evant / kotlin-inject

Dependency injection lib for kotlin
Apache License 2.0
1.29k stars 60 forks source link

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

Closed eygraber closed 6 months ago

eygraber commented 7 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`)