Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve diagnostics deduplication 2 (#58318)
- Loading branch information
Showing
15 changed files
with
310 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
tests/baselines/reference/duplicateErrorAssignability.errors.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
duplicateErrorAssignability.ts(10,11): error TS2741: Property 'x' is missing in type 'B' but required in type 'A'. | ||
duplicateErrorAssignability.ts(12,5): error TS2538: Type 'B' cannot be used as an index type. | ||
|
||
|
||
==== duplicateErrorAssignability.ts (2 errors) ==== | ||
interface A { | ||
x: number; | ||
} | ||
interface B { | ||
y: string; | ||
} | ||
|
||
declare let b: B; | ||
declare let a: A; | ||
const x = a = b; | ||
~ | ||
!!! error TS2741: Property 'x' is missing in type 'B' but required in type 'A'. | ||
!!! related TS2728 duplicateErrorAssignability.ts:2:5: 'x' is declared here. | ||
let obj: { 3: string } = { 3: "three" }; | ||
obj[x]; | ||
~ | ||
!!! error TS2538: Type 'B' cannot be used as an index type. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
//// [tests/cases/compiler/duplicateErrorAssignability.ts] //// | ||
|
||
//// [duplicateErrorAssignability.ts] | ||
interface A { | ||
x: number; | ||
} | ||
interface B { | ||
y: string; | ||
} | ||
|
||
declare let b: B; | ||
declare let a: A; | ||
const x = a = b; | ||
let obj: { 3: string } = { 3: "three" }; | ||
obj[x]; | ||
|
||
//// [duplicateErrorAssignability.js] | ||
"use strict"; | ||
var x = a = b; | ||
var obj = { 3: "three" }; | ||
obj[x]; |
38 changes: 38 additions & 0 deletions
38
tests/baselines/reference/duplicateErrorAssignability.symbols
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
//// [tests/cases/compiler/duplicateErrorAssignability.ts] //// | ||
|
||
=== duplicateErrorAssignability.ts === | ||
interface A { | ||
>A : Symbol(A, Decl(duplicateErrorAssignability.ts, 0, 0)) | ||
|
||
x: number; | ||
>x : Symbol(A.x, Decl(duplicateErrorAssignability.ts, 0, 13)) | ||
} | ||
interface B { | ||
>B : Symbol(B, Decl(duplicateErrorAssignability.ts, 2, 1)) | ||
|
||
y: string; | ||
>y : Symbol(B.y, Decl(duplicateErrorAssignability.ts, 3, 13)) | ||
} | ||
|
||
declare let b: B; | ||
>b : Symbol(b, Decl(duplicateErrorAssignability.ts, 7, 11)) | ||
>B : Symbol(B, Decl(duplicateErrorAssignability.ts, 2, 1)) | ||
|
||
declare let a: A; | ||
>a : Symbol(a, Decl(duplicateErrorAssignability.ts, 8, 11)) | ||
>A : Symbol(A, Decl(duplicateErrorAssignability.ts, 0, 0)) | ||
|
||
const x = a = b; | ||
>x : Symbol(x, Decl(duplicateErrorAssignability.ts, 9, 5)) | ||
>a : Symbol(a, Decl(duplicateErrorAssignability.ts, 8, 11)) | ||
>b : Symbol(b, Decl(duplicateErrorAssignability.ts, 7, 11)) | ||
|
||
let obj: { 3: string } = { 3: "three" }; | ||
>obj : Symbol(obj, Decl(duplicateErrorAssignability.ts, 10, 3)) | ||
>3 : Symbol(3, Decl(duplicateErrorAssignability.ts, 10, 10)) | ||
>3 : Symbol(3, Decl(duplicateErrorAssignability.ts, 10, 26)) | ||
|
||
obj[x]; | ||
>obj : Symbol(obj, Decl(duplicateErrorAssignability.ts, 10, 3)) | ||
>x : Symbol(x, Decl(duplicateErrorAssignability.ts, 9, 5)) | ||
|
52 changes: 52 additions & 0 deletions
52
tests/baselines/reference/duplicateErrorAssignability.types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
//// [tests/cases/compiler/duplicateErrorAssignability.ts] //// | ||
|
||
=== duplicateErrorAssignability.ts === | ||
interface A { | ||
x: number; | ||
>x : number | ||
> : ^^^^^^ | ||
} | ||
interface B { | ||
y: string; | ||
>y : string | ||
> : ^^^^^^ | ||
} | ||
|
||
declare let b: B; | ||
>b : B | ||
> : ^ | ||
|
||
declare let a: A; | ||
>a : A | ||
> : ^ | ||
|
||
const x = a = b; | ||
>x : B | ||
> : ^ | ||
>a = b : B | ||
> : ^ | ||
>a : A | ||
> : ^ | ||
>b : B | ||
> : ^ | ||
|
||
let obj: { 3: string } = { 3: "three" }; | ||
>obj : { 3: string; } | ||
> : ^^^^^ ^^^ | ||
>3 : string | ||
> : ^^^^^^ | ||
>{ 3: "three" } : { 3: string; } | ||
> : ^^^^^^^^^^^^^^ | ||
>3 : string | ||
> : ^^^^^^ | ||
>"three" : "three" | ||
> : ^^^^^^^ | ||
|
||
obj[x]; | ||
>obj[x] : any | ||
> : ^^^ | ||
>obj : { 3: string; } | ||
> : ^^^^^^^^^^^^^^ | ||
>x : B | ||
> : ^ | ||
|
11 changes: 11 additions & 0 deletions
11
tests/baselines/reference/duplicateErrorNameNotFound.errors.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
duplicateErrorNameNotFound.ts(4,5): error TS2552: Cannot find name 'RoomInterface'. Did you mean 'RoomInterfae'? | ||
|
||
|
||
==== duplicateErrorNameNotFound.ts (1 errors) ==== | ||
type RoomInterfae = {}; | ||
|
||
export type { | ||
RoomInterface | ||
~~~~~~~~~~~~~ | ||
!!! error TS2552: Cannot find name 'RoomInterface'. Did you mean 'RoomInterfae'? | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
//// [tests/cases/compiler/duplicateErrorNameNotFound.ts] //// | ||
|
||
//// [duplicateErrorNameNotFound.ts] | ||
type RoomInterfae = {}; | ||
|
||
export type { | ||
RoomInterface | ||
} | ||
|
||
//// [duplicateErrorNameNotFound.js] | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
10 changes: 10 additions & 0 deletions
10
tests/baselines/reference/duplicateErrorNameNotFound.symbols
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
//// [tests/cases/compiler/duplicateErrorNameNotFound.ts] //// | ||
|
||
=== duplicateErrorNameNotFound.ts === | ||
type RoomInterfae = {}; | ||
>RoomInterfae : Symbol(RoomInterfae, Decl(duplicateErrorNameNotFound.ts, 0, 0)) | ||
|
||
export type { | ||
RoomInterface | ||
>RoomInterface : Symbol(RoomInterface, Decl(duplicateErrorNameNotFound.ts, 2, 13)) | ||
} |
12 changes: 12 additions & 0 deletions
12
tests/baselines/reference/duplicateErrorNameNotFound.types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
//// [tests/cases/compiler/duplicateErrorNameNotFound.ts] //// | ||
|
||
=== duplicateErrorNameNotFound.ts === | ||
type RoomInterfae = {}; | ||
>RoomInterfae : RoomInterfae | ||
> : ^^^^^^^^^^^^ | ||
|
||
export type { | ||
RoomInterface | ||
>RoomInterface : any | ||
> : ^^^ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.