Closed susosuso closed 1 year ago
Curious - what sort of scenario does this come up?
it's just more of an inconsistency to me. Say if evaluator takes in two parameters. Param A is untyped object, and param B is strongly typed. For ease of mind, user might just explicit convert all the values in the expression, even though only param A is required to do so. But Boolean(A.some_bool)
will succeed but Boolean(B.some_bool)
will fail.
To fix:
Boolean(x)
when x is a bool, just emit x
. JS will need a separate fix since 1+2 will impact its resolution, and it's also not on IR yet (so won't pick up fix from 3) .
We discussed and we'd like to fix this.
Load balancing....
Marking Breaking Internal since we will need a corresponding PAClient update to handle this. (if it was an IR change, we wouldn't...)
Ideally, we could do this as an IR change, but we don't have the contracts in place. See #808 -that's just parameters, whereas this is the entire method. Table overload - see #874
Type conversion typically allow a value to convert to its current type. Looks like Power FX allows that for
Value
andText
, but notBoolean
:Value(10)
returns10
Text("hello")
returns"hello"
But
Boolean(true)
is invalid.This feels like a bug to me. Thoughts?