From 74a6beff202d7e8d3d707b8cbf5776433cb4da8f Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 12 Oct 2026 02:41:10 +0000 Subject: [PATCH] typename: use nameof instead of reading UnionAll fields typename probed isdefined(M, :name) and M.name.name, then M.body for a UnionAll. Julia 1.14 (JuliaLang/julia#63530) stores a UnionAll's binder name in a field called name, so the first branch returned the type variable's name instead of the type's. nameof gives the unqualified type name for both DataType and UnionAll on every supported Julia version. Assisted-by: Claude Code (Mythos 5.1) --- src/StatisticalTraits.jl | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/StatisticalTraits.jl b/src/StatisticalTraits.jl index 4cb830b..bfe61b2 100644 --- a/src/StatisticalTraits.jl +++ b/src/StatisticalTraits.jl @@ -89,10 +89,8 @@ returns `:Machine`. Where this does not make sense (eg, instances of """ function typename(M) - if isdefined(M, :name) - return M.name.name - elseif isdefined(M, :body) - return typename(M.body) + if M isa DataType || M isa UnionAll + return nameof(M) else return Symbol(string(M)) end