Tom Pratt
12/29/2020, 6:03 PMpod("NearbyMessages")
4. Now when I gradle sync I get the following error.
> Task :kotlin-library:cinteropNearbyMessagesIosArm64 FAILED
Exception in thread "main" java.lang.Error: /var/folders/t7/gwvnk41x66g5kmr7s7y8thdw0000gn/T/6648793494349780018.m:1:9: fatal error: module 'NearbyMessages' not found
at org.jetbrains.kotlin.native.interop.indexer.UtilsKt.ensureNoCompileErrors(Utils.kt:152)
at org.jetbrains.kotlin.native.interop.indexer.ModuleSupportKt.getModulesASTFiles(ModuleSupport.kt:68)
at org.jetbrains.kotlin.native.interop.indexer.ModuleSupportKt.getModulesInfo(ModuleSupport.kt:14)
at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.buildNativeLibrary(main.kt:507)
at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.processCLib(main.kt:265)
at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.interop(main.kt:73)
at org.jetbrains.kotlin.cli.utilities.InteropCompilerKt.invokeInterop(InteropCompiler.kt:45)
at org.jetbrains.kotlin.cli.utilities.MainKt.mainImpl(main.kt:19)
at org.jetbrains.kotlin.cli.utilities.MainKt.main(main.kt:41)
Execution failed for task ':kotlin-library:cinteropNearbyMessagesIosArm64'.
> Process 'command '/Applications/Android <http://Studio.app/Contents/jre/jdk/Contents/Home/bin/java|Studio.app/Contents/jre/jdk/Contents/Home/bin/java>'' finished with non-zero exit value 1
I was able to install the cocoapod using a podfile and pod install
. With no KMM involved. I've tried all sorts of random stuff besides but these are the steps that seem like they should work.eygraber
12/30/2020, 3:46 AM// Foo is a library class and out of my control
class Foo
infix fun Foo.togetherWith(first: Any, second: Any) = ...
inline fun fooBuilder(builder: Foo.() -> Unit) {
Foo().apply(builder)
}
fooBuilder {
1 togetherWith 2
}
I know this specifically doesn't work, but is there any way to achieve this behavior?sbeve
12/30/2020, 5:12 AMAnimesh Sahu
12/30/2020, 5:35 AMandylamax
12/30/2020, 6:44 AMEugen Martynov
12/30/2020, 7:43 AMEugen Martynov
12/30/2020, 7:48 AMclass BaseFragment<T: BaseViewModel> {
val viewModel: T = createViewModel()
}
private fun <reified T: BaseViewModel> createViewModel() = T::java.class.newInstance()
This compiles but I have just one function with BaseViewModel class as argument. Is it possible to get many such methods for every class that extends it with more specific view model?Jukka Siivonen
12/30/2020, 8:49 AMziv kesten
12/30/2020, 9:38 AMoverride suspend fun observeWatchedShows(): Flow<List<Show>> {
return watchListDao.observeShows()
//Map flow of list of Watched Shows to flow of list of Show
.map { listOfShows ->
entityMapper.toDomainList(
//Map list of WatchShows to list of ShowEntity
listOfShows.map { watchedShow -> watchedShow.show }
)
}
// Mapping Flow<List<WatchedShow>> -> Flow<List<ShowEntity>> -> Flow<List<Show>>
}
Animesh Sahu
12/30/2020, 11:18 AMÉdgar Sánchez Gordón
12/30/2020, 5:51 PMdf
12/31/2020, 2:05 PMprivate suspend fun upsertAssets(code: String, assets: List<CreateAssetCommand>): List<UpsertAssetResponse> {
return assets.chunked(100)
.map { akeneoClient.upsertAssets(code, it) }
.fold(mutableListOf()) { acc, next -> acc + next }
}
that produces the compile time error Type mismatch: inferred type is List<UpsertAssetResponse> but MutableList<UpsertAssetResponse> was expected
(the fold line). What am I missing?Ch8n
01/03/2021, 6:16 AMTimo Gruen
01/03/2021, 11:14 AMprivate val
variables. class Client(private val delegate: InternalClient)
- The compiler tells me , that i’m not allowed to use InternalClient
as val
because of it’s being exposed public.
But… the private should limit the visibility to other classes so no getter and no setter should be present, and it shouldn’t make any difference from compiler perspective,
since no user is ever allowed to invoke delegate
directly via client
. Or am i missing something here?James Richardson
01/03/2021, 3:34 PMliminal
01/03/2021, 6:32 PMkenkyee
01/04/2021, 2:05 AMzak.taccardi
01/04/2021, 10:05 PMwhen
?Slackbot
01/05/2021, 7:45 AMRachid
01/05/2021, 7:21 PMdata class Response(
val id: Int,
@MyFirstMetadata
val label: LabelResponse
)
The idea that for the field label
we generate some metadata and add this as extra fields in LabelResponse
.
I wonder if there's a way to reach our goal without annotations and reflection. I read about making DSL's in Kotlin, but I couldn't directly find something for our situation. I'm happy to hear your thoughts.Chills
01/06/2021, 9:32 AMfor-loop
https://pastebin.com/K1uQx2mL
sophia.likedPeople.stream().forEach(x->println(x.name))
frogger
01/06/2021, 11:08 AMigor.wojda
01/06/2021, 11:44 AMval
, not var
with nullable type and no custom getter). Do you think we need IDE warning here?
private val requestId: String? = null
Alex
01/06/2021, 1:30 PMregistry.addConverter(
object : Converter<String, IaaSProvider> {
override fun convert(source: String): IaaSProvider = IaaSProvider.fromString(source)
}
)
Converter is a SAM interface, So technically it would be possible to do something like this:
registry.addConverter { source -> IaaSProvider.fromString(source) }
But how would I define generics in this lambda?ribesg
01/06/2021, 5:11 PMspnda
01/07/2021, 10:46 PMwhen {
array.contains(value) -> {
}
}
Emery Tanghanwaye
01/07/2021, 11:32 PMEmery Tanghanwaye
01/07/2021, 11:32 PMTim Malseed
01/08/2021, 1:11 AMstring randomizer
01/08/2021, 11:40 AMstring randomizer
01/08/2021, 11:40 AMVampire
01/08/2021, 12:53 PMstring randomizer
01/11/2021, 9:56 PMVampire
01/11/2021, 9:58 PM