summaryrefslogtreecommitdiff
path: root/test/files/neg/ambiguous-same.scala
diff options
context:
space:
mode:
authorSom Snytt <som.snytt@gmail.com>2016-07-14 13:23:44 -0700
committerSom Snytt <som.snytt@gmail.com>2017-04-09 20:04:17 -0700
commited63344a2dae7731c01737102fbe12b7ad10ba77 (patch)
treea9c6c5858a59bc4e4144bbc5887245f3365db65a /test/files/neg/ambiguous-same.scala
parent1ef37f0bc18be5ed2ca8c33c0ea1912eed5dac3e (diff)
downloadscala-ed63344a2dae7731c01737102fbe12b7ad10ba77.tar.gz
scala-ed63344a2dae7731c01737102fbe12b7ad10ba77.tar.bz2
scala-ed63344a2dae7731c01737102fbe12b7ad10ba77.zip
SI-2458 Make spec example live test
Synchronize the live test with the spec update, which is trivial. Also add a neg test showing that an imported name remains ambiguous even if it resolves to the definition in scope with which it is ambiguous.
Diffstat (limited to 'test/files/neg/ambiguous-same.scala')
-rw-r--r--test/files/neg/ambiguous-same.scala15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/files/neg/ambiguous-same.scala b/test/files/neg/ambiguous-same.scala
new file mode 100644
index 0000000000..50dba71f67
--- /dev/null
+++ b/test/files/neg/ambiguous-same.scala
@@ -0,0 +1,15 @@
+
+// When faced with ambiguities between imports,
+// an attempt is made to see if the imports intend
+// identical types.
+//
+// Here, no attempt is made to notice that x
+// names the same thing.
+//
+object X {
+ val x = 42
+ def f = {
+ import X.x
+ x
+ }
+}