SeeminglyScience / ILAssembler

ILAsm-like DSL for PowerShell
MIT License
16 stars 1 forks source link

Pinning ref types/using in calli sigs throws at type load #12

Closed SeeminglyScience closed 4 years ago

SeeminglyScience commented 4 years ago

Oddly object works, but any other ref types throw.

il { [void] $_._() } {
    .locals init {
        [pinned] [Text.StringBuilder] $var
    }

    ret
}

Throws:

New-IlDelegate: Could not load type 'Invalid_Token.0x02000002' from assembly 'Anonymously Hosted DynamicMethods Assembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.

Need to either throw a parse error, or replace under the covers with [object] or [IntPtr].

SeeminglyScience commented 4 years ago

Can no longer repro