issa-tseng / janus

the two-faced application library-framework.
http://janusjs.org
37 stars 7 forks source link

Change case superclasses to be match-only #70

Closed issa-tseng closed 6 years ago

issa-tseng commented 7 years ago

And then change their unapply to just return the original case like otherwise does.

issa-tseng commented 6 years ago

This is actually somewhat tricky, due to the way we use case construction as the way to build matchers. So all we can do is trap misuse at match-time and error.

issa-tseng commented 6 years ago

Punting on this until a clearer answer emerges. Making case superclasses abstract is a fairly obvious and correct thing to do, but if doing so breaks the way we do case handling in general then we need to do more thinking.

issa-tseng commented 6 years ago

This is done; we still allow the construction of such cases, sadly, but we will never allow matching on them, which should discourage their use in this way.