Clean up tests a bit
This commit is contained in:
parent
ae63df6cec
commit
60b8d0a7a3
4 changed files with 27 additions and 54 deletions
|
@ -1,4 +1,5 @@
|
|||
//// [genericInheritedDefaultConstructors.ts]
|
||||
// repro from #8166
|
||||
interface Constructor<T> {
|
||||
new(...args: any[]): T;
|
||||
prototype: T;
|
||||
|
@ -6,12 +7,7 @@ interface Constructor<T> {
|
|||
|
||||
class A<U> { a: U; }
|
||||
class B<V> extends A<V> { b: V; }
|
||||
var c:Constructor<B<boolean>> = B; // error here
|
||||
var x = new B<number>();
|
||||
|
||||
//class A1 { a: boolean; }
|
||||
//class B1 extends A1 { b: boolean; }
|
||||
//var c1:Constructor<B1> = B1; // no error here
|
||||
var c:Constructor<B<boolean>> = B; // shouldn't error here
|
||||
|
||||
|
||||
//// [genericInheritedDefaultConstructors.js]
|
||||
|
@ -32,8 +28,4 @@ var B = (function (_super) {
|
|||
}
|
||||
return B;
|
||||
}(A));
|
||||
var c = B; // error here
|
||||
var x = new B();
|
||||
//class A1 { a: boolean; }
|
||||
//class B1 extends A1 { b: boolean; }
|
||||
//var c1:Constructor<B1> = B1; // no error here
|
||||
var c = B; // shouldn't error here
|
||||
|
|
|
@ -1,42 +1,35 @@
|
|||
=== tests/cases/compiler/genericInheritedDefaultConstructors.ts ===
|
||||
// repro from #8166
|
||||
interface Constructor<T> {
|
||||
>Constructor : Symbol(Constructor, Decl(genericInheritedDefaultConstructors.ts, 0, 0))
|
||||
>T : Symbol(T, Decl(genericInheritedDefaultConstructors.ts, 0, 22))
|
||||
>T : Symbol(T, Decl(genericInheritedDefaultConstructors.ts, 1, 22))
|
||||
|
||||
new(...args: any[]): T;
|
||||
>args : Symbol(args, Decl(genericInheritedDefaultConstructors.ts, 1, 8))
|
||||
>T : Symbol(T, Decl(genericInheritedDefaultConstructors.ts, 0, 22))
|
||||
>args : Symbol(args, Decl(genericInheritedDefaultConstructors.ts, 2, 8))
|
||||
>T : Symbol(T, Decl(genericInheritedDefaultConstructors.ts, 1, 22))
|
||||
|
||||
prototype: T;
|
||||
>prototype : Symbol(Constructor.prototype, Decl(genericInheritedDefaultConstructors.ts, 1, 27))
|
||||
>T : Symbol(T, Decl(genericInheritedDefaultConstructors.ts, 0, 22))
|
||||
>prototype : Symbol(Constructor.prototype, Decl(genericInheritedDefaultConstructors.ts, 2, 27))
|
||||
>T : Symbol(T, Decl(genericInheritedDefaultConstructors.ts, 1, 22))
|
||||
}
|
||||
|
||||
class A<U> { a: U; }
|
||||
>A : Symbol(A, Decl(genericInheritedDefaultConstructors.ts, 3, 1))
|
||||
>U : Symbol(U, Decl(genericInheritedDefaultConstructors.ts, 5, 8))
|
||||
>a : Symbol(A.a, Decl(genericInheritedDefaultConstructors.ts, 5, 12))
|
||||
>U : Symbol(U, Decl(genericInheritedDefaultConstructors.ts, 5, 8))
|
||||
>A : Symbol(A, Decl(genericInheritedDefaultConstructors.ts, 4, 1))
|
||||
>U : Symbol(U, Decl(genericInheritedDefaultConstructors.ts, 6, 8))
|
||||
>a : Symbol(A.a, Decl(genericInheritedDefaultConstructors.ts, 6, 12))
|
||||
>U : Symbol(U, Decl(genericInheritedDefaultConstructors.ts, 6, 8))
|
||||
|
||||
class B<V> extends A<V> { b: V; }
|
||||
>B : Symbol(B, Decl(genericInheritedDefaultConstructors.ts, 5, 20))
|
||||
>V : Symbol(V, Decl(genericInheritedDefaultConstructors.ts, 6, 8))
|
||||
>A : Symbol(A, Decl(genericInheritedDefaultConstructors.ts, 3, 1))
|
||||
>V : Symbol(V, Decl(genericInheritedDefaultConstructors.ts, 6, 8))
|
||||
>b : Symbol(B.b, Decl(genericInheritedDefaultConstructors.ts, 6, 25))
|
||||
>V : Symbol(V, Decl(genericInheritedDefaultConstructors.ts, 6, 8))
|
||||
>B : Symbol(B, Decl(genericInheritedDefaultConstructors.ts, 6, 20))
|
||||
>V : Symbol(V, Decl(genericInheritedDefaultConstructors.ts, 7, 8))
|
||||
>A : Symbol(A, Decl(genericInheritedDefaultConstructors.ts, 4, 1))
|
||||
>V : Symbol(V, Decl(genericInheritedDefaultConstructors.ts, 7, 8))
|
||||
>b : Symbol(B.b, Decl(genericInheritedDefaultConstructors.ts, 7, 25))
|
||||
>V : Symbol(V, Decl(genericInheritedDefaultConstructors.ts, 7, 8))
|
||||
|
||||
var c:Constructor<B<boolean>> = B; // error here
|
||||
>c : Symbol(c, Decl(genericInheritedDefaultConstructors.ts, 7, 3))
|
||||
var c:Constructor<B<boolean>> = B; // shouldn't error here
|
||||
>c : Symbol(c, Decl(genericInheritedDefaultConstructors.ts, 8, 3))
|
||||
>Constructor : Symbol(Constructor, Decl(genericInheritedDefaultConstructors.ts, 0, 0))
|
||||
>B : Symbol(B, Decl(genericInheritedDefaultConstructors.ts, 5, 20))
|
||||
>B : Symbol(B, Decl(genericInheritedDefaultConstructors.ts, 5, 20))
|
||||
|
||||
var x = new B<number>();
|
||||
>x : Symbol(x, Decl(genericInheritedDefaultConstructors.ts, 8, 3))
|
||||
>B : Symbol(B, Decl(genericInheritedDefaultConstructors.ts, 5, 20))
|
||||
|
||||
//class A1 { a: boolean; }
|
||||
//class B1 extends A1 { b: boolean; }
|
||||
//var c1:Constructor<B1> = B1; // no error here
|
||||
>B : Symbol(B, Decl(genericInheritedDefaultConstructors.ts, 6, 20))
|
||||
>B : Symbol(B, Decl(genericInheritedDefaultConstructors.ts, 6, 20))
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
=== tests/cases/compiler/genericInheritedDefaultConstructors.ts ===
|
||||
// repro from #8166
|
||||
interface Constructor<T> {
|
||||
>Constructor : Constructor<T>
|
||||
>T : T
|
||||
|
@ -26,18 +27,9 @@ class B<V> extends A<V> { b: V; }
|
|||
>b : V
|
||||
>V : V
|
||||
|
||||
var c:Constructor<B<boolean>> = B; // error here
|
||||
var c:Constructor<B<boolean>> = B; // shouldn't error here
|
||||
>c : Constructor<B<boolean>>
|
||||
>Constructor : Constructor<T>
|
||||
>B : B<V>
|
||||
>B : typeof B
|
||||
|
||||
var x = new B<number>();
|
||||
>x : B<number>
|
||||
>new B<number>() : B<number>
|
||||
>B : typeof B
|
||||
|
||||
//class A1 { a: boolean; }
|
||||
//class B1 extends A1 { b: boolean; }
|
||||
//var c1:Constructor<B1> = B1; // no error here
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// repro from #8166
|
||||
interface Constructor<T> {
|
||||
new(...args: any[]): T;
|
||||
prototype: T;
|
||||
|
@ -5,9 +6,4 @@ interface Constructor<T> {
|
|||
|
||||
class A<U> { a: U; }
|
||||
class B<V> extends A<V> { b: V; }
|
||||
var c:Constructor<B<boolean>> = B; // error here
|
||||
var x = new B<number>();
|
||||
|
||||
//class A1 { a: boolean; }
|
||||
//class B1 extends A1 { b: boolean; }
|
||||
//var c1:Constructor<B1> = B1; // no error here
|
||||
var c:Constructor<B<boolean>> = B; // shouldn't error here
|
||||
|
|
Loading…
Reference in a new issue