mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-22 12:03:44 -05:00
Merge branch 'noErrorTruncation' of https://github.com/gcnew/TypeScript into gcnew-noErrorTruncation
# Conflicts: # src/compiler/diagnosticMessages.json
This commit is contained in:
@@ -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;
|
||||
Reference in New Issue
Block a user