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

regression in name binding involving imports at the start of a template #8403

Closed
scabug opened this issue Mar 12, 2014 · 4 comments
Closed

Comments

@scabug
Copy link

scabug commented Mar 12, 2014

scalac-hash dbd8457e4~1 /Users/jason/code/scala2/src/compiler/scala/tools/nsc/backend/icode/Printers.scala
topic/function-to-string /code/scala scalac-hash dbd8457e4 /Users/jason/code/scala2/src/compiler/scala/tools/nsc/backend/icode/Printers.scala
/Users/jason/code/scala2/src/compiler/scala/tools/nsc/backend/icode/Printers.scala:19: error: reference to Linearizer is ambiguous;
it is both defined in trait Linearizers and imported subsequently by
import global.icodes._
  class TextPrinter(writer: PrintWriter, lin: Linearizer) {
                                              ^

Printers.scala is from v2.10.3.

Regressed in my refactorings of Context.

scala/scala@dbd8457

commit dbd8457e441bda6a444efd19b5eb1eaec373a535
Author: Jason Zaugg <jzaugg@gmail.com>
Date:   Tue Apr 16 11:12:44 2013 +0200

    SI-7345 Produce Context#imports from the context chain

Minimization pending

@scabug
Copy link
Author

scabug commented Mar 12, 2014

Imported From: https://issues.scala-lang.org/browse/SI-8403?orig=1
Reporter: @retronym
Affected Versions: 2.11.0-M4

@scabug
Copy link
Author

scabug commented Mar 12, 2014

@retronym said:

trait Bug {
  val u: { type Amb } = ???
  import u._

  class Amb
  class C(x: Amb) // after dbd8457e4, "reference to Amb is ambiguous"
}

@scabug
Copy link
Author

scabug commented Mar 12, 2014

@adriaanm said (edited on Mar 12, 2014 6:05:18 PM UTC):
Maybe after your investigation I'll finally internalize the weird nesting of contexts in the (primary) constructor that ensures the different symbols for the ctor arguments / fields / accessors are in scope (or not). I remember Lukas explaining this to me once, but I forget the details.

@scabug
Copy link
Author

scabug commented Mar 13, 2014

@retronym said:
scala/scala#3625

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