-
-
Notifications
You must be signed in to change notification settings - Fork 24.8k
'export var' infers the wrong type of preload() #61752
Copy link
Copy link
Open
Labels
Milestone
Description
Godot version
v3.5.rc3.official.af8a02dda
System information
Linux
Issue description
export var example := preload("ExampleNode.tscn") results in this error message:
built-in:3 - Parse Error: The export hint's type (Object) doesn't match the variable's type (PackedScene).
modules/gdscript/gdscript.cpp:597 - Method failed. Returning: ERR_PARSE_ERROR
I'm getting the same parser error on 3.5 rc2 and 3.4.4 stable. Haven't tested other versions.
Steps to reproduce
extends Node
export var example := preload("ExampleNode.tscn") # parse error
export var example2 : PackedScene = preload("ExampleNode.tscn") # no error
var example3 := preload("ExampleNode.tscn") # no error
Minimal reproduction project
MRP_export_PackedScene.zip
(same code as in the steps to reproduce)
Reactions are currently unavailable