On Wed, Apr 24, 2013 at 11:44 PM, Paul Phillips <notifications@github.com>wrote:

> In src/compiler/scala/tools/nsc/doc/model/ModelFactory.scala:
>
> >            case aClass: DocTemplateEntity with Class =>
> > -            (aClass.primaryConstructor map { _.valueParams.head }) match {
> > -              case Some(vps) => vps map { Some(_) }
> > -              case None => noParams
> > -            }
> > -          case _ => noParams
> > +            val constr = aClass.constructors find (_.asInstanceOf[MemberImpl].sym == annot.original.symbol)
>
> You never have to cast. There is a limit to "when in Rome, do as Romans
> do." - if the Romans are sufficiently depraved one should do as the Greeks
> do.
>
Not fluent in Greek, I would appreciate a tip how Greeks would tackle it.
-collect is an aknowledgement of the fact that I'm not sure what to expect
here. If one day the implementations start returning not MemberImpl,
collect will silently return None.
-Declaring a type parameter 'MemberRepr' and returning it in 'def
constructors' is something I would do if I had a chance to break binary
compatibility. Since this PR targets 2.10, I don't have it.
Probably collect is a better fix in 2.10 (though I'm not sure why it's
better than casting), while deeper refactoring should be done in master.

> —
> Reply to this email directly or view it on GitHub<https://github.com/scala/scala/pull/2392/files#r3944682>
> .
>