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
kotlin-native
  • i

    ilya.matveev

    03/23/2018, 5:38 PM
    We are pleased to present the 0.6.2 Kotlin/Native release. The release includes a number of bugfixes and an improvement in the Gradle plugin allowing one to create several
    expectedBy
    -dependencies in one Kotlin/Native project. You can get the release binaries here: https://download.jetbrains.com/kotlin/native/builds/releases/0.6.2/macos/kotlin-native-macos-0.6.2.tar.gz https://download.jetbrains.com/kotlin/native/builds/releases/0.6.2/linux/kotlin-native-linux-0.6.2.tar.gz https://download.jetbrains.com/kotlin/native/builds/releases/0.6.2/windows/kotlin-native-windows-0.6.2.zip GitHub release page: https://github.com/JetBrains/kotlin-native/releases/tag/v0.6.2
    👍 3
    🎉 14
    j
    n
    +2
    6 replies · 5 participants
  • s

    spierce7

    03/23/2018, 9:46 PM
    Any idea when we'll hear more news around the kotlin-native IDE story?
    o
    f
    6 replies · 3 participants
  • m

    molikto

    03/24/2018, 11:28 AM
    have anyone tried Kotlin/Native with Skia? any pointers how to use them together?
    o
    1 reply · 2 participants
  • q

    qlitzler

    03/24/2018, 1:13 PM
    Hello, I’ve successfully used konan to build an ios framework from kotlin code, and noticed this in my Xcode project: If my iOS framework is named
    Something
    and a class inside this framework is named
    Somewhere
    , the class in iOS will be named
    SomethingSomewhere
    IS there anything I can do about it ?
    o
    2 replies · 2 participants
  • q

    qlitzler

    03/24/2018, 1:16 PM
    I believe it comes from the way header definitions are created for C interoperability, and I get why a fully qualified name would be important. But still wondering..
    s
    1 reply · 2 participants
  • f

    ftomassetti

    03/24/2018, 4:54 PM
    Is there any information on calling JS from Kotlin when targeting WASM?
    👍 2
    j
    o
    10 replies · 3 participants
  • a

    Aregev2

    03/24/2018, 7:39 PM
    Can I interop k/n with cpp as well, if so what are the terms for it
    g
    o
    2 replies · 3 participants
  • j

    jo

    03/24/2018, 8:35 PM
    I think my Google-fu is failing me. Is there a way to produce a static library that is NOT a klib? Like if I wanted to produce a .lib file that I could link with another C method, is that possible? Or do I have to use the 'native' method to produce BC and then use clang or something to build the finished DLL?
    o
    1 reply · 2 participants
  • k

    kyonifer

    03/24/2018, 9:20 PM
    i believe so. from the MR it looked like CName only worked on toplevel functions as well
    o
    1 reply · 2 participants
  • j

    jo

    03/24/2018, 9:22 PM
    I've got 0.6.2.
    k
    1 reply · 2 participants
  • a

    Aregev2

    03/24/2018, 9:40 PM
    List.shuffle is not working in k/n?
    g
    o
    3 replies · 3 participants
  • h

    hellotimmutton

    03/26/2018, 4:18 AM
    updated to 0.6.2 and im still getting
    Error:(33, 0) Platform project project ':android' has more than one 'expectedBy' dependency: project ':common', project ':common-frontend'
    g
    i
    12 replies · 3 participants
  • y

    yusuf3000

    03/26/2018, 1:48 PM
    I’ve got an
    expect
    class called Date:
    expect class Date() {
    
        companion object {
            val current: Double
        }
    }
    This is the ios actual:
    package com.careem.adma.booking.framework.Date
    
    import platform.Foundation.*
    
    actual class Date actual constructor () {
        actual companion object {
            actual val current: Double = NSDate.timeIntervalSince1970()
        }
    }
    but i’m getting this error:
    error: unresolved reference. None of the following candidates is applicable because of receiver type mismatch: 
    @ObjCMethod public external fun NSDate.timeIntervalSince1970(): NSTimeInterval /* = Double */ defined in platform.Foundation
            actual val current: Double = NSDate.timeIntervalSince1970()
    s
    o
    16 replies · 3 participants
  • m

    molikto

    03/27/2018, 7:41 AM
    Wouldn't using Kotlin Native to develop desktop GUI be nice? Or in the future all GUI will be in Javascript?
    o
    n
    +1
    6 replies · 4 participants
  • j

    jkbbwr

    03/27/2018, 4:17 PM
    Is there a public roadmap anywhere
    o
    s
    +2
    21 replies · 5 participants
  • s

    sdeleuze

    03/28/2018, 8:56 AM
    Maybe some interesting info to grab from the related docs
    e
    1 reply · 2 participants
  • s

    Sam

    03/28/2018, 1:45 PM
    I have some Kotlin code that is not generating a valid Objective C header file. It seems to be a problem with the way the functions are translated to blocks.
    //Kotlin class taking an array of functions
    class Store (private val repositories: Map<String, Repository<*>>,
                 private val middleware: List<Middleware> = emptyList()){
    
    //The function definitions
    typealias DispatchFunction = (cmd: Command) -> Unit
    typealias Middleware = (dispatch: DispatchFunction, repositories: Map<String, Repository<*>>) -> (DispatchFunction) -> DispatchFunction
    
    //The ObjC header file that is generated
    -(instancetype)initWithRepositories:(NSDictionary<NSString*, id<PistachioRepository>>*)repositories middleware:(NSArray<PistachioStdlibUnit*(^)(id<PistachioCommand>)(^)(PistachioStdlibUnit*(^)(id<PistachioCommand>))(^)(PistachioStdlibUnit*(^)(id<PistachioCommand>), NSDictionary<NSString*, id<PistachioRepository>>*)>*)middleware NS_SWIFT_NAME(init(repositories:middleware:)) NS_DESIGNATED_INITIALIZER;
    The error message is
    Pistachio.h:86:168: Block pointer to non-function type is invalid
    . Admittedly this is not a pretty function header and I'll probably refactor it since it seems to be a little too functional for ObjC. The code with the issue can be found at https://github.com/samus/pistachio/commit/4537d11648563596db6be22a53bb72a38a6be9ee
    s
    2 replies · 2 participants
  • s

    Sam

    03/29/2018, 4:54 AM
    I have a model class called
    Account
    defined in Swift as a subclass of NSObject. I'm trying to pass it into a method of a class in a framework. However to pass that object to some of the foundation classes it needs to be of type NSObject or the compiler will complain. Any cast I've tried has failed at runtime with an exception for me. If I take out the if check it will give a class cast exception
    override fun put(obj: T): UUID {
            if (obj !is ObjCObject) { //Tried NSObject, NSObjectProtocol
                throw IllegalArgumentException("Object: $obj must be a subclass of NSObject.")
            }
            val objc = obj as ObjCObject
            val data = NSKeyedArchiver.archivedDataWithRootObject(objc) // Won't take obj so need to cast.
            ...
        }
    
        //Swift class
        class Account: NSObject {
        let name: String
    
        init(name: String) {
            self.name = name
        }
    }
    s
    o
    10 replies · 3 participants
  • j

    J-Rojas

    03/30/2018, 1:19 PM
    For iOS I have an open Kotlin class that inherits from UIViewController. This class is meant to be the base of my UIViewController hierarchy, adding various properties used for view controller management of subclasses. To my surprise, I ran into this compilation error:
    non-final Kotlin subclasses of Objective-C classes are not yet supported
    If I understand this error correctly, I cannot create my intermediate UIViewController subclass in Kotlin. Will a fix for this be addressed soon? I'm trying to imagine if a workaround is possible.
    s
    3 replies · 2 participants
  • m

    mikehearn

    03/30/2018, 3:01 PM
    there doesn't seem to be any obvious way to do this. i see some interop helpers for objective-c that are coded in c++
    s
    2 replies · 2 participants
  • m

    mikehearn

    03/30/2018, 4:02 PM
    man it's painful to do kotlin without an ide 😞
    o
    2 replies · 2 participants
  • j

    J-Rojas

    03/30/2018, 5:58 PM
    I think I stumbled upon a runtime K/N bug wrt lambdas executed within Kotlin/Native in different threads. I'm messing around with libdispatch and noticed a runtime crash when using
    dispatch_async
    on different queues. Lambdas (blocks) that are born on the Swift side but executed in the Kotlin compiled code work fine. But Lambdas born on the Kotlin side executed in a different thread than they were born in cause a crash. I'll have to create a code sample since it's not straightforward, but it is a common use case.
    1 reply · 1 participant
  • m

    mikehearn

    03/30/2018, 9:12 PM
    there's errno_tVar but I can't see how to extract the actual value from it
    o
    2 replies · 2 participants
  • n

    napperley

    03/31/2018, 1:32 AM
    Trying to use the menu side of ncurses and have run into a seg fault issue that occurs when calling the post_menu function (shows the menu), which expects a menu (type - CPointer<MENU>?) to be passed as a parameter. Had a menu created (via the new_menu function) that was populated from an array of items (type - Array<CPointer<ITEM>?>), which had to be converted via the toCValues function (returns this type - CValuesRef<CPointerVar<ITEM>>?). Are there any CLI tools that can be used for debugging a Kotlin Native program?
    o
    3 replies · 2 participants
  • j

    J-Rojas

    03/31/2018, 3:33 AM
    ☝️Coming back to the multithreading issue... is it true that you cannot access Kotlin native objects from another thread than the owning thread?
    s
    o
    5 replies · 3 participants
  • n

    napperley

    04/01/2018, 6:59 AM
    Is there a way to manually allocate memory for reference types (eg String)? Both the
    alloc
    and
    allocArray
    functions only handle primitive types.
    o
    10 replies · 2 participants
  • j

    jkbbwr

    04/01/2018, 12:08 PM
    How do I specify
    staticLibraries
    in gradle for cinterop
    o
    1 reply · 2 participants
  • a

    Aregev2

    04/01/2018, 2:36 PM
    What version of llvm is used in the compilation process of k/n?
    o
    5 replies · 2 participants
  • j

    jkbbwr

    04/01/2018, 3:19 PM
    #ifndef _SEAHORN__H_
    #define _SEAHORN__H_
    #ifdef __cplusplus
    extern "C" {
    #endif        
    extern void __VERIFIER_error (void);
    extern void __VERIFIER_assume (int);
    #ifdef __cplusplus
    }
    #endif
    
    #define assume __VERIFIER_assume
    #define sassert(X) (void)((X) || (__VERIFIER_error (), 0))
    #endif
    o
    1 reply · 2 participants
  • q

    qlitzler

    04/01/2018, 4:03 PM
    I’m building an iOS framework from kotlin, and generic types are disappearing
    o
    2 replies · 2 participants
Powered by Linen
Title
q

qlitzler

04/01/2018, 4:03 PM
I’m building an iOS framework from kotlin, and generic types are disappearing
o

olonho

04/01/2018, 4:30 PM
currently generic conversion is only supported for collection types
q

qlitzler

04/01/2018, 4:37 PM
Ok, thank you Nikolay !
View count: 2