-
Notifications
You must be signed in to change notification settings - Fork 21
Closed
scala/scala
#6538Description
Aladdin: [http://scala-webapps.epfl.ch/bugtracking/bugs/displayItem.do?id=1299 bug 1299], [http://scala-webapps.epfl.ch/bugtracking/contribs/display.do?id=773 contrib 773]
== Code ==
object Foo {
// this is overly verbose
def getInt(s : String) = try {
s.toInt
} catch {
case e : NumberFormatException => 0
}
// I'd much rather write this
def getInt2(s : String) = s.toInt(0)
}== What happened ==
n/a
== What expected ==
To be able to optionally provide a default value for string-to-primitive conversion methods, much like Option.get.