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: 2 additions & 0 deletions mypy/join.py
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,8 @@ def default(self, typ: Type) -> ProperType:
typ = get_proper_type(typ)
if isinstance(typ, Instance):
return object_from_instance(typ)
elif isinstance(typ, TypeType):
return self.default(typ.item)
elif isinstance(typ, UnboundType):
return AnyType(TypeOfAny.special_form)
elif isinstance(typ, TupleType):
Expand Down
4 changes: 4 additions & 0 deletions mypy/test/testtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1064,6 +1064,10 @@ def test_variadic_tuple_joins(self) -> None:
self.tuple(UnpackType(Instance(self.fx.std_tuplei, [self.fx.a])), self.fx.a),
)

def test_join_type_type_type_var(self) -> None:
self.assert_join(self.fx.type_a, self.fx.t, self.fx.o)
self.assert_join(self.fx.t, self.fx.type_a, self.fx.o)

# There are additional test cases in check-inference.test.

# TODO: Function types + varargs and default args.
Expand Down