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
  • j

    jelloranger

    08/21/2017, 8:25 AM
    I already tried adding sourceSets { test.kotlin.srcDirs += 'src/test/kotlin' } and nothing changed
    g
    • 2
    • 1
  • j

    jelloranger

    08/21/2017, 8:52 AM
    I think I'm gonna go to bed at this point 😕. I really do appreciate all the help though in trying to figure out what's going wrong in my project
    g
    • 2
    • 5
  • h

    horse_badorties

    08/21/2017, 11:31 AM
    😅 sorry, I missread your question entirely
    a
    • 2
    • 2
  • k

    karelpeeters

    08/21/2017, 11:45 AM
    @arekolek There's this issue that's WIP, it's also about smart casts and inline functions: https://youtrack.jetbrains.com/issueMobile/KT-14397
    👍 1
    a
    l
    i
    • 4
    • 7
  • j

    jkbbwr

    08/21/2017, 1:13 PM
    is kotlin still planning on truly immutable data structures
    o
    • 2
    • 1
  • c

    Czar

    08/21/2017, 1:16 PM
    After update to kotlin 1.1.4, my gradle build (groovy based) fails with following
    Task with path 'copyMainKotlinClasses' not found in project
    . In
    build.gradle
    I have:
    // groovy code should have access to kotlin classes for things like blablabla to work
    tasks.compileGroovy.dependsOn 'copyMainKotlinClasses'
    // and also for tests
    tasks.compileTestGroovy.dependsOn 'copyTestKotlinClasses'
    Gradle version: 4.0.1
    m
    k
    • 3
    • 9
  • s

    Slackbot

    08/22/2017, 1:06 AM
    This message was deleted.
    k
    a
    g
    • 4
    • 5
  • a

    a2.codeslayers

    08/22/2017, 1:12 AM
    And guyz what's your opinions about React-Native is it worth learning
    k
    • 2
    • 1
  • d

    Dalinar

    08/22/2017, 2:51 AM
    is there a way to reference the object that you're `with`ing from within the block?
    r
    • 2
    • 2
  • b

    boyw165

    08/22/2017, 8:32 AM
    Not sure if this blog is over posted, it’s a good article about reactive programming for Android. http://hannesdorfmann.com/android/mosby3-mvi-1
    c
    • 2
    • 1
  • f

    fitermay

    08/22/2017, 10:42 AM
    Could someone please take a look at https://youtrack.jetbrains.com/issue/KT-19830 ? It seems to be a major bug and I believe it worked it earlier versions.
    m
    • 2
    • 1
  • n

    nyxcode

    08/22/2017, 8:48 PM
    Hey! How does Kotlins
    internal
    visibility modifier work? Is it just compiler-side? How does Java-Interop look like? Is an internal function accessible from Java code in an other module?
    j
    d
    • 3
    • 4
  • p

    Paul Woitaschek

    08/22/2017, 9:52 PM
    Actually fascinating. That means you can null out a late init property from java
    a
    k
    • 3
    • 8
  • k

    karelpeeters

    08/22/2017, 10:02 PM
    I don't know, maybe DI frameworks don't always work on private variables?
    a
    d
    p
    • 4
    • 7
  • s

    Slackbot

    08/23/2017, 7:53 AM
    This message was deleted.
    :stackoverflow: 1
    d
    • 2
    • 1
  • r

    robinchew

    08/23/2017, 8:02 AM
    o right, I should probably ask in the android channel
    d
    • 2
    • 1
  • a

    aidanvii

    08/23/2017, 3:57 PM
    Is there any way to stop annotations on interfaces being added to the generated
    DefaultImpls
    class? I’m using an annotation processor (android data-binding) that does not like certain annotations on classes that don’t meet certain requirements (doesn’t extend an interface)
    k
    • 2
    • 2
  • p

    poohbar

    08/23/2017, 6:02 PM
    Button b2 = new Button();
    b2.Click  += new RoutedEventHandler(Onb2Click);
    g
    b
    +2
    • 5
    • 6
  • m

    melston

    08/23/2017, 11:08 PM
    @leonardootto, the first one splits on any character (the '.' matches any character). The second splits only on an actual dot.
    👍 1
    k
    r
    • 3
    • 2
  • k

    kevin.cianfarini

    08/24/2017, 3:20 AM
    can anyone explain the reified keyword to me? What I'm reading online isn't making a whole lot of sense and I need it to click
    g
    a
    • 3
    • 9
  • p

    prestongarno

    08/25/2017, 5:11 AM
    Browsed around org.jetbrains maven artifacts and don’t see anything, can’t find anything on github
    • 1
    • 1
  • d

    dreamreal

    08/25/2017, 1:50 PM
    ah, beauty. Thank you. The kotlin interop page doesn't show that, and should. 😞
    k
    • 2
    • 2
  • n

    nounours

    08/25/2017, 5:34 PM
    Oh ok, I didn't know this feature ! Thanks !
    g
    • 2
    • 1
  • w

    wst

    08/26/2017, 3:49 AM
    Is there any better way of doing it?
    val t: List<(Double) -> Double> // not empty
    
    fun transform(d: Double): Double {
        var temp = d
        t.forEach { temp = it(temp) }
        return temp
    }
    a
    • 2
    • 2
  • a

    alexcouch

    08/26/2017, 12:23 PM
    I was reading up on the native kotlin info page and it mentions game development. I was thinking of how that would be used. Would it be used as like just scripting for events and whatnot or like full on games? I'm sure it seems obvious but I'm a game design student and I wanna know how it will work, according to plans, so that I could possibly use kotlin for games that I make, depending on how it will be designed
    m
    k
    e
    • 4
    • 5
  • s

    supaham

    08/26/2017, 1:43 PM
    I'm using a library which gets
    field#getCollectionType()
    a collection's type but the code kotlin compiles keeps returning that class type as
    java.lang.Object
    . How do I fix this?
    k
    • 2
    • 3
  • a

    alexcouch

    08/26/2017, 5:33 PM
    Somehow...
    k
    • 2
    • 1
  • s

    supaham

    08/26/2017, 6:39 PM
    I'm writing a DAO in Kotlin. I would like to, and believe it to be acceptable, throw an error if they try to read a value that isn't set. lateinit does the trick, but not for fields that are nullable. Any suggestions without actually writing exception throwing for each field
    k
    • 2
    • 4
  • b

    bod

    08/26/2017, 7:24 PM
    Hello! If I have a “setter” in a Java lib that doesn’t return
    void
    , but the target object (bulder pattern), will that still be considered a property in Kotlin?
    k
    • 2
    • 3
  • r

    Rob

    08/26/2017, 7:25 PM
    https://medium.com/@Robert_Chrzanow/kotlins-missing-type-either-51602db80fda
    👍 2
    r
    k
    • 3
    • 4
Powered by Linen
Title
r

Rob

08/26/2017, 7:25 PM
https://medium.com/@Robert_Chrzanow/kotlins-missing-type-either-51602db80fda
👍 2
r

raulraja

08/26/2017, 7:42 PM
@Rob In case you have not already run into it, we have Either, EitherT, monadic comprehensions for all monads and other similar FP datatypes and abstraction in Kategory. https://github.com/kategory/kategory/blob/master/kategory/src/main/kotlin/kategory/data/Either.kt There is other instances of Either in other libs too, Funktionale also has an Either https://github.com/MarioAriasC/funKTionale/blob/master/funktionale-either/src/main/kotlin/org/funktionale/either/Disjunction.kt
k

karelpeeters

08/26/2017, 7:44 PM
Good article explaining the absolute basics, but I don't really get why you're talking about "product" and "sum" types: why is that information useful in practice?
r

Rob

08/26/2017, 7:45 PM
Thanks! I'm aware of these libraries. I'm writing my own library of functional abstractions to better grok them.
I wanted to quickly cover how algebraic data types construct new types before showing a generic instance of a sum type.
View count: 2