mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
38 lines
1.0 KiB
Plaintext
38 lines
1.0 KiB
Plaintext
templateTagOnClasses.js(7,23): error TS2304: Cannot find name 'T'.
|
|
templateTagOnClasses.js(7,29): error TS2304: Cannot find name 'T'.
|
|
templateTagOnClasses.js(25,1): error TS2322: Type 'boolean' is not assignable to type 'number'.
|
|
|
|
|
|
==== templateTagOnClasses.js (3 errors) ====
|
|
/**
|
|
* @template T
|
|
* @typedef {(t: T) => T} Id
|
|
*/
|
|
/** @template T */
|
|
class Foo {
|
|
/** @typedef {(t: T) => T} Id2 */
|
|
~
|
|
!!! error TS2304: Cannot find name 'T'.
|
|
~
|
|
!!! error TS2304: Cannot find name 'T'.
|
|
/** @param {T} x */
|
|
constructor (x) {
|
|
this.a = x
|
|
}
|
|
/**
|
|
*
|
|
* @param {T} x
|
|
* @param {Id<T>} y
|
|
* @param {Id2} alpha
|
|
* @return {T}
|
|
*/
|
|
foo(x, y, alpha) {
|
|
return alpha(y(x))
|
|
}
|
|
}
|
|
var f = new Foo(1)
|
|
var g = new Foo(false)
|
|
f.a = g.a
|
|
~~~
|
|
!!! error TS2322: Type 'boolean' is not assignable to type 'number'.
|
|
|