Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
e76195cc
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,发现更多精彩内容 >>
提交
e76195cc
编写于
6月 14, 2017
作者:
V
vsadov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
make new features dependent on 7.2 version
上级
ae941fc5
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
23 addition
and
24 deletion
+23
-24
src/Compilers/CSharp/Portable/Errors/MessageID.cs
src/Compilers/CSharp/Portable/Errors/MessageID.cs
+2
-3
src/Compilers/CSharp/Test/Syntax/Parsing/ParserErrorMessageTests.cs
...ers/CSharp/Test/Syntax/Parsing/ParserErrorMessageTests.cs
+2
-2
src/Compilers/CSharp/Test/Syntax/Parsing/ReadOnlyStructs.cs
src/Compilers/CSharp/Test/Syntax/Parsing/ReadOnlyStructs.cs
+6
-6
src/Compilers/CSharp/Test/Syntax/Parsing/RefReadonlyReturnsTests.cs
...ers/CSharp/Test/Syntax/Parsing/RefReadonlyReturnsTests.cs
+8
-8
src/Compilers/CSharp/Test/Syntax/Parsing/RefStructs.cs
src/Compilers/CSharp/Test/Syntax/Parsing/RefStructs.cs
+5
-5
未找到文件。
src/Compilers/CSharp/Portable/Errors/MessageID.cs
浏览文件 @
e76195cc
...
...
@@ -196,12 +196,11 @@ internal static LanguageVersion RequiredVersion(this MessageID feature)
// Checks are in the LanguageParser unless otherwise noted.
switch
(
feature
)
{
//PROTOTYPE(readonlyRefs): these are all 7.2 features we need to update this.
// C# 7.1 features.
// C# 7.2 features.
case
MessageID
.
IDS_FeatureReadonlyReferences
:
case
MessageID
.
IDS_FeatureRefStructs
:
case
MessageID
.
IDS_FeatureReadOnlyStructs
:
return
LanguageVersion
.
CSharp7_
1
;
return
LanguageVersion
.
CSharp7_
2
;
// C# 7.1 features.
case
MessageID
.
IDS_FeatureAsyncMain
:
...
...
src/Compilers/CSharp/Test/Syntax/Parsing/ParserErrorMessageTests.cs
浏览文件 @
e76195cc
...
...
@@ -2879,9 +2879,9 @@ public class Test
}"
;
ParseAndValidate
(
code
,
new
CSharpParseOptions
(
LanguageVersion
.
CSharp7
),
// (4,29): error CS8107: Feature 'readonly references' is not available in C# 7. Please use language version 7.
1
or greater.
// (4,29): error CS8107: Feature 'readonly references' is not available in C# 7. Please use language version 7.
2
or greater.
// public void DoSomething(in int x) { }
Diagnostic
(
ErrorCode
.
ERR_FeatureNotAvailableInVersion7
,
"in"
).
WithArguments
(
"readonly references"
,
"7.
1"
)
Diagnostic
(
ErrorCode
.
ERR_FeatureNotAvailableInVersion7
,
"in"
).
WithArguments
(
"readonly references"
,
"7.
2"
).
WithLocation
(
4
,
29
)
);
}
...
...
src/Compilers/CSharp/Test/Syntax/Parsing/ReadOnlyStructs.cs
浏览文件 @
e76195cc
...
...
@@ -73,15 +73,15 @@ class Program
var
comp
=
CreateCompilationWithMscorlib45
(
text
,
parseOptions
:
TestOptions
.
Regular
.
WithLanguageVersion
(
LanguageVersion
.
CSharp7
),
options
:
TestOptions
.
DebugDll
);
comp
.
VerifyDiagnostics
(
// (4,5): error CS8107: Feature 'readonly structs' is not available in C# 7. Please use language version 7.
1
or greater.
// (4,5): error CS8107: Feature 'readonly structs' is not available in C# 7. Please use language version 7.
2
or greater.
// readonly struct S1{}
Diagnostic
(
ErrorCode
.
ERR_FeatureNotAvailableInVersion7
,
"readonly"
).
WithArguments
(
"readonly structs"
,
"7.
1
"
).
WithLocation
(
4
,
5
),
// (6,12): error CS8107: Feature 'readonly structs' is not available in C# 7. Please use language version 7.
1
or greater.
Diagnostic
(
ErrorCode
.
ERR_FeatureNotAvailableInVersion7
,
"readonly"
).
WithArguments
(
"readonly structs"
,
"7.
2
"
).
WithLocation
(
4
,
5
),
// (6,12): error CS8107: Feature 'readonly structs' is not available in C# 7. Please use language version 7.
2
or greater.
// public readonly struct S2{}
Diagnostic
(
ErrorCode
.
ERR_FeatureNotAvailableInVersion7
,
"readonly"
).
WithArguments
(
"readonly structs"
,
"7.
1
"
).
WithLocation
(
6
,
12
),
// (8,5): error CS8107: Feature 'readonly structs' is not available in C# 7. Please use language version 7.
1
or greater.
Diagnostic
(
ErrorCode
.
ERR_FeatureNotAvailableInVersion7
,
"readonly"
).
WithArguments
(
"readonly structs"
,
"7.
2
"
).
WithLocation
(
6
,
12
),
// (8,5): error CS8107: Feature 'readonly structs' is not available in C# 7. Please use language version 7.
2
or greater.
// readonly public struct S3{}
Diagnostic
(
ErrorCode
.
ERR_FeatureNotAvailableInVersion7
,
"readonly"
).
WithArguments
(
"readonly structs"
,
"7.
1
"
).
WithLocation
(
8
,
5
)
Diagnostic
(
ErrorCode
.
ERR_FeatureNotAvailableInVersion7
,
"readonly"
).
WithArguments
(
"readonly structs"
,
"7.
2
"
).
WithLocation
(
8
,
5
)
);
}
...
...
src/Compilers/CSharp/Test/Syntax/Parsing/RefReadonlyReturnsTests.cs
浏览文件 @
e76195cc
...
...
@@ -40,18 +40,18 @@ unsafe class Program
var
comp
=
CreateCompilationWithMscorlib45
(
text
,
parseOptions
:
TestOptions
.
Regular
.
WithLanguageVersion
(
LanguageVersion
.
CSharp7
),
options
:
TestOptions
.
UnsafeDebugDll
);
comp
.
VerifyDiagnostics
(
// (4,18): error CS8107: Feature 'readonly references' is not available in C# 7. Please use language version 7.
1
or greater.
// (4,18): error CS8107: Feature 'readonly references' is not available in C# 7. Please use language version 7.
2
or greater.
// delegate ref readonly int D1();
Diagnostic
(
ErrorCode
.
ERR_FeatureNotAvailableInVersion7
,
"readonly"
).
WithArguments
(
"readonly references"
,
"7.
1
"
).
WithLocation
(
4
,
18
),
// (6,16): error CS8107: Feature 'readonly references' is not available in C# 7. Please use language version 7.
1
or greater.
Diagnostic
(
ErrorCode
.
ERR_FeatureNotAvailableInVersion7
,
"readonly"
).
WithArguments
(
"readonly references"
,
"7.
2
"
).
WithLocation
(
4
,
18
),
// (6,16): error CS8107: Feature 'readonly references' is not available in C# 7. Please use language version 7.
2
or greater.
// static ref readonly T M<T>()
Diagnostic
(
ErrorCode
.
ERR_FeatureNotAvailableInVersion7
,
"readonly"
).
WithArguments
(
"readonly references"
,
"7.
1
"
).
WithLocation
(
6
,
16
),
// (11,24): error CS8107: Feature 'readonly references' is not available in C# 7. Please use language version 7.
1
or greater.
Diagnostic
(
ErrorCode
.
ERR_FeatureNotAvailableInVersion7
,
"readonly"
).
WithArguments
(
"readonly references"
,
"7.
2
"
).
WithLocation
(
6
,
16
),
// (11,24): error CS8107: Feature 'readonly references' is not available in C# 7. Please use language version 7.
2
or greater.
// public virtual ref readonly int* P1 => throw null;
Diagnostic
(
ErrorCode
.
ERR_FeatureNotAvailableInVersion7
,
"readonly"
).
WithArguments
(
"readonly references"
,
"7.
1
"
).
WithLocation
(
11
,
24
),
// (13,16): error CS8107: Feature 'readonly references' is not available in C# 7. Please use language version 7.
1
or greater.
Diagnostic
(
ErrorCode
.
ERR_FeatureNotAvailableInVersion7
,
"readonly"
).
WithArguments
(
"readonly references"
,
"7.
2
"
).
WithLocation
(
11
,
24
),
// (13,16): error CS8107: Feature 'readonly references' is not available in C# 7. Please use language version 7.
2
or greater.
// public ref readonly int[][] this[int i] => throw null;
Diagnostic
(
ErrorCode
.
ERR_FeatureNotAvailableInVersion7
,
"readonly"
).
WithArguments
(
"readonly references"
,
"7.
1"
)
Diagnostic
(
ErrorCode
.
ERR_FeatureNotAvailableInVersion7
,
"readonly"
).
WithArguments
(
"readonly references"
,
"7.
2"
).
WithLocation
(
13
,
16
)
);
}
...
...
src/Compilers/CSharp/Test/Syntax/Parsing/RefStructs.cs
浏览文件 @
e76195cc
...
...
@@ -49,12 +49,12 @@ class Program
var
comp
=
CreateCompilationWithMscorlib45
(
text
,
parseOptions
:
TestOptions
.
Regular
.
WithLanguageVersion
(
LanguageVersion
.
CSharp7
),
options
:
TestOptions
.
DebugDll
);
comp
.
VerifyDiagnostics
(
// (4,5): error CS8107: Feature 'ref structs' is not available in C# 7. Please use language version 7.
1
or greater.
// (4,5): error CS8107: Feature 'ref structs' is not available in C# 7. Please use language version 7.
2
or greater.
// ref struct S1{}
Diagnostic
(
ErrorCode
.
ERR_FeatureNotAvailableInVersion7
,
"ref"
).
WithArguments
(
"ref structs"
,
"7.
1
"
).
WithLocation
(
4
,
5
),
// (6,12): error CS8107: Feature 'ref structs' is not available in C# 7. Please use language version 7.
1
or greater.
Diagnostic
(
ErrorCode
.
ERR_FeatureNotAvailableInVersion7
,
"ref"
).
WithArguments
(
"ref structs"
,
"7.
2
"
).
WithLocation
(
4
,
5
),
// (6,12): error CS8107: Feature 'ref structs' is not available in C# 7. Please use language version 7.
2
or greater.
// public ref struct S2{}
Diagnostic
(
ErrorCode
.
ERR_FeatureNotAvailableInVersion7
,
"ref"
).
WithArguments
(
"ref structs"
,
"7.
1
"
).
WithLocation
(
6
,
12
)
Diagnostic
(
ErrorCode
.
ERR_FeatureNotAvailableInVersion7
,
"ref"
).
WithArguments
(
"ref structs"
,
"7.
2
"
).
WithLocation
(
6
,
12
)
);
}
...
...
@@ -106,7 +106,7 @@ class Program
}
"
;
var
comp
=
CreateCompilationWithMscorlib45
(
text
,
parseOptions
:
TestOptions
.
Regular
.
WithLanguageVersion
(
LanguageVersion
.
CSharp7_1
),
options
:
TestOptions
.
DebugDll
);
var
comp
=
CreateCompilationWithMscorlib45
(
text
,
parseOptions
:
TestOptions
.
Regular
.
WithLanguageVersion
(
LanguageVersion
.
Latest
),
options
:
TestOptions
.
DebugDll
);
comp
.
VerifyDiagnostics
();
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录