0xFFFFFFFFu = 0u
````
evaluates true
### Repro code
0xFFFFFFFFu = 0u
````
expected: false
actual: true (repl2 and 2.0.0-beta-001))
<> is consistent with = and also incorrect.
Any uint32 literal with bit 31 set exhibits this.
(-1 |> uint32) is correct.
dotnet fable --version): 2.0.0-beta-001The problem seems to be that the literal 0xFFFFFFFFu is read as 0u. I'd guess that it is interpreted as a negative int32 and then set to 0 on conversion to uint32 somewhere.
I have no idea where in the compiler code unsigned 32 bit literals are parsed (int32.ts does signed).
This is happening only in the REPL, right? Seems to work fine with the CLI version. Parsing the literal 0xFFFFFFFFu is done by the F# compiler so the code is not here. However that part is indeed compiled to JS when building the REPL so maybe there's an error in the process.
@ncave Do you have any idea what the problem may be here?
Apologies! Yes it is just the REPL (should have checked more carefully!).
No worries, it's understandable that users try quick things directly in the REPL (that's what is meant for) and finding disagreements between the REPL and the CLI is also helpful to pinpoint problems in JS compilation :+1:
Not a priority, since the CLI is fine.
But: 0x0FFFu gives a syntax error now in REPL2!
This number is outside the allowable range for 32-bit unsigned integers
@alfonsogarciacaro
The OP issue seems to be somewhere in FCS-Fable (i.e. 0x1u comes across as 0u in the F# AST).
I'll take a deeper look, time permitting.
Most helpful comment
The OP issue seems to be somewhere in FCS-Fable (i.e. 0x1u comes across as 0u in the F# AST).
I'll take a deeper look, time permitting.