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

Code generation to java gives ambiguous reference to Record #778

Open
CThuleHansen opened this issue Apr 16, 2021 · 0 comments
Open

Code generation to java gives ambiguous reference to Record #778

CThuleHansen opened this issue Apr 16, 2021 · 0 comments

Comments

@CThuleHansen
Copy link

Description

Code-generation of a VDM-SL spec with Records to Java gives the following error:
Reference to Record is ambiguous [ERROR] both interface org.overture.codegen.runtime.Record in org.overture.codegen.runtime and class java.lang.Record in java.lang match

as of JDK 14, Record has become part of Java.Lang. This means, that it is default imported.
So import org.overture.codegen.runtime.*; indeed brings in Record, but it does not override the Java.Lang.Record. And therefore becomes ambiguous. As I understand it, importing record explicitly should solve it.
I.e. replace import org.overture.codegen.runtime.*; with import org.overture.codegen.runtime.Record

Steps to Reproduce

Build this: https://github.com/INTO-CPS-Association/maestro/tree/development/modeldefinitionchecker with jdk14+

Expected behavior: [What you expect to happen]

Actual behavior: [What actually happens]

Reproduces how often: [What percentage of the time does it reproduce?]

Versions

All I think

Additional Information

Any additional information, configuration or data that might be necessary to reproduce the issue.

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

No branches or pull requests

1 participant