Created
September 30, 2014 15:47
-
-
Save RobertFischer/a6505037471c89aa3d03 to your computer and use it in GitHub Desktop.
When Option.get() isn't...
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
scala> var opt = Some("Foo") | |
opt: Some[String] = Some(Foo) | |
So far, so good. I want to get the value from my Some. Checking the API for Option, and there's a .get() to retrieve the value — http://www.scala-lang.org/api/current/index.html#scala.Option | |
scala> opt.get() | |
<console>:9: error: not enough arguments for method apply: (index: Int)Char in class StringOps. | |
Unspecified value parameter index. | |
opt.get() | |
^ | |
Wait, what? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment