Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mypy/checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -5968,7 +5968,7 @@ def _make_fake_typeinfo_and_full_name(
errors.append((pretty_names_list, "would have incompatible method signatures"))
return None

curr_module.names[full_name] = SymbolTableNode(GDEF, info)
curr_module.names[full_name] = SymbolTableNode(GDEF, info, False, module_hidden=True)
return Instance(info, [], extra_attrs=instances[0].extra_attrs or instances[1].extra_attrs)

def intersect_instance_callable(self, typ: Instance, callable_type: CallableType) -> Instance:
Expand Down
19 changes: 19 additions & 0 deletions test-data/unit/check-modules.test
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,25 @@ x = 1
[file m2.py]
x = 1

[case testStarImportDoesNotImportGeneratedIntersections]
from m1 import *
from m2 import *
[file m1.py]
from m3 import A, B

a: A
if isinstance(a, B): ...
[file m2.py]
from m3 import A, B

a: A
if isinstance(a, B): ...
[file m3.py]
class A: ...
class B: ...
class AB(A, B): ...
[builtins fixtures/isinstance.pyi]

[case testAssignToFuncDefViaImport]

# Errors differ with the new analyzer. (Old analyzer gave error on the
Expand Down