Skip to content

Commit 73a6488

Browse files
committed
Merge branch 'gcnew-noErrorTruncation'
2 parents 4880e7e + 5843bbb commit 73a6488

File tree

4 files changed

+62
-0
lines changed

4 files changed

+62
-0
lines changed

src/compiler/commandLineParser.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@ namespace ts {
126126
type: "boolean",
127127
description: Diagnostics.Do_not_emit_outputs_if_any_errors_were_reported,
128128
},
129+
{
130+
name: "noErrorTruncation",
131+
type: "boolean"
132+
},
129133
{
130134
name: "noImplicitAny",
131135
type: "boolean",
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
tests/cases/compiler/noErrorTruncation.ts(10,7): error TS2322: Type 'number' is not assignable to type '{ someLongOptionA: string; } | { someLongOptionB: string; } | { someLongOptionC: string; } | { someLongOptionD: string; } | { someLongOptionE: string; } | { someLongOptionF: string; }'.
2+
3+
4+
==== tests/cases/compiler/noErrorTruncation.ts (1 errors) ====
5+
// @noErrorTruncation
6+
7+
type SomeLongOptionA = { someLongOptionA: string }
8+
type SomeLongOptionB = { someLongOptionB: string }
9+
type SomeLongOptionC = { someLongOptionC: string }
10+
type SomeLongOptionD = { someLongOptionD: string }
11+
type SomeLongOptionE = { someLongOptionE: string }
12+
type SomeLongOptionF = { someLongOptionF: string }
13+
14+
const x: SomeLongOptionA
15+
~
16+
!!! error TS2322: Type 'number' is not assignable to type '{ someLongOptionA: string; } | { someLongOptionB: string; } | { someLongOptionC: string; } | { someLongOptionD: string; } | { someLongOptionE: string; } | { someLongOptionF: string; }'.
17+
| SomeLongOptionB
18+
| SomeLongOptionC
19+
| SomeLongOptionD
20+
| SomeLongOptionE
21+
| SomeLongOptionF = 42;
22+
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
//// [noErrorTruncation.ts]
2+
// @noErrorTruncation
3+
4+
type SomeLongOptionA = { someLongOptionA: string }
5+
type SomeLongOptionB = { someLongOptionB: string }
6+
type SomeLongOptionC = { someLongOptionC: string }
7+
type SomeLongOptionD = { someLongOptionD: string }
8+
type SomeLongOptionE = { someLongOptionE: string }
9+
type SomeLongOptionF = { someLongOptionF: string }
10+
11+
const x: SomeLongOptionA
12+
| SomeLongOptionB
13+
| SomeLongOptionC
14+
| SomeLongOptionD
15+
| SomeLongOptionE
16+
| SomeLongOptionF = 42;
17+
18+
19+
//// [noErrorTruncation.js]
20+
// @noErrorTruncation
21+
var x = 42;
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// @noErrorTruncation
2+
3+
type SomeLongOptionA = { someLongOptionA: string }
4+
type SomeLongOptionB = { someLongOptionB: string }
5+
type SomeLongOptionC = { someLongOptionC: string }
6+
type SomeLongOptionD = { someLongOptionD: string }
7+
type SomeLongOptionE = { someLongOptionE: string }
8+
type SomeLongOptionF = { someLongOptionF: string }
9+
10+
const x: SomeLongOptionA
11+
| SomeLongOptionB
12+
| SomeLongOptionC
13+
| SomeLongOptionD
14+
| SomeLongOptionE
15+
| SomeLongOptionF = 42;

0 commit comments

Comments
 (0)