mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
SILGen: Fix a couple of problems with materializeForSet in constrained extensions
- Property defined in constrained extension of a class - Subscript defined in a constrained extension with non-canonical index type Fixes <rdar://problem/31222187>.
This commit is contained in:
@@ -52,9 +52,13 @@ TypeConverter::getIndicesAbstractionPattern(SubscriptDecl *decl) {
|
||||
CanGenericSignature genericSig;
|
||||
if (auto sig = decl->getGenericSignatureOfContext())
|
||||
genericSig = sig->getCanonicalSignature();
|
||||
return AbstractionPattern(genericSig,
|
||||
decl->getIndicesInterfaceType()
|
||||
->getCanonicalType());
|
||||
auto indicesTy = decl->getIndicesInterfaceType();
|
||||
auto indicesCanTy =
|
||||
(genericSig
|
||||
? genericSig->getCanonicalTypeInContext(indicesTy,
|
||||
*decl->getParentModule())
|
||||
: indicesTy->getCanonicalType());
|
||||
return AbstractionPattern(genericSig, indicesCanTy);
|
||||
}
|
||||
|
||||
static const clang::Type *getClangType(const clang::Decl *decl) {
|
||||
|
||||
Reference in New Issue
Block a user