Propagate constants in useless array assignment and reference #115
Open
Description
Here's a short example:
Object[] arrayOfObject = new Object[2];
arrayOfObject[0] = "hello";
arrayOfObject[1] = world";
someMethod(arrayOfObject[0], arrayOfObject[1])
I think this could work by replacing aget
on a known array with a constant-izable value with the constant op equivalent. Dead code analysis would then notice arrayOfObject
isn't used. For an easy example of this, see #94.