Skip to content

Generated Kotlin code triggers compile warnings #207

@larryng

Description

@larryng

This makes using Kotlin code generation mode impossible when allWarningsAsErrors is enabled. See #205. This time it's because the generated method signature doesn't match for binds factory methods.

A few requests to address this:

  1. Fix or suppress the warning in generated code (similar to PR above).
  2. Enable allWarningsAsErrors in Kotlin codegen test suite.
  3. Add a note in https://github.com/uber/motif/wiki#code-generation-mode for Gradle/Kotlin users (looking up how to set this was a bit painful):
    kapt {
        arguments {
            arg("motif.mode", "java")
        }
    }
    

Library version:
0.3.4

Repro steps or stacktrace:
Add a binds factory method:

@Expose
fun foo(fooImpl: FooImpl): Foo

Compile warning:

w: <redacted>: The corresponding parameter in the supertype 'Objects' is named 'fooImpl'. This may cause problems when calling this function with named arguments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions