Skip to content

presentation compiler reporting incorrect error #9500

Open
@scabug

Description

@scabug

Create the following two compilation units in package test:

// test/package.scala
package object test {
  type Seq[+A] = scala.collection.immutable.Seq[A]
}

// test/Foo.scala
package test

object Foo {
  def foo(s: Seq[Any]) = ()
  
  foo(Seq()) // <-- presentation compiler reports error here
}

The error reported by the presentation compiler is type mismatch; found : Seq[Nothing] required: test.Seq[Any] (which expands to) scala.collection.immutable.Seq[Any].

Changing Seq() to scala.collection.immutable.Seq() fixes the problem. But of course it shouldn't be necessary given the type alias definition in the package object.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions