Skip to content

Commit 1210bb6

Browse files
committed
SIL: SILFunctionTypes don't allow generic signatures where all parameters are concrete
1 parent 11b1ce2 commit 1210bb6

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lib/AST/ASTContext.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4000,6 +4000,10 @@ SILFunctionType::SILFunctionType(GenericSignature *genericSig, ExtInfo ext,
40004000

40014001
// Make sure the interface types are sane.
40024002
if (genericSig) {
4003+
assert(!genericSig->areAllParamsConcrete() &&
4004+
"If all generic parameters are concrete, SILFunctionType should "
4005+
"not have a generic signature at all");
4006+
40034007
for (auto gparam : genericSig->getGenericParams()) {
40044008
(void)gparam;
40054009
assert(gparam->isCanonical() && "generic signature is not canonicalized");

lib/IRGen/GenProto.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3091,7 +3091,7 @@ GenericTypeRequirements::GenericTypeRequirements(IRGenModule &IGM,
30913091
// We only need to do something here if the declaration context is
30923092
// somehow generic.
30933093
auto ncGenerics = typeDecl->getGenericSignatureOfContext();
3094-
if (!ncGenerics) return;
3094+
if (!ncGenerics || ncGenerics->areAllParamsConcrete()) return;
30953095

30963096
// Construct a representative function type.
30973097
auto generics = ncGenerics->getCanonicalSignature();

0 commit comments

Comments
 (0)