enumeratum icon indicating copy to clipboard operation
enumeratum copied to clipboard

Better error message for withName

Open superbobry opened this issue 9 years ago • 1 comments

Currently withName produces error messages like

Baz is not a member of Enum (Bar, Boo)

where Enum is used regardless of the actual enum class/trait name. Is it possible to replace it with the actual class name?

superbobry avatar Jan 10 '17 16:01 superbobry

That's a good idea. The implementation could be tricky to get right though, because there are weird edge cases that make it hard to get a nice short name (e.g. if an object is declared inside a method), and getSimpleName is known to throw in some situations.

lloydmeta avatar Jan 11 '17 04:01 lloydmeta