TypeScript/tests/cases/compiler/ambientConstLiterals.ts
Anders Hejlsberg b6b8e8c308 Add tests
2016-09-26 12:47:22 -07:00

22 lines
429 B
TypeScript

// @declaration: true
function f<T>(x: T): T {
return x;
}
enum E { A, B, C }
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 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;