File tree 3 files changed +12
-1
lines changed
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
1452
1452
printComments doc cmtTbl cd.pcd_name.loc
1453
1453
in
1454
1454
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
1456
1457
in
1457
1458
let gadt =
1458
1459
match cd.pcd_res with
@@ -3453,6 +3454,12 @@ and printTemplateLiteral ~state expr cmtTbl =
3453
3454
printStringContents txt
3454
3455
| _ ->
3455
3456
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
3456
3463
Doc. group (Doc. concat [Doc. text " ${" ; Doc. indent doc; Doc. rbrace])
3457
3464
in
3458
3465
let content = walkExpr expr in
Original file line number Diff line number Diff line change @@ -49,6 +49,8 @@ let s = `
49
49
50
50
let s = `$dollar without $braces $interpolation`
51
51
52
+ let s = `${(s: string)}`
53
+
52
54
// don't sugar to one single template literal, keep the concatenation
53
55
`the sky` ++ `is blue`
54
56
Original file line number Diff line number Diff line change @@ -49,6 +49,8 @@ let s = `
49
49
50
50
let s = ` $dollar without $braces $interpolation`
51
51
52
+ let s = ` ${(s: string)}`
53
+
52
54
// don't sugar to one single template literal, keep the concatenation
53
55
` the sky` ++ ` is blue`
54
56
You can’t perform that action at this time.
0 commit comments