Closed amelentev closed 11 years ago
javac on:
import java.util.*; import java.math.*; class bug { public static void main(String[] args) { List<BigInteger> a = new ArrayList<>(); a.add(BigInteger.ONE); a[0] = BigInteger.TEN; a[0] = 5; // BigInteger.valueOf(5) System.out.println(a[0]); } }
outputs:
bug.java:8: error: array required, but List<BigInteger> found a[0] = 5; // BigInteger.valueOf(5)
In this case a[0] = 5 should transform to a.set(0, BigInteger.valueOf(5)) but if class of a have also #set(int, int) method then there will be confusion. So wontfix for now.
a[0] = 5
a.set(0, BigInteger.valueOf(5))
a
#set(int, int)
javac on:
outputs: