-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue #90, added support for DocDef #124
Issue #90, added support for DocDef #124
Conversation
case m: DefDef if !m.mods.hasFlag(Flag.PRIVATE) && !m.mods.hasFlag(Flag.PROTECTED) => m | ||
case t if t.isInstanceOf[Trees#DocDef] => matchMethod(t.asInstanceOf[Trees#DocDef].definition.asInstanceOf[Tree]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
case t: Trees#DocDef => t.definition.asInstanceOf[Tree]
won't work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately if you try to do this compilation error will occur:
Error:(256, 23) pattern type is incompatible with expected type;
found : scala.tools.nsc.ast.Trees#DocDef
required: TypeClassMacros.this.c.universe.TreeApi
case t: Trees#DocDef => matchMethod(t.definition.asInstanceOf[Tree])
Trees from reflect API and NSC aren't compatible. Please check previously linked scala issues.
Looks good to me. Could you add a small test? |
The only proper way to test it is to run |
1de701f
to
aa13c2c
Compare
Edit: it fails regardless of comments or this additional case for |
The 2.13 failure is due to scala/bug#11045 -- fixed in 2.13.0-RC1. I pushed a temporary fix for that to this PR. I'll merge on Travis success and then get a build out. |
Ohh, didn't know about this bug. Thanks for info and merging PR. |
#90
Unfortunately it is impossible to implement without casting - compare issues: scala/bug#8904 and scala/bug#7993