Skip to content

Should await bind more tightly than postfix !? #319

@leafpetersen

Description

@leafpetersen

If we simply make ! a postfix operator using the existing grammar, I believe we get the behavior that await e! is parsed as await (e!). Since await is accepting of null, it seems like it would be more useful to make it bind more tightly than !, and hence treat await e! as (await e)!. I'm not sure whether this matches the users intuition or not though. Would it be surprising to the user if await x++ were parsed as await (x++) but await x! were parsed as (await x)!?

Thoughts?

Issue raised by proposed tests here.

cc @lrhn @munificent @eernstg @stereotype441 @danrubel @bwilkerson @scheglov

Metadata

Metadata

Assignees

No one assigned

    Labels

    nnbdNNBD related issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions