https://bugzilla.novell.com/show_bug.cgi?id=442144
Summary: compiler crash when mcs fails to resolve base interfaces
and referenced inside the type
Product: Mono: Compilers
Version: unspecified
Platform: i586
OS/Version: Other
Status: NEW
Severity: Minor
Priority: P5 - None
Component: C#
AssignedTo: [email protected]
ReportedBy: [EMAIL PROTECTED]
QAContact: [email protected]
Found By: ---
The following code results in compiler crash.
--------
namespace Foo {
public interface IBase {
object X { get; }
}
}
public interface IDerived<T> : Foo.IBase {
T X { get; }
}
public class Test<T> {
public class Y : IDerived<T>, IBase
{
public T X { get { return default (T); } }
object Foo.IBase.X {
get { return default (T); }
}
}
}
--------
$ gmcs test.cs
test.cs(12,39): error CS0246: The type or namespace name `IBase' could not be
fo
und. Are you missing a using directive or an assembly reference?
Unhandled Exception: System.NullReferenceException: Object reference not set to
an instance of an object
at Mono.CSharp.TypeContainer.CheckRecursiveDefinition
(Mono.CSharp.TypeContain
er tc) [0x00000]
at Mono.CSharp.TypeContainer.DefineBaseTypes () [0x00000]
at Mono.CSharp.TypeContainer.DefineType () [0x00000]
at Mono.CSharp.TypeContainer.DefineNestedTypes () [0x00000]
at Mono.CSharp.TypeContainer.DefineType () [0x00000]
at Mono.CSharp.RootContext.ResolveTree () [0x00000]
at Mono.CSharp.Driver.Compile () [0x00000]
at Mono.CSharp.Driver.Main (System.String[] args) [0x00000]
Since the reference to IBase on line 12 is totally optional, it could be simply
removed.
It happened to IEnumerable<T> and IEnumerable (I experienced missing "using
System.Collections" only on the base interface reference).
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
_______________________________________________
mono-bugs maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs