Skip to content
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

Immediate tracked parameter access crashes under -Ycheck:all #22540

Open
KacperFKorban opened this issue Feb 6, 2025 · 0 comments
Open

Immediate tracked parameter access crashes under -Ycheck:all #22540

KacperFKorban opened this issue Feb 6, 2025 · 0 comments
Labels
area:experimental:modularity Issues related to the modularity extension. itype:bug itype:crash

Comments

@KacperFKorban
Copy link
Member

Compiler version

a56c622

Minimized code

//> using scala 3.nightly
//> using options -Ycheck:all

import scala.language.experimental.modularity
 
class C(tracked val x: Int)

object Test:
  val n = 1
  val nFromC = C(n).x

Output

checking wiadro/tracked-param-access.scala after phase typer
checking wiadro/tracked-param-access.scala after phase inlinedPositions
checking wiadro/tracked-param-access.scala after phase posttyper
checking wiadro/tracked-param-access.scala after phase unrollDefs
checking wiadro/tracked-param-access.scala after phase pickler
checking wiadro/tracked-param-access.scala after phase inlining
checking wiadro/tracked-param-access.scala after phase postInlining
checking wiadro/tracked-param-access.scala after phase staging
checking wiadro/tracked-param-access.scala after phase splicing
checking wiadro/tracked-param-access.scala after phase pickleQuotes
checking wiadro/tracked-param-access.scala after phase MegaPhase{crossVersionChecks, firstTransform, checkReentrant, elimPackagePrefixes, cookComments, checkLoopingImplicits, betaReduce, inlineVals, expandSAMs, elimRepeated, refchecks}
*** error while checking wiadro/tracked-param-access.scala after phase MegaPhase{crossVersionChecks, firstTransform, checkReentrant, elimPackagePrefixes, cookComments, checkLoopingImplicits, betaReduce, inlineVals, expandSAMs, elimRepeated, refchecks} ***

  unhandled exception while running Ycheck on wiadro/tracked-param-access.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: wiadro/tracked-param-access.scala
        during phase: Ycheck
                mode: Mode(ImplicitsEnabled)
     library version: version 2.13.16
    compiler version: version 3.7.0-RC1-bin-20250204-d75ca7f-NIGHTLY-git-d75ca7f
            settings: -Ycheck List(all) -classpath .cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-library_3/3.7.0-RC1-bin-20250204-d75ca7f-NIGHTLY/scala3-library_3-3.7.0-RC1-bin-20250204-d75ca7f-NIGHTLY.jar:.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.16/scala-library-2.13.16.jar -d wiadro/.scala-build/wiadro_ef31ba4fc4-e1502f11ac/classes/main -sourceroot wiadro

Exception in thread "main" java.lang.AssertionError: assertion failed: non member selection of value n in object Test from C{val x: (Test.n : Int)} in new C(Test.n).n
	at scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:8)
	at dotty.tools.dotc.transform.FirstTransform.checkPostCondition(FirstTransform.scala:67)
	at dotty.tools.dotc.transform.TreeChecker$.dotty$tools$dotc$transform$TreeChecker$Checker$$_$typedUnadapted$$anonfun$1(TreeChecker.scala:439)
	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:334)
	at dotty.tools.dotc.transform.TreeChecker$Checker.typedUnadapted(TreeChecker.scala:439)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3690)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3695)
	at dotty.tools.dotc.transform.TreeChecker$Checker.typed(TreeChecker.scala:416)
	at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3806)
	at dotty.tools.dotc.typer.Typer.typedValDef(Typer.scala:2860)
	at dotty.tools.dotc.transform.TreeChecker$Checker.typedValDef(TreeChecker.scala:622)
	at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:3507)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:3612)
	at dotty.tools.dotc.transform.TreeChecker$Checker.typedUnadapted(TreeChecker.scala:434)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3690)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3695)
	at dotty.tools.dotc.transform.TreeChecker$Checker.typed(TreeChecker.scala:416)
	at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:3717)
	at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:3763)
	at dotty.tools.dotc.transform.TreeChecker$Checker.typedStats(TreeChecker.scala:691)
	at dotty.tools.dotc.typer.Typer.typedClassDef(Typer.scala:3192)
	at dotty.tools.dotc.transform.TreeChecker$Checker.typedClassDef(TreeChecker.scala:618)
	at dotty.tools.dotc.typer.Typer.typedTypeOrClassDef$1(Typer.scala:3516)
	at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:3520)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:3612)
	at dotty.tools.dotc.transform.TreeChecker$Checker.typedUnadapted(TreeChecker.scala:434)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3690)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3695)
	at dotty.tools.dotc.transform.TreeChecker$Checker.typed(TreeChecker.scala:416)
	at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:3717)
	at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:3763)
	at dotty.tools.dotc.transform.TreeChecker$Checker.typedStats(TreeChecker.scala:691)
	at dotty.tools.dotc.typer.Typer.typedPackageDef(Typer.scala:3325)
	at dotty.tools.dotc.transform.TreeChecker$Checker.typedPackageDef(TreeChecker.scala:717)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:3562)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:3613)
	at dotty.tools.dotc.transform.TreeChecker$Checker.typedUnadapted(TreeChecker.scala:434)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3690)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3695)
	at dotty.tools.dotc.transform.TreeChecker$Checker.typed(TreeChecker.scala:416)
	at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3806)
	at dotty.tools.dotc.transform.TreeChecker.check(TreeChecker.scala:131)
	at dotty.tools.dotc.transform.TreeChecker.run(TreeChecker.scala:111)
	at dotty.tools.dotc.core.Phases$Phase.runOn$$anonfun$1(Phases.scala:383)
	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:334)
	at dotty.tools.dotc.core.Phases$Phase.runOn(Phases.scala:376)
	at dotty.tools.dotc.Run.runPhases$1$$anonfun$1(Run.scala:345)
	at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
	at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
	at scala.collection.ArrayOps$.foreach$extension(ArrayOps.scala:1324)
	at dotty.tools.dotc.Run.runPhases$1(Run.scala:338)
	at dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:385)
	at dotty.tools.dotc.Run.compileUnits$$anonfun$adapted$1(Run.scala:397)
	at dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:69)
	at dotty.tools.dotc.Run.compileUnits(Run.scala:397)
	at dotty.tools.dotc.Run.compileSources(Run.scala:284)
	at dotty.tools.dotc.Run.compile(Run.scala:269)
	at dotty.tools.dotc.Driver.doCompile(Driver.scala:37)
	at dotty.tools.dotc.Driver.process(Driver.scala:201)
	at dotty.tools.dotc.Driver.process(Driver.scala:169)
	at dotty.tools.dotc.Driver.process(Driver.scala:181)
	at dotty.tools.dotc.Driver.main(Driver.scala:211)
	at dotty.tools.dotc.Main.main(Main.scala)

Expectation

Successful compilation

@KacperFKorban KacperFKorban added area:experimental:modularity Issues related to the modularity extension. itype:bug itype:crash labels Feb 6, 2025
@KacperFKorban KacperFKorban changed the title immediate tracked parameter crashes under -Ycheck:all Immediate tracked parameter access crashes under -Ycheck:all Feb 6, 2025
KacperFKorban added a commit to dotty-staging/dotty that referenced this issue Feb 6, 2025
KacperFKorban added a commit to dotty-staging/dotty that referenced this issue Feb 7, 2025
KacperFKorban added a commit to dotty-staging/dotty that referenced this issue Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:experimental:modularity Issues related to the modularity extension. itype:bug itype:crash
Projects
None yet
Development

No branches or pull requests

1 participant