diff options
author | Stiver <stiver.mail@gmail.com> | 2014-08-16 15:31:53 +0200 |
---|---|---|
committer | Stiver <stiver.mail@gmail.com> | 2014-08-16 15:31:53 +0200 |
commit | 929056d727dedc26c9ddcbb5d8a4a269a12d95e8 (patch) | |
tree | b7c46379f389e7275cde75c29a381ce950c4f066 | |
parent | c672e5bc8316cf96090e47a0ed70d357ce6da68e (diff) | |
download | fernflower-929056d727dedc26c9ddcbb5d8a4a269a12d95e8.tar fernflower-929056d727dedc26c9ddcbb5d8a4a269a12d95e8.tar.gz fernflower-929056d727dedc26c9ddcbb5d8a4a269a12d95e8.tar.lz fernflower-929056d727dedc26c9ddcbb5d8a4a269a12d95e8.tar.xz fernflower-929056d727dedc26c9ddcbb5d8a4a269a12d95e8.zip |
Fixed ' IDEA-128685: Incorrectly typed assignment expression'
-rw-r--r-- | src/de/fernflower/modules/decompiler/exps/AssignmentExprent.java | 2 | ||||
-rw-r--r-- | test/unit/classes/TestClassTypes.java | 15 | ||||
-rw-r--r-- | test/unit/results/TestClassTypes.dec | 11 |
3 files changed, 27 insertions, 1 deletions
diff --git a/src/de/fernflower/modules/decompiler/exps/AssignmentExprent.java b/src/de/fernflower/modules/decompiler/exps/AssignmentExprent.java index 2aa359d..a672f6c 100644 --- a/src/de/fernflower/modules/decompiler/exps/AssignmentExprent.java +++ b/src/de/fernflower/modules/decompiler/exps/AssignmentExprent.java @@ -65,7 +65,7 @@ public class AssignmentExprent extends Exprent { public VarType getExprType() { - return right.getExprType(); + return left.getExprType(); } diff --git a/test/unit/classes/TestClassTypes.java b/test/unit/classes/TestClassTypes.java index 0d0cba1..a23e256 100644 --- a/test/unit/classes/TestClassTypes.java +++ b/test/unit/classes/TestClassTypes.java @@ -1,5 +1,8 @@ package unit.classes; +import java.util.ArrayList; +import java.util.List; + public class TestClassTypes { public void testBoolean() { @@ -18,4 +21,16 @@ public class TestClassTypes { } } + + public void testAssignmentType(List list) { + + List a = list; + + if(a != null) { + (a = new ArrayList(a)).add("23"); + } + + System.out.println(a.size()); + } + } diff --git a/test/unit/results/TestClassTypes.dec b/test/unit/results/TestClassTypes.dec index f4c6885..8e3ec08 100644 --- a/test/unit/results/TestClassTypes.dec +++ b/test/unit/results/TestClassTypes.dec @@ -1,5 +1,7 @@ package unit.classes; +import java.util.ArrayList; +import java.util.List; public class TestClassTypes { @@ -17,4 +19,13 @@ public class TestClassTypes { } } + + public void testAssignmentType(List var1) { + Object var2 = var1; + if(var1 != null) { + ((List)(var2 = new ArrayList(var1))).add("23"); + } + + System.out.println(((List)var2).size()); + } } |