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

Native benchmark with no package specified fails to compile #215

Closed
PavelPunegov opened this issue May 22, 2024 · 0 comments · Fixed by #216
Closed

Native benchmark with no package specified fails to compile #215

PavelPunegov opened this issue May 22, 2024 · 0 comments · Fixed by #216
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@PavelPunegov
Copy link
Contributor

Consider the following benchmark that doesn't have a package declaration

import kotlinx.benchmark.*
import kotlin.math.*

@State(Scope.Benchmark)
open class RootBenchmark {
    @Benchmark
    open fun mathBenchmark(): Double {
        return log(sqrt(3.0) * cos(3.0), 2.0)
    }
}

It fails to compile with:

e: build/benchmarks/native/sources/kotlinx/benchmark/generated/%3Croot%3E/RootBenchmark_Descriptor.kt:1:37 Name contains illegal characters: "<>"
e: build/benchmarks/native/sources/kotlinx/benchmark/generated/%3Croot%3E/RootBenchmark_Descriptor.kt:3:8 Unresolved reference: `<root>`
e: build/benchmarks/native/sources/kotlinx/benchmark/generated/%3Croot%3E/RootBenchmark_Descriptor.kt:18:31 Unresolved reference: RootBenchmark

SuiteSourceGenerator creates Descriptor with the following code, that is not valid for compiler.

package kotlinx.benchmark.generated.`<root>`

import `<root>`.RootBenchmark
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants