Repository navigation
Warn that a custom type variant is never constructed #6318
ollie-dot-earth
started this conversation in
Ideas & suggestions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
It'd be nice to have a warning if a custom type variant is only ever used in say, an update function, and never actually Constructed anywhere.
Ideally this would work for both private and
pub opaquetypes.My specific usecase would be
Messagevariants, commonly in lustre applications, where the functions emitting them were removed in a refactor at some point.But since the
updatefunction still handles it there is no warning telling me that the variant is never used.This makes it pretty annoying to find out if a message is still relevant. Especially in larger applications.
Real world example
https://tangled.org/ollie.earth/inventory/blob/f362445debcefa5f7d2a4d2c8c43f32feae9756c/client/src/inventory/page/project/list.gleam#L308
UserSelectedProjectis one of the ones that got deleted in more recent commits.see: product.gleam for a module with more messages
Constructed example
All reactions