diff --git a/tests/neg/i7890.scala b/tests/neg/i7890.scala new file mode 100644 index 000000000000..a1f84ee46dde --- /dev/null +++ b/tests/neg/i7890.scala @@ -0,0 +1,16 @@ +trait Instrument { + type R + def result: R +} + +trait InstrumentFactory[I <: Instrument] { + def createInstrument: I +} + +case class Instrumented[I <: Instrument]( + instrumentation: I#R) // error + +def instrumented[D, I <: Instrument](instrumentFactory: InstrumentFactory[I]): Instrumented[I] = { + val instrument = instrumentFactory.createInstrument + Instrumented(instrument.result) +} \ No newline at end of file