{"action":"created","issue":{"url":"https://api.github.com/repos/dart-lang/sdk/issues/21792","labels_url":"https://api.github.com/repos/dart-lang/sdk/issues/21792/labels{/name}","comments_url":"https://api.github.com/repos/dart-lang/sdk/issues/21792/comments","events_url":"https://api.github.com/repos/dart-lang/sdk/issues/21792/events","html_url":"https://github.com/dart-lang/sdk/issues/21792","id":84594396,"number":21792,"title":"pkg/matcher: isEmpty etc should not do any type checks","user":{"login":"DartBot","id":8958862,"avatar_url":"https://avatars.githubusercontent.com/u/8958862?v=3","gravatar_id":"","url":"https://api.github.com/users/DartBot","html_url":"https://github.com/DartBot","followers_url":"https://api.github.com/users/DartBot/followers","following_url":"https://api.github.com/users/DartBot/following{/other_user}","gists_url":"https://api.github.com/users/DartBot/gists{/gist_id}","starred_url":"https://api.github.com/users/DartBot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DartBot/subscriptions","organizations_url":"https://api.github.com/users/DartBot/orgs","repos_url":"https://api.github.com/users/DartBot/repos","events_url":"https://api.github.com/users/DartBot/events{/privacy}","received_events_url":"https://api.github.com/users/DartBot/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dart-lang/sdk/labels/Area-Pkg","name":"Area-Pkg","color":"ededed"},{"url":"https://api.github.com/repos/dart-lang/sdk/labels/Fixed","name":"Fixed","color":"ededed"},{"url":"https://api.github.com/repos/dart-lang/sdk/labels/Pkg-Matcher","name":"Pkg-Matcher","color":"ededed"},{"url":"https://api.github.com/repos/dart-lang/sdk/labels/Priority-Unassigned","name":"Priority-Unassigned","color":"ededed"},{"url":"https://api.github.com/repos/dart-lang/sdk/labels/Type-Defect","name":"Type-Defect","color":"ededed"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2014-12-04T20:00:47Z","updated_at":"2015-06-05T22:59:50Z","closed_at":"2015-06-03T14:30:47Z","body":"*This issue was originally filed by bl...&#064;google.com*\n_____\nThere are custom collections (like ListMultimap in quiver or RigidMap) that implement interfaces which are unknown to matcher. The matchers would be more useful and more easily understandable by removing all type checks from them:\n\nclass \\_Empty extends Matcher {\n&nbsp;&nbsp;const \\_Empty();\n&nbsp;&nbsp;bool matches(item, Map matchState) {\n&nbsp;&nbsp;&nbsp;&nbsp;return item.isEmpty;\n&nbsp;&nbsp;}\n&nbsp;&nbsp;Description describe(Description description) =&gt; description.add('empty');\n}\n\nThis would be also match initial expectations. Obviously, there is a change in semantics (if the object has no isEmpty property, an exception will be thrown), but this is useful:\nThis also fixes the other bug (https://code.google.com/p/dart/issues/detail?id=21562) because isNot(isEmpty) on a null object would also throw an exception and fail the expect call instead of passing.\n\nI'm happy to provide a patch for isEmpty (and isNotEmpty as soon as it is submitted).\n\nThanks,\n&nbsp;Andreas"},"comment":{"url":"https://api.github.com/repos/dart-lang/sdk/issues/comments/109472275","html_url":"https://github.com/dart-lang/sdk/issues/21792#issuecomment-109472275","issue_url":"https://api.github.com/repos/dart-lang/sdk/issues/21792","id":109472275,"user":{"login":"DartBot","id":8958862,"avatar_url":"https://avatars.githubusercontent.com/u/8958862?v=3","gravatar_id":"","url":"https://api.github.com/users/DartBot","html_url":"https://github.com/DartBot","followers_url":"https://api.github.com/users/DartBot/followers","following_url":"https://api.github.com/users/DartBot/following{/other_user}","gists_url":"https://api.github.com/users/DartBot/gists{/gist_id}","starred_url":"https://api.github.com/users/DartBot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DartBot/subscriptions","organizations_url":"https://api.github.com/users/DartBot/orgs","repos_url":"https://api.github.com/users/DartBot/repos","events_url":"https://api.github.com/users/DartBot/events{/privacy}","received_events_url":"https://api.github.com/users/DartBot/received_events","type":"User","site_admin":false},"created_at":"2015-06-05T22:59:50Z","updated_at":"2015-06-05T22:59:50Z","body":"This issue has been moved to dart-lang/matcher#24."}}