summaryrefslogtreecommitdiff
path: root/test/files/pos
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@epfl.ch>2012-09-04 14:33:38 +0200
committerLukas Rytz <lukas.rytz@epfl.ch>2012-09-04 16:28:55 +0200
commitec39e1ca82ea26429c140f120831b01cae65853c (patch)
treef31e27a4cc331e5e23c82c782b5adbedf4bba4dc /test/files/pos
parent291754799ae498d2b64ac4ac612e4d376a539f05 (diff)
downloadscala-ec39e1ca82ea26429c140f120831b01cae65853c.tar.gz
scala-ec39e1ca82ea26429c140f120831b01cae65853c.tar.bz2
scala-ec39e1ca82ea26429c140f120831b01cae65853c.zip
SI-6274 Fix owners when eta-expanding function with byName param
When eta-expanding a function that takes a by-name param the local definition for the corresponding argument is a function-0 val eta$1 = () => { argument-to-by-name } If there are any definitinos in the `argument-to-by-name`, the symbol owner needs to be changed to the anonymous function's symbol. To know the function symbol in eta expand, we need to type-check the function, and therefore pass the `Typer` instance to `etaExpand`.
Diffstat (limited to 'test/files/pos')
-rw-r--r--test/files/pos/t6274.scala13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/files/pos/t6274.scala b/test/files/pos/t6274.scala
new file mode 100644
index 0000000000..cf769fc72d
--- /dev/null
+++ b/test/files/pos/t6274.scala
@@ -0,0 +1,13 @@
+trait Crash {
+
+ def foo(i: => Int) (j: Int): Int
+
+ def t = {
+ // var count = 0
+ foo {
+ var count = 0
+ count
+ } _
+ }
+
+}