Merge branch 'gcnew-noErrorTruncation'
This commit is contained in:
commit
73a64888f0
4 changed files with 62 additions and 0 deletions
|
@ -126,6 +126,10 @@ namespace ts {
|
|||
type: "boolean",
|
||||
description: Diagnostics.Do_not_emit_outputs_if_any_errors_were_reported,
|
||||
},
|
||||
{
|
||||
name: "noErrorTruncation",
|
||||
type: "boolean"
|
||||
},
|
||||
{
|
||||
name: "noImplicitAny",
|
||||
type: "boolean",
|
||||
|
|
22
tests/baselines/reference/noErrorTruncation.errors.txt
Normal file
22
tests/baselines/reference/noErrorTruncation.errors.txt
Normal file
|
@ -0,0 +1,22 @@
|
|||
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; }'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/noErrorTruncation.ts (1 errors) ====
|
||||
// @noErrorTruncation
|
||||
|
||||
type SomeLongOptionA = { someLongOptionA: string }
|
||||
type SomeLongOptionB = { someLongOptionB: string }
|
||||
type SomeLongOptionC = { someLongOptionC: string }
|
||||
type SomeLongOptionD = { someLongOptionD: string }
|
||||
type SomeLongOptionE = { someLongOptionE: string }
|
||||
type SomeLongOptionF = { someLongOptionF: string }
|
||||
|
||||
const x: SomeLongOptionA
|
||||
~
|
||||
!!! error TS2322: Type 'number' is not assignable to type '{ someLongOptionA: string; } | { someLongOptionB: string; } | { someLongOptionC: string; } | { someLongOptionD: string; } | { someLongOptionE: string; } | { someLongOptionF: string; }'.
|
||||
| SomeLongOptionB
|
||||
| SomeLongOptionC
|
||||
| SomeLongOptionD
|
||||
| SomeLongOptionE
|
||||
| SomeLongOptionF = 42;
|
||||
|
21
tests/baselines/reference/noErrorTruncation.js
Normal file
21
tests/baselines/reference/noErrorTruncation.js
Normal file
|
@ -0,0 +1,21 @@
|
|||
//// [noErrorTruncation.ts]
|
||||
// @noErrorTruncation
|
||||
|
||||
type SomeLongOptionA = { someLongOptionA: string }
|
||||
type SomeLongOptionB = { someLongOptionB: string }
|
||||
type SomeLongOptionC = { someLongOptionC: string }
|
||||
type SomeLongOptionD = { someLongOptionD: string }
|
||||
type SomeLongOptionE = { someLongOptionE: string }
|
||||
type SomeLongOptionF = { someLongOptionF: string }
|
||||
|
||||
const x: SomeLongOptionA
|
||||
| SomeLongOptionB
|
||||
| SomeLongOptionC
|
||||
| SomeLongOptionD
|
||||
| SomeLongOptionE
|
||||
| SomeLongOptionF = 42;
|
||||
|
||||
|
||||
//// [noErrorTruncation.js]
|
||||
// @noErrorTruncation
|
||||
var x = 42;
|
15
tests/cases/compiler/noErrorTruncation.ts
Normal file
15
tests/cases/compiler/noErrorTruncation.ts
Normal file
|
@ -0,0 +1,15 @@
|
|||
// @noErrorTruncation
|
||||
|
||||
type SomeLongOptionA = { someLongOptionA: string }
|
||||
type SomeLongOptionB = { someLongOptionB: string }
|
||||
type SomeLongOptionC = { someLongOptionC: string }
|
||||
type SomeLongOptionD = { someLongOptionD: string }
|
||||
type SomeLongOptionE = { someLongOptionE: string }
|
||||
type SomeLongOptionF = { someLongOptionF: string }
|
||||
|
||||
const x: SomeLongOptionA
|
||||
| SomeLongOptionB
|
||||
| SomeLongOptionC
|
||||
| SomeLongOptionD
|
||||
| SomeLongOptionE
|
||||
| SomeLongOptionF = 42;
|
Loading…
Reference in a new issue