papsign / Ktor-OpenAPI-Generator

Ktor OpenAPI/Swagger 3 Generator
Apache License 2.0
241 stars 42 forks source link

Why are you using 'crossinline' modifier in body param of NormalOpenApiRoute.route method #61

Open y9san9 opened 4 years ago

y9san9 commented 4 years ago

I am making DSL for your framework and when I'm trying to make wrapper function the method and getting an internal JVM exception cause of invalid bytecode generation image I haven't found the real solution, but in my case changing 'crossinline' modifier to 'noinline' helped, can you ask, why are you using the first one ? or may be even can you replace crossinline into noinine ?

Wicpar commented 4 years ago

Crossinline is necessary to preserve reification, but maybe it is not necessary in most cases. Can you show me how you are calling the function ?

y9san9 commented 4 years ago

@Wicpar Im not calling the function, it is compile error, but Idk why it shows only in compile log, not in ide

Wicpar commented 4 years ago

Ah it could be a jdk version mismatch.

y9san9 commented 4 years ago

@Wicpar I found that is JVM bug, but if crossinline is necessary in your case then ok