Skip to content

Fix #2246: Use semantic names when freshening #2263

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

Merged
merged 1 commit into from
Apr 21, 2017

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Apr 14, 2017

I have decided to treat the super call problems elsewhere. Both are needed to make ScalaTest compile again.

def newSuperArgMethod(argType: Type) = {
val (staticFlag, methOwner) =
if (cls.owner.is(Package)) (JavaStatic, cls) else (EmptyFlags, cls.owner)
val argTypeWrtConstr = argType.subst(allParams, allParamRefs(constr.info))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems allParamRefs(constr.info) is called for each argument, maybe turn it into lazy val? Or, it's because constr.info may change between different calls?

@liufengyun
Copy link
Contributor

A mini test that reproduce the run-time exceptions:

class Base[A](exp: => Option[A])

object Empty extends Base[Nothing](None)

object Test {
  def main(args: Array[String]): Unit = Empty
}

@odersky
Copy link
Contributor Author

odersky commented Apr 21, 2017

The super call arguments handling had "interesting" interactions with elimByName. The new treatment has been moved to a separate PR #2282.

@odersky
Copy link
Contributor Author

odersky commented Apr 21, 2017

@liufengyun I added your example to #2282. Thanks!

@odersky odersky merged commit 0303089 into scala:master Apr 21, 2017
@allanrenucci allanrenucci deleted the fix-#2246-v2 branch December 14, 2017 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants