https://kotlinlang.org logo
#korge
Title
# korge
r

Rachid

07/03/2020, 9:01 AM
Another thing I stumble upon regularly is that it's hard for me to get code samples working. Maybe I'm missing out on something. But doing the tutorials and looking at the docs is not sufficient for me. So if you have other references please let me know. So for example tweens at: https://korlibs.soywiz.com/korge/animation/#simple-interface when copy the line (apply it to the circleFilled of my previous message)
Copy code
circleFilled.tween(circleFilled::x[10.0, 100.0], time = 1000)
I got the compilation error:
Copy code
'operator' modifier is required on 'get' in 'kotlin.reflect.KMutableProperty0'
Type mismatch.
Required: V2<*>
Found: Double
Can it be that I'm using a version that's newer than when the docs were written?
d

Deactivated User

07/03/2020, 9:03 AM
If you place the caret in the
[
and press alt+enter in IntelliJ, it should allow yo the import the get extension method
Since the KMutableProperty is a Kotlin class, the import is necessary for the extension method
Maybe we should state that in the documentation and maybe place a gif showing how to do that
Please, try the alt+enter + import stuff to see if it works for you and let me know
r

Rachid

07/03/2020, 9:04 AM
OMG, I tried ALT+enter in a lot of places, but not that one. Adding to the docs would help a beginner like me yes
👍 1
Also time should be
Copy code
time = 1000.milliseconds
instead of plain 1000
🪲 1
d

Deactivated User

07/03/2020, 9:06 AM
oh, you are right 🙂
r

Rachid

07/03/2020, 9:06 AM
The other examples did include the
Copy code
.milliseconds
so that I could figure out myself ;)
d

Deactivated User

07/03/2020, 9:07 AM
probably outdated. We probably wrote that before inline classes were available on kotlin 🙂 thanks for reporting!
r

Rachid

07/03/2020, 9:07 AM
Are the docs "open source", I'm happy to create PR's for improvements
d

Deactivated User

07/03/2020, 9:07 AM
they are indeed
there is a Suggest Change / Typo button on the top right corner of the page pointing to the right file to edit
👍 1
r

Rachid

07/03/2020, 9:08 AM
Ok, will do for this page now
🙏 2
3 Views