File tree Expand file tree Collapse file tree 1 file changed +16
-8
lines changed Expand file tree Collapse file tree 1 file changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -1109,16 +1109,24 @@ static VarDecl *getPointeeProperty(VarDecl *&cache,
1109
1109
// There must be a property named "pointee".
1110
1110
auto identifier = ctx.getIdentifier (" pointee" );
1111
1111
auto results = nominal->lookupDirect (identifier);
1112
- if (results.size () != 1 ) return nullptr ;
1112
+ for (auto result : results) {
1113
+ // The property must have type T.
1114
+ auto *property = dyn_cast<VarDecl>(result);
1115
+ if (!property)
1116
+ continue ;
1113
1117
1114
- // The property must have type T.
1115
- auto *property = dyn_cast<VarDecl>(results[0 ]);
1116
- if (!property) return nullptr ;
1117
- if (!property->getInterfaceType ()->isEqual (sig.getGenericParams ()[0 ]))
1118
- return nullptr ;
1118
+ if (!property->getInterfaceType ()->isEqual (sig.getGenericParams ()[0 ]))
1119
+ continue ;
1119
1120
1120
- cache = property;
1121
- return property;
1121
+ if (property->getFormalAccess () != AccessLevel::Public)
1122
+ continue ;
1123
+
1124
+ cache = property;
1125
+ return property;
1126
+ }
1127
+
1128
+ llvm_unreachable (" Could not find pointee property" );
1129
+ return nullptr ;
1122
1130
}
1123
1131
1124
1132
VarDecl *
You can’t perform that action at this time.
0 commit comments