You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "Achal1607 (via GitHub)" <gi...@apache.org> on 2023/12/03 06:58:29 UTC

[PR] Added warning for case where var and diamond operator are used together [netbeans]

Achal1607 opened a new pull request, #6780:
URL: https://github.com/apache/netbeans/pull/6780

   The user may be surprised that `var v = new ArrayList<>();` will be inferred as `ArrayList<Object>`. So, added a warning for such case.
   
   closes [#javavscode-69](https://github.com/oracle/javavscode/issues/69)


-- 
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


Re: [PR] Added warning for case where var and diamond operator are used together [netbeans]

Posted by "lahodaj (via GitHub)" <gi...@apache.org>.
lahodaj commented on PR #6780:
URL: https://github.com/apache/netbeans/pull/6780#issuecomment-1839098420

   I think writing `var v = new ArrayList<>();` is likely a mistake, as it cannot infer anything nice. So a warning does not seem bad to me. I was thinking of this, and when we were generalizing the pattern for the hint, I/we probably went a bit too far. So this:
   https://github.com/Achal1607/netbeans/pull/2
   limits the warning to only Collections/Maps, and only to constructors that are unlikely to infer something sensible.


-- 
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


Re: [PR] Added warning for case where var and diamond operator are used together [netbeans]

Posted by "lahodaj (via GitHub)" <gi...@apache.org>.
lahodaj merged PR #6780:
URL: https://github.com/apache/netbeans/pull/6780


-- 
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