"error: erroneous or inaccessible type"

1,305 views
Skip to first unread message

Nils Kilden-Pedersen

unread,
Jul 17, 2013, 6:10:57 PM7/17/13
to scala-user, scala-i...@googlegroups.com

After upgrading to 2.10.2, I've come to a complete stand-still. On a rather small project (~150 classes), I'm hitting error: erroneous or inaccessible type 13 different places with no clue whatsoever as to the cause.

I've seen numerous bugs filed that match this description, some of them marked fixed, others not.

Can anyone offer some clue on how to proceed? Any workaround would be much appreciated.

Grzegorz Kossakowski

unread,
Jul 17, 2013, 6:55:23 PM7/17/13
to scala-internals, scala-user
Can you show us complete output of Scala compiler? For example, does it report positions in source files where error occurs?

--
Grzegorz Kossakowski
Scalac hacker at Typesafe
twitter: @gkossakowski

Som Snytt

unread,
Jul 17, 2013, 7:15:24 PM7/17/13
to scala-internals, scala-user
After upgrading to 2.10.2, I've come to a complete stand-still.

That happens to me, too.

It's like you've arrived at the lip of the Grand Canyon, and you just stand there in shock and awe at the wonder of it all.
 


--
You received this message because you are subscribed to the Google Groups "scala-internals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-interna...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Nils Kilden-Pedersen

unread,
Jul 17, 2013, 8:01:30 PM7/17/13
to scala-i...@googlegroups.com, scala-user
On Wed, Jul 17, 2013 at 5:55 PM, Grzegorz Kossakowski <grzegorz.k...@gmail.com> wrote:
On 17 July 2013 15:10, Nils Kilden-Pedersen <nil...@gmail.com> wrote:

After upgrading to 2.10.2, I've come to a complete stand-still. On a rather small project (~150 classes), I'm hitting error: erroneous or inaccessible type 13 different places with no clue whatsoever as to the cause.

I've seen numerous bugs filed that match this description, some of them marked fixed, others not.

Can anyone offer some clue on how to proceed? Any workaround would be much appreciated.

Can you show us complete output of Scala compiler? For example, does it report positions in source files where error occurs?

I think I have it figured out. In my case, it was probably some funky cake inheritance gone horribly wrong. At least removing some of that made those, seemingly unrelated, errors go away.

 


--
Grzegorz Kossakowski
Scalac hacker at Typesafe
twitter: @gkossakowski

Grzegorz Kossakowski

unread,
Jul 17, 2013, 8:04:49 PM7/17/13
to scala-internals, scala-user
On 17 July 2013 17:01, Nils Kilden-Pedersen <ni...@kilden-pedersen.net> wrote:
On Wed, Jul 17, 2013 at 5:55 PM, Grzegorz Kossakowski <grzegorz.k...@gmail.com> wrote:
On 17 July 2013 15:10, Nils Kilden-Pedersen <nil...@gmail.com> wrote:

After upgrading to 2.10.2, I've come to a complete stand-still. On a rather small project (~150 classes), I'm hitting error: erroneous or inaccessible type 13 different places with no clue whatsoever as to the cause.

I've seen numerous bugs filed that match this description, some of them marked fixed, others not.

Can anyone offer some clue on how to proceed? Any workaround would be much appreciated.

Can you show us complete output of Scala compiler? For example, does it report positions in source files where error occurs?

I think I have it figured out. In my case, it was probably some funky cake inheritance gone horribly wrong. At least removing some of that made those, seemingly unrelated, errors go away.

I'm glad to hear that. However, if you have a way to reproduce the problem then we would definitively to hear about it. Improving error messages is really important for Scala programmer's user experience.

Ilya Denisov

unread,
Oct 11, 2013, 10:23:41 AM10/11/13
to scala...@googlegroups.com, scala-internals
Following error:
> <console>:13: error: erroneous or inaccessible type
           def build = Bar(
               ^
 could be reproduces with this sample code:
class Foo {
  def toInt = 12
}
case class Bar( fooBar : Int )
class Test {
  var fooBar : Foo = null
  def build = Bar(
    fooBar = foBar.toInt
  )
}
Error disappears if I fix typo here: 
fooBar = foBar.toInt
to 
fooBar = fooBar.toInt
 
Scala version is 2.10.1  

четверг, 18 июля 2013 г., 3:04:49 UTC+3 пользователь Grzegorz Kossakowski написал:

Jason Zaugg

unread,
Oct 11, 2013, 10:40:08 AM10/11/13
to Ilya Denisov, scala-user, scala-internals
On Fri, Oct 11, 2013 at 4:23 PM, Ilya Denisov <id.i...@gmail.com> wrote:
Following error:
> <console>:13: error: erroneous or inaccessible type
           def build = Bar(
               ^
 could be reproduces with this sample code:
class Foo {
  def toInt = 12
}
case class Bar( fooBar : Int )
class Test {
  var fooBar : Foo = null
  def build = Bar(
    fooBar = foBar.toInt
  )
}
Error disappears if I fix typo here: 
fooBar = foBar.toInt
to 
fooBar = fooBar.toInt
 
Scala version is 2.10.1  

Thanks for the reproduction. That particular case was fixed in 2.10.2. 

The latest stable release of Scala is 2.10.3, which is a drop-in replacement binary compatibility wise earlier versions, so I would recommend an upgrade.

I've added your test case to our regression suite: https://github.com/scala/scala/pull/3032

-jason

Chris Hodapp

unread,
Oct 12, 2013, 6:07:17 AM10/12/13
to scala...@googlegroups.com, scala-i...@googlegroups.com
I've got another one. With Scalaz 7.0.4 on the classpath, I can have this REPL session:

Welcome to Scala version 2.10.3 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_40).
Type in expressions to have them evaluated.
Type :help for more information.

scala> import scalaz._
import scalaz._

scala> import Scalaz._
import Scalaz._

scala> def functor[F[_]: Functor](f: F[_]) = implicitly[Functor[F]]
warning: there were 1 feature warning(s); re-run with -feature for details
functor: [F[_]](f: F[_])(implicit evidence$1: scalaz.Functor[F])scalaz.Functor[F]

scala> functor(identity _)
<console>:14: error: erroneous or inaccessible type
       val res0 =
           ^


Christopher Hunt

unread,
Nov 28, 2013, 5:59:16 PM11/28/13
to scala...@googlegroups.com, scala-internals
Hi Grzegorz,

I seem to be able to reproduce this issue given the following:

import java.io.File
import scalax.collection.Graph
import scalax.collection.GraphEdge.DiEdge

sbt.TaskKey[(Graph[File, DiEdge], Seq[File])]("")

...it looks like DiEdge is the culprit i.e. if I do the following:

sbt.TaskKey[(Graph[File, Nothing], Seq[File])]("")

...then all is well. Shall I file an issue or am I overlooking something?

Kind regards,
Christopher

Christopher Hunt

unread,
Nov 28, 2013, 6:00:21 PM11/28/13
to scala...@googlegroups.com, scala-internals
Oh, and I'm using 2.10.3

Jason Zaugg

unread,
Nov 29, 2013, 3:40:39 AM11/29/13
to scala...@googlegroups.com, scala-internals
Your error comes from the inability to summon Manifest for type constructors. The `apply` method you're calling requires one as an implicit parameter:

def apply[T](label: String,description: String,rank: Int)(implicit evidence$4: Manifest[T]): sbt.TaskKey[T]

It is twice as confusing in this instance because the real error message is swallowed. The "erroneous or inacessible type" error really means "oops, I don't know how we got here."

I've added this example to: SI-2915

As a workaround, create a class to wrap the Graph. You can create a manifest for that without running into this limitation.

case class MyGraph(value: Graph[File, DiEdge])
sbt.TaskKey[(MyGraph, Seq[File])]("")

-jason

Reply all
Reply to author
Forward
0 new messages