[Mono-bugs] [Bug 555170] New: can't compile method using optional parameter whose type is defined in another file.

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Nov 13 02:10:10 EST 2009


http://bugzilla.novell.com/show_bug.cgi?id=555170


           Summary: can't compile method using optional parameter whose
                    type is defined in another file.
    Classification: Mono
           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: vargaz at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.4)
Gecko/20091028 Iceweasel/3.5.4 (Debian-3.5.4-1)

Testcase:
<<<<<<<<<<<<<< bug.cs >>>>>>>>>>>>>>>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
using System.Diagnostics;
using System.Linq.Expressions;

public class Tests
{
    public static void foo (Foo f = Foo.None) {
    }

    public static void Main (String[] args) {
    }
}
<<<<<<<<<<<<< foo.cs >>>>>>>>>>>>>>>>

public enum Foo {
    None = 0
}
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

Compile:
gmcs bug.cs foo.cs

Result:

Unhandled Exception: Mono.CSharp.InternalErrorException: bug.cs(9,14): Tests
---> Mono.CSharp.InternalErrorException: bug.cs(11,28): Tests.foo(Foo) --->
System.NullReferenceException: Object reference not set to an instance of an
object                                                                          
  at Mono.CSharp.EnumMember.Define () [0x00000] in <filename unknown>:0         
  at Mono.CSharp.TypeContainer.FindMembers (MemberTypes mt, BindingFlags bf,
System.Reflection.MemberFilter filter, System.Object criteria) [0x00000] in
<filename unknown>:0                                                       
  at Mono.CSharp.TypeManager.MemberLookup_FindMembers (System.Type t,
MemberTypes mt, BindingFlags bf, System.String name, System.Boolean&
used_cache) [0x00000] in <filename unknown>:0                                   
  at Mono.CSharp.TypeManager.RealMemberLookup (System.Type invocation_type,
System.Type qualifier_type, System.Type queried_type, MemberTypes mt,
BindingFlags original_bf, System.String name, IList almost_match) [0x00000] in
<filename unknown>:0                                                            

Reproducible: Always

Steps to Reproduce:
1.
2.
3.

-- 
Configure bugmail: http://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