You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When one of the arguments of the types in the union is shadowed, it should effectively be handled as Any but is currently effectively handled as an uninhabited type.
How can we reproduce the bug?
deftest_function_with_union_where_one_of_the_types_is_shadowed():
@typecheckeddeffoo(int: int|None) ->int|None:
returnint# All the following should pass because the typechecker cannot 'see'# int-type as it's shadowed from the int-argument.# However, the only test that passes at the moment is `foo(None)`.assertfoo(1) ==1assertfoo(None) isNoneassertfoo("foo") =="foo"
The text was updated successfully, but these errors were encountered:
Things to check first
I have searched the existing issues and didn't find my bug already reported there
I have checked that my bug is still present in the latest release
Typeguard version
master - 041b0e3
Python version
Python 3.10.12
What happened?
When one of the arguments of the types in the union is shadowed, it should effectively be handled as
Any
but is currently effectively handled as an uninhabited type.How can we reproduce the bug?
The text was updated successfully, but these errors were encountered: