We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
trait Foo def g(f: Int => Int): Int = 1 def g(given String)(f: Int => String): String = "2" @main def Test = val m: Foo = ??? given String = "foo" m.g(x => "2")
-- [E007] Type Mismatch Error: /Users/kmetiuk/Projects/scala3/pg/sandbox/iss71.scala:8:11 8 | m.g(x => "2") | ^^^ | Found: ("2" : String) | Required: Int 1 error found
Works if you define the second g as (move the given to the last arg group):
g
given
def g(f: Int => String)(given String): String = "2"
Works also if you define gs as:
def g(f: Int): Int = 1 def g(given String)(f: String): String = "2"
And use as m.g("2").
m.g("2")
Works also if you call m.g(x => 1).
m.g(x => 1)
The original case should resolve overloading correctly.
The text was updated successfully, but these errors were encountered:
Fix scala#7793: Account for context params preceding normal ones in o…
9706421
…verloading
09250a6
48ed5d7
f8c70ee
Merge pull request #8406 from dotty-staging/fix-#7793
3d3d147
Fix #7793: Handle context parameters in resolveOverloaded
anatoliykmetyuk
Successfully merging a pull request may close this issue.
minimized code
Works if you define the second
g
as (move thegiven
to the last arg group):Works also if you define
g
s as:And use as
m.g("2")
.Works also if you call
m.g(x => 1)
.expectation
The original case should resolve overloading correctly.
The text was updated successfully, but these errors were encountered: