Skip to content

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

@iniini

Description

@iniini

利用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);
    }

这两段代码无法通过编译

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions