You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
object Test {
def test2: Int = {
var ds: String = null
def s = {
ds = "abs"
ds
}
s.length
}
As expected, LambdaLift lifts out def s and ads additional argument to it, creating a method def s$1(ds$1: scala.runtime.ObjectRef): String.
At the end of transformation Ident('s') reference in body of test2 has a fixed symbol s$1, but the type remains TermRef(NoPrefix, s) with a fixed symbol s$1.
As dotty has Idents that are effectively Selects in scalac, backend needs to figure out which reciever to load based on an Ident('s'). This information was expected to come from type, but in this case type is wrong(should be TermRef(This(Test2), s)), and it cannot be recreated from symbol as symbol doesn't indicate an object instance for the method invocation.
The text was updated successfully, but these errors were encountered:
DarkDimius
changed the title
Inconsitency betwee types and symbols of Idents refering to lifted functions after flatten
Inconsitency betwee types and symbols of Idents refering to lifted functions after LambdaLift
Jan 30, 2015
DarkDimius
added a commit
to dotty-staging/dotty
that referenced
this issue
Jan 30, 2015
As expected, LambdaLift lifts out
def s
and ads additional argument to it, creating a methoddef s$1(ds$1: scala.runtime.ObjectRef): String
.At the end of transformation
Ident('s')
reference in body oftest2
has a fixed symbols$1
, but the type remainsTermRef(NoPrefix, s)
with a fixed symbols$1
.As dotty has Idents that are effectively Selects in scalac, backend needs to figure out which reciever to load based on an
Ident('s')
. This information was expected to come from type, but in this case type is wrong(should beTermRef(This(Test2), s)
), and it cannot be recreated from symbol as symbol doesn't indicate an object instance for the method invocation.The text was updated successfully, but these errors were encountered: