[Mono-bugs] [Bug 604735] New: NRE with attribute name found in multiple namespaces

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue May 11 09:18:58 EDT 2010


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

http://bugzilla.novell.com/show_bug.cgi?id=604735#c0


           Summary: NRE with attribute name found in multiple namespaces
    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: rkvinge at novell.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


Repro:

using System;
using System.Linq;
using System.Reflection;

namespace System.Reflection.Derived {
    class Dummy {}
}

namespace System.Linq.Derived {
    class Dummy {}
}

public class DerivedAttribute : Attribute {
}

[Derived ()]
class T {
static void Main () {}
}

results in:

System.NullReferenceException: Object reference not set to an instance of an
object
  at Mono.CSharp.NamespaceEntry.Lookup (string,int,Mono.CSharp.Location,bool)
[0x001a0] in /mono/main/git/moonlight/mcs/mcs/namespace.cs:1166
  at Mono.CSharp.NamespaceEntry.LookupNamespaceOrType
(string,int,Mono.CSharp.Location,bool) [0x00009] in
/mono/main/git/moonlight/mcs/mcs/namespace.cs:1055
  at Mono.CSharp.DeclSpace.LookupNamespaceOrType
(string,int,Mono.CSharp.Location,bool) [0x000a0] in
/mono/main/git/moonlight/mcs/mcs/decl.cs:1379
  at Mono.CSharp.DeclSpace.LookupNamespaceOrType
(string,int,Mono.CSharp.Location,bool) [0x0008a] in
/mono/main/git/moonlight/mcs/mcs/decl.cs:1377
  at Mono.CSharp.MemberCore.LookupNamespaceOrType
(string,int,Mono.CSharp.Location,bool) [0x00000] in
/mono/main/git/moonlight/mcs/mcs/decl.cs:691
  at Mono.CSharp.Method.LookupNamespaceOrType
(string,int,Mono.CSharp.Location,bool) [0x00029] in
/mono/main/git/moonlight/mcs/mcs/method.cs:881
  at Mono.CSharp.SimpleName.ResolveAsTypeStep (Mono.CSharp.IMemberContext,bool)
[0x00011] in /mono/main/git/moonlight/mcs/mcs/ecore.cs:2390
  at Mono.CSharp.Expression.ResolveAsTypeTerminal
(Mono.CSharp.IMemberContext,bool) [0x00011] in
/mono/main/git/moonlight/mcs/mcs/ecore.cs:253
  at Mono.CSharp.Attribute.ResolveAsTypeTerminal
(Mono.CSharp.Expression,Mono.CSharp.IMemberContext) [0x00000] in
/mono/main/git/moonlight/mcs/mcs/attribute.cs:226
  at Mono.CSharp.Attribute.ResolvePossibleAttributeType
(Mono.CSharp.ATypeNameExpression,bool&) [0x00000] in
/mono/main/git/moonlight/mcs/mcs/attribute.cs:231
  at Mono.CSharp.Attribute.ResolveAttributeType () [0x00024] in
/mono/main/git/moonlight/mcs/mcs/attribute.cs:259
  at Mono.CSharp.Attribute.ResolveType () [0x00016] in
/mono/main/git/moonlight/mcs/mcs/attribute.cs:299
  at Mono.CSharp.Attributes.Search (Mono.CSharp.PredefinedAttribute) [0x00019]
in /mono/main/git/moonlight/mcs/mcs/attribute.cs:1365
  at Mono.CSharp.MemberCore.IsNotCLSCompliant () [0x0003b] in
/mono/main/git/moonlight/mcs/mcs/decl.cs:706
  at Mono.CSharp.MemberCore.get_HasClsCompliantAttribute () [0x0000e] in
/mono/main/git/moonlight/mcs/mcs/decl.cs:726
  at Mono.CSharp.MemberCore.IsClsComplianceRequired () [0x0002b] in
/mono/main/git/moonlight/mcs/mcs/decl.cs:641
  at Mono.CSharp.Attribute.Emit
(System.Collections.Generic.Dictionary`2<Mono.CSharp.Attribute,
System.Collections.Generic.List`1<Mono.CSharp.Attribute>>) [0x00420] in
/mono/main/git/moonlight/mcs/mcs/attribute.cs:1167
  at Mono.CSharp.Attributes.Emit () [0x0003d] in
/mono/main/git/moonlight/mcs/mcs/attribute.cs:1396
  at Mono.CSharp.MethodOrOperator.Emit () [0x00137] in
/mono/main/git/moonlight/mcs/mcs/method.cs:599
  at Mono.CSharp.Method.Emit () [0x00112] in
/mono/main/git/moonlight/mcs/mcs/method.cs:1132
  at Mono.CSharp.TypeContainer.EmitType () [0x001d9] in
/mono/main/git/moonlight/mcs/mcs/class.cs:1769
  at Mono.CSharp.RootContext.EmitCode () [0x00059] in
/mono/main/git/moonlight/mcs/mcs/rootcontext.cs:332
  at Mono.CSharp.Driver.Compile () [0x00342] in
/mono/main/git/moonlight/mcs/mcs/driver.cs:1771
  at Mono.CSharp.Driver.Main (string[]) [0x0003c] in
/mono/main/git/moonlight/mcs/mcs/driver.cs:308

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