-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compile error "impossible type switch case: sdl.QuitEvent" #15
Comments
Ah! Sorry. Indeed. I copied the example directly from the current https://github.com/veandco/go-sdl2-examples require github.com/veandco/go-sdl2 v0.4.38 I need to better understand how Thanks a lot for go-sdl2 ! |
Ah! Now, after running my go.mod contains
but then compiling
|
Hi @chrplr, thanks for reporting it! The issue was in the |
Since go-sdl2 is still only on v0.4.0 release, I have to ask what are you talking about? |
Hi @iweave1, I was referring to the master branch code which is to be v0.5.x. |
Thank you for clarifying! |
When trying to compile examples/keyboard-input/keyboard-input.go, I get the following error:
impossible type switch case: sdl.QuitEvent
event (variable of type sdl.Event) cannot have dynamic type sdl.QuitEvent
This is due to a change following the commit "examples: updated to remove pointer in event switch cases" where "*sdl.QuitEvent" was replaced by "sdl.QuitEvent" in the switch statement.
If I put back the dereferencing operator '*', the code compiles.
There must be a good reason for the change in the commit. Could you explain the rationale please? Thank you in advance !
If that matters, I am using go1.22.2 linux/amd64
The text was updated successfully, but these errors were encountered: