We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OneUtil.kt
class OneUtil { fun add(x: Int, y: Int): Int { return staticAdd(x, y) } companion object { fun staticAdd(x: Int, y: Int): Int { return x + y } } }
OneUtilTest.kt
class OneUtilTest { class Mock { @MockInvoke(targetClass = OneUtil::class) private fun staticAdd(x: Int, y: Int): Int { return 100 } } @Test fun exampleTest() { assertEquals(100, OneUtil().add(1, 3)) } }
执行后出错
Bad type on operand stack Exception Details: Location: com/example/xxx/OneUtil.add(II)I @8: invokevirtual Reason: Type 'com/example/xxx/OneUtil$Companion' (current frame, stack[2]) is not assignable to integer Current Frame: bci: @8 flags: { } locals: { 'com/example/xxx/OneUtil', integer, integer } stack: { 'com/example/xxx/OneUtilTest$Mock', null, 'com/example/xxx/OneUtil$Companion', integer } Bytecode: 0000000: b800 2601 b200 281b b600 2cac java.lang.VerifyError: Bad type on operand stack Exception Details: Location: com/example/xxx/OneUtil.add(II)I @8: invokevirtual Reason: Type 'com/example/xxx/OneUtil$Companion' (current frame, stack[2]) is not assignable to integer Current Frame: bci: @8 flags: { } locals: { 'com/example/xxx/OneUtil', integer, integer } stack: { 'com/example/xxx/OneUtilTest$Mock', null, 'com/example/xxx/OneUtil$Companion', integer } Bytecode: 0000000: b800 2601 b200 281b b600 2cac
The text was updated successfully, but these errors were encountered:
No branches or pull requests
OneUtil.kt
OneUtilTest.kt
执行后出错
The text was updated successfully, but these errors were encountered: