Skip to content

Commit

Permalink
Fix Attribute.valueToStarlark to corretcly handle TriState values.
Browse files Browse the repository at this point in the history
They need to be convetred to **starlark** ints, not **Java** ints.

PiperOrigin-RevId: 726183302
Change-Id: I885f5895fea04420224d2e7457d84bb879fa57db
  • Loading branch information
katre authored and copybara-github committed Feb 12, 2025
1 parent 54ca6f5 commit 948612c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2447,7 +2447,7 @@ public static Object valueToStarlark(Object x) {
return StarlarkList.immutableCopyOf(set);
} else if (x instanceof TriState triState) {
// Convert TriState to integer (same as in query output and native.existing_rules())
return triState.toInt();
return Starlark.fromJava(triState.toInt(), /* mutability= */ null);
}

// For all other attribute values, shallow conversion is safe.
Expand Down

0 comments on commit 948612c

Please sign in to comment.