CosmosOS / Cosmos

Cosmos is an operating system "construction kit". Build your own OS using managed languages such as C#, VB.NET, and more!
https://www.goCosmos.org
BSD 3-Clause "New" or "Revised" License
2.85k stars 536 forks source link

Plug `System.Type.IsByRefLike` property #2998

Open Guillermo-Santos opened 1 month ago

Guillermo-Santos commented 1 month ago

What is the usecase for this plug

With the PR #2997 the System.Activator.CreateInstance are plugged to Cosmos, the thing is that ref struct should not be supported by these methods and a NotSupportedException should be throw, but since this property is missing, we do not have any way to check if the type we are working with is a ref struct at runtime.

Complexity of plug

Adding a new property to the Vtable and modifying IL2CPU so that said value is set.

Describe alternatives you've considered

Are there workarounds for this plug? As of my knowledge, there is no workaround.

Additional context

Add any other context about the plug request here. May be useful for other operations too.