mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 03:13:40 +07:00
intersection in cast type: repeat interface, different parameterization checks
This commit is contained in:
+4
@@ -1,4 +1,5 @@
|
||||
import java.io.Serializable;
|
||||
import java.util.*;
|
||||
|
||||
class FooBar1 {
|
||||
{
|
||||
@@ -7,5 +8,8 @@ class FooBar1 {
|
||||
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>
|
||||
Object z0 = (Cloneable & <error descr="Unexpected type: class is expected">Runnable[]</error>) x;
|
||||
Object z1 = (Cloneable & <error descr="Repeated interface">Cloneable</error>) x;
|
||||
Object z2 = <error descr="java.util.Collection cannot be inherited with different arguments: String and Integer">(List<String> & Set<Integer>) x</error>;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -9,6 +9,6 @@ class Test {
|
||||
|
||||
{
|
||||
Predicate<String> mh1 = (Predicate<String> & Serializable)Test::test;
|
||||
Predicate<String> mh0 = (<warning descr="Casting 'Test::test' to 'Predicate<String> & Predicate<String>' is redundant">Predicate<String> & Predicate<String></warning>)Test::test;
|
||||
Predicate<String> mh0 = (Predicate<String> & <error descr="Repeated interface">Predicate<String></error>)Test::test;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user