mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Java: better error message when there are more arguments than parameters (IDEA-336129)
GitOrigin-RevId: a17a5f0f3878b9baf211737a614d1aa1a5103d31
This commit is contained in:
committed by
intellij-monorepo-bot
parent
ed3ae46a60
commit
6916b6b005
+1
-1
@@ -3,7 +3,7 @@ import java.util.function.UnaryOperator;
|
||||
|
||||
class Test<T> {
|
||||
private void example() {
|
||||
update(x -> x.flatMap<error descr="'flatMap()' in 'Test' cannot be applied to '(<lambda expression>)'">(y -> getEmpty())</error>);
|
||||
update(x -> x.flatMap<error descr="Expected no arguments but found 1">(y -> getEmpty())</error>);
|
||||
}
|
||||
|
||||
private <J> Test<J> flatMap() {
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ class R<T> {
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
test(new R<>.O<error descr="'O(java.lang.Object)' in 'R.O' cannot be applied to '()'">()</error>);
|
||||
test(new R<>.O<error descr="Expected 1 argument but found 0">()</error>);
|
||||
}
|
||||
|
||||
private static void test(R.O o) { }
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
class A<R>{
|
||||
A(R value) {}
|
||||
public static void main(String[] args) {
|
||||
A<Integer> a = new A<><error descr="'A(R)' in 'A' cannot be applied to '(java.lang.String, int)'" tooltip="Expected 1 arguments but found 2">("hi", 1)</error>;
|
||||
A<Integer> a = new A<><error descr="Expected 1 argument but found 2" tooltip="Expected 1 argument but found 2">("hi", 1)</error>;
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -8,8 +8,8 @@ interface TypeB extends TypeA {
|
||||
|
||||
class Test {
|
||||
void foo(final TypeB typeB) {
|
||||
typeB.test<error descr="'test(java.lang.String[])' in 'TypeB' cannot be applied to '(java.lang.String, java.lang.String)'">("a", "b")</error>;
|
||||
typeB.test<error descr="Expected 1 argument but found 2">("a", "b")</error>;
|
||||
typeB.test<error descr="'test(java.lang.String[])' in 'TypeB' cannot be applied to '(java.lang.String)'">("a")</error>;
|
||||
typeB.test<error descr="'test(java.lang.String[])' in 'TypeB' cannot be applied to '()'">()</error>;
|
||||
typeB.test<error descr="Expected 1 argument but found 0">()</error>;
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -7,8 +7,8 @@ class Test {
|
||||
varargs(1);
|
||||
varargs(1, "");
|
||||
varargs(1, "", "");
|
||||
usage<error descr="'usage(java.lang.String)' in 'Test' cannot be applied to '()'">()</error>;
|
||||
usage<error descr="Expected 1 argument but found 0">()</error>;
|
||||
usage("");
|
||||
usage<error descr="'usage(java.lang.String)' in 'Test' cannot be applied to '(java.lang.String, java.lang.String)'">("", "")</error>;
|
||||
usage<error descr="Expected 1 argument but found 2">("", "")</error>;
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -5,7 +5,7 @@ interface ToStringBug {
|
||||
class Inner implements ToStringBug {
|
||||
|
||||
{
|
||||
toString<error descr="'toString()' in 'java.lang.Object' cannot be applied to '(java.lang.String)'">( "x")</error>;
|
||||
toString<error descr="Expected no arguments but found 1">( "x")</error>;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ import static java.util.Objects.toString;
|
||||
class Foo {
|
||||
|
||||
String go() {
|
||||
return toString<error descr="'toString()' in 'Foo' cannot be applied to '(java.lang.String)'">("foo")</error>;
|
||||
return toString<error descr="Expected no arguments but found 1">("foo")</error>;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
|
||||
Reference in New Issue
Block a user