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
Matcher: extend a Predicate interface #3722
Labels
area-pkg
Used for miscellaneous pkg/ packages not associated with specific area- teams.
type-enhancement
A request for a change that isn't a bug
Comments
Added Area-UnitTest, Triaged labels. |
Set owner to @gramster. |
Removed the owner. |
Added Pkg-Unittest label. |
Removed Area-UnitTest label. |
Love the idea! Removed Type-Defect label. |
Removed Pkg-Unittest label. |
DartBot
added
Type-Enhancement
area-pkg
Used for miscellaneous pkg/ packages not associated with specific area- teams.
labels
May 9, 2014
This issue has been moved to dart-lang/matcher#10. |
kevmoo
added
type-enhancement
A request for a change that isn't a bug
and removed
type-enhancement
labels
Mar 1, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area-pkg
Used for miscellaneous pkg/ packages not associated with specific area- teams.
type-enhancement
A request for a change that isn't a bug
This issue was originally filed by @seaneagan
If we had:
typedef bool Predicate<T>(T item);
interface Matcher<T> extends Predicate<T> {...}
instead of Matcher#matches, thus using "operator call", then the following would work:
collection.some(same(value));
collection.every(isNotNull);
collection.filter(isPositive);
Also, issue #2949 could be solved with:
switch(x) {
match (isNegative) ...
case (0) ...
match (lessThan(5)) ...
// avoid full blown Matcher since don't need mismatch messages
match ((i) => i.isEven()) ...
default ...
}
The text was updated successfully, but these errors were encountered: