Here is a little program that makes the compiler crash with an internal error. It involves assigning to the time derivative of a user defined class. The error happens in the code generator.
I can't spontaneously understand the error to fix it, so I file a bug.
This is the program that crashes the compiler. When the alternative, commented out, code is used, the program compiles.
-------------------------------------------------------------------
class Vec2:
data x: Float role_unknown
data y: Float role_unknown
func __assign__(this, other):
x = other.x
y = other.y
func __diff__(this):
data res: Vec2 replace_attr(res.x, $x) replace_attr(res.y, $y)
return res
Here is a little program that makes the compiler crash with an internal error. It involves assigning to the time derivative of a user defined class. The error happens in the code generator.
I can't spontaneously understand the error to fix it, so I file a bug.
This is the program that crashes the compiler. When the alternative, commented out, code is used, the program compiles. ------- ------- ------- ------- ------- ------- ------- ------- ----
-------
class Vec2:
data x: Float role_unknown
data y: Float role_unknown
func __assign__(this, other):
x = other.x
y = other.y
func __diff__(this):
replace_ attr(res. x, $x)
replace_ attr(res. y, $y)
data res: Vec2
return res
data vg: Vec2
vg.x = 0
vg.y = -9.81
class Throw:
data v: Vec2
func dynamic(this):
#$v.x = 0 #This code
#$v.y = -9.81 #works
$v = vg #This code crashes the compiler
compile Throw ------- ------- ------- ------- ------- ------- ----
-------