File tree Expand file tree Collapse file tree 2 files changed +3
-9
lines changed Expand file tree Collapse file tree 2 files changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -4224,8 +4224,7 @@ Optional<Identifier> TypeChecker::omitNeedlessWords(VarDecl *var) {
4224
4224
return None;
4225
4225
4226
4226
// Dig out the type of the variable.
4227
- Type type = var->getInterfaceType ()->getReferenceStorageReferent ()
4228
- ->getWithoutSpecifierType ();
4227
+ Type type = var->getValueInterfaceType ();
4229
4228
while (auto optObjectTy = type->getOptionalObjectType ())
4230
4229
type = optObjectTy;
4231
4230
Original file line number Diff line number Diff line change @@ -3865,13 +3865,8 @@ void TypeChecker::validateDecl(ValueDecl *D) {
3865
3865
auto valueParams = accessor->getParameters ();
3866
3866
3867
3867
// Determine the value type.
3868
- Type valueIfaceTy;
3869
- if (auto VD = dyn_cast<VarDecl>(storage)) {
3870
- valueIfaceTy = VD->getInterfaceType ()->getReferenceStorageReferent ();
3871
- } else {
3872
- auto SD = cast<SubscriptDecl>(storage);
3873
- valueIfaceTy = SD->getElementInterfaceType ();
3874
-
3868
+ Type valueIfaceTy = storage->getValueInterfaceType ();
3869
+ if (auto SD = dyn_cast<SubscriptDecl>(storage)) {
3875
3870
// Copy the index types instead of re-validating them.
3876
3871
auto indices = SD->getIndices ();
3877
3872
for (size_t i = 0 , e = indices->size (); i != e; ++i) {
You can’t perform that action at this time.
0 commit comments