Comment and assertion changes transpilation of return
statement
#60296
Labels
Fix Available
A PR has been opened for this issue
🔎 Search Terms
transpile, output, return statement
🕗 Version & Regression Information
4.5.5
and4.6.0
. Versions4.6.1
,4.6.2
,4.7.4
,4.8.4
,4.9.5
,5.0.4
,5.1.6
,5.2.2
,5.3.3
,5.4.5
,5.5.4
,5.6.3
,5.7.0-beta
, and5.7.0-dev.20241020
(aka the ones accessible from the TS version dropdown on the Playground, along with4.6.1
) have all been explicitly tested on the Playground and all exhibit the behaviour—presumably, the versions in between do too.⏯ Playground Link
https://www.typescriptlang.org/play/?#code/CYUwxgNghgTiAEYD2A7AzgF3kgRgKwC54AlcJGYAHkxgEsUBzAGnihQE8A+AKG4Ho+8FEkRIAtmJAosbYEJEByKGgXwAvNgDWUdtwBmAVxRgMtVKwAUASngBvbvEfw4GAzBTwLDpz9x4A2gBEUDhggQC63o42GgCMANzcAL68hsam5jjWdlHOIK7unrk+AtgoEOysohJSWBpI2ro+vvhBIWGRPjHwCcm8pagVrB5KKupaOvpGJmYeYNn2Pi5uHl7NTn5toRGsaEIGYjggMLndvSlT6bPwwAu5y4Vr6-ClAO60GAAW8F8IyDXSeAAangowULA+8BwcCgmjQxQ2rWC23Cu32h2Op3G524QA
💻 Code
which transpiles to:
🙁 Actual behavior
The issue is function
d
—this function will always returnundefined
at runtime🙂 Expected behavior
As with versions prior to
4.6.0
, functiond
should be transpiled as:Additional information about the issue
No response
The text was updated successfully, but these errors were encountered: