Conflicts: tests/baselines/reference/APISample_compile.types tests/baselines/reference/APISample_linter.types tests/baselines/reference/APISample_transform.types tests/baselines/reference/APISample_watcher.types
43 lines
2 KiB
Text
43 lines
2 KiB
Text
=== tests/cases/compiler/typeParameterExtendingUnion1.ts ===
|
|
class Animal { run() { } }
|
|
>Animal : Symbol(Animal, Decl(typeParameterExtendingUnion1.ts, 0, 0))
|
|
>run : Symbol(run, Decl(typeParameterExtendingUnion1.ts, 0, 14))
|
|
|
|
class Cat extends Animal { meow }
|
|
>Cat : Symbol(Cat, Decl(typeParameterExtendingUnion1.ts, 0, 26))
|
|
>Animal : Symbol(Animal, Decl(typeParameterExtendingUnion1.ts, 0, 0))
|
|
>meow : Symbol(meow, Decl(typeParameterExtendingUnion1.ts, 1, 26))
|
|
|
|
class Dog extends Animal { woof }
|
|
>Dog : Symbol(Dog, Decl(typeParameterExtendingUnion1.ts, 1, 33))
|
|
>Animal : Symbol(Animal, Decl(typeParameterExtendingUnion1.ts, 0, 0))
|
|
>woof : Symbol(woof, Decl(typeParameterExtendingUnion1.ts, 2, 26))
|
|
|
|
function run(a: Animal) {
|
|
>run : Symbol(run, Decl(typeParameterExtendingUnion1.ts, 2, 33))
|
|
>a : Symbol(a, Decl(typeParameterExtendingUnion1.ts, 4, 13))
|
|
>Animal : Symbol(Animal, Decl(typeParameterExtendingUnion1.ts, 0, 0))
|
|
|
|
a.run();
|
|
>a.run : Symbol(Animal.run, Decl(typeParameterExtendingUnion1.ts, 0, 14))
|
|
>a : Symbol(a, Decl(typeParameterExtendingUnion1.ts, 4, 13))
|
|
>run : Symbol(Animal.run, Decl(typeParameterExtendingUnion1.ts, 0, 14))
|
|
}
|
|
|
|
function f<T extends Cat | Dog>(a: T) {
|
|
>f : Symbol(f, Decl(typeParameterExtendingUnion1.ts, 6, 1))
|
|
>T : Symbol(T, Decl(typeParameterExtendingUnion1.ts, 8, 11))
|
|
>Cat : Symbol(Cat, Decl(typeParameterExtendingUnion1.ts, 0, 26))
|
|
>Dog : Symbol(Dog, Decl(typeParameterExtendingUnion1.ts, 1, 33))
|
|
>a : Symbol(a, Decl(typeParameterExtendingUnion1.ts, 8, 32))
|
|
>T : Symbol(T, Decl(typeParameterExtendingUnion1.ts, 8, 11))
|
|
|
|
a.run();
|
|
>a.run : Symbol(run, Decl(typeParameterExtendingUnion1.ts, 0, 14), Decl(typeParameterExtendingUnion1.ts, 0, 14))
|
|
>a : Symbol(a, Decl(typeParameterExtendingUnion1.ts, 8, 32))
|
|
>run : Symbol(run, Decl(typeParameterExtendingUnion1.ts, 0, 14), Decl(typeParameterExtendingUnion1.ts, 0, 14))
|
|
|
|
run(a);
|
|
>run : Symbol(run, Decl(typeParameterExtendingUnion1.ts, 2, 33))
|
|
>a : Symbol(a, Decl(typeParameterExtendingUnion1.ts, 8, 32))
|
|
}
|