From bc303f8489746c2bc91d2af951592fbb95c2357c Mon Sep 17 00:00:00 2001 From: Jacob Quinn Date: Thu, 15 Oct 2026 11:27:07 -0600 Subject: [PATCH] Show the matching trait in the struct type macro docstrings Each generated macro docstring said the macro was equivalent to `StructType.Struct()`, which names a nonexistent module and the wrong trait for every macro except @Struct. Interpolate the macro's own trait. Co-Authored-By: Claude Opus 5.5 --- src/macros.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/macros.jl b/src/macros.jl index 6acfece..ba9c5bf 100644 --- a/src/macros.jl +++ b/src/macros.jl @@ -16,7 +16,7 @@ for struct_type in (:Struct, :Mutable, :CustomStruct, :OrderedStruct, :AbstractT ``` is equivalent to ```julia - StructTypes.StructType(::Type{MyStruct}) = StructType.Struct() + StructTypes.StructType(::Type{MyStruct}) = StructTypes.$(isolate_name($struct_type))() ``` and ```julia @@ -29,7 +29,7 @@ for struct_type in (:Struct, :Mutable, :CustomStruct, :OrderedStruct, :AbstractT struct MyStruct val::Int end - StructTypes.StructType(::Type{MyStruct}) = StructType.Struct() + StructTypes.StructType(::Type{MyStruct}) = StructTypes.$(isolate_name($struct_type))() ``` """ macro $struct_type(expr) return macro_constructor(expr, $struct_type)