Skip to content

Commit

Permalink
fix static_show of empty named tuples (#26042)
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson authored Feb 14, 2018
1 parent 00b7ff8 commit 0b6a472
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/rtutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -873,11 +873,16 @@ static size_t jl_static_show_x_(JL_STREAM *out, jl_value_t *v, jl_datatype_t *vt
}
else if (jl_is_datatype(vt)) {
int istuple = jl_is_tuple_type(vt), isnamedtuple = jl_is_namedtuple_type(vt);
if (!istuple && !isnamedtuple)
size_t tlen = jl_datatype_nfields(vt);
if (isnamedtuple) {
if (tlen == 0)
n += jl_printf(out, "NamedTuple");
}
else if (!istuple) {
n += jl_static_show_x(out, (jl_value_t*)vt, depth);
}
n += jl_printf(out, "(");
size_t nb = jl_datatype_size(vt);
size_t tlen = jl_datatype_nfields(vt);
if (nb > 0 && tlen == 0) {
uint8_t *data = (uint8_t*)v;
n += jl_printf(out, "0x");
Expand Down

1 comment on commit 0b6a472

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily benchmark build, I will reply here when finished:

@nanosoldier runbenchmarks(ALL, isdaily = true)

Please sign in to comment.