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
|
=== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer4.ts ===
// Derived type indexer must be subtype of base type indexer
interface Base { foo: string; }
>Base : Symbol(Base, Decl(subtypingWithNumericIndexer4.ts, 0, 0))
>foo : Symbol(Base.foo, Decl(subtypingWithNumericIndexer4.ts, 2, 16))
interface Derived extends Base { bar: string; }
>Derived : Symbol(Derived, Decl(subtypingWithNumericIndexer4.ts, 2, 31))
>Base : Symbol(Base, Decl(subtypingWithNumericIndexer4.ts, 0, 0))
>bar : Symbol(Derived.bar, Decl(subtypingWithNumericIndexer4.ts, 3, 32))
interface Derived2 extends Derived { baz: string; }
>Derived2 : Symbol(Derived2, Decl(subtypingWithNumericIndexer4.ts, 3, 47))
>Derived : Symbol(Derived, Decl(subtypingWithNumericIndexer4.ts, 2, 31))
>baz : Symbol(Derived2.baz, Decl(subtypingWithNumericIndexer4.ts, 4, 36))
class A {
>A : Symbol(A, Decl(subtypingWithNumericIndexer4.ts, 4, 51))
[x: number]: Derived;
>x : Symbol(x, Decl(subtypingWithNumericIndexer4.ts, 7, 5))
>Derived : Symbol(Derived, Decl(subtypingWithNumericIndexer4.ts, 2, 31))
}
class B extends A {
>B : Symbol(B, Decl(subtypingWithNumericIndexer4.ts, 8, 1))
>A : Symbol(A, Decl(subtypingWithNumericIndexer4.ts, 4, 51))
[x: number]: string; // error
>x : Symbol(x, Decl(subtypingWithNumericIndexer4.ts, 11, 5))
}
module Generics {
>Generics : Symbol(Generics, Decl(subtypingWithNumericIndexer4.ts, 12, 1))
class A<T extends Derived> {
>A : Symbol(A, Decl(subtypingWithNumericIndexer4.ts, 14, 17))
>T : Symbol(T, Decl(subtypingWithNumericIndexer4.ts, 15, 12))
>Derived : Symbol(Derived, Decl(subtypingWithNumericIndexer4.ts, 2, 31))
[x: number]: T;
>x : Symbol(x, Decl(subtypingWithNumericIndexer4.ts, 16, 9))
>T : Symbol(T, Decl(subtypingWithNumericIndexer4.ts, 15, 12))
}
class B extends A<Base> {
>B : Symbol(B, Decl(subtypingWithNumericIndexer4.ts, 17, 5))
>A : Symbol(A, Decl(subtypingWithNumericIndexer4.ts, 14, 17))
>Base : Symbol(Base, Decl(subtypingWithNumericIndexer4.ts, 0, 0))
[x: number]: string; // error
>x : Symbol(x, Decl(subtypingWithNumericIndexer4.ts, 20, 9))
}
class B3<T extends Derived> extends A<T> {
>B3 : Symbol(B3, Decl(subtypingWithNumericIndexer4.ts, 21, 5))
>T : Symbol(T, Decl(subtypingWithNumericIndexer4.ts, 23, 13))
>Derived : Symbol(Derived, Decl(subtypingWithNumericIndexer4.ts, 2, 31))
>A : Symbol(A, Decl(subtypingWithNumericIndexer4.ts, 14, 17))
>T : Symbol(T, Decl(subtypingWithNumericIndexer4.ts, 23, 13))
[x: number]: string; // error
>x : Symbol(x, Decl(subtypingWithNumericIndexer4.ts, 24, 9))
}
}
|