Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spn<T>/byref-like types support #31

Open
controlflow opened this issue Apr 2, 2020 · 1 comment
Open

Spn<T>/byref-like types support #31

controlflow opened this issue Apr 2, 2020 · 1 comment

Comments

@controlflow
Copy link

Unfortunately, byref-like types cannot be used as type arguments...

System.TypeLoadException: The generic type 'SizeComputer`1' was used with an invalid instantiation in assembly 'ObjectLayoutInspector, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
   at System.RuntimeType.MakeGenericType(Type[] instantiation)
   at ObjectLayoutInspector.InspectorHelper.GetSizeOfValueTypeInstance(Type type)
   at ObjectLayoutInspector.InspectorHelper.GetSize(Type type)
   at ObjectLayoutInspector.TypeLayout.<GetLayout>g__DoGetLayout|24_0(<>c__DisplayClass24_0& )
   at ObjectLayoutInspector.TypeLayout.GetLayout(Type type, TypeLayoutCache cache, Boolean includePaddings)

I guess you can emit the "same" type without byref flag...

@dzmitry-lahoda
Copy link
Contributor

is UnsafeLayout also fails?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants