Francesc
01/11/2023, 8:31 PMKirill Grouchnikov
01/11/2023, 8:32 PMAll direct subclasses of a sealed class are known at compile time. *No other subclasses may appear outside a module within which the sealed class is defined*.Francesc
01/11/2023, 8:33 PMKirill Grouchnikov
01/11/2023, 8:33 PMwhen would work when the leaves are spread across multiple modulesKirill Grouchnikov
01/11/2023, 8:34 PMFrancesc
01/11/2023, 8:35 PMwhen, and that's the reason I was building this hierarchy, I was just not aware it was not possible to spread it across modules so I was trying to understand the reason behind thatephemient
01/11/2023, 8:37 PMKirill Grouchnikov
01/11/2023, 8:37 PMwhen work when the leaves are spread across multiple modules? How would the compiler be able to compile the module with that when? How would you even import all the leaves scattered across the modules, unless every module depends on everything else.ephemient
01/11/2023, 8:37 PMFrancesc
01/11/2023, 8:38 PMthe set of modules is not known to the compilerthanks, that's the kind of concise answer I was looking for
ephemient
01/11/2023, 8:38 PMKristian Nedrevold
01/11/2023, 8:40 PMFrancesc
01/11/2023, 8:41 PMKirill Grouchnikov
01/11/2023, 8:42 PMShape classes isn’t the strongest. There’s a good argument against using a sealed shape hierarchy in a geometry library, as that would prevent 3rd parties to implement their own shapes.
But then there’s also a good argument on what could be done with that “loosely sealed” hierarchy when you can’t enumerate all the leaves in a whenKirill Grouchnikov
01/11/2023, 8:42 PMsealedephemient
01/11/2023, 8:42 PMFrancesc
01/11/2023, 8:42 PMsealed interface ?Kirill Grouchnikov
01/11/2023, 8:43 PMsealed. Probably some sort of combination of builders and private / protected constructors.ephemient
01/11/2023, 8:44 PMJosé González D'Amico
01/11/2023, 8:58 PMFrancesc
01/11/2023, 9:02 PMJosé González D'Amico
01/11/2023, 9:02 PMJosé González D'Amico
01/11/2023, 9:03 PMKirill Grouchnikov
01/11/2023, 9:17 PM