You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fory.apache.org by "ayush00git (via GitHub)" <gi...@apache.org> on 2026/09/30 17:55:38 UTC

[PR] fix(compiler): fix Java, Kotlin and Scala codegen emission bugs [fory]

ayush00git opened a new pull request, #4109:
URL: https://github.com/apache/fory/pull/4109

   ## What does this PR do?
   
   Fixes five code-emission bugs in the Java, Kotlin and Scala compiler generators:
   
   - Java: union cases of duration/decimal types emitted `Types.UNKNOWN` instead of `Types.DURATION`/`Types.DECIMAL`, producing a wrong wire type id.
   - Java: reserved-word field names were never escaped, so a field such as `string class = 1;` generated `private String class;`, which does not compile; a field or union case named `class` also generated `getClass()`, clashing with the final `Object.getClass()`.
   - Java: optional list elements and map values lost the `@Nullable` type-use annotation, so generated Java treated them as non-null while Kotlin, Scala and Go emit nullable for the same schema.
   - Java/Kotlin/Scala: a schema type named after a module-file runtime import (e.g. `message Fory`) compiled but silently registered the wrong class; registrations of shadowed names are now package-qualified, and a shadowed name in the default package is rejected with a clear error.
   - Kotlin: `message Empty {}` generated `data class Empty()`, which does not compile; empty messages now use a plain class.
   
   ## Verification
   
   Regression tests added for each bug; each fails without its corresponding generator fix. Full compiler suite passes: `python3 -m pytest fory_compiler/tests -q` (500 passed, 1 skipped).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org
For additional commands, e-mail: commits-help@fory.apache.org


Re: [PR] fix(compiler): fix Java, Kotlin and Scala codegen emission bugs [fory]

Posted by "chaokunyang (via GitHub)" <gi...@apache.org>.
chaokunyang merged PR #4109:
URL: https://github.com/apache/fory/pull/4109


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org
For additional commands, e-mail: commits-help@fory.apache.org