Skip to content

Commit

Permalink
No public description
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 695330651
  • Loading branch information
Soy Authors authored and copybara-github committed Nov 12, 2024
1 parent e232d97 commit 606458f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions java/src/com/google/template/soy/jbcsrc/ExternCompiler.java
Original file line number Diff line number Diff line change
Expand Up @@ -306,11 +306,13 @@ private static Expression adaptParameter(
// For protocol enums, we need to call forNumber on the type w/ the param (as casted to an int).
// This is because Soy internally stores enums as ints. We know this is safe because we
// already validated that the enum type matches the signature.
if (soyType.getKind() == Kind.PROTO_ENUM) {
if (nonNullableSoyType.getKind() == Kind.PROTO_ENUM) {
if (soyTypeBoxed) {
return JbcSrcExternRuntime.SOY_VALUE_TO_ENUM.invoke(
actualParam,
BytecodeUtils.constant(BytecodeUtils.getTypeForClassName(javaType.getClassName())));
return JbcSrcExternRuntime.SOY_VALUE_TO_ENUM
.invoke(
actualParam,
BytecodeUtils.constant(BytecodeUtils.getTypeForClassName(javaType.getClassName())))
.checkedCast(javaType);
}
return MethodRef.createStaticMethod(
javaTypeInfo,
Expand Down

0 comments on commit 606458f

Please sign in to comment.