Skip to content

Overloading with context function bug #15163

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

Open
soronpo opened this issue May 11, 2022 · 0 comments
Open

Overloading with context function bug #15163

soronpo opened this issue May 11, 2022 · 0 comments

Comments

@soronpo
Copy link
Contributor

soronpo commented May 11, 2022

This bug is related to #14699, which was solved but we missed a case for context function blocks.

Compiler version

v3.1.3-RC2

Minimized code

See https://scastie.scala-lang.org/ftY9Wn6KQvC81LR30o3jUA

trait Ctx
given Ctx with {}
def always(block: Ctx ?=> Unit): Unit = {}
def always(args: Int*)(block: Ctx ?=> Unit): Unit ={}

always{} //error
always(1,2,3) {}

Output

None of the overloaded alternatives of method always in object Playground with types
 (args: Int*)(block: (Playground.Ctx) ?=> Unit): Unit
 (block: (Playground.Ctx) ?=> Unit): Unit
match arguments (Unit)

Expectation

No error.

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

1 participant