1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167
|
=== tests/cases/compiler/errorsInGenericTypeReference.ts ===
interface IFoo<T> { }
>IFoo : Symbol(IFoo, Decl(errorsInGenericTypeReference.ts, 0, 0))
>T : Symbol(T, Decl(errorsInGenericTypeReference.ts, 0, 15))
class Foo<T> { }
>Foo : Symbol(Foo, Decl(errorsInGenericTypeReference.ts, 0, 21))
>T : Symbol(T, Decl(errorsInGenericTypeReference.ts, 2, 10))
// in call type arguments
class testClass1 {
>testClass1 : Symbol(testClass1, Decl(errorsInGenericTypeReference.ts, 2, 16))
method<T>(): void { }
>method : Symbol(testClass1.method, Decl(errorsInGenericTypeReference.ts, 6, 18))
>T : Symbol(T, Decl(errorsInGenericTypeReference.ts, 7, 11))
}
var tc1 = new testClass1();
>tc1 : Symbol(tc1, Decl(errorsInGenericTypeReference.ts, 9, 3))
>testClass1 : Symbol(testClass1, Decl(errorsInGenericTypeReference.ts, 2, 16))
tc1.method<{ x: V }>(); // error: could not find symbol V
>tc1.method : Symbol(testClass1.method, Decl(errorsInGenericTypeReference.ts, 6, 18))
>tc1 : Symbol(tc1, Decl(errorsInGenericTypeReference.ts, 9, 3))
>method : Symbol(testClass1.method, Decl(errorsInGenericTypeReference.ts, 6, 18))
>x : Symbol(x, Decl(errorsInGenericTypeReference.ts, 10, 12))
// in constructor type arguments
class testClass2<T> {
>testClass2 : Symbol(testClass2, Decl(errorsInGenericTypeReference.ts, 10, 23))
>T : Symbol(T, Decl(errorsInGenericTypeReference.ts, 14, 17))
}
var tc2 = new testClass2<{ x: V }>(); // error: could not find symbol V
>tc2 : Symbol(tc2, Decl(errorsInGenericTypeReference.ts, 16, 3))
>testClass2 : Symbol(testClass2, Decl(errorsInGenericTypeReference.ts, 10, 23))
>x : Symbol(x, Decl(errorsInGenericTypeReference.ts, 16, 26))
// in method return type annotation
class testClass3 {
>testClass3 : Symbol(testClass3, Decl(errorsInGenericTypeReference.ts, 16, 37))
testMethod1(): Foo<{ x: V }> { return null; } // error: could not find symbol V
>testMethod1 : Symbol(testClass3.testMethod1, Decl(errorsInGenericTypeReference.ts, 20, 18))
>Foo : Symbol(Foo, Decl(errorsInGenericTypeReference.ts, 0, 21))
>x : Symbol(x, Decl(errorsInGenericTypeReference.ts, 21, 24))
static testMethod2(): Foo<{ x: V }> { return null } // error: could not find symbol V
>testMethod2 : Symbol(testClass3.testMethod2, Decl(errorsInGenericTypeReference.ts, 21, 49))
>Foo : Symbol(Foo, Decl(errorsInGenericTypeReference.ts, 0, 21))
>x : Symbol(x, Decl(errorsInGenericTypeReference.ts, 22, 31))
set a(value: Foo<{ x: V }>) { } // error: could not find symbol V
>a : Symbol(testClass3.a, Decl(errorsInGenericTypeReference.ts, 22, 55))
>value : Symbol(value, Decl(errorsInGenericTypeReference.ts, 23, 10))
>Foo : Symbol(Foo, Decl(errorsInGenericTypeReference.ts, 0, 21))
>x : Symbol(x, Decl(errorsInGenericTypeReference.ts, 23, 22))
property: Foo<{ x: V }>; // error: could not find symbol V
>property : Symbol(testClass3.property, Decl(errorsInGenericTypeReference.ts, 23, 35))
>Foo : Symbol(Foo, Decl(errorsInGenericTypeReference.ts, 0, 21))
>x : Symbol(x, Decl(errorsInGenericTypeReference.ts, 24, 19))
}
// in function return type annotation
function testFunction1(): Foo<{ x: V }> { return null; } // error: could not find symbol V
>testFunction1 : Symbol(testFunction1, Decl(errorsInGenericTypeReference.ts, 25, 1))
>Foo : Symbol(Foo, Decl(errorsInGenericTypeReference.ts, 0, 21))
>x : Symbol(x, Decl(errorsInGenericTypeReference.ts, 29, 31))
// in paramter types
function testFunction2(p: Foo<{ x: V }>) { }// error: could not find symbol V
>testFunction2 : Symbol(testFunction2, Decl(errorsInGenericTypeReference.ts, 29, 56))
>p : Symbol(p, Decl(errorsInGenericTypeReference.ts, 33, 23))
>Foo : Symbol(Foo, Decl(errorsInGenericTypeReference.ts, 0, 21))
>x : Symbol(x, Decl(errorsInGenericTypeReference.ts, 33, 31))
// in var type annotation
var f: Foo<{ x: V }>; // error: could not find symbol V
>f : Symbol(f, Decl(errorsInGenericTypeReference.ts, 37, 3))
>Foo : Symbol(Foo, Decl(errorsInGenericTypeReference.ts, 0, 21))
>x : Symbol(x, Decl(errorsInGenericTypeReference.ts, 37, 12))
// in constraints
class testClass4<T extends { x: V }> { } // error: could not find symbol V
>testClass4 : Symbol(testClass4, Decl(errorsInGenericTypeReference.ts, 37, 21))
>T : Symbol(T, Decl(errorsInGenericTypeReference.ts, 41, 17))
>x : Symbol(x, Decl(errorsInGenericTypeReference.ts, 41, 28))
interface testClass5<T extends Foo<{ x: V }>> { } // error: could not find symbol V
>testClass5 : Symbol(testClass5, Decl(errorsInGenericTypeReference.ts, 41, 40))
>T : Symbol(T, Decl(errorsInGenericTypeReference.ts, 43, 21))
>Foo : Symbol(Foo, Decl(errorsInGenericTypeReference.ts, 0, 21))
>x : Symbol(x, Decl(errorsInGenericTypeReference.ts, 43, 36))
class testClass6<T> {
>testClass6 : Symbol(testClass6, Decl(errorsInGenericTypeReference.ts, 43, 49))
>T : Symbol(T, Decl(errorsInGenericTypeReference.ts, 45, 17))
method<M extends { x: V }>(): void { } // error: could not find symbol V
>method : Symbol(testClass6.method, Decl(errorsInGenericTypeReference.ts, 45, 21))
>M : Symbol(M, Decl(errorsInGenericTypeReference.ts, 46, 11))
>x : Symbol(x, Decl(errorsInGenericTypeReference.ts, 46, 22))
}
interface testInterface1 {
>testInterface1 : Symbol(testInterface1, Decl(errorsInGenericTypeReference.ts, 47, 1))
new <M extends { x: V }>(a: M); // error: could not find symbol V
>M : Symbol(M, Decl(errorsInGenericTypeReference.ts, 50, 9))
>x : Symbol(x, Decl(errorsInGenericTypeReference.ts, 50, 20))
>a : Symbol(a, Decl(errorsInGenericTypeReference.ts, 50, 29))
>M : Symbol(M, Decl(errorsInGenericTypeReference.ts, 50, 9))
}
// in extends clause
class testClass7 extends Foo<{ x: V }> { } // error: could not find symbol V
>testClass7 : Symbol(testClass7, Decl(errorsInGenericTypeReference.ts, 51, 1))
>Foo : Symbol(Foo, Decl(errorsInGenericTypeReference.ts, 0, 21))
>x : Symbol(x, Decl(errorsInGenericTypeReference.ts, 55, 30))
// in implements clause
class testClass8 implements IFoo<{ x: V }> { } // error: could not find symbol V
>testClass8 : Symbol(testClass8, Decl(errorsInGenericTypeReference.ts, 55, 42))
>IFoo : Symbol(IFoo, Decl(errorsInGenericTypeReference.ts, 0, 0))
>x : Symbol(x, Decl(errorsInGenericTypeReference.ts, 59, 34))
// in signatures
interface testInterface2 {
>testInterface2 : Symbol(testInterface2, Decl(errorsInGenericTypeReference.ts, 59, 46))
new (a: Foo<{ x: V }>): Foo<{ x: V }>; //2x: error: could not find symbol V
>a : Symbol(a, Decl(errorsInGenericTypeReference.ts, 64, 9))
>Foo : Symbol(Foo, Decl(errorsInGenericTypeReference.ts, 0, 21))
>x : Symbol(x, Decl(errorsInGenericTypeReference.ts, 64, 17))
>Foo : Symbol(Foo, Decl(errorsInGenericTypeReference.ts, 0, 21))
>x : Symbol(x, Decl(errorsInGenericTypeReference.ts, 64, 33))
[x: string]: Foo<{ x: V }>; // error: could not find symbol V
>x : Symbol(x, Decl(errorsInGenericTypeReference.ts, 65, 5))
>Foo : Symbol(Foo, Decl(errorsInGenericTypeReference.ts, 0, 21))
>x : Symbol(x, Decl(errorsInGenericTypeReference.ts, 65, 22))
method(a: Foo<{ x: V }>): Foo<{ x: V }>; //2x: error: could not find symbol V
>method : Symbol(testInterface2.method, Decl(errorsInGenericTypeReference.ts, 65, 31))
>a : Symbol(a, Decl(errorsInGenericTypeReference.ts, 66, 11))
>Foo : Symbol(Foo, Decl(errorsInGenericTypeReference.ts, 0, 21))
>x : Symbol(x, Decl(errorsInGenericTypeReference.ts, 66, 19))
>Foo : Symbol(Foo, Decl(errorsInGenericTypeReference.ts, 0, 21))
>x : Symbol(x, Decl(errorsInGenericTypeReference.ts, 66, 35))
property: Foo<{ x: V }>; // error: could not find symbol V
>property : Symbol(testInterface2.property, Decl(errorsInGenericTypeReference.ts, 66, 44))
>Foo : Symbol(Foo, Decl(errorsInGenericTypeReference.ts, 0, 21))
>x : Symbol(x, Decl(errorsInGenericTypeReference.ts, 67, 19))
}
|