Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Godot C# GD class convert #1755

Open
Avatarchik opened this issue Jun 11, 2024 · 1 comment
Open

Godot C# GD class convert #1755

Avatarchik opened this issue Jun 11, 2024 · 1 comment

Comments

@Avatarchik
Copy link

Avatarchik commented Jun 11, 2024

Hi! I am generating the Godot.GD class, but there is an error in 2 functions during generation, how can I fix this?
Cannot use 'System.Span' as a type argument
Cannot cast expression of type 'object' to type 'Span'

 [Puerts.MonoPInvokeCallback(typeof(Puerts.V8FunctionCallback))]
        internal static void F_BytesToVar(IntPtr isolate, IntPtr info, IntPtr self, int paramLen, long data)
        {
            try
            {
        
                {
            
                    IntPtr v8Value0 = PuertsDLL.GetArgumentValue(info, 0);
                    object argobj0 = null;
                    ;
                    {
                        argobj0 = argobj0 != null ? argobj0 : StaticTranslate<System.Span<byte>>.Get((int)data, isolate, NativeValueApi.GetValueFromArgument, v8Value0, false); System.Span<byte> arg0 = (System.Span<byte>)argobj0;

                        var result = Godot.GD.BytesToVar (arg0);

                        Puerts.ResultHelper.Set((int)data, isolate, info, result);
                    }
                }
            }
            catch (Exception e)
            {
                Puerts.PuertsDLL.ThrowException(isolate, "c# exception:" + e.Message + ",stack:" + e.StackTrace);
            }
        }
        [Puerts.MonoPInvokeCallback(typeof(Puerts.V8FunctionCallback))]
        internal static void F_BytesToVarWithObjects(IntPtr isolate, IntPtr info, IntPtr self, int paramLen, long data)
        {
            try
            {
        
                {
            
                    IntPtr v8Value0 = PuertsDLL.GetArgumentValue(info, 0);
                    object argobj0 = null;
                    ;
                    {
                        argobj0 = argobj0 != null ? argobj0 : StaticTranslate<System.Span<byte>>.Get((int)data, isolate, NativeValueApi.GetValueFromArgument, v8Value0, false); System.Span<byte> arg0 = (System.Span<byte>)argobj0;

                        var result = Godot.GD.BytesToVarWithObjects (arg0);

                        Puerts.ResultHelper.Set((int)data, isolate, info, result);
                    }
                }
            }
            catch (Exception e)
            {
                Puerts.PuertsDLL.ThrowException(isolate, "c# exception:" + e.Message + ",stack:" + e.StackTrace);
            }
        }
@chexiongsheng
Copy link
Collaborator

chexiongsheng commented Jun 20, 2024

I suggest you temporarily add the APIs involving Span to the generation blacklist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants