Moved tests to classAbstractKeyword folder

This commit is contained in:
Arthur Ozga 2015-06-23 10:33:41 -07:00
parent 9451aa66ee
commit 1068890fcd
8 changed files with 14 additions and 41 deletions

View File

@ -1,36 +0,0 @@
// @declaration: true
abstract class Foo {
constructor(f: any) { }
public static bar(): void { }
public empty() { }
}
class Bar extends Foo {
constructor(f: any) {
super(f);
}
}
var a = new Foo(1); // Error
var b = new Foo(); // Error because of invalid constructor arguments
module baz {
export abstract class Qux {
}
export class Quz extends Qux {
}
}
new baz.Qux();
// Valid
var c = new Bar(1);
c.empty();
// Calling a static method on a abstract class is valid
Foo.bar();
var Copy = Foo;
new Copy();

View File

@ -1,4 +0,0 @@
class abstract {
abstract(): void { }
}

View File

@ -0,0 +1,5 @@
class abstract {
foo() { return 1; }
}
new abstract;

View File

@ -0,0 +1,7 @@
module M {
export abstract class A {}
export class B extends A {}
}
new M.A;
new M.B;

View File

@ -11,7 +11,7 @@ abstract class B extends A {
class C extends B {
foo() { return 2; }
qux() { return super.foo(); } // error, super is abstract
qux() { return super.foo() || super.foo; } // 2 errors, foo is abstract
norf() { return super.bar(); }
}