You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When writing a conditional rule with a wildcard pattern in place of types in member patterns, it is not possible to back-reference it. It appears that the wildcard is simply skipped and subsequent wildcards are then off by one.
Consider the program:
package com.example;
public class A {
public int foo() { ... }
public int foo(int x) { ... }
}
The following rule will not work:
-if class **A { *** foo(); } -keep class <1>A { <2> foo(<2>); }
in contrast to:
-if class **A { *** foo(); } -keep class <1>A { int foo(int); }
Also, the following rule shows how the index is offset by one as it will apply and keep the one-arg foo if the zero-arg foo is used:
-if class **A { *** *(); } -keep class <1>A { int <2>(int); }
but the rule that would match the number of wildcards fails with an index error:
-if class **A { *** *(); } -keep class <1>A { int <3>(int); }
The same issue applies to:
the return-type of fields as in { *** x; }
the indexed method parameters as in { void foo(int, ***, int); }
the "any" method parameters as in { void foo(...); }
The text was updated successfully, but these errors were encountered:
When writing a conditional rule with a wildcard pattern in place of types in member patterns, it is not possible to back-reference it. It appears that the wildcard is simply skipped and subsequent wildcards are then off by one.
Consider the program:
The following rule will not work:
in contrast to:
Also, the following rule shows how the index is offset by one as it will apply and keep the one-arg foo if the zero-arg foo is used:
but the rule that would match the number of wildcards fails with an index error:
The same issue applies to:
{ *** x; }
{ void foo(int, ***, int); }
{ void foo(...); }
The text was updated successfully, but these errors were encountered: