Skip to content

Commit 0a1f8b5

Browse files
authored
Restore a dynamic argument (#673)
Avoid moving a runtime null check to a static null check because some code locations may be passing a nullable reference which is never null.
1 parent c6fc37d commit 0a1f8b5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

source_gen/lib/src/library.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ class LibraryReader {
9898
/// * `asset`
9999
///
100100
/// May throw [ArgumentError] if it is not possible to resolve a path.
101-
Uri pathToUrl(Object toUrlOrString) {
101+
Uri pathToUrl(dynamic toUrlOrString) {
102+
// TODO: https://github.com/dart-lang/source_gen/issues/672 - Take Object
103+
ArgumentError.checkNotNull(toUrlOrString, 'toUrlOrString');
102104
final to = toUrlOrString is Uri
103105
? toUrlOrString
104106
: Uri.parse(toUrlOrString as String);

0 commit comments

Comments
 (0)