File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -1640,14 +1640,12 @@ DeclReferenceType ConstraintSystem::getTypeOfMemberReference(
16401640 memberTy = replaceInferableTypesWithTypeVars (
16411641 memberTy, locator, preparedOverload);
16421642
1643- // Wrap it in a metatype.
1644- memberTy = MetatypeType::get (memberTy);
1645-
1646- // If this is a value generic, undo the wrapping. 'substMemberTypeWithBase'
1647- // returns the underlying value type of the value generic (e.g. 'Int').
1648- if (isa<GenericTypeParamDecl>(value) &&
1649- cast<GenericTypeParamDecl>(value)->isValue ()) {
1650- memberTy = memberTy->castTo <MetatypeType>()->getInstanceType ();
1643+ // Wrap it in a metatype, unless this is a value generic.
1644+ // 'substMemberTypeWithBase' returns the underlying value type
1645+ // of the value generic (e.g. 'Int').
1646+ if (!isa<GenericTypeParamDecl>(value) ||
1647+ !cast<GenericTypeParamDecl>(value)->isValue ()) {
1648+ memberTy = MetatypeType::get (memberTy);
16511649 }
16521650
16531651 auto openedType = FunctionType::get ({baseObjParam}, memberTy);
You can’t perform that action at this time.
0 commit comments