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

    Daniele Segato

    09/11/2018, 9:10 PM
    I'm reading this: https://android.jlelse.eu/inline-noinline-crossinline-what-do-they-mean-b13f48e113c2 what's the behavior when I don't specify any of
    inline
    ,
    noinline
    ,
    crossinline
    ?
    d
    • 2
    • 2
  • p

    pawel.urban

    09/12/2018, 9:43 AM
    Hey. Can I have an extension function that would handle
    SomeClass<X>
    and
    SomeClass<X?>
    at once?
    n
    r
    +2
    • 5
    • 19
  • h

    Hamza

    09/12/2018, 10:20 AM
    anyone else feel like the kotlin css and html wrappers are a bit lack luster
    d
    g
    • 3
    • 9
  • p

    pawel.urban

    09/12/2018, 11:38 AM
    Another one with nullability Let’s assume I have a function
    fun doSomething(input: SomeClass<Concrete?>)
    . Use case is:
    val localInstance: SomeClass<Concrete> = ...
    doSomething(localInstance)
    Should I naively cast local instance to
    localInstance as SomeClass<Concrete?>
    to use this method? Assume that I can’t change the method.
    :thread-please: 1
    m
    d
    • 3
    • 7
  • k

    karelpeeters

    09/12/2018, 4:54 PM
    One of the big problems with
    typealias
    is that it doesn't offer any type safety. For example, say I'm packing a 2D coordinate of `Int`s in a
    Long
    , I don't want the
    Long
    value to ever be interpreted as a number nor the other way around.
    m
    • 2
    • 2
  • i

    ianbrandt

    09/12/2018, 5:20 PM
    I'm doing some dependency updates on a project, and happened to notice the 1.2.70 artifacts have hit Maven Central. Now we just need the IDE plugins to land. 😃 https://search.maven.org/search?q=g:org.jetbrains.kotlin%20v:1.2.70 https://plugins.jetbrains.com/plugin/6954-kotlin
    🎊 1
    • 1
    • 1
  • d

    Dias

    09/12/2018, 8:11 PM
    Hello, another general coroutine question. I have a gap in understanding how they work. I know coroutines are supposed to be used when you have to wait for something, specifically IO, for example database read of http call. What I don’t understand is how do I convert/wrap those blocking database/http calls into async calls? And how it will work internally?
    a
    • 2
    • 1
  • k

    karelpeeters

    09/12/2018, 8:30 PM
    Strangest thing that's missing from the language.
    😱 1
    m
    • 2
    • 1
  • m

    McEna

    09/12/2018, 8:39 PM
    The @JvmField annotation stopped the clash messages in the BaseJVMRestWorker class, but any kotlin class subclassing that one gets the conflicts again
    a
    • 2
    • 2
  • m

    McEna

    09/12/2018, 8:51 PM
    according to @karelpeeters link, looks like kotlin does not recognize accessors for subclasses...
    • 1
    • 1
  • m

    McEna

    09/12/2018, 9:10 PM
    If I could ask you a bit more of your time, can you take a look at this? https://github.com/fcopardo/EasyRest2
    a
    • 2
    • 1
  • a

    Andreas Sinz

    09/12/2018, 9:16 PM
    Is this a known issue?
    fun main(args: Array<String>) {
        val foo = object {
            var foo: Int? = null
        }
        
        foo.foo = 5
        
        println(foo.foo) //Yields Smart cast impossible, because foo.foo is a mutable property ...
    }
    m
    s
    d
    • 4
    • 17
  • t

    tateisu

    09/12/2018, 10:36 PM
    Does the app created by Kotlin include trove code?
    🇳🇴 2
    e
    • 2
    • 1
  • g

    gildor

    09/13/2018, 6:34 AM
    if(obj != null)
    is not bad itself Maybe you could show to your team members good examples how to eliminate nullability in particular cases
    c
    j
    • 3
    • 18
  • m

    McEna

    09/13/2018, 6:40 AM
    Java is not evil by itself, if the team is still more comfortable doing java, keep using java and introduce kotlin gradually, for example, at view level, for POJOs... take advantage of the interoperability
    j
    g
    d
    • 4
    • 4
  • o

    orangy

    09/13/2018, 12:49 PM
    Result
    is now prohibited for use as a return type by compiler
    k
    p
    e
    • 4
    • 13
  • j

    jmfayard

    09/13/2018, 12:50 PM
    Am I the only one annoyed by the default
    toString()
    implementation of `object`s inside a
    sealed class
    ? ^^
    d
    • 2
    • 1
  • r

    robstoll

    09/13/2018, 3:37 PM
    is there another way to force a compile error on
    when
    when it is not exhaustive other than using it as expression (e.g. assign it to a variable)?
    d
    • 2
    • 3
  • j

    jw

    09/13/2018, 3:39 PM
    https://youtrack.jetbrains.com/issue/KT-12380
    r
    • 2
    • 1
  • r

    Ruckus

    09/13/2018, 4:26 PM
    I submitted an issue https://youtrack.jetbrains.com/issue/KT-26806
    h
    a
    • 3
    • 3
  • v

    vaskir

    09/13/2018, 4:55 PM
    Does Kotlin have a reactive streams implementation (like akka streams for example)?
    g
    • 2
    • 1
  • t

    tipsy

    09/13/2018, 5:42 PM
    is there a better way to write this function?
    inline fun <reified T : Any> getAs(noinline converter: ((String) -> Any)? = null): T = ...
    g
    • 2
    • 1
  • v

    v79

    09/13/2018, 6:26 PM
    I do use
    when
    in my main code. This is just in a test class. I am just surprised the compiler was understanding that
    result
    must be a
    Post
    just because
    post
    is from a cast. Especially is it is possible for my function to return a
    PostGeneration.Error
    or a
    <http://PostGeneration.Post|PostGeneration.Post>
    . I'm going to write a test case which should return a
    PostGeneration.Error
    and see what happens...
    p
    • 2
    • 3
  • h

    Hullaballoonatic

    09/13/2018, 11:02 PM
    not important, but just wondering... why are functions like
    isNullOrEmpty()
    not just an extension property so that the () are unnecessary? so that they can be overloaded? I usually create extensions for readability
    g
    • 2
    • 21
  • b

    bloodshura

    09/13/2018, 11:45 PM
    Or is it for the sole purpose of not creating an additional middle-ware List between the 2 calls?
    s
    • 2
    • 2
  • x

    xenoterracide

    09/14/2018, 12:30 AM
    I'm writing a gradle plugin in java, I need to consume an extension that's written in Kotlin. https://github.com/tbroyer/gradle-errorprone-plugin/blob/master/src/main/kotlin/net/ltgt/gradle/errorprone/ErrorProneOptions.kt but this class
    ErrorProneOptions.class
    doesn't appear to be available to me in java. Why? can I remediate?
    g
    • 2
    • 5
  • d

    dhananjaykulkarni19

    09/14/2018, 6:14 AM
    Hello Androiders, Need a small help. I want to create my own plugin in android studio which will get json text as input and generate a pojo class. I don't want to use ready made plugins i want to create my own. Any help would be appreciated.
    g
    d
    • 3
    • 5
  • s

    Slackbot

    09/14/2018, 8:59 AM
    This message was deleted.
    l
    p
    +3
    • 6
    • 11
  • б

    Бежан Александр

    09/14/2018, 9:36 AM
    Hey guys. I need to make parallel
    flatMap
    in Kotlin. How to do that ? For example:
    val coll: List<Set<Int>> = ...
    coll.flatMap{set -> setOf(set, set + 1)}
    g
    • 2
    • 11
  • p

    pniederw

    09/14/2018, 9:50 AM
    are you perhaps using a ktor version based on 1.3-m1? (just guessing)
    ❤️ 1
    a
    • 2
    • 7
Powered by Linen
Title
p

pniederw

09/14/2018, 9:50 AM
are you perhaps using a ktor version based on 1.3-m1? (just guessing)
❤️ 1
a

aviadmini

09/14/2018, 9:52 AM
No as I said I'm using Stable channel and plugin version is 1.2.70-blabla
Also ktor version is based on 1.2.61
p

pniederw

09/14/2018, 9:53 AM
it sounds like one of your dependencies is pulling in 1.3-M1, in which case channel and plugin version don’t matter.
a

aviadmini

09/14/2018, 9:56 AM
Well it's weird because apart from updating plugins (kotlin and kotlinx.serialization) and updating kotlin version to 1.2.70 in gradle I didn't change anything
p

pniederw

09/14/2018, 9:56 AM
running
gradlew dependencies
would be a good start
a

aviadmini

09/14/2018, 10:04 AM
Thanks a lot! Looks like ktor version I used was for 1.3. Downgrading solved the issue
p

pniederw

09/14/2018, 10:21 AM
👍
View count: 2