File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
lib/AST/RequirementMachine Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -244,10 +244,19 @@ RequirementMachine::getLongestValidPrefix(const MutableTerm &term) const {
244
244
" Protocol symbol can only appear at the start of a type term" );
245
245
break ;
246
246
247
- case Symbol::Kind::GenericParam:
247
+ case Symbol::Kind::GenericParam: {
248
248
assert (prefix.empty () &&
249
249
" Generic parameter symbol can only appear at the start of a type term" );
250
+
251
+ if (std::find_if (Params.begin (), Params.end (),
252
+ [&](Type otherParam) -> bool {
253
+ return otherParam->isEqual (symbol.getGenericParam ());
254
+ }) == Params.end ()) {
255
+ return prefix;
256
+ }
257
+
250
258
break ;
259
+ }
251
260
252
261
case Symbol::Kind::AssociatedType: {
253
262
const auto *props = Map.lookUpProperties (prefix);
You can’t perform that action at this time.
0 commit comments