File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -572,6 +572,48 @@ mod + 0 # E: Unsupported left operand type for + (Module)
572572x = 0
573573x += ""
574574
575+ [case testFollowImportsSilentOverloadResolution]
576+ # flags: --follow-imports=silent
577+ from mod import x
578+ reveal_type(x) # N: Revealed type is "builtins.str"
579+ [file mod.py]
580+ from typing import overload
581+ @overload
582+ def f(x: int) -> int: ...
583+ @overload
584+ def f(x: str) -> str: ...
585+ def f(x: int | str) -> int | str:
586+ return x
587+ x = f("")
588+
589+ [case testFollowImportsSilentReverseOperator]
590+ # flags: --follow-imports=silent
591+ from mod import x
592+ reveal_type(x) # N: Revealed type is "builtins.str"
593+ [file mod.py]
594+ class A:
595+ def __add__(self, other: int) -> int: ...
596+ class B:
597+ def __radd__(self, other: A) -> str: ...
598+ x = A() + B()
599+
600+ [case testFollowImportsSilentTypedDictUnion]
601+ # flags: --follow-imports=silent
602+ from mod import x
603+ reveal_type(x) # N: Revealed type is "builtins.str"
604+ [file mod.py]
605+ from typing_extensions import TypedDict
606+ class A(TypedDict):
607+ value: int
608+ class B(TypedDict):
609+ value: str
610+ data: A | B
611+ data = {"value": ""}
612+ x = data["value"]
613+ [file typing_extensions.pyi]
614+ TypedDict = 0
615+ class _TypedDict: pass
616+
575617[case testFollowImportsSilentTypeIgnore]
576618# flags: --warn-unused-ignores --follow-imports=silent
577619import mod
You can’t perform that action at this time.
0 commit comments