diff --git a/src/main/java/pico/inference/PICOInferenceVisitor.java b/src/main/java/pico/inference/PICOInferenceVisitor.java index fee3daf..426a558 100644 --- a/src/main/java/pico/inference/PICOInferenceVisitor.java +++ b/src/main/java/pico/inference/PICOInferenceVisitor.java @@ -481,7 +481,7 @@ public Void visitMethod(MethodTree node, Void p) { flexibleOverrideChecker(node); // ObjectIdentityMethod check - if (PICOTypeUtil.isObjectIdentityMethod(node, atypeFactory)) { + if (!infer && PICOTypeUtil.isObjectIdentityMethod(node, atypeFactory)) { ObjectIdentityMethodEnforcer.check( atypeFactory.getPath(node.getBody()), (PICOInferenceRealTypeFactory) atypeFactory, checker); }