Skip to content

0.3.0

Compare
Choose a tag to compare
@passsy passsy released this 03 Jan 17:26
· 456 commits to master since this release

diff v0.2.0...v0.3.0

Summary

This release of Kollection fully covers the project with unit tests, from 52% to 99% 🎉.
By doing that bugs where discovered and fixed.

Because Dart doesn't support non-nullable types yet, this update manually checks all method arguments at runtime.
Passing null in any method will throw ArgumentError unless documented otherwise.

Behavior changes

  • #36 All method arguments are now validated for nullability. If a argument isn't documented as "nullable" the method will throw ArgumentError (when asserts are enabled)
  • #51, #46 KIterable<T>.associateWithTo, Kiterable<T>.filterTo, KIterable<T>.filterIndexedTo, KIterable<T>.filterNotTo, KIterable<T>.filterNotNullTo , KIterable<T>.groupByTo ,KMap<T>.mapKeysTo ,KMap<T>.mapValuesTo, KIterable.toCollection did not compile when called directly due to dart-lang/sdk/issues/35518. The type of destination of those methods has been changed to a dynamic type (i.e. KMutableList<T> -> KMutableList<dynamic>). Those methods will now be checked at runtime. This has one advantage: It allows to pass in contravariant types.
final KIterable<int> iterable = listOf([4, 25, -12, 10]);
final result = mutableListOf<num>(); // covariant!
final filtered = iterable.filterIndexedTo(result, (i, it) => it < 10);
expect(identical(result, filtered), isTrue);
expect(result, listOf([4, -12]));
  • #56 KMutableEntry.setValue now throws UnimplementedError because of bug #55. It anyways never worked.
  • #58 KSet doesn't allow mutation of its elements with via set getter. It is now really immutable.

API changes

Bug fixes

Documentation changes

  • #57 Document hashSetOf and linkedSetOf
  • #19 KIterable.any document return value when called without predicate
  • #51 Document expected type of now dynamically typed KIterable<T>.associateWithTo, Kiterable<T>.filterTo, KIterable<T>.filterIndexedTo, KIterable<T>.filterNotTo, KIterable<T>.filterNotNullTo , KIterable<T>.groupByTo ,KMap<T>.mapKeysTo ,KMap<T>.mapValuesTo, KIterable.toCollection

Other changes