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

Spurious illegal inheritance error & implicit resolution failure with parent class implicit constructor argument #5454

Closed
scabug opened this issue Feb 10, 2012 · 5 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Feb 10, 2012

Compiling the following,

object IllegalInheritance {
  trait A
  implicit def a = new A {}            // def => val
  //val r = implicitly[A]              // uncomment

  class B[T](t : T)(implicit a : A)    // remove implicit param block

  class C extends B/*[Int]*/(23)       // uncomment
  val c = new C                        // comment
}

with 2.9.1.final or 2.10.0-M1-0179-g34233f031e-2012-02-10 results in the following error reports,

bug.scala:8: error: could not find implicit value for parameter a: IllegalInheritance.A
  class C extends B/*[Int]*/(23)       // uncomment
          ^
bug.scala:8: error: illegal inheritance;
 self-type IllegalInheritance.C does not conform to IllegalInheritance.B[Int]'s selftype IllegalInheritance.B[Int]
  class C extends B/*[Int]*/(23)       // uncomment
                  ^
two errors found

Any one of the changes mentioned in the line-end comments will result in a successful compilation. Compiling with -Yno-self-type-checks eliminates the illegal inheritance error, but doesn't eliminate the spurious implicit resolution failure.

@scabug
Copy link
Author

scabug commented Feb 10, 2012

Imported From: https://issues.scala-lang.org/browse/SI-5454?orig=1
Reporter: @milessabin
Affected Versions: 2.9.1, 2.10.0
See #3439

@scabug
Copy link
Author

scabug commented Feb 14, 2012

@cvogt said:
reproduced in 2.9.1

@scabug
Copy link
Author

scabug commented Jan 13, 2013

@retronym said:
There is a big mess described in the comments of #3439 that is likely related to the weirdness you see here.

@scabug
Copy link
Author

scabug commented May 20, 2013

@JamesIry said:
2.10.2 is about to be cut. Kicking down the road and un-assigning to foster work stealing.

@scabug
Copy link
Author

scabug commented Oct 10, 2014

@retronym said:
scala/scala#4043

@scabug scabug closed this as completed Nov 2, 2014
@scabug scabug added this to the 2.11.5 milestone Apr 7, 2017
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