[swift-evolution] [Completing Generics]

Brent Royal-Gordon brent at architechies.com
Wed Mar 9 20:11:55 CST 2016


>> I assume the following will fall under "constant expression":
>> 
>> 	let 2π = 2 * π
> 
> That would involve inferring that 2π is a generic constant… could certainly be something to explore, but it’s somewhat new territory. 

It seems to me that the same logic would make this:

	let range = 1.0...5.0

Into something like this:

	let range<T: Comparable, FloatLiteralType>: ClosedInterval<T> = 1.0...5.0

Which strikes me as a bridge too far.

-- 
Brent Royal-Gordon
Architechies



More information about the swift-evolution mailing list