Search Issue Tracker
Won't Fix
Votes
0
Found in
3.2.0f2
Issue ID
389962
Regression
No
AOT failure when generic type array is exposed using ReadOnlyCollection<>
Looks like AOT failure. When accessing Node<T>.node directly - everything works fine. If it's wrapped with ReadOnlyCollection<> property, then AOT fails. Throws assert in mono:
Node<Test>[] doesn't implement interface System.Collections.Generic.IEnumerable<Node<T>>
- Assertion: should not be reached at mini-trampolines.c:183
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
interface ITest
{
void DoStuff();
}
class Test: ITest
{
public void DoStuff()
{
Debug.Log("DoStuff");
}
}
class Node<T>
{
public Node<T>[] nodes = new Node<T>[1];
public ReadOnlyCollection<Node<T>> Nodes { get { return new ReadOnlyCollection<Node<T>>(nodes); } }
}
class Tree<T> where T: class
{
public void DoStuff(Node<T> node, T element)
{
node = new Node<T>();
foreach (var entry in node.Nodes)
if (entry == null)
Debug.Log("Awesome");
Debug.Log("The end");
}
}
public class NewBehaviourScript : MonoBehaviour {
void Start () {
var tree = new Tree<Test>();
tree.DoStuff(null, null);
}
}
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- var VisionOSEDRHeadromm has a comma instead of a dot when building with Metal Rendering App Mode and local OS localization is set to German
- IAP Catalog remove product “x” and add product “+” buttons are not consistent with other remove and add buttons in the Editor
- Performance issues in Play Mode when quickly hovering the mouse cursor over Hierarchy GameObjects
- Frame Debugger displays incorrect output when FidelityFX Super Resolution or Spatial-Temporal Upscaler is used with Temporal Anti-aliasing or Subpixel Morphological Anti-aliasing
- The layout system is failing to correctly calculate or apply the height of the Japanese fallback font when the primary English font's metrics are used
Add comment