Update test failing by previous commit
This commit is contained in:
parent
5fa30e550c
commit
0abef5219b
4 changed files with 922 additions and 627 deletions
|
@ -1,10 +1,5 @@
|
||||||
tests/cases/compiler/contextualTyping.ts(189,18): error TS2384: Overload signatures must all be ambient or non-ambient.
|
tests/cases/compiler/contextualTyping.ts(189,18): error TS2384: Overload signatures must all be ambient or non-ambient.\ntests/cases/compiler/contextualTyping.ts(197,15): error TS2300: Duplicate identifier 'Point'.\ntests/cases/compiler/contextualTyping.ts(207,10): error TS2300: Duplicate identifier 'Point'.\ntests/cases/compiler/contextualTyping.ts(230,5): error TS2322: Type '{}' is not assignable to type 'B'.
|
||||||
tests/cases/compiler/contextualTyping.ts(197,15): error TS2300: Duplicate identifier 'Point'.
|
Property 'x' is missing in type '{}'.\n\n\n==== tests/cases/compiler/contextualTyping.ts (4 errors) ====
|
||||||
tests/cases/compiler/contextualTyping.ts(207,10): error TS2300: Duplicate identifier 'Point'.
|
|
||||||
tests/cases/compiler/contextualTyping.ts(230,5): error TS2322: Type '{}' is not assignable to type 'B'.\n Property 'x' is missing in type '{}'.
|
|
||||||
|
|
||||||
|
|
||||||
==== tests/cases/compiler/contextualTyping.ts (4 errors) ====
|
|
||||||
// DEFAULT INTERFACES
|
// DEFAULT INTERFACES
|
||||||
interface IFoo {
|
interface IFoo {
|
||||||
n: number;
|
n: number;
|
||||||
|
@ -242,5 +237,6 @@ tests/cases/compiler/contextualTyping.ts(230,5): error TS2322: Type '{}' is not
|
||||||
interface B extends A { }
|
interface B extends A { }
|
||||||
var x: B = { };
|
var x: B = { };
|
||||||
~
|
~
|
||||||
!!! error TS2322: Type '{}' is not assignable to type 'B'.\n Property 'x' is missing in type '{}'.
|
!!! error TS2322: Type '{}' is not assignable to type 'B'.
|
||||||
|
!!! error TS2322: Property 'x' is missing in type '{}'.
|
||||||
|
|
|
@ -232,4 +232,206 @@ var x: B = { };
|
||||||
|
|
||||||
|
|
||||||
//// [contextualTyping.js]
|
//// [contextualTyping.js]
|
||||||
// CONTEXT: Class property declaration\nvar C1T5 = (function () {\n function C1T5() {\n this.foo = function (i) {\n return i;\n };\n }\n return C1T5;\n})();\n// CONTEXT: Module property declaration\nvar C2T5;\n(function (C2T5) {\n C2T5.foo = function (i) {\n return i;\n };\n})(C2T5 || (C2T5 = {}));\n// CONTEXT: Variable declaration\nvar c3t1 = (function (s) {\n return s;\n});\nvar c3t2 = ({\n n: 1\n});\nvar c3t3 = [];\nvar c3t4 = function () {\n return ({});\n};\nvar c3t5 = function (n) {\n return ({});\n};\nvar c3t6 = function (n, s) {\n return ({});\n};\nvar c3t7 = function (n) {\n return n;\n};\nvar c3t8 = function (n) {\n return n;\n};\nvar c3t9 = [[], []];\nvar c3t10 = [({}), ({})];\nvar c3t11 = [function (n, s) {\n return s;\n}];\nvar c3t12 = {\n foo: ({})\n};\nvar c3t13 = ({\n f: function (i, s) {\n return s;\n }\n});\nvar c3t14 = ({\n a: []\n});\n// CONTEXT: Class property assignment\nvar C4T5 = (function () {\n function C4T5() {\n this.foo = function (i, s) {\n return s;\n };\n }\n return C4T5;\n})();\n// CONTEXT: Module property assignment\nvar C5T5;\n(function (C5T5) {\n C5T5.foo;\n C5T5.foo = function (i, s) {\n return s;\n };\n})(C5T5 || (C5T5 = {}));\n// CONTEXT: Variable assignment\nvar c6t5;\nc6t5 = function (n) {\n return ({});\n};\n// CONTEXT: Array index assignment\nvar c7t2;\nc7t2[0] = ({ n: 1 });\nvar objc8 = ({});\nobjc8.t1 = (function (s) {\n return s;\n});\nobjc8.t2 = ({\n n: 1\n});\nobjc8.t3 = [];\nobjc8.t4 = function () {\n return ({});\n};\nobjc8.t5 = function (n) {\n return ({});\n};\nobjc8.t6 = function (n, s) {\n return ({});\n};\nobjc8.t7 = function (n) {\n return n;\n};\nobjc8.t8 = function (n) {\n return n;\n};\nobjc8.t9 = [[], []];\nobjc8.t10 = [({}), ({})];\nobjc8.t11 = [function (n, s) {\n return s;\n}];\nobjc8.t12 = {\n foo: ({})\n};\nobjc8.t13 = ({\n f: function (i, s) {\n return s;\n }\n});\nobjc8.t14 = ({\n a: []\n});\n// CONTEXT: Function call\nfunction c9t5(f) {\n}\n;\nc9t5(function (n) {\n return ({});\n});\n// CONTEXT: Return statement\nvar c10t5 = function () {\n return function (n) {\n return ({});\n };\n};\n// CONTEXT: Newing a class\nvar C11t5 = (function () {\n function C11t5(f) {\n }\n return C11t5;\n})();\n;\nvar i = new C11t5(function (n) {\n return ({});\n});\n// CONTEXT: Type annotated expression\nvar c12t1 = (function (s) {\n return s;\n});\nvar c12t2 = ({\n n: 1\n});\nvar c12t3 = [];\nvar c12t4 = function () {\n return ({});\n};\nvar c12t5 = function (n) {\n return ({});\n};\nvar c12t6 = function (n, s) {\n return ({});\n};\nvar c12t7 = function (n) {\n return n;\n};\nvar c12t8 = function (n) {\n return n;\n};\nvar c12t9 = [[], []];\nvar c12t10 = [({}), ({})];\nvar c12t11 = [function (n, s) {\n return s;\n}];\nvar c12t12 = {\n foo: ({})\n};\nvar c12t13 = ({\n f: function (i, s) {\n return s;\n }\n});\nvar c12t14 = ({\n a: []\n});\nfunction EF1(a, b) {\n return a + b;\n}\nvar efv = EF1(1, 2);\nfunction Point(x, y) {\n this.x = x;\n this.y = y;\n return this;\n}\nPoint.origin = new Point(0, 0);\nPoint.prototype.add = function (dx, dy) {\n return new Point(this.x + dx, this.y + dy);\n};\nPoint.prototype = {\n x: 0,\n y: 0,\n add: function (dx, dy) {\n return new Point(this.x + dx, this.y + dy);\n }\n};\nvar x = {};\n//# sourceMappingURL=contextualTyping.js.map
|
// CONTEXT: Class property declaration
|
||||||
|
var C1T5 = (function () {
|
||||||
|
function C1T5() {
|
||||||
|
this.foo = function (i) {
|
||||||
|
return i;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return C1T5;
|
||||||
|
})();
|
||||||
|
// CONTEXT: Module property declaration
|
||||||
|
var C2T5;
|
||||||
|
(function (C2T5) {
|
||||||
|
C2T5.foo = function (i) {
|
||||||
|
return i;
|
||||||
|
};
|
||||||
|
})(C2T5 || (C2T5 = {}));
|
||||||
|
// CONTEXT: Variable declaration
|
||||||
|
var c3t1 = (function (s) {
|
||||||
|
return s;
|
||||||
|
});
|
||||||
|
var c3t2 = ({
|
||||||
|
n: 1
|
||||||
|
});
|
||||||
|
var c3t3 = [];
|
||||||
|
var c3t4 = function () {
|
||||||
|
return ({});
|
||||||
|
};
|
||||||
|
var c3t5 = function (n) {
|
||||||
|
return ({});
|
||||||
|
};
|
||||||
|
var c3t6 = function (n, s) {
|
||||||
|
return ({});
|
||||||
|
};
|
||||||
|
var c3t7 = function (n) {
|
||||||
|
return n;
|
||||||
|
};
|
||||||
|
var c3t8 = function (n) {
|
||||||
|
return n;
|
||||||
|
};
|
||||||
|
var c3t9 = [[], []];
|
||||||
|
var c3t10 = [({}), ({})];
|
||||||
|
var c3t11 = [function (n, s) {
|
||||||
|
return s;
|
||||||
|
}];
|
||||||
|
var c3t12 = {
|
||||||
|
foo: ({})
|
||||||
|
};
|
||||||
|
var c3t13 = ({
|
||||||
|
f: function (i, s) {
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
var c3t14 = ({
|
||||||
|
a: []
|
||||||
|
});
|
||||||
|
// CONTEXT: Class property assignment
|
||||||
|
var C4T5 = (function () {
|
||||||
|
function C4T5() {
|
||||||
|
this.foo = function (i, s) {
|
||||||
|
return s;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return C4T5;
|
||||||
|
})();
|
||||||
|
// CONTEXT: Module property assignment
|
||||||
|
var C5T5;
|
||||||
|
(function (C5T5) {
|
||||||
|
C5T5.foo;
|
||||||
|
C5T5.foo = function (i, s) {
|
||||||
|
return s;
|
||||||
|
};
|
||||||
|
})(C5T5 || (C5T5 = {}));
|
||||||
|
// CONTEXT: Variable assignment
|
||||||
|
var c6t5;
|
||||||
|
c6t5 = function (n) {
|
||||||
|
return ({});
|
||||||
|
};
|
||||||
|
// CONTEXT: Array index assignment
|
||||||
|
var c7t2;
|
||||||
|
c7t2[0] = ({ n: 1 });
|
||||||
|
var objc8 = ({});
|
||||||
|
objc8.t1 = (function (s) {
|
||||||
|
return s;
|
||||||
|
});
|
||||||
|
objc8.t2 = ({
|
||||||
|
n: 1
|
||||||
|
});
|
||||||
|
objc8.t3 = [];
|
||||||
|
objc8.t4 = function () {
|
||||||
|
return ({});
|
||||||
|
};
|
||||||
|
objc8.t5 = function (n) {
|
||||||
|
return ({});
|
||||||
|
};
|
||||||
|
objc8.t6 = function (n, s) {
|
||||||
|
return ({});
|
||||||
|
};
|
||||||
|
objc8.t7 = function (n) {
|
||||||
|
return n;
|
||||||
|
};
|
||||||
|
objc8.t8 = function (n) {
|
||||||
|
return n;
|
||||||
|
};
|
||||||
|
objc8.t9 = [[], []];
|
||||||
|
objc8.t10 = [({}), ({})];
|
||||||
|
objc8.t11 = [function (n, s) {
|
||||||
|
return s;
|
||||||
|
}];
|
||||||
|
objc8.t12 = {
|
||||||
|
foo: ({})
|
||||||
|
};
|
||||||
|
objc8.t13 = ({
|
||||||
|
f: function (i, s) {
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
objc8.t14 = ({
|
||||||
|
a: []
|
||||||
|
});
|
||||||
|
// CONTEXT: Function call
|
||||||
|
function c9t5(f) {
|
||||||
|
}
|
||||||
|
;
|
||||||
|
c9t5(function (n) {
|
||||||
|
return ({});
|
||||||
|
});
|
||||||
|
// CONTEXT: Return statement
|
||||||
|
var c10t5 = function () {
|
||||||
|
return function (n) {
|
||||||
|
return ({});
|
||||||
|
};
|
||||||
|
};
|
||||||
|
// CONTEXT: Newing a class
|
||||||
|
var C11t5 = (function () {
|
||||||
|
function C11t5(f) {
|
||||||
|
}
|
||||||
|
return C11t5;
|
||||||
|
})();
|
||||||
|
;
|
||||||
|
var i = new C11t5(function (n) {
|
||||||
|
return ({});
|
||||||
|
});
|
||||||
|
// CONTEXT: Type annotated expression
|
||||||
|
var c12t1 = (function (s) {
|
||||||
|
return s;
|
||||||
|
});
|
||||||
|
var c12t2 = ({
|
||||||
|
n: 1
|
||||||
|
});
|
||||||
|
var c12t3 = [];
|
||||||
|
var c12t4 = function () {
|
||||||
|
return ({});
|
||||||
|
};
|
||||||
|
var c12t5 = function (n) {
|
||||||
|
return ({});
|
||||||
|
};
|
||||||
|
var c12t6 = function (n, s) {
|
||||||
|
return ({});
|
||||||
|
};
|
||||||
|
var c12t7 = function (n) {
|
||||||
|
return n;
|
||||||
|
};
|
||||||
|
var c12t8 = function (n) {
|
||||||
|
return n;
|
||||||
|
};
|
||||||
|
var c12t9 = [[], []];
|
||||||
|
var c12t10 = [({}), ({})];
|
||||||
|
var c12t11 = [function (n, s) {
|
||||||
|
return s;
|
||||||
|
}];
|
||||||
|
var c12t12 = {
|
||||||
|
foo: ({})
|
||||||
|
};
|
||||||
|
var c12t13 = ({
|
||||||
|
f: function (i, s) {
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
var c12t14 = ({
|
||||||
|
a: []
|
||||||
|
});
|
||||||
|
function EF1(a, b) {
|
||||||
|
return a + b;
|
||||||
|
}
|
||||||
|
var efv = EF1(1, 2);
|
||||||
|
function Point(x, y) {
|
||||||
|
this.x = x;
|
||||||
|
this.y = y;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
Point.origin = new Point(0, 0);
|
||||||
|
Point.prototype.add = function (dx, dy) {
|
||||||
|
return new Point(this.x + dx, this.y + dy);
|
||||||
|
};
|
||||||
|
Point.prototype = {
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
add: function (dx, dy) {
|
||||||
|
return new Point(this.x + dx, this.y + dy);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
var x = {};
|
||||||
|
//# sourceMappingURL=contextualTyping.js.map
|
File diff suppressed because it is too large
Load diff
|
@ -2,4 +2,4 @@
|
||||||
var foo: {id:number;} = {id:4};
|
var foo: {id:number;} = {id:4};
|
||||||
|
|
||||||
//// [contextualTyping1.js]
|
//// [contextualTyping1.js]
|
||||||
var foo = { id: 4 };
|
var foo = { id: 4 };\n
|
Loading…
Reference in a new issue