@@ -2795,8 +2795,9 @@ let genBinding (b: BindingNode) (ctx: Context) : Context =
27952795 | _ -> false
27962796
27972797 let binding =
2798- match b.FunctionName with
2799- | Choice1Of2 functionName when List.isNotEmpty b.Parameters ->
2798+ match ( b.FunctionName, b.Parameters) with
2799+ | Choice1Of2 functionName, _ :: _ ->
2800+ // An actual function parameters
28002801 let genAttrIsFirstChild =
28012802 onlyIf ( not isRecursiveLetOrUseFunction) ( genAttributes b.Attributes)
28022803
@@ -2969,47 +2970,8 @@ let genBinding (b: BindingNode) (ctx: Context) : Context =
29692970 +> genAttrIsFirstChild
29702971 +> genPref
29712972 +> leadingExpressionIsMultiline genSignature genExpr)
2972-
2973- | Choice2Of2( Pattern.Tuple _ as pat) ->
2974- let genAttrAndPref =
2975- if not isRecursiveLetOrUseFunction then
2976- ( genAttributes b.Attributes +> genMultipleTextsNode b.LeadingKeyword)
2977- else
2978- ( genMultipleTextsNode b.LeadingKeyword
2979- +> sepSpace
2980- +> genOnelinerAttributes b.Attributes)
2981-
2982- let afterLetKeyword =
2983- genAccessOpt b.Accessibility
2984- +> ifElse b.IsMutable (!- " mutable " ) sepNone
2985- +> genInlineOpt b.Inline
2986-
2987- let genDestructedTuples =
2988- expressionFitsOnRestOfLine ( genPat pat) ( sepOpenT +> genPat pat +> sepCloseT)
2989- +> optSingle
2990- ( fun ( rt : BindingReturnInfoNode ) ->
2991- genSingleTextNode rt.Colon
2992- +> sepSpace
2993- +> atCurrentColumnIndent ( genType rt.Type))
2994- b.ReturnType
2995-
2996- genXml b.XmlDoc
2997- +> genAttrAndPref
2998- +> sepSpace
2999- +> ( fun ctx ->
3000- let prefix =
3001- afterLetKeyword
3002- +> sepSpace
3003- +> genDestructedTuples
3004- +> sepSpace
3005- +> genSingleTextNode b.Equals
3006-
3007- let long = prefix +> indentSepNlnUnindent ( genExpr b.Expr)
3008- let short = prefix +> sepSpace +> genExpr b.Expr
3009- isShortExpression ctx.Config.MaxValueBindingWidth short long ctx)
3010-
30112973 | _ ->
3012- // old code of genSynBindingValue
2974+ // Everything value related
30132975 let genAttrIsFirstChild =
30142976 onlyIf ( not isRecursiveLetOrUseFunction) ( genAttributes b.Attributes)
30152977
@@ -3029,6 +2991,8 @@ let genBinding (b: BindingNode) (ctx: Context) : Context =
30292991 let genValueName =
30302992 match b.FunctionName with
30312993 | Choice1Of2 lid -> genIdentListNode lid
2994+ | Choice2Of2 tuplePat when tuplePat.IsTuple ->
2995+ expressionFitsOnRestOfLine ( genPat tuplePat) ( sepOpenT +> genPat tuplePat +> sepCloseT)
30322996 | Choice2Of2 pat -> genPat pat
30332997 +> optSingle genTyparDecls b.GenericTypeParameters
30342998
0 commit comments