Skip to content

Out of memory on opaque type usage in enclosed class #16740

Closed
@Adam-Vandervorst

Description

@Adam-Vandervorst

Compiler version

3.2.1

Minimized code

class Enclosing:
  object Tags:
    opaque type Ref[T, S <: String & Singleton] = S
    inline def require[T, S <: String & Singleton]: Ref[T, S] = ???
  import Tags.*

  val t1 = require[Int, "t1"]
  val t2 = require[Double, "t2"]

Output (click arrow to expand)

java.lang.OutOfMemoryError: Java heap space
	at dotty.tools.dotc.ast.untpd$.TypeApply(untpd.scala:378)
	at dotty.tools.dotc.ast.tpd$.TypeApply(tpd.scala:55)
	at dotty.tools.dotc.ast.tpd$TreeOps$.appliedToTypeTrees$extension(tpd.scala:969)
	at dotty.tools.dotc.ast.tpd$TreeOps$.appliedToTypes$extension(tpd.scala:961)
	at dotty.tools.dotc.ast.tpd$TreeOps$.appliedToType$extension(tpd.scala:957)
	at dotty.tools.dotc.ast.tpd$TreeOps$.asInstance$extension(tpd.scala:998)
	at dotty.tools.dotc.transform.Erasure$Boxing$.cast(Erasure.scala:371)
	at dotty.tools.dotc.transform.Erasure$Typer.recur$1(Erasure.scala:785)
	at dotty.tools.dotc.transform.Erasure$Typer.typedSelect(Erasure.scala:789)
	at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2889)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2982)
	at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3050)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3054)
	at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3170)
	at dotty.tools.dotc.typer.Typer.typedValDef(Typer.scala:2295)
	at dotty.tools.dotc.transform.Erasure$Typer.typedValDef(Erasure.scala:897)
	at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2893)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2982)
	at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3050)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3054)
	at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:3076)
	at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:3126)
	at dotty.tools.dotc.transform.Erasure$Typer.typedStats(Erasure.scala:1043)
	at dotty.tools.dotc.typer.Typer.typedBlockStats(Typer.scala:1060)
	at dotty.tools.dotc.typer.Typer.typedInlined(Typer.scala:1916)
	at dotty.tools.dotc.transform.Erasure$Typer.typedInlined(Erasure.scala:888)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2942)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2983)
	at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3050)
[error] [launcher] error during sbt launcher: java.lang.OutOfMemoryError: Java heap space

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions