@@ -13,8 +13,8 @@ use crate::meta;
13
13
use crate :: meta:: error:: { ConvertError , FromGodotError , FromVariantError } ;
14
14
use crate :: meta:: {
15
15
element_godot_type_name, element_variant_type, ArrayElement , ArrayTypeInfo , AsArg , ClassName ,
16
- CowArg , FromGodot , GodotConvert , GodotFfiVariant , GodotType , ParamType , PropertyHintInfo ,
17
- RefArg , ToGodot ,
16
+ CowArg , ExtVariantType , FromGodot , GodotConvert , GodotFfiVariant , GodotType , ParamType ,
17
+ PropertyHintInfo , RefArg , ToGodot ,
18
18
} ;
19
19
use crate :: obj:: { bounds, Bounds , DynGd , Gd , GodotClass } ;
20
20
use crate :: registry:: property:: { BuiltinExport , Export , Var } ;
@@ -1110,7 +1110,7 @@ impl VariantArray {
1110
1110
// Arrays are properly initialized through a `from_sys` call, but the ref-count should be incremented
1111
1111
// as that is the callee's responsibility. Which we do by calling `std::mem::forget(array.clone())`.
1112
1112
unsafe impl < T : ArrayElement > GodotFfi for Array < T > {
1113
- const VARIANT_TYPE : VariantType = VariantType :: ARRAY ;
1113
+ const VARIANT_TYPE : ExtVariantType = ExtVariantType :: Concrete ( VariantType :: ARRAY ) ;
1114
1114
1115
1115
ffi_methods ! { type sys:: GDExtensionTypePtr = * mut Opaque ; .. }
1116
1116
}
@@ -1371,9 +1371,9 @@ impl<T: ArrayElement> GodotFfiVariant for Array<T> {
1371
1371
1372
1372
fn ffi_from_variant ( variant : & Variant ) -> Result < Self , ConvertError > {
1373
1373
// First check if the variant is an array. The array conversion shouldn't be called otherwise.
1374
- if variant. get_type ( ) != Self :: VARIANT_TYPE {
1374
+ if variant. get_type ( ) != Self :: VARIANT_TYPE . variant_as_nil ( ) {
1375
1375
return Err ( FromVariantError :: BadType {
1376
- expected : Self :: VARIANT_TYPE ,
1376
+ expected : Self :: VARIANT_TYPE . variant_as_nil ( ) ,
1377
1377
actual : variant. get_type ( ) ,
1378
1378
}
1379
1379
. into_error ( variant. clone ( ) ) ) ;
0 commit comments