-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Conditionally mark getter/setter implementations virtual in generated classes #8303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conditionally mark getter/setter implementations virtual in generated classes #8303
Conversation
When implementing interfaces, PowerShell incorrectly produces non-virtual get/set methods for interface-defined properties. This commit adds a lookup method for interface-defined properties and marks get/set methods for properties with matching signatures virtual.
|
I have a two-year-old commit that supports getters/setters (MSFT team had a plan to enhance class support before 6.1 release but it was postponed and I'm already tired to rebase the commit every month :-) ) and I could add it there since this code has been significantly modified. @IISResetMe Please add tests and fix CodeFactor issues. |
|
@iSazonov if you have anything that's either more correct, complete or aesthetically pleasing, please feel free to update the PR :) |
|
@IISResetMe My post was informational. If you commit will approved I can grab it to my branch or rebase my branch. |
94deaef to
4c6b908
Compare
|
@iSazonov Fixed the CodeFactor issues in |
|
We ignore "Complex Method". |
test/powershell/Language/Classes/scripting.Classes.inheritance.tests.ps1
Outdated
Show resolved
Hide resolved
test/powershell/Language/Classes/scripting.Classes.inheritance.tests.ps1
Outdated
Show resolved
Hide resolved
c544123 to
f1b54df
Compare
Build tests currently failing because the interface property test is missing an instance of the test class to inspect
f1b54df to
699f56c
Compare
|
Reopen to restart Appveyor CI., |
|
@IISResetMe Thanks for your contribution! |
Fix #8302
When implementing interfaces, PowerShell incorrectly produces non-virtual get/set methods for interface-defined properties.
This commit adds a lookup method for interface-defined properties and marks get/set methods for properties with matching signatures virtual.
PR Summary
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:to the beginning of the title and remove the prefix when the PR is ready.[feature]if the change is significant or affects feature testsI'm unsure how to meaningfully add tests to prevent regression for this