You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since switch does no pattern match variables but only constants (static inline), the whole Keycode class is a potential disaster (at least with recent haxe versions).
for example : key_1 is static var and thus the pattern matcher will use every work key_1 as switch traps and all the code in the switch is a potential switch trap.
I suggest obliterating the code (asap) and replacing the old implementation switch with an Int Map matching keycodes and scancodes.
Xoxo
The text was updated successfully, but these errors were encountered:
delahee
changed the title
linc_sdl : SDL.Keycode
linc_sdl : SDL.Keycode: Pattern matching havoc
Mar 14, 2016
Hi,
Since switch does no pattern match variables but only constants (static inline), the whole Keycode class is a potential disaster (at least with recent haxe versions).
for example : key_1 is static var and thus the pattern matcher will use every work key_1 as switch traps and all the code in the switch is a potential switch trap.
I suggest obliterating the code (asap) and replacing the old implementation switch with an Int Map matching keycodes and scancodes.
Xoxo
The text was updated successfully, but these errors were encountered: