Skip to content

Formatting AST including @trusted delegate produces invalid output #383

@Geod24

Description

@Geod24

TL;DR: Test case for formatter.d:

testFormatNode!(AssertExpression)("static assert(() @trusted { return bar()(3); }() == 4);");

Was trying to update libdparse for dlang.org (dlang/dlang.org#2758) and hit this bug.
The code:

 assert(() @trusted { return bar()(3); }() == 4);

from here is turned into:

assert (() @trusteddo
{ return bar()(3);
}() == 4)

by formatter, which is obviously invalid.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions