aboutsummaryrefslogtreecommitdiff
path: root/tests/pos
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-11-10 15:29:01 +0100
committerMartin Odersky <odersky@gmail.com>2016-11-10 15:31:18 +0100
commit4b1f5daa63afc29d4d7f8c5959e56d2e8bc998e1 (patch)
tree5a2aaaca35c20a34ba6dd76c36b6e3f43c2c5941 /tests/pos
parent28c2e04dd33b6389a44460f977a97b8691265994 (diff)
downloaddotty-4b1f5daa63afc29d4d7f8c5959e56d2e8bc998e1.tar.gz
dotty-4b1f5daa63afc29d4d7f8c5959e56d2e8bc998e1.tar.bz2
dotty-4b1f5daa63afc29d4d7f8c5959e56d2e8bc998e1.zip
Fix #1664: Refine isOuterRef condition
We forgot the case where a hoistable method can still refer to free variables that have to be passed using outer pointers. Fixes #1664.
Diffstat (limited to 'tests/pos')
-rw-r--r--tests/pos/i1664.scala12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/pos/i1664.scala b/tests/pos/i1664.scala
new file mode 100644
index 000000000..39d8d606d
--- /dev/null
+++ b/tests/pos/i1664.scala
@@ -0,0 +1,12 @@
+object test {
+ def f[a](x: a) = {
+ def print = x
+ class A {
+ def f() = {
+ class B { def h = print }
+ new B
+ }
+ f()
+ }
+ }
+}