-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
The following program
(include "univ-lib/lib.scm")
(declare (not constant-fold))
(+ 1 1)
crash with the error
SyntaxError: Unexpected token ILLEGAL
gambit_r1 = new Gambit_Flonum(1.val + 1.val);
^^
SyntaxError: Unexpected token ILLEGAL
when compiled with gsc -c -target js program-name.scm
The same problem arises with -target equals to python and php. I could not assess if ruby is also victim of this bug (it crashed on what seemed to be another bug).
The error seems to be that + gets inlined, which generate a test case for when its operands are flonums. This generate an attribute access which is not allowed on fixnums by the syntax of the target languages (Ruby might be immune to this bug because "everything is an object").
Note: The code should work when both -repr-flonumand -repr-fixnum are set to class (I didn't tested it though)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels