Skip to content

Commit ba52903

Browse files
committed
Reduce the Type Match scope when comparing the method parameters
1 parent 3f6a741 commit ba52903

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

lib/PrintAsObjC/PrintAsObjC.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -971,11 +971,9 @@ class ObjCPrinter : private DeclVisitor<ObjCPrinter>,
971971

972972
bool hasSameParameterTypes = true;
973973
for (auto index : indices(*cParams)) {
974-
TypeMatchOptions matchMode = TypeMatchFlags::AllowOverride;
975-
matchMode |= TypeMatchFlags::AllowTopLevelOptionalMismatch;
976974
auto cParamsType = cParams->get(index)->getType();
977975
auto dParamsType = dParams->get(index)->getType();
978-
if (!cParamsType->matchesParameter(dParamsType, matchMode)) {
976+
if (!cParamsType->matchesParameter(dParamsType, TypeMatchFlags::AllowOverride)) {
979977
hasSameParameterTypes = false;
980978
break;
981979
}

0 commit comments

Comments
 (0)