Skip to content

Named tuples operations produce huge types in inlay hints #7397

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
keynmol opened this issue Apr 13, 2025 · 1 comment · Fixed by scala/scala3#23013
Closed

Named tuples operations produce huge types in inlay hints #7397

keynmol opened this issue Apr 13, 2025 · 1 comment · Fixed by scala/scala3#23013
Labels
bug Something that is making a piece of functionality unusable Scala 3 Generic ticket relating to Scala 3
Milestone

Comments

@keynmol
Copy link
Contributor

keynmol commented Apr 13, 2025

Describe the bug

//> using scala 3.7.0-RC2
def hello = (path = ".", num = 5)

def test =
  hello ++ (line = 1)

@main def bla =
  val x: (path: String, num: Int, line: Int) = test

Inlay hint is super long for concatenation:

Image

And doing "Insert type" code action on test produces a huge type as well.

Expected behavior

Named tuples should be handled in a special way by other compiler or metals, producing the expected shortand type

Operating system

macOS

Editor/Extension

Other

Version of Metals

1.5.2

Extra context or search terms

named tuples, inlay hints, inferred type

tgodzik added a commit to tgodzik/scala3 that referenced this issue Apr 17, 2025
@tgodzik
Copy link
Contributor

tgodzik commented Apr 17, 2025

Trying a fix in scala/scala3#23013, let me know if that makes more sense.

@tgodzik tgodzik added bug Something that is making a piece of functionality unusable Scala 3 Generic ticket relating to Scala 3 labels Apr 17, 2025
tgodzik added a commit to tgodzik/scala3 that referenced this issue Apr 29, 2025
tgodzik added a commit to scala/scala3 that referenced this issue May 5, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
This causes the code to grow quite a lot.

Fixes scalameta/metals#7397
@kasiaMarek kasiaMarek added this to the v1.5.3 milestone May 12, 2025
odersky pushed a commit to dotty-staging/dotty that referenced this issue May 12, 2025
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 Scala 3 Generic ticket relating to Scala 3
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants