@@ -99,6 +99,14 @@ public static Env add(Env env) {
9999 timestampConversionDeclarations (env .enableTimestampEpoch ()).forEach (env ::add );
100100 numericComparisonDeclarations (env .enableHeterogeneousNumericComparisons ()).forEach (env ::add );
101101
102+ if (env .enableUnsignedLongs ()) {
103+ env .add (
104+ CelFunctionDecl .newFunctionDeclaration (
105+ Function .INT .getFunction (),
106+ CelOverloadDecl .newGlobalOverload (
107+ "int64_to_int64" , "type conversion (identity)" , SimpleType .INT , SimpleType .INT )));
108+ }
109+
102110 return env ;
103111 }
104112
@@ -384,6 +392,8 @@ private static ImmutableList<CelFunctionDecl> coreFunctionDeclarations() {
384392 celFunctionDeclBuilder .add (
385393 CelFunctionDecl .newFunctionDeclaration (
386394 Function .UINT .getFunction (),
395+ CelOverloadDecl .newGlobalOverload (
396+ "uint64_to_uint64" , "type conversion (identity)" , SimpleType .UINT , SimpleType .UINT ),
387397 CelOverloadDecl .newGlobalOverload (
388398 "int64_to_uint64" , "type conversion" , SimpleType .UINT , SimpleType .INT ),
389399 CelOverloadDecl .newGlobalOverload (
@@ -395,6 +405,11 @@ private static ImmutableList<CelFunctionDecl> coreFunctionDeclarations() {
395405 celFunctionDeclBuilder .add (
396406 CelFunctionDecl .newFunctionDeclaration (
397407 Function .DOUBLE .getFunction (),
408+ CelOverloadDecl .newGlobalOverload (
409+ "double_to_double" ,
410+ "type conversion (identity)" ,
411+ SimpleType .DOUBLE ,
412+ SimpleType .DOUBLE ),
398413 CelOverloadDecl .newGlobalOverload (
399414 "int64_to_double" , "type conversion" , SimpleType .DOUBLE , SimpleType .INT ),
400415 CelOverloadDecl .newGlobalOverload (
@@ -406,6 +421,11 @@ private static ImmutableList<CelFunctionDecl> coreFunctionDeclarations() {
406421 celFunctionDeclBuilder .add (
407422 CelFunctionDecl .newFunctionDeclaration (
408423 Function .STRING .getFunction (),
424+ CelOverloadDecl .newGlobalOverload (
425+ "string_to_string" ,
426+ "type conversion (identity)" ,
427+ SimpleType .STRING ,
428+ SimpleType .STRING ),
409429 CelOverloadDecl .newGlobalOverload (
410430 "int64_to_string" , "type conversion" , SimpleType .STRING , SimpleType .INT ),
411431 CelOverloadDecl .newGlobalOverload (
@@ -423,6 +443,8 @@ private static ImmutableList<CelFunctionDecl> coreFunctionDeclarations() {
423443 celFunctionDeclBuilder .add (
424444 CelFunctionDecl .newFunctionDeclaration (
425445 Function .BYTES .getFunction (),
446+ CelOverloadDecl .newGlobalOverload (
447+ "bytes_to_bytes" , "type conversion (identity)" , SimpleType .BYTES , SimpleType .BYTES ),
426448 CelOverloadDecl .newGlobalOverload (
427449 "string_to_bytes" , "type conversion" , SimpleType .BYTES , SimpleType .STRING )));
428450
@@ -437,12 +459,24 @@ private static ImmutableList<CelFunctionDecl> coreFunctionDeclarations() {
437459 celFunctionDeclBuilder .add (
438460 CelFunctionDecl .newFunctionDeclaration (
439461 Function .DURATION .getFunction (),
462+ CelOverloadDecl .newGlobalOverload (
463+ "duration_to_duration" ,
464+ "type conversion (identity)" ,
465+ SimpleType .DURATION ,
466+ SimpleType .DURATION ),
440467 CelOverloadDecl .newGlobalOverload (
441468 "string_to_duration" ,
442469 "type conversion, duration should be end with \" s\" , which stands for seconds" ,
443470 SimpleType .DURATION ,
444471 SimpleType .STRING )));
445472
473+ // Conversions to boolean
474+ celFunctionDeclBuilder .add (
475+ CelFunctionDecl .newFunctionDeclaration (
476+ Function .BOOL .getFunction (),
477+ CelOverloadDecl .newGlobalOverload (
478+ "bool_to_bool" , "type conversion (identity)" , SimpleType .BOOL , SimpleType .BOOL )));
479+
446480 // String functions
447481 celFunctionDeclBuilder .add (
448482 CelFunctionDecl .newFunctionDeclaration (
@@ -674,7 +708,12 @@ private static ImmutableList<CelFunctionDecl> timestampConversionDeclarations(bo
674708 "Type conversion of strings to timestamps according to RFC3339. Example:"
675709 + " \" 1972-01-01T10:00:20.021-05:00\" ." ,
676710 SimpleType .TIMESTAMP ,
677- SimpleType .STRING ));
711+ SimpleType .STRING ),
712+ CelOverloadDecl .newGlobalOverload (
713+ "timestamp_to_timestamp" ,
714+ "type conversion (identity)" ,
715+ SimpleType .TIMESTAMP ,
716+ SimpleType .TIMESTAMP ));
678717 if (withEpoch ) {
679718 timestampBuilder .addOverloads (
680719 CelOverloadDecl .newGlobalOverload (
0 commit comments