Skip to content

Compiler crash when using StringContext and sttp import #21798

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
felix-hedenstrom opened this issue Oct 17, 2024 · 1 comment
Closed

Compiler crash when using StringContext and sttp import #21798

felix-hedenstrom opened this issue Oct 17, 2024 · 1 comment
Labels
itype:bug itype:crash stat:needs triage Every issue needs to have an "area" and "itype" label

Comments

@felix-hedenstrom
Copy link

Compiler version

3.5.1

Minimized code

//> using scala 3.5.1
//> using dep "com.softwaremill.sttp.client4::core:4.0.0-M19"
import sttp.client4.basicRequest

val bar = uri"bar"

Output (click arrow to expand)

exception occurred while typechecking /home/felix/Documents/reproduce/.scala-build/reproduce_bde03bda35-7818e4ce37/src_generated/main/UriBug.scala

  An unhandled exception was thrown in the compiler.
  Please file a crash report here:
  https://github.com/scala/scala3/issues/new/choose
  For non-enriched exceptions, compile with -Xno-enrich-error-messages.

     while compiling: /home/felix/Documents/reproduce/.scala-build/reproduce_bde03bda35-7818e4ce37/src_generated/main/UriBug.scala
        during phase: typer
                mode: Mode(ImplicitsEnabled)
     library version: version 2.13.14
    compiler version: version 3.5.1
            settings: -bootclasspath /home/felix/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-library_3/3.5.1/scala3-library_3-3.5.1.jar:/home/felix/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.14/scala-library-2.13.14.jar -classpath /home/felix/Documents/reproduce/.scala-build/.bloop/reproduce_bde03bda35-7818e4ce37/bloop-internal-classes/main-HUiwHVF3TrGEOj5VjwiNww==:/home/felix/Documents/reproduce/.scala-build/.bloop/reproduce_bde03bda35-7818e4ce37/bloop-internal-classes/main-FlxZ_dfnS3CAygMbbaacZw==:/home/felix/.cache/coursier/v1/https/repo1.maven.org/maven2/com/softwaremill/sttp/client4/core_3/4.0.0-M19/core_3-4.0.0-M19.jar:/home/felix/.cache/coursier/v1/https/repo1.maven.org/maven2/com/softwaremill/sttp/model/core_3/1.7.11/core_3-1.7.11.jar:/home/felix/.cache/coursier/v1/https/repo1.maven.org/maven2/com/softwaremill/sttp/shared/core_3/1.3.22/core_3-1.3.22.jar:/home/felix/.cache/coursier/v1/https/repo1.maven.org/maven2/com/softwaremill/sttp/shared/ws_3/1.3.22/ws_3-1.3.22.jar -d /home/felix/Documents/reproduce/.scala-build/.bloop/reproduce_bde03bda35-7818e4ce37/bloop-internal-classes/main-HUiwHVF3TrGEOj5VjwiNww== -sourceroot /home/felix/Documents/reproduce

Error compiling project (Scala 3.5.1, JVM (17))
Error: Unexpected error when compiling reproduce_bde03bda35-7818e4ce37: java.lang.UnsupportedOperationException: empty.reduceLeft
	at scala.collection.IterableOnceOps.reduceLeft(IterableOnce.scala:853)
	at scala.collection.IterableOnceOps.reduceLeft$(IterableOnce.scala:851)
	at scala.collection.AbstractIterable.reduceLeft(Iterable.scala:935)
	at dotty.tools.dotc.typer.Applications.widenPrefix$1(Applications.scala:1945)
@felix-hedenstrom felix-hedenstrom added itype:bug itype:crash stat:needs triage Every issue needs to have an "area" and "itype" label labels Oct 17, 2024
@felix-hedenstrom
Copy link
Author

felix-hedenstrom commented Oct 17, 2024

Looks like this is a duplicate of #21669. Maybe this could help give a lead so that you can better reproduce the issue.

I notice that I get the issue if anything (except for UriContext) is imported from sttp.client4 while trying to do a uri string interpolation.

@som-snytt som-snytt closed this as not planned Won't fix, can't repro, duplicate, stale Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
itype:bug itype:crash stat:needs triage Every issue needs to have an "area" and "itype" label
Projects
None yet
Development

No branches or pull requests

2 participants