diff options
Diffstat (limited to 'test/files/run/verify-ctor.scala')
-rw-r--r-- | test/files/run/verify-ctor.scala | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/files/run/verify-ctor.scala b/test/files/run/verify-ctor.scala new file mode 100644 index 0000000000..17e4f71be5 --- /dev/null +++ b/test/files/run/verify-ctor.scala @@ -0,0 +1,13 @@ +class Foo(val str: String) { + def this(arr: Array[Char]) = this({ + if (arr.length == 0) exit(1) + new String(arr) + }) +} + +object Test { + def main(args: Array[String]) = { + val t = new Foo(Array('a', 'b', 'c')) + println(t.str) + } +} |