TypeLoadException when pointer is used as member of Records
See original GitHub issueVersion Used: master(sharplab)
Steps to Reproduce:
public unsafe record Test1(int* x);
Expected Behavior: It’s just an test, not sure what’s the expected behavior. Maybe report compile error, or emit an valid IL.
Actual Behavior: System.TypeLoadException: The generic type ‘System.Collections.Generic.EqualityComparer`1’ was used with an invalid instantiation in assembly ‘System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e’.
Seems EqualityComparer<int*>.Default
is not vaild.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
c# - TypeLoadException says 'no implementation', but it is ...
I got this when my application didn't have a reference to another assembly defining a class that the method in the error message...
Read more >Pointer related operators - access memory and ...
Learn about C# operators that you can use when working with pointers. You use these operators to access memory, index memory locations and ......
Read more >TypeLoadException struct problems - C# / C Sharp
Hello, When I use the following structure at the Load event I get a type load exception. [StructLayout(LayoutKind.Explicit)]
Read more >Pointers to members (C++ only)
Pointers to members allow you to refer to nonstatic members of class objects. You cannot use a pointer to member to point to...
Read more >Pointers to Member Functions, C++ FAQ
How do I create and use an array of pointer-to-member-function? ... The this pointer points to the instance data for the object.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
True. I should have said “record members”
From LDM 10/26/2020, we’re going to block this scenario for now. I’ll open a follow-up proposal in csharplang. We’ll disallow all “restricted types” (which cannot be used as type arguments).