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

Scala class generation for records #23

Open
julienrf opened this issue Sep 11, 2012 · 1 comment
Open

Scala class generation for records #23

julienrf opened this issue Sep 11, 2012 · 1 comment
Labels

Comments

@julienrf
Copy link
Contributor

Hi,

I faced another problem with Scala code generation of records: the current implementation registers that a record type should be mapped to a case class only if the program to generate creates such a record (by using new Record { … }). If a program only uses a record its type isn’t be remapped to the corresponding case class. Furthermore, as the code generator relies on a mutable state, the mapping to a case class works only if a record is used after a record of the same type has been created, in a program.

I solved this problem in this branch but my solution is not satisfying either. It still relies on a mutable state but registers record types both on usage and creation. It uses only the RefinedManifest of the type of the record to generate the corresponding case class (so it can’t be transformed by the mirror process, as it is the case in the delite-develop branch). Furthermore, the hashing function I use to generate case class names according to the record type is not deterministic, so tests fail.

@TiarkRompf
Copy link
Owner

yeah, i think we can't rely on uses happening after creation.

@TiarkRompf TiarkRompf modified the milestones: 1.0.0, 0.8.0 Aug 6, 2015
@TiarkRompf TiarkRompf removed this from the 1.0.0 milestone Dec 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants