Find a file
Paul Berry c567790306 Clean up closure return type handling during front end type inference
This CL fixes two minor flaws in the type inference of closure return types:

- inferReturnType needs to call _wrapAsyncOrGenerator prior to
  checking whether the inferred return type is a subtype of the
  context.  This is necessary because for async and generator
  functions, the context type is the "wrapped" type (FutureOr<>,
  Iterable<>, or Stream<>).

- _updateInferredReturnType needs to perform implicit downcasts before
  storing the inferred return type.  This is necessary because if in
  implicit downcast is added, the inferred type that should be stored
  is the type that was downcast to.  In order to make this work, the
  "unwrapping" logic needed to be moved from
  _updateInferredReturnType's two call sites into
  _updateInferredReturnType itself.

These flaws were benign because they were masked by the looseness of
the future flattening operation.  They need to be fixed so that future
flattening can be made more precise.

Change-Id: I2b5ea3f63632638b5fadbce7d52c5d028acda5ab
Reviewed-on: https://dart-review.googlesource.com/34480
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-01-12 22:07:20 +00:00
build [infra] Roll clang toolchain forward 2018-01-10 21:23:39 +00:00
client
docs Adding generic methods to the language specification. 2018-01-11 16:15:58 +00:00
pkg Clean up closure return type handling during front end type inference 2018-01-12 22:07:20 +00:00
runtime [VM runtime] Implement support for _extractTypeArguments in the VM (fixes #31805). 2018-01-12 21:32:20 +00:00
samples [vm/testing] Make --strong -c dartk configuration a Dart 2.0 configuration. 2017-12-12 12:19:10 +00:00
samples-dev Spelling fixes e to i. 2017-06-24 13:41:39 +02:00
sdk Link kernel service dill with the command line dart executable. 2018-01-12 20:40:41 +00:00
tests [VM runtime] Implement support for _extractTypeArguments in the VM (fixes #31805). 2018-01-12 21:32:20 +00:00
third_party [infra] Use Clang for ia32 and arm64. Use the dl'd sysroots by default. 2017-12-02 06:19:33 +00:00
tools Add dart2.bat to accommodate running dart2 tests on Windows 2018-01-11 01:35:17 +00:00
utils Link kernel service dill with the command line dart executable. 2018-01-12 20:40:41 +00:00
.clang-format VM: Re-format to use at most one newline between functions 2017-07-13 08:08:37 -07:00
.gitattributes Migrate the lingering language_strong tests over to language_2. 2017-10-27 23:44:08 +00:00
.gitignore
.gn
.mailmap
.packages Bring dart_style 1.0.9 into the repo and update its dependencies. 2018-01-05 22:36:08 +00:00
AUTHORS
BUILD.gn Link kernel service dill with the command line dart executable. 2018-01-12 20:40:41 +00:00
CHANGELOG.md Fix return type of Base64Codec.decode to say Uint8List. 2018-01-08 13:27:02 +00:00
codereview.settings Update codereview.settings to Gerrit (dart-review.googlesource.com) 2017-09-04 12:52:09 +00:00
DEPS Bump json_rpc_2 version 2018-01-11 21:43:28 +00:00
LICENSE
PATENTS
PRESUBMIT.py [infra] Add and check 'allowed_hosts' in DEPS file 2018-01-08 18:31:24 +00:00
README.dart-sdk
README.md
WATCHLISTS Creates a watchlist for sdk/lib/_http and adds me to it 2018-01-02 18:39:53 +00:00

Dart

Dart is an open-source, scalable programming language, with robust libraries and runtimes, for building web, server, and mobile apps.

Using Dart

Visit the dartlang.org to learn more about the language, tools, getting started, and more.

Browse pub.dartlang.org for more packages and libraries contributed by the community and the Dart team.

Building Dart

If you want to build Dart yourself, here is a guide to getting the source, preparing your machine to build the SDK, and building.

There are more documents on our wiki.

Contributing to Dart

The easiest way to contribute to Dart is to file issues.

You can also contribute patches, as described in Contributing.

License & patents

See LICENSE and PATENTS.