Godot Version
v4.6.2.stable.official [71f334935]
Question
Trying to get better about static typing in GDscript. This code:
var screen_size: Vector2
func _ready() -> void:
screen_size = get_viewport().size
Gives this warning:
W 0:00:01:354 GDScript::reload: The property "size" is not present on the inferred type "Viewport" (but may be present on a subtype).
<GDScript Error>UNSAFE_PROPERTY_ACCESS
What’s the proper way to statically type get_viewport().size?