mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 15:09:39 +07:00
inference: allow child session inference if containing method is not generics
This commit is contained in:
@@ -150,7 +150,7 @@ public class InferenceSessionContainer {
|
||||
return properties.getInfo().getSubstitutor(false);
|
||||
}
|
||||
}
|
||||
return childSession.prepareSubstitution();
|
||||
return null;
|
||||
}
|
||||
return childSession.collectAdditionalAndInfer(parameters, arguments, properties, compoundInitialState.getInitialSubstitutor());
|
||||
}
|
||||
|
||||
@@ -7,6 +7,6 @@ class Test2 {
|
||||
}
|
||||
|
||||
{
|
||||
foo (bar(String.class), <error descr="'foo(java.lang.String, java.lang.Integer)' in 'Test2' cannot be applied to '(T, java.lang.String)'">""</error>);
|
||||
foo (bar(String.class), <error descr="'foo(java.lang.String, java.lang.Integer)' in 'Test2' cannot be applied to '(java.lang.String, java.lang.String)'">""</error>);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ import java.util.function.Function;
|
||||
|
||||
class Test {
|
||||
{
|
||||
valueOf(processFirst(x -> <error descr="Bad return type in lambda expression: Integer cannot be converted to V">x</error>));
|
||||
valueOf(processFirst(<error descr="no instance(s) of type variable(s) exist so that Integer conforms to char[]">x -> x</error>));
|
||||
}
|
||||
|
||||
public static <V> V processFirst(Function<Integer,V> f){
|
||||
|
||||
@@ -6,7 +6,7 @@ import java.util.stream.Stream;
|
||||
class Test {
|
||||
|
||||
void foo() {
|
||||
log(get(<error descr="Bad return type in method reference: cannot convert java.util.TreeSet<java.lang.String> to C">TreeSet<String>::new</error>));
|
||||
log(<error descr="no instance(s) of type variable(s) exist so that TreeSet<String> conforms to String[]">get(TreeSet<String>::new)</error>);
|
||||
}
|
||||
|
||||
private void log(String params[]) {
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
// "Add explicit type arguments" "true"
|
||||
|
||||
import java.util.*;
|
||||
|
||||
class MyTest {
|
||||
|
||||
void foo(List<String> list1, List<String> list2) {}
|
||||
|
||||
void bar() {
|
||||
foo(Collections.<String>singletonList("x"), unresolved());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// "Add explicit type arguments" "true"
|
||||
|
||||
import java.util.*;
|
||||
|
||||
class MyTest {
|
||||
|
||||
void foo(List<String> list1, List<String> list2) {}
|
||||
|
||||
void bar() {
|
||||
foo(Collections.single<caret>tonList("x"), unresolved());
|
||||
}
|
||||
}
|
||||
@@ -26,7 +26,7 @@ public class AddTypeArgumentsTest extends LightQuickFixParameterizedTestCase {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected LanguageLevel getLanguageLevel() {
|
||||
protected LanguageLevel getDefaultLanguageLevel() {
|
||||
return LanguageLevel.JDK_1_5;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user