mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
inference errors: make applicability error thread safe so multiple threads can perform overload resolution of parent method calls independently, save presentable error when substitutor cached only
This commit is contained in:
+2
-1
@@ -1,5 +1,6 @@
|
||||
class Foo<T extends Enum> {
|
||||
public T bar(Class<? extends T> type, String str) {
|
||||
return Enum.valueOf(<error descr="'valueOf(java.lang.Class<T>, java.lang.String)' in 'java.lang.Enum' cannot be applied to '(java.lang.Class<capture<? extends T>>, java.lang.String)'">type</error>, str);
|
||||
return <error descr="Incompatible types. Required T but 'valueOf' was inferred to T:
|
||||
Incompatible types: Enum is not convertible to T">Enum.valueOf(type, str);</error>
|
||||
}
|
||||
}
|
||||
+2
-1
@@ -10,7 +10,8 @@ class Test {
|
||||
|
||||
public void test(Set<MyConsumer> set) {
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<Parent, MyConsumer<Parent>> map = create<error descr="'create(java.util.Set<T>)' in 'Test' cannot be applied to '(java.util.Set<Test.MyConsumer>)'">(set)</error>;
|
||||
Map<Parent, MyConsumer<Parent>> map = <error descr="Incompatible types. Required Map<Parent, MyConsumer<Parent>> but 'create' was inferred to Map<S, T>:
|
||||
Incompatible equality constraint: MyConsumer<Test.Parent> and MyConsumer">create(set);</error>
|
||||
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -4,7 +4,8 @@ abstract class Group {
|
||||
}
|
||||
|
||||
public <T extends Category> T get(Key<T> key) {
|
||||
return getCategory<error descr="'getCategory(Key<R>)' in 'Group' cannot be applied to '(Key<T>)'">(key)</error>;
|
||||
return <error descr="Incompatible types. Required T but 'getCategory' was inferred to R:
|
||||
Incompatible types: Category is not convertible to T">getCategory(key);</error>
|
||||
}
|
||||
|
||||
public abstract <R extends Category<R>> R getCategory(Key<R> key);
|
||||
|
||||
+2
-1
@@ -10,7 +10,8 @@ class NachCollections<K,V> {
|
||||
Collection<? super Map.Entry<K,V>> c2,
|
||||
Consumer<Map.Entry<K, V>> a) {
|
||||
c1.forEach(consumer(a));
|
||||
c2.forEach(consumer<error descr="'consumer(java.util.function.Consumer<java.util.Map.Entry<K1,V1>>)' in 'NachCollections' cannot be applied to '(java.util.function.Consumer<java.util.Map.Entry<K,V>>)'">(a)</error>);
|
||||
c2.forEach(<error descr="Incompatible types. Required Consumer<? super capture of ? super Entry<K, V>> but 'consumer' was inferred to Consumer<Entry<K1, V1>>:
|
||||
no instance(s) of type variable(s) K1, V1 exist so that capture of ? super Entry<K, V> conforms to Entry<K1, V1>">consumer(a)</error>);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user