SE-0244: Opaque Result Types

As I recently complained about adding a new keyword:
How about recycling something we already have?

func makeMeACollection<T>(_: T.Type) -> [T] as MutableCollection & RangeReplaceableCollection where Element == T {
   return [T]()
}

This would also resolve another nuisance I have with some:
When declaring a property, its actual type is inferred in an imho rather intransparent way.

2 Likes