Skip to content

Conversation

@IISResetMe
Copy link
Collaborator

@IISResetMe IISResetMe commented Nov 17, 2018

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

I'm unsure how to meaningfully add tests to prevent regression for this

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.
@iSazonov
Copy link
Collaborator

iSazonov commented Nov 18, 2018

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.

@IISResetMe
Copy link
Collaborator Author

@iSazonov if you have anything that's either more correct, complete or aesthetically pleasing, please feel free to update the PR :)

@iSazonov
Copy link
Collaborator

@IISResetMe My post was informational. If you commit will approved I can grab it to my branch or rebase my branch.

@IISResetMe IISResetMe force-pushed the patch/virtual-interface-properties branch from 94deaef to 4c6b908 Compare November 21, 2018 13:04
@IISResetMe
Copy link
Collaborator Author

@iSazonov Fixed the CodeFactor issues in ShouldImplementProperty() but I'm unsure what to do with the "Complex Method" finding for EmitPropertyIL()

@iSazonov
Copy link
Collaborator

We ignore "Complex Method".

@IISResetMe IISResetMe force-pushed the patch/virtual-interface-properties branch from c544123 to f1b54df Compare November 21, 2018 14:33
Build tests currently failing because the interface property test is missing
an instance of the test class to inspect
@IISResetMe IISResetMe force-pushed the patch/virtual-interface-properties branch from f1b54df to 699f56c Compare November 21, 2018 15:15
@iSazonov iSazonov closed this Nov 22, 2018
@iSazonov
Copy link
Collaborator

Reopen to restart Appveyor CI.,

@iSazonov iSazonov reopened this Nov 22, 2018
@iSazonov iSazonov self-assigned this Nov 30, 2018
@iSazonov iSazonov added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Nov 30, 2018
@iSazonov iSazonov merged commit 950377f into PowerShell:master Nov 30, 2018
@iSazonov
Copy link
Collaborator

@IISResetMe Thanks for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generated get/set methods incorrectly marked non-virtual

3 participants