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

    david.bilik

    11/28/2017, 8:27 AM
    I’ve noticed interesting “bug”, if i use
    Date
    in my code, it adds this import
    import java.util.*
    instead of just
    import java.util.Date
    like in Java files. Is there any purpose?
    k
    j
    • 3
    • 2
  • j

    jchannon

    11/28/2017, 9:26 AM
    @karelpeeters that then breaks the inline fun 🙂
    k
    • 2
    • 2
  • a

    alexcouch

    11/28/2017, 9:38 AM
    So...just curious...is there a slack or something similar for IDEA?
    k
    s
    +3
    • 6
    • 8
  • j

    jchannon

    11/28/2017, 10:25 AM
    fun  <T:Any> get(c: KClass<T>) : T{
             return c.createInstance()
         }
    c
    l
    • 3
    • 3
  • c

    Czar

    11/28/2017, 10:52 AM
    Gotta love extension methods. The fact that joda time does not provide is(Before|After)OrEqual methods bugged me even though the workaround is very simple. With Kotlin this is solved 😄
    fun AbstractPartial.isBeforeOrEqual(other: ReadablePartial): Boolean = !isAfter(other)
    fun AbstractPartial.isAfterOrEqual(other: ReadablePartial): Boolean = !isBefore(other)
    The problem with directly using something like
    !isAfter(other)
    is the exclamation mark, arguably it is harder to spot and read than readable name like
    isBeforeOrEqual(other)
    .
    l
    d
    • 3
    • 9
  • l

    louiscad

    11/28/2017, 2:57 PM
    KOTLIN 1.2 IS COMING TO STABLE CHANNEL!!
    🎉 11
    😱 6
    🎊 2
    🙃 2
    a
    • 2
    • 3
  • m

    marstran

    11/28/2017, 2:59 PM
    Oops, wrote it a little bit quick.
    • 1
    • 1
  • p

    Paul Woitaschek

    11/28/2017, 3:20 PM
    I removed a line to make that clear 😛
    👍🏽 1
    l
    • 2
    • 1
  • p

    Paul Woitaschek

    11/28/2017, 3:30 PM
    https://youtrack.jetbrains.com/issue/KT-21490
    👍🏽 1
    s
    • 2
    • 2
  • d

    dierre

    11/28/2017, 3:42 PM
    hello, just out of curiosity, do you know if there is an equivalent of for-comprehension in kotlin? Basically something to use instead of
    c1.flatMap(x => c2.flatMap(y => c3.map(z => {...})))
    which in scala would be
    for(x <- c1; y <- c2; z <- c3) yield {...}
    m
    • 2
    • 1
  • a

    adam-mcneilly

    11/28/2017, 3:52 PM
    Changing off to offset 😜
    ➕ 3
    r
    • 2
    • 1
  • y

    yole

    11/28/2017, 4:03 PM
    <!channel> Kotlin 1.2 is out! https://blog.jetbrains.com/kotlin/2017/11/kotlin-1-2-released/
    🎉 271
    🇳🇴 3
    🏩 12
    🍾 42
    🙇 4
    🙌 12
    :kotlin-flag: 65
    ✋ 2
    :bowtie: 3
    🇵🇰 4
    👏 40
    😵 2
    👍🏽 5
    🇩🇪 3
    ✅ 2
    🇧🇻 2
    🇸🇯 2
    👀 4
    🇺🇦 9
    😎 8
    🇵🇱 4
    🤘 5
    🎄 5
    🍿 8
    💥 4
    📣 3
    🍕 2
    🎊 4
    🍻 3
    🤓 5
    :kotlinconf: 9
    🙀 4
    🎩 4
    🇪🇸 16
    🚀 19
    :yes: 20
    💯 10
    🤘 14
    🗣️ 7
    👌 19
    💪 15
    ❤️ 13
    :kotlin: 94
    🙃 17
    😮 11
    :glitch_crab: 8
    🆒 23
    🕶️ 5
    :gradle: 33
    👍 77
    g
    • 2
    • 1
  • t

    tschuchort

    11/28/2017, 4:08 PM
    Btw are there any plans for crosscompilation to dart? I quite like the flutter framework but good god the language is awful
    w
    • 2
    • 1
  • j

    jchannon

    11/28/2017, 4:08 PM
    you dont compile Kotlin to an online account. i think it needs more clarity??
    👍 11
    ➕ 1
    o
    m
    • 3
    • 2
  • e

    egorand

    11/28/2017, 4:36 PM
    Looks like passing varargs as named parameters got deprecated and the auto-fix changes it to
    *arrayOf()
    which is kinda verbose. Is there a better way?
    y
    r
    • 3
    • 3
  • e

    ehubbard

    11/28/2017, 4:48 PM
    For folks using gradle — current docs say ext.kotlin_version = ‘1.2’ but it should read ext.kotlin_version = ‘1.2.0’ right?
    👍 1
    y
    • 2
    • 1
  • j

    jlleitschuh

    11/28/2017, 4:49 PM
    @yole The Compatibility Glossary for
    1.2.0
    needs to be updated. http://kotlinlang.org/docs/reference/compatibility.html
    👍 1
    y
    • 2
    • 2
  • j

    Jorge Castillo

    11/28/2017, 4:54 PM
    also is it completely mandatory to have
    expected
    on a common module and
    actual
    in a platform one?
    😌 1
    y
    p
    i
    • 4
    • 10
  • j

    jlleitschuh

    11/28/2017, 5:24 PM
    How do I prevent these two declarations from having the same JVM type signature?
    class NamedDomainObjectContainerScope<T : Any>(
        private val container: NamedDomainObjectContainer<T>) : NamedDomainObjectContainer<T> by container {
    
        operator fun String.invoke(configuration: T.() -> Unit): T =
            this().apply(configuration)
    
        /**
         * @see [NamedDomainObjectContainer.maybeCreate]
         */
        inline
        operator fun <reified U : T> String.invoke(configuration: U.() -> Unit): U =
            this(U::class).apply(configuration)
    }
    Use case: I want to be able to do this:
    container { // `this` is type `NamedDomainObjectContainerScope<Task>`
        "allice" { /* Type Task in this scope*/ }
        "bob"<ExtendedTaskType> { /* Type ExtendedTaskType in this scope*/ }
    }
    My more general problem is that I'm trying to add
    reified
    overloads for all of these methods in the Gradle Kotlin DSL: https://github.com/gradle/kotlin-dsl/blob/6a3c51a65e8423aa33432b816996360cd32e7906/provider/src/main/kotlin/org/gradle/kotlin/dsl/NamedDomainObjectContainerExtensions.kt
    a
    • 2
    • 5
  • f

    fjanicki

    11/28/2017, 5:27 PM
    Does Kotlin 1.2 means that we could reuse the Domain + Data layer of an Android application and add another module written in Kotlin, targetting JS and that is a frontend in React?
    h
    • 2
    • 2
  • t

    tapchicoma

    11/28/2017, 7:41 PM
    what is right approach for
    ReplaceWith
    in
    @Depreacted
    annotation for properties? I want to update from:
    val someField = someValue
    to
    val someFields = arrayOf(someValue)
    Using
    ReplaceWith("val someFields = arrayOf(x)")
    produces
    val someFields = arrayOf(x)
    on IDEA action 😞
    i
    • 2
    • 2
  • j

    jchannon

    11/28/2017, 8:18 PM
    does anyone know of a postgres data type to kotlin data type dictionary? eg serial, int4, int8 matches Int
    c
    • 2
    • 4
  • g

    g4sarma

    11/28/2017, 9:25 PM
    Anyone how has some experience with connecting to MS -Sql server using JDBC ?
    t
    • 2
    • 7
  • c

    cedric

    11/28/2017, 9:43 PM
    Maybe even our first spam, so exciting!
    🎆 4
    🍾 9
    🎉 5
    o
    • 2
    • 1
  • c

    chansek

    11/29/2017, 3:22 AM
    Does 1.2 works with Android Studio 3.1 Canary 4?
    m
    g
    • 3
    • 9
  • c

    chansek

    11/29/2017, 3:22 AM
    Yesterday I updated it and my AS stopped working
    g
    • 2
    • 5
  • d

    dave

    11/29/2017, 9:42 AM
    Gradle question: I'm upgrading a project to 1.2 and all of a sudden I've got a errors because I'm calling static java methods and this is now prohibited. On further inspection, it looks like my IntelliJ project is being imported with a targetPlatform of 1.6. Any idea of the gradle magic to fix this? I've already got
    sourceCompatibility = JavaVersion.VERSION_1_8
        targetCompatibility = JavaVersion.VERSION_1_8
    in my gradle file, and the project SDK is set correctly to 1.8. Is there another flag I'm missing for
    targetPlatform
    ?
    d
    c
    • 3
    • 9
  • m

    michaelzinn

    11/29/2017, 10:19 AM
    I have a simple problem where I’m not sure how to solve it in the most type save way. I have two sets of well known values, which means that enums seem like a natural fit. However, those enums are parameterized with description texts. How do I write a generic function that takes the whole enum as a parameter? Enums can’t inherit from a “parameterized enum”. Can they implement interfaces? Can I even reference the whole enum set, or do I have to pass the SomeEnum.values() array around?
    d
    • 2
    • 2
  • e

    edwardwongtl

    11/29/2017, 10:46 AM
    Writing it by hand or generated by compiler is an other question though
    d
    m
    • 3
    • 18
  • p

    Paul Woitaschek

    11/29/2017, 12:30 PM
    I think I found a bug in 1.2 🙂
    o
    • 2
    • 9
Powered by Linen
Title
p

Paul Woitaschek

11/29/2017, 12:30 PM
I think I found a bug in 1.2 🙂
o

orangy

11/29/2017, 12:32 PM
Bugs need to go to YouTrack. This Slack is not a proper tracking tool. It could be easily missed in the stream of messages.
p

Paul Woitaschek

11/29/2017, 12:32 PM
It will, I'm just posting it here in case I'm missing something
o

orangy

11/29/2017, 12:33 PM
Well, if compiler crashes, it’s hardly something missing 🙂 Please report.
Is it a regression? I don’t have 1.1.61 handy…
p

Paul Woitaschek

11/29/2017, 12:35 PM
https://youtrack.jetbrains.com/issue/KT-21506
In 1.1.61 you could not omit
this
o

orangy

11/29/2017, 12:36 PM
Yup, thanks for reporting!
So it’s already fixed for 1.2.10 🙂
🙌 3
p

Paul Woitaschek

11/29/2017, 12:42 PM
thx 🙂
View count: 2