codemix / babel-plugin-typecheck

Static and runtime type checking for JavaScript in the form of a Babel plugin.
MIT License
886 stars 44 forks source link

importing & exporting types does not work as expected #80

Closed bdchauvette closed 8 years ago

bdchauvette commented 8 years ago

When I use an imported type, the code uses an instanceof check instead of using the imported type checking function

Following the example code from #46, I put together a gist that shows the unexpected transform.

If I define the types within the same file, though, everything works great.

I'm probably doing something wrong, because importing and exporting works just fine in the babel-plugin-typecheck test suite. :confused:

phpnode commented 8 years ago

It's a babel bug unfortunately, and it's very annoying/concerning that it works in the test suite,

Thanks for the gist, I'll add it to https://phabricator.babeljs.io/T6730

bdchauvette commented 8 years ago

That's a shame :/

Thanks for the quick reply, though! :smile: