Skip to content

scala.* symbol precedes conflicting root package name #2856

Closed
@olafurpg

Description

@olafurpg

This behavior may be intentional but I could not find a reference to it in the docs.

package io.grpc {
  trait Grpc
}
package bar {
  import io.grpc.Grpc
  object a extends Grpc
}

Dotty reports the following error

-- [E008] Member Not Found Error: grpc.scala:6:12 ------------------------------
6 |  import io.grpc.Grpc
  |         ^^^^^^^
  |         value `grpc` is not a member of io

one error found

while scalac reports no error.

A workaround for error is to prefix the import: import _root_.io.grpc.

Given the recent popularity of *.io domains, a few popular Scala libraries libraries now use io as their root package. For example, Circe (https://circe.github.io/circe/) and Quill (http://getquill.io/).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions