Skip to content

Erroneous or Inaccessible Type compiler error #6865

@scabug

Description

@scabug

The following code fails to compile with a 'Erroneous or inaccessible type' error which I believe is not correct.

object CompileError {

  import scalaz._
  import Scalaz._

  object IsItABug {

    implicit val monadWriter = EitherT.listenableMonadWriter[Writer, String, String]

    def apply(opt: Option[String]) = {

      def lift[T](o: Option[T], name: String) = o match {
        case None     monadWriter.left[T]("The " + name + " is missing.\n")
        case Some(m)  monadWriter.right[T](m) :++>> (_  "The " + name + " is present.\n")
      }

      def oops() =
        for {
          s  lift(opt, "Blah") // erroneous or inaccessible type error here
          if true
        } yield "x"
    }
  }
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions