TypeScript/tests/baselines/reference/constDeclarations-scopes2.types

37 lines
1 KiB
Plaintext
Raw Normal View History

2014-10-15 02:37:46 +02:00
=== tests/cases/compiler/constDeclarations-scopes2.ts ===
// global
const c = "string";
2015-04-13 23:01:57 +02:00
>c : string, Symbol(c, Decl(constDeclarations-scopes2.ts, 2, 5))
2015-04-13 21:36:11 +02:00
>"string" : string
2014-10-15 02:37:46 +02:00
var n: number;
2015-04-13 23:01:57 +02:00
>n : number, Symbol(n, Decl(constDeclarations-scopes2.ts, 4, 3))
2014-10-15 02:37:46 +02:00
var b: boolean;
2015-04-13 23:01:57 +02:00
>b : boolean, Symbol(b, Decl(constDeclarations-scopes2.ts, 5, 3))
2014-10-15 02:37:46 +02:00
// for scope
for (const c = 0; c < 10; n = c ) {
2015-04-13 23:01:57 +02:00
>c : number, Symbol(c, Decl(constDeclarations-scopes2.ts, 8, 10))
2015-04-13 21:36:11 +02:00
>0 : number
2014-10-15 02:37:46 +02:00
>c < 10 : boolean
2015-04-13 23:01:57 +02:00
>c : number, Symbol(c, Decl(constDeclarations-scopes2.ts, 8, 10))
2015-04-13 21:36:11 +02:00
>10 : number
2014-10-15 02:37:46 +02:00
>n = c : number
2015-04-13 23:01:57 +02:00
>n : number, Symbol(n, Decl(constDeclarations-scopes2.ts, 4, 3))
>c : number, Symbol(c, Decl(constDeclarations-scopes2.ts, 8, 10))
2014-10-15 02:37:46 +02:00
// for block
const c = false;
2015-04-13 23:01:57 +02:00
>c : boolean, Symbol(c, Decl(constDeclarations-scopes2.ts, 10, 9))
2015-04-13 21:36:11 +02:00
>false : boolean
2014-10-15 02:37:46 +02:00
b = c;
>b = c : boolean
2015-04-13 23:01:57 +02:00
>b : boolean, Symbol(b, Decl(constDeclarations-scopes2.ts, 5, 3))
>c : boolean, Symbol(c, Decl(constDeclarations-scopes2.ts, 10, 9))
2014-10-15 02:37:46 +02:00
}