Hi all. First off, this is an awesome library. Nic...
# kotlinx-rpc
x
Hi all. First off, this is an awesome library. Nice work 🙌 Here, I'm trying to get
kotlinx-rpc
working with square's molecule so that I can do something like
Copy code
class TopStoriesService(..) : RPC {
  override suspend fun state(
    initialState: TopStoriesState,
    events: Flow<TopStoriesEvent>,
  ) : Flow<TopStoriesState> = moleculeFlow(RecompositionMode.Immediate) {
    TopStoriesDomain(initialState, events, webService)
  }
}

@Composable
fun TopStoriesDomain(
  initialState: TopStoriesState,
  events: Flow<TopStoriesEvent>,
  webService: NyTimesWebService,
): TopStoriesState { .. }
But unfortunately running into an internal compiler error here (full trace pasted in thread 🧵)
Copy code
Caused by: java.lang.RuntimeException: Exception while generating code for:
FUN name:TopStoriesDomain visibility:public modality:FINAL <> (initialState:io.github.xxfast.nytimes.shared.domains.topStories.TopStoriesState, events:kotlinx.coroutines.flow.Flow<io.github.xxfast.nytimes.shared.domains.topStories.TopStoriesEvent>, webService:io.github.xxfast.nytimes.server.api.NyTimesWebService) returnType:io.github.xxfast.nytimes.shared.domains.topStories.TopStoriesState
Not sure which of the two compiler plugins is causing this issue. 🤔 Does anyone have any clue?
✅ 1
Full stack trace here
ah my dumb dumb forgot to add the compiler plugin 😅 all good
a
Hey! Thank you for your interest in the library! Glad that you solved the problem. If you have any more, feel free to contact me here