Skip to content

Commit bd137f8

Browse files
committed
Handle typed array metadata
1 parent 6bcaa3c commit bd137f8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

godot-codegen/src/conv/type_conversions.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,10 @@ fn to_rust_type_uncached(full_ty: &GodotTy, ctx: &mut Context) -> RustTy {
158158
}
159159

160160
// Only place where meta is relevant is here.
161-
if let Some(hardcoded) = to_hardcoded_rust_ident(full_ty) {
162-
return RustTy::BuiltinIdent(ident(hardcoded));
161+
if !ty.starts_with("typedarray::") {
162+
if let Some(hardcoded) = to_hardcoded_rust_ident(full_ty) {
163+
return RustTy::BuiltinIdent(ident(hardcoded));
164+
}
163165
}
164166

165167
if let Some(hardcoded) = to_hardcoded_rust_enum(ty) {
@@ -215,7 +217,7 @@ fn to_rust_type_uncached(full_ty: &GodotTy, ctx: &mut Context) -> RustTy {
215217
return RustTy::BuiltinIdent(rustify_ty(ty));
216218
}
217219
} else if let Some(elem_ty) = ty.strip_prefix("typedarray::") {
218-
let rust_elem_ty = to_rust_type(elem_ty, None, ctx);
220+
let rust_elem_ty = to_rust_type(elem_ty, full_ty.meta.as_ref(), ctx);
219221
return if ctx.is_builtin(elem_ty) {
220222
RustTy::BuiltinArray {
221223
elem_type: quote! { Array<#rust_elem_ty> },

0 commit comments

Comments
 (0)