Skip to content

[BUG] Function expression can't be the left argument to is/as #435

Closed
@JohelEGP

Description

@JohelEGP

Title: Function expression can't be the left argument to is/as.

Minimal reproducer (https://cpp2.godbolt.org/z/K53erj1fh):

main: () = {
  :() = 0; is int;
}

Commands:

cppfront -clean-cpp1 main.cpp2

Expected result:

Same as (https://cpp2.godbolt.org/z/8nszP1Wo4):

main: () = {
  cp := :(x) -> _ = x;
  cp(:() = 0) is int;
}

Actual result and error:

main.cpp2(1,12): error: ill-formed initializer (at '{')
main.cpp2(1,1): error: unexpected text at end of Cpp2 code section (at 'main')
main.cpp2(1,0): error: parse failed for section starting here

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions