π Search Terms
transpileDeclaration globals
π Version & Regression Information
- This changed between versions 5.4 and 5.5 beta
β― Playground Link
Playground
π» Code
// @declaration:true
// @emitDeclarationOnly: true
// @fileName: globals.ts
type MissingGlobalType = "global";
declare const missingGlobalValue: "A";
// @fileName: index.ts
// this test assumes there is some global definitions for MissingGlobalType and missingGlobalValue that are not available to transpileDeclaration
export const x: MissingGlobalType = null!;
export const fn = (a: MissingGlobalType): MissingGlobalType => null!;
export const fn2 = (a: MissingGlobalType) => null! as MissingGlobalType;
export const x2: typeof missingGlobalValue = null!;
export const fn3 = (a: typeof missingGlobalValue): typeof missingGlobalValue => null!;
export const fn4 = (a: typeof missingGlobalValue) => null! as typeof missingGlobalValue;
export const o : {
[missingGlobalValue]: string
} = null!;
π Actual behavior
trasnpileDeclaration will return errors since it can't find MissingGlobalType and missingGlobalValue
π Expected behavior
trasnpileDeclaration should not error or missing symbols. It does not have enough information to know if that symbol is resolvable.
Additional information about the issue
No response
π Search Terms
transpileDeclaration globals
π Version & Regression Information
β― Playground Link
Playground
π» Code
π Actual behavior
trasnpileDeclarationwill return errors since it can't findMissingGlobalTypeandmissingGlobalValueπ Expected behavior
trasnpileDeclarationshould not error or missing symbols. It does not have enough information to know if that symbol is resolvable.Additional information about the issue
No response