Skip to content

JavaFX 24 dependencies causing compiler errors #7573

Closed
scala/scala3
#23414
@RumbleTumbleKid

Description

@RumbleTumbleKid

Describe the bug

Adding JavaFX 24 dependencies to a project causes compiler errors, resulting in malfunctioning autocomplete etc.

Simple project:

//> using scala 3.7.1
//> using dep org.scalafx::scalafx::24.0.0-R35

@main
def main(): Unit = 
    val s: Scene = ???

causing Metals error:

#### Error stacktrace:

scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:8)
	dotty.tools.dotc.core.classfile.ClassfileParser$AbstractConstantPool.getSuperClass(ClassfileParser.scala:175)
	dotty.tools.dotc.core.classfile.ClassfileParser.parseParents$1(ClassfileParser.scala:380)
	dotty.tools.dotc.core.classfile.ClassfileParser.parseClass(ClassfileParser.scala:395)
	dotty.tools.dotc.core.classfile.ClassfileParser.$anonfun$1(ClassfileParser.scala:302)
	dotty.tools.dotc.core.classfile.ClassfileParser.run(ClassfileParser.scala:297)
	dotty.tools.dotc.core.ClassfileLoader.doComplete(SymbolLoaders.scala:471)
	dotty.tools.dotc.core.SymbolLoader$$anon$1.doComplete(SymbolLoaders.scala:378)
	dotty.tools.dotc.core.SymbolLoader.complete(SymbolLoaders.scala:402)
	dotty.tools.dotc.core.SymDenotations$SymDenotation.completeFrom(SymDenotations.scala:175)
	dotty.tools.dotc.core.SymDenotations$SymDenotation.completeOnce(SymDenotations.scala:385)
	dotty.tools.dotc.core.SymDenotations$SymDenotation.isAbsent(SymDenotations.scala:615)
	dotty.tools.dotc.interactive.Completion$.isValidCompletionSymbol(Completion.scala:340)
	dotty.tools.dotc.interactive.Completion$Completer.dotty$tools$dotc$interactive$Completion$Completer$$include(Completion.scala:658)
	dotty.tools.dotc.interactive.Completion$Completer$$anon$5.applyOrElse(Completion.scala:687)
	dotty.tools.dotc.interactive.Completion$Completer$$anon$5.applyOrElse(Completion.scala:686)
	scala.collection.immutable.List.collect(List.scala:268)
	scala.collection.immutable.List.collect(List.scala:79)
	dotty.tools.dotc.interactive.Completion$Completer.accessibleMembers(Completion.scala:688)
	dotty.tools.dotc.interactive.Completion$Completer.scopeCompletions$$anonfun$1(Completion.scala:412)
	scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
	scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
	scala.collection.IterableOnceOps.foreach(IterableOnce.scala:619)
	scala.collection.IterableOnceOps.foreach$(IterableOnce.scala:617)
	dotty.tools.dotc.core.Contexts$Context$$anon$2.foreach(Contexts.scala:135)
	dotty.tools.dotc.interactive.Completion$Completer.scopeCompletions(Completion.scala:402)
	dotty.tools.dotc.interactive.Completion$.scopeContext(Completion.scala:59)
	dotty.tools.pc.IndexedContext$LazyWrapper.<init>(IndexedContext.scala:91)
	dotty.tools.pc.IndexedContext$.apply(IndexedContext.scala:80)
	dotty.tools.pc.completions.CompletionProvider.completions(CompletionProvider.scala:110)
	dotty.tools.pc.ScalaPresentationCompiler.complete$$anonfun$1(ScalaPresentationCompiler.scala:191)
#### Short summary: 

java.lang.AssertionError: assertion failed: attempt to parse java.lang.Object from classfile

Expected behavior

No response

Operating system

Windows

Editor/Extension

VS Code

Version of Metals

v1.6.0

Extra context or search terms

No response

Activity

tgodzik

tgodzik commented on Jun 17, 2025

@tgodzik
Contributor

Thanks for reporting! I started looking at it, but it seems more complex than first assumed. Will probably have another look later this week.

added theissue type on Jun 17, 2025
added
bugSomething that is making a piece of functionality unusable
Scala 3Generic ticket relating to Scala 3
on Jun 17, 2025
tgodzik

tgodzik commented on Jun 23, 2025

@tgodzik
Contributor

Looks to be related to scala/scala3#20421 (comment)

tgodzik

tgodzik commented on Jun 24, 2025

@tgodzik
Contributor

Should be fixed by scala/scala3#23414

RumbleTumbleKid

RumbleTumbleKid commented on Jun 29, 2025

@RumbleTumbleKid
Author

Should be fixed by scala/scala3#23414

Metals SNAPSHOT works with the OP project but not with this one:

//> using dep io.grpc:grpc-netty:1.73.0
//> using dep com.thesamet.scalapb::scalapb-runtime-grpc::1.0.0-alpha.1

@main def main(): Unit = ???

same error

tgodzik

tgodzik commented on Jul 1, 2025

@tgodzik
Contributor

Looks like the same error, will be fixed in 3.3.7 and 3.7.3 compiler versions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Scala 3Generic ticket relating to Scala 3bugSomething that is making a piece of functionality unusable

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @tgodzik@RumbleTumbleKid

      Issue actions

        JavaFX 24 dependencies causing compiler errors · Issue #7573 · scalameta/metals