Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
dotNET Platform
fsharp
提交
471bb271
F
fsharp
项目概览
dotNET Platform
/
fsharp
11 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
471bb271
编写于
10月 25, 2022
作者:
D
Don Syme
浏览文件
操作
浏览文件
下载
差异文件
Merge commit '
9d290901
' into feature/nullness
上级
7c0b0c28
9d290901
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
35 addition
and
35 deletion
+35
-35
eng/build.sh
eng/build.sh
+10
-7
eng/common/tools.sh
eng/common/tools.sh
+1
-1
src/Compiler/Checking/CheckExpressions.fs
src/Compiler/Checking/CheckExpressions.fs
+2
-2
src/Compiler/Checking/InfoReader.fs
src/Compiler/Checking/InfoReader.fs
+1
-1
src/Compiler/Driver/CompilerOptions.fs
src/Compiler/Driver/CompilerOptions.fs
+4
-6
src/Compiler/Facilities/DiagnosticsLogger.fs
src/Compiler/Facilities/DiagnosticsLogger.fs
+5
-5
src/Compiler/Facilities/DiagnosticsLogger.fsi
src/Compiler/Facilities/DiagnosticsLogger.fsi
+1
-2
src/Compiler/Facilities/LanguageFeatures.fs
src/Compiler/Facilities/LanguageFeatures.fs
+6
-6
src/Compiler/Facilities/LanguageFeatures.fsi
src/Compiler/Facilities/LanguageFeatures.fsi
+5
-5
未找到文件。
eng/build.sh
浏览文件 @
471bb271
...
...
@@ -255,21 +255,24 @@ function BuildSolution {
rm
-fr
$bootstrap_dir
fi
if
[
!
-f
"
$bootstrap_dir
/fslex.dll"
]
;
then
local
bltools
=
""
if
[[
"
$bl
"
!=
""
]]
;
then
bltools
=
$bl
+
".lex.binlog"
fi
BuildMessage
=
"Error building tools"
MSBuild
"
$repo_root
/buildtools/buildtools.proj"
\
/restore
\
/p:Configuration
=
$bootstrap_config
MSBuild
"
$repo_root
/buildtools/buildtools.proj"
/restore
"
$bltools
"
/p:Configuration
=
$bootstrap_config
mkdir
-p
"
$bootstrap_dir
"
cp
-pr
$artifacts_dir
/bin/fslex/
$bootstrap_config
/net7.0
$bootstrap_dir
/fslex
cp
-pr
$artifacts_dir
/bin/fsyacc/
$bootstrap_config
/net7.0
$bootstrap_dir
/fsyacc
fi
if
[
!
-f
"
$bootstrap_dir
/fsc.exe"
]
;
then
local
bltools
=
""
if
[[
"
$bl
"
!=
""
]]
;
then
bltools
=
$bl
+
".bootstrap.binlog"
fi
BuildMessage
=
"Error building bootstrap"
MSBuild
"
$repo_root
/Proto.sln"
\
/restore
\
/p:Configuration
=
$bootstrap_config
MSBuild
"
$repo_root
/Proto.sln"
/restore
"
$bltools
"
/p:Configuration
=
$bootstrap_config
cp
-pr
$artifacts_dir
/bin/fsc/
$bootstrap_config
/net7.0
$bootstrap_dir
/fsc
fi
fi
...
...
eng/common/tools.sh
浏览文件 @
471bb271
...
...
@@ -490,7 +490,7 @@ function MSBuild-Core {
}
}
RunBuildTool
"
$_InitializeBuildToolCommand
"
/m /nologo /clp:Summary /v:
$verbosity
/nr:
$node_reuse
$warnaserror_switch
/p:TreatWarningsAsErrors
=
$warn_as_error
/p:ContinuousIntegrationBuild
=
$ci
/bl
"
$@
"
RunBuildTool
"
$_InitializeBuildToolCommand
"
/m /nologo /clp:Summary /v:
$verbosity
/nr:
$node_reuse
$warnaserror_switch
/p:TreatWarningsAsErrors
=
$warn_as_error
/p:ContinuousIntegrationBuild
=
$ci
"
$@
"
}
ResolvePath
"
${
BASH_SOURCE
[0]
}
"
...
...
src/Compiler/Checking/CheckExpressions.fs
浏览文件 @
471bb271
...
...
@@ -7057,7 +7057,7 @@ and TcInterpolatedStringExpr cenv (overallTy: OverallTy) env m tpenv (parts: Syn
let newFormatMethod =
match GetIntrinsicConstructorInfosOfType cenv.infoReader m formatTy |> List.filter (fun minfo -> minfo.NumArgs = [3]) with
| [ctorInfo] -> ctorInfo
| _ -> languageFeatureNotSupportedInLibraryError
g.langVersion
LanguageFeature.StringInterpolation m
| _ -> languageFeatureNotSupportedInLibraryError LanguageFeature.StringInterpolation m
let stringKind =
// If this is an interpolated string then try to force the result to be a string
...
...
@@ -7092,7 +7092,7 @@ and TcInterpolatedStringExpr cenv (overallTy: OverallTy) env m tpenv (parts: Syn
match createMethodOpt with
| Some createMethod -> Choice2Of2 createMethod
| None -> languageFeatureNotSupportedInLibraryError
g.langVersion
LanguageFeature.StringInterpolation m
| None -> languageFeatureNotSupportedInLibraryError LanguageFeature.StringInterpolation m
// ... or if that fails then may be a PrintfFormat by a type-directed rule....
elif not (isObjTy g overallTy.Commit) && AddCxTypeMustSubsumeTypeUndoIfFailed env.DisplayEnv cenv.css m overallTy.Commit formatTy then
...
...
src/Compiler/Checking/InfoReader.fs
浏览文件 @
471bb271
...
...
@@ -926,7 +926,7 @@ type InfoReader(g: TcGlobals, amap: Import.ImportMap) as this =
let
checkLanguageFeatureRuntimeAndRecover
(
infoReader
:
InfoReader
)
langFeature
m
=
if
not
(
infoReader
.
IsLanguageFeatureRuntimeSupported
langFeature
)
then
let
featureStr
=
infoReader
.
g
.
lang
Version
.
GetFeatureString
langFeature
let
featureStr
=
Language
Version
.
GetFeatureString
langFeature
errorR
(
Error
(
FSComp
.
SR
.
chkFeatureNotRuntimeSupported
featureStr
,
m
))
let
GetIntrinsicConstructorInfosOfType
(
infoReader
:
InfoReader
)
m
ty
=
...
...
src/Compiler/Driver/CompilerOptions.fs
浏览文件 @
471bb271
...
...
@@ -1111,15 +1111,13 @@ let mlCompatibilityFlag (tcConfigB: TcConfigBuilder) =
/// LanguageVersion management
let
setLanguageVersion
specifiedVersion
=
let
languageVersion
=
LanguageVersion
(
specifiedVersion
)
let
dumpAllowedValues
()
=
printfn
"%s"
(
FSComp
.
SR
.
optsSupportedLangVersions
()
)
for
v
in
l
anguageVersion
.
ValidOptions
do
for
v
in
L
anguageVersion
.
ValidOptions
do
printfn
"%s"
v
for
v
in
l
anguageVersion
.
ValidVersions
do
for
v
in
L
anguageVersion
.
ValidVersions
do
printfn
"%s"
v
exit
0
...
...
@@ -1128,10 +1126,10 @@ let setLanguageVersion specifiedVersion =
dumpAllowedValues
()
elif
specifiedVersion
.
ToUpperInvariant
()
=
"PREVIEW"
then
()
elif
not
(
l
anguageVersion
.
ContainsVersion
specifiedVersion
)
then
elif
not
(
L
anguageVersion
.
ContainsVersion
specifiedVersion
)
then
error
(
Error
(
FSComp
.
SR
.
optsUnrecognizedLanguageVersion
specifiedVersion
,
rangeCmdArgs
))
languageVersion
LanguageVersion
(
specifiedVersion
)
let
languageFlags
tcConfigB
=
[
...
...
src/Compiler/Facilities/DiagnosticsLogger.fs
浏览文件 @
471bb271
...
...
@@ -787,9 +787,9 @@ let NormalizeErrorString (text: string MaybeNull) =
let
private
tryLanguageFeatureErrorAux
(
langVersion
:
LanguageVersion
)
(
langFeature
:
LanguageFeature
)
(
m
:
range
)
=
if
not
(
langVersion
.
SupportsFeature
langFeature
)
then
let
featureStr
=
lang
Version
.
GetFeatureString
langFeature
let
featureStr
=
Language
Version
.
GetFeatureString
langFeature
let
currentVersionStr
=
langVersion
.
SpecifiedVersionString
let
suggestedVersionStr
=
lang
Version
.
GetFeatureVersionString
langFeature
let
suggestedVersionStr
=
Language
Version
.
GetFeatureVersionString
langFeature
Some
(
Error
(
FSComp
.
SR
.
chkFeatureNotLanguageSupported
(
featureStr
,
currentVersionStr
,
suggestedVersionStr
),
m
))
else
None
...
...
@@ -807,9 +807,9 @@ let internal checkLanguageFeatureAndRecover langVersion langFeature m =
let
internal
tryLanguageFeatureErrorOption
langVersion
langFeature
m
=
tryLanguageFeatureErrorAux
langVersion
langFeature
m
let
internal
languageFeatureNotSupportedInLibraryError
(
lang
Version
:
LanguageVersion
)
(
lang
Feature
:
LanguageFeature
)
(
m
:
range
)
=
let
featureStr
=
lang
Version
.
GetFeatureString
langFeature
let
suggestedVersionStr
=
lang
Version
.
GetFeatureVersionString
langFeature
let
internal
languageFeatureNotSupportedInLibraryError
(
langFeature
:
LanguageFeature
)
(
m
:
range
)
=
let
featureStr
=
Language
Version
.
GetFeatureString
langFeature
let
suggestedVersionStr
=
Language
Version
.
GetFeatureVersionString
langFeature
error
(
Error
(
FSComp
.
SR
.
chkFeatureNotSupportedInLibrary
(
featureStr
,
suggestedVersionStr
),
m
))
/// Guard against depth of expression nesting, by moving to new stack when a maximum depth is reached
...
...
src/Compiler/Facilities/DiagnosticsLogger.fsi
浏览文件 @
471bb271
...
...
@@ -386,8 +386,7 @@ val checkLanguageFeatureAndRecover: langVersion: LanguageVersion -> langFeature:
val
tryLanguageFeatureErrorOption
:
langVersion
:
LanguageVersion
->
langFeature
:
LanguageFeature
->
m
:
range
->
exn
option
val
languageFeatureNotSupportedInLibraryError
:
langVersion
:
LanguageVersion
->
langFeature
:
LanguageFeature
->
m
:
range
->
'
T
val
languageFeatureNotSupportedInLibraryError
:
langFeature
:
LanguageFeature
->
m
:
range
->
'
T
type
StackGuard
=
new
:
maxDepth
:
int
->
StackGuard
...
...
src/Compiler/Facilities/LanguageFeatures.fs
浏览文件 @
471bb271
...
...
@@ -149,7 +149,7 @@ type LanguageVersion(versionText) =
let
specified
=
getVersionFromString
versionText
let
versionToString
v
=
static
let
versionToString
v
=
if
v
=
previewVersion
then
"'PREVIEW'"
else
string
v
let
specifiedString
=
versionToString
specified
...
...
@@ -169,15 +169,15 @@ type LanguageVersion(versionText) =
member
_.
IsPreviewEnabled
=
specified
=
previewVersion
/// Does the languageVersion support this version string
member
_.
ContainsVersion
version
=
static
member
ContainsVersion
version
=
let
langVersion
=
getVersionFromString
version
langVersion
<>
0
m
&&
languageVersions
.
Contains
langVersion
/// Get a list of valid strings for help text
member
_.
ValidOptions
=
validOptions
static
member
ValidOptions
=
validOptions
/// Get a list of valid versions for help text
member
_.
ValidVersions
=
static
member
ValidVersions
=
[|
for
v
in
languageVersions
|>
Seq
.
sort
->
sprintf
"%M%s"
v
(
if
v
=
defaultVersion
then
" (Default)"
else
""
)
|]
...
...
@@ -192,7 +192,7 @@ type LanguageVersion(versionText) =
member
_.
SpecifiedVersionString
=
specifiedString
/// Get a string name for the given feature.
member
_.
GetFeatureString
feature
=
static
member
GetFeatureString
feature
=
match
feature
with
|
LanguageFeature
.
SingleUnderscorePattern
->
FSComp
.
SR
.
featureSingleUnderscorePattern
()
|
LanguageFeature
.
WildCardInForLoop
->
FSComp
.
SR
.
featureWildCardInForLoop
()
...
...
@@ -235,7 +235,7 @@ type LanguageVersion(versionText) =
|
LanguageFeature
.
SelfTypeConstraints
->
FSComp
.
SR
.
featureSelfTypeConstraints
()
/// Get a version string associated with the given feature.
member
_.
GetFeatureVersionString
feature
=
static
member
GetFeatureVersionString
feature
=
match
features
.
TryGetValue
feature
with
|
true
,
v
->
versionToString
v
|
_
->
invalidArg
"feature"
"Internal error: Unable to find feature."
...
...
src/Compiler/Facilities/LanguageFeatures.fsi
浏览文件 @
471bb271
...
...
@@ -53,7 +53,7 @@ type LanguageVersion =
new
:
string
->
LanguageVersion
/// Get the list of valid versions
member
ContainsVersion
:
string
->
bool
static
member
ContainsVersion
:
string
->
bool
/// Has preview been explicitly specified
member
IsPreviewEnabled
:
bool
...
...
@@ -65,10 +65,10 @@ type LanguageVersion =
member
SupportsFeature
:
LanguageFeature
->
bool
/// Get the list of valid versions
member
ValidVersions
:
string
[]
static
member
ValidVersions
:
string
[]
/// Get the list of valid options
member
ValidOptions
:
string
[]
static
member
ValidOptions
:
string
[]
/// Get the specified LanguageVersion
member
SpecifiedVersion
:
decimal
...
...
@@ -80,9 +80,9 @@ type LanguageVersion =
member
SpecifiedVersionString
:
string
/// Get a string name for the given feature.
member
GetFeatureString
:
feature
:
LanguageFeature
->
string
static
member
GetFeatureString
:
feature
:
LanguageFeature
->
string
/// Get a version string associated with the given feature.
member
GetFeatureVersionString
:
feature
:
LanguageFeature
->
string
static
member
GetFeatureVersionString
:
feature
:
LanguageFeature
->
string
static
member
Default
:
LanguageVersion
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录