-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: return type lost after type inference (#396)
- Loading branch information
1 parent
1fc92d2
commit 3a798cb
Showing
2 changed files
with
41 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
jadx-core/src/test/java/jadx/tests/integration/arrays/TestArrays4.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package jadx.tests.integration.arrays; | ||
|
||
import jadx.core.dex.nodes.ClassNode; | ||
import jadx.tests.api.SmaliTest; | ||
import static jadx.tests.api.utils.JadxMatchers.containsOne; | ||
import static org.junit.Assert.assertThat; | ||
import org.junit.Test; | ||
|
||
public class TestArrays4 extends SmaliTest { | ||
|
||
public static class TestCls { | ||
char[] payload; | ||
|
||
public TestCls(byte[] bytes) { | ||
char[] a = toChars(bytes); | ||
this.payload = new char[a.length]; | ||
System.arraycopy(a, 0, this.payload, 0, bytes.length); | ||
} | ||
|
||
private static char[] toChars(byte[] bArr) { | ||
return new char[bArr.length]; | ||
} | ||
} | ||
|
||
@Test | ||
public void testArrayTypeInference() { | ||
noDebugInfo(); | ||
ClassNode cls = getClassNode(TestCls.class); | ||
String code = cls.getCode().toString(); | ||
|
||
assertThat(code, containsOne("char[] toChars = toChars(bArr);")); | ||
} | ||
|
||
} |