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

Compilation issues when adding alias list from within an if statement #841

Open
hugohills-regnosys opened this issue Sep 17, 2024 · 1 comment
Labels
bug Something isn't working subject: code generation This issue is about code generation

Comments

@hugohills-regnosys
Copy link
Contributor

This compiles and runs successfully:

type Bar:
    foos Foo (0..*)

type Foo:
    attr string (1..1)

func FuncFoo:
    inputs:
        newFoos Foo (0..*)
        test boolean (1..1)
    output:
        bar Bar (1..1)

    add bar -> foos:
        if test
        then newFoos

But this works fails with compilation issues due to error: incompatible types: java.util.List<capture#1 of ? extends com.rosetta.test.model.Foo> cannot be converted to java.util.List<com.rosetta.test.model.Foo>

type Bar:
    foos Foo (0..*)

type Foo:
    attr string (1..1)

func FuncFoo:
    inputs:
        newFoos Foo (0..*)
        test boolean (1..1)
    output:
        bar Bar (1..1)

    alias filteredFoos: newFoos

    add bar -> foos:
        if test
        then filteredFoos
@hugohills-regnosys
Copy link
Contributor Author

See PR for unit test (without a fix) #842

@hugohills-regnosys hugohills-regnosys added the subject: code generation This issue is about code generation label Sep 17, 2024
@SimonCockx SimonCockx added the bug Something isn't working label Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working subject: code generation This issue is about code generation
Projects
None yet
Development

No branches or pull requests

2 participants