You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following code leveraging the sealed interface + record pattern (to make sum types) should not violate the InterfaceWithOnlyStatics rule as the interface is sealed:
publicsealedinterfaceSum {
record A() implementsSum { }
record B() implementsSum { }
// ...anything else
}
Note that permits is not needed if all implementers are nested types. (The second record is not necessary, but illustrates the point.)
The text was updated successfully, but these errors were encountered:
The following code leveraging the sealed interface + record pattern (to make sum types) should not violate the InterfaceWithOnlyStatics rule as the interface is
sealed
:Note that
permits
is not needed if all implementers are nested types. (The secondrecord
is not necessary, but illustrates the point.)The text was updated successfully, but these errors were encountered: