summaryrefslogtreecommitdiff
path: root/puzzles/infer_literal_narrowing.py
blob: 953405a6ce35360448d42e0287785ec97a48be2a (plain)
1
2
3
4
5
from typing import Literal

def f(x: int) -> None:
    if x == 1 or x == 2:
        _: Literal[1, 2] = x