Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1650,8 +1650,12 @@ private void generateChoiceDecls(
String comma = "";
for (final Token token : tokens)
{
// In Go a composite‐literal’s elements must either be untyped constants.
// (which are assignable to any compatible numeric type) or exactly the same type as the field.
// So the untyped constants, such 0, 1 works fine,
// but if using the primite type such as uint64{0} would not works here.
sb.append(comma)
.append(generateLiteral(token.encoding().primitiveType(), token.encoding().constValue().toString()));
.append(token.encoding().constValue().toString());
comma = ", ";
}

Expand Down
Loading