Skip to content

Commit

Permalink
improve setproperties() error message
Browse files Browse the repository at this point in the history
  • Loading branch information
aplavin authored Aug 21, 2024
1 parent 3f1e80e commit d186cc6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ConstructionBase.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d186cc6

Please sign in to comment.