Skip to content

Commit 6cc3d5a

Browse files
authored
Add generic argument to pubspec private helpers (#1764)
1 parent 932e76e commit 6cc3d5a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/src/pubspec.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -891,15 +891,15 @@ class Pubspec {
891891
/// [description] should be a noun phrase that describes whatever's being
892892
/// parsed or processed by [fn]. [span] should be the location of whatever's
893893
/// being processed within the pubspec.
894-
_wrapFormatException(String description, SourceSpan span, fn()) {
894+
T _wrapFormatException<T>(String description, SourceSpan span, T fn()) {
895895
try {
896896
return fn();
897897
} on FormatException catch (e) {
898898
_error('Invalid $description: ${e.message}', span);
899899
}
900900
}
901901

902-
_wrapSpanFormatException(String description, fn()) {
902+
T _wrapSpanFormatException<T>(String description, T fn()) {
903903
try {
904904
return fn();
905905
} on SourceSpanFormatException catch (e) {

0 commit comments

Comments
 (0)