Hi,
The following code does not compile in Unity (checked in 4.7.1f1 and 5.3.4f1) but compiles in regular .net 3.5 project:
using System;
public class Test<T>
{
private class Inner
{
public event Action onAction;
}
public void Foo()
{
var inner = new Inner();
inner.onAction += inner_onAction;
}
void inner_onAction()
{
throw new NotImplementedException();
}
}
If the class has no generic parameter than it compiles fine. Also if the reserved keyword “event” is removed than it also compiles. Changing Inner class access modifier to public has not effect.
I’m not sure if this qualifies for a bug report - I guess that it’s the issue with mono compiler. I’ve checked Microsoft .net and Xamarin compilers and both compile this piece of code without any errors.