|
| 1 | +//// [tests/cases/compiler/typeAliasDeclareKeywordNewlines.ts] //// |
| 2 | + |
| 3 | +=== typeAliasDeclareKeywordNewlines.ts === |
| 4 | +var declare: any, type: any; |
| 5 | +>declare : Symbol(declare, Decl(typeAliasDeclareKeywordNewlines.ts, 0, 3)) |
| 6 | +>type : Symbol(type, Decl(typeAliasDeclareKeywordNewlines.ts, 0, 17)) |
| 7 | + |
| 8 | +// The following is invalid but should declare a type alias named 'T1': |
| 9 | +declare type /*unexpected newline*/ |
| 10 | +T1 = null; |
| 11 | +>T1 : Symbol(T1, Decl(typeAliasDeclareKeywordNewlines.ts, 0, 28)) |
| 12 | + |
| 13 | +const t1: T1 = null; |
| 14 | +>t1 : Symbol(t1, Decl(typeAliasDeclareKeywordNewlines.ts, 5, 5)) |
| 15 | +>T1 : Symbol(T1, Decl(typeAliasDeclareKeywordNewlines.ts, 0, 28)) |
| 16 | + |
| 17 | +let T: null; |
| 18 | +>T : Symbol(T, Decl(typeAliasDeclareKeywordNewlines.ts, 7, 3)) |
| 19 | + |
| 20 | +// The following should use a variable named 'declare', use a variable named |
| 21 | +// 'type', and assign to a variable named 'T'. |
| 22 | +declare /*ASI*/ |
| 23 | +>declare : Symbol(declare, Decl(typeAliasDeclareKeywordNewlines.ts, 0, 3)) |
| 24 | + |
| 25 | +type /*ASI*/ |
| 26 | +>type : Symbol(type, Decl(typeAliasDeclareKeywordNewlines.ts, 0, 17)) |
| 27 | + |
| 28 | +T = null; |
| 29 | +>T : Symbol(T, Decl(typeAliasDeclareKeywordNewlines.ts, 7, 3)) |
| 30 | + |
| 31 | +// The following should use a variable named 'declare' and declare a type alias |
| 32 | +// named 'T2': |
| 33 | +declare /*ASI*/ |
| 34 | +>declare : Symbol(declare, Decl(typeAliasDeclareKeywordNewlines.ts, 0, 3)) |
| 35 | + |
| 36 | +type T2 = null; |
| 37 | +>T2 : Symbol(T2, Decl(typeAliasDeclareKeywordNewlines.ts, 16, 7)) |
| 38 | + |
| 39 | +const t2: T2 = null; |
| 40 | +>t2 : Symbol(t2, Decl(typeAliasDeclareKeywordNewlines.ts, 18, 5)) |
| 41 | +>T2 : Symbol(T2, Decl(typeAliasDeclareKeywordNewlines.ts, 16, 7)) |
| 42 | + |
0 commit comments