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
eap
  • e

    Eugenio

    06/26/2017, 8:21 AM
    we just tried using 1.1.3 and the compilation fails with the following:
    ...
    Cause: No var type @142
    Element is unknownThe root cause was thrown at: RedundantNullCheckV2MethodTransformer.kt:208
    	at org.jetbrains.kotlin.codegen.TransformationMethodVisitor.visitEnd(TransformationMethodVisitor.java:86)
    	at org.jetbrains.kotlin.codegen.TransformationMethodVisitor.visitEnd(TransformationMethodVisitor.java:83)
    	... 63 more
    Caused by: java.lang.AssertionError: No var type @142
    	at org.jetbrains.kotlin.codegen.optimization.nullCheck.RedundantNullCheckV2MethodTransformer$TransformerPass$NullabilityAssumptionsBuilder.injectAssumptions(RedundantNullCheckV2MethodTransformer.kt:208)
    	at org.jetbrains.kotlin.codegen.optimization.nullCheck.RedundantNullCheckV2MethodTransformer$TransformerPass$NullabilityAssumptionsBuilder.injectNullabilityAssumptions(RedundantNullCheckV2MethodTransformer.kt:170)
    	at org.jetbrains.kotlin.codegen.optimization.nullCheck.RedundantNullCheckV2MethodTransformer$TransformerPass.injectNullabilityAssumptions(RedundantNullCheckV2MethodTransformer.kt:88)
    	at org.jetbrains.kotlin.codegen.optimization.nullCheck.RedundantNullCheckV2MethodTransformer$TransformerPass.eliminateRedundantChecks(RedundantNullCheckV2MethodTransformer.kt:78)
    	at org.jetbrains.kotlin.codegen.optimization.nullCheck.RedundantNullCheckV2MethodTransformer$TransformerPass.run(RedundantNullCheckV2MethodTransformer.kt:48)
    	at org.jetbrains.kotlin.codegen.optimization.nullCheck.RedundantNullCheckV2MethodTransformer.transform(RedundantNullCheckV2MethodTransformer.kt:37)
    	at org.jetbrains.kotlin.codegen.optimization.OptimizationMethodVisitor.performTransformations(OptimizationMethodVisitor.java:67)
    	at org.jetbrains.kotlin.codegen.TransformationMethodVisitor.visitEnd(TransformationMethodVisitor.java:63)
    	... 64 more
    
    
    :compileInternalKotlin FAILED
    known issue?
    d
    • 2
    • 2
  • k

    kirillrakhman

    07/13/2017, 10:00 AM
    There is the new inspection for combining multiple collection operations. In one case, it offers to combine
    map
    and
    joinToString
    which looks harmless but actually the lambda in
    map
    is inline while in
    joinToString
    it's not. Is this an issue? I understand that the extra lambda allocation is probably compensated by the saved
    List
    allocation but the code size and method count grows a little.
    m
    • 2
    • 2
  • m

    miha-x64

    07/20/2017, 3:38 PM
    I’m getting a very weird and painful exception while trying to execute tests both with eap-11 and eap-33:
    java.lang.IllegalArgumentException: Parameter specified as non-null is null: method kotlin.collections.CollectionsKt__IterablesKt.collectionSizeOrDefault, parameter $receiver
    
    	at kotlin.collections.CollectionsKt__IterablesKt.collectionSizeOrDefault(Iterables.kt)
    	at my.code.SomeClass.method(deserializers.kt:439)
            ...
    click on
    deserializers.kt:439
    ->
    Inline function call site
    shows me
    deserializert.kt:107
    , which is
    someMap.map { (_, value) ->
    . Click on
    Inline function body
    passes me to
    Iterable.map
    function source (which really contains a call to
    collectionSizeOrDefault
    ), but both Cmd+click on
    .map {
    and bytecode show me that
    Map.map
    function should be / was actually inlined, and it does not contain any calls to
    collectionSizeOrDefault
    . 🙀
    m
    • 2
    • 3
  • m

    mikhailov

    08/09/2017, 3:21 PM
    Code highlighting is broken in kotlin js module with 69 eap
    y
    • 2
    • 10
  • j

    jlleitschuh

    08/09/2017, 6:18 PM
    Looking forward to 1.1.4 for JDK 9 support. Its currently blocking the Gradle Kotlin DSL from working under JDK 9.
    y
    • 2
    • 2
  • k

    kirillrakhman

    08/15/2017, 8:00 AM
    @max.kammerer I somehow missed that the 1.1.4 introduced the
    @Parcelize
    feature during the EAP phase and wasn't able to test it properly before release. Did I just miss it or wasn't it communicated?
    o
    • 2
    • 2
  • s

    sdeleuze

    08/15/2017, 8:11 AM
    Great release, could you publish the Gradle plugin as well ? https://plugins.gradle.org/plugin/org.jetbrains.kotlin.jvm
    y
    • 2
    • 1
  • s

    Sorin

    08/17/2017, 12:44 PM
    I started using the
    @Parcelize
    but I constantly get a compiler error:
    error: cannot find symbol CREATOR = null
    , when I remove kapt it seems to work. But I need both in my project.
    e
    • 2
    • 1
  • k

    kirillrakhman

    08/23/2017, 3:10 PM
    will the new inference be in 1.1.5? 😒imple_smile:
    y
    p
    • 3
    • 2
  • n

    nhaarman

    09/07/2017, 7:10 AM
    what happens if we get 10 patch updates
    g
    u
    • 3
    • 3
  • s

    sdeleuze

    09/23/2017, 12:09 PM
    @denis.zharkov@yole Unless I missed something, there is a big regression in
    1.1.50
    null-safety support, see https://youtrack.jetbrains.com/issue/KT-19419#comment=27-2435983
    b
    • 2
    • 2
  • p

    pniederw

    10/29/2017, 7:23 AM
    going forward, can we please have a single eap repo for all versions? it’s really hard to get new repos proxied in a large organization. I’m not ready for another fight to get kotlin-eap-1.2 proxied.
    ➕ 1
    😨 1
    👍 2
    i
    v
    • 3
    • 6
  • r

    ralf

    11/06/2017, 1:22 PM
    Then there’s also another Kapt warning which I can’t resolve
    w: [kapt] Sources output directory is not specified for database_debug, skipping annotation processing
    The project builds fine, though. It’s a problem for us, because we’d like to make Kotlin compiler warnings errors with 1.2.
    a
    • 2
    • 2
  • e

    elect

    11/27/2017, 7:18 AM
    rc-84
    instead
    Could not find org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.0-rc-84.
    Searched in the following locations:
        <https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-gradle-plugin/1.2.0-rc-84/kotlin-gradle-plugin-1.2.0-rc-84.pom>
        <https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-gradle-plugin/1.2.0-rc-84/kotlin-gradle-plugin-1.2.0-rc-84.jar>
        <https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.2.0-rc-84/kotlin-gradle-plugin-1.2.0-rc-84.pom>
        <https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.2.0-rc-84/kotlin-gradle-plugin-1.2.0-rc-84.jar>
        <https://dl.bintray.com/kotlin/kotlin-dev/org/jetbrains/kotlin/kotlin-gradle-plugin/1.2.0-rc-84/kotlin-gradle-plugin-1.2.0-rc-84.pom>
        <https://dl.bintray.com/kotlin/kotlin-dev/org/jetbrains/kotlin/kotlin-gradle-plugin/1.2.0-rc-84/kotlin-gradle-plugin-1.2.0-rc-84.jar>
        <https://oss.sonatype.org/content/repositories/snapshots/org/jetbrains/kotlin/kotlin-gradle-plugin/1.2.0-rc-84/kotlin-gradle-plugin-1.2.0-rc-84.pom>
        <https://oss.sonatype.org/content/repositories/snapshots/org/jetbrains/kotlin/kotlin-gradle-plugin/1.2.0-rc-84/kotlin-gradle-plugin-1.2.0-rc-84.jar>
    Required by:
        project :
    g
    • 2
    • 2
  • o

    oshai

    12/15/2017, 6:47 AM
    Is there a changelog for 1.2.10?
    g
    y
    • 3
    • 6
  • b

    beholder

    12/20/2017, 7:29 PM
    Which IDEA version is required for this plugin?
    v
    • 2
    • 1
  • d

    denis.zharkov

    12/21/2017, 7:29 AM
    NB: To try out the incremental compilation's improvements you need to enable them explicitly by adding
    kotlin.incremental.usePreciseJavaTracking=true
    to your
    gradle.properties
    i
    • 2
    • 2
  • d

    dsavvinov

    02/15/2018, 11:00 AM
    📣 New EAP build
    1.2.30-eap-47
    is available! https://discuss.kotlinlang.org/t/kotlin-1-2-30-eap/6479 📣
    🎉 9
    s
    • 2
    • 1
  • p

    pniederw

    02/19/2018, 7:52 PM
    how close is 1.2.30 final? need to decide whether to wait or roll back.
    y
    • 2
    • 3
  • s

    skennedy

    04/13/2018, 11:30 PM
    running the EAP on my android app, the build is failing with:
    Execution failed for task ':app:transformResourcesWithMergeJavaResForDebugAndroidTest'.
    > More than one file was found with OS independent path 'META-INF/main.kotlin_module'
    It’s working fine with 1.2.31 though, and I’m not really sure how to get enough useful information for a bug report
    i
    s
    • 3
    • 6
  • s

    sdeleuze

    04/25/2018, 9:11 AM
    @yan It seems we have a regression with Kotlin 1.2.40 https://youtrack.jetbrains.com/issue/KT-23973
    y
    • 2
    • 1
  • i

    ilya.chernikov

    05/16/2018, 5:33 PM
    The first EAP of Kotlin 1.2.50 is out, the published version is 1.2.50-eap-17. Is available, as usual, in the “eap 1.2.x” plugin update channels in IDEA and AS, and in the kotlin-eap repo on bintray. The releasne notes could be viewed here: https://github.com/JetBrains/kotlin/releases/tag/v1.2.50-eap-17. Please have a look and report issues to our tracker.
    🎉 1
    a
    d
    h
    • 4
    • 4
  • k

    krtko

    05/31/2018, 5:21 PM
    Hello I am unable to update my Kotlin IDEA plugin to the EAP version
    i
    • 2
    • 4
  • c

    christophsturm

    06/01/2018, 3:18 PM
    the latest eap build does not work at all for me. neither with 2018.1.4 nor with the latest idea eap : https://youtrack.jetbrains.com/issue/KT-24733
    ➕ 1
    • 1
    • 1
  • s

    Slackbot

    06/08/2018, 8:08 AM
    This message was deleted.
    s
    • 2
    • 1
  • u

    udalov

    07/31/2018, 9:58 AM
    The new EAP build of 1.2.60 is available (
    1.2.60-eap-75
    ). This build mostly contains last-minute fixes of problems found in the latest build and is very close to the release, so please check that new versions of plugins and libraries are working correctly in your project. Thanks! What's new: https://github.com/JetBrains/kotlin/releases/tag/v1.2.60-eap-75
    🎉 10
    👍 6
    :kotlin: 5
    l
    g
    • 3
    • 3
  • o

    orangy

    08/15/2018, 4:27 PM
    📣 We’ve published native binaries of Kotlin 1.2.60 compiler (built with Excelsior JET compilers https://www.excelsiorjet.com/) to https://github.com/JetBrains/kotlin/releases/tag/v1.2.60 If you need to use standalone compiler and faster startup to build small files or scripts, that could be useful. No build system integration is planned for now. Please share your experience if you try them.
    🔥 9
    🎉 8
    s
    s
    u
    • 4
    • 4
  • r

    robin

    08/29/2018, 8:48 PM
    Trying out contracts in 1.3-M2 right now. The compiler seems to require that I only call functions that use contracts from functions that are also marked with the
    @ExperimentalContracts
    Annotation, so I have to effectively mark all my functions with that Annotation. Is that intended? From the blog it seems like you should only need that annotation on functions that actually specify a contract, not those that just call functions with contracts.
    o
    d
    • 3
    • 3
  • r

    robin

    08/29/2018, 8:54 PM
    Another question, to try out inline classes, the blog says I need to set the
    -XXLanguage:+InlineClasses
    option. How do I do that if I build via gradle? Is there an equivalent to kotlin.experimental.coroutines "enable"?
    d
    g
    • 3
    • 2
  • j

    Jeff Gulbronson

    08/31/2018, 4:47 PM
    Also playing around with contracts, and I feel like I’m missing something
    @ExperimentalContracts
    fun String?.trueIfNotNullOrEmpty(): Boolean {
      contract {
        returns(true) implies (this@trueIfNotNullOrEmpty != null)
      }
      return !isNullOrEmpty()
    }
    
    @ExperimentalContracts
    fun foo() {
      val maybeNull : String? = "foo"
      val isNotNull = maybeNull.trueIfNotNullOrEmpty()
      if (isNotNull) {
        val definitelyNotNull : String = maybeNull
      }
    }
    Intellij is saying I can’t assign
    maybeNull
    to
    definitelyNotNull
    , because it’s
    String
    vs
    String?
    . My contract seems right, it’s really just the inverse of what
    isNullOrEmpty
    uses. Any idea where I went wrong? Sorry in advance if it’s blindingly obvious.
    d
    • 2
    • 6
Powered by Linen
Title
j

Jeff Gulbronson

08/31/2018, 4:47 PM
Also playing around with contracts, and I feel like I’m missing something
@ExperimentalContracts
fun String?.trueIfNotNullOrEmpty(): Boolean {
  contract {
    returns(true) implies (this@trueIfNotNullOrEmpty != null)
  }
  return !isNullOrEmpty()
}

@ExperimentalContracts
fun foo() {
  val maybeNull : String? = "foo"
  val isNotNull = maybeNull.trueIfNotNullOrEmpty()
  if (isNotNull) {
    val definitelyNotNull : String = maybeNull
  }
}
Intellij is saying I can’t assign
maybeNull
to
definitelyNotNull
, because it’s
String
vs
String?
. My contract seems right, it’s really just the inverse of what
isNullOrEmpty
uses. Any idea where I went wrong? Sorry in advance if it’s blindingly obvious.
d

dsavvinov

08/31/2018, 4:54 PM
Actually that won't work irrelevant of contracts. You can change
maybeNull.trueIfNotNullOrEmpty()
into plain
maybeNull != null
, and you still won't get smartcast. Here's an issue for that: https://youtrack.jetbrains.com/issue/KT-25747
j

Jeff Gulbronson

08/31/2018, 5:01 PM
Ah of course, I forgot that
maybeNull != null
wouldn’t work. Interestingly I changed the contract to
contract {
    returns(true) implies (this@trueIfNotNullOrEmpty is String)
  }
And still no good, though I would’ve expected this one to work. I suppose contracts are new so I’m not 100% sure what should work and what shouldn’t.
d

dsavvinov

08/31/2018, 5:34 PM
Sorry, am I right that you've changed only contract declaration? In such case, that won't work either -- the issue here is local Boolean
isNull
. Compiler has to check that this boolean is initialized to something special, and keep in mind that if
isNull == true
then
maybeNull != null
(or
maybeNull is String
, actual kind of smartcast is irrelevant). We don't do that at the moment (sorry if I got you wrong -- if you've inlined
isNull
variable and still don't get smartcast, then the issue is somewhere else. If you'll show complete code, we can continue digging here :) )
j

Jeff Gulbronson

08/31/2018, 8:01 PM
Ah, very cool! Inlining worked, it was able to smart cast correctly.
Interesting extracting the variable caused it to break, even though everything is a
val
Thank you for the help!
View count: 1