Skip to content
New issue

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

BeanIntrospection dispath method generated is wrong for Kotlin extension functions. #10669

Open
khurramijaz opened this issue Mar 31, 2024 · 0 comments
Labels
lang: kotlin Issues or features specific to Kotlin type: bug Something isn't working

Comments

@khurramijaz
Copy link

khurramijaz commented Mar 31, 2024

Expected Behavior

For an extension method defined in any bean as below

    fun Int.addOne() = this + 1

dispatch function in the BeanIntrospection generated should be

 protected final Object dispatch(int var1, Object var2, Object[] var3) {
        switch (var1) {
            case 0:
                return ((TestBean)var2).addOne(var3[0]);
            default:
                throw this.unknownDispatchAtIndexException(var1);
        }
    }

Actual Behaviour

This is what is actually produced.

 protected final Object dispatch(int var1, Object var2, Object[] var3) {
        switch (var1) {
            case 0:
                return ((TestBean)var2).addOne();
            default:
                throw this.unknownDispatchAtIndexException(var1);
        }
    }

When this function is invoked, java.lang.NoSuchMethodError exception is thrown as the signature does not match.

Steps To Reproduce

No response

Environment Information

Kotlin 1.9.22
JDK 21

Example Application

No response

Version

4.3.5

@yawkat yawkat added the type: bug Something isn't working label Apr 2, 2024
@sdelamo sdelamo added the lang: kotlin Issues or features specific to Kotlin label May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang: kotlin Issues or features specific to Kotlin type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants