Skip to content

Case where -Ypartial-unification fails #10310

@m50d

Description

@m50d

Simplified/standalone version of the first failure case I'm hitting from tierney. testSuccess compiles (by passing explicit type parameters), testFail does not (even with -Ypartial-unification) whereas I would (maybe) expect it to?

object Demo {
  trait Free1[F[_], A]
  trait Free2[F[_], A]
  trait Cp[F[_], G[_], A]

  class Fix[W[_[_[_], _], _[_], _], F[_], A]()
  type Unfixed[S[_[_], _], F[_], A] = 
    Cp[F, Free1[Free2[S[F, ?], ?], ?], A]
  
  trait Command[A]
  
  def unify[F[_], A](value: F[A]): Unit = {}
  
  def testSuccess(v: Free2[Fix[Unfixed, Command, ?], String]) =
    unify[Free2[Fix[Unfixed, Command, ?], ?], String](v)
    
  def testFail(v: Free2[Fix[Unfixed, Command, ?], String]) =
    unify(v)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions