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

生成的System_String_Binding.cs CLR绑定代码中出现语法错误编译无法通过 #741

Open
iniini opened this issue Dec 8, 2022 · 2 comments

Comments

@iniini
Copy link

iniini commented Dec 8, 2022

利用String的构造函数public String(ReadOnlySpan value);l来实例化一个string的时候会生成代码:

    static StackObject* op_Implicit_26(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
    {
        ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
        StackObject* ptr_of_this_method;
        StackObject* __ret = ILIntepreter.Minus(__esp, 1);

        ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
        System.String @value = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
        __intp.Free(ptr_of_this_method);


        var result_of_this_method = (System.ReadOnlySpan<System.Char>)value;

        return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
    }



    static StackObject* Ctor_1(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
    {
        ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
        StackObject* ptr_of_this_method;
        StackObject* __ret = ILIntepreter.Minus(__esp, 1);
        ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
        System.ReadOnlySpan<System.Char> @value = (System.ReadOnlySpan<System.Char>)typeof(System.ReadOnlySpan<System.Char>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)16);
        __intp.Free(ptr_of_this_method);


        var result_of_this_method = new System.String(@value);

        return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
    }

这两段代码无法通过编译

@iniini iniini changed the title 生成System_String_Binding.cs CLR绑定代码中出现语法错误编译无法通过 生成的System_String_Binding.cs CLR绑定代码中出现语法错误编译无法通过 Feb 28, 2023
@Madnala98ljf
Copy link

请问解决了吗

@iniini
Copy link
Author

iniini commented Jul 21, 2023

求解决了吗

我换了一个String的构造函数

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