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 {
244244 " Protocol symbol can only appear at the start of a type term" );
245245 break ;
246246
247- case Symbol::Kind::GenericParam:
247+ case Symbol::Kind::GenericParam: {
248248 assert (prefix.empty () &&
249249 " 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+
250258 break ;
259+ }
251260
252261 case Symbol::Kind::AssociatedType: {
253262 const auto *props = Map.lookUpProperties (prefix);
You can’t perform that action at this time.
0 commit comments