-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Closed
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug
Description
TypeScript Version: 3.8.1-rc and nightly (3.8.0-dev.20200207)
Search Terms:
Individual declarations in merged declaration
Code
Two files:
// ns.ts
export type Type = {greet: string}
export function hello(input: Type) {
console.log(input.greet)
}// use.ts
import * as Greeting from './ns'
export type Greeting = Greeting.Type
export {Greeting}Expected behavior:
Expected that this compiles and users can refer to Greeting as both the type {greet: string} and the namespace of functions/data (just hello in this case). In versions 3.7.5 and 3.8.0-beta, this was OK.
Actual behavior:
3.8.1-rc and current nightly produce these errors:
use.ts:1:13 - error TS2395: Individual declarations in merged declaration 'Greeting' must be all exported or all local.
1 import * as Greeting from './ns'
~~~~~~~~
use.ts:3:13 - error TS2395: Individual declarations in merged declaration 'Greeting' must be all exported or all local.
3 export type Greeting = Greeting.Type
~~~~~~~~
Metadata
Metadata
Assignees
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug