Addressed Jason's pedantic correction over the wording of a comment.

This commit is contained in:
Daniel Rosenwasser 2015-01-27 13:36:10 -08:00
parent 4646d63558
commit 8ee09dbe6e
3 changed files with 13 additions and 5 deletions

View file

@ -1,4 +1,4 @@
tests/cases/compiler/superCallArgsMustMatch.ts(15,15): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'.
tests/cases/compiler/superCallArgsMustMatch.ts(17,15): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'.
==== tests/cases/compiler/superCallArgsMustMatch.ts (1 errors) ====
@ -16,7 +16,9 @@ tests/cases/compiler/superCallArgsMustMatch.ts(15,15): error TS2345: Argument of
constructor() {
super("hi"); // Should error, base constructor has type T for first arg, which is fixed as number in the extends clause
// Should error; base constructor has type T for first arg,
// which is instantiated with 'number' in the extends clause
super("hi");
~~~~
!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'.

View file

@ -13,7 +13,9 @@ class T6 extends T5<number>{
constructor() {
super("hi"); // Should error, base constructor has type T for first arg, which is fixed as number in the extends clause
// Should error; base constructor has type T for first arg,
// which is instantiated with 'number' in the extends clause
super("hi");
var x: number = this.foo;
@ -39,7 +41,9 @@ var T5 = (function () {
var T6 = (function (_super) {
__extends(T6, _super);
function T6() {
_super.call(this, "hi"); // Should error, base constructor has type T for first arg, which is fixed as number in the extends clause
// Should error; base constructor has type T for first arg,
// which is instantiated with 'number' in the extends clause
_super.call(this, "hi");
var x = this.foo;
}
return T6;

View file

@ -12,7 +12,9 @@ class T6 extends T5<number>{
constructor() {
super("hi"); // Should error, base constructor has type T for first arg, which is fixed as number in the extends clause
// Should error; base constructor has type T for first arg,
// which is instantiated with 'number' in the extends clause
super("hi");
var x: number = this.foo;