f8b6a8fc8d
* Introduce literal freshness for literal enum members, allow enum references in ambient const initializers * Merge statements * Add enum literal readonly property test case * Accept better baselines post-merge
23 lines
No EOL
481 B
TypeScript
23 lines
No EOL
481 B
TypeScript
// @declaration: true
|
|
|
|
function f<T>(x: T): T {
|
|
return x;
|
|
}
|
|
|
|
enum E { A, B, C, "non identifier" }
|
|
|
|
const c1 = "abc";
|
|
const c2 = 123;
|
|
const c3 = c1;
|
|
const c4 = c2;
|
|
const c5 = f(123);
|
|
const c6 = f(-123);
|
|
const c7 = true;
|
|
const c8 = E.A;
|
|
const c8b = E["non identifier"];
|
|
const c9 = { x: "abc" };
|
|
const c10 = [123];
|
|
const c11 = "abc" + "def";
|
|
const c12 = 123 + 456;
|
|
const c13 = Math.random() > 0.5 ? "abc" : "def";
|
|
const c14 = Math.random() > 0.5 ? 123 : 456; |