1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
tests/cases/conformance/salsa/use.js(5,5): error TS2345: Argument of type '"nope"' is not assignable to parameter of type 'number'.
tests/cases/conformance/salsa/use.js(6,5): error TS2345: Argument of type '"not really"' is not assignable to parameter of type 'number'.
==== tests/cases/conformance/salsa/use.js (2 errors) ====
/// <reference path='./types.d.ts'/>
var mod = require('./mod');
var a = new mod.A()
var b = new mod.B()
a.m('nope')
~~~~~~
!!! error TS2345: Argument of type '"nope"' is not assignable to parameter of type 'number'.
b.m('not really')
~~~~~~~~~~~~
!!! error TS2345: Argument of type '"not really"' is not assignable to parameter of type 'number'.
==== tests/cases/conformance/salsa/types.d.ts (0 errors) ====
declare function require(name: string): any;
declare var exports: any;
==== tests/cases/conformance/salsa/mod.js (0 errors) ====
/// <reference path='./types.d.ts'/>
var A = function() {
this.a = 1
}
var B = function() {
this.b = 2
}
exports.A = A
exports.B = B
A.prototype = B.prototype = {
/** @param {number} n */
m(n) {
return n + 1
}
}
|