REGnosys / rosetta-code-generators

Write code generators for any language, based on the rosetta DSL
Apache License 2.0
17 stars 33 forks source link

Incompatible Types error thrown converting List of String(Enum Value) to List of FieldWithMetaString #323

Closed PayalKhanna closed 5 months ago

PayalKhanna commented 5 months ago

Description

when generating code for following rosetta type throws incompatible type Error

type IndexBase extends Identifier: <"Identifies an index by referencing an identifier.">
    name string (0..1)  <"A description of the Index.">
    provider string (0..1) <"The organisation that creates or maintains the Index.">
    assetClass AssetClassEnum (0..1) <"The Asset Classs of the Index.">
    exchange string (0..*)  <"If the Index is listed, defines the public exchange(s) of the listing.">
        [metadata scheme]
    relatedExchange string (0..*)  <"Provides the related Exchanges, if applicable.">

choice Index: <"Defines the different types of Index.">
    CreditIndex
    EquityIndex
    FloatingIndex
    InflationIndex
    OtherIndex

when converting List of Enum values to return FieldWithMetaString

Is this a regression?

no

Expected behaviour

it should generate code without any compilation error.

🔥 Exception or Error

incompatible types: java.util.List<java.lang.String> cannot be converted to java.util.List<com.rosetta.model.metafields.FieldWithMetaString>

🌍 Your Environment

Changes in https://github.com/finos/common-domain-model/pull/2997 results in Compile error