Nested case class conversion with nice error messages.

Fixes #58
Review by @gzm0 @hubertp

True! Hoisiting isCaseClass out since it is used in other methods.
On 18/07/14 11:57, Hubert Plociniczak wrote:
>
> In core/src/main/scala/records/RecordConversions.scala:
>
> > -        c.abort(NoPosition,
> > -          s"Records can only be converted to case classes; $toType is not a case class.")
> > +    def convertRecordMaterializer(fromType: Type, toType: Type, path: List[String] = Nil): Tree =
> > +      convertRecordMaterializer(fromType, toType, toType, path)
> > +
> > +    def convertRecordMaterializer(
> > +      fromType: Type,
> > +      toType: Type,
> > +      originalType: Type,
> > +      path: List[String]): Tree = {
> > +
> > +      def isCaseClass(tpe: Type) =
> > +        toType.typeSymbol.asClass.isCaseClass
> > +
> > +      // check if the expected type is a case class
> > +      val prefix = if (path == Nil) "" else path.mkString("", ".", ".")
>
> A similar argument can be made for isCaseClass, yet you actually make 
> it a def. Just change it (and add @inline <https://github.com/inline> 
> if you really want to).
>
> —
> Reply to this email directly or view it on GitHub 
> <https://github.com/scala-records/scala-records/pull/70/files#r15103937>.
>