Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
oyvindberg opened this issue Sep 3, 2020 · 0 comments
Closed
Assignees

Comments

@oyvindberg
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants