Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Java codegen for struct-valued constants #503

Conversation

benjamin-bader
Copy link
Collaborator

A few minor and not-so-minor changes needed to happen along the way:

  • To make this feature bearable, we relaxed the restriction that a struct const must define all fields, and now only required fields must be present.
  • This broke Kotlin codegen, so that needed to be fixed
  • Turns out that constant-references to enums have always been broken in Java codegen, as revealed by the rather-arbitrary integration test code. The fix for that is sub-optimal but it works.
  • When we implemented constant references, we forgot that map keys can be constant references, not just values. Fixed here.

Fixes #484

@benjamin-bader benjamin-bader merged commit f9c1099 into microsoft:master Dec 8, 2022
@benjamin-bader benjamin-bader deleted the struct-constants-java-codegen branch December 8, 2022 00:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Java codegen for struct-valued constants
1 participant