Skip to content
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

contextualType is always undefined #101

Open
OliverJAsh opened this issue Sep 16, 2022 · 1 comment
Open

contextualType is always undefined #101

OliverJAsh opened this issue Sep 16, 2022 · 1 comment

Comments

@OliverJAsh
Copy link

According to the viewer, there is no contextualType for this selection. However when I use the TS compiler API in my script, this Node does have a contextual type (accessed via checker.getContextualType(objectLiteralExpression)).

https://ts-ast-viewer.com/#code/CYUwxgNghgTiAEYD2A7AzgF3gMwFzwAoAPfAb3gAcYkL8UBXAWwCMQZ4BfASngF4A+ePRQBrFEgDuKANwAobAXJUa+AIycu0oA

image

@dsherret
Copy link
Owner

dsherret commented Sep 16, 2022

@OliverJAsh I think that internal property is just a cached value on the Node, so it displaying undefined there seems correct in that it’s just displaying the property values of the node. Maybe it would be useful to show the contextual type in the output elsewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants