diff --git a/common/src/main/java/dev/cel/common/CelOptions.java b/common/src/main/java/dev/cel/common/CelOptions.java index dd0ccf87..5c49936d 100644 --- a/common/src/main/java/dev/cel/common/CelOptions.java +++ b/common/src/main/java/dev/cel/common/CelOptions.java @@ -109,8 +109,6 @@ public enum ProtoUnsetFieldOptions { public abstract ProtoUnsetFieldOptions fromProtoUnsetFieldOption(); - public abstract boolean adaptRuntimeTypeValueToNativeType(); - public abstract boolean enableStringConversion(); public abstract boolean enableStringConcatenation(); @@ -210,7 +208,6 @@ public static Builder newBuilder() { .enableCelValue(false) .comprehensionMaxIterations(-1) .unwrapWellKnownTypesOnFunctionDispatch(true) - .adaptRuntimeTypeValueToNativeType(true) .fromProtoUnsetFieldOption(ProtoUnsetFieldOptions.BIND_DEFAULT) .enableStringConversion(true) .enableStringConcatenation(true) @@ -523,14 +520,6 @@ public abstract static class Builder { */ public abstract Builder fromProtoUnsetFieldOption(ProtoUnsetFieldOptions value); - /** - * If enabled, result of the type function call `type(foo)` will be evaluated as a native-type - * equivalent {@code CelType} instead of the protobuf type equivalent from {value.proto}. - * - *
This is a temporary flag for migration purposes, and will be removed in the near future.
- */
- public abstract Builder adaptRuntimeTypeValueToNativeType(boolean value);
-
/**
* Enables string() overloads for the runtime. This option exists to maintain parity with
* cel-cpp interpreter options.
diff --git a/common/src/test/java/dev/cel/common/values/ProtoMessageValueProviderTest.java b/common/src/test/java/dev/cel/common/values/ProtoMessageValueProviderTest.java
index 4130b2db..2ce41605 100644
--- a/common/src/test/java/dev/cel/common/values/ProtoMessageValueProviderTest.java
+++ b/common/src/test/java/dev/cel/common/values/ProtoMessageValueProviderTest.java
@@ -122,8 +122,7 @@ public void newValue_createProtoMessage_fieldsPopulated() {
@Test
public void newValue_createProtoMessage_unsignedLongFieldsPopulated() {
ProtoMessageValueProvider protoMessageValueProvider =
- ProtoMessageValueProvider.newInstance(
- DYNAMIC_PROTO, CelOptions.current().enableUnsignedLongs(true).build());
+ ProtoMessageValueProvider.newInstance(DYNAMIC_PROTO, CelOptions.current().build());
ProtoMessageValue protoMessageValue =
(ProtoMessageValue)
diff --git a/common/src/test/java/dev/cel/common/values/ProtoMessageValueTest.java b/common/src/test/java/dev/cel/common/values/ProtoMessageValueTest.java
index cf9cc8ab..ab3c52d1 100644
--- a/common/src/test/java/dev/cel/common/values/ProtoMessageValueTest.java
+++ b/common/src/test/java/dev/cel/common/values/ProtoMessageValueTest.java
@@ -55,7 +55,7 @@ public final class ProtoMessageValueTest {
private static final ProtoCelValueConverter PROTO_CEL_VALUE_CONVERTER =
ProtoCelValueConverter.newInstance(
- CelOptions.current().enableUnsignedLongs(true).build(),
+ CelOptions.current().build(),
DefaultDescriptorPool.INSTANCE,
DynamicProto.create(DefaultMessageFactory.INSTANCE));
diff --git a/conformance/src/test/java/dev/cel/conformance/ConformanceTest.java b/conformance/src/test/java/dev/cel/conformance/ConformanceTest.java
index 47c8beea..b27fd1bc 100644
--- a/conformance/src/test/java/dev/cel/conformance/ConformanceTest.java
+++ b/conformance/src/test/java/dev/cel/conformance/ConformanceTest.java
@@ -90,8 +90,6 @@ private static TypeRegistry newDefaultTypeRegistry() {
private static final CelOptions OPTIONS =
CelOptions.current()
.enableTimestampEpoch(true)
- .enableUnsignedLongs(true)
- .adaptRuntimeTypeValueToNativeType(true)
.enableHeterogeneousNumericComparisons(true)
.enableProtoDifferencerEquality(true)
.enableOptionalSyntax(true)
diff --git a/extensions/src/test/java/dev/cel/extensions/CelMathExtensionsTest.java b/extensions/src/test/java/dev/cel/extensions/CelMathExtensionsTest.java
index a0bf39e7..65b7542c 100644
--- a/extensions/src/test/java/dev/cel/extensions/CelMathExtensionsTest.java
+++ b/extensions/src/test/java/dev/cel/extensions/CelMathExtensionsTest.java
@@ -538,7 +538,7 @@ public void least_unsignedLongResult_withSignedLongType_success(String expr, lon
+ " '3'}")
public void least_unsignedLongResult_withUnsignedLongType_success(
String expr, String expectedResult) throws Exception {
- CelOptions celOptions = CelOptions.current().enableUnsignedLongs(true).build();
+ CelOptions celOptions = CelOptions.current().build();
CelCompiler celCompiler =
CelCompilerFactory.standardCelCompilerBuilder()
.setOptions(celOptions)
diff --git a/extensions/src/test/java/dev/cel/extensions/CelOptionalLibraryTest.java b/extensions/src/test/java/dev/cel/extensions/CelOptionalLibraryTest.java
index f35745e2..06f748a4 100644
--- a/extensions/src/test/java/dev/cel/extensions/CelOptionalLibraryTest.java
+++ b/extensions/src/test/java/dev/cel/extensions/CelOptionalLibraryTest.java
@@ -91,12 +91,7 @@ private enum ConstantTestCases {
private static CelBuilder newCelBuilder() {
return CelFactory.standardCelBuilder()
- .setOptions(
- CelOptions.current()
- .enableUnsignedLongs(true)
- .enableTimestampEpoch(true)
- .adaptRuntimeTypeValueToNativeType(true)
- .build())
+ .setOptions(CelOptions.current().enableTimestampEpoch(true).build())
.setStandardMacros(CelStandardMacro.STANDARD_MACROS)
.setContainer("cel.expr.conformance.proto3")
.addMessageTypes(TestAllTypes.getDescriptor())
diff --git a/extensions/src/test/java/dev/cel/extensions/CelSetsExtensionsTest.java b/extensions/src/test/java/dev/cel/extensions/CelSetsExtensionsTest.java
index 7d6f9721..808cc50f 100644
--- a/extensions/src/test/java/dev/cel/extensions/CelSetsExtensionsTest.java
+++ b/extensions/src/test/java/dev/cel/extensions/CelSetsExtensionsTest.java
@@ -43,8 +43,7 @@
@RunWith(TestParameterInjector.class)
public final class CelSetsExtensionsTest {
- private static final CelOptions CEL_OPTIONS =
- CelOptions.current().enableUnsignedLongs(true).build();
+ private static final CelOptions CEL_OPTIONS = CelOptions.current().build();
private static final CelCompiler COMPILER =
CelCompilerFactory.standardCelCompilerBuilder()
.addMessageTypes(TestAllTypes.getDescriptor())
diff --git a/runtime/src/main/java/dev/cel/runtime/BUILD.bazel b/runtime/src/main/java/dev/cel/runtime/BUILD.bazel
index 7d7700c8..093d8d86 100644
--- a/runtime/src/main/java/dev/cel/runtime/BUILD.bazel
+++ b/runtime/src/main/java/dev/cel/runtime/BUILD.bazel
@@ -108,6 +108,7 @@ java_library(
"//common/internal:default_message_factory",
"//common/internal:dynamic_proto",
"//common/internal:proto_message_factory",
+ "//common/types",
"//common/types:cel_types",
"//common/types:type_providers",
"@cel_spec//proto/cel/expr:expr_java_proto",
diff --git a/runtime/src/main/java/dev/cel/runtime/DefaultInterpreter.java b/runtime/src/main/java/dev/cel/runtime/DefaultInterpreter.java
index 1d1b110e..0db9587b 100644
--- a/runtime/src/main/java/dev/cel/runtime/DefaultInterpreter.java
+++ b/runtime/src/main/java/dev/cel/runtime/DefaultInterpreter.java
@@ -16,7 +16,6 @@
import static com.google.common.base.Preconditions.checkNotNull;
-import dev.cel.expr.Value;
import com.google.auto.value.AutoValue;
import com.google.common.base.Joiner;
import com.google.common.base.Preconditions;
@@ -40,6 +39,7 @@
import dev.cel.common.ast.CelReference;
import dev.cel.common.types.CelKind;
import dev.cel.common.types.CelType;
+import dev.cel.common.types.TypeType;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
@@ -260,10 +260,7 @@ private IntermediateResult resolveIdent(ExecutionFrame frame, CelExpr expr, Stri
// Check whether the type exists in the type check map as a 'type'.
Optional