https://kotlinlang.org logo
Docs
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
intellij
  • j

    jdiaz

    04/07/2019, 6:04 PM
    Has anyone seen
    An exception occurs during Evaluate Expression Action : More than one package fragment, files: [KtFile: debugFile.kt, KtFile: ConfigProvider.kt] | fragments: [package com.jdiazcano.cfg4k.providers, package com.jdiazcano.cfg4k.providers]
    an exception from [this](https://github.com/JetBrains/kotlin/blob/683c2b0434d0d69c9a4bd85a28c437a71dc2b39b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/debugger/evaluate/KotlinEvaluationBuilder.kt#L178) line (inside kotlin code)
    a
    • 2
    • 3
  • s

    Slackbot

    04/08/2019, 2:04 AM
    This message was deleted.
    m
    • 2
    • 1
  • s

    Smallville7123

    04/08/2019, 6:47 AM
    do i need to worry about inspection issues from build directories? for example:
    PluginSpecBuildersFor$f1aa8c20a83a561deeaf97817f973d9f.kt 14 warnings
    Line is longer than allowed by code style (> 120 columns)
    /home/macropreprocessor/AndroidStudioProjects/kppmaster/buildSrc/build/generated-sources/kotlin-dsl-external-plugin-spec-builders/kotlin/gradle/kotlin/dsl/plugins/PluginSpecBuildersFor$f1aa8c20a83a561deeaf97817f973d9f.kt
         * The `org.gradle.build-announcements` plugin implemented by [org.gradle.api.plugins.announce.BuildAnnouncementsPlugin].
    m
    k
    • 3
    • 4
  • b

    Bernhard

    04/10/2019, 11:33 AM
    is inlining broken in the latest intellij version?
    a
    • 2
    • 1
  • s

    Smallville7123

    04/14/2019, 3:31 PM
    2 gradle deamons:947MB:531MB, and 1 maven:106MB? along with IDEA:1.7GB
    :thread-please: 1
    m
    n
    • 3
    • 7
  • g

    Gerard Klijs

    04/14/2019, 5:54 PM
    But it's a #gradle question if you ask me.
    :no_red: 1
    g
    • 2
    • 1
  • d

    Dias

    04/15/2019, 11:31 AM
    Whenever I try to evaluate expression that uses context of lambda in kotlin, it says that it's not captured. How do I deal with it? For example in ktor I want to see what kind of context data is available when I debug post endpoint, but whenever I evaluate expression using
    this
    it says
    this@post is not captured
    k
    • 2
    • 2
  • s

    Smallville7123

    04/15/2019, 12:42 PM
    is there any way to make this a project level setting? "Warning:kotlin: Native is not yet supported in IDEA internal build system. Please use Gradle to build kpp.linuxMain and tests of kpp.linuxTest (enable 'Delegate IDE build/run actions to Gradle' in Settings)."
    "Delegate build to Gradle: (Settings - Build, Execution, Deployment - Build Tools - Gradle - Build and Run using Gradle (default: Idea)). "
    r
    • 2
    • 17
  • d

    Dias

    04/16/2019, 9:51 AM
    when intellij highlights "inappropriate blocking call" in a suspendable function. How does it know which is which? Is there just hardcoded set of libraries, like "highlight if readValue on jackson object mapper"?
    s
    • 2
    • 1
  • a

    Andrew Gazelka

    04/16/2019, 9:31 PM
    from what I can tell there is no way in vanilla IntelliJ to make UML diagrams in for Kotlin classes, correct?
    • 1
    • 3
  • g

    gsala

    04/17/2019, 2:09 PM
    Can I use structural search on Kotlin files? I'm trying to do so from Android Studio and it only has Java as the file type
    • 1
    • 1
  • s

    steamstreet

    04/21/2019, 3:12 AM
    I have a situation where IntelliJ says that 1.3.21 is installed in the 'Installed' plugin panel, but doesn't allow it to be updated:
    l
    • 2
    • 4
  • s

    Smallville7123

    04/21/2019, 10:34 AM
    how do i save my configurations as when i restart my pc all my configurations disappear
    d
    o
    • 3
    • 2
  • d

    diesieben07

    04/21/2019, 5:17 PM
    Moving a Kotlin class to a package containing the string
    import
    is impossible
    • 1
    • 1
  • g

    GarouDan

    04/22/2019, 12:23 PM
    Hi everyone, Does someone know how can I configure the
    qualified names
    of my modules on IntelliJ? Or how can I configure the qualified modules names in
    .gradle.kts
    files? When importing a gradle project I would like it automatically creates the modules tree, but it is not creating it properly. Since the other option
    explicit module groups
    seems to be something manual, that will disappear in the next project refresh, I would like to create something persistent, that will work across projects re-imports.
    a
    • 2
    • 11
  • v

    vach

    04/22/2019, 10:51 PM
    Is there any feature/plugin for intellij for triggering a system notification when a run configuration executed... I have run configurations that do build/package/deploy but take a minute or so, if i'm doing something else and intellij is not focused i wont know when operation ended. Having a notification or some sound triggered when run is complete would be nice.
    c
    • 2
    • 1
  • e

    Eugen Martynov

    04/23/2019, 5:58 AM
    Hi guys, is there a way to refactor next:
    data class A(val topProperty: String)
    to
    data class A(...) { data class B(val innerProperty: String)}
    c
    • 2
    • 2
  • c

    Czar

    04/23/2019, 8:56 AM
    Please stay on topic, this is not IntelliJ general support channel.
    d
    • 2
    • 1
  • p

    poohbar

    04/23/2019, 2:07 PM
    What does the little :kotlin: icon do in the
    Variables
    tab during debugging?
    j
    • 2
    • 2
  • s

    Scott White

    04/24/2019, 3:16 PM
    renamed a package within our Kotlin project and it seems to have broke about everything
    a
    • 2
    • 1
  • m

    Michael Bryant

    04/24/2019, 10:11 PM
    anyone have any debugging tips as to why intellij wouldn’t be downloading the sources for my dependency? it’s my own kotlin library i’ve uploaded to our internal artifactory. all the source files appear to be there in a sources jar, and intellij’s gradle is able to resolve and download the dependency, but when i go to actually import the functions it can’t resolve the symbols
    s
    m
    +2
    • 5
    • 13
  • m

    Mike

    04/25/2019, 10:24 AM
    Calling a slack administrator. May I suggest the channel be renamed to 'kotlin-intellij-plugin'. Currently, there are a number of intellij specific questions in here that have nothing to do with Kotlin. With a new name, hopefully the intended topic is clearer.
    r
    s
    • 3
    • 2
  • r

    Robert Menke

    04/28/2019, 2:45 PM
    ^^ Hey, not sure if this is related directly to IntelliJ, but trying to build a multi-project gradle project (kotlin as src language) and I get this error in IntelliJ Ultimate
    a
    • 2
    • 1
  • s

    Scott Dudley

    04/30/2019, 12:57 PM
    Hi all! I’m trying to build Kotlin itself (1.3.30) using IntelliJ Ultimate 2019.1, but the Gradle project import is crashing with some bytecode-related problem and I can’t figure out why. (If this isn’t the right channel, can you let me know where to look?) I am just trying to import the Gradle project per the Kotlin setup instructions, but it crashes on the “Configure build” step, apparently in kotlin-gradle-plugin:dokka, with a “java.lang.VerifyError: Uninitialized object exists on backward branch 302", apparently when trying to create a proxy class for org.jetbrains.dokka.gradle.DokkaTask, and it then spits out a bunch of bytecode. Any ideas? Note that using gradlew from the command line generally works fine, minus a few test failures a few hours into the build process. While I don’t mind using gradlew to do builds, I really do want to get the project imported into the IDE for type completion, navigation, etc.
    • 1
    • 1
  • n

    Nikky

    04/30/2019, 5:10 PM
    in idea ultimate i cannot find Diagrams, Generate UML on anything in a multiplatform project i just installed ultimate to use this feature for a small presentation
    l
    • 2
    • 1
  • e

    elect

    05/02/2019, 8:31 AM
    this is curious.. I have the following
    infix operator fun <N> N.minus(other: N): N where N : Number, N : Comparable<N> =
            when {
                this is Byte && other is Byte -> this - other
                this is Short && other is Short -> this - other
                this is Int && other is Int -> this - other
    //            this is Long && other is Long -> this - other
    //            this is Float && other is Float -> this - other
                else -> error("Invalid operand types")
            } as N
    Everything works fine, smart casting is kicking in properly. However if I comment out one the last two lines, then it cast automatically the result to
    Any
    ... ??
    k
    • 2
    • 14
  • d

    DALDEI

    05/05/2019, 6:36 AM
    I've tried every trick I have found documented and many I have not to get Intellij kotlin "script" to interop properly with Java 1.8. Whether in REPL or in a scratch if its a '.kts' the exact same code that works for .kt files fails with .kts files when I use an inline function that was compiled using jvm 1.8 (as ALL my settings and projects specify). The complaint is the well known "cant use inline bytecode from 1.8 when compiling into 1.6 bytecode pleas use -jvm-target" -- but from inside intellij you cant specify it (I tried -- ,as well as all the settings, facets, hand-editing the .iml files etc no go. Take the exact same .kts file and rename it to ".kt" works fine. Looking in the kotin compiler source doesnt seem to be another global way to fix this -- its got to be passed down through intellij somewhere -- I've put ever variant I can find in my gradle scripts to no affect. My conclusion is that kotlin script compilation doesnt follow the same paths as kotlin compiling. Any suggestions ?
    t
    • 2
    • 1
  • r

    Robert Menke

    05/05/2019, 5:03 PM
    Hey, I get this error every time I load up a kotlin project in intellij and navigate to the main method. I’m unable to type in the error description text box so I can’t submit the report to Jetbrains. I’ve had the same issues with JDK 8 & 12. Has anyone else had this issue with the latest version of the kotlin plugin?
    a
    • 2
    • 1
  • b

    Bernhard

    05/06/2019, 10:53 AM
    @karelpeeters
    val method = result.jsonObject?.get("result")?.asString
                ?: throwInsertionError(result)
            return when (method) {
    c
    m
    a
    • 4
    • 4
  • e

    elect

    05/07/2019, 9:07 AM
    Idea suggests to simplify
    0f == (-0f)
    as
    false
    , which is wrong
    d
    k
    • 3
    • 16
Powered by Linen
Title
e

elect

05/07/2019, 9:07 AM
Idea suggests to simplify
0f == (-0f)
as
false
, which is wrong
d

Dias

05/07/2019, 9:24 AM
Although negative zero and positive zero are generally considered equal for comparison purposes, some programming language relational operators and similar constructs treat them as distinct. According to the Java Language Specification,[5] comparison and equality operators treat them as equal, but Math.min() and Math.max() distinguish them (officially starting with Java version 1.1 but actually with 1.1.1), as do the comparison methods equals(), compareTo() and even compare() of classes Float and Double
k

karelpeeters

05/07/2019, 9:27 AM
Doesn't matter, the IDE shouldn't suggest replacing any expression that returns
true
with
false
.
d

Dias

05/07/2019, 9:30 AM
oh that's interesting, because I assumed it returns false, given Java spec, and OPs confusion was for different reasons
k

karelpeeters

05/07/2019, 9:30 AM
Well your quote says:
According to the Java Language Specification,[5] comparison and equality operators treat them as equal
d

Dias

05/07/2019, 9:31 AM
but Math.min() and Math.max() distinguish them (officially starting with Java version 1.1 but actually with 1.1.1), as do the comparison methods equals(), compareTo() and even compare() of classes Float and Double
maybe I am reading it wrong
k

karelpeeters

05/07/2019, 9:31 AM
They are equal according to
==
, but not according to
Float.equals
.
👍 1
From the
java.lang.Float.equals
docs:
If f1 represents +0.0f while f2 represents -0.0f, or vice versa, the equal test has the value false, even though 0.0f==-0.0f has the value true.
d

Dias

05/07/2019, 9:33 AM
I thought == is operator for equals()
k

karelpeeters

05/07/2019, 9:36 AM
Not really it turns out:
val posPrimitive: Float = 0.0f
val negPrimitive: Float = -0.0f

val posBoxed: Float? = posPrimitive
val negBoxed: Float? = negPrimitive

println(posPrimitive == negPrimitive)   //true
println(posBoxed == negBoxed)           //true
println(posBoxed?.equals(negBoxed))     //false
Now I'm confused myself, I would have expected
true, false, true
.
d

Dias

05/07/2019, 9:39 AM
println(posPrimitive.equals(negPrimitive))   //false
k

karelpeeters

05/07/2019, 9:40 AM
That boxes the primitives and calls the actual
Float.equals
function, so according to the docs that makes sense.
e

elect

05/07/2019, 9:41 AM
So, I managed to get Karel confused.. excellent ^^
😄 1
k

karelpeeters

05/07/2019, 9:42 AM
Turns out there literally is a special case for floats in the compiler: https://kotlinlang.org/docs/reference/equality.html#floating-point-numbers-equality
👍 1
Why is this not a Kotlin puzzler yet?
:trollface: 2
View count: 3