Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not properly define all variable types #271

Open
zsrv opened this issue Apr 25, 2023 · 0 comments
Open

Could not properly define all variable types #271

zsrv opened this issue Apr 25, 2023 · 0 comments
Labels
bug Something isn't working Priority: Medium Medium priority Subsystem: Statement Structure Anything concerning how statements are structured in a method

Comments

@zsrv
Copy link

zsrv commented Apr 25, 2023

Version: Quiltflower 1.10.0 (commit d43976c)

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);
         }
      }
   }
}
@jaskarth jaskarth added bug Something isn't working Subsystem: Statement Structure Anything concerning how statements are structured in a method Priority: Medium Medium priority labels Apr 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Priority: Medium Medium priority Subsystem: Statement Structure Anything concerning how statements are structured in a method
Projects
None yet
Development

No branches or pull requests

2 participants