Last active
February 3, 2017 12:38
-
-
Save pawegio/b6112f61392302c914d3765846b88e6b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun doSthWithReport(report: Report) = when (report) { | |
is HourlyReport -> view.showHours(report.hours) | |
is DailyReport -> view.showDate(report.date) | |
//else -> throw IllegalArgumentException() <- NOT NEEDED! | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
the commented line misses the
throw
keyword