Because generic uses `Car` instead of `Position` when running the code, so
there is no casting as `car as Position` as in your original code. The
`T:Position`
part restricts that the type conforms `Position`, but it won't use `Position`,
it uses the type.
Zhaoxin
On Sat, May 27, 2017 at 4:58 PM,
Thanks. Why generic function don not require memory allocate for inout
variable, even if it is protocol type?
>Пятница, 26 мая 2017, 19:35 +03:00 от Guillaume Lessard
>:
>
>In your example, the compiler needs a parameter of type Position. Car is a
>type of Position, but they are not interchang
Hi guys,
I’m just trying to get my head around something: is there any difference
between `open let` and `public let`? Seeing that `let` cannot be overridden, is
the any functional difference?
Thanks,
Rod Brown
___
swift-users mailing list
swift-user