Skip to content

Instantly share code, notes, and snippets.

@slyphon
Created June 12, 2009 09:07
Show Gist options
  • Save slyphon/128530 to your computer and use it in GitHub Desktop.
Save slyphon/128530 to your computer and use it in GitHub Desktop.
object MyEnum extends Enumeration {
val One = Value("one")
val Two = Value("two")
}
class Blah {
import MyEnum._
def doStuff():Option[MyEnum.Value] = {
shouldReturnAnOption.getOrElse(None)
}
def shouldReturnAnOption:Option[MyEnum.Value] = None
}
/***********
WTF.scala:11: error: type mismatch;
found : ScalaObject
required: Option[MyEnum.Value]
shouldReturnAnOption.getOrElse(None)
^
one error found
*************/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment