Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
dotNET Platform
fsharp
提交
446e6f3d
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,发现更多精彩内容 >>
未验证
提交
446e6f3d
编写于
9月 21, 2018
作者:
D
dotnet-automerge-bot
提交者:
GitHub
9月 21, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #5688 from Microsoft/merges/master-to-dev16.0
Merge master to dev16.0
上级
b0d4d77c
99221473
变更
6
展开全部
隐藏空白更改
内联
并排
Showing
6 changed file
with
205 addition
and
39 deletion
+205
-39
src/fsharp/NameResolution.fs
src/fsharp/NameResolution.fs
+44
-38
tests/fsharpqa/Source/Conformance/StructFieldEqualityComparison/comparebsl.cmd
.../Conformance/StructFieldEqualityComparison/comparebsl.cmd
+8
-0
tests/fsharpqa/Source/Conformance/StructFieldEqualityComparison/env.lst
.../Source/Conformance/StructFieldEqualityComparison/env.lst
+1
-0
tests/fsharpqa/Source/Conformance/StructFieldEqualityComparison/floatsanddoubles.exe.bsl
...ce/StructFieldEqualityComparison/floatsanddoubles.exe.bsl
+112
-0
tests/fsharpqa/Source/Conformance/StructFieldEqualityComparison/floatsanddoubles.fs
...ormance/StructFieldEqualityComparison/floatsanddoubles.fs
+39
-0
tests/fsharpqa/Source/test.lst
tests/fsharpqa/Source/test.lst
+1
-1
未找到文件。
src/fsharp/NameResolution.fs
浏览文件 @
446e6f3d
...
...
@@ -3691,9 +3691,10 @@ let InfosForTyconConstructors (ncenv:NameResolver) m ad (tcref:TyconRef) =
|
Item
.
CtorGroup
(
nm
,
ctorInfos
)
->
let
ctors
=
ctorInfos
|>
List
.
filter
(
IsMethInfoAccessible
amap
m
ad
)
|>
List
.
filter
(
MethInfoIsUnseen
g
m
ty
>>
not
)
match
ctors
with
|>
List
.
filter
(
fun
minfo
->
IsMethInfoAccessible
amap
m
ad
minfo
&&
not
(
MethInfoIsUnseen
g
m
ty
minfo
))
match
ctors
with
|
[]
->
[]
|
_
->
[
Item
.
MakeCtorGroup
(
nm
,
ctors
)]
|
item
->
...
...
@@ -3761,9 +3762,9 @@ let rec ResolvePartialLongIdentInModuleOrNamespace (ncenv: NameResolver) nenv is
match
plid
with
|
[]
->
let
tycons
=
mty
.
TypeDefinitions
|>
List
.
filter
(
fun
tcref
->
not
(
tcref
.
LogicalName
.
Contains
(
","
)))
|>
List
.
filter
(
fun
tycon
->
not
(
IsTyconUnseen
ad
g
ncenv
.
amap
m
(
modref
.
NestedTyconRef
tycon
)))
mty
.
TypeDefinitions
|>
List
.
filter
(
fun
tcref
->
not
(
tcref
.
LogicalName
.
Contains
(
","
))
&&
not
(
IsTyconUnseen
ad
g
ncenv
.
amap
m
(
modref
.
NestedTyconRef
tcref
)))
let
accessibleSubModules
=
let
moduleOrNamespaces
=
...
...
@@ -3779,16 +3780,16 @@ let rec ResolvePartialLongIdentInModuleOrNamespace (ncenv: NameResolver) nenv is
let
demangledName
=
x
.
DemangledModuleOrNamespaceName
notFakeContainerModule
ilTyconNames
demangledName
&&
IsInterestingModuleName
demangledName
)
|>
List
.
map
modref
.
NestedTyconRef
|>
List
.
filter
(
IsTyconUnseen
ad
g
ncenv
.
amap
m
>>
not
)
|>
List
.
filter
(
EntityRefContainsSomethingAccessible
ncenv
m
ad
)
|>
List
.
filter
(
fun
tyref
->
not
(
IsTyconUnseen
ad
g
ncenv
.
amap
m
tyref
)
&&
EntityRefContainsSomethingAccessible
ncenv
m
ad
tyref
)
|>
List
.
map
ItemForModuleOrNamespaceRef
// Collect up the accessible values in the module, excluding the members
(
mty
.
AllValsAndMembers
|>
Seq
.
toList
|>
List
.
choose
(
TryMkValRefInModRef
modref
)
// if the assembly load set is incomplete and we get a None value here, then ignore the value
|>
List
.
filter
(
fun
v
->
not
v
.
IsMember
)
|>
List
.
filter
(
IsValUnseen
ad
g
m
>>
not
)
|>
List
.
filter
(
fun
vref
->
not
vref
.
IsMember
&&
not
(
IsValUnseen
ad
g
m
vref
))
|>
List
.
map
Item
.
Value
)
// Collect up the accessible discriminated union cases in the module
...
...
@@ -3910,18 +3911,19 @@ let rec ResolvePartialLongIdentPrim (ncenv: NameResolver) (nenv: NameResolutionE
let
ilTyconNames
=
getFakeContainerModulesFromTyconRefs
(
nenv
.
TyconsByAccessNames
(
fullyQualified
).
Values
)
moduleOrNamespaceRefs
|>
List
.
filter
(
fun
x
->
let
demangledName
=
x
.
DemangledModuleOrNamespaceName
IsInterestingModuleName
demangledName
&&
notFakeContainerModule
ilTyconNames
demangledName
)
|>
List
.
filter
(
EntityRefContainsSomethingAccessible
ncenv
m
ad
)
|>
List
.
filter
(
IsTyconUnseen
ad
g
ncenv
.
amap
m
>>
not
)
|>
List
.
filter
(
fun
modref
->
let
demangledName
=
modref
.
DemangledModuleOrNamespaceName
IsInterestingModuleName
demangledName
&&
notFakeContainerModule
ilTyconNames
demangledName
&&
EntityRefContainsSomethingAccessible
ncenv
m
ad
modref
&&
not
(
IsTyconUnseen
ad
g
ncenv
.
amap
m
modref
)
)
|>
List
.
map
ItemForModuleOrNamespaceRef
let
tycons
=
nenv
.
TyconsByDemangledNameAndArity
(
fullyQualified
).
Values
|>
List
.
filter
(
fun
tcref
->
not
(
tcref
.
LogicalName
.
Contains
(
","
)))
|>
List
.
filter
(
fun
tcref
->
not
tcref
.
IsExceptionDecl
)
|>
List
.
filter
(
IsTyconUnseen
ad
g
ncenv
.
amap
m
>>
not
)
|>
List
.
filter
(
fun
tcref
->
not
(
tcref
.
LogicalName
.
Contains
(
","
))
&&
not
tcref
.
IsExceptionDecl
&&
not
(
IsTyconUnseen
ad
g
ncenv
.
amap
m
tcref
))
|>
List
.
map
(
ItemOfTyconRef
ncenv
m
)
// Get all the constructors accessible from here
...
...
@@ -3979,9 +3981,10 @@ let rec ResolvePartialLongIdentInModuleOrNamespaceForRecordFields (ncenv: NameRe
// get record type constructors
let
tycons
=
mty
.
TypeDefinitions
|>
List
.
filter
(
fun
tcref
->
not
(
tcref
.
LogicalName
.
Contains
(
","
)))
|>
List
.
filter
(
fun
tycon
->
tycon
.
IsRecordTycon
)
|>
List
.
filter
(
fun
tycon
->
not
(
IsTyconUnseen
ad
g
ncenv
.
amap
m
(
modref
.
NestedTyconRef
tycon
)))
|>
List
.
filter
(
fun
tcref
->
not
(
tcref
.
LogicalName
.
Contains
(
","
))
&&
tcref
.
IsRecordTycon
&&
not
(
IsTyconUnseen
ad
g
ncenv
.
amap
m
(
modref
.
NestedTyconRef
tcref
)))
let
accessibleSubModules
=
...
...
@@ -3994,12 +3997,13 @@ let rec ResolvePartialLongIdentInModuleOrNamespaceForRecordFields (ncenv: NameRe
let
ilTyconNames
=
getFakeContainerModulesFromTycons
mty
.
TypesByAccessNames
.
Values
moduleOrNamespaces
|>
List
.
filter
(
fun
x
->
|>
List
.
filter
(
fun
x
->
let
demangledName
=
x
.
DemangledModuleOrNamespaceName
notFakeContainerModule
ilTyconNames
demangledName
&&
IsInterestingModuleName
demangledName
)
|>
List
.
map
modref
.
NestedTyconRef
|>
List
.
filter
(
IsTyconUnseen
ad
g
ncenv
.
amap
m
>>
not
)
|>
List
.
filter
(
EntityRefContainsSomethingAccessible
ncenv
m
ad
)
|>
List
.
filter
(
fun
tcref
->
not
(
IsTyconUnseen
ad
g
ncenv
.
amap
m
tcref
)
&&
EntityRefContainsSomethingAccessible
ncenv
m
ad
tcref
)
|>
List
.
map
ItemForModuleOrNamespaceRef
accessibleSubModules
...
...
@@ -4066,18 +4070,19 @@ and ResolvePartialLongIdentToClassOrRecdFieldsImpl (ncenv: NameResolver) (nenv:
let
ilTyconNames
=
getFakeContainerModulesFromTyconRefs
(
nenv
.
TyconsByAccessNames
(
fullyQualified
).
Values
)
moduleOrNamespaceRefs
|>
List
.
filter
(
fun
x
->
let
demangledName
=
x
.
DemangledModuleOrNamespaceName
IsInterestingModuleName
demangledName
&&
notFakeContainerModule
ilTyconNames
demangledName
)
|>
List
.
filter
(
EntityRefContainsSomethingAccessible
ncenv
m
ad
)
|>
List
.
filter
(
IsTyconUnseen
ad
g
ncenv
.
amap
m
>>
not
)
|>
List
.
filter
(
fun
modref
->
let
demangledName
=
modref
.
DemangledModuleOrNamespaceName
IsInterestingModuleName
demangledName
&&
notFakeContainerModule
ilTyconNames
demangledName
&&
EntityRefContainsSomethingAccessible
ncenv
m
ad
modref
&&
not
(
IsTyconUnseen
ad
g
ncenv
.
amap
m
modref
)
)
|>
List
.
map
ItemForModuleOrNamespaceRef
let
recdTyCons
=
nenv
.
TyconsByDemangledNameAndArity
(
fullyQualified
).
Values
|>
List
.
filter
(
fun
tcref
->
not
(
tcref
.
LogicalName
.
Contains
(
","
)))
|>
List
.
filter
(
fun
tcref
->
tcref
.
IsRecordTycon
)
|>
List
.
filter
(
IsTyconUnseen
ad
g
ncenv
.
amap
m
>>
not
)
|>
List
.
filter
(
fun
tcref
->
not
(
tcref
.
LogicalName
.
Contains
(
","
))
&&
tcref
.
IsRecordTycon
&&
not
(
IsTyconUnseen
ad
g
ncenv
.
amap
m
tcref
))
|>
List
.
map
(
ItemOfTyconRef
ncenv
m
)
let
recdFields
=
...
...
@@ -4343,8 +4348,7 @@ let rec ResolvePartialLongIdentInModuleOrNamespaceForItem (ncenv: NameResolver)
mty
.
AllValsAndMembers
|>
Seq
.
toList
|>
List
.
choose
(
TryMkValRefInModRef
modref
)
// if the assembly load set is incomplete and we get a None value here, then ignore the value
|>
List
.
filter
(
fun
v
->
not
v
.
IsMember
)
|>
List
.
filter
(
IsValUnseen
ad
g
m
>>
not
)
|>
List
.
filter
(
fun
vref
->
not
vref
.
IsMember
&&
not
(
IsValUnseen
ad
g
m
vref
))
|>
List
.
map
Item
.
Value
|
Item
.
UnionCase
_
->
// Collect up the accessible discriminated union cases in the module
...
...
@@ -4384,14 +4388,16 @@ let rec ResolvePartialLongIdentInModuleOrNamespaceForItem (ncenv: NameResolver)
let
demangledName
=
x
.
DemangledModuleOrNamespaceName
notFakeContainerModule
ilTyconNames
demangledName
&&
IsInterestingModuleName
demangledName
)
|>
List
.
map
modref
.
NestedTyconRef
|>
List
.
filter
(
IsTyconUnseen
ad
g
ncenv
.
amap
m
>>
not
)
|>
List
.
filter
(
EntityRefContainsSomethingAccessible
ncenv
m
ad
)
|>
List
.
filter
(
fun
tcref
->
not
(
IsTyconUnseen
ad
g
ncenv
.
amap
m
tcref
)
&&
EntityRefContainsSomethingAccessible
ncenv
m
ad
tcref
)
|>
List
.
map
ItemForModuleOrNamespaceRef
let
tycons
=
mty
.
TypeDefinitions
|>
List
.
filter
(
fun
tcref
->
not
(
tcref
.
LogicalName
.
Contains
(
","
)))
|>
List
.
filter
(
fun
tycon
->
not
(
IsTyconUnseen
ad
g
ncenv
.
amap
m
(
modref
.
NestedTyconRef
tycon
)))
|>
List
.
filter
(
fun
tcref
->
not
(
tcref
.
LogicalName
.
Contains
(
","
))
&&
not
(
IsTyconUnseen
ad
g
ncenv
.
amap
m
(
modref
.
NestedTyconRef
tcref
)))
// Get all the types and .NET constructor groups accessible from here
let
nestedTycons
=
tycons
|>
List
.
map
modref
.
NestedTyconRef
...
...
tests/fsharpqa/Source/Conformance/StructFieldEqualityComparison/comparebsl.cmd
0 → 100644
浏览文件 @
446e6f3d
REM == %1 --> assembly
%
1
>
%
1
.out
echo
..\..\..\testenv\bin\ILComparer.exe
"
%
1.bsl"
"
%
1.out"
..\..\..\testenv\bin\ILComparer.exe
"
%
1.bsl"
"
%
1.out"
exit
/b
%ERRORLEVEL%
tests/fsharpqa/Source/Conformance/StructFieldEqualityComparison/env.lst
0 → 100644
浏览文件 @
446e6f3d
SOURCE=floatsanddoubles.fs SCFLAGS="-g --out:floatsanddoubles.exe" COMPILE_ONLY=1 POSTCMD="comparebsl.cmd floatsanddoubles.exe" # floatsanddoubles.fs
tests/fsharpqa/Source/Conformance/StructFieldEqualityComparison/floatsanddoubles.exe.bsl
0 → 100644
浏览文件 @
446e6f3d
此差异已折叠。
点击以展开。
tests/fsharpqa/Source/Conformance/StructFieldEqualityComparison/floatsanddoubles.fs
0 → 100644
浏览文件 @
446e6f3d
// ===========================================================================================================================
// Test case for GenericEqualityERFast with floats/doubles
// Ensures that matrix of values evaluate to the same values as the shipping compiler
// ===========================================================================================================================
module
floatsanddoubles
open
System
open
System
type
Float
=
struct
val
F
:
float
new
(
f
:
float
)
=
{
F
=
f
}
end
type
Double
=
struct
val
D
:
double
new
(
d
:
double
)
=
{
D
=
d
}
end
let
floats
=
[|
Float
(
Double
.
Epsilon
);
Float
(
Double
.
MinValue
);
Float
(
Double
.
MaxValue
);
Float
(
Double
.
NegativeInfinity
);
Float
(
Double
.
PositiveInfinity
);
Float
(
Double
.
NaN
);
Float
(
7
.
0
)|]
let
doubles
=
[|
Double
(
Double
.
Epsilon
);
Double
(
Double
.
MinValue
);
Double
(
Double
.
MaxValue
);
Double
(
Double
.
NegativeInfinity
);
Double
(
Double
.
PositiveInfinity
);
Double
(
Double
.
NaN
);
Double
(
7
.
0
)|]
let
names
=
[|
"Epsilon"
;
"MinValue"
;
"MaxValue"
;
"NegativeInfinity"
;
"PositiveInfinity"
;
"NaN"
;
"Number"
|]
[<
EntryPoint
>]
let
main
argv
=
for
i
in
0
..
doubles
.
Length
-
1
do
for
j
in
0
..
doubles
.
Length
-
1
do
printfn
"Doubles: %-17s = %-17s is: %-5b Values %f = %f"
(
names
.[
i
])
(
names
.[
j
])
(
doubles
.[
i
].
Equals
(
doubles
.[
j
]))
(
doubles
.[
i
].
D
)
(
doubles
.[
j
].
D
)
printfn
""
for
i
in
0
..
floats
.
Length
-
1
do
for
j
in
0
..
floats
.
Length
-
1
do
printfn
"Floats: %-17s = %-17s is: %-5b Values %f = %f"
(
names
.[
i
])
(
names
.[
j
])
(
floats
.[
i
].
Equals
(
floats
.[
j
]))
(
floats
.[
i
].
F
)
(
floats
.[
j
].
F
)
printfn
""
0
// return an integer exit code
tests/fsharpqa/Source/test.lst
浏览文件 @
446e6f3d
...
...
@@ -69,7 +69,6 @@ CompilerOptions01,NoMT CompilerOptions\fsi\times
CompilerOptions02,NoMT CompilerOptions\fsi\exename
CompilerOptions01,NoMT,Determinism CompilerOptions\fsc\determinism
Conformance01 Conformance\BasicGrammarElements\Constants
Conformance01 Conformance\BasicGrammarElements\OperatorNames
Conformance01 Conformance\BasicGrammarElements\PrecedenceAndOperators
...
...
@@ -228,6 +227,7 @@ Conformance08 Conformance\Signatures\SignatureConformance
Conformance08 Conformance\Signatures\SignatureTypes
Conformance08 Conformance\SpecialAttributesAndTypes\Imported\System.ThreadStatic
Conformance08 Conformance\SpecialAttributesAndTypes\Imported\CallerInfo
Conformance08 Conformance\StructFieldEqualityComparison
Conformance08 Conformance\TypesAndTypeConstraints\CheckingSyntacticTypes
Conformance08 Conformance\TypesAndTypeConstraints\LogicalPropertiesOfTypes
Conformance08 Conformance\TypesAndTypeConstraints\TypeConstraints
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录