Skip to content

Segmentation fault using if-then-else with strings #487

Closed
@elKei24

Description

@elKei24

The following example gives me a segmentation fault:

var bool: b;
var string: s = if b then "foo" else "bar" endif;

I came across this because I have a model with some choices for the solver to make and some variables that depending on the choice do not matter any more. I do not want these irrelevant variables in my output any more, like this:

var bool: b; var 0..10: i; var 5..15: j;
output [ if b then "i=\(i)" else "j=\(j)" endif ];
solve maximize if b then i else j endif;

I guess this is not possible so far, right?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugresolvedIssue is resolved and the feature or fix will be part of next release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions