vineflower icon indicating copy to clipboard operation
vineflower copied to clipboard

Could not properly define all variable types

Open zsrv opened this issue 1 year ago • 0 comments

Version: Quiltflower 1.10.0 (commit d43976c4523bf67344ee61366e997ac43f1927ef)

Original code (if it looks familiar, it is the same code in #270 but with the if statement removed):

public class Example {
    private void myMethod() {
        Object[] myObjects = new Object[]{};
        int[] myInts = new int[]{1, 2, 3};
        int i;
        int myObjectsLength = myObjects.length;
        for (i = 0; i < myInts.length; ++i) {
            int myInt = myInts[i];
            int[] myInts2 = myInts;
            int myInts2Length = myInts2.length;
            if (myInts2Length != myObjectsLength) {
                System.out.println(myInts2Length + " " + myObjectsLength);
            }
        }
    }
}

Quiltflower output:

public class Example {
   // $QF: Could not properly define all variable types!
   // Please report this to the Quiltflower issue tracker, at https://github.com/QuiltMC/quiltflower/issues with a copy of the class file (if you have the rights to distribute it!)
   private void myMethod() {
      Object[] myObjects = new Object[0];

      for (int myInt : new int[]{1, 2, 3}) {
         <unknown> var2;
         int myInts2Length = ((Object[])var2_1).length;
         byte myObjectsLength;
         if (myInts2Length != myObjectsLength) {
            System.out.println(myInts2Length + " " + myObjectsLength);
         }
      }
   }
}

zsrv avatar Apr 25 '23 09:04 zsrv