Added tests/baselines.

This commit is contained in:
Daniel Rosenwasser
2014-12-18 16:34:14 -08:00
parent 5ecc28834e
commit 50d0f9b719
6 changed files with 81 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
//// [genericAndNonGenericInheritedSignature1.ts]
interface Foo {
f(x: any): any;
}
interface Bar {
f<T>(x: T): T;
}
interface Hello extends Foo, Bar {
}
//// [genericAndNonGenericInheritedSignature1.js]

View File

@@ -0,0 +1,24 @@
=== tests/cases/compiler/genericAndNonGenericInheritedSignature1.ts ===
interface Foo {
>Foo : Foo
f(x: any): any;
>f : (x: any) => any
>x : any
}
interface Bar {
>Bar : Bar
f<T>(x: T): T;
>f : <T>(x: T) => T
>T : T
>x : T
>T : T
>T : T
}
interface Hello extends Foo, Bar {
>Hello : Hello
>Foo : Foo
>Bar : Bar
}

View File

@@ -0,0 +1,17 @@
tests/cases/compiler/genericAndNonGenericInheritedSignature2.ts(7,11): error TS2320: Interface 'Hello' cannot simultaneously extend types 'Bar' and 'Foo'.
Named properties 'f' of types 'Bar' and 'Foo' are not identical.
==== tests/cases/compiler/genericAndNonGenericInheritedSignature2.ts (1 errors) ====
interface Foo {
f(x: any): any;
}
interface Bar {
f<T>(x: T): T;
}
interface Hello extends Bar, Foo {
~~~~~
!!! error TS2320: Interface 'Hello' cannot simultaneously extend types 'Bar' and 'Foo'.
!!! error TS2320: Named properties 'f' of types 'Bar' and 'Foo' are not identical.
}

View File

@@ -0,0 +1,12 @@
//// [genericAndNonGenericInheritedSignature2.ts]
interface Foo {
f(x: any): any;
}
interface Bar {
f<T>(x: T): T;
}
interface Hello extends Bar, Foo {
}
//// [genericAndNonGenericInheritedSignature2.js]

View File

@@ -0,0 +1,8 @@
interface Foo {
f(x: any): any;
}
interface Bar {
f<T>(x: T): T;
}
interface Hello extends Foo, Bar {
}

View File

@@ -0,0 +1,8 @@
interface Foo {
f(x: any): any;
}
interface Bar {
f<T>(x: T): T;
}
interface Hello extends Bar, Foo {
}