Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Erroneous or Inaccessible Type compiler error #6865

Closed
scabug opened this issue Dec 22, 2012 · 3 comments
Closed

Erroneous or Inaccessible Type compiler error #6865

scabug opened this issue Dec 22, 2012 · 3 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Dec 22, 2012

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"
    }
  }
}
@scabug
Copy link
Author

scabug commented Dec 22, 2012

Imported From: https://issues.scala-lang.org/browse/SI-6865?orig=1
Reporter: Channing Walton (channingwalton)
Affected Versions: 2.10.0-RC5
See #7222
Duplicates #7239

@scabug
Copy link
Author

scabug commented Dec 24, 2012

Channing Walton (channingwalton) said:
I should add that the problem is the 'if true' which is not the right type. Its fixed with something like _ <- monadWriter.right(true)

@scabug
Copy link
Author

scabug commented Mar 26, 2013

@retronym said:
Before-the-fact duplicate of #7239, fixed in 2.10.2. See also #7222.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants