lunatech-labs / lunatech-scala2-to-scala3-course

Lunatech course - "Moving forward from Scala 2 to Scala 3"
Apache License 2.0
204 stars 21 forks source link

Remove pattern guard from pattern matching expressions #37

Open eloots opened 4 years ago

eloots commented 4 years ago

Adding pattern guards on case clauses leads to the inability of the compiler to check if a pattern match is complete. Let's remove this to illustrate how this should be done. Move the tests inside the expression executed.