Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitadb4fa2

Browse files
committed
Minor refactoring
1 parenta8972fe commitadb4fa2

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

‎src/fsharp/NicePrint.fs‎

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ module private PrintUtilities =
7171
|(x:: rest)->[ resultFunction x(layoutFunction x-- leftL(match rest.Lengthwith1-> FSComp.SR.nicePrintOtherOverloads1()| n-> FSComp.SR.nicePrintOtherOverloadsN(n)))]
7272
|_->[]
7373

74-
/// Layout a reference to a type
74+
7575
letlayoutTyconRefImpl isAttribute(denv:DisplayEnv)(tcref:TyconRef)=
7676
letdemangled=
7777
letname=
@@ -99,7 +99,8 @@ module private PrintUtilities =
9999
letpathText= trimPathByDisplayEnv denv path
100100
if pathText=""then tyconTextLelse leftL pathText^^ tyconTextL
101101

102-
letlayoutTyconAttribute(denv:DisplayEnv)(tcref:TyconRef)=
102+
letlayoutBuiltinAttribute(denv:DisplayEnv)(attrib:BuiltinAttribInfo)=
103+
lettcref= attrib.TyconRef
103104
squareAngleL(layoutTyconRefImpltrue denv tcref)
104105

105106
moduleprivatePrintIL=
@@ -216,9 +217,8 @@ module private PrintIL =
216217
// Layout an unnamed argument
217218
|_, None,_-> leftL":"
218219
// Layout a named argument
219-
|true, Some nm,_->
220-
lettyp= denv.g.attrib_ParamArrayAttribute.TyconRef
221-
layoutTyconAttribute denv typ^^ leftL(nm+":")
220+
|true, Some nm,_->
221+
layoutBuiltinAttribute denv denv.g.attrib_ParamArrayAttribute^^ leftL(nm+":")
222222
|false, Some nm,_-> leftL(nm+":")
223223
preL^^(layoutILType denv ilTyparSubst p.Type)
224224

@@ -582,6 +582,7 @@ module private PrintTypes =
582582
| Internal,Private-> wordL"private"++ itemL// print modifier, since more specific than context
583583
|_-> itemL
584584

585+
/// Layout a reference to a type
585586
letlayoutTyconRef denv tycon= layoutTyconRefImplfalse denv tycon
586587

587588
/// Layout the flags of a member
@@ -931,9 +932,8 @@ module private PrintTypes =
931932
// Layout a named argument
932933
| Some id,_,isParamArray,_->
933934
letprefix=
934-
if isParamArraythen
935-
lettyp= denv.g.attrib_ParamArrayAttribute.TyconRef
936-
layoutTyconAttribute denv typ^^ leftL id.idText
935+
if isParamArraythen
936+
layoutBuiltinAttribute denv denv.g.attrib_ParamArrayAttribute^^ leftL id.idText
937937
else
938938
leftL id.idText
939939
prefix^^ sepL":"^^ layoutTypeWithInfoAndPrec denv env2 ty
@@ -1165,8 +1165,7 @@ module InfoMemberPrinting =
11651165
outputTy denv os pty;
11661166
// Layout a named argument
11671167
|true, Some nm,_,_->
1168-
lettyp= denv.g.attrib_ParamArrayAttribute.TyconRef
1169-
layoutTyconAttribute denv typ|> bufferL os
1168+
layoutBuiltinAttribute denv denv.g.attrib_ParamArrayAttribute|> bufferL os
11701169
bprintf os"%s:" nm
11711170
outputTy denv os pty
11721171
|false, Some nm,_,_->

‎tests/fsharpqa/Source/Printing/ParamArrayInSignatures.fs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
//<Expects status=success> end</Expects>
99

1010
typeHeterogeneous=
11-
static memberEcho([<System.ParamArray>]args:obj[])= args
11+
static memberEcho([<System.ParamArray>]args:obj[])= args

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp