mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-11-18 20:11:14 +00:00
moved tests, added a test
This commit is contained in:
1 parent
8f1790de4a
commit
df3560f6a7
10 files changed
+26
-1
No files matched your search
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+17
@@ -0,0 +1,17 @@
|
||||
abstract class A {
|
||||
abstract foo() : number;
|
||||
}
|
||||
|
||||
class B extends A {
|
||||
foo() { return 1; }
|
||||
}
|
||||
|
||||
abstract class C extends A {
|
||||
abstract foo() : number;
|
||||
}
|
||||
|
||||
var a = new B;
|
||||
a.foo();
|
||||
|
||||
a = new C; // error, cannot instantiate abstract class.
|
||||
a.foo();
|
||||
+9
-1
@@ -15,4 +15,12 @@ var c : C;
|
||||
|
||||
a = new B;
|
||||
b = new B;
|
||||
c = new B;
|
||||
c = new B;
|
||||
|
||||
module M {
|
||||
export abstract class A {}
|
||||
}
|
||||
|
||||
import myA = M.A;
|
||||
|
||||
var aa = new myA;
|
||||
Reference in new issue
Block a user