chuck
chuck copied to clipboard
Static dur field not static
I believe this may already be a known issue; it appears static dur fields are not statically initialized
class Impatient
{
1::ms => static dur moment;
fun static void pause()
{
<<<"just a moment...", moment>>>;
}
}
Impatient.pause();
reports
$ chuck impatient.ck
just a moment... 0.000000
instead of the desired
$ chuck impatient.ck
just a moment... 44.100000
See also
https://github.com/heuermh/lick/blob/master/Loops.ck#L26
Migrated from https://github.com/spencersalazar/chuck/issues/40
reviving this long-standing issue...
possible remedy: static variables needs to be initialized separated and automatically; to start, may need limit the kinds of initialization (literals/decls only, no vars or functions, possible new
and expressions with literals only)