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
This commit is contained in:
Vyacheslav Egorov
2018-05-02 17:49:30 +02:00
committed by GitHub
parent 2849bc04ff
commit f6fb982d5c

View File

@@ -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