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
In Scala 2.10.0 you can write a macro that will define an anonymous class with a type member and return an instance that will be statically typed as a structural type with that type member:
In Scala 2.10.0 you can write a macro that will define an anonymous class with a type member and return an instance that will be statically typed as a structural type with that type member:
(Where ReflectionUtils just defines a constructor method for convenience.)
And now:
But if we try the same thing with a method instead of a type member, it doesn't work:
We just don't end up with a structural type:
But for some reason we can add an extra class that extends the anonymous class and instantiate that instead:
And it works:
See this Stack Overflow question for more discussion.
The text was updated successfully, but these errors were encountered: