-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
We could have traits instead of interfaces, while still allowing "trait inheritance". This would mean classes and structs can explicitly implement a trait internally, while also allowing external "extension" of types with traits. e.g.
trait Iterator!(T, TState) {
TState InitialState ();
T? TryGetNext (ref TState state);
}
extends IList!(T) with Iteratable!(T, intN) {
intN InitialState => 0;
T? TryGetNext (ref intN index) => index < length ? this[index] : null;
}
class ClassWithIterator : Iterator<T, int32> {
// [...]
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request