Skip to content

Incorrect parsing of -(a=2) #113

@oscardssmith

Description

@oscardssmith

On Julia master:

julia> @Meta.lower -(a = 2)
:($(Expr(:thunk, CodeInfo(
    @ none within `top-level scope`
1 ─ %1 = Core.get_binding_type(Main, :a)
│   %2 = Base.convert(%1, 2)
│   %3 = Core.typeassert(%2, %1)
│        a = %3
│   %5 = -2
└──      return %5
))))

With JuliaSyntax:

:($(Expr(:thunk, CodeInfo(
    @ none within `top-level scope`
1 ─ %1 = Core.tuple(:a)
│   %2 = Core.apply_type(Core.NamedTuple, %1)
│   %3 = Core.tuple(2)
│   %4 = (%2)(%3)
│   %5 = Core.kwfunc(-)
│   %6 = (%5)(%4, -)
└──      return %6
))))

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions