GDScript STANDALONE_EXPRESSION
warning should not apply for preload
(due to static initializers)
#92022
Labels
Milestone
Tested versions
Reproducible in 2ba22d1 (fairly recent master branch build)
Reproducible in v4.3.dev6
System information
Windows 10.0.19044 - dedicated NVIDIA GeForce RTX 2080 (NVIDIA; 31.0.15.5186) - Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz (12 Threads)
Issue description
A
preload
expression causes static constructor and variable initializers to run.However, writing a
preload
on a standalone line still causes this warning:Standalone expression (the line has no effect). (STANDALONE_EXPRESSION)
This is already accounted for with
load
, which does not show a warning in this situation.Steps to reproduce
In your scene:
And in
static_stuff.gd
:Despite the
STANDALONE_EXPRESSION
warning showing, you will see two prints in Output. The warning is not correct here!Minimal reproduction project (MRP)
preload-standalone-expression.zip
The text was updated successfully, but these errors were encountered: