diff --git a/crates/red_knot_python_semantic/resources/mdtest/conditional/match.md b/crates/red_knot_python_semantic/resources/mdtest/conditional/match.md index 81dd93e738ade..2b92c6c734a61 100644 --- a/crates/red_knot_python_semantic/resources/mdtest/conditional/match.md +++ b/crates/red_knot_python_semantic/resources/mdtest/conditional/match.md @@ -3,40 +3,43 @@ ## With wildcard ```py -match 0: - case 1: - y = 2 - case _: - y = 3 - -reveal_type(y) # revealed: Literal[2, 3] +def _(target: int): + match target: + case 1: + y = 2 + case _: + y = 3 + + reveal_type(y) # revealed: Literal[2, 3] ``` ## Without wildcard ```py -match 0: - case 1: - y = 2 - case 2: - y = 3 - -# revealed: Literal[2, 3] -# error: [possibly-unresolved-reference] -reveal_type(y) +def _(target: int): + match target: + case 1: + y = 2 + case 2: + y = 3 + + # revealed: Literal[2, 3] + # error: [possibly-unresolved-reference] + reveal_type(y) ``` ## Basic match ```py -y = 1 -y = 2 +def _(target: int): + y = 1 + y = 2 -match 0: - case 1: - y = 3 - case 2: - y = 4 + match target: + case 1: + y = 3 + case 2: + y = 4 -reveal_type(y) # revealed: Literal[2, 3, 4] + reveal_type(y) # revealed: Literal[2, 3, 4] ```