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
announcements
  • c

    cedric

    04/20/2017, 2:58 PM
    @ijp If compiling a simple Java file takes 15 seconds, I strongly suspect something wrong with your environment (defective hard drive maybe?). Have you tried to build on another computer?
    j
    o
    i
    • 4
    • 32
  • v

    vinicius.rob.cunha

    04/20/2017, 5:22 PM
    Hi everybody I created a project on git hub to of an extention for java.util.File class adding methods to delete after few seconds. How i'm new in Kotlin and here, I would to know if anyone could take a look mainly on code and tests case and which is the best channel on slack to publish
    r
    • 2
    • 3
  • o

    orangy

    04/20/2017, 6:34 PM
    Please check 1.1.2 EAP in #eap channel, your project might be important for quality! 📣 📣
    👍 3
    v
    • 2
    • 1
  • s

    Slackbot

    04/20/2017, 8:00 PM
    This message was deleted.
    i
    • 2
    • 1
  • g

    groostav

    04/21/2017, 6:08 AM
    does anybody know why "JvmField cannot be applied to property defined in companion object of interface"?
    y
    • 2
    • 1
  • v

    vitruvia

    04/21/2017, 1:08 PM
    When creating a collection or a list do you always need to specify the type of whatever is in those structures with <>? (like Collection<Int>). Can't you make a list that has both Int and Strings?
    e
    k
    • 3
    • 13
  • m

    mg6maciej

    04/21/2017, 10:30 PM
    Package-private and testing shouldn't have anything to do with each other tho. Test what's public.
    ➕ 3
    b
    • 2
    • 5
  • o

    orangy

    04/22/2017, 11:31 AM
    Please file a kotl.in/issue
    y
    • 2
    • 2
  • o

    orangy

    04/22/2017, 11:59 AM
    Because JMM. https://shipilev.net/blog/2014/safe-public-construction/
    l
    c
    • 3
    • 2
  • r

    raulraja

    04/22/2017, 12:40 PM
    @orangy Thanks, I'm comfortable if I have to figure it out looking at the code. Regarding the
    all-open
    plugin, do you know where it actually performs either the AST transformation or class rewrite to open it? I have not been able to find the sources for that part and that could help me get started.
    m
    • 2
    • 3
  • m

    mg6maciej

    04/22/2017, 2:07 PM
    Any way to force use of named parameters on
    copy
    for certain data classes? I have a class where first two props are `Int`s and wanted to change the second, but forgot to use name of property. Found after like 5 minutes.
    s
    r
    • 3
    • 3
  • p

    poohbar

    04/23/2017, 12:10 PM
    Is it possible to set up hot-swap for JavaFX development? What I have in mind is moving around components while the app is running by recompiling some classes.
    m
    • 2
    • 1
  • c

    Czar

    04/24/2017, 9:29 AM
    I'm planning to implement kotlin script runner for my web application. It will work like this: On the web there is an editor with a text area where one can write a Kotlin script, then this script is autowired from running Spring context and then executed. I want it to be nice, so I decided to implement a web-ide style editor, with syntax highlighting and auto-complete for both language features and existing Spring beans (maybe). So I'm looking for a minimal but extendable web-ide for Kotlin. So far I've found out that try.kotl.in is open-source, and therefore I could strip it down to bare bones that I need and use that, but before I dive down I'd like to know, maybe there is something more atomic, which I can just take instead of digging it out of a larger project?
    g
    j
    • 3
    • 6
  • a

    aidanvii

    04/24/2017, 10:59 AM
    I’m looking for some more examples of how to use the
    provideDelegate
    operator. The example code on the documentation is slightly confusing: https://kotlinlang.org/docs/reference/delegated-properties.html Does this create an instance of
    ResourceLoader
    which then creates the delegate? Will the
    ResourceLoader
    be gc’d after it’s created the delegate? It also mentions it can be done with an extension function, but there is no example of this.
    l
    • 2
    • 2
  • p

    poohbar

    04/24/2017, 3:52 PM
    wow.. adding a dependency for a "two-liner" smells awful lot like javascript and npm 😄
    m
    a
    • 3
    • 3
  • t

    thymecypher

    04/24/2017, 6:46 PM
    What in the world would cause “unresolved reference: kotlinx” and “unresolved reference: list” to start appearing?
    k
    • 2
    • 9
  • m

    manijshrestha

    04/24/2017, 8:07 PM
    can someone point me on how I can extend a data class? as per the documentation
    Since 1.1, data classes may extend other classes
    .? I am trying to achieve
    data class Person(val name: String)
    data class Employee(val id: String, val name:String) : Person(name)
    k
    k
    m
    • 4
    • 13
  • r

    redrield

    04/25/2017, 12:03 AM
    So... Is there a way that I can pass in Javadocs so that something like java.util.function.Consumer becomes Consumer with a hyperlink to the oracle docs/
    o
    • 2
    • 2
  • m

    mg6maciej

    04/25/2017, 12:52 AM
    Tricky question: is there a way to tell my code that some Java type is covariant?
    o
    • 2
    • 5
  • c

    Czar

    04/25/2017, 2:34 PM
    Yes. And I do know many of the pros and cons of tabs vs spaces, for my team tabs win 🙂 I'm not saying it's like that for everyone, but give me my options!
    m
    p
    • 3
    • 8
  • n

    nesl247

    04/25/2017, 6:05 PM
    inCompilationProduct.toCompiledProduct().shouldEqual(expected)
    using Kluent. I’ve tried with assertEquals from Junit just to be sure it wasn’t something Kluent was doing, but it isn’t.
    p
    • 2
    • 7
  • t

    trevjones

    04/26/2017, 12:20 AM
    why is it that when you want to update the idea kotlin plugin you have to go find it in the list of jetbrains plugins rather than just hitting check for updates?
    k
    • 2
    • 2
  • p

    pniederw

    04/26/2017, 12:39 AM
    without a way to downgrade the intellij plugin to 1.1.1, my project no longer compiles in intellij. that’s the kind of lock-in I’m always afraid of (got burned too many times with groovy + eclipse in the past).
    s
    s
    o
    • 4
    • 4
  • m

    mzgreen

    04/26/2017, 11:40 AM
    Oh I get it, thanks 👍
    o
    m
    • 3
    • 7
  • o

    orangy

    04/26/2017, 12:12 PM
    @firezenk I don’t see how meme image like this contributes to Kotlin community. If you have complaints, please share them and be specific.
    p
    • 2
    • 1
  • c

    Czar

    04/26/2017, 1:22 PM
    Missed it, now I'm insanely curious what was the image everyone is talking about 👿
    ➕ 2
    • 1
    • 1
  • j

    jean

    04/26/2017, 7:12 PM
    I have suddenly started getting error when building my KotlinJS project in Idea 2016.3 (Kotlin plugin 1.1.1): Error: Kotlin: Source file or directory not found. Maven builds works fine. Any idea how can I turn more logging for kotlin compiler? There is no other error than this in the Idea logs.
    • 1
    • 1
  • j

    jw

    04/27/2017, 4:35 AM
    I change it manually because of course, but I always have to remind my teammates
    m
    • 2
    • 1
  • p

    pabl0rg

    04/27/2017, 9:57 AM
    is there a way to get IntelliJ to show type info for an expression?
    e
    • 2
    • 3
  • p

    ptashcka

    04/27/2017, 1:05 PM
    hey! is this the expected behavior? println(Math.sqrt(-1.0) == Double.NaN) // false println(Math.sqrt(-1.0).equals(Double.NaN)) // true
    ➕ 1
    i
    • 2
    • 3
Powered by Linen
Title
p

ptashcka

04/27/2017, 1:05 PM
hey! is this the expected behavior? println(Math.sqrt(-1.0) == Double.NaN) // false println(Math.sqrt(-1.0).equals(Double.NaN)) // true
➕ 1
i

ilya.gorbunov

04/27/2017, 2:37 PM
Yes, this is an expected behavior,
NaN == NaN
are compared as IEEE numbers and that results in false, however
NaN.equals(NaN)
are compared as boxed objects and results in true
Unfortunately, it isn't documented thoroughly yet
p

ptashcka

04/27/2017, 4:53 PM
then I think the bug is with Idea inspections: http://take.ms/Pfhq5
View count: 5