2018-04-20 19:41:58 +02:00
|
|
|
// @allowJs: true
|
|
|
|
// @checkJs: true
|
|
|
|
// @noEmit: true
|
|
|
|
// @Filename: templateTagWithNestedTypeLiteral.js
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {T} t
|
2018-06-04 20:42:46 +02:00
|
|
|
* @template T
|
2018-04-20 19:41:58 +02:00
|
|
|
*/
|
|
|
|
function Zet(t) {
|
|
|
|
/** @type {T} */
|
|
|
|
this.u
|
|
|
|
this.t = t
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* @param {T} v
|
|
|
|
* @param {object} o
|
|
|
|
* @param {T} o.nested
|
|
|
|
*/
|
|
|
|
Zet.prototype.add = function(v, o) {
|
|
|
|
this.u = v || o.nested
|
|
|
|
return this.u
|
|
|
|
}
|
|
|
|
var z = new Zet(1)
|
|
|
|
z.t = 2
|
|
|
|
z.u = false
|
2018-04-26 23:03:18 +02:00
|
|
|
|
|
|
|
// lookup in typedef should not crash the compiler, even when the type is unknown
|
|
|
|
/**
|
|
|
|
* @typedef {Object} A
|
|
|
|
* @property {T} value
|
|
|
|
*/
|
|
|
|
/** @type {A} */
|
|
|
|
const options = { value: null };
|