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

Implicits are resolved with empty parameter lists #22439

Open
hamzaremmal opened this issue Jan 23, 2025 · 10 comments · May be fixed by #22458
Open

Implicits are resolved with empty parameter lists #22439

hamzaremmal opened this issue Jan 23, 2025 · 10 comments · May be fixed by #22458
Assignees
Labels
area:implicits related to implicits itype:bug regression This worked in a previous version but doesn't anymore

Comments

@hamzaremmal
Copy link
Member

hamzaremmal commented Jan 23, 2025

Compiler version

Since 3.4.2

Minimized code

implicit val x: Int = 0
def foo(implicit x: Int): Int = x
foo()

Output

Complies

Expectation

Behaves as Scala < 3.4.2 and as in the specification.

Note

This is the error message that was generated before 3.4.2

-- [E171] Type Error: ----------------------------------------------------------
1 |foo()
  |^^^^^
  |missing argument for parameter x of method foo: (implicit x: Int): Int
1 error found

and in scala 2.13.14

scala> foo()
          ^
       error: not enough arguments for method foo: (implicit x: Int): Int.
       Unspecified value parameter x.
@hamzaremmal hamzaremmal added area:implicits related to implicits itype:bug regression This worked in a previous version but doesn't anymore labels Jan 23, 2025
@Gedochao
Copy link
Contributor

Last good stable release: 3.4.1
Last good nightly release: 3.4.2-RC1-bin-20240222-98efdab-NIGHTLY
First bad nightly release: 3.4.2-RC1-bin-20240226-e0cb1e7-NIGHTLY
First bad stable release: 3.4.2

e0cb1e7 is the first bad commit
cc @SethTisue

@sjrd
Copy link
Member

sjrd commented Jan 23, 2025

e0cb1e7 is the first bad commit
cc @SethTisue

That ... does not look likely. 😅 Is it possible that bisect ended up in a "local minimum" of the build not even functioning at all, rather than the actual typechecking regression?

@som-snytt
Copy link
Contributor

Seems to be 1e89016

A quarter-line tweak in #19737

@Gedochao
Copy link
Contributor

Is it possible that bisect ended up in a "local minimum" of the build not even functioning at all, rather than the actual typechecking regression?

Yeah... that's likely what happened 😅 I need to think about tweaking the bisect script for cases such as this...

Anyway, as @som-snytt suggested, the correct commit seems to be 1e89016
cc @EugeneFlesselle

@SethTisue
Copy link
Member

whew

@som-snytt
Copy link
Contributor

I took a look. It turns on that an implicit parameter list is supplied only when it is missing, whereas with "use-site using" or explicit using you can supply just some args. (In matchArgs, it already has an arg list.) (I remember that subtlety came up a few years ago in documentation for scala 2.)

All this time, I thought I knew how to call a method.

I'll submit a PR when I see where to toss the monkey wrench.

@som-snytt som-snytt assigned som-snytt and unassigned hamzaremmal Jan 24, 2025
@som-snytt som-snytt linked a pull request Jan 26, 2025 that will close this issue
@som-snytt som-snytt removed their assignment Jan 27, 2025
@som-snytt
Copy link
Contributor

Removing myself as assignee because the PR requires review. There's nothing on the "board" that indicates "requires review" or who is available.

@Gedochao
Copy link
Contributor

Gedochao commented Jan 29, 2025

Removing myself as assignee because the PR requires review.

@som-snytt Hey, would you mind actually staying assigned in this case? Your PR contains a solution and it's awaiting review, so in so many words, you currently "own" the solution. As in, there is no reason for anybody else to jump into this for the time being.
Asking, since it makes it easier for me to track things 😅

@som-snytt som-snytt self-assigned this Jan 29, 2025
@som-snytt
Copy link
Contributor

@Gedochao Sure, I just don't know how the process works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:implicits related to implicits itype:bug regression This worked in a previous version but doesn't anymore
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants