Open mttkay opened 9 years ago
I think the JavaType
helper is missing a case for PrimitiveType
. What's the reason for using so much custom code around dealing with types? The Types
class and related in the JDK should cover all you need? You can obtain a Types
instance from the processing environment which you can use to enumerate types, no need to re-implement all this?
Thanks for telling about javax.lang.model.util.Types
, it simplifies things considerably. :) This is my first experiment of using APT and I couldn't find much learning material online (all the articles I found were far too basic), so a code review from someone with more experience is welcome. I figured there should be a simpler way for handling types, because that custom code would have gotten a roadblock sooner or later.
I'll look into this bug probably this Friday. Maybe switching to use Types
will solve it as a side effect.
:+1: Yeah the docs are definitely scarce around APT. I always found it useful to look at projects like Dagger or auto to see how they do it, especially around unit testing (they use Google Compile Testing which works pretty well)
I was declaring an Actor interface like so:
This fails the annotation processor with the message:
Is there any reason why primitive types are not supported?
It works when changing the formal parameter type to
Integer
.