Skip to content

Commit

Permalink
Defer setting sealed from source to follow-up
Browse files Browse the repository at this point in the history
  • Loading branch information
som-snytt committed Apr 24, 2023
1 parent 2e36049 commit 80ee36a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/compiler/scala/tools/nsc/javac/JavaParsers.scala
Expand Up @@ -494,7 +494,7 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners {
in.nextToken()
case _ =>
val unsealed = 0L // no flag for UNSEALED
def consume(added: FlagSet): false = { in.nextToken(); flags |= added; false }
def consume(added: FlagSet): false = { in.nextToken(); /*flags |= added;*/ false }
def lookingAhead(s: String): Boolean = {
import scala.reflect.internal.Chars._
var i = 0
Expand Down
9 changes: 3 additions & 6 deletions test/files/neg/t12159.check
@@ -1,7 +1,4 @@
s.scala:5: error: illegal inheritance from sealed class H
class S extends H {
s.scala:11: error: not found: type ZZ
class Z extends ZZ // fail compile: remove when source flags are restored
^
s.scala:8: error: illegal inheritance from sealed trait I
trait T extends I {
^
2 errors
1 error
2 changes: 2 additions & 0 deletions test/files/neg/t12159/s.scala
Expand Up @@ -7,3 +7,5 @@ class S extends H {

trait T extends I {
}

class Z extends ZZ // fail compile: remove when source flags are restored

0 comments on commit 80ee36a

Please sign in to comment.