mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Diagnostics] Let invalid member ref carry member declaration instead of looking it up
All places where `invalid member ref` fix/diagnostic is used already have a reference to the potential member choice declaration, which diagnostic could take advantage of.
This commit is contained in:
@@ -4530,8 +4530,12 @@ fixMemberRef(ConstraintSystem &cs, Type baseTy,
|
||||
if (reason) {
|
||||
switch (*reason) {
|
||||
case MemberLookupResult::UR_InstanceMemberOnType:
|
||||
case MemberLookupResult::UR_TypeMemberOnInstance:
|
||||
return AllowTypeOrInstanceMember::create(cs, baseTy, memberName, locator);
|
||||
case MemberLookupResult::UR_TypeMemberOnInstance: {
|
||||
return choice.isDecl()
|
||||
? AllowTypeOrInstanceMember::create(
|
||||
cs, baseTy, choice.getDecl(), memberName, locator)
|
||||
: nullptr;
|
||||
}
|
||||
|
||||
case MemberLookupResult::UR_Inaccessible:
|
||||
assert(choice.isDecl());
|
||||
|
||||
Reference in New Issue
Block a user