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 some places of Scaladoc we need to cast members of public API into compiler API to get more information. We can try to expose necessary elements of compiler API in public API to minimize casting.
TypeRepr.memberInfo(sym: Symbol) <- equivalent of Type.memberInfo(sym: Symbol)
Method which returns all supertypes of class
Method which returns all members of Symbol
Method which returns TypeRepr of ClassDef
There are also some fishy pieces of code that should probably be removed:
We need to filter out some methods by matching Strings: s.name.contains("$super$") , ".*\\$default\\$\\d+$".r.matches(s.name). There's no flags set to filter these methods, maybe we should add Synthetic flag or expose some API to be able to filter them out.
There's currently no way to disambiguate constructor with empty param list and constructor without param list: for DefDef.paramss both return List(List()). Currently we hack this check using positions.
It's probably a good time to do the changes now to add them to 3.1.0.
Basically, all methods that used internal API in Scaladoc are removed besides the method that gets all members from ClassDef. The reason of that is that methods from Quotes are calling lookupMember which also returns members from self-type which shouldn't be documented.
Besides that, there are two methods that check if a member is a super accessor or a default parameter forwarder which are implemented a bit hacky, basing on the member name. In the future we might want to replace them with some flag.
In some places of Scaladoc we need to cast members of public API into compiler API to get more information. We can try to expose necessary elements of compiler API in public API to minimize casting.
Things missing in public API:
TypeRepr.isTupleType
(see Add TypeRepr.isTupleN to reflection API #13384)Position.exists
TypeRepr.isCompiletimeAppliedType
TypeRepr.memberInfo(sym: Symbol)
<- equivalent ofType.memberInfo(sym: Symbol)
There are also some fishy pieces of code that should probably be removed:
s.name.contains("$super$")
,".*\\$default\\$\\d+$".r.matches(s.name)
. There's no flags set to filter these methods, maybe we should add Synthetic flag or expose some API to be able to filter them out.DefDef.paramss
both returnList(List())
. Currently we hack this check using positions.It's probably a good time to do the changes now to add them to 3.1.0.
@smarter
@nicolasstucki
@romanowski
The text was updated successfully, but these errors were encountered: