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

SIP-64 / Scala 3.6.2 compatibility - Support for Context Bounded Associated Types / Type Members #7077

Open
Dessix opened this issue Dec 28, 2024 · 1 comment
Labels
bug Something that is making a piece of functionality unusable

Comments

@Dessix
Copy link

Dessix commented Dec 28, 2024

Is your feature request related to a problem? Please describe.

import cats.{Show, Traverse}

trait Foo:
  type A: Show
  def a: Iterable[A]

trait Bar extends Foo:
  override type A: {Show, Traverse}
  type B: {Show, Traverse}

These two syntax additions from SIP-64 are valid as released in Scala 3.6.2 but appear to be taken as syntax errors under Metals 1.45.1.

This issue does not (yet) contain an exhaustive set of changes from SIP-64.

Describe the solution you'd like

Syntax support for the following:

  • "naming context bounds, as in A: Monoid as a"
  • "a new syntax for multiple context bounds, as in A: {Monoid, Ord}"
    As described in SIP-64.

Describe alternatives you've considered

Not using Scala 3.6.2's new features.

Additional context

Scalafmt appears to have added support for the new given syntax from SIP-64 in their PR #4656. Unfortunately, theirs does not also include code to support the new context bounds. This aspect does appear to be supported by Metals as of version 1.45.1.

Search terms

associated types, type members, context bounds

@tgodzik
Copy link
Contributor

tgodzik commented Dec 30, 2024

Thanks for reporting! This should be fixed by scalameta/scalameta#4099 so once the new version is out we can bump it in Metals

@tgodzik tgodzik transferred this issue from scalameta/metals-feature-requests Dec 30, 2024
@tgodzik tgodzik added the bug Something that is making a piece of functionality unusable label Dec 30, 2024
@tgodzik tgodzik moved this from Triage to In progress in Metals Issue Board Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that is making a piece of functionality unusable
Projects
Status: In progress
Development

No branches or pull requests

2 participants