mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
37 lines
1.3 KiB
Plaintext
37 lines
1.3 KiB
Plaintext
//// [tests/cases/compiler/constDeclarations-errors.ts] ////
|
|
|
|
=== constDeclarations-errors.ts ===
|
|
// error, missing intialicer
|
|
const c1;
|
|
>c1 : Symbol(c1, Decl(constDeclarations-errors.ts, 1, 5))
|
|
|
|
const c2: number;
|
|
>c2 : Symbol(c2, Decl(constDeclarations-errors.ts, 2, 5))
|
|
|
|
const c3, c4, c5 :string, c6; // error, missing initialicer
|
|
>c3 : Symbol(c3, Decl(constDeclarations-errors.ts, 3, 5))
|
|
>c4 : Symbol(c4, Decl(constDeclarations-errors.ts, 3, 9))
|
|
>c5 : Symbol(c5, Decl(constDeclarations-errors.ts, 3, 13))
|
|
>c6 : Symbol(c6, Decl(constDeclarations-errors.ts, 3, 25))
|
|
|
|
for(const c in {}) { }
|
|
>c : Symbol(c, Decl(constDeclarations-errors.ts, 5, 9))
|
|
|
|
// error, assigning to a const
|
|
for(const c8 = 0; c8 < 1; c8++) { }
|
|
>c8 : Symbol(c8, Decl(constDeclarations-errors.ts, 8, 9))
|
|
>c8 : Symbol(c8, Decl(constDeclarations-errors.ts, 8, 9))
|
|
>c8 : Symbol(c8, Decl(constDeclarations-errors.ts, 8, 9))
|
|
|
|
// error, can not be unintalized
|
|
for(const c9; c9 < 1;) { }
|
|
>c9 : Symbol(c9, Decl(constDeclarations-errors.ts, 11, 9))
|
|
>c9 : Symbol(c9, Decl(constDeclarations-errors.ts, 11, 9))
|
|
|
|
// error, can not be unintalized
|
|
for(const c10 = 0, c11; c10 < 1;) { }
|
|
>c10 : Symbol(c10, Decl(constDeclarations-errors.ts, 14, 9))
|
|
>c11 : Symbol(c11, Decl(constDeclarations-errors.ts, 14, 18))
|
|
>c10 : Symbol(c10, Decl(constDeclarations-errors.ts, 14, 9))
|
|
|