mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-13 09:19:13 +07:00
don't open captures on type computation (IDEA-154968)
This commit is contained in:
+1
-1
@@ -30,6 +30,6 @@ class Foo<T> {
|
||||
|
||||
public static void main(String[] args) {
|
||||
Foo<?> foo = getFoo();
|
||||
double value = (double) foo.getValue();
|
||||
double value = <error descr="Inconvertible types; cannot cast 'capture<?>' to 'double'">(double) foo.getValue()</error>;
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -2,7 +2,7 @@ abstract class A<T, S extends T>
|
||||
{
|
||||
abstract S bar();
|
||||
void foo(A<Runnable[], ? extends Cloneable[]> a){
|
||||
<error descr="Incompatible types. Found: 'java.lang.Cloneable[]', required: 'java.lang.Runnable[]'">Runnable[] x = a.bar();</error>
|
||||
<error descr="Incompatible types. Found: 'capture<? extends java.lang.Cloneable[]>', required: 'java.lang.Runnable[]'">Runnable[] x = a.bar();</error>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ abstract class AC<T, S>
|
||||
{
|
||||
abstract S bar();
|
||||
void foo(AC<Runnable[], ? extends Cloneable[]> a){
|
||||
<error descr="Incompatible types. Found: 'java.lang.Cloneable[]', required: 'java.lang.Runnable[]'">Runnable[] x = a.bar();</error>
|
||||
<error descr="Incompatible types. Found: 'capture<? extends java.lang.Cloneable[]>', required: 'java.lang.Runnable[]'">Runnable[] x = a.bar();</error>
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -45,7 +45,7 @@ class VarianceTesting {
|
||||
VarianceTesting t = l1.get(0);
|
||||
l.add(new VarianceTesting());
|
||||
l.add(null);
|
||||
<error descr="Incompatible types. Found: 'java.lang.Object', required: 'VarianceTesting'">VarianceTesting t1 = l.get(0);</error>
|
||||
<error descr="Incompatible types. Found: 'capture<? super VarianceTesting>', required: 'VarianceTesting'">VarianceTesting t1 = l.get(0);</error>
|
||||
X<? extends VarianceTesting> x1 = null;
|
||||
x1.putAll(new ArrayList<VarianceTesting>());
|
||||
List<?> unknownlist = l;
|
||||
@@ -142,7 +142,7 @@ class S1 {
|
||||
}
|
||||
|
||||
void bar(List<? extends S1> k) {
|
||||
f(k, <error descr="'f(java.util.List<capture<? extends S1>>, capture<? extends S1>)' in 'S1' cannot be applied to '(java.util.List<capture<? extends S1>>, S1)'">k.get(0)</error>);
|
||||
f(k, <error descr="'f(java.util.List<capture<? extends S1>>, capture<? extends S1>)' in 'S1' cannot be applied to '(java.util.List<capture<? extends S1>>, capture<? extends S1>)'">k.get(0)</error>);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user