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
abstractclassWordSpec {
exportthis.{extension_in=>extension_should}
extension(s: String) defin(f: =>Any):Unit= {
println(s)
f
}
}
objecttestextendsWordSpec {
"X" should {
"add numbers" in {
assert(1+1==2)
}
}
}
Output
no eligible member extension_in at thisthis.extension_in cannot be exported because it is already a member of classAnyWordSpecexportthis.{extension_in=>extension_should}
Expectation
Seems like the check for duplicates is over-eager and happens before renames are taken into account, making it illegal to rename symbols in this, but legal otherwise. Workaround is to create a proxy object and re-export from it:
A member is eligible if all of the following holds:
its owner is not a base class of the class(*) containing the export clause, ...
If we want to change this we'd need a feature request, and a discussion in depth. I personally think that a change would not be simple at all. There would be many things to specify, what constutes a clash and what doesn't.
Minimized code
Output
Expectation
Seems like the check for duplicates is over-eager and happens before renames are taken into account, making it illegal to rename symbols in
this
, but legal otherwise. Workaround is to create a proxy object and re-export from it:The text was updated successfully, but these errors were encountered: