Inherit construct signature from extended interface#5934
Merged
sandersn merged 5 commits intoDec 4, 2015
Conversation
In recursiveBaseConstructorCreator3, the error message has improved to match the originally intended error.
Contributor
There was a problem hiding this comment.
it feels like a cascading error
Member
Author
There was a problem hiding this comment.
I'll see if I can avoid emitting it.
Member
Author
There was a problem hiding this comment.
I can get back to the old behaviour without too much trouble. I'll see if I can also get rid of the "Property 'foo' does not exist on type 'xyz'" as well.
Member
Author
There was a problem hiding this comment.
Actually, I think I'll merge this the way it is. All the things I've tried so far to prevent cascading errors happen way before resolveNewExpression even gets to calling getDefaultConstructSignatures. So that change is going to be unrelated to and quite a bit more complicated than this fix.
sandersn
added a commit
that referenced
this pull request
Dec 4, 2015
…rom-extended-interface Inherit construct signature from extended interface
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5864. Previously, when a class had no constructors,
getDefaultConstructSignatureonly checked class base types for constructors. Now it checks all types that the class extends.The performance should be about the same -- the original guard called
getBaseTypeswhich callsgetBaseConstructorTypeOfClass. The new code callsgetBaseConstructorTypeOfClassup-front and then guards on the number of signatures.This change improves the error message of an existing test which previously was not the desired message according to the comment in the text of the test.