From fb29df7fdcf25bfbe4706e898a8c6c39c7cd6ed7 Mon Sep 17 00:00:00 2001 From: Sam Rawlins Date: Mon, 19 Sep 2022 18:26:31 +0000 Subject: [PATCH] Add methods to Set and Map which are needed for Linter Bug: https://github.com/dart-lang/linter/issues/1307 Change-Id: Ia62aa7715509a45eb9fb0feb48c58ffee551db34 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259506 Commit-Queue: Samuel Rawlins Reviewed-by: Phil Quitslund Reviewed-by: Konstantin Shcheglov --- pkg/analyzer/lib/src/test_utilities/mock_sdk.dart | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkg/analyzer/lib/src/test_utilities/mock_sdk.dart b/pkg/analyzer/lib/src/test_utilities/mock_sdk.dart index 924d688e9a75..cea854888410 100644 --- a/pkg/analyzer/lib/src/test_utilities/mock_sdk.dart +++ b/pkg/analyzer/lib/src/test_utilities/mock_sdk.dart @@ -499,8 +499,10 @@ abstract class Map { void addAll(Map other); Map cast(); bool containsKey(Object? key); + bool containsValue(Object? value); void forEach(void action(K key, V value)); V putIfAbsent(K key, V ifAbsent()); + V? remove(Object? key); } class Null extends Object { @@ -595,8 +597,13 @@ abstract class Set implements Iterable { bool add(E value); void addAll(Iterable elements); - bool remove(Object? value); + bool containsAll(Iterable other); + Set difference(Set other); + Set intersection(Set other); E? lookup(Object? object); + bool remove(Object? value); + void removeAll(Iterable elements); + void retainAll(Iterable elements); static Set castFrom(Set source, {Set Function()? newSet}) => throw '';