File tree Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -1452,7 +1452,8 @@ and printConstructorDeclaration2 ~state i
14521452 printComments doc cmtTbl cd.pcd_name.loc
14531453 in
14541454 let constrArgs =
1455- printConstructorArguments ~is DotDotDot ~state ~indent: true cd.pcd_args cmtTbl
1455+ printConstructorArguments ~is DotDotDot ~state ~indent: true cd.pcd_args
1456+ cmtTbl
14561457 in
14571458 let gadt =
14581459 match cd.pcd_res with
@@ -3453,6 +3454,12 @@ and printTemplateLiteral ~state expr cmtTbl =
34533454 printStringContents txt
34543455 | _ ->
34553456 let doc = printExpressionWithComments ~state expr cmtTbl in
3457+ let doc =
3458+ match Parens. expr expr with
3459+ | Parens. Parenthesized -> addParens doc
3460+ | Braced braces -> printBraces doc expr braces
3461+ | Nothing -> doc
3462+ in
34563463 Doc. group (Doc. concat [Doc. text " ${" ; Doc. indent doc; Doc. rbrace])
34573464 in
34583465 let content = walkExpr expr in
Original file line number Diff line number Diff line change @@ -49,6 +49,8 @@ let s = `
4949
5050let s = `$dollar without $braces $interpolation`
5151
52+ let s = `${(s: string)}`
53+
5254// don't sugar to one single template literal, keep the concatenation
5355`the sky` ++ `is blue`
5456
Original file line number Diff line number Diff line change @@ -49,6 +49,8 @@ let s = `
4949
5050let s = ` $dollar without $braces $interpolation`
5151
52+ let s = ` ${(s: string)}`
53+
5254// don't sugar to one single template literal, keep the concatenation
5355` the sky` ++ ` is blue`
5456
You can’t perform that action at this time.
0 commit comments