mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-03 15:50:52 +07:00
eliminateWildcards -> GenericsUtil; lambda: eliminate wildcards before formal types declaration (IDEA-90578)
This commit is contained in:
@@ -7,7 +7,7 @@ class NoInferenceResult {
|
||||
<T> void m1(T t) { }
|
||||
|
||||
void test() {
|
||||
m(<error descr="Cyclic inference">(String s1) -> (String s2) -> s1 + s2</error>);
|
||||
m(<error descr="Incompatible return type <lambda expression> in lambda expression">(String s1) -> (String s2) -> s1 + s2</error>);
|
||||
|
||||
m((String s1) -> s1.length());
|
||||
m((String s1) -> s1);
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
class Test1 {
|
||||
{
|
||||
Comparable<? extends Integer> c = (Integer o)->{
|
||||
return 0;
|
||||
};
|
||||
|
||||
Comparable<? super Integer> c1 = (Integer o)->{
|
||||
return 0;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class Test2<U> {
|
||||
interface I<T> {
|
||||
void m(T t);
|
||||
}
|
||||
private void foo(I<? super U> i1) {}
|
||||
|
||||
private void bar() {
|
||||
foo((U u) -> {});
|
||||
foo(u -> {});
|
||||
}
|
||||
|
||||
interface I1<T> {}
|
||||
private <A extends I1<? super U>> A bar(A a) {
|
||||
foo((U u)->{});
|
||||
foo(u->{});
|
||||
return a;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user