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
The code should produce an error at the first line as fooInt is not in the scope.
The correct way to use it is to import MyClass.fooInt or use qualified name.
The same issue is for case classes and ordinary classes.
I guess it's a leaked implementation detail of "universal apply" feature + a bug in handling apply methods with default parameter values.
Now even non-case classes have synthetic apply methods.
It seams during compilation the default arguments are simply moved to the apply method of companion object (potentially synthetic), where object members are accessible.