Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Wanted to understand why this fails to compile:
List(("Mark", 4), ("Charles", 5)).filter(case(name, number) => number == 4)
:1: error: illegal start of simple expression
List(("Mark", 4), ("Charles", 5)).filter(case(name, number) => number == 4)
Yet this works fine:
List(("Mark", 4), ("Charles", 5)).filter{case(name, number) => number == 4}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment