Skip to content

Commit 03b5e92

Browse files
committed
Adapt conversion from old parsetree
Now that function attributes and first-argument attributes are split, they need to be re-joined in the old parse tree. This means that after a ppx, both will be on the first argument.
1 parent 5372d67 commit 03b5e92

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

compiler/ml/ast_mapper_to0.ml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@ module T = struct
101101
| Ptyp_arrow {arg; ret; arity} -> (
102102
let lbl = Asttypes.to_noloc arg.lbl in
103103
let typ0 =
104-
arrow ~loc ~attrs lbl (sub.typ sub arg.typ) (sub.typ sub ret)
104+
arrow ~loc
105+
~attrs:(attrs @ sub.attributes sub arg.attrs)
106+
lbl (sub.typ sub arg.typ) (sub.typ sub ret)
105107
in
106108
match arity with
107109
| None -> typ0
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
type fn = (~foo: string) => int
1+
type fn = (@as("something") ~foo: string) => int

0 commit comments

Comments
 (0)