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

Function with empty boolean resolves to true #857

Open
hugohills-regnosys opened this issue Oct 22, 2024 · 2 comments
Open

Function with empty boolean resolves to true #857

hugohills-regnosys opened this issue Oct 22, 2024 · 2 comments
Labels
bug Something isn't working subject: code generation This issue is about code generation
Milestone

Comments

@hugohills-regnosys
Copy link
Contributor

type Foo:
    someBoolean boolean (0..1)
    alwaysFalse boolean (1..1)

func ExpressionWithEmptyBoolean:
    inputs:
        foo Foo (1..1)
    output:
        result boolean (1..1) // output cardinality validation should validate that expression resolves to optional

    set result:
        foo -> someBoolean or foo -> alwaysFalse // if foo -> someBoolean is empty, then function resolves to true
@hugohills-regnosys
Copy link
Contributor Author

hugohills-regnosys commented Oct 22, 2024

The output cardinality validation issue is covered in issue #856.

@hugohills-regnosys
Copy link
Contributor Author

For type conditions, resolving to empty is treated in the same way as resolving to true. In the below example, if attr is False then the condition returns empty which is treated as success (which really it should be treated as not applicable?).

type Foo:
    someBoolean boolean (0..1)
    alwaysFalse boolean (1..1)
    attr boolean (1..1)
    
    condition SomeCondition:
        if attr = True
        then alwaysFalse

@SimonCockx SimonCockx added bug Something isn't working subject: code generation This issue is about code generation labels Nov 7, 2024
@SimonCockx SimonCockx added this to the 10.0.0 milestone Dec 4, 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