From ec39e1ca82ea26429c140f120831b01cae65853c Mon Sep 17 00:00:00 2001 From: Lukas Rytz Date: Tue, 4 Sep 2012 14:33:38 +0200 Subject: 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`. --- test/files/pos/t6274.scala | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 test/files/pos/t6274.scala (limited to 'test') 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 + } _ + } + +} -- cgit v1.2.3