Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
01282fb6
R
roslyn
项目概览
lwm1986
/
roslyn
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
roslyn
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
01282fb6
编写于
2月 10, 2016
作者:
A
Andrew Casey
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Don't call GetGenericsArguments unless IsGeneric is true
Fixes #8452
上级
4425532d
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
16 addition
and
3 deletion
+16
-3
src/Scripting/CSharpTest/ObjectFormatterTests.cs
src/Scripting/CSharpTest/ObjectFormatterTests.cs
+10
-0
src/Scripting/Core/Hosting/ObjectFormatter/CommonObjectFormatter.cs
...ing/Core/Hosting/ObjectFormatter/CommonObjectFormatter.cs
+5
-2
src/Scripting/Core/Hosting/ObjectFormatter/CommonTypeNameFormatter.cs
...g/Core/Hosting/ObjectFormatter/CommonTypeNameFormatter.cs
+1
-1
未找到文件。
src/Scripting/CSharpTest/ObjectFormatterTests.cs
浏览文件 @
01282fb6
...
...
@@ -4,6 +4,7 @@
using
System.Collections.Concurrent
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Reflection
;
using
System.Runtime.CompilerServices
;
using
System.Threading
;
using
Microsoft.CodeAnalysis.Scripting
;
...
...
@@ -777,6 +778,15 @@ public void DebuggerProxy_ArrayBuilder()
);
}
[
WorkItem
(
8542
,
"https://github.com/dotnet/roslyn/issues/8452"
)]
[
Fact
]
public
void
FormatConstructorSignature
()
{
var
constructor
=
typeof
(
object
).
GetTypeInfo
().
DeclaredConstructors
.
Single
();
var
signature
=
((
CommonObjectFormatter
)
s_formatter
).
FormatMethodSignature
(
constructor
);
Assert
.
Equal
(
"object..ctor()"
,
signature
);
// Checking for exceptions, more than particular output.
}
// The stack trace contains line numbers. We use a #line directive
// so that the baseline doesn't need to be updated every time this
// file changes.
...
...
src/Scripting/Core/Hosting/ObjectFormatter/CommonObjectFormatter.cs
浏览文件 @
01282fb6
...
...
@@ -101,7 +101,7 @@ public override string FormatUnhandledException(Exception e)
/// Returns a method signature display string. Used to display stack frames.
/// </summary>
/// <returns>Null if the method is a compiler generated method that shouldn't be displayed to the user.</returns>
protected
virtual
string
FormatMethodSignature
(
MethodBase
method
)
protected
internal
virtual
string
FormatMethodSignature
(
MethodBase
method
)
{
var
pooled
=
PooledStringBuilder
.
GetInstance
();
var
builder
=
pooled
.
Builder
;
...
...
@@ -112,7 +112,10 @@ protected virtual string FormatMethodSignature(MethodBase method)
builder
.
Append
(
TypeNameFormatter
.
FormatTypeName
(
declaringType
,
options
));
builder
.
Append
(
'.'
);
builder
.
Append
(
method
.
Name
);
if
(
method
.
IsGenericMethod
)
{
builder
.
Append
(
TypeNameFormatter
.
FormatTypeArguments
(
method
.
GetGenericArguments
(),
options
));
}
builder
.
Append
(
'('
);
...
...
src/Scripting/Core/Hosting/ObjectFormatter/CommonTypeNameFormatter.cs
浏览文件 @
01282fb6
...
...
@@ -93,7 +93,7 @@ public virtual string FormatTypeArguments(Type[] typeArguments, CommonTypeNameFo
if
(
typeArguments
.
Length
==
0
)
{
return
""
;
throw
new
ArgumentException
(
null
,
nameof
(
typeArguments
))
;
}
var
pooled
=
PooledStringBuilder
.
GetInstance
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录