Skip to content

Fix preceding statements with ternary operator#1234

Merged
Perryvw merged 1 commit intoTypeScriptToLua:masterfrom
GlassBricks:ternary-preceding-statements
Mar 17, 2022
Merged

Fix preceding statements with ternary operator#1234
Perryvw merged 1 commit intoTypeScriptToLua:masterfrom
GlassBricks:ternary-preceding-statements

Conversation

@GlassBricks
Copy link
Copy Markdown
Contributor

Fixes #1231

return { result, i };
`
.setOptions({
strictNullChecks: true,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this option required here, I don't see any undefineds/nulls in the tests?

Copy link
Copy Markdown
Contributor Author

@GlassBricks GlassBricks Mar 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without it, the test doesn't start as failing and detect the issue:
The type number with no strict null checks may be null and therefore falsy, so the if statement was used.

@GlassBricks GlassBricks requested a review from Perryvw March 16, 2022 20:52
@Perryvw Perryvw merged commit 191c20b into TypeScriptToLua:master Mar 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error in ternary operator

2 participants