evant / kotlin-inject

Dependency injection lib for kotlin
Apache License 2.0
1.14k stars 51 forks source link

Component with an Int literal property name is used as an Int value #371

Closed eygraber closed 2 months ago

eygraber commented 3 months ago

The following code uses the property name as a value:

@Suppress("LocalVariableName")
@Component
abstract class MyComponent(
    `1`: String
)

generates:

public fun KClass<MyComponent>.create(
  `1`: String
): MyComponent = InjectMyComponent(1)

public class InjectMyComponent(
  `1`: String
) : MyComponent(`1`)