can anyone explain this exception when compiling w...
# javascript
b
can anyone explain this exception when compiling with JsPlainObject and generics? java.lang.IllegalArgumentException: No container found for type parameter 'T' of 'CLASS INTERFACE name:DataFieldOptions modality:ABSTRACT visibility:public [external] superTypes:[kotlin.Any]'
Copy code
@JsPlainObject
external interface DataFieldOptions<T> {
    var initial: T?
}
a
There was an issue with the compiler plugin and it should be fixed in 2.0.20. What version of the kmp do you use?
b
- org.jetbrains.kotlin.multiplatformorg.jetbrains.kotlin.multiplatform.gradle.plugin2.0.20-RC
a
Could you check if 2.0.20-RC2 works?
b
same issue
t
./gradlew clean
before check?
b
yep
the worst thing is that the stacktrace is absolutely useless to figure out where the issue occurs
if you want to try to find the cause, here's a branch https://github.com/BernhardPosselt/foundryvtt-kotlin/pull/1/files
I'll debug more later to try to figure it out, got to run a TTRPG game in 45 minutes
Copy code
@JsPlainObject
external interface ArrayFieldOptions<T> : DataFieldOptions<T> {
    val min: Int?
    val max: Int?
}
this breaks it
and it's not even related to the type parameter on the child interface
e.g. this also does not compile
Copy code
@JsPlainObject
external interface ArrayFieldOptions : DataFieldOptions<String> {
    val min: Int?
    val max: Int?
}
minimal example to reproduce:
Copy code
@JsPlainObject
external interface Test<T> {
    val attr: T
}

@JsPlainObject
external interface Child : Test<String> {
}