Skip to content

Example in README with @file:Import fails #418

@rameshvenk

Description

@rameshvenk

The @file:Import example failed with this error

error: platform declaration clash: The following declarations have the same JVM signature (median([Ljava/lang/Double;)D):[nl] fun Array<Double>.median(): Double defined in kscript.scriplet.Main[nl] fun Array<Double>.median(): Double defined in kscript.scriplet.Main[nl]private fun Array<Double>.median(): Double

Changing the example from val robustMean = listOf(1.3, 42.3, 7.0).median() to val robustMean = arrayOf(1.3, 42.3, 7.0).median() seems to have fixed the issue.

Description of environment

jdk, kotlin and kscript are installed via sdkman on Macbook M1 Pro


$ kscript --version
Version   : 4.2.3
Build     : 2023-07-22T13:06:02.327407526Z
Kotlin    : 1.9.21-release-633
Java      : JRE 21.0.2+13

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions