Summary
The default-value parser for exported properties handles Vector2/Color struct-literal defaults correctly, but for Rect2 and Transform2D it unconditionally returns a hardcoded zeroed value regardless of what the script actually authored. Any script declaring e.g. @export let mut r: Rect2 = Rect2 { position: Vector2 { x: 10.0, y: 10.0 }, size: Vector2 { x: 64.0, y: 64.0 } }; will show (0,0)/(0,0) in the Godot Inspector instead of the authored default.
Location
crates/runtime/src/lib.rs, in the default-value-string parser (~line 682):
// TODO: Rect2, Transform2D (complex struct literals)
// For now, return type defaults
"Rect2" => Value::Rect2 {
position: Box::new(Value::Vector2 { x: 0.0, y: 0.0 }),
size: Box::new(Value::Vector2 { x: 0.0, y: 0.0 }),
},
"Transform2D" => Value::Transform2D {
position: Box::new(Value::Vector2 { x: 0.0, y: 0.0 }),
rotation: 0.0,
scale: Box::new(Value::Vector2 { x: 1.0, y: 1.0 }),
},
Compare to the Vector2/Color cases immediately above, which correctly parse the nested field values out of the default-value string.
Expected
Rect2/Transform2D default parsing should follow the same nested-field-parsing pattern already implemented for Vector2/Color in the same function, rather than discarding the authored default.
Why it matters
User-visible bug: any exported Rect2/Transform2D property with a non-zero default silently shows the wrong value in the Inspector. Not currently caught by the ferris-test integration corpus because no test asserts on Inspector default values — worth adding one alongside the fix. Found during a broader technical-debt review of the v0.0.5 release.
Summary
The default-value parser for exported properties handles
Vector2/Colorstruct-literal defaults correctly, but forRect2andTransform2Dit unconditionally returns a hardcoded zeroed value regardless of what the script actually authored. Any script declaring e.g.@export let mut r: Rect2 = Rect2 { position: Vector2 { x: 10.0, y: 10.0 }, size: Vector2 { x: 64.0, y: 64.0 } };will show(0,0)/(0,0)in the Godot Inspector instead of the authored default.Location
crates/runtime/src/lib.rs, in the default-value-string parser (~line 682):Compare to the
Vector2/Colorcases immediately above, which correctly parse the nested field values out of the default-value string.Expected
Rect2/Transform2Ddefault parsing should follow the same nested-field-parsing pattern already implemented forVector2/Colorin the same function, rather than discarding the authored default.Why it matters
User-visible bug: any exported
Rect2/Transform2Dproperty with a non-zero default silently shows the wrong value in the Inspector. Not currently caught by theferris-testintegration corpus because no test asserts on Inspector default values — worth adding one alongside the fix. Found during a broader technical-debt review of the v0.0.5 release.