mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
switch tests on new inference
(cherry picked from commit d2cbf3f2833104c3a0381059b0d6ef8ac0b3c94c)
This commit is contained in:
+1
@@ -16,6 +16,7 @@ public class Autoboxing {
|
||||
{
|
||||
Object data = 1;
|
||||
boolean is1 = <error descr="Operator '==' cannot be applied to 'java.lang.Object', 'int'">data == 1</error>;
|
||||
boolean is2 = <error descr="Operator '==' cannot be applied to 'int', 'java.lang.Object'">1 == data</error>;
|
||||
}
|
||||
|
||||
//IDEADEV-5549: Short and double are convertible
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ public class FooBar1 {
|
||||
{
|
||||
Object x = null;
|
||||
Object y = (CharSequence & Serializable) x;
|
||||
Object y2 = (CharSequence & Integer) x;
|
||||
Object y2 = (CharSequence & <error descr="Interface expected here">Integer</error>) x;
|
||||
Object y3 = (Integer & CharSequence) x;
|
||||
<error descr="Incompatible types. Found: 'java.lang.CharSequence & java.io.Serializable', required: 'int'">int y1 = (CharSequence & Serializable) x;</error>
|
||||
}
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
import java.util.*;
|
||||
|
||||
interface A2{};
|
||||
interface B extends A2{};
|
||||
|
||||
class GenericTest {
|
||||
public static <M extends V, V> List<V> convert(List<M> list){
|
||||
return new ArrayList<V>();
|
||||
}
|
||||
public static void test(){
|
||||
// it prompts convert returns List<B>
|
||||
List<A2> as = convert(new ArrayList<B>());
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -3,6 +3,6 @@ abstract class A<T>{
|
||||
<S extends Number & Comparable<?>> void baz(A<S> a){}
|
||||
|
||||
void bar(A<Long> x, A<Integer> y){
|
||||
baz<error descr="'baz(A<S>)' in 'A' cannot be applied to '(A<capture<? extends java.lang.Number & java.lang.Comparable<? extends java.lang.Comparable<?>>>>)'">(foo(x, y))</error>;
|
||||
baz<error descr="'baz(A<java.lang.Number & java.lang.Comparable<?>>)' in 'A' cannot be applied to '(A<capture<? extends java.lang.Number & java.lang.Comparable<? extends java.lang.Comparable<?>>>>)'">(foo(x, y))</error>;
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -87,7 +87,7 @@ class CaptureTest {
|
||||
}
|
||||
|
||||
void foo (Class<? extends Emum<CaptureTest>> clazz) {
|
||||
Emum.valueOf<error descr="'valueOf(java.lang.Class<T>, java.lang.String)' in 'CaptureTest.Emum' cannot be applied to '(java.lang.Class<capture<? extends CaptureTest.Emum<CaptureTest>>>, java.lang.String)'">(clazz, "CCC")</error>;
|
||||
<error descr="Inferred type 'capture<? extends CaptureTest.Emum<CaptureTest>>' for type parameter 'T' is not within its bound; should extend 'CaptureTest.Emum<capture<? extends CaptureTest.Emum<CaptureTest>>>'">Emum.valueOf(clazz, "CCC")</error>;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -182,7 +182,7 @@ class TypeBug {
|
||||
|
||||
multiList.add(intHolder);
|
||||
multiList.add(doubleHolder);
|
||||
swapFirstTwoValues<error descr="'swapFirstTwoValues(java.util.List<TypeBug.ValueHolder<T>>)' in 'TypeBug' cannot be applied to '(java.util.List<TypeBug.ValueHolder<?>>)'">(multiList)</error>; //need to be highlighted
|
||||
swapFirstTwoValues<error descr="'swapFirstTwoValues(java.util.List<TypeBug.ValueHolder<java.lang.Object>>)' in 'TypeBug' cannot be applied to '(java.util.List<TypeBug.ValueHolder<?>>)'">(multiList)</error>; //need to be highlighted
|
||||
|
||||
// this line causes a ClassCastException when checked.
|
||||
Integer value = intHolder.value;
|
||||
|
||||
Reference in New Issue
Block a user