scalac is checking that you have a case for each possible pattern for  
the given value, which it can determine because Box and its subclasses  
are sealed.

In this case, you explicitly handle Full and Empty, but do not  
consider Failure or its subclass ParamFailure, which will cause a  
MatchError at runtime if selectedTag is one of those.

Add a case for Failure, or change your case Empty => to case _ => and  
the warning will probably go away.

-Ross

On Aug 28, 2009, at 11:51 PM, g-man wrote:

>
> I am getting this warning during compile of my ToDo tutorial app
> enhancement:
>
> ToDo.scala:355: warning: match is not exhaustive!
> missing combination   ParamFailure
> missing combination             Failure
>          case Nil =>  selectedTag match {
>
> My code is:
>
>        currentTask.validate match {
>          case Nil =>  selectedTag match {
>            case Full(currentTag) => if (! currentTask.saved_?) {
>              currentTask.save
>              JoinTags.joinTask(currentTag, currentTask)
>              S.notice("added Task: " + currentTask.desc.is)
>            }
>            case Empty => S.error("..please supply a Tag");
> S.mapSnippet("ToDo.addTask", doTaskBind)
>          }
>          case xs => S.error(xs); S.mapSnippet("ToDo.addTask",
> doTaskBind)
>        }
>
> The code runs fine so far... Is it the nested match?
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to