Skip to content
This repository has been archived by the owner on Oct 15, 2018. It is now read-only.

Type assignment checking? #201

Open
MeirionHughes opened this issue Oct 18, 2016 · 1 comment
Open

Type assignment checking? #201

MeirionHughes opened this issue Oct 18, 2016 · 1 comment
Labels

Comments

@MeirionHughes
Copy link

MeirionHughes commented Oct 18, 2016

Does this library have support for checking if one Type is assignable to another (via reflection)?

I've been looking through the main typescript code, and it seems all the checking code is hidden from the main library (checker.ts is marked internal). :/

@dsherret
Copy link
Owner

dsherret commented Oct 19, 2016

Sorry, it's not possible at the moment. There is an option to expose the nodes from the compiler (see Include tsNodes). Using that and the type checker you should be able to get the types and then check if one type is assignable to another... I'm not sure how to check if one type is assignable to another though because I've never looked into it.

Also, I've opened #202 to add a flag to include the compiler types... that way the types this library returns will have a property with the corresponding internal typescript compiler type on it so you don't manually have to get it from the nodes.

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

No branches or pull requests

2 participants