Skip to content

Instantly share code, notes, and snippets.

@piotrga
Created December 24, 2011 09:59
Show Gist options
  • Save piotrga/1517036 to your computer and use it in GitHub Desktop.
Save piotrga/1517036 to your computer and use it in GitHub Desktop.
Type aliasing
case class FunnyPair[A,B](a:A, b:B)
val x = FunnyPair // apparently it's equivalent to: type x = FunnyPair.type
x(2,"9")
scala> case class FunnyPair[A,B](a:A, b:B)
defined class FunnyPair
scala> val x = FunnyPair
x: FunnyPair.type = FunnyPair
scala> x(2,"9")
res0: FunnyPair[Int,java.lang.String] = FunnyPair(2,9)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment