Skip to content

Commit e4ca34d

Browse files
authored
Merge pull request #855 from raulsntos/typedarray-with-meta
Handle typed array metadata
2 parents 64055f0 + bd137f8 commit e4ca34d

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) {
@@ -180,7 +182,7 @@ fn to_rust_type_uncached(full_ty: &GodotTy, ctx: &mut Context) -> RustTy {
180182
return RustTy::BuiltinIdent(rustify_ty(ty));
181183
}
182184
} else if let Some(elem_ty) = ty.strip_prefix("typedarray::") {
183-
let rust_elem_ty = to_rust_type(elem_ty, None, ctx);
185+
let rust_elem_ty = to_rust_type(elem_ty, full_ty.meta.as_ref(), ctx);
184186
return if ctx.is_builtin(elem_ty) {
185187
RustTy::BuiltinArray {
186188
elem_type: quote! { Array<#rust_elem_ty> },

0 commit comments

Comments
 (0)