Skip to content

Commit 5ab1a89

Browse files
committed
Don't require => in named tuples to be infix
This isn't required in old lowering, and is difficult to preserve in the presence of `Expr` macros. It's also an awkward/wrong use of flags given that we've already arranged the associated `K"call"` node by the time we get to desugaring.
1 parent c4e0357 commit 5ab1a89

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

src/desugaring.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1568,7 +1568,7 @@ function expand_named_tuple(ctx, ex, kws;
15681568
end
15691569
name = to_symbol(ctx, kw[2])
15701570
value = kw
1571-
elseif k == K"call" && is_infix_op_call(kw) && numchildren(kw) == 3 &&
1571+
elseif k == K"call" && numchildren(kw) == 3 &&
15721572
is_same_identifier_like(kw[1], "=>")
15731573
# a=>b ==> $a=b
15741574
appended_nt = _named_tuple_expr(ctx, kw, (kw[2],), (kw[3],))

src/macro_expansion.jl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -301,10 +301,7 @@ function expand_forms_1(ctx::MacroExpansionContext, ex::SyntaxTree)
301301
k = K"dotcall"
302302
farg = farg[1]
303303
end
304-
# Preserve call type flags (mostly ignored in the next pass as
305-
# we've already reordered arguments.)
306-
callflags = JuliaSyntax.call_type_flags(ex)
307-
@ast ctx ex [k(syntax_flags=(callflags == 0 ? nothing : callflags))
304+
@ast ctx ex [k
308305
expand_forms_1(ctx, farg)
309306
(expand_forms_1(ctx, a) for a in args)...
310307
]

0 commit comments

Comments
 (0)