Skip to content

Commit 16c1585

Browse files
Merge pull request #9143 from dotty-staging/fix-#5793
Fix #5793: Add regression test
2 parents d6d29fc + 16f0972 commit 16c1585

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

tests/pos/i5793/A.scala

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
object exec{
2+
trait Runner[T]{
3+
def run(t: T): Unit
4+
}
5+
object Runner{
6+
def run[T: Runner](t: T): Unit = implicitly[Runner[T]].run(t)
7+
implicit inline def runImplicitly[T]: Runner[T] = new {
8+
def run(t: T) = List(()).map(x => x).head // <<<
9+
}
10+
}
11+
}

tests/pos/i5793/B.scala

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
object Main{
2+
def main(args: Array[String]): Unit = {
3+
import exec._
4+
Runner.run(Some(5))
5+
}
6+
}

0 commit comments

Comments
 (0)