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

No member completions for existential types #12607

Closed
tgodzik opened this issue Jun 9, 2022 · 5 comments
Closed

No member completions for existential types #12607

tgodzik opened this issue Jun 9, 2022 · 5 comments

Comments

@tgodzik
Copy link

tgodzik commented Jun 9, 2022

Reproduction steps

Scala version: 2.12.16 (though with latest kind projector it fails also on earlier versions)

With kind projector plugin https://github.com/typelevel/kind-projector

object a {
 def baz[F[_], A]: F[A] = ???
 baz[Either[Int, ?], String].fold@@
}

Problem

When trying to get the type members of baz[Either[Int, ?], String] are getting empty results from Global.completionsAt(pos) with pos at @@

It seems we get an existential type here:

Select(
  TypeApply(
    Ident(baz),
    List(
      ExistentialTypeTree(
        AppliedTypeTree(Ident(Either), List(Ident(Int), Ident($qmark$1))),
        List(
          TypeDef(Modifiers(2097168L, , List()), $qmark$1, List(), TypeBoundsTree(<empty>, <empty>))
        )
      ),
      Ident(String)
    )
  ),
  fold
)

Is this something that might be easily fixable, or would be quite involved?

@SethTisue
Copy link
Member

with latest kind projector it fails also on earlier versions

I'm confused. Something changed recently in kind-projector?

@tgodzik
Copy link
Author

tgodzik commented Jun 9, 2022

I realised we were testing 0.10.3, which up until 2.12.16 was not returning a exitential type. That changed in 2.12.16 somehow and I tried to update to the newest kind-projector, but that turned out to also return the same result.

@SethTisue
Copy link
Member

Okay.

My impression is that the issue isn't severe enough to warrant withdrawing 2.12.16? Do you agree?

We already have one regression that warrants building 2.12.17 on a short-ish timetable (2 months, maybe), so we already know that missing the 2.12.16 train doesn't mean an epically long delay.

@smarter
Copy link
Member

smarter commented Jun 9, 2022

baz[Either[Int, ?], String].fold

This syntax does not exist anymore in kind-projector, ? was replaced by * (the old syntax was deprecated a long time ago and fully removed one year ago: typelevel/kind-projector#186). This allowed us to repurpose ? by default in Scala 2: scala/scala#9990 / scala/scala#10005, so this change is expected.

@tgodzik
Copy link
Author

tgodzik commented Jun 9, 2022

Well that explains it 😅 Thanks @smarter ! I went a totally different way delving into the presentation compiler 😅

My impression is that the issue isn't severe enough to warrant withdrawing 2.12.16? Do you agree?

I think this was a false alarm, sorry about that. It seems to work properly.

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

No branches or pull requests

3 participants