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

Compile error with default implicit value #21938

Open
david04 opened this issue Nov 13, 2024 · 1 comment
Open

Compile error with default implicit value #21938

david04 opened this issue Nov 13, 2024 · 1 comment

Comments

@david04
Copy link

david04 commented Nov 13, 2024

Compiler version

Scala 3.5.2

Minimized code

class C()(implicit s: String = ""); C()

Output

method $lessinit$greater$default$1 in object C must be called with () argument

Expectation

Should compile

Thanks to @SethTisue for the help with minimizing the sample code 🙂

@david04 david04 added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels Nov 13, 2024
@SethTisue
Copy link
Member

as a workaround, omitting the empty first parameter list seems to avoid the issue:

scala> class C(using s: String = ""); C()
// defined class C
val res6: C = C@3991fe6d

@Gedochao Gedochao added area:implicits related to implicits area:default-parameters and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Nov 13, 2024
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

3 participants