Improve type of Statement#parent#22052
Closed
ghost wants to merge 7 commits into
Closed
Conversation
ajafff
suggested changes
Feb 20, 2018
|
|
||
| /** Type for statements that appear only in statement position. */ | ||
| export interface StatementOnly extends Statement { | ||
| parent?: Block | CaseClause | DefaultClause | SourceFile | ModuleBlock | LabeledStatement; |
Contributor
There was a problem hiding this comment.
- IfStatement | WithStatement | IterationStatement
7c33318 to
5b119d0
Compare
5b119d0 to
6d46beb
Compare
Author
mhegazy
reviewed
Feb 22, 2018
| } | ||
|
|
||
| /** Type for statements that appear only in statement position. */ | ||
| export interface StatementOnly extends Statement { |
Contributor
There was a problem hiding this comment.
Can we split off MissingDeclaration instead of having to create this type?
Author
There was a problem hiding this comment.
Turns out MissingDeclaration has some supertypes it doesn't need. See #23485.
Collaborator
|
Thanks for your contribution. This PR has not been updated in a while and cannot be automatically merged at the time being. For housekeeping purposes we are closing stale PRs. If you'd still like to continue working on this PR, please leave a message and one of the maintainers can reopen it. |
aefcf46 to
1aa7a32
Compare
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.
Unfortunately,
MissingDeclarationmultiply inherits fromDeclarationStatementand from three other types that aren't statements. So had to create aStatementOnlytype for things that only occur in statement position.