Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Type trees created by MethodSynthesis for abstract val getters carry symless originals, which are unusable for reification purposes (or the result of reification will be unhygienic). To combat this, type trees for such getters are now created empty, i.e. without any `tpe` set, just having an original assigned. Subsequent `typedTypeTree` invocations fill in the `tpe` and update the original to be symful.
- Loading branch information
Showing
4 changed files
with
38 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
abstract trait Foo extends AnyRef { | ||
<stable> <accessor> def a: Int | ||
}; | ||
() | ||
} | ||
{ | ||
abstract trait Foo extends AnyRef { | ||
<stable> <accessor> def a: Int | ||
}; | ||
() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import scala.reflect.runtime.universe._ | ||
import scala.reflect.runtime.{currentMirror => cm} | ||
import scala.tools.reflect.ToolBox | ||
|
||
object Test extends App { | ||
// test 1: reify | ||
val tree = reify{ trait Foo { val a: Int } }.tree | ||
println(tree.toString) | ||
|
||
// test 2: import and typecheck | ||
val toolbox = cm.mkToolBox() | ||
val ttree = toolbox.typeCheck(tree) | ||
println(ttree.toString) | ||
|
||
// test 3: import and compile | ||
toolbox.eval(tree) | ||
} |