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". |
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