Closed MikeStall closed 1 year ago
This works: Error( {Kind: 2 } )
Error( {Kind: 2 } )
But this does not: Error( {Kind:"2" } )
Error( {Kind:"2" } )
and gets compile time error because it won't allow string to number coercion: Error 7-19: Invalid type for field 'Kind'. Expected field type of 'ErrorKind'.
We want to allow the string-to-number coercion and for 2nd one to work.
Fix is likely in: https://github.com/microsoft/Power-Fx/blob/2cace9a65b3a98e792ba0072cd2a2a4c9d27d191/src/libraries/Microsoft.PowerFx.Core/Texl/Builtins/Error.cs#L44
Fixed in https://github.com/microsoft/Power-Fx/pull/1206
This works:
Error( {Kind: 2 } )
But this does not:
Error( {Kind:"2" } )
and gets compile time error because it won't allow string to number coercion: Error 7-19: Invalid type for field 'Kind'. Expected field type of 'ErrorKind'.
We want to allow the string-to-number coercion and for 2nd one to work.
Fix is likely in: https://github.com/microsoft/Power-Fx/blob/2cace9a65b3a98e792ba0072cd2a2a4c9d27d191/src/libraries/Microsoft.PowerFx.Core/Texl/Builtins/Error.cs#L44