See sample code at https://gist.github.com/3881844
The "Experiment" class is passed to MyAnnotation, which is kept due to "-keepattributes *Annotation*", but Experiment is not kept, and we get an error when trying to call .type().
Thanks for the detailed report. I can reproduce the problem. A relevant part of the annotation is removed indeed. I'll look into it.
I have modified the code for the upcoming ProGuard 4.9 beta2, so it keeps the Experiment class and the annotation "type = Experiment.class". However, the sample code also calls "newInstance()" on the Experiment class, which is a kind of reflection that ProGuard can't foresee. You'll still have to specify
-keep class pg.Experiment
This historically also preserves the parameterless constructor, required for this case. Now, this configuration already solves the issue for ProGuard 4.8, so the fix may have limited added value.
Good point about newInstance. I've updated the code to stop using newInstance (the original code is still available at https://gist.github.com/3881844/4f1c1b968ea94fe4bd7dc1d80963fab50c811c7f ).
If you want to tell me how to get the trunk version of Proguard (I couldn't find the source myself), I can test it out to make sure it works on this code with no config changes.
I don't have an on-line repository. I'll try to get version 4.9 beta2 out quickly.