Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
dotNET Platform
fsharp
提交
8cbbd29f
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,发现更多精彩内容 >>
提交
8cbbd29f
编写于
10月 25, 2022
作者:
D
Don Syme
浏览文件
操作
浏览文件
下载
差异文件
Merge commit '
e05bdc2d
' into feature/nullness
上级
9334dbe1
e05bdc2d
变更
27
展开全部
隐藏空白更改
内联
并排
Showing
27 changed file
with
9598 addition
and
51 deletion
+9598
-51
azure-pipelines.yml
azure-pipelines.yml
+44
-0
src/Compiler/Checking/CheckExpressions.fs
src/Compiler/Checking/CheckExpressions.fs
+2
-1
src/Compiler/Checking/NicePrint.fs
src/Compiler/Checking/NicePrint.fs
+1
-1
src/Compiler/Service/ServiceParseTreeWalk.fs
src/Compiler/Service/ServiceParseTreeWalk.fs
+7
-2
src/Compiler/Service/ServiceParsedInputOps.fs
src/Compiler/Service/ServiceParsedInputOps.fs
+19
-4
src/Compiler/SyntaxTree/SyntaxTree.fs
src/Compiler/SyntaxTree/SyntaxTree.fs
+4
-1
src/Compiler/SyntaxTree/SyntaxTree.fsi
src/Compiler/SyntaxTree/SyntaxTree.fsi
+8
-0
src/Compiler/pars.fsy
src/Compiler/pars.fsy
+12
-5
src/FSharp.Core/FSharp.Core.fsproj
src/FSharp.Core/FSharp.Core.fsproj
+2
-0
src/FSharp.Core/ILLink.LinkAttributes.xml
src/FSharp.Core/ILLink.LinkAttributes.xml
+167
-0
src/FSharp.Core/ILLink.Substitutions.xml
src/FSharp.Core/ILLink.Substitutions.xml
+8
-0
tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected
...s/FSharp.CompilerService.SurfaceArea.netstandard.expected
+15
-0
tests/fsharp/core/load-script/out.stdout.bsl
tests/fsharp/core/load-script/out.stdout.bsl
+1
-3
tests/fsharp/core/printing/output.1000.stdout.bsl
tests/fsharp/core/printing/output.1000.stdout.bsl
+1
-5
tests/fsharp/core/printing/output.200.stdout.bsl
tests/fsharp/core/printing/output.200.stdout.bsl
+1
-5
tests/fsharp/core/printing/output.47.stdout.bsl
tests/fsharp/core/printing/output.47.stdout.bsl
+2
-6
tests/fsharp/core/printing/output.multiemit.stdout.bsl
tests/fsharp/core/printing/output.multiemit.stdout.bsl
+2
-6
tests/fsharp/core/printing/output.off.stdout.bsl
tests/fsharp/core/printing/output.off.stdout.bsl
+1
-5
tests/fsharp/core/printing/output.stdout.bsl
tests/fsharp/core/printing/output.stdout.bsl
+2
-6
tests/projects/SelfContained_Trimming_Test/NuGet.Config
tests/projects/SelfContained_Trimming_Test/NuGet.Config
+16
-0
tests/projects/SelfContained_Trimming_Test/Program.fs
tests/projects/SelfContained_Trimming_Test/Program.fs
+9079
-0
tests/projects/SelfContained_Trimming_Test/SelfContained_Trimming_Test.fsproj
...ontained_Trimming_Test/SelfContained_Trimming_Test.fsproj
+40
-0
tests/projects/SelfContained_Trimming_Test/check.cmd
tests/projects/SelfContained_Trimming_Test/check.cmd
+2
-0
tests/projects/SelfContained_Trimming_Test/check.ps1
tests/projects/SelfContained_Trimming_Test/check.ps1
+23
-0
tests/service/SyntaxTreeTests/SignatureTypeTests.fs
tests/service/SyntaxTreeTests/SignatureTypeTests.fs
+41
-0
tests/service/SyntaxTreeTests/TypeTests.fs
tests/service/SyntaxTreeTests/TypeTests.fs
+70
-0
tests/service/SyntaxTreeTests/UnionCaseTests.fs
tests/service/SyntaxTreeTests/UnionCaseTests.fs
+28
-1
未找到文件。
azure-pipelines.yml
浏览文件 @
8cbbd29f
...
...
@@ -605,6 +605,50 @@ stages:
DOTNET_ROLL_FORWARD_TO_PRERELEASE
:
1
displayName
:
Regular rebuild of FSharp.Compiler.Service.sln
# Test trimming on Windows
-
job
:
Build_And_Test_Trimming_Windows
pool
:
name
:
NetCore-Public
demands
:
ImageOverride -equals $(WindowsMachineQueueName)
strategy
:
maxParallel
:
2
matrix
:
compressed_metadata
:
_kind
:
"
-compressAllMetadata"
classic_metadata
:
_kind
:
"
"
variables
:
-
name
:
_BuildConfig
value
:
Release
steps
:
-
checkout
:
self
clean
:
true
-
task
:
UseDotNet@2
displayName
:
install SDK
inputs
:
packageType
:
sdk
useGlobalJson
:
true
includePreviewVersions
:
true
workingDirectory
:
$(Build.SourcesDirectory)
installationPath
:
$(Agent.ToolsDirectory)/dotnet
-
script
:
dotnet --list-sdks
displayName
:
Report dotnet SDK versions
-
script
:
.\Build.cmd $(_kind) -pack -c $(_BuildConfig)
displayName
:
Initial build and prepare packages.
-
script
:
dotnet publish -c $(_BuildConfig) -bl:\"./bin/$(_BuildConfig)/net7.0/win-x64/publish/Trimming.binlog\"
displayName
:
Build and publish a trim test package.
workingDirectory
:
$(Build.SourcesDirectory)/tests/projects/SelfContained_Trimming_Test
-
script
:
.\check.cmd
displayName
:
Check the state of the trimmed app.
workingDirectory
:
$(Build.SourcesDirectory)/tests/projects/SelfContained_Trimming_Test
-
task
:
PublishPipelineArtifact@1
displayName
:
Publish Trim Tests Logs
inputs
:
targetPath
:
'
$(Build.SourcesDirectory)/tests/projects/SelfContained_Trimming_Test/bin/$(_BuildConfig)/net7.0/win-x64/publish'
artifactName
:
'
Trim
Test
Logs
Attempt
$(System.JobAttempt)
Logs
$(_kind)'
continueOnError
:
true
condition
:
always()
# Arcade-powered source build
# turned off until https://github.com/dotnet/source-build/issues/1795 is fixed
# - template: /eng/common/templates/jobs/jobs.yml
...
...
src/Compiler/Checking/CheckExpressions.fs
浏览文件 @
8cbbd29f
...
...
@@ -4391,7 +4391,8 @@ and TcTypeOrMeasure kindOpt (cenv: cenv) newOk checkConstraints occ (iwsam: Warn
| SynType.App(arg1, _, args, _, _, postfix, m) ->
TcTypeMeasureApp kindOpt cenv newOk checkConstraints occ env tpenv arg1 args postfix m
| SynType.Paren(innerType, _) ->
| SynType.Paren(innerType, _)
| SynType.SignatureParameter(usedType = innerType) ->
TcTypeOrMeasure kindOpt cenv newOk checkConstraints occ iwsam env tpenv innerType
and CheckIWSAM (cenv: cenv) (env: TcEnv) checkConstraints iwsam m tcref =
...
...
src/Compiler/Checking/NicePrint.fs
浏览文件 @
8cbbd29f
...
...
@@ -2444,7 +2444,7 @@ module InferredSigPrinting =
wordL
(
tagKeyword
keyword
)
^^
sepListL
SepL
.
dot
pathL
match
expr
with
|
EmptyModuleOrNamespaces
mspecs
->
|
EmptyModuleOrNamespaces
mspecs
when
showHeader
->
List
.
map
emptyModuleOrNamespace
mspecs
|>
aboveListL
|
expr
->
imdefL
denv
expr
...
...
src/Compiler/Service/ServiceParseTreeWalk.fs
浏览文件 @
8cbbd29f
...
...
@@ -823,8 +823,13 @@ module SyntaxTraversal =
|
SynType
.
MeasureDivide
(
ty1
,
ty2
,
_)
->
[
ty1
;
ty2
]
|>
List
.
tryPick
(
traverseSynType
path
)
|
SynType
.
Tuple
(
path
=
segments
)
->
getTypeFromTuplePath
segments
|>
List
.
tryPick
(
traverseSynType
path
)
|
SynType
.
StaticConstantExpr
(
expr
,
_)
->
traverseSynExpr
[]
expr
|
SynType
.
Anon
_
->
None
|
_
->
None
|
SynType
.
Paren
(
innerType
=
t
)
|
SynType
.
SignatureParameter
(
usedType
=
t
)
->
traverseSynType
path
t
|
SynType
.
Anon
_
|
SynType
.
AnonRecd
_
|
SynType
.
LongIdent
_
|
SynType
.
Var
_
|
SynType
.
StaticConstant
_
->
None
visitor
.
VisitType
(
origPath
,
defaultTraverse
,
ty
)
...
...
src/Compiler/Service/ServiceParsedInputOps.fs
浏览文件 @
8cbbd29f
...
...
@@ -670,8 +670,15 @@ module ParsedInput =
|
SynType
.
HashConstraint
(
t
,
_)
->
walkType
t
|
SynType
.
MeasureDivide
(
t1
,
t2
,
_)
->
walkType
t1
|>
Option
.
orElseWith
(
fun
()
->
walkType
t2
)
|
SynType
.
MeasurePower
(
t
,
_,
_)
->
walkType
t
|
SynType
.
Paren
(
t
,
_)
->
walkType
t
|
_
->
None
|
SynType
.
Paren
(
t
,
_)
|
SynType
.
SignatureParameter
(
usedType
=
t
)
->
walkType
t
|
SynType
.
StaticConstantExpr
(
e
,
_)
->
walkExpr
e
|
SynType
.
StaticConstantNamed
(
ident
,
value
,
_)
->
List
.
tryPick
walkType
[
ident
;
value
]
|
SynType
.
Anon
_
|
SynType
.
AnonRecd
_
|
SynType
.
LongIdent
_
|
SynType
.
Var
_
|
SynType
.
StaticConstant
_
->
None
and
walkClause
clause
=
let
(
SynMatchClause
(
pat
=
pat
;
whenExpr
=
e1
;
resultExpr
=
e2
))
=
clause
...
...
@@ -1663,7 +1670,8 @@ module ParsedInput =
|
SynType
.
Array
(_,
t
,
_)
|
SynType
.
HashConstraint
(
t
,
_)
|
SynType
.
MeasurePower
(
t
,
_,
_)
|
SynType
.
Paren
(
t
,
_)
->
walkType
t
|
SynType
.
Paren
(
t
,
_)
|
SynType
.
SignatureParameter
(
usedType
=
t
)
->
walkType
t
|
SynType
.
Fun
(
argType
=
t1
;
returnType
=
t2
)
|
SynType
.
MeasureDivide
(
t1
,
t2
,
_)
->
walkType
t1
...
...
@@ -1677,7 +1685,14 @@ module ParsedInput =
|
SynType
.
WithGlobalConstraints
(
t
,
typeConstraints
,
_)
->
walkType
t
List
.
iter
walkTypeConstraint
typeConstraints
|
_
->
()
|
SynType
.
StaticConstantExpr
(
e
,
_)
->
walkExpr
e
|
SynType
.
StaticConstantNamed
(
ident
,
value
,
_)
->
walkType
ident
walkType
value
|
SynType
.
Anon
_
|
SynType
.
AnonRecd
_
|
SynType
.
Var
_
|
SynType
.
StaticConstant
_
->
()
and
walkClause
(
SynMatchClause
(
pat
=
pat
;
whenExpr
=
e1
;
resultExpr
=
e2
))
=
walkPat
pat
...
...
src/Compiler/SyntaxTree/SyntaxTree.fs
浏览文件 @
8cbbd29f
...
...
@@ -442,6 +442,8 @@ type SynType =
|
Paren
of
innerType
:
SynType
*
range
:
range
|
SignatureParameter
of
attributes
:
SynAttributes
*
optional
:
bool
*
id
:
Ident
option
*
usedType
:
SynType
*
range
:
range
member
x
.
Range
=
match
x
with
|
SynType
.
App
(
range
=
m
)
...
...
@@ -461,7 +463,8 @@ type SynType =
|
SynType
.
WithNull
(
range
=
m
)
|
SynType
.
MeasureDivide
(
range
=
m
)
|
SynType
.
MeasurePower
(
range
=
m
)
|
SynType
.
Paren
(
range
=
m
)
->
m
|
SynType
.
Paren
(
range
=
m
)
|
SynType
.
SignatureParameter
(
range
=
m
)
->
m
|
SynType
.
LongIdent
lidwd
->
lidwd
.
Range
[<
NoEquality
;
NoComparison
;
RequireQualifiedAccess
>]
...
...
src/Compiler/SyntaxTree/SyntaxTree.fsi
浏览文件 @
8cbbd29f
...
...
@@ -518,6 +518,14 @@ type SynType =
|
Paren
of
innerType
:
SynType
*
range
:
range
/// F# syntax: a: b, used in signatures and type annotations
|
SignatureParameter
of
attributes
:
SynAttributes
*
optional
:
bool
*
id
:
Ident
option
*
usedType
:
SynType
*
range
:
range
/// Gets the syntax range of this construct
member
Range
:
range
...
...
src/Compiler/pars.fsy
浏览文件 @
8cbbd29f
...
...
@@ -5090,22 +5090,29 @@ topTupleTypeElements:
topAppType:
| attributes appType COLON appType
{ match $2 with
| SynType.LongIdent(SynLongIdent([id], _, _)) -> $4, SynArgInfo($1, false, Some id)
| SynType.LongIdent(SynLongIdent([id], _, _)) ->
let m = rhs2 parseState 1 4
SynType.SignatureParameter($1, false, Some id, $4, m), SynArgInfo($1, false, Some id)
| _ -> raiseParseErrorAt (rhs parseState 2) (FSComp.SR.parsSyntaxErrorInLabeledType()) }
| attributes QMARK ident COLON appType
{ $5, SynArgInfo($1, true, Some $3) }
{ let m = rhs2 parseState 1 5
SynType.SignatureParameter($1, true, Some $3, $5, m), SynArgInfo($1, true, Some $3) }
| attributes appType
{ ($2, SynArgInfo($1, false, None)) }
{ let m = rhs2 parseState 1 2
SynType.SignatureParameter($1, false, None, $2, m), SynArgInfo($1, false, None) }
| appType COLON appType
{ match $1 with
| SynType.LongIdent(SynLongIdent([id], _, _)) -> $3, SynArgInfo([], false, Some id)
| SynType.LongIdent(SynLongIdent([id], _, _)) ->
let m = rhs2 parseState 1 3
SynType.SignatureParameter([], false, Some id, $3, m), SynArgInfo([], false, Some id)
| _ -> raiseParseErrorAt (rhs parseState 2) (FSComp.SR.parsSyntaxErrorInLabeledType()) }
| QMARK ident COLON appType
{ $4, SynArgInfo([], true, Some $2) }
{ let m = rhs2 parseState 1 4
SynType.SignatureParameter([], true, Some $2, $4, m), SynArgInfo([], true, Some $2) }
| appType
{ $1, SynArgInfo([], false, None) }
...
...
src/FSharp.Core/FSharp.Core.fsproj
浏览文件 @
8cbbd29f
...
...
@@ -61,6 +61,8 @@
<GeneratedModuleName>
Microsoft.FSharp.Core.SR
</GeneratedModuleName>
<Link>
FSCore.resx
</Link>
</EmbeddedResource>
<EmbeddedResource
Include=
"ILLink.LinkAttributes.xml"
LogicalName=
"ILLink.LinkAttributes.xml"
/>
<EmbeddedResource
Include=
"ILLink.Substitutions.xml"
LogicalName=
"ILLink.Substitutions.xml"
/>
<CompileBefore
Include=
"prim-types-prelude.fsi"
>
<Link>
Primitives/prim-types-prelude.fsi
</Link>
</CompileBefore>
...
...
src/FSharp.Core/ILLink.LinkAttributes.xml
0 → 100644
浏览文件 @
8cbbd29f
<linker>
<!--
Attributes listed below here should be behind the 'System.AggressiveAttributeTrimming' feature switch, which
is only enabled by default on app models that need as much size savings as possible.
-->
<assembly
fullname=
"FSharp.Core"
feature=
"System.AggressiveAttributeTrimming"
featurevalue=
"true"
>
<!-- Microsoft.FSharp.Core -->
<type
fullname=
"Microsoft.FSharp.Core.AbstractClassAttribute"
>
<attribute
internal=
"RemoveAttributeInstances"
/>
</type>
<type
fullname=
"Microsoft.FSharp.Core.AutoOpenAttribute"
>
<attribute
internal=
"RemoveAttributeInstances"
/>
</type>
<type
fullname=
"Microsoft.FSharp.Core.AutoSerializableAttribute"
>
<attribute
internal=
"RemoveAttributeInstances"
/>
</type>
<type
fullname=
"Microsoft.FSharp.Core.ClassAttribute"
>
<attribute
internal=
"RemoveAttributeInstances"
/>
</type>
<type
fullname=
"Microsoft.FSharp.Core.CLIEventAttribute"
>
<attribute
internal=
"RemoveAttributeInstances"
/>
</type>
<type
fullname=
"Microsoft.FSharp.Core.CLIMutableAttribute"
>
<attribute
internal=
"RemoveAttributeInstances"
/>
</type>
<type
fullname=
"Microsoft.FSharp.Core.ComparisonConditionalOnAttribute"
>
<attribute
internal=
"RemoveAttributeInstances"
/>
</type>
<type
fullname=
"Microsoft.FSharp.Core.CompilationArgumentCountsAttribute"
>
<attribute
internal=
"RemoveAttributeInstances"
/>
</type>
<type
fullname=
"Microsoft.FSharp.Core.CompilationSourceNameAttribute"
>
<attribute
internal=
"RemoveAttributeInstances"
/>
</type>
<type
fullname=
"Microsoft.FSharp.Core.CompiledNameAttribute"
>
<attribute
internal=
"RemoveAttributeInstances"
/>
</type>
<type
fullname=
"Microsoft.FSharp.Core.CompilerMessageAttribute"
>
<attribute
internal=
"RemoveAttributeInstances"
/>
</type>
<type
fullname=
"Microsoft.FSharp.Core.CustomComparisonAttribute"
>
<attribute
internal=
"RemoveAttributeInstances"
/>
</type>
<type
fullname=
"Microsoft.FSharp.Core.CustomEqualityAttribute"
>
<attribute
internal=
"RemoveAttributeInstances"
/>
</type>
<type
fullname=
"Microsoft.FSharp.Core.CustomOperationAttribute"
>
<attribute
internal=
"RemoveAttributeInstances"
/>
</type>
<type
fullname=
"Microsoft.FSharp.Core.DefaultAugmentationAttribute"
>
<attribute
internal=
"RemoveAttributeInstances"
/>
</type>
<type
fullname=
"Microsoft.FSharp.Core.DefaultValueAttribute"
>
<attribute
internal=
"RemoveAttributeInstances"
/>
</type>
<type
fullname=
"Microsoft.FSharp.Core.EntryPointAttribute"
>
<attribute
internal=
"RemoveAttributeInstances"
/>
</type>
<type
fullname=
"Microsoft.FSharp.Core.EqualityConditionalOnAttribute"
>
<attribute
internal=
"RemoveAttributeInstances"
/>
</type>
<type
fullname=
"Microsoft.FSharp.Core.ExperimentalAttribute"
>
<attribute
internal=
"RemoveAttributeInstances"
/>
</type>
<type
fullname=
"Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute"
>
<attribute
internal=
"RemoveAttributeInstances"
/>
</type>
<type
fullname=
"Microsoft.FSharp.Core.GeneralizableValueAttribute"
>
<attribute
internal=
"RemoveAttributeInstances"
/>
</type>
<type
fullname=
"Microsoft.FSharp.Core.InlineIfLambdaAttribute"
>
<attribute
internal=
"RemoveAttributeInstances"
/>
</type>
<type
fullname=
"Microsoft.FSharp.Core.FSharpInterfaceDataVersionLiteralAttribute"
>
<attribute
internal=
"RemoveAttributeInstances"
/>
</type>
<type
fullname=
"Microsoft.FSharp.Core.MeasureAnnotatedAbbreviationAttribute"
>
<attribute
internal=
"RemoveAttributeInstances"
/>
</type>
<type
fullname=
"Microsoft.FSharp.Core.MeasureAttribute"
>
<attribute
internal=
"RemoveAttributeInstances"
/>
</type>
<type
fullname=
"Microsoft.FSharp.Core.NoComparisonAttribute"
>
<attribute
internal=
"RemoveAttributeInstances"
/>
</type>
<type
fullname=
"Microsoft.FSharp.Core.NoDynamicInvocationAttribute"
>
<attribute
internal=
"RemoveAttributeInstances"
/>
</type>
<type
fullname=
"Microsoft.FSharp.Core.NoEqualityAttribute"
>
<attribute
internal=
"RemoveAttributeInstances"
/>
</type>
<type
fullname=
"Microsoft.FSharp.Core.OptionalArgumentAttribute"
>
<attribute
internal=
"RemoveAttributeInstances"
/>
</type>
<type
fullname=
"Microsoft.FSharp.Core.ProjectionParameterAttribute"
>
<attribute
internal=
"RemoveAttributeInstances"
/>
</type>
<type
fullname=
"Microsoft.FSharp.Core.ReferenceEqualityAttribute"
>
<attribute
internal=
"RemoveAttributeInstances"
/>
</type>
<type
fullname=
"Microsoft.FSharp.Core.ReflectedDefinitionAttribute"
>
<attribute
internal=
"RemoveAttributeInstances"
/>
</type>
<type
fullname=
"Microsoft.FSharp.Core.RequireQualifiedAccessAttribute"
>
<attribute
internal=
"RemoveAttributeInstances"
/>
</type>
<type
fullname=
"Microsoft.FSharp.Core.RequiresExplicitTypeArgumentsAttribute"
>
<attribute
internal=
"RemoveAttributeInstances"
/>
</type>
<type
fullname=
"Microsoft.FSharp.Core.SealedAttribute"
>
<attribute
internal=
"RemoveAttributeInstances"
/>
</type>
<type
fullname=
"Microsoft.FSharp.Core.StructAttribute"
>
<attribute
internal=
"RemoveAttributeInstances"
/>
</type>
<type
fullname=
"Microsoft.FSharp.Core.StructuralComparisonAttribute"
>
<attribute
internal=
"RemoveAttributeInstances"
/>
</type>
<type
fullname=
"Microsoft.FSharp.Core.StructuralEqualityAttribute"
>
<attribute
internal=
"RemoveAttributeInstances"
/>
</type>
<type
fullname=
"Microsoft.FSharp.Core.UnverifiableAttribute"
>
<attribute
internal=
"RemoveAttributeInstances"
/>
</type>
<type
fullname=
"Microsoft.FSharp.Core.ValueAsStaticPropertyAttribute"
>
<attribute
internal=
"RemoveAttributeInstances"
/>
</type>
<type
fullname=
"Microsoft.FSharp.Core.VolatileFieldAttribute"
>
<attribute
internal=
"RemoveAttributeInstances"
/>
</type>
<!-- The following attributes are accessed by FSharp.Core at runtime.
Removing them would cause behavior changes but the feature switch allows them. -->
<type
fullname=
"Microsoft.FSharp.Core.AllowNullLiteralAttribute"
>
<attribute
internal=
"RemoveAttributeInstances"
/>
</type>
<type
fullname=
"Microsoft.FSharp.Core.CompilationMappingAttribute"
>
<attribute
internal=
"RemoveAttributeInstances"
/>
</type>
<type
fullname=
"Microsoft.FSharp.Core.CompilationRepresentationAttribute"
>
<attribute
internal=
"RemoveAttributeInstances"
/>
</type>
<type
fullname=
"Microsoft.FSharp.Core.StructuredFormatDisplayAttribute"
>
<attribute
internal=
"RemoveAttributeInstances"
/>
</type>
<!-- Microsoft.FSharp.Core.CompilerServices -->
<type
fullname=
"Microsoft.FSharp.Core.CompilerServices.NoEagerConstraintApplicationAttribute"
>
<attribute
internal=
"RemoveAttributeInstances"
/>
</type>
<type
fullname=
"Microsoft.FSharp.Core.CompilerServices.TypeProviderAssemblyAttribute"
>
<attribute
internal=
"RemoveAttributeInstances"
/>
</type>
<type
fullname=
"Microsoft.FSharp.Core.CompilerServices.TypeProviderAttribute"
>
<attribute
internal=
"RemoveAttributeInstances"
/>
</type>
<type
fullname=
"Microsoft.FSharp.Core.CompilerServices.TypeProviderDefinitionLocationAttribute"
>
<attribute
internal=
"RemoveAttributeInstances"
/>
</type>
<type
fullname=
"Microsoft.FSharp.Core.CompilerServices.TypeProviderEditorHideMethodsAttribute"
>
<attribute
internal=
"RemoveAttributeInstances"
/>
</type>
<type
fullname=
"Microsoft.FSharp.Core.CompilerServices.TypeProviderXmlDocAttribute"
>
<attribute
internal=
"RemoveAttributeInstances"
/>
</type>
</assembly>
</linker>
\ No newline at end of file
src/FSharp.Core/ILLink.Substitutions.xml
0 → 100644
浏览文件 @
8cbbd29f
<linker>
<assembly
fullname=
"FSharp.Core"
>
<resource
name=
"FSharpOptimizationCompressedData.FSharp.Core"
action=
"remove"
/>
<resource
name=
"FSharpOptimizationInfo.FSharp.Core"
action=
"remove"
/>
<resource
name=
"FSharpSignatureCompressedData.FSharp.Core"
action=
"remove"
/>
<resource
name=
"FSharpSignatureInfo.FSharp.Core"
action=
"remove"
/>
</assembly>
</linker>
tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected
浏览文件 @
8cbbd29f
...
...
@@ -8483,6 +8483,16 @@ FSharp.Compiler.Syntax.SynType+Paren: FSharp.Compiler.Syntax.SynType get_innerTy
FSharp.Compiler.Syntax.SynType+Paren: FSharp.Compiler.Syntax.SynType innerType
FSharp.Compiler.Syntax.SynType+Paren: FSharp.Compiler.Text.Range get_range()
FSharp.Compiler.Syntax.SynType+Paren: FSharp.Compiler.Text.Range range
FSharp.Compiler.Syntax.SynType+SignatureParameter: Boolean get_optional()
FSharp.Compiler.Syntax.SynType+SignatureParameter: Boolean optional
FSharp.Compiler.Syntax.SynType+SignatureParameter: FSharp.Compiler.Syntax.SynType get_usedType()
FSharp.Compiler.Syntax.SynType+SignatureParameter: FSharp.Compiler.Syntax.SynType usedType
FSharp.Compiler.Syntax.SynType+SignatureParameter: FSharp.Compiler.Text.Range get_range()
FSharp.Compiler.Syntax.SynType+SignatureParameter: FSharp.Compiler.Text.Range range
FSharp.Compiler.Syntax.SynType+SignatureParameter: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList] attributes
FSharp.Compiler.Syntax.SynType+SignatureParameter: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList] get_attributes()
FSharp.Compiler.Syntax.SynType+SignatureParameter: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.Ident] get_id()
FSharp.Compiler.Syntax.SynType+SignatureParameter: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.Ident] id
FSharp.Compiler.Syntax.SynType+StaticConstant: FSharp.Compiler.Syntax.SynConst constant
FSharp.Compiler.Syntax.SynType+StaticConstant: FSharp.Compiler.Syntax.SynConst get_constant()
FSharp.Compiler.Syntax.SynType+StaticConstant: FSharp.Compiler.Text.Range get_range()
...
...
@@ -8508,6 +8518,7 @@ FSharp.Compiler.Syntax.SynType+Tags: Int32 LongIdentApp
FSharp.Compiler.Syntax.SynType+Tags: Int32 MeasureDivide
FSharp.Compiler.Syntax.SynType+Tags: Int32 MeasurePower
FSharp.Compiler.Syntax.SynType+Tags: Int32 Paren
FSharp.Compiler.Syntax.SynType+Tags: Int32 SignatureParameter
FSharp.Compiler.Syntax.SynType+Tags: Int32 StaticConstant
FSharp.Compiler.Syntax.SynType+Tags: Int32 StaticConstantExpr
FSharp.Compiler.Syntax.SynType+Tags: Int32 StaticConstantNamed
...
...
@@ -8541,6 +8552,7 @@ FSharp.Compiler.Syntax.SynType: Boolean IsLongIdentApp
FSharp.Compiler.Syntax.SynType: Boolean IsMeasureDivide
FSharp.Compiler.Syntax.SynType: Boolean IsMeasurePower
FSharp.Compiler.Syntax.SynType: Boolean IsParen
FSharp.Compiler.Syntax.SynType: Boolean IsSignatureParameter
FSharp.Compiler.Syntax.SynType: Boolean IsStaticConstant
FSharp.Compiler.Syntax.SynType: Boolean IsStaticConstantExpr
FSharp.Compiler.Syntax.SynType: Boolean IsStaticConstantNamed
...
...
@@ -8558,6 +8570,7 @@ FSharp.Compiler.Syntax.SynType: Boolean get_IsLongIdentApp()
FSharp.Compiler.Syntax.SynType: Boolean get_IsMeasureDivide()
FSharp.Compiler.Syntax.SynType: Boolean get_IsMeasurePower()
FSharp.Compiler.Syntax.SynType: Boolean get_IsParen()
FSharp.Compiler.Syntax.SynType: Boolean get_IsSignatureParameter()
FSharp.Compiler.Syntax.SynType: Boolean get_IsStaticConstant()
FSharp.Compiler.Syntax.SynType: Boolean get_IsStaticConstantExpr()
FSharp.Compiler.Syntax.SynType: Boolean get_IsStaticConstantNamed()
...
...
@@ -8575,6 +8588,7 @@ FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewLongIdentApp(F
FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewMeasureDivide(FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Text.Range)
FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewMeasurePower(FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Syntax.SynRationalConst, FSharp.Compiler.Text.Range)
FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewParen(FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Text.Range)
FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewSignatureParameter(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList], Boolean, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.Ident], FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Text.Range)
FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewStaticConstant(FSharp.Compiler.Syntax.SynConst, FSharp.Compiler.Text.Range)
FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewStaticConstantExpr(FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Text.Range)
FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewStaticConstantNamed(FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Text.Range)
...
...
@@ -8592,6 +8606,7 @@ FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+LongIdentApp
FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+MeasureDivide
FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+MeasurePower
FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+Paren
FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+SignatureParameter
FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+StaticConstant
FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+StaticConstantExpr
FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+StaticConstantNamed
...
...
tests/fsharp/core/load-script/out.stdout.bsl
浏览文件 @
8cbbd29f
...
...
@@ -16,9 +16,7 @@ World
-
the
end
Test
3
=================================================
>
module
FSI_0001
[
Loading
D
:
\
staging
\
staging
\
src
\
tests
\
fsharp
\
core
\
load
-
script
\
1
.
fsx
>
[
Loading
D
:
\
staging
\
staging
\
src
\
tests
\
fsharp
\
core
\
load
-
script
\
1
.
fsx
Loading
D
:
\
staging
\
staging
\
src
\
tests
\
fsharp
\
core
\
load
-
script
\
2
.
fsx
Loading
D
:
\
staging
\
staging
\
src
\
tests
\
fsharp
\
core
\
load
-
script
\
3
.
fsx
]
Hello
...
...
tests/fsharp/core/printing/output.1000.stdout.bsl
浏览文件 @
8cbbd29f
module
FSI_0001
>
val
it
:
unit
=
()
>
val
repeatId
:
string
=
"A"
...
...
@@ -236,9 +234,7 @@ module D1 =
val
words
:
System
.
Collections
.
Generic
.
IDictionary
<
string
,
int
>
val
words2000
:
System
.
Collections
.
Generic
.
IDictionary
<
int
,
string
>
>
module
FSI_0020
>
module
D2
=
>
>
module
D2
=
val
words
:
IDictionary
<
string
,
int
>
val
words2000
:
IDictionary
<
int
,
string
>
val
opt1
:
'
a
option
...
...
tests/fsharp/core/printing/output.200.stdout.bsl
浏览文件 @
8cbbd29f
module
FSI_0001
>
val
it
:
unit
=
()
>
val
repeatId
:
string
=
"A"
...
...
@@ -131,9 +129,7 @@ module D1 =
val
words
:
System
.
Collections
.
Generic
.
IDictionary
<
string
,
int
>
val
words2000
:
System
.
Collections
.
Generic
.
IDictionary
<
int
,
string
>
>
module
FSI_0020
>
module
D2
=
>
>
module
D2
=
val
words
:
IDictionary
<
string
,
int
>
val
words2000
:
IDictionary
<
int
,
string
>
val
opt1
:
'
a
option
...
...
tests/fsharp/core/printing/output.47.stdout.bsl
浏览文件 @
8cbbd29f
>
module
FSI_0001
val
repeatId
:
string
=
"A"
>
val
repeatId
:
string
=
"A"
>
val
repeatId
:
string
=
"B"
...
...
@@ -251,9 +249,7 @@ module D1 =
val
words
:
System
.
Collections
.
Generic
.
IDictionary
<
string
,
int
>
val
words2000
:
System
.
Collections
.
Generic
.
IDictionary
<
int
,
string
>
>
module
FSI_0019
>
module
D2
=
>
>
module
D2
=
val
words
:
IDictionary
<
string
,
int
>
val
words2000
:
IDictionary
<
int
,
string
>
val
opt1
:
'
a
option
...
...
tests/fsharp/core/printing/output.multiemit.stdout.bsl
浏览文件 @
8cbbd29f
>
module
FSI_0001
val
repeatId
:
string
=
"A"
>
val
repeatId
:
string
=
"A"
>
val
repeatId
:
string
=
"B"
...
...
@@ -251,9 +249,7 @@ module D1 =
val
words
:
System
.
Collections
.
Generic
.
IDictionary
<
string
,
int
>
val
words2000
:
System
.
Collections
.
Generic
.
IDictionary
<
int
,
string
>
>
module
FSI_0019
>
module
D2
=
>
>
module
D2
=
val
words
:
IDictionary
<
string
,
int
>
val
words2000
:
IDictionary
<
int
,
string
>
val
opt1
:
'
a
option
...
...
tests/fsharp/core/printing/output.off.stdout.bsl
浏览文件 @
8cbbd29f
module
FSI_0001
>
val
it
:
unit
=
()
>
val
repeatId
:
string
...
...
@@ -96,9 +94,7 @@ module D1 =
val
words
:
System
.
Collections
.
Generic
.
IDictionary
<
string
,
int
>
val
words2000
:
System
.
Collections
.
Generic
.
IDictionary
<
int
,
string
>
>
module
FSI_0020
>
module
D2
=
>
>
module
D2
=
val
words
:
IDictionary
<
string
,
int
>
val
words2000
:
IDictionary
<
int
,
string
>
val
opt1
:
'
a
option
...
...
tests/fsharp/core/printing/output.stdout.bsl
浏览文件 @
8cbbd29f
>
module
FSI_0001
val
repeatId
:
string
=
"A"
>
val
repeatId
:
string
=
"A"
>
val
repeatId
:
string
=
"B"
...
...
@@ -251,9 +249,7 @@ module D1 =
val
words
:
System
.
Collections
.
Generic
.
IDictionary
<
string
,
int
>
val
words2000
:
System
.
Collections
.
Generic
.
IDictionary
<
int
,
string
>
>
module
FSI_0019
>
module
D2
=
>
>
module
D2
=
val
words
:
IDictionary
<
string
,
int
>
val
words2000
:
IDictionary
<
int
,
string
>
val
opt1
:
'
a
option
...
...
tests/projects/SelfContained_Trimming_Test/NuGet.Config
0 → 100644
浏览文件 @
8cbbd29f
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
configuration
>
<
solution
>
<
add
key
=
"disableSourceControlIntegration"
value
=
"true"
/>
</
solution
>
<
packageSources
>
<
clear
/>
<
add
key
=
"localPackages"
value
=
"../../../artifacts/packages/Release/Release"
/>
</
packageSources
>
<
disabledPackageSources
>
<
clear
/>
</
disabledPackageSources
>
<
fallbackPackageFolders
>
<
clear
/>
</
fallbackPackageFolders
>
</
configuration
>
tests/projects/SelfContained_Trimming_Test/Program.fs
0 → 100644
浏览文件 @
8cbbd29f
此差异已折叠。
点击以展开。
tests/projects/SelfContained_Trimming_Test/SelfContained_Trimming_Test.fsproj
0 → 100644
浏览文件 @
8cbbd29f
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<LangVersion>preview</LangVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<DotNetBuildOffline>true</DotNetBuildOffline>
</PropertyGroup>
<PropertyGroup>
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
<PublishTrimmed>true</PublishTrimmed>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
</PropertyGroup>
<PropertyGroup>
<DotnetFscCompilerPath>$(MSBuildThisFileDirectory)../../../artifacts/bin/fsc/Release/net7.0/fsc.dll</DotnetFscCompilerPath>
<Fsc_DotNET_DotnetFscCompilerPath>$(MSBuildThisFileDirectory)../../../artifacts/bin/fsc/Release/net7.0/fsc.dll</Fsc_DotNET_DotnetFscCompilerPath>
<FSharpPreferNetFrameworkTools>False</FSharpPreferNetFrameworkTools>
<FSharpPrefer64BitTools>True</FSharpPrefer64BitTools>
</PropertyGroup>
<ItemGroup>
<Compile Include="Program.fs" />
</ItemGroup>
<Import Project="$(MSBuildThisFileDirectory)../../../eng/Versions.props" />
<PropertyGroup>
<RestoreSources>
$(MSBuildThisFileDirectory)/../../../artifacts/packages/Release/Release
</RestoreSources>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FSharp.Core" Version="$(FSCoreProductVersion).*"/>
</ItemGroup>
</Project>
tests/projects/SelfContained_Trimming_Test/check.cmd
0 → 100644
浏览文件 @
8cbbd29f
@echo
off
powershell
-ExecutionPolicy
ByPass
-NoProfile -command
"& """
%~dp0
check
.ps1
""""
tests/projects/SelfContained_Trimming_Test/check.ps1
0 → 100644
浏览文件 @
8cbbd29f
$output
=
.
\bin\Release\net7.0\win-x64\publish\SelfContained_Trimming_Test.exe
# Checking that it is actually running.
if
(
-not
(
$LASTEXITCODE
-eq
0
))
{
Write-Error
"Test failed with exit code
${LASTEXITCODE}
"
-ErrorAction
Stop
}
# Checking that the output is as expected.
$expected
=
"All tests passed"
if
(
-not
(
$output
-eq
$expected
))
{
Write-Error
"Test failed with unexpected output:
`n
Expected:
`n`t
${expected}
`n
Actual
`n`t
${output}
"
-ErrorAction
Stop
}
# Checking that FSharp.Core binary is of expected size (needs adjustments if test is updated).
$expected_len
=
2181119
# In bytes
$file
=
Get-Item
.
\bin\Release\net7.0\win-x64\publish\FSharp.Core.dll
$file_len
=
$file
.
Length
if
(
$file_len
-le
$expected_len
)
{
Write-Error
"Test failed with unexpected FSharp.Core length:
`n
Expected:
`n`t
${expected_len}
Bytes
`n
Actual:
`n`t
${file_len}
Bytes"
-ErrorAction
Stop
}
\ No newline at end of file
tests/service/SyntaxTreeTests/SignatureTypeTests.fs
浏览文件 @
8cbbd29f
...
...
@@ -471,3 +471,44 @@ type Z with
assertRange
(
14
,
0
)
(
14
,
4
)
mType3
assertRange
(
14
,
7
)
(
14
,
11
)
mWith3
|
_
->
Assert
.
Fail
$
"Could not get valid AST, got {parseResults}"
[<
Test
>]
let
``SynValSig contains parameter names``
()
=
let
parseResults
=
getParseResultsOfSignatureFile
"""
module Meh
val InferSynValData:
memberFlagsOpt: SynMemberFlags option * pat: SynPat option * SynReturnInfo option * origRhsExpr: SynExpr ->
x: string ->
SynValData2
"""
match
parseResults
with
|
ParsedInput
.
SigFile
(
ParsedSigFileInput
(
modules
=[
SynModuleOrNamespaceSig
(
decls
=[
SynModuleSigDecl
.
Val
(
valSig
=
SynValSig
(
synType
=
SynType
.
Fun
(
argType
=
SynType
.
Tuple
(
path
=
[
SynTupleTypeSegment
.
Type
(
SynType
.
SignatureParameter
(
id
=
Some
memberFlagsOpt
))
SynTupleTypeSegment
.
Star
_
SynTupleTypeSegment
.
Type
(
SynType
.
SignatureParameter
(
id
=
Some
pat
))
SynTupleTypeSegment
.
Star
_
SynTupleTypeSegment
.
Type
(
SynType
.
App
_)
SynTupleTypeSegment
.
Star
_
SynTupleTypeSegment
.
Type
(
SynType
.
SignatureParameter
(
id
=
Some
origRhsExpr
))
])
returnType
=
SynType
.
Fun
(
argType
=
SynType
.
SignatureParameter
(
id
=
Some
x
)
returnType
=
SynType
.
LongIdent
_
)
)
))
]
)
]))
->
Assert
.
AreEqual
(
"memberFlagsOpt"
,
memberFlagsOpt
.
idText
)
Assert
.
AreEqual
(
"pat"
,
pat
.
idText
)
Assert
.
AreEqual
(
"origRhsExpr"
,
origRhsExpr
.
idText
)
Assert
.
AreEqual
(
"x"
,
x
.
idText
)
|
_
->
Assert
.
Fail
$
"Could not get valid AST, got {parseResults}"
\ No newline at end of file
tests/service/SyntaxTreeTests/TypeTests.fs
浏览文件 @
8cbbd29f
...
...
@@ -524,3 +524,73 @@ let _: struct (int * int = ()
assertRange
(
2
,
7
)
(
2
,
24
)
mTuple
|
_
->
Assert
.
Fail
$
"Could not get valid AST, got {parseResults}"
[<
Test
>]
let
``Named parameters in delegate type``
()
=
let
parseResults
=
getParseResults
"""
type Foo = delegate of a: A * b: B -> c:C -> D
"""
match
parseResults
with
|
ParsedInput
.
ImplFile
(
ParsedImplFileInput
(
modules
=
[
SynModuleOrNamespace
.
SynModuleOrNamespace
(
decls
=
[
SynModuleDecl
.
Types
(
typeDefns
=
[
SynTypeDefn
(
typeRepr
=
SynTypeDefnRepr
.
ObjectModel
(
kind
=
SynTypeDefnKind
.
Delegate
(
signature
=
SynType
.
Fun
(
argType
=
SynType
.
Tuple
(
path
=
[
SynTupleTypeSegment
.
Type
(
SynType
.
SignatureParameter
(
id
=
Some
a
))
SynTupleTypeSegment
.
Star
_
SynTupleTypeSegment
.
Type
(
SynType
.
SignatureParameter
(
id
=
Some
b
))
])
returnType
=
SynType
.
Fun
(
argType
=
SynType
.
SignatureParameter
(
id
=
Some
c
)
returnType
=
SynType
.
LongIdent
_
)
))))
])
])
]))
->
Assert
.
AreEqual
(
"a"
,
a
.
idText
)
Assert
.
AreEqual
(
"b"
,
b
.
idText
)
Assert
.
AreEqual
(
"c"
,
c
.
idText
)
|
_
->
Assert
.
Fail
$
"Could not get valid AST, got {parseResults}"
[<
Test
>]
let
``Attributes in optional named member parameter``
()
=
let
parseResults
=
getParseResults
"""
type X =
abstract member Y: [<Foo; Bar>] ?a: A -> B
"""
match
parseResults
with
|
ParsedInput
.
ImplFile
(
ParsedImplFileInput
(
modules
=
[
SynModuleOrNamespace
.
SynModuleOrNamespace
(
decls
=
[
SynModuleDecl
.
Types
(
typeDefns
=
[
SynTypeDefn
(
typeRepr
=
SynTypeDefnRepr
.
ObjectModel
(
members
=
[
SynMemberDefn
.
AbstractSlot
(
slotSig
=
SynValSig
(
synType
=
SynType
.
Fun
(
argType
=
SynType
.
SignatureParameter
(
[
{
Attributes
=
[
_
;
_
]
}
],
true
,
Some
a
,
SynType
.
LongIdent
_,
m
)
returnType
=
SynType
.
LongIdent
_
)
))
]
))
])
])
]))
->
Assert
.
AreEqual
(
"a"
,
a
.
idText
)
assertRange
(
3
,
23
)
(
3
,
41
)
m
|
_
->
Assert
.
Fail
$
"Could not get valid AST, got {parseResults}"
\ No newline at end of file
tests/service/SyntaxTreeTests/UnionCaseTests.fs
浏览文件 @
8cbbd29f
...
...
@@ -135,4 +135,31 @@ type Currency =
]))
->
assertRange
(
7
,
4
)
(
7
,
11
)
mPrivate
|
_
->
Assert
.
Fail
"Could not get valid AST"
\ No newline at end of file
Assert
.
Fail
"Could not get valid AST"
[<
Test
>]
let
``SynUnionCaseKind.FullType``
()
=
let
parseResults
=
getParseResults
"""
type X =
| a: int * z:int
"""
match
parseResults
with
|
ParsedInput
.
ImplFile
(
ParsedImplFileInput
(
modules
=
[
SynModuleOrNamespace
.
SynModuleOrNamespace
(
decls
=
[
SynModuleDecl
.
Types
(
typeDefns
=
[
SynTypeDefn
(
typeRepr
=
SynTypeDefnRepr
.
Simple
(
simpleRepr
=
SynTypeDefnSimpleRepr
.
Union
(
unionCases
=
[
SynUnionCase
(
caseType
=
SynUnionCaseKind
.
FullType
(
fullType
=
SynType
.
Tuple
(
path
=
[
SynTupleTypeSegment
.
Type
(
SynType
.
LongIdent
_)
SynTupleTypeSegment
.
Star
_
SynTupleTypeSegment
.
Type
(
SynType
.
SignatureParameter
(
id
=
Some
z
))
])))
])))
])
])
]))
->
Assert
.
AreEqual
(
"z"
,
z
.
idText
)
|
_
->
Assert
.
Fail
$
"Could not get valid AST, got {parseResults}"
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录