hg: lambda/lambda/langtools: 8012003: Method diagnostics resolution need to be simplified in some cases

Jonathan Gibbons jonathan.gibbons at oracle.com
Thu Apr 11 11:50:10 PDT 2013


Nice!

-- Jon

On 04/11/2013 11:30 AM, maurizio.cimadamore at oracle.com wrote:
> Changeset: 53cbb85eb634
> Author:    mcimadamore
> Date:      2013-04-11 19:26 +0100
> URL:       http://hg.openjdk.java.net/lambda/lambda/langtools/rev/53cbb85eb634
>
> 8012003: Method diagnostics resolution need to be simplified in some cases
>
> This patch adds a -Xdiags flag that can be set to either 'verbose' or 'compact' (latter being new default).
> If 'compact' is chosen, javac will try to simplify complex method resolution diagnostics. Example:
>
> Before:
>
> Test.java:10: error: method m in class Test cannot be applied to given types;
>          m(()->1);
>          ^
>    required: Runnable
>    found: ()->1
>    reason: argument mismatch; bad return type in lambda expression
>        int cannot be converted to void
>
> After:
>
> Test.java:10: error: incompatible types: bad return type in lambda expression
>          m(()->1);
>                ^
>      int cannot be converted to void
>
> ! src/share/classes/com/sun/tools/javac/comp/Attr.java
> ! src/share/classes/com/sun/tools/javac/comp/Resolve.java
> ! src/share/classes/com/sun/tools/javac/main/JavaCompiler.java
> ! src/share/classes/com/sun/tools/javac/main/Option.java
> ! src/share/classes/com/sun/tools/javac/resources/compiler.properties
> ! src/share/classes/com/sun/tools/javac/resources/javac.properties
> ! src/share/classes/com/sun/tools/javac/util/JCDiagnostic.java
> ! src/share/classes/com/sun/tools/javac/util/List.java
> ! src/share/classes/com/sun/tools/javac/util/Log.java
> + test/tools/javac/Diagnostics/compressed/T8012003a.java
> + test/tools/javac/Diagnostics/compressed/T8012003a.out
> + test/tools/javac/Diagnostics/compressed/T8012003b.java
> + test/tools/javac/Diagnostics/compressed/T8012003b.out
> + test/tools/javac/Diagnostics/compressed/T8012003c.java
> + test/tools/javac/Diagnostics/compressed/T8012003c.out
> + test/tools/javac/diags/examples/CompressedDiags.java
> ! test/tools/javac/diags/examples/KindnameConstructor.java
> + test/tools/javac/diags/examples/ProbFoundReqFragment.java
> ! test/tools/javac/lambda/TargetType66.out
>
>



More information about the lambda-dev mailing list