You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pretty sure you're augmenting a globally available Image via some defaultly available DOM types.
AFAIK the locally defined Image should shadow the global one. That's what it seems to do when I run the code.
This is a minimal reproduction from real code in @pulumi/aws which I don't think does the correct thing at runtime although I haven't checked this specific instance.
I did some debugging and it gets to resolveNameHelper in the type checker and it traverses up to the SourceFileObject. canHaveLocals returns true but the location.locals is empty for some reason. It looks like if it wasn't empty then it would attempt to lookup from these locals first. Only if it doesn't find it here does it look for it in the globals.
Although even if locals was not empty it fails the !isGlobalSourceFile(location) check. Perhaps I need to get it to treat it as a ModuleDefinition instead? Not sure how to do that.
Describe the bug
Version: 22.0.0
To Reproduce
Reproduction: https://github.com/steinybot/bug-reports/tree/ts-morph/wrong-get-type
Expected behavior
It should log
typeof Image
but it logsnew (width?: number, height?: number) => HTMLImageElement
The text was updated successfully, but these errors were encountered: