mirror of
https://github.com/swc-project/swc.git
synced 2024-12-19 19:52:21 +03:00
30 lines
507 B
TypeScript
30 lines
507 B
TypeScript
|
// @allowJs: true
|
||
|
// @checkJs: true
|
||
|
// @target: esnext
|
||
|
// @out: foo.js
|
||
|
// @declaration: true
|
||
|
// @Filename: jsdocReadonlyDeclarations.js
|
||
|
class C {
|
||
|
/** @readonly */
|
||
|
x = 6
|
||
|
/** @readonly */
|
||
|
constructor(n) {
|
||
|
this.x = n
|
||
|
/**
|
||
|
* @readonly
|
||
|
* @type {number}
|
||
|
*/
|
||
|
this.y = n
|
||
|
}
|
||
|
}
|
||
|
new C().x
|
||
|
|
||
|
function F() {
|
||
|
/** @readonly */
|
||
|
this.z = 1
|
||
|
}
|
||
|
|
||
|
// https://github.com/microsoft/TypeScript/issues/38401
|
||
|
class D {
|
||
|
constructor(/** @readonly */ x) {}
|
||
|
}
|