Skip to content

Instantly share code, notes, and snippets.

@RobertFischer
Created May 20, 2010 20:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RobertFischer/408066 to your computer and use it in GitHub Desktop.
Save RobertFischer/408066 to your computer and use it in GitHub Desktop.
// This works
class Foo(bar:Int) {
def this(bar1:Int, bar2:Int) = this(bar1 + bar2)
}
// This works
class Foo(bar:Int) {
def this(bar1:Int, bar2:Int) = {
this(bar1 + bar2)
}
}
// This doesn't
class Foo(bar:Int) {
def this(bar1:Int, bar2:Int) = {
val summer = new Summer(bar1, bar2)
this(summer.sum())
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment