mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-09 02:30:15 -06:00
Moved tests to classAbstractKeyword folder
This commit is contained in:
parent
9451aa66ee
commit
1068890fcd
@ -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();
|
||||
@ -1,4 +0,0 @@
|
||||
class abstract {
|
||||
|
||||
abstract(): void { }
|
||||
}
|
||||
@ -0,0 +1,5 @@
|
||||
class abstract {
|
||||
foo() { return 1; }
|
||||
}
|
||||
|
||||
new abstract;
|
||||
@ -0,0 +1,7 @@
|
||||
module M {
|
||||
export abstract class A {}
|
||||
export class B extends A {}
|
||||
}
|
||||
|
||||
new M.A;
|
||||
new M.B;
|
||||
@ -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(); }
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1 @@
|
||||
abstract interface I {}
|
||||
Loading…
x
Reference in New Issue
Block a user