File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed
src/compiler/scala/reflect/runtime Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -23,15 +23,21 @@ trait ToolBoxes extends { self: Universe =>
23
23
24
24
lazy val exporter = importer.reverse
25
25
26
- def typeCheck (tree : Tree , expectedType : Type = WildcardType ): Tree = {
26
+ def typeCheck (tree : reflect.mirror. Tree , expectedType : reflect.mirror. Type ): reflect.mirror. Tree = {
27
27
println(" typing " + tree+ " , pt = " + expectedType)
28
28
val run = new compiler.Run
29
29
compiler.phase = run.refchecksPhase
30
- val ctree : compiler.Tree = importer.importTree(tree)
31
- val pt : compiler.Type = importer.importType(expectedType)
30
+ val ctree : compiler.Tree = importer.importTree(tree. asInstanceOf [ Tree ] )
31
+ val pt : compiler.Type = importer.importType(expectedType. asInstanceOf [ Type ] )
32
32
val ttree : compiler.Tree = compiler.typer.typed(ctree, compiler.analyzer.EXPRmode , pt)
33
- exporter.importTree(ttree)
33
+ exporter.importTree(ttree). asInstanceOf [reflect.mirror. Tree ]
34
34
}
35
- }
36
35
36
+ def typeCheck (tree : reflect.mirror.Tree ): reflect.mirror.Tree =
37
+ typeCheck(tree, WildcardType .asInstanceOf [reflect.mirror.Type ])
38
+
39
+ def show (tree : reflect.mirror.Tree ): String = {
40
+ importer.importTree(tree.asInstanceOf [Tree ]).toString
41
+ }
42
+ }
37
43
}
You can’t perform that action at this time.
0 commit comments