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

    Czar

    12/11/2017, 5:57 PM
    Hm... I had the same impression when I was starting out with gradle, but eventually, when I learned, it became much easier and more readable for me personally to write gradle build files instead of pom.xml
    v
    • 2
    • 5
  • t

    tekjar

    12/12/2017, 7:36 AM
    Hi. Is anyone here using kotlin with google cloud platflorm dataflow ?
    p
    • 2
    • 1
  • l

    loloof64

    12/12/2017, 12:56 PM
    Thank you 🙂
    g
    • 2
    • 1
  • t

    Thiago

    12/12/2017, 12:58 PM
    Hello people. A companion object and a static block inside a class, okay? E This block can be implemented in any other class, which inherits from the class that contains this companion object? right?
    k
    • 2
    • 2
  • r

    rajendhiraneasu

    12/12/2017, 1:56 PM
    hi mates, is it possible to call the firebase cloud functions through android ? like we do for general web api calls via retrofit or volley ?
    :stackoverflow: 2
    a
    • 2
    • 1
  • s

    Slackbot

    12/12/2017, 2:01 PM
    This message was deleted.
    k
    l
    a
    • 4
    • 4
  • n

    noncom

    12/12/2017, 3:50 PM
    what is the best way to deep-compare two lists in Kotlin today?
    k
    • 2
    • 2
  • m

    myanmarking

    12/12/2017, 3:50 PM
    i think i may have the version wrong because my release build is failing with
    Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'.
    m
    • 2
    • 2
  • l

    loloof64

    12/12/2017, 4:09 PM
    I've managed to execute an script inside a string from a Kotlin program. But this require to import the kotlin-compiler jar, which is about 30Mb. So, this is too big for an Android project : has someone another solution ?
    g
    • 2
    • 3
  • l

    loloof64

    12/12/2017, 4:13 PM
    I thought about Lua first, I just wanted to avoid to use the NDK : the "plugin" I found use the NDK. But I should look further if another project can embed Lua without using NDK
    k
    • 2
    • 2
  • m

    mauri

    12/12/2017, 4:14 PM
    Hi all, is there any release version for kotlin 1.2.10 IDE plugin?
    c
    • 2
    • 1
  • s

    stkent

    12/12/2017, 4:50 PM
    remove
    returns the value of the entry removed or null if nothing was removed
    k
    • 2
    • 5
  • s

    snowe

    12/12/2017, 4:54 PM
    I'm assuming I'll have to use flatmap, but I'm terrible at flatmaps so I'm not sure how I'd do it.
    k
    • 2
    • 2
  • s

    sxtanna

    12/13/2017, 5:35 AM
    Is Kotlin influenced by Swift?
    g
    c
    +2
    • 5
    • 13
  • e

    edwardwongtl

    12/13/2017, 7:16 AM
    @Shawn That does not work on overloaded function😞
    g
    • 2
    • 6
  • g

    gildor

    12/13/2017, 7:18 AM
    You cannot do that for functions. But there is KEEP proposal about this - https://github.com/Kotlin/KEEP/pull/89
    e
    • 2
    • 5
  • s

    Shawn

    12/13/2017, 7:20 AM
    closest you’re gonna get is probably a lambda
    val toast = { x: Int -> activity.toast(x) }
    e
    • 2
    • 1
  • m

    mikehearn

    12/13/2017, 10:27 AM
    why can't I take a varargs array and use operator + on it?
    r
    • 2
    • 1
  • r

    rrader

    12/13/2017, 12:41 PM
    hi, what are reasons to have companion object in class and not a static block(methods, variables) instead?
    l
    d
    • 3
    • 15
  • t

    Thiago

    12/13/2017, 1:38 PM
    @agrosner Yes. I've tried it several times. However, the error persists.
    a
    • 2
    • 2
  • c

    christophsturm

    12/13/2017, 1:46 PM
    is there something like swift playgrounds for kotlin? (like try.kotlin, but updating on every keypress, and outputting values for every line)
    g
    • 2
    • 3
  • j

    jamie-purchase

    12/13/2017, 1:56 PM
    guys i'm losing hope with an issue - was happening with a gradle build but i've copied the source code into a new standard Kotlin JVM project and it's still happening. I am using IntelliJ IDEA 2017.2.5 but this issue happened after i tried 2017.3 for a brief moment then moved back
    Error:Kotlin: [Internal Error] java.lang.NoClassDefFoundError: Could not initialize class org.jetbrains.kotlin.diagnostics.DiagnosticUtils
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.logOrThrowException(ExpressionTypingVisitorDispatcher.java:243)
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.lambda$getTypeInfo$0(ExpressionTypingVisitorDispatcher.java:221)
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher$$Lambda$82/14319803.invoke(Unknown Source)
    	at org.jetbrains.kotlin.util.PerformanceCounter.time(PerformanceCounter.kt:90)
    already tried everything on this article https://github.com/JetBrains/gradle-intellij-plugin/issues/69
    p
    j
    • 3
    • 8
  • a

    adam-mcneilly

    12/13/2017, 4:22 PM
    This would be so clean as a when statement though... Unless I'm not reading it right, which is totally possible.
    f
    j
    • 3
    • 21
  • e

    elect

    12/13/2017, 4:58 PM
    I have the exact same function
    glBufferData
    in two different locations
    import org.lwjgl.opengl.GL15.*
    import gln.buffer.glBufferData
    is there a way to avoid importing it from the first
    import
    ? At the moment I'm having this in addition:
    import org.lwjgl.opengl.GL15.glBufferData as deprecated
    but it's meh..
    a
    c
    • 3
    • 11
  • e

    evkaky

    12/13/2017, 5:39 PM
    curr.left
    is not so complex for me…
    j
    g
    a
    • 4
    • 6
  • m

    mike_shysh

    12/13/2017, 6:44 PM
    The lambda expression is unused. If you mean a block, you can use 'run {...} '
    g
    • 2
    • 5
  • l

    loloof64

    12/13/2017, 8:35 PM
    Thanks, I've read this page, but how can I simply apply these features to generate a function from a string ?
    n
    • 2
    • 1
  • m

    mbstavola

    12/14/2017, 5:20 AM
    I'm having a strange issue with extending a Kotlin class that implements Iterable. It seems as though when viewed from Java, the implementation clashes with the
    java.util
    equivalent. Not really too sure what's up!
    g
    • 2
    • 5
  • y

    ylemoigne

    12/14/2017, 7:10 AM
    Hello. If someone has some idea : https://stackoverflow.com/questions/47807755/searching-a-workaround-for-kotlin-empty-data-class-primary-constructor
    a
    l
    • 3
    • 14
  • l

    louiscad

    12/14/2017, 8:19 AM
    Hi, what's the most idiomatic way to define and use a custom
    toString()
    (for debugging purposes) for a java class that doesn't override the one from
    Object
    ?
    j
    k
    c
    • 4
    • 4
Powered by Linen
Title
l

louiscad

12/14/2017, 8:19 AM
Hi, what's the most idiomatic way to define and use a custom
toString()
(for debugging purposes) for a java class that doesn't override the one from
Object
?
j

jmfayard

12/14/2017, 8:36 AM
interface Debuggable {
   val debugMsg: String
fun <T : Debuggable> debug(name: String): T {
    println("DEBUG: ${name} = ${debugMsg}")
    return this
}
}
l

louiscad

12/14/2017, 8:45 AM
@jmfayard This is not my class, I can't add an interface to it. I ended up writing using a
print()
extension function that returns what a proper
toString()
should return for now.
k

kingsley

12/14/2017, 8:38 PM
You could also open a proper debugging session, and set breakpoints, so you can see actual values held by the object in question I’m assuming you’re running in an environment where this kind of thing is possible
c

cedric

12/15/2017, 2:18 AM
Hopefully this will become possible if type classes get added to Kotlin (being discussed in a KEEP right now)
👍🏽 1
View count: 2