Re: sealed
Nick Stanchenko <[email protected]> Thu, 11 Feb 2016 15:19:11 -0800 (PST)
| Newsgroups | gmane.comp.lang.scala |
|---|---|
| Message-ID | <[email protected]> |
+1. I bet this could also help with https://issues.scala-lang.org/browse/SI-7046 ;) On Thursday, February 11, 2016 at 6:32:59 PM UTC, Oliver Ruebenacker wrote: > > > Hello, > > I love the feature of having sealed types that can only be directly > extended by a limited set of sub-types. However, I find it quite awkward > that the allowed direct sub-types are those that are in the same file. > First, this collides almost always with my preferences of what I would like > to put in the same file and what not. Second, it requires careful reading > of the entire file to find them all. > > Why not list the allowed sub-types, for example like this: > > sealed(B, C, D) trait A > > meaning that A can only be directly extended by B, C and D. > > Best, Oliver > > -- > Oliver Ruebenacker > Senior Software Engineer, Diabetes Portal > <http://www.type2diabetesgenetics.org/>, Broad Institute > <http://www.broadinstitute.org/> > > -- You received this message because you are subscribed to the Google Groups "scala-language" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.