mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-15 03:23:08 -06:00
added tests
This commit is contained in:
parent
1efff2857f
commit
c93bde693b
@ -0,0 +1,25 @@
|
||||
abstract class A<T> {
|
||||
t: T;
|
||||
|
||||
abstract foo(): T;
|
||||
abstract bar(t: T);
|
||||
}
|
||||
|
||||
abstract class B<T> extends A<T> {}
|
||||
|
||||
class C<T> extends A<T> {} // error -- inherits abstract methods
|
||||
|
||||
class D extends A<number> {} // error -- inherits abstract methods
|
||||
|
||||
class E<T> extends A<T> { // error -- doesn't implement bar
|
||||
foo() { return this.t; }
|
||||
}
|
||||
|
||||
class F<T> extends A<T> { // error -- doesn't implement foo
|
||||
bar(t : T) {}
|
||||
}
|
||||
|
||||
class G<T> extends A<T> {
|
||||
foo() { return this.t; }
|
||||
bar(t: T) { }
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
abstract class CM {}
|
||||
module CM {}
|
||||
|
||||
module MC {}
|
||||
abstract class MC {}
|
||||
|
||||
abstract class CI {}
|
||||
interface CI {}
|
||||
|
||||
interface IC {}
|
||||
abstract class IC {}
|
||||
|
||||
abstract class CC1 {}
|
||||
class CC1 {}
|
||||
|
||||
class CC2 {}
|
||||
abstract class CC2 {}
|
||||
|
||||
new CM;
|
||||
new MC;
|
||||
new CI;
|
||||
new IC;
|
||||
new CC1;
|
||||
new CC2;
|
||||
Loading…
x
Reference in New Issue
Block a user