Closed
Description
TypeScript Version: 3.8 RC – nightly
Search Terms: declares locally but not exported
Code
// a.ts
class Foo {}
export = Foo;
// b.ts
import { Foo } from './a';
Expected behavior:
Module "./a" has no exported member 'Foo'
(pre-3.8 message), or better yet, using context to pick between one of these specialized messages:
- TS, module kind < es2015, allowSynthetic off:
'Foo' can only be imported by using 'import Foo = require(...)' or by turning on the 'allowSyntheticDefaultImports' flag and using a default import.
- TS, module kind < es2015, allowSynthetic on:
'Foo' can only be imported by using 'import Foo = require(...)' or a default import.
- TS or JS, module kind >= es2015, allowSynthetic off:
'Foo' can only be imported by turning on the 'allowSyntheticDefaultImports' flag and using a default import.
- TS or JS, module kind >= es2015, allowSynthetic on:
'Foo' can only be imported by using a default import.
- JS, module kind < es2015, allowSynthetic off:
'Foo' can only be imported by using a 'require' call or by turning on the 'allowSyntheticDefaultImports' flag and using a default import.
- JS, module kind < es2015, allowSynthetic on: `'Foo' can only be imported by using a 'require' call or by using a default import.'
Actual behavior:
Module '"./a"' declares 'Foo' locally, but it is not exported.
Related Issues: PR: #36187