From b620abeff890986fd45749936a28b50504f03f9c Mon Sep 17 00:00:00 2001 From: Aosen Xiong Date: Fri, 31 May 2024 15:27:00 -0400 Subject: [PATCH] Don't check ObjectIdentity if it is infer mode --- src/main/java/pico/inference/PICOInferenceVisitor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); }