Skip to content

Regression 3.4.0+: scenario where Tuple.InverseMap does not compute the expected type #20538

Closed
@kavedaa

Description

@kavedaa

Compiler version

3.4.0 and higher

Minimized code

//> using scala 3.4.0

trait Column:
  type T
  type F[X]
  type Q = F[T]

class varchar extends Column:
  type T = String

trait notnull extends Column:
  type F[X] = X

object Error:

  val firstName = new varchar with notnull
  val lastName = new varchar with notnull

  val relation = (firstName, lastName)

  type RelationTypes = Tuple.InverseMap[relation.type, [X] =>> Column { type Q = X }]

  summon[RelationTypes =:= (String, String)]

object Works:

  object firstName extends varchar with notnull
  object lastName extends varchar with notnull

  val relation = (firstName, lastName)

  type RelationTypes = Tuple.InverseMap[relation.type, [X] =>> Column { type Q = X }]

  summon[RelationTypes =:= (String, String)]

Output

Compiling project (Scala 3.4.0, JVM (8))
[error] .\test.scala:23:45
[error] Cannot prove that Error.RelationTypes =:= (String, String).
[error]   summon[RelationTypes =:= (String, String)]
[error]                                             ^
Error compiling project (Scala 3.4.0, JVM (8))
Compilation failed

Expectation

Successful compilation.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions