JuliaObjects / ConstructionBase.jl

Primitives for construction of objects
MIT License
38 stars 22 forks source link

improve setproperties() error message #93

Closed aplavin closed 2 months ago

aplavin commented 2 months ago

Currently, it can be both too long and unclear for novices (I saw some confusion), eg:

ERROR: The function Base.propertynames was overloaded for type Mesh{3, Float32, GeometryBasics.Ngon{3, Float32, 3, Point{3, Float32}}, SimpleFaceView{3, Float32, 3, OffsetInteger{-1, UInt32}, Point{3, Float32}, NgonFace{3, OffsetInteger{-1, UInt32}}}}. Please make sure ConstructionBase.setproperties is also overloaded for this type.

This PR changes it to:

The Mesh type defines custom properties: it has propertynames overloaded. Please define ConstructionBase.setproperties(::Mesh, ::NamedTuple) to set its properties.

Happy to rephrase if you have other suggestions!

aplavin commented 2 months ago

I think so, around here: https://github.com/JuliaObjects/ConstructionBase.jl/blob/3f1e80ec356acd025f977a942165d8fec6953f7c/test/runtests.jl#L328-L332