Incorrect compile result of arrow function using implicit return (starts with optional chaining) and with line comments in between #41814
Labels
Bug
A bug in TypeScript
Fix Available
A PR has been opened for this issue
Has Repro
This issue has compiler-backed repros: https://aka.ms/ts-repros
High Priority
Milestone
TypeScript Version: Since v3.8.3
Search Terms:
Arrow function, implicit return, line comments, optional chaining
Code
Expected behavior:
Something like:
Actual behavior:
return
, making this function always returnundefined
.Playground Link:
https://www.typescriptlang.org/play?target=1&ts=3.8.3#code/MYewdgzgLgBFCm0YF4YAowEMC2iBcM0ATgJZgDmA2gLoCUKAfDAFAxswD0HciUZ5MAIxwA7iFbssuCAH4AdADMSAGwRE0AD0YwNtANzNmoSCGXw5ykOTQJoaSgCJMDuvqA
Related Issues:
The text was updated successfully, but these errors were encountered: