Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
dotNET Platform
fsharp
提交
77800470
F
fsharp
项目概览
dotNET Platform
/
fsharp
12 个月 前同步成功
通知
0
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
fsharp
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
77800470
编写于
11月 21, 2019
作者:
P
Phillip Carter
提交者:
GitHub
11月 21, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Be very literal about the LangVersion string (#7895)
* Be very literal about the LangVersion string * Skip timing test
上级
0dabe8da
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
49 addition
and
24 deletion
+49
-24
src/fsharp/LanguageFeatures.fs
src/fsharp/LanguageFeatures.fs
+23
-23
tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharpScriptTests.fs
...Compiler.Private.Scripting.UnitTests/FSharpScriptTests.fs
+1
-1
tests/fsharpqa/Source/CompilerOptions/fsc/langversion/badlangversion-culture.fsx
...ompilerOptions/fsc/langversion/badlangversion-culture.fsx
+5
-0
tests/fsharpqa/Source/CompilerOptions/fsc/langversion/badlangversion-decimal.fsx
...ompilerOptions/fsc/langversion/badlangversion-decimal.fsx
+5
-0
tests/fsharpqa/Source/CompilerOptions/fsc/langversion/env.lst
...s/fsharpqa/Source/CompilerOptions/fsc/langversion/env.lst
+2
-0
tests/fsharpqa/Source/CompilerOptions/fsi/langversion/badlangversion-culture.fsx
...ompilerOptions/fsi/langversion/badlangversion-culture.fsx
+5
-0
tests/fsharpqa/Source/CompilerOptions/fsi/langversion/badlangversion-decimal.fsx
...ompilerOptions/fsi/langversion/badlangversion-decimal.fsx
+5
-0
tests/fsharpqa/Source/CompilerOptions/fsi/langversion/env.lst
...s/fsharpqa/Source/CompilerOptions/fsi/langversion/env.lst
+3
-0
未找到文件。
src/fsharp/LanguageFeatures.fs
浏览文件 @
77800470
...
...
@@ -29,9 +29,8 @@ type LanguageFeature =
|
ImplicitYield
=
7
|
OpenStaticClasses
=
8
/// LanguageVersion management
type
LanguageVersion
(
specifiedVersion
)
=
type
LanguageVersion
(
specifiedVersion
AsString
)
=
// When we increment language versions here preview is higher than current RTM version
static
let
languageVersion46
=
4
.
6
m
...
...
@@ -44,30 +43,34 @@ type LanguageVersion (specifiedVersion) =
static
let
validOptions
=
[|
"preview"
;
"default"
;
"latest"
;
"latestmajor"
|]
static
let
languageVersions
=
set
[|
languageVersion46
;
languageVersion47
|]
static
let
features
=
dict
[|
// Add new LanguageVersions here ...
LanguageFeature
.
LanguageVersion46
,
languageVersion46
LanguageFeature
.
LanguageVersion47
,
languageVersion47
LanguageFeature
.
PreviewVersion
,
previewVersion
LanguageFeature
.
SingleUnderscorePattern
,
languageVersion47
LanguageFeature
.
WildCardInForLoop
,
languageVersion47
LanguageFeature
.
RelaxWhitespace
,
languageVersion47
LanguageFeature
.
NameOf
,
previewVersion
LanguageFeature
.
ImplicitYield
,
languageVersion47
LanguageFeature
.
OpenStaticClasses
,
previewVersion
|]
static
let
features
=
dict
[
// Add new LanguageVersions here ...
LanguageFeature
.
LanguageVersion46
,
languageVersion46
LanguageFeature
.
LanguageVersion47
,
languageVersion47
LanguageFeature
.
PreviewVersion
,
previewVersion
// F# 4.7
LanguageFeature
.
SingleUnderscorePattern
,
languageVersion47
LanguageFeature
.
WildCardInForLoop
,
languageVersion47
LanguageFeature
.
RelaxWhitespace
,
languageVersion47
LanguageFeature
.
ImplicitYield
,
languageVersion47
// Add new Language Features here...
LanguageFeature
.
NameOf
,
previewVersion
LanguageFeature
.
OpenStaticClasses
,
previewVersion
]
let
specified
=
match
specifiedVersion
with
match
specifiedVersion
AsString
with
|
"?"
->
0
m
|
"preview"
->
previewVersion
|
"default"
->
defaultVersion
|
"latest"
->
latestVersion
|
"latestmajor"
->
latestMajorVersion
|
_
->
match
Decimal
.
TryParse
(
specifiedVersion
)
with
|
true
,
v
->
v
|
_
->
0
m
|
"4.6"
->
languageVersion46
|
"4.7"
->
languageVersion47
|
_
->
0
m
/// Check if this feature is supported by the selected langversion
member
__.
SupportsFeature
featureId
=
...
...
@@ -79,10 +82,7 @@ type LanguageVersion (specifiedVersion) =
member
__.
ContainsVersion
version
=
match
version
with
|
"?"
|
"preview"
|
"default"
|
"latest"
|
"latestmajor"
->
true
|
_
->
match
Decimal
.
TryParse
(
specifiedVersion
)
with
|
true
,
v
->
languageVersions
.
Contains
v
|
_
->
false
|
_
->
languageVersions
.
Contains
specified
/// Get a list of valid strings for help text
member
__.
ValidOptions
=
validOptions
...
...
tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharpScriptTests.fs
浏览文件 @
77800470
...
...
@@ -100,7 +100,7 @@ type InteractiveTests() =
|
Ok
(_)
->
Assert
.
Fail
(
"expected a failure"
)
|
Error
(
ex
)
->
Assert
.
IsInstanceOf
<
FileNotFoundException
>(
ex
)
[<
Test
>]
[<
Test
;
Ignore
(
"This timing test fails in different environments. Skipping so that we don't assume an arbitrary CI environment has enough compute/etc. for what we need here."
)
>]
member
_.
``Evaluation can be cancelled``
()
=
use
script
=
new
FSharpScript
()
let
sleepTime
=
10000
...
...
tests/fsharpqa/Source/CompilerOptions/fsc/langversion/badlangversion-culture.fsx
0 → 100644
浏览文件 @
77800470
// #NoMT #CompilerOptions #RequiresENU
// Unrecognized value '4,7' for --langversion use --langversion:? for complete list
//<Expects id="FS0246" status="error"></Expects>
#
light
exit
0
tests/fsharpqa/Source/CompilerOptions/fsc/langversion/badlangversion-decimal.fsx
0 → 100644
浏览文件 @
77800470
// #NoMT #CompilerOptions #RequiresENU
// Unrecognized value '4.70000000000' for --langversion use --langversion:? for complete list
//<Expects id="FS0246" status="error"></Expects>
#
light
exit
0
tests/fsharpqa/Source/CompilerOptions/fsc/langversion/env.lst
浏览文件 @
77800470
...
...
@@ -2,3 +2,5 @@
ReqENU SOURCE=dummy.fsx COMPILE_ONLY=1 PRECMD="\$FSC_PIPE >langversionhelp.txt --langversion:? 2>&1" POSTCMD="\$FSI_PIPE --nologo --quiet --exec ..\\..\\..\\comparer.fsx langversionhelp.txt langversionhelp.437.1033.bsl" # --langversion:?
ReqENU SOURCE=badlangversion.fsx SCFLAGS=" --langversion:4.5" # --langversion:4.5
ReqENU SOURCE=badlangversion-culture.fsx SCFLAGS=" --langversion:4,7" # --langversion:4,7
ReqENU SOURCE=badlangversion-decimal.fsx SCFLAGS=" --langversion:4.70000000000" # --langversion:4.70000000000
tests/fsharpqa/Source/CompilerOptions/fsi/langversion/badlangversion-culture.fsx
0 → 100644
浏览文件 @
77800470
// #NoMT #CompilerOptions #RequiresENU
// Unrecognized value '4,7' for --langversion use --langversion:? for complete list
//<Expects id="FS0246" status="error"></Expects>
#
light
exit
0
tests/fsharpqa/Source/CompilerOptions/fsi/langversion/badlangversion-decimal.fsx
0 → 100644
浏览文件 @
77800470
// #NoMT #CompilerOptions #RequiresENU
// Unrecognized value '4.70000000000' for --langversion use --langversion:? for complete list
//<Expects id="FS0246" status="error"></Expects>
#
light
exit
0
tests/fsharpqa/Source/CompilerOptions/fsi/langversion/env.lst
浏览文件 @
77800470
...
...
@@ -2,3 +2,6 @@
ReqENU SOURCE=dummy.fsx COMPILE_ONLY=1 SCFLAGS="--nologo" FSIMODE=EXEC PRECMD="\$FSI_PIPE --langversion:? >langversionhelp.txt 2>&1" POSTCMD="\$FSI_PIPE --nologo --quiet --exec ..\\..\\..\\comparer.fsx langversionhelp.txt langversionhelp.437.1033.bsl" # --langversion:?
ReqENU SOURCE=badlangversion.fsx SCFLAGS=" --langversion:4.5" # --langversion:4.5
ReqENU SOURCE=badlangversion-culture.fsx SCFLAGS=" --langversion:4,7" # --langversion:4,7
ReqENU SOURCE=badlangversion-decimal.fsx SCFLAGS=" --langversion:4.70000000000" # --langversion:4.70000000000
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录