SDK: Deprecate the ability to implement RegExp and RegExpMatch.

Work towards https://github.com/dart-lang/sdk/issues/55608

Change-Id: Ib686c5a070c54907e9f4d900cd0736ca70a712d0
CoreLibraryReviewExempt: No behavioral change
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/453460
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
This commit is contained in:
Sam Rawlins
2025-10-06 06:29:52 -07:00
committed by Commit Queue
parent 365e578f47
commit 6bc49bb7c3
2 changed files with 10 additions and 0 deletions
+2
View File
@@ -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
+8
View File
@@ -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].
///