Closed
Description
I was trying to investigate something about how dotty infers types that scalac infers as existential "forSome" types. Alas the REPL only shows me an error that seems to come from the code generation phase of the REPL itself.
scala>
object foo {
trait ShapeLevel
trait FlatShapeLevel extends ShapeLevel
trait ColumnsShapeLevel extends FlatShapeLevel
abstract class Shape[Level <: ShapeLevel, -Mixed, Unpacked, Packed]
object Shape extends TupleShapeImplicits { }
trait TupleShapeImplicits {
implicit final def tuple2Shape[Level <: ShapeLevel, M1,M2, U1,U2, P1,P2](implicit u1: Shape[_ <: Level, M1, U1, P1], u2: Shape[_ <: Level, M2, U2, P2]): Shape[Level, (M1,M2), (U1,U2), (P1,P2)] = ???
}
}
defined module foo
scala> import foo._
import foo._
scala> implicit val shape: Shape[_ <: FlatShapeLevel, Int, Int, _] = null
val shape: foo.Shape[_ <: foo.FlatShapeLevel, Int, Int, _] = null
scala> def hint = Shape.tuple2Shape(shape, shape)
-- Error: <console>:4:4 --------------------------------------------------------
4 |(""+"def hint: foo.Shape[foo.FlatShapeLevel, (Int, Int), (Int, Int), (shape.Packed,
| ^
| unclosed string literal
-- [E039] Syntax Error: <console>:6:1 ------------------------------------------
6 |)]\n"
| ^
| ';' expected, but `Packed` found
Metadata
Metadata
Assignees
Labels
No labels