Skip to content

Commit 3ba4a14

Browse files
committed
Ensure lack of invokeDynamic elsewhere too
Since these checks ensure the *absence* of a call, they should check both `Invoke` and `invokeDynamic`.
1 parent 501f8cd commit 3ba4a14

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

compiler/test/dotty/tools/backend/jvm/DottyBytecodeTests.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ class TestBCode extends DottyBytecodeTest {
209209

210210
val arrayWrapped = instructionsFromMethod(method).exists {
211211
case inv: Invoke => inv.name.contains("wrapRefArray")
212+
case inv: InvokeDynamic => inv.name.contains("wrapRefArray")
212213
case _ => false
213214
}
214215

@@ -256,8 +257,9 @@ class TestBCode extends DottyBytecodeTest {
256257
val equalsMethod = getMethod(moduleNode, methodName)
257258

258259
val callsEquals = instructionsFromMethod(equalsMethod).exists {
259-
case i @ Invoke(_, _, "equals", _, _) => true
260-
case i => false
260+
case inv: Invoke => inv.name == "equals"
261+
case inv: InvokeDynamic => inv.name == "equals"
262+
case _ => false
261263
}
262264

263265
assert(!callsEquals, s"equals method should not be called in the definition of $clsName#$methodName\n")

0 commit comments

Comments
 (0)