Skip to content

Commit ed59b58

Browse files
Align enum class-value test with reverted overload behavior
test_enum_class_value (issue #1982) expected f(E.X) to match Literal[E.X] after literal member typing. Reverting that feature restores the general E branch; update the assertion accordingly. Made-with: Cursor
1 parent fe106ce commit ed59b58

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

pyrefly/lib/test/enums.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ def f(x: Literal[E.X]) -> int: ...
8383
def f(x: E) -> int | str | None: ...
8484
def f(x) -> int | str | None: ...
8585
86-
assert_type(f(E.X), int)
86+
# Without narrowing enum members to literal types, `E.X` matches the `E` overload.
87+
assert_type(f(E.X), int | str | None)
8788
"#,
8889
);
8990

0 commit comments

Comments
 (0)