From 40675e6939382a9063e5ac812725f93d17f9f98a Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Tue, 11 Apr 2017 15:54:20 +0200 Subject: 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. --- tests/pos/i2212.scala | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 tests/pos/i2212.scala (limited to 'tests/pos/i2212.scala') 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 = ??? +} -- cgit v1.2.3