Skip to content

@show displays unnecessary parentheses for nested structs #31065

@GregPlowman

Description

@GregPlowman

The display using @show for nested structs has parentheses, which seems like clutter to me.
I like the v0.6 behavior better.

struct Foo3 x::Int end
struct Foo2 x::Foo3 end
struct Foo1 x::Foo2 end

foo1 = Foo1(Foo2(Foo3(42)))
@show foo1.x
@show foo1.x.x
@show foo1.x.x.x

For Julia v0.6.4:

foo1.x = Foo2(Foo3(42))
foo1.x.x = Foo3(42)
foo1.x.x.x = 42

For Julia v0.7.0, v1.0.3, v1.1.0:

foo1.x = Foo2(Foo3(42))
(foo1.x).x = Foo3(42)
((foo1.x).x).x = 42

Metadata

Metadata

Assignees

No one assigned

    Labels

    display and printingAesthetics and correctness of printed representations of objects.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions