mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
merge with extendsExpressions
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
tests/cases/conformance/es6/variableDeclarations/VariableDeclaration11_es6.ts(2,4): error TS1123: Variable declaration list cannot be empty.
|
||||
tests/cases/conformance/es6/variableDeclarations/VariableDeclaration11_es6.ts(2,1): error TS1212: Identifier expected. 'let' is a reserved word in strict mode
|
||||
tests/cases/conformance/es6/variableDeclarations/VariableDeclaration11_es6.ts(2,1): error TS2304: Cannot find name 'let'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/variableDeclarations/VariableDeclaration11_es6.ts (1 errors) ====
|
||||
==== tests/cases/conformance/es6/variableDeclarations/VariableDeclaration11_es6.ts (2 errors) ====
|
||||
"use strict";
|
||||
let
|
||||
|
||||
!!! error TS1123: Variable declaration list cannot be empty.
|
||||
~~~
|
||||
!!! error TS1212: Identifier expected. 'let' is a reserved word in strict mode
|
||||
~~~
|
||||
!!! error TS2304: Cannot find name 'let'.
|
||||
@@ -4,4 +4,4 @@ let
|
||||
|
||||
//// [VariableDeclaration11_es6.js]
|
||||
"use strict";
|
||||
let ;
|
||||
let;
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression18_es6.ts(2,1): error TS1163: A 'yield' expression is only allowed in a generator body.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression18_es6.ts(2,1): error TS1212: Identifier expected. 'yield' is a reserved word in strict mode
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression18_es6.ts(2,1): error TS2304: Cannot find name 'yield'.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression18_es6.ts(2,7): error TS2304: Cannot find name 'foo'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression18_es6.ts (1 errors) ====
|
||||
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression18_es6.ts (3 errors) ====
|
||||
"use strict";
|
||||
yield(foo);
|
||||
~~~~~
|
||||
!!! error TS1163: A 'yield' expression is only allowed in a generator body.
|
||||
!!! error TS1212: Identifier expected. 'yield' is a reserved word in strict mode
|
||||
~~~~~
|
||||
!!! error TS2304: Cannot find name 'yield'.
|
||||
~~~
|
||||
!!! error TS2304: Cannot find name 'foo'.
|
||||
@@ -4,4 +4,4 @@ yield(foo);
|
||||
|
||||
//// [YieldExpression18_es6.js]
|
||||
"use strict";
|
||||
yield (foo);
|
||||
yield(foo);
|
||||
|
||||
@@ -53,9 +53,9 @@ import Backbone = require("aliasUsage1_backbone");
|
||||
|
||||
export class VisualizationModel extends Backbone.Model {
|
||||
>VisualizationModel : VisualizationModel
|
||||
>Backbone.Model : any
|
||||
>Backbone.Model : Backbone.Model
|
||||
>Backbone : typeof Backbone
|
||||
>Model : Backbone.Model
|
||||
>Model : typeof Backbone.Model
|
||||
|
||||
// interesting stuff here
|
||||
}
|
||||
|
||||
@@ -41,9 +41,9 @@ import Backbone = require("aliasUsageInArray_backbone");
|
||||
|
||||
export class VisualizationModel extends Backbone.Model {
|
||||
>VisualizationModel : VisualizationModel
|
||||
>Backbone.Model : any
|
||||
>Backbone.Model : Backbone.Model
|
||||
>Backbone : typeof Backbone
|
||||
>Model : Backbone.Model
|
||||
>Model : typeof Backbone.Model
|
||||
|
||||
// interesting stuff here
|
||||
}
|
||||
|
||||
@@ -42,9 +42,9 @@ import Backbone = require("aliasUsageInFunctionExpression_backbone");
|
||||
|
||||
export class VisualizationModel extends Backbone.Model {
|
||||
>VisualizationModel : VisualizationModel
|
||||
>Backbone.Model : any
|
||||
>Backbone.Model : Backbone.Model
|
||||
>Backbone : typeof Backbone
|
||||
>Model : Backbone.Model
|
||||
>Model : typeof Backbone.Model
|
||||
|
||||
// interesting stuff here
|
||||
}
|
||||
|
||||
@@ -57,9 +57,9 @@ import Backbone = require("aliasUsageInGenericFunction_backbone");
|
||||
|
||||
export class VisualizationModel extends Backbone.Model {
|
||||
>VisualizationModel : VisualizationModel
|
||||
>Backbone.Model : any
|
||||
>Backbone.Model : Backbone.Model
|
||||
>Backbone : typeof Backbone
|
||||
>Model : Backbone.Model
|
||||
>Model : typeof Backbone.Model
|
||||
|
||||
// interesting stuff here
|
||||
}
|
||||
|
||||
@@ -50,9 +50,9 @@ import Backbone = require("aliasUsageInIndexerOfClass_backbone");
|
||||
|
||||
export class VisualizationModel extends Backbone.Model {
|
||||
>VisualizationModel : VisualizationModel
|
||||
>Backbone.Model : any
|
||||
>Backbone.Model : Backbone.Model
|
||||
>Backbone : typeof Backbone
|
||||
>Model : Backbone.Model
|
||||
>Model : typeof Backbone.Model
|
||||
|
||||
// interesting stuff here
|
||||
}
|
||||
|
||||
@@ -55,9 +55,9 @@ import Backbone = require("aliasUsageInObjectLiteral_backbone");
|
||||
|
||||
export class VisualizationModel extends Backbone.Model {
|
||||
>VisualizationModel : VisualizationModel
|
||||
>Backbone.Model : any
|
||||
>Backbone.Model : Backbone.Model
|
||||
>Backbone : typeof Backbone
|
||||
>Model : Backbone.Model
|
||||
>Model : typeof Backbone.Model
|
||||
|
||||
// interesting stuff here
|
||||
}
|
||||
|
||||
@@ -79,9 +79,9 @@ import Backbone = require("aliasUsageInOrExpression_backbone");
|
||||
|
||||
export class VisualizationModel extends Backbone.Model {
|
||||
>VisualizationModel : VisualizationModel
|
||||
>Backbone.Model : any
|
||||
>Backbone.Model : Backbone.Model
|
||||
>Backbone : typeof Backbone
|
||||
>Model : Backbone.Model
|
||||
>Model : typeof Backbone.Model
|
||||
|
||||
// interesting stuff here
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ class C<T extends IHasVisualizationModel> {
|
||||
}
|
||||
class D extends C<IHasVisualizationModel> {
|
||||
>D : D
|
||||
>C : C<T>
|
||||
>C : C<IHasVisualizationModel>
|
||||
>IHasVisualizationModel : IHasVisualizationModel
|
||||
|
||||
x = moduleA;
|
||||
@@ -46,9 +46,9 @@ import Backbone = require("aliasUsageInTypeArgumentOfExtendsClause_backbone");
|
||||
|
||||
export class VisualizationModel extends Backbone.Model {
|
||||
>VisualizationModel : VisualizationModel
|
||||
>Backbone.Model : any
|
||||
>Backbone.Model : Backbone.Model
|
||||
>Backbone : typeof Backbone
|
||||
>Model : Backbone.Model
|
||||
>Model : typeof Backbone.Model
|
||||
|
||||
// interesting stuff here
|
||||
}
|
||||
|
||||
@@ -37,9 +37,9 @@ import Backbone = require("aliasUsageInVarAssignment_backbone");
|
||||
|
||||
export class VisualizationModel extends Backbone.Model {
|
||||
>VisualizationModel : VisualizationModel
|
||||
>Backbone.Model : any
|
||||
>Backbone.Model : Backbone.Model
|
||||
>Backbone : typeof Backbone
|
||||
>Model : Backbone.Model
|
||||
>Model : typeof Backbone.Model
|
||||
|
||||
// interesting stuff here
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ class List<T> {
|
||||
class DerivedList<U> extends List<U> {
|
||||
>DerivedList : DerivedList<U>
|
||||
>U : U
|
||||
>List : List<T>
|
||||
>List : List<U>
|
||||
>U : U
|
||||
|
||||
foo: U;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
class C<T1> extends CBase<T1> {
|
||||
>C : C<T1>
|
||||
>T1 : T1
|
||||
>CBase : CBase<T2>
|
||||
>CBase : CBase<T1>
|
||||
>T1 : T1
|
||||
|
||||
public works() {
|
||||
@@ -35,7 +35,7 @@ class C<T1> extends CBase<T1> {
|
||||
class CBase<T2> extends CBaseBase<Wrapper<T2>> {
|
||||
>CBase : CBase<T2>
|
||||
>T2 : T2
|
||||
>CBaseBase : CBaseBase<T3>
|
||||
>CBaseBase : CBaseBase<Wrapper<T2>>
|
||||
>Wrapper : Wrapper<T5>
|
||||
>T2 : T2
|
||||
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
tests/cases/compiler/checkForObjectTooStrict.ts(22,19): error TS2311: A class may only extend another class.
|
||||
tests/cases/compiler/checkForObjectTooStrict.ts(26,9): error TS2335: 'super' can only be referenced in a derived class.
|
||||
|
||||
|
||||
==== tests/cases/compiler/checkForObjectTooStrict.ts (2 errors) ====
|
||||
module Foo {
|
||||
|
||||
export class Object {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
class Bar extends Foo.Object { // should work
|
||||
|
||||
constructor () {
|
||||
|
||||
super();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
class Baz extends Object {
|
||||
~~~~~~
|
||||
!!! error TS2311: A class may only extend another class.
|
||||
|
||||
constructor () { // ERROR, as expected
|
||||
|
||||
super();
|
||||
~~~~~
|
||||
!!! error TS2335: 'super' can only be referenced in a derived class.
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
=== tests/cases/compiler/checkForObjectTooStrict.ts ===
|
||||
module Foo {
|
||||
>Foo : Symbol(Foo, Decl(checkForObjectTooStrict.ts, 0, 0))
|
||||
|
||||
export class Object {
|
||||
>Object : Symbol(Object, Decl(checkForObjectTooStrict.ts, 0, 12))
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
class Bar extends Foo.Object { // should work
|
||||
>Bar : Symbol(Bar, Decl(checkForObjectTooStrict.ts, 6, 1))
|
||||
>Foo.Object : Symbol(Foo.Object, Decl(checkForObjectTooStrict.ts, 0, 12))
|
||||
>Foo : Symbol(Foo, Decl(checkForObjectTooStrict.ts, 0, 0))
|
||||
>Object : Symbol(Foo.Object, Decl(checkForObjectTooStrict.ts, 0, 12))
|
||||
|
||||
constructor () {
|
||||
|
||||
super();
|
||||
>super : Symbol(Foo.Object, Decl(checkForObjectTooStrict.ts, 0, 12))
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
class Baz extends Object {
|
||||
>Baz : Symbol(Baz, Decl(checkForObjectTooStrict.ts, 18, 1))
|
||||
>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11))
|
||||
|
||||
constructor () { // ERROR, as expected
|
||||
|
||||
super();
|
||||
>super : Symbol(ObjectConstructor, Decl(lib.d.ts, 124, 1))
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
=== tests/cases/compiler/checkForObjectTooStrict.ts ===
|
||||
module Foo {
|
||||
>Foo : typeof Foo
|
||||
|
||||
export class Object {
|
||||
>Object : Object
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
class Bar extends Foo.Object { // should work
|
||||
>Bar : Bar
|
||||
>Foo.Object : Foo.Object
|
||||
>Foo : typeof Foo
|
||||
>Object : typeof Foo.Object
|
||||
|
||||
constructor () {
|
||||
|
||||
super();
|
||||
>super() : void
|
||||
>super : typeof Foo.Object
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
class Baz extends Object {
|
||||
>Baz : Baz
|
||||
>Object : Object
|
||||
|
||||
constructor () { // ERROR, as expected
|
||||
|
||||
super();
|
||||
>super() : void
|
||||
>super : ObjectConstructor
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -10,9 +10,9 @@ module B {
|
||||
|
||||
export class D extends a.C {
|
||||
>D : D
|
||||
>a.C : any
|
||||
>a.C : a.C
|
||||
>a : typeof a
|
||||
>C : a.C
|
||||
>C : typeof a.C
|
||||
|
||||
id: number;
|
||||
>id : number
|
||||
|
||||
@@ -19,8 +19,8 @@ module M {
|
||||
|
||||
export class O extends M.N {
|
||||
>O : O
|
||||
>M.N : any
|
||||
>M.N : N
|
||||
>M : typeof M
|
||||
>N : N
|
||||
>N : typeof N
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
//// [classExtendingBuiltinType.ts]
|
||||
class C1 extends Object { }
|
||||
class C2 extends Function { }
|
||||
class C3 extends String { }
|
||||
class C4 extends Boolean { }
|
||||
class C5 extends Number { }
|
||||
class C6 extends Date { }
|
||||
class C7 extends RegExp { }
|
||||
class C8 extends Error { }
|
||||
class C9 extends Array { }
|
||||
class C10 extends Array<number> { }
|
||||
|
||||
|
||||
//// [classExtendingBuiltinType.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; }
|
||||
__.prototype = b.prototype;
|
||||
d.prototype = new __();
|
||||
};
|
||||
var C1 = (function (_super) {
|
||||
__extends(C1, _super);
|
||||
function C1() {
|
||||
_super.apply(this, arguments);
|
||||
}
|
||||
return C1;
|
||||
})(Object);
|
||||
var C2 = (function (_super) {
|
||||
__extends(C2, _super);
|
||||
function C2() {
|
||||
_super.apply(this, arguments);
|
||||
}
|
||||
return C2;
|
||||
})(Function);
|
||||
var C3 = (function (_super) {
|
||||
__extends(C3, _super);
|
||||
function C3() {
|
||||
_super.apply(this, arguments);
|
||||
}
|
||||
return C3;
|
||||
})(String);
|
||||
var C4 = (function (_super) {
|
||||
__extends(C4, _super);
|
||||
function C4() {
|
||||
_super.apply(this, arguments);
|
||||
}
|
||||
return C4;
|
||||
})(Boolean);
|
||||
var C5 = (function (_super) {
|
||||
__extends(C5, _super);
|
||||
function C5() {
|
||||
_super.apply(this, arguments);
|
||||
}
|
||||
return C5;
|
||||
})(Number);
|
||||
var C6 = (function (_super) {
|
||||
__extends(C6, _super);
|
||||
function C6() {
|
||||
_super.apply(this, arguments);
|
||||
}
|
||||
return C6;
|
||||
})(Date);
|
||||
var C7 = (function (_super) {
|
||||
__extends(C7, _super);
|
||||
function C7() {
|
||||
_super.apply(this, arguments);
|
||||
}
|
||||
return C7;
|
||||
})(RegExp);
|
||||
var C8 = (function (_super) {
|
||||
__extends(C8, _super);
|
||||
function C8() {
|
||||
_super.apply(this, arguments);
|
||||
}
|
||||
return C8;
|
||||
})(Error);
|
||||
var C9 = (function (_super) {
|
||||
__extends(C9, _super);
|
||||
function C9() {
|
||||
_super.apply(this, arguments);
|
||||
}
|
||||
return C9;
|
||||
})(Array);
|
||||
var C10 = (function (_super) {
|
||||
__extends(C10, _super);
|
||||
function C10() {
|
||||
_super.apply(this, arguments);
|
||||
}
|
||||
return C10;
|
||||
})(Array);
|
||||
@@ -0,0 +1,41 @@
|
||||
=== tests/cases/conformance/classes/classDeclarations/classExtendingBuiltinType.ts ===
|
||||
class C1 extends Object { }
|
||||
>C1 : Symbol(C1, Decl(classExtendingBuiltinType.ts, 0, 0))
|
||||
>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11))
|
||||
|
||||
class C2 extends Function { }
|
||||
>C2 : Symbol(C2, Decl(classExtendingBuiltinType.ts, 0, 27))
|
||||
>Function : Symbol(Function, Decl(lib.d.ts, 223, 38), Decl(lib.d.ts, 269, 11))
|
||||
|
||||
class C3 extends String { }
|
||||
>C3 : Symbol(C3, Decl(classExtendingBuiltinType.ts, 1, 29))
|
||||
>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11))
|
||||
|
||||
class C4 extends Boolean { }
|
||||
>C4 : Symbol(C4, Decl(classExtendingBuiltinType.ts, 2, 27))
|
||||
>Boolean : Symbol(Boolean, Decl(lib.d.ts, 443, 38), Decl(lib.d.ts, 456, 11))
|
||||
|
||||
class C5 extends Number { }
|
||||
>C5 : Symbol(C5, Decl(classExtendingBuiltinType.ts, 3, 28))
|
||||
>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11))
|
||||
|
||||
class C6 extends Date { }
|
||||
>C6 : Symbol(C6, Decl(classExtendingBuiltinType.ts, 4, 27))
|
||||
>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11))
|
||||
|
||||
class C7 extends RegExp { }
|
||||
>C7 : Symbol(C7, Decl(classExtendingBuiltinType.ts, 5, 25))
|
||||
>RegExp : Symbol(RegExp, Decl(lib.d.ts, 825, 1), Decl(lib.d.ts, 876, 11))
|
||||
|
||||
class C8 extends Error { }
|
||||
>C8 : Symbol(C8, Decl(classExtendingBuiltinType.ts, 6, 27))
|
||||
>Error : Symbol(Error, Decl(lib.d.ts, 876, 38), Decl(lib.d.ts, 889, 11))
|
||||
|
||||
class C9 extends Array { }
|
||||
>C9 : Symbol(C9, Decl(classExtendingBuiltinType.ts, 7, 26))
|
||||
>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11))
|
||||
|
||||
class C10 extends Array<number> { }
|
||||
>C10 : Symbol(C10, Decl(classExtendingBuiltinType.ts, 8, 26))
|
||||
>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11))
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
=== tests/cases/conformance/classes/classDeclarations/classExtendingBuiltinType.ts ===
|
||||
class C1 extends Object { }
|
||||
>C1 : C1
|
||||
>Object : Object
|
||||
|
||||
class C2 extends Function { }
|
||||
>C2 : C2
|
||||
>Function : Function
|
||||
|
||||
class C3 extends String { }
|
||||
>C3 : C3
|
||||
>String : String
|
||||
|
||||
class C4 extends Boolean { }
|
||||
>C4 : C4
|
||||
>Boolean : Boolean
|
||||
|
||||
class C5 extends Number { }
|
||||
>C5 : C5
|
||||
>Number : Number
|
||||
|
||||
class C6 extends Date { }
|
||||
>C6 : C6
|
||||
>Date : Date
|
||||
|
||||
class C7 extends RegExp { }
|
||||
>C7 : C7
|
||||
>RegExp : RegExp
|
||||
|
||||
class C8 extends Error { }
|
||||
>C8 : C8
|
||||
>Error : Error
|
||||
|
||||
class C9 extends Array { }
|
||||
>C9 : C9
|
||||
>Array : any[]
|
||||
|
||||
class C10 extends Array<number> { }
|
||||
>C10 : C10
|
||||
>Array : number[]
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
tests/cases/conformance/classes/classDeclarations/classExtendingClassLikeType.ts(7,18): error TS2304: Cannot find name 'Base'.
|
||||
tests/cases/conformance/classes/classDeclarations/classExtendingClassLikeType.ts(45,18): error TS2508: No base constructor has the specified number of type arguments.
|
||||
tests/cases/conformance/classes/classDeclarations/classExtendingClassLikeType.ts(56,18): error TS2510: Base constructors must all have the same return type.
|
||||
|
||||
|
||||
==== tests/cases/conformance/classes/classDeclarations/classExtendingClassLikeType.ts (3 errors) ====
|
||||
interface Base<T, U> {
|
||||
x: T;
|
||||
y: U;
|
||||
}
|
||||
|
||||
// Error, no Base constructor function
|
||||
class D0 extends Base<string, string> {
|
||||
~~~~
|
||||
!!! error TS2304: Cannot find name 'Base'.
|
||||
}
|
||||
|
||||
interface BaseConstructor {
|
||||
new (x: string, y: string): Base<string, string>;
|
||||
new <T>(x: T): Base<T, T>;
|
||||
new <T>(x: T, y: T): Base<T, T>;
|
||||
new <T, U>(x: T, y: U): Base<T, U>;
|
||||
}
|
||||
|
||||
declare function getBase(): BaseConstructor;
|
||||
|
||||
class D1 extends getBase() {
|
||||
constructor() {
|
||||
super("abc", "def");
|
||||
this.x = "x";
|
||||
this.y = "y";
|
||||
}
|
||||
}
|
||||
|
||||
class D2 extends getBase() <number> {
|
||||
constructor() {
|
||||
super(10);
|
||||
super(10, 20);
|
||||
this.x = 1;
|
||||
this.y = 2;
|
||||
}
|
||||
}
|
||||
|
||||
class D3 extends getBase() <string, number> {
|
||||
constructor() {
|
||||
super("abc", 42);
|
||||
this.x = "x";
|
||||
this.y = 2;
|
||||
}
|
||||
}
|
||||
|
||||
// Error, no constructors with three type arguments
|
||||
class D4 extends getBase() <string, string, string> {
|
||||
~~~~~~~~~
|
||||
!!! error TS2508: No base constructor has the specified number of type arguments.
|
||||
}
|
||||
|
||||
interface BadBaseConstructor {
|
||||
new (x: string): Base<string, string>;
|
||||
new (x: number): Base<number, number>;
|
||||
}
|
||||
|
||||
declare function getBadBase(): BadBaseConstructor;
|
||||
|
||||
// Error, constructor return types differ
|
||||
class D5 extends getBadBase() {
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS2510: Base constructors must all have the same return type.
|
||||
}
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
//// [classExtendingClassLikeType.ts]
|
||||
interface Base<T, U> {
|
||||
x: T;
|
||||
y: U;
|
||||
}
|
||||
|
||||
// Error, no Base constructor function
|
||||
class D0 extends Base<string, string> {
|
||||
}
|
||||
|
||||
interface BaseConstructor {
|
||||
new (x: string, y: string): Base<string, string>;
|
||||
new <T>(x: T): Base<T, T>;
|
||||
new <T>(x: T, y: T): Base<T, T>;
|
||||
new <T, U>(x: T, y: U): Base<T, U>;
|
||||
}
|
||||
|
||||
declare function getBase(): BaseConstructor;
|
||||
|
||||
class D1 extends getBase() {
|
||||
constructor() {
|
||||
super("abc", "def");
|
||||
this.x = "x";
|
||||
this.y = "y";
|
||||
}
|
||||
}
|
||||
|
||||
class D2 extends getBase() <number> {
|
||||
constructor() {
|
||||
super(10);
|
||||
super(10, 20);
|
||||
this.x = 1;
|
||||
this.y = 2;
|
||||
}
|
||||
}
|
||||
|
||||
class D3 extends getBase() <string, number> {
|
||||
constructor() {
|
||||
super("abc", 42);
|
||||
this.x = "x";
|
||||
this.y = 2;
|
||||
}
|
||||
}
|
||||
|
||||
// Error, no constructors with three type arguments
|
||||
class D4 extends getBase() <string, string, string> {
|
||||
}
|
||||
|
||||
interface BadBaseConstructor {
|
||||
new (x: string): Base<string, string>;
|
||||
new (x: number): Base<number, number>;
|
||||
}
|
||||
|
||||
declare function getBadBase(): BadBaseConstructor;
|
||||
|
||||
// Error, constructor return types differ
|
||||
class D5 extends getBadBase() {
|
||||
}
|
||||
|
||||
|
||||
//// [classExtendingClassLikeType.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; }
|
||||
__.prototype = b.prototype;
|
||||
d.prototype = new __();
|
||||
};
|
||||
// Error, no Base constructor function
|
||||
var D0 = (function (_super) {
|
||||
__extends(D0, _super);
|
||||
function D0() {
|
||||
_super.apply(this, arguments);
|
||||
}
|
||||
return D0;
|
||||
})(Base);
|
||||
var D1 = (function (_super) {
|
||||
__extends(D1, _super);
|
||||
function D1() {
|
||||
_super.call(this, "abc", "def");
|
||||
this.x = "x";
|
||||
this.y = "y";
|
||||
}
|
||||
return D1;
|
||||
})(getBase());
|
||||
var D2 = (function (_super) {
|
||||
__extends(D2, _super);
|
||||
function D2() {
|
||||
_super.call(this, 10);
|
||||
_super.call(this, 10, 20);
|
||||
this.x = 1;
|
||||
this.y = 2;
|
||||
}
|
||||
return D2;
|
||||
})(getBase());
|
||||
var D3 = (function (_super) {
|
||||
__extends(D3, _super);
|
||||
function D3() {
|
||||
_super.call(this, "abc", 42);
|
||||
this.x = "x";
|
||||
this.y = 2;
|
||||
}
|
||||
return D3;
|
||||
})(getBase());
|
||||
// Error, no constructors with three type arguments
|
||||
var D4 = (function (_super) {
|
||||
__extends(D4, _super);
|
||||
function D4() {
|
||||
_super.apply(this, arguments);
|
||||
}
|
||||
return D4;
|
||||
})(getBase());
|
||||
// Error, constructor return types differ
|
||||
var D5 = (function (_super) {
|
||||
__extends(D5, _super);
|
||||
function D5() {
|
||||
_super.apply(this, arguments);
|
||||
}
|
||||
return D5;
|
||||
})(getBadBase());
|
||||
@@ -0,0 +1,38 @@
|
||||
tests/cases/conformance/classes/classDeclarations/classExtendingNonConstructor.ts(7,18): error TS2507: Base expression is not of a constructor function type.
|
||||
tests/cases/conformance/classes/classDeclarations/classExtendingNonConstructor.ts(8,18): error TS2507: Base expression is not of a constructor function type.
|
||||
tests/cases/conformance/classes/classDeclarations/classExtendingNonConstructor.ts(9,18): error TS2507: Base expression is not of a constructor function type.
|
||||
tests/cases/conformance/classes/classDeclarations/classExtendingNonConstructor.ts(10,18): error TS2507: Base expression is not of a constructor function type.
|
||||
tests/cases/conformance/classes/classDeclarations/classExtendingNonConstructor.ts(11,18): error TS2507: Base expression is not of a constructor function type.
|
||||
tests/cases/conformance/classes/classDeclarations/classExtendingNonConstructor.ts(12,18): error TS2507: Base expression is not of a constructor function type.
|
||||
tests/cases/conformance/classes/classDeclarations/classExtendingNonConstructor.ts(13,18): error TS2507: Base expression is not of a constructor function type.
|
||||
|
||||
|
||||
==== tests/cases/conformance/classes/classDeclarations/classExtendingNonConstructor.ts (7 errors) ====
|
||||
var x: {};
|
||||
|
||||
function foo() {
|
||||
this.x = 1;
|
||||
}
|
||||
|
||||
class C1 extends undefined { }
|
||||
~~~~~~~~~
|
||||
!!! error TS2507: Base expression is not of a constructor function type.
|
||||
class C2 extends true { }
|
||||
~~~~
|
||||
!!! error TS2507: Base expression is not of a constructor function type.
|
||||
class C3 extends false { }
|
||||
~~~~~
|
||||
!!! error TS2507: Base expression is not of a constructor function type.
|
||||
class C4 extends 42 { }
|
||||
~~
|
||||
!!! error TS2507: Base expression is not of a constructor function type.
|
||||
class C5 extends "hello" { }
|
||||
~~~~~~~
|
||||
!!! error TS2507: Base expression is not of a constructor function type.
|
||||
class C6 extends x { }
|
||||
~
|
||||
!!! error TS2507: Base expression is not of a constructor function type.
|
||||
class C7 extends foo { }
|
||||
~~~
|
||||
!!! error TS2507: Base expression is not of a constructor function type.
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
//// [classExtendingNonConstructor.ts]
|
||||
var x: {};
|
||||
|
||||
function foo() {
|
||||
this.x = 1;
|
||||
}
|
||||
|
||||
class C1 extends undefined { }
|
||||
class C2 extends true { }
|
||||
class C3 extends false { }
|
||||
class C4 extends 42 { }
|
||||
class C5 extends "hello" { }
|
||||
class C6 extends x { }
|
||||
class C7 extends foo { }
|
||||
|
||||
|
||||
//// [classExtendingNonConstructor.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; }
|
||||
__.prototype = b.prototype;
|
||||
d.prototype = new __();
|
||||
};
|
||||
var x;
|
||||
function foo() {
|
||||
this.x = 1;
|
||||
}
|
||||
var C1 = (function (_super) {
|
||||
__extends(C1, _super);
|
||||
function C1() {
|
||||
_super.apply(this, arguments);
|
||||
}
|
||||
return C1;
|
||||
})(undefined);
|
||||
var C2 = (function (_super) {
|
||||
__extends(C2, _super);
|
||||
function C2() {
|
||||
_super.apply(this, arguments);
|
||||
}
|
||||
return C2;
|
||||
})(true);
|
||||
var C3 = (function (_super) {
|
||||
__extends(C3, _super);
|
||||
function C3() {
|
||||
_super.apply(this, arguments);
|
||||
}
|
||||
return C3;
|
||||
})(false);
|
||||
var C4 = (function (_super) {
|
||||
__extends(C4, _super);
|
||||
function C4() {
|
||||
_super.apply(this, arguments);
|
||||
}
|
||||
return C4;
|
||||
})(42);
|
||||
var C5 = (function (_super) {
|
||||
__extends(C5, _super);
|
||||
function C5() {
|
||||
_super.apply(this, arguments);
|
||||
}
|
||||
return C5;
|
||||
})("hello");
|
||||
var C6 = (function (_super) {
|
||||
__extends(C6, _super);
|
||||
function C6() {
|
||||
_super.apply(this, arguments);
|
||||
}
|
||||
return C6;
|
||||
})(x);
|
||||
var C7 = (function (_super) {
|
||||
__extends(C7, _super);
|
||||
function C7() {
|
||||
_super.apply(this, arguments);
|
||||
}
|
||||
return C7;
|
||||
})(foo);
|
||||
@@ -0,0 +1,26 @@
|
||||
//// [classExtendingNull.ts]
|
||||
class C1 extends null { }
|
||||
class C2 extends (null) { }
|
||||
|
||||
|
||||
//// [classExtendingNull.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; }
|
||||
__.prototype = b.prototype;
|
||||
d.prototype = new __();
|
||||
};
|
||||
var C1 = (function (_super) {
|
||||
__extends(C1, _super);
|
||||
function C1() {
|
||||
_super.apply(this, arguments);
|
||||
}
|
||||
return C1;
|
||||
})(null);
|
||||
var C2 = (function (_super) {
|
||||
__extends(C2, _super);
|
||||
function C2() {
|
||||
_super.apply(this, arguments);
|
||||
}
|
||||
return C2;
|
||||
})((null));
|
||||
@@ -0,0 +1,7 @@
|
||||
=== tests/cases/conformance/classes/classDeclarations/classExtendingNull.ts ===
|
||||
class C1 extends null { }
|
||||
>C1 : Symbol(C1, Decl(classExtendingNull.ts, 0, 0))
|
||||
|
||||
class C2 extends (null) { }
|
||||
>C2 : Symbol(C2, Decl(classExtendingNull.ts, 0, 25))
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
=== tests/cases/conformance/classes/classDeclarations/classExtendingNull.ts ===
|
||||
class C1 extends null { }
|
||||
>C1 : C1
|
||||
>null : null
|
||||
|
||||
class C2 extends (null) { }
|
||||
>C2 : C2
|
||||
>(null) : null
|
||||
>null : null
|
||||
|
||||
@@ -4,13 +4,12 @@ tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/cla
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(6,18): error TS2304: Cannot find name 'Void'.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(7,19): error TS1109: Expression expected.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(8,18): error TS2304: Cannot find name 'Null'.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(9,19): error TS9002: Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(10,18): error TS2304: Cannot find name 'undefined'.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(10,18): error TS2507: Base expression is not of a constructor function type.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(11,18): error TS2304: Cannot find name 'Undefined'.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(14,18): error TS2311: A class may only extend another class.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(14,18): error TS2507: Base expression is not of a constructor function type.
|
||||
|
||||
|
||||
==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts (10 errors) ====
|
||||
==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts (9 errors) ====
|
||||
// classes cannot extend primitives
|
||||
|
||||
class C extends number { }
|
||||
@@ -32,11 +31,9 @@ tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/cla
|
||||
~~~~
|
||||
!!! error TS2304: Cannot find name 'Null'.
|
||||
class C5a extends null { }
|
||||
~~~~
|
||||
!!! error TS9002: Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses.
|
||||
class C6 extends undefined { }
|
||||
~~~~~~~~~
|
||||
!!! error TS2304: Cannot find name 'undefined'.
|
||||
!!! error TS2507: Base expression is not of a constructor function type.
|
||||
class C7 extends Undefined { }
|
||||
~~~~~~~~~
|
||||
!!! error TS2304: Cannot find name 'Undefined'.
|
||||
@@ -44,4 +41,4 @@ tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/cla
|
||||
enum E { A }
|
||||
class C8 extends E { }
|
||||
~
|
||||
!!! error TS2311: A class may only extend another class.
|
||||
!!! error TS2507: Base expression is not of a constructor function type.
|
||||
@@ -1,13 +1,10 @@
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive2.ts(3,19): error TS1109: Expression expected.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive2.ts(4,19): error TS9002: Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses.
|
||||
|
||||
|
||||
==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive2.ts (2 errors) ====
|
||||
==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive2.ts (1 errors) ====
|
||||
// classes cannot extend primitives
|
||||
|
||||
class C4a extends void {}
|
||||
~~~~
|
||||
!!! error TS1109: Expression expected.
|
||||
class C5a extends null { }
|
||||
~~~~
|
||||
!!! error TS9002: Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses.
|
||||
class C5a extends null { }
|
||||
@@ -1,4 +1,4 @@
|
||||
tests/cases/compiler/classExtendingQualifiedName.ts(5,23): error TS2305: Module 'M' has no exported member 'C'.
|
||||
tests/cases/compiler/classExtendingQualifiedName.ts(5,23): error TS2339: Property 'C' does not exist on type 'typeof M'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/classExtendingQualifiedName.ts (1 errors) ====
|
||||
@@ -8,6 +8,6 @@ tests/cases/compiler/classExtendingQualifiedName.ts(5,23): error TS2305: Module
|
||||
|
||||
class D extends M.C {
|
||||
~
|
||||
!!! error TS2305: Module 'M' has no exported member 'C'.
|
||||
!!! error TS2339: Property 'C' does not exist on type 'typeof M'.
|
||||
}
|
||||
}
|
||||
@@ -8,8 +8,8 @@ module M {
|
||||
|
||||
class D extends M.C {
|
||||
>D : D
|
||||
>M.C : any
|
||||
>M.C : C
|
||||
>M : typeof M
|
||||
>C : C
|
||||
>C : typeof C
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
tests/cases/compiler/classExtendsClauseClassMergedWithModuleNotReferingConstructor.ts(10,21): error TS2419: Type name 'A' in extends clause does not reference constructor function for 'A'.
|
||||
tests/cases/compiler/classExtendsClauseClassMergedWithModuleNotReferingConstructor.ts(10,21): error TS2507: Base expression is not of a constructor function type.
|
||||
|
||||
|
||||
==== tests/cases/compiler/classExtendsClauseClassMergedWithModuleNotReferingConstructor.ts (1 errors) ====
|
||||
@@ -13,7 +13,7 @@ tests/cases/compiler/classExtendsClauseClassMergedWithModuleNotReferingConstruct
|
||||
var A = 1;
|
||||
class B extends A {
|
||||
~
|
||||
!!! error TS2419: Type name 'A' in extends clause does not reference constructor function for 'A'.
|
||||
!!! error TS2507: Base expression is not of a constructor function type.
|
||||
b: string;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
tests/cases/compiler/classExtendsClauseClassNotReferringConstructor.ts(4,21): error TS2419: Type name 'A' in extends clause does not reference constructor function for 'A'.
|
||||
tests/cases/compiler/classExtendsClauseClassNotReferringConstructor.ts(4,21): error TS2507: Base expression is not of a constructor function type.
|
||||
|
||||
|
||||
==== tests/cases/compiler/classExtendsClauseClassNotReferringConstructor.ts (1 errors) ====
|
||||
@@ -7,6 +7,6 @@ tests/cases/compiler/classExtendsClauseClassNotReferringConstructor.ts(4,21): er
|
||||
var A = 1;
|
||||
class B extends A { b: string; }
|
||||
~
|
||||
!!! error TS2419: Type name 'A' in extends clause does not reference constructor function for 'A'.
|
||||
!!! error TS2507: Base expression is not of a constructor function type.
|
||||
}
|
||||
|
||||
@@ -1,40 +1,43 @@
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(4,17): error TS2311: A class may only extend another class.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(6,18): error TS9002: Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(4,17): error TS2304: Cannot find name 'I'.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(6,18): error TS2507: Base expression is not of a constructor function type.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(6,25): error TS2304: Cannot find name 'string'.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(6,31): error TS1005: ',' expected.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(8,18): error TS2304: Cannot find name 'x'.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(11,18): error TS2304: Cannot find name 'M'.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(14,18): error TS2304: Cannot find name 'foo'.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(16,18): error TS9002: Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(8,18): error TS2507: Base expression is not of a constructor function type.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(11,18): error TS2507: Base expression is not of a constructor function type.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(14,18): error TS2507: Base expression is not of a constructor function type.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(16,18): error TS2507: Base expression is not of a constructor function type.
|
||||
|
||||
|
||||
==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts (7 errors) ====
|
||||
==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts (8 errors) ====
|
||||
interface I {
|
||||
foo: string;
|
||||
}
|
||||
class C extends I { } // error
|
||||
~
|
||||
!!! error TS2311: A class may only extend another class.
|
||||
!!! error TS2304: Cannot find name 'I'.
|
||||
|
||||
class C2 extends { foo: string; } { } // error
|
||||
~~~~~~~~~~~~~~~~
|
||||
!!! error TS9002: Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses.
|
||||
!!! error TS2507: Base expression is not of a constructor function type.
|
||||
~~~~~~
|
||||
!!! error TS2304: Cannot find name 'string'.
|
||||
~
|
||||
!!! error TS1005: ',' expected.
|
||||
var x: { foo: string; }
|
||||
class C3 extends x { } // error
|
||||
~
|
||||
!!! error TS2304: Cannot find name 'x'.
|
||||
!!! error TS2507: Base expression is not of a constructor function type.
|
||||
|
||||
module M { export var x = 1; }
|
||||
class C4 extends M { } // error
|
||||
~
|
||||
!!! error TS2304: Cannot find name 'M'.
|
||||
!!! error TS2507: Base expression is not of a constructor function type.
|
||||
|
||||
function foo() { }
|
||||
class C5 extends foo { } // error
|
||||
~~~
|
||||
!!! error TS2304: Cannot find name 'foo'.
|
||||
!!! error TS2507: Base expression is not of a constructor function type.
|
||||
|
||||
class C6 extends []{ } // error
|
||||
~~
|
||||
!!! error TS9002: Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses.
|
||||
!!! error TS2507: Base expression is not of a constructor function type.
|
||||
@@ -1,15 +1,18 @@
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts(1,18): error TS9002: Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts(1,18): error TS2507: Base expression is not of a constructor function type.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts(1,25): error TS2304: Cannot find name 'string'.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts(1,31): error TS1005: ',' expected.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts(3,18): error TS9002: Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts(3,18): error TS2507: Base expression is not of a constructor function type.
|
||||
|
||||
|
||||
==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts (3 errors) ====
|
||||
==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts (4 errors) ====
|
||||
class C2 extends { foo: string; } { } // error
|
||||
~~~~~~~~~~~~~~~~
|
||||
!!! error TS9002: Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses.
|
||||
!!! error TS2507: Base expression is not of a constructor function type.
|
||||
~~~~~~
|
||||
!!! error TS2304: Cannot find name 'string'.
|
||||
~
|
||||
!!! error TS1005: ',' expected.
|
||||
|
||||
class C6 extends []{ } // error
|
||||
~~
|
||||
!!! error TS9002: Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses.
|
||||
!!! error TS2507: Base expression is not of a constructor function type.
|
||||
@@ -1,17 +1,17 @@
|
||||
tests/cases/compiler/classExtendsInterface.ts(2,17): error TS2311: A class may only extend another class.
|
||||
tests/cases/compiler/classExtendsInterface.ts(6,21): error TS2311: A class may only extend another class.
|
||||
tests/cases/compiler/classExtendsInterface.ts(2,17): error TS2304: Cannot find name 'Comparable'.
|
||||
tests/cases/compiler/classExtendsInterface.ts(6,21): error TS2304: Cannot find name 'Comparable2'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/classExtendsInterface.ts (2 errors) ====
|
||||
interface Comparable {}
|
||||
class A extends Comparable {}
|
||||
~~~~~~~~~~
|
||||
!!! error TS2311: A class may only extend another class.
|
||||
!!! error TS2304: Cannot find name 'Comparable'.
|
||||
class B implements Comparable {}
|
||||
|
||||
interface Comparable2<T> {}
|
||||
class A2<T> extends Comparable2<T> {}
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2311: A class may only extend another class.
|
||||
~~~~~~~~~~~
|
||||
!!! error TS2304: Cannot find name 'Comparable2'.
|
||||
class B2<T> implements Comparable2<T> {}
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItself.ts(1,7): error TS2310: Type 'C' recursively references itself as a base type.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItself.ts(3,7): error TS2310: Type 'D<T>' recursively references itself as a base type.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItself.ts(5,7): error TS2310: Type 'E<T>' recursively references itself as a base type.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItself.ts(1,7): error TS2506: 'C' is referenced directly or indirectly in its own base expression.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItself.ts(3,7): error TS2506: 'D' is referenced directly or indirectly in its own base expression.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItself.ts(5,7): error TS2506: 'E' is referenced directly or indirectly in its own base expression.
|
||||
|
||||
|
||||
==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItself.ts (3 errors) ====
|
||||
class C extends C { } // error
|
||||
~
|
||||
!!! error TS2310: Type 'C' recursively references itself as a base type.
|
||||
!!! error TS2506: 'C' is referenced directly or indirectly in its own base expression.
|
||||
|
||||
class D<T> extends D<T> { } // error
|
||||
~
|
||||
!!! error TS2310: Type 'D<T>' recursively references itself as a base type.
|
||||
!!! error TS2506: 'D' is referenced directly or indirectly in its own base expression.
|
||||
|
||||
class E<T> extends E<string> { } // error
|
||||
~
|
||||
!!! error TS2310: Type 'E<T>' recursively references itself as a base type.
|
||||
!!! error TS2506: 'E' is referenced directly or indirectly in its own base expression.
|
||||
@@ -1,20 +1,32 @@
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly.ts(1,7): error TS2310: Type 'C' recursively references itself as a base type.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly.ts(7,7): error TS2310: Type 'C2<T>' recursively references itself as a base type.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly.ts(1,7): error TS2506: 'C' is referenced directly or indirectly in its own base expression.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly.ts(3,7): error TS2506: 'D' is referenced directly or indirectly in its own base expression.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly.ts(5,7): error TS2506: 'E' is referenced directly or indirectly in its own base expression.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly.ts(7,7): error TS2506: 'C2' is referenced directly or indirectly in its own base expression.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly.ts(9,7): error TS2506: 'D2' is referenced directly or indirectly in its own base expression.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly.ts(11,7): error TS2506: 'E2' is referenced directly or indirectly in its own base expression.
|
||||
|
||||
|
||||
==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly.ts (2 errors) ====
|
||||
==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly.ts (6 errors) ====
|
||||
class C extends E { foo: string; } // error
|
||||
~
|
||||
!!! error TS2310: Type 'C' recursively references itself as a base type.
|
||||
!!! error TS2506: 'C' is referenced directly or indirectly in its own base expression.
|
||||
|
||||
class D extends C { bar: string; }
|
||||
~
|
||||
!!! error TS2506: 'D' is referenced directly or indirectly in its own base expression.
|
||||
|
||||
class E extends D { baz: number; }
|
||||
~
|
||||
!!! error TS2506: 'E' is referenced directly or indirectly in its own base expression.
|
||||
|
||||
class C2<T> extends E2<T> { foo: T; } // error
|
||||
~~
|
||||
!!! error TS2310: Type 'C2<T>' recursively references itself as a base type.
|
||||
!!! error TS2506: 'C2' is referenced directly or indirectly in its own base expression.
|
||||
|
||||
class D2<T> extends C2<T> { bar: T; }
|
||||
~~
|
||||
!!! error TS2506: 'D2' is referenced directly or indirectly in its own base expression.
|
||||
|
||||
class E2<T> extends D2<T> { baz: T; }
|
||||
class E2<T> extends D2<T> { baz: T; }
|
||||
~~
|
||||
!!! error TS2506: 'E2' is referenced directly or indirectly in its own base expression.
|
||||
@@ -1,31 +1,43 @@
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly2.ts(1,7): error TS2310: Type 'C' recursively references itself as a base type.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly2.ts(13,11): error TS2310: Type 'C2<T>' recursively references itself as a base type.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly2.ts(1,7): error TS2506: 'C' is referenced directly or indirectly in its own base expression.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly2.ts(4,18): error TS2506: 'D' is referenced directly or indirectly in its own base expression.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly2.ts(9,18): error TS2506: 'E' is referenced directly or indirectly in its own base expression.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly2.ts(13,11): error TS2506: 'C2' is referenced directly or indirectly in its own base expression.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly2.ts(16,22): error TS2506: 'D2' is referenced directly or indirectly in its own base expression.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly2.ts(20,22): error TS2506: 'E2' is referenced directly or indirectly in its own base expression.
|
||||
|
||||
|
||||
==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly2.ts (2 errors) ====
|
||||
==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly2.ts (6 errors) ====
|
||||
class C extends N.E { foo: string; } // error
|
||||
~
|
||||
!!! error TS2310: Type 'C' recursively references itself as a base type.
|
||||
!!! error TS2506: 'C' is referenced directly or indirectly in its own base expression.
|
||||
|
||||
module M {
|
||||
export class D extends C { bar: string; }
|
||||
~
|
||||
!!! error TS2506: 'D' is referenced directly or indirectly in its own base expression.
|
||||
|
||||
}
|
||||
|
||||
module N {
|
||||
export class E extends M.D { baz: number; }
|
||||
~
|
||||
!!! error TS2506: 'E' is referenced directly or indirectly in its own base expression.
|
||||
}
|
||||
|
||||
module O {
|
||||
class C2<T> extends Q.E2<T> { foo: T; } // error
|
||||
~~
|
||||
!!! error TS2310: Type 'C2<T>' recursively references itself as a base type.
|
||||
!!! error TS2506: 'C2' is referenced directly or indirectly in its own base expression.
|
||||
|
||||
module P {
|
||||
export class D2<T> extends C2<T> { bar: T; }
|
||||
~~
|
||||
!!! error TS2506: 'D2' is referenced directly or indirectly in its own base expression.
|
||||
}
|
||||
|
||||
module Q {
|
||||
export class E2<T> extends P.D2<T> { baz: T; }
|
||||
~~
|
||||
!!! error TS2506: 'E2' is referenced directly or indirectly in its own base expression.
|
||||
}
|
||||
}
|
||||
@@ -1,25 +1,37 @@
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly_file1.ts(1,7): error TS2310: Type 'C' recursively references itself as a base type.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly_file4.ts(1,7): error TS2310: Type 'C2<T>' recursively references itself as a base type.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly_file1.ts(1,7): error TS2506: 'C' is referenced directly or indirectly in its own base expression.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly_file2.ts(1,7): error TS2506: 'D' is referenced directly or indirectly in its own base expression.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly_file3.ts(1,7): error TS2506: 'E' is referenced directly or indirectly in its own base expression.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly_file4.ts(1,7): error TS2506: 'C2' is referenced directly or indirectly in its own base expression.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly_file5.ts(1,7): error TS2506: 'D2' is referenced directly or indirectly in its own base expression.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly_file6.ts(1,7): error TS2506: 'E2' is referenced directly or indirectly in its own base expression.
|
||||
|
||||
|
||||
==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly_file1.ts (1 errors) ====
|
||||
class C extends E { foo: string; } // error
|
||||
~
|
||||
!!! error TS2310: Type 'C' recursively references itself as a base type.
|
||||
!!! error TS2506: 'C' is referenced directly or indirectly in its own base expression.
|
||||
|
||||
==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly_file2.ts (0 errors) ====
|
||||
==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly_file2.ts (1 errors) ====
|
||||
class D extends C { bar: string; }
|
||||
~
|
||||
!!! error TS2506: 'D' is referenced directly or indirectly in its own base expression.
|
||||
|
||||
==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly_file3.ts (0 errors) ====
|
||||
==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly_file3.ts (1 errors) ====
|
||||
class E extends D { baz: number; }
|
||||
~
|
||||
!!! error TS2506: 'E' is referenced directly or indirectly in its own base expression.
|
||||
|
||||
==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly_file4.ts (1 errors) ====
|
||||
class C2<T> extends E2<T> { foo: T; } // error
|
||||
~~
|
||||
!!! error TS2310: Type 'C2<T>' recursively references itself as a base type.
|
||||
!!! error TS2506: 'C2' is referenced directly or indirectly in its own base expression.
|
||||
|
||||
==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly_file5.ts (0 errors) ====
|
||||
==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly_file5.ts (1 errors) ====
|
||||
class D2<T> extends C2<T> { bar: T; }
|
||||
~~
|
||||
!!! error TS2506: 'D2' is referenced directly or indirectly in its own base expression.
|
||||
|
||||
==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly_file6.ts (0 errors) ====
|
||||
class E2<T> extends D2<T> { baz: T; }
|
||||
==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly_file6.ts (1 errors) ====
|
||||
class E2<T> extends D2<T> { baz: T; }
|
||||
~~
|
||||
!!! error TS2506: 'E2' is referenced directly or indirectly in its own base expression.
|
||||
@@ -1,4 +1,4 @@
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsShadowedConstructorFunction.ts(5,21): error TS2419: Type name 'C' in extends clause does not reference constructor function for 'C'.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsShadowedConstructorFunction.ts(5,21): error TS2507: Base expression is not of a constructor function type.
|
||||
|
||||
|
||||
==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsShadowedConstructorFunction.ts (1 errors) ====
|
||||
@@ -8,7 +8,7 @@ tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/cla
|
||||
var C = 1;
|
||||
class D extends C { // error, C must evaluate to constructor function
|
||||
~
|
||||
!!! error TS2419: Type name 'C' in extends clause does not reference constructor function for 'C'.
|
||||
!!! error TS2507: Base expression is not of a constructor function type.
|
||||
bar: string;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsValidConstructorFunction.ts(5,17): error TS2304: Cannot find name 'foo'.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsValidConstructorFunction.ts(5,17): error TS2507: Base expression is not of a constructor function type.
|
||||
|
||||
|
||||
==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsValidConstructorFunction.ts (1 errors) ====
|
||||
@@ -8,4 +8,4 @@ tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/cla
|
||||
|
||||
class C extends foo { } // error, cannot extend it though
|
||||
~~~
|
||||
!!! error TS2304: Cannot find name 'foo'.
|
||||
!!! error TS2507: Base expression is not of a constructor function type.
|
||||
@@ -1,8 +1,8 @@
|
||||
tests/cases/compiler/classInheritence.ts(2,7): error TS2310: Type 'A' recursively references itself as a base type.
|
||||
tests/cases/compiler/classInheritence.ts(2,7): error TS2506: 'A' is referenced directly or indirectly in its own base expression.
|
||||
|
||||
|
||||
==== tests/cases/compiler/classInheritence.ts (1 errors) ====
|
||||
class B extends A { }
|
||||
class A extends A { }
|
||||
~
|
||||
!!! error TS2310: Type 'A' recursively references itself as a base type.
|
||||
!!! error TS2506: 'A' is referenced directly or indirectly in its own base expression.
|
||||
@@ -1,7 +1,5 @@
|
||||
tests/cases/compiler/classUpdateTests.ts(34,2): error TS2377: Constructors for derived classes must contain a 'super' call.
|
||||
tests/cases/compiler/classUpdateTests.ts(43,18): error TS2335: 'super' can only be referenced in a derived class.
|
||||
tests/cases/compiler/classUpdateTests.ts(46,17): error TS2311: A class may only extend another class.
|
||||
tests/cases/compiler/classUpdateTests.ts(47,18): error TS2335: 'super' can only be referenced in a derived class.
|
||||
tests/cases/compiler/classUpdateTests.ts(57,2): error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.
|
||||
tests/cases/compiler/classUpdateTests.ts(63,7): error TS2415: Class 'L' incorrectly extends base class 'G'.
|
||||
Property 'p1' is private in type 'L' but not in type 'G'.
|
||||
@@ -20,7 +18,7 @@ tests/cases/compiler/classUpdateTests.ts(111,15): error TS1005: ';' expected.
|
||||
tests/cases/compiler/classUpdateTests.ts(113,1): error TS1128: Declaration or statement expected.
|
||||
|
||||
|
||||
==== tests/cases/compiler/classUpdateTests.ts (18 errors) ====
|
||||
==== tests/cases/compiler/classUpdateTests.ts (16 errors) ====
|
||||
//
|
||||
// test codegen for instance properties
|
||||
//
|
||||
@@ -71,11 +69,7 @@ tests/cases/compiler/classUpdateTests.ts(113,1): error TS1128: Declaration or st
|
||||
}
|
||||
|
||||
class I extends Object {
|
||||
~~~~~~
|
||||
!!! error TS2311: A class may only extend another class.
|
||||
constructor() { super(); } // ERROR - no super call allowed
|
||||
~~~~~
|
||||
!!! error TS2335: 'super' can only be referenced in a derived class.
|
||||
}
|
||||
|
||||
class J extends G {
|
||||
|
||||
@@ -5,9 +5,9 @@ declare module E {
|
||||
|
||||
class foobar extends D.bar {
|
||||
>foobar : foobar
|
||||
>D.bar : any
|
||||
>D.bar : D.bar
|
||||
>D : typeof D
|
||||
>bar : D.bar
|
||||
>bar : typeof D.bar
|
||||
|
||||
foo();
|
||||
>foo : () => any
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
tests/cases/compiler/complicatedGenericRecursiveBaseClassReference.ts(1,7): error TS2310: Type 'S18<B, A, C>' recursively references itself as a base type.
|
||||
tests/cases/compiler/complicatedGenericRecursiveBaseClassReference.ts(1,7): error TS2506: 'S18' is referenced directly or indirectly in its own base expression.
|
||||
tests/cases/compiler/complicatedGenericRecursiveBaseClassReference.ts(4,2): error TS2346: Supplied parameters do not match any signature of call target.
|
||||
|
||||
|
||||
==== tests/cases/compiler/complicatedGenericRecursiveBaseClassReference.ts (2 errors) ====
|
||||
class S18<B, A, C> extends S18<A[], { S19: A; (): A }[], C[]>
|
||||
~~~
|
||||
!!! error TS2310: Type 'S18<B, A, C>' recursively references itself as a base type.
|
||||
!!! error TS2506: 'S18' is referenced directly or indirectly in its own base expression.
|
||||
{
|
||||
}
|
||||
(new S18(123)).S18 = 0;
|
||||
|
||||
@@ -16,7 +16,7 @@ class GenericBase<T extends Constraint> {
|
||||
}
|
||||
class Derived extends GenericBase<TypeArg> {
|
||||
>Derived : Derived
|
||||
>GenericBase : GenericBase<T>
|
||||
>GenericBase : GenericBase<TypeArg>
|
||||
>TypeArg : TypeArg
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
tests/cases/compiler/constraints0.ts(14,9): error TS2344: Type 'B' does not satisfy the constraint 'A'.
|
||||
tests/cases/compiler/constraints0.ts(14,11): error TS2344: Type 'B' does not satisfy the constraint 'A'.
|
||||
Property 'a' is missing in type 'B'.
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ tests/cases/compiler/constraints0.ts(14,9): error TS2344: Type 'B' does not sati
|
||||
|
||||
var v1: C<A>; // should work
|
||||
var v2: C<B>; // should not work
|
||||
~~~~
|
||||
~
|
||||
!!! error TS2344: Type 'B' does not satisfy the constraint 'A'.
|
||||
!!! error TS2344: Property 'a' is missing in type 'B'.
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ class X<T> {
|
||||
}
|
||||
class C extends X<() => number> {
|
||||
>C : C
|
||||
>X : X<T>
|
||||
>X : X<() => number>
|
||||
}
|
||||
interface I extends X<() => number> {
|
||||
>I : I
|
||||
|
||||
@@ -153,9 +153,9 @@ export var g = C.F5<C.A<C.B>>();
|
||||
|
||||
export class h extends C.A<C.B>{ }
|
||||
>h : h
|
||||
>C.A : any
|
||||
>C.A : C.A<C.B>
|
||||
>C : typeof C
|
||||
>A : C.A<T>
|
||||
>A : typeof C.A
|
||||
>C : any
|
||||
>B : C.B
|
||||
|
||||
|
||||
@@ -86,11 +86,11 @@ module templa.dom.mvc {
|
||||
>templa : any
|
||||
>mvc : any
|
||||
>IModel : templa.mvc.IModel
|
||||
>templa.mvc.AbstractController : any
|
||||
>templa.mvc.AbstractController : templa.mvc.AbstractController<ModelType>
|
||||
>templa.mvc : typeof templa.mvc
|
||||
>templa : typeof templa
|
||||
>mvc : typeof templa.mvc
|
||||
>AbstractController : templa.mvc.AbstractController<ModelType>
|
||||
>AbstractController : typeof templa.mvc.AbstractController
|
||||
>ModelType : ModelType
|
||||
>IElementController : IElementController<ModelType>
|
||||
>ModelType : ModelType
|
||||
@@ -116,13 +116,13 @@ module templa.dom.mvc.composite {
|
||||
>mvc : any
|
||||
>composite : any
|
||||
>ICompositeControllerModel : templa.mvc.composite.ICompositeControllerModel
|
||||
>templa.dom.mvc.AbstractElementController : any
|
||||
>templa.dom.mvc.AbstractElementController : AbstractElementController<ModelType>
|
||||
>templa.dom.mvc : typeof mvc
|
||||
>templa.dom : typeof dom
|
||||
>templa : typeof templa
|
||||
>dom : typeof dom
|
||||
>mvc : typeof mvc
|
||||
>AbstractElementController : AbstractElementController<ModelType>
|
||||
>AbstractElementController : typeof AbstractElementController
|
||||
>ModelType : ModelType
|
||||
|
||||
public _controllers: templa.mvc.IController<templa.mvc.IModel>[];
|
||||
|
||||
+4
-4
@@ -19,13 +19,13 @@ module X.Y.base {
|
||||
|
||||
export class W extends A.B.Base.W {
|
||||
>W : W
|
||||
>A.B.Base.W : any
|
||||
>A.B.Base.W : A.B.Base.W
|
||||
>A.B.Base : typeof A.B.Base
|
||||
>A.B : typeof A.B
|
||||
>A : typeof A
|
||||
>B : typeof A.B
|
||||
>Base : typeof A.B.Base
|
||||
>W : A.B.Base.W
|
||||
>W : typeof A.B.Base.W
|
||||
|
||||
name: string;
|
||||
>name : string
|
||||
@@ -41,13 +41,13 @@ module X.Y.base.Z {
|
||||
export class W<TValue> extends X.Y.base.W {
|
||||
>W : W<TValue>
|
||||
>TValue : TValue
|
||||
>X.Y.base.W : any
|
||||
>X.Y.base.W : base.W
|
||||
>X.Y.base : typeof base
|
||||
>X.Y : typeof Y
|
||||
>X : typeof X
|
||||
>Y : typeof Y
|
||||
>base : typeof base
|
||||
>W : base.W
|
||||
>W : typeof base.W
|
||||
|
||||
value: boolean;
|
||||
>value : boolean
|
||||
|
||||
@@ -14,15 +14,15 @@ import ab = A.B;
|
||||
|
||||
class D extends ab.C{ }
|
||||
>D : D
|
||||
>ab.C : any
|
||||
>ab.C : ab.C
|
||||
>ab : typeof ab
|
||||
>C : ab.C
|
||||
>C : typeof ab.C
|
||||
|
||||
class E extends A.B.C{ }
|
||||
>E : E
|
||||
>A.B.C : any
|
||||
>A.B.C : ab.C
|
||||
>A.B : typeof ab
|
||||
>A : typeof A
|
||||
>B : typeof ab
|
||||
>C : ab.C
|
||||
>C : typeof ab.C
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
tests/cases/conformance/expressions/unaryOperators/deleteOperator/deleteOperatorInvalidOperations.ts(5,20): error TS1005: ',' expected.
|
||||
tests/cases/conformance/expressions/unaryOperators/deleteOperator/deleteOperatorInvalidOperations.ts(5,27): error TS1109: Expression expected.
|
||||
tests/cases/conformance/expressions/unaryOperators/deleteOperator/deleteOperatorInvalidOperations.ts(8,23): error TS1109: Expression expected.
|
||||
tests/cases/conformance/expressions/unaryOperators/deleteOperator/deleteOperatorInvalidOperations.ts(13,16): error TS1102: 'delete' cannot be called on an identifier in strict mode.
|
||||
|
||||
|
||||
==== tests/cases/conformance/expressions/unaryOperators/deleteOperator/deleteOperatorInvalidOperations.ts (3 errors) ====
|
||||
==== tests/cases/conformance/expressions/unaryOperators/deleteOperator/deleteOperatorInvalidOperations.ts (4 errors) ====
|
||||
// Unary operator delete
|
||||
var ANY;
|
||||
|
||||
@@ -23,5 +24,7 @@ tests/cases/conformance/expressions/unaryOperators/deleteOperator/deleteOperator
|
||||
class testADelx {
|
||||
constructor(public s: () => {}) {
|
||||
delete s; //expect error
|
||||
~
|
||||
!!! error TS1102: 'delete' cannot be called on an identifier in strict mode.
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,11 @@
|
||||
tests/cases/compiler/downlevelLetConst11.ts(2,4): error TS1123: Variable declaration list cannot be empty.
|
||||
tests/cases/compiler/downlevelLetConst11.ts(2,1): error TS1212: Identifier expected. 'let' is a reserved word in strict mode
|
||||
tests/cases/compiler/downlevelLetConst11.ts(2,1): error TS2304: Cannot find name 'let'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/downlevelLetConst11.ts (1 errors) ====
|
||||
==== tests/cases/compiler/downlevelLetConst11.ts (2 errors) ====
|
||||
"use strict";
|
||||
let
|
||||
|
||||
!!! error TS1123: Variable declaration list cannot be empty.
|
||||
~~~
|
||||
!!! error TS1212: Identifier expected. 'let' is a reserved word in strict mode
|
||||
~~~
|
||||
!!! error TS2304: Cannot find name 'let'.
|
||||
@@ -4,4 +4,4 @@ let
|
||||
|
||||
//// [downlevelLetConst11.js]
|
||||
"use strict";
|
||||
var ;
|
||||
let;
|
||||
|
||||
+2
-2
@@ -9,11 +9,11 @@ class B<T> {
|
||||
}
|
||||
class C extends B<string> { }
|
||||
>C : C
|
||||
>B : B<T>
|
||||
>B : B<string>
|
||||
|
||||
class D extends B<number> {
|
||||
>D : D
|
||||
>B : B<T>
|
||||
>B : B<number>
|
||||
|
||||
constructor(a: any)
|
||||
>a : any
|
||||
|
||||
@@ -9,8 +9,8 @@ declare module M {
|
||||
|
||||
class Bar extends M.Foo {
|
||||
>Bar : Bar
|
||||
>M.Foo : any
|
||||
>M.Foo : M.Foo
|
||||
>M : typeof M
|
||||
>Foo : M.Foo
|
||||
>Foo : typeof M.Foo
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import q = require("exportAssignmentOfGenericType1_0");
|
||||
|
||||
class M extends q<string> { }
|
||||
>M : M
|
||||
>q : q<X>
|
||||
>q : q<string>
|
||||
|
||||
var m: M;
|
||||
>m : M
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
tests/cases/conformance/externalModules/exportNonInitializedVariablesAMD.ts(2,4): error TS1123: Variable declaration list cannot be empty.
|
||||
tests/cases/conformance/externalModules/exportNonInitializedVariablesAMD.ts(3,1): error TS1214: Identifier expected. 'let' is a reserved word in strict mode. Modules are automatically in strict mode.
|
||||
tests/cases/conformance/externalModules/exportNonInitializedVariablesAMD.ts(3,1): error TS2304: Cannot find name 'let'.
|
||||
tests/cases/conformance/externalModules/exportNonInitializedVariablesAMD.ts(4,6): error TS1123: Variable declaration list cannot be empty.
|
||||
|
||||
|
||||
==== tests/cases/conformance/externalModules/exportNonInitializedVariablesAMD.ts (3 errors) ====
|
||||
==== tests/cases/conformance/externalModules/exportNonInitializedVariablesAMD.ts (4 errors) ====
|
||||
|
||||
var;
|
||||
|
||||
!!! error TS1123: Variable declaration list cannot be empty.
|
||||
let;
|
||||
~~~
|
||||
!!! error TS1214: Identifier expected. 'let' is a reserved word in strict mode. Modules are automatically in strict mode.
|
||||
~~~
|
||||
!!! error TS2304: Cannot find name 'let'.
|
||||
const;
|
||||
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
tests/cases/conformance/externalModules/exportNonInitializedVariablesCommonJS.ts(2,4): error TS1123: Variable declaration list cannot be empty.
|
||||
tests/cases/conformance/externalModules/exportNonInitializedVariablesCommonJS.ts(3,1): error TS1214: Identifier expected. 'let' is a reserved word in strict mode. Modules are automatically in strict mode.
|
||||
tests/cases/conformance/externalModules/exportNonInitializedVariablesCommonJS.ts(3,1): error TS2304: Cannot find name 'let'.
|
||||
tests/cases/conformance/externalModules/exportNonInitializedVariablesCommonJS.ts(4,6): error TS1123: Variable declaration list cannot be empty.
|
||||
|
||||
|
||||
==== tests/cases/conformance/externalModules/exportNonInitializedVariablesCommonJS.ts (3 errors) ====
|
||||
==== tests/cases/conformance/externalModules/exportNonInitializedVariablesCommonJS.ts (4 errors) ====
|
||||
|
||||
var;
|
||||
|
||||
!!! error TS1123: Variable declaration list cannot be empty.
|
||||
let;
|
||||
~~~
|
||||
!!! error TS1214: Identifier expected. 'let' is a reserved word in strict mode. Modules are automatically in strict mode.
|
||||
~~~
|
||||
!!! error TS2304: Cannot find name 'let'.
|
||||
const;
|
||||
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
tests/cases/conformance/externalModules/exportNonInitializedVariablesES6.ts(2,4): error TS1123: Variable declaration list cannot be empty.
|
||||
tests/cases/conformance/externalModules/exportNonInitializedVariablesES6.ts(3,1): error TS1214: Identifier expected. 'let' is a reserved word in strict mode. Modules are automatically in strict mode.
|
||||
tests/cases/conformance/externalModules/exportNonInitializedVariablesES6.ts(3,1): error TS2304: Cannot find name 'let'.
|
||||
tests/cases/conformance/externalModules/exportNonInitializedVariablesES6.ts(4,6): error TS1123: Variable declaration list cannot be empty.
|
||||
|
||||
|
||||
==== tests/cases/conformance/externalModules/exportNonInitializedVariablesES6.ts (3 errors) ====
|
||||
==== tests/cases/conformance/externalModules/exportNonInitializedVariablesES6.ts (4 errors) ====
|
||||
|
||||
var;
|
||||
|
||||
!!! error TS1123: Variable declaration list cannot be empty.
|
||||
let;
|
||||
~~~
|
||||
!!! error TS1214: Identifier expected. 'let' is a reserved word in strict mode. Modules are automatically in strict mode.
|
||||
~~~
|
||||
!!! error TS2304: Cannot find name 'let'.
|
||||
const;
|
||||
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
tests/cases/conformance/externalModules/exportNonInitializedVariablesSystem.ts(2,4): error TS1123: Variable declaration list cannot be empty.
|
||||
tests/cases/conformance/externalModules/exportNonInitializedVariablesSystem.ts(3,1): error TS1214: Identifier expected. 'let' is a reserved word in strict mode. Modules are automatically in strict mode.
|
||||
tests/cases/conformance/externalModules/exportNonInitializedVariablesSystem.ts(3,1): error TS2304: Cannot find name 'let'.
|
||||
tests/cases/conformance/externalModules/exportNonInitializedVariablesSystem.ts(4,6): error TS1123: Variable declaration list cannot be empty.
|
||||
|
||||
|
||||
==== tests/cases/conformance/externalModules/exportNonInitializedVariablesSystem.ts (3 errors) ====
|
||||
==== tests/cases/conformance/externalModules/exportNonInitializedVariablesSystem.ts (4 errors) ====
|
||||
|
||||
var;
|
||||
|
||||
!!! error TS1123: Variable declaration list cannot be empty.
|
||||
let;
|
||||
~~~
|
||||
!!! error TS1214: Identifier expected. 'let' is a reserved word in strict mode. Modules are automatically in strict mode.
|
||||
~~~
|
||||
!!! error TS2304: Cannot find name 'let'.
|
||||
const;
|
||||
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
tests/cases/conformance/externalModules/exportNonInitializedVariablesUMD.ts(2,4): error TS1123: Variable declaration list cannot be empty.
|
||||
tests/cases/conformance/externalModules/exportNonInitializedVariablesUMD.ts(3,1): error TS1214: Identifier expected. 'let' is a reserved word in strict mode. Modules are automatically in strict mode.
|
||||
tests/cases/conformance/externalModules/exportNonInitializedVariablesUMD.ts(3,1): error TS2304: Cannot find name 'let'.
|
||||
tests/cases/conformance/externalModules/exportNonInitializedVariablesUMD.ts(4,6): error TS1123: Variable declaration list cannot be empty.
|
||||
|
||||
|
||||
==== tests/cases/conformance/externalModules/exportNonInitializedVariablesUMD.ts (3 errors) ====
|
||||
==== tests/cases/conformance/externalModules/exportNonInitializedVariablesUMD.ts (4 errors) ====
|
||||
|
||||
var;
|
||||
|
||||
!!! error TS1123: Variable declaration list cannot be empty.
|
||||
let;
|
||||
~~~
|
||||
!!! error TS1214: Identifier expected. 'let' is a reserved word in strict mode. Modules are automatically in strict mode.
|
||||
~~~
|
||||
!!! error TS2304: Cannot find name 'let'.
|
||||
const;
|
||||
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
tests/cases/conformance/es6/modules/t3.ts(1,17): error TS1214: Identifier expected. 'yield' is a reserved word in strict mode. Modules are automatically in strict mode.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/modules/t1.ts (0 errors) ====
|
||||
|
||||
let set = {
|
||||
set foo(x: number) {
|
||||
}
|
||||
}
|
||||
let get = 10;
|
||||
|
||||
export { set, get };
|
||||
|
||||
==== tests/cases/conformance/es6/modules/t2.ts (0 errors) ====
|
||||
import * as set from "./t1";
|
||||
|
||||
==== tests/cases/conformance/es6/modules/t3.ts (1 errors) ====
|
||||
import { set as yield } from "./t1";
|
||||
~~~~~
|
||||
!!! error TS1214: Identifier expected. 'yield' is a reserved word in strict mode. Modules are automatically in strict mode.
|
||||
|
||||
==== tests/cases/conformance/es6/modules/t4.ts (0 errors) ====
|
||||
import { get } from "./t1";
|
||||
@@ -1,30 +0,0 @@
|
||||
=== tests/cases/conformance/es6/modules/t1.ts ===
|
||||
|
||||
let set = {
|
||||
>set : Symbol(set, Decl(t1.ts, 1, 3))
|
||||
|
||||
set foo(x: number) {
|
||||
>foo : Symbol(foo, Decl(t1.ts, 1, 11))
|
||||
>x : Symbol(x, Decl(t1.ts, 2, 12))
|
||||
}
|
||||
}
|
||||
let get = 10;
|
||||
>get : Symbol(get, Decl(t1.ts, 5, 3))
|
||||
|
||||
export { set, get };
|
||||
>set : Symbol(set, Decl(t1.ts, 7, 8))
|
||||
>get : Symbol(get, Decl(t1.ts, 7, 13))
|
||||
|
||||
=== tests/cases/conformance/es6/modules/t2.ts ===
|
||||
import * as set from "./t1";
|
||||
>set : Symbol(set, Decl(t2.ts, 0, 6))
|
||||
|
||||
=== tests/cases/conformance/es6/modules/t3.ts ===
|
||||
import { set as yield } from "./t1";
|
||||
>set : Symbol(yield, Decl(t3.ts, 0, 8))
|
||||
>yield : Symbol(yield, Decl(t3.ts, 0, 8))
|
||||
|
||||
=== tests/cases/conformance/es6/modules/t4.ts ===
|
||||
import { get } from "./t1";
|
||||
>get : Symbol(get, Decl(t4.ts, 0, 8))
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
=== tests/cases/conformance/es6/modules/t1.ts ===
|
||||
|
||||
let set = {
|
||||
>set : { foo: number; }
|
||||
>{ set foo(x: number) { }} : { foo: number; }
|
||||
|
||||
set foo(x: number) {
|
||||
>foo : number
|
||||
>x : number
|
||||
}
|
||||
}
|
||||
let get = 10;
|
||||
>get : number
|
||||
>10 : number
|
||||
|
||||
export { set, get };
|
||||
>set : { foo: number; }
|
||||
>get : number
|
||||
|
||||
=== tests/cases/conformance/es6/modules/t2.ts ===
|
||||
import * as set from "./t1";
|
||||
>set : typeof set
|
||||
|
||||
=== tests/cases/conformance/es6/modules/t3.ts ===
|
||||
import { set as yield } from "./t1";
|
||||
>set : { foo: number; }
|
||||
>yield : { foo: number; }
|
||||
|
||||
=== tests/cases/conformance/es6/modules/t4.ts ===
|
||||
import { get } from "./t1";
|
||||
>get : number
|
||||
|
||||
@@ -30,9 +30,9 @@ module N {
|
||||
|
||||
export class C3 extends M.B {
|
||||
>C3 : C3
|
||||
>M.B : any
|
||||
>M.B : M.B
|
||||
>M : typeof M
|
||||
>B : M.B
|
||||
>B : typeof M.B
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
tests/cases/compiler/extBaseClass2.ts(2,31): error TS2305: Module 'M' has no exported member 'B'.
|
||||
tests/cases/compiler/extBaseClass2.ts(2,31): error TS2339: Property 'B' does not exist on type 'typeof M'.
|
||||
tests/cases/compiler/extBaseClass2.ts(7,29): error TS2304: Cannot find name 'B'.
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ tests/cases/compiler/extBaseClass2.ts(7,29): error TS2304: Cannot find name 'B'.
|
||||
module N {
|
||||
export class C4 extends M.B {
|
||||
~
|
||||
!!! error TS2305: Module 'M' has no exported member 'B'.
|
||||
!!! error TS2339: Property 'B' does not exist on type 'typeof M'.
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
tests/cases/compiler/extendNonClassSymbol1.ts(3,17): error TS2304: Cannot find name 'x'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/extendNonClassSymbol1.ts (1 errors) ====
|
||||
class A { foo() { } }
|
||||
var x = A;
|
||||
class C extends x { } // error, could not find symbol xs
|
||||
~
|
||||
!!! error TS2304: Cannot find name 'x'.
|
||||
@@ -0,0 +1,12 @@
|
||||
=== tests/cases/compiler/extendNonClassSymbol1.ts ===
|
||||
class A { foo() { } }
|
||||
>A : Symbol(A, Decl(extendNonClassSymbol1.ts, 0, 0))
|
||||
>foo : Symbol(foo, Decl(extendNonClassSymbol1.ts, 0, 9))
|
||||
|
||||
var x = A;
|
||||
>x : Symbol(x, Decl(extendNonClassSymbol1.ts, 1, 3))
|
||||
>A : Symbol(A, Decl(extendNonClassSymbol1.ts, 0, 0))
|
||||
|
||||
class C extends x { } // error, could not find symbol xs
|
||||
>C : Symbol(C, Decl(extendNonClassSymbol1.ts, 1, 10))
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
=== tests/cases/compiler/extendNonClassSymbol1.ts ===
|
||||
class A { foo() { } }
|
||||
>A : A
|
||||
>foo : () => void
|
||||
|
||||
var x = A;
|
||||
>x : typeof A
|
||||
>A : typeof A
|
||||
|
||||
class C extends x { } // error, could not find symbol xs
|
||||
>C : C
|
||||
>x : A
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
tests/cases/compiler/extendNonClassSymbol2.ts(5,17): error TS2304: Cannot find name 'Foo'.
|
||||
tests/cases/compiler/extendNonClassSymbol2.ts(5,17): error TS2507: Base expression is not of a constructor function type.
|
||||
|
||||
|
||||
==== tests/cases/compiler/extendNonClassSymbol2.ts (1 errors) ====
|
||||
@@ -8,4 +8,4 @@ tests/cases/compiler/extendNonClassSymbol2.ts(5,17): error TS2304: Cannot find n
|
||||
var x = new Foo(); // legal, considered a constructor function
|
||||
class C extends Foo {} // error, could not find symbol Foo
|
||||
~~~
|
||||
!!! error TS2304: Cannot find name 'Foo'.
|
||||
!!! error TS2507: Base expression is not of a constructor function type.
|
||||
@@ -61,9 +61,9 @@ import Backbone = require("extendingClassFromAliasAndUsageInIndexer_backbone");
|
||||
|
||||
export class VisualizationModel extends Backbone.Model {
|
||||
>VisualizationModel : VisualizationModel
|
||||
>Backbone.Model : any
|
||||
>Backbone.Model : Backbone.Model
|
||||
>Backbone : typeof Backbone
|
||||
>Model : Backbone.Model
|
||||
>Model : typeof Backbone.Model
|
||||
|
||||
// interesting stuff here
|
||||
}
|
||||
@@ -74,9 +74,9 @@ import Backbone = require("extendingClassFromAliasAndUsageInIndexer_backbone");
|
||||
|
||||
export class VisualizationModel extends Backbone.Model {
|
||||
>VisualizationModel : VisualizationModel
|
||||
>Backbone.Model : any
|
||||
>Backbone.Model : Backbone.Model
|
||||
>Backbone : typeof Backbone
|
||||
>Model : Backbone.Model
|
||||
>Model : typeof Backbone.Model
|
||||
|
||||
// different interesting stuff here
|
||||
}
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck40.ts(2,21): error TS9002: Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses.
|
||||
tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck40.ts(2,21): error TS2507: Base expression is not of a constructor function type.
|
||||
tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck40.ts(2,22): error TS1163: A 'yield' expression is only allowed in a generator body.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck40.ts (1 errors) ====
|
||||
==== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck40.ts (2 errors) ====
|
||||
function* g() {
|
||||
class C extends (yield 0) { }
|
||||
~~~~~~~~~
|
||||
!!! error TS9002: Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses.
|
||||
!!! error TS2507: Base expression is not of a constructor function type.
|
||||
~~~~~
|
||||
!!! error TS1163: A 'yield' expression is only allowed in a generator body.
|
||||
}
|
||||
@@ -1,9 +1,12 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck60.ts(2,21): error TS9002: Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses.
|
||||
tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck60.ts(2,21): error TS2507: Base expression is not of a constructor function type.
|
||||
tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck60.ts(2,22): error TS1163: A 'yield' expression is only allowed in a generator body.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck60.ts (1 errors) ====
|
||||
==== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck60.ts (2 errors) ====
|
||||
function* g() {
|
||||
class C extends (yield) {};
|
||||
~~~~~~~
|
||||
!!! error TS9002: Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses.
|
||||
!!! error TS2507: Base expression is not of a constructor function type.
|
||||
~~~~~
|
||||
!!! error TS1163: A 'yield' expression is only allowed in a generator body.
|
||||
}
|
||||
@@ -14,7 +14,7 @@ class BaseClass<T> {
|
||||
|
||||
class SubClass extends BaseClass<number> {
|
||||
>SubClass : SubClass
|
||||
>BaseClass : BaseClass<T>
|
||||
>BaseClass : BaseClass<number>
|
||||
|
||||
public Error(): void {
|
||||
>Error : () => void
|
||||
|
||||
@@ -24,7 +24,7 @@ class BaseCollection2<TItem extends CollectionItem2> {
|
||||
|
||||
class DataView2 extends BaseCollection2<CollectionItem2> {
|
||||
>DataView2 : DataView2
|
||||
>BaseCollection2 : BaseCollection2<TItem>
|
||||
>BaseCollection2 : BaseCollection2<CollectionItem2>
|
||||
>CollectionItem2 : CollectionItem2
|
||||
|
||||
fillItems(item: CollectionItem2) {
|
||||
|
||||
@@ -31,7 +31,7 @@ module M {
|
||||
export class B<T> extends C1<A<T>> { }
|
||||
>B : B<T>
|
||||
>T : T
|
||||
>C1 : C1<T>
|
||||
>C1 : C1<A<T>>
|
||||
>A : A<T>
|
||||
>T : T
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
=== tests/cases/compiler/genericClassInheritsConstructorFromNonGenericClass.ts ===
|
||||
class A extends B<string> { }
|
||||
>A : A
|
||||
>B : B<U>
|
||||
>B : B<string>
|
||||
|
||||
class B<U> extends C { }
|
||||
>B : B<U>
|
||||
|
||||
@@ -192,13 +192,13 @@ module PortalFx.ViewModels.Controls.Validators {
|
||||
export class Validator<TValue> extends Portal.Controls.Validators.Validator<TValue> {
|
||||
>Validator : Validator<TValue>
|
||||
>TValue : TValue
|
||||
>Portal.Controls.Validators.Validator : any
|
||||
>Portal.Controls.Validators.Validator : Portal.Controls.Validators.Validator<TValue>
|
||||
>Portal.Controls.Validators : typeof Portal.Controls.Validators
|
||||
>Portal.Controls : typeof Portal.Controls
|
||||
>Portal : typeof Portal
|
||||
>Controls : typeof Portal.Controls
|
||||
>Validators : typeof Portal.Controls.Validators
|
||||
>Validator : Portal.Controls.Validators.Validator<TValue>
|
||||
>Validator : typeof Portal.Controls.Validators.Validator
|
||||
>TValue : TValue
|
||||
|
||||
constructor(message?: string) {
|
||||
|
||||
@@ -53,7 +53,7 @@ module EndGate.Tweening {
|
||||
|
||||
export class NumberTween extends Tween<number>{
|
||||
>NumberTween : NumberTween
|
||||
>Tween : Tween<T>
|
||||
>Tween : Tween<number>
|
||||
|
||||
constructor(from: number) {
|
||||
>from : number
|
||||
|
||||
@@ -52,7 +52,7 @@ module EndGate.Tweening {
|
||||
|
||||
export class NumberTween extends Tween<Number>{
|
||||
>NumberTween : NumberTween
|
||||
>Tween : Tween<T>
|
||||
>Tween : Tween<Number>
|
||||
>Number : Number
|
||||
|
||||
constructor(from: number) {
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
tests/cases/compiler/genericTypeConstraints.ts(9,27): error TS2344: Type 'FooExtended' does not satisfy the constraint 'Foo'.
|
||||
Property 'fooMethod' is missing in type 'FooExtended'.
|
||||
tests/cases/compiler/genericTypeConstraints.ts(9,31): error TS2344: Type 'FooExtended' does not satisfy the constraint 'Foo'.
|
||||
Property 'fooMethod' is missing in type 'FooExtended'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/genericTypeConstraints.ts (2 errors) ====
|
||||
==== tests/cases/compiler/genericTypeConstraints.ts (1 errors) ====
|
||||
class Foo {
|
||||
fooMethod() {}
|
||||
}
|
||||
@@ -13,11 +12,9 @@ tests/cases/compiler/genericTypeConstraints.ts(9,31): error TS2344: Type 'FooExt
|
||||
class Bar<T extends Foo> { }
|
||||
|
||||
class BarExtended extends Bar<FooExtended> {
|
||||
~~~~~~~~~~~~~~~~
|
||||
!!! error TS2344: Type 'FooExtended' does not satisfy the constraint 'Foo'.
|
||||
!!! error TS2344: Property 'fooMethod' is missing in type 'FooExtended'.
|
||||
~~~~~~~~~~~
|
||||
!!! error TS2344: Type 'FooExtended' does not satisfy the constraint 'Foo'.
|
||||
!!! error TS2344: Property 'fooMethod' is missing in type 'FooExtended'.
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenc
|
||||
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(14,23): error TS2314: Generic type 'C<T>' requires 1 type argument(s).
|
||||
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(14,27): error TS2314: Generic type 'C<T>' requires 1 type argument(s).
|
||||
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(16,25): error TS2314: Generic type 'C<T>' requires 1 type argument(s).
|
||||
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(22,28): error TS2305: Module 'M' has no exported member 'C'.
|
||||
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(22,28): error TS2339: Property 'C' does not exist on type 'typeof M'.
|
||||
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(23,28): error TS2314: Generic type 'E<T>' requires 1 type argument(s).
|
||||
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(25,30): error TS2314: Generic type 'C<T>' requires 1 type argument(s).
|
||||
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(26,30): error TS2314: Generic type 'E<T>' requires 1 type argument(s).
|
||||
@@ -58,7 +58,7 @@ tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenc
|
||||
|
||||
declare class D2 extends M.C { }
|
||||
~
|
||||
!!! error TS2305: Module 'M' has no exported member 'C'.
|
||||
!!! error TS2339: Property 'C' does not exist on type 'typeof M'.
|
||||
declare class D3<T extends M.E> { }
|
||||
~~~
|
||||
!!! error TS2314: Generic type 'E<T>' requires 1 type argument(s).
|
||||
|
||||
@@ -13,9 +13,9 @@ tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenc
|
||||
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(18,23): error TS2314: Generic type 'I<T>' requires 1 type argument(s).
|
||||
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(18,27): error TS2314: Generic type 'I<T>' requires 1 type argument(s).
|
||||
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(18,38): error TS2314: Generic type 'I<T>' requires 1 type argument(s).
|
||||
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(20,17): error TS2314: Generic type 'I<T>' requires 1 type argument(s).
|
||||
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(20,17): error TS2304: Cannot find name 'I'.
|
||||
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(23,21): error TS2314: Generic type 'I<T>' requires 1 type argument(s).
|
||||
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(29,20): error TS2305: Module 'M' has no exported member 'C'.
|
||||
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(29,18): error TS2304: Cannot find name 'M'.
|
||||
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(30,24): error TS2314: Generic type 'E<T>' requires 1 type argument(s).
|
||||
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(31,24): error TS2305: Module 'M' has no exported member 'C'.
|
||||
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(33,22): error TS2314: Generic type 'I<T>' requires 1 type argument(s).
|
||||
@@ -76,7 +76,7 @@ tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenc
|
||||
|
||||
class D extends I {
|
||||
~
|
||||
!!! error TS2314: Generic type 'I<T>' requires 1 type argument(s).
|
||||
!!! error TS2304: Cannot find name 'I'.
|
||||
}
|
||||
|
||||
interface U extends I {}
|
||||
@@ -88,8 +88,8 @@ tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenc
|
||||
}
|
||||
|
||||
class D2 extends M.C { }
|
||||
~
|
||||
!!! error TS2305: Module 'M' has no exported member 'C'.
|
||||
~
|
||||
!!! error TS2304: Cannot find name 'M'.
|
||||
interface D3<T extends M.E> { }
|
||||
~~~
|
||||
!!! error TS2314: Generic type 'E<T>' requires 1 type argument(s).
|
||||
|
||||
@@ -8,7 +8,7 @@ tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenc
|
||||
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(14,23): error TS2314: Generic type 'C<T>' requires 1 type argument(s).
|
||||
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(14,27): error TS2314: Generic type 'C<T>' requires 1 type argument(s).
|
||||
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(16,25): error TS2314: Generic type 'C<T>' requires 1 type argument(s).
|
||||
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(22,28): error TS2305: Module 'M' has no exported member 'C'.
|
||||
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(22,28): error TS2339: Property 'C' does not exist on type 'typeof M'.
|
||||
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(23,28): error TS2314: Generic type 'E<T>' requires 1 type argument(s).
|
||||
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(25,30): error TS2314: Generic type 'C<T>' requires 1 type argument(s).
|
||||
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(26,30): error TS2314: Generic type 'E<T>' requires 1 type argument(s).
|
||||
@@ -58,7 +58,7 @@ tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenc
|
||||
|
||||
declare class D2 extends M.C { }
|
||||
~
|
||||
!!! error TS2305: Module 'M' has no exported member 'C'.
|
||||
!!! error TS2339: Property 'C' does not exist on type 'typeof M'.
|
||||
declare class D3<T extends M.E> { }
|
||||
~~~
|
||||
!!! error TS2314: Generic type 'E<T>' requires 1 type argument(s).
|
||||
|
||||
@@ -12,7 +12,7 @@ export class Collection<TItem extends CollectionItem> {
|
||||
|
||||
export class List extends Collection<ListItem>{
|
||||
>List : List
|
||||
>Collection : Collection<TItem>
|
||||
>Collection : Collection<ListItem>
|
||||
>ListItem : ListItem
|
||||
|
||||
Bar() {}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
tests/cases/compiler/generics1.ts(10,9): error TS2344: Type 'A' does not satisfy the constraint 'B'.
|
||||
tests/cases/compiler/generics1.ts(10,14): error TS2344: Type 'A' does not satisfy the constraint 'B'.
|
||||
Property 'b' is missing in type 'A'.
|
||||
tests/cases/compiler/generics1.ts(13,9): error TS2314: Generic type 'G<T, U>' requires 2 type argument(s).
|
||||
tests/cases/compiler/generics1.ts(14,9): error TS2314: Generic type 'G<T, U>' requires 2 type argument(s).
|
||||
@@ -15,7 +15,7 @@ tests/cases/compiler/generics1.ts(14,9): error TS2314: Generic type 'G<T, U>' re
|
||||
var v1: G<A, C>; // Ok
|
||||
var v2: G<{ a: string }, C>; // Ok, equivalent to G<A, C>
|
||||
var v3: G<A, A>; // Error, A not valid argument for U
|
||||
~~~~~~~
|
||||
~
|
||||
!!! error TS2344: Type 'A' does not satisfy the constraint 'B'.
|
||||
!!! error TS2344: Property 'b' is missing in type 'A'.
|
||||
var v4: G<G<A, B>, C>; // Ok
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
tests/cases/compiler/generics2.ts(17,9): error TS2344: Type 'A' does not satisfy the constraint 'B'.
|
||||
tests/cases/compiler/generics2.ts(17,14): error TS2344: Type 'A' does not satisfy the constraint 'B'.
|
||||
Property 'b' is missing in type 'A'.
|
||||
tests/cases/compiler/generics2.ts(20,9): error TS2314: Generic type 'G<T, U>' requires 2 type argument(s).
|
||||
tests/cases/compiler/generics2.ts(21,9): error TS2314: Generic type 'G<T, U>' requires 2 type argument(s).
|
||||
@@ -22,7 +22,7 @@ tests/cases/compiler/generics2.ts(21,9): error TS2314: Generic type 'G<T, U>' re
|
||||
|
||||
var v2: G<{ a: string }, C>; // Ok, equivalent to G<A, C>
|
||||
var v3: G<A, A>; // Error, A not valid argument for U
|
||||
~~~~~~~
|
||||
~
|
||||
!!! error TS2344: Type 'A' does not satisfy the constraint 'B'.
|
||||
!!! error TS2344: Property 'b' is missing in type 'A'.
|
||||
var v4: G<G<A, B>, C>; // Ok
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
tests/cases/compiler/generics5.ts(10,9): error TS2344: Type 'A' does not satisfy the constraint 'B'.
|
||||
tests/cases/compiler/generics5.ts(10,14): error TS2344: Type 'A' does not satisfy the constraint 'B'.
|
||||
Property 'b' is missing in type 'A'.
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ tests/cases/compiler/generics5.ts(10,9): error TS2344: Type 'A' does not satisfy
|
||||
}
|
||||
|
||||
var v3: G<A, A>; // Error, A not valid argument for U
|
||||
~~~~~~~
|
||||
~
|
||||
!!! error TS2344: Type 'A' does not satisfy the constraint 'B'.
|
||||
!!! error TS2344: Property 'b' is missing in type 'A'.
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
tests/cases/compiler/importAsBaseClass_1.ts(2,21): error TS2304: Cannot find name 'Greeter'.
|
||||
tests/cases/compiler/importAsBaseClass_1.ts(2,21): error TS2507: Base expression is not of a constructor function type.
|
||||
|
||||
|
||||
==== tests/cases/compiler/importAsBaseClass_1.ts (1 errors) ====
|
||||
import Greeter = require("importAsBaseClass_0");
|
||||
class Hello extends Greeter { }
|
||||
~~~~~~~
|
||||
!!! error TS2304: Cannot find name 'Greeter'.
|
||||
!!! error TS2507: Base expression is not of a constructor function type.
|
||||
|
||||
==== tests/cases/compiler/importAsBaseClass_0.ts (0 errors) ====
|
||||
export class Greeter {
|
||||
|
||||
@@ -25,6 +25,7 @@ var __extends = (this && this.__extends) || function (d, b) {
|
||||
__.prototype = b.prototype;
|
||||
d.prototype = new __();
|
||||
};
|
||||
var Greeter = require("importAsBaseClass_0");
|
||||
var Hello = (function (_super) {
|
||||
__extends(Hello, _super);
|
||||
function Hello() {
|
||||
|
||||
@@ -5,9 +5,9 @@ import foo = require('importUsedInExtendsList1_require');
|
||||
|
||||
class Sub extends foo.Super { }
|
||||
>Sub : Sub
|
||||
>foo.Super : any
|
||||
>foo.Super : foo.Super
|
||||
>foo : typeof foo
|
||||
>Super : foo.Super
|
||||
>Super : typeof foo.Super
|
||||
|
||||
var s: Sub;
|
||||
>s : Sub
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
tests/cases/compiler/indirectSelfReference.ts(1,7): error TS2310: Type 'a' recursively references itself as a base type.
|
||||
tests/cases/compiler/indirectSelfReference.ts(1,7): error TS2506: 'a' is referenced directly or indirectly in its own base expression.
|
||||
tests/cases/compiler/indirectSelfReference.ts(2,7): error TS2506: 'b' is referenced directly or indirectly in its own base expression.
|
||||
|
||||
|
||||
==== tests/cases/compiler/indirectSelfReference.ts (1 errors) ====
|
||||
==== tests/cases/compiler/indirectSelfReference.ts (2 errors) ====
|
||||
class a extends b{ }
|
||||
~
|
||||
!!! error TS2310: Type 'a' recursively references itself as a base type.
|
||||
class b extends a{ }
|
||||
!!! error TS2506: 'a' is referenced directly or indirectly in its own base expression.
|
||||
class b extends a{ }
|
||||
~
|
||||
!!! error TS2506: 'b' is referenced directly or indirectly in its own base expression.
|
||||
@@ -1,8 +1,11 @@
|
||||
tests/cases/compiler/indirectSelfReferenceGeneric.ts(1,7): error TS2310: Type 'a<T>' recursively references itself as a base type.
|
||||
tests/cases/compiler/indirectSelfReferenceGeneric.ts(1,7): error TS2506: 'a' is referenced directly or indirectly in its own base expression.
|
||||
tests/cases/compiler/indirectSelfReferenceGeneric.ts(2,7): error TS2506: 'b' is referenced directly or indirectly in its own base expression.
|
||||
|
||||
|
||||
==== tests/cases/compiler/indirectSelfReferenceGeneric.ts (1 errors) ====
|
||||
==== tests/cases/compiler/indirectSelfReferenceGeneric.ts (2 errors) ====
|
||||
class a<T> extends b<T> { }
|
||||
~
|
||||
!!! error TS2310: Type 'a<T>' recursively references itself as a base type.
|
||||
class b<T> extends a<T> { }
|
||||
!!! error TS2506: 'a' is referenced directly or indirectly in its own base expression.
|
||||
class b<T> extends a<T> { }
|
||||
~
|
||||
!!! error TS2506: 'b' is referenced directly or indirectly in its own base expression.
|
||||
@@ -1,11 +1,11 @@
|
||||
tests/cases/compiler/inheritFromGenericTypeParameter.ts(1,20): error TS2311: A class may only extend another class.
|
||||
tests/cases/compiler/inheritFromGenericTypeParameter.ts(1,20): error TS2304: Cannot find name 'T'.
|
||||
tests/cases/compiler/inheritFromGenericTypeParameter.ts(2,24): error TS2312: An interface may only extend a class or another interface.
|
||||
|
||||
|
||||
==== tests/cases/compiler/inheritFromGenericTypeParameter.ts (2 errors) ====
|
||||
class C<T> extends T { }
|
||||
~
|
||||
!!! error TS2311: A class may only extend another class.
|
||||
!!! error TS2304: Cannot find name 'T'.
|
||||
interface I<T> extends T { }
|
||||
~
|
||||
!!! error TS2312: An interface may only extend a class or another interface.
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user