We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e8a2630 commit 3579c61Copy full SHA for 3579c61
test-data/unit/check-python310.test
@@ -1220,6 +1220,21 @@ def main() -> None:
1220
case a:
1221
reveal_type(a) # N: Revealed type is "builtins.int"
1222
1223
+[case testMatchCapturePatternFromAsyncFunctionReturningUnion-xfail]
1224
+async def func1(arg: bool) -> str | int: ...
1225
+async def func2(arg: bool) -> bytes | int: ...
1226
+
1227
+async def main() -> None:
1228
+ match await func1(True):
1229
+ case str(a):
1230
+ match await func2(True):
1231
+ case c:
1232
+ reveal_type(a) # N: Revealed type is "builtins.str"
1233
+ reveal_type(c) # N: Revealed type is "Union[builtins.bytes, builtins.int]"
1234
1235
+ case a:
1236
+ reveal_type(a) # N: Revealed type is "builtins.int"
1237
1238
-- Guards --
1239
1240
[case testMatchSimplePatternGuard]
0 commit comments