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
Shadowed import bindings require cross-file knowledge even with isolatedModules
#58131
Comments
You forgot colons in your bug workbench compiler options. The behavior youβre looking for already exists: https://www.typescriptlang.org/dev/bug-workbench/?isolatedModules=true&verbatimModuleSyntax=true&ts=5.4.4#code/PTAEAEGcAsHsHcCiBbAlgFwFAggQwDby4CekAyugE6oDG6AXKFQK4Cm2Y4qks+u6rACYBZWIOb5WkRi3Y5wAN1aUARv1TJR4yWWIA7dLgAeMym0wdOAM1SS9uZK0ZXYsAHTpImVkYAOsSnQmYl9WUAAxV1AAXlAAbwBfAG5vPwCgmlg9SCCAIVxKGPjkixBrW1Z7R0ZUPUEfDy8Nf0D4iNcAGlB8woTQK0pYZFAAcjdgF1gRiytmPTpULPbYAAoASmLMWfn0Rb1ugvXNzCA |
Oh thanks π |
Thanks π |
Also, tip: |
π Search Terms
isolatedModules import duplicate
π Version & Regression Information
β― Playground Link
https://www.typescriptlang.org/dev/bug-workbench/?ts=5.4.4#code/PTAEAEGcAsHsHcCiBbAlgFwFAggQwDby4CekAyugE6oDG6oVArgKbZjiqSz67rMAmAWVj9G+ZpAaUWbCADdmlAEa9UyYaPFliAO3S4AHlJlt2AM1TiduZMwBcoM7FgA6dJEzMDAB1iV66MTezKAAYs6gALygAN4AvgDcnj5+9DSwOpD0AEK4lFGxiZimEBZWNvagqDr8Xm4ear7+sWHOADSguflxjpSwyKAA5C7ATrCDxWaMOnSoGa2wABQAlIWYUzPoczqdeStrmEA
π» Code
π Actual behavior
TS complains about the redeclaration of
Bar
but not about the redeclaration ofFoo
π Expected behavior
Given that inside
index.ts
Foo
andBar
are used exactly the same way, they both should be an error (or both allowed, but it's less desirable).Additional information about the issue
This was originally reported to Babel at babel/babel#16423, but we cannot match the TS semantics because they require cross-file knowledge (and
isolatedModules
is supposed to prevent that).The text was updated successfully, but these errors were encountered: