File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -4526,6 +4526,15 @@ bool ConstraintSystem::diagnoseAmbiguity(ArrayRef<Solution> solutions) {
4526
4526
// is not sufficiently centralized in the AST.
4527
4527
DeclNameRef name (getOverloadChoiceName (overload.choices ));
4528
4528
auto anchor = simplifyLocatorToAnchor (overload.locator );
4529
+ if (!anchor) {
4530
+ // It's not clear that this is actually valid. Just use the overload's
4531
+ // anchor for release builds, but assert so we can properly diagnose
4532
+ // this case if it happens to be hit. Note that the overload will
4533
+ // *always* be anchored, otherwise everything would be broken, ie. this
4534
+ // assertion would be the least of our worries.
4535
+ anchor = overload.locator ->getAnchor ();
4536
+ assert (false && " locator could not be simplified to anchor" );
4537
+ }
4529
4538
4530
4539
// Emit the ambiguity diagnostic.
4531
4540
auto &DE = getASTContext ().Diags ;
You can’t perform that action at this time.
0 commit comments