Skip to content
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

Overloaded method with higher kinded type shadows value type on 2.13 #11487

Closed
lJoublanc opened this issue Apr 15, 2019 · 4 comments
Closed

Overloaded method with higher kinded type shadows value type on 2.13 #11487

lJoublanc opened this issue Apr 15, 2019 · 4 comments
Assignees
Milestone

Comments

@lJoublanc
Copy link

@milessabin @mpilquist has kindly provided this minimized example:

scala> object Foo {
     |   def apply[A]: Int = 0
     |   def apply[F[_]](implicit x: Int): Boolean = true
     | }
defined object Foo

scala> Foo[Int]
           ^
       error: Int takes no type parameters, expected: one

The whole discussion is here ☝️ April 15, 2019 12:17 PM.

Confirmed on both 2.13-M5 and RC1.

This doesn't occur if the methods have a different number of type parameters.

@hrhino
Copy link
Member

hrhino commented Apr 15, 2019

This also happens on 2.12, it seems, so not a 2.13 regression: https://scalafiddle.io/sf/D35fZL1/0

@hrhino hrhino added this to the Backlog milestone Apr 15, 2019
@som-snytt som-snytt added the fixed in Scala 3 This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/) label Jul 7, 2020
@joroKr21
Copy link
Member

I wouldn't say it's fixed in dotty. It just chooses the other overload:

scala> Foo[List]
1 |Foo[List]
  |    ^^^^
  |    Missing type parameter for List

@joroKr21
Copy link
Member

joroKr21 commented Jan 7, 2021

Fixed by scala/scala#9405 but let's wait and see what dotty has to say: scala/scala3#11015

@joroKr21 joroKr21 removed the fixed in Scala 3 This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/) label Jan 7, 2021
@joroKr21
Copy link
Member

joroKr21 commented Jan 7, 2021

Confirmed that it's a bug in dotty and therefore the fix that was merged in scalac is the right thing to do.

@joroKr21 joroKr21 closed this as completed Jan 7, 2021
@joroKr21 joroKr21 self-assigned this Jan 7, 2021
@joroKr21 joroKr21 modified the milestones: Backlog, 2.13.5 Jan 7, 2021
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

4 participants