Sealed Types and Traits
- Q298: What is allow only on traits in EK9?
- Q299: How does allow only work with dispatchers in EK9?
- Q300: Can abstract classes be in an allow only list in EK9?
- Q301: How do I restrict which classes can extend my class in EK9?
- Q302: How do dispatchers work with sealed classes in EK9?
- Q303: Can a permitted subclass also be sealed in EK9?
- Q850: Can an abstract class appear in a trait's allow only list?
- Q1129: Delegate trait methods to another object using the 'by' keyword.
- Q1130: Chain trait delegations so Top delegates to Middle which delegates to Final.
- Q1131: Resolve diamond inheritance when a class adopts two traits that share a parent.
- Q1132: Call a specific trait's method implementation using TraitName.method() syntax.
- Q1133: Delegate operators through a trait so the delegating class supports $ and ?.
- Q1171: Define a sealed Shape class that permits only Circle, Square, and Triangle.
- Q1172: Build a chained sealed hierarchy: Vehicle permits Car and Truck, Car permits Sedan and Hatchback.
- Q1176: Implement a Describable trait with a name method in a concrete Animal class.