Hacker News new | ask | show | jobs
by halfmatthalfcat 1490 days ago
As does Scala:

  match thing {
    case a: String => 
      // use a as string
    case a @ MyCaseClass(b: String, c, d) =>
      // use a as the instance of MyCaseClass or use b as a string
  }