-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
If a string and an int are combined via &, a compilation error occurs. When combined via &=, the int is converted to a string via $ and the code compiles. This error doesn't occur in Nimscript, and is localized to Nim.
var
a: string = "abc"
b: int = 5
a &= b
echo aCurrent Output
abc5
Expected Output
Compilation Error of Error: type mismatch: got <string, int>
Tested on 0.19.0, 0.19.4, and devel (compiled as this issue was written). All three had Nimscript (tested via nim secret) throw an error, but Nim compile.