mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Fix a crash on subscript decls in protocols.
Swift SVN r12277
This commit is contained in:
@@ -1526,7 +1526,9 @@ ConstraintSystem::simplifyMemberConstraint(const Constraint &constraint) {
|
||||
|
||||
// Subscripts are ok on rvalues so long as the getter is @!mutating.
|
||||
if (auto *SD = dyn_cast<SubscriptDecl>(result))
|
||||
if (SD->getGetter()->isMutating())
|
||||
// The subscript decl won't have a getter if this is in protocol. In
|
||||
// that case, we assume it is non-mutating.
|
||||
if (SD->getGetter() && SD->getGetter()->isMutating())
|
||||
continue;
|
||||
|
||||
// Computed properties are ok on rvalues so long as the getter is
|
||||
|
||||
Reference in New Issue
Block a user