mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-11 16:38:46 -05:00
Added tests/baselines.
This commit is contained in:
@@ -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]
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
}
|
||||
|
||||
@@ -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]
|
||||
@@ -0,0 +1,8 @@
|
||||
interface Foo {
|
||||
f(x: any): any;
|
||||
}
|
||||
interface Bar {
|
||||
f<T>(x: T): T;
|
||||
}
|
||||
interface Hello extends Foo, Bar {
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
interface Foo {
|
||||
f(x: any): any;
|
||||
}
|
||||
interface Bar {
|
||||
f<T>(x: T): T;
|
||||
}
|
||||
interface Hello extends Bar, Foo {
|
||||
}
|
||||
Reference in New Issue
Block a user