Skip to content

Commit

Permalink
Add test case for class union < 3.10
Browse files Browse the repository at this point in the history
  • Loading branch information
dcreager committed Dec 27, 2024
1 parent a5f0dad commit 5239fa9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions crates/red_knot_python_semantic/resources/mdtest/binary/classes.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,13 @@ class B: ...

reveal_type(A | B) # revealed: UnionType
```

## Union of two classes (prior to 3.10)

```py
class A: ...
class B: ...

# error: "Operator `|` is unsupported between objects of type `Literal[A]` and `Literal[B]`"
reveal_type(A | B) # revealed: Unknown
```

0 comments on commit 5239fa9

Please sign in to comment.