aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2017-04-11 15:54:20 +0200
committerMartin Odersky <odersky@gmail.com>2017-04-11 15:56:31 +0200
commit40675e6939382a9063e5ac812725f93d17f9f98a (patch)
treea21b9c43fa8852e568687265a02e18e8a232339b /tests
parent14fde01d3576f60585d59d2b00cce8b3c177b236 (diff)
downloaddotty-40675e6939382a9063e5ac812725f93d17f9f98a.tar.gz
dotty-40675e6939382a9063e5ac812725f93d17f9f98a.tar.bz2
dotty-40675e6939382a9063e5ac812725f93d17f9f98a.zip
Fix #2212: Avoid imports in the wrong namespace
Don't issue an error if when considering a named import that refers to a valoe or type which does not exist. Instead, disregard the import an continue.
Diffstat (limited to 'tests')
-rw-r--r--tests/pos/i2212.scala19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/pos/i2212.scala b/tests/pos/i2212.scala
new file mode 100644
index 000000000..416c8ca04
--- /dev/null
+++ b/tests/pos/i2212.scala
@@ -0,0 +1,19 @@
+package object squants {
+ type Time = squants.time.Time
+}
+package squants.time {
+ class Time
+ object Time { def x = 2 }
+}
+package squants.velocity {
+ import squants.time._ // <-- imports `Time` value
+ import squants.Time // <-- imports type alias
+ object Velocity { Time.x }
+}
+
+import scala.math.BigDecimal.RoundingMode
+import scala.math.BigDecimal.RoundingMode.RoundingMode
+
+object Money {
+ def foo(round: RoundingMode = RoundingMode.HALF_EVEN): Int = ???
+}