koin-annotations icon indicating copy to clipboard operation
koin-annotations copied to clipboard

Generated module code is broken when annotations are ordered in the wrong way

Open janseeger opened this issue 2 years ago • 1 comments
trafficstars

Describe the bug Depending on the order different code is generated, which leads to weird behaviour.

To Reproduce

@Scope
class A

@Scope(A::class)
@Scoped
@KoinViewModel
class B: ViewModel

produces

scope<A> {
  scoped { B }
}

while

@Scope
class A

@KoinViewModel
@Scoped
@Scope(A::class)
class B: ViewModel

will produce

scope<A> {
  viewModel { B }
}

Expected behavior This isn't obvious and should perhaps be documented or fixed that any order results in the same code.

Koin module and version: koin-annotations:1.3.0

janseeger avatar Oct 19 '23 14:10 janseeger

thanks for your feedback

arnaudgiuliani avatar Oct 31 '23 08:10 arnaudgiuliani