Browse Source

Add (failing) unit test for icsharpcode/NRefactory#73.

newNRvisualizers
Daniel Grunwald 14 years ago
parent
commit
9640abde31
  1. 14
      ICSharpCode.NRefactory.Tests/CSharp/Parser/GeneralScope/AttributeSectionTests.cs
  2. 2
      ICSharpCode.NRefactory/TypeSystem/Implementation/AbstractResolvedMember.cs

14
ICSharpCode.NRefactory.Tests/CSharp/Parser/GeneralScope/AttributeSectionTests.cs

@ -205,5 +205,19 @@ public class Form1 { @@ -205,5 +205,19 @@ public class Form1 {
typeof(NamespaceDeclaration)
}, cu.Children.Select(c => c.GetType()).ToArray());
}
[Ignore("Fixme!")]
[Test]
public void AssemblyAttributeBeforeClass()
{
var cu = new CSharpParser().Parse(new StringReader("using System; [assembly: Attr] class X {}"), "code.cs");
Assert.AreEqual(
new Type[] {
typeof(UsingDeclaration),
typeof(AttributeSection),
typeof(TypeDeclaration)
}, cu.Children.Select(c => c.GetType()).ToArray());
Assert.That(((TypeDeclaration)cu.LastChild).Attributes, Is.Empty);
}
}
}

2
ICSharpCode.NRefactory/TypeSystem/Implementation/AbstractResolvedMember.cs

@ -76,7 +76,7 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation @@ -76,7 +76,7 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation
result.Add(member);
}
return result.ToArray();
} else if (unresolved.IsStatic || DeclaringTypeDefinition.Kind == TypeKind.Interface) {
} else if (unresolved.IsStatic || DeclaringTypeDefinition == null || DeclaringTypeDefinition.Kind == TypeKind.Interface) {
return EmptyList<IMember>.Instance;
} else {
// TODO: implement interface member mappings correctly

Loading…
Cancel
Save