From d186cc6a3e380a59291cd529e2ed825793a0e991 Mon Sep 17 00:00:00 2001 From: Alexander Plavin Date: Wed, 21 Aug 2024 14:51:10 +0100 Subject: [PATCH 1/2] improve setproperties() error message --- src/ConstructionBase.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ConstructionBase.jl b/src/ConstructionBase.jl index d29c18f..244fff1 100644 --- a/src/ConstructionBase.jl +++ b/src/ConstructionBase.jl @@ -54,8 +54,8 @@ if VERSION >= v"1.7" # but triple equals is easier for the compiler to optimize, see #82 if propertynames(obj) !== fieldnames(typeof(obj)) error(""" - The function `Base.propertynames` was overloaded for type `$(typeof(obj))`. - Please make sure `ConstructionBase.setproperties` is also overloaded for this type. + The `$(nameof(typeof(obj)))` type defines custom properties: it has `propertynames` overloaded. + Please define `ConstructionBase.setproperties(::`$(nameof(typeof(obj)))`, ::NamedTuple)` to set its properties. """) end end From 44da0760be3d90808ec0e1cd74d712664561a7c1 Mon Sep 17 00:00:00 2001 From: Alexander Plavin Date: Wed, 21 Aug 2024 14:52:44 +0100 Subject: [PATCH 2/2] upd --- src/ConstructionBase.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ConstructionBase.jl b/src/ConstructionBase.jl index 244fff1..553477c 100644 --- a/src/ConstructionBase.jl +++ b/src/ConstructionBase.jl @@ -55,7 +55,7 @@ if VERSION >= v"1.7" if propertynames(obj) !== fieldnames(typeof(obj)) error(""" The `$(nameof(typeof(obj)))` type defines custom properties: it has `propertynames` overloaded. - Please define `ConstructionBase.setproperties(::`$(nameof(typeof(obj)))`, ::NamedTuple)` to set its properties. + Please define `ConstructionBase.setproperties(::$(nameof(typeof(obj))), ::NamedTuple)` to set its properties. """) end end