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

Can't build when used with Kotlin experimental features #47

Closed
ShreckYe opened this issue Aug 2, 2021 · 4 comments
Closed

Can't build when used with Kotlin experimental features #47

ShreckYe opened this issue Aug 2, 2021 · 4 comments
Labels
document this behavior The unexpected behavior described in this issue should be documented in the library

Comments

@ShreckYe
Copy link

ShreckYe commented Aug 2, 2021

The library I am benchmarking uses Kotlin's ExperimentalUnsignedTypes. I have already added

@OptIn(ExperimentalUnsignedTypes::class)

to the benchmark class and

tasks.withType<KotlinCompile>().configureEach {
    kotlinOptions.freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn"
}

to build.gradle.kts but still got the following Gradle error:

Execution failed for task ':app:mainBenchmarkGenerate'.
> There was a failure while executing work items
   > A failure occurred while executing kotlinx.benchmark.gradle.JmhBytecodeGeneratorWorker
      > Generation of JMH bytecode failed with 1errors:
          - Group name should be the legal Java identifier.
           [org.openjdk.jmh.generators.reflection.RFMethodInfo@3212c77c]

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.


@qurbonzoda
Copy link
Contributor

Hi @ShreckYe,
The problem may come with quoted benchmark function names with spaces.
Could you please check if that is the case for you?

@qurbonzoda
Copy link
Contributor

Related: melix/jmh-gradle-plugin#150

@ShreckYe
Copy link
Author

ShreckYe commented Aug 6, 2021

Hi @ShreckYe,
The problem may come with quoted benchmark function names with spaces.
Could you please check if that is the case for you?

Thanks. I checked the code again and found the reason. It's actually due to using a single expression function with = as a @Benchmark function, and the inferred return type is not Unit. It just happened that I used experimental features inside so I made a mistake there. Sorry for this.

@qurbonzoda qurbonzoda added the document this behavior The unexpected behavior described in this issue should be documented in the library label Aug 6, 2021
@qurbonzoda qurbonzoda reopened this Aug 6, 2021
OndrejSliva pushed a commit to OndrejSliva/kotlinx-benchmark that referenced this issue Jan 10, 2024
…us.mojo-versions-maven-plugin-2.10.0

build(deps): bump versions-maven-plugin from 2.9.0 to 2.10.0
@qurbonzoda
Copy link
Contributor

Created a separate issue for documenting the supported return types: #219

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
document this behavior The unexpected behavior described in this issue should be documented in the library
Projects
None yet
Development

No branches or pull requests

2 participants