Skip to content

Fix crash in name resolution with custom transforms and emitDecoratorMetadata#18051

Merged
rbuckton merged 1 commit into
masterfrom
fix17551
Aug 25, 2017
Merged

Fix crash in name resolution with custom transforms and emitDecoratorMetadata#18051
rbuckton merged 1 commit into
masterfrom
fix17551

Conversation

@rbuckton
Copy link
Copy Markdown
Contributor

Fixes #17551

Copy link
Copy Markdown
Member

@weswigham weswigham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine, one comment, but it's not really important.

Comment thread src/compiler/checker.ts

function getTypeReferenceSerializationKind(typeName: EntityName, location?: Node): TypeReferenceSerializationKind {
// ensure both `typeName` and `location` are parse tree nodes.
typeName = getParseTreeNode(typeName, isEntityName);
Copy link
Copy Markdown
Member

@weswigham weswigham Aug 25, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems needlessly conservative - resolveEntityName does not use parent pointers on the name argument if location is present - it just draws the names to lookup from it. I don't think it strictly needs to be a parse tree node (and more importantly, couldn't a transform morph one name into another? Shouldn't that be resolved, so the serialized kind also reflects the transformation?)?

Probably too much of an edge case to care about until someone asks for it, anyway.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather guard against it in any event.

@rbuckton rbuckton merged commit eb75619 into master Aug 25, 2017
@rbuckton
Copy link
Copy Markdown
Contributor Author

This has also been ported to release-2.5

@rbuckton rbuckton deleted the fix17551 branch August 25, 2017 22:15
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants