Hey friends, I'm trying out New MPP with 1.3.0 sta...
# multiplatform
a
Hey friends, I'm trying out New MPP with 1.3.0 stable, and running into some weird issues when trying to run a test in the IDE. Whenever I try running a specific test (from my
commonTest
sources) using the Play button in the gutter, I get
Error:(1, 18) Kotlin: [my-module_jvmMain] Declaration annotated with '@OptionalExpectation' can only be used in common module sources
. Tests run perfectly fine with
./gradlew :my-module:jvmTest
though! I have a couple methods annotated with
JsName
and
JvmStatic
, but they very clearly are in the common module sources. I'm using a standard
fromPreset(presets.jvm, 'jvm')
target. Do I need to explicitly call
useExperimentalAnnotation
or
enableLanguageFeature
to use annotations marked as
@OptionalExpectation
? Or is this an IDE issue? If it's an IDE issue, is there a ticket I should be following?
o
@udalov
u
This will be fixed in 1.3.20: https://youtrack.jetbrains.com/issue/KT-26489 As a workaround, try delegating build/run actions to Gradle (Preferences | Build, Execution, Deployment | Build Tools | Gradle | Runner), remove the old run configuration which runs that test and rerun it with the gutter icon: the IDE will use Gradle for running tests now
a
Awesome, thanks for the speedy reply. Just wanted to make sure I wasn't doing something wrong 😛