Refactor around the macro definitions into 3 files. Both converter and s...

...etter support Options
I had been thinking it just wouldn't compile. But you could be right in the
case of the fields constructor empty is valid. So yes this needs a
test/throw. I was more thinking in the general case as we discussed we need
to put more tests on the 'inside' of our macros which would catch your
example there. But not for instance The case of an empty case class. I
think that would pass through a case class test

On Monday, December 29, 2014, P. Oscar Boykin <notifications@github.com>
wrote:

> In
> scalding-macros/src/main/scala/com/twitter/scalding/macros/impl/FieldsProviderImpl.scala
> <https://github.com/twitter/scalding/pull/1145#discussion-diff-22335239>:
>
> > +          val simpleRet = List((q"""classOf[$fieldType]""", s"$outerName$fieldName"))
> > +          accessorMethod.returnType match {
> > +            case tpe if tpe =:= typeOf[String] => simpleRet
> > +            case tpe if tpe =:= typeOf[Boolean] => simpleRet
> > +            case tpe if tpe =:= typeOf[Short] => simpleRet
> > +            case tpe if tpe =:= typeOf[Int] => simpleRet
> > +            case tpe if tpe =:= typeOf[Long] => simpleRet
> > +            case tpe if tpe =:= typeOf[Float] => simpleRet
> > +            case tpe if tpe =:= typeOf[Double] => simpleRet
> > +            case tpe if IsCaseClassImpl.isCaseClassType(c)(tpe) => expandMethod(tpe, s"$outerName$fieldName.")
> > +            case _ => c.abort(c.enclosingPosition, s"Case class ${T} is not pure primitives or nested case classes")
> > +          }
> > +        }.toList
> > +    }
> > +
> > +    val expanded = expandMethod(T.tpe, "")
>
> I'm confused, what is preventing something like:
>
> def test[T: IsCaseClass](t: T): Any = Macros.toFields[T]
>
> Which compiled before, but would give, I think, and empty Fields instance
> here.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/twitter/scalding/pull/1145/files#r22335239>.
>