Sema: Generic parameters can only bind to materializable types

I don't have a test case for this, so it might be a no-op.
But it's clearly "correct".
This commit is contained in:
Slava Pestov
2017-05-10 16:58:23 -07:00
parent fb77682b5a
commit 6c443113ae

View File

@@ -373,7 +373,9 @@ namespace {
cast<GenericTypeParamType>(genericParam->getCanonicalType()));
if (known == replacements.end())
return cs.createTypeVariable(nullptr, TVO_PrefersSubtypeBinding);
return cs.createTypeVariable(nullptr,
TVO_PrefersSubtypeBinding |
TVO_MustBeMaterializable);
return known->second;
}