Closed jobf closed 1 year ago
The following code would produce the error Only inline or read-only (default, never) fields can be used as a pattern
Only inline or read-only (default, never) fields can be used as a pattern
switch Rl.getKeyPressed() { case Rl.Keys.UP: handle_up(); case _: }
Removing static from the fields within enum abstract Keys fixes this.
static
enum abstract Keys
I also added to and from rules for easier casting. This negates the need for the explicit Int type hint.
to
from
Int
Thank you :D
The following code would produce the error
Only inline or read-only (default, never) fields can be used as a pattern
Removing
static
from the fields withinenum abstract Keys
fixes this.I also added
to
andfrom
rules for easier casting. This negates the need for the explicitInt
type hint.