-
Notifications
You must be signed in to change notification settings - Fork 137
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
Make macro configs static #1815
Conversation
21ab0eb
to
c46b5b0
Compare
? maybeFastbootMemberExpression.get('property') | ||
: maybeFastbootMemberExpression.isOptionalMemberExpression() | ||
? maybeFastbootMemberExpression.get('property') | ||
: assertNever(maybeFastbootMemberExpression); |
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 looks weird, but I found no better way to make TS happy. I had it first as simple as this:
You see the return type of .get('property')
is not correct, it cannot be an array of NodePath
, that makes no sense...
Those tertiary expressions narrow down the type before hitting .get()
to make it return the correct type.
The type definition of .get()
would not deal well with a union type (NodePath<MemberExpression> | NodePath<OptionalMemeberExpression>
it seems, falling back to the second loosely typed one:
That tertiary expression would narrow down the type before hitting .get()
, returning the expected correct type.
Failing tests are the same as those on master, fixed in #1817... |
…me implementation
c46b5b0
to
183dd97
Compare
Fixes #1804