Skip to content

Properly implement round-trip property for if/else #6193

Open
@sgraf812

Description

@sgraf812

In #6188, @phadej is hesitating to delete dead code because

That dead code reminds me of an unsolved issue, but when it's gone there won't be anything reminding of that ugliness...

So I'm recording his process in #6188 (comment) here so that this issue can serve as a memory hook for him to come back and fix the code later


The code there is in the state to have roundtrip property for code like

if flag(some-condition)
  buildable: True
else
  buildable: False

which is ugly when pretty-printed as:

if flag(some-condition)
else
  buildable: False

That's because buildable: True is no-op, and there could be other a like.

One way, is to pretty-print that as

if !flag(some-condition)
  buildable: False

But that violates roundtrip property.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions