-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
[ID-Prep] PR5 - Preserve type nodes from function like expression in declaration emit #57678
[ID-Prep] PR5 - Preserve type nodes from function like expression in declaration emit #57678
Conversation
…eclrations-from-assertions
…d arrow functions.
c8462ed
to
cd7636d
Compare
return { accessibility: SymbolAccessibility.Accessible }; | ||
} | ||
|
||
// Parameters or binding elements from parameters are always visible in their enclosing function declarations |
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.
The checker complained about the parameter name not being accessible (since arrow functions are not themselves marked as visible by determineIfDeclarationIsVisible
.
@@ -48160,13 +48177,25 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { | |||
hasSyntacticModifier(parameter, ModifierFlags.ParameterPropertyModifier); | |||
} | |||
|
|||
function isExpandoFunctionDeclaration(node: Declaration): boolean { | |||
const declaration = getParseTreeNode(node, isFunctionDeclaration); | |||
function isExpandoFunctionDeclaration(node: FunctionDeclaration | VariableDeclaration): boolean { |
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.
Both function and variable declarations will now be tested. We can't reliably determine the type for an expando functions variable from just it's declaration so we fall back on the type checker.
Fixes #57677