Open SeeminglyScience opened 4 years ago
Turns out it's any generic instantiation. There doesn't appear to be anything wrong with the signature that I'm encoding, so I am leaning towards it being a bug with DynamicILInfo
. I'll need to do more research and possibly open an issue on dotnet/runtime.
Until then, I've worked around the issue by using the unsupported element type ELEMENT_TYPE_INTERNAL
to embed the type handle directly into the signature.
Get-Error
```python Exception : Type : System.Management.Automation.MethodInvocationException ErrorRecord : Exception : Type : System.Management.Automation.ParentContainsErrorRecordException Message : Exception calling "Invoke" with "1" argument(s): "Could not load type 'Microsoft.CodeAnalysis.EmbeddedAttribute' from assembly 'ILAssembler, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' due to value type mismatch." HResult : -2146233087 CategoryInfo : NotSpecified: (:) [], ParentContainsErrorRecordException FullyQualifiedErrorId : TypeLoadException InvocationInfo : ScriptLineNumber : 1 OffsetInLine : 1 HistoryId : -1 Line : $longToBytes.Invoke(20l) PositionMessage : At line:1 char:1 + $longToBytes.Invoke(20l) + ~~~~~~~~~~~~~~~~~~~~~~~~ CommandOrigin : Internal ScriptStackTrace : at