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
That's sort of intentional. getClass in nsc has an insane amount of specialized logic devoted to it. Seems overkill for something as marginal. So we dropped that in Dotty. But there are saner ways to regain it. I was thinking of making getClass available as a Decorator in Predef.
Then, translate this to the real getClass at erasure. The real getClass needs to be hidden in Object so that the decorator kicks in. The easiest way to do this is to make it private and drop that flag at erasure.
EDIT: It's no so simple. First, we cannot define the decorator because getClass is final in Any. To get around this, we'd need to make it private instead. But then we have to check any illegal redefinitions of getClass manually while excluding the decorator from this check. Furthermore, there's the problem how to bootstrap this. It seems a solution is in reach only once Dotty bootstraps itself.
Scala 2:
Dotty:
The text was updated successfully, but these errors were encountered: