summaryrefslogtreecommitdiff
path: root/test/files/pos
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2013-03-10 09:11:50 +0100
committerJason Zaugg <jzaugg@gmail.com>2013-03-10 10:10:42 +0100
commit33b499cd04342a49bd5c4f5bf0e2fab88b69069c (patch)
treea5aff002f2d3255322cf9dac6c63a826f984e285 /test/files/pos
parent889020dfab9f99a3198528fedb699c061027acab (diff)
downloadscala-33b499cd04342a49bd5c4f5bf0e2fab88b69069c.tar.gz
scala-33b499cd04342a49bd5c4f5bf0e2fab88b69069c.tar.bz2
scala-33b499cd04342a49bd5c4f5bf0e2fab88b69069c.zip
SI-7233 Account for aliased imports in eta expansion.
Buggy: treeCopy.Select(sel, sel.qual, sel.name) setSymbol null Select(sel, sel.qual, sel.name) Okay: treeCopy.Select(sel, sel.qual, sel.name) Select(sel, sel.qual, sel.symbol.name) // but doesn't copyAttrs! It is an easy mistake to make, I've found one more occurance: def foo(a: Any) = { import a.{toString => toS}; toS } error: uncaught exception during compilation: scala.reflect.internal.FatalError scala.reflect.internal.FatalError: class Object does not have a member toS at scala.reflect.internal.Definitions$DefinitionsClass.scala$reflect$internal$Definitions$DefinitionsClass$$fatalMissingSymbol(Definitions.scala:1028) A followup commit will address that problem.
Diffstat (limited to 'test/files/pos')
-rw-r--r--test/files/pos/t7233.scala14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/files/pos/t7233.scala b/test/files/pos/t7233.scala
new file mode 100644
index 0000000000..ae15c08c35
--- /dev/null
+++ b/test/files/pos/t7233.scala
@@ -0,0 +1,14 @@
+object Foo {
+ def bar(i: Int) = i
+
+ def ol(i: Int) = i
+ def ol(i: String) = i
+}
+object Test {
+ import Foo.{ bar => quux, toString => bar, ol => olRenamed}
+
+ val f1 = quux _
+ val f1Typed: (Int => Int) = f1
+
+ val f2: String => String = olRenamed _
+}