TypeScript/tests/baselines/reference/typeParameterExtendingUnion1.types
Cyrus Najmabadi 87b06f4c3f Merge branch 'master' into symbolWriter2
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
2015-04-15 17:01:36 -07:00

47 lines
748 B
Plaintext

=== tests/cases/compiler/typeParameterExtendingUnion1.ts ===
class Animal { run() { } }
>Animal : Animal
>run : () => void
class Cat extends Animal { meow }
>Cat : Cat
>Animal : Animal
>meow : any
class Dog extends Animal { woof }
>Dog : Dog
>Animal : Animal
>woof : any
function run(a: Animal) {
>run : (a: Animal) => void
>a : Animal
>Animal : Animal
a.run();
>a.run() : void
>a.run : () => void
>a : Animal
>run : () => void
}
function f<T extends Cat | Dog>(a: T) {
>f : <T extends Cat | Dog>(a: T) => void
>T : T
>Cat : Cat
>Dog : Dog
>a : T
>T : T
a.run();
>a.run() : void
>a.run : () => void
>a : T
>run : () => void
run(a);
>run(a) : void
>run : (a: Animal) => void
>a : T
}