-
Notifications
You must be signed in to change notification settings - Fork 222
Labels
bugSomething isn't working or is incorrectSomething isn't working or is incorrectdslxDSLX (domain specific language) implementation / front-endDSLX (domain specific language) implementation / front-end
Description
Describe the bug
If you try to set a configured_value_or<u1> (or equivalently configured_value_or<bool>), any integer value setting seems to be interpreted as 0.
To Reproduce
fn foo() -> bool { configured_value_or<bool>("my_value", 1) }
fn bar() -> u1 { configured_value_or<u1>("my_value", 0) }
fn baz() -> bool { 1 }
#[test]
fn test_collision() {
let x = foo();
let y = bar();
let z = baz();
assert_eq(x, 0);
assert_eq(y, 0);
assert_eq(z, 1);
}
with configured_values = {"my_value": "1"} or configured_values = {"my_value": "123"} will pass all assertions. x/foo indicates that it's not just ignoring the value and using a default.
Expected behavior
I would expect all functions to return 1 when set to "1" and generate a type inference error like TypeInferenceError: size mismatch: u7 vs. bool when set to "123".
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't working or is incorrectSomething isn't working or is incorrectdslxDSLX (domain specific language) implementation / front-endDSLX (domain specific language) implementation / front-end
Type
Projects
Status
No status