Skip to content

Instantly share code, notes, and snippets.

@pawegio
Last active February 3, 2017 12:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pawegio/b6112f61392302c914d3765846b88e6b to your computer and use it in GitHub Desktop.
Save pawegio/b6112f61392302c914d3765846b88e6b to your computer and use it in GitHub Desktop.
fun doSthWithReport(report: Report) = when (report) {
is HourlyReport -> view.showHours(report.hours)
is DailyReport -> view.showDate(report.date)
//else -> throw IllegalArgumentException() <- NOT NEEDED!
}
@LouisCAD
Copy link

LouisCAD commented Feb 1, 2017

the commented line misses the throw keyword

@pawegio
Copy link
Author

pawegio commented Feb 3, 2017

thanks, fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment