mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 04:43:37 -05:00
accepted baselines
This commit is contained in:
@@ -1,57 +0,0 @@
|
||||
tests/cases/compiler/abstractClass1.ts(15,9): error TS2511: Cannot create an instance of the abstract class 'Foo'.
|
||||
tests/cases/compiler/abstractClass1.ts(16,9): error TS2346: Supplied parameters do not match any signature of call target.
|
||||
tests/cases/compiler/abstractClass1.ts(16,9): error TS2511: Cannot create an instance of the abstract class 'Foo'.
|
||||
tests/cases/compiler/abstractClass1.ts(25,1): error TS2511: Cannot create an instance of the abstract class 'Qux'.
|
||||
tests/cases/compiler/abstractClass1.ts(35,1): error TS2346: Supplied parameters do not match any signature of call target.
|
||||
tests/cases/compiler/abstractClass1.ts(35,1): error TS2511: Cannot create an instance of the abstract class 'Foo'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/abstractClass1.ts (6 errors) ====
|
||||
|
||||
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
|
||||
~~~~~~~~~~
|
||||
!!! error TS2511: Cannot create an instance of the abstract class 'Foo'.
|
||||
var b = new Foo(); // Error because of invalid constructor arguments
|
||||
~~~~~~~~~
|
||||
!!! error TS2346: Supplied parameters do not match any signature of call target.
|
||||
~~~~~~~~~
|
||||
!!! error TS2511: Cannot create an instance of the abstract class 'Foo'.
|
||||
|
||||
module baz {
|
||||
export abstract class Qux {
|
||||
}
|
||||
export class Quz extends Qux {
|
||||
}
|
||||
}
|
||||
|
||||
new baz.Qux();
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2511: Cannot create an instance of the abstract class '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();
|
||||
~~~~~~~~~~
|
||||
!!! error TS2346: Supplied parameters do not match any signature of call target.
|
||||
~~~~~~~~~~
|
||||
!!! error TS2511: Cannot create an instance of the abstract class 'Foo'.
|
||||
|
||||
@@ -1,106 +0,0 @@
|
||||
//// [abstractClass1.ts]
|
||||
|
||||
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();
|
||||
|
||||
|
||||
//// [abstractClass1.js]
|
||||
var __extends = (this && this.__extends) || function (d, b) {
|
||||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
var Foo = (function () {
|
||||
function Foo(f) {
|
||||
}
|
||||
Foo.bar = function () { };
|
||||
Foo.prototype.empty = function () { };
|
||||
return Foo;
|
||||
})();
|
||||
var Bar = (function (_super) {
|
||||
__extends(Bar, _super);
|
||||
function Bar(f) {
|
||||
_super.call(this, f);
|
||||
}
|
||||
return Bar;
|
||||
})(Foo);
|
||||
var a = new Foo(1); // Error
|
||||
var b = new Foo(); // Error because of invalid constructor arguments
|
||||
var baz;
|
||||
(function (baz) {
|
||||
var Qux = (function () {
|
||||
function Qux() {
|
||||
}
|
||||
return Qux;
|
||||
})();
|
||||
baz.Qux = Qux;
|
||||
var Quz = (function (_super) {
|
||||
__extends(Quz, _super);
|
||||
function Quz() {
|
||||
_super.apply(this, arguments);
|
||||
}
|
||||
return Quz;
|
||||
})(Qux);
|
||||
baz.Quz = Quz;
|
||||
})(baz || (baz = {}));
|
||||
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();
|
||||
|
||||
|
||||
//// [abstractClass1.d.ts]
|
||||
declare abstract class Foo {
|
||||
constructor(f: any);
|
||||
static bar(): void;
|
||||
empty(): void;
|
||||
}
|
||||
declare class Bar extends Foo {
|
||||
constructor(f: any);
|
||||
}
|
||||
declare var a: Foo;
|
||||
declare var b: any;
|
||||
declare module baz {
|
||||
abstract class Qux {
|
||||
}
|
||||
class Quz extends Qux {
|
||||
}
|
||||
}
|
||||
declare var c: Bar;
|
||||
declare var Copy: typeof Foo;
|
||||
@@ -1,14 +0,0 @@
|
||||
//// [abstractClassIdentifierName.ts]
|
||||
class abstract {
|
||||
|
||||
abstract(): void { }
|
||||
}
|
||||
|
||||
|
||||
//// [abstractClassIdentifierName.js]
|
||||
var abstract = (function () {
|
||||
function abstract() {
|
||||
}
|
||||
abstract.prototype.abstract = function () { };
|
||||
return abstract;
|
||||
})();
|
||||
@@ -1,8 +0,0 @@
|
||||
=== tests/cases/compiler/abstractClassIdentifierName.ts ===
|
||||
class abstract {
|
||||
>abstract : Symbol(abstract, Decl(abstractClassIdentifierName.ts, 0, 0))
|
||||
|
||||
abstract(): void { }
|
||||
>abstract : Symbol(abstract, Decl(abstractClassIdentifierName.ts, 0, 16))
|
||||
}
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
=== tests/cases/compiler/abstractClassIdentifierName.ts ===
|
||||
class abstract {
|
||||
>abstract : abstract
|
||||
|
||||
abstract(): void { }
|
||||
>abstract : () => void
|
||||
}
|
||||
|
||||
15
tests/baselines/reference/classAbstractAsIdentifier.js
Normal file
15
tests/baselines/reference/classAbstractAsIdentifier.js
Normal file
@@ -0,0 +1,15 @@
|
||||
//// [classAbstractAsIdentifier.ts]
|
||||
class abstract {
|
||||
foo() { return 1; }
|
||||
}
|
||||
|
||||
new abstract;
|
||||
|
||||
//// [classAbstractAsIdentifier.js]
|
||||
var abstract = (function () {
|
||||
function abstract() {
|
||||
}
|
||||
abstract.prototype.foo = function () { return 1; };
|
||||
return abstract;
|
||||
})();
|
||||
new abstract;
|
||||
11
tests/baselines/reference/classAbstractAsIdentifier.symbols
Normal file
11
tests/baselines/reference/classAbstractAsIdentifier.symbols
Normal file
@@ -0,0 +1,11 @@
|
||||
=== tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractAsIdentifier.ts ===
|
||||
class abstract {
|
||||
>abstract : Symbol(abstract, Decl(classAbstractAsIdentifier.ts, 0, 0))
|
||||
|
||||
foo() { return 1; }
|
||||
>foo : Symbol(foo, Decl(classAbstractAsIdentifier.ts, 0, 16))
|
||||
}
|
||||
|
||||
new abstract;
|
||||
>abstract : Symbol(abstract, Decl(classAbstractAsIdentifier.ts, 0, 0))
|
||||
|
||||
13
tests/baselines/reference/classAbstractAsIdentifier.types
Normal file
13
tests/baselines/reference/classAbstractAsIdentifier.types
Normal file
@@ -0,0 +1,13 @@
|
||||
=== tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractAsIdentifier.ts ===
|
||||
class abstract {
|
||||
>abstract : abstract
|
||||
|
||||
foo() { return 1; }
|
||||
>foo : () => number
|
||||
>1 : number
|
||||
}
|
||||
|
||||
new abstract;
|
||||
>new abstract : abstract
|
||||
>abstract : typeof abstract
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractDeclarations.d.ts(2,5): error TS1236: 'abstract' modifier can only appear on a class or method declaration.
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractDeclarations.d.ts(2,28): error TS1184: An implementation cannot be declared in ambient contexts.
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractDeclarations.d.ts(11,15): error TS2515: Non-abstract class 'CC' does not implement inherited abstract member 'AA.foo'.
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractDeclarations.d.ts(13,15): error TS2515: Non-abstract class 'DD' does not implement inherited abstract member 'BB.foo'.
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractDeclarations.d.ts(17,15): error TS2515: Non-abstract class 'FF' does not implement inherited abstract member 'CC.foo'.
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractDeclarations.d.ts(11,15): error TS2515: Non-abstract class 'CC' does not implement inherited abstract member 'foo' from class 'AA'.
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractDeclarations.d.ts(13,15): error TS2515: Non-abstract class 'DD' does not implement inherited abstract member 'foo' from class 'BB'.
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractDeclarations.d.ts(17,15): error TS2515: Non-abstract class 'FF' does not implement inherited abstract member 'foo' from class 'CC'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractDeclarations.d.ts (5 errors) ====
|
||||
@@ -22,17 +22,17 @@ tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbst
|
||||
|
||||
declare class CC extends AA {}
|
||||
~~
|
||||
!!! error TS2515: Non-abstract class 'CC' does not implement inherited abstract member 'AA.foo'.
|
||||
!!! error TS2515: Non-abstract class 'CC' does not implement inherited abstract member 'foo' from class 'AA'.
|
||||
|
||||
declare class DD extends BB {}
|
||||
~~
|
||||
!!! error TS2515: Non-abstract class 'DD' does not implement inherited abstract member 'BB.foo'.
|
||||
!!! error TS2515: Non-abstract class 'DD' does not implement inherited abstract member 'foo' from class 'BB'.
|
||||
|
||||
declare abstract class EE extends BB {}
|
||||
|
||||
declare class FF extends CC {}
|
||||
~~
|
||||
!!! error TS2515: Non-abstract class 'FF' does not implement inherited abstract member 'CC.foo'.
|
||||
!!! error TS2515: Non-abstract class 'FF' does not implement inherited abstract member 'foo' from class 'CC'.
|
||||
|
||||
declare abstract class GG extends CC {}
|
||||
|
||||
|
||||
13
tests/baselines/reference/classAbstractInAModule.errors.txt
Normal file
13
tests/baselines/reference/classAbstractInAModule.errors.txt
Normal file
@@ -0,0 +1,13 @@
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractInAModule.ts(6,1): error TS2511: Cannot create an instance of the abstract class 'A'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractInAModule.ts (1 errors) ====
|
||||
module M {
|
||||
export abstract class A {}
|
||||
export class B extends A {}
|
||||
}
|
||||
|
||||
new M.A;
|
||||
~~~~~~~
|
||||
!!! error TS2511: Cannot create an instance of the abstract class 'A'.
|
||||
new M.B;
|
||||
34
tests/baselines/reference/classAbstractInAModule.js
Normal file
34
tests/baselines/reference/classAbstractInAModule.js
Normal file
@@ -0,0 +1,34 @@
|
||||
//// [classAbstractInAModule.ts]
|
||||
module M {
|
||||
export abstract class A {}
|
||||
export class B extends A {}
|
||||
}
|
||||
|
||||
new M.A;
|
||||
new M.B;
|
||||
|
||||
//// [classAbstractInAModule.js]
|
||||
var __extends = (this && this.__extends) || function (d, b) {
|
||||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
var M;
|
||||
(function (M) {
|
||||
var A = (function () {
|
||||
function A() {
|
||||
}
|
||||
return A;
|
||||
})();
|
||||
M.A = A;
|
||||
var B = (function (_super) {
|
||||
__extends(B, _super);
|
||||
function B() {
|
||||
_super.apply(this, arguments);
|
||||
}
|
||||
return B;
|
||||
})(A);
|
||||
M.B = B;
|
||||
})(M || (M = {}));
|
||||
new M.A;
|
||||
new M.B;
|
||||
@@ -1,6 +1,6 @@
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractInheritance.ts(13,7): error TS2515: Non-abstract class 'CC' does not implement inherited abstract member 'AA.foo'.
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractInheritance.ts(15,7): error TS2515: Non-abstract class 'DD' does not implement inherited abstract member 'BB.foo'.
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractInheritance.ts(19,7): error TS2515: Non-abstract class 'FF' does not implement inherited abstract member 'CC.foo'.
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractInheritance.ts(13,7): error TS2515: Non-abstract class 'CC' does not implement inherited abstract member 'foo' from class 'AA'.
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractInheritance.ts(15,7): error TS2515: Non-abstract class 'DD' does not implement inherited abstract member 'foo' from class 'BB'.
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractInheritance.ts(19,7): error TS2515: Non-abstract class 'FF' does not implement inherited abstract member 'foo' from class 'CC'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractInheritance.ts (3 errors) ====
|
||||
@@ -18,16 +18,16 @@ tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbst
|
||||
|
||||
class CC extends AA {}
|
||||
~~
|
||||
!!! error TS2515: Non-abstract class 'CC' does not implement inherited abstract member 'AA.foo'.
|
||||
!!! error TS2515: Non-abstract class 'CC' does not implement inherited abstract member 'foo' from class 'AA'.
|
||||
|
||||
class DD extends BB {}
|
||||
~~
|
||||
!!! error TS2515: Non-abstract class 'DD' does not implement inherited abstract member 'BB.foo'.
|
||||
!!! error TS2515: Non-abstract class 'DD' does not implement inherited abstract member 'foo' from class 'BB'.
|
||||
|
||||
abstract class EE extends BB {}
|
||||
|
||||
class FF extends CC {}
|
||||
~~
|
||||
!!! error TS2515: Non-abstract class 'FF' does not implement inherited abstract member 'CC.foo'.
|
||||
!!! error TS2515: Non-abstract class 'FF' does not implement inherited abstract member 'foo' from class 'CC'.
|
||||
|
||||
abstract class GG extends CC {}
|
||||
@@ -1,26 +1,20 @@
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractInstantiations2.ts(6,28): error TS2304: Cannot find name 'bar'.
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractInstantiations2.ts(10,1): error TS2511: Cannot create an instance of the abstract class 'B'.
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractInstantiations2.ts(17,5): error TS2511: Cannot create an instance of the abstract class 'B'.
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractInstantiations2.ts(21,1): error TS2511: Cannot create an instance of the abstract class 'B'.
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractInstantiations2.ts(26,7): error TS2515: Non-abstract class 'C' does not implement inherited abstract member 'B.bar'.
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractInstantiations2.ts(45,14): error TS2516: All declarations of an abstract method must be consecutive.
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractInstantiations2.ts(45,20): error TS1144: '{' or ';' expected.
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractInstantiations2.ts(45,20): error TS2300: Duplicate identifier 'boolean'.
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractInstantiations2.ts(26,7): error TS2515: Non-abstract class 'C' does not implement inherited abstract member 'bar' from class 'B'.
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractInstantiations2.ts(46,5): error TS2391: Function implementation is missing or not immediately following the declaration.
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractInstantiations2.ts(46,5): error TS2512: Overload signatures must all be `abstract` or not `abstract.
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractInstantiations2.ts(46,21): error TS1144: '{' or ';' expected.
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractInstantiations2.ts(46,21): error TS2300: Duplicate identifier 'boolean'.
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractInstantiations2.ts(49,7): error TS2514: Classes containing abstract functions must be marked abstract.
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractInstantiations2.ts(49,7): error TS2514: Classes containing abstract methods must be marked abstract.
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractInstantiations2.ts(50,5): error TS1238: Abstract methods can only appear within an abstract class.
|
||||
|
||||
|
||||
==== tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractInstantiations2.ts (12 errors) ====
|
||||
==== tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractInstantiations2.ts (8 errors) ====
|
||||
class A {
|
||||
// ...
|
||||
}
|
||||
|
||||
abstract class B {
|
||||
foo(): number { return bar(); }
|
||||
~~~
|
||||
!!! error TS2304: Cannot find name 'bar'.
|
||||
foo(): number { return this.bar(); }
|
||||
abstract bar() : number;
|
||||
}
|
||||
|
||||
@@ -48,7 +42,7 @@ tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbst
|
||||
|
||||
class C extends B { } // error -- not declared abstract
|
||||
~
|
||||
!!! error TS2515: Non-abstract class 'C' does not implement inherited abstract member 'B.bar'.
|
||||
!!! error TS2515: Non-abstract class 'C' does not implement inherited abstract member 'bar' from class 'B'.
|
||||
|
||||
abstract class D extends B { } // okay
|
||||
|
||||
@@ -67,24 +61,18 @@ tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbst
|
||||
y : number;
|
||||
abstract quz(x : number, y : string) : boolean; // error -- declarations must be adjacent
|
||||
|
||||
abstract nom() boolean;
|
||||
~~~
|
||||
!!! error TS2516: All declarations of an abstract method must be consecutive.
|
||||
~~~~~~~
|
||||
!!! error TS1144: '{' or ';' expected.
|
||||
~~~~~~~
|
||||
!!! error TS2300: Duplicate identifier 'boolean'.
|
||||
nom(x : number) boolean; // error -- use of modifier abstract must match on all overloads.
|
||||
abstract nom(): boolean;
|
||||
nom(x : number): boolean; // error -- use of modifier abstract must match on all overloads.
|
||||
~~~
|
||||
!!! error TS2391: Function implementation is missing or not immediately following the declaration.
|
||||
~~~
|
||||
!!! error TS2512: Overload signatures must all be `abstract` or not `abstract.
|
||||
~~~~~~~
|
||||
!!! error TS1144: '{' or ';' expected.
|
||||
~~~~~~~
|
||||
!!! error TS2300: Duplicate identifier 'boolean'.
|
||||
}
|
||||
|
||||
class H { // error -- not declared abstract
|
||||
~
|
||||
!!! error TS2514: Classes containing abstract functions must be marked abstract.
|
||||
!!! error TS2514: Classes containing abstract methods must be marked abstract.
|
||||
abstract baz() : number;
|
||||
~~~~~~~~
|
||||
!!! error TS1238: Abstract methods can only appear within an abstract class.
|
||||
}
|
||||
@@ -4,7 +4,7 @@ class A {
|
||||
}
|
||||
|
||||
abstract class B {
|
||||
foo(): number { return bar(); }
|
||||
foo(): number { return this.bar(); }
|
||||
abstract bar() : number;
|
||||
}
|
||||
|
||||
@@ -43,8 +43,8 @@ abstract class G {
|
||||
y : number;
|
||||
abstract quz(x : number, y : string) : boolean; // error -- declarations must be adjacent
|
||||
|
||||
abstract nom() boolean;
|
||||
nom(x : number) boolean; // error -- use of modifier abstract must match on all overloads.
|
||||
abstract nom(): boolean;
|
||||
nom(x : number): boolean; // error -- use of modifier abstract must match on all overloads.
|
||||
}
|
||||
|
||||
class H { // error -- not declared abstract
|
||||
@@ -65,7 +65,7 @@ var A = (function () {
|
||||
var B = (function () {
|
||||
function B() {
|
||||
}
|
||||
B.prototype.foo = function () { return bar(); };
|
||||
B.prototype.foo = function () { return this.bar(); };
|
||||
return B;
|
||||
})();
|
||||
new B; // error
|
||||
@@ -112,8 +112,6 @@ var F = (function (_super) {
|
||||
var G = (function () {
|
||||
function G() {
|
||||
}
|
||||
G.prototype.nom = ;
|
||||
G.prototype.nom = ;
|
||||
return G;
|
||||
})();
|
||||
var H = (function () {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractMixedWithModifiers.ts(6,13): error TS1237: 'private' modifier cannot be used with 'abstract' modifier.
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractMixedWithModifiers.ts(8,14): error TS1029: 'public' modifier must precede 'abstract' modifier.
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractMixedWithModifiers.ts(9,14): error TS1029: 'protected' modifier must precede 'abstract' modifier.
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractMixedWithModifiers.ts(10,14): error TS1029: 'private' modifier must precede 'abstract' modifier.
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractMixedWithModifiers.ts(10,14): error TS1237: 'private' modifier cannot be used with 'abstract' modifier.
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractMixedWithModifiers.ts(12,14): error TS1237: 'static' modifier cannot be used with 'abstract' modifier.
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractMixedWithModifiers.ts(14,12): error TS1237: 'static' modifier cannot be used with 'abstract' modifier.
|
||||
|
||||
@@ -24,7 +24,7 @@ tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbst
|
||||
!!! error TS1029: 'protected' modifier must precede 'abstract' modifier.
|
||||
abstract private foo_dd();
|
||||
~~~~~~~
|
||||
!!! error TS1029: 'private' modifier must precede 'abstract' modifier.
|
||||
!!! error TS1237: 'private' modifier cannot be used with 'abstract' modifier.
|
||||
|
||||
abstract static foo_d();
|
||||
~~~~~~
|
||||
|
||||
@@ -2,10 +2,11 @@ tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbst
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractProperties.ts(3,12): error TS1236: 'abstract' modifier can only appear on a class or method declaration.
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractProperties.ts(4,15): error TS1236: 'abstract' modifier can only appear on a class or method declaration.
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractProperties.ts(5,13): error TS1236: 'abstract' modifier can only appear on a class or method declaration.
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractProperties.ts(10,13): error TS1237: 'private' modifier cannot be used with 'abstract' modifier.
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractProperties.ts(7,5): error TS1236: 'abstract' modifier can only appear on a class or method declaration.
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractProperties.ts(12,13): error TS1237: 'private' modifier cannot be used with 'abstract' modifier.
|
||||
|
||||
|
||||
==== tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractProperties.ts (5 errors) ====
|
||||
==== tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractProperties.ts (6 errors) ====
|
||||
abstract class A {
|
||||
abstract x : number;
|
||||
~~~~~~~~
|
||||
@@ -20,6 +21,10 @@ tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbst
|
||||
~~~~~~~~
|
||||
!!! error TS1236: 'abstract' modifier can only appear on a class or method declaration.
|
||||
|
||||
abstract m: () => void;
|
||||
~~~~~~~~
|
||||
!!! error TS1236: 'abstract' modifier can only appear on a class or method declaration.
|
||||
|
||||
abstract foo_x() : number;
|
||||
public abstract foo_y() : number;
|
||||
protected abstract foo_z() : number;
|
||||
|
||||
@@ -5,6 +5,8 @@ abstract class A {
|
||||
protected abstract z : number;
|
||||
private abstract w : number;
|
||||
|
||||
abstract m: () => void;
|
||||
|
||||
abstract foo_x() : number;
|
||||
public abstract foo_y() : number;
|
||||
protected abstract foo_z() : number;
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractSuperCalls.ts(14,26): error TS2513: Abstract method 'foo.B' cannot be called via super expression.
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractSuperCalls.ts(14,26): error TS2513: Abstract method 'foo' in class 'B' cannot be accessed via super expression.
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractSuperCalls.ts(14,41): error TS2513: Abstract method 'foo' in class 'B' cannot be accessed via super expression.
|
||||
|
||||
|
||||
==== tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractSuperCalls.ts (1 errors) ====
|
||||
==== tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractSuperCalls.ts (2 errors) ====
|
||||
|
||||
class A {
|
||||
foo() { return 1; }
|
||||
@@ -15,9 +16,11 @@ tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbst
|
||||
|
||||
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
|
||||
~~~
|
||||
!!! error TS2513: Abstract method 'foo.B' cannot be called via super expression.
|
||||
!!! error TS2513: Abstract method 'foo' in class 'B' cannot be accessed via super expression.
|
||||
~~~
|
||||
!!! error TS2513: Abstract method 'foo' in class 'B' cannot be accessed via super expression.
|
||||
norf() { return super.bar(); }
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,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(); }
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ var C = (function (_super) {
|
||||
_super.apply(this, arguments);
|
||||
}
|
||||
C.prototype.foo = function () { return 2; };
|
||||
C.prototype.qux = function () { return _super.prototype.foo.call(this); }; // error, super is abstract
|
||||
C.prototype.qux = function () { return _super.prototype.foo.call(this) || _super.prototype.foo; }; // 2 errors, foo is abstract
|
||||
C.prototype.norf = function () { return _super.prototype.bar.call(this); };
|
||||
return C;
|
||||
})(B);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractUsingAbstractMethod.ts(16,5): error TS2511: Cannot create an instance of the abstract class 'C'.
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractUsingAbstractMethod1.ts(16,5): error TS2511: Cannot create an instance of the abstract class 'C'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractUsingAbstractMethod.ts (1 errors) ====
|
||||
==== tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractUsingAbstractMethod1.ts (1 errors) ====
|
||||
abstract class A {
|
||||
abstract foo() : number;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
//// [classAbstractUsingAbstractMethod.ts]
|
||||
//// [classAbstractUsingAbstractMethod1.ts]
|
||||
abstract class A {
|
||||
abstract foo() : number;
|
||||
}
|
||||
@@ -17,7 +17,7 @@ a.foo();
|
||||
a = new C; // error, cannot instantiate abstract class.
|
||||
a.foo();
|
||||
|
||||
//// [classAbstractUsingAbstractMethod.js]
|
||||
//// [classAbstractUsingAbstractMethod1.js]
|
||||
var __extends = (this && this.__extends) || function (d, b) {
|
||||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
|
||||
function __() { this.constructor = d; }
|
||||
@@ -0,0 +1,42 @@
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractUsingAbstractMethods2.ts(1,7): error TS2514: Classes containing abstract methods must be marked abstract.
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractUsingAbstractMethods2.ts(2,5): error TS1238: Abstract methods can only appear within an abstract class.
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractUsingAbstractMethods2.ts(5,7): error TS2515: Non-abstract class 'B' does not implement inherited abstract member 'foo' from class 'A'.
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractUsingAbstractMethods2.ts(21,7): error TS2515: Non-abstract class 'BB' does not implement inherited abstract member 'foo' from class 'AA'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractUsingAbstractMethods2.ts (4 errors) ====
|
||||
class A {
|
||||
~
|
||||
!!! error TS2514: Classes containing abstract methods must be marked abstract.
|
||||
abstract foo();
|
||||
~~~~~~~~
|
||||
!!! error TS1238: Abstract methods can only appear within an abstract class.
|
||||
}
|
||||
|
||||
class B extends A {}
|
||||
~
|
||||
!!! error TS2515: Non-abstract class 'B' does not implement inherited abstract member 'foo' from class 'A'.
|
||||
|
||||
abstract class C extends A {}
|
||||
|
||||
class D extends A {
|
||||
foo() {}
|
||||
}
|
||||
|
||||
abstract class E extends A {
|
||||
foo() {}
|
||||
}
|
||||
|
||||
abstract class AA {
|
||||
abstract foo();
|
||||
}
|
||||
|
||||
class BB extends AA {}
|
||||
~~
|
||||
!!! error TS2515: Non-abstract class 'BB' does not implement inherited abstract member 'foo' from class 'AA'.
|
||||
|
||||
abstract class CC extends AA {}
|
||||
|
||||
class DD extends AA {
|
||||
foo() {}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
//// [classWithAbstractMethods.ts]
|
||||
//// [classAbstractUsingAbstractMethods2.ts]
|
||||
class A {
|
||||
abstract foo();
|
||||
}
|
||||
@@ -27,7 +27,7 @@ class DD extends AA {
|
||||
foo() {}
|
||||
}
|
||||
|
||||
//// [classWithAbstractMethods.js]
|
||||
//// [classAbstractUsingAbstractMethods2.js]
|
||||
var __extends = (this && this.__extends) || function (d, b) {
|
||||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
|
||||
function __() { this.constructor = d; }
|
||||
@@ -0,0 +1,7 @@
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractWithInterface.ts(1,1): error TS1236: 'abstract' modifier can only appear on a class or method declaration.
|
||||
|
||||
|
||||
==== tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractWithInterface.ts (1 errors) ====
|
||||
abstract interface I {}
|
||||
~~~~~~~~
|
||||
!!! error TS1236: 'abstract' modifier can only appear on a class or method declaration.
|
||||
4
tests/baselines/reference/classAbstractWithInterface.js
Normal file
4
tests/baselines/reference/classAbstractWithInterface.js
Normal file
@@ -0,0 +1,4 @@
|
||||
//// [classAbstractWithInterface.ts]
|
||||
abstract interface I {}
|
||||
|
||||
//// [classAbstractWithInterface.js]
|
||||
@@ -1,42 +0,0 @@
|
||||
tests/cases/conformance/classes/classDeclarations/classWithAbstractMethods.ts(1,7): error TS2514: Classes containing abstract functions must be marked abstract.
|
||||
tests/cases/conformance/classes/classDeclarations/classWithAbstractMethods.ts(2,5): error TS1238: Abstract methods can only appear within an abstract class.
|
||||
tests/cases/conformance/classes/classDeclarations/classWithAbstractMethods.ts(5,7): error TS2515: Non-abstract class 'B' does not implement inherited abstract member 'A.foo'.
|
||||
tests/cases/conformance/classes/classDeclarations/classWithAbstractMethods.ts(21,7): error TS2515: Non-abstract class 'BB' does not implement inherited abstract member 'AA.foo'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/classes/classDeclarations/classWithAbstractMethods.ts (4 errors) ====
|
||||
class A {
|
||||
~
|
||||
!!! error TS2514: Classes containing abstract functions must be marked abstract.
|
||||
abstract foo();
|
||||
~~~~~~~~
|
||||
!!! error TS1238: Abstract methods can only appear within an abstract class.
|
||||
}
|
||||
|
||||
class B extends A {}
|
||||
~
|
||||
!!! error TS2515: Non-abstract class 'B' does not implement inherited abstract member 'A.foo'.
|
||||
|
||||
abstract class C extends A {}
|
||||
|
||||
class D extends A {
|
||||
foo() {}
|
||||
}
|
||||
|
||||
abstract class E extends A {
|
||||
foo() {}
|
||||
}
|
||||
|
||||
abstract class AA {
|
||||
abstract foo();
|
||||
}
|
||||
|
||||
class BB extends AA {}
|
||||
~~
|
||||
!!! error TS2515: Non-abstract class 'BB' does not implement inherited abstract member 'AA.foo'.
|
||||
|
||||
abstract class CC extends AA {}
|
||||
|
||||
class DD extends AA {
|
||||
foo() {}
|
||||
}
|
||||
Reference in New Issue
Block a user