Why am I getting an AssertionError when assigning Arrays.asList() to var directly?

后端 未结 2 1105
傲寒
傲寒 2021-02-12 03:34

I\'m trying to understand local variable type inference in Java 10.

  1. The code below works perfectly during compilation and runtime:

    List list1 =         
    
    
            
2条回答
  •  一个人的身影
    2021-02-12 04:07

    This is a bug of openjdk, see this:

    Javac should skip non-denotable types in the LocalVariableTypeTable attribute

提交回复
热议问题