Created
October 8, 2016 12:19
-
-
Save AtsushiSuzuki/8503c422bdc67c66e30c1b798de7f0c0 to your computer and use it in GitHub Desktop.
TypeScript 2.0.3 possible bug?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test1.ts(8,12): error TS1005: '=' expected. | |
test1.ts(9,27): error TS1005: ')' expected. | |
test1.ts(9,39): error TS1005: ';' expected. | |
test1.ts(9,41): error TS1005: '=>' expected. | |
test1.ts(11,6): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. | |
test1.ts(13,1): error TS1128: Declaration or statement expected. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Test1 { | |
async hello() { | |
return ["hello", "world"]; | |
} | |
test() { | |
// should be OK but fail with TypeScript 2.0.3 | |
(async () => { | |
for (let i in await this.hello()) { | |
} | |
}); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Test2 { | |
async hello() { | |
return ["hello", "world"]; | |
} | |
async test() { | |
for (let i in await this.hello()) { | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Test3 { | |
async hello() { | |
return ["hello", "world"]; | |
} | |
test() { | |
const fn = async () => { | |
for (let i in await this.hello()) { | |
} | |
}; | |
fn(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Test4 { | |
async hello() { | |
return ["hello", "world"]; | |
} | |
test() { | |
(async () => { | |
await this.hello(); | |
}); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"compilerOptions": { | |
"module": "commonjs", | |
"target": "es6", | |
"noImplicitAny": true, | |
"strictNullChecks": true | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment