tcltest::test 15.12.1-syntax-1 { The type in the qualified super is not
        obscured } {
    empty_class T15121s1 {
        int T15121s1; // obscure the class name from normal expressions
        String s = T15121s1.super.toString();
    }
} PASS

tcltest::test 15.12.1-syntax-2 { The type in qualified super may not be a
        primitive type } {
    empty_class T15121s2 {
        Object o = int.super.toString();
    }
} FAIL

tcltest::test 15.12.1-syntax-3 { The type in qualified super may not be an
        array type } {
    empty_class T15121s3 {
        Object o = int[].super.toString();
    }
} FAIL

tcltest::test 15.12.1-syntax-4 { The type in qualified super may not be an
        array type } {
    empty_class T15121s4 {
        Object o = T15121s4[].super.toString();
    }
} FAIL

tcltest::test 15.12.1-syntax-5 { The type in qualified super may not be
        null } {
    empty_class T15121s5 {
        Object o = null.super.toString();
    }
} FAIL

tcltest::test 15.12.1-syntax-6 { The type in qualified super may not be
        void } {
    empty_class T15121s6 {
        Object o = void.super.toString();
    }
} FAIL

tcltest::test 15.12.1-syntax-7 { The type in qualified super may not be a
        literal } {
    compile [saveas T15121s7a.java {
class T15121s7a {
    int i;
}
class T15121s7b extends T15121s7a {
    Object o = 1 .super.toString();
}
    }]
} FAIL

tcltest::test 15.12.1-syntax-8 { The type in qualified super may not be a
        literal } {
    compile [saveas T15121s8a.java {
class T15121s8a {
    int i;
}
class T15121s8b extends T15121s8a {
    Object o = "1".super.toString();
}
    }]
} FAIL

tcltest::test 15.12.1-syntax-9 { The type in qualified super must enclose the
        current type } {
    empty_class T15121s9 {
	static class A {
	    static int i() { return 1; }
	}
	class B extends A {}
	int j = B.super.i();
    }
} FAIL

tcltest::test 15.12.1-syntax-10 { The type in qualified super must enclose the
        current type } {
    empty_class T15121s10 {
	interface A {
	    int i();
	}
	interface B extends A {
	    class C {
		int j = B.super.i(); // B encloses C, but is not a class
	    }
	}
    }
} FAIL

tcltest::test 15.12.1-type-1 { The type to search for plain MethodName is the
        innermost enclosing type which contains a method by that name } {
    empty_class T15121t1 {
	void m() {}
	class A {
	    void m(int i) {}
	    { m(); } // A is searched, not T15121t1; and A.m() does not exist
	}
    }
} FAIL

tcltest::test 15.12.1-type-2 { The type to search for plain MethodName is the
        innermost enclosing type which contains a method by that name } {
    empty_class T15121t2 {
	void m() {}
	class A {
	    void m(int i) {}
	    { m(1); } // A is searched, not T15121t1; and A.m(int) exists
	}
    }
} PASS

tcltest::test 15.12.1-type-3 { The type to search for TypeName.MethodName is
        TypeName, which must be a class } {
    empty_class T15121t3 {
	static class A extends T15121t3 {
	    static void m() {}
	    { T15121t3.m(); }
	}
    }
} FAIL

tcltest::test 15.12.1-type-4 { The type to search for TypeName.MethodName is
        TypeName, which must be a class } {
    empty_class T15121t4 {
	interface A {
	    void m();
	}
	{ A.m(); }
    }
} FAIL

tcltest::test 15.12.1-type-5 { The type to search for FieldName.MethodName is
        the compile-time type of FieldName } {
    empty_class T15121t5 {
	class A {
	    void m() {}
	}
	class B extends A {
	    void m(int i) {}
	}
	{
	    A a = new B();
	    a.m(1); // search for A.m(int) fails, even though a has runtime
                    // type B, and B.m(int) exists
	}
    }
} FAIL

tcltest::test 15.12.1-type-6 { The type to search for primary.MethodName is
        the compile-time type of primary } {
    empty_class T15121t6 {
	class A {
	    void m() {}
	}
	class B extends A {
	    void m(int i) {}
	}
	{
	    ((A)new B()).m(1); // search for A.m(int) fails, even though
                     // ((A)new B()) has runtime type B, and B.m(int) exists
	}
    }
} FAIL

tcltest::test 15.12.1-type-7 { The type to search for super.MethodName is
        the superclass, which must exist } {
    empty_class T15121t7 {
	interface A {
	    int m();
	}
	interface B extends A {
	    int i = super.m(); // A is not a superclass, but a superinterface
	}
    }
} FAIL

tcltest::test 15.12.1-type-8 { The type to search for super.MethodName is
        the superclass, which must exist } {
    empty_class T15121t8 {
	interface A {
	    String s = super.toString(); // interfaces do not extend Object
	}
    }
} FAIL

tcltest::test 15.12.1-type-9 { The type to search for super.MethodName is
        the superclass, which must exist } {
    empty_class T15121t9 {
	class A {
	    void m() {}
	}
	class B extends A {
	    void m(int i) {}
	    { super.m(1); } // A.m(int) does not exist
	}
    }
} FAIL

tcltest::test 15.12.1-type-10 { The type to search for super.MethodName is
        the superclass, which must exist } {
    empty_class T15121t10 {
	class A {
	    void m() {}
	}
	class B extends A {
	    { super.m(); }
	}
    }
} PASS

tcltest::test 15.12.1-type-11 { The type to search for
        ClassName.super.MethodName is the superclass of ClassName } {
    empty_class T15121t11 {
	interface A {
	    int m();
	}
	interface B extends A {
	    int i = B.super.m(); // A is not a superclass, but a superinterface
	}
    }
} FAIL

tcltest::test 15.12.1-type-12 { The type to search for
        ClassName.super.MethodName is the superclass of ClassName } {
    empty_class T15121t12 {
	interface A {
	    String s = A.super.toString(); // interfaces do not extend Object
	}
    }
} FAIL

tcltest::test 15.12.1-type-13 { The type to search for
        ClassName.super.MethodName is the superclass of ClassName } {
    empty_class T15121t13 {
	class A {
	    void m() {}
	}
	class B extends A {
	    void m(int i) {}
	    { B.super.m(1); } // A.m(int) does not exist
	}
    }
} FAIL

tcltest::test 15.12.1-type-14 { The type to search for
        ClassName.super.MethodName is the superclass of ClassName } {
    empty_class T15121t14 {
	class A {
	    void m() {}
	}
	class B extends A {
	    { B.super.m(); }
	}
    }
} PASS
