summaryrefslogtreecommitdiff
path: root/test/files/pos
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2013-03-12 19:14:46 -0700
committerPaul Phillips <paulp@improving.org>2013-03-12 19:14:46 -0700
commit7d0cb1f0e2c254ccc071fcd8a057c67065682a0f (patch)
treeacfeaab79bbcdd3119f7ec7ea5bc55a88505cefd /test/files/pos
parent5f4039f83ea27ed1da88146dc2ffab3d8dd11b29 (diff)
parent41e3b89c6d636164f48a2c2d8e8867201075cdae (diff)
downloadscala-7d0cb1f0e2c254ccc071fcd8a057c67065682a0f.tar.gz
scala-7d0cb1f0e2c254ccc071fcd8a057c67065682a0f.tar.bz2
scala-7d0cb1f0e2c254ccc071fcd8a057c67065682a0f.zip
Merge pull request #2230 from retronym/ticket/7233
SI-7233 Account for aliased imports in EtaExpansion / Erasure
Diffstat (limited to 'test/files/pos')
-rw-r--r--test/files/pos/t7233.scala14
-rw-r--r--test/files/pos/t7233b.scala8
2 files changed, 22 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 _
+}
diff --git a/test/files/pos/t7233b.scala b/test/files/pos/t7233b.scala
new file mode 100644
index 0000000000..927c7fcfd1
--- /dev/null
+++ b/test/files/pos/t7233b.scala
@@ -0,0 +1,8 @@
+object Test {
+ // crash
+ def foo(a: Any) = { import a.{toString => toS}; toS }
+
+ // okay
+ def ok1(a: String) = { import a.{isInstanceOf => iio}; iio[String] }
+ def ok2(a: Int) = { import a.{toInt => ti}; ti }
+}