Files
tsgo/testdata/baselines/reference/tsc/noEmit/dts-errors.js
bbdf7a24be Restore tsgo noEmit exit status semantics (#4407)
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: jakebailey <[email protected]>
Co-authored-by: weswigham <[email protected]>
2026-08-13 20:58:47 +00:00

4.2 KiB

currentDirectory::/home/src/projects/project
useCaseSensitiveFileNames::true
Input::
//// [/home/src/projects/project/a.ts] *new*
const a = class { private p = 10; };
//// [/home/src/projects/project/tsconfig.json] *new*
{
"compilerOptions": {
"incremental": false,
"declaration": true
}
}
 
tsgo --noEmit
ExitStatus:: DiagnosticsPresent_OutputsGenerated
Output::
a.ts:1:7 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected.
 
1 const a = class { private p = 10; };
~
 
a.ts:1:7 - Add a type annotation to the variable a.
1 const a = class { private p = 10; };
~
 
 
Found 1 error in a.ts:1
 
//// [/home/src/tslibs/TS/Lib/lib.es2025.full.d.ts] *Lib*
/// <reference no-default-lib="true"/>
interface Boolean {}
interface Function {}
interface CallableFunction {}
interface NewableFunction {}
interface IArguments {}
interface Number { toExponential: any; }
interface Object {}
interface RegExp {}
interface String { charAt: any; }
interface Array<T> { length: number; [n: number]: T; }
interface ReadonlyArray<T> {}
interface SymbolConstructor {
(desc?: string | number): symbol;
for(name: string): symbol;
readonly toStringTag: symbol;
}
declare var Symbol: SymbolConstructor;
interface Symbol {
readonly [Symbol.toStringTag]: string;
}
declare const console: { log(msg: any): void; };
 
 
 
Edit [0]:: no change
 
tsgo --noEmit
ExitStatus:: DiagnosticsPresent_OutputsGenerated
Output::
a.ts:1:7 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected.
 
1 const a = class { private p = 10; };
~
 
a.ts:1:7 - Add a type annotation to the variable a.
1 const a = class { private p = 10; };
~
 
 
Found 1 error in a.ts:1
 
 
 
 
Edit [1]:: Fix error
//// [/home/src/projects/project/a.ts] *modified*
const a = "hello";
 
tsgo --noEmit
ExitStatus:: Success
Output::
 
 
 
Edit [2]:: no change
 
tsgo --noEmit
ExitStatus:: Success
Output::
 
 
 
Edit [3]:: Emit after fixing error
 
tsgo
ExitStatus:: Success
Output::
//// [/home/src/projects/project/a.d.ts] *new*
declare const a = "hello";
//// [/home/src/projects/project/a.js] *new*
"use strict";
const a = "hello";
 
 
 
 
Edit [4]:: no change
 
tsgo --noEmit
ExitStatus:: Success
Output::
 
 
 
Edit [5]:: Introduce error
//// [/home/src/projects/project/a.ts] *modified*
const a = class { private p = 10; };
 
tsgo --noEmit
ExitStatus:: DiagnosticsPresent_OutputsGenerated
Output::
a.ts:1:7 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected.
 
1 const a = class { private p = 10; };
~
 
a.ts:1:7 - Add a type annotation to the variable a.
1 const a = class { private p = 10; };
~
 
 
Found 1 error in a.ts:1
 
 
 
 
Edit [6]:: Emit when error
 
tsgo
ExitStatus:: DiagnosticsPresent_OutputsSkipped
Output::
a.ts:1:7 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected.
 
1 const a = class { private p = 10; };
~
 
a.ts:1:7 - Add a type annotation to the variable a.
1 const a = class { private p = 10; };
~
 
 
Found 1 error in a.ts:1
 
//// [/home/src/projects/project/a.js] *modified*
"use strict";
const a = class {
p = 10;
};
 
 
 
 
Edit [7]:: no change
 
tsgo --noEmit
ExitStatus:: DiagnosticsPresent_OutputsGenerated
Output::
a.ts:1:7 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected.
 
1 const a = class { private p = 10; };
~
 
a.ts:1:7 - Add a type annotation to the variable a.
1 const a = class { private p = 10; };
~
 
 
Found 1 error in a.ts:1