Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
dc5d6faa
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,发现更多精彩内容 >>
未验证
提交
dc5d6faa
编写于
1月 23, 2018
作者:
A
Andy Gocke
提交者:
GitHub
1月 23, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #24383 from dotnet/merges/dev15.6.x-to-dev15.7.x-20180123-080009
Merge dev15.6.x to dev15.7.x
上级
3a3ba133
b0ab11bb
变更
21
隐藏空白更改
内联
并排
Showing
21 changed file
with
174 addition
and
1 deletion
+174
-1
build/Targets/Roslyn.Toolsets.Xunit.targets
build/Targets/Roslyn.Toolsets.Xunit.targets
+1
-1
src/Compilers/CSharp/Portable/Binder/Binder_Operators.cs
src/Compilers/CSharp/Portable/Binder/Binder_Operators.cs
+4
-0
src/Compilers/CSharp/Portable/CSharpResources.Designer.cs
src/Compilers/CSharp/Portable/CSharpResources.Designer.cs
+9
-0
src/Compilers/CSharp/Portable/CSharpResources.resx
src/Compilers/CSharp/Portable/CSharpResources.resx
+3
-0
src/Compilers/CSharp/Portable/Errors/MessageID.cs
src/Compilers/CSharp/Portable/Errors/MessageID.cs
+2
-0
src/Compilers/CSharp/Portable/xlf/CSharpResources.cs.xlf
src/Compilers/CSharp/Portable/xlf/CSharpResources.cs.xlf
+5
-0
src/Compilers/CSharp/Portable/xlf/CSharpResources.de.xlf
src/Compilers/CSharp/Portable/xlf/CSharpResources.de.xlf
+5
-0
src/Compilers/CSharp/Portable/xlf/CSharpResources.es.xlf
src/Compilers/CSharp/Portable/xlf/CSharpResources.es.xlf
+5
-0
src/Compilers/CSharp/Portable/xlf/CSharpResources.fr.xlf
src/Compilers/CSharp/Portable/xlf/CSharpResources.fr.xlf
+5
-0
src/Compilers/CSharp/Portable/xlf/CSharpResources.it.xlf
src/Compilers/CSharp/Portable/xlf/CSharpResources.it.xlf
+5
-0
src/Compilers/CSharp/Portable/xlf/CSharpResources.ja.xlf
src/Compilers/CSharp/Portable/xlf/CSharpResources.ja.xlf
+5
-0
src/Compilers/CSharp/Portable/xlf/CSharpResources.ko.xlf
src/Compilers/CSharp/Portable/xlf/CSharpResources.ko.xlf
+5
-0
src/Compilers/CSharp/Portable/xlf/CSharpResources.pl.xlf
src/Compilers/CSharp/Portable/xlf/CSharpResources.pl.xlf
+5
-0
src/Compilers/CSharp/Portable/xlf/CSharpResources.pt-BR.xlf
src/Compilers/CSharp/Portable/xlf/CSharpResources.pt-BR.xlf
+5
-0
src/Compilers/CSharp/Portable/xlf/CSharpResources.ru.xlf
src/Compilers/CSharp/Portable/xlf/CSharpResources.ru.xlf
+5
-0
src/Compilers/CSharp/Portable/xlf/CSharpResources.tr.xlf
src/Compilers/CSharp/Portable/xlf/CSharpResources.tr.xlf
+5
-0
src/Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hans.xlf
...Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hans.xlf
+5
-0
src/Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hant.xlf
...Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hant.xlf
+5
-0
src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenRefConditionalOperatorTests.cs
...p/Test/Emit/CodeGen/CodeGenRefConditionalOperatorTests.cs
+31
-0
src/EditorFeatures/CSharpTest/SignatureHelp/ElementAccessExpressionSignatureHelpProviderTests.cs
...Help/ElementAccessExpressionSignatureHelpProviderTests.cs
+46
-0
src/Features/CSharp/Portable/SignatureHelp/ElementAccessExpressionSignatureHelpProvider.cs
...atureHelp/ElementAccessExpressionSignatureHelpProvider.cs
+13
-0
未找到文件。
build/Targets/Roslyn.Toolsets.Xunit.targets
浏览文件 @
dc5d6faa
...
...
@@ -4,7 +4,7 @@
<PropertyGroup>
<!-- xUnit.net Console Runner -->
<XUnitPath>
$(NuGetPackageRoot)\xunit.runner.console\$(xunitrunnerconsoleVersion)\tools\xunit.console.x86.exe
</XUnitPath>
<XUnitPath>
$(NuGetPackageRoot)\xunit.runner.console\$(xunitrunnerconsoleVersion)\tools\
net452\
xunit.console.x86.exe
</XUnitPath>
<XUnitTestResultsDirectory>
$(OutDir)\xUnitResults
</XUnitTestResultsDirectory>
<XUnitArguments>
"$(OutDir)\$(AssemblyName).dll" -html "$(XUnitTestResultsDirectory)\$(AssemblyName).html" -noshadow
</XUnitArguments>
<PrepareForBuildDependsOn>
$(PrepareForBuildDependsOn);AddDefaultTestAppConfig
</PrepareForBuildDependsOn>
...
...
src/Compilers/CSharp/Portable/Binder/Binder_Operators.cs
浏览文件 @
dc5d6faa
...
...
@@ -3521,6 +3521,10 @@ private BoundExpression BindConditionalOperator(ConditionalExpressionSyntax node
diagnostics
.
Add
(
ErrorCode
.
ERR_RefConditionalNeedsTwoRefs
,
whenTrue
.
GetFirstToken
().
GetLocation
());
}
}
else
{
CheckFeatureAvailability
(
node
,
MessageID
.
IDS_FeatureRefConditional
,
diagnostics
);
}
BoundExpression
condition
=
BindBooleanExpression
(
node
.
Condition
,
diagnostics
);
...
...
src/Compilers/CSharp/Portable/CSharpResources.Designer.cs
浏览文件 @
dc5d6faa
...
...
@@ -10700,6 +10700,15 @@ internal class CSharpResources {
}
}
/// <summary>
/// Looks up a localized string similar to ref conditional expression.
/// </summary>
internal static string IDS_FeatureRefConditional {
get {
return ResourceManager.GetString("IDS_FeatureRefConditional", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to ref extension methods.
/// </summary>
...
...
src/Compilers/CSharp/Portable/CSharpResources.resx
浏览文件 @
dc5d6faa
...
...
@@ -4264,6 +4264,9 @@ To remove the warning, you can use /reference instead (set the Embed Interop Typ
<data
name=
"IDS_FeatureRefStructs"
xml:space=
"preserve"
>
<value>
ref structs
</value>
</data>
<data
name=
"IDS_FeatureRefConditional"
xml:space=
"preserve"
>
<value>
ref conditional expression
</value>
</data>
<data
name=
"CompilationC"
xml:space=
"preserve"
>
<value>
Compilation (C#):
</value>
</data>
...
...
src/Compilers/CSharp/Portable/Errors/MessageID.cs
浏览文件 @
dc5d6faa
...
...
@@ -145,6 +145,7 @@ internal enum MessageID
IDS_FeatureRefExtensionMethods
=
MessageBase
+
12728
,
IDS_StackAllocExpression
=
MessageBase
+
12729
,
IDS_FeaturePrivateProtected
=
MessageBase
+
12730
,
IDS_FeatureRefConditional
=
MessageBase
+
12731
,
}
// Message IDs may refer to strings that need to be localized.
...
...
@@ -192,6 +193,7 @@ internal static LanguageVersion RequiredVersion(this MessageID feature)
case
MessageID
.
IDS_FeatureRefStructs
:
case
MessageID
.
IDS_FeatureReadOnlyStructs
:
case
MessageID
.
IDS_FeatureRefExtensionMethods
:
case
MessageID
.
IDS_FeatureRefConditional
:
return
LanguageVersion
.
CSharp7_2
;
// C# 7.1 features.
...
...
src/Compilers/CSharp/Portable/xlf/CSharpResources.cs.xlf
浏览文件 @
dc5d6faa
...
...
@@ -8590,6 +8590,11 @@ Pokud chcete odstranit toto varování, můžete místo toho použít /reference
<target
state=
"new"
>
Arguments with 'in' modifier cannot be used in dynamically dispatched expessions.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"IDS_FeatureRefConditional"
>
<source>
ref conditional expression
</source>
<target
state=
"new"
>
ref conditional expression
</target>
<note
/>
</trans-unit>
</body>
</file>
</xliff>
\ No newline at end of file
src/Compilers/CSharp/Portable/xlf/CSharpResources.de.xlf
浏览文件 @
dc5d6faa
...
...
@@ -8590,6 +8590,11 @@ Um die Warnung zu beheben, können Sie stattdessen /reference verwenden (Einbett
<target state="new">Arguments with 'in' modifier cannot be used in dynamically dispatched expessions.</target>
<note />
</trans-unit>
<trans-unit id="IDS_FeatureRefConditional">
<source>ref conditional expression</source>
<target state="new">ref conditional expression</target>
<note />
</trans-unit>
</body>
</file>
</xliff>
\ No newline at end of file
src/Compilers/CSharp/Portable/xlf/CSharpResources.es.xlf
浏览文件 @
dc5d6faa
...
...
@@ -8590,6 +8590,11 @@ Para eliminar la advertencia puede usar /reference (establezca la propiedad Embe
<target state="new">Arguments with 'in' modifier cannot be used in dynamically dispatched expessions.</target>
<note />
</trans-unit>
<trans-unit id="IDS_FeatureRefConditional">
<source>ref conditional expression</source>
<target state="new">ref conditional expression</target>
<note />
</trans-unit>
</body>
</file>
</xliff>
\ No newline at end of file
src/Compilers/CSharp/Portable/xlf/CSharpResources.fr.xlf
浏览文件 @
dc5d6faa
...
...
@@ -8590,6 +8590,11 @@ Pour supprimer l'avertissement, vous pouvez utiliser la commande /reference (dé
<target state="new">Arguments with 'in' modifier cannot be used in dynamically dispatched expessions.</target>
<note />
</trans-unit>
<trans-unit id="IDS_FeatureRefConditional">
<source>ref conditional expression</source>
<target state="new">ref conditional expression</target>
<note />
</trans-unit>
</body>
</file>
</xliff>
\ No newline at end of file
src/Compilers/CSharp/Portable/xlf/CSharpResources.it.xlf
浏览文件 @
dc5d6faa
...
...
@@ -8590,6 +8590,11 @@ Per rimuovere l'avviso, è invece possibile usare /reference (impostare la propr
<target state="new">Arguments with 'in' modifier cannot be used in dynamically dispatched expessions.</target>
<note />
</trans-unit>
<trans-unit id="IDS_FeatureRefConditional">
<source>ref conditional expression</source>
<target state="new">ref conditional expression</target>
<note />
</trans-unit>
</body>
</file>
</xliff>
\ No newline at end of file
src/Compilers/CSharp/Portable/xlf/CSharpResources.ja.xlf
浏览文件 @
dc5d6faa
...
...
@@ -8590,6 +8590,11 @@ To remove the warning, you can use /reference instead (set the Embed Interop Typ
<target
state=
"new"
>
Arguments with 'in' modifier cannot be used in dynamically dispatched expessions.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"IDS_FeatureRefConditional"
>
<source>
ref conditional expression
</source>
<target
state=
"new"
>
ref conditional expression
</target>
<note
/>
</trans-unit>
</body>
</file>
</xliff>
\ No newline at end of file
src/Compilers/CSharp/Portable/xlf/CSharpResources.ko.xlf
浏览文件 @
dc5d6faa
...
...
@@ -8590,6 +8590,11 @@ To remove the warning, you can use /reference instead (set the Embed Interop Typ
<target
state=
"new"
>
Arguments with 'in' modifier cannot be used in dynamically dispatched expessions.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"IDS_FeatureRefConditional"
>
<source>
ref conditional expression
</source>
<target
state=
"new"
>
ref conditional expression
</target>
<note
/>
</trans-unit>
</body>
</file>
</xliff>
\ No newline at end of file
src/Compilers/CSharp/Portable/xlf/CSharpResources.pl.xlf
浏览文件 @
dc5d6faa
...
...
@@ -8590,6 +8590,11 @@ Aby usunąć ostrzeżenie, możesz zamiast tego użyć opcji /reference (ustaw w
<target state="new">Arguments with 'in' modifier cannot be used in dynamically dispatched expessions.</target>
<note />
</trans-unit>
<trans-unit id="IDS_FeatureRefConditional">
<source>ref conditional expression</source>
<target state="new">ref conditional expression</target>
<note />
</trans-unit>
</body>
</file>
</xliff>
\ No newline at end of file
src/Compilers/CSharp/Portable/xlf/CSharpResources.pt-BR.xlf
浏览文件 @
dc5d6faa
...
...
@@ -8590,6 +8590,11 @@ Para incorporar informações de tipo de interoperabilidade para os dois assembl
<target state="new">Arguments with 'in' modifier cannot be used in dynamically dispatched expessions.</target>
<note />
</trans-unit>
<trans-unit id="IDS_FeatureRefConditional">
<source>ref conditional expression</source>
<target state="new">ref conditional expression</target>
<note />
</trans-unit>
</body>
</file>
</xliff>
\ No newline at end of file
src/Compilers/CSharp/Portable/xlf/CSharpResources.ru.xlf
浏览文件 @
dc5d6faa
...
...
@@ -8590,6 +8590,11 @@ To remove the warning, you can use /reference instead (set the Embed Interop Typ
<target state="new">Arguments with 'in' modifier cannot be used in dynamically dispatched expessions.</target>
<note />
</trans-unit>
<trans-unit id="IDS_FeatureRefConditional">
<source>ref conditional expression</source>
<target state="new">ref conditional expression</target>
<note />
</trans-unit>
</body>
</file>
</xliff>
\ No newline at end of file
src/Compilers/CSharp/Portable/xlf/CSharpResources.tr.xlf
浏览文件 @
dc5d6faa
...
...
@@ -8590,6 +8590,11 @@ Uyarıyı kaldırmak için, /reference kullanabilirsiniz (Birlikte Çalışma T
<target
state=
"new"
>
Arguments with 'in' modifier cannot be used in dynamically dispatched expessions.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"IDS_FeatureRefConditional"
>
<source>
ref conditional expression
</source>
<target
state=
"new"
>
ref conditional expression
</target>
<note
/>
</trans-unit>
</body>
</file>
</xliff>
\ No newline at end of file
src/Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hans.xlf
浏览文件 @
dc5d6faa
...
...
@@ -8590,6 +8590,11 @@ To remove the warning, you can use /reference instead (set the Embed Interop Typ
<target
state=
"new"
>
Arguments with 'in' modifier cannot be used in dynamically dispatched expessions.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"IDS_FeatureRefConditional"
>
<source>
ref conditional expression
</source>
<target
state=
"new"
>
ref conditional expression
</target>
<note
/>
</trans-unit>
</body>
</file>
</xliff>
\ No newline at end of file
src/Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hant.xlf
浏览文件 @
dc5d6faa
...
...
@@ -8590,6 +8590,11 @@ To remove the warning, you can use /reference instead (set the Embed Interop Typ
<target
state=
"new"
>
Arguments with 'in' modifier cannot be used in dynamically dispatched expessions.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"IDS_FeatureRefConditional"
>
<source>
ref conditional expression
</source>
<target
state=
"new"
>
ref conditional expression
</target>
<note
/>
</trans-unit>
</body>
</file>
</xliff>
\ No newline at end of file
src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenRefConditionalOperatorTests.cs
浏览文件 @
dc5d6faa
...
...
@@ -636,6 +636,37 @@ static void Main()
);
}
[
Fact
]
[
WorkItem
(
24306
,
"https://github.com/dotnet/roslyn/issues/24306"
)]
public
void
TestRefConditional_71
()
{
var
source
=
@"
class C
{
static void Main()
{
}
void Test()
{
int local1 = 1;
int local2 = 2;
bool b = true;
ref int r = ref b? ref local1: ref local2;
}
}
"
;
var
comp
=
CreateCompilationWithMscorlib45
(
source
,
options
:
TestOptions
.
ReleaseExe
,
parseOptions
:
TestOptions
.
Regular7_1
);
comp
.
VerifyEmitDiagnostics
(
// (15,25): error CS8302: Feature 'ref conditional expression' is not available in C# 7.1. Please use language version 7.2 or greater.
// ref int r = ref b? ref local1: ref local2;
Diagnostic
(
ErrorCode
.
ERR_FeatureNotAvailableInVersion7_1
,
"b? ref local1: ref local2"
).
WithArguments
(
"ref conditional expression"
,
"7.2"
).
WithLocation
(
15
,
25
)
);
}
[
Fact
]
public
void
TestRefConditionalUnsafeToReturn1
()
{
...
...
src/EditorFeatures/CSharpTest/SignatureHelp/ElementAccessExpressionSignatureHelpProviderTests.cs
浏览文件 @
dc5d6faa
...
...
@@ -52,6 +52,52 @@ void Goo()
await
TestAsync
(
markup
,
expectedOrderedItems
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
SignatureHelp
)]
[
WorkItem
(
24311
,
"https://github.com/dotnet/roslyn/issues/24311"
)]
public
async
Task
TestInvocationWithParametersOn1_WithRefReturn
()
{
var
markup
=
@"
class C
{
public ref int this[int a]
{
get { throw null; }
}
void Goo(C c)
{
[|c[$$]|]
}
}"
;
var
expectedOrderedItems
=
new
List
<
SignatureHelpTestItem
>();
expectedOrderedItems
.
Add
(
new
SignatureHelpTestItem
(
"ref int C[int a]"
,
string
.
Empty
,
string
.
Empty
,
currentParameterIndex
:
0
));
await
TestAsync
(
markup
,
expectedOrderedItems
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
SignatureHelp
)]
[
WorkItem
(
24311
,
"https://github.com/dotnet/roslyn/issues/24311"
)]
public
async
Task
TestInvocationWithParametersOn1_WithRefReadonlyReturn
()
{
var
markup
=
@"
class C
{
public ref readonly int this[int a]
{
get { throw null; }
}
void Goo(C c)
{
[|c[$$]|]
}
}"
;
var
expectedOrderedItems
=
new
List
<
SignatureHelpTestItem
>();
expectedOrderedItems
.
Add
(
new
SignatureHelpTestItem
(
"ref readonly int C[int a]"
,
string
.
Empty
,
string
.
Empty
,
currentParameterIndex
:
0
));
await
TestAsync
(
markup
,
expectedOrderedItems
);
}
[
WorkItem
(
636117
,
"http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/636117"
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
SignatureHelp
)]
public
async
Task
TestInvocationOnExpression
()
...
...
src/Features/CSharp/Portable/SignatureHelp/ElementAccessExpressionSignatureHelpProvider.cs
浏览文件 @
dc5d6faa
...
...
@@ -246,6 +246,19 @@ public override SignatureHelpState GetCurrentArgumentState(SyntaxNode root, int
{
var
result
=
new
List
<
SymbolDisplayPart
>();
if
(
indexer
.
ReturnsByRef
)
{
result
.
Add
(
Keyword
(
SyntaxKind
.
RefKeyword
));
result
.
Add
(
Space
());
}
else
if
(
indexer
.
ReturnsByRefReadonly
)
{
result
.
Add
(
Keyword
(
SyntaxKind
.
RefKeyword
));
result
.
Add
(
Space
());
result
.
Add
(
Keyword
(
SyntaxKind
.
ReadOnlyKeyword
));
result
.
Add
(
Space
());
}
result
.
AddRange
(
indexer
.
Type
.
ToMinimalDisplayParts
(
semanticModel
,
position
));
result
.
Add
(
Space
());
result
.
AddRange
(
indexer
.
ContainingType
.
ToMinimalDisplayParts
(
semanticModel
,
position
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录