Our existing implementation prevented dart2js from statically deducing the return value. This fix does not yet result in better tree-shaking due to the following dart2js bugs: https://github.com/dart-lang/sdk/issues/24354 https://github.com/dart-lang/sdk/issues/24355 Closes #4198