Type annotation in wildcard and class reference types; more tests

This commit is contained in:
Roman Shevchenko
2013-04-05 21:08:12 +02:00
parent 69242b8a27
commit 218fd54bf2
9 changed files with 222 additions and 91 deletions
@@ -0,0 +1,12 @@
// "Cast to 'int'" "true"
import java.lang.annotation.*;
import static java.lang.annotation.ElementType.*;
@Target({TYPE_USE}) @interface TA { String value() default ""; }
class C {
{
Object o = null;
@TA("wtf") <caret>int i = (@TA("wtf") int) o;
}
}
@@ -8,6 +8,6 @@ import static java.lang.annotation.ElementType.*;
class C {
{
Object o = null;
@TA <caret>List<@TA ? extends @TA String> l = (@TA List<? extends @TA String>) o;
@TA List<@TA ? extends @TA String> l = (@TA List<@TA ? extends @TA String>) o;
}
}
@@ -0,0 +1,12 @@
// "Cast to 'int'" "true"
import java.lang.annotation.*;
import static java.lang.annotation.ElementType.*;
@Target({TYPE_USE}) @interface TA { String value() default ""; }
class C {
{
Object o = null;
@TA("wtf") <caret>int i = o;
}
}