Terse print of types for Mill.jl data structures. Error messages were never more concise.
Author CTUAvastLab
3 Stars
Updated Last
1 Year Ago
Started In
November 2020


Build Status Coverage Status

When working with recursive structures containing parametric types, printing types (e.g. in error) gets very verbose.

PrintTypesTersely modifies printing types so only the first type is printed.

By default the functionality is turned off, but you can turn it on by:

using PrintTypesTersely

now it starts to shorten types print. So instead of e.g. A{Union{Int, Missing}}, you'll see only A{…}. You can disable this behavior by


or you can enable the behavior only for some block of code using

PrintTypesTersely.with_state(true) do
    @test repr(A{Vector{Int}}) == "A{…}"
    @test repr(A{Union{Int, Missing}}) == "A{…}"
    @test repr(B{Int, Float32}) == "B{…}"
    @test repr(B{Int}) == "B{…}"

That's all, basically.

The default value is false by default, because when turned on, it breaks compilation of some packages.