Martinho0330 / javaparser

Automatically exported from code.google.com/p/javaparser
0 stars 0 forks source link

Type arguments for super field accesses #63

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The parser allows super field accesses to have type arguments. In particular, 
it accepts the following file, even though it is not valid Java syntax:

public class Foo {
    public static class Bar<E> {E e;}

    public static class Baz extends Bar<Integer> {
        public void baz() {
            Integer i = super.<Integer>e;
        }
    }
}

Original issue reported on code.google.com by Darmanit...@gmail.com on 4 Jul 2013 at 8:10

GoogleCodeExporter commented 9 years ago
On a related note, the parser also accepts "this.super.x" and "(1).super.x". 
The javac parser rejects both of these.

Original comment by Darmanit...@gmail.com on 4 Jul 2013 at 9:31