Skip to content

Commit 68b2cb7

Browse files
committed
Don't use SILBoxType::getBoxedType() in isUnspecializedGeneric.
NFC, since it's unlikely anyone would ask this of a SIL-only type to begin with.
1 parent 6fffae7 commit 68b2cb7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/AST/Type.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,8 +375,11 @@ bool TypeBase::isUnspecializedGeneric() {
375375
return cast<SILBlockStorageType>(this)->getCaptureType()
376376
->isUnspecializedGeneric();
377377
case TypeKind::SILBox:
378-
return cast<SILBoxType>(this)->getBoxedType()
379-
->isUnspecializedGeneric();
378+
for (auto &arg : cast<SILBoxType>(this)->getGenericArgs()) {
379+
if (arg.getReplacement()->isUnspecializedGeneric())
380+
return true;
381+
}
382+
return false;
380383
}
381384
llvm_unreachable("bad TypeKind");
382385
}

0 commit comments

Comments
 (0)