orthros / dart-epub

Epub Reader and Writer for Dart
MIT License
218 stars 226 forks source link

Mismatched hashcodes #77

Closed timekone closed 4 years ago

timekone commented 4 years ago

The following code will print true false:


  var reference = new EpubBook();
  reference
    ..Author = "orthros"
    ..AuthorList = ["orthros"]
    ..Chapters = [new EpubChapter()]
    ..Content = new EpubContent()
    ..CoverImage = image.Image(100, 100)
    ..Schema = new EpubSchema()
    ..Title = "A Dissertation on Epubs";

  EpubBook testBook;
    testBook = new EpubBook();
    testBook
      ..Author = "orthros"
      ..AuthorList = ["orthros"]
      ..Chapters = [new EpubChapter()]
      ..Content = new EpubContent()
      ..CoverImage = image.Image(100, 100)
      ..Schema = new EpubSchema()
      ..Title = "A Dissertation on Epubs";

  print(reference == testBook);
  print(reference.hashCode == testBook.hashCode);

This bug is present in numerous classes with List fields.