REggar/auto-value-ignore-hash-equals

error: incompatible types: missing return value

Zhuinden opened this issue ยท 4 comments

abstract class $AutoValue_AgendaKey extends $$AutoValue_AgendaKey {
  $AutoValue_AgendaKey(int tabIndex) {
    super(tabIndex);
  }

  @Override
  public final boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof AgendaKey) {
      AgendaKey that = (AgendaKey) o;
      return; // <-- this is the error
    }
    return false;
  }

  @Override
  public final int hashCode() {
    int h = 1;
    return h;
  }
}

using @IgnoreHashEquals annotation, this is the generated file, and it does not compile. I have only 1 property in this object and it is ignored.

Of course, adding another field like abstract String hax(); and setting it to "" results in compilable code, so the edge case is that all your fields are hashignored.

Thanks for the bug report, I will add a fix today.

Fixed in 1.1.4. Thanks again for the bug report.

Thank you for the quick support! ๐Ÿ˜„