Added test for abstract-classes

This commit is contained in:
Dick van den Brink
2015-04-30 18:34:06 +02:00
parent 3aeae55fc3
commit 9436934aa5
4 changed files with 50 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
// @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

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

View File

@@ -0,0 +1,6 @@
var abstract = true;
function foo() {
"use strict";
var abstract = true;
}

View File

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