You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2022/01/16 14:11:49 UTC

[GitHub] [netbeans] ExE-Boss opened a new issue #3466: “Convert Explicit Type to Var” shouldn’t be reported for method references or lambda expressions

ExE-Boss opened a new issue #3466:
URL: https://github.com/apache/netbeans/issues/3466


   ### Apache NetBeans version
   
   Latest release
   
   ### What happened
   
   **Convert Explicit Type to Var** is reported for method references and lambda expressions, e.g.:
   ```java
   final Consumer<String> println = System.out::println;
   ```
   
   But it's invalid to replace the above with:
   ```java
   final var println = System.out::println;
   ```
   which results in the compile error:
   ```
   error: cannot infer type for local variable println
   final var println = System.out::println;
             ^
     (method reference needs an explicit target-type)
   ```
   
   ### How to reproduce
   
   _No response_
   
   ### Did this work correctly in an earlier version?
   
   - [ ] This used to work!
   
   ### Operating System
   
   Windows 10
   
   ### JDK
   
   OpenJDK Runtime Environment [Temurin](https://adoptium.net/)-17.0.1+12 (build 17.0.1+12)
   
   ### Apache NetBeans packaging
   
   Apache NetBeans provided installer
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit a pull request?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow the Apache Software Foundation's [Code of Conduct](https://www.apache.org/foundation/policies/conduct.html)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] neilcsmith-net closed issue #3466: Hint: “Convert Explicit Type to Var” shouldn’t be reported for method references or lambda expressions

Posted by GitBox <gi...@apache.org>.
neilcsmith-net closed issue #3466:
URL: https://github.com/apache/netbeans/issues/3466


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] neilcsmith-net commented on issue #3466: Hint: “Convert Explicit Type to Var” shouldn’t be reported for method references or lambda expressions

Posted by GitBox <gi...@apache.org>.
neilcsmith-net commented on issue #3466:
URL: https://github.com/apache/netbeans/issues/3466#issuecomment-1014678678


   Thanks for the report. Can reproduce. Definitely a bug.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] mbien commented on issue #3466: Hint: “Convert Explicit Type to Var” shouldn’t be reported for method references or lambda expressions

Posted by GitBox <gi...@apache.org>.
mbien commented on issue #3466:
URL: https://github.com/apache/netbeans/issues/3466#issuecomment-1014844717


   the hint is here:
   https://github.com/apache/netbeans/blob/master/java/java.hints/src/org/netbeans/modules/java/hints/jdk/ConvertToVarHint.java
   
   potentially easy to fix. But maybe someone else can do it since I don't use 'var' at all :) 
   
   adding the good-first-issue label.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists