-
Notifications
You must be signed in to change notification settings - Fork 880
nativeptr in interfaces leads to runtime errors #14508
Copy link
Copy link
Labels
Area-Compiler-CodeGenIlxGen, ilwrite and things at the backendIlxGen, ilwrite and things at the backendBugImpact-Medium(Internal MS Team use only) Describes an issue with moderate impact on existing code.(Internal MS Team use only) Describes an issue with moderate impact on existing code.
Milestone
Description
Activity
Metadata
Metadata
Assignees
Labels
Area-Compiler-CodeGenIlxGen, ilwrite and things at the backendIlxGen, ilwrite and things at the backendBugImpact-Medium(Internal MS Team use only) Describes an issue with moderate impact on existing code.(Internal MS Team use only) Describes an issue with moderate impact on existing code.
Type
Projects
- StatusShow more project fieldsDone
Implementing a generic interface that contains a member returning
nativeptr<'T>leads to aTypeLoadExceptionwith messagewhen using that type. Curiously, implementing the interface in a generic type works as expected. I'm not sure if I'm doing something completely unreasonable here, but I'd expect a compiler error at least.
This does not seem to be related to .NET 7.
Repro steps
ConsoleApp1.zip
Expected behavior
Should run or produce a compile-time error if not valid.
Actual behavior
Throws an
TypeLoadExceptionat runtime.Related information