diff options
author | Jonas Herzig <me@johni0702.de> | 2022-05-24 15:13:42 +0200 |
---|---|---|
committer | Jonas Herzig <me@johni0702.de> | 2022-05-27 08:46:01 +0200 |
commit | 51cf5a796dbf3a185bb80044976dc8f32ebbf040 (patch) | |
tree | d06b45bea0f262b8a7e90d296450502011dfc7a4 /src/main/kotlin/com/replaymod/gradle | |
parent | 1e3fab153d134f7dec5601cbdbca3c27d6aebc58 (diff) | |
download | Remap-51cf5a796dbf3a185bb80044976dc8f32ebbf040.tar.gz Remap-51cf5a796dbf3a185bb80044976dc8f32ebbf040.tar.bz2 Remap-51cf5a796dbf3a185bb80044976dc8f32ebbf040.zip |
Properly support new expression matching in @Pattern
Used to only compare the arguments, nether the class nor the qualifier (the
outer class instance for inner classes constructor calls).
Diffstat (limited to 'src/main/kotlin/com/replaymod/gradle')
-rw-r--r-- | src/main/kotlin/com/replaymod/gradle/remap/PsiPattern.kt | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/main/kotlin/com/replaymod/gradle/remap/PsiPattern.kt b/src/main/kotlin/com/replaymod/gradle/remap/PsiPattern.kt index 9a067da..9bf1e90 100644 --- a/src/main/kotlin/com/replaymod/gradle/remap/PsiPattern.kt +++ b/src/main/kotlin/com/replaymod/gradle/remap/PsiPattern.kt @@ -84,6 +84,8 @@ internal class PsiPattern( is PsiParenthesizedExpression -> expr is PsiParenthesizedExpression && match(pattern.expression, expr.expression) is PsiNewExpression -> expr is PsiNewExpression + && pattern.classReference?.resolve() == expr.classReference?.resolve() + && match(pattern.qualifier, expr.qualifier) && match(pattern.argumentList, expr.argumentList) is PsiLiteralExpression -> expr is PsiLiteralExpression && pattern.text == expr.text |