Skip to content

Commit 3a05363

Browse files
committed
Correct errorForUsingPropertyOfTypeAsType03
Rename didn't work properly in a file with errors, so the test isn't testing the right thing.
1 parent cdd3cd4 commit 3a05363

File tree

5 files changed

+34
-34
lines changed

5 files changed

+34
-34
lines changed

tests/baselines/reference/errorForUsingPropertyOfTypeAsType03.errors.txt

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
tests/cases/compiler/errorForUsingPropertyOfTypeAsType03.ts(11,19): error TS2694: Namespace 'Color' has no exported member 'Red'.
22
tests/cases/compiler/errorForUsingPropertyOfTypeAsType03.ts(13,19): error TS2339: Property 'Red' does not exist on type 'Color'.
3-
tests/cases/compiler/errorForUsingPropertyOfTypeAsType03.ts(19,13): error TS2503: Cannot find namespace 'T1'.
4-
tests/cases/compiler/errorForUsingPropertyOfTypeAsType03.ts(20,13): error TS2503: Cannot find namespace 'T1'.
3+
tests/cases/compiler/errorForUsingPropertyOfTypeAsType03.ts(19,13): error TS2702: 'C1' only refers to a type, but is being used as a namespace here.
4+
tests/cases/compiler/errorForUsingPropertyOfTypeAsType03.ts(20,13): error TS2702: 'C1' only refers to a type, but is being used as a namespace here.
55
tests/cases/compiler/errorForUsingPropertyOfTypeAsType03.ts(21,16): error TS2339: Property 'Red' does not exist on type 'Color'.
6-
tests/cases/compiler/errorForUsingPropertyOfTypeAsType03.ts(23,13): error TS2503: Cannot find namespace 'T2'.
7-
tests/cases/compiler/errorForUsingPropertyOfTypeAsType03.ts(24,13): error TS2503: Cannot find namespace 'T2'.
6+
tests/cases/compiler/errorForUsingPropertyOfTypeAsType03.ts(23,13): error TS2713: Cannot access 'C2.Red' because 'C2' is a type, but not a namespace. Did you mean to retrieve the type of the property 'Red' in 'C2' with 'C2["Red"]'?
7+
tests/cases/compiler/errorForUsingPropertyOfTypeAsType03.ts(24,13): error TS2713: Cannot access 'C2.Red' because 'C2' is a type, but not a namespace. Did you mean to retrieve the type of the property 'Red' in 'C2' with 'C2["Red"]'?
88

99

1010
==== tests/cases/compiler/errorForUsingPropertyOfTypeAsType03.ts (7 errors) ====
@@ -30,21 +30,21 @@ tests/cases/compiler/errorForUsingPropertyOfTypeAsType03.ts(24,13): error TS2503
3030
//let b2: (typeof Color).Red["toString"];
3131
let b3: (typeof Color)["Red"]["toString"];
3232

33-
let c1: T1.Red.toString;
33+
let c1: C1.Red.toString;
3434
~~
35-
!!! error TS2503: Cannot find namespace 'T1'.
36-
let c2: T1.Red["toString"];
35+
!!! error TS2702: 'C1' only refers to a type, but is being used as a namespace here.
36+
let c2: C1.Red["toString"];
3737
~~
38-
!!! error TS2503: Cannot find namespace 'T1'.
38+
!!! error TS2702: 'C1' only refers to a type, but is being used as a namespace here.
3939
let c3: C1["Red"]["toString"];
4040
~~~~~
4141
!!! error TS2339: Property 'Red' does not exist on type 'Color'.
4242

43-
let d1: T2.Red.toString;
44-
~~
45-
!!! error TS2503: Cannot find namespace 'T2'.
46-
let d2: T2.Red["toString"];
47-
~~
48-
!!! error TS2503: Cannot find namespace 'T2'.
43+
let d1: C2.Red.toString;
44+
~~~~~~
45+
!!! error TS2713: Cannot access 'C2.Red' because 'C2' is a type, but not a namespace. Did you mean to retrieve the type of the property 'Red' in 'C2' with 'C2["Red"]'?
46+
let d2: C2.Red["toString"];
47+
~~~~~~
48+
!!! error TS2713: Cannot access 'C2.Red' because 'C2' is a type, but not a namespace. Did you mean to retrieve the type of the property 'Red' in 'C2' with 'C2["Red"]'?
4949
let d3: C2["Red"]["toString"];
5050
}

