Browse Source

Fixed bug in IdStringProvider.ParseTypeName.

pull/45/merge
Mike Krüger 12 years ago
parent
commit
f7e1c35fdf
  1. 14
      ICSharpCode.NRefactory.Tests/Documentation/CSharpCrefParserTests.cs
  2. 1
      ICSharpCode.NRefactory/Documentation/IdStringProvider.cs

14
ICSharpCode.NRefactory.Tests/Documentation/CSharpCrefParserTests.cs

@ -289,5 +289,19 @@ namespace ICSharpCode.NRefactory.Documentation @@ -289,5 +289,19 @@ namespace ICSharpCode.NRefactory.Documentation
}
});
}
[Test]
public void TestParseTypeName()
{
var result = IdStringProvider.ParseTypeName("T:System.Collections.Generic.List{T}");
Assert.IsNotNull(result);
var pc = new CSharpProjectContent().AddAssemblyReferences(new[] { CecilLoaderTests.Mscorlib });
var type = result.Resolve(pc.CreateCompilation());
Assert.AreEqual("System.Collections.Generic.List", type.FullName);
Assert.AreEqual(1, type.TypeParameterCount);
}
}
}

1
ICSharpCode.NRefactory/Documentation/IdStringProvider.cs

@ -360,6 +360,7 @@ namespace ICSharpCode.NRefactory.Documentation @@ -360,6 +360,7 @@ namespace ICSharpCode.NRefactory.Documentation
} while (typeName[pos] == ',');
if (typeName[pos] != '}')
throw new ReflectionNameParseException(pos, "Expected '}'");
pos++;
}
return shortTypeName;
}

Loading…
Cancel
Save