overturetool / overture

The Overture Tool
http://overturetool.org
GNU General Public License v3.0
49 stars 25 forks source link

Code generation to java gives ambiguous reference to Record #778

Open CThuleHansen opened 3 years ago

CThuleHansen commented 3 years ago

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.