-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
I am not sure if this is a bug or intentional behavior. I bumped into this while compiling squants with Dotty.
The following snippet compiles with scalac but not Dotty
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 type alias
import squants.time._ // <-- imports `Time` value
object Velocity { Time.x }
}Dotty reports "E008 member not found":
-- [E008] Member Not Found Error: package.scala --------------------------------
11 | object Velocity { Time.x }
| ^^^^
|value `Time` is not a member of squants.type - did you mean `squants.time`?
one error foundIt seems that the import on the Time type alias shadows the underscore import on the Time companion object. Commenting out import squants.Time (import on type alias) removes the error.
Commit to reproduce issue in the dotty repo: 2487e78
FWIW, the Dotty behavior feels somewhat more intuitive to me since named imports have a higher precedence.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels