New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Value class calls private method: crash #6215
Comments
Imported From: https://issues.scala-lang.org/browse/SI-6215?orig=1 |
@som-snytt said (edited on Sep 28, 2012 5:30:10 PM UTC): I realize that in Scala there is no expectation of privacy. object `package` {
/* crashes
implicit class MaybeInt(val s: String) extends AnyVal {
def toInt_? : Option[Int] = if (s.isEmpty) None else convert
private def convert = try { Some(Integer.parseInt(s)) } catch { case _: NumberFormatException => None }
}
*/
/* OK
implicit class MaybeInt(val s: String) extends AnyVal {
def toInt_? : Option[Int] = if (s.isEmpty) None else convert
def convert = try { Some(Integer.parseInt(s)) } catch { case _: NumberFormatException => None }
}
*/
/* OK
implicit class MaybeInt(val s: String) {
def toInt_? : Option[Int] = if (s.isEmpty) None else convert
private def convert = try { Some(Integer.parseInt(s)) } catch { case _: NumberFormatException => None }
}
*/
} |
@paulp said: |
@odersky said: |
@adriaanm said: |
@gkossakowski said: |
The text was updated successfully, but these errors were encountered: