You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Kotlin compiler mangles name of functions returning value classes. JMH can't handle such method names and fails with a cryptic error:
@JvmInline
value classVal(valvalue:Int)
@State(Scope.Benchmark)
openclassValueClassBenchmark {
@Benchmark
funbenchmark() =Val(42)
}
Generation of JMH bytecode failed with 1 errors:
- Group name should be the legal Java identifier.
[org.openjdk.jmh.generators.reflection.RFMethodInfo@2e052ab3]
Under the missing RFMethodInfo.toString overload the following function is hiding: org.example.ValueClassBenchmark.benchmark-5sfh64U.
Using @JvmName or rewriting the benchmark method to accept a blackhole and use it explicitly instead of returning a value class instance helps, but the solution is not that intuitive (and org.openjdk.jmh.generators.reflection.RFMethodInfo@2e052ab3 does not help here).
Perhaps, we should check method names in JmhBytecodeGeneratorWorker before passing classes down to JMH and print some meaningful error message with a fix suggestion.
The text was updated successfully, but these errors were encountered:
Kotlin compiler mangles name of functions returning value classes. JMH can't handle such method names and fails with a cryptic error:
Under the missing
RFMethodInfo.toString
overload the following function is hiding:org.example.ValueClassBenchmark.benchmark-5sfh64U
.Using
@JvmName
or rewriting the benchmark method to accept a blackhole and use it explicitly instead of returning a value class instance helps, but the solution is not that intuitive (andorg.openjdk.jmh.generators.reflection.RFMethodInfo@2e052ab3
does not help here).Perhaps, we should check method names in
JmhBytecodeGeneratorWorker
before passing classes down to JMH and print some meaningful error message with a fix suggestion.The text was updated successfully, but these errors were encountered: