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

package object + case class synthetics + imports gone bad #6734

Closed
scabug opened this issue Nov 28, 2012 · 2 comments
Closed

package object + case class synthetics + imports gone bad #6734

scabug opened this issue Nov 28, 2012 · 2 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Nov 28, 2012

In a single compilation unit, package object interacts with an import during case class method synthesis.

Note that if the companion object is already defined before the import, it also fails, so that scenario also complicates method generation.

//single file badimp.scala
// adding package object gives not found: type SortedMap
package object badimp {
}

package badimp {

  // move before package object works
  import scala.collection.immutable.SortedMap

  case class Nodal(value: String, children: SortedMap[String, Int])

  // adding target object restores sanity
  // but adding it before the import does not
  //object Nodal
}
@scabug
Copy link
Author

scabug commented Nov 28, 2012

Imported From: https://issues.scala-lang.org/browse/SI-6734?orig=1
Reporter: @som-snytt
Affected Versions: 2.10.0-RC2, 2.12.0-M4

@scabug
Copy link
Author

scabug commented Oct 27, 2016

@som-snytt said:
scala/scala#5486

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