File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
src/reflect/scala/reflect/internal
test/junit/scala/tools/nsc/backend/jvm Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -725,7 +725,7 @@ trait Symbols extends api.Symbols { self: SymbolTable =>
725
725
726
726
def setFlag (mask : Long ): this .type = { _rawflags |= mask ; this }
727
727
def resetFlag (mask : Long ): this .type = { _rawflags &= ~ mask ; this }
728
- def resetFlags () { rawflags &= TopLevelCreationFlags }
728
+ def resetFlags () { rawflags = 0 }
729
729
730
730
/** Default implementation calls the generic string function, which
731
731
* will print overloaded flags as <flag1/flag2/flag3>. Subclasses
Original file line number Diff line number Diff line change @@ -88,4 +88,15 @@ class DirectCompileTest extends BytecodeTesting {
88
88
def compileErroneous (): Unit = {
89
89
compileToBytes(" class C { def f: String = 1 }" , allowMessage = _.msg contains " type mismatch" )
90
90
}
91
+
92
+ @ Test
93
+ def residentRedefineFinalFlag (): Unit = {
94
+ val compiler = newCompiler()
95
+ val a = " final class C { def c1 = 0 }"
96
+ // for re-defined class symbols (C), the compiler did not clear the `final` flag.
97
+ // so compiling `D` would give an error `illegal inheritance from final class C`.
98
+ val b = " class C; class D extends C"
99
+ compiler.compileToBytes(a)
100
+ compiler.compileToBytes(b)
101
+ }
91
102
}
You can’t perform that action at this time.
0 commit comments