Having a function that takes Optional[T]
as an input and returns T
(A type var) works incorrectly if T is an union
#17383
Labels
Bug Report
Having a function that takes
Optional[T]
as an input and returnsT
(A type var) works incorrectly if T is an union.To Reproduce
Expected Behavior
When calling
make_non_optional(my_value)
withA | B | None
the returned type should beA | B
Actual Behavior
It has
object
type as the return typeYour Environment
Mypy version used:
Python version used:
Mypy command-line flags: none
Mypy configuration options from
mypy.ini
(and other config files): noneThe text was updated successfully, but these errors were encountered: