Skip to content

Investigate logical expression type rules #1136

Closed
@dcodeIO

Description

@dcodeIO

While working on #1129 I noticed that the rules in place for logical && and || are weird.

if (someObject && someInt) // cannot convert RHS integer to LHS object
if (someObject && someBool) // cannot convert RHS boolean to LHS object
var foo = aFooNullable || bFoo; // cannot convert RHS non-nullable to LHS nullable

Boolean context is especially strange. Pinning here so we don't forget.

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