TypeScript/tests/baselines/reference/constDeclarations-errors.errors.txt

65 lines
3 KiB
Text
Raw Normal View History

tests/cases/compiler/constDeclarations-errors.ts(3,7): error TS1155: const must be intialized.
tests/cases/compiler/constDeclarations-errors.ts(4,7): error TS1155: const must be intialized.
tests/cases/compiler/constDeclarations-errors.ts(5,7): error TS1155: const must be intialized.
tests/cases/compiler/constDeclarations-errors.ts(5,11): error TS1155: const must be intialized.
tests/cases/compiler/constDeclarations-errors.ts(5,15): error TS1155: const must be intialized.
tests/cases/compiler/constDeclarations-errors.ts(5,27): error TS1155: const must be intialized.
tests/cases/compiler/constDeclarations-errors.ts(8,5): error TS1109: Expression expected.
tests/cases/compiler/constDeclarations-errors.ts(8,5): error TS1156: const must be declared inside a block.
tests/cases/compiler/constDeclarations-errors.ts(8,11): error TS1155: const must be intialized.
tests/cases/compiler/constDeclarations-errors.ts(8,13): error TS1005: ';' expected.
tests/cases/compiler/constDeclarations-errors.ts(8,13): error TS1128: Declaration or statement expected.
tests/cases/compiler/constDeclarations-errors.ts(8,18): error TS1128: Declaration or statement expected.
tests/cases/compiler/constDeclarations-errors.ts(10,5): error TS1109: Expression expected.
tests/cases/compiler/constDeclarations-errors.ts(10,5): error TS1156: const must be declared inside a block.
tests/cases/compiler/constDeclarations-errors.ts(10,28): error TS1005: ';' expected.
tests/cases/compiler/constDeclarations-errors.ts(10,18): error TS2304: Cannot find name 'c'.
tests/cases/compiler/constDeclarations-errors.ts(10,25): error TS2304: Cannot find name 'c'.
==== tests/cases/compiler/constDeclarations-errors.ts (17 errors) ====
// error, missing intialicer
const c1;
~~
!!! error TS1155: const must be intialized.
const c2: number;
~~
!!! error TS1155: const must be intialized.
const c3, c4, c5 :string, c6; // error, missing initialicer
~~
!!! error TS1155: const must be intialized.
~~
!!! error TS1155: const must be intialized.
~~
!!! error TS1155: const must be intialized.
~~
!!! error TS1155: const must be intialized.
// error, wrong context
for(const c in {}) { }
~~~~~
!!! error TS1109: Expression expected.
~~~~~~~
!!! error TS1156: const must be declared inside a block.
~
!!! error TS1155: const must be intialized.
~~
!!! error TS1005: ';' expected.
~~
!!! error TS1128: Declaration or statement expected.
~
!!! error TS1128: Declaration or statement expected.
for(const c = 0; c < 9; c++) { }
~~~~~
!!! error TS1109: Expression expected.
~~~~~~~~~~~~
!!! error TS1156: const must be declared inside a block.
~
!!! error TS1005: ';' expected.
~
!!! error TS2304: Cannot find name 'c'.
~
!!! error TS2304: Cannot find name 'c'.