We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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 Entity[M, T, P] def (me: M) receive(sender: T)(msg: P)(given Entity[T, M, P]): Unit def (me: M) name(): String class GreetingPerson(private val name: String) object GreetingPerson given GreetingPersonEntity: Entity[GreetingPerson, GreetedPerson, String] def (me: GreetingPerson) receive(sender: GreetedPerson)(msg: String)(given Entity[GreetedPerson, GreetingPerson, String]): Unit = println(f"Thanks for saying $msg, ${sender.name()}") def (me: GreetingPerson) name() = me.name class GreetedPerson(private val name: String) object GreetedPerson given GreetedPersonEntity: Entity[GreetedPerson, GreetingPerson, String] def (me: GreetedPerson) receive(sender: GreetingPerson)(msg: String)(given Entity[GreetingPerson, GreetedPerson, String]): Unit = println(f"Thanks for saying $msg, ${sender.name()}") def (me: GreetedPerson) name() = me.name
The code should compile but it doesn't unless val name is renamed to something else.
val name
The text was updated successfully, but these errors were encountered:
Minimized:
class Foo(private val name: String) // Compiles with s/name/blah/ object Bar { def (f: Foo) name() = "" def main(f: Foo) = println(s"Hello ${f.name()}") }
Sorry, something went wrong.
Add regression tests for scala#7375
19841a5
Merge pull request #10859 from griggt/fix-#7375
1302da3
Fix #7375: Add regression test
Successfully merging a pull request may close this issue.
minimized code
expectation
The code should compile but it doesn't unless
val name
is renamed to something else.The text was updated successfully, but these errors were encountered: