Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
dotNET Platform
fsharp
提交
d5cc008a
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,发现更多精彩内容 >>
未验证
提交
d5cc008a
编写于
5月 02, 2022
作者:
D
dotnet bot
提交者:
GitHub
5月 02, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #13083 from dotnet/merges/main-to-release/dev17.3
Merge main to release/dev17.3
上级
ce3bef74
d31eae10
变更
8
展开全部
隐藏空白更改
内联
并排
Showing
8 changed file
with
946 addition
and
8 deletion
+946
-8
src/fsharp/CheckExpressions.fs
src/fsharp/CheckExpressions.fs
+1
-2
tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunctions.fs
...r.ComponentTests/EmittedIL/TestFunctions/TestFunctions.fs
+36
-2
tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/Verify13043.fs
...ler.ComponentTests/EmittedIL/TestFunctions/Verify13043.fs
+44
-0
tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/Verify13043.fs.il.debug.bsl
...Tests/EmittedIL/TestFunctions/Verify13043.fs.il.debug.bsl
+427
-0
tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/Verify13043.fs.il.release.bsl
...sts/EmittedIL/TestFunctions/Verify13043.fs.il.release.bsl
+427
-0
tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj
...iler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj
+1
-0
tests/FSharp.Test.Utilities/Compiler.fs
tests/FSharp.Test.Utilities/Compiler.fs
+8
-2
tests/FSharp.Test.Utilities/DirectoryAttribute.fs
tests/FSharp.Test.Utilities/DirectoryAttribute.fs
+2
-2
未找到文件。
src/fsharp/CheckExpressions.fs
浏览文件 @
d5cc008a
...
...
@@ -5850,7 +5850,7 @@ and TcNonControlFlowExpr (env: TcEnv) f =
| NotedSourceConstruct.Combine
| NotedSourceConstruct.With
| NotedSourceConstruct.While
| NotedSourceConstruct.DelayOrQuoteOrRun ->
| NotedSourceConstruct.DelayOrQuoteOrRun ->
res, tpenv
| NotedSourceConstruct.None ->
// Skip outer debug point for "e1 && e2" and "e1 || e2"
...
...
@@ -5929,7 +5929,6 @@ and TcExprUndelayed cenv (overallTy: OverallTy) env tpenv (synExpr: SynExpr) =
// e: ty
| SynExpr.Typed (synBodyExpr, synType, m) ->
TcNonControlFlowExpr env <| fun env ->
TcExprTypeAnnotated cenv overallTy env tpenv (synBodyExpr, synType, m)
// e :? ty
...
...
tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunctions.fs
浏览文件 @
d5cc008a
...
...
@@ -7,14 +7,23 @@ open FSharp.Test.Compiler
module
TestFunctions
=
let
verifyCo
mpilation
compilation
=
let
verifyCo
re
compilation
=
compilation
|>
withOptions
[
"--test:EmitFeeFeeAs100001"
]
|>
withOptions
[
"--test:EmitFeeFeeAs100001"
;
"--nowarn:988"
;
"--nowarn:3370"
]
|>
asExe
|>
withNoOptimize
|>
withEmbeddedPdb
|>
withEmbedAllSource
|>
ignoreWarnings
let
verifyCompileAndRun
compilation
=
compilation
|>
verifyCore
|>
compileAndRun
let
verifyCompilation
compilation
=
compilation
|>
verifyCore
|>
verifyILBaseline
//SOURCE=TestFunction01.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd TestFunction01.exe" # TestFunction01.fs
...
...
@@ -245,3 +254,28 @@ module TestFunctions =
compilation
|>
verifyCompilation
// Verify IL 13043
[<
Theory
;
Directory
(__
SOURCE_DIRECTORY__
,
Includes
=[|
"Verify13043.fs"
|])>]
let
``Verify13043_il``
compilation
=
compilation
|>
withDebug
|>
verifyCompilation
// Verify Execution 13043 run it built not optimized with debug
[<
Theory
;
Directory
(__
SOURCE_DIRECTORY__
,
Includes
=[|
"Verify13043.fs"
|])>]
let
``Verify13043_execution_noopt``
compilation
=
compilation
|>
withDebug
|>
verifyCompileAndRun
|>
shouldSucceed
// Verify Execution 13043 --- run it built optimized no debug
[<
Theory
;
Directory
(__
SOURCE_DIRECTORY__
,
Includes
=[|
"Verify13043.fs"
|])>]
let
``Verify13043_execution_opt``
compilation
=
compilation
|>
asExe
|>
withOptions
[
"--test:EmitFeeFeeAs100001"
;
"--nowarn:988"
;
"--nowarn:3370"
]
|>
withOptimize
|>
withNoDebug
|>
compileAndRun
|>
shouldSucceed
tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/Verify13043.fs
0 → 100644
浏览文件 @
d5cc008a
module
Verify13043
let
list
=
[
1
;
2
;
3
]
let
condition
n
=
n
<
3
let
dropWhileWithMatch
condition
list
=
let
rec
f
(
l
:
List
<
int
>)
:
List
<
int
>
=
match
l
with
|
[]
->
[]
|
head
::
tail
->
match
condition
head
with
|
true
->
f
tail
|
false
->
head
::
tail
f
list
(*
This function caused an Unhandled exception at execution time:
Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
at Program.f@14-1.Invoke(FSharpList`1 _arg1) in /workspaces/function-rec-fsharp-dotnet7-bug-demo/Program.fs:line 18
at Program.dropWhileWithFunction(FSharpFunc`2 condition, FSharpList`1 list) in /workspaces/function-rec-fsharp-dotnet7-bug-demo/Program.fs:line 21
at <StartupCode$function-rec-fsharp-dotnet7-bug-demo>.$Program.main@() in /workspaces/function-rec-fsharp-dotnet7-bug-demo/Program.fs:line 29
*)
let
dropWhileWithFunction
condition
list
=
let
rec
f
:
List
<
int
>
->
List
<
int
>
=
function
|
[]
->
[]
|
head
::
tail
->
match
condition
head
with
|
true
->
f
tail
|
false
->
head
::
tail
f
list
// this runs fine:
let
matchResult
=
dropWhileWithMatch
condition
list
printfn
"Match: %A"
matchResult
// and this results in a null reference exception
let
functionResult
=
dropWhileWithFunction
condition
list
printfn
"Function: %A"
functionResult
tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/Verify13043.fs.il.debug.bsl
0 → 100644
浏览文件 @
d5cc008a
此差异已折叠。
点击以展开。
tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/Verify13043.fs.il.release.bsl
0 → 100644
浏览文件 @
d5cc008a
此差异已折叠。
点击以展开。
tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj
浏览文件 @
d5cc008a
...
...
@@ -193,6 +193,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference
Include=
"$(FSharpSourcesRoot)\fsharp\FSharp.Compiler.Service\FSharp.Compiler.Service.fsproj"
/>
<ProjectReference
Include=
"$(FSharpSourcesRoot)\fsharp\FSharp.Compiler.Interactive.Settings\FSharp.Compiler.Interactive.Settings.fsproj"
/>
<ProjectReference
Include=
"$(FSharpSourcesRoot)\fsharp\FSharp.Core\FSharp.Core.fsproj"
/>
<ProjectReference
Include=
"$(FSharpTestsRoot)\FSharp.Test.Utilities\FSharp.Test.Utilities.fsproj"
/>
</ItemGroup>
...
...
tests/FSharp.Test.Utilities/Compiler.fs
浏览文件 @
d5cc008a
...
...
@@ -342,6 +342,12 @@ module rec Compiler =
|
FS
fs
->
FS
{
fs
with
Options
=
fs
.
Options
@
options
}
|
_
->
failwith
message
let
withDebug
(
cUnit
:
CompilationUnit
)
:
CompilationUnit
=
withOptionsHelper
[
"--debug+"
]
"debug+ is only supported on F#"
cUnit
let
withNoDebug
(
cUnit
:
CompilationUnit
)
:
CompilationUnit
=
withOptionsHelper
[
"--debug-"
]
"debug- is only supported on F#"
cUnit
let
withOcamlCompat
(
cUnit
:
CompilationUnit
)
:
CompilationUnit
=
withOptionsHelper
[
"--mlcompatibility"
]
"withOcamlCompat is only supported on F#"
cUnit
...
...
@@ -845,8 +851,8 @@ module rec Compiler =
// if the environment variable TEST_UPDATE_BSL has been set
if
snd
(
Int32
.
TryParse
(
Environment
.
GetEnvironmentVariable
(
"TEST_UPDATE_BSL"
)))
<>
0
then
match
baseline
with
|
Some
baseline
->
System
.
IO
.
File
.
Copy
(
baseline
.
ILBaseline
.
FilePath
,
baseline
.
ILBaseline
.
BslSource
,
true
)
|
None
->
()
|
Some
baseline
->
System
.
IO
.
File
.
Copy
(
baseline
.
ILBaseline
.
FilePath
,
baseline
.
ILBaseline
.
BslSource
,
true
)
|
None
->
()
createBaselineErrors
bsl
.
ILBaseline
actualIL
Assert
.
Fail
(
errorMsg
)
...
...
tests/FSharp.Test.Utilities/DirectoryAttribute.fs
浏览文件 @
d5cc008a
...
...
@@ -66,8 +66,8 @@ type DirectoryAttribute(dir: string) =
let readFileOrDefault (path: string) : string option =
match FileSystem.FileExistsShim(path) with
| true -> Some <| File.ReadAllText path
| _ -> None
| true -> Some (File.ReadAllText path)
| _ -> None
let createCompilationUnit path fs name =
let outputDirectory = outputDirectory name
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录