Merge branch 'gcnew-noErrorTruncation'

This commit is contained in:
Mohamed Hegazy 2016-08-17 14:22:12 -07:00
commit 73a64888f0
4 changed files with 62 additions and 0 deletions

View file

@ -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",

View 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;

View 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;

View 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;