From db9dea9f50dc7f9a26c7ea6b8032925c48391450 Mon Sep 17 00:00:00 2001 From: coehlrich Date: Tue, 5 Sep 2023 18:56:00 +1200 Subject: [PATCH] Fix unnecessary casts with instanceof --- .../modules/decompiler/exps/FunctionExprent.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/exps/FunctionExprent.java b/src/org/jetbrains/java/decompiler/modules/decompiler/exps/FunctionExprent.java index 72868fc421..6ca24cef57 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/exps/FunctionExprent.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/exps/FunctionExprent.java @@ -18,9 +18,9 @@ import org.jetbrains.java.decompiler.struct.match.MatchNode; import org.jetbrains.java.decompiler.util.IntHelper; import org.jetbrains.java.decompiler.util.InterpreterUtil; +import org.jetbrains.java.decompiler.util.TextBuffer; import org.jetbrains.java.decompiler.util.Typed; import org.jetbrains.java.decompiler.util.collections.ListStack; -import org.jetbrains.java.decompiler.util.TextBuffer; import org.jetbrains.java.decompiler.util.collections.SFormsFastMapDirect; import java.util.*; @@ -293,6 +293,11 @@ public VarType getInferredExprType(VarType upperBound) { return type1; } + return getExprType(); + } else if (funcType == FunctionType.INSTANCEOF) { + for (Exprent oper : lstOperands) { + oper.getInferredExprType(null); + } return getExprType(); }