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
Have you checked that no other similar issue already exists?
I have searched and not found similar issues.
A clear and concise description of what the bug is.
This script works:
version "4.13"
class Test
{
Function<play void()> f;
}
but change class to struct, and you get:
zscript.txt:zscript.txt, line 5: Invalid Scope for Function Pointer
Only clearscope seems to work; neither play nor ui does. Changing the scope of the struct itself to play or ui does not appear to have any effect either.
However, it is possible to work around this by declaring the type as Function<void>, but then a cast to the proper type will be necessary in order to call the function declared this way. Which makes me think this is likely a bug in the compiler and not some kind of fundamental limitation of the ZScript architecture.
Steps to reproduce the behaviour.
Load the Zscript file provided in the description
Observe that there is no error
Change class to struct in the script code and try again
Observe the error: "Invalid Scope for Function Pointer"
Your configuration
N/A
Provide a Log
N/A
The text was updated successfully, but these errors were encountered:
GZDoom version
4.13.2 and 4.14pre-76-gccd38afbc
Which game are you running with GZDoom?
Doom 2
What Operating System are you using?
Windows 11
Please describe your specific OS version
N/A
Relevant hardware info
N/A
Have you checked that no other similar issue already exists?
A clear and concise description of what the bug is.
This script works:
but change
class
tostruct
, and you get:Only
clearscope
seems to work; neitherplay
norui
does. Changing the scope of the struct itself toplay
orui
does not appear to have any effect either.However, it is possible to work around this by declaring the type as
Function<void>
, but then a cast to the proper type will be necessary in order to call the function declared this way. Which makes me think this is likely a bug in the compiler and not some kind of fundamental limitation of the ZScript architecture.Steps to reproduce the behaviour.
class
tostruct
in the script code and try againYour configuration
Provide a Log
N/A
The text was updated successfully, but these errors were encountered: