Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit d041e5e

Browse files
committed
analysis_options: disallow implicit casts
1 parent ac159de commit d041e5e

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

analysis_options.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
include: package:pedantic/analysis_options.yaml
22
analyzer:
3-
# strong-mode:
4-
# implicit-casts: false
3+
strong-mode:
4+
implicit-casts: false
55
linter:
66
rules:
77
- always_declare_return_types

lib/src/exception.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import 'string_scanner.dart';
88

99
/// An exception thrown by a [StringScanner] that failed to parse a string.
1010
class StringScannerException extends SourceSpanFormatException {
11-
String get source => super.source;
11+
String get source => super.source as String;
1212

1313
/// The URL of the source file being parsed.
1414
///

lib/src/string_scanner.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ class StringScanner {
5858
/// URL of the source of the string being scanned, if available. It can be
5959
/// a [String], a [Uri], or `null`.
6060
StringScanner(this.string, {sourceUrl, int position})
61-
: sourceUrl = sourceUrl is String ? Uri.parse(sourceUrl) : sourceUrl {
61+
: sourceUrl =
62+
sourceUrl is String ? Uri.parse(sourceUrl) : sourceUrl as Uri {
6263
if (position != null) this.position = position;
6364
}
6465

0 commit comments

Comments
 (0)