Validate import namespace specified functions properly #143
Labels
Runtime
type assertions
Everything related to type assertions.
typings
Everything related to type declarations
This error is caused by:
RuntimeTypeInspector.js/src-runtime/inspectType.js
Lines 21 to 34 in 3ec2e10
Clearly the instance of a class isn't a function - otherwise the logic works for other primitive types like numbers.
So I need some special casing for the case of
importNamespaceSpecifiers[a][b].constructor
We may be tempted to use
importNamespaceSpecifiers[a][b].name
, but I don't think this goes far enough - after all you can make nameless classes/functions:Or in more familiar terms:
Output:
It seems that TypeScript is itself confused:
Error:
Right now I'm tempted to imply that any import namespace specifier function assumes an object with given function as prototype:
The text was updated successfully, but these errors were encountered: