Understanding Parametricity in Scala
Daniel Sebban
2613

This trick loses all its magic when thinking in bytecode terms.

Compiler strips off your generics, leaving the function as

def f(a: Object): Object

Now the main question reduces to “what can you get from an Object without calling any of its methods ?”. Oops, apparently nothing.

Like what you read? Give Alexander Zakusylo a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.