aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/transform/FullParameterization.scala
diff options
context:
space:
mode:
authorGuillaume Martres <smarter@ubuntu.com>2015-02-28 00:23:57 +0100
committerGuillaume Martres <smarter@ubuntu.com>2015-03-02 22:33:49 +0100
commita273f38907f15fbb77f5de77f785509aee2d94f4 (patch)
treecf08228b15fee6bc33a1b47d342fdd752b2d8805 /src/dotty/tools/dotc/transform/FullParameterization.scala
parent4e9987740f206c2376957d08d626f7c1ed087688 (diff)
downloaddotty-a273f38907f15fbb77f5de77f785509aee2d94f4.tar.gz
dotty-a273f38907f15fbb77f5de77f785509aee2d94f4.tar.bz2
dotty-a273f38907f15fbb77f5de77f785509aee2d94f4.zip
FullParameterization: fix rewiring of Returns
The `from` field of a Return tree should either be EmptyTree or an Ident corresponding to the method we're returning from.
Diffstat (limited to 'src/dotty/tools/dotc/transform/FullParameterization.scala')
-rw-r--r--src/dotty/tools/dotc/transform/FullParameterization.scala6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/transform/FullParameterization.scala b/src/dotty/tools/dotc/transform/FullParameterization.scala
index 4b205e542..1fc9591d2 100644
--- a/src/dotty/tools/dotc/transform/FullParameterization.scala
+++ b/src/dotty/tools/dotc/transform/FullParameterization.scala
@@ -176,6 +176,12 @@ trait FullParameterization {
} else EmptyTree
}
tree match {
+ case Return(expr, from) if !from.isEmpty =>
+ val rewired = rewiredTarget(from, derived)
+ if (rewired.exists)
+ tpd.cpy.Return(tree)(expr, Ident(rewired.termRef))
+ else
+ EmptyTree
case Ident(_) => rewireCall(thisRef)
case Select(qual, _) => rewireCall(qual)
case tree @ TypeApply(fn, targs1) =>