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

Mixing model objects and builders leads to static compilation issue #632

Open
SimonCockx opened this issue Aug 31, 2023 · 0 comments
Open
Labels
bug Something isn't working subject: code generation This issue is about code generation subject: model validation This issue is about validation of Rosetta models, such as the type system

Comments

@SimonCockx
Copy link
Contributor

SimonCockx commented Aug 31, 2023

type Person:
    name string (1..1)
    boss Person (0..1)

func ReplaceBoss:
    inputs:
        person Person (1..1)
        boss Person (1..1)
    output:
        result Person (1..1)
    
    set result: person
    set result -> boss:
        if result <> boss  // note: we are using `result` both as a builder object and as a model object
        then boss

leads to

local variables referenced from a lambda expression must be final or effectively final
					if (notEqual(MapperS.of(result), MapperS.of(boss), CardinalityOperator.Any).getOrDefault(false)) {
					                        ^
@SimonCockx SimonCockx added bug Something isn't working subject: code generation This issue is about code generation subject: model validation This issue is about validation of Rosetta models, such as the type system labels Aug 31, 2023
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 subject: model validation This issue is about validation of Rosetta models, such as the type system
Projects
None yet
Development

No branches or pull requests

1 participant