diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2012-11-01 11:08:39 -0700 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2012-11-01 11:08:39 -0700 |
commit | a70c8219220b637072b52fc834439d90f0cf5b38 (patch) | |
tree | d1cf2daa641f63491d0b8935721385bafaaa1555 /test/files/neg | |
parent | 2dd7142401d85badff451a6d3bb15eb84f4e9fa9 (diff) | |
parent | 578c4c6c64250a12a0e625d1e54a74dbdad6d972 (diff) | |
download | scala-a70c8219220b637072b52fc834439d90f0cf5b38.tar.gz scala-a70c8219220b637072b52fc834439d90f0cf5b38.tar.bz2 scala-a70c8219220b637072b52fc834439d90f0cf5b38.zip |
Merge pull request #1521 from paulp/whats-in-a-name
Saving symbol lookup from typedIdent.
Diffstat (limited to 'test/files/neg')
-rw-r--r-- | test/files/neg/import-precedence.check | 19 | ||||
-rw-r--r-- | test/files/neg/import-precedence.scala | 68 | ||||
-rw-r--r-- | test/files/neg/t3160ambiguous.check | 7 | ||||
-rw-r--r-- | test/files/neg/t3160ambiguous.scala | 15 | ||||
-rw-r--r-- | test/files/neg/t4537.check | 4 | ||||
-rw-r--r-- | test/files/neg/t4537/a.scala | 5 | ||||
-rw-r--r-- | test/files/neg/t4537/b.scala | 5 | ||||
-rw-r--r-- | test/files/neg/t4537/c.scala | 8 |
8 files changed, 109 insertions, 22 deletions
diff --git a/test/files/neg/import-precedence.check b/test/files/neg/import-precedence.check new file mode 100644 index 0000000000..5f99611052 --- /dev/null +++ b/test/files/neg/import-precedence.check @@ -0,0 +1,19 @@ +import-precedence.scala:18: error: reference to X is ambiguous; +it is imported twice in the same scope by +import uniq1.uniq2._ +and import uniq1.X + object Y { def f = X } + ^ +import-precedence.scala:61: error: reference to X is ambiguous; +it is imported twice in the same scope by +import uniq1.uniq2._ +and import uniq1._ + object Y { def f = X } + ^ +import-precedence.scala:67: error: reference to X is ambiguous; +it is imported twice in the same scope by +import uniq1.uniq2.X +and import uniq1.X + object Y { def f = X } + ^ +three errors found diff --git a/test/files/neg/import-precedence.scala b/test/files/neg/import-precedence.scala new file mode 100644 index 0000000000..0401635e32 --- /dev/null +++ b/test/files/neg/import-precedence.scala @@ -0,0 +1,68 @@ +package uniq1 { + object X + package uniq2 { + object X + package uniq3 { + object X + package uniq4 { + object X + } + } + } +} + +package p1 { + import uniq1.X + package p2 { + import uniq1.uniq2._ + object Y { def f = X } + } +} + +package p2 { + import uniq1.uniq2._ + package p2 { + import uniq1.X + object Y { def f = X } + } +} + +package p3 { + import uniq1.X + import uniq1.uniq2._ + object Y { def f = X } +} + +package p4 { + import uniq1.uniq2._ + import uniq1.X + object Y { def f = X } +} + +package p5 { + import uniq1.X + package p6 { + import uniq1.uniq2.X + object Y { def f = X } + } +} + +package p6 { + import uniq1._ + package p5 { + import uniq1.uniq2._ + object Y { def f = X } + } +} + +package p7 { + import uniq1._ + import uniq1.uniq2._ + object Y { def f = X } +} + +package p8 { + import uniq1.X + import uniq1.uniq2.X + object Y { def f = X } +} diff --git a/test/files/neg/t3160ambiguous.check b/test/files/neg/t3160ambiguous.check new file mode 100644 index 0000000000..e80d9a5461 --- /dev/null +++ b/test/files/neg/t3160ambiguous.check @@ -0,0 +1,7 @@ +t3160ambiguous.scala:8: error: reference to Node is ambiguous; +it is imported twice in the same scope by +import scala.xml._ +and import Bippy._ + def f(x: Node): String = ??? // ambiguous, because Bippy.Node is accessible + ^ +one error found diff --git a/test/files/neg/t3160ambiguous.scala b/test/files/neg/t3160ambiguous.scala new file mode 100644 index 0000000000..cb9759b79c --- /dev/null +++ b/test/files/neg/t3160ambiguous.scala @@ -0,0 +1,15 @@ +object Bippy { + private class Node +} +class Bippy { + import Bippy._ + import scala.xml._ + + def f(x: Node): String = ??? // ambiguous, because Bippy.Node is accessible +} +class Other { + import Bippy._ + import scala.xml._ + + def f(x: Node): String = ??? // unambiguous, because Bippy.Node is inaccessible +} diff --git a/test/files/neg/t4537.check b/test/files/neg/t4537.check deleted file mode 100644 index 931bcd0405..0000000000 --- a/test/files/neg/t4537.check +++ /dev/null @@ -1,4 +0,0 @@ -c.scala:7: error: object Settings in package a cannot be accessed in package a - println(Settings.Y) - ^ -one error found diff --git a/test/files/neg/t4537/a.scala b/test/files/neg/t4537/a.scala deleted file mode 100644 index 65e183c5f8..0000000000 --- a/test/files/neg/t4537/a.scala +++ /dev/null @@ -1,5 +0,0 @@ -package a - -private[a] object Settings { - val X = 0 -}
\ No newline at end of file diff --git a/test/files/neg/t4537/b.scala b/test/files/neg/t4537/b.scala deleted file mode 100644 index bb9dd4e15a..0000000000 --- a/test/files/neg/t4537/b.scala +++ /dev/null @@ -1,5 +0,0 @@ -package b - -object Settings { - val Y = 0 -}
\ No newline at end of file diff --git a/test/files/neg/t4537/c.scala b/test/files/neg/t4537/c.scala deleted file mode 100644 index 379599112d..0000000000 --- a/test/files/neg/t4537/c.scala +++ /dev/null @@ -1,8 +0,0 @@ -package b -package c - -import a._ - -object Test { - println(Settings.Y) -}
\ No newline at end of file |