Skip to content

Error on type computation #9228

Closed
@flomebul

Description

@flomebul

Moving from Dotty 0.24-RC1 to Dotty 0.25-RC2, if found an issue.

Minimized code

object ABug {

  class Graph { class Node }

  def ltol[O](tb: List[O]): List[O] = ???

  def gtoll(using g: Graph): List[List[g.Node]] = ???

  object graph extends Graph
  import graph._
  given graph.type = graph

  val osq: List[List[Node]] = gtoll

  val r: List[List[Any ]] = ltol(gtoll)
  val q: List[List[Node]] = ltol(gtoll)

}

Output

-- [E007] Type Mismatch Error: ABug.scala:16:32 --------------------------------
16 |  val q: List[List[Node]] = ltol(gtoll)
   |                            ^^^^^^^^^^^
   |                            Found:    List[List[Any]]
   |                            Required: List[List[ABug.graph.Node]]
1 error found

Expectation

A do not have such an error in dotty 0.24

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions