From e5ed1714d1cbfefb78327980434e6e1748cd15dc Mon Sep 17 00:00:00 2001 From: Ivan Kylchik Date: Fri, 26 May 2023 22:37:52 +0200 Subject: [PATCH] [IR] Unconditionally allow to interpret `IrConst` We can interpret all const elements. It wasn't true on early prototype phase because of some problems with unsigned numbers, but right now it is correct to assume that all const are valid. #KT-58923 --- .../ir/interpreter/checker/IrInterpreterCommonChecker.kt | 4 ---- 1 file changed, 4 deletions(-) diff --git a/compiler/ir/ir.interpreter/src/org/jetbrains/kotlin/ir/interpreter/checker/IrInterpreterCommonChecker.kt b/compiler/ir/ir.interpreter/src/org/jetbrains/kotlin/ir/interpreter/checker/IrInterpreterCommonChecker.kt index 8b5d6aab212..ed87b48437d 100644 --- a/compiler/ir/ir.interpreter/src/org/jetbrains/kotlin/ir/interpreter/checker/IrInterpreterCommonChecker.kt +++ b/compiler/ir/ir.interpreter/src/org/jetbrains/kotlin/ir/interpreter/checker/IrInterpreterCommonChecker.kt @@ -114,10 +114,6 @@ class IrInterpreterCommonChecker : IrInterpreterChecker { } override fun visitConst(expression: IrConst<*>, data: IrInterpreterCheckerData): Boolean { - if (expression.type.getUnsignedType() != null) { - val constructor = expression.type.classOrNull?.owner?.constructors?.singleOrNull() ?: return false - return data.mode.canEvaluateFunction(constructor) - } return true }