Skip to content

Commit 9d02970

Browse files
committed
Polyfill Variant Debug impl for Godot < 4.4
1 parent 77a8739 commit 9d02970

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

godot-core/src/classes/class_runtime.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
//! Runtime checks and inspection of Godot classes.
99
10-
use crate::builtin::{GString, StringName, Variant};
10+
use crate::builtin::{GString, StringName, Variant, VariantType};
1111
#[cfg(debug_assertions)]
1212
use crate::classes::{ClassDb, Object};
1313
use crate::meta::CallContext;
@@ -35,6 +35,8 @@ pub(crate) fn debug_string_variant(
3535
f: &mut std::fmt::Formatter<'_>,
3636
ty: &str,
3737
) -> std::fmt::Result {
38+
debug_assert_eq!(obj.get_type(), VariantType::OBJECT);
39+
3840
let id = obj
3941
.object_id_unchecked()
4042
.expect("Variant must be of type OBJECT");

0 commit comments

Comments
 (0)