Type Erasure Magic in Swift
realm.io
Type Erasure Magic in Swift
1–10 of 10 posts
Re: Type Erasure Magic in Swift
#2Re: Type Erasure Magic in Swift
#3As a TL;DR, or even as a starting point for diving deeper into the finer points in the talk, it would be really helpful to attach the complete code which demonstrates type erasure.
Re: Type Erasure Magic in Swift
#4Re: Type Erasure Magic in Swift
#5Re: Type Erasure Magic in Swift
#6Why do all sorts of blogs have "Click to Read More" buttons these days? Seems totally unnecessary.
Edit: it seems the old location for adverts, the sidebar, is dead because people zoom in on mobile and many users are on mobile.
Pop-ups also are somewhat dead because people have learned to close the not-too obnoxious ones without paying attention.
Re: Type Erasure Magic in Swift
#7As a TL;DR, or even as a starting point for diving deeper into the finer points in the talk, it would be really helpful to attach the complete code which demonstrates type erasure.
Agreed. Although, the code is in the presentation.
Re: Type Erasure Magic in Swift
#8It's the opposite. In Java, when you instantiate a generic class with a concrete type, it will erase that type in the generic class. So, the actual code for Foo and Foo is the same; String and Integer are erased, and inside of Foo, it just uses Object. For that reason, Foo is not allowed to do anything with T that would require knowing the actual type of T; that knowledge has been erased. See https://docs.oracle.com/javase/tutorial/java/generics/erasur...
With this confusion, it's hard for me to orient myself with how this applies to Swift.
Re: Type Erasure Magic in Swift
#9Re: Type Erasure Magic in Swift
#10Why do all sorts of blogs have "Click to Read More" buttons these days? Seems totally unnecessary.