Skip to content

Illegal flagset combination for Java Enums in sealedStrictDescendants #15908

Closed
@jkciesluk

Description

@jkciesluk

Compiler version

3.2.1-RC1-bin-20220816-cf4dd05-NIGHTLY

While using sealedStrictDescendants on Java enum symbol got

Aug 25, 2022 10:09:03 AM scala.meta.internal.pc.CompilerAccess handleError
SEVERE: assertion failed: illegal flagset combination: final <java> <static> enum <touched> and <children-queried>
java.lang.AssertionError: assertion failed: illegal flagset combination: final <java> <static> enum <touched> and <children-queried>
        at scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:8)
        at dotty.tools.dotc.core.Flags$.$bar(Flags.scala:40)
        at dotty.tools.dotc.core.SymDenotations$SymDenotation.setFlag(SymDenotations.scala:81)
        at dotty.tools.dotc.core.SymDenotations$SymDenotation.children(SymDenotations.scala:1629)
        at dotty.tools.dotc.core.SymDenotations$SymDenotation.findLvl2$1(SymDenotations.scala:1666)
        at dotty.tools.dotc.core.SymDenotations$SymDenotation.sealedStrictDescendants(SymDenotations.scala:1687)
        at scala.meta.internal.pc.completions.CaseKeywordCompletion$.v$proxy1$1(MatchCaseCompletions.scala:218)
        at scala.meta.internal.pc.completions.CaseKeywordCompletion$.subclassesForType$1$$anonfun$1(MatchCaseCompletions.scala:218)
        at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
        at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
        at scala.collection.immutable.List.foreach(List.scala:333)
        at scala.meta.internal.pc.completions.CaseKeywordCompletion$.subclassesForType$1(MatchCaseCompletions.scala:222)
        at scala.meta.internal.pc.completions.CaseKeywordCompletion$.matchContribute(MatchCaseCompletions.scala:228)
        at scala.meta.internal.pc.completions.Completions.advancedCompletions(Completions.scala:438)
        at scala.meta.internal.pc.completions.Completions.completions(Completions.scala:166)
        at scala.meta.internal.pc.completions.CompletionsProvider.completions(CompletionsProvider.scala:77)

Tested on java.nio.file.AccessMode
Using symbol.children instead works fine.

Expectation

Using symbol.sealedStrictDescendants on Java enum symbols should work the same as symbol.children.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions