Skip to content

Unexpected conditional expression type inference change #7986

Description

@JukkaL

#7955 caused this example to start generating type errors:

from typing import List, Union

def g(a: List[str], b: bool) -> bool:
    x = a and b
    y: bool
    return x or y  # Incompatible return value type (got "Union[List[str], bool]", expected "bool")

Previously, this generated no errors. It's unclear whether this fixed a false negative or whether this is a regression.

@Michael0x2a Do you have an idea of what might be going on?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions