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

Implicit value instances of inner class defined in superclass of package object don't resolve on import #6225

Closed
scabug opened this issue Aug 13, 2012 · 3 comments

Comments

@scabug
Copy link

scabug commented Aug 13, 2012

Compiling the following three files together results in the compile error suggesting that val foo can't be found (presumably because it doesn't think its type is the same type as the type library.x.Foo it's looking for). Defining class Foo outside of class X allows it to be found.

This worked as desired in Scala 2.9.1.

// lib.scala
package library.x
class X {
  class Foo
  implicit val foo = new Foo
}

// package.scala
package library
package object x extends X

// app.scala
package app
import library.x._
object App { implicitly[Foo] }


error: could not find implicit value for parameter e: library.x.Foo
  implicitly[Foo]
            ^
one error found
@scabug
Copy link
Author

scabug commented Aug 13, 2012

Imported From: https://issues.scala-lang.org/browse/SI-6225?orig=1
Reporter: @propensive
Affected Versions: 2.10.0-M1, 2.10.0-M6
Attachments:

  • test.scala (created on Aug 15, 2012 11:21:39 AM UTC, 200 bytes)

@scabug
Copy link
Author

scabug commented Aug 15, 2012

@propensive said:
In my haste, I missed a newline in the code in the initial comment. Here is a single source file which demonstrates the problem.

@scabug
Copy link
Author

scabug commented Feb 8, 2013

@retronym said:
scala/scala#2098

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