[Mono-bugs] [Bug 442144] New: compiler crash when mcs fails to resolve base interfaces and referenced inside the type
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Thu Nov 6 00:41:48 EST 2008
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: mono-bugs at lists.ximian.com
ReportedBy: atsushi at ximian.com
QAContact: mono-bugs at lists.ximian.com
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.
More information about the mono-bugs
mailing list