-
Bug
-
Resolution: Duplicate
-
P5
-
8, 9
When I compile the following, the line number for the error in the lambda body is left out of the error message.
-----
public class HiddenLine {
void m(String s1) {}
static class Nested {
void m2(Number n) {
Runnable r = () -> m(n);
}
}
}
-----
error: incompatible types: Number cannot be converted to String
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error
I can get the desired information using -Xdiags:verbose:
-----
HiddenLine.java:7: error: method m in class HiddenLine cannot be applied to given types;
Runnable r = () -> m(n);
^
required: String
found: Number
reason: argument mismatch; Number cannot be converted to String
1 error
-----
public class HiddenLine {
void m(String s1) {}
static class Nested {
void m2(Number n) {
Runnable r = () -> m(n);
}
}
}
-----
error: incompatible types: Number cannot be converted to String
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error
I can get the desired information using -Xdiags:verbose:
-----
HiddenLine.java:7: error: method m in class HiddenLine cannot be applied to given types;
Runnable r = () -> m(n);
^
required: String
found: Number
reason: argument mismatch; Number cannot be converted to String
1 error
- duplicates
-
JDK-8043870 Error without diagnostic position
-
- Closed
-