mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
39 lines
633 B
TypeScript
39 lines
633 B
TypeScript
//// [tests/cases/compiler/declarationEmitEnumReadonlyProperty.ts] ////
|
|
|
|
//// [declarationEmitEnumReadonlyProperty.ts]
|
|
enum E {
|
|
A = 'a',
|
|
B = 'b'
|
|
}
|
|
|
|
class C {
|
|
readonly type = E.A;
|
|
}
|
|
|
|
let x: E.A = new C().type;
|
|
|
|
//// [declarationEmitEnumReadonlyProperty.js]
|
|
"use strict";
|
|
var E;
|
|
(function (E) {
|
|
E["A"] = "a";
|
|
E["B"] = "b";
|
|
})(E || (E = {}));
|
|
class C {
|
|
constructor() {
|
|
this.type = E.A;
|
|
}
|
|
}
|
|
let x = new C().type;
|
|
|
|
|
|
//// [declarationEmitEnumReadonlyProperty.d.ts]
|
|
declare enum E {
|
|
A = "a",
|
|
B = "b"
|
|
}
|
|
declare class C {
|
|
readonly type = E.A;
|
|
}
|
|
declare let x: E.A;
|