diff options
author | Lukas Rytz <lukas.rytz@gmail.com> | 2016-05-25 15:21:50 +0200 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2016-06-06 14:37:46 +1000 |
commit | 59d6dbc0aac912567d235048b5114cccf965c7ce (patch) | |
tree | f4bc57382dba28f49b510c49e34aff22015629b6 /test/junit | |
parent | 037a089ad4fb7137513777ccda6d47e30e151838 (diff) | |
download | scala-59d6dbc0aac912567d235048b5114cccf965c7ce.tar.gz scala-59d6dbc0aac912567d235048b5114cccf965c7ce.tar.bz2 scala-59d6dbc0aac912567d235048b5114cccf965c7ce.zip |
clear all flags when resetting a symbol
this change is a bit scary because it changes code that's not been
changed in 11 years
https://github.com/scala/scala/commit/7fa7c93#diff-d5789e5ae5061197d782d08324b260dbL214
Diffstat (limited to 'test/junit')
-rw-r--r-- | test/junit/scala/tools/nsc/backend/jvm/DirectCompileTest.scala | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/junit/scala/tools/nsc/backend/jvm/DirectCompileTest.scala b/test/junit/scala/tools/nsc/backend/jvm/DirectCompileTest.scala index f835e9b140..36bdb759a6 100644 --- a/test/junit/scala/tools/nsc/backend/jvm/DirectCompileTest.scala +++ b/test/junit/scala/tools/nsc/backend/jvm/DirectCompileTest.scala @@ -88,4 +88,15 @@ class DirectCompileTest extends BytecodeTesting { def compileErroneous(): Unit = { compileToBytes("class C { def f: String = 1 }", allowMessage = _.msg contains "type mismatch") } + + @Test + def residentRedefineFinalFlag(): Unit = { + val compiler = newCompiler() + val a = "final class C { def c1 = 0 }" + // for re-defined class symbols (C), the compiler did not clear the `final` flag. + // so compiling `D` would give an error `illegal inheritance from final class C`. + val b = "class C; class D extends C" + compiler.compileToBytes(a) + compiler.compileToBytes(b) + } } |