diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-05-30 22:01:02 +0200 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2013-05-31 09:50:40 +0200 |
commit | 801720b65173d692174cf8303ef481306c12b7f4 (patch) | |
tree | b0a2f94004039cf7d870c1f7bf652422aa76df14 /test/files | |
parent | 1c6a0cf75592c201e27a6e11140c6da87de67123 (diff) | |
download | scala-801720b65173d692174cf8303ef481306c12b7f4.tar.gz scala-801720b65173d692174cf8303ef481306c12b7f4.tar.bz2 scala-801720b65173d692174cf8303ef481306c12b7f4.zip |
SI-6309 Test case for early-init / private[this] crasher.
This has worked since 98daf03, "Overhauled local/getter/setter name logic.".
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/run/t6309.check | 1 | ||||
-rw-r--r-- | test/files/run/t6309.scala | 16 |
2 files changed, 17 insertions, 0 deletions
diff --git a/test/files/run/t6309.check b/test/files/run/t6309.check new file mode 100644 index 0000000000..7f8f011eb7 --- /dev/null +++ b/test/files/run/t6309.check @@ -0,0 +1 @@ +7 diff --git a/test/files/run/t6309.scala b/test/files/run/t6309.scala new file mode 100644 index 0000000000..7bbca63c2a --- /dev/null +++ b/test/files/run/t6309.scala @@ -0,0 +1,16 @@ +trait A { + def a: Int +} + +object Test { + def f(a: Int) = new { + //private val b = a + private[this] val b = a // crashes, sorry scalac + } with A { + def a = b + } + + def main(args: Array[String]) { + println(f(7).a) + } +} |