Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
dotNET Platform
fsharp
提交
31803ec2
F
fsharp
项目概览
dotNET Platform
/
fsharp
大约 1 年 前同步成功
通知
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,发现更多精彩内容 >>
未验证
提交
31803ec2
编写于
3月 31, 2022
作者:
D
dotnet bot
提交者:
GitHub
3月 31, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #12912 from dotnet/merges/main-to-release/dev17.2
Merge main to release/dev17.2
上级
be6a759c
e4eda128
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
99 addition
and
10 deletion
+99
-10
src/fsharp/IlxGen.fs
src/fsharp/IlxGen.fs
+6
-10
tests/fsharp/regression/4715/date.fs
tests/fsharp/regression/4715/date.fs
+27
-0
tests/fsharp/regression/4715/env.fs
tests/fsharp/regression/4715/env.fs
+36
-0
tests/fsharp/regression/4715/main.fs
tests/fsharp/regression/4715/main.fs
+25
-0
tests/fsharp/tests.fs
tests/fsharp/tests.fs
+5
-0
未找到文件。
src/fsharp/IlxGen.fs
浏览文件 @
31803ec2
...
...
@@ -1250,16 +1250,12 @@ let ComputeFieldSpecForVal(optIntraAssemblyInfo: IlxGenIntraAssemblyInfo option,
match
optIntraAssemblyInfo
with
|
None
->
generate
()
|
Some
intraAssemblyInfo
->
if
vspec
.
IsMutable
&&
vspec
.
IsCompiledAsTopLevel
&&
isStructTy
g
vspec
.
Type
then
let
ok
,
res
=
intraAssemblyInfo
.
StaticFieldInfo
.
TryGetValue
ilGetterMethRef
if
ok
then
res
else
let
res
=
generate
()
intraAssemblyInfo
.
StaticFieldInfo
.[
ilGetterMethRef
]
<-
res
res
else
generate
()
match
intraAssemblyInfo
.
StaticFieldInfo
.
TryGetValue
ilGetterMethRef
with
|
true
,
res
->
res
|
_
->
let
res
=
generate
()
intraAssemblyInfo
.
StaticFieldInfo
.[
ilGetterMethRef
]
<-
res
res
/// Compute the representation information for an F#-declared value (not a member nor a function).
/// Mutable and literal static fields must have stable names and live in the "public" location
...
...
tests/fsharp/regression/4715/date.fs
0 → 100644
浏览文件 @
31803ec2
#
light
[<
RequireQualifiedAccess
>]
module
app
.
date
open
System
open
System
.
Threading
type
T
=
private
T
of
DateTime
let
mutable
private
_
today
=
None
let
set_today
(
dt
:
DateTime
)
=
Interlocked
.
Exchange
(&_
today
,
Some
(
T
dt
.
Date
))
let
today
()
=
match
_
today
with
|
Some
d
->
d
|
None
->
T
DateTime
.
Today
.
Date
let
yesterday
()
=
let
today
=
DateTime
.
Today
.
Date
T
(
today
-
TimeSpan
(
1
,
0
,
0
,
0
))
let
inline
private
unwrap
(
T
d
)
=
d
let
fromdt
(
dt
:
DateTime
)
=
T
dt
.
Date
let
year
d
=
(
unwrap
d
).
Year
tests/fsharp/regression/4715/env.fs
0 → 100644
浏览文件 @
31803ec2
#
light
[<
RequireQualifiedAccess
>]
module
app
.
env
open
System
//open System.Runtime.CompilerServices
open
System
.
Threading
let
mutable
private
_
processing_date
:
date
.
T
option
=
None
let
mutable
private
_
irs_received_date
:
date
.
T
option
=
None
//[<MethodImpl (MethodImplOptions.NoInlining)>]
let
set_processing_date
d
=
Interlocked
.
Exchange
(&_
processing_date
,
Some
d
)
//[<MethodImpl (MethodImplOptions.NoInlining)>]
let
set_irs_received_dt
d
=
Interlocked
.
Exchange
(&_
irs_received_date
,
Some
d
)
let
processing_date
()
=
match
_
processing_date
with
|
Some
d
->
d
|
None
->
date
.
fromdt
DateTime
.
Today
let
processing_year
()
=
let
d
=
processing_date
()
date
.
year
d
let
tax_year
()
=
let
yr
=
processing_year
()
yr
-
1
let
irs_received_date
()
=
_
irs_received_date
let
irs_received_date_exn
()
=
match
_
irs_received_date
with
|
Some
d
->
d
|
None
->
failwith
"env.irs_received_date uninitialized via set_irs_received_dt"
tests/fsharp/regression/4715/main.fs
0 → 100644
浏览文件 @
31803ec2
#
light
module
app
.
main
open
System
let
private
init_dates
rdate
pdate
=
match
rdate
with
|
Some
d
->
env
.
set_irs_received_dt
d
|>
ignore
|
None
->
()
match
pdate
with
|
Some
d
->
env
.
set_processing_date
d
|>
ignore
|
None
->
()
[<
EntryPoint
>]
let
main
argv
=
try
let
rdate
=
Some
(
date
.
yesterday
()
)
let
pdate
=
Some
(
date
.
today
()
)
init_dates
rdate
pdate
with
|
ex
->
eprintfn
"Unhandled exception: %s"
(
ex
.
ToString
()
)
;
exit
1
0
tests/fsharp/tests.fs
浏览文件 @
31803ec2
...
...
@@ -2143,6 +2143,11 @@ module RegressionTests =
[<
Test
>]
let
``12383-FSC_OPTIMIZED``
()
=
singleTestBuildAndRun
"regression/12383"
FSC_OPTIMIZED
[<
Test
>]
let
``4715-optimized``
()
=
let
cfg
=
testConfig
"regression/4715"
fsc
cfg
"%s -o:test.exe --optimize+"
cfg
.
fsc_flags
[
"date.fs"
;
"env.fs"
;
"main.fs"
]
#
if
NETCOREAPP
[<
Test
>]
let
``Large inputs 12322 fsc.dll 64-bit fsc.dll .NET SDK generating optimized code``
()
=
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录