diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f01255480f..df16cbc3f5b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -149,6 +149,8 @@ instead. deprecated. - [`@Deprecated.instantiate()`][] indicates the ability to instantiate a class is deprecated. +- The ability to implement the RegExp class and the RegExpMatch class is + deprecated. [#61392]: https://dartbug.com/61392 [`@Deprecated.extend()`]: https://api.dart.dev/dev/latest/dart-core/Deprecated/Deprecated.extend.html diff --git a/sdk/lib/core/regexp.dart b/sdk/lib/core/regexp.dart index 048f6215784..6b10339292b 100644 --- a/sdk/lib/core/regexp.dart +++ b/sdk/lib/core/regexp.dart @@ -213,6 +213,10 @@ part of "dart:core"; /// when the regexp does not find a match. /// Several guides to [improving the performance of regular expressions](https://www.google.com/search?q=performance+of+regular+expressions) /// exist on the internet. Use these as inspirations, too. +@Deprecated.implement( + "This class will become 'final' in a future release. " + "'Pattern' may be a more appropriate interface to implement.", +) abstract interface class RegExp implements Pattern { /// Constructs a regular expression. /// @@ -468,6 +472,10 @@ abstract interface class RegExp implements Pattern { /// // This is the second message. /// } /// ``` +@Deprecated.implement( + "This class will become 'final' in a future release." + "'Match' may be a more appropriate interface to implement.", +) abstract interface class RegExpMatch implements Match { /// The string captured by the named capture group [name]. ///