@@ -4243,13 +4243,13 @@ fixMemberRef(ConstraintSystem &cs, Type baseTy,
4243
4243
DeclName memberName, const OverloadChoice &choice,
4244
4244
ConstraintLocator *locator,
4245
4245
Optional<MemberLookupResult::UnviableReason> reason = None) {
4246
- if (!choice. isDecl ())
4247
- return nullptr ;
4248
-
4249
- auto *decl = choice.getDecl ();
4250
- if (auto *CD = dyn_cast<ConstructorDecl>(decl)) {
4251
- if ( auto *fix = validateInitializerRef (cs, CD, locator))
4252
- return fix;
4246
+ // Not all of the choices handled here are going
4247
+ // to refer to a declaration.
4248
+ if (choice. isDecl ()) {
4249
+ if ( auto *CD = dyn_cast<ConstructorDecl>( choice.getDecl ())) {
4250
+ if (auto *fix = validateInitializerRef (cs, CD, locator))
4251
+ return fix;
4252
+ }
4253
4253
}
4254
4254
4255
4255
if (reason) {
@@ -4259,7 +4259,8 @@ fixMemberRef(ConstraintSystem &cs, Type baseTy,
4259
4259
return AllowTypeOrInstanceMember::create (cs, baseTy, memberName, locator);
4260
4260
4261
4261
case MemberLookupResult::UR_Inaccessible:
4262
- return AllowInaccessibleMember::create (cs, decl, locator);
4262
+ assert (choice.isDecl ());
4263
+ return AllowInaccessibleMember::create (cs, choice.getDecl (), locator);
4263
4264
4264
4265
case MemberLookupResult::UR_MutatingMemberOnRValue:
4265
4266
case MemberLookupResult::UR_MutatingGetterOnRValue:
0 commit comments