From d737c58bbb747c46eddbf2adcb60dc2f983d893f Mon Sep 17 00:00:00 2001 From: Alexander Plavin Date: Mon, 26 Aug 2024 05:57:16 -0400 Subject: [PATCH] improve error messages (#166) --- src/optics.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/optics.jl b/src/optics.jl index d0c4b63b..f02fa5f6 100644 --- a/src/optics.jl +++ b/src/optics.jl @@ -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 @@ -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)