Skip to content

invalid syntax (gotoifnot (true) 0) from return type conversion of an opaque closure #44723

Closed
@tkf

Description

@tkf
julia> demo(thunk)::Any = Base.Experimental.@opaque () -> true ? 1 : 2
ERROR: syntax: invalid syntax (gotoifnot (true) 0)
Stacktrace:
 [1] top-level scope
   @ REPL[1]:1

julia> VERSION
v"1.9.0-DEV.241"

Meta.@lower throws, so I guess it happens in the frontend?

julia> Meta.@lower demo(thunk)::Any = Base.Experimental.@opaque () -> true ? 1 : 2
:($(Expr(:error, "invalid syntax (gotoifnot (true) 0)")))

But fe throws something else?

> (fe "demo(thunk)::Any = Base.Experimental.@opaque () -> true ? 1 : 2")
error: invalid syntax (call (top getproperty) (call (top getproperty) (outerref Base) (inert Experiment
al)) (inert @opaque)) # none, line 1 begin
    nothing
    begin
        nothing
        #1 = (new #1#2)
        (unnecessary #1)
    end
end
#0 (error ("invalid syntax (call (top getproperty) (call (top getproperty) (outerref Base) (inert Exper
imental)) (inert @opaque)) # none, line 1 begin\n    nothing\n    begin\n        nothing\n        #1 =
(new #1#2)\n        (unnecessary #1)\n    end\nend"))
#1 (compile-body/compile
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or unintended behaviorcompiler:loweringSyntax lowering (compiler front end, 2nd stage)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions