You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Doubledefinition:
finallazygivenvalgiven_Config: Playground.One.Config in objectPlayground at line 9 and
finallazygivenvalgiven_Config: Playground.Two.Config in objectPlayground at line 10
Expectation
I expect that the compiler will notice that both givens come from different paths and use them as a full name to prevent the double definition from occurring. So the compiler should desugar to:
You can give them explicit names in user space. That's the disambiguation mechanism that is offered.
If the compiler did something automatic, the name would not be stable across two versions of a library where the second version adds the second definition. That would be very bad.
If the compiler did something automatic, the name would not be stable across two versions of a library where the second version adds the second definition. That would be very bad.
That's right, I haven't considered that. We could avoid that by always using the suggested desugaring for given X.Y.Z, but this will break backward compatibility.
I'm not clear if this is indeed a bug, or a limitation that can be lifted with or without a SIP.
Compiler version
v3.3.0
Minimized code
https://scastie.scala-lang.org/7m7S5DcCQYeZioWaeM2Uqw
Output
Expectation
I expect that the compiler will notice that both givens come from different paths and use them as a full name to prevent the double definition from occurring. So the compiler should desugar to:
The text was updated successfully, but these errors were encountered: