aboutsummaryrefslogtreecommitdiff
path: root/tests/pos
diff options
context:
space:
mode:
authorodersky <odersky@gmail.com>2017-04-11 20:56:55 +0200
committerGitHub <noreply@github.com>2017-04-11 20:56:55 +0200
commit10a1300b7599407a7c6078244c4b7692e339b39f (patch)
treeee615b89facfa8f4e658952b6f66acc4b211e88d /tests/pos
parentd63191d1d68a7de0bc622356b5af1599b25cbf25 (diff)
parent552d85626aabab273213622df14544f154fbc4ca (diff)
downloaddotty-10a1300b7599407a7c6078244c4b7692e339b39f.tar.gz
dotty-10a1300b7599407a7c6078244c4b7692e339b39f.tar.bz2
dotty-10a1300b7599407a7c6078244c4b7692e339b39f.zip
Merge pull request #2225 from dotty-staging/fix-#2192
Fix #2212: Avoid imports in the wrong namespace
Diffstat (limited to 'tests/pos')
-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 = ???
+}