-
Notifications
You must be signed in to change notification settings - Fork 12.9k
A merged interface with an inherited member should satisfy an abstract base class member #32539
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
Conversation
…t base class member
if (baseDeclarationFlags & ModifierFlags.Private || derivedDeclarationFlags & ModifierFlags.Private) { | ||
// either base or derived property is private - not override, skip it | ||
continue; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This diff is really wonky if you don’t have “Hide whitespace changes” turned on.
@typescript-bot test this |
Heya @andrewbranch, I've started to run the extended test suite on this PR at 2ed1beb. You can monitor the build here. It should now contribute to this PR's status checks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ... guess? It's weird that the implementing property needs to be identical to the abstract one instead of a subtype. That is, a normal subtype can say bar: 12 = 12
but the property from the merged interface has to be exactly the same type.
abstract
is not a principled concept anyway, so a squishy gut check is about the best we can do.
Fixes #31905
I kind of expected this to be fixed by a single insertion of
getMergedSymbol
somewhere, but it seems thatresolveObjectTypeMembers
(which is called bygetPropertyOfType
), when copying members from base types, just skips over any member with the same name as one that has already been resolved. In the linked issue / test case, theabstract BaseClass
is closer thanIGetters
, so its members get copied to the type, and then whenIGetters
’ members get copied, it’s a no-op becausebar
already exists. So—is there an existing function that says “get me all the symbols that represent this property,” rather than just the closest?