Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
09c724c9
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,发现更多精彩内容 >>
提交
09c724c9
编写于
1月 11, 2016
作者:
D
David Kean
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #7871 from alexanderkozlenko/pr_nm_cm
Use nameof expression for exceptions in Compilers projects
上级
eec2fc98
f6038440
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
18 addition
and
18 deletion
+18
-18
src/Compilers/CSharp/Portable/Compilation/CSharpSemanticModel.cs
...pilers/CSharp/Portable/Compilation/CSharpSemanticModel.cs
+2
-2
src/Compilers/CSharp/Portable/Symbols/MethodSymbol.cs
src/Compilers/CSharp/Portable/Symbols/MethodSymbol.cs
+2
-2
src/Compilers/CSharp/Portable/Syntax/InternalSyntax/SyntaxToken.cs
...lers/CSharp/Portable/Syntax/InternalSyntax/SyntaxToken.cs
+2
-2
src/Compilers/CSharp/Portable/Syntax/SyntaxFactory.cs
src/Compilers/CSharp/Portable/Syntax/SyntaxFactory.cs
+4
-4
src/Compilers/Core/Portable/StrongName/DesktopStrongNameProvider.cs
...ers/Core/Portable/StrongName/DesktopStrongNameProvider.cs
+1
-1
src/Compilers/Shared/GlobalAssemblyCacheHelpers/FusionAssemblyIdentity.cs
...ared/GlobalAssemblyCacheHelpers/FusionAssemblyIdentity.cs
+6
-6
src/Test/Utilities/Desktop/IlasmUtilities.cs
src/Test/Utilities/Desktop/IlasmUtilities.cs
+1
-1
未找到文件。
src/Compilers/CSharp/Portable/Compilation/CSharpSemanticModel.cs
浏览文件 @
09c724c9
...
...
@@ -1383,7 +1383,7 @@ private void CheckModelAndSyntaxNodeToSpeculate(CSharpSyntaxNode syntax)
{
throw
new
ArgumentException
(
"Not a valid position for a call to LookupBaseMembers (must be in a type with a base type)"
,
"position"
);
nameof
(
position
)
);
}
container
=
baseType
;
}
...
...
@@ -4605,7 +4605,7 @@ private static NamespaceOrTypeSymbol ToLanguageSpecific(INamespaceOrTypeSymbol c
var
result
=
container
as
NamespaceOrTypeSymbol
;
if
((
object
)
result
==
null
)
{
throw
new
ArgumentException
(
CSharpResources
.
NotACSharpSymbol
,
"container"
);
throw
new
ArgumentException
(
CSharpResources
.
NotACSharpSymbol
,
nameof
(
container
)
);
}
return
result
;
}
...
...
src/Compilers/CSharp/Portable/Symbols/MethodSymbol.cs
浏览文件 @
09c724c9
...
...
@@ -754,12 +754,12 @@ public MethodSymbol Construct(ImmutableArray<TypeSymbol> typeArguments)
if
(
typeArguments
.
Any
(
TypeSymbolIsNullFunction
))
{
throw
new
ArgumentException
(
CSharpResources
.
TypeArgumentCannotBeNull
,
"typeArguments"
);
throw
new
ArgumentException
(
CSharpResources
.
TypeArgumentCannotBeNull
,
nameof
(
typeArguments
)
);
}
if
(
typeArguments
.
Length
!=
this
.
Arity
)
{
throw
new
ArgumentException
(
CSharpResources
.
WrongNumberOfTypeArguments
,
"typeArguments"
);
throw
new
ArgumentException
(
CSharpResources
.
WrongNumberOfTypeArguments
,
nameof
(
typeArguments
)
);
}
if
(
TypeParametersMatchTypeArguments
(
this
.
TypeParameters
,
typeArguments
))
...
...
src/Compilers/CSharp/Portable/Syntax/InternalSyntax/SyntaxToken.cs
浏览文件 @
09c724c9
...
...
@@ -95,7 +95,7 @@ internal static SyntaxToken Create(SyntaxKind kind)
{
if
(!
SyntaxFacts
.
IsAnyToken
(
kind
))
{
throw
new
ArgumentException
(
string
.
Format
(
CSharpResources
.
ThisMethodCanOnlyBeUsedToCreateTokens
,
kind
),
"kind"
);
throw
new
ArgumentException
(
string
.
Format
(
CSharpResources
.
ThisMethodCanOnlyBeUsedToCreateTokens
,
kind
),
nameof
(
kind
)
);
}
return
CreateMissing
(
kind
,
null
,
null
);
...
...
@@ -110,7 +110,7 @@ internal static SyntaxToken Create(SyntaxKind kind, CSharpSyntaxNode leading, CS
{
if
(!
SyntaxFacts
.
IsAnyToken
(
kind
))
{
throw
new
ArgumentException
(
string
.
Format
(
CSharpResources
.
ThisMethodCanOnlyBeUsedToCreateTokens
,
kind
),
"kind"
);
throw
new
ArgumentException
(
string
.
Format
(
CSharpResources
.
ThisMethodCanOnlyBeUsedToCreateTokens
,
kind
),
nameof
(
kind
)
);
}
return
CreateMissing
(
kind
,
leading
,
trailing
);
...
...
src/Compilers/CSharp/Portable/Syntax/SyntaxFactory.cs
浏览文件 @
09c724c9
...
...
@@ -242,18 +242,18 @@ public static SyntaxToken Token(SyntaxTriviaList leading, SyntaxKind kind, strin
{
case
SyntaxKind
.
IdentifierToken
:
// Have a different representation.
throw
new
ArgumentException
(
CSharpResources
.
UseVerbatimIdentifier
,
"kind"
);
throw
new
ArgumentException
(
CSharpResources
.
UseVerbatimIdentifier
,
nameof
(
kind
)
);
case
SyntaxKind
.
CharacterLiteralToken
:
// Value should not have type string.
throw
new
ArgumentException
(
CSharpResources
.
UseLiteralForTokens
,
"kind"
);
throw
new
ArgumentException
(
CSharpResources
.
UseLiteralForTokens
,
nameof
(
kind
)
);
case
SyntaxKind
.
NumericLiteralToken
:
// Value should not have type string.
throw
new
ArgumentException
(
CSharpResources
.
UseLiteralForNumeric
,
"kind"
);
throw
new
ArgumentException
(
CSharpResources
.
UseLiteralForNumeric
,
nameof
(
kind
)
);
}
if
(!
SyntaxFacts
.
IsAnyToken
(
kind
))
{
throw
new
ArgumentException
(
string
.
Format
(
CSharpResources
.
ThisMethodCanOnlyBeUsedToCreateTokens
,
kind
),
"kind"
);
throw
new
ArgumentException
(
string
.
Format
(
CSharpResources
.
ThisMethodCanOnlyBeUsedToCreateTokens
,
kind
),
nameof
(
kind
)
);
}
return
new
SyntaxToken
(
Syntax
.
InternalSyntax
.
SyntaxFactory
.
Token
((
InternalSyntax
.
CSharpSyntaxNode
)
leading
.
Node
,
kind
,
text
,
valueText
,
(
InternalSyntax
.
CSharpSyntaxNode
)
trailing
.
Node
));
...
...
src/Compilers/Core/Portable/StrongName/DesktopStrongNameProvider.cs
浏览文件 @
09c724c9
...
...
@@ -119,7 +119,7 @@ public DesktopStrongNameProvider(ImmutableArray<string> keyFileSearchPaths = def
{
if
(!
keyFileSearchPaths
.
IsDefault
&&
keyFileSearchPaths
.
Any
(
path
=>
!
PathUtilities
.
IsAbsolute
(
path
)))
{
throw
new
ArgumentException
(
CodeAnalysisResources
.
AbsolutePathExpected
,
"keyFileSearchPaths"
);
throw
new
ArgumentException
(
CodeAnalysisResources
.
AbsolutePathExpected
,
nameof
(
keyFileSearchPaths
)
);
}
_keyFileSearchPaths
=
keyFileSearchPaths
.
NullToEmpty
();
...
...
src/Compilers/Shared/GlobalAssemblyCacheHelpers/FusionAssemblyIdentity.cs
浏览文件 @
09c724c9
...
...
@@ -439,15 +439,15 @@ internal static IAssemblyName ToAssemblyNameObject(AssemblyName name)
{
#if SCRIPTING
throw
new
ArgumentException
(
Scripting
.
ScriptingResources
.
InvalidCharactersInAssemblyName
,
"name"
);
throw
new
ArgumentException
(
Scripting
.
ScriptingResources
.
InvalidCharactersInAssemblyName
,
nameof
(
name
)
);
#elif WORKSPACE_DESKTOP
throw
new
ArgumentException
(
Microsoft
.
CodeAnalysis
.
WorkspaceDesktopResources
.
InvalidCharactersInAssemblyName
,
"name"
);
throw
new
ArgumentException
(
Microsoft
.
CodeAnalysis
.
WorkspaceDesktopResources
.
InvalidCharactersInAssemblyName
,
nameof
(
name
)
);
#else
throw
new
ArgumentException
(
Microsoft
.
CodeAnalysis
.
CodeAnalysisResources
.
InvalidCharactersInAssemblyName
,
"name"
);
throw
new
ArgumentException
(
Microsoft
.
CodeAnalysis
.
CodeAnalysisResources
.
InvalidCharactersInAssemblyName
,
nameof
(
name
)
);
#endif
}
...
...
@@ -469,15 +469,15 @@ internal static IAssemblyName ToAssemblyNameObject(AssemblyName name)
{
#if SCRIPTING
throw
new
ArgumentException
(
Microsoft
.
CodeAnalysis
.
Scripting
.
ScriptingResources
.
InvalidCharactersInAssemblyName
,
"name"
);
throw
new
ArgumentException
(
Microsoft
.
CodeAnalysis
.
Scripting
.
ScriptingResources
.
InvalidCharactersInAssemblyName
,
nameof
(
name
)
);
#elif WORKSPACE_DESKTOP
throw
new
ArgumentException
(
Microsoft
.
CodeAnalysis
.
WorkspaceDesktopResources
.
InvalidCharactersInAssemblyName
,
"name"
);
throw
new
ArgumentException
(
Microsoft
.
CodeAnalysis
.
WorkspaceDesktopResources
.
InvalidCharactersInAssemblyName
,
nameof
(
name
)
);
#else
throw
new
ArgumentException
(
Microsoft
.
CodeAnalysis
.
CodeAnalysisResources
.
InvalidCharactersInAssemblyName
,
"name"
);
throw
new
ArgumentException
(
Microsoft
.
CodeAnalysis
.
CodeAnalysisResources
.
InvalidCharactersInAssemblyName
,
nameof
(
name
)
);
#endif
}
...
...
src/Test/Utilities/Desktop/IlasmUtilities.cs
浏览文件 @
09c724c9
...
...
@@ -90,7 +90,7 @@ public static void IlasmTempAssembly(string declarations, bool appendDefaultHead
"The provided IL cannot be compiled."
+
Environment
.
NewLine
+
program
+
" "
+
arguments
+
Environment
.
NewLine
+
result
,
"declarations"
);
nameof
(
declarations
)
);
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录