[Mono-bugs] [Bug 387502] New: Compilation error with anonymous method and ?? operator

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue May 6 22:58:16 EDT 2008


https://bugzilla.novell.com/show_bug.cgi?id=387502


           Summary: Compilation error with anonymous method and ?? operator
           Product: Mono: Compilers
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: sanxiyn at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


SVN r102693.

This is a regression. gmcs from Mono 1.9 compiles the code fine.

Testcase:

public class Test {
    public delegate bool MemberFilter();
    public static void FindMembers(MemberFilter filter) {}
    public static void GetMethodGroup(MemberFilter filter) {
        FindMembers(filter ?? delegate() {
            return true;
        });
    }
    public static void Main() {}
}

Result:

Exception caught by the compiler while compiling:
   Block that caused the problem begin at: Test.cs(4,24):
                     Block being compiled: [Test.cs(4,60):,Test.cs(8,5):]
System.NullReferenceException: Object reference not set to an instance of an
object
Internal compiler error at Test.cs(4,24):: exception caught while emitting
MethodBuilder [Test::GetMethodGroup]

Unhandled Exception: System.NullReferenceException: Object reference not set to
an instance of an object
  at Mono.CSharp.AnonymousMethodExpression.ImplicitStandardConversionExists
(System.Type delegate_type) [0x00000] 
  at Mono.CSharp.Convert.ImplicitStandardConversionExists
(Mono.CSharp.Expression expr, System.Type target_type) [0x00000] 
  at Mono.CSharp.Convert.ImplicitConversionExists (Mono.CSharp.EmitContext ec,
Mono.CSharp.Expression expr, System.Type target_type) [0x00000] 
  at Mono.CSharp.Nullable.NullCoalescingOperator.DoResolve
(Mono.CSharp.EmitContext ec) [0x00000] 
  at Mono.CSharp.Expression.Resolve (Mono.CSharp.EmitContext ec, ResolveFlags
flags) [0x00000] 
  at Mono.CSharp.Expression.Resolve (Mono.CSharp.EmitContext ec) [0x00000] 
  at Mono.CSharp.Argument.Resolve (Mono.CSharp.EmitContext ec, Location loc)
[0x00000] 
  at Mono.CSharp.Invocation.DoResolve (Mono.CSharp.EmitContext ec) [0x00000] 
  at Mono.CSharp.Expression.Resolve (Mono.CSharp.EmitContext ec, ResolveFlags
flags) [0x00000] 
  at Mono.CSharp.Expression.Resolve (Mono.CSharp.EmitContext ec) [0x00000] 
  at Mono.CSharp.ExpressionStatement.ResolveStatement (Mono.CSharp.EmitContext
ec) [0x00000] 
  at Mono.CSharp.StatementExpression.Resolve (Mono.CSharp.EmitContext ec)
[0x00000] 
  at Mono.CSharp.Block.Resolve (Mono.CSharp.EmitContext ec) [0x00000] 
  at Mono.CSharp.EmitContext.ResolveTopBlock (Mono.CSharp.EmitContext
anonymous_method_host, Mono.CSharp.ToplevelBlock block, Mono.CSharp.Parameters
ip, IMethodData md, System.Boolean& unreachable) [0x00000]


-- 
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