Generic typealiases with additional constraints?

How is that different from the workaround in this comment: Constraining associatedtype of non-generic typealias - #2 by Karl

typealias IsFloatColl<T> = T where T: Collection, T.Element: Strideable, T.Element.Stride: BinaryFloatingPoint

which already works today. Isn't a matter of syntax whether you introduce the T explicitly or implicitly desugar something like

// strawman short syntax
typealias IsFloatColl = Collection where Element: Strideable, Element.Stride: BinaryFloatingPoint

// (somehow) implicitly desugared to
typealias IsFloatColl<T> = T where T: Collection, T.Element: Strideable, T.Element.Stride: BinaryFloatingPoint

? Now it's a separate question of how the desugaring would work, but I don't see how it needs a new form of existentials.

2 Likes