Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated code for Map fields dont compile #15

Open
danielgomezrico opened this issue Jan 17, 2017 · 1 comment
Open

Generated code for Map fields dont compile #15

danielgomezrico opened this issue Jan 17, 2017 · 1 comment

Comments

@danielgomezrico
Copy link

danielgomezrico commented Jan 17, 2017

Try a class like

class BugReportRepositoryBuilder(val apiKey: String, val projectId: String, val properties: Map<String, String>)

and generate file dont compile:

class BugReportRepositoryBuilder(val apiKey: String,
                                 val projectId: String,
                                 val properties: Map<String, String>)
  : BugReportRepository.Builder, Parcelable {

  companion object {
    @JvmField val CREATOR: Parcelable.Creator<BugReportRepositoryBuilder> = object : Parcelable.Creator<BugReportRepositoryBuilder> {
      override fun createFromParcel(source: Parcel): BugReportRepositoryBuilder = BugReportRepositoryBuilder(source)
      override fun newArray(size: Int): Array<BugReportRepositoryBuilder?> = arrayOfNulls(size)
    }
  }

  constructor(source: Parcel) : this(source.readString(), source.readString(), source.readMap<String, String>())

  override fun describeContents() = 0

  override fun writeToParcel(dest: Parcel?, flags: Int) {
    dest?.writeString(apiKey)
    dest?.writeString(projectId)
    dest?.writeMap<String, String>(properties)
  }
}
@ivamluz
Copy link

ivamluz commented Jun 27, 2017

Facing a similar problem here. Did you manage to solve this, @caipivara?

Thanks in advance for any inputs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants