Skip to content

Commit b9cb4e8

Browse files
committed
SIL: SILFunctionTypes don't allow generic signatures where all parameters are concrete
1 parent e08e9a9 commit b9cb4e8

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
@@ -4048,6 +4048,10 @@ SILFunctionType::SILFunctionType(GenericSignature *genericSig, ExtInfo ext,
40484048

40494049
// Make sure the interface types are sane.
40504050
if (genericSig) {
4051+
assert(!genericSig->areAllParamsConcrete() &&
4052+
"If all generic parameters are concrete, SILFunctionType should "
4053+
"not have a generic signature at all");
4054+
40514055
for (auto gparam : genericSig->getGenericParams()) {
40524056
(void)gparam;
40534057
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
@@ -3095,7 +3095,7 @@ GenericTypeRequirements::GenericTypeRequirements(IRGenModule &IGM,
30953095
// We only need to do something here if the declaration context is
30963096
// somehow generic.
30973097
auto ncGenerics = typeDecl->getGenericSignatureOfContext();
3098-
if (!ncGenerics) return;
3098+
if (!ncGenerics || ncGenerics->areAllParamsConcrete()) return;
30993099

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

0 commit comments

Comments
 (0)