1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120
|
=== tests/cases/conformance/externalModules/topLevelAwaitErrors.1.ts ===
export {};
// reparse call as invalid await should error
await (1,);
>await (1,) : any
>(1,) : any
>1, : any
>1 : 1
> : any
await <number, string>(1);
>await <number, string>(1) : boolean
>await <number : number
><number : number
> : any
>string>(1) : boolean
>string : any
>(1) : 1
>1 : 1
// reparse tagged template as invalid await should error
await <number, string> ``;
>await <number, string> `` : boolean
>await <number : number
><number : number
> : any
>string> `` : boolean
>string : any
>`` : ""
// reparse class extends clause should fail
class C extends await<string> {
>C : C
>string : any
}
// await in class decorators should fail
@(await)
>(await) : any
>await : any
> : any
class C1 {}
>C1 : C1
@await(x)
>await(x) : any
> : any
>x : any
class C2 {}
>C2 : C2
@await
> : any
class C3 {}
>C3 : C3
// await in member decorators should fail
class C4 {
>C4 : C4
@await
> : any
["foo"]() {}
>["foo"] : () => void
>"foo" : "foo"
}
class C5 {
>C5 : C5
@await(1)
>await(1) : any
> : any
>1 : 1
["foo"]() {}
>["foo"] : () => void
>"foo" : "foo"
}
class C6 {
>C6 : C6
@(await)
>(await) : any
>await : any
> : any
["foo"]() {}
>["foo"] : () => void
>"foo" : "foo"
}
// await in parameter decorators should fail
class C7 {
>C7 : C7
method1(@await [x]) {}
>method1 : ([x]: [any]) => void
> : any
>x : any
method2(@await(1) [x]) {}
>method2 : ([x]: [any]) => void
>await(1) : any
> : any
>1 : 1
>x : any
method3(@(await) [x]) {}
>method3 : ([x]: [any]) => void
>(await) : any
>await : any
> : any
>x : any
}
|