mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Merge pull request #18392 from slavapestov/error-type-cleanup
Error type cleanup
This commit is contained in:
@@ -1204,14 +1204,13 @@ TypeConverter::canStorageUseStoredKeyPathComponent(AbstractStorageDecl *decl) {
|
||||
M.getSwiftModule());
|
||||
switch (strategy.getKind()) {
|
||||
case AccessStrategy::Storage: {
|
||||
// If the stored value would need to be reabstracted in fully opaque
|
||||
// context, then we have to treat the component as computed.
|
||||
auto componentObjTy = decl->getStorageInterfaceType()
|
||||
->getWithoutSpecifierType();
|
||||
// Keypaths rely on accessors to handle the special behavior of weak or
|
||||
// unowned properties.
|
||||
if (componentObjTy->is<ReferenceStorageType>())
|
||||
if (decl->getInterfaceType()->is<ReferenceStorageType>())
|
||||
return false;
|
||||
// If the stored value would need to be reabstracted in fully opaque
|
||||
// context, then we have to treat the component as computed.
|
||||
auto componentObjTy = decl->getValueInterfaceType();
|
||||
if (auto genericEnv =
|
||||
decl->getInnermostDeclContext()->getGenericEnvironmentOfContext())
|
||||
componentObjTy = genericEnv->mapTypeIntoContext(componentObjTy);
|
||||
|
||||
Reference in New Issue
Block a user