You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A statement compiled to a number throws InvalidProtocolProvided #2224
In the LINQ compiler, a statement asked for as a number throws InvalidProtocolProvided. That exception says the caller's protocol is wrong, and no protocol was passed.
throws InvalidProtocolProvided: NaN conversion not implemented for System.Boolean
"x > 1".ToEntity().Compile<Complex, Complex>("x")
the same, measured on master
"x > 1".ToEntity().Compile<double, bool>("x")(2)
True
"x > 1".ToEntity().Compile("x").Call(2)
(1, 0), FastExpression's truth value
There are two consistent answers:
Compile the statement to its truth value as a number, 1, 0 or NaN, as FastExpression does and as iverson already does.
Refuse with UncompilableNodeException, the exception documented for a form the compiler does not have.
The first matches FastExpression, which returns a number for every expression.
CrashCheck counts the exception as a refusal. With #2223, two of its generated cases, x in ZZ and x divides 2, compile far enough to reach this conversion and move from "returned" to "declined".
Activity
A compiled statement asked for as a number is its truth value (ASC-Co…