Skip to content

Commit

Permalink
improve error messages (#166)
Browse files Browse the repository at this point in the history
  • Loading branch information
aplavin authored Aug 26, 2024
1 parent 991e92d commit d737c58
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/optics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ function _set(obj, optic, val, ::SetBased)
Optic = typeof(optic)
error("""
This should be unreachable. You probably need to overload
`Accessors.set(obj, ::$Optic, val)
`Accessors.set(obj::$(nameof(typeof(obj))), ::$Optic, val::$(nameof(typeof(val))))`
""")
end

Expand Down Expand Up @@ -201,9 +201,9 @@ end
function _modify(f, obj, optic, ::ModifyBased)
Optic = typeof(optic)
error("""
This should be unreachable. You probably need to overload:
`Accessors.modify(f, obj, ::$Optic)`
""")
This should be unreachable. You probably need to overload:
`Accessors.modify(f, obj::$(nameof(typeof(obj))), ::$Optic)`
""")
end

function _modify(f, obj, optic::ComposedOptic, ::ModifyBased)
Expand Down

0 comments on commit d737c58

Please sign in to comment.