From 3a05363a298797c9069aa82d1b9cb707cc40ab1f Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Wed, 29 Nov 2017 17:48:58 -0800 Subject: [PATCH] Correct errorForUsingPropertyOfTypeAsType03 Rename didn't work properly in a file with errors, so the test isn't testing the right thing. --- ...rForUsingPropertyOfTypeAsType03.errors.txt | 28 +++++++++---------- .../errorForUsingPropertyOfTypeAsType03.js | 8 +++--- ...rrorForUsingPropertyOfTypeAsType03.symbols | 8 +++--- .../errorForUsingPropertyOfTypeAsType03.types | 16 +++++------ .../errorForUsingPropertyOfTypeAsType03.ts | 8 +++--- 5 files changed, 34 insertions(+), 34 deletions(-) diff --git a/tests/baselines/reference/errorForUsingPropertyOfTypeAsType03.errors.txt b/tests/baselines/reference/errorForUsingPropertyOfTypeAsType03.errors.txt index a1cd0efd08..990a7f425a 100644 --- a/tests/baselines/reference/errorForUsingPropertyOfTypeAsType03.errors.txt +++ b/tests/baselines/reference/errorForUsingPropertyOfTypeAsType03.errors.txt @@ -1,10 +1,10 @@ tests/cases/compiler/errorForUsingPropertyOfTypeAsType03.ts(11,19): error TS2694: Namespace 'Color' has no exported member 'Red'. tests/cases/compiler/errorForUsingPropertyOfTypeAsType03.ts(13,19): error TS2339: Property 'Red' does not exist on type 'Color'. -tests/cases/compiler/errorForUsingPropertyOfTypeAsType03.ts(19,13): error TS2503: Cannot find namespace 'T1'. -tests/cases/compiler/errorForUsingPropertyOfTypeAsType03.ts(20,13): error TS2503: Cannot find namespace 'T1'. +tests/cases/compiler/errorForUsingPropertyOfTypeAsType03.ts(19,13): error TS2702: 'C1' only refers to a type, but is being used as a namespace here. +tests/cases/compiler/errorForUsingPropertyOfTypeAsType03.ts(20,13): error TS2702: 'C1' only refers to a type, but is being used as a namespace here. tests/cases/compiler/errorForUsingPropertyOfTypeAsType03.ts(21,16): error TS2339: Property 'Red' does not exist on type 'Color'. -tests/cases/compiler/errorForUsingPropertyOfTypeAsType03.ts(23,13): error TS2503: Cannot find namespace 'T2'. -tests/cases/compiler/errorForUsingPropertyOfTypeAsType03.ts(24,13): error TS2503: Cannot find namespace 'T2'. +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"]'? +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"]'? ==== tests/cases/compiler/errorForUsingPropertyOfTypeAsType03.ts (7 errors) ==== @@ -30,21 +30,21 @@ tests/cases/compiler/errorForUsingPropertyOfTypeAsType03.ts(24,13): error TS2503 //let b2: (typeof Color).Red["toString"]; let b3: (typeof Color)["Red"]["toString"]; - let c1: T1.Red.toString; + let c1: C1.Red.toString; ~~ -!!! error TS2503: Cannot find namespace 'T1'. - let c2: T1.Red["toString"]; +!!! error TS2702: 'C1' only refers to a type, but is being used as a namespace here. + let c2: C1.Red["toString"]; ~~ -!!! error TS2503: Cannot find namespace 'T1'. +!!! error TS2702: 'C1' only refers to a type, but is being used as a namespace here. let c3: C1["Red"]["toString"]; ~~~~~ !!! error TS2339: Property 'Red' does not exist on type 'Color'. - let d1: T2.Red.toString; - ~~ -!!! error TS2503: Cannot find namespace 'T2'. - let d2: T2.Red["toString"]; - ~~ -!!! error TS2503: Cannot find namespace 'T2'. + let d1: C2.Red.toString; + ~~~~~~ +!!! 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"]'? + let d2: C2.Red["toString"]; + ~~~~~~ +!!! 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"]'? let d3: C2["Red"]["toString"]; } \ No newline at end of file diff --git a/tests/baselines/reference/errorForUsingPropertyOfTypeAsType03.js b/tests/baselines/reference/errorForUsingPropertyOfTypeAsType03.js index 6ae641b93d..d433563086 100644 --- a/tests/baselines/reference/errorForUsingPropertyOfTypeAsType03.js +++ b/tests/baselines/reference/errorForUsingPropertyOfTypeAsType03.js @@ -17,12 +17,12 @@ namespace Test1 { //let b2: (typeof Color).Red["toString"]; let b3: (typeof Color)["Red"]["toString"]; - let c1: T1.Red.toString; - let c2: T1.Red["toString"]; + let c1: C1.Red.toString; + let c2: C1.Red["toString"]; let c3: C1["Red"]["toString"]; - let d1: T2.Red.toString; - let d2: T2.Red["toString"]; + let d1: C2.Red.toString; + let d2: C2.Red["toString"]; let d3: C2["Red"]["toString"]; } diff --git a/tests/baselines/reference/errorForUsingPropertyOfTypeAsType03.symbols b/tests/baselines/reference/errorForUsingPropertyOfTypeAsType03.symbols index 0a59ac2494..80d0a34fd9 100644 --- a/tests/baselines/reference/errorForUsingPropertyOfTypeAsType03.symbols +++ b/tests/baselines/reference/errorForUsingPropertyOfTypeAsType03.symbols @@ -42,20 +42,20 @@ namespace Test1 { >b3 : Symbol(b3, Decl(errorForUsingPropertyOfTypeAsType03.ts, 16, 7)) >Color : Symbol(Color, Decl(errorForUsingPropertyOfTypeAsType03.ts, 0, 17)) - let c1: T1.Red.toString; + let c1: C1.Red.toString; >c1 : Symbol(c1, Decl(errorForUsingPropertyOfTypeAsType03.ts, 18, 7)) - let c2: T1.Red["toString"]; + let c2: C1.Red["toString"]; >c2 : Symbol(c2, Decl(errorForUsingPropertyOfTypeAsType03.ts, 19, 7)) let c3: C1["Red"]["toString"]; >c3 : Symbol(c3, Decl(errorForUsingPropertyOfTypeAsType03.ts, 20, 7)) >C1 : Symbol(C1, Decl(errorForUsingPropertyOfTypeAsType03.ts, 5, 5)) - let d1: T2.Red.toString; + let d1: C2.Red.toString; >d1 : Symbol(d1, Decl(errorForUsingPropertyOfTypeAsType03.ts, 22, 7)) - let d2: T2.Red["toString"]; + let d2: C2.Red["toString"]; >d2 : Symbol(d2, Decl(errorForUsingPropertyOfTypeAsType03.ts, 23, 7)) let d3: C2["Red"]["toString"]; diff --git a/tests/baselines/reference/errorForUsingPropertyOfTypeAsType03.types b/tests/baselines/reference/errorForUsingPropertyOfTypeAsType03.types index 548b2679ce..8d6dbf3d4b 100644 --- a/tests/baselines/reference/errorForUsingPropertyOfTypeAsType03.types +++ b/tests/baselines/reference/errorForUsingPropertyOfTypeAsType03.types @@ -44,30 +44,30 @@ namespace Test1 { >b3 : (radix?: number) => string >Color : typeof Color - let c1: T1.Red.toString; + let c1: C1.Red.toString; >c1 : any ->T1 : any +>C1 : any >Red : any >toString : No type information available! - let c2: T1.Red["toString"]; + let c2: C1.Red["toString"]; >c2 : any ->T1 : any +>C1 : any >Red : No type information available! let c3: C1["Red"]["toString"]; >c3 : any >C1 : Color - let d1: T2.Red.toString; + let d1: C2.Red.toString; >d1 : any ->T2 : any +>C2 : any >Red : any >toString : No type information available! - let d2: T2.Red["toString"]; + let d2: C2.Red["toString"]; >d2 : any ->T2 : any +>C2 : any >Red : No type information available! let d3: C2["Red"]["toString"]; diff --git a/tests/cases/compiler/errorForUsingPropertyOfTypeAsType03.ts b/tests/cases/compiler/errorForUsingPropertyOfTypeAsType03.ts index bb88454df0..2ebd0f3c7c 100644 --- a/tests/cases/compiler/errorForUsingPropertyOfTypeAsType03.ts +++ b/tests/cases/compiler/errorForUsingPropertyOfTypeAsType03.ts @@ -16,11 +16,11 @@ namespace Test1 { //let b2: (typeof Color).Red["toString"]; let b3: (typeof Color)["Red"]["toString"]; - let c1: T1.Red.toString; - let c2: T1.Red["toString"]; + let c1: C1.Red.toString; + let c2: C1.Red["toString"]; let c3: C1["Red"]["toString"]; - let d1: T2.Red.toString; - let d2: T2.Red["toString"]; + let d1: C2.Red.toString; + let d2: C2.Red["toString"]; let d3: C2["Red"]["toString"]; } \ No newline at end of file