Unverified Commit f6fb982d authored by Vyacheslav Egorov's avatar Vyacheslav Egorov Committed by GitHub

Fix strong mode issue in _PosixUtils._which. (#17192)

ProcessResult.stdout has static type dynamic so for
inference to infer proper type argument for the map
invocation we need to cast stdout to String explicitly.

Fixes #17163
parent 2849bc04
......@@ -91,7 +91,8 @@ class _PosixUtils extends OperatingSystemUtils {
final ProcessResult result = processManager.runSync(command);
if (result.exitCode != 0)
return const <File>[];
return result.stdout.trim().split('\n').map((String path) => fs.file(path.trim())).toList();
final String stdout = result.stdout;
return stdout.trim().split('\n').map((String path) => fs.file(path.trim())).toList();
}
@override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment