Closed
Description
Compiler version
3.1.1
Minimized code
Here's a Scastie link
sealed trait Schema[A]
object Schema extends RecordInstances:
case class Field[A]()
sealed trait RecordInstances:
self: Schema.type =>
case class Record[A](field: Field[A]) extends Schema[A]
import Schema._
val field: Field[Int] = Field()
// Uh oh Found Playground.Schema.Field[Int] but Requried RecordInstances.this.Field[Int]
val record = Record[Int](field)
Expectation
I would expect to be able to instantiate my record correctly. This actually will compile if I delete theField[Int]
type ascription on val field
(https://scastie.scala-lang.org/y6cLE8oXRE6bXmCcYH5lLw).