提交 b2d19fd9 编写于 作者: T Tom Meschter

Add exception message to CSharpCompilation.GetSpecialType

Related to https://devdiv.visualstudio.com/DevDiv/_workitems/edit/459418.

Our non-fatal error reports indicate this method is often called with
an out-of-range value for the `specialType` parameter. This commit adds
a custom message to the resulting `ArgumentOutOfRangeException` so we
can see what we're being asked about.
上级 457ab8ed
......@@ -1253,7 +1253,7 @@ internal new NamedTypeSymbol GetSpecialType(SpecialType specialType)
{
if (specialType <= SpecialType.None || specialType > SpecialType.Count)
{
throw new ArgumentOutOfRangeException(nameof(specialType));
throw new ArgumentOutOfRangeException(nameof(specialType), $"Unexpected SpecialType: '{(int)specialType}'.");
}
var result = Assembly.GetSpecialType(specialType);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册