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

ClassFormatError in pattern of code use by Slick #8114

Closed
scabug opened this issue Jan 3, 2014 · 5 comments
Closed

ClassFormatError in pattern of code use by Slick #8114

scabug opened this issue Jan 3, 2014 · 5 comments
Assignees
Labels
Milestone

Comments

@scabug
Copy link

@scabug scabug commented Jan 3, 2014

In TypeMap, the following optimization is too eager:

protected def noChangeToSymbols(origSyms: List[Symbol]) =
      origSyms forall (sym => sym.info eq this(sym.info))

sym.info may still change indirectly, when
sym.info.typeSymbol.info ne this(sym.info.typeSymbol.info)

It turns out it's more than an optimization, as simply setting it to false causes other problems.

repro:

// derived from a real-world Slick app (support #3035)
// running Test should not throw a java.lang.ClassFormatError: Duplicate method name&signature in class file Test$$anonfun$1 
// workaround: uncomment type arg to list below

class AbstractTable[T] { type TableElementType }
class Table[T] extends AbstractTable[T] { type TableElementType = T }

class Query[E, U]
class TableQuery[E <: AbstractTable[_]] extends Query[E, E#TableElementType]

object Test extends App {
  object MyTable extends TableQuery[Table[Long]]

  def list[R](q: Query[_, R]): List[R] = Nil
  list/*[Long]*/(MyTable) collect { case x => x }
}
@scabug
Copy link
Author

@scabug scabug commented Jan 3, 2014

Imported From: https://issues.scala-lang.org/browse/SI-8114?orig=1
Reporter: @adriaanm
Affected Versions: 2.10.3
Other Milestones: 2.11.0-M2

@scabug
Copy link
Author

@scabug scabug commented Jan 3, 2014

@adriaanm said:
2.11.0 is not affected because of the fix for #7120 in scala/scala#2125

@scabug
Copy link
Author

@scabug scabug commented Jan 3, 2014

@adriaanm said:
I'd like to fix this in 2.10.4-RC2, if we have one.

@scabug
Copy link
Author

@scabug scabug commented Jan 9, 2014

@retronym said (edited on Jan 9, 2014 1:11:51 PM UTC):
2.10.x binary compatible workaround for the double definition symptom: scala/scala#3345

@scabug
Copy link
Author

@scabug scabug commented Jan 21, 2014

@retronym said (edited on Jan 21, 2014 11:51:09 AM UTC):
Closing to note that we've worked around the ClassFormatError in 2.10.4. I'll open a new issue for the residual question about what TypeMap should do with bounds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants