Skip to content

-Ycheck:inlinedPositions failure with Tuples and multiple inlined calls #6507

Closed
@milessabin

Description

@milessabin

The simplest reproduction I could come up with,

object Test {
  inline def s1 = 47 *: s2

  inline def s2 = 48 *: s3

  inline def s3 = 49 *: ()

  s1
}

fails with,

java.lang.AssertionError: assertion failed: wrong source set for 49 # 1264 of class dotty.tools.dotc.ast.Trees$Literal, set to tests/pos/ixxxx.scala but context had /home/miles/projects/dotty/library/src-3.x/scala/Tuple.scala while compiling tests/pos/ixxxx.scala
Exception in thread "main" java.lang.AssertionError: assertion failed: wrong source set for 49 # 1264 of class dotty.tools.dotc.ast.Trees$Literal, set to tests/pos/ixxxx.scala but context had /home/miles/projects/dotty/library/src-3.x/scala/Tuple.scala

The original was a (fairly simple) recursive case,

import scala.compiletime._

object Test {
  inline def summonValues[T] <: Tuple = inline erasedValue[T] match {
    case _: Unit => ()
    case _: (a *: b) => constValue[a] *: summonValues[b]
  }

  summonValues[(96, 97, 98)]
}

which fails similarly with,

java.lang.AssertionError: assertion failed: wrong source set for 98 # 1605 of class dotty.tools.dotc.ast.Trees$Literal, set to tests/pos/ixxxx.scala but context had /home/miles/projects/dotty/library/src-3.x/scala/Tuple.scala while compiling tests/pos/ixxxx.scala
Exception in thread "main" java.lang.AssertionError: assertion failed: wrong source set for 98 # 1605 of class dotty.tools.dotc.ast.Trees$Literal, set to tests/pos/ixxxx.scala but context had /home/miles/projects/dotty/library/src-3.x/scala/Tuple.scala

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions