Skip to content

Code generation to java gives ambiguous reference to Record #778

@CThuleHansen

Description

@CThuleHansen

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions