Skip to content

Commit 2ed4df9

Browse files
Merge pull request #7899 from dotty-staging/fix-#7890
Fix #7890: Add test case
2 parents 1863077 + 45a8ac8 commit 2ed4df9

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/neg/i7890.scala

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
trait Instrument {
2+
type R
3+
def result: R
4+
}
5+
6+
trait InstrumentFactory[I <: Instrument] {
7+
def createInstrument: I
8+
}
9+
10+
case class Instrumented[I <: Instrument](
11+
instrumentation: I#R) // error
12+
13+
def instrumented[D, I <: Instrument](instrumentFactory: InstrumentFactory[I]): Instrumented[I] = {
14+
val instrument = instrumentFactory.createInstrument
15+
Instrumented(instrument.result)
16+
}

0 commit comments

Comments
 (0)