Add baselines for the current state of enum members

This commit is contained in:
Andrew Casey 2017-11-29 15:57:11 -08:00
parent 31c4ca5235
commit 170cb9c811
5 changed files with 266 additions and 0 deletions

View file

@ -0,0 +1,50 @@
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(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 (7 errors) ====
namespace Test1 {
enum Color {
Red,
Green,
Blue
}
type C1 = Color;
type C2 = typeof Color;
let a1: Color.Red.toString;
~~~
!!! error TS2694: Namespace 'Color' has no exported member 'Red'.
let a2: Color.Red["toString"];
let a3: Color["Red"]["toString"];
~~~~~
!!! error TS2339: Property 'Red' does not exist on type 'Color'.
//let b1: (typeof Color).Red.toString;
//let b2: (typeof Color).Red["toString"];
let b3: (typeof Color)["Red"]["toString"];
let c1: T1.Red.toString;
~~
!!! error TS2503: Cannot find namespace 'T1'.
let c2: T1.Red["toString"];
~~
!!! error TS2503: Cannot find namespace 'T1'.
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 d3: C2["Red"]["toString"];
}

View file

@ -0,0 +1,50 @@
//// [errorForUsingPropertyOfTypeAsType03.ts]
namespace Test1 {
enum Color {
Red,
Green,
Blue
}
type C1 = Color;
type C2 = typeof Color;
let a1: Color.Red.toString;
let a2: Color.Red["toString"];
let a3: Color["Red"]["toString"];
//let b1: (typeof Color).Red.toString;
//let b2: (typeof Color).Red["toString"];
let b3: (typeof Color)["Red"]["toString"];
let c1: T1.Red.toString;
let c2: T1.Red["toString"];
let c3: C1["Red"]["toString"];
let d1: T2.Red.toString;
let d2: T2.Red["toString"];
let d3: C2["Red"]["toString"];
}
//// [errorForUsingPropertyOfTypeAsType03.js]
var Test1;
(function (Test1) {
var Color;
(function (Color) {
Color[Color["Red"] = 0] = "Red";
Color[Color["Green"] = 1] = "Green";
Color[Color["Blue"] = 2] = "Blue";
})(Color || (Color = {}));
var a1;
var a2;
var a3;
//let b1: (typeof Color).Red.toString;
//let b2: (typeof Color).Red["toString"];
var b3;
var c1;
var c2;
var c3;
var d1;
var d2;
var d3;
})(Test1 || (Test1 = {}));

View file

@ -0,0 +1,64 @@
=== tests/cases/compiler/errorForUsingPropertyOfTypeAsType03.ts ===
namespace Test1 {
>Test1 : Symbol(Test1, Decl(errorForUsingPropertyOfTypeAsType03.ts, 0, 0))
enum Color {
>Color : Symbol(Color, Decl(errorForUsingPropertyOfTypeAsType03.ts, 0, 17))
Red,
>Red : Symbol(Color.Red, Decl(errorForUsingPropertyOfTypeAsType03.ts, 1, 16))
Green,
>Green : Symbol(Color.Green, Decl(errorForUsingPropertyOfTypeAsType03.ts, 2, 12))
Blue
>Blue : Symbol(Color.Blue, Decl(errorForUsingPropertyOfTypeAsType03.ts, 3, 14))
}
type C1 = Color;
>C1 : Symbol(C1, Decl(errorForUsingPropertyOfTypeAsType03.ts, 5, 5))
>Color : Symbol(Color, Decl(errorForUsingPropertyOfTypeAsType03.ts, 0, 17))
type C2 = typeof Color;
>C2 : Symbol(C2, Decl(errorForUsingPropertyOfTypeAsType03.ts, 7, 20))
>Color : Symbol(Color, Decl(errorForUsingPropertyOfTypeAsType03.ts, 0, 17))
let a1: Color.Red.toString;
>a1 : Symbol(a1, Decl(errorForUsingPropertyOfTypeAsType03.ts, 10, 7))
>Color : Symbol(Color, Decl(errorForUsingPropertyOfTypeAsType03.ts, 0, 17))
let a2: Color.Red["toString"];
>a2 : Symbol(a2, Decl(errorForUsingPropertyOfTypeAsType03.ts, 11, 7))
>Color : Symbol(Color, Decl(errorForUsingPropertyOfTypeAsType03.ts, 0, 17))
>Red : Symbol(Color.Red, Decl(errorForUsingPropertyOfTypeAsType03.ts, 1, 16))
let a3: Color["Red"]["toString"];
>a3 : Symbol(a3, Decl(errorForUsingPropertyOfTypeAsType03.ts, 12, 7))
>Color : Symbol(Color, Decl(errorForUsingPropertyOfTypeAsType03.ts, 0, 17))
//let b1: (typeof Color).Red.toString;
//let b2: (typeof Color).Red["toString"];
let b3: (typeof Color)["Red"]["toString"];
>b3 : Symbol(b3, Decl(errorForUsingPropertyOfTypeAsType03.ts, 16, 7))
>Color : Symbol(Color, Decl(errorForUsingPropertyOfTypeAsType03.ts, 0, 17))
let c1: T1.Red.toString;
>c1 : Symbol(c1, Decl(errorForUsingPropertyOfTypeAsType03.ts, 18, 7))
let c2: T1.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;
>d1 : Symbol(d1, Decl(errorForUsingPropertyOfTypeAsType03.ts, 22, 7))
let d2: T2.Red["toString"];
>d2 : Symbol(d2, Decl(errorForUsingPropertyOfTypeAsType03.ts, 23, 7))
let d3: C2["Red"]["toString"];
>d3 : Symbol(d3, Decl(errorForUsingPropertyOfTypeAsType03.ts, 24, 7))
>C2 : Symbol(C2, Decl(errorForUsingPropertyOfTypeAsType03.ts, 7, 20))
}

View file

@ -0,0 +1,76 @@
=== tests/cases/compiler/errorForUsingPropertyOfTypeAsType03.ts ===
namespace Test1 {
>Test1 : typeof Test1
enum Color {
>Color : Color
Red,
>Red : Color.Red
Green,
>Green : Color.Green
Blue
>Blue : Color.Blue
}
type C1 = Color;
>C1 : Color
>Color : Color
type C2 = typeof Color;
>C2 : typeof Color
>Color : typeof Color
let a1: Color.Red.toString;
>a1 : any
>Color : any
>Red : any
>toString : No type information available!
let a2: Color.Red["toString"];
>a2 : (radix?: number) => string
>Color : any
>Red : Color.Red
let a3: Color["Red"]["toString"];
>a3 : any
>Color : Color
//let b1: (typeof Color).Red.toString;
//let b2: (typeof Color).Red["toString"];
let b3: (typeof Color)["Red"]["toString"];
>b3 : (radix?: number) => string
>Color : typeof Color
let c1: T1.Red.toString;
>c1 : any
>T1 : any
>Red : any
>toString : No type information available!
let c2: T1.Red["toString"];
>c2 : any
>T1 : any
>Red : No type information available!
let c3: C1["Red"]["toString"];
>c3 : any
>C1 : Color
let d1: T2.Red.toString;
>d1 : any
>T2 : any
>Red : any
>toString : No type information available!
let d2: T2.Red["toString"];
>d2 : any
>T2 : any
>Red : No type information available!
let d3: C2["Red"]["toString"];
>d3 : (radix?: number) => string
>C2 : typeof Color
}

View file

@ -0,0 +1,26 @@
namespace Test1 {
enum Color {
Red,
Green,
Blue
}
type C1 = Color;
type C2 = typeof Color;
let a1: Color.Red.toString;
let a2: Color.Red["toString"];
let a3: Color["Red"]["toString"];
//let b1: (typeof Color).Red.toString;
//let b2: (typeof Color).Red["toString"];
let b3: (typeof Color)["Red"]["toString"];
let c1: T1.Red.toString;
let c2: T1.Red["toString"];
let c3: C1["Red"]["toString"];
let d1: T2.Red.toString;
let d2: T2.Red["toString"];
let d3: C2["Red"]["toString"];
}