Skip to content

Add warning diagnostic when trying to use if statement expression that always evaluates to true in Lua #1212

@felixhirt

Description

@felixhirt

Maybe i missed something in the documentation or issues, but i cannot find anything about the difference in falsy values. The most obvious one being "0", and the transpilation of this code:
image
As far as i can tell, this should not print the value because 0 is false in typescript. But it will print it, because 0 is true in lua!

Is this intended? Am i wrong and 0 is actually true in typescript as well? I am quite confused right now

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions