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

[Unity] Bug: 泛型类中定义的非泛型类在导出的wrapper代码中被当做泛型类 #1672

Open
3 tasks done
lansemengmo opened this issue Mar 15, 2024 · 1 comment
Assignees
Labels
bug Something isn't working Unity

Comments

@lansemengmo
Copy link

前置阅读 | Pre-reading

Puer的版本 | Puer Version

2.0.1]

Unity的版本 | Unity Version

5.6

发生在哪个平台 | Platform

Editor(win)

错误信息 | Error Message

在泛型类A中定义一个非泛型类B,然后生成的wrapper代码中类B被当做了泛型类,导致编译错误。详见重现部分

问题重现 | Bug reproduce

在泛型类A中定义一个非泛型类B,然后生成wrapper代码,类B被当做了泛型类。
原始代码:
企业微信截图_17104672808341
导出代码:
企业微信截图_17104673316815

@lansemengmo lansemengmo added bug Something isn't working Unity labels Mar 15, 2024
@chexiongsheng
Copy link
Collaborator

我在最新版本puerts,unity2022下试了没问题,生成代码如下:

internal static void M_SetCanvasSortingOrder(IntPtr isolate, IntPtr info, IntPtr self, int paramLen, long data)
        {
            try
            {
                var obj = Puerts.Utils.GetSelf((int)data, self) as PuertsTest.TestClass;
        
                {
            
                    IntPtr v8Value0 = PuertsDLL.GetArgumentValue(info, 0);
                    object argobj0 = null;
                    ;
                    IntPtr v8Value1 = PuertsDLL.GetArgumentValue(info, 1);
                    object argobj1 = null;
                    ;
                    {
                        argobj0 = argobj0 != null ? argobj0 : StaticTranslate<PuertsTest.CMTree<UnityEngine.GameObject>.Node>.Get((int)data, isolate, NativeValueApi.GetValueFromArgument, v8Value0, false); PuertsTest.CMTree<UnityEngine.GameObject>.Node arg0 = (PuertsTest.CMTree<UnityEngine.GameObject>.Node)argobj0;
                        int arg1 = (int)PuertsDLL.GetNumberFromValue(isolate, v8Value1, false);

                        obj.SetCanvasSortingOrder (arg0, arg1);

                    }
                }
            }
            catch (Exception e)
            {
                Puerts.PuertsDLL.ThrowException(isolate, "c# exception:" + e.Message + ",stack:" + e.StackTrace);
            }
        }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Unity
Projects
None yet
Development

No branches or pull requests

3 participants