tests/baselines/reference/errorForUsingPropertyOfTypeAsType03.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ namespace Test1 {
1717
//let b2: (typeof Color).Red["toString"];
1818
let b3: (typeof Color)["Red"]["toString"];
1919

20-
let c1: T1.Red.toString;
21-
let c2: T1.Red["toString"];
20+
let c1: C1.Red.toString;
21+
let c2: C1.Red["toString"];
2222
let c3: C1["Red"]["toString"];
2323

24-
let d1: T2.Red.toString;
25-
let d2: T2.Red["toString"];
24+
let d1: C2.Red.toString;
25+
let d2: C2.Red["toString"];
2626
let d3: C2["Red"]["toString"];
2727
}
2828

tests/baselines/reference/errorForUsingPropertyOfTypeAsType03.symbols

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,20 +42,20 @@ namespace Test1 {
4242
>b3 : Symbol(b3, Decl(errorForUsingPropertyOfTypeAsType03.ts, 16, 7))
4343
>Color : Symbol(Color, Decl(errorForUsingPropertyOfTypeAsType03.ts, 0, 17))
4444

45-
let c1: T1.Red.toString;
45+
let c1: C1.Red.toString;
4646
>c1 : Symbol(c1, Decl(errorForUsingPropertyOfTypeAsType03.ts, 18, 7))
4747

48-
let c2: T1.Red["toString"];
48+
let c2: C1.Red["toString"];
4949
>c2 : Symbol(c2, Decl(errorForUsingPropertyOfTypeAsType03.ts, 19, 7))
5050

5151
let c3: C1["Red"]["toString"];
5252
>c3 : Symbol(c3, Decl(errorForUsingPropertyOfTypeAsType03.ts, 20, 7))
5353
>C1 : Symbol(C1, Decl(errorForUsingPropertyOfTypeAsType03.ts, 5, 5))
5454

55-
let d1: T2.Red.toString;
55+
let d1: C2.Red.toString;
5656
>d1 : Symbol(d1, Decl(errorForUsingPropertyOfTypeAsType03.ts, 22, 7))
5757

58-
let d2: T2.Red["toString"];
58+
let d2: C2.Red["toString"];
5959
>d2 : Symbol(d2, Decl(errorForUsingPropertyOfTypeAsType03.ts, 23, 7))
6060

6161
let d3: C2["Red"]["toString"];

tests/baselines/reference/errorForUsingPropertyOfTypeAsType03.types

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,30 +44,30 @@ namespace Test1 {
4444
>b3 : (radix?: number) => string
4545
>Color : typeof Color
4646

47-
let c1: T1.Red.toString;
47+
let c1: C1.Red.toString;
4848
>c1 : any
49-
>T1 : any
49+
>C1 : any
5050
>Red : any
5151
>toString : No type information available!
5252

53-
let c2: T1.Red["toString"];
53+
let c2: C1.Red["toString"];
5454
>c2 : any
55-
>T1 : any
55+
>C1 : any
5656
>Red : No type information available!
5757

5858
let c3: C1["Red"]["toString"];
5959
>c3 : any
6060
>C1 : Color
6161

62-
let d1: T2.Red.toString;
62+
let d1: C2.Red.toString;
6363
>d1 : any
64-
>T2 : any
64+
>C2 : any
6565
>Red : any
6666
>toString : No type information available!
6767

68-
let d2: T2.Red["toString"];
68+
let d2: C2.Red["toString"];
6969
>d2 : any
70-
>T2 : any
70+
>C2 : any
7171
>Red : No type information available!
7272

7373
let d3: C2["Red"]["toString"];

tests/cases/compiler/errorForUsingPropertyOfTypeAsType03.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ namespace Test1 {
1616
//let b2: (typeof Color).Red["toString"];
1717
let b3: (typeof Color)["Red"]["toString"];
1818

19-
let c1: T1.Red.toString;
20-
let c2: T1.Red["toString"];
19+
let c1: C1.Red.toString;
20+
let c2: C1.Red["toString"];
2121
let c3: C1["Red"]["toString"];
2222

23-
let d1: T2.Red.toString;
24-
let d2: T2.Red["toString"];
23+
let d1: C2.Red.toString;
24+
let d2: C2.Red["toString"];
2525
let d3: C2["Red"]["toString"];
2626
}

0 commit comments

Comments
 (0)