Java 8: Generic type inference improvements

前端 未结 3 1402
夕颜
夕颜 2021-02-14 23:40

With JEP 101: Generalized Target-Type Inference, this

final List bools = Arrays.asList(true,false, true);
final List string = boo         


        
相关标签:
3条回答
  • 2021-02-15 00:04

    The example is accepted by every Eclipse release since the release of Java 8.

    (Releases greater or equal P20140317-1600).

    0 讨论(0)
  • 2021-02-15 00:13

    Seems like this issue is fixed now with the latest JDT snapshot implementing the desired proposal.

    0 讨论(0)
  • 2021-02-15 00:15

    It just works fine under IntelliJ Idea 13 which seems ahead of Eclipse for Java8 support. So I guess you just have to wait until Eclipse will be able to compile this.

    0 讨论(0)
提交回复
热议问题