basmith / stab-language

Automatically exported from code.google.com/p/stab-language
Apache License 2.0
0 stars 0 forks source link

Parameter annotation are not generated on bytecode #11

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Annotations applied to parameters are not included in generated bytecode.

Original issue reported on code.google.com by ice.ta...@gmail.com on 26 Jun 2010 at 3:57

GoogleCodeExporter commented 8 years ago
It was on the TODO list. It is now implemented.

Original comment by stab.hac...@gmail.com on 26 Jun 2010 at 10:32

GoogleCodeExporter commented 8 years ago
The following code:

    [Target({ ElementType.FIELD, ElementType.PARAMETER })]
    [Retention(RetentionPolicy.RUNTIME)]
    public interface Demo : Annotation {
    }

    [StaticClass]
    public class Main {

        public static void main( [Deprecated][Demo] String[] args){
            System.out.println("DONE");
        }
    }

generate de "Deprecated" annotation, but is not generating the "Demo" 
annotation.

Original comment by ice.ta...@gmail.com on 27 Jun 2010 at 10:53

GoogleCodeExporter commented 8 years ago
I compiled your code and the annotations are both generated.

Original comment by stab.hac...@gmail.com on 27 Jun 2010 at 12:16

GoogleCodeExporter commented 8 years ago
I found the issue, the annotations are not being generated on constructors, 
delegates and interfaces for example:

    [Target({ ElementType.FIELD, ElementType.PARAMETER })]
    [Retention(RetentionPolicy.RUNTIME)]
    public interface Demo : Annotation {
    }

    delegate void D([Deprecated][Demo] int i);

    public interface Test {
        void foo([Deprecated][Demo] int i);
    }

    public class Main {

        public Main( [Deprecated][Demo] String[] args){
            System.out.println("DONE CONSTRUCTOR");
        }

        public static void main( [Deprecated][Demo] String[] args){
            System.out.println("DONE");
        }
    }

only the static main method is annotated.

Original comment by ice.ta...@gmail.com on 3 Jul 2010 at 1:42

GoogleCodeExporter commented 8 years ago
It should work in all cases now.

Original comment by stab.hac...@gmail.com on 4 Jul 2010 at 11:53