Add support for parsing and emitting class expressions.#2567
Merged
Conversation
This type represents the expression+type arguments you can get in a class or interface heritage clause section. For class-implements clauses, or interface-extends clauses, these expressions can only be identifiers or dotted names. For class extends clauses, these could be any expressions in the future. However, for now, we only support identifiers and dotted names.
fc61772 to
b363a45
Compare
Contributor
Author
There was a problem hiding this comment.
Can someone suggest a better name for this? :)
Contributor
There was a problem hiding this comment.
can we mention that it can be identifiers\qualified names with optional type arguments?
CyrusNajmabadi
added a commit
that referenced
this pull request
Apr 1, 2015
Add support for parsing and emitting class expressions.
Contributor
There was a problem hiding this comment.
I really do not like this name. why do we need it here? why can not we just have getTypeOfNode?
Merged
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.
Currently class expressions are not typechecked. We'll have to figure out how we want to appropriately design things there.
Parsing and emitting of class expressions themselves was not too hard. The most difficult part was changing things to support arbitrary expressions in the 'heritage' clause sections of a class. Parsing here was not bad. However, it did mean further parts of the typechecker and services layer needed to become aware of this new shape for the AST.