Skip to content

Commit dbc0422

Browse files
committed
[Type checker] Ensure we validate type declarations before using them.
Fixes a crasher regression.
1 parent ca117dd commit dbc0422

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/Sema/TypeCheckGeneric.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,9 @@ Type CompleteGenericTypeResolver::resolveDependentMemberType(
191191
// Otherwise, the nested type comes from a concrete tpye. Substitute the
192192
// base type into it.
193193
auto concrete = ref->getBoundDecl();
194+
TC.validateDeclForNameLookup(concrete);
195+
if (!concrete->hasInterfaceType())
196+
return ErrorType::get(TC.Context);
194197
if (baseTy->isTypeParameter()) {
195198
if (auto proto =
196199
concrete->getDeclContext()

0 commit comments

Comments
 (0)