- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1.1k
Open
Labels
Milestone
Description
Compiler version
3.2.2 RC2
Minimized example
Two files.
// boundary.scala
object boundary:
  transparent inline def apply[R](inline body: R): R =  // works if `transparent` is dropped
    body2nd file:
// Test.scala
inline def f [T](fallback: => T) = fallback
def foo(x: Int): Int = boundary.apply {
  f(10)
}Output
Under -Ycheck:all:
*** error while checking Test.scala after phase inlining ***
java.lang.AssertionError: assertion failed: wrong source set for 10 # -1 of class dotty.tools.dotc.ast.Trees$Literal, set to boundary.scala but context had Test.scala
 <permanent> while running Ycheck on Test.scala
exception occurred while compiling Test.scala, boundary.scala
java.lang.AssertionError: assertion failed: wrong source set for 10 # -1 of class dotty.tools.dotc.ast.Trees$Literal, set to boundary.scala but context had Test.scala
 <permanent> while compiling Test.scala, boundary.scala
Exception in thread "main" java.lang.AssertionError: assertion failed: wrong source set for 10 # -1 of class dotty.tools.dotc.ast.Trees$Literal, set to boundary.scala but context had Test.scala
 <permanent>
	at scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:8)
	at dotty.tools.dotc.transform.YCheckPositions$$anon$1.traverse(YCheckPositions.scala:36)
	at dotty.tools.dotc.transform.YCheckPositions$$anon$1.traverse(YCheckPositions.scala:45)
	at dotty.tools.dotc.ast.Trees$Instance$TreeTraverser.apply(Trees.scala:1655)
	at dotty.tools.dotc.ast.Trees$Instance$TreeTraverser.apply(Trees.scala:1655)
	at dotty.tools.dotc.ast.Trees$Instance$TreeAccumulator.foldOver(Trees.scala:1554)
	at dotty.tools.dotc.ast.Trees$Instance$TreeTraverser.traverseChildren(Trees.scala:1656)Expectation
Should pass Ycheck