{"action":"created","issue":{"url":"https://api.github.com/repos/dart-lang/collection/issues/6","labels_url":"https://api.github.com/repos/dart-lang/collection/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/dart-lang/collection/issues/6/comments","events_url":"https://api.github.com/repos/dart-lang/collection/issues/6/events","html_url":"https://github.com/dart-lang/collection/issues/6","id":84827487,"number":6,"title":"Add an option (possibly the default?) for DeepCollectionEquality to handle self-referential structures","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/collection/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-06-04T00:02:52Z","updated_at":"2015-06-04T00:02:53Z","closed_at":null,"body":"<a href=\"https://github.com/nex3\"><img src=\"https://avatars.githubusercontent.com/u/188?v=3\" align=\"left\" width=\"96\" height=\"96\" hspace=\"10\"></img></a> **Issue by [nex3](https://github.com/nex3)**\n_Originally opened as https://github.com/dart-lang/sdk/issues/18729_\n\n----\n\nSometimes it's useful to be able to compare nested object structures that can contain self-referential loops. Currently DeepCollectionEquality causes a stack overflow when passed such structures, but it would be nice if it could handle them. This could be done either as a configuration option or as the default if the prospect of storing back-references isn't too worrisome.\n\nCurrently the YAML package has its own custom implementation of deep equality, but it would be nice if it could use the standard implementation instead.\n"},"comment":{"url":"https://api.github.com/repos/dart-lang/collection/issues/comments/108651826","html_url":"https://github.com/dart-lang/collection/issues/6#issuecomment-108651826","issue_url":"https://api.github.com/repos/dart-lang/collection/issues/6","id":108651826,"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-04T00:02:53Z","updated_at":"2015-06-04T00:02:53Z","body":"<a href=\"https://github.com/lrhn\"><img src=\"https://avatars.githubusercontent.com/u/4865287?v=3\" align=\"left\" width=\"48\" height=\"48\" hspace=\"10\"></img></a> **Comment by [lrhn](https://github.com/lrhn)**\n\n----\n\nThat should be doable. For each operand, remember each object it is currently being compared to, and if you see that combination again, return true.\nIt's not fool-proof, but it will catch most simple self-referential structures.\n"}}