forked from mono/mono
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[metadata] Fields whose types are gparams with a reference type const…
…raint aren't blittlable. Don't try to layout the field to find out if it's blittable. Fixes certain recursive examples. ``` using System; namespace TestRecursiveType { class Program { static void Main(string[] args) { SubClass subC = new SubClass(); Console.WriteLine(subC.GetTest()); } } public struct ValueTest<U> { // When U is instantiated with T, from BaseClass, we know it'll be a // reference field, so we know the instantiation ValueTest<T> won't // be blittable. public readonly U value; } public abstract class BaseClass<T> where T : BaseClass<T> { public ValueTest<T> valueTest = default(ValueTest<T>); } public class SubClass : BaseClass<SubClass> { private String test = "test"; public string GetTest() { return test; } } } ``` Fixes mono#15760
- Loading branch information
1 parent
3ff64f1
commit fe72027
Showing
3 changed files
with
48 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters