alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Scala example source code file (exhausting.check)

This example Scala source code file (exhausting.check) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Scala tags/keywords

anyref, bar1, bar1, bar2, bar2, bar3, foo, foo, list, nil, nil

The Scala exhausting.check source code

exhausting.scala:20: error: match is not exhaustive!
missing combination              *           Nil

  def fail1[T](xs: List[T]) = xs match {
                              ^
exhausting.scala:24: error: match is not exhaustive!
missing combination            Nil

  def fail2[T](xs: List[T]) = xs match {
                              ^
exhausting.scala:27: error: match is not exhaustive!
missing combination           Bar3

  def fail3[T](x: Foo[T]) = x match {
                            ^
exhausting.scala:31: error: match is not exhaustive!
missing combination           Bar2          Bar2

  def fail4[T <: AnyRef](xx: (Foo[T], Foo[T])) = xx match {
                                                 ^
exhausting.scala:36: error: match is not exhaustive!
missing combination           Bar1          Bar2
missing combination           Bar1          Bar3
missing combination           Bar2          Bar1
missing combination           Bar2          Bar2

  def fail5[T](xx: (Foo[T], Foo[T])) = xx match {
                                       ^
5 errors found

Other Scala examples (source code examples)

Here is a short list of links related to this Scala exhausting.check source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.