Skip to content

Bad interaction between package objects, Nothing, type parameters #9717

Closed
@oyvindberg

Description

@oyvindberg

Hey there. I tested the newly released scala.js support in dotty and came across this problem in facade code. It doesn't need scala.js enabled to reproduce.

Minimized code

// minimized scala.js 
package object js {
  def native: Nothing = ???
}
// minimized facade
object Object {
  def assign[T, U](target: T, source: U): T with U = js.native
}

Output

Get the following error message

[error]     |         class Nothing in package scala does not take type parameters

Expectation

Should compile.

The code compiles if the package object is changed to a normal object, or if the return type in assign is changed to a concrete type

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions