Skip to content

Fix #2246: Ensure ScalaTest compiles again #2258

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

Closed
wants to merge 4 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions compiler/src/dotty/tools/dotc/transform/LambdaLift.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,17 @@ import core.Decorators._
import core.StdNames.nme
import core.Names._
import core.NameOps._
import core.NameKinds.ExpandPrefixName
import core.Phases._
import ast.Trees._
import SymUtils._
import ExplicitOuter.outer
import util.Attachment
import util.NameTransformer
import util.Positions._
import collection.{ mutable, immutable }
import collection.mutable.{ HashMap, HashSet, LinkedHashMap, LinkedHashSet, TreeSet }

object LambdaLift {
private val NJ = NameTransformer.NAME_JOIN_STRING
private class NoPath extends Exception
}

Expand Down Expand Up @@ -338,7 +337,9 @@ class LambdaLift extends MiniPhase with IdentityDenotTransformer { thisTransform

private def newName(sym: Symbol)(implicit ctx: Context): Name =
if (sym.isAnonymousFunction && sym.owner.is(Method, butNot = Label))
(sym.name ++ NJ ++ sym.owner.name).freshened
sym.name.rewrite {
case name: SimpleTermName => ExpandPrefixName(sym.owner.name.asTermName, name)
Copy link
Member

Choose a reason for hiding this comment

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

It's kind of weird to use ExpandPrefixName here since this isn't a prefix, isn't it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, but FlatName does not fit either.

}.freshened
else sym.name.freshened

private def generateProxies()(implicit ctx: Context): Unit =
Expand Down