-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix: record calls to constructors in lambdaLift #22487
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -129,9 +129,7 @@ object LambdaLift: | |
|
||
private def proxy(sym: Symbol)(using Context): Symbol = { | ||
def liftedEnclosure(sym: Symbol) = | ||
if sym.is(Method) | ||
then deps.logicalOwner.getOrElse(sym, sym.enclosure) | ||
else sym.enclosure | ||
deps.logicalOwner.getOrElse(sym, sym.enclosure) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why was the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was just my previous approach for solving this issue, so this is basically a revert. Turns out that picking the |
||
def searchIn(enclosure: Symbol): Symbol = { | ||
if (!enclosure.exists) { | ||
def enclosures(encl: Symbol): List[Symbol] = | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,18 @@ | ||
def f() = | ||
val NotFound: Char = 'a' | ||
class crashing() { | ||
class issue() { | ||
NotFound | ||
} | ||
class Module() { | ||
val obligatory = | ||
class anonIssue() { | ||
issue() | ||
object Test { | ||
def f() = { | ||
val NotFound: Char = 'a' | ||
class crashing() { | ||
class issue() { | ||
NotFound | ||
} | ||
class Module() { | ||
val obligatory = { | ||
def anonIssue = { | ||
issue() | ||
} | ||
anonIssue | ||
} | ||
} | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
trait A | ||
trait OuterClass | ||
trait MidClass | ||
trait InnerClass | ||
|
||
object Obj: | ||
def outerDef(a: A) = | ||
new OuterClass { | ||
def midDef(): Unit = { | ||
new MidClass { | ||
val valdef = new InnerClass { | ||
def innerDef() = | ||
println(a) | ||
} | ||
} | ||
} | ||
} |
Uh oh!
There was an error while loading. Please reload this page.