https://kotlinlang.org logo
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
kontributors
  • r

    rbares

    04/05/2020, 9:48 AM
    Hi! Attempting to debug tests in kotlin/plugins/android-extensions/android-extensions-compiler. When trying to run them in the IDE they fail with
    ClassNotFoundException
    , and they also fail when running
    gradlew plugins:android-extensions-compiler:test
    from the command line. At best it seems like the dependencies are set up awkwardly elsewhere, in a different gradle script. What is the correct way to debug these tests?
    • 1
    • 1
  • t

    turansky

    04/11/2020, 12:13 AM
    Kotlin bootsrap version
    1.4.0-dev-1818
    (used in master) removed from bintray! Which version recommended before master update? @ilya.gorbunov Was
    1.4.0-dev-5087
    planned as next?
    i
    • 2
    • 2
  • d

    Dominik wuttke

    04/26/2020, 8:40 PM
    Hi, I would like to help with some samples for the standard library. Is there anything which should be considered first? I am planning on doing samples for kotlin/util/standard. These were the parts which were hard to find usage for, when I started Kotlin.
    i
    • 2
    • 3
  • s

    Subroh Nishikori

    05/03/2020, 9:50 AM
    HI! I want to be able to declare
    devDependencies
    in the
    org.jetbrains.kotlin.js
    plugin. I tried to implement it in the Kotlin repository that I forked, and it worked as expected. So I want to send a Pull Request, but is there a problem?
    t
    i
    • 3
    • 4
  • d

    diesieben07

    06/14/2020, 2:57 PM
    I've cloned the repository and ran
    gradlew install
    . Now I can see all the artifacts in my local maven repository. When trying to do a gradle build referencing the snapshot artifacts in my local maven repo I get the following error: Built-in class kotlin.Enum is not found. My build.gradle.kts and settings.gradle.kts. Any advice?
    t
    • 2
    • 9
  • s

    Samyak Jain

    06/15/2020, 5:52 AM
    Here are some of issues I'm stuck while debugging the task for :compiler-embeddable: Here's the link to the issue: https://discuss.gradle.org/t/build-kotlin-v1-3-30-with-support-of-gradle-4-4-1/36493
    g
    • 2
    • 8
  • c

    chr

    06/24/2020, 7:38 PM
    Is it possible to install the plugin produced by running
    ./gradlew ideaPlugin
    into Android Studio? Once that finishes I zip
    /dist/artifacts/ideaPlugin/Kotlin
    and try to install that as a plugin from disk, but I always get the message “Plugin ‘Kotlin’ is incompatible with this installation”. Is there something I need to configure before building the plugin to note which IDE I want to build it for?
    t
    • 2
    • 6
  • s

    Samyak Jain

    06/26/2020, 3:45 PM
    :kotlin-gradle-plugin:classes
    \--- :kotlin-gradle-plugin:compileJava
         +--- :kotlin-gradle-plugin:compileKotlin
         |    \--- :kotlin-gradle-plugin:jar
         |         +--- :kotlin-gradle-plugin:classes (*)
         |         +--- :kotlin-gradle-plugin:compileKotlin (*)
         |         \--- :kotlin-gradle-plugin:inspectClassesForKotlinIC
         |              \--- :kotlin-gradle-plugin:classes (*)
         \--- :kotlin-gradle-plugin:jar (*)
    While running kotlin v1.3.30 from the gradle 4.4.1 without using kotlin-DSL, The build fails with the above circular dependencies. Can someone explain me the circular dependency structure, I feel like a little lost here.
    • 1
    • 1
  • s

    Samyak Jain

    07/04/2020, 6:45 PM
    Hi where is the source code for 'kotlin-annotation-processing-gradle' reside I tried running
    find . -name 'kotlin-annotation-processing-gradle'
    but wasn't able to find it in the kotlin-source + plus googling doesn't help either 😕
    t
    • 2
    • 2
  • s

    Samyak Jain

    07/07/2020, 7:39 AM
    While building kotlin-source code (1.3.30) after custom changes required, I'm getting this error:
    :kotlin-compiler-embeddable:install (Thread[Task worker for ':' Thread 4,5,main]) started.
    :kotlin-compiler-embeddable:install
    Putting task artifact state for task ':kotlin-compiler-embeddable:install' into context took 0.0 secs.
    Up-to-date check for task ':kotlin-compiler-embeddable:install' took 0.0 secs. It is not up-to-date because:
      Task has not declared any outputs.
    Publishing configuration: configuration ':kotlin-compiler-embeddable:archives'
    Publishing to org.gradle.api.publication.maven.internal.deployer.BaseMavenInstaller@85c2fcf
    :kotlin-compiler-embeddable:install FAILED
    :kotlin-compiler-embeddable:install (Thread[Task worker for ':' Thread 4,5,main]) completed. Took 0.002 secs.
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':kotlin-compiler-embeddable:install'.
    Could not publish configuration 'archives'
       > Could not write to file '/home/samyak/Kotlin/master/kotlin-1.3.30/prepare/compiler-embeddable/build/poms/pom-default.xml'.
    
    * Try:
    Run with --debug option to get more log output. Run with --scan to get full insights.
    I'm not quite sure why it is not able to write to the file? Any help is appreciated.
    • 1
    • 1
  • s

    Samyak Jain

    07/17/2020, 5:32 PM
    Hi again 😅 I'm facing the following error while compiling kotlin-gradle-plugin. https://paste.debian.net/1156846/ Am i missing any dependency? Is that the reason for all unresolved references?
    e
    • 2
    • 2
  • r

    Renee Vandervelde

    07/18/2020, 5:56 PM
    What are the rules around when to use
    @SinceKotlin
    and what version to target when using it? i.e. Should it be used any time a public method is added? and do the same rules apply to libraries like kotlin.test in addition to stdlib?
    t
    • 2
    • 2
  • c

    camdenorrb

    08/11/2020, 11:52 PM
    Hello everyone, in the contributing guidelines it says I should talk about what I plan to contribute. So basically I have an issue where I get a StackOverflowError whenever I load big enum files shown in the issue below. https://youtrack.jetbrains.com/issue/KT-40599 This is my first contribution if I complete it, any guidance/opinions is appreciated.
    t
    • 2
    • 1
  • a

    Alex Ch

    08/13/2020, 8:57 PM
    Where should I report a problem with experimental API? Specifically for
    @ExperimentalUnsignedTypes
    ?
    :youtrack: 3
    g
    • 2
    • 1
  • e

    Esa

    08/20/2020, 11:25 AM
    Hi there, I have a couple of extension functions for
    Iterable<T>
    that has been very useful to me personally, and I wish to make a contribution to the stdlib with those. 🙂 I read through this link and it suggests to let you know of my plans. So here's what the functions are basically:
    list.validatedFold
    - this is a function that iterates through the elements of an ordered list, and verifies that elements
    n
    and
    n+1
    pass some validation function. returns true if all elements pass, or false on the first element that does not pass (early return).
    list.flatMapIndexedNotNull
    - essentially what the name says, it was relevant for me in one case and I didn't find it in the stdlib. Do you think these are appropriate contributions?
    d
    • 2
    • 2
  • c

    cketti

    09/04/2020, 4:23 PM
    Looks like 0e04af463d6e80a96040a88bffc6eeac2ab8a59d broke the IDEA plugin (class is not found at runtime). Is anyone working on fixing that?
    s
    • 2
    • 2
  • i

    ilyagulya

    09/17/2020, 8:55 AM
    Hello! Are there any tutorial on how can I debug kotlin compiler? I have an android project and kotlin compiler crashes for some reason. I'd like to run a debugger and find outh what causes it to crash.
    • 1
    • 1
  • i

    ilyagulya

    09/18/2020, 10:16 AM
    Hi! Are there any docs about compiler architecture?
    👍 3
    e
    • 2
    • 2
  • u

    Uzi Landsmann

    10/03/2020, 7:19 AM
    When adding samples to functions that actualise expectations, where should the
    @sample
    line be? • in the
    expect
    • in all
    actual
    implementations • both in the
    expect
    and the
    actual
    implementations
    i
    • 2
    • 1
  • b

    Brutus5000

    10/07/2020, 11:49 AM
    Hi! I was missing a collection function
    sumOfOrNull
    so I wrote my own very simple one:
    inline fun <T> Iterable<T>.sumOfOrNull(selector: (T) -> Double?): Double? =
        this.mapNotNull(selector)
            .reduceOrNull { acc, i -> acc + i }
    Does it make sense to add it to the standard library? Is this even suitable? I see the standard library uses mostly iterators,
    for
    or
    while
    , and not that much high level stuff (I guess due to performance?)
    a
    r
    • 3
    • 8
  • z

    zmunm

    10/08/2020, 7:12 AM
    Hi. I'm not sure if this is a Kotlin bug, but it only happens in version 1.4. I'm using JUnit4 and I migrated Kotlin from 1.3.70 to 1.4.10
    class Test {
        interface Example {
            operator fun <T> get(key: String, defaultValue: T): T
        }
    
        class ExampleImpl : Example {
            override fun <T> get(key: String, defaultValue: T): T = when (defaultValue) {
                is Int -> defaultValue
                else -> // Debug here is recognized as'Long' on `exampleError`
                    throw UnsupportedOperationException("NOT_YET_IMPLEMENT") 
            }
        }
     
        // exception occurs only in 1.4
        @Test(expected = UnsupportedOperationException::class)
        fun exampleError() {
            val example: Example = ExampleImpl()
            org.junit.Assert.assertEquals(example["key", 1], 1)
        }
    
        // Success
        @Test
        fun exampleSuccess() {
            val example: Example = ExampleImpl()
            junit.framework.TestCase.assertEquals(example["key", 1], 1)
        }
    }
    I think this is the cause TestCase.assertEquals
    public static void assertEquals(int expected, int actual)
    Assert.assertEquals
    public static void assertEquals(Object expected, Object actual) // There is no part defined as int type
    Is there anyone who can help?
    • 1
    • 1
  • w

    wjur

    10/26/2020, 8:56 PM
    Hi! I think I’ve found a bug in
    kotlin.reflect
    and I want to contribute. I did some research and here’s what I found. Calling
    metod.kotlinFunction
    on a method that is a suspend function with inline class as a return type results in an error. It happens exactly in InlineClassAwareCaller.kt#L100. It is similar to KT-34024 , but it’s not exactly it. I went through the code and now I have a working minimal setup that reproduces the problem and some ideas how to fix it. I’d like to apply my ideas, starting with writing failing tests. I tried to find out how to write one, but I couldn’t find any instructions for that. I checked what git-blame says about the file and I found a commit which modifies the code and adds some tests. The commit adds, for example, compiler/testData/codegen/box/reflection/callBy/inlineClassDefaultArguments.kt, and, in the beginning of the file, there is:
    // IGNORE_BACKEND: JS_IR, JS, NATIVE
    // WITH_REFLECT
    I found another one with:
    // TARGET_BACKEND: JVM
    // WITH_REFLECT
    // WITH_COROUTINES
    They seem to be instructions for a tool used in tests. Do you have any manual for it? Eg what options are available? Is it a good idea if I try to mimic what the linked commit does? I mean, is it sufficient to add *.kt file in the compile/testData/codegen directory and call
    ./gradlew coreLibTests
    ? Thank you :)
    u
    • 2
    • 7
  • d

    David

    10/27/2020, 9:17 PM
    Evening, I stumbled accross issue KT-42619 (https://youtrack.jetbrains.com/issue/KT-42619) , the request for a nullable valueOf method for Enums. Now, I thought, let's contribute and try to create a pull request for this seemingly simple function. Checked out Kotlin, and started checking where I could add this function .... It seems that it is far less straightforward then I thought. Where should I start if I wish to add a function to Enums ?
    d
    i
    • 3
    • 4
  • i

    Iaroslav Postovalov

    11/30/2020, 3:39 PM
    How to prevent IDEA from changing
    misc.xml
    and other files that shouldn't be changed by a PR?
    m
    t
    a
    • 4
    • 12
  • j

    Justin Wei

    12/05/2020, 2:44 AM
    Is there any expected latency on code reviews if you've got a PR? I've been waiting for a few days but wasn't sure if it's normal or if it got lost somehow.
    j
    • 2
    • 2
  • i

    Iaroslav Postovalov

    12/26/2020, 1:41 PM
    How to run API dump for the Standard Library?
    i
    • 2
    • 1
  • z

    Zac Sweers

    01/02/2021, 2:29 AM
    I opened this PR up to fix an NPE in kapt in July but haven't gotten any sort of ack, is there anything else needed for someone to look at it? https://github.com/JetBrains/kotlin/pull/3610
    a
    • 2
    • 1
  • j

    Justin Wei

    01/27/2021, 3:31 AM
    Hey, I've for a PR that's been in limbo since christmas. Is there anyway someone can merge it after running tests? https://github.com/JetBrains/kotlin/pull/3947
    n
    • 2
    • 2
  • z

    Zhelenskiy

    02/08/2021, 3:39 PM
    I have implemented
    Collection
    instance for `Progression`s: https://github.com/JetBrains/kotlin/pull/4095 Connected issue: https://youtrack.jetbrains.com/issue/KT-34617
    i
    • 2
    • 10
  • i

    Iaroslav Postovalov

    03/04/2021, 1:44 PM
    Kotlin/Native was moved to the monorepo of Kotlin, and now IDE support of kotlin-native project doesn't work at all. Are there any workarounds?
    s
    • 2
    • 2
Powered by Linen
Title
i

Iaroslav Postovalov

03/04/2021, 1:44 PM
Kotlin/Native was moved to the monorepo of Kotlin, and now IDE support of kotlin-native project doesn't work at all. Are there any workarounds?
s

stanislav.erokhin

03/04/2021, 1:47 PM
Switch https://github.com/JetBrains/kotlin/blob/master/gradle.properties#L45 flag. Sorry, we still in progress and documentation wasn't updated yet.
i

Iaroslav Postovalov

03/04/2021, 1:51 PM
Thanks
View count: 3