@@ -1019,27 +1019,16 @@ static bool doesStorageProduceLValue(AbstractStorageDecl *storage,
1019
1019
if (!storage->isSetterAccessibleFrom (useDC))
1020
1020
return false ;
1021
1021
1022
- // If there is no base, or if the base isn't being used, it is settable.
1023
- // This is only possible for vars.
1024
- if (auto var = dyn_cast<VarDecl>(storage)) {
1025
- if (!baseType || var->isStatic ())
1026
- return true ;
1027
- }
1028
-
1029
- // If the base is an lvalue, then a reference produces an lvalue.
1030
- if (baseType->is <LValueType>())
1031
- return true ;
1032
-
1033
- // Stored properties of reference types produce lvalues.
1034
- if (baseType->hasReferenceSemantics () && storage->hasStorage ())
1022
+ // If there is no base, or the base is an lvalue, then a reference
1023
+ // produces an lvalue.
1024
+ if (!baseType || baseType->is <LValueType>())
1035
1025
return true ;
1036
1026
1037
- // So the base is an rvalue type. The only way an accessor can
1027
+ // The base is an rvalue type. The only way an accessor can
1038
1028
// produce an lvalue is if we have a property where both the
1039
1029
// getter and setter are nonmutating.
1040
- return !storage->hasStorage () &&
1041
- !storage->isGetterMutating () &&
1042
- !storage->isSetterMutating ();
1030
+ return (!storage->isGetterMutating () &&
1031
+ !storage->isSetterMutating ());
1043
1032
}
1044
1033
1045
1034
Type ConstraintSystem::getUnopenedTypeOfReference (VarDecl *value, Type baseType,
0 commit comments