-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Property is used before its initialization error is only shown during compilation when using ES2022 but is with ESNext #53286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hello Alan, |
Go for it |
Itβs not a duplicate as those issues are closed and problem still persists. It appears that the problem was only fixed for esnext. |
Hey Alan! |
@Dev79844, no one has opened a PR so far so feel free to open one. |
Can confirmed this issue is happening with ES2022 (and above, including ESNext) implies On ESNext, if you set the option to true, TS2729 shows up, and when false it doesn't. This is expected. But on ES2022, even with |
@alan-agius4 I am new to opensource could you suggest how would I test the error. |
@Anshul-target, please see the contributing guidelines. |
Hey @alan-agius4 does the PR #53885 fix this issue? |
Looks like it |
Bug Report
π Search Terms
π Version & Regression Information
β― Playground Link
ESNext: https://www.typescriptlang.org/play?useDefineForClassFields=true&target=99&ts=5.1.0-dev.20230315&ssl=4&ssc=2&pln=1&pc=1#code/MYGwhgzhAEBiD29oG9oChqegIzAJ2gF5oAXACwEsIA6bAVwC8BuDLYeAOwhLzuBPh4AFAAc8FAG5gSAUxyMAXNDocA1h3gB3DgEoUAXzT6gA
ES2022: https://www.typescriptlang.org/play?useDefineForClassFields=true&target=9&ts=5.1.0-dev.20230315&ssl=4&ssc=2&pln=1&pc=1#code/MYGwhgzhAEBiD29oG9oChqegIzAJ2gF5oAXACwEsIA6bAVwC8BuDLYeAOwhLzuBPh4AFAAc8FAG5gSAUxyMAXNDocA1h3gB3DgEoUAXzT6gA
π» Code
π Actual behavior
TSC correctly produces the below compilation error when targeting ESNext. But does not when targeting ES2022.
π Expected behavior
The same compilation error is shown when targetting ES2022.
The text was updated successfully, but these errors were encountered: