Version 2.1.2-dev.0.0

Merge commit '011a1239fc4c0ed140ddce4773cc791da1936cd4' into dev
diff --git a/.packages b/.packages
index 597ffb9..9d7e756 100644
--- a/.packages
+++ b/.packages
@@ -20,7 +20,6 @@
 boolean_selector:third_party/pkg/boolean_selector/lib
 build_integration:pkg/build_integration/lib
 charcode:third_party/pkg/charcode/lib
-charted:third_party/observatory_pub_packages/packages/charted/lib
 cli_util:third_party/pkg/cli_util/lib
 collection:third_party/pkg/collection/lib
 compiler:pkg/compiler/lib
@@ -36,10 +35,8 @@
 dev_compiler:pkg/dev_compiler/lib
 diagnostic:pkg/diagnostic/lib
 expect:pkg/expect/lib
-file:third_party/pkg/file/packages/file/lib
 fixnum:third_party/pkg/fixnum/lib
 front_end:pkg/front_end/lib
-func:third_party/pkg/func/lib
 gardening:tools/gardening/lib
 glob:third_party/pkg/glob/lib
 html:third_party/pkg/html/lib
@@ -63,22 +60,18 @@
 meta:pkg/meta/lib
 mime:third_party/pkg/mime/lib
 mockito:third_party/pkg/mockito/lib
-mustache4dart:third_party/pkg/mustache4dart/lib
+mustache:third_party/pkg/mustache/lib
 oauth2:third_party/pkg/oauth2/lib
 observatory:runtime/observatory/lib
 package_config:third_party/pkg_tested/package_config/lib
 package_resolver:third_party/pkg_tested/package_resolver/lib
 path:third_party/pkg/path/lib
-petitparser:third_party/pkg/petitparser/lib
-platform:third_party/pkg/platform/lib
 plugin:third_party/pkg/plugin/lib
 pool:third_party/pkg/pool/lib
-process:third_party/pkg/process/lib
 protobuf:third_party/pkg/protobuf/lib
 pub:third_party/pkg/pub/lib
 pub_semver:third_party/pkg/pub_semver/lib
 quiver:third_party/pkg/quiver/lib
-quiver_hashcode:third_party/pkg/quiver_hashcode/lib
 resource:third_party/pkg/resource/lib
 sdk_library_metadata:sdk/lib/_internal/sdk_library_metadata/lib
 shelf:third_party/pkg/shelf/lib
diff --git a/BUILD.gn b/BUILD.gn
index 27a1cf86..ae4c230 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -46,6 +46,7 @@
     "runtime/bin:run_vm_tests",
     "runtime/bin:sample_extension",
     "runtime/bin:test_extension",
+    "runtime/bin:entrypoints_verification_test_extension",
     "runtime/vm:kernel_platform_files($host_toolchain)",
     "utils/kernel-service:kernel-service",
   ]
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9db2340..dc9f141 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,111 @@
+## 2.1.2-dev.0.0
+
+* Merge commit 011a1239fc4c0ed140ddce4773cc791da1936cd4 into dev
+
+## 2.1.1
+
+* Identical to 2.1.1-dev.3.2
+
+## 2.1.1-dev.3.2
+
+* Cherry-pick 9d25cc93e850d4717cdc9e1c4bd3623e09c16d47 to dev
+
+## 2.1.1-dev.3.1
+
+* Cherry-pick 46080dd886a622c5520895d49c97506ecedb1df8 to dev
+* Cherry-pick fc62cf037343248c5ace87629d8eb1063f9f2428 to dev
+* Cherry-pick 770ab5275ac34af62d7c39da8eac8c56fdc48edb to dev
+* Cherry-pick 957e194735bda4fcf06cdcc68fa80f3290b17d79 to dev
+
+## 2.1.1-dev.3.0
+
+* Cherry-pick 3cb16d20e7810a2a378bb897d939f67c0b380d88 to dev
+
+## 2.1.1-dev.2.0
+
+### Core library changes
+
+#### `dart:html`
+
+*   Added methods `Element.removeAttribute`, `Element.removeAttributeNS`,
+    `Element.hasAttribute` and `Element.hasAttributeNS`. (Issue [35655][]).
+*   Improved dart2js compilation of `element.attributes.remove(name)` to
+    generate `element.removeAttribute(name)`, so that there is no performance
+    reason to migrate to the above methods.
+*   Fixed a number of `dart:html` P1 bugs:
+
+    *   Fixed HTML API's with callback typedef to correctly convert Dart
+        function to JS function (Issue [35484]).
+    *   HttpStatus constants exposed in `dart:html` (Issue [34318]).
+    *   Expose DomName `ondblclick` and `dblclickEvent` for Angular analyzer.
+    *   Fixed `removeAll` on `classes`; `elements` parameter should be
+        `Iterable<Object>` to match Set's `removeAll` not `Iterable<E>` (Issue
+        [30278]).
+    *   Fixed a number of methods on DataTransferItem, Entry, FileEntry and
+        DirectoryEntry which previously returned NativeJavaScriptObject.  This
+        fixes handling drag/drop of files/directories (Issue [35510]).
+    *   Added ability to allow local file access from Chrome browser in ddb.
+
+[35655]: https://github.com/dart-lang/sdk/issues/35655
+[30278]: https://github.com/dart-lang/sdk/issues/30278
+[34318]: https://github.com/dart-lang/sdk/issues/34318
+[35484]: https://github.com/dart-lang/sdk/issues/35484
+[35510]: https://github.com/dart-lang/sdk/issues/35510
+
+#### `dart:io`
+
+*   Added ability to get and set low level socket options.
+* **Breaking Change:** Adding to a closed `IOSink` now throws a `StateError`.
+
+[29554]: https://github.com/dart-lang/sdk/issues/29554
+
+### Other library changes
+
+#### `package:kernel`
+
+*   **Breaking change:** The `klass` getter on the `InstanceConstant` class in
+    the Kernel AST API has been renamed to `classNode` for consistency.
+
+*   **Breaking change:** Updated `Link` implementation to utilize true symbolic
+    links instead of junctions on Windows. Existing junctions will continue to
+    work with the new `Link` implementation, but all new links will create
+    symbolic links.
+    
+    To create a symbolic link, Dart must be run with
+    administrative privileges or Developer Mode must be enabled, otherwise a
+    `FileSystemException` will be raised with errno set to
+    `ERROR_PRIVILEGE_NOT_HELD` (Issue [33966]).
+
+[33966]: https://github.com/dart-lang/sdk/issues/33966
+
+### Dart VM
+
+### Tool Changes
+
+#### Analyzer
+
+*   The `DEPRECATED_MEMBER_USE` hint was split into two hints:
+
+    *   `DEPRECATED_MEMBER_USE` reports on usage of `@deprecated` members
+        declared in a different package.
+    *   `DEPRECATED_MEMBER_USE_FROM_SAME_PACKAGE` reports on usage of
+        `@deprecated` members declared in the same package.
+
+### Linter
+
+The linter was bumped to `0.1.79` which introduces the following linter improvements to the SDK:
+
+* `unnecessary_parenthesis` updated to play nicer with cascades
+* new lint: `use_full_hex_values_for_flutter_colors`
+* new lint: `prefer_null_aware_operators`
+* miscellaneous documentation fixes
+* removed deprecated lints from the "all options" sample
+* stopped registering "default lints"
+* `hash_and_equals` fixed to respect `hashCode` fields
+
+
+#### Other Tools
+
 ## 2.1.1-dev.3.2
 
 * Cherry-pick 9d25cc93e850d4717cdc9e1c4bd3623e09c16d47 to dev
@@ -47,7 +155,9 @@
 
 ### Dart VM
 
-In previous releases it was possible to violate static types using dart:mirrors but this bug is fixed now. Meaning that the code below would run without any TypeErrors and print "impossible" output.
+In previous releases it was possible to violate static types using
+`dart:mirrors` but this bug is fixed now. Meaning that the code below would run
+without any TypeErrors and print "impossible" output.
 
 ```dart
 import 'dart:mirrors';
@@ -105,7 +215,7 @@
       Common front-end. On large apps, the fix can cut down 2/3 of the time
       spent on this task.
 
-    * We fixed a bug in how inferred types were miscategorized (#35311). The old
+    * We fixed a bug in how inferred types were miscategorized (Issue [35311]). The old
       behavior was unsound and could produce broken programs. The fix may cause
       more code to be pulled into the main output unit.
 
@@ -137,14 +247,15 @@
       }
       ```
 
-    * Because the new implementation might require you to inspect and fix
-      your app, we exposed two temporary flags:
+  Because the new implementation might require you to inspect and fix
+  your app, we exposed two temporary flags:
 
-        * `--report-invalid-deferred-types`: when provided, we will run
-          both the old and new algorithm and report where the issue was
-          detected.
+    * `--report-invalid-deferred-types`: when provided, we will run both the
+      old and new algorithm and report where the issue was detected.
 
-        * `--new-deferred-split`: enables the new algorithm.
+    * `--new-deferred-split`: enables the new algorithm.
+
+[35311]: https://github.com/dart-lang/sdk/issues/35311
 
 #### dartdoc
 
@@ -2783,7 +2894,7 @@
     people in practice.
 
   * **Breaking:** Support for `barback` versions prior to 0.15.0 (released July
-    2014) has been dropped. Pub will no longer install these older barback
+    1)    has been dropped. Pub will no longer install these older barback
     versions.
 
   * `pub serve` now GZIPs the assets it serves to make load times more similar
diff --git a/DEPS b/DEPS
index ae2451a..6fe9b46 100644
--- a/DEPS
+++ b/DEPS
@@ -36,7 +36,7 @@
   "chromium_git": "https://chromium.googlesource.com",
   "fuchsia_git": "https://fuchsia.googlesource.com",
 
-  "co19_2_rev": "9c03cd19b61a9307db192f174a7e7a1ec6759bb2",
+  "co19_2_rev": "31f7dc1e222910ce64ab57ffee286382b03446a4",
 
   # As Flutter does, we use Fuchsia's GN and Clang toolchain. These revision
   # should be kept up to date with the revisions pulled by the Flutter engine.
@@ -81,13 +81,11 @@
   # For more details, see https://github.com/dart-lang/sdk/issues/30164
   "dart_style_tag": "1.2.2",  # Please see the note above before updating.
 
-  "dartdoc_tag" : "v0.27.0",
-  "file_rev": "515ed1dd48740ab14b625de1be464cb2bca4fefd",  # 5.0.6
+  "dartdoc_tag" : "v0.28.0",
   "fixnum_tag": "0.10.9",
-  "func_rev": "25eec48146a58967d75330075ab376b3838b18a8",
   "glob_tag": "1.1.7",
   "html_tag" : "0.13.3+2",
-  "http_io_rev": "265e90afbffacb7b2988385d4a6aa2f14e970d44",
+  "http_io_rev": "57da05a66f5bf7df3dd7aebe7b7efe0dfc477baa",
   "http_multi_server_tag" : "2.0.5",
   "http_parser_tag" : "3.1.1",
   "http_retry_tag": "0.1.1",
@@ -97,23 +95,22 @@
   "intl_tag": "0.15.7",
   "jinja2_rev": "2222b31554f03e62600cd7e383376a7c187967a1",
   "json_rpc_2_tag": "2.0.9",
-  "linter_tag": "0.1.78",
+  "linter_tag": "0.1.79",
   "logging_tag": "0.11.3+2",
+  "markupsafe_rev": "8f45f5cfa0009d2a70589bcda0349b8cb2b72783",
   "markdown_tag": "2.0.2",
   "matcher_tag": "0.12.3",
   "mime_tag": "0.9.6+2",
   "mockito_tag": "d39ac507483b9891165e422ec98d9fb480037c8b",
-  "mustache4dart_tag" : "v2.1.2",
+  "mustache_tag" : "5e81b12215566dbe2473b2afd01a8a8aedd56ad9",
   "oauth2_tag": "1.2.1",
   "observatory_pub_packages_rev": "0894122173b0f98eb08863a7712e78407d4477bc",
   "package_config_tag": "1.0.5",
   "package_resolver_tag": "1.0.4",
   "path_tag": "1.6.2",
-  "platform_rev": "c368ca95775a4ec8d0b60899ce51299a9fbda399", # 2.2.0
   "plugin_tag": "f5b4b0e32d1406d62daccea030ba6457d14b1c47",
   "ply_rev": "604b32590ffad5cbb82e4afef1d305512d06ae93",
   "pool_tag": "1.3.6",
-  "process_rev": "b8d73f0bad7be5ab5130baf10cd042aae4366d7c", # 3.0.5
   "protobuf_tag": "0.9.0",
   "pub_rev": "9f00679ef47bc79cadc18e143720ade6c06c0100",
   "pub_semver_tag": "1.4.2",
@@ -180,6 +177,10 @@
       "dep_type": "cipd",
   },
 
+  Var("dart_root") + "/third_party/markupsafe":
+      Var("chromium_git") + "/chromium/src/third_party/markupsafe.git" +
+      "@" + Var("markupsafe_rev"),
+
   Var("dart_root") + "/third_party/zlib":
       Var("chromium_git") + "/chromium/src/third_party/zlib.git" +
       "@" + Var("zlib_rev"),
@@ -248,12 +249,8 @@
       Var("dart_git") + "dart2js_info.git" + "@" + Var("dart2js_info_tag"),
   Var("dart_root") + "/third_party/pkg/dartdoc":
       Var("dart_git") + "dartdoc.git" + "@" + Var("dartdoc_tag"),
-  Var("dart_root") + "/third_party/pkg/file":
-      Var("dart_git") + "file.dart.git" + "@" + Var("file_rev"),
   Var("dart_root") + "/third_party/pkg/fixnum":
       Var("dart_git") + "fixnum.git" + "@" + Var("fixnum_tag"),
-  Var("dart_root") + "/third_party/pkg/func":
-      Var("dart_git") + "func.git" + "@" + Var("func_rev"),
   Var("dart_root") + "/third_party/pkg/glob":
       Var("dart_git") + "glob.git" + "@" + Var("glob_tag"),
   Var("dart_root") + "/third_party/pkg/html":
@@ -289,10 +286,10 @@
       Var("dart_git") + "mime.git" + "@" + Var("mime_tag"),
   Var("dart_root") + "/third_party/pkg/mockito":
       Var("dart_git") + "mockito.git" + "@" + Var("mockito_tag"),
-  Var("dart_root") + "/third_party/pkg/mustache4dart":
-      Var("chromium_git")
-      + "/external/github.com/valotas/mustache4dart.git"
-      + "@" + Var("mustache4dart_tag"),
+  Var("dart_root") + "/third_party/pkg/mustache":
+      Var("dart_git")
+      + "external/github.com/xxgreg/mustache"
+      + "@" + Var("mustache_tag"),
   Var("dart_root") + "/third_party/pkg/oauth2":
       Var("dart_git") + "oauth2.git" + "@" + Var("oauth2_tag"),
   Var("dart_root") + "/third_party/observatory_pub_packages":
@@ -306,14 +303,10 @@
       + "@" + Var("package_resolver_tag"),
   Var("dart_root") + "/third_party/pkg/path":
       Var("dart_git") + "path.git" + "@" + Var("path_tag"),
-  Var("dart_root") + "/third_party/pkg/platform":
-      Var("dart_git") + "platform.dart.git" + "@" + Var("platform_rev"),
   Var("dart_root") + "/third_party/pkg/plugin":
       Var("dart_git") + "plugin.git" + "@" + Var("plugin_tag"),
   Var("dart_root") + "/third_party/pkg/pool":
       Var("dart_git") + "pool.git" + "@" + Var("pool_tag"),
-  Var("dart_root") + "/third_party/pkg/process":
-      Var("dart_git") + "process.dart.git" + "@" + Var("process_rev"),
   Var("dart_root") + "/third_party/pkg/protobuf":
       Var("dart_git") + "protobuf.git" + "@" + Var("protobuf_tag"),
   Var("dart_root") + "/third_party/pkg/pub_semver":
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index f7291e8..8bf1471 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -22,6 +22,8 @@
   upstream = input_api.change._upstream
   unformatted_files = []
   for git_file in input_api.AffectedTextFiles():
+    if git_file.LocalPath().startswith("pkg/front_end/testcases/"):
+      continue
     filename = git_file.AbsoluteLocalPath()
     if filename.endswith(extension) and hasFormatErrors(filename=filename):
       old_version_has_errors = False
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index 6edb3b3..0a6a259 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -91,6 +91,11 @@
       ldflags += [ "-Wl,--fatal-warnings" ]
     }
 
+    # Enable mitigations for Cortex-A53 Erratum #843419 bug.
+    if (current_cpu == "arm64" && is_clang) {
+      ldflags += [ "-Wl,--fix-cortex-a53-843419" ]
+    }
+
     # Common options for AddressSanitizer, LeakSanitizer, ThreadSanitizer and
     # MemorySanitizer
     if (using_sanitizer) {
diff --git a/docs/language/dart.sty b/docs/language/dart.sty
index 0776ec0..0ad847e 100644
--- a/docs/language/dart.sty
+++ b/docs/language/dart.sty
@@ -96,7 +96,7 @@
 
 % Auxiliary functions.
 \newcommand{\flatten}[1]{\ensuremath{\mbox{\it flatten}({#1})}}
-\newcommand{\basetype}[1]{\ensuremath{\mbox{\it basetype}({#1})}}
+\newcommand{\futureOrBase}[1]{\ensuremath{\mbox{\it futureOrBase}({#1})}}
 \newcommand{\overrides}[1]{\ensuremath{\mbox{\it overrides}({#1})}}
 \newcommand{\inherited}[1]{\ensuremath{\mbox{\it inherited}({#1})}}
 
@@ -133,6 +133,11 @@
 \newcommand{\IndexCustom}[2]{%
   \leavevmode\marginpar{\ensuremath{\diamond}}\emph{#1}\index{#2}}
 
+% Used when one concept should have >1 entry in the index. Does not add
+% the diamond in the margin and shows no text where the command occurs.
+% Intended to be used immediately after another \Index... command.
+\newcommand{\IndexExtraEntry}[1]{\index{#1}}
+
 % Used for a defining occurrence of a phrase, adding it to the index.
 \newcommand{\Index}[1]{\IndexCustom{#1}{#1}}
 
@@ -184,10 +189,15 @@
   {#1}_1\FunctionTypeExtends{#2}_1,\,\ldots,\ %
   {#1}_{#3}\FunctionTypeExtends{#2}_{#3}}}
 
-% Used to specify non-generic function types: Same syntax as in source.
+% Used to specify simple non-generic function types: Same syntax as in source.
 % Arguments: Return type, formal parameter declarations.
 \newcommand{\FunctionTypeSimple}[2]{\code{\ensuremath{#1}\ \FUNCTION({#2})}}
 
+% Used to specify simple generic function types: Same syntax as in source.
+% Arguments: Return type, formal parameter declarations.
+\newcommand{\FunctionTypeSimpleGeneric}[3]{\code{%
+  \ensuremath{#1}\ \FUNCTION<{#2}>({#3})}}
+
 % Used to specify function types: Same syntax as in source.
 % Arguments: Return type, spacer, type parameter name, bound name,
 %   number of type parameters, formal parameter declarations.
@@ -237,13 +247,13 @@
 %   name of optional parameters, number of optional parameters.
 \newcommand{\FunctionTypeNamed}[9]{%
   \FunctionType{#1}{#2}{#3}{#4}{#5}{%
-    \FunctionTypePositionalArguments{#6}{#7}{#8}{#9}}}
+    \FunctionTypeNamedArguments{#6}{#7}{#8}{#9}}}
 
 % Same as \FunctionType except suitable for inline usage, hence omitting
 % the spacer argument.
 \newcommand{\RawFunctionTypeNamed}[8]{%
   \RawFunctionType{#1}{#2}{#3}{#4}{%
-    \FunctionTypePositionalArguments{#5}{#6}{#7}{#8}}}
+    \FunctionTypeNamedArguments{#5}{#6}{#7}{#8}}}
 
 % Used to specify function types with no optional parameters:
 % Arguments: Return type, spacer, type parameter name, bound name,
diff --git a/docs/language/dartLangSpec.tex b/docs/language/dartLangSpec.tex
index 2202ec5..04bdb83 100644
--- a/docs/language/dartLangSpec.tex
+++ b/docs/language/dartLangSpec.tex
@@ -732,10 +732,10 @@
 A static warning must be reported by a Dart compiler before the associated code is executed.
 
 \LMHash{}%
-When this specification says that a \Index{run-time error} occurs,
+When this specification says that a \Index{dynamic error} occurs,
 it means that a corresponding error object is thrown.
 When it says that a \Index{dynamic type error} occurs,
-it represents a failed run-time type check,
+it represents a failed type check at run time,
 and the object which is thrown implements \code{TypeError}.
 
 \LMHash{}%
@@ -944,6 +944,7 @@
 that has been initialized by means of an initializing formal of a constructor $k$
 is also initialized in the initializer list of $k$ (\ref{initializerLists}).
 
+%% TODO(eernst): Not quite true, because of special lookup for assignment!
 A static final variable $v$ does not induce a setter,
 so unless a setter named \code{$v$=} is in scope
 it is a compile-time error to assign to $v$.
@@ -956,6 +957,7 @@
 but initialization and assignment is not the same thing.
 When the receiver has type \DYNAMIC{}
 such an assignment is not a compile-time error,
+% This error can occur because the receiver is dynamic.
 but if there is no setter it will cause a dynamic error.
 }
 
@@ -1002,8 +1004,9 @@
 }
 
 \LMHash{}%
-It is a dynamic type error if $o$ is not the null object (\ref{null})
-and the dynamic type of $o$ is not
+% This error can occur due to implicit casts, and
+% for instance variables also when a setter is called dynamically.
+It is a dynamic type error if the dynamic type of $o$ is not
 a subtype of the actual type of the variable $v$
 (\ref{actualTypeOfADeclaration}).
 
@@ -1584,8 +1587,10 @@
 
 \LMHash{}%
 In this specification,
-the notation used to denote the type of a function follows
-the syntax of the language, except that \EXTENDS{} is abbreviated to
+the notation used to denote the type of a function,
+that is, a \Index{function type},
+follows the syntax of the language,
+except that \EXTENDS{} is abbreviated to
 \FunctionTypeExtends.
 This means that every function type is of one of the forms
 \FunctionTypePositionalStd{T_0}
@@ -1594,7 +1599,8 @@
 \noindent
 where $T_0$ is the return type,
 $X_j$ are the formal type parameters with bounds $B_j$, $j \in 1 .. s$,
-$T_j$ are the formal parameter types for $j \in 1 .. n + k$.
+$T_j$ are the formal parameter types for $j \in 1 .. n + k$,
+and $x_{n+j}$ are the names of named parameters for $j \in 1 .. k$.
 Non-generic function types are covered by the case $s = 0$,
 where the type parameter declaration list
 \code{<\ldots{}>}
@@ -1664,7 +1670,8 @@
 type parameters \TypeParametersStd,
 required formal parameter types \List{T}{1}{n},
 return type $T_0$,
-and named parameters \PairList{T}{x}{n+1}{n+k}.
+and named parameters \PairList{T}{x}{n+1}{n+k},
+where $x_{n+j}$, $j \in 1 .. k$ may or may not have a default value.
 Then the static type of $F$ is
 \FunctionTypeNamedStd{T_0}.
 
@@ -1684,12 +1691,12 @@
 $u$ is a class that implements the built-in class \FUNCTION{};
 $u$ is a subtype of $t$;
 and $u$ is not a subtype of any function type which is a proper subtype of $t$.
-\commentary{
+\commentary{%
 If we had omitted the last requirement then
 \code{f \IS{} int\,\FUNCTION([int])}
 could evaluate to \TRUE{} with the declaration
 \code{\VOID{} f()\,\{\}},
-e.g., by letting $u$ be \code{Null}.
+which is obviously not the intention.%
 }
 
 \rationale{
@@ -1746,12 +1753,10 @@
 
 \begin{grammar}
 <classDefinition> ::= <metadata> \ABSTRACT{}? \CLASS{} <identifier> <typeParameters>?
-  \gnewline{} <superclass>? <mixins>? <interfaces>?
+  \gnewline{} <superclass>? <interfaces>?
   \gnewline{} `{' (<metadata> <classMemberDefinition>)* `}'
   \alt <metadata> \ABSTRACT{}? \CLASS{} <mixinApplicationClass>
 
-<mixins> ::= \WITH{} <typeNotVoidList>
-
 <typeNotVoidList> ::= <typeNotVoid> (`,' <typeNotVoid>)*
 
 <classMemberDefinition> ::= <declaration> `;'
@@ -1768,10 +1773,10 @@
   \alt <constructorSignature> (<redirection> | <initializers>)?
   \alt \EXTERNAL{} <constantConstructorSignature>
   \alt \EXTERNAL{} <constructorSignature>
-  \alt ((\EXTERNAL{} \STATIC{}?))? <getterSignature>
-  \alt ((\EXTERNAL{} \STATIC{}?))? <setterSignature>
+  \alt (\EXTERNAL{} \STATIC{}?)? <getterSignature>
+  \alt (\EXTERNAL{} \STATIC{}?)? <setterSignature>
   \alt \EXTERNAL{}? <operatorSignature>
-  \alt ((\EXTERNAL{} \STATIC{}?))? <functionSignature>
+  \alt (\EXTERNAL{} \STATIC{}?)? <functionSignature>
   \alt \STATIC{} (\FINAL{} | \CONST{}) <type>? <staticFinalDeclarationList>
   \alt \FINAL{} <type>? <initializedIdentifierList>
   \alt (\STATIC{} | \COVARIANT{})? (\VAR{} | <type>) <initializedIdentifierList>
@@ -1883,15 +1888,12 @@
 (in which case it will be overridden by another \code{noSuchMethod} forwarder).
 }
 
-% making an exception for the setters generated for final fields is tempting but problematic.
-% If a super type defines a setter, it will be overridden yet have no impact on the interface.
-% Maybe the final field hides the setter in scope?
-% I think the original rules were best.
-
 \commentary{
 It is a compile-time error if a class declares two members of the same name,
-either because it declares the same name twice in the same scope (\ref{scoping}),
-or because it declares a static member and an instance member with the same name
+either because it declares the same name twice in the same scope
+(\ref{scoping}),
+or because it declares a static member and an instance member
+with the same name
 (\ref{classMemberConflicts}).
 }
 
@@ -2030,71 +2032,72 @@
 
 \LMHash{}%
 The following names are allowed for user-defined operators:
-\syntax{`<'},
-\syntax{`>'},
-\syntax{`<='},
-\syntax{`>='},
-\syntax{`=='},
-\syntax{`-'},
-\syntax{`+'},
-\syntax{`/'},
-\syntax{`~'},
-\syntax{`*'},
-\syntax{`\%'},
-\syntax{`|'},
-\syntax{`^'},
-\syntax{`\&'},
-\syntax{`\ltlt'},
-\syntax{`\gtgt'},
-\syntax{`\gtgtgt'},
-\syntax{`[]='},
-\syntax{`[]'},
-\syntax{`~'}.
+\lit{<},
+\lit{>},
+\lit{<=},
+\lit{>=},
+\lit{==},
+\lit{-},
+\lit{+},
+\lit{/},
+\lit{\~{}/},
+\lit{*},
+\lit{\%},
+\lit{|},
+\lit{\^},
+\lit{\&},
+\lit{\ltlt},
+\lit{\gtgt},
+\lit{\gtgtgt},
+\lit{[]=},
+\lit{[]},
+\lit{\~{}}.
 
 \LMHash{}%
 It is a compile-time error if the arity of the user-declared operator
-\syntax{`[]='} is not 2.
+\lit{[]=} is not 2.
 It is a compile-time error if the arity of a user-declared operator with one of the names:
-\syntax{`<'},
-\syntax{`>'},
-\syntax{`<='},
-\syntax{`>='},
-\syntax{`=='},
-\syntax{`-'},
-\syntax{`+'},
-\syntax{`~/'},
-\syntax{`/'},
-\syntax{`*'},
-\syntax{`\%'},
-\syntax{`|'},
-\syntax{`^'},
-\syntax{`\&'},
-\syntax{`\ltlt'},
-\syntax{`\gtgt'},
-\syntax{`\gtgtgt'},
-\syntax{`[]'}
+\lit{<},
+\lit{>},
+\lit{<=},
+\lit{>=},
+\lit{==},
+\lit{-},
+\lit{+},
+\lit{\~{}/},
+\lit{/},
+\lit{*},
+\lit{\%},
+\lit{|},
+\lit{\^},
+\lit{\&},
+\lit{\ltlt},
+\lit{\gtgt},
+\lit{\gtgtgt},
+\lit{[]}
 is not 1.
 It is a compile-time error if the arity of the user-declared operator
-\syntax{`-'}
+\lit{-}
 is not 0 or 1.
 
 \commentary{
-The \syntax{`-'} operator is unique
+The \lit{-} operator is unique
 in that two overloaded versions are permitted.
 If the operator has no arguments, it denotes unary minus.
 If it has an argument, it denotes binary subtraction.
 }
 
 \LMHash{}%
-The name of the unary operator \syntax{`-'} is \code{unary-}.
+The name of the unary operator \lit{-} is \code{unary-}.
 
 \rationale{
-This device allows the two methods to be distinguished for purposes of method lookup, override and reflection.
+This device allows the two methods to be distinguished
+for purposes of method lookup, override and reflection.
 }
 
 \LMHash{}%
 It is a compile-time error if the arity of the user-declared operator
-\syntax{`~'}
+\lit{\~{}}
 is not 0.
 
 \LMHash{}%
@@ -2102,25 +2105,26 @@
 
 \LMHash{}%
 It is a static warning if the return type of a user-declared operator
-\syntax{`[]='}
+\lit{[]=}
 is explicitly declared and not \VOID{}.
 
 \commentary{
 If no return type is specified for a user-declared operator
-\syntax{`[]='},
+\lit{[]=},
 its return type is \VOID{} (\ref{typeOfAFunction}).
 }
 
 \rationale{
 The return type is \VOID{} because
 a return statement in an implementation of operator
-\syntax{`[]='}
+\lit{[]=}
 does not return a value.
-Consider a non-throwing evaluation of an expression $e$ of the form \code{$e_1$[$e_2$] = $e_3$},
+Consider a non-throwing evaluation of an expression $e$ of the form
+\code{$e_1$[$e_2$] = $e_3$},
 and assume that the evaluation of $e_3$ yields an instance $o$.
 $e$ will then evaluate to $o$,
 and even if the executed body of operator
-\syntax{`[]='}
+\lit{[]=}
 completes with a value $o'$,
 that is, if $o'$ is returned, that value is simply ignored.
 The rationale for this behavior is that assignments should be guaranteed to evaluate to the assigned value.
@@ -2420,6 +2424,61 @@
 \end{dartCode}
 
 
+\subsubsection{The Operator `=='}
+\LMLabel{theOperatorEqualsEquals}
+
+\LMHash{}%
+The operator \lit{==} is used implicitly in certain situations,
+and in particular constant expressions
+(\ref{constants})
+give rise to constraints on that operator.
+In order to specify these constraints just once we introduce the notion of a
+% Neither \syntax nor \lit works, so we fall back to `\code{==}'.
+\IndexCustom{primitive operator `\code{==}'}{%
+  operator `\code{==}'!primitive}:
+
+\begin{itemize}
+\item Every instance of type \code{int} and \code{String}
+  has a primitive operator \lit{==}.
+\item Every instance of type \code{Symbol}
+  which was originally obtained by evaluation of a literal symbol or
+  a constant invocation of a constructor of the \code{Symbol} class
+  has a primitive operator \lit{==}.
+\item Every instance of type \code{Type}
+  which was originally obtained by evaluating a constant type literal
+  (\ref{dynamicTypeSystem})
+  has a primitive operator \lit{==}.
+\item An instance $o$ has a primitive operator \lit{==}
+  if the dynamic type of $o$ is a class $C$,
+  and $C$ has a primitive operator \lit{==}.
+\item The class \code{Object} has a primitive operator \lit{==}.
+\item A class $C$ has a primitive operator \lit{==}
+  if it does not have an implementation of the operator \lit{==}
+  that overrides the one inherited from \code{Object}.
+  \commentary{%
+  In particular, the following have a primitive operator \lit{==}:
+  The null object (\ref{null}),
+  function objects obtained by function closurization of
+  a static method or a top-level function
+  (\ref{functionClosurization}),
+  instances of type \code{bool}
+  (\ref{booleans}),
+  and instances obtained by evaluation of a list literal
+  (\ref{lists}),
+  a map literal
+  (\ref{maps}), or
+  a set literal
+  (\ref{sets}).
+  }
+\end{itemize}
+
+\LMHash{}%
+When we say that the operator \lit{==} of a given instance or class
+\IndexCustom{is not primitive}{operator `\code{==}'!is not primitive},
+it means that it is not true that said instance or class
+has a primitive operator \lit{==}.
+
+
 \subsection{Getters}
 \LMLabel{getters}
 
@@ -2639,8 +2698,10 @@
 It is a compile-time error if the name of a constructor is not a constructor name.
 
 \LMHash{}%
-The \Index{function type of a constructor} $k$ is the function type whose
-return type is the class that contains the declaration of $k$,
+The
+\IndexCustom{function type of a constructor}{function type!of a constructor}
+$k$ is the function type
+whose return type is the class that contains the declaration of $k$,
 and whose formal parameter types, optionality, and names of named parameters
 correspond to the declaration of $k$.
 
@@ -2711,10 +2772,15 @@
 }
 
 \LMHash{}%
-Initializing formals are executed during the execution of generative constructors detailed below.
-Executing an initializing formal \code{\THIS{}.\id} causes the instance variable \id{} of the immediately surrounding class to be assigned the value of the corresponding actual parameter,
-%% TODO(eernst): This should be a compile-time error -- check, revise if true!
-unless \id{} is a final variable that has already been initialized, in which case a run-time error occurs.
+Initializing formals are executed during
+the execution of generative constructors detailed below.
+Executing an initializing formal \code{\THIS{}.\id}
+causes the instance variable \id{} of the immediately surrounding class
+to be assigned the value of the corresponding actual parameter,
+% This can occur due to a failing implicit cast.
+unless the assigned value has a dynamic type
+which is not a subtype of the declared type of the instance variable \id{},
+in which case a dynamic error occurs.
 
 \commentary{
 The above rule allows initializing formals to be used as optional parameters:
@@ -2822,10 +2888,14 @@
 must be a potentially constant expression (\ref{constantConstructors}).
 
 \LMHash{}%
-It is a dynamic type error if an actual argument passed in an invocation of a redirecting generative constructor $k$
+% This error can occur due to a failed implicit cast.
+It is a dynamic type error if an actual argument passed
+in an invocation of a redirecting generative constructor $k$
 is not a subtype of the actual type (\ref{actualTypeOfADeclaration})
 of the corresponding formal parameter in the declaration of $k$.
-It is a dynamic type error if an actual argument passed to the redirectee $k'$ of a redirecting generative constructor
+% This error can occur due to a failed implicit cast.
+It is a dynamic type error if an actual argument passed
+to the redirectee $k'$ of a redirecting generative constructor
 is not a subtype of the actual type
 (\ref{actualTypeOfADeclaration})
 of the corresponding formal parameter in the declaration of the redirectee.
@@ -2964,9 +3034,10 @@
 Execution then proceeds as follows:
 
 \LMHash{}%
-The instance variable declarations of the immediately enclosing class are visited in the order they appear in the program text.
+The instance variable declarations of the immediately enclosing class
+are visited in the order they appear in the program text.
 For each such declaration $d$, if $d$ has the form
-\code{\syntax{finalConstVarOrType} $v$ = $e$; }
+\code{\synt{finalConstVarOrType} $v$ = $e$; }
 then $e$ is evaluated to an object $o$
 and the instance variable $v$ of $i$ is bound to $o$.
 
@@ -3015,9 +3086,9 @@
 \LMHash{}%
 First, the expression $e$ is evaluated to an object $o$.
 Then, the instance variable $v$ of $i$ is bound to $o$.
-It is a dynamic type error if $o$ is not the null object
-(\ref{null})
-and the dynamic type of $o$ is not a subtype of the actual type
+% This error can occur due to an implicit cast.
+It is a dynamic type error if the dynamic type of $o$ is not
+a subtype of the actual type
 (\ref{actualTypeOfADeclaration})
 of the instance variable $v$.
 
@@ -3080,6 +3151,7 @@
 It is a compile-time error if $M$ is not the name of the immediately enclosing class.
 
 \LMHash{}%
+% This error can occur due to an implicit cast.
 It is a dynamic type error if a factory returns a non-null object
 whose type is not a subtype of its actual
 (\ref{actualTypeOfADeclaration})
@@ -3166,12 +3238,15 @@
 
 \rationale{
 We require a subtype match
-(rather than the more forgiving assignable match which is used with a generative redirecting constructor),
-because a factory redirecting constructor $k$ always invokes its redirectee $k'$
-with exactly the same actual arguments that $k$ received.
+(rather than the more forgiving assignable match
+which is used with a generative redirecting constructor),
+because a factory redirecting constructor $k$ always invokes
+its redirectee $k'$ with
+exactly the same actual arguments that $k$ received.
 This means that a downcast on an actual argument
 ``between'' $k$ and $k'$
-would either be unused because the actual argument has the type required by $k'$,
+would either be unused because the actual argument has
+the type required by $k'$,
 or it would amount to a dynamic error which is simply delayed a single step.
 }
 
@@ -3184,10 +3259,10 @@
 \LMHash{}%
 It is a compile-time error if $k$ explicitly specifies a default value for an optional parameter.
 
-\commentary{
+\rationale{%
 Default values specified in $k$ would be ignored,
 since it is the \emph{actual} parameters that are passed to $k'$.
-Hence, default values are disallowed.
+Hence, default values are disallowed.%
 }
 
 \LMHash{}%
@@ -3233,6 +3308,7 @@
 and $k'$ is the redirectee of $k$.
 
 \LMHash{}%
+% This error can occur due to an implicit cast.
 It is a dynamic type error if an actual argument passed in an invocation of $k$
 is not a subtype of the actual type (\ref{actualTypeOfADeclaration})
 of the corresponding formal parameter in the declaration of $k$.
@@ -3330,7 +3406,7 @@
 \CLASS{} D \{
   \FINAL{} w;
   \CONST{} D.makeList(p): w = \CONST{} [p]; // \comment{compile-time error}
-  \CONST{} D.makeMap(p): w = \CONST{} \{``help'': q\}; // \comment{compile-time error}
+  \CONST{} D.makeMap(p): w = \CONST{} \{"help": q\}; // \comment{compile-time error}
   \CONST{} D.makeC(p): w = \CONST{} C(p, 12); // \comment{compile-time error}
 \}
 \end{dartCode}
@@ -3431,7 +3507,10 @@
 for class \code{Object}.
 
 \begin{grammar}
-<superclass> ::= \EXTENDS{} <typeNotVoid>
+<superclass> ::= \EXTENDS{} <typeNotVoid> <mixins>?
+    \alt <mixins>
+
+<mixins> ::= \WITH{} <typeNotVoidList>
 \end{grammar}
 
 %The superclass clause of a class C is processed within the enclosing scope of the static scope of C.
@@ -3445,7 +3524,7 @@
 \LMHash{}%
 It is a compile-time error if the type in the \EXTENDS{} clause of a class $C$ is
 a type variable (\ref{generics}), a type alias that does not denote a class (\ref{typedef}),
-an enumerated type (\ref{enums}), a malformed type (\ref{staticTypes}),
+an enumerated type (\ref{enums}),
 a deferred type (\ref{staticTypes}), type \DYNAMIC{} (\ref{typeDynamic}),
 or type \code{FutureOr<$T$>} for any $T$ (\ref{typeFutureOr}).
 
@@ -3635,7 +3714,7 @@
 \LMHash{}%
 It is a compile-time error if an element in the type list of the \IMPLEMENTS{} clause of a class $C$ is
 a type variable (\ref{generics}), a type alias that does not denote a class (\ref{typedef}),
-an enumerated type (\ref{enums}), a malformed type (\ref{staticTypes}),
+an enumerated type (\ref{enums}),
 a deferred type (\ref{staticTypes}), type \DYNAMIC{} (\ref{typeDynamic}),
 or type \code{FutureOr<$T$>} for any $T$ (\ref{typeFutureOr}).
 It is a compile-time error if two elements in the type list of the \IMPLEMENTS{} clause of a class $C$ specifies the same type $T$.
@@ -4016,7 +4095,7 @@
 \Case{Methods and setters}
 In this case $M_0$ consists of setter signatures only,
 or method signatures only,
-because the name \id{} in the former case always end in \syntax{`='},
+because the name \id{} in the former case always ends in \lit{=},
 which is never true in the latter case.
 
 \LMHash{}%
@@ -4155,6 +4234,7 @@
 It is a compile-time error
 if the computation of said combined member signature fails.
 
+
 \subsubsection{Correct Member Overrides}
 \LMLabel{correctMemberOverrides}
 
@@ -4218,33 +4298,16 @@
 
 \LMHash{}%
 A mixin describes the difference between a class and its superclass.
-A mixin is always derived from an existing class declaration.
+A mixin is either derived from an existing class declaration
+or introduced by a mixin declaration.
 
 \LMHash{}%
-It is a compile-time error to derive a mixin from a class which explicitly declares a generative constructor.
-It is a compile-time error to derive a mixin from a class which has a superclass other than \code{Object}.
+Mixin application occurs when one or more mixins are mixed into a class declaration via its \WITH{} clause (\ref{mixinApplication}).
+Mixin application may be used to extend a class per section \ref{classes};
+alternatively, a class may be defined as a mixin application as described in the following section.
 
-\rationale{
-This restriction is temporary.
-We expect to remove it in later versions of Dart.
-
-The restriction on constructors simplifies the construction of mixin applications because the process of creating instances is simpler.
-}
-
-
-\subsection{Mixin Application}
-\LMLabel{mixinApplication}
-
-\LMHash{}%
-A mixin may be applied to a superclass, yielding a new class.
-Mixin application occurs when one or more mixins are mixed into a class declaration via its \WITH{} clause.
-The mixin application may be used to extend a class per section \ref{classes};
-alternatively, a class may be defined as a mixin application as described in this section.
-It is a compile-time error if an element in the type list of the \WITH{} clause of a mixin application is
-a type variable (\ref{generics}), a type alias that does not denote a class (\ref{typedef}),
-an enumerated type (\ref{enums}), a malformed type (\ref{staticTypes}),
-a deferred type (\ref{staticTypes}), type \DYNAMIC{} (\ref{typeDynamic}),
-or type \code{FutureOr<$T$>} for any $T$ (\ref{typeFutureOr}).
+\subsection{Mixin Classes}
+\LMLabel{mixinClasses}
 
 \begin{grammar}
 <mixinApplicationClass> ::= \gnewline{}
@@ -4254,26 +4317,207 @@
 \end{grammar}
 
 \LMHash{}%
-A mixin application of the form \code{$S$ \WITH{} $M$;} for the name $N$ defines a class $C$ with superclass $S$ and name $N$.
+It is a compile-time error if an element in the type list of the \WITH{} clause of a mixin application is
+a type variable (\ref{generics}),
+a function type (\ref{functionTypes}),
+a type alias that does not denote a class (\ref{typedef}),
+an enumerated type (\ref{enums}),
+a deferred type (\ref{staticTypes}),
+type \DYNAMIC{} (\ref{typeDynamic}),
+type \VOID{} (\ref{typeVoid}),
+or type \code{FutureOr<$T$>} for any $T$ (\ref{typeFutureOr}).
+If $T$ is a type in a \WITH{} clause, \IndexCustom{the mixin of}{type!mixin of}
+$T$ is either the mixin derived from $T$ if $T$ denotes a class,
+or the mixin introduced by $T$ if $T$ denotes a mixin declaration.
 
 \LMHash{}%
-A mixin application of the form \code{$S$ \WITH{} $M_1,\ \ldots,\ M_k$;} for the name $N$ defines a class $C$ whose superclass is the application of the mixin composition (\ref{mixinComposition}) $M_{k-1} * \ldots * M_1$ to $S$ of a name that is a fresh identifer, and whose name is $N$.
-\rationale{The name of the resulting class is necessary because it is part of the names of the introduced constructors.}
+Let $D$ be a mixin application class declaration of the form
+\begin{normativeDartCode}
+\ABSTRACT? \CLASS{} $N$ = $S$ \WITH{} $M_1$, \ldots{}, $M_n$ \IMPLEMENTS{} $I_1$, \ldots, $I_k$;
+\end{normativeDartCode}
 
 \LMHash{}%
-In both cases above, $C$ declares the same instance members as $M$ (respectively, $M_k$),
-and it does not declare any static members.
-If any of the instance variables of $M$ (respectively, $M_k$) have initializers,
-they are executed in the instance scope of $M$ (respectively, $M_k$)
-to initialize the corresponding instance variables of $C$.
+It is a compile-time error if $S$ is an enumerated type (\ref{enums}).
+It is a compile-time error if any of $M_1, \ldots, M_k$ is an enumerated type (\ref{enums}).
+It is a compile-time error if a well formed mixin cannot be derived from each of $M_1, \ldots, M_k$.
+
+\LMHash{}%
+The effect of $D$ in library $L$ is to introduce the name $N$ into the scope of $L$, bound to the class (\ref{classes}) defined by the clause \code{$S$ \WITH{} $M_1$, \ldots{}, $M_n$} with name $N$, as described below.
+If $k > 0$ then the class also implements $I_1$, \ldots{}, $I_k$.
+If{}f the class declaration is prefixed by the built-in identifier \ABSTRACT{}, the class being defined is made an abstract class.
+
+\LMHash{}%
+A clause of the form \code{$S$ \WITH{} $M_1$, \ldots{}, $M_n$}
+with name $N$ defines a class as follows:
+
+\LMHash{}%
+If there is only one mixin ($n = 1$), then \code{$S$ \WITH{} $M_1$}
+defines the class yielded by the mixin application (\ref{mixinApplication})
+of the mixin of $M_1$ (\ref{mixinDeclaration}) to the class denoted by
+$S$ with name $N$.
+
+\LMHash{}%
+If there is more than one mixin ($n > 1$), then
+let $X$ be the class defined by \code{$S$ \WITH{} $M_1$, \ldots{}, $M_{n-1}$}
+with name $F$, where $F$ is a fresh name, and make $X$ abstract.
+Then \code{$S$ \WITH{} $M_1$, \ldots{}, $M_n$} defines the class yielded
+by the mixin application of the mixin of $M_n$ to the class $X$ with name $N$.
+
+\LMHash{}%
+In either case, let $K$ be a class declaration with the same constructors, superclass, interfaces and instance members as the defined class.
+It is a compile-time error if the declaration of $K$ would cause a compile-time error.
+% TODO(eernst): Not completely!
+% We do not want super-invocations on covariant implementations
+% to be compile-time errors.
+
+\commentary{
+It is an error, for example, if $M$ contains a member declaration $d$ which overrides a member signature $m$ in the interface of $S$, but which is not a correct override of $m$ (\ref{correctMemberOverrides}).
+}
+
+\subsection{Mixin Declaration}
+\LMLabel{mixinDeclaration}
+
+\LMHash{}%
+A mixin defines zero or more \IndexCustom{mixin member declarations}{mixin!member declaration},
+zero or more \IndexCustom{required superinterfaces}{mixin!required superinterface},
+one \IndexCustom{combined superinterface}{mixin!combined superinterface},
+and zero or more \IndexCustom{implemented interfaces}{mixin!implemented interface}.
+
+\LMHash{}%
+The mixin derived from a class declaration:
+\begin{normativeDartCode}
+\ABSTRACT? \CLASS{} $X$ \IMPLEMENTS{} $I_1$, \ldots{}, $I_k$ \{
+  \metavar{members}
+\}
+\end{normativeDartCode}
+has \code{Object} as required superinterface
+and combined superinterface,
+$I_1$, \ldots, $I_k$ as implemented interfaces,
+and the instance members of \metavar{members} as mixin member declarations.
+If $X$ is generic, so is the mixin.
+
+\LMHash{}%
+A mixin declaration introduces a mixin and provides a scope
+for static member declarations.
+
+\begin{grammar}
+<mixinDeclaration> ::= <metadata> \MIXIN{} <identifier> <typeParameters>?
+  \gnewline{} (\ON{} <typeNotVoidList>)? <interfaces>?
+  \gnewline{} `\{' (<metadata> <classMemberDefinition>)* `\}'
+\end{grammar}
+
+\LMHash{}
+It is a compile-time error to declare a constructor in a mixin-declaration.
+
+\LMHash{}
+A mixin declaration with no \code{\ON{}} clause is equivalent
+to one with the clause \code{\ON{} Object}.
+
+\LMHash{}
+Let $M$ be a \MIXIN{} declaration of the form
+\begin{normativeDartCode}
+\MIXIN{} $N$<\TypeParametersStd> \ON{} \List{T}{1}{n} \IMPLEMENTS{} \List{I}{1}{k} \{
+  \metavar{members}
+\}
+\end{normativeDartCode}
+It is a compile-time error if any of the types $T_1$ through $T_n$
+or $I_1$ through $I_k$ is
+a type variable (\ref{generics}),
+a function type (\ref{functionTypes}),
+a type alias not denoting a class (\ref{typedef}),
+an enumerated type (\ref{enums}),
+a deferred type (\ref{staticTypes}),
+type \DYNAMIC{} (\ref{typeDynamic}),
+type \VOID{} (\ref{typeVoid}),
+or type \code{FutureOr<$T$>} for any $T$ (\ref{typeFutureOr}).
+
+\LMHash{}%
+Let $M_S$ be the interface declared by the class declaration
+\begin{normativeDartCode}
+abstract \CLASS{} $M_{super}$<$P_1$, \ldots{}, $P_m$> implements $T_1$, $\dots{}$, $T_n$ \{\}
+\end{normativeDartCode}
+where $M_{super}$ is a fresh name.
+It is a compile-time error for the mixin declaration if the $M_S$
+class declaration would cause a compile-time error,
+\commentary{
+that is, if any member is declared by more than one declared superinterface,
+and there is not a most specific signature for that member among the super
+interfaces}.
+The interface $M_S$ is called the
+\Index{superinvocation interface} of the mixin declaration $M$.
+\commentary{
+If the mixin declaration $M$ has only one declared superinterface, $T_1$,
+then the superinvocation interface $M_{super}$ has exactly the same members
+as the interface $T_1$.}
+
+\LMHash{}
+Let $M_I$ be the interface that would be defined by the class declaration
+\begin{normativeDartCode}
+\ABSTRACT{} \CLASS{} $N$<\TypeParametersStd> \IMPLEMENTS{} \List{T}{1}{n}, \List{I}{1}{k} \{
+  $\metavar{members}'$
+\}
+\end{normativeDartCode}
+where $\metavar{members}'$ are the member declarations of
+the mixin declaration $M$ except that all superinvocations are treated
+as if \SUPER{} was a valid expression with static type $M_S$.
+It is a compile-time error for the mixin $M$ if this $N$ class
+declaration would cause a compile-time error, \commentary{that is, if the
+required superinterfaces, the implemented interfaces and the declarations do not
+define a consistent interface, if any member declaration contains a
+compile-time error other than a super-invocation, or if a super-invocation
+is not valid against the interface $M_S$}.
+The interface introduced by the mixin declaration $M$ has the same member
+signatures and superinterfaces as $M_I$.
+
+\LMHash{}%
+The mixin declaration $M$ introduces a mixin
+with the \NoIndex{required superinterface}s $T_1$, \ldots{}, $T_n$,
+the \NoIndex{combined superinterface} $M_S$,
+\NoIndex{implemented interface}s $I_1$, \ldots{}, $I_k$
+and the instance members declared in $M$ as \Index{mixin member declarations}.
+
+\subsection{Mixin Application}
+\LMLabel{mixinApplication}
+
+\LMHash{}%
+A mixin may be applied to a superclass, yielding a new class.
+
+\LMHash{}%
+Let $S$ be a class,
+$M$ be a mixin with \NoIndex{required superinterface}s $T_1$, \ldots, $T_n$,
+\NoIndex{combined superinterface} $M_S$,
+\NoIndex{implemented interfaces} $I_1$, \ldots{}, $I_k$ and
+\metavar{members} as \NoIndex{mixin member declarations},
+and let $N$ be a name.
+
+\LMHash{}%
+It is a compile-time error to apply $M$ to $S$ if $S$ does not implement,
+directly or indirectly, all of $T_1$, \ldots, $T_n$.
+It is a compile-time error if any of \metavar{members} contains a
+super-invocation of a member $m$ \commentary{(for example \code{super.foo},
+\code{super + 2}, or \code{super[1] = 2})}, and $S$ does not have a concrete
+implementation of $m$ which is a valid override of the member $m$ in
+the interface $M_S$. \rationale{We treat super-invocations in mixins as
+interface invocations on the combined superinterface, so we require the
+superclass of a mixin application to have valid implementations of those
+interface members that are actually super-invoked.}
+
+\LMHash{}%
+The mixin application of $M$ to $S$ with name $N$ introduces a new
+class, $C$, with name $N$, superclass $S$,
+implemented interface $I_1$, \ldots{}, $I_k$
+and \metavar{members} as instance members.
+The class $C$ has no static members.
+If $S$ declares any generative constructors, then the application
+introduces generative constructors on $C$ as follows:
 
 \LMHash{}%
 Let $L_C$ be the library containing the mixin application.
 \commentary{That is, the library containing the clause \code{$S$ \WITH{} $M$}
-or the clause \code{$S_0$ \WITH{} $M_1$, \ldots,\ $M_k$, $M$}.}
+or the clause \code{$S_0$ \WITH{} $M_1$, \ldots,\ $M_k$, $M$} giving rise
+to the mixin application.}
 
-Let $N_C$ be the name of the mixin application class $C$,
-let $S$ be the superclass of $C$, and let $S_N$ be the name of $S$.
+Let $S_N$ be the name of $S$.
 
 For each generative constructor of the form \code{$S_q$($T_{1}$ $a_{1}$, $\ldots$, $T_{k}$ $a_{k}$)} of $S$ that is accessible to $L_C$, $C$ has an implicitly declared constructor of the form
 
@@ -4283,10 +4527,10 @@
 
 \noindent
 where $C_q$ is obtained from $S_q$ by replacing occurrences of $S_N$,
-which denote the superclass, by $N_C$, and $\SUPER_q$ is obtained from $S_q$ by
+which denote the superclass, by $N$, and $\SUPER_q$ is obtained from $S_q$ by
 replacing occurrences of $S_N$ which denote the superclass by \SUPER{}.
-If $S_q$ is a generative const constructor, and $M$ does not declare any
-fields, $C_q$ is also a const constructor.
+If $S_q$ is a generative const constructor, and $C$ does not declare any
+instance variables, $C_q$ is also a const constructor.
 
 \LMHash{}%
 For each generative constructor of the form \code{$S_q$($T_{1}$ $a_{1}$, \ldots , $T_{k}$ $a_{k}$, [$T_{k+1}$ $a_{k+1}$ = $d_1$, \ldots , $T_{k+p}$ $a_{k+p}$ = $d_p$])} of $S$ that is accessible to $L_C$, $C$ has an implicitly declared constructor of the form
@@ -4298,13 +4542,13 @@
 
 \noindent
 where $C_q$ is obtained from $S_q$ by replacing occurrences of $S_N$,
-which denote the superclass, by $N_C$,
+which denote the superclass, by $N$,
 $\SUPER_q$ is obtained from $S_q$ by replacing occurrences of $S_N$
 which denote the superclass by \SUPER{},
 and $d'_i$, $i \in 1..p$, is a constant expression evaluating
 to the same value as $d_i$.
-If $S_q$ is a generative const constructor, and $M$ does not declare any
-fields, $C_q$ is also a const constructor.
+If $S_q$ is a generative const constructor, and $MC$ does not declare any
+instance variables, $C_q$ is also a const constructor.
 
 \LMHash{}%
 For each generative constructor of the form \code{$S_q$($T_{1}$ $a_{1}$, \ldots , $T_{k}$ $a_{k}$, \{$T_{k+1}$ $a_{k+1}$ = $d_1$, \ldots , $T_{k+n}$ $a_{k+n}$ = $d_n$\})} of $S$ that is accessible to $L_C$, $C$ has an implicitly declared constructor of the form
@@ -4316,104 +4560,13 @@
 
 \noindent
 where $C_q$ is obtained from $S_q$ by replacing occurrences of $S_N$
-which denote the superclass by $N_C$,
+which denote the superclass by $N$,
 $\SUPER_q$ is obtained from $S_q$ by replacing occurrences of $S_N$
 which denote the superclass by \SUPER{},
 and $d'_i$, $i \in 1..n$, is a constant expression evaluating to the same value as $d_i$.
 If $S_q$ is a generative const constructor, and $M$ does not declare any
 fields, $C_q$ is also a const constructor.
 
-\LMHash{}%
-If the mixin application class declares interfaces, the resulting class also implements those interfaces.
-
-\LMHash{}%
-It is a compile-time error if $S$ is an enumerated type (\ref{enums}) or a malformed type.
-It is a compile-time error if $M$ (respectively, any of $M_1, \ldots, M_k$) is an enumerated type (\ref{enums}) or a malformed type.
-It is a compile-time error if a well formed mixin cannot be derived from $M$ (respectively, from each of $M_1, \ldots, M_k$).
-
-\commentary{%
-Note that \VOID{} is a reserved word,
-which implies that the same restrictions apply for the type \VOID,
-and similar restrictions are specified for other types like
-\code{Null} (\ref{null}) and
-\code{String} (\ref{strings}).%
-}
-
-\LMHash{}%
-Let $K$ be a class declaration with the same constructors, superclass and interfaces as $C$, and the instance members declared by $M$ (respectively $M_1, \ldots, M_k$).
-It is a compile-time error if the declaration of $K$ would cause a compile-time error.
-
-\commentary{
-If, for example,
-$M$ declares an instance member $im$ whose type is at odds with the type of a member of the same name in $S$,
-this will result in a compile-time error just as if we had defined $K$ by means of an ordinary class declaration extending $S$, with a body that included $im$.
-}
-
-\LMHash{}%
-The effect of a class definition of the form \code{\CLASS{} $C$ = $M$; } or the form \code{\CLASS{} $C<T_1, \ldots,\ T_n>$ = $M$; } in library $L$ is to introduce the name $C$ into the scope of $L$, bound to the class (\ref{classes}) defined by the mixin application $M$ for the name $C$.
-The name of the class is also set to $C$.
-If{}f the class is prefixed by the built-in identifier \ABSTRACT{}, the class being defined is an abstract class.
-
-\LMHash{}%
-Let $M_A$ be a mixin derived from a class $M$ with direct superclass $S_{static}$, e.g., as defined by the class declaration \code{class M extends S$_{static}$ \{ \ldots \}}.
-
-\LMHash{}%
-Let $A$ be an application of $M_A$.
-It is a compile-time error if the superclass of $A$ is not a subtype of $S_{static}$.
-
-\LMHash{}%
-Let $C$ be a class declaration that includes $M_A$ in a with clause.
-It is a compile-time error if $C$ does not implement, directly or indirectly, all the direct superinterfaces of $M$.
-
-
-\subsection{Mixin Composition}
-\LMLabel{mixinComposition}
-
-\rationale{
-Dart does not directly support mixin composition, but the concept is useful when defining how the superclass of a class with a mixin clause is created.
-}
-
-\LMHash{}%
-The \Index{composition of two mixins},
-\code{$M_1$<$T_1, \ldots, T_{k_{M_1}}$>} and
-\code{$M_2$<$U_1, \ldots, U_{k_{M_2}}$>}, written
-\code{$M_1$<$T_1, \ldots, T_{k_{M_1}}$>$ * M_2$<$U_1, \ldots, U_{k_{M_2}}$>}
-defines an anonymous mixin such that for any class
-\code{$S$<$V_1, \ldots, V_{k_S}$>},
-the application of
-
-\code{$M_1$<$T_1, \ldots, T_{k_{M_1}}$> $*$ $M_2$<$U_1, \ldots, U_{k_{M_2}}$>}
-
-to \code{$S$<$V_1, \ldots, V_{k_S}$>} for the name $C$ is equivalent to
-
-\begin{normativeDartCode}
-\ABSTRACT{} \CLASS{} $C<T_1, \ldots, T_{k_{M_1}}, U_1, \ldots, U_{k_{M_2}}, V_1, \ldots, V_{k_S}> = $
-      $Id_2<U_1, \ldots, U_{k_{M_2}}, V_1 \ldots V_{k_S}>$ \WITH{} $M_1 <T_1, \ldots, T_{k_{M_1}}>$;
-\end{normativeDartCode}
-
-where $Id_2$ denotes
-
-\begin{normativeDartCode}
-\ABSTRACT{} \CLASS{} $Id_2<U_1, \ldots, U_{k_{M_2}}, V_1, \ldots, V_{k_S}> =$
-                         $S<V_1, \ldots, V_{k_S}>$ \WITH{} $M_2<U_1, \ldots, U_{k_{M_2}}>$;
-\end{normativeDartCode}
-
-and $Id_2$ is a unique identifier that does not exist anywhere in the program.
-
-\rationale{
-The intermediate classes produced by mixin composition are regarded as abstract because they cannot be instantiated independently.
-They are only introduced as anonymous superclasses of ordinary class declarations and mixin applications.
-Consequently, no errors are raised if a mixin composition includes abstract members, or incompletely implements an interface.
-}
-
-\LMHash{}%
-Mixin composition is associative.
-
-\commentary{
-Note that any subset of $M_1$, $M_2$ and $S$ may or may not be generic.
-For any non-generic declaration, the corresponding type parameters may be elided, and if no type parameters remain in the derived declarations $C$ and/or $Id_2$ then the those declarations need not be generic either.
-}
-
 
 \section{Enums}
 \LMLabel{enums}
@@ -4513,7 +4666,7 @@
 $T$ is a type,
 and \code{$S$?} is a type or the empty string.
 Let $S'$ be \code{$S$?} if it is a type, otherwise let $S'$ be \DYNAMIC.
-The associated function type of $D$, call it $F$, is, respectively:
+The associated type of $D$, call it $F$, is, respectively:
 
 \begin{itemize}
 \item $T$
@@ -4554,7 +4707,7 @@
 $[T_1/X_1, \ldots, T_s/X_s]F$.
 
 \commentary{%
-Note that the type alias syntax without \syntax{`='}
+Note that the type alias syntax without \lit{=}
 can only express function types,
 and it cannot express the type of a generic function.
 When such a type alias is generic,
@@ -4643,10 +4796,14 @@
 \LMHash{}%
 Type parameters are declared in the type parameter scope of a class or function.
 The type parameters of a generic $G$ are in scope in the bounds of all of the type parameters of $G$.
-The type parameters of a generic class declaration $G$ are also in scope in the \EXTENDS{} and \IMPLEMENTS{} clauses of $G$ (if these exist) and in the body of $G$.
-However, a type parameter of a generic class is considered to be a malformed type when referenced by a static member.
+The type parameters of a generic class declaration $G$ are also in scope in
+the \EXTENDS{} and \IMPLEMENTS{} clauses of $G$ (if these exist) and in the body of $G$.
 
-\commentary{
+\commentary{%
+However, a type parameter of a generic class
+is considered to be a malformed type
+when referenced by a static member
+(\ref{staticTypes}).
 The scopes associated with the type parameters of a generic function are described in (\ref{formalParameters}).
 }
 
@@ -5353,6 +5510,7 @@
 etc.
 }
 
+
 \subsubsection{The Instantiation to Bound Algorithm}
 \LMLabel{theInstantiationToBoundAlgorithm}
 
@@ -5811,7 +5969,7 @@
 \item $e_1$ evaluates to \FALSE{} and $e_2$ is a constant expression that evaluates to a value of type \code{bool}.
 \end{enumerate}
 
-\item An expression of the form \code{~$e_1$} is a potentially constant expression if $e_1$ is a potentially constant expression. It is further a constant expression if $e_1$ is a constant expression that evaluates to a value of type \code{int}.
+\item An expression of the form \code{\~{}$e_1$} is a potentially constant expression if $e_1$ is a potentially constant expression. It is further a constant expression if $e_1$ is a constant expression that evaluates to a value of type \code{int}.
 
 \item An expression of one of the forms \code{$e_1$\,\&\,$e_2$}, \code{$e_1$\,|\,$e_2$}, or \code{$e_1$\,\^\,$e_2$} is potentially constant if $e_1$ and $e_2$ are both potentially constant expressions. It is further constant if both $e_1$ and $e_2$ are constant expressions that both evaluate to values that are both instances of \code{int}, or that are both instances of \code{bool}.
 % The bool case is new in 2.1.
@@ -5858,17 +6016,28 @@
 
 \LMHash{}%
 % New in 2.1.
-A constant type expression is one of:
+A
+\Index{constant type expression}
+is one of:
 \begin{itemize}
-\item An simple or qualified identifier denoting a type declaration (a type alias, class or mixin declaration) that is not qualified by a deferred prefix,
-optionally followed by type arguments of the form
-\code{<$T_1$,\ \ldots,\ $T_n$>}
-where $T_1$, \ldots{}, $T_n$ are constant type expressions.
-\item A type of the form \code{FutureOr<$T$>} where $T$ is a constant type expression.
-\item A function type
-\code{$R$ Function<\metavar{typeParameters}>(\metavar{argumentTypes})}
-(where $R$ and \code{<\metavar{typeParameters}>} may be omitted)
-and where $R$, \metavar{typeParameters} and \metavar{argumentTypes} (if present) contain only constant type expressions.
+\item An simple or qualified identifier
+  denoting a type declaration (a type alias, class or mixin declaration)
+  that is not qualified by a deferred prefix,
+  optionally followed by type arguments of the form
+  \code{<$T_1$,\ \ldots,\ $T_n$>}
+  where $T_1$, \ldots{}, $T_n$ are constant type expressions.
+\item A type of the form \code{FutureOr<$T$>}
+  where $T$ is a constant type expression.
+\item
+  %% TODO(eernst): This does not allow for type variables introduced by
+  %% the type itself. `Function<X>(X)` could be a constant type expression,
+  %% but that is not covered by the current rules: `X` is a type variable,
+  %% and they are never allowed.
+  A function type
+  \code{$R$ Function<\metavar{typeParameters}>(\metavar{argumentTypes})}
+  (where $R$ and \code{<\metavar{typeParameters}>} may be omitted)
+  and where $R$, \metavar{typeParameters} and \metavar{argumentTypes}
+  (if present) contain only constant type expressions.
 \item The type \VOID{}.
 \item The type \DYNAMIC{}.
 \end{itemize}
@@ -5992,11 +6161,13 @@
 
 \LMHash{}%
 The null object is the sole instance of the built-in class \code{Null}.
-Attempting to instantiate \code{Null} causes a run-time error.
+% The following can be a consequence of the declaration of `Null`,
+% but we don't spell that out, we just require that it is an error.
+Attempting to instantiate \code{Null} causes a compile-time error.
 It is a compile-time error for a class to extend, mix in or implement \code{Null}.
 The \code{Null} class extends the \code{Object} class and declares no methods except those also declared by \code{Object}.
-\commentary{As such, it does not override the \code{==} operator inherited
-from the \code{Object} class.}
+In particular, the \code{Null} class does not override the \lit{==} operator
+inherited from the \code{Object} class.
 
 \LMHash{}%
 The static type of \NULL{} is the \code{Null} type.
@@ -6111,7 +6282,8 @@
 It is a compile-time error for any class other than \code{int} and \code{double} to extend, mix in or implement \code{num}.
 
 \LMHash{}%
-The instances of \code{int} and \code{double} all override the \code{==} operator inherited from the \code{Object} class.
+The instances of \code{int} and \code{double} all override the \lit{==} operator inherited from the \code{Object} class.
+
 
 \subsection{Booleans}
 \LMLabel{booleans}
@@ -6132,10 +6304,11 @@
 Both \NoIndex{true} and \NoIndex{false} are instances of
 the built-in class \code{bool},
 and there are no other objects that implement \code{bool}.
-It is a compile-time error for a class to extend, mix in or implement \code{bool}.
+It is a compile-time error for a class to
+extend, mix in or implement \code{bool}.
 
 \LMHash{}%
-The \code{bool} class does not override the \code{==} operator inherited from
+The \code{bool} class does not override the \lit{==} operator inherited from
 the \code{Object} class.
 
 \LMHash{}%
@@ -6251,8 +6424,15 @@
 \end{grammar}
 
 \LMHash{}%
-Multiline strings are delimited by either matching triples of single quotes or matching triples of double quotes.
-If the first line of a multiline string consists solely of the whitespace characters defined by the production \synt{WHITESPACE} (\ref{lexicalRules}), possibly prefixed by \syntax{`\\'}, then that line is ignored, including the line break at its end.
+Multiline strings are delimited by either
+matching triples of single quotes or
+matching triples of double quotes.
+If the first line of a multiline string consists solely of
+the whitespace characters defined by the production \synt{WHITESPACE}
+(\ref{lexicalRules}),
+possibly prefixed by \syntax{`\\'},
+then that line is ignored,
+including the line break at its end.
 
 \rationale{
 The idea is to ignore a whitespace-only first line of a multiline string, where whitespace is defined as tabs, spaces and the final line break.
@@ -6267,42 +6447,60 @@
 Strings support escape sequences for special characters.
 The escapes are:
 \begin{itemize}
-\item \syntax{`\\n'} for newline, equivalent to \syntax{`\\x0A'}.
-\item \syntax{`\\r'} for carriage return, equivalent to \syntax{`\\x0D'}.
-\item \syntax{`\\f'} for form feed, equivalent to \syntax{`\\x0C'}.
-\item \syntax{`\\b'} for backspace, equivalent to \syntax{`\\x08'}.
-\item \syntax{`\\t'} for tab, equivalent to \syntax{`\\x09'}.
-\item \syntax{`\\v'} for vertical tab, equivalent to \syntax{`\\x0B'}.
-\item \syntax{`\\x' <HEX\_DIGIT>$_1$ <HEX\_DIGIT>$_2$}, equivalent to
+\item
+  \syntax{`\\n'} for newline, equivalent to \syntax{`\\x0A'}.
+\item
+  \syntax{`\\r'} for carriage return, equivalent to \syntax{`\\x0D'}.
+\item
+  \syntax{`\\f'} for form feed, equivalent to \syntax{`\\x0C'}.
+\item
+  \syntax{`\\b'} for backspace, equivalent to \syntax{`\\x08'}.
+\item
+  \syntax{`\\t'} for tab, equivalent to \syntax{`\\x09'}.
+\item
+  \syntax{`\\v'} for vertical tab, equivalent to \syntax{`\\x0B'}.
+\item
+  \syntax{`\\x' <HEX\_DIGIT>$_1$ <HEX\_DIGIT>$_2$}, equivalent to
 
-\syntax{`\\u{' <HEX\_DIGIT>$_1$ <HEX\_DIGIT>$_2$ `}'}.
-\item \syntax{`\\u' <HEX\_DIGIT>$_1$ <HEX\_DIGIT>$_2$ <HEX\_DIGIT>$_3$ <HEX\_DIGIT>$_4$},
-equivalent to
+  \syntax{`\\u{' <HEX\_DIGIT>$_1$ <HEX\_DIGIT>$_2$ `}'}.
+\item
+  \syntax{`\\u' <HEX\_DIGIT>$_1$ <HEX\_DIGIT>$_2$ <HEX\_DIGIT>$_3$ <HEX\_DIGIT>$_4$},
+  equivalent to
 
-\noindent
-\syntax{`\\u{' <HEX\_DIGIT>$_1$ <HEX\_DIGIT>$_2$ <HEX\_DIGIT>$_3$ <HEX\_DIGIT>$_4$ `}'}.
-\item \syntax{`\\u{' <HEX\_DIGIT\_SEQUENCE> `}'} is the Unicode code point represented by the
-\syntax{<HEX\_DIGIT\_SEQUENCE>}.
-It is a compile-time error if the value of the
-\syntax{<HEX\_DIGIT\_SEQUENCE>}
-is not a valid Unicode code point.
-\item \syntax{`$'} indicating the beginning of an interpolated expression.
-\item Otherwise, \syntax{`\\'$k$} indicates the character $k$ for any $k$ not in
-\syntax{$\{$`n', `r', `f', `b', `t', `v', `x', `u'$\}$}.
+  \noindent
+  \syntax{`\\u{' <HEX\_DIGIT>$_1$ <HEX\_DIGIT>$_2$ <HEX\_DIGIT>$_3$ <HEX\_DIGIT>$_4$ `}'}.
+\item
+  \syntax{`\\u{' <HEX\_DIGIT\_SEQUENCE> `}'} is
+  the Unicode code point represented by the
+  \syntax{<HEX\_DIGIT\_SEQUENCE>}.
+  It is a compile-time error if the value of the
+  \syntax{<HEX\_DIGIT\_SEQUENCE>}
+  is not a valid Unicode code point.
+\item
+  \lit{\$} indicating the beginning of an interpolated expression.
+\item
+  Otherwise, \syntax{`\\$k$'} indicates the character $k$ for
+  any $k$ not in \syntax{$\{$`n', `r', `f', `b', `t', `v', `x', `u'$\}$}.
 \end{itemize}
 
 \LMHash{}%
-Any string may be prefixed with the character \syntax{`r'},
+Any string may be prefixed with the character \lit{r},
 indicating that it is a \Index{raw string},
 in which case no escapes or interpolations are recognized.
 
 \LMHash{}%
-Line breaks in a multiline string are represented by the \syntax{<NEWLINE>} production.
+Line breaks in a multiline string are represented by
+the \syntax{<NEWLINE>} production.
 A line break introduces a single newline character into the string value.
 
 \LMHash{}%
-It is a compile-time error if a non-raw string literal contains a character sequence of the form \syntax{`\\x'} that is not followed by a sequence of two hexadecimal digits.
-It is a compile-time error if a non-raw string literal contains a character sequence of the form \syntax{`\\u'} that is not followed by either a sequence of four hexadecimal digits, or by curly brace delimited sequence of hexadecimal digits.
+It is a compile-time error if a non-raw string literal contains
+a character sequence of the form \syntax{`\\x'} that is not followed by
+a sequence of two hexadecimal digits.
+It is a compile-time error if a non-raw string literal contains
+a character sequence of the form \syntax{`\\u'} that is not followed by
+either a sequence of four hexadecimal digits,
+or by curly brace delimited sequence of hexadecimal digits.
 
 \begin{grammar}
 <stringContentDQ> ::= \~{}( `\\' | `"' | `$' | <NEWLINE> )
@@ -6328,8 +6526,9 @@
 
 \LMHash{}%
 All string literals evaluate to instances of the built-in class \code{String}.
-It is a compile-time error for a class to extend, mix in or implement \code{String}.
-The \code{String} class overrides the \code{==} operator inherited from
+It is a compile-time error for a class to
+extend, mix in or implement \code{String}.
+The \code{String} class overrides the \lit{==} operator inherited from
 the \code{Object} class.
 The static type of a string literal is \code{String}.
 
@@ -6338,7 +6537,10 @@
 \LMLabel{stringInterpolation}
 
 \LMHash{}%
-It is possible to embed expressions within non-raw string literals, such that these expressions are evaluated, and the resulting values are converted into strings and concatenated with the enclosing string.
+It is possible to embed expressions within non-raw string literals,
+such that these expressions are evaluated,
+and the resulting values are converted into strings and
+concatenated with the enclosing string.
 This process is known as \Index{string interpolation}.
 
 \begin{grammar}
@@ -6347,14 +6549,17 @@
 \end{grammar}
 
 \commentary{
-The reader will note that the expression inside the interpolation could itself include strings, which could again be interpolated recursively.
+The reader will note that the expression inside the interpolation
+could itself include strings,
+which could again be interpolated recursively.
 }
 
 \LMHash{}%
-An unescaped \syntax{`$'} character in a string signifies the beginning of an interpolated expression.
-The \syntax{`$'} sign may be followed by either:
+An unescaped \lit{\$} character in a string signifies
+the beginning of an interpolated expression.
+The \lit{\$} sign may be followed by either:
 \begin{itemize}
-\item A single identifier \id{} that must not contain the \syntax{`$'} character.
+\item A single identifier \id{} that does not contain the \lit{\$} character.
 \item An expression $e$ delimited by curly braces.
 \end{itemize}
 
@@ -6386,13 +6591,13 @@
 
 \LMHash{}%
 A symbol literal \code{\#\id} where \id{} is an identifier
-that does not begin with an underscore ('\code{\_}'),
+that does not begin with an underscore (`\code{\_}'),
 evaluates to an instance of \code{Symbol} representing the identifier \id.
 All occurrences of \code{\#\id} evaluate to the same instance
 \commentary{(symbol instances are canonicalized)},
 and no other symbol literals evaluate to that \code{Symbol} instance
 or to a \code{Symbol} instance that is equal
-(according to the \code{==} operator \ref{equality}) to that instance.
+(according to the \lit{==} operator \ref{equality}) to that instance.
 
 \LMHash{}%
 A symbol literal \code{\#$\id.\id_2\ldots\id_n$}
@@ -6401,7 +6606,7 @@
 All occurrences of \code{\#$\id.\id_2\ldots\id_n$} with the same sequence of identifiers
 evaluate to the same instance,
 and no other symbol literals evaluate to that \code{Symbol} instance
-or to a \code{Symbol} instance that is \code{==} to that instance.
+or to a \code{Symbol} instance that is \lit{==} to that instance.
 \commentary{This kind of symbol literal denotes the name of a library declaration. Library names are not subject to library privacy, even
 if some of its identifiers begin with an underscore.}
 
@@ -6410,18 +6615,18 @@
 representing that particular operator name.
 All occurrences of \code{\#\metavar{operator}} evaluate to the same instance,
 and no other symbol literals evaluate to that \code{Symbol} instance
-or to a \code{Symbol} instance that is \code{==} to that instance.
+or to a \code{Symbol} instance that is \lit{==} to that instance.
 
 \LMHash{}%
 A symbol literal \code{\#\_\id}, evaluates to an instance of \code{Symbol}
 representing the private identifier \code{\_\id} of the containing library.
 All occurrences of \code{\#\_\id} \emph{in the same library} evaluate to the same instance,
 and no other symbol literals evaluate to that \code{Symbol} instance
-or to a \code{Symbol} instance that is \code{==} to that instance.
+or to a \code{Symbol} instance that is \lit{==} to that instance.
 
 \LMHash{}%
 The objects created by symbol literals all override
-the \code{==} operator inherited from the \code{Object} class.
+the \lit{==} operator inherited from the \code{Object} class.
 
 \rationale{
 One may well ask what is the motivation for introducing literal symbols? In some languages, symbols are canonicalized whereas strings are not.
@@ -6441,6 +6646,7 @@
 \LMHash{}%
 The static type of a symbol literal is \code{Symbol}.
 
+
 \subsection{Lists}
 \LMLabel{lists}
 
@@ -6458,7 +6664,8 @@
 A list has an associated set of indices.
 An empty list has an empty set of indices.
 A non-empty list has the index set $\{0, \ldots, n - 1\}$ where $n$ is the size of the list.
-It is a run-time error to attempt to access a list using an index that is not a member of its set of indices.
+It is a dynamic error to attempt to access a list
+using an index that is not a member of its set of indices.
 
 \LMHash{}%
 If a list literal begins with the reserved word \CONST{}, it is a
@@ -6469,11 +6676,11 @@
 and it is evaluated at run time.
 Only run-time list literals can be mutated
 after they are created.
+% This error can occur because being constant is a dynamic property, here.
 Attempting to mutate a constant list literal will result in a dynamic error.
 
 \LMHash{}%
 It is a compile-time error if an element of a constant list literal is not a constant expression.
-% Need 'free': `const <Function(Function<X>(X))>[]` is OK, but `X` is not free.
 It is a compile-time error if the type argument of a constant list literal is
 not a constant type expression.
 \rationale{
@@ -6509,26 +6716,31 @@
 is evaluated as follows:
 \begin{itemize}
 \item
-First, the expressions $e_1, \ldots, e_n$ are evaluated in order they appear in the program, producing objects $o_1, \ldots, o_n$.
-\item A fresh instance (\ref{generativeConstructors}) $a$, of size $n$, whose class implements the built-in class
-\code{List<$E$>}
-is allocated.
+  First, the expressions $e_1, \ldots, e_n$ are evaluated
+  in order they appear in the program,
+  producing objects $o_1, \ldots, o_n$.
 \item
-The operator \syntax{`[]='} is invoked on $a$ with first argument $i$ and second argument
-%The $i$th element of $a$ is set to
-$o_{i+1}, 0 \le i < n$.
+  A fresh instance (\ref{generativeConstructors}) $a$, of size $n$,
+  whose class implements the built-in class \code{List<$E$>}
+  is allocated.
 \item
-The result of the evaluation is $a$.
+  The operator \lit{[]=} is invoked on $a$ with
+  first argument $i$ and second argument
+  $o_{i+1}, 0 \le i < n$.
+\item
+  The result of the evaluation is $a$.
 \end{itemize}
 
 \LMHash{}%
 The objects created by list literals do not override
-the \code{==} operator inherited from the \code{Object} class.
+the \lit{==} operator inherited from the \code{Object} class.
 
 \commentary{
-Note that this document does not specify an order in which the elements are set.
-This allows for parallel assignments into the list if an implementation so desires.
-The order can only be observed (and may not be relied upon):
+Note that this document does not specify an order
+in which the elements are set.
+This allows for parallel assignments into the list
+if an implementation so desires.
+The order can only be observed as follows (and may not be relied upon):
 if element $i$ is not a subtype of the element type of the list,
 a dynamic type error will occur when $a[i]$ is assigned $o_{i-1}$.
 }
@@ -6583,8 +6795,8 @@
 If $e$ has three or more type arguments, it is a compile-time error.
 If $e$ has \emph{no} type arguments,
 then let $S$ be the static context type of the literal.
-If $\basetype{S}$ (\ref{typeFutureOr}) is a subtype of \code{Iterable<Object>}
-and $\basetype{S}$ is not a subtype of \code{Map<Object, Object>},
+If $\futureOrBase{S}$ (\ref{typeFutureOr}) is a subtype of \code{Iterable<Object>}
+and $\futureOrBase{S}$ is not a subtype of \code{Map<Object, Object>},
 then $e$ is set literal,
 and otherwise it is a map literal.
 A map literal derived from \synt{setOrMapLiteral}
@@ -6606,24 +6818,20 @@
 \IndexCustom{run-time map literal}{literal!map!run-time}
 and it is evaluated at run time.
 Only run-time map literals can be mutated after they are created.
+% This error can occur because being constant is a dynamic property, here.
 Attempting to mutate a constant map literal will result in a dynamic error.
 
 \LMHash{}%
-It is a compile-time error if either a key or a value of an entry in a constant map literal is not a constant expression.
-It is a compile-time error if the key of an entry in a constant map literal is an instance of
-a class that has a concrete operator \syntax{`=='} declaration different from the one in \code{Object},
-unless the key is a string or an integer,
-the key expression evaluates to an instance of the built-in
-class \code{Symbol} which was originally obtained by evaluation of a
-literal symbol or
-a constant invocation of a constructor of the \code{Symbol} class,
-or to an object implementing the built-in class \code{Type}
-which was originally obtained by evaluating a constant type literal
-(\ref{dynamicTypeSystem}).
-% Needs 'free': `const <int, Function(Function<X>(X))>{}` is OK, but
-% `X` is not free.
+It is a compile-time error if
+either a key or a value of an entry in a constant map literal
+is not a constant expression.
+It is a compile-time error if
+the operator \lit{==} of the key of an entry in a constant map literal
+is not primitive
+(\ref{theOperatorEqualsEquals}).
 It is a compile-time error if a type argument of a constant map literal
-is not a constant type expression \ref{constants}.
+is not a constant type expression
+(\ref{constants}).
 
 \LMHash{}%
 The value of a constant map literal
@@ -6651,7 +6859,7 @@
 
 \LMHash{}%
 It is a compile-time error if two keys of a constant map literal are equal
-according to their \code{==} operator (\ref{equality}).
+according to their \lit{==} operator (\ref{equality}).
 
 \LMHash{}%
 A run-time map literal
@@ -6659,21 +6867,25 @@
 is evaluated as follows:
 \begin{itemize}
 \item
-For each $i \in 1 .. n$ in numeric order,
-first the expression $k_i$ is evaluated producing object $u_i$,
-and then $e_i$ is evaluated producing object $o_i$.
-This produces all the objects $u_1, o_1, \ldots, u_n, o_n$.
-\item A fresh instance (\ref{generativeConstructors}) $m$
-whose class implements the built-in class \code{Map<$K, V$>}, is allocated.
+  For each $i \in 1 .. n$ in numeric order,
+  first the expression $k_i$ is evaluated producing object $u_i$,
+  and then $e_i$ is evaluated producing object $o_i$.
+  This produces all the objects $u_1, o_1, \ldots, u_n, o_n$.
 \item
-The operator \syntax{`[]='} is invoked on $m$ with first argument $u_i$ and second argument $o_i$ for each $i \in 1 .. n$.
+  A fresh instance (\ref{generativeConstructors}) $m$
+  whose class implements the built-in class \code{Map<$K, V$>},
+  is allocated.
 \item
-The result of the evaluation is $m$.
+  The operator \lit{[]=} is invoked on $m$
+  with first argument $u_i$ and second argument $o_i$
+  for each $i \in 1 .. n$.
+\item
+  The result of the evaluation is $m$.
 \end{itemize}
 
 \LMHash{}%
 The objects created by map literals do not override
-the \code{==} operator inherited from the \code{Object} class.
+the \lit{==} operator inherited from the \code{Object} class.
 
 \LMHash{}%
 A run-time map literal
@@ -6683,11 +6895,13 @@
 \code{<\DYNAMIC{}, \DYNAMIC{}>\{$k_1:e_1, \ldots, k_n:e_n$\}}.
 
 \LMHash{}%
-A map literal is ordered: iterating over the keys and/or values of the maps always happens in the
- order the keys appeared in the source code.
+A map literal is ordered:
+iterating over the keys and/or values of the maps
+always happens in the order the keys appeared in the source code.
 
 \commentary{
-Of course, if a key repeats, the order is defined by first occurrence, but the value is defined by the last.
+Of course, if a key repeats, the order is defined by first occurrence,
+but the value is defined by the last.
 }
 
 \LMHash{}%
@@ -6740,24 +6954,22 @@
 \IndexCustom{run-time set literal}{literal!set!run-time}
 and it is evaluated at run time.
 Only run-time set literals can be mutated after they are created.
+% This error can occur because being constant is a dynamic property, here.
 Attempting to mutate a constant set literal will result in a dynamic error.
 
 \LMHash{}%
-It is a compile-time error if an element expression in a constant set literal is not a constant expression.
-It is a compile-time error if the element object in a constant set literal is an instance of
-a class that has a concrete operator \syntax{`=='} declaration different from the one in \code{Object},
-unless the element is a string or an integer,
-the element expression evaluates to an instance of the built-in
-class \code{Symbol} which was originally obtained by evaluation of a
-literal symbol or
-a constant invocation of a constructor of the \code{Symbol} class,
-or to an object implementing the built-in class \code{Type}
-which was originally obtained by evaluating a constant type literal
-(\ref{dynamicTypeSystem}).
+It is a compile-time error if an element expression in a constant set literal
+is not a constant expression.
+It is a compile-time error if
+the operator \lit{==} of an element expression in a constant map literal
+is not primitive
+(\ref{theOperatorEqualsEquals}).
 It is a compile-time error if the type argument of a constant set literal
-is not a constant type expression \ref{constants}.
+is not a constant type expression
+(\ref{constants}).
 It is a compile-time error if two elements of a constant set literal are equal
-according to their \code{==} operator (\ref{equality}).
+according to their \lit{==} operator
+(\ref{equality}).
 
 \LMHash{}%
 The value of a constant set literal with element expressions
@@ -6801,7 +7013,7 @@
 
 \LMHash{}%
 The objects created by set literals do not override
-the \code{==} operator inherited from the \code{Object} class.
+the \lit{==} operator inherited from the \code{Object} class.
 
 \LMHash{}%
 A set literal is ordered: iterating over the elements of the sets
@@ -6819,6 +7031,7 @@
 is
 \code{Set<$E$>}.
 
+
 \subsection{Throw}
 \LMLabel{throw}
 
@@ -7191,9 +7404,7 @@
 \code{\CONST{} $T$($a_1, \ldots,\ a_n,\ x_{n+1}$: $a_{n+1}, \ldots,\ x_{n+k}$: $a_{n+k}$)}
 
 \noindent
-is malformed (\ref{staticTypes}),
-is malbounded (\ref{parameterizedTypes}),
-or is an enumerated type (\ref{enums}).
+is an enumerated type (\ref{enums}).
 
 
 \subsubsection{New}
@@ -7307,6 +7518,7 @@
 
 \noindent
 \commentary{Note that the non-generic case is covered by letting $m = 0$.}
+% This error can occur due to an implicit cast.
 If for any
 $j \in 1 .. n + k$
 the run-time type of $o_j$ is not a subtype of
@@ -7315,7 +7527,10 @@
 
 \LMHash{}%
 \Case{Non-loaded deferred constructors}
-If $T$ is a deferred type with prefix $p$, then if $p$ has not been successfully loaded, a dynamic error occurs.
+% This error can occur because being-loaded is a dynamic property.
+If $T$ is a deferred type with prefix $p$,
+then if $p$ has not been successfully loaded,
+a dynamic error occurs.
 \EndCase
 
 \LMHash{}%
@@ -7582,7 +7797,10 @@
 
 \LMHash{}%
 An isolate's memory is finite, as is the space available to its thread's call stack.
-It is possible for a running isolate to exhaust its memory or stack, resulting in a run-time error that cannot be effectively caught, which will force the isolate to be suspended.
+% This error can occur because memory usage is a dynamic property.
+It is possible for a running isolate to exhaust its memory or stack,
+resulting in a dynamic error that cannot be effectively caught,
+which will force the isolate to be suspended.
 
 \commentary{
 As discussed in section \ref{errorsAndWarnings}, the handling of a suspended isolate is the responsibility of the embedder.
@@ -7748,10 +7966,13 @@
 \end{grammar}
 
 \LMHash{}%
-Argument lists allow an optional trailing comma after the last argument (\syntax{`,'?}).
-An argument list with such a trailing comma is equivalent in all ways to the same parameter list without the trailing comma.
+Argument lists allow an optional trailing comma after the last argument
+(\syntax{`,'?}).
+An argument list with such a trailing comma is equivalent in all ways to
+the same parameter list without the trailing comma.
 All argument lists in this specification are shown without a trailing comma,
-but the rules and semantics apply equally to the corresponding argument list with a trailing comma.
+but the rules and semantics apply equally to
+the corresponding argument list with a trailing comma.
 
 \LMHash{}%
 Let $L$ be an argument list of the form
@@ -7771,15 +7992,18 @@
 \code{($T_1\ x_1 \ldots,\ T_n\ x_n,\ $[$T_{n+1}\ x_{n+1} = d_1, \ldots,\ T_{n+k}\ x_{n+k} = d_k$])}
 
 \noindent
-where each parameter may be marked \COVARIANT{} (\commentary{not shown, but allowed}).
+where each parameter may be marked \COVARIANT{}
+(\commentary{not shown, but allowed}).
 
 \LMHash{}%
 We say that $\argumentList{S}$ is
 a \Index{subtype match} for $\parameterList{P}$
-if{}f $p = 0$, $n \leq m \leq n+k$, and $S_i$ is a subtype of $T_i$ for all $i \in 1 .. m$.
+if{}f $p = 0$, $n \leq m \leq n+k$, and $S_i$ is
+a subtype of $T_i$ for all $i \in 1 .. m$.
 We say that $\argumentList{S}$ is
 an \Index{assignable match} for $\parameterList{P}$
-if{}f $p = 0$, $n \leq m \leq n+k$, and $S_i$ is assignable to $T_i$ for all $i \in 1 .. m$.
+if{}f $p = 0$, $n \leq m \leq n+k$, and $S_i$ is
+assignable to $T_i$ for all $i \in 1 .. m$.
 
 \LMHash{}%
 Let $\argumentList{S}$ be the static argument list type
@@ -7792,7 +8016,8 @@
 \code{($T_1\ x_1 \ldots,\ T_n\ x_n,\ $\{$T_{n+1}\ x_{n+1} = d_1, \ldots,\ T_{n+k}\ x_{n+k} = d_k$\})}
 
 \noindent
-where each parameter may be marked \COVARIANT{} (\commentary{not shown, but allowed}).
+where each parameter may be marked \COVARIANT{}
+(\commentary{not shown, but allowed}).
 
 \LMHash{}%
 We say that $\argumentList{S}$ is
@@ -8099,15 +8324,18 @@
 
 \LMHash{}%
 % Check the type arguments.
+% This error can occur due to covariance and due to dynamic invocation.
 It is a dynamic type error if $t_i$ is not a subtype of the actual bound
 (\ref{actualTypeOfADeclaration})
 of the $i$th type argument of $f$, for actual type arguments $t_1, \ldots, t_r$.
 % Check the types of positional arguments.
+% This error can occur due to implicit casts, covariance, and dynamic calls.
 It is a dynamic type error if $o_i$ is not the null object (\ref{null})
 and the actual type
 (\ref{actualTypeOfADeclaration})
 of $p_i$ is not a supertype of the dynamic type of $o_i, i \in 1 .. m$.
 % Check the types of named arguments.
+% This error can occur due to implicit casts, covariance, and dynamic calls.
 It is a dynamic type error if $o_{m+j}$ is
 not the null object and the actual type
 (\ref{actualTypeOfADeclaration})
@@ -8304,15 +8532,15 @@
 There does not exist a function type $F'$ which is a proper subtype of $F$
 such that $C$ is a subtype of $F'$.
 If $f$ denotes a static method or top-level function,
-class $C$ does not override the \code{==} operator
+class $C$ does not override the \lit{==} operator
 inherited from the \code{Object} class.
 
-\commentary{
+\commentary{%
 In other words, $C$ has the freedom to be a proper subtype of
 the function type that we can read off of the declaration of $f$
 because it may need to be a specific internal platform defined class,
 but $C$ does not have the freedom to be a subtype of
-a different and more special function type, and it cannot be \code{Null}.
+a different and more special function type, and it cannot be \code{Null}.%
 }
 
 \LMHash{}%
@@ -8326,6 +8554,217 @@
 as the invocation of $f$ would have yielded.
 
 
+\subsubsection{Generic Function Instantiation}
+\LMLabel{genericFunctionInstantiation}
+
+%% TODO(eernst): The specification of generic function instantiation relies
+%% on type inference in a different way than other mechanisms that we have
+%% specified, because it is impossible to claim that 'type inference is
+%% assumed to have taken place already' and then we just consider the
+%% program where the missing type arguments or type annotations have been
+%% added syntactically. Consequently, this section will probably need to be
+%% rewritten rather extensively when we add a specification of inference.
+
+\LMHash{}%
+Generic function instantiation is a mechanism that yields
+a non-generic function object,
+based on a reference to a generic function.
+
+\commentary{%
+It is a mechanism which is very similar to function closurization
+(\ref{functionClosurization}),
+but it only occurs in situations where
+a compile-time error would otherwise occur.
+}
+
+\rationale{%
+The essence of generic function instantiation
+is to allow for ``curried'' invocations,
+in the sense that a generic function can receive its actual
+type arguments separately during closurization
+(it must then receive \emph{all} type arguments, not just some of them),
+and that yields a non-generic function object.
+The type arguments are passed implicitly, based on type inference;
+a future version of Dart may allow for passing them explicitly.%
+}
+\commentary{Here is an example:}
+
+\begin{dartCode}
+X fg<X \EXTENDS{} num>(X x) => x;
+\\
+\CLASS{} A \{
+  \STATIC{} X fs<X \EXTENDS{} num>(X x) => x;
+\}
+\\
+\VOID{} main() \{
+  X fl<X \EXTENDS{} num>(X x) => x;
+  List<int \FUNCTION{}(int)> functions = [fg, A.fs, fl];
+\}
+\end{dartCode}
+
+\commentary{%
+\noindent
+Each function object stored in \code{functions}
+has dynamic type \code{int\,\,\FUNCTION(int)},
+and it is obtained by implicitly
+``passing the actual type argument \code{int}''
+to the corresponding generic function.
+}
+
+\LMHash{}%
+Let $f$ of the form
+\syntax{<identifier> ('.'~<identifier>\,('.'~<identifier>)?)?}~be
+an expression that denotes
+a declaration of a local function, a static method, or a top-level function,
+and let $G$ be the static type of $f$.
+Consider the situation where $G$ is a function type of the form
+\RawFunctionType{T_0}{X}{B}{s}{\metavar{parameters}}
+with $s > 0$
+(\commentary{that is, $G$ is a generic function type}),
+and the context type is a non-generic function type $F$.
+In this situation a compile-time error occurs
+(\ref{variables},
+\ref{functions},
+\ref{generativeConstructors},
+\ref{redirectingGenerativeConstructors},
+\ref{initializerLists},
+\ref{new},
+\ref{const},
+\ref{bindingActualsToFormals},
+\ref{assignment},
+\ref{localVariableDeclaration},
+\ref{switch},
+\ref{return},
+\ref{yieldEach}),
+except when the following step succeeds:
+
+\LMHash{}%
+\IndexCustom{Generic function type instantiation}{%
+  generic function type instantiation}:
+Type inference is applied to $G$ with context type $F$,
+and it succeeds, yielding the actual type argument list
+\List{T}{1}{s}.
+
+\commentary{%
+The generic function type instantiation fails
+in the case where type inference fails,
+in which case the above mentioned compile-time error occurs.
+It will be specified in a future version of this document
+how type inference computes \List{T}{1}{s}
+(\ref{overview}).
+}
+
+\LMHash{}%
+Otherwise, the generic function type instantiation succeeded.
+Let $F'$ denote the type
+$[T_1/X_1, \ldots, T_s/X_s]%
+(\FunctionTypeSimple{T_0}{\metavar{parameters}})$.
+\commentary{%
+Note that it is guaranteed that $F'$ is assignable to $F$,
+or inference would have failed.%
+}
+
+\LMHash{}%
+\Case{Top-level Functions and Static Methods}
+Consider the situation where $f$ denotes
+a top-level function or a static method.
+%
+In this situation, the program is modified such that $f$ is replaced by
+a reference $f'$ to an implicitly induced non-generic function
+whose signature is $F'$,
+whose dynamic type is $[t_1/T_1, \ldots, t_s/T_s]F'$,
+and whose semantics for each invocation is the same as
+invoking $f$ with \List{t}{1}{s} as the actual type argument list,
+where \List{t}{1}{s} is the actual value of \List{T}{1}{s}
+at the point during execution where $f'$ was evaluated.
+\commentary{Here is an example:}
+
+\begin{dartCode}
+List<T> foo<T>(T t) => [t];
+List<int> fooOfInt(int i) => [i];
+\\
+String bar(List<int> f(int)) => "\${f(42)}";
+\\
+\VOID{} main() \{
+  print(bar(foo));
+\}
+\end{dartCode}
+
+\commentary{%
+In this example,
+\code{foo} as an actual argument to \code{bar} will be modified
+as if the call had been \code{bar(fooOfInt)},
+except for equality, which is specified next.
+}
+
+\LMHash{}%
+Consider the situation where the program
+before generic function instantiation contains
+two occurrences of $f$ in the same scope or different scopes,
+but denoting the same function,
+respectively the situation where
+an execution of the program containing $f$ evaluates it twice.
+Let $o_1$ and $o_2$ denote the function objects obtained by
+evaluation of those two expressions,
+respectively the two evaluations of that expression.
+
+\LMHash{}%
+In the case where the actual values of the type arguments
+are the same for both evaluations,
+it is guaranteed that $o_1$ and $o_2$ are equal
+according to operator \lit{==}.
+However, it is unspecified whether
+\code{identical($o_1$, $o_2$)} evaluates to \TRUE{} or \FALSE{}.
+
+\rationale{%
+No notion of equality is appropriate
+when different type arguments are provided,
+even if the resulting function objects
+turn out to have exactly the same type at run time,
+because execution of two function objects that differ in these ways
+can have different side-effects and return different results
+when executed starting from exactly the same state.%
+}
+\commentary{%
+For instance, there could be a type parameter \code{X}
+that does not occur in the signature of the function,
+and the function could create and return a \code{List<X>}.%
+}
+
+\LMHash{}%
+\Case{Local Functions}
+Consider the situation where $f$ is an identifier denoting a local function.
+\commentary{For a local function, only an identifier can denote it.}
+%
+In this situation, the program is modified such that $f$ is replaced by
+a reference $f'$ to an implicitly induced non-generic function
+whose signature is $F'$,
+whose dynamic type is $[t_1/T_1, \ldots, t_s/T_s]F'$,
+and whose semantics for each invocation is the same as
+invoking $f$ with \List{t}{1}{s} as the actual type argument list,
+where \List{t}{1}{s} is the actual value of \List{T}{1}{s}
+at the point during execution where $f'$ was evaluated.
+
+\commentary{%
+No guarantees are provided regarding equality
+of non-generic functions obtained from a local function
+by generic function instantiation.%
+}
+
+\rationale{%
+Such a local function could have received exactly
+the same actual type arguments in the two cases,
+and still its body could contain references
+to declarations of types, variables, and other entities
+in the enclosing scopes.
+Those references could denote different entities
+when the two function objects were created.
+In that situation it is unreasonable
+to consider the two function objects to be the same function.%
+}
+\EndCase{}
+
+
 \subsection{Lookup}
 \LMLabel{lookup}
 
@@ -8337,12 +8776,12 @@
 A lookup may be part of the static analysis, and it may be performed
 at run time. It may succeed or fail.
 
-\commentary{
+\commentary{%
 We define several kinds of lookup with a very similar structure.
 We spell out each of them in spite of the redundancy,
 in order to avoid introducing meta-level abstraction mechanisms just for this purpose.
 The point is that we must indicate for each lookup which kind of member it is looking for,
-because, e.g., a `method lookup' and a `getter lookup' are used in different situations.
+because, e.g., a `method lookup' and a `getter lookup' are used in different situations.%
 }
 
 { % Scope for 'lookup' definition.
@@ -9237,6 +9676,259 @@
 \code{$c_1$ == $c_2$} is then true if and only if $o_1$ and $o_2$ is the same object.
 
 
+\subsubsection{Generic Method Instantiation}
+\LMLabel{genericMethodInstantiation}
+
+%% TODO(eernst): Like generic function instantiation, generic method instantiation
+%% relies on type inference. See the comment in \ref{genericFunctionInstantiation}
+%% for further details.
+
+\LMHash{}%
+Generic method instantiation is a mechanism that yields
+a non-generic function object,
+based on a property extraction which denotes an instance method closurization
+(\ref{ordinaryMemberClosurization}, \ref{superClosurization}).
+
+\commentary{%
+It is a mechanism which is very similar to instance method closurization,
+but it only occurs in situations where
+a compile-time error would otherwise occur.%
+}
+
+\rationale{%
+The essence of generic method instantiation
+is to allow for ``curried'' invocations,
+in the sense that a generic instance method can receive its actual
+type arguments separately during closurization
+(it must then receive \emph{all} type arguments, not just some of them),
+and that yields a non-generic function object.
+The type arguments are passed implicitly, based on type inference;
+a future version of Dart may allow for passing them explicitly.%
+}
+\commentary{Here is an example:}
+
+\begin{dartCode}
+\CLASS{} A \{
+  X fi<X \EXTENDS{} num>(X x) => x;
+\}
+\\
+\CLASS{} B \EXTENDS{} /*\,or\,\,\IMPLEMENTS\,*/ A \{
+  X fi<X \EXTENDS{} num>(X x, [List<X> xs]) => x;
+\}
+\\
+\VOID{} main() \{
+  A a = B();
+  int \FUNCTION{}(int) f = a.fi;
+\}
+\end{dartCode}
+
+\commentary{%
+\noindent
+The function object which is stored in \code{f} at the end of \code{main}
+has dynamic type \code{int\,\,\FUNCTION(int,\,[List<int>])},
+and it is obtained by implicitly
+``passing the actual type argument \code{int}''
+to the denoted generic instance method,
+thus obtaining a non-generic function object of the specified type.
+%
+Note that this function object accepts an optional positional argument,
+even though this is not part of
+the statically known type of the corresponding instance method,
+nor of the context type.
+}
+
+\rationale{%
+In other words, generic method instantiation yields a function
+whose signature matches the context type as far as possible,
+but with respect to its parameter list shape
+(that is, the number of positional parameters and their optionality,
+or the set of names of named parameters),
+it will be determined by the method signature of the actual instance method
+of the given receiver.
+Of course, the difference can only be such that the actual type is
+% This is about the dynamic type, so there is no exception for \COVARIANT.
+a subtype of the given context type,
+otherwise the declaration of that instance method
+would have been a compile-time error.%
+}
+
+\LMHash{}%
+Let $i$ be a property extraction expression of the form
+\code{$e$?.\id}, \code{$e$.\id}, or \code{\SUPER.\id}
+(\ref{propertyExtraction}, \ref{superGetterAccessAndMethodClosurization}),
+which is statically resolved to denote an instance method named \id,
+and let $G$ be the static type of $i$.
+Consider the situation where $G$ is a function type of the form
+\RawFunctionType{T_0}{X}{B}{s}{\metavar{parameters}}
+with $s > 0$
+(\commentary{that is, $G$ is a generic function type}),
+and the context type is a non-generic function type $F$.
+In this situation a compile-time error occurs
+(\ref{variables},
+\ref{functions},
+\ref{generativeConstructors},
+\ref{redirectingGenerativeConstructors},
+\ref{initializerLists},
+\ref{new},
+\ref{const},
+\ref{bindingActualsToFormals},
+\ref{assignment},
+\ref{localVariableDeclaration},
+\ref{switch},
+\ref{return},
+\ref{yieldEach}),
+except when generic function type instantiation
+(\ref{genericFunctionInstantiation})
+succeeds, that is:
+
+\LMHash{}%
+Type inference is applied to $G$ with context type $F$,
+and it succeeds, yielding the actual type argument list
+\List{T}{1}{s}.
+
+{ % Scope for \gmiName.
+
+\def\gmiName{\metavar{gmiName\ensuremath{_{\id}}}}
+
+% For any given method name \id, \gmiName is the "associated" name which
+% is used for the implicitly induced method that we use to get the function
+% object which is the result of a generic method instantiation. Let's call
+% that associated method the "generic instantiation method".
+%
+% The basic idea is that we consider all libraries included in the
+% compilation of a complete Dart program, and then we select a suffix,
+% say `_*`, which is globally unique (because no user-written identifier
+% can have that suffix, and the compiler doesn't use anything similar
+% for other purposes).
+%
+% When we have found such a "globally fresh suffix", it is easy to see
+% that we can use it to specify the implicitly induced methods in a way
+% that will do the right thing:
+%
+% Assume that a class `C` has a generic method `foo`, and it is subject
+% to generic method instantiation.
+%
+% We then generate a generic instantiation method for `foo` in in `C`, with the
+% name `foo_*`. If there is a subclass `D` of `C` which has an overriding
+% declaration of `foo` then we also generate a `foo_*` generic instantiation
+% method in `D`, and that one might return a closure with a different parameter
+% list shape, because that's the way `foo` is declared in `D`.
+%
+% We can then call `e.foo_*<...>()` where `e` has static type `C`,
+% at a location where the original source code had `e.foo` and the context
+% type was non-generic (so generic method instantiation kicked in).
+% This may invoke `foo_*` in `C`, or `D`, or some other class, whatever is the
+% dynamic type of the result of evaluating `e`.
+%
+% Altogether, this ensures that we obtain a function object whose parameter
+% list shape corresponds precisely to the parameter list shape of `foo` in
+% the dynamic type of the receiver, as it should. There will not be any
+% name clashes with user-written declarations, and overriding declarations
+% will actually override as they should, because they all use that same
+% "globally fresh suffix".
+%
+% The text below tries to communicate how this could work without being too
+% much like a particular implementation.
+
+\LMHash{}%
+Consider the situation where generic function type instantiation succeeded.
+Let \gmiName{} be a fresh name which is associated with \id{},
+which is private if and only if \id{} is private.
+\commentary{%
+An implementation could use, say, \code{foo_*} when \id{} is \code{foo},
+which is known to be fresh because user-written identifiers cannot contain `\code{*}'.%
+}
+The program is then modified as follows:
+
+\begin{itemize}
+\item When $i$ is \code{$e$?.\id}:
+  Replace $i$ by \code{$e$?.\gmiName<\List{T}{1}{s}>()}.
+\item When $i$ is \code{$e$.\id}:
+  Replace $i$ by \code{$e$.\gmiName<\List{T}{1}{s}>()}.
+\item When $i$ is \code{\SUPER.\id}:
+  Replace $i$ by \code{\SUPER.\gmiName<\List{T}{1}{s}>()}.
+\end{itemize}
+
+\LMHash{}%
+The inserted expressions have no compile-time error and can be executed,
+because the corresponding generic method is induced implicitly.
+We use the phrase
+\Index{generic instantiation method}
+to denote these implicitly induced methods,
+and designate the method that induced it as its
+\IndexCustom{target}{generic instantiation method!target}.
+
+\LMHash{}%
+Assume that a class $C$ declares a generic instance method named \id,
+with a method signature corresponding to a generic function type $G$,
+formal type parameters \TypeParametersStd{},
+and formal parameter declarations \metavar{parameters}.
+Let \metavar{arguments} denote the corresponding actual argument list,
+passing these parameters.
+\commentary{%
+For instance, \metavar{parameters} could be
+
+\noindent
+\code{$\PairList{T}{p}{1}{n},\ $\{$T_{n+1}\ p_{n+1} = d_1, \ldots,\ T_{n+k}\ p_{n+k} = d_k$\}}
+
+\noindent
+in which case \metavar{arguments} would be
+\code{\List{p}{1}{n},\ $p_{n+1}$:\ $p_{n+1}$,\ $p_{n+k}$:\ $p_{n+k}$}.%
+}
+
+\LMHash{}%
+Let $G'$ be the same function type as $G$,
+except that it omits the formal type parameter declarations.
+\commentary{%
+For instance, if $G$ is
+\FunctionTypeSimpleGeneric{\VOID}{$X$, $Y$ \EXTENDS\ num}{X x, List<Y> ys}
+then $G'$ is
+\FunctionTypeSimple{\VOID}{X x, List<Y> ys}.
+Note that $G'$ will typically contain free type variables.
+}
+
+\LMHash{}%
+An instance method with the name \gmiName{} is then implicitly induced,
+with the same behavior as the following declaration
+(except for equality of the returned function object,
+which is specified below):
+
+% Use `\THIS.\id..` because there could be a parameter named \id.
+\begin{normativeDartCode}
+$G'$ \gmiName<\TypeParametersStd{}>() \{
+\ \ \RETURN{} (\metavar{parameters}) => \THIS.\id<\List{X}{1}{s}>(\metavar{arguments});
+\}
+\end{normativeDartCode}
+
+\LMHash{}%
+Let $o$ be an instance of a class which contains
+an implicitly induced declaration of \gmiName{}
+as described above.
+%
+Consider the situation where the program evaluates
+two invocations of this method with the same receiver $o$,
+and with actual type arguments whose actual values are
+the same types \List{t}{1}{s} for both invocations,
+and assume that the invocations returned
+the instances $o_1$ respectively $o_2$.
+%
+It is then guaranteed that $o_1$ and $o_2$ are equal
+according to operator \lit{==}.
+It is unspecified whether
+\code{identical($o_1$, $o_2$)}
+evaluates to \TRUE{} or \FALSE{}.
+
+} % End of scope for \gmiName.
+
+\rationale{%
+No notion of equality is appropriate with different receivers,
+nor when different type arguments are provided,
+because execution of two function objects that differ in these ways
+can have different side-effects and return different results
+when executed starting from exactly the same state.%
+}
+
+
 \subsection{Assignment}
 \LMLabel{assignment}
 
@@ -9314,8 +10006,9 @@
 Otherwise, the assignment is equivalent to the assignment \code{\THIS{}.$v$ = $e$}.
 
 \LMHash{}%
-It is a dynamic type error if $o$ is not the null object (\ref{null})
-and the dynamic type of $o$ is not a subtype of the actual type
+% This error can occur due to implicit casts.
+It is a dynamic type error if the dynamic type of $o$
+is not a subtype of the actual type
 (\ref{actualTypeOfADeclaration})
 of $v$.
 \EndCase
@@ -9356,6 +10049,7 @@
 The expression $e_1$ is evaluated to an object $o_1$.
 Then, the expression $e_2$ is evaluated to an object $o_2$.
 Then, the setter \code{$v$=} is looked up (\ref{lookup}) in $o_1$ with respect to the current library.
+% This error can occur due to implicit casts and dynamic calls.
 It is a dynamic type error if the dynamic type of $o_2$
 is not a subtype of the actual parameter type of said setter
 (\ref{actualTypeOfADeclaration}).
@@ -9416,6 +10110,7 @@
 The value of the assignment expression is $o$.
 
 \LMHash{}%
+% This error can occur due to implicit casts and mixin+covariance.
 It is a dynamic type error if $o$ is not the null object (\ref{null})
 and the dynamic type of $o$ is
 not a subtype of the actual type of the formal parameter of \code{$v$=}
@@ -9583,7 +10278,7 @@
 \Case{\code{$C$?.$v$ ??= $e_2$}}
 A compound assignment of the form \code{$C$?.$v$ ??= $e_2$}
 where $C$ is a type literal
-that may or may not be be qualified by an import prefix
+that may or may not be qualified by an import prefix
 is equivalent to the expression \code{$C$.$v$ ??= $e$}.
 \EndCase
 
@@ -9693,7 +10388,8 @@
 
 \LMHash{}%
 First, $e_1$ is evaluated to an object $o_1$.
-It is a run-time error if the run-time type of $o_1$ is not \code{bool}.
+% This error can occur due to implicit casts and null.
+It is a dynamic error if the run-time type of $o_1$ is not \code{bool}.
 If $r$ is \TRUE, then the value of $c$ is the result of evaluating the expression $e_2$.
 Otherwise the value of $c$ is the result of evaluating the expression $e_3$.
 
@@ -9756,16 +10452,20 @@
 
 \LMHash{}%
 Evaluation of a logical boolean expression $b$ of the form $e_1 || e_2$ causes the evaluation of $e_1$ to a value $o_1$.
-It is a run-time error if the run-time type of $o_1$ is not \code{bool}.
+% This error can occur due to implicit casts and null.
+It is a dynamic error if the run-time type of $o_1$ is not \code{bool}.
 If $o_1$ is \TRUE, the result of evaluating $b$ is \TRUE, otherwise $e_2$ is evaluated to an object $o_2$.
-It is a run-time error if the run-time type of $o_2$ is not \code{bool}.
+% This error can occur due to implicit casts and null.
+It is a dynamic error if the run-time type of $o_2$ is not \code{bool}.
 Otherwise the result of evaluating $b$ is $o_2$.
 
 \LMHash{}%
 Evaluation of a logical boolean expression $b$ of the form $e_1 \&\& e_2$ causes the evaluation of $e_1$ producing an object $o_1$.
-It is a run-time error if the run-time type of $o_1$ is not \code{bool}.
+% This error can occur due to implicit casts and null.
+It is a dynamic error if the run-time type of $o_1$ is not \code{bool}.
 If $o_1$ is \FALSE, the result of evaluating $b$ is \FALSE, otherwise $e_2$ is evaluated to an object $o_2$.
-It is a run-time error if the run-time type of $o_2$ is not \code{bool}.
+% This error can occur due to implicit casts and null.
+It is a dynamic error if the run-time type of $o_2$ is not \code{bool}.
 Otherwise the result of evaluating $b$ is $o_2$.
 
 \LMHash{}%
@@ -9842,7 +10542,7 @@
 \end{itemize}
 
 \commentary{
-As a result of the above definition, user defined \code{==} methods can assume that their argument is non-null, and avoid the standard boiler-plate prelude:
+As a result of the above definition, user defined \lit{==} methods can assume that their argument is non-null, and avoid the standard boiler-plate prelude:
 
 \code{if (identical(\NULL{}, arg)) return \FALSE{};}
 
@@ -10012,6 +10712,7 @@
 The static type of an expression $e_1 * e_2$ where $e_1$ has static type \code{int} is \code{int} if the static type of $e_2$ is \code{int}, and \code{double} if the static type of $e_2$ is \code{double}.
 The static type of an expression $e_1 \% e_2$ where $e_1$ has static type \code{int} is \code{int} if the static type of $e_2$ is \code{int}, and \code{double} if the static type of $e_2$ is \code{double}.
 
+
 \subsection{Unary Expressions}
 \LMLabel{unaryExpressions}
 
@@ -10110,22 +10811,24 @@
 
 %Otherwise, the value of $a$ is the value of $e$. If evaluation of $e$ raises an exception $x$, $a$ raises $x$.
 
-\commentary{
-It is a compile-time error if the function immediately enclosing $a$ is not declared asynchronous.
-However, this error is simply a syntax error, because in the context of a normal function, \AWAIT{} has no special meaning.
-% TODO(lrn): Update this, it's not actually correct,
-% the expression "await(expr)" is valid non-async syntax *and* a valid
-% async await expression.
+\commentary{%
+It is typically a compile-time error
+if the function immediately enclosing $a$ is not declared asynchronous.
+E.g., it can be a syntax error because \AWAIT{} has no special meaning
+in the context of a normal function.
+However, \code{\AWAIT($e$)} can also be a function invocation.%
 }
 
-\rationale{
+\rationale{%
 An await expression has no meaning in a synchronous function.
-If such a function were to suspend waiting for a future, it would no longer be synchronous.
+If such a function were to suspend waiting for a future,
+it would no longer be synchronous.%
 }
 
-\commentary{
-It is not a compile-time error if the type of $e$ is not a subtype of \code{Future}.
-Tools may choose to give a hint in such cases.
+\commentary{%
+It is not a compile-time error if the type of $e$ is not
+a subtype of \code{Future}.
+Tools may choose to give a hint in such cases.%
 }
 
 \LMHash{}%
@@ -10436,7 +11139,7 @@
 If no such declaration exists in the lexical scope, let $d$ be the declaration of the inherited member named \id{} if it exists.
 
 \begin{itemize}
-\item if $d$ is a prefix $p$, a compile-time error occurs unless the token immediately following $d$ is \code{'.'}.
+\item if $d$ is a prefix $p$, a compile-time error occurs unless the token immediately following $d$ is `\code{.}'.
 \item If $d$ is a class or type alias $T$, the value of $e$ is an object implementing the class \code{Type} which reifies $T$.
 \item If $d$ is a type parameter $T$, then the value of $e$ is the value of the actual type argument corresponding to $T$ that was passed to the generative constructor that created the current binding of \THIS{}.
 If, however, $e$ occurs inside a static member, a compile-time error occurs.
@@ -10511,9 +11214,8 @@
 
 \LMHash{}%
 The expression $e$ is evaluated to a value $v$.
-% TODO(eernst): https://github.com/dart-lang/sdk/issues/34521.
-Then, if $T$ is a malformed or deferred type (\ref{staticTypes}), a dynamic error occurs.
-Otherwise, if the dynamic type of $v$ is a subtype of $T$, the is-expression evaluates to \TRUE.
+If the dynamic type of $v$ is a subtype of $T$,
+the is-expression evaluates to \TRUE.
 Otherwise it evaluates to \FALSE.
 
 \commentary{
@@ -10580,9 +11282,8 @@
 
 \LMHash{}%
 The expression $e$ is evaluated to a value $v$.
-%% TODO(eernst): https://github.com/dart-lang/sdk/issues/34521
-Then, if $T$ is a malformed or deferred type (\ref{staticTypes}), a dynamic error occurs.
-It is a dynamic type error if $o$ is not the null object (\ref{null})
+% This error can occur, by design of `as`.
+It is a dynamic type error if $o$ is not the null object (\ref{null}),
 and the dynamic type of $o$ is not a subtype of $T$.
 Otherwise $e$ evaluates to $v$.
 
@@ -10696,22 +11397,24 @@
 
 \LMHash{}%
 An \Index{expression statement} consists of an expression that does not
-begin with a \syntax{`{'} character.
+begin with a \lit{\{} character.
 
 \begin{grammar}
 <expressionStatement> ::= <expression>? `;'
 \end{grammar}
 
 \LMHash{}%
-The expression of an expression statement is not allowed to begin with a \syntax{`\{'}.
+The expression of an expression statement is not allowed
+to begin with a \lit{\{}.
 \commentary{
 This means that if some source text could otherwise be parsed as an expression
-followed by a \syntax{`;'}, then this grammar production does not apply
-when the expression starts with a \syntax{`\{'}.
+followed by a \lit{;}, then this grammar production does not apply
+when the expression starts with a \lit{\{}.
 }
 \rationale{
 The restriction resolves an ambiguity while parsing where a
-\syntax{`\{'} can start either a block (\ref{blocks}) or a map literal (\ref{maps}).
+\lit{\{} can start either a block (\ref{blocks}) or
+a map literal (\ref{maps}).
 By disallowing the latter from starting an expression statement,
 the parser does not need to look further ahead
 before deciding that it is parsing a block statement.
@@ -10884,6 +11587,7 @@
 \LMHash{}%
 The expression $e$ is evaluated to an object $o$.
 Then, the variable $v$ is set to $o$.
+% This error can occur due to implicit casts.
 A dynamic type error occurs
 if the dynamic type of $o$ is not a subtype of the actual type
 (\ref{actualTypeOfADeclaration})
@@ -10999,7 +11703,8 @@
 
 \LMHash{}%
 First, the expression $b$ is evaluated to an object $o$.
-It is a run-time error if the run-time type of $o$ is not \code{bool}.
+% This error can occur due to implicit casts and null.
+It is a dynamic error if the run-time type of $o$ is not \code{bool}.
 If $o$ is \TRUE{}, then the block statement $s_1$ is executed, otherwise the block statement $s_2$ is executed.
 
 \LMHash{}%
@@ -11061,7 +11766,8 @@
 Otherwise, let $v'$ be the variable $v''$ created in the previous execution of step \ref{allocateFreshVar}.
 \item
 The expression $[v'/v]c$ is evaluated to a value $o$.
-It is a run-time error if the run-time type of $o$ is not \code{bool}.
+% This error can occur due to implicit casts and null.
+It is a dynamic error if the run-time type of $o$ is not \code{bool}.
 If $o$ is \FALSE{}, the for loop completes normally.
 Otherwise, execution continues at step \ref{beginIteration}.
 \item
@@ -11149,6 +11855,7 @@
 
 \LMHash{}%
 The expression $e$ is evaluated to an object $o$.
+% This error can occur due to implicit casts and null.
 It is a dynamic type error if $o$ is not an instance of a class that implements \code{Stream}.
 It is a compile-time error if $D$ is empty and \id{} is a final variable.
 
@@ -11234,7 +11941,8 @@
 
 \LMHash{}%
 The expression $e$ is evaluated to an object $o$.
-It is a run-time error if the run-time type of $o$ is not \code{bool}.
+% This error can occur due to implicit casts and null.
+It is a dynamic error if the run-time type of $o$ is not \code{bool}.
 
 \LMHash{}%
 If $o$ is \FALSE{}, then execution of the while statement completes normally (\ref{statementCompletion}).
@@ -11271,7 +11979,8 @@
 
 \LMHash{}%
 Then, the expression $e$ is evaluated to an object $o$.
-It is a run-time error if the run-time type of $o$ is not \code{bool}.
+% This error can occur due to implicit casts and null.
+It is a dynamic error if the run-time type of $o$ is not \code{bool}.
 If $o$ is \FALSE{}, execution of the do statement completes normally (\ref{statementCompletion}).
 If $o$ is \TRUE{}, then the do statement is re-executed.
 
@@ -11334,25 +12043,23 @@
 }
 
 \LMHash{}%
-It is a compile-time error if the class $C$ has an implementation of
-the operator \code{==} other than the one inherited from \code{Object},
-unless the expression evaluates to a string or an integer,
-the expression evaluates to an instance of the built-in
-class \code{Symbol} which was initially obtained by evaluation of a
-literal symbol or
-a constant invocation of a constructor of the \code{Symbol} class,
-or to an object implementing the built-in class \code{Type}
-which was originally created by evaluating a constant type literal
-(\ref{dynamicTypeSystem}).
+It is a compile-time error if the operator \lit{==} of class $C$
+is not primitive
+(\ref{theOperatorEqualsEquals}).
 
 \rationale{
-The prohibition on user defined equality allows us to implement the switch efficiently for user defined types.
-We could formulate matching in terms of identity instead with the same efficiency.
-However, if a type defines an equality operator, programmers would find it quite surprising that equal objects did not match.
+The prohibition on user defined equality allows us to
+implement the switch efficiently for user defined types.
+We could formulate matching in terms of identity instead,
+with the same efficiency.
+However, if a type defines an equality operator,
+programmers would presumably find it quite surprising
+if equal objects did not match.
 }
 
 \commentary{
-The \SWITCH{} statement should only be used in very limited situations (e.g., interpreters or scanners).
+The \SWITCH{} statement should only be used in
+very limited situations (e.g., interpreters or scanners).
 }
 
 \LMHash{}%
@@ -11381,7 +12088,9 @@
 
 \LMHash{}%
 The statement \code{\VAR{} \id{} = $e$;} is evaluated, where \id{} is a fresh variable.
-It is a run-time error if the value of $e$ is
+% This error can occur due to implicit casts and standard subsumption.
+%% TODO(eernst): But why couldn't $e$ be an instance of a subtype?!
+It is a dynamic error if the value of $e$ is
 not an instance of the same class as the constants $e_1, \ldots, e_n$.
 
 \commentary{
@@ -11408,7 +12117,8 @@
 
 \LMHash{}%
 The expression \code{$e_k$ == \id} is evaluated to an object $o$.
-It is a run-time error if the run-time type of $o$ is not \code{bool}.
+% This error can occur due to implicit casts and null.
+It is a dynamic error if the run-time type of $o$ is not \code{bool}.
 If $o$ is \FALSE{} the following case, \CASE{} $e_{k+1}: s_{k+1}$ is matched against \id{} if $k < n$, and if $k = n$, then the \DEFAULT{} clause's statements are executed (\ref{case-execute}).
 If $o$ is \TRUE{}, let $h$ be the smallest number such that $h \ge k$ and $s_h$ is non-empty.
 If no such $h$ exists, let $h = n + 1$.
@@ -11429,7 +12139,8 @@
 
 \LMHash{}%
 The expression \code{$e_k$ == \id} is evaluated to an object $o$.
-It is a run-time error if the run-time type of $o$ is not \code{bool}.
+% This error can occur due to implicit casts and null.
+It is a dynamic error if the run-time type of $o$ is not \code{bool}.
 If $o$ is \FALSE{} the following case, \CASE{} $e_{k+1}: s_{k+1}$ is matched against \id{} if $k < n$.
 If $o$ is \TRUE{}, let $h$ be the smallest integer such that $h \ge k$ and $s_h$ is non-empty.
 If such a $h$ exists, the case statements $s_h$ are executed (\ref{case-execute}).
@@ -11635,8 +12346,7 @@
 Otherwise the \TRY{} statement completes in the same way as the execution of $b$.
 
 \LMHash{}%
-If $T_1$ is a malformed or deferred type (\ref{staticTypes}), then performing a match causes a run-time error.
-It is a compile-time error if $T_i$, $1 \le i \le n$ is a deferred or malformed type.
+It is a compile-time error if $T_i$, $1 \le i \le n$ is a deferred type.
 
 
 \subsubsection{\ON{}-\CATCH{} clauses}
@@ -11871,8 +12581,10 @@
 \begin{itemize}
 \item
   If the body of $f$ is marked \ASYNC{} (\ref{functions})
+  % This error can occur due to implicit casts.
   it is a dynamic type error if \code{Future<$U$>} is not a subtype of $T$.
 \item
+  % This error can occur due to implicit casts.
   Otherwise, it is a dynamic type error if $U$ is not a subtype of $T$.
 \end{itemize}
 
@@ -12058,16 +12770,30 @@
 \LMHash{}%
 If the immediately enclosing function $m$ is marked \code{\SYNC*} (\ref{functions}), then:
 \begin{enumerate}
-\item It is a dynamic type error if the class of $o$ does not implement \code{Iterable}.
-Otherwise
-\item The method \code{iterator} is invoked upon $o$ returning an object $i$.
-\item \label{moveNext} The \code{moveNext} method of $i$ is invoked on it with no arguments.
-If \code{moveNext} returns \FALSE{} execution of $s$ is complete.
-Otherwise
-\item The getter \code{current} is invoked on $i$.
-If the invocation throws (\ref{evaluation}), execution of $s$ throws the same exception object and stack trace (\ref{statementCompletion}).
-Otherwise, the result $x$ of the getter invocation is added to the iterable associated with $m$.
-Execution of the function $m$ immediately enclosing $s$ is suspended until the nullary method \code{moveNext()} is invoked upon the iterator used to initiate the current invocation of $m$, at which point execution of $s$ continues at \ref{moveNext}.
+\item
+  % This error can occur due to implicit casts.
+  It is a dynamic type error
+  if the class of $o$ does not implement \code{Iterable}.
+  Otherwise
+\item
+  The method \code{iterator} is invoked upon $o$ returning an object $i$.
+\item
+  \label{moveNext} The \code{moveNext} method of $i$ is invoked on it
+  with no arguments.
+  If \code{moveNext} returns \FALSE{} execution of $s$ is complete.
+  Otherwise
+\item
+  The getter \code{current} is invoked on $i$.
+  If the invocation throws
+  (\ref{evaluation}),
+  execution of $s$ throws the same exception object and stack trace
+  (\ref{statementCompletion}).
+  Otherwise, the result $x$ of the getter invocation is added to
+  the iterable associated with $m$.
+  Execution of the function $m$ immediately enclosing $s$ is suspended
+  until the nullary method \code{moveNext()} is invoked
+  upon the iterator used to initiate the current invocation of $m$,
+  at which point execution of $s$ continues at \ref{moveNext}.
 \item
 The current call to \code{moveNext()} returns \TRUE.
 \end{enumerate}
@@ -12075,32 +12801,50 @@
 \LMHash{}%
 If $m$ is marked \code{\ASYNC*} (\ref{functions}), then:
 \begin{itemize}
-\item It is a dynamic type error if the class of $o$ does not implement \code{Stream}.
+\item
+  % This error can occur due to implicit casts.
+  It is a dynamic type error if the class of $o$
+  does not implement \code{Stream}.
 Otherwise
-\item The nearest enclosing asynchronous for loop (\ref{asynchronousFor-in}), if any, is paused.
-\item The $o$ stream is listened to, creating a subscription $s$, and for each event $x$, or error $e$ with stack trace $t$, of $s$:
+\item
+  The nearest enclosing asynchronous for loop (\ref{asynchronousFor-in}),
+  if any, is paused.
+\item
+  The $o$ stream is listened to, creating a subscription $s$,
+  and for each event $x$, or error $e$ with stack trace $t$, of $s$:
 \begin{itemize}
 \item
-If the stream $u$ associated with $m$ has been paused, then execution of $m$ is suspended until $u$ is resumed or canceled.
+  If the stream $u$ associated with $m$ has been paused,
+  then execution of $m$ is suspended until $u$ is resumed or canceled.
 \item
-If the stream $u$ associated with $m$ has been canceled,
-then $s$ is canceled by evaluating \code{\AWAIT{} v.cancel()} where $v$ is a fresh variable referencing the stream subscription $s$.
-Then, if the cancel completed normally, the stream execution of $s$ returns without a value (\ref{statementCompletion}).
+  If the stream $u$ associated with $m$ has been canceled,
+  then $s$ is canceled by evaluating \code{\AWAIT{} v.cancel()}
+  where $v$ is a fresh variable referencing the stream subscription $s$.
+  Then, if the cancel completed normally,
+  the stream execution of $s$ returns without a value
+  (\ref{statementCompletion}).
 \item
-Otherwise, $x$, or $e$ with $t$, are added to the stream associated with $m$ in the order they appear in $o$.
-The function $m$ may suspend.
+  Otherwise, $x$, or $e$ with $t$, are added to
+  the stream associated with $m$ in the order they appear in $o$.
+  The function $m$ may suspend.
 \end{itemize}
-\item If the stream $o$ is done, execution of $s$ completes normally.
+\item
+  If the stream $o$ is done, execution of $s$ completes normally.
 \end{itemize}
 
 \LMHash{}%
-It is a compile-time error if a yield-each statement appears in a function that is not a generator function.
+It is a compile-time error if a yield-each statement appears
+in a function that is not a generator function.
 
 \LMHash{}%
-Let $T$ be the static type of $e$ and let $f$ be the immediately enclosing function.
-It is a compile-time error if $T$ may not be assigned to the declared return type of $f$.
-If $f$ is synchronous it is a compile-time error if $T$ may not be assigned to \code{Iterable}.
-If $f$ is asynchronous it is a compile-time error if $T$ may not be assigned to \code{Stream}.
+Let $T$ be the static type of $e$ and let $f$ be
+the immediately enclosing function.
+It is a compile-time error if $T$ may not be assigned to
+the declared return type of $f$.
+If $f$ is synchronous it is a compile-time error
+if $T$ may not be assigned to \code{Iterable}.
+If $f$ is asynchronous it is a compile-time error
+if $T$ may not be assigned to \code{Stream}.
 
 
 \subsection{Assert}
@@ -12138,6 +12882,7 @@
 
 \LMHash{}%
 The expression $c$ is evaluated to an object $r$.
+% This error can occur due to implicit casts and null.
 It is a dynamic type error if $r$ is not of type \code{bool}.
 \commentary{
 Hence it is a compile-time error if that situation arises during evaluation of an assertion in a \CONST{} constructor invocation.
@@ -12249,8 +12994,9 @@
 Script tags are intended for use with scripts (\ref{scripts}).
 A script tag can be used to identify the interpreter of the script to whatever computing environment the script is embedded in.
 The script tag must appear before any whitespace or comments.
-A script tag begins with \syntax{`#!'} and ends at the end of the line.
-Any characters that follow \syntax{`#!'} in the script tag are ignored by the Dart implementation.
+A script tag begins with \lit{\#!} and ends at the end of the line.
+Any characters that follow \lit{\#!} in the script tag are ignored by
+the Dart implementation.
 
 \LMHash{}%
 Libraries are units of privacy.
@@ -12316,7 +13062,8 @@
 It is a compile-time error if a prefix used in a deferred import is used in another import clause.
 
 \LMHash{}%
-An import directive $I$ may optionally include a namespace combinator clauses used to restrict the set of names imported by $I$.
+An import directive $I$ may optionally include namespace combinator clauses
+used to restrict the set of names imported by $I$.
 Currently, two namespace combinators are supported: \HIDE{} and \SHOW{}.
 
 \LMHash{}%
@@ -12336,14 +13083,26 @@
 When called, the method causes an immediate import $I'$ to be executed at some future time, where $I'$ is derived from $I$ by eliding the word \DEFERRED{} and adding a \HIDE{} \code{loadLibrary} combinator clause.
 When $I'$ executes without error, $f$ completes successfully.
 If $I'$ executes without error, we say that the call to \code{loadLibrary} has succeeded, otherwise we say the call has failed.
-\item For every top level function $f$ named \id{} in the imported library $B$, a corresponding method named \id{} with the same signature as $f$.
-Calling the method results in a run-time error.
-\item For every top level getter $g$ named \id{} in $B$, a corresponding getter named \id{} with the same signature as $g$.
-Calling the method results in a run-time error.
-\item For every top level setter $s$ named \id{} in $B$, a corresponding setter named \id{} with the same signature as $s$.
-Calling the method results in a run-time error.
-\item For every type $T$ named \id{} in $B$, a corresponding getter named \id{} with return type \code{Type}.
-Calling the method results in a run-time error.
+\item
+  For every top level function $f$ named \id{} in the imported library $B$,
+  a corresponding method named \id{} with the same signature as $f$.
+  % This error can occur because being-loaded is a dynamic property.
+  Calling the method results in a dynamic error.
+\item
+  For every top level getter $g$ named \id{} in $B$,
+  a corresponding getter named \id{} with the same signature as $g$.
+  % This error can occur because being-loaded is a dynamic property.
+  Calling the method results in a dynamic error.
+\item
+  For every top level setter $s$ named \id{} in $B$,
+  a corresponding setter named \id{} with the same signature as $s$.
+  % This error can occur because being-loaded is a dynamic property.
+  Calling the method results in a dynamic error.
+\item
+  For every type $T$ named \id{} in $B$,
+  a corresponding getter named \id{} with return type \code{Type}.
+  % This error can occur because being-loaded is a dynamic property.
+  Calling the method results in a dynamic error.
 \end{itemize}
 
 \rationale{
@@ -12418,7 +13177,10 @@
 \end{itemize}
 
 \LMHash{}%
-Next, if $I$ includes a prefix clause of the form \AS{} $p$, let $NS = NS_n \cup \{p: prefixObject(NS_n)\}$ where $prefixObject(NS_n)$ is a \Index{prefix object} for the namespace $NS_n$, which is an object that has the following members:
+Next, if $I$ includes a prefix clause of the form \AS{} $p$,
+let $NS = \{p: prefixObject(NS_n)\}$ where $prefixObject(NS_n)$ is
+a \Index{prefix object} for the namespace $NS_n$,
+which is an object that has the following members:
 
 \begin{itemize}
 \item For every top level function $f$ named \id{} in $NS_n$, a corresponding method with the same name and signature as $f$ that forwards (\ref{functionDeclarations}) to $f$.
@@ -12686,7 +13448,7 @@
 Then, the top-level function defined by \code{main}
 in the exported namespace of $S$ is invoked (\ref{functionInvocation})
 as follows:
-If \code{main} can be be called with with two positional arguments,
+If \code{main} can be called with with two positional arguments,
 it is invoked with the following two actual arguments:
 \begin{enumerate}
 \item An object whose run-time type implements \code{List<String>}.
@@ -12752,7 +13514,7 @@
 \item{} Let $u$ be \metavar{uri}.
 \item{} For each of the following configuration URIs of the form \code{\IF{} ($\metavar{test}_i$) $\metavar{uri}_i$}, in source order, do the following.
 \begin{itemize}
-  \item{} If $\metavar{test}_i$ is \code{\metavar{ids}} with no \code{==} clause, it is
+  \item{} If $\metavar{test}_i$ is \code{\metavar{ids}} with no \lit{==} clause, it is
   equivalent to \code{\metavar{ids} == "true"}.
   \item{} If $\metavar{test}_i$ is \code{\metavar{ids} == \metavar{string}},
   then create a string, \metavar{key}, from \metavar{ids}
@@ -12923,19 +13685,20 @@
 \item
   $T$ has the form \id{} or the form \code{\metavar{prefix}.\id},
   and in the enclosing lexical scope,
-  the name \id{} (respectively \code{\metavar{prefix}.\id}) does not denote a type.
-
+  the name \id{} (respectively \code{\metavar{prefix}.\id})
+  does not denote a type.
 \item
   $T$ denotes a type variable in the enclosing lexical scope,
   but occurs in the signature or body of a static member.
-
-\item $T$ is a parameterized type of the form \code{$G$<$S_1, \ldots,\ S_n$>},
+\item
+  $T$ is a parameterized type of the form \code{$G$<$S_1, \ldots,\ S_n$>},
   and $G$ is malformed,
   or $G$ is not a generic type,
-  or $G$ is a generic type, but it declares $n'$ type parameters and $n' \not= n$,
+  or $G$ is a generic type,
+  but it declares $n'$ type parameters and $n' \not= n$,
   or $S_j$ is malformed for some $j \in 1 .. n$.
-
-\item $T$ is a function type of the form
+\item
+  $T$ is a function type of the form
 
   \code{$T_0$ \FUNCTION{}<$X_1\ \EXTENDS\ B_1, \ldots,\ X_m\ \EXTENDS\ B_m$>}
 
@@ -12952,24 +13715,20 @@
   where each $x_j$ which is not a named parameter may be omitted,
   and $T_j$ is malformed for some $j \in 0 .. n$,
   or $B_j$ is malformed for some $j \in 1 .. m$.
-
 \item
   $T$ denotes declarations that were imported from multiple imports clauses.
 \end{itemize}
 
 \LMHash{}%
-Any use of a malformed type gives rise to a compile-time error.
-A malformed type is then interpreted as \DYNAMIC{} by the static type checker unless explicitly specified otherwise.
-
-\rationale{
-This ensures that the developer is spared a series of cascading errors as the malformed type interacts with other types.
-}
+Any occurrence of a malformed type in a library is a compile-time error.
 
 \LMHash{}%
 A type $T$ is \IndexCustom{deferred}{type!deferred}
 if{}f it is of the form $p.T$ where $p$ is a deferred prefix.
-It is a compile-time error to use a deferred type in a type annotation, type test, type cast or as a type parameter.
-However, all other compile-time errors must be issued under the assumption that all deferred libraries have successfully been loaded.
+It is a compile-time error to use a deferred type
+in a type annotation, type test, type cast or as a type parameter.
+However, all other compile-time errors must be issued
+under the assumption that all deferred libraries have successfully been loaded.
 
 % Now, when passed to a generic, p.T also has to be treated as dynamic - otherwise we have to fail immediately. Where do we say that? And how does this fit with idea that as a type object it fails? Should we say that the accessor on p returns dynamic instead of failing? Do we distinguish its use in a constructor vs its use in an annotation? It's not that we evaluate type objects in constructor args - these cannot represent parameterized types.
 
@@ -13046,9 +13805,9 @@
 
 \LMHash{}%
 When types are reified as instances of the built-in class \code{Type},
-those objects override the \code{==} operator
+those objects override the \lit{==} operator
 inherited from the \code{Object} class, so that
-two \code{Type} objects are equal according to operator \syntax{`=='}
+two \code{Type} objects are equal according to operator \lit{==}
 if{}f the corresponding types are subtypes of each other.
 
 \commentary{
@@ -13090,6 +13849,7 @@
 A constant type literal is a constant expression (\ref{constants}).
 }
 
+
 \subsection{Type Aliases}
 \LMLabel{typedef}
 
@@ -13252,7 +14012,10 @@
 \LMHash{}%
 %% TODO(eernst): Introduce these specialized intersection types
 %% in a suitable location where type promotion is specified.
-Types of the form $X \& S$ arise during static analysis due to type promotion
+Types of the form
+\IndexCustom{$X \& S$}{type!of the form $X \& S$}%
+\IndexExtraEntry{\&@$X \& S$}
+arise during static analysis due to type promotion
 (\ref{typePromotion}).
 They never occur during execution,
 they are never a type argument of another type,
@@ -13996,7 +14759,7 @@
 
 \commentary{
 This \code{Type} object must compare equal to the corresponding \code{Type}
-objects for \code{Object} and \VOID{} according to operator `\code{==}'
+objects for \code{Object} and \VOID{} according to operator \lit{==}
 (\ref{dynamicTypeSystem}).
 }
 
@@ -14125,24 +14888,31 @@
 
 \LMHash{}%
 The built-in type declaration \code{FutureOr},
-which is declared in the library \code{dart:async},
+which is exported by the library \code{dart:async},
 defines a generic type with one type parameter (\ref{generics}).
+The type \code{FutureOr<$T$>} is a non-class type
+which is regular-bounded for all $T$.
 
-\LMHash{}%
-The \code{FutureOr<$T$>} type is a non-class type with the following
-type relations:
+\commentary{%
+The subtype relations involving \code{FutureOr} are specified elsewhere
+(\ref{subtypeRules}).
+Note, however, that they entail certain useful properties:
 \begin{itemize}
-    \item{} $T$ <: \code{FutureOr<$T$>}.
-    \item{} \code{Future<$T$>} <: \code{FutureOr<$T$>}.
-    \item{} If $T$ <: $S$ and \code{Future<$T$>} <: $S$
-        then \code{FutureOr<$T$>} <: $S$.
-        \commentary{In particular, \code{FutureOr<$T$>} <: \code{Object}.}
+\item[$\bullet$]
+  $T <: \code{FutureOr<$T$>}$.
+\item[$\bullet$]
+  $\code{Future<$T$>} <: \code{FutureOr<$T$>}$.
+\item[$\bullet$]
+  If $T <: S$ and $\code{Future<$T$>} <: S$, then $\code{FutureOr<$T$>} <: S$.
 \end{itemize}.
 
-\commentary{
-The last point guarantees that generic type \code{FutureOr} is
-\emph{covariant} in its type parameter, just like class types.
-That is, if $S$ <: $T$ then \code{FutureOr<$S$>} <: \code{FutureOr<$T$>}.
+That is, \code{FutureOr} is in a sense
+the union of $T$ and the corresponding future type.
+The last point guarantees that
+\code{FutureOr<$T$>} <: \code{Object},
+and also that \code{FutureOr} is covariant in its type parameter,
+just like class types:
+if $S$ <: $T$ then \code{FutureOr<$S$>} <: \code{FutureOr<$T$>}.%
 }
 
 \LMHash{}%
@@ -14153,42 +14923,45 @@
 denotes a \code{Type} object representing the type \code{FutureOr<dynamic>}.
 
 \rationale{
-The \code{FutureOr<\metavar{type}>} type represents a case where a value can be
-either an instance of the type \metavar{type}
-or the type \code{Future<\metavar{type}>}.
+The \code{FutureOr<$T$>} type represents a case where a value can be
+either an instance of the type $T$
+or the type \code{Future<$T$>}.
 Such cases occur naturally in asynchronous code.
-Using \code{FutureOr} instead of \DYNAMIC{} allows some tools
-to provide a more precise type analysis.
+The available alternative would be to use a top type (e.g., \DYNAMIC{}),
+but \code{FutureOr} allows some tools to provide a more precise type analysis.
 }
 
 \LMHash{}%
 The type \code{FutureOr<$T$>} has an interface that is identical to that
 of \code{Object}.
-
-\commentary{
-The only members that can be invoked on a value with static type
-\code{FutureOr<$T$>} are members that are also on \code{Object}.
+\commentary{%
+That is, only members that \code{Object} has can be invoked
+on a value with static type \code{FutureOr<$T$>}.%
 }
 
 \rationale{
 We only want to allow invocations of members that are inherited from
 a common supertype of both $T$ and \code{Future<$T$>}.
-In most cases the only common supertype is \code{Object}. The exceptions, like
-\code{FutureOr<Future<Object\gtgt} which has \code{Future<Object>} as common
-supertype, are few and not practically useful, so for now we choose to
-only allow invocations of members inherited from \code{Object}.
+In most cases the only common supertype is \code{Object}.
+The exceptions, like \code{FutureOr<Future<Object\gtgt}
+which has \code{Future<Object>} as common supertype,
+are few and not practically useful,
+so for now we choose to only allow invocations of
+members inherited from \code{Object}.
 }
 
 \LMHash{}%
 We define the auxiliary function
-\IndexCustom{\basetype{T}}{basetype(t)@\emph{basetype}$(T)$}
+\IndexCustom{\futureOrBase{T}}{futureOrBase(t)@\emph{futureOrBase}$(T)$}
 as follows:
 
 \begin{itemize}
-\item If $T$ is \code{FutureOr<$S$>} for some $S$ then $\basetype{T} = \basetype{S}$.
-\item Otherwise $\basetype{T} = T$.
+\item If $T$ is \code{FutureOr<$S$>} for some $S$
+  then $\futureOrBase{T} = \futureOrBase{S}$.
+\item Otherwise $\futureOrBase{T} = T$.
 \end{itemize}
 
+
 \subsection{Type Void}
 \LMLabel{typeVoid}
 
@@ -14225,7 +14998,7 @@
 the value of an expression of type \VOID.
 %
 Consequently, any instance of type \code{Type} which reifies the type \VOID{}
-must compare equal (according to the \code{==} operator \ref{equality})
+must compare equal (according to the \lit{==} operator \ref{equality})
 to any instance of \code{Type} which reifies the type \code{Object}
 (\ref{dynamicTypeSystem}).
 It is not guaranteed that \code{identical(\VOID, Object)} evaluates to true.
@@ -14381,7 +15154,8 @@
 because it has type \VOID.%
 }
 
-\paragraph{Void Soundness}
+
+\subsubsection{Void Soundness}
 \LMLabel{voidSoundness}
 
 \LMHash{}%
diff --git a/docs/language/informal/generic-function-instantiation.md b/docs/language/informal/generic-function-instantiation.md
index 50098c2..80e9241 100644
--- a/docs/language/informal/generic-function-instantiation.md
+++ b/docs/language/informal/generic-function-instantiation.md
@@ -1,10 +1,11 @@
 # Generic Function Instantiation
 
-Author: eernst@.
+**Author**: eernst@.
 
-Version: 0.3 (2018-04-05)
+**Version**: 0.3 (2018-04-05)
 
-Status: Under implementation.
+**Status**: This document is now background material.
+For normative text, please consult the language specification.
 
 **This document** is a Dart 2 feature specification of _generic function
 instantiation_, which is the feature that implicitly coerces a reference to
diff --git a/docs/language/informal/subtyping.md b/docs/language/informal/subtyping.md
new file mode 100644
index 0000000..dedd41a
--- /dev/null
+++ b/docs/language/informal/subtyping.md
@@ -0,0 +1,9 @@
+# Dart 2.0 Static and Runtime Subtyping
+
+leafp@google.com
+
+**Status**: This document has been integrated into the language specification.
+Also, an updated version taking non-null types into account exists
+[here](https://github.com/dart-lang/language/blob/master/resources/type-system/subtyping.md).
+
+**Contents of this document**: Deleted.
diff --git a/docs/process/breaking-changes.md b/docs/process/breaking-changes.md
new file mode 100644
index 0000000..adf71a2
--- /dev/null
+++ b/docs/process/breaking-changes.md
@@ -0,0 +1,155 @@
+# Dart SDK breaking change process
+
+The present document describes the Dart SDK philosophy for compatibility, and
+process for breaking changes.
+
+## Dart compatibility and philosophy
+
+Generally the Dart team strives to not make breaking changes, and to preserve
+compatibility of all Dart programs across stable Dart SDK releases. However, on
+occasion, we believe that breaking changes are needed, or justified:
+
+* Security: To resolve a security issue in the specification or implementation.
+
+* Unspecified behavior: Programs that depend on unspecified behavior may break
+  as such behavior is specified and implemented.
+
+* Implementation bugs: If the implementation deviates unintentionally from the
+  specification, programs may break as we rectify the implementation.
+
+* Evolution: If we deem that there is a very large benefit to changing current
+  behavior, we may choose to do so after careful consideration of the associated
+  impact of the change.
+
+## Scope of compatibility
+
+It is not practical to offer compatability to programs that do not follow
+best practices. Thus, the breaking change process assumes that programs
+abide by the following basic conditions:
+
+* Must contain no static analysis **errors**.
+
+* Must not rely on a certain runtime **error** being thrown (in other words, 
+  a new SDK might throw fewer errors than an old SDK).
+
+* Must access libraries via the public API (for example, must not reach into
+  the internals of a package located in the `/src/` directory).
+
+* Must not rely on an [experiment flag](flags.md).
+
+* Must not circumvent clear restrictions documented in the public API
+  documentation (for example, must not mixin a class clearly documented as
+  not intended to be used as a mixin).
+
+Compatibility is only considered between stable releases (i.e. releases from the
+[Dart stable
+channel](https://www.dartlang.org/tools/sdk/archive#stable-channel)).
+
+## Breaking change notification
+
+Anyone wishing to make a breaking change to Dart is expected to perform the
+following steps.  It is expected that all of these steps are followed prior
+to a change being released in a dev channel release.
+
+### Step 1: Announcement
+
+* Create an issue in the Dart SDK issue tracker labelled
+  `breaking-change-request` containing the following:
+
+  * The intended change in behavior.
+
+  * The justification/rationale for making the change.
+
+  * The expected impact of this change.
+
+  * Clear steps for mitigating the change.
+
+[TODO: Link to an issue template for this]
+
+* Email `announce@dartlang.org, flutter-announce@googlegroups.com`,:
+
+  * Subject: 'Breaking change [bug ID]: [short summary]'
+
+  * Very short summary of the intended change
+
+  * Link to the above mentioned issue
+
+  * A request that developers may leave comments in the linked issue, if this
+    breaking change poses a severe problem.
+
+### Step 2: Approval
+
+If there is a general agreement that the benefit of the change outweighs the
+cost of the change, a set of Dart SDK approvers will approve the change.
+Adequate time must be allowed after step 1, at a minimum 24 hours during the
+work week for smaller impact changes, and proportionally longer for higher
+impact changes.
+### Step 3: Execution
+
+If approved, the change may be made.
+
+After the breaking change had been made, the person who made the change must:
+
+* Resolve the breaking change issue and make a note that the change has landed
+
+* Make a note in the [Dart SDK changelog](`changelog.md`) detailing the change.
+  This must be prefixed `** Breaking change:`.
+
+* Reply to the original announcement email, and make a note that the change is
+  being implemented.
+
+If not approved, or if the requestor decides to not pursue the change, the
+requestor must:
+
+* Reply to the original announcement email, and make a note that the change is
+  has been rejected, with a quick summary of the rationale for that.
+## Unexpected breaking changes & roll-back requests
+
+If a developer notices a breaking change has been made in the dev or stable
+channels, and this change impacts a program that abides to the above defined
+scope of compatibility, and for which either:
+
+  * No breaking change was announced, or
+
+  * The impact of the change was significantly larger than described in the
+    breaking change announcement
+
+, then they may file a 'request for roll-back' using the following steps:
+
+* Create an issue in the Dart SDK issue tracker labelled
+  `roll-back-request` containing the following:
+
+  * If applicable, a link to the associated breaking change request issue
+
+  * A clear description of the actual impact, and if applicable a description of
+    how this differs from the expected impact.
+
+  * A link to the program that was affected, or another program that illustrated
+    the same effect.
+
+[TODO: Link to an issue template for this]
+
+Upon receiving such an issue the Dart SDK team will either:
+
+  * Roll-back the change, or
+
+  * Make a quick corrective action to correct the change, or
+
+  * Detail how the change in their opinion does not warrant a roll-back.
+
+If a breaking change is rolled-back, in addition:
+
+  * The breaking change request issue should be reopened
+
+### Roll-backs following unexpected changes
+
+If a roll-back occurs after what should have been a breaking change, the
+originator of the change is expected to follow the breaking change process to
+move forward.
+
+If a roll-back occurs after a breaking change, but where the impact was larger
+than anticipated, then the impacted party is expected to make a best effort to
+quickly rectify their program to either not be affected by the breaking change,
+or in some other way offer the originator a clear timeline for when the breaking
+change can be landed.
+
diff --git a/pkg/analysis_server/lib/lsp_protocol/protocol_custom_generated.dart b/pkg/analysis_server/lib/lsp_protocol/protocol_custom_generated.dart
new file mode 100644
index 0000000..dc8817d
--- /dev/null
+++ b/pkg/analysis_server/lib/lsp_protocol/protocol_custom_generated.dart
@@ -0,0 +1,66 @@
+// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// This file has been automatically generated. Please do not edit it manually.
+// To regenerate the file, use the script
+// "pkg/analysis_server/tool/lsp_spec/generate_all.dart".
+
+// ignore_for_file: deprecated_member_use
+// ignore_for_file: deprecated_member_use_from_same_package
+// ignore_for_file: unnecessary_brace_in_string_interps
+// ignore_for_file: unused_import
+
+import 'dart:core' hide deprecated;
+import 'dart:core' as core show deprecated;
+import 'dart:convert' show JsonEncoder;
+import 'package:analysis_server/lsp_protocol/protocol_special.dart';
+import 'package:analysis_server/src/protocol/protocol_internal.dart'
+    show listEqual, mapEqual;
+import 'package:analyzer/src/generated/utilities_general.dart';
+
+const jsonEncoder = const JsonEncoder.withIndent('    ');
+
+class DartDiagnosticServer implements ToJsonable {
+  DartDiagnosticServer(this.port) {
+    if (port == null) {
+      throw 'port is required but was not provided';
+    }
+  }
+  static DartDiagnosticServer fromJson(Map<String, dynamic> json) {
+    final port = json['port'];
+    return new DartDiagnosticServer(port);
+  }
+
+  final num port;
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> __result = {};
+    __result['port'] = port ?? (throw 'port is required but was not set');
+    return __result;
+  }
+
+  static bool canParse(Object obj) {
+    return obj is Map<String, dynamic> &&
+        obj.containsKey('port') &&
+        obj['port'] is num;
+  }
+
+  @override
+  bool operator ==(other) {
+    if (other is DartDiagnosticServer) {
+      return port == other.port && true;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, port.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+
+  @override
+  String toString() => jsonEncoder.convert(toJson());
+}
diff --git a/pkg/analysis_server/lib/lsp_protocol/protocol_generated.dart b/pkg/analysis_server/lib/lsp_protocol/protocol_generated.dart
index 8e0f2a2..e0484bf 100644
--- a/pkg/analysis_server/lib/lsp_protocol/protocol_generated.dart
+++ b/pkg/analysis_server/lib/lsp_protocol/protocol_generated.dart
@@ -7,7 +7,9 @@
 // "pkg/analysis_server/tool/lsp_spec/generate_all.dart".
 
 // ignore_for_file: deprecated_member_use
+// ignore_for_file: deprecated_member_use_from_same_package
 // ignore_for_file: unnecessary_brace_in_string_interps
+// ignore_for_file: unused_import
 
 import 'dart:core' hide deprecated;
 import 'dart:core' as core show deprecated;
@@ -4980,10 +4982,15 @@
   /// range at the mouse position.
   final Range originSelectionRange;
 
-  /// The full target range of this link.
+  /// The full target range of this link. If the target for example is a symbol
+  /// then target range is the range enclosing this symbol not including
+  /// leading/trailing whitespace but everything else like comments. This
+  /// information is typically used to highlight the range in the editor.
   final Range targetRange;
 
-  /// The span of this link.
+  /// The range that should be selected and revealed when this link is being
+  /// followed, e.g the name of a function. Must be contained by the the
+  /// `targetRange`. See also `DocumentSymbol#range`
   final Range targetSelectionRange;
 
   /// The target resource identifier of this link.
@@ -4998,9 +5005,8 @@
         targetUri ?? (throw 'targetUri is required but was not set');
     __result['targetRange'] =
         targetRange ?? (throw 'targetRange is required but was not set');
-    if (targetSelectionRange != null) {
-      __result['targetSelectionRange'] = targetSelectionRange;
-    }
+    __result['targetSelectionRange'] = targetSelectionRange ??
+        (throw 'targetSelectionRange is required but was not set');
     return __result;
   }
 
@@ -5009,7 +5015,9 @@
         obj.containsKey('targetUri') &&
         obj['targetUri'] is String &&
         obj.containsKey('targetRange') &&
-        Range.canParse(obj['targetRange']);
+        Range.canParse(obj['targetRange']) &&
+        obj.containsKey('targetSelectionRange') &&
+        Range.canParse(obj['targetSelectionRange']);
   }
 
   @override
@@ -5353,234 +5361,182 @@
 
 /// Valid LSP methods known at the time of code generation from the spec.
 class Method {
-  const Method._(this._value);
+  const Method(this._value);
   const Method.fromJson(this._value);
 
   final String _value;
 
   static bool canParse(Object obj) {
-    switch (obj) {
-      case r'$/cancelRequest':
-      case r'initialize':
-      case r'initialized':
-      case r'shutdown':
-      case r'exit':
-      case r'window/showMessage':
-      case r'window/showMessageRequest':
-      case r'window/logMessage':
-      case r'telemetry/event':
-      case r'client/registerCapability':
-      case r'client/unregisterCapability':
-      case r'workspace/workspaceFolders':
-      case r'workspace/didChangeWorkspaceFolders':
-      case r'workspace/configuration':
-      case r'workspace/didChangeWatchedFiles':
-      case r'workspace/symbol':
-      case r'workspace/executeCommand':
-      case r'workspace/applyEdit':
-      case r'textDocument/didOpen':
-      case r'textDocument/didChange':
-      case r'textDocument/willSave':
-      case r'textDocument/willSaveWaitUntil':
-      case r'textDocument/didClose':
-      case r'textDocument/publishDiagnostics':
-      case r'textDocument/completion':
-      case r'completionItem/resolve':
-      case r'textDocument/hover':
-      case r'textDocument/signatureHelp':
-      case r'textDocument/declaration':
-      case r'textDocument/definition':
-      case r'textDocument/typeDefinition':
-      case r'textDocument/implementation':
-      case r'textDocument/references':
-      case r'textDocument/documentHighlight':
-      case r'textDocument/documentSymbol':
-      case r'textDocument/codeAction':
-      case r'textDocument/codeLens':
-      case r'codeLens/resolve':
-      case r'textDocument/documentLink':
-      case r'documentLink/resolve':
-      case r'textDocument/documentColor':
-      case r'textDocument/colorPresentation':
-      case r'textDocument/formatting':
-      case r'textDocument/onTypeFormatting':
-      case r'textDocument/rename':
-      case r'textDocument/prepareRename':
-      case r'textDocument/foldingRange':
-        return true;
-    }
-    return false;
+    return obj is String;
   }
 
   /// Constant for the '$/cancelRequest' method.
-  static const cancelRequest = const Method._(r'$/cancelRequest');
+  static const cancelRequest = const Method(r'$/cancelRequest');
 
   /// Constant for the 'initialize' method.
-  static const initialize = const Method._(r'initialize');
+  static const initialize = const Method(r'initialize');
 
   /// Constant for the 'initialized' method.
-  static const initialized = const Method._(r'initialized');
+  static const initialized = const Method(r'initialized');
 
   /// Constant for the 'shutdown' method.
-  static const shutdown = const Method._(r'shutdown');
+  static const shutdown = const Method(r'shutdown');
 
   /// Constant for the 'exit' method.
-  static const exit = const Method._(r'exit');
+  static const exit = const Method(r'exit');
 
   /// Constant for the 'window/showMessage' method.
-  static const window_showMessage = const Method._(r'window/showMessage');
+  static const window_showMessage = const Method(r'window/showMessage');
 
   /// Constant for the 'window/showMessageRequest' method.
   static const window_showMessageRequest =
-      const Method._(r'window/showMessageRequest');
+      const Method(r'window/showMessageRequest');
 
   /// Constant for the 'window/logMessage' method.
-  static const window_logMessage = const Method._(r'window/logMessage');
+  static const window_logMessage = const Method(r'window/logMessage');
 
   /// Constant for the 'telemetry/event' method.
-  static const telemetry_event = const Method._(r'telemetry/event');
+  static const telemetry_event = const Method(r'telemetry/event');
 
   /// Constant for the 'client/registerCapability' method.
   static const client_registerCapability =
-      const Method._(r'client/registerCapability');
+      const Method(r'client/registerCapability');
 
   /// Constant for the 'client/unregisterCapability' method.
   static const client_unregisterCapability =
-      const Method._(r'client/unregisterCapability');
+      const Method(r'client/unregisterCapability');
 
   /// Constant for the 'workspace/workspaceFolders' method.
   static const workspace_workspaceFolders =
-      const Method._(r'workspace/workspaceFolders');
+      const Method(r'workspace/workspaceFolders');
 
   /// Constant for the 'workspace/didChangeWorkspaceFolders' method.
   static const workspace_didChangeWorkspaceFolders =
-      const Method._(r'workspace/didChangeWorkspaceFolders');
+      const Method(r'workspace/didChangeWorkspaceFolders');
 
   /// Constant for the 'workspace/configuration' method.
   static const workspace_configuration =
-      const Method._(r'workspace/configuration');
+      const Method(r'workspace/configuration');
 
   /// Constant for the 'workspace/didChangeWatchedFiles' method.
   static const workspace_didChangeWatchedFiles =
-      const Method._(r'workspace/didChangeWatchedFiles');
+      const Method(r'workspace/didChangeWatchedFiles');
 
   /// Constant for the 'workspace/symbol' method.
-  static const workspace_symbol = const Method._(r'workspace/symbol');
+  static const workspace_symbol = const Method(r'workspace/symbol');
 
   /// Constant for the 'workspace/executeCommand' method.
   static const workspace_executeCommand =
-      const Method._(r'workspace/executeCommand');
+      const Method(r'workspace/executeCommand');
 
   /// Constant for the 'workspace/applyEdit' method.
-  static const workspace_applyEdit = const Method._(r'workspace/applyEdit');
+  static const workspace_applyEdit = const Method(r'workspace/applyEdit');
 
   /// Constant for the 'textDocument/didOpen' method.
-  static const textDocument_didOpen = const Method._(r'textDocument/didOpen');
+  static const textDocument_didOpen = const Method(r'textDocument/didOpen');
 
   /// Constant for the 'textDocument/didChange' method.
-  static const textDocument_didChange =
-      const Method._(r'textDocument/didChange');
+  static const textDocument_didChange = const Method(r'textDocument/didChange');
 
   /// Constant for the 'textDocument/willSave' method.
-  static const textDocument_willSave = const Method._(r'textDocument/willSave');
+  static const textDocument_willSave = const Method(r'textDocument/willSave');
 
   /// Constant for the 'textDocument/willSaveWaitUntil' method.
   static const textDocument_willSaveWaitUntil =
-      const Method._(r'textDocument/willSaveWaitUntil');
+      const Method(r'textDocument/willSaveWaitUntil');
 
   /// Constant for the 'textDocument/didClose' method.
-  static const textDocument_didClose = const Method._(r'textDocument/didClose');
+  static const textDocument_didClose = const Method(r'textDocument/didClose');
 
   /// Constant for the 'textDocument/publishDiagnostics' method.
   static const textDocument_publishDiagnostics =
-      const Method._(r'textDocument/publishDiagnostics');
+      const Method(r'textDocument/publishDiagnostics');
 
   /// Constant for the 'textDocument/completion' method.
   static const textDocument_completion =
-      const Method._(r'textDocument/completion');
+      const Method(r'textDocument/completion');
 
   /// Constant for the 'completionItem/resolve' method.
-  static const completionItem_resolve =
-      const Method._(r'completionItem/resolve');
+  static const completionItem_resolve = const Method(r'completionItem/resolve');
 
   /// Constant for the 'textDocument/hover' method.
-  static const textDocument_hover = const Method._(r'textDocument/hover');
+  static const textDocument_hover = const Method(r'textDocument/hover');
 
   /// Constant for the 'textDocument/signatureHelp' method.
   static const textDocument_signatureHelp =
-      const Method._(r'textDocument/signatureHelp');
+      const Method(r'textDocument/signatureHelp');
 
   /// Constant for the 'textDocument/declaration' method.
   static const textDocument_declaration =
-      const Method._(r'textDocument/declaration');
+      const Method(r'textDocument/declaration');
 
   /// Constant for the 'textDocument/definition' method.
   static const textDocument_definition =
-      const Method._(r'textDocument/definition');
+      const Method(r'textDocument/definition');
 
   /// Constant for the 'textDocument/typeDefinition' method.
   static const textDocument_typeDefinition =
-      const Method._(r'textDocument/typeDefinition');
+      const Method(r'textDocument/typeDefinition');
 
   /// Constant for the 'textDocument/implementation' method.
   static const textDocument_implementation =
-      const Method._(r'textDocument/implementation');
+      const Method(r'textDocument/implementation');
 
   /// Constant for the 'textDocument/references' method.
   static const textDocument_references =
-      const Method._(r'textDocument/references');
+      const Method(r'textDocument/references');
 
   /// Constant for the 'textDocument/documentHighlight' method.
   static const textDocument_documentHighlight =
-      const Method._(r'textDocument/documentHighlight');
+      const Method(r'textDocument/documentHighlight');
 
   /// Constant for the 'textDocument/documentSymbol' method.
   static const textDocument_documentSymbol =
-      const Method._(r'textDocument/documentSymbol');
+      const Method(r'textDocument/documentSymbol');
 
   /// Constant for the 'textDocument/codeAction' method.
   static const textDocument_codeAction =
-      const Method._(r'textDocument/codeAction');
+      const Method(r'textDocument/codeAction');
 
   /// Constant for the 'textDocument/codeLens' method.
-  static const textDocument_codeLens = const Method._(r'textDocument/codeLens');
+  static const textDocument_codeLens = const Method(r'textDocument/codeLens');
 
   /// Constant for the 'codeLens/resolve' method.
-  static const codeLens_resolve = const Method._(r'codeLens/resolve');
+  static const codeLens_resolve = const Method(r'codeLens/resolve');
 
   /// Constant for the 'textDocument/documentLink' method.
   static const textDocument_documentLink =
-      const Method._(r'textDocument/documentLink');
+      const Method(r'textDocument/documentLink');
 
   /// Constant for the 'documentLink/resolve' method.
-  static const documentLink_resolve = const Method._(r'documentLink/resolve');
+  static const documentLink_resolve = const Method(r'documentLink/resolve');
 
   /// Constant for the 'textDocument/documentColor' method.
   static const textDocument_documentColor =
-      const Method._(r'textDocument/documentColor');
+      const Method(r'textDocument/documentColor');
 
   /// Constant for the 'textDocument/colorPresentation' method.
   static const textDocument_colorPresentation =
-      const Method._(r'textDocument/colorPresentation');
+      const Method(r'textDocument/colorPresentation');
 
   /// Constant for the 'textDocument/formatting' method.
   static const textDocument_formatting =
-      const Method._(r'textDocument/formatting');
+      const Method(r'textDocument/formatting');
 
   /// Constant for the 'textDocument/onTypeFormatting' method.
   static const textDocument_onTypeFormatting =
-      const Method._(r'textDocument/onTypeFormatting');
+      const Method(r'textDocument/onTypeFormatting');
 
   /// Constant for the 'textDocument/rename' method.
-  static const textDocument_rename = const Method._(r'textDocument/rename');
+  static const textDocument_rename = const Method(r'textDocument/rename');
 
   /// Constant for the 'textDocument/prepareRename' method.
   static const textDocument_prepareRename =
-      const Method._(r'textDocument/prepareRename');
+      const Method(r'textDocument/prepareRename');
 
   /// Constant for the 'textDocument/foldingRange' method.
   static const textDocument_foldingRange =
-      const Method._(r'textDocument/foldingRange');
+      const Method(r'textDocument/foldingRange');
 
   Object toJson() => _value;
 
@@ -6668,9 +6624,9 @@
   /// A number indicating the error type that occurred.
   final ErrorCodes code;
 
-  /// A Primitive or Structured value that contains additional information about
-  /// the error. Can be omitted.
-  final D data;
+  /// A string that contains additional information about the error. Can be
+  /// omitted.
+  final String data;
 
   /// A string providing a short description of the error.
   final String message;
diff --git a/pkg/analysis_server/lib/src/analysis_server.dart b/pkg/analysis_server/lib/src/analysis_server.dart
index a917fb1..aff4e6b 100644
--- a/pkg/analysis_server/lib/src/analysis_server.dart
+++ b/pkg/analysis_server/lib/src/analysis_server.dart
@@ -155,11 +155,6 @@
   final StreamController _onAnalysisSetChangedController =
       new StreamController.broadcast(sync: true);
 
-  /// The DiagnosticServer for this AnalysisServer. If available, it can be used
-  /// to start an http diagnostics server or return the port for an existing
-  /// server.
-  final DiagnosticServer diagnosticServer;
-
   final DetachableFileSystemManager detachableFileSystemManager;
 
   /// Initialize a newly created server to receive requests from and send
@@ -175,11 +170,11 @@
     AnalysisServerOptions options,
     this.sdkManager,
     this.instrumentationService, {
-    this.diagnosticServer,
+    DiagnosticServer diagnosticServer,
     ResolverProvider fileResolverProvider: null,
     ResolverProvider packageResolverProvider: null,
     this.detachableFileSystemManager: null,
-  }) : super(options, baseResourceProvider) {
+  }) : super(options, diagnosticServer, baseResourceProvider) {
     notificationManager = new NotificationManager(channel, resourceProvider);
 
     pluginManager = new PluginManager(
@@ -351,6 +346,12 @@
     });
   }
 
+  /// Return `true` if the [path] is both absolute and normalized.
+  bool isAbsoluteAndNormalized(String path) {
+    var pathContext = resourceProvider.pathContext;
+    return pathContext.isAbsolute(path) && pathContext.normalize(path) == path;
+  }
+
   /// Return `true` if analysis is complete.
   bool isAnalysisComplete() {
     return !analysisDriverScheduler.isAnalyzing;
@@ -382,6 +383,16 @@
     channel.sendResponse(response);
   }
 
+  /// If the [path] is not a valid file path, that is absolute and normalized,
+  /// send an error response, and return `true`. If OK then return `false`.
+  bool sendResponseErrorIfInvalidFilePath(Request request, String path) {
+    if (!isAbsoluteAndNormalized(path)) {
+      sendResponse(Response.invalidFilePathFormat(request, path));
+      return true;
+    }
+    return false;
+  }
+
   /// Sends a `server.error` notification.
   void sendServerErrorNotification(
     String message,
diff --git a/pkg/analysis_server/lib/src/analysis_server_abstract.dart b/pkg/analysis_server/lib/src/analysis_server_abstract.dart
index f784b71..b0b3d34 100644
--- a/pkg/analysis_server/lib/src/analysis_server_abstract.dart
+++ b/pkg/analysis_server/lib/src/analysis_server_abstract.dart
@@ -8,6 +8,7 @@
 import 'package:analysis_server/src/analysis_server.dart';
 import 'package:analysis_server/src/collections.dart';
 import 'package:analysis_server/src/context_manager.dart';
+import 'package:analysis_server/src/server/diagnostic_server.dart';
 import 'package:analysis_server/src/services/correction/namespace.dart';
 import 'package:analysis_server/src/services/search/element_visitors.dart';
 import 'package:analyzer/dart/analysis/results.dart';
@@ -38,6 +39,11 @@
   /// context directories.
   ContextManager contextManager;
 
+  /// The DiagnosticServer for this AnalysisServer. If available, it can be used
+  /// to start an http diagnostics server or return the port for an existing
+  /// server.
+  final DiagnosticServer diagnosticServer;
+
   /// A [RecentBuffer] of the most recent exceptions encountered by the analysis
   /// server.
   final RecentBuffer<ServerException> exceptions = new RecentBuffer(10);
@@ -73,7 +79,8 @@
   /// list is lazily created and should be accessed using [analyzedFilesGlobs].
   List<Glob> _analyzedFilesGlobs = null;
 
-  AbstractAnalysisServer(this.options, ResourceProvider baseResourceProvider)
+  AbstractAnalysisServer(this.options, this.diagnosticServer,
+      ResourceProvider baseResourceProvider)
       : resourceProvider = OverlayResourceProvider(baseResourceProvider) {
     performance = performanceDuringStartup;
   }
@@ -239,4 +246,13 @@
         .getResult(path, sendCachedToStream: sendCachedToStream)
         .catchError((_) => null);
   }
+
+  /// Return the unresolved unit for the file with the given [path].
+  ParsedUnitResult getParsedUnit(String path) {
+    if (!AnalysisEngine.isDartFileName(path)) {
+      return null;
+    }
+
+    return getAnalysisDriver(path)?.currentSession?.getParsedUnit(path);
+  }
 }
diff --git a/pkg/analysis_server/lib/src/computer/computer_highlights.dart b/pkg/analysis_server/lib/src/computer/computer_highlights.dart
index 39c1e8e..dddc8b4 100644
--- a/pkg/analysis_server/lib/src/computer/computer_highlights.dart
+++ b/pkg/analysis_server/lib/src/computer/computer_highlights.dart
@@ -415,6 +415,20 @@
   }
 
   @override
+  void visitCollectionForElement(CollectionForElement node) {
+    computer._addRegion_token(node.awaitKeyword, HighlightRegionType.BUILT_IN);
+    computer._addRegion_token(node.forKeyword, HighlightRegionType.KEYWORD);
+    super.visitCollectionForElement(node);
+  }
+
+  @override
+  void visitCollectionIfElement(CollectionIfElement node) {
+    computer._addRegion_token(node.ifKeyword, HighlightRegionType.KEYWORD);
+    computer._addRegion_token(node.elseKeyword, HighlightRegionType.KEYWORD);
+    super.visitCollectionIfElement(node);
+  }
+
+  @override
   void visitConstructorDeclaration(ConstructorDeclaration node) {
     computer._addRegion_token(
         node.externalKeyword, HighlightRegionType.BUILT_IN);
@@ -475,6 +489,18 @@
   }
 
   @override
+  void visitForEachPartsWithDeclaration(ForEachPartsWithDeclaration node) {
+    computer._addRegion_token(node.inKeyword, HighlightRegionType.KEYWORD);
+    super.visitForEachPartsWithDeclaration(node);
+  }
+
+  @override
+  void visitForEachPartsWithIdentifier(ForEachPartsWithIdentifier node) {
+    computer._addRegion_token(node.inKeyword, HighlightRegionType.KEYWORD);
+    super.visitForEachPartsWithIdentifier(node);
+  }
+
+  @override
   void visitForEachStatement(ForEachStatement node) {
     computer._addRegion_token(node.awaitKeyword, HighlightRegionType.BUILT_IN);
     computer._addRegion_token(node.forKeyword, HighlightRegionType.KEYWORD);
@@ -489,6 +515,13 @@
   }
 
   @override
+  void visitForStatement2(ForStatement2 node) {
+    computer._addRegion_token(node.awaitKeyword, HighlightRegionType.BUILT_IN);
+    computer._addRegion_token(node.forKeyword, HighlightRegionType.KEYWORD);
+    super.visitForStatement2(node);
+  }
+
+  @override
   void visitFunctionDeclaration(FunctionDeclaration node) {
     computer._addRegion_token(
         node.externalKeyword, HighlightRegionType.BUILT_IN);
@@ -526,6 +559,7 @@
   @override
   void visitIfStatement(IfStatement node) {
     computer._addRegion_token(node.ifKeyword, HighlightRegionType.KEYWORD);
+    computer._addRegion_token(node.elseKeyword, HighlightRegionType.KEYWORD);
     super.visitIfStatement(node);
   }
 
@@ -581,6 +615,27 @@
   }
 
   @override
+  void visitListLiteral2(ListLiteral2 node) {
+    computer._addRegion_node(node, HighlightRegionType.LITERAL_LIST);
+    computer._addRegion_token(node.constKeyword, HighlightRegionType.KEYWORD);
+    super.visitListLiteral2(node);
+  }
+
+  @override
+  void visitMapForElement(MapForElement node) {
+    computer._addRegion_token(node.awaitKeyword, HighlightRegionType.BUILT_IN);
+    computer._addRegion_token(node.forKeyword, HighlightRegionType.KEYWORD);
+    super.visitMapForElement(node);
+  }
+
+  @override
+  void visitMapIfElement(MapIfElement node) {
+    computer._addRegion_token(node.ifKeyword, HighlightRegionType.KEYWORD);
+    computer._addRegion_token(node.elseKeyword, HighlightRegionType.KEYWORD);
+    super.visitMapIfElement(node);
+  }
+
+  @override
   void visitMapLiteral(MapLiteral node) {
     computer._addRegion_node(node, HighlightRegionType.LITERAL_MAP);
     computer._addRegion_token(node.constKeyword, HighlightRegionType.KEYWORD);
@@ -588,6 +643,13 @@
   }
 
   @override
+  void visitMapLiteral2(MapLiteral2 node) {
+    computer._addRegion_node(node, HighlightRegionType.LITERAL_MAP);
+    computer._addRegion_token(node.constKeyword, HighlightRegionType.KEYWORD);
+    super.visitMapLiteral2(node);
+  }
+
+  @override
   void visitMethodDeclaration(MethodDeclaration node) {
     computer._addRegion_token(
         node.externalKeyword, HighlightRegionType.BUILT_IN);
@@ -652,6 +714,20 @@
   }
 
   @override
+  void visitSetLiteral(SetLiteral node) {
+//    computer._addRegion_node(node, HighlightRegionType.LITERAL_SET);
+    computer._addRegion_token(node.constKeyword, HighlightRegionType.KEYWORD);
+    super.visitSetLiteral(node);
+  }
+
+  @override
+  void visitSetLiteral2(SetLiteral2 node) {
+//    computer._addRegion_node(node, HighlightRegionType.LITERAL_SET);
+    computer._addRegion_token(node.constKeyword, HighlightRegionType.KEYWORD);
+    super.visitSetLiteral2(node);
+  }
+
+  @override
   void visitShowCombinator(ShowCombinator node) {
     computer._addRegion_token(node.keyword, HighlightRegionType.BUILT_IN);
     super.visitShowCombinator(node);
diff --git a/pkg/analysis_server/lib/src/computer/computer_highlights2.dart b/pkg/analysis_server/lib/src/computer/computer_highlights2.dart
index 6ae85e2..aaea61e 100644
--- a/pkg/analysis_server/lib/src/computer/computer_highlights2.dart
+++ b/pkg/analysis_server/lib/src/computer/computer_highlights2.dart
@@ -506,6 +506,20 @@
   }
 
   @override
+  void visitCollectionForElement(CollectionForElement node) {
+    computer._addRegion_token(node.awaitKeyword, HighlightRegionType.BUILT_IN);
+    computer._addRegion_token(node.forKeyword, HighlightRegionType.KEYWORD);
+    super.visitCollectionForElement(node);
+  }
+
+  @override
+  void visitCollectionIfElement(CollectionIfElement node) {
+    computer._addRegion_token(node.ifKeyword, HighlightRegionType.KEYWORD);
+    computer._addRegion_token(node.elseKeyword, HighlightRegionType.KEYWORD);
+    super.visitCollectionIfElement(node);
+  }
+
+  @override
   void visitConstructorDeclaration(ConstructorDeclaration node) {
     computer._addRegion_token(
         node.externalKeyword, HighlightRegionType.BUILT_IN);
@@ -566,6 +580,18 @@
   }
 
   @override
+  void visitForEachPartsWithDeclaration(ForEachPartsWithDeclaration node) {
+    computer._addRegion_token(node.inKeyword, HighlightRegionType.KEYWORD);
+    super.visitForEachPartsWithDeclaration(node);
+  }
+
+  @override
+  void visitForEachPartsWithIdentifier(ForEachPartsWithIdentifier node) {
+    computer._addRegion_token(node.inKeyword, HighlightRegionType.KEYWORD);
+    super.visitForEachPartsWithIdentifier(node);
+  }
+
+  @override
   void visitForEachStatement(ForEachStatement node) {
     computer._addRegion_token(node.awaitKeyword, HighlightRegionType.BUILT_IN);
     computer._addRegion_token(node.forKeyword, HighlightRegionType.KEYWORD);
@@ -580,6 +606,13 @@
   }
 
   @override
+  void visitForStatement2(ForStatement2 node) {
+    computer._addRegion_token(node.awaitKeyword, HighlightRegionType.BUILT_IN);
+    computer._addRegion_token(node.forKeyword, HighlightRegionType.KEYWORD);
+    super.visitForStatement2(node);
+  }
+
+  @override
   void visitFunctionDeclaration(FunctionDeclaration node) {
     computer._addRegion_token(
         node.externalKeyword, HighlightRegionType.BUILT_IN);
@@ -617,6 +650,7 @@
   @override
   void visitIfStatement(IfStatement node) {
     computer._addRegion_token(node.ifKeyword, HighlightRegionType.KEYWORD);
+    computer._addRegion_token(node.elseKeyword, HighlightRegionType.KEYWORD);
     super.visitIfStatement(node);
   }
 
@@ -678,6 +712,27 @@
   }
 
   @override
+  void visitListLiteral2(ListLiteral2 node) {
+    computer._addRegion_node(node, HighlightRegionType.LITERAL_LIST);
+    computer._addRegion_token(node.constKeyword, HighlightRegionType.KEYWORD);
+    super.visitListLiteral2(node);
+  }
+
+  @override
+  void visitMapForElement(MapForElement node) {
+    computer._addRegion_token(node.awaitKeyword, HighlightRegionType.BUILT_IN);
+    computer._addRegion_token(node.forKeyword, HighlightRegionType.KEYWORD);
+    super.visitMapForElement(node);
+  }
+
+  @override
+  void visitMapIfElement(MapIfElement node) {
+    computer._addRegion_token(node.ifKeyword, HighlightRegionType.KEYWORD);
+    computer._addRegion_token(node.elseKeyword, HighlightRegionType.KEYWORD);
+    super.visitMapIfElement(node);
+  }
+
+  @override
   void visitMapLiteral(MapLiteral node) {
     computer._addRegion_node(node, HighlightRegionType.LITERAL_MAP);
     computer._addRegion_token(node.constKeyword, HighlightRegionType.KEYWORD);
@@ -685,6 +740,13 @@
   }
 
   @override
+  void visitMapLiteral2(MapLiteral2 node) {
+    computer._addRegion_node(node, HighlightRegionType.LITERAL_MAP);
+    computer._addRegion_token(node.constKeyword, HighlightRegionType.KEYWORD);
+    super.visitMapLiteral2(node);
+  }
+
+  @override
   void visitMethodDeclaration(MethodDeclaration node) {
     computer._addRegion_token(
         node.externalKeyword, HighlightRegionType.BUILT_IN);
@@ -749,6 +811,20 @@
   }
 
   @override
+  void visitSetLiteral(SetLiteral node) {
+//    computer._addRegion_node(node, HighlightRegionType.LITERAL_SET);
+    computer._addRegion_token(node.constKeyword, HighlightRegionType.KEYWORD);
+    super.visitSetLiteral(node);
+  }
+
+  @override
+  void visitSetLiteral2(SetLiteral2 node) {
+//    computer._addRegion_node(node, HighlightRegionType.LITERAL_SET);
+    computer._addRegion_token(node.constKeyword, HighlightRegionType.KEYWORD);
+    super.visitSetLiteral2(node);
+  }
+
+  @override
   void visitShowCombinator(ShowCombinator node) {
     computer._addRegion_token(node.keyword, HighlightRegionType.BUILT_IN);
     super.visitShowCombinator(node);
diff --git a/pkg/analysis_server/lib/src/domain_analysis.dart b/pkg/analysis_server/lib/src/domain_analysis.dart
index 9d2cbe9..6886c65 100644
--- a/pkg/analysis_server/lib/src/domain_analysis.dart
+++ b/pkg/analysis_server/lib/src/domain_analysis.dart
@@ -47,6 +47,11 @@
    */
   Future<void> getErrors(Request request) async {
     String file = new AnalysisGetErrorsParams.fromRequest(request).file;
+
+    if (server.sendResponseErrorIfInvalidFilePath(request, file)) {
+      return;
+    }
+
     ResolvedUnitResult result = await server.getResolvedUnit(file);
 
     if (result?.state != ResultState.VALID) {
@@ -70,9 +75,14 @@
     // TODO(brianwilkerson) Determine whether this await is necessary.
     await null;
     var params = new AnalysisGetHoverParams.fromRequest(request);
+    var file = params.file;
+
+    if (server.sendResponseErrorIfInvalidFilePath(request, file)) {
+      return;
+    }
 
     // Prepare the resolved units.
-    ResolvedUnitResult result = await server.getResolvedUnit(params.file);
+    ResolvedUnitResult result = await server.getResolvedUnit(file);
     CompilationUnit unit = result?.unit;
 
     // Prepare the hovers.
@@ -96,12 +106,17 @@
   Future<void> getImportedElements(Request request) async {
     // TODO(brianwilkerson) Determine whether this await is necessary.
     await null;
-    AnalysisGetImportedElementsParams params =
-        new AnalysisGetImportedElementsParams.fromRequest(request);
+    var params = new AnalysisGetImportedElementsParams.fromRequest(request);
+    var file = params.file;
+
+    if (server.sendResponseErrorIfInvalidFilePath(request, file)) {
+      return;
+    }
+
     //
     // Prepare the resolved unit.
     //
-    ResolvedUnitResult result = await server.getResolvedUnit(params.file);
+    ResolvedUnitResult result = await server.getResolvedUnit(file);
     if (result?.state != ResultState.VALID) {
       server.sendResponse(new Response.getImportedElementsInvalidFile(request));
       return;
@@ -160,6 +175,10 @@
     int offset = params.offset;
     int length = params.length;
 
+    if (server.sendResponseErrorIfInvalidFilePath(request, file)) {
+      return;
+    }
+
     AnalysisDriver driver = server.getAnalysisDriver(file);
     if (driver == null) {
       server.sendResponse(new Response.getNavigationInvalidFile(request));
@@ -242,9 +261,14 @@
    */
   Future<void> getSignature(Request request) async {
     var params = new AnalysisGetSignatureParams.fromRequest(request);
+    var file = params.file;
+
+    if (server.sendResponseErrorIfInvalidFilePath(request, file)) {
+      return;
+    }
 
     // Prepare the resolved units.
-    ResolvedUnitResult result = await server.getResolvedUnit(params.file);
+    ResolvedUnitResult result = await server.getResolvedUnit(file);
 
     if (result?.state != ResultState.VALID) {
       server.sendResponse(new Response.getSignatureInvalidFile(request));
@@ -388,6 +412,12 @@
   Response setPriorityFiles(Request request) {
     var params = new AnalysisSetPriorityFilesParams.fromRequest(request);
 
+    for (var file in params.files) {
+      if (!server.isAbsoluteAndNormalized(file)) {
+        return Response.invalidFilePathFormat(request, file);
+      }
+    }
+
     if (server.options.enableUXExperiment1) {
       // If this experiment is enabled, set the analysis root to be the
       // containing directory.
@@ -445,6 +475,15 @@
    */
   Response setSubscriptions(Request request) {
     var params = new AnalysisSetSubscriptionsParams.fromRequest(request);
+
+    for (var fileList in params.subscriptions.values) {
+      for (var file in fileList) {
+        if (!server.isAbsoluteAndNormalized(file)) {
+          return Response.invalidFilePathFormat(request, file);
+        }
+      }
+    }
+
     // parse subscriptions
     Map<AnalysisService, Set<String>> subMap = mapMap(params.subscriptions,
         valueCallback: (List<String> subscriptions) => subscriptions.toSet());
@@ -466,6 +505,13 @@
    */
   Response updateContent(Request request) {
     var params = new AnalysisUpdateContentParams.fromRequest(request);
+
+    for (var file in params.files.keys) {
+      if (!server.isAbsoluteAndNormalized(file)) {
+        return Response.invalidFilePathFormat(request, file);
+      }
+    }
+
     server.updateContent(request.id, params.files);
     //
     // Forward the request to the plugins.
diff --git a/pkg/analysis_server/lib/src/domain_completion.dart b/pkg/analysis_server/lib/src/domain_completion.dart
index 2b61900..c70db3b 100644
--- a/pkg/analysis_server/lib/src/domain_completion.dart
+++ b/pkg/analysis_server/lib/src/domain_completion.dart
@@ -170,10 +170,14 @@
     // extract and validate params
     CompletionGetSuggestionsParams params =
         new CompletionGetSuggestionsParams.fromRequest(request);
-    String filePath = params.file;
+    String file = params.file;
     int offset = params.offset;
 
-    ResolvedUnitResult result = await server.getResolvedUnit(filePath);
+    if (server.sendResponseErrorIfInvalidFilePath(request, file)) {
+      return;
+    }
+
+    ResolvedUnitResult result = await server.getResolvedUnit(file);
 
     if (result?.state == ResultState.VALID) {
       if (offset < 0 || offset > result.content.length) {
@@ -185,7 +189,7 @@
         return;
       }
 
-      recordRequest(performance, filePath, result.content, offset);
+      recordRequest(performance, file, result.content, offset);
     }
     CompletionRequestImpl completionRequest =
         new CompletionRequestImpl(result, offset, performance);
diff --git a/pkg/analysis_server/lib/src/edit/edit_domain.dart b/pkg/analysis_server/lib/src/edit/edit_domain.dart
index 2e1f6e2..f692c76 100644
--- a/pkg/analysis_server/lib/src/edit/edit_domain.dart
+++ b/pkg/analysis_server/lib/src/edit/edit_domain.dart
@@ -165,6 +165,10 @@
     int offset = params.offset;
     int length = params.length;
 
+    if (server.sendResponseErrorIfInvalidFilePath(request, file)) {
+      return;
+    }
+
     List<SourceChange> changes = <SourceChange>[];
     //
     // Allow plugins to start computing assists.
@@ -228,6 +232,11 @@
     EditGetFixesParams params = new EditGetFixesParams.fromRequest(request);
     String file = params.file;
     int offset = params.offset;
+
+    if (server.sendResponseErrorIfInvalidFilePath(request, file)) {
+      return;
+    }
+
     //
     // Allow plugins to start computing fixes.
     //
@@ -277,9 +286,15 @@
     server.options.analytics?.sendEvent('edit', 'getPostfixCompletion');
 
     var params = new EditGetPostfixCompletionParams.fromRequest(request);
+    var file = params.file;
+
+    if (server.sendResponseErrorIfInvalidFilePath(request, file)) {
+      return;
+    }
+
     SourceChange change;
 
-    ResolvedUnitResult result = await server.getResolvedUnit(params.file);
+    ResolvedUnitResult result = await server.getResolvedUnit(file);
     if (result != null) {
       PostfixCompletionContext context = new PostfixCompletionContext(
         result,
@@ -303,10 +318,17 @@
   Future getStatementCompletion(Request request) async {
     // TODO(brianwilkerson) Determine whether this await is necessary.
     await null;
+
     var params = new EditGetStatementCompletionParams.fromRequest(request);
+    var file = params.file;
+
+    if (server.sendResponseErrorIfInvalidFilePath(request, file)) {
+      return;
+    }
+
     SourceChange change;
 
-    ResolvedUnitResult result = await server.getResolvedUnit(params.file);
+    ResolvedUnitResult result = await server.getResolvedUnit(file);
     if (result != null) {
       var context = new StatementCompletionContext(result, params.offset);
       StatementCompletionProcessor processor =
@@ -377,12 +399,18 @@
   Future<void> importElements(Request request) async {
     // TODO(brianwilkerson) Determine whether this await is necessary.
     await null;
-    EditImportElementsParams params =
-        new EditImportElementsParams.fromRequest(request);
+
+    var params = new EditImportElementsParams.fromRequest(request);
+    var file = params.file;
+
+    if (server.sendResponseErrorIfInvalidFilePath(request, file)) {
+      return;
+    }
+
     //
     // Prepare the resolved unit.
     //
-    ResolvedUnitResult result = await server.getResolvedUnit(params.file);
+    ResolvedUnitResult result = await server.getResolvedUnit(file);
     if (result == null) {
       server.sendResponse(new Response.importElementsInvalidFile(request));
     }
@@ -415,9 +443,15 @@
     // TODO(brianwilkerson) Determine whether this await is necessary.
     await null;
     var params = new EditGetPostfixCompletionParams.fromRequest(request);
+    var file = params.file;
+
+    if (server.sendResponseErrorIfInvalidFilePath(request, file)) {
+      return;
+    }
+
     bool value = false;
 
-    ResolvedUnitResult result = await server.getResolvedUnit(params.file);
+    ResolvedUnitResult result = await server.getResolvedUnit(file);
     if (result != null) {
       var context = new PostfixCompletionContext(
         result,
@@ -452,12 +486,16 @@
     server.options.analytics?.sendEvent('edit', 'organizeDirectives');
 
     var params = new EditOrganizeDirectivesParams.fromRequest(request);
-    // prepare file
-    String file = params.file;
+    var file = params.file;
+
+    if (server.sendResponseErrorIfInvalidFilePath(request, file)) {
+      return;
+    }
     if (!engine.AnalysisEngine.isDartFileName(file)) {
       server.sendResponse(new Response.fileNotAnalyzed(request, file));
       return;
     }
+
     // Prepare the file information.
     ResolvedUnitResult result = await server.getResolvedUnit(file);
     if (result == null) {
@@ -487,19 +525,23 @@
     // TODO(brianwilkerson) Determine whether this await is necessary.
     await null;
     var params = new EditSortMembersParams.fromRequest(request);
-    // prepare file
-    String file = params.file;
+    var file = params.file;
+
+    if (server.sendResponseErrorIfInvalidFilePath(request, file)) {
+      return;
+    }
     if (!engine.AnalysisEngine.isDartFileName(file)) {
       server.sendResponse(new Response.sortMembersInvalidFile(request));
       return;
     }
+
     // Prepare the file information.
-    var driver = server.getAnalysisDriver(file);
-    ParsedUnitResult result = await driver?.parseFile(file);
+    ParsedUnitResult result = await server.getParsedUnit(file);
     if (result == null) {
       server.sendResponse(new Response.fileNotAnalyzed(request, file));
       return;
     }
+
     int fileStamp = -1;
     String code = result.content;
     CompilationUnit unit = result.unit;
@@ -560,13 +602,15 @@
   }
 
   Future _getAvailableRefactoringsImpl(Request request) async {
-    // TODO(brianwilkerson) Determine whether this await is necessary.
-    await null;
-    // prepare parameters
     var params = new EditGetAvailableRefactoringsParams.fromRequest(request);
     String file = params.file;
     int offset = params.offset;
     int length = params.length;
+
+    if (server.sendResponseErrorIfInvalidFilePath(request, file)) {
+      return;
+    }
+
     // add refactoring kinds
     List<RefactoringKind> kinds = <RefactoringKind>[];
     // Check nodes.
@@ -731,6 +775,11 @@
         EMPTY_PROBLEM_LIST, EMPTY_PROBLEM_LIST, EMPTY_PROBLEM_LIST);
     // process the request
     var params = new EditGetRefactoringParams.fromRequest(_request);
+    var file = params.file;
+
+    if (server.sendResponseErrorIfInvalidFilePath(request, file)) {
+      return;
+    }
 
     if (params.kind != null) {
       server.options.analytics
@@ -740,7 +789,7 @@
     runZoned(() async {
       // TODO(brianwilkerson) Determine whether this await is necessary.
       await null;
-      await _init(params.kind, params.file, params.offset, params.length);
+      await _init(params.kind, file, params.offset, params.length);
       if (initStatus.hasFatalError) {
         feedback = null;
         _sendResultResponse();
diff --git a/pkg/analysis_server/lib/src/edit/fix/non_nullable_fix.dart b/pkg/analysis_server/lib/src/edit/fix/non_nullable_fix.dart
index 14bad20..fc623af 100644
--- a/pkg/analysis_server/lib/src/edit/fix/non_nullable_fix.dart
+++ b/pkg/analysis_server/lib/src/edit/fix/non_nullable_fix.dart
@@ -1,3 +1,7 @@
+// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
 import 'package:analysis_server/src/edit/edit_dartfix.dart';
 import 'package:analyzer/dart/analysis/results.dart';
 import 'package:analyzer/dart/ast/ast.dart';
@@ -6,6 +10,9 @@
 import 'package:analyzer/src/generated/source.dart';
 import 'package:analyzer_plugin/protocol/protocol_common.dart';
 
+/// [NonNullableFix] visits each named type in a resolved compilation unit
+/// and determines whether the associated variable or parameter can be null
+/// then adds or removes a '?' trailing the named type as appropriate.
 class NonNullableFix {
   final EditDartFix dartFix;
 
@@ -62,6 +69,28 @@
   }
 
   @override
+  void visitExtendsClause(ExtendsClause node) {
+    // skip the type name associated with the extends clause
+    node.superclass?.typeArguments?.accept(this);
+  }
+
+  @override
+  void visitImplementsClause(ImplementsClause node) {
+    // skip the type names in the implements clause
+    for (TypeName typeName in node.interfaces) {
+      typeName.typeArguments?.accept(this);
+    }
+  }
+
+  @override
+  void visitOnClause(OnClause node) {
+    // skip the type name in the clause
+    for (TypeName typeName in node.superclassConstraints) {
+      typeName.typeArguments?.accept(this);
+    }
+  }
+
+  @override
   void visitTypeName(TypeName node) {
     // TODO(danrubel): Replace this braindead implementation
     // with something that determines whether or not the type should be nullable
@@ -79,4 +108,12 @@
     }
     super.visitTypeName(node);
   }
+
+  @override
+  void visitWithClause(WithClause node) {
+    // skip the type names associated with this clause
+    for (TypeName typeName in node.mixinTypes) {
+      typeName.typeArguments?.accept(this);
+    }
+  }
 }
diff --git a/pkg/analysis_server/lib/src/lsp/channel/lsp_byte_stream_channel.dart b/pkg/analysis_server/lib/src/lsp/channel/lsp_byte_stream_channel.dart
index b81c125..d412402 100644
--- a/pkg/analysis_server/lib/src/lsp/channel/lsp_byte_stream_channel.dart
+++ b/pkg/analysis_server/lib/src/lsp/channel/lsp_byte_stream_channel.dart
@@ -62,7 +62,9 @@
       onError: onError,
       onDone: () {
         close();
-        onDone();
+        if (onDone != null) {
+          onDone();
+        }
       },
     );
   }
diff --git a/pkg/analysis_server/lib/src/lsp/constants.dart b/pkg/analysis_server/lib/src/lsp/constants.dart
index 464ab95..aaf762f 100644
--- a/pkg/analysis_server/lib/src/lsp/constants.dart
+++ b/pkg/analysis_server/lib/src/lsp/constants.dart
@@ -56,3 +56,7 @@
   ///   if it crashes 5 times in the last 180 seconds."
   static const ClientServerInconsistentState = const ErrorCodes(-32010);
 }
+
+abstract class CustomMethods {
+  static const DiagnosticServer = const Method('dart/diagnosticServer');
+}
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/commands/organize_imports.dart b/pkg/analysis_server/lib/src/lsp/handlers/commands/organize_imports.dart
index 4161f20..674201f 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/commands/organize_imports.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/commands/organize_imports.dart
@@ -33,7 +33,7 @@
     final path = arguments.single;
     final docIdentifier = server.getVersionedDocumentIdentifier(path);
 
-    final result = await requireUnit(path);
+    final result = await requireResolvedUnit(path);
     return result.mapResult((result) {
       final code = result.content;
       final unit = result.unit;
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/commands/simple_edit_handler.dart b/pkg/analysis_server/lib/src/lsp/handlers/commands/simple_edit_handler.dart
index 24c7b7d..64c5877 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/commands/simple_edit_handler.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/commands/simple_edit_handler.dart
@@ -47,7 +47,7 @@
       return error(
         ServerErrorCodes.ClientFailedToApplyEdit,
         'Client failed to apply workspace edit for $commandName',
-        editResponse.error,
+        editResponse.error.toString(),
       );
     }
 
@@ -64,7 +64,7 @@
       return error(
         ServerErrorCodes.ClientFailedToApplyEdit,
         'Client failed to apply workspace edit for $commandName',
-        workspaceEdit,
+        workspaceEdit.toString(),
       );
     }
   }
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/custom/handler_diagnostic_server.dart b/pkg/analysis_server/lib/src/lsp/handlers/custom/handler_diagnostic_server.dart
new file mode 100644
index 0000000..7a3dec6
--- /dev/null
+++ b/pkg/analysis_server/lib/src/lsp/handlers/custom/handler_diagnostic_server.dart
@@ -0,0 +1,27 @@
+// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:async';
+
+import 'package:analysis_server/lsp_protocol/protocol_custom_generated.dart';
+import 'package:analysis_server/lsp_protocol/protocol_generated.dart';
+import 'package:analysis_server/lsp_protocol/protocol_special.dart';
+import 'package:analysis_server/src/lsp/constants.dart';
+import 'package:analysis_server/src/lsp/handlers/handlers.dart';
+import 'package:analysis_server/src/lsp/lsp_analysis_server.dart';
+
+class DiagnosticServerHandler
+    extends MessageHandler<void, DartDiagnosticServer> {
+  DiagnosticServerHandler(LspAnalysisServer server) : super(server);
+  Method get handlesMessage => CustomMethods.DiagnosticServer;
+
+  @override
+  void convertParams(Map<String, dynamic> json) => null;
+
+  @override
+  Future<ErrorOr<DartDiagnosticServer>> handle(void _) async {
+    final port = await server.diagnosticServer.getServerPort();
+    return success(new DartDiagnosticServer(port));
+  }
+}
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_code_actions.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_code_actions.dart
index 41d3014..3788e2c 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/handler_code_actions.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_code_actions.dart
@@ -43,7 +43,7 @@
         capabilities?.codeActionLiteralSupport?.codeActionKind?.valueSet ?? []);
 
     final path = pathOfDoc(params.textDocument);
-    final unit = await path.mapResult(requireUnit);
+    final unit = await path.mapResult(requireResolvedUnit);
 
     return unit.mapResult((unit) {
       final startOffset = toOffset(unit.lineInfo, params.range.start);
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_completion.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_completion.dart
index bc81078..1f845ef 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/handler_completion.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_completion.dart
@@ -60,7 +60,7 @@
 
     final pos = params.position;
     final path = pathOfDoc(params.textDocument);
-    final unit = await path.mapResult(requireUnit);
+    final unit = await path.mapResult(requireResolvedUnit);
     final offset = await unit.mapResult((unit) => toOffset(unit.lineInfo, pos));
     return offset.mapResult((offset) => _getItems(
           completionCapabilities,
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_definition.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_definition.dart
index c3e9246..90912c6 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/handler_definition.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_definition.dart
@@ -26,7 +26,7 @@
       TextDocumentPositionParams params) async {
     final pos = params.position;
     final path = pathOfDoc(params.textDocument);
-    final unit = await path.mapResult(requireUnit);
+    final unit = await path.mapResult(requireResolvedUnit);
     final offset = await unit.mapResult((unit) => toOffset(unit.lineInfo, pos));
 
     return offset.mapResult((offset) {
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_document_highlights.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_document_highlights.dart
index 9f6822e..cc21c40 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/handler_document_highlights.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_document_highlights.dart
@@ -25,7 +25,7 @@
       TextDocumentPositionParams params) async {
     final pos = params.position;
     final path = pathOfDoc(params.textDocument);
-    final unit = await path.mapResult(requireUnit);
+    final unit = await path.mapResult(requireResolvedUnit);
     final offset = await unit.mapResult((unit) => toOffset(unit.lineInfo, pos));
 
     return offset.mapResult((requestedOffset) {
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_document_symbols.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_document_symbols.dart
index e1fda79..7810b7f 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/handler_document_symbols.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_document_symbols.dart
@@ -61,7 +61,7 @@
         symbolCapabilities?.hierarchicalDocumentSymbolSupport ?? false;
 
     final path = pathOfDoc(params.textDocument);
-    final unit = await path.mapResult(requireUnit);
+    final unit = await path.mapResult(requireResolvedUnit);
     return unit.mapResult((unit) => _getSymbols(clientSupportedSymbolKinds,
         clientSupportsDocumentSymbol, path.result, unit));
   }
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_exit.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_exit.dart
index f2b3579..4f3f320 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/handler_exit.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_exit.dart
@@ -18,6 +18,10 @@
 
   @override
   Future<ErrorOr<void>> handle(void _) async {
+    // TODO(dantup): Spec says we should exit with a code of 1 if we had not
+    // received a shutdown request prior to exit.
+    // TODO(dantup): Probably we should add a new state for "shutting down"
+    // that refuses any more requests between shutdown and exit.
     await server.shutdown();
     return success();
   }
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_folding.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_folding.dart
new file mode 100644
index 0000000..96e1a4a
--- /dev/null
+++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_folding.dart
@@ -0,0 +1,37 @@
+// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:async';
+
+import 'package:analysis_server/lsp_protocol/protocol_generated.dart';
+import 'package:analysis_server/lsp_protocol/protocol_special.dart';
+import 'package:analysis_server/src/computer/computer_folding.dart';
+import 'package:analysis_server/src/lsp/handlers/handlers.dart';
+import 'package:analysis_server/src/lsp/lsp_analysis_server.dart';
+import 'package:analysis_server/src/lsp/mapping.dart';
+
+class FoldingHandler
+    extends MessageHandler<FoldingRangeParams, List<FoldingRange>> {
+  FoldingHandler(LspAnalysisServer server) : super(server);
+  Method get handlesMessage => Method.textDocument_foldingRange;
+
+  @override
+  FoldingRangeParams convertParams(Map<String, dynamic> json) =>
+      FoldingRangeParams.fromJson(json);
+
+  Future<ErrorOr<List<FoldingRange>>> handle(FoldingRangeParams params) async {
+    final path = pathOfDoc(params.textDocument);
+    final unit = await path.mapResult(requireUnresolvedUnit);
+
+    return unit.mapResult((unit) {
+      final lineInfo = unit.lineInfo;
+      final regions =
+          new DartUnitFoldingComputer(lineInfo, unit.unit).compute();
+
+      return success(
+        regions.map((region) => toFoldingRange(lineInfo, region)).toList(),
+      );
+    });
+  }
+}
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_format_on_type.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_format_on_type.dart
index 6fb1c2f..37d6a9d 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/handler_format_on_type.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_format_on_type.dart
@@ -6,11 +6,11 @@
 
 import 'package:analysis_server/lsp_protocol/protocol_generated.dart';
 import 'package:analysis_server/lsp_protocol/protocol_special.dart';
+import 'package:analysis_server/src/lsp/constants.dart';
 import 'package:analysis_server/src/lsp/handlers/handlers.dart';
 import 'package:analysis_server/src/lsp/lsp_analysis_server.dart';
 import 'package:analysis_server/src/lsp/mapping.dart';
 import 'package:analysis_server/src/lsp/source_edits.dart';
-import 'package:analyzer/dart/analysis/results.dart';
 
 class FormatOnTypeHandler
     extends MessageHandler<DocumentOnTypeFormattingParams, List<TextEdit>> {
@@ -21,17 +21,19 @@
   DocumentOnTypeFormattingParams convertParams(Map<String, dynamic> json) =>
       DocumentOnTypeFormattingParams.fromJson(json);
 
-  ErrorOr<List<TextEdit>> formatFile(String path, ResolvedUnitResult unit) {
-    final unformattedSource =
-        server.resourceProvider.getFile(path).readAsStringSync();
+  ErrorOr<List<TextEdit>> formatFile(String path) {
+    final file = server.resourceProvider.getFile(path);
+    if (!file.exists) {
+      return error(ServerErrorCodes.InvalidFilePath, 'Invalid file path', path);
+    }
 
+    final unformattedSource = file.readAsStringSync();
     return success(generateEditsForFormatting(unformattedSource));
   }
 
   Future<ErrorOr<List<TextEdit>>> handle(
       DocumentOnTypeFormattingParams params) async {
     final path = pathOfDoc(params.textDocument);
-    final unit = await path.mapResult(requireUnit);
-    return unit.mapResult((unit) => formatFile(path.result, unit));
+    return path.mapResult((path) => formatFile(path));
   }
 }
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_formatting.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_formatting.dart
index e226bc4..b4e0b60 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/handler_formatting.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_formatting.dart
@@ -6,11 +6,11 @@
 
 import 'package:analysis_server/lsp_protocol/protocol_generated.dart';
 import 'package:analysis_server/lsp_protocol/protocol_special.dart';
+import 'package:analysis_server/src/lsp/constants.dart';
 import 'package:analysis_server/src/lsp/handlers/handlers.dart';
 import 'package:analysis_server/src/lsp/lsp_analysis_server.dart';
 import 'package:analysis_server/src/lsp/mapping.dart';
 import 'package:analysis_server/src/lsp/source_edits.dart';
-import 'package:analyzer/dart/analysis/results.dart';
 
 class FormattingHandler
     extends MessageHandler<DocumentFormattingParams, List<TextEdit>> {
@@ -21,17 +21,19 @@
   DocumentFormattingParams convertParams(Map<String, dynamic> json) =>
       DocumentFormattingParams.fromJson(json);
 
-  ErrorOr<List<TextEdit>> formatFile(String path, ResolvedUnitResult unit) {
-    final unformattedSource =
-        server.resourceProvider.getFile(path).readAsStringSync();
+  ErrorOr<List<TextEdit>> formatFile(String path) {
+    final file = server.resourceProvider.getFile(path);
+    if (!file.exists) {
+      return error(ServerErrorCodes.InvalidFilePath, 'Invalid file path', path);
+    }
 
+    final unformattedSource = file.readAsStringSync();
     return success(generateEditsForFormatting(unformattedSource));
   }
 
   Future<ErrorOr<List<TextEdit>>> handle(
       DocumentFormattingParams params) async {
     final path = pathOfDoc(params.textDocument);
-    final unit = await path.mapResult(requireUnit);
-    return unit.mapResult((unit) => formatFile(path.result, unit));
+    return path.mapResult((path) => formatFile(path));
   }
 }
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_hover.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_hover.dart
index a5396e5..d9302ae 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/handler_hover.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_hover.dart
@@ -26,7 +26,7 @@
   Future<ErrorOr<Hover>> handle(TextDocumentPositionParams params) async {
     final pos = params.position;
     final path = pathOfDoc(params.textDocument);
-    final unit = await path.mapResult(requireUnit);
+    final unit = await path.mapResult(requireResolvedUnit);
     final offset = await unit.mapResult((unit) => toOffset(unit.lineInfo, pos));
     return offset.mapResult((offset) => _getHover(unit.result, offset));
   }
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_initialize.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_initialize.dart
index e1a72f6..67ab08f 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/handler_initialize.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_initialize.dart
@@ -60,10 +60,25 @@
           false,
           // Set the characters that will cause the editor to automatically
           // trigger completion.
-          // TODO(dantup): This is quite eager and may need filtering in the
-          // completion handler.
-          // See https://github.com/Dart-Code/Dart-Code/blob/c616c93c87972713454eb0518f97c0278201a99a/src/providers/dart_completion_item_provider.ts#L36
-          r'''.: =(${'"/\'''.split(''),
+          // TODO(dantup): There are several characters that we want to conditionally
+          // allow to trigger completion, but they can only be added when the completion
+          // provider is able to handle them in context:
+          //
+          //    {   trigger if being typed in a string immediately after a $
+          //    '   trigger if the opening quote for an import/export
+          //    "   trigger if the opening quote for an import/export
+          //    /   trigger if as part of a path in an import/export
+          //    \   trigger if as part of a path in an import/export
+          //    :   don't trigger when typing case expressions (`case x:`)
+          //
+          // Additionally, we need to prefix `filterText` on completion items
+          // with spaces for those that can follow whitespace (eg. `foo` in
+          // `myArg: foo`) to ensure they're not filtered away when the user
+          // types space.
+          //
+          // See https://github.com/Dart-Code/Dart-Code/blob/68d1cd271e88a785570257d487adbdec17abd6a3/src/providers/dart_completion_item_provider.ts#L36-L64
+          // for the VS Code implementation of this.
+          r'''.=($'''.split(''),
         ),
         new SignatureHelpOptions(
           // TODO(dantup): Signature help triggering is even more sensitive to
@@ -94,7 +109,7 @@
             : Either2<bool, RenameOptions>.t1(true),
         null,
         null,
-        null,
+        Either3<bool, FoldingRangeProviderOptions, dynamic>.t1(true),
         new ExecuteCommandOptions(Commands.serverSupportedCommands),
         new ServerCapabilitiesWorkspace(
             new ServerCapabilitiesWorkspaceFolders(true, true)),
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_references.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_references.dart
index f6f803f..5f3fe45 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/handler_references.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_references.dart
@@ -31,7 +31,7 @@
   Future<ErrorOr<List<Location>>> handle(ReferenceParams params) async {
     final pos = params.position;
     final path = pathOfDoc(params.textDocument);
-    final unit = await path.mapResult(requireUnit);
+    final unit = await path.mapResult(requireResolvedUnit);
     final offset = await unit.mapResult((unit) => toOffset(unit.lineInfo, pos));
     return offset.mapResult(
         (offset) => _getRefererences(path.result, offset, params, unit.result));
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_rename.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_rename.dart
index 3a9075e..5433077 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/handler_rename.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_rename.dart
@@ -24,7 +24,7 @@
       TextDocumentPositionParams params) async {
     final pos = params.position;
     final path = pathOfDoc(params.textDocument);
-    final unit = await path.mapResult(requireUnit);
+    final unit = await path.mapResult(requireResolvedUnit);
     final offset = await unit.mapResult((unit) => toOffset(unit.lineInfo, pos));
 
     return offset.mapResult((offset) async {
@@ -84,7 +84,7 @@
         params.textDocument is VersionedTextDocumentIdentifier
             ? params.textDocument
             : server.getVersionedDocumentIdentifier(path)));
-    final unit = await path.mapResult(requireUnit);
+    final unit = await path.mapResult(requireResolvedUnit);
     final offset = await unit.mapResult((unit) => toOffset(unit.lineInfo, pos));
 
     return offset.mapResult((offset) async {
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_signature_help.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_signature_help.dart
index 2fe40ef..3f3e195 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/handler_signature_help.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_signature_help.dart
@@ -24,7 +24,7 @@
       TextDocumentPositionParams params) async {
     final pos = params.position;
     final path = pathOfDoc(params.textDocument);
-    final unit = await path.mapResult(requireUnit);
+    final unit = await path.mapResult(requireResolvedUnit);
     final offset = await unit.mapResult((unit) => toOffset(unit.lineInfo, pos));
 
     return offset.mapResult((offset) {
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_states.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_states.dart
index 9375b8b..36eb607 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/handler_states.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_states.dart
@@ -7,12 +7,14 @@
 import 'package:analysis_server/lsp_protocol/protocol_generated.dart';
 import 'package:analysis_server/lsp_protocol/protocol_special.dart';
 import 'package:analysis_server/src/lsp/constants.dart';
+import 'package:analysis_server/src/lsp/handlers/custom/handler_diagnostic_server.dart';
 import 'package:analysis_server/src/lsp/handlers/handler_code_actions.dart';
 import 'package:analysis_server/src/lsp/handlers/handler_completion.dart';
 import 'package:analysis_server/src/lsp/handlers/handler_definition.dart';
 import 'package:analysis_server/src/lsp/handlers/handler_document_highlights.dart';
 import 'package:analysis_server/src/lsp/handlers/handler_document_symbols.dart';
 import 'package:analysis_server/src/lsp/handlers/handler_execute_command.dart';
+import 'package:analysis_server/src/lsp/handlers/handler_folding.dart';
 import 'package:analysis_server/src/lsp/handlers/handler_format_on_type.dart';
 import 'package:analysis_server/src/lsp/handlers/handler_formatting.dart';
 import 'package:analysis_server/src/lsp/handlers/handler_hover.dart';
@@ -64,6 +66,8 @@
     registerHandler(new WorkspaceFoldersHandler(server));
     registerHandler(new PrepareRenameHandler(server));
     registerHandler(new RenameHandler(server));
+    registerHandler(new FoldingHandler(server));
+    registerHandler(new DiagnosticServerHandler(server));
   }
 }
 
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handlers.dart b/pkg/analysis_server/lib/src/lsp/handlers/handlers.dart
index 9fd98d8..78684ec 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/handlers.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/handlers.dart
@@ -32,13 +32,13 @@
 mixin Handler<P, R> {
   LspAnalysisServer server;
 
-  ErrorOr<R> error<R>(ErrorCodes code, String message, Object data) =>
+  ErrorOr<R> error<R>(ErrorCodes code, String message, String data) =>
       new ErrorOr<R>.error(new ResponseError(code, message, data));
 
   ErrorOr<R> failure<R>(ErrorOr<dynamic> error) =>
       new ErrorOr<R>.error(error.error);
 
-  Future<ErrorOr<ResolvedUnitResult>> requireUnit(String path) async {
+  Future<ErrorOr<ResolvedUnitResult>> requireResolvedUnit(String path) async {
     final result = await server.getResolvedUnit(path);
     if (result?.state != ResultState.VALID) {
       return error(ServerErrorCodes.InvalidFilePath, 'Invalid file path', path);
@@ -46,6 +46,14 @@
     return success(result);
   }
 
+  ErrorOr<ParsedUnitResult> requireUnresolvedUnit(String path) {
+    final result = server.getParsedUnit(path);
+    if (result?.state != ResultState.VALID) {
+      return error(ServerErrorCodes.InvalidFilePath, 'Invalid file path', path);
+    }
+    return success(result);
+  }
+
   ErrorOr<R> success<R>([R t]) => new ErrorOr<R>.success(t);
 }
 
@@ -85,7 +93,7 @@
   }
 
   ErrorOr<Object> failure<Object>(ErrorCodes code, String message,
-          [Object data]) =>
+          [String data]) =>
       new ErrorOr<Object>.error(new ResponseError(code, message, data));
 
   /// Handle the given [message]. If the [message] is a [RequestMessage], then the
diff --git a/pkg/analysis_server/lib/src/lsp/lsp_analysis_server.dart b/pkg/analysis_server/lib/src/lsp/lsp_analysis_server.dart
index 925e5a7..5f99c59 100644
--- a/pkg/analysis_server/lib/src/lsp/lsp_analysis_server.dart
+++ b/pkg/analysis_server/lib/src/lsp/lsp_analysis_server.dart
@@ -22,6 +22,7 @@
 import 'package:analysis_server/src/lsp/mapping.dart';
 import 'package:analysis_server/src/plugin/notification_manager.dart';
 import 'package:analysis_server/src/protocol_server.dart' as protocol;
+import 'package:analysis_server/src/server/diagnostic_server.dart';
 import 'package:analysis_server/src/services/completion/completion_performance.dart'
     show CompletionPerformance;
 import 'package:analysis_server/src/services/refactoring/refactoring.dart';
@@ -141,8 +142,9 @@
     AnalysisServerOptions options,
     this.sdkManager,
     this.instrumentationService, {
+    DiagnosticServer diagnosticServer,
     ResolverProvider packageResolverProvider: null,
-  }) : super(options, baseResourceProvider) {
+  }) : super(options, diagnosticServer, baseResourceProvider) {
     messageHandler = new UninitializedStateMessageHandler(this);
     defaultContextOptions.generateImplicitErrors = false;
     defaultContextOptions.useFastaParser = options.useFastaParser;
@@ -299,16 +301,14 @@
                 errorMessage,
                 null,
               ));
-          logError(error.toString());
-          if (stackTrace != null) {
-            logError(stackTrace.toString());
-          }
+          logException(errorMessage, error, stackTrace);
         }
       });
     }, onError: error);
   }
 
-  void logError(String message) {
+  /// Logs the error on the client using window/logMessage.
+  void logErrorToClient(String message) {
     channel.sendNotification(new NotificationMessage(
       Method.window_logMessage,
       new LogMessageParams(MessageType.Error, message),
@@ -341,7 +341,7 @@
           new ResponseMessage(message.id, null, error, jsonRpcVersion));
       // Since the LSP client might not show the failed requests to the user,
       // also ensure the error is logged to the client.
-      logError(error.message);
+      logErrorToClient(error.message);
     } else if (message is ResponseMessage) {
       // For bad response messages where we can't respond with an error, send it as
       // show instead of log.
@@ -359,7 +359,7 @@
       messageHandler = new FailureStateMessageHandler(this);
 
       final message = 'An unrecoverable error occurred.';
-      logError(
+      logErrorToClient(
           '$message\n\n${error.message}\n\n${error.code}\n\n${error.data}');
 
       shutdown();
@@ -399,24 +399,28 @@
   }
 
   void sendServerErrorNotification(String message, exception, stackTrace) {
-    final fullError = new StringBuffer();
-
-    fullError.writeln(exception == null ? message : '$message: $exception');
+    message = exception == null ? message : '$message: $exception';
 
     // Show message (without stack) to the user.
-    showError(fullError.toString());
+    showError(message);
 
-    if (stackTrace != null) {
-      fullError.writeln(stackTrace.toString());
-    }
-    // Log the full message since showMessage above may be truncated or formatted
-    // badly (eg. VS Code takes the newlines out).
-    logError(fullError.toString());
+    logException(message, exception, stackTrace);
+  }
 
-    // remember the last few exceptions
+  /// Logs an exception by sending it to the client (window/logMessage) and
+  /// recording it in a buffer on the server for diagnostics.
+  void logException(String message, exception, stackTrace) {
     if (exception is CaughtException) {
       stackTrace ??= exception.stackTrace;
     }
+
+    final fullError = stackTrace == null ? message : '$message\n$stackTrace';
+
+    // Log the full message since showMessage above may be truncated or formatted
+    // badly (eg. VS Code takes the newlines out).
+    logErrorToClient(fullError);
+
+    // remember the last few exceptions
     exceptions.add(new ServerException(
       message,
       exception,
diff --git a/pkg/analysis_server/lib/src/lsp/lsp_socket_server.dart b/pkg/analysis_server/lib/src/lsp/lsp_socket_server.dart
index 25a15e1..aee1dca 100644
--- a/pkg/analysis_server/lib/src/lsp/lsp_socket_server.dart
+++ b/pkg/analysis_server/lib/src/lsp/lsp_socket_server.dart
@@ -8,6 +8,7 @@
 import 'package:analysis_server/src/lsp/channel/lsp_channel.dart';
 import 'package:analysis_server/src/lsp/constants.dart';
 import 'package:analysis_server/src/lsp/lsp_analysis_server.dart';
+import 'package:analysis_server/src/server/diagnostic_server.dart';
 import 'package:analysis_server/src/socket_server.dart';
 import 'package:analyzer/file_system/physical_file_system.dart';
 import 'package:analyzer/instrumentation/instrumentation.dart';
@@ -31,11 +32,12 @@
    * The function used to create a new SDK using the default SDK.
    */
   final DartSdkManager sdkManager;
-
+  final DiagnosticServer diagnosticServer;
   final InstrumentationService instrumentationService;
 
   LspSocketServer(
     this.analysisServerOptions,
+    this.diagnosticServer,
     this.sdkManager,
     this.instrumentationService,
   );
@@ -78,6 +80,7 @@
     }
 
     analysisServer = new LspAnalysisServer(serverChannel, resourceProvider,
-        analysisServerOptions, sdkManager, instrumentationService);
+        analysisServerOptions, sdkManager, instrumentationService,
+        diagnosticServer: diagnosticServer);
   }
 }
diff --git a/pkg/analysis_server/lib/src/lsp/mapping.dart b/pkg/analysis_server/lib/src/lsp/mapping.dart
index d69d15d..edf1327 100644
--- a/pkg/analysis_server/lib/src/lsp/mapping.dart
+++ b/pkg/analysis_server/lib/src/lsp/mapping.dart
@@ -256,7 +256,7 @@
     return new ErrorOr<String>.error(new ResponseError(
         lsp.ServerErrorCodes.InvalidFilePath,
         'URI was not a valid file:// URI',
-        uri));
+        uri.toString()));
   }
   try {
     return new ErrorOr<String>.success(uri.toFilePath());
@@ -266,7 +266,7 @@
     return new ErrorOr<String>.error(new ResponseError(
         lsp.ServerErrorCodes.InvalidFilePath,
         'File URI did not contain a valid file path',
-        uri));
+        uri.toString()));
   }
 }
 
@@ -417,6 +417,28 @@
   }
 }
 
+lsp.FoldingRange toFoldingRange(
+    server.LineInfo lineInfo, server.FoldingRegion region) {
+  final range = toRange(lineInfo, region.offset, region.length);
+  return new lsp.FoldingRange(range.start.line, range.start.character,
+      range.end.line, range.end.character, toFoldingRangeKind(region.kind));
+}
+
+lsp.FoldingRangeKind toFoldingRangeKind(server.FoldingKind kind) {
+  switch (kind) {
+    case server.FoldingKind.DOCUMENTATION_COMMENT:
+    case server.FoldingKind.FILE_HEADER:
+      return lsp.FoldingRangeKind.Comment;
+    case server.FoldingKind.DIRECTIVES:
+      return lsp.FoldingRangeKind.Imports;
+    default:
+      // null (actually undefined in LSP, the toJson() takes care of that) is
+      // valid, and actually the value used for the majority of folds
+      // (class/functions/etc.).
+      return null;
+  }
+}
+
 List<lsp.DocumentHighlight> toHighlights(
     server.LineInfo lineInfo, server.Occurrences occurrences) {
   return occurrences.offsets
@@ -436,7 +458,7 @@
             ? lsp.ServerErrorCodes.ClientServerInconsistentState
             : lsp.ServerErrorCodes.InvalidFileLineCol,
         'Invalid line number',
-        pos.line));
+        pos.line.toString()));
   }
   // TODO(dantup): Is there any way to validate the character? We could ensure
   // it's less than the offset of the next line, but that would only work for
diff --git a/pkg/analysis_server/lib/src/server/driver.dart b/pkg/analysis_server/lib/src/server/driver.dart
index 29d59bb..305b455 100644
--- a/pkg/analysis_server/lib/src/server/driver.dart
+++ b/pkg/analysis_server/lib/src/server/driver.dart
@@ -554,6 +554,7 @@
 
     final socketServer = new LspSocketServer(
       analysisServerOptions,
+      diagnosticServer,
       dartSdkManager,
       instrumentationService,
     );
diff --git a/pkg/analysis_server/lib/src/server/lsp_stdio_server.dart b/pkg/analysis_server/lib/src/server/lsp_stdio_server.dart
index 1b5cde59..92fd980 100644
--- a/pkg/analysis_server/lib/src/server/lsp_stdio_server.dart
+++ b/pkg/analysis_server/lib/src/server/lsp_stdio_server.dart
@@ -33,7 +33,7 @@
    */
   Future serveStdio() {
     LspByteStreamServerChannel serverChannel = new LspByteStreamServerChannel(
-        stdin, stdout, socketServer.instrumentationService);
+        stdin, stdout.nonBlocking, socketServer.instrumentationService);
     socketServer.createAnalysisServer(serverChannel);
     return serverChannel.closed;
   }
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/arglist_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/arglist_contributor.dart
index f7ddb32..85c9fa6 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/arglist_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/arglist_contributor.dart
@@ -280,6 +280,7 @@
       if (parameter is FieldFormalParameterElement) {
         _setDocumentation(suggestion, parameter.field?.documentationComment);
         suggestion.element = convertElement(parameter);
+        suggestion.elementUri = parameter.source.toString();
       }
 
       suggestions.add(suggestion);
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/label_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/label_contributor.dart
index 77b4ebf..d89ed2f 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/label_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/label_contributor.dart
@@ -103,6 +103,7 @@
         suggestion.element = createLocalElement(
             request.source, protocol.ElementKind.LABEL, label.label,
             returnType: NO_RETURN_TYPE);
+        suggestion.elementUri = request.source.toString();
       }
     }
   }
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/local_reference_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/local_reference_contributor.dart
index a883a59..c335b79 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/local_reference_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/local_reference_contributor.dart
@@ -342,6 +342,7 @@
           isDeprecated: isDeprecated,
           parameters: param?.toSource(),
           returnType: typeName);
+      suggestion.elementUri = request.source.toString();
       if ((elemKind == protocol.ElementKind.METHOD ||
               elemKind == protocol.ElementKind.FUNCTION) &&
           param != null) {
@@ -383,6 +384,7 @@
             constantDeclaration.name.length,
             0,
             0));
+    suggestion.elementUri = request.source.uri.toString();
   }
 
   void _addLocalSuggestion_includeReturnValueSuggestions(
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/override_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/override_contributor.dart
index aa25fba..22692c1 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/override_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/override_contributor.dart
@@ -9,9 +9,7 @@
 import 'package:analysis_server/src/protocol_server.dart' as protocol
     hide CompletionSuggestion, CompletionSuggestionKind;
 import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
-import 'package:analyzer/dart/analysis/results.dart';
 import 'package:analyzer/dart/ast/ast.dart';
-import 'package:analyzer/dart/element/element.dart';
 import 'package:analyzer/dart/element/type.dart';
 import 'package:analyzer/src/dart/element/inheritance_manager2.dart';
 import 'package:analyzer/src/generated/source.dart';
@@ -33,30 +31,29 @@
     if (targetId == null) {
       return const <CompletionSuggestion>[];
     }
-    ClassDeclaration classDecl =
-        targetId.thisOrAncestorOfType<ClassDeclaration>();
+    var classDecl = targetId.thisOrAncestorOfType<ClassOrMixinDeclaration>();
     if (classDecl == null) {
       return const <CompletionSuggestion>[];
     }
 
-    // TODO(brianwilkerson) Consider making the type system visible from the
-    // request.result.
-    var inheritance = new InheritanceManager2(
-        await request.result.libraryElement.session.typeSystem);
+    var inheritance = new InheritanceManager2(request.result.typeSystem);
 
     // Generate a collection of inherited members
-    ClassElement classElem = classDecl.declaredElement;
-    var interface = inheritance.getInterface(classElem.type).map;
-    var namesToOverride = _namesToOverride(classElem, interface.keys);
+    var classElem = classDecl.declaredElement;
+    var interface = inheritance.getInterface(classElem.type);
+    var interfaceMap = interface.map;
+    var namesToOverride =
+        _namesToOverride(classElem.librarySource.uri, interface);
 
     // Build suggestions
     List<CompletionSuggestion> suggestions = <CompletionSuggestion>[];
     for (Name name in namesToOverride) {
-      FunctionType signature = interface[name];
+      FunctionType signature = interfaceMap[name];
       // Gracefully degrade if the overridden element has not been resolved.
       if (signature.returnType != null) {
-        CompletionSuggestion suggestion =
-            await _buildSuggestion(request, targetId, signature);
+        var invokeSuper = interface.isSuperImplemented(name);
+        var suggestion =
+            await _buildSuggestion(request, targetId, signature, invokeSuper);
         if (suggestion != null) {
           suggestions.add(suggestion);
         }
@@ -66,41 +63,26 @@
   }
 
   /**
-   * Return a template for an override of the given [signature]. If selected,
-   * the template will replace [targetId].
+   * Build a suggestion to replace [targetId] in the given [request] with an
+   * override of the given [signature].
    */
-  Future<DartChangeBuilder> _buildReplacementText(
-      ResolvedUnitResult result,
+  Future<CompletionSuggestion> _buildSuggestion(
+      DartCompletionRequest request,
       SimpleIdentifier targetId,
       FunctionType signature,
-      StringBuffer displayTextBuffer) async {
-    // TODO(brianwilkerson) Determine whether this await is necessary.
-    await null;
-    DartChangeBuilder builder = new DartChangeBuilder(result.session);
-    await builder.addFileEdit(result.path, (DartFileEditBuilder builder) {
-      builder.addReplacement(range.node(targetId), (DartEditBuilder builder) {
-        ExecutableElement element = signature.element;
+      bool invokeSuper) async {
+    var displayTextBuffer = new StringBuffer();
+    var builder = new DartChangeBuilder(request.result.session);
+    await builder.addFileEdit(request.result.path, (builder) {
+      builder.addReplacement(range.node(targetId), (builder) {
         builder.writeOverride(
           signature,
           displayTextBuffer: displayTextBuffer,
-          invokeSuper: !element.isAbstract,
+          invokeSuper: invokeSuper,
         );
       });
     });
-    return builder;
-  }
 
-  /**
-   * Build a suggestion to replace [targetId] in the given [unit]
-   * with an override of the given [signature].
-   */
-  Future<CompletionSuggestion> _buildSuggestion(DartCompletionRequest request,
-      SimpleIdentifier targetId, FunctionType signature) async {
-    // TODO(brianwilkerson) Determine whether this await is necessary.
-    await null;
-    StringBuffer displayTextBuffer = new StringBuffer();
-    DartChangeBuilder builder = await _buildReplacementText(
-        request.result, targetId, signature, displayTextBuffer);
     String replacement = builder.sourceChange.edits[0].edits[0].replacement;
     String completion = replacement.trim();
     String overrideAnnotation = '@override';
@@ -129,6 +111,7 @@
         false,
         displayText: displayText);
     suggestion.element = protocol.convertElement(signature.element);
+    suggestion.elementUri = signature.element.source.toString();
     return suggestion;
   }
 
@@ -138,7 +121,7 @@
    */
   SimpleIdentifier _getTargetId(CompletionTarget target) {
     AstNode node = target.containingNode;
-    if (node is ClassDeclaration) {
+    if (node is ClassOrMixinDeclaration) {
       Object entity = target.entity;
       if (entity is FieldDeclaration) {
         return _getTargetIdFromVarList(entity.fields);
@@ -174,17 +157,6 @@
   }
 
   /**
-   * Return `true` if the given [classElement] directly declares a member with
-   * the given [memberName].
-   */
-  bool _hasMember(ClassElement classElement, String memberName) {
-    return classElement.getField(memberName) != null ||
-        classElement.getGetter(memberName) != null ||
-        classElement.getMethod(memberName) != null ||
-        classElement.getSetter(memberName) != null;
-  }
-
-  /**
    * Return `true` if the given [node] has an `override` annotation.
    */
   bool _hasOverride(AstNode node) {
@@ -201,16 +173,14 @@
   }
 
   /**
-   * Return a list containing the subset of [interfaceNames] that are not
-   * defined yet in the given [classElement].
+   * Return the list of names that belong to the [interface] of a class, but
+   * are not yet declared in the class.
    */
-  List<Name> _namesToOverride(
-      ClassElement classElement, Iterable<Name> interfaceNames) {
-    var libraryUri = classElement.library.source.uri;
+  List<Name> _namesToOverride(Uri libraryUri, Interface interface) {
     var namesToOverride = <Name>[];
-    for (var name in interfaceNames) {
+    for (var name in interface.map.keys) {
       if (name.isAccessibleFor(libraryUri)) {
-        if (!_hasMember(classElement, name.name)) {
+        if (!interface.declared.containsKey(name)) {
           namesToOverride.add(name);
         }
       }
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/suggestion_builder.dart b/pkg/analysis_server/lib/src/services/completion/dart/suggestion_builder.dart
index 7c65f43..5f66d87 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/suggestion_builder.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/suggestion_builder.dart
@@ -51,6 +51,7 @@
   suggestion.docSummary = getDartDocSummary(doc);
 
   suggestion.element = protocol.convertElement(element);
+  suggestion.elementUri = element.source.uri.toString();
   Element enclosingElement = element.enclosingElement;
   if (enclosingElement is ClassElement) {
     suggestion.declaringType = enclosingElement.displayName;
@@ -165,6 +166,7 @@
     CompletionSuggestion suggestion = createSuggestion(element,
         completion: completion, kind: kind, relevance: relevance);
     if (suggestion != null) {
+      suggestion.elementUri = element.source.uri.toString();
       if (element.isSynthetic && element is PropertyAccessorElement) {
         String cacheKey;
         if (element.isGetter) {
diff --git a/pkg/analysis_server/lib/src/services/correction/assist.dart b/pkg/analysis_server/lib/src/services/correction/assist.dart
index 8601163..9f3595e 100644
--- a/pkg/analysis_server/lib/src/services/correction/assist.dart
+++ b/pkg/analysis_server/lib/src/services/correction/assist.dart
@@ -77,6 +77,10 @@
       "Convert to field formal parameter");
   static const CONVERT_TO_INT_LITERAL = const AssistKind(
       'dart.assist.convert.toIntLiteral', 30, "Convert to an int literal");
+  static const CONVERT_TO_MULTILINE_STRING = const AssistKind(
+      'dart.assist.convert.toMultilineString',
+      30,
+      "Convert to multiline string");
   static const CONVERT_TO_NORMAL_PARAMETER = const AssistKind(
       'dart.assist.convert.toConstructorNormalParameter',
       30,
diff --git a/pkg/analysis_server/lib/src/services/correction/assist_internal.dart b/pkg/analysis_server/lib/src/services/correction/assist_internal.dart
index 135f6dc..001180e 100644
--- a/pkg/analysis_server/lib/src/services/correction/assist_internal.dart
+++ b/pkg/analysis_server/lib/src/services/correction/assist_internal.dart
@@ -99,6 +99,7 @@
     await _addProposal_convertToIsNot_onNot();
     await _addProposal_convertToIsNotEmpty();
     await _addProposal_convertToFieldParameter();
+    await _addProposal_convertToMultilineString();
     await _addProposal_convertToNormalParameter();
     await _addProposal_convertToSingleQuotedString();
     await _addProposal_encapsulateField();
@@ -1266,6 +1267,36 @@
     }
   }
 
+  Future<void> _addProposal_convertToMultilineString() async {
+    var node = this.node;
+    if (node is InterpolationElement) {
+      node = (node as InterpolationElement).parent;
+    }
+    if (node is SingleStringLiteral) {
+      SingleStringLiteral literal = node;
+      if (!literal.isMultiline) {
+        var changeBuilder = _newDartChangeBuilder();
+        await changeBuilder.addFileEdit(file, (builder) {
+          var newQuote = literal.isSingleQuoted ? "'''" : '"""';
+          builder.addReplacement(
+            SourceRange(literal.offset + (literal.isRaw ? 1 : 0), 1),
+            (builder) {
+              builder.writeln(newQuote);
+            },
+          );
+          builder.addSimpleReplacement(
+            SourceRange(literal.end - 1, 1),
+            newQuote,
+          );
+        });
+        _addAssistFromBuilder(
+          changeBuilder,
+          DartAssistKind.CONVERT_TO_MULTILINE_STRING,
+        );
+      }
+    }
+  }
+
   Future<void> _addProposal_convertToSingleQuotedString() async {
     // TODO(brianwilkerson) Determine whether this await is necessary.
     await null;
@@ -1625,7 +1656,7 @@
               }
               builder.writeln('  @override');
               builder.writeln('  $stateName createState() {');
-              builder.writeln('    return new $stateName();');
+              builder.writeln('    return $stateName();');
               builder.writeln('  }');
               if (hasEmptyLineAfterCreateState) {
                 builder.writeln();
@@ -1817,8 +1848,8 @@
       return;
     }
 
-    // child: new ThisWidget(child: ourChild)
-    // children: [foo, new ThisWidget(child: ourChild), bar]
+    // child: ThisWidget(child: ourChild)
+    // children: [foo, ThisWidget(child: ourChild), bar]
     var changeBuilder = _newDartChangeBuilder();
     await changeBuilder.addFileEdit(file, (DartFileEditBuilder builder) {
       var childExpression = childArgument.expression;
@@ -2608,7 +2639,6 @@
         builder.write('[');
         builder.write(eol);
         builder.write(indentArg);
-        builder.write('new ');
         builder.addSimpleLinkedEdit('WIDGET', 'widget');
         builder.write('(');
         builder.write(eol);
diff --git a/pkg/analysis_server/lib/src/services/correction/fix.dart b/pkg/analysis_server/lib/src/services/correction/fix.dart
index e9bf18d..2f872621 100644
--- a/pkg/analysis_server/lib/src/services/correction/fix.dart
+++ b/pkg/analysis_server/lib/src/services/correction/fix.dart
@@ -201,6 +201,8 @@
       'MOVE_TYPE_ARGUMENTS_TO_CLASS',
       50,
       "Move type arguments to after class name");
+  static const REMOVE_ANNOTATION =
+      const FixKind('REMOVE_ANNOTATION', 50, "Remove the '{0}' annotation");
   static const REMOVE_AWAIT = const FixKind('REMOVE_AWAIT', 50, "Remove await");
   static const REMOVE_DEAD_CODE =
       const FixKind('REMOVE_DEAD_CODE', 50, "Remove dead code");
@@ -220,6 +222,8 @@
       "Remove unnecessary interpolation braces");
   static const REMOVE_METHOD_DECLARATION = const FixKind(
       'REMOVE_METHOD_DECLARATION', 50, "Remove method declaration");
+  static const REMOVE_NAME_FROM_COMBINATOR = const FixKind(
+      'REMOVE_NAME_FROM_COMBINATOR', 50, "Remove name from '{0}'");
   static const REMOVE_PARAMETERS_IN_GETTER_DECLARATION = const FixKind(
       'REMOVE_PARAMETERS_IN_GETTER_DECLARATION',
       50,
diff --git a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
index 0db0fb2..2d8e769 100644
--- a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
+++ b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
@@ -282,27 +282,107 @@
     if (errorCode == HintCode.DEAD_CODE) {
       await _addFix_removeDeadCode();
     }
+    if (errorCode == HintCode.DEAD_CODE_CATCH_FOLLOWING_CATCH ||
+        errorCode == HintCode.DEAD_CODE_ON_CATCH_SUBTYPE) {
+      await _addFix_removeDeadCode();
+      // TODO(brianwilkerson) Add a fix to move the unreachable catch clause to
+      //  a place where it can be reached (when possible).
+    }
+    // TODO(brianwilkerson) Define a syntax for deprecated members to indicate
+    //  how to update the code and implement a fix to apply the update.
+//    if (errorCode == HintCode.DEPRECATED_MEMBER_USE ||
+//        errorCode == HintCode.DEPRECATED_MEMBER_USE_FROM_SAME_PACKAGE) {
+//      await _addFix_replaceDeprecatedMemberUse();
+//    }
     if (errorCode == HintCode.DIVISION_OPTIMIZATION) {
       await _addFix_useEffectiveIntegerDivision();
     }
+    if (errorCode == HintCode.DUPLICATE_IMPORT) {
+      await _addFix_removeUnusedImport();
+    }
+    if (errorCode == HintCode.DUPLICATE_HIDDEN_NAME ||
+        errorCode == HintCode.DUPLICATE_SHOWN_NAME) {
+      await _addFix_removeNameFromCombinator();
+    }
+    // TODO(brianwilkerson) Add a fix to convert the path to a package: import.
+//    if (errorCode == HintCode.FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE) {
+//      await _addFix_convertPathToPackageUri();
+//    }
+    if (errorCode == HintCode.INVALID_FACTORY_ANNOTATION ||
+        errorCode == HintCode.INVALID_IMMUTABLE_ANNOTATION ||
+        errorCode == HintCode.INVALID_LITERAL_ANNOTATION ||
+        errorCode == HintCode.INVALID_REQUIRED_PARAM ||
+        errorCode == HintCode.INVALID_SEALED_ANNOTATION) {
+      await _addFix_removeAnnotation();
+    }
+    if (errorCode == HintCode.MISSING_REQUIRED_PARAM ||
+        errorCode == HintCode.MISSING_REQUIRED_PARAM_WITH_DETAILS) {
+      await _addFix_addMissingRequiredArgument();
+    }
+    if (errorCode == HintCode.OVERRIDE_ON_NON_OVERRIDING_GETTER ||
+        errorCode == HintCode.OVERRIDE_ON_NON_OVERRIDING_FIELD ||
+        errorCode == HintCode.OVERRIDE_ON_NON_OVERRIDING_METHOD ||
+        errorCode == HintCode.OVERRIDE_ON_NON_OVERRIDING_SETTER) {
+      await _addFix_removeAnnotation();
+    }
+    // TODO(brianwilkerson) Add a fix to normalize the path.
+//    if (errorCode == HintCode.PACKAGE_IMPORT_CONTAINS_DOT_DOT) {
+//      await _addFix_normalizeUri();
+//    }
+    if (errorCode == HintCode.SDK_VERSION_ASYNC_EXPORTED_FROM_CORE) {
+      await _addFix_importAsync();
+      await _addFix_updateSdkConstraints();
+    }
     if (errorCode == HintCode.TYPE_CHECK_IS_NOT_NULL) {
       await _addFix_isNotNull();
     }
     if (errorCode == HintCode.TYPE_CHECK_IS_NULL) {
       await _addFix_isNull();
     }
+    if (errorCode == HintCode.UNDEFINED_HIDDEN_NAME ||
+        errorCode == HintCode.UNDEFINED_SHOWN_NAME) {
+      await _addFix_removeNameFromCombinator();
+    }
     if (errorCode == HintCode.UNNECESSARY_CAST) {
       await _addFix_removeUnnecessaryCast();
     }
+    // TODO(brianwilkerson) Add a fix to remove the method.
+//    if (errorCode == HintCode.UNNECESSARY_NO_SUCH_METHOD) {
+//      await _addFix_removeMethodDeclaration();
+//    }
+    // TODO(brianwilkerson) Add a fix to remove the type check.
+//    if (errorCode == HintCode.UNNECESSARY_TYPE_CHECK_FALSE ||
+//        errorCode == HintCode.UNNECESSARY_TYPE_CHECK_TRUE) {
+//      await _addFix_removeUnnecessaryTypeCheck();
+//    }
     if (errorCode == HintCode.UNUSED_CATCH_CLAUSE) {
       await _addFix_removeUnusedCatchClause();
     }
     if (errorCode == HintCode.UNUSED_CATCH_STACK) {
       await _addFix_removeUnusedCatchStack();
     }
+    // TODO(brianwilkerson) Add a fix to remove the declaration. Decide whether
+    //  this should be a single general fix, or multiple more specific fixes
+    //  such as [_addFix_removeMethodDeclaration].
+//    if (errorCode == HintCode.UNUSED_ELEMENT ||
+//        errorCode == HintCode.UNUSED_FIELD) {
+//      await _addFix_removeUnusedDeclaration();
+//    }
     if (errorCode == HintCode.UNUSED_IMPORT) {
       await _addFix_removeUnusedImport();
     }
+    // TODO(brianwilkerson) Add a fix to remove the label.
+//    if (errorCode == HintCode.UNUSED_LABEL) {
+//      await _addFix_removeUnusedLabel();
+//    }
+    // TODO(brianwilkerson) Add a fix to remove the local variable, either with
+    //  or without the initialization code.
+//    if (errorCode == HintCode.UNUSED_LOCAL_VARIABLE) {
+//      await _addFix_removeUnusedLocalVariable();
+//    }
+    if (errorCode == HintCode.UNUSED_SHOWN_NAME) {
+      await _addFix_removeNameFromCombinator();
+    }
     if (errorCode == ParserErrorCode.EXPECTED_TOKEN) {
       await _addFix_insertSemicolon();
     }
@@ -327,10 +407,6 @@
       await _addFix_createConstructor_insteadOfSyntheticDefault();
       await _addFix_addMissingParameter();
     }
-    if (errorCode == HintCode.MISSING_REQUIRED_PARAM ||
-        errorCode == HintCode.MISSING_REQUIRED_PARAM_WITH_DETAILS) {
-      await _addFix_addMissingRequiredArgument();
-    }
     if (errorCode == StaticWarningCode.NEW_WITH_UNDEFINED_CONSTRUCTOR) {
       await _addFix_createConstructor_named();
     }
@@ -469,10 +545,6 @@
         CompileTimeErrorCode.MIXIN_APPLICATION_NOT_IMPLEMENTED_INTERFACE) {
       await _addFix_extendClassForMixin();
     }
-    if (errorCode == HintCode.SDK_VERSION_ASYNC_EXPORTED_FROM_CORE) {
-      await _addFix_importAsync();
-      await _addFix_updateSdkConstraints();
-    }
     // lints
     if (errorCode is LintCode) {
       String name = errorCode.name;
@@ -2509,6 +2581,49 @@
     _addFixFromBuilder(changeBuilder, DartFixKind.ADD_NE_NULL);
   }
 
+  Future<void> _addFix_removeAnnotation() async {
+    void addFix(Annotation node) async {
+      if (node == null) {
+        return;
+      }
+      Token followingToken = node.endToken.next;
+      followingToken = followingToken.precedingComments ?? followingToken;
+      DartChangeBuilder changeBuilder = _newDartChangeBuilder();
+      await changeBuilder.addFileEdit(file, (DartFileEditBuilder builder) {
+        builder.addDeletion(range.startStart(node, followingToken));
+      });
+      _addFixFromBuilder(changeBuilder, DartFixKind.REMOVE_ANNOTATION,
+          args: [node.name.name]);
+    }
+
+    Annotation findAnnotation(
+        NodeList<Annotation> metadata, String targetName) {
+      return metadata.firstWhere(
+          (annotation) => annotation.name.name == targetName,
+          orElse: () => null);
+    }
+
+    AstNode node = this.coveredNode;
+    if (node is Annotation) {
+      await addFix(node);
+    } else if (node is DefaultFormalParameter) {
+      await addFix(findAnnotation(node.parameter.metadata, 'required'));
+    } else if (node is NormalFormalParameter) {
+      await addFix(findAnnotation(node.metadata, 'required'));
+    } else if (node is DeclaredSimpleIdentifier) {
+      AstNode parent = node.parent;
+      if (parent is MethodDeclaration) {
+        await addFix(findAnnotation(parent.metadata, 'override'));
+      } else if (parent is VariableDeclaration) {
+        FieldDeclaration fieldDeclaration =
+            parent.thisOrAncestorOfType<FieldDeclaration>();
+        if (fieldDeclaration != null) {
+          await addFix(findAnnotation(fieldDeclaration.metadata, 'override'));
+        }
+      }
+    }
+  }
+
   Future<void> _addFix_removeAwait() async {
     // TODO(brianwilkerson) Determine whether this await is necessary.
     await null;
@@ -2524,8 +2639,6 @@
   }
 
   Future<void> _addFix_removeDeadCode() async {
-    // TODO(brianwilkerson) Determine whether this await is necessary.
-    await null;
     AstNode coveringNode = this.coveredNode;
     if (coveringNode is Expression) {
       AstNode parent = coveredNode.parent;
@@ -2564,6 +2677,17 @@
         builder.addDeletion(rangeToRemove);
       });
       _addFixFromBuilder(changeBuilder, DartFixKind.REMOVE_DEAD_CODE);
+    } else if (coveringNode is CatchClause) {
+      TryStatement tryStatement = coveringNode.parent;
+      NodeList<CatchClause> catchClauses = tryStatement.catchClauses;
+      int index = catchClauses.indexOf(coveringNode);
+      AstNode previous =
+          index == 0 ? tryStatement.body : catchClauses[index - 1];
+      DartChangeBuilder changeBuilder = _newDartChangeBuilder();
+      await changeBuilder.addFileEdit(file, (DartFileEditBuilder builder) {
+        builder.addDeletion(range.endEnd(previous, coveringNode));
+      });
+      _addFixFromBuilder(changeBuilder, DartFixKind.REMOVE_DEAD_CODE);
     }
   }
 
@@ -2673,6 +2797,68 @@
     }
   }
 
+  Future<void> _addFix_removeNameFromCombinator() async {
+    SourceRange rangeForCombinator(Combinator combinator) {
+      AstNode parent = combinator.parent;
+      if (parent is NamespaceDirective) {
+        NodeList<Combinator> combinators = parent.combinators;
+        if (combinators.length == 1) {
+          Token previousToken =
+              combinator.parent.findPrevious(combinator.beginToken);
+          return range.endEnd(previousToken, combinator);
+        }
+        int index = combinators.indexOf(combinator);
+        if (index < 0) {
+          return null;
+        } else if (index == combinators.length - 1) {
+          return range.endEnd(combinators[index - 1], combinator);
+        }
+        return range.startStart(combinator, combinators[index + 1]);
+      }
+      return null;
+    }
+
+    SourceRange rangeForNameInCombinator(
+        Combinator combinator, SimpleIdentifier name) {
+      NodeList<SimpleIdentifier> names;
+      if (combinator is HideCombinator) {
+        names = combinator.hiddenNames;
+      } else if (combinator is ShowCombinator) {
+        names = combinator.shownNames;
+      } else {
+        return null;
+      }
+      if (names.length == 1) {
+        return rangeForCombinator(combinator);
+      }
+      int index = names.indexOf(name);
+      if (index < 0) {
+        return null;
+      } else if (index == names.length - 1) {
+        return range.endEnd(names[index - 1], name);
+      }
+      return range.startStart(name, names[index + 1]);
+    }
+
+    AstNode node = this.coveredNode;
+    if (node is SimpleIdentifier) {
+      AstNode parent = coveredNode.parent;
+      if (parent is Combinator) {
+        SourceRange rangeToRemove = rangeForNameInCombinator(parent, node);
+        if (rangeToRemove == null) {
+          return;
+        }
+        DartChangeBuilder changeBuilder = _newDartChangeBuilder();
+        await changeBuilder.addFileEdit(file, (DartFileEditBuilder builder) {
+          builder.addDeletion(rangeToRemove);
+        });
+        _addFixFromBuilder(
+            changeBuilder, DartFixKind.REMOVE_NAME_FROM_COMBINATOR,
+            args: [parent is HideCombinator ? 'hide' : 'show']);
+      }
+    }
+  }
+
   Future<void> _addFix_removeParameters_inGetterDeclaration() async {
     // TODO(brianwilkerson) Determine whether this await is necessary.
     await null;
diff --git a/pkg/analysis_server/lib/src/socket_server.dart b/pkg/analysis_server/lib/src/socket_server.dart
index b9cdaf0..80e07cc 100644
--- a/pkg/analysis_server/lib/src/socket_server.dart
+++ b/pkg/analysis_server/lib/src/socket_server.dart
@@ -17,6 +17,7 @@
 abstract class AbstractSocketServer {
   AnalysisServerOptions get analysisServerOptions;
   AbstractAnalysisServer get analysisServer;
+  DiagnosticServer get diagnosticServer;
 }
 
 /**
diff --git a/pkg/analysis_server/test/abstract_context.dart b/pkg/analysis_server/test/abstract_context.dart
index 2d94d63..d9ffdb2 100644
--- a/pkg/analysis_server/test/abstract_context.dart
+++ b/pkg/analysis_server/test/abstract_context.dart
@@ -67,17 +67,67 @@
     addPackageFile('meta', 'meta.dart', r'''
 library meta;
 
+const _AlwaysThrows alwaysThrows = const _AlwaysThrows();
+
+@deprecated
+const _Checked checked = const _Checked();
+
+const _Experimental experimental = const _Experimental();
+
+const _Factory factory = const _Factory();
+
+const Immutable immutable = const Immutable();
+
 const _IsTest isTest = const _IsTest();
 
 const _IsTestGroup isTestGroup = const _IsTestGroup();
 
+const _Literal literal = const _Literal();
+
+const _MustCallSuper mustCallSuper = const _MustCallSuper();
+
+const _OptionalTypeArgs optionalTypeArgs = const _OptionalTypeArgs();
+
+const _Protected protected = const _Protected();
+
 const Required required = const Required();
 
+const _Sealed sealed = const _Sealed();
+
+@deprecated
+const _Virtual virtual = const _Virtual();
+
+const _VisibleForOverriding visibleForOverriding =
+    const _VisibleForOverriding();
+
+const _VisibleForTesting visibleForTesting = const _VisibleForTesting();
+
+class Immutable {
+  final String reason;
+  const Immutable([this.reason]);
+}
+
 class Required {
   final String reason;
   const Required([this.reason]);
 }
 
+class _AlwaysThrows {
+  const _AlwaysThrows();
+}
+
+class _Checked {
+  const _Checked();
+}
+
+class _Experimental {
+  const _Experimental();
+}
+
+class _Factory {
+  const _Factory();
+}
+
 class _IsTest {
   const _IsTest();
 }
@@ -85,6 +135,39 @@
 class _IsTestGroup {
   const _IsTestGroup();
 }
+
+class _Literal {
+  const _Literal();
+}
+
+class _MustCallSuper {
+  const _MustCallSuper();
+}
+
+class _OptionalTypeArgs {
+  const _OptionalTypeArgs();
+}
+
+class _Protected {
+  const _Protected();
+}
+
+class _Sealed {
+  const _Sealed();
+}
+
+@deprecated
+class _Virtual {
+  const _Virtual();
+}
+
+class _VisibleForOverriding {
+  const _VisibleForOverriding();
+}
+
+class _VisibleForTesting {
+  const _VisibleForTesting();
+}
 ''');
   }
 
diff --git a/pkg/analysis_server/test/analysis/get_errors_test.dart b/pkg/analysis_server/test/analysis/get_errors_test.dart
index db150ad..b32c59d 100644
--- a/pkg/analysis_server/test/analysis/get_errors_test.dart
+++ b/pkg/analysis_server/test/analysis/get_errors_test.dart
@@ -12,6 +12,7 @@
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 
 import '../analysis_abstract.dart';
+import '../mocks.dart';
 
 main() {
   defineReflectiveSuite(() {
@@ -95,6 +96,24 @@
     }
   }
 
+  test_invalidFilePathFormat_notAbsolute() async {
+    var request = _createGetErrorsRequest('test.dart');
+    var response = await waitResponse(request);
+    expect(
+      response,
+      isResponseFailure(requestId, RequestErrorCode.INVALID_FILE_PATH_FORMAT),
+    );
+  }
+
+  test_invalidFilePathFormat_notNormalized() async {
+    var request = _createGetErrorsRequest(convertPath('/foo/../bar/test.dart'));
+    var response = await waitResponse(request);
+    expect(
+      response,
+      isResponseFailure(requestId, RequestErrorCode.INVALID_FILE_PATH_FORMAT),
+    );
+  }
+
   test_noErrors() async {
     addTestFile('''
 main() {
diff --git a/pkg/analysis_server/test/analysis/get_hover_test.dart b/pkg/analysis_server/test/analysis/get_hover_test.dart
index faadc26..7dc1119 100644
--- a/pkg/analysis_server/test/analysis/get_hover_test.dart
+++ b/pkg/analysis_server/test/analysis/get_hover_test.dart
@@ -10,6 +10,7 @@
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 
 import '../analysis_abstract.dart';
+import '../mocks.dart';
 
 main() {
   defineReflectiveSuite(() {
@@ -416,6 +417,26 @@
     expect(hover.parameter, 'double myParameter');
   }
 
+  test_invalidFilePathFormat_notAbsolute() async {
+    var request = new AnalysisGetHoverParams('test.dart', 0).toRequest('0');
+    var response = await waitResponse(request);
+    expect(
+      response,
+      isResponseFailure('0', RequestErrorCode.INVALID_FILE_PATH_FORMAT),
+    );
+  }
+
+  test_invalidFilePathFormat_notNormalized() async {
+    var request =
+        new AnalysisGetHoverParams(convertPath('/foo/../bar/test.dart'), 0)
+            .toRequest('0');
+    var response = await waitResponse(request);
+    expect(
+      response,
+      isResponseFailure('0', RequestErrorCode.INVALID_FILE_PATH_FORMAT),
+    );
+  }
+
   test_localVariable_declaration() async {
     addTestFile('''
 library my.library;
diff --git a/pkg/analysis_server/test/analysis/get_navigation_test.dart b/pkg/analysis_server/test/analysis/get_navigation_test.dart
index cc31c34..b99aa74 100644
--- a/pkg/analysis_server/test/analysis/get_navigation_test.dart
+++ b/pkg/analysis_server/test/analysis/get_navigation_test.dart
@@ -9,6 +9,7 @@
 import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 
+import '../mocks.dart';
 import 'notification_navigation_test.dart';
 
 main() {
@@ -129,6 +130,25 @@
     expect(testTargets[0].kind, ElementKind.LIBRARY);
   }
 
+  test_invalidFilePathFormat_notAbsolute() async {
+    var request = _createGetNavigationRequest('test.dart', 0, 0);
+    var response = await waitResponse(request);
+    expect(
+      response,
+      isResponseFailure(requestId, RequestErrorCode.INVALID_FILE_PATH_FORMAT),
+    );
+  }
+
+  test_invalidFilePathFormat_notNormalized() async {
+    var request =
+        _createGetNavigationRequest(convertPath('/foo/../bar/test.dart'), 0, 0);
+    var response = await waitResponse(request);
+    expect(
+      response,
+      isResponseFailure(requestId, RequestErrorCode.INVALID_FILE_PATH_FORMAT),
+    );
+  }
+
   test_multipleRegions() async {
     addTestFile('''
 main() {
diff --git a/pkg/analysis_server/test/analysis/get_signature_test.dart b/pkg/analysis_server/test/analysis/get_signature_test.dart
index e91c889..4242908 100644
--- a/pkg/analysis_server/test/analysis/get_signature_test.dart
+++ b/pkg/analysis_server/test/analysis/get_signature_test.dart
@@ -11,6 +11,7 @@
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 
 import '../analysis_abstract.dart';
+import '../mocks.dart';
 
 main() {
   defineReflectiveSuite(() {
@@ -131,13 +132,6 @@
         equals(RequestErrorCode.GET_SIGNATURE_UNKNOWN_FUNCTION));
   }
 
-  test_error_file_invalid_path() async {
-    var result = await prepareRawSignatureAt(0, file: ':\\/?*');
-    expect(result.error, isNotNull);
-    expect(
-        result.error.code, equals(RequestErrorCode.GET_SIGNATURE_INVALID_FILE));
-  }
-
   test_error_file_not_analyzed() async {
     var result = await prepareRawSignatureAt(0,
         file: convertPath('/not/in/project.dart'));
@@ -407,6 +401,26 @@
     expect(result.parameters, hasLength(0));
   }
 
+  test_invalidFilePathFormat_notAbsolute() async {
+    var request = new AnalysisGetSignatureParams('test.dart', 0).toRequest('0');
+    var response = await waitResponse(request);
+    expect(
+      response,
+      isResponseFailure('0', RequestErrorCode.INVALID_FILE_PATH_FORMAT),
+    );
+  }
+
+  test_invalidFilePathFormat_notNormalized() async {
+    var request =
+        new AnalysisGetSignatureParams(convertPath('/foo/../bar/test.dart'), 0)
+            .toRequest('0');
+    var response = await waitResponse(request);
+    expect(
+      response,
+      isResponseFailure('0', RequestErrorCode.INVALID_FILE_PATH_FORMAT),
+    );
+  }
+
   test_method_instance() async {
     addTestFile('''
 /// MyClass doc
diff --git a/pkg/analysis_server/test/analysis/notification_highlights2_test.dart b/pkg/analysis_server/test/analysis/notification_highlights2_test.dart
index 1046cbe..4aa6ddc 100644
--- a/pkg/analysis_server/test/analysis/notification_highlights2_test.dart
+++ b/pkg/analysis_server/test/analysis/notification_highlights2_test.dart
@@ -16,102 +16,13 @@
 main() {
   defineReflectiveSuite(() {
     defineReflectiveTests(AnalysisNotificationHighlightsTest);
+    defineReflectiveTests(HighlightsWithControlFlowCollectionsTest);
     defineReflectiveTests(HighlightTypeTest);
   });
 }
 
 @reflectiveTest
-class AnalysisNotificationHighlightsTest extends AbstractAnalysisTest {
-  List<HighlightRegion> regions;
-
-  Completer _resultsAvailable = new Completer();
-
-  void assertHasRawRegion(HighlightRegionType type, int offset, int length) {
-    for (HighlightRegion region in regions) {
-      if (region.offset == offset &&
-          region.length == length &&
-          region.type == type) {
-        return;
-      }
-    }
-    fail('Expected to find (offset=$offset; length=$length; type=$type) in\n'
-        '${regions.join('\n')}');
-  }
-
-  void assertHasRegion(HighlightRegionType type, String search,
-      [int length = -1]) {
-    int offset = findOffset(search);
-    length = findRegionLength(search, length);
-    assertHasRawRegion(type, offset, length);
-  }
-
-  void assertHasStringRegion(HighlightRegionType type, String str) {
-    int offset = findOffset(str);
-    int length = str.length;
-    assertHasRawRegion(type, offset, length);
-  }
-
-  void assertNoRawRegion(HighlightRegionType type, int offset, int length) {
-    for (HighlightRegion region in regions) {
-      if (region.offset == offset &&
-          region.length == length &&
-          region.type == type) {
-        fail(
-            'Not expected to find (offset=$offset; length=$length; type=$type) in\n'
-            '${regions.join('\n')}');
-      }
-    }
-  }
-
-  void assertNoRegion(HighlightRegionType type, String search,
-      [int length = -1]) {
-    int offset = findOffset(search);
-    length = findRegionLength(search, length);
-    assertNoRawRegion(type, offset, length);
-  }
-
-  int findRegionLength(String search, int length) {
-    if (length == -1) {
-      length = 0;
-      while (length < search.length) {
-        int c = search.codeUnitAt(length);
-        if (length == 0 && c == '@'.codeUnitAt(0)) {
-          length++;
-          continue;
-        }
-        if (!(c >= 'a'.codeUnitAt(0) && c <= 'z'.codeUnitAt(0) ||
-            c >= 'A'.codeUnitAt(0) && c <= 'Z'.codeUnitAt(0) ||
-            c >= '0'.codeUnitAt(0) && c <= '9'.codeUnitAt(0))) {
-          break;
-        }
-        length++;
-      }
-    }
-    return length;
-  }
-
-  Future prepareHighlights() {
-    addAnalysisSubscription(AnalysisService.HIGHLIGHTS, testFile);
-    return _resultsAvailable.future;
-  }
-
-  void processNotification(Notification notification) {
-    if (notification.event == ANALYSIS_NOTIFICATION_HIGHLIGHTS) {
-      var params = new AnalysisHighlightsParams.fromNotification(notification);
-      if (params.file == testFile) {
-        regions = params.regions;
-        _resultsAvailable.complete(null);
-      }
-    }
-  }
-
-  @override
-  void setUp() {
-    super.setUp();
-    server.options.useAnalysisHighlight2 = true;
-    createProject();
-  }
-
+class AnalysisNotificationHighlightsTest extends HighlightsTestSupport {
   test_ANNOTATION_hasArguments() async {
     addTestFile('''
 class AAA {
@@ -791,6 +702,17 @@
     assertHasRegion(HighlightRegionType.KEYWORD, 'with A;');
   }
 
+  test_KEYWORD_ifElse_statement() async {
+    addTestFile('''
+f(a, b) {
+  if (a < b) {} else {}
+}
+''');
+    await prepareHighlights();
+    assertHasRegion(HighlightRegionType.KEYWORD, 'if');
+    assertHasRegion(HighlightRegionType.KEYWORD, 'else');
+  }
+
   test_KEYWORD_mixin() async {
     addTestFile('''
 mixin M {}
@@ -1122,6 +1044,103 @@
     assertHasRegion(type, 'unresolved(2)');
     assertHasRegion(type, 'unresolved(3)');
   }
+}
+
+class HighlightsTestSupport extends AbstractAnalysisTest {
+  List<HighlightRegion> regions;
+
+  Completer _resultsAvailable = new Completer();
+
+  void assertHasRawRegion(HighlightRegionType type, int offset, int length) {
+    for (HighlightRegion region in regions) {
+      if (region.offset == offset &&
+          region.length == length &&
+          region.type == type) {
+        return;
+      }
+    }
+    fail('Expected to find (offset=$offset; length=$length; type=$type) in\n'
+        '${regions.join('\n')}');
+  }
+
+  void assertHasRegion(HighlightRegionType type, String search,
+      [int length = -1]) {
+    int offset = findOffset(search);
+    length = findRegionLength(search, length);
+    assertHasRawRegion(type, offset, length);
+  }
+
+  void assertHasStringRegion(HighlightRegionType type, String str) {
+    int offset = findOffset(str);
+    int length = str.length;
+    assertHasRawRegion(type, offset, length);
+  }
+
+  void assertNoRawRegion(HighlightRegionType type, int offset, int length) {
+    for (HighlightRegion region in regions) {
+      if (region.offset == offset &&
+          region.length == length &&
+          region.type == type) {
+        fail(
+            'Not expected to find (offset=$offset; length=$length; type=$type) in\n'
+            '${regions.join('\n')}');
+      }
+    }
+  }
+
+  void assertNoRegion(HighlightRegionType type, String search,
+      [int length = -1]) {
+    int offset = findOffset(search);
+    length = findRegionLength(search, length);
+    assertNoRawRegion(type, offset, length);
+  }
+
+  int findRegionLength(String search, int length) {
+    if (length == -1) {
+      length = 0;
+      while (length < search.length) {
+        int c = search.codeUnitAt(length);
+        if (length == 0 && c == '@'.codeUnitAt(0)) {
+          length++;
+          continue;
+        }
+        if (!(c >= 'a'.codeUnitAt(0) && c <= 'z'.codeUnitAt(0) ||
+            c >= 'A'.codeUnitAt(0) && c <= 'Z'.codeUnitAt(0) ||
+            c >= '0'.codeUnitAt(0) && c <= '9'.codeUnitAt(0))) {
+          break;
+        }
+        length++;
+      }
+    }
+    return length;
+  }
+
+  Future prepareHighlights() {
+    addAnalysisSubscription(AnalysisService.HIGHLIGHTS, testFile);
+    return _resultsAvailable.future;
+  }
+
+  void processNotification(Notification notification) {
+    if (notification.event == SERVER_NOTIFICATION_ERROR) {
+      print('SERVER_NOTIFICATION_ERROR: ${notification.toJson()}');
+      _resultsAvailable.complete(null);
+      fail('SERVER_NOTIFICATION_ERROR');
+    }
+    if (notification.event == ANALYSIS_NOTIFICATION_HIGHLIGHTS) {
+      var params = new AnalysisHighlightsParams.fromNotification(notification);
+      if (params.file == testFile) {
+        regions = params.regions;
+        _resultsAvailable.complete(null);
+      }
+    }
+  }
+
+  @override
+  void setUp() {
+    super.setUp();
+    server.options.useAnalysisHighlight2 = true;
+    createProject();
+  }
 
   void _addLibraryForTestPart() {
     newFile(join(testFolder, 'my_lib.dart'), content: '''
@@ -1132,6 +1151,158 @@
 }
 
 @reflectiveTest
+class HighlightsWithControlFlowCollectionsTest extends HighlightsTestSupport {
+  @override
+  void createProject({Map<String, String> packageRoots}) {
+    addAnalysisOptionsFile('''
+analyzer:
+  enable-experiment:
+    - control-flow-collections
+''');
+    super.createProject(packageRoots: packageRoots);
+  }
+
+  @failingTest
+  test_KEYWORD_awaitForIn_list() async {
+    addTestFile('''
+f(a) async {
+  return [await for(var b in a) b];
+}
+''');
+    await prepareHighlights();
+    assertHasRegion(HighlightRegionType.KEYWORD, 'await');
+    assertHasRegion(HighlightRegionType.KEYWORD, 'for');
+    assertHasRegion(HighlightRegionType.KEYWORD, 'in');
+  }
+
+  @failingTest
+  test_KEYWORD_awaitForIn_map() async {
+    addTestFile('''
+f(a, b) async {
+  return {await for(var b in a) b};
+}
+''');
+    await prepareHighlights();
+    assertHasRegion(HighlightRegionType.KEYWORD, 'await');
+    assertHasRegion(HighlightRegionType.KEYWORD, 'for');
+    assertHasRegion(HighlightRegionType.KEYWORD, 'in');
+  }
+
+  @failingTest
+  test_KEYWORD_awaitForIn_set() async {
+    addTestFile('''
+f(a, b) async {
+  return {await for(var b in a) b};
+}
+''');
+    await prepareHighlights();
+    assertHasRegion(HighlightRegionType.KEYWORD, 'await');
+    assertHasRegion(HighlightRegionType.KEYWORD, 'for');
+    assertHasRegion(HighlightRegionType.KEYWORD, 'in');
+  }
+
+  test_KEYWORD_const_list() async {
+    addTestFile('''
+var v = const [];
+''');
+    await prepareHighlights();
+    assertHasRegion(HighlightRegionType.KEYWORD, 'const');
+  }
+
+  test_KEYWORD_const_map() async {
+    addTestFile('''
+var v = const {0 : 1};
+''');
+    await prepareHighlights();
+    assertHasRegion(HighlightRegionType.KEYWORD, 'const');
+  }
+
+  test_KEYWORD_const_set() async {
+    addTestFile('''
+var v = const {0};
+''');
+    await prepareHighlights();
+    assertHasRegion(HighlightRegionType.KEYWORD, 'const');
+  }
+
+  test_KEYWORD_if_list() async {
+    addTestFile('''
+f(a, b) {
+  return [if (a < b) 'a'];
+}
+''');
+    await prepareHighlights();
+    assertHasRegion(HighlightRegionType.KEYWORD, 'if');
+  }
+
+  test_KEYWORD_if_map() async {
+    addTestFile('''
+f(a, b) {
+  return {if (a < b) 'a' : 1};
+}
+''');
+    await prepareHighlights();
+    assertHasRegion(HighlightRegionType.KEYWORD, 'if');
+  }
+
+  test_KEYWORD_if_set() async {
+    addTestFile('''
+f(a, b) {
+  return {if (a < b) 'a'};
+}
+''');
+    await prepareHighlights();
+    assertHasRegion(HighlightRegionType.KEYWORD, 'if');
+  }
+
+  test_KEYWORD_ifElse_list() async {
+    addTestFile('''
+f(a, b) {
+  return [if (a < b) 'a' else 'b'];
+}
+''');
+    await prepareHighlights();
+    assertHasRegion(HighlightRegionType.KEYWORD, 'if');
+    assertHasRegion(HighlightRegionType.KEYWORD, 'else');
+  }
+
+  test_KEYWORD_ifElse_map() async {
+    addTestFile('''
+f(a, b) {
+  return {if (a < b) 'a' : 1 else 'b' : 2};
+}
+''');
+    await prepareHighlights();
+    assertHasRegion(HighlightRegionType.KEYWORD, 'if');
+    assertHasRegion(HighlightRegionType.KEYWORD, 'else');
+  }
+
+  test_KEYWORD_ifElse_set() async {
+    addTestFile('''
+f(a, b) {
+  return {if (a < b) 'a' else 'b'};
+}
+''');
+    await prepareHighlights();
+    assertHasRegion(HighlightRegionType.KEYWORD, 'if');
+    assertHasRegion(HighlightRegionType.KEYWORD, 'else');
+  }
+
+  test_LITERAL_LIST() async {
+    addTestFile('var V = <int>[1, 2, 3];');
+    await prepareHighlights();
+    assertHasStringRegion(HighlightRegionType.LITERAL_LIST, '<int>[1, 2, 3]');
+  }
+
+  test_LITERAL_MAP() async {
+    addTestFile("var V = const <int, String>{1: 'a', 2: 'b', 3: 'c'};");
+    await prepareHighlights();
+    assertHasStringRegion(HighlightRegionType.LITERAL_MAP,
+        "const <int, String>{1: 'a', 2: 'b', 3: 'c'}");
+  }
+}
+
+@reflectiveTest
 class HighlightTypeTest {
   void test_constructor() {
     expect(HighlightRegionType.CLASS,
diff --git a/pkg/analysis_server/test/analysis/notification_highlights_test.dart b/pkg/analysis_server/test/analysis/notification_highlights_test.dart
index 030addf..b992bc9 100644
--- a/pkg/analysis_server/test/analysis/notification_highlights_test.dart
+++ b/pkg/analysis_server/test/analysis/notification_highlights_test.dart
@@ -16,101 +16,13 @@
 main() {
   defineReflectiveSuite(() {
     defineReflectiveTests(AnalysisNotificationHighlightsTest);
+    defineReflectiveTests(HighlightsWithControlFlowCollectionsTest);
     defineReflectiveTests(HighlightTypeTest);
   });
 }
 
 @reflectiveTest
-class AnalysisNotificationHighlightsTest extends AbstractAnalysisTest {
-  List<HighlightRegion> regions;
-
-  Completer _resultsAvailable = new Completer();
-
-  void assertHasRawRegion(HighlightRegionType type, int offset, int length) {
-    for (HighlightRegion region in regions) {
-      if (region.offset == offset &&
-          region.length == length &&
-          region.type == type) {
-        return;
-      }
-    }
-    fail('Expected to find (offset=$offset; length=$length; type=$type) in\n'
-        '${regions.join('\n')}');
-  }
-
-  void assertHasRegion(HighlightRegionType type, String search,
-      [int length = -1]) {
-    int offset = findOffset(search);
-    length = findRegionLength(search, length);
-    assertHasRawRegion(type, offset, length);
-  }
-
-  void assertHasStringRegion(HighlightRegionType type, String str) {
-    int offset = findOffset(str);
-    int length = str.length;
-    assertHasRawRegion(type, offset, length);
-  }
-
-  void assertNoRawRegion(HighlightRegionType type, int offset, int length) {
-    for (HighlightRegion region in regions) {
-      if (region.offset == offset &&
-          region.length == length &&
-          region.type == type) {
-        fail(
-            'Not expected to find (offset=$offset; length=$length; type=$type) in\n'
-            '${regions.join('\n')}');
-      }
-    }
-  }
-
-  void assertNoRegion(HighlightRegionType type, String search,
-      [int length = -1]) {
-    int offset = findOffset(search);
-    length = findRegionLength(search, length);
-    assertNoRawRegion(type, offset, length);
-  }
-
-  int findRegionLength(String search, int length) {
-    if (length == -1) {
-      length = 0;
-      while (length < search.length) {
-        int c = search.codeUnitAt(length);
-        if (length == 0 && c == '@'.codeUnitAt(0)) {
-          length++;
-          continue;
-        }
-        if (!(c >= 'a'.codeUnitAt(0) && c <= 'z'.codeUnitAt(0) ||
-            c >= 'A'.codeUnitAt(0) && c <= 'Z'.codeUnitAt(0) ||
-            c >= '0'.codeUnitAt(0) && c <= '9'.codeUnitAt(0))) {
-          break;
-        }
-        length++;
-      }
-    }
-    return length;
-  }
-
-  Future prepareHighlights() {
-    addAnalysisSubscription(AnalysisService.HIGHLIGHTS, testFile);
-    return _resultsAvailable.future;
-  }
-
-  void processNotification(Notification notification) {
-    if (notification.event == ANALYSIS_NOTIFICATION_HIGHLIGHTS) {
-      var params = new AnalysisHighlightsParams.fromNotification(notification);
-      if (params.file == testFile) {
-        regions = params.regions;
-        _resultsAvailable.complete(null);
-      }
-    }
-  }
-
-  @override
-  void setUp() {
-    super.setUp();
-    createProject();
-  }
-
+class AnalysisNotificationHighlightsTest extends HighlightsTestSupport {
   test_ANNOTATION_hasArguments() async {
     addTestFile('''
 class AAA {
@@ -781,6 +693,17 @@
     assertHasRegion(HighlightRegionType.KEYWORD, 'with A;');
   }
 
+  test_KEYWORD_ifElse_statement() async {
+    addTestFile('''
+f(a, b) {
+  if (a < b) {} else {}
+}
+''');
+    await prepareHighlights();
+    assertHasRegion(HighlightRegionType.KEYWORD, 'if');
+    assertHasRegion(HighlightRegionType.KEYWORD, 'else');
+  }
+
   test_KEYWORD_mixin() async {
     addTestFile('''
 mixin M {}
@@ -971,6 +894,102 @@
     assertHasRegion(HighlightRegionType.TYPE_PARAMETER, 'T mmm(');
     assertHasRegion(HighlightRegionType.TYPE_PARAMETER, 'T p)');
   }
+}
+
+class HighlightsTestSupport extends AbstractAnalysisTest {
+  List<HighlightRegion> regions;
+
+  Completer _resultsAvailable = new Completer();
+
+  void assertHasRawRegion(HighlightRegionType type, int offset, int length) {
+    for (HighlightRegion region in regions) {
+      if (region.offset == offset &&
+          region.length == length &&
+          region.type == type) {
+        return;
+      }
+    }
+    fail('Expected to find (offset=$offset; length=$length; type=$type) in\n'
+        '${regions.join('\n')}');
+  }
+
+  void assertHasRegion(HighlightRegionType type, String search,
+      [int length = -1]) {
+    int offset = findOffset(search);
+    length = findRegionLength(search, length);
+    assertHasRawRegion(type, offset, length);
+  }
+
+  void assertHasStringRegion(HighlightRegionType type, String str) {
+    int offset = findOffset(str);
+    int length = str.length;
+    assertHasRawRegion(type, offset, length);
+  }
+
+  void assertNoRawRegion(HighlightRegionType type, int offset, int length) {
+    for (HighlightRegion region in regions) {
+      if (region.offset == offset &&
+          region.length == length &&
+          region.type == type) {
+        fail(
+            'Not expected to find (offset=$offset; length=$length; type=$type) in\n'
+            '${regions.join('\n')}');
+      }
+    }
+  }
+
+  void assertNoRegion(HighlightRegionType type, String search,
+      [int length = -1]) {
+    int offset = findOffset(search);
+    length = findRegionLength(search, length);
+    assertNoRawRegion(type, offset, length);
+  }
+
+  int findRegionLength(String search, int length) {
+    if (length == -1) {
+      length = 0;
+      while (length < search.length) {
+        int c = search.codeUnitAt(length);
+        if (length == 0 && c == '@'.codeUnitAt(0)) {
+          length++;
+          continue;
+        }
+        if (!(c >= 'a'.codeUnitAt(0) && c <= 'z'.codeUnitAt(0) ||
+            c >= 'A'.codeUnitAt(0) && c <= 'Z'.codeUnitAt(0) ||
+            c >= '0'.codeUnitAt(0) && c <= '9'.codeUnitAt(0))) {
+          break;
+        }
+        length++;
+      }
+    }
+    return length;
+  }
+
+  Future prepareHighlights() {
+    addAnalysisSubscription(AnalysisService.HIGHLIGHTS, testFile);
+    return _resultsAvailable.future;
+  }
+
+  void processNotification(Notification notification) {
+    if (notification.event == SERVER_NOTIFICATION_ERROR) {
+      print('SERVER_NOTIFICATION_ERROR: ${notification.toJson()}');
+      _resultsAvailable.complete(null);
+      fail('SERVER_NOTIFICATION_ERROR');
+    }
+    if (notification.event == ANALYSIS_NOTIFICATION_HIGHLIGHTS) {
+      var params = new AnalysisHighlightsParams.fromNotification(notification);
+      if (params.file == testFile) {
+        regions = params.regions;
+        _resultsAvailable.complete(null);
+      }
+    }
+  }
+
+  @override
+  void setUp() {
+    super.setUp();
+    createProject();
+  }
 
   void _addLibraryForTestPart() {
     newFile(join(testFolder, 'my_lib.dart'), content: '''
@@ -981,6 +1000,158 @@
 }
 
 @reflectiveTest
+class HighlightsWithControlFlowCollectionsTest extends HighlightsTestSupport {
+  @override
+  void createProject({Map<String, String> packageRoots}) {
+    addAnalysisOptionsFile('''
+analyzer:
+  enable-experiment:
+    - control-flow-collections
+''');
+    super.createProject(packageRoots: packageRoots);
+  }
+
+  @failingTest
+  test_KEYWORD_awaitForIn_list() async {
+    addTestFile('''
+f(a) async {
+  return [await for(var b in a) b];
+}
+''');
+    await prepareHighlights();
+    assertHasRegion(HighlightRegionType.KEYWORD, 'await');
+    assertHasRegion(HighlightRegionType.KEYWORD, 'for');
+    assertHasRegion(HighlightRegionType.KEYWORD, 'in');
+  }
+
+  @failingTest
+  test_KEYWORD_awaitForIn_map() async {
+    addTestFile('''
+f(a, b) async {
+  return {await for(var b in a) b};
+}
+''');
+    await prepareHighlights();
+    assertHasRegion(HighlightRegionType.KEYWORD, 'await');
+    assertHasRegion(HighlightRegionType.KEYWORD, 'for');
+    assertHasRegion(HighlightRegionType.KEYWORD, 'in');
+  }
+
+  @failingTest
+  test_KEYWORD_awaitForIn_set() async {
+    addTestFile('''
+f(a, b) async {
+  return {await for(var b in a) b};
+}
+''');
+    await prepareHighlights();
+    assertHasRegion(HighlightRegionType.KEYWORD, 'await');
+    assertHasRegion(HighlightRegionType.KEYWORD, 'for');
+    assertHasRegion(HighlightRegionType.KEYWORD, 'in');
+  }
+
+  test_KEYWORD_const_list() async {
+    addTestFile('''
+var v = const [];
+''');
+    await prepareHighlights();
+    assertHasRegion(HighlightRegionType.KEYWORD, 'const');
+  }
+
+  test_KEYWORD_const_map() async {
+    addTestFile('''
+var v = const {0 : 1};
+''');
+    await prepareHighlights();
+    assertHasRegion(HighlightRegionType.KEYWORD, 'const');
+  }
+
+  test_KEYWORD_const_set() async {
+    addTestFile('''
+var v = const {0};
+''');
+    await prepareHighlights();
+    assertHasRegion(HighlightRegionType.KEYWORD, 'const');
+  }
+
+  test_KEYWORD_if_list() async {
+    addTestFile('''
+f(a, b) {
+  return [if (a < b) 'a'];
+}
+''');
+    await prepareHighlights();
+    assertHasRegion(HighlightRegionType.KEYWORD, 'if');
+  }
+
+  test_KEYWORD_if_map() async {
+    addTestFile('''
+f(a, b) {
+  return {if (a < b) 'a' : 1};
+}
+''');
+    await prepareHighlights();
+    assertHasRegion(HighlightRegionType.KEYWORD, 'if');
+  }
+
+  test_KEYWORD_if_set() async {
+    addTestFile('''
+f(a, b) {
+  return {if (a < b) 'a'};
+}
+''');
+    await prepareHighlights();
+    assertHasRegion(HighlightRegionType.KEYWORD, 'if');
+  }
+
+  test_KEYWORD_ifElse_list() async {
+    addTestFile('''
+f(a, b) {
+  return [if (a < b) 'a' else 'b'];
+}
+''');
+    await prepareHighlights();
+    assertHasRegion(HighlightRegionType.KEYWORD, 'if');
+    assertHasRegion(HighlightRegionType.KEYWORD, 'else');
+  }
+
+  test_KEYWORD_ifElse_map() async {
+    addTestFile('''
+f(a, b) {
+  return {if (a < b) 'a' : 1 else 'b' : 2};
+}
+''');
+    await prepareHighlights();
+    assertHasRegion(HighlightRegionType.KEYWORD, 'if');
+    assertHasRegion(HighlightRegionType.KEYWORD, 'else');
+  }
+
+  test_KEYWORD_ifElse_set() async {
+    addTestFile('''
+f(a, b) {
+  return {if (a < b) 'a' else 'b'};
+}
+''');
+    await prepareHighlights();
+    assertHasRegion(HighlightRegionType.KEYWORD, 'if');
+    assertHasRegion(HighlightRegionType.KEYWORD, 'else');
+  }
+
+  test_LITERAL_LIST_withControlFlow() async {
+    addTestFile('var V = <int>[1, 2, 3];');
+    await prepareHighlights();
+    assertHasStringRegion(HighlightRegionType.LITERAL_LIST, '<int>[1, 2, 3]');
+  }
+
+  test_LITERAL_MAP_withControlFlow() async {
+    addTestFile("var V = const <int, String>{1: 'a', 2: 'b', 3: 'c'};");
+    await prepareHighlights();
+    assertHasStringRegion(HighlightRegionType.LITERAL_MAP,
+        "const <int, String>{1: 'a', 2: 'b', 3: 'c'}");
+  }
+}
+
+@reflectiveTest
 class HighlightTypeTest {
   void test_constructor() {
     expect(HighlightRegionType.CLASS,
diff --git a/pkg/analysis_server/test/analysis/set_priority_files_test.dart b/pkg/analysis_server/test/analysis/set_priority_files_test.dart
index bb6530d..dc03a1b 100644
--- a/pkg/analysis_server/test/analysis/set_priority_files_test.dart
+++ b/pkg/analysis_server/test/analysis/set_priority_files_test.dart
@@ -31,7 +31,7 @@
   }
 
   test_fileDoesNotExist() async {
-    String file = '$projectPath/doesNotExist.dart';
+    String file = convertPath('$projectPath/doesNotExist.dart');
     Response response = await _setPriorityFile(file);
     expect(response, isResponseSuccess('0'));
   }
@@ -48,7 +48,7 @@
   test_fileInSdk() async {
     addTestFile('');
     // set priority files
-    String filePath = '/lib/convert/convert.dart';
+    String filePath = convertPath('/lib/convert/convert.dart');
     Response response = await _setPriorityFile(filePath);
     expect(response, isResponseSuccess('0'));
     // verify
@@ -56,14 +56,14 @@
   }
 
   test_fileNotInAnalysisRoot() async {
-    String path = '/other/file.dart';
+    String path = convertPath('/other/file.dart');
     newFile(path);
     await _setPriorityFile(path);
     _verifyPriorityFiles(path);
   }
 
   test_ignoredInAnalysisOptions() async {
-    String sampleFile = '$projectPath/samples/sample.dart';
+    String sampleFile = convertPath('$projectPath/samples/sample.dart');
     newFile('$projectPath/.analysis_options', content: r'''
 analyzer:
   exclude:
@@ -78,7 +78,7 @@
   test_ignoredInAnalysisOptions_inChildContext() async {
     newFile('$projectPath/.packages');
     newFile('$projectPath/child/.packages');
-    String sampleFile = '$projectPath/child/samples/sample.dart';
+    String sampleFile = convertPath('$projectPath/child/samples/sample.dart');
     newFile('$projectPath/child/.analysis_options', content: r'''
 analyzer:
   exclude:
@@ -93,7 +93,7 @@
   test_ignoredInAnalysisOptions_inRootContext() async {
     newFile('$projectPath/.packages');
     newFile('$projectPath/child/.packages');
-    String sampleFile = '$projectPath/child/samples/sample.dart';
+    String sampleFile = convertPath('$projectPath/child/samples/sample.dart');
     newFile('$projectPath/.analysis_options', content: r'''
 analyzer:
   exclude:
@@ -105,6 +105,26 @@
     _verifyPriorityFiles(sampleFile);
   }
 
+  test_invalidFilePathFormat_notAbsolute() async {
+    var request =
+        new AnalysisSetPriorityFilesParams(['test.dart']).toRequest('0');
+    var response = await waitResponse(request);
+    expect(
+      response,
+      isResponseFailure('0', RequestErrorCode.INVALID_FILE_PATH_FORMAT),
+    );
+  }
+
+  test_invalidFilePathFormat_notNormalized() async {
+    var request = new AnalysisSetPriorityFilesParams(
+        [convertPath('/foo/../bar/test.dart')]).toRequest('0');
+    var response = await waitResponse(request);
+    expect(
+      response,
+      isResponseFailure('0', RequestErrorCode.INVALID_FILE_PATH_FORMAT),
+    );
+  }
+
   test_sentToPlugins() async {
     addTestFile('');
     // set priority files
diff --git a/pkg/analysis_server/test/analysis/update_content_test.dart b/pkg/analysis_server/test/analysis/update_content_test.dart
index 5ab9a4e..9245872 100644
--- a/pkg/analysis_server/test/analysis/update_content_test.dart
+++ b/pkg/analysis_server/test/analysis/update_content_test.dart
@@ -14,6 +14,7 @@
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 
 import '../analysis_abstract.dart';
+import '../mocks.dart';
 
 main() {
   defineReflectiveSuite(() {
@@ -60,6 +61,28 @@
     }
   }
 
+  test_invalidFilePathFormat_notAbsolute() async {
+    var request = new AnalysisUpdateContentParams(
+      {'test.dart': AddContentOverlay('')},
+    ).toRequest('0');
+    var response = await waitResponse(request);
+    expect(
+      response,
+      isResponseFailure('0', RequestErrorCode.INVALID_FILE_PATH_FORMAT),
+    );
+  }
+
+  test_invalidFilePathFormat_notNormalized() async {
+    var request = new AnalysisUpdateContentParams(
+      {convertPath('/foo/../bar/test.dart'): AddContentOverlay('')},
+    ).toRequest('0');
+    var response = await waitResponse(request);
+    expect(
+      response,
+      isResponseFailure('0', RequestErrorCode.INVALID_FILE_PATH_FORMAT),
+    );
+  }
+
   test_multiple_contexts() async {
     String project1path = convertPath('/project1');
     String project2path = convertPath('/project2');
diff --git a/pkg/analysis_server/test/analysis_abstract.dart b/pkg/analysis_server/test/analysis_abstract.dart
index 8415bc9..6135864 100644
--- a/pkg/analysis_server/test/analysis_abstract.dart
+++ b/pkg/analysis_server/test/analysis_abstract.dart
@@ -73,6 +73,12 @@
 
   AnalysisDriver get testDiver => server.getAnalysisDriver(testFile);
 
+  void addAnalysisOptionsFile(String content) {
+    newFile(
+        resourceProvider.pathContext.join(projectPath, 'analysis_options.yaml'),
+        content: content);
+  }
+
   void addAnalysisSubscription(AnalysisService service, String file) {
     // add file to subscription
     var files = analysisSubscriptions[service];
diff --git a/pkg/analysis_server/test/domain_analysis_test.dart b/pkg/analysis_server/test/domain_analysis_test.dart
index e50b52f..ae88bc8 100644
--- a/pkg/analysis_server/test/domain_analysis_test.dart
+++ b/pkg/analysis_server/test/domain_analysis_test.dart
@@ -105,8 +105,9 @@
   }
 
   test_setPriorityFiles_invalid() {
-    var request = new AnalysisSetPriorityFilesParams(['/project/lib.dart'])
-        .toRequest('0');
+    var request = new AnalysisSetPriorityFilesParams(
+      [convertPath('/project/lib.dart')],
+    ).toRequest('0');
     var response = handler.handleRequest(request);
     expect(response, isResponseSuccess('0'));
   }
diff --git a/pkg/analysis_server/test/domain_completion_test.dart b/pkg/analysis_server/test/domain_completion_test.dart
index f22f2f2..4749ab7 100644
--- a/pkg/analysis_server/test/domain_completion_test.dart
+++ b/pkg/analysis_server/test/domain_completion_test.dart
@@ -19,6 +19,7 @@
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 
 import 'domain_completion_util.dart';
+import 'mocks.dart';
 
 main() {
   defineReflectiveSuite(() {
@@ -548,6 +549,27 @@
     });
   }
 
+  test_invalidFilePathFormat_notAbsolute() async {
+    var request =
+        new CompletionGetSuggestionsParams('test.dart', 0).toRequest('0');
+    var response = await waitResponse(request);
+    expect(
+      response,
+      isResponseFailure('0', RequestErrorCode.INVALID_FILE_PATH_FORMAT),
+    );
+  }
+
+  test_invalidFilePathFormat_notNormalized() async {
+    var request = new CompletionGetSuggestionsParams(
+            convertPath('/foo/../bar/test.dart'), 0)
+        .toRequest('0');
+    var response = await waitResponse(request);
+    expect(
+      response,
+      isResponseFailure('0', RequestErrorCode.INVALID_FILE_PATH_FORMAT),
+    );
+  }
+
   test_invocation() {
     addTestFile('class A {b() {}} main() {A a; a.^}');
     return getSuggestions().then((_) {
diff --git a/pkg/analysis_server/test/domain_edit_dartfix_test.dart b/pkg/analysis_server/test/domain_edit_dartfix_test.dart
index edd543c..8e568e4 100644
--- a/pkg/analysis_server/test/domain_edit_dartfix_test.dart
+++ b/pkg/analysis_server/test/domain_edit_dartfix_test.dart
@@ -122,11 +122,18 @@
     createProject();
     addTestFile('''
 main() {
-  functionWithNullableParam(new List<Object>(1));
+  functionWithNullableParam(new List<String>(1));
   functionWithNullableParam(null);
 }
 
-void functionWithNullableParam(Object object) {
+class C1 {}
+class C2 {}
+class C extends C1 with M1 implements C2 {}
+
+mixin M1 {}
+mixin M on M1 implements C1 {}
+
+void functionWithNullableParam(String object) {
   if (object == null) {
     print('object is null');
   } else {
@@ -143,11 +150,18 @@
     expectSuggestion(result.suggestions[0], 'non-nullable', 46, 6);
     expectEdits(result.edits, '''
 main() {
-  functionWithNullableParam(new List<Object?>(1));
+  functionWithNullableParam(new List<String?>(1));
   functionWithNullableParam(null);
 }
 
-void functionWithNullableParam(Object? object) {
+class C1 {}
+class C2 {}
+class C extends C1 with M1 implements C2 {}
+
+mixin M1 {}
+mixin M on M1 implements C1 {}
+
+void functionWithNullableParam(String? object) {
   if (object == null) {
     print('object is null');
   } else {
diff --git a/pkg/analysis_server/test/edit/assists_test.dart b/pkg/analysis_server/test/edit/assists_test.dart
index d8a77f0..51c4da0 100644
--- a/pkg/analysis_server/test/edit/assists_test.dart
+++ b/pkg/analysis_server/test/edit/assists_test.dart
@@ -16,6 +16,7 @@
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 
 import '../analysis_abstract.dart';
+import '../mocks.dart';
 
 main() {
   defineReflectiveSuite(() {
@@ -68,6 +69,26 @@
     _assertHasChange(message, 'xmain() {}');
   }
 
+  test_invalidFilePathFormat_notAbsolute() async {
+    var request = new EditGetAssistsParams('test.dart', 0, 0).toRequest('0');
+    var response = await waitResponse(request);
+    expect(
+      response,
+      isResponseFailure('0', RequestErrorCode.INVALID_FILE_PATH_FORMAT),
+    );
+  }
+
+  test_invalidFilePathFormat_notNormalized() async {
+    var request =
+        new EditGetAssistsParams(convertPath('/foo/../bar/test.dart'), 0, 0)
+            .toRequest('0');
+    var response = await waitResponse(request);
+    expect(
+      response,
+      isResponseFailure('0', RequestErrorCode.INVALID_FILE_PATH_FORMAT),
+    );
+  }
+
   test_removeTypeAnnotation() async {
     addTestFile('''
 main() {
diff --git a/pkg/analysis_server/test/edit/fixes_test.dart b/pkg/analysis_server/test/edit/fixes_test.dart
index c9c5eaa..2fa8a24 100644
--- a/pkg/analysis_server/test/edit/fixes_test.dart
+++ b/pkg/analysis_server/test/edit/fixes_test.dart
@@ -16,6 +16,7 @@
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 
 import '../analysis_abstract.dart';
+import '../mocks.dart';
 
 main() {
   defineReflectiveSuite(() {
@@ -43,7 +44,7 @@
         await _getFixesAt('Completer<String>');
     expect(errorFixes, hasLength(1));
     AnalysisError error = errorFixes[0].error;
-    expect(error.severity, AnalysisErrorSeverity.WARNING);
+    expect(error.severity, AnalysisErrorSeverity.ERROR);
     expect(error.type, AnalysisErrorType.STATIC_WARNING);
     List<SourceChange> fixes = errorFixes[0].fixes;
     expect(fixes, hasLength(3));
@@ -96,6 +97,26 @@
     }
   }
 
+  test_invalidFilePathFormat_notAbsolute() async {
+    var request = new EditGetFixesParams('test.dart', 0).toRequest('0');
+    var response = await waitResponse(request);
+    expect(
+      response,
+      isResponseFailure('0', RequestErrorCode.INVALID_FILE_PATH_FORMAT),
+    );
+  }
+
+  test_invalidFilePathFormat_notNormalized() async {
+    var request =
+        new EditGetFixesParams(convertPath('/foo/../bar/test.dart'), 0)
+            .toRequest('0');
+    var response = await waitResponse(request);
+    expect(
+      response,
+      isResponseFailure('0', RequestErrorCode.INVALID_FILE_PATH_FORMAT),
+    );
+  }
+
   test_overlayOnlyFile() async {
     createProject();
     testCode = '''
diff --git a/pkg/analysis_server/test/edit/organize_directives_test.dart b/pkg/analysis_server/test/edit/organize_directives_test.dart
index e8424aa..116427e 100644
--- a/pkg/analysis_server/test/edit/organize_directives_test.dart
+++ b/pkg/analysis_server/test/edit/organize_directives_test.dart
@@ -55,13 +55,34 @@
   }
 
   Future test_BAD_notDartFile() async {
-    Request request =
-        new EditOrganizeDirectivesParams('/not-a-Dart-file.txt').toRequest('0');
+    Request request = new EditOrganizeDirectivesParams(
+      convertPath('/not-a-Dart-file.txt'),
+    ).toRequest('0');
     Response response = await waitResponse(request);
     expect(
         response, isResponseFailure('0', RequestErrorCode.FILE_NOT_ANALYZED));
   }
 
+  test_invalidFilePathFormat_notAbsolute() async {
+    var request = new EditOrganizeDirectivesParams('test.dart').toRequest('0');
+    var response = await waitResponse(request);
+    expect(
+      response,
+      isResponseFailure('0', RequestErrorCode.INVALID_FILE_PATH_FORMAT),
+    );
+  }
+
+  test_invalidFilePathFormat_notNormalized() async {
+    var request =
+        new EditOrganizeDirectivesParams(convertPath('/foo/../bar/test.dart'))
+            .toRequest('0');
+    var response = await waitResponse(request);
+    expect(
+      response,
+      isResponseFailure('0', RequestErrorCode.INVALID_FILE_PATH_FORMAT),
+    );
+  }
+
   Future test_OK_remove_duplicateImports_withSamePrefix() {
     addTestFile('''
 library lib;
diff --git a/pkg/analysis_server/test/edit/postfix_completion_test.dart b/pkg/analysis_server/test/edit/postfix_completion_test.dart
index 00139e5..c8cede9 100644
--- a/pkg/analysis_server/test/edit/postfix_completion_test.dart
+++ b/pkg/analysis_server/test/edit/postfix_completion_test.dart
@@ -10,6 +10,7 @@
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 
 import '../analysis_abstract.dart';
+import '../mocks.dart';
 
 main() {
   defineReflectiveSuite(() {
@@ -45,6 +46,27 @@
 ''');
   }
 
+  test_invalidFilePathFormat_notAbsolute() async {
+    var request = new EditGetPostfixCompletionParams('test.dart', '.for', 0)
+        .toRequest('0');
+    var response = await waitResponse(request);
+    expect(
+      response,
+      isResponseFailure('0', RequestErrorCode.INVALID_FILE_PATH_FORMAT),
+    );
+  }
+
+  test_invalidFilePathFormat_notNormalized() async {
+    var request = new EditGetPostfixCompletionParams(
+            convertPath('/foo/../bar/test.dart'), '.for', 0)
+        .toRequest('0');
+    var response = await waitResponse(request);
+    expect(
+      response,
+      isResponseFailure('0', RequestErrorCode.INVALID_FILE_PATH_FORMAT),
+    );
+  }
+
   void _assertHasChange(String message, String expectedCode, [Function cmp]) {
     if (change.message == message) {
       if (!change.edits.isEmpty) {
diff --git a/pkg/analysis_server/test/edit/refactoring_test.dart b/pkg/analysis_server/test/edit/refactoring_test.dart
index da70280..df6558d 100644
--- a/pkg/analysis_server/test/edit/refactoring_test.dart
+++ b/pkg/analysis_server/test/edit/refactoring_test.dart
@@ -352,6 +352,32 @@
 ''');
   }
 
+  test_invalidFilePathFormat_notAbsolute() async {
+    var request = new EditGetRefactoringParams(
+            RefactoringKind.EXTRACT_LOCAL_VARIABLE, 'test.dart', 0, 0, true)
+        .toRequest('0');
+    var response = await waitResponse(request);
+    expect(
+      response,
+      isResponseFailure('0', RequestErrorCode.INVALID_FILE_PATH_FORMAT),
+    );
+  }
+
+  test_invalidFilePathFormat_notNormalized() async {
+    var request = new EditGetRefactoringParams(
+            RefactoringKind.EXTRACT_LOCAL_VARIABLE,
+            convertPath('/foo/../bar/test.dart'),
+            0,
+            0,
+            true)
+        .toRequest('0');
+    var response = await waitResponse(request);
+    expect(
+      response,
+      isResponseFailure('0', RequestErrorCode.INVALID_FILE_PATH_FORMAT),
+    );
+  }
+
   test_names() async {
     addTestFile('''
 class TreeItem {}
@@ -901,6 +927,27 @@
     expect(kinds, contains(RefactoringKind.EXTRACT_WIDGET));
   }
 
+  test_invalidFilePathFormat_notAbsolute() async {
+    var request = new EditGetAvailableRefactoringsParams('test.dart', 0, 0)
+        .toRequest('0');
+    var response = await waitResponse(request);
+    expect(
+      response,
+      isResponseFailure('0', RequestErrorCode.INVALID_FILE_PATH_FORMAT),
+    );
+  }
+
+  test_invalidFilePathFormat_notNormalized() async {
+    var request = new EditGetAvailableRefactoringsParams(
+            convertPath('/foo/../bar/test.dart'), 0, 0)
+        .toRequest('0');
+    var response = await waitResponse(request);
+    expect(
+      response,
+      isResponseFailure('0', RequestErrorCode.INVALID_FILE_PATH_FORMAT),
+    );
+  }
+
   Future test_rename_hasElement_class() {
     return assertHasRenameRefactoring('''
 class Test {}
diff --git a/pkg/analysis_server/test/edit/sort_members_test.dart b/pkg/analysis_server/test/edit/sort_members_test.dart
index 04828b6..29c9cb9 100644
--- a/pkg/analysis_server/test/edit/sort_members_test.dart
+++ b/pkg/analysis_server/test/edit/sort_members_test.dart
@@ -55,13 +55,34 @@
   }
 
   test_BAD_notDartFile() async {
-    Request request =
-        new EditSortMembersParams('/not-a-Dart-file.txt').toRequest('0');
+    Request request = new EditSortMembersParams(
+      convertPath('/not-a-Dart-file.txt'),
+    ).toRequest('0');
     Response response = await waitResponse(request);
     expect(response,
         isResponseFailure('0', RequestErrorCode.SORT_MEMBERS_INVALID_FILE));
   }
 
+  test_invalidFilePathFormat_notAbsolute() async {
+    var request = new EditSortMembersParams('test.dart').toRequest('0');
+    var response = await waitResponse(request);
+    expect(
+      response,
+      isResponseFailure('0', RequestErrorCode.INVALID_FILE_PATH_FORMAT),
+    );
+  }
+
+  test_invalidFilePathFormat_notNormalized() async {
+    var request =
+        new EditSortMembersParams(convertPath('/foo/../bar/test.dart'))
+            .toRequest('0');
+    var response = await waitResponse(request);
+    expect(
+      response,
+      isResponseFailure('0', RequestErrorCode.INVALID_FILE_PATH_FORMAT),
+    );
+  }
+
   test_OK_afterWaitForAnalysis() async {
     addTestFile('''
 class C {}
diff --git a/pkg/analysis_server/test/edit/statement_completion_test.dart b/pkg/analysis_server/test/edit/statement_completion_test.dart
index 50f834b..4b381be 100644
--- a/pkg/analysis_server/test/edit/statement_completion_test.dart
+++ b/pkg/analysis_server/test/edit/statement_completion_test.dart
@@ -10,6 +10,7 @@
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 
 import '../analysis_abstract.dart';
+import '../mocks.dart';
 
 main() {
   defineReflectiveSuite(() {
@@ -28,6 +29,27 @@
     handler = new EditDomainHandler(server);
   }
 
+  test_invalidFilePathFormat_notAbsolute() async {
+    var request =
+        new EditGetStatementCompletionParams('test.dart', 0).toRequest('0');
+    var response = await waitResponse(request);
+    expect(
+      response,
+      isResponseFailure('0', RequestErrorCode.INVALID_FILE_PATH_FORMAT),
+    );
+  }
+
+  test_invalidFilePathFormat_notNormalized() async {
+    var request = new EditGetStatementCompletionParams(
+            convertPath('/foo/../bar/test.dart'), 0)
+        .toRequest('0');
+    var response = await waitResponse(request);
+    expect(
+      response,
+      isResponseFailure('0', RequestErrorCode.INVALID_FILE_PATH_FORMAT),
+    );
+  }
+
   test_plainEnterFromStart() async {
     addTestFile('''
 main() {
diff --git a/pkg/analysis_server/test/integration/lsp_server/integration_tests.dart b/pkg/analysis_server/test/integration/lsp_server/integration_tests.dart
new file mode 100644
index 0000000..8f21d53
--- /dev/null
+++ b/pkg/analysis_server/test/integration/lsp_server/integration_tests.dart
@@ -0,0 +1,128 @@
+// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:async';
+import 'dart:io';
+
+import 'package:analysis_server/lsp_protocol/protocol_generated.dart';
+import 'package:analysis_server/src/lsp/channel/lsp_byte_stream_channel.dart';
+import 'package:analyzer/instrumentation/instrumentation.dart';
+import 'package:analyzer/src/test_utilities/resource_provider_mixin.dart';
+import 'package:path/path.dart';
+
+import '../../lsp/server_abstract.dart';
+
+class AbstractLspAnalysisServerIntegrationTest
+    with
+        ResourceProviderMixin,
+        ClientCapabilitiesHelperMixin,
+        LspAnalysisServerTestMixin {
+  LspServerClient client;
+
+  final Map<int, Completer<ResponseMessage>> _completers = {};
+
+  @override
+  Stream<Message> get serverToClient => client.serverToClient;
+
+  @override
+  void sendNotificationToServer(NotificationMessage notification) =>
+      client.channel.sendNotification(notification);
+
+  @override
+  Future<ResponseMessage> sendRequestToServer(RequestMessage request) {
+    final completer = new Completer<ResponseMessage>();
+    final id = request.id.map(
+        (num) => num, (string) => throw 'String IDs not supported in tests');
+    _completers[id] = completer;
+
+    client.channel.sendRequest(request);
+
+    return completer.future;
+  }
+
+  @override
+  void sendResponseToServer(ResponseMessage response) =>
+      client.channel.sendResponse(response);
+
+  Future setUp() async {
+    client = new LspServerClient();
+    await client.start();
+    client.serverToClient.listen((message) {
+      if (message is ResponseMessage) {
+        final id = message.id.map((num) => num,
+            (string) => throw 'String IDs not supported in tests');
+
+        final completer = _completers[id];
+        if (completer == null) {
+          throw 'Response with ID $id was unexpected';
+        } else {
+          _completers.remove(id);
+          completer.complete(message);
+        }
+      }
+    });
+  }
+
+  tearDown() {
+    // TODO(dantup): Graceful shutdown?
+    client.close();
+  }
+}
+
+class LspServerClient {
+  Process _process;
+  LspByteStreamServerChannel channel;
+  final StreamController<Message> _serverToClient =
+      new StreamController<Message>.broadcast();
+
+  Future<int> get exitCode => _process.exitCode;
+
+  Stream<Message> get serverToClient => _serverToClient.stream;
+
+  void close() {
+    channel.close();
+    _process.kill();
+  }
+
+  /**
+   * Find the root directory of the analysis_server package by proceeding
+   * upward to the 'test' dir, and then going up one more directory.
+   */
+  String findRoot(String pathname) {
+    while (!['benchmark', 'test'].contains(basename(pathname))) {
+      String parent = dirname(pathname);
+      if (parent.length >= pathname.length) {
+        throw new Exception("Can't find root directory");
+      }
+      pathname = parent;
+    }
+    return dirname(pathname);
+  }
+
+  Future start() async {
+    if (_process != null) {
+      throw new Exception('Process already started');
+    }
+
+    String dartBinary = Platform.executable;
+
+    // TODO(dantup): The other servers integration tests can run with a snapshot
+    // which is much faster - we may wish to investigate doing the same here.
+    final rootDir =
+        findRoot(Platform.script.toFilePath(windows: Platform.isWindows));
+    final serverPath = normalize(join(rootDir, 'bin', 'server.dart'));
+
+    final arguments = [serverPath, '--lsp', '--suppress-analytics'];
+    _process = await Process.start(dartBinary, arguments);
+    _process.exitCode.then((int code) {
+      if (code != 0) {
+        // TODO(dantup): Log/fail tests...
+      }
+    });
+
+    channel = new LspByteStreamServerChannel(
+        _process.stdout, _process.stdin, InstrumentationService.NULL_SERVICE);
+    channel.listen(_serverToClient.add);
+  }
+}
diff --git a/pkg/analysis_server/test/integration/lsp_server/server_test.dart b/pkg/analysis_server/test/integration/lsp_server/server_test.dart
new file mode 100644
index 0000000..0e3c8c0
--- /dev/null
+++ b/pkg/analysis_server/test/integration/lsp_server/server_test.dart
@@ -0,0 +1,46 @@
+// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:test/test.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+
+import 'integration_tests.dart';
+
+main() {
+  defineReflectiveSuite(() {
+    defineReflectiveTests(ServerTest);
+  });
+}
+
+@reflectiveTest
+class ServerTest extends AbstractLspAnalysisServerIntegrationTest {
+  test_exit_afterShutdown() async {
+    await sendShutdown();
+    sendExit();
+
+    await client.channel.closed.timeout(const Duration(seconds: 10),
+        onTimeout: () =>
+            fail('Server channel did not close within 10 seconds'));
+
+    final exitCode = await client.exitCode.timeout(const Duration(seconds: 10),
+        onTimeout: () => fail('Server process did not exit within 10 seconds'));
+
+    expect(exitCode, equals(0));
+  }
+
+  @failingTest
+  test_exit_withoutShutdown() async {
+    sendExit();
+
+    await client.channel.closed.timeout(const Duration(seconds: 10),
+        onTimeout: () =>
+            fail('Server channel did not close within 10 seconds'));
+
+    final exitCode = await client.exitCode.timeout(const Duration(seconds: 10),
+        onTimeout: () => fail('Server process did not exit within 10 seconds'));
+
+    // TODO(dantup): Fix the server so this works.
+    expect(exitCode, equals(1));
+  }
+}
diff --git a/pkg/analysis_server/test/lsp/folding_test.dart b/pkg/analysis_server/test/lsp/folding_test.dart
new file mode 100644
index 0000000..0b41612
--- /dev/null
+++ b/pkg/analysis_server/test/lsp/folding_test.dart
@@ -0,0 +1,113 @@
+// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:analysis_server/lsp_protocol/protocol_generated.dart';
+import 'package:test/test.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+
+import 'server_abstract.dart';
+
+main() {
+  defineReflectiveSuite(() {
+    defineReflectiveTests(FoldingTest);
+  });
+}
+
+@reflectiveTest
+class FoldingTest extends AbstractLspAnalysisServerTest {
+  test_class() async {
+    final content = '''
+    class MyClass2 {[[
+      // Class content
+    ]]}
+    ''';
+
+    final range1 = rangeFromMarkers(content);
+    final expectedRegions = [
+      new FoldingRange(
+        range1.start.line,
+        range1.start.character,
+        range1.end.line,
+        range1.end.character,
+        null,
+      )
+    ];
+
+    await initialize();
+    await openFile(mainFileUri, withoutMarkers(content));
+
+    final regions = await getFoldingRegions(mainFileUri);
+    expect(regions, unorderedEquals(expectedRegions));
+  }
+
+  test_comments() async {
+    final content = '''
+    [[/// This is a comment
+    /// that spans many lines]]
+    class MyClass2 {}
+    ''';
+
+    final range1 = rangeFromMarkers(content);
+    final expectedRegions = [
+      new FoldingRange(
+        range1.start.line,
+        range1.start.character,
+        range1.end.line,
+        range1.end.character,
+        FoldingRangeKind.Comment,
+      )
+    ];
+
+    await initialize();
+    await openFile(mainFileUri, withoutMarkers(content));
+
+    final regions = await getFoldingRegions(mainFileUri);
+    expect(regions, unorderedEquals(expectedRegions));
+  }
+
+  test_headersImportsComments() async {
+    // TODO(dantup): Review why the file header and the method comment ranges
+    // are different... one spans only the range to collapse, but the other
+    // just starts at the logical block.
+    // The LSP spec doesn't give any guidance on whether the first part of
+    // the surrounded content should be visible or not after folding
+    // so we'll need to revisit this once there's clarification:
+    // https://github.com/Microsoft/language-server-protocol/issues/659
+    final content = '''
+    // Copyright some year by some people[[
+    // See LICENCE etc.]]
+
+    import[[ 'dart:io';
+    import 'dart:async';]]
+
+    [[/// This is not the file header
+    /// It's just a comment]]
+    main() {}
+    ''';
+
+    final ranges = rangesFromMarkers(content);
+
+    final expectedRegions = [
+      _toFoldingRange(ranges[0], FoldingRangeKind.Comment),
+      _toFoldingRange(ranges[1], FoldingRangeKind.Imports),
+      _toFoldingRange(ranges[2], FoldingRangeKind.Comment),
+    ];
+
+    await initialize();
+    await openFile(mainFileUri, withoutMarkers(content));
+
+    final regions = await getFoldingRegions(mainFileUri);
+    expect(regions, unorderedEquals(expectedRegions));
+  }
+
+  FoldingRange _toFoldingRange(Range range, FoldingRangeKind kind) {
+    return new FoldingRange(
+      range.start.line,
+      range.start.character,
+      range.end.line,
+      range.end.character,
+      kind,
+    );
+  }
+}
diff --git a/pkg/analysis_server/test/lsp/initialization_test.dart b/pkg/analysis_server/test/lsp/initialization_test.dart
index 7afb2a5..edbad6e 100644
--- a/pkg/analysis_server/test/lsp/initialization_test.dart
+++ b/pkg/analysis_server/test/lsp/initialization_test.dart
@@ -66,7 +66,7 @@
   test_uninitialized_dropsNotifications() async {
     final notification =
         makeNotification(new Method.fromJson('randomNotification'), null);
-    final nextNotification = channel.errorNotificationsFromServer.first;
+    final nextNotification = errorNotificationsFromServer.first;
     channel.sendNotificationToServer(notification);
 
     // Wait up to 1sec to ensure no error/log notifications were sent back.
diff --git a/pkg/analysis_server/test/lsp/rename_test.dart b/pkg/analysis_server/test/lsp/rename_test.dart
index 6226b60..2406dbb 100644
--- a/pkg/analysis_server/test/lsp/rename_test.dart
+++ b/pkg/analysis_server/test/lsp/rename_test.dart
@@ -17,11 +17,6 @@
 
 @reflectiveTest
 class RenameTest extends AbstractLspAnalysisServerTest {
-  // TODO(dantup): send a rename without a version
-  // TODO(dantup): send an old version of the doc?
-  // TODO(dantup): check the version returned matches?
-  // TODO(dantup): renames across multiple files
-
   test_prepare_class() {
     const content = '''
     class MyClass {}
@@ -122,6 +117,23 @@
         content, 'MyNewClass', expectedContent);
   }
 
+  test_rename_withoutVersionedIdentifier() {
+    // Without sending a document version, the rename should still work because
+    // the server should use the version it had at the start of the rename
+    // operation.
+    const content = '''
+    class MyClass {}
+    final a = new [[My^Class]]();
+    ''';
+    const expectedContent = '''
+    class MyNewClass {}
+    final a = new MyNewClass();
+    ''';
+    return _test_rename_withDocumentChanges(
+        content, 'MyNewClass', expectedContent,
+        sendRenameVersion: false);
+  }
+
   test_rename_classNewKeyword() async {
     const content = '''
     class MyClass {}
@@ -321,16 +333,25 @@
   }
 
   _test_rename_withDocumentChanges(
-      String content, String newName, String expectedContent) async {
+    String content,
+    String newName,
+    String expectedContent, {
+    sendDocumentVersion = true,
+    sendRenameVersion = true,
+  }) async {
+    // The specific number doesn't matter here, it's just a placeholder to confirm
+    // the values match.
+    final documentVersion = 222;
     await initialize(
       workspaceCapabilities:
           withDocumentChangesSupport(emptyWorkspaceClientCapabilities),
     );
-    await openFile(mainFileUri, withoutMarkers(content), version: 222);
+    await openFile(mainFileUri, withoutMarkers(content),
+        version: sendDocumentVersion ? documentVersion : null);
 
     final result = await rename(
       mainFileUri,
-      222,
+      sendRenameVersion ? documentVersion : null,
       positionFromMarker(content),
       newName,
     );
@@ -341,8 +362,70 @@
       final contents = {
         mainFilePath: withoutMarkers(content),
       };
-      applyDocumentChanges(contents, result.documentChanges);
+      final documentVersions = {
+        mainFilePath: documentVersion,
+      };
+      applyDocumentChanges(
+        contents,
+        result.documentChanges,
+        expectedVersions: documentVersions,
+      );
       expect(contents[mainFilePath], equals(expectedContent));
     }
   }
+
+  test_rename_multipleFiles() async {
+    final referencedFilePath =
+        join(projectFolderPath, 'lib', 'referenced.dart');
+    final referencedFileUri = Uri.file(referencedFilePath);
+    const mainContent = '''
+    import 'referenced.dart';
+    final a = new My^Class();
+    ''';
+    const referencedContent = '''
+    class MyClass {}
+    ''';
+    const expectedMainContent = '''
+    import 'referenced.dart';
+    final a = new MyNewClass();
+    ''';
+    const expectedReferencedContent = '''
+    class MyNewClass {}
+    ''';
+    const mainVersion = 111;
+    const referencedVersion = 222;
+
+    await initialize(
+      workspaceCapabilities:
+          withDocumentChangesSupport(emptyWorkspaceClientCapabilities),
+    );
+    await openFile(mainFileUri, withoutMarkers(mainContent),
+        version: mainVersion);
+    await openFile(referencedFileUri, withoutMarkers(referencedContent),
+        version: referencedVersion);
+
+    final result = await rename(
+      mainFileUri,
+      mainVersion,
+      positionFromMarker(mainContent),
+      'MyNewClass',
+    );
+
+    // Ensure applying the changes will give us the expected content.
+    final contents = {
+      mainFilePath: withoutMarkers(mainContent),
+      referencedFilePath: withoutMarkers(referencedContent),
+    };
+    final documentVersions = {
+      mainFilePath: mainVersion,
+      referencedFilePath: referencedVersion,
+    };
+    applyDocumentChanges(
+      contents,
+      result.documentChanges,
+      expectedVersions: documentVersions,
+    );
+    expect(contents[mainFilePath], equals(expectedMainContent));
+    expect(contents[referencedFilePath], equals(expectedReferencedContent));
+  }
 }
diff --git a/pkg/analysis_server/test/lsp/server_abstract.dart b/pkg/analysis_server/test/lsp/server_abstract.dart
index fad7baf..94c60f2 100644
--- a/pkg/analysis_server/test/lsp/server_abstract.dart
+++ b/pkg/analysis_server/test/lsp/server_abstract.dart
@@ -4,9 +4,11 @@
 
 import 'dart:async';
 
+import 'package:analysis_server/lsp_protocol/protocol_custom_generated.dart';
 import 'package:analysis_server/lsp_protocol/protocol_generated.dart';
 import 'package:analysis_server/lsp_protocol/protocol_special.dart';
 import 'package:analysis_server/src/analysis_server.dart';
+import 'package:analysis_server/src/lsp/constants.dart';
 import 'package:analysis_server/src/lsp/lsp_analysis_server.dart';
 import 'package:analysis_server/src/lsp/mapping.dart';
 import 'package:analyzer/instrumentation/instrumentation.dart';
@@ -28,8 +30,8 @@
 
 final beginningOfDocument = new Range(new Position(0, 0), new Position(0, 0));
 
-abstract class AbstractLspAnalysisServerTest
-    with ResourceProviderMixin, ClientCapabilitiesHelperMixin {
+mixin LspAnalysisServerTestMixin
+    implements ResourceProviderMixin, ClientCapabilitiesHelperMixin {
   static const positionMarker = '^';
   static const rangeMarkerStart = '[[';
   static const rangeMarkerEnd = ']]';
@@ -37,13 +39,46 @@
   static final allMarkersPattern =
       new RegExp(allMarkers.map(RegExp.escape).join('|'));
 
-  MockLspServerChannel channel;
-  LspAnalysisServer server;
-
   int _id = 0;
   String projectFolderPath, mainFilePath;
   Uri projectFolderUri, mainFileUri;
 
+  Stream<Message> get serverToClient;
+
+  /**
+   * A stream of [NotificationMessage]s from the server that may be errors.
+   */
+  Stream<NotificationMessage> get errorNotificationsFromServer {
+    return notificationsFromServer.where(_isErrorNotification);
+  }
+
+  /**
+   * A stream of [NotificationMessage]s from the server.
+   */
+  Stream<NotificationMessage> get notificationsFromServer {
+    return serverToClient
+        .where((m) => m is NotificationMessage)
+        .cast<NotificationMessage>();
+  }
+
+  /// Checks whether a notification is likely an error from the server (for
+  /// example a window/showMessage). This is useful for tests that want to
+  /// ensure no errors come from the server in response to notifications (which
+  /// don't have their own responses).
+  bool _isErrorNotification(NotificationMessage notification) {
+    return notification.method == Method.window_logMessage ||
+        notification.method == Method.window_showMessage;
+  }
+
+  /**
+   * A stream of [RequestMessage]s from the server.
+   */
+  Stream<RequestMessage> get requestsFromServer {
+    return serverToClient
+        .where((m) => m is RequestMessage)
+        .cast<RequestMessage>();
+  }
+
   void applyChanges(
     Map<String, String> fileContents,
     Map<String, List<TextEdit>> changes,
@@ -55,13 +90,17 @@
   }
 
   void applyDocumentChanges(
-      Map<String, String> fileContents,
-      Either2<
-              List<TextDocumentEdit>,
-              List<
-                  Either4<TextDocumentEdit, CreateFile, RenameFile,
-                      DeleteFile>>>
-          documentChanges) {
+    Map<String, String> fileContents,
+    Either2<List<TextDocumentEdit>,
+            List<Either4<TextDocumentEdit, CreateFile, RenameFile, DeleteFile>>>
+        documentChanges, {
+    Map<String, int> expectedVersions,
+  }) {
+    // If we were supplied with expected versions, ensure that all returned
+    // edits match the versions.
+    if (expectedVersions != null) {
+      expectDocumentVersions(documentChanges, expectedVersions);
+    }
     documentChanges.map(
       (edits) => applyTextDocumentEdits(fileContents, edits),
       (changes) => applyResourceChanges(fileContents, changes),
@@ -152,8 +191,7 @@
         changes,
       ),
     );
-    channel.sendNotificationToServer(notification);
-    await pumpEventQueue();
+    sendNotificationToServer(notification);
   }
 
   Future changeWorkspaceFolders({List<Uri> add, List<Uri> remove}) async {
@@ -166,8 +204,7 @@
         ),
       ),
     );
-    channel.sendNotificationToServer(notification);
-    await pumpEventQueue();
+    sendNotificationToServer(notification);
   }
 
   Future closeFile(Uri uri) async {
@@ -176,8 +213,7 @@
       new DidCloseTextDocumentParams(
           new TextDocumentIdentifier(uri.toString())),
     );
-    channel.sendNotificationToServer(notification);
-    await pumpEventQueue();
+    sendNotificationToServer(notification);
   }
 
   Future<Object> executeCommand(Command command) async {
@@ -191,11 +227,50 @@
     return expectSuccessfulResponseTo(request);
   }
 
+  void expectDocumentVersion(
+    TextDocumentEdit edit,
+    Map<String, int> expectedVersions,
+  ) {
+    final path = Uri.parse(edit.textDocument.uri).toFilePath();
+    final expectedVersion = expectedVersions[path];
+
+    if (edit.textDocument is VersionedTextDocumentIdentifier) {
+      expect(edit.textDocument.version, equals(expectedVersion));
+    } else {
+      throw 'Document identifier for $path was not versioned (expected version $expectedVersion)';
+    }
+  }
+
+  /// Validates the document versions for a set of edits match the versions in
+  /// the supplied map.
+  void expectDocumentVersions(
+    Either2<List<TextDocumentEdit>,
+            List<Either4<TextDocumentEdit, CreateFile, RenameFile, DeleteFile>>>
+        documentChanges,
+    Map<String, int> expectedVersions,
+  ) {
+    documentChanges.map(
+      // Validate versions on simple doc edits
+      (edits) => edits
+          .forEach((edit) => expectDocumentVersion(edit, expectedVersions)),
+      // For resource changes, we only need to validate changes since
+      // creates/renames/deletes do not supply versions.
+      (changes) => changes.forEach((change) {
+            change.map(
+              (edit) => expectDocumentVersion(edit, expectedVersions),
+              (create) => {},
+              (rename) {},
+              (delete) {},
+            );
+          }),
+    );
+  }
+
   Future<T> expectErrorNotification<T>(
     FutureOr<void> f(), {
     Duration timeout = const Duration(seconds: 5),
   }) async {
-    final firstError = channel.errorNotificationsFromServer.first;
+    final firstError = errorNotificationsFromServer.first;
     await f();
 
     final notificationFromServer = await firstError.timeout(timeout);
@@ -211,7 +286,7 @@
     Duration timeout = const Duration(seconds: 5),
   }) async {
     final firstRequest =
-        channel.requestsFromServer.firstWhere((n) => n.method == method);
+        requestsFromServer.firstWhere((n) => n.method == method);
     await f();
 
     final requestFromServer = await firstRequest.timeout(timeout);
@@ -223,7 +298,7 @@
   /// Sends a request to the server and unwraps the result. Throws if the
   /// response was not successful or returned an error.
   Future<T> expectSuccessfulResponseTo<T>(RequestMessage request) async {
-    final resp = await channel.sendRequestToServer(request);
+    final resp = await sendRequestToServer(request);
     if (resp.error != null) {
       throw resp.error;
     } else {
@@ -298,6 +373,14 @@
     return expectSuccessfulResponseTo<List<Location>>(request);
   }
 
+  Future<DartDiagnosticServer> getDiagnosticServer() {
+    final request = makeRequest(
+      CustomMethods.DiagnosticServer,
+      null,
+    );
+    return expectSuccessfulResponseTo(request);
+  }
+
   Future<List<DocumentHighlight>> getDocumentHighlights(Uri uri, Position pos) {
     final request = makeRequest(
       Method.textDocument_documentHighlight,
@@ -320,6 +403,14 @@
     return expectSuccessfulResponseTo(request);
   }
 
+  Future<List<FoldingRange>> getFoldingRegions(Uri uri) {
+    final request = makeRequest(
+      Method.textDocument_foldingRange,
+      new FoldingRangeParams(new TextDocumentIdentifier(uri.toString())),
+    );
+    return expectSuccessfulResponseTo<List<FoldingRange>>(request);
+  }
+
   Future<Hover> getHover(Uri uri, Position pos) {
     final request = makeRequest(
       Method.textDocument_hover,
@@ -430,12 +521,12 @@
             ),
             null,
             workspaceFolders?.map(toWorkspaceFolder)?.toList()));
-    final response = await channel.sendRequestToServer(request);
+    final response = await sendRequestToServer(request);
     expect(response.id, equals(request.id));
 
     if (response.error == null) {
       final notification = makeNotification(Method.initialized, null);
-      channel.sendNotificationToServer(notification);
+      sendNotificationToServer(notification);
       await pumpEventQueue();
     }
 
@@ -469,7 +560,7 @@
       new DidOpenTextDocumentParams(new TextDocumentItem(
           uri.toString(), dartLanguageId, version, content)),
     );
-    channel.sendNotificationToServer(notification);
+    sendNotificationToServer(notification);
     await pumpEventQueue();
   }
 
@@ -560,7 +651,7 @@
     String newName,
   ) {
     final request = makeRenameRequest(version, uri, pos, newName);
-    return channel.sendRequestToServer(request);
+    return sendRequestToServer(request);
   }
 
   Future replaceFile(int newVersion, Uri uri, String content) {
@@ -574,10 +665,77 @@
   /// Sends [responseParams] to the server as a successful response to
   /// a server-initiated [request].
   void respondTo<T>(RequestMessage request, T responseParams) {
-    channel.sendResponseToServer(
+    sendResponseToServer(
         new ResponseMessage(request.id, responseParams, null, jsonRpcVersion));
   }
 
+  Future<Null> sendShutdown() {
+    final request = makeRequest(Method.shutdown, null);
+    return expectSuccessfulResponseTo(request);
+  }
+
+  void sendExit() {
+    final request = makeRequest(Method.exit, null);
+    sendRequestToServer(request);
+  }
+
+  FutureOr<void> sendNotificationToServer(NotificationMessage notification);
+
+  Future<ResponseMessage> sendRequestToServer(RequestMessage request);
+
+  void sendResponseToServer(ResponseMessage response);
+
+  WorkspaceFolder toWorkspaceFolder(Uri uri) {
+    return WorkspaceFolder(uri.toString(), path.basename(uri.toFilePath()));
+  }
+
+  Future<List<Diagnostic>> waitForDiagnostics(Uri uri) async {
+    PublishDiagnosticsParams diagnosticParams;
+    await serverToClient.firstWhere((message) {
+      if (message is NotificationMessage &&
+          message.method == Method.textDocument_publishDiagnostics) {
+        diagnosticParams = message.params;
+
+        return diagnosticParams.uri == uri.toString();
+      }
+      return false;
+    });
+    return diagnosticParams.diagnostics;
+  }
+
+  /// Removes markers like `[[` and `]]` and `^` that are used for marking
+  /// positions/ranges in strings to avoid hard-coding positions in tests.
+  String withoutMarkers(String contents) =>
+      contents.replaceAll(allMarkersPattern, '');
+
+  /// Removes range markers from strings to give accurate position offsets.
+  String withoutRangeMarkers(String contents) =>
+      contents.replaceAll(rangeMarkerStart, '').replaceAll(rangeMarkerEnd, '');
+}
+
+abstract class AbstractLspAnalysisServerTest
+    with
+        ResourceProviderMixin,
+        ClientCapabilitiesHelperMixin,
+        LspAnalysisServerTestMixin {
+  MockLspServerChannel channel;
+  LspAnalysisServer server;
+
+  Stream<Message> get serverToClient => channel.serverToClient;
+
+  Future sendNotificationToServer(NotificationMessage notification) async {
+    channel.sendNotificationToServer(notification);
+    await pumpEventQueue();
+  }
+
+  Future<ResponseMessage> sendRequestToServer(RequestMessage request) {
+    return channel.sendRequestToServer(request);
+  }
+
+  void sendResponseToServer(ResponseMessage response) {
+    channel.sendResponseToServer(response);
+  }
+
   void setUp() {
     channel = new MockLspServerChannel(debugPrintCommunication);
     // Create an SDK in the mock file system.
@@ -604,33 +762,6 @@
     channel.close();
     await server.shutdown();
   }
-
-  WorkspaceFolder toWorkspaceFolder(Uri uri) {
-    return WorkspaceFolder(uri.toString(), path.basename(uri.toFilePath()));
-  }
-
-  Future<List<Diagnostic>> waitForDiagnostics(Uri uri) async {
-    PublishDiagnosticsParams diagnosticParams;
-    await channel.serverToClient.firstWhere((message) {
-      if (message is NotificationMessage &&
-          message.method == Method.textDocument_publishDiagnostics) {
-        diagnosticParams = message.params;
-
-        return diagnosticParams.uri == uri.toString();
-      }
-      return false;
-    });
-    return diagnosticParams.diagnostics;
-  }
-
-  /// Removes markers like `[[` and `]]` and `^` that are used for marking
-  /// positions/ranges in strings to avoid hard-coding positions in tests.
-  String withoutMarkers(String contents) =>
-      contents.replaceAll(allMarkersPattern, '');
-
-  /// Removes range markers from strings to give accurate position offsets.
-  String withoutRangeMarkers(String contents) =>
-      contents.replaceAll(rangeMarkerStart, '').replaceAll(rangeMarkerEnd, '');
 }
 
 mixin ClientCapabilitiesHelperMixin {
diff --git a/pkg/analysis_server/test/lsp/server_test.dart b/pkg/analysis_server/test/lsp/server_test.dart
index 233b57a..f935b60 100644
--- a/pkg/analysis_server/test/lsp/server_test.dart
+++ b/pkg/analysis_server/test/lsp/server_test.dart
@@ -2,6 +2,9 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+import 'dart:convert';
+import 'dart:io';
+
 import 'package:analysis_server/lsp_protocol/protocol_generated.dart';
 import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
@@ -37,19 +40,13 @@
 
   test_shutdown_initialized() async {
     await initialize();
-    final request = makeRequest(Method.shutdown, null);
-    final response = await channel.sendRequestToServer(request);
-    expect(response.id, equals(request.id));
-    expect(response.error, isNull);
-    expect(response.result, isNull);
+    final response = await sendShutdown();
+    expect(response, isNull);
   }
 
   test_shutdown_uninitialized() async {
-    final request = makeRequest(Method.shutdown, null);
-    final response = await channel.sendRequestToServer(request);
-    expect(response.id, equals(request.id));
-    expect(response.error, isNull);
-    expect(response.result, isNull);
+    final response = await sendShutdown();
+    expect(response, isNull);
   }
 
   test_unknownNotifications_logError() async {
@@ -68,11 +65,36 @@
     );
   }
 
+  @failingTest
+  test_diagnosticServer() async {
+    // TODO(dantup): This test fails because server.diagnosticServer is not
+    // set up in these tests. This needs moving to an integration test (which
+    // we don't yet have for LSP, but the existing server does have that we
+    // can mirror).
+    await initialize();
+
+    // Send the custom request to the LSP server to get the Dart diagnostic
+    // server info.
+    final server = await getDiagnosticServer();
+
+    expect(server.port, isNotNull);
+    expect(server.port, isNonZero);
+    expect(server.port, isPositive);
+
+    // Ensure the server was actually started.
+    final client = new HttpClient();
+    HttpClientRequest request = await client
+        .getUrl(Uri.parse('http://localhost:${server.port}/status'));
+    final response = await request.close();
+    final responseBody = await utf8.decodeStream(response);
+    expect(responseBody, contains('<title>Analysis Server</title>'));
+  }
+
   test_unknownOptionalNotifications_silentlyDropped() async {
     await initialize();
     final notification =
         makeNotification(new Method.fromJson(r'$/randomNotification'), null);
-    final firstError = channel.errorNotificationsFromServer.first;
+    final firstError = errorNotificationsFromServer.first;
     channel.sendNotificationToServer(notification);
 
     // Wait up to 1sec to ensure no error/log notifications were sent back.
diff --git a/pkg/analysis_server/test/lsp/test_all.dart b/pkg/analysis_server/test/lsp/test_all.dart
index d1e29ad..2745a6b 100644
--- a/pkg/analysis_server/test/lsp/test_all.dart
+++ b/pkg/analysis_server/test/lsp/test_all.dart
@@ -23,6 +23,7 @@
 import 'rename_test.dart' as rename_test;
 import 'server_test.dart' as server_test;
 import 'signature_help_test.dart' as signature_help_test;
+import 'folding_test.dart' as folding_test;
 
 main() {
   defineReflectiveSuite(() {
@@ -44,5 +45,6 @@
     assists_code_action_tests.main();
     packet_transformer_tests.main();
     rename_test.main();
+    folding_test.main();
   }, name: 'lsp');
 }
diff --git a/pkg/analysis_server/test/mocks.dart b/pkg/analysis_server/test/mocks.dart
index 286da86..367e52e 100644
--- a/pkg/analysis_server/test/mocks.dart
+++ b/pkg/analysis_server/test/mocks.dart
@@ -8,6 +8,7 @@
 import 'package:analysis_server/lsp_protocol/protocol_generated.dart' as lsp;
 import 'package:analysis_server/lsp_protocol/protocol_generated.dart';
 import 'package:analysis_server/lsp_protocol/protocol_special.dart' as lsp;
+import 'package:analysis_server/lsp_protocol/protocol_special.dart';
 import 'package:analysis_server/protocol/protocol.dart';
 import 'package:analysis_server/protocol/protocol_generated.dart';
 import 'package:analysis_server/src/analysis_server.dart';
@@ -64,31 +65,6 @@
     return _closed.future;
   }
 
-  /**
-   * A stream of [NotificationMessage]s from the server that may be errors.
-   */
-  Stream<lsp.NotificationMessage> get errorNotificationsFromServer {
-    return notificationsFromServer.where(_isErrorNotification);
-  }
-
-  /**
-   * A stream of [NotificationMessage]s from the server.
-   */
-  Stream<lsp.NotificationMessage> get notificationsFromServer {
-    return _serverToClient.stream
-        .where((m) => m is lsp.NotificationMessage)
-        .cast<lsp.NotificationMessage>();
-  }
-
-  /**
-   * A stream of [RequestMessage]s from the server.
-   */
-  Stream<lsp.RequestMessage> get requestsFromServer {
-    return _serverToClient.stream
-        .where((m) => m is lsp.RequestMessage)
-        .cast<lsp.RequestMessage>();
-  }
-
   Stream<lsp.Message> get serverToClient => _serverToClient.stream;
 
   @override
@@ -98,6 +74,13 @@
     }
   }
 
+  /// Run the object through JSON serialisation to catch any
+  /// issues like fields that are unserialisable types. This is used for
+  /// messages going server-to-client.
+  void ensureMessageCanBeJsonSerialized(ToJsonable message) {
+    jsonEncode(message.toJson());
+  }
+
   @override
   void listen(void Function(lsp.Message message) onMessage,
       {Function onError, void Function() onDone}) {
@@ -110,6 +93,9 @@
     if (_closed.isCompleted) {
       return;
     }
+
+    ensureMessageCanBeJsonSerialized(notification);
+
     _serverToClient.add(notification);
   }
 
@@ -118,7 +104,9 @@
     if (_closed.isCompleted) {
       return;
     }
+
     notification = _convertJson(notification, lsp.NotificationMessage.fromJson);
+
     _clientToServer.add(notification);
   }
 
@@ -128,6 +116,9 @@
     if (_closed.isCompleted) {
       return;
     }
+
+    ensureMessageCanBeJsonSerialized(request);
+
     _serverToClient.add(request);
   }
 
@@ -141,7 +132,9 @@
     if (_closed.isCompleted) {
       throw new Exception('sendLspRequest after connection closed');
     }
+
     request = _convertJson(request, lsp.RequestMessage.fromJson);
+
     // Wrap send request in future to simulate WebSocket.
     new Future(() => _clientToServer.add(request));
     return waitForResponse(request);
@@ -153,6 +146,9 @@
     if (_closed.isCompleted) {
       return;
     }
+
+    ensureMessageCanBeJsonSerialized(response);
+
     // Wrap send response in future to simulate WebSocket.
     new Future(() => _serverToClient.add(response));
   }
@@ -162,7 +158,9 @@
     if (_closed.isCompleted) {
       return;
     }
+
     response = _convertJson(response, lsp.ResponseMessage.fromJson);
+
     _clientToServer.add(response);
   }
 
@@ -201,15 +199,6 @@
       lsp.ToJsonable message, T Function(Map<String, dynamic>) constructor) {
     return constructor(jsonDecode(jsonEncode(message.toJson())));
   }
-
-  /// Checks whether a notification is likely an error from the server (for
-  /// example a window/showMessage). This is useful for tests that want to
-  /// ensure no errors come from the server in response to notifications (which
-  /// don't have their own responses).
-  bool _isErrorNotification(lsp.NotificationMessage notification) {
-    return notification.method == Method.window_logMessage ||
-        notification.method == Method.window_showMessage;
-  }
 }
 
 /**
diff --git a/pkg/analysis_server/test/services/completion/dart/imported_reference_contributor_test.dart b/pkg/analysis_server/test/services/completion/dart/imported_reference_contributor_test.dart
index 0a1300f..1bbf623 100644
--- a/pkg/analysis_server/test/services/completion/dart/imported_reference_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/imported_reference_contributor_test.dart
@@ -43,8 +43,9 @@
 void main() {f^}''');
     await computeSuggestions();
 
-    assertSuggestFunction('foo', 'bool',
+    CompletionSuggestion cs = assertSuggestFunction('foo', 'bool',
         defaultArgListString: 'bar, baz: null');
+    expect(cs.elementUri, equals('package:test/b.dart'));
   }
 
   test_ArgumentList() async {
diff --git a/pkg/analysis_server/test/services/completion/dart/library_member_contributor_test.dart b/pkg/analysis_server/test/services/completion/dart/library_member_contributor_test.dart
index e13ad70..af3d4f8 100644
--- a/pkg/analysis_server/test/services/completion/dart/library_member_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/library_member_contributor_test.dart
@@ -4,6 +4,7 @@
 
 import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
 import 'package:analysis_server/src/services/completion/dart/library_member_contributor.dart';
+import 'package:analyzer_plugin/protocol/protocol_common.dart';
 import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 
@@ -26,7 +27,8 @@
     // SimpleIdentifier  PrefixedIdentifier  ExpressionStatement
     addTestSource('import "dart:async" as bar; foo() {bar.^}');
     await computeSuggestions();
-    assertSuggestClass('Future');
+    CompletionSuggestion cs = assertSuggestClass('Future');
+    expect(cs.elementUri, equals('dart:async'));
     assertNotSuggested('loadLibrary');
   }
 
diff --git a/pkg/analysis_server/test/services/completion/dart/local_library_contributor_test.dart b/pkg/analysis_server/test/services/completion/dart/local_library_contributor_test.dart
index 8e5f942..f38def7 100644
--- a/pkg/analysis_server/test/services/completion/dart/local_library_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/local_library_contributor_test.dart
@@ -4,6 +4,7 @@
 
 import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
 import 'package:analysis_server/src/services/completion/dart/local_library_contributor.dart';
+import 'package:analyzer_plugin/protocol/protocol_common.dart';
 import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 
@@ -42,7 +43,8 @@
     await computeSuggestions();
     expect(replacementOffset, completionOffset);
     expect(replacementLength, 0);
-    assertSuggestConstructor('A');
+    CompletionSuggestion cs = assertSuggestConstructor('A');
+    expect(cs.elementUri, 'package:test/a.dart');
     // Suggested by LocalConstructorContributor
     assertNotSuggested('B.bar');
     // Suggested by ImportedReferenceContributor
diff --git a/pkg/analysis_server/test/services/completion/dart/local_reference_contributor_test.dart b/pkg/analysis_server/test/services/completion/dart/local_reference_contributor_test.dart
index ffa3f3a..d484f79 100644
--- a/pkg/analysis_server/test/services/completion/dart/local_reference_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/local_reference_contributor_test.dart
@@ -5,6 +5,7 @@
 import 'package:analysis_server/src/protocol_server.dart';
 import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
 import 'package:analysis_server/src/services/completion/dart/local_reference_contributor.dart';
+import 'package:analyzer/file_system/memory_file_system.dart';
 import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 
@@ -68,10 +69,11 @@
 void main() {h^}''');
     await computeSuggestions();
 
-    assertSuggestFunction('hasLength', 'bool',
+    CompletionSuggestion cs = assertSuggestFunction('hasLength', 'bool',
         relevance: DART_RELEVANCE_LOCAL_FUNCTION,
         defaultArgListString: 'a, b',
         defaultArgumentListTextRanges: [0, 1, 3, 1]);
+    expect(cs.elementUri, equals(convertPath('/home/test/lib/test.dart')));
   }
 
   test_ArgDefaults_function_none() async {
diff --git a/pkg/analysis_server/test/services/completion/dart/override_contributor_test.dart b/pkg/analysis_server/test/services/completion/dart/override_contributor_test.dart
index 49a5e34..076ae44 100644
--- a/pkg/analysis_server/test/services/completion/dart/override_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/override_contributor_test.dart
@@ -21,6 +21,22 @@
     return new OverrideContributor();
   }
 
+  test_alreadyOverridden() async {
+    addTestSource('''
+class A {
+  void foo() {}
+  void bar() {}
+}
+
+class B implements A {
+  void bar() {}
+  f^
+}
+''');
+    await computeSuggestions();
+    _assertNoOverrideContaining('bar');
+  }
+
   test_fromMultipleSuperclasses() async {
     addTestSource(r'''
 class A {
@@ -152,6 +168,61 @@
         selectionLength: 27);
   }
 
+  test_inClass_of_interface() async {
+    addTestSource('''
+class A {
+  void foo() {}
+}
+
+class B implements A {
+  f^
+}
+''');
+    await computeSuggestions();
+    _assertOverride('''
+@override
+  void foo() {
+    // TODO: implement foo
+  }''', displayText: 'foo() { … }', selectionOffset: 51, selectionLength: 0);
+  }
+
+  test_inMixin_of_interface() async {
+    addTestSource('''
+class A {
+  void foo() {}
+}
+
+mixin M implements A {
+  f^
+}
+''');
+    await computeSuggestions();
+    _assertOverride('''
+@override
+  void foo() {
+    // TODO: implement foo
+  }''', displayText: 'foo() { … }', selectionOffset: 51, selectionLength: 0);
+  }
+
+  test_inMixin_of_superclassConstraint() async {
+    addTestSource('''
+class A {
+  void foo() {}
+}
+
+mixin M on A {
+  f^
+}
+''');
+    await computeSuggestions();
+    _assertOverride('''
+@override
+  void foo() {
+    // TODO: implement foo
+    super.foo();
+  }''', displayText: 'foo() { … }', selectionOffset: 56, selectionLength: 12);
+  }
+
   @failingTest
   test_insideBareClass() async {
     addTestSource('''
@@ -278,6 +349,14 @@
         selectionLength: 22);
   }
 
+  void _assertNoOverrideContaining(String search) {
+    expect(
+        suggestions.where((c) =>
+            c.kind == CompletionSuggestionKind.OVERRIDE &&
+            c.completion.contains(search)),
+        isEmpty);
+  }
+
   CompletionSuggestion _assertOverride(String completion,
       {String displayText, int selectionOffset, int selectionLength}) {
     CompletionSuggestion cs = getSuggest(
diff --git a/pkg/analysis_server/test/src/services/correction/assist/add_type_annotation_test.dart b/pkg/analysis_server/test/src/services/correction/assist/add_type_annotation_test.dart
index 9d1e8fb..7019111 100644
--- a/pkg/analysis_server/test/src/services/correction/assist/add_type_annotation_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/assist/add_type_annotation_test.dart
@@ -204,7 +204,7 @@
     await assertHasAssist('''
 part of my_app;
 main() {
-  HashMap<String, int> /*caret*/v = getMap();
+  HashMap<String, int> v = getMap();
 }
 ''', additionallyChangedFiles: {
       appPath: [
@@ -521,14 +521,14 @@
   test_privateType_sameLibrary() async {
     await resolveTestUnit('''
 class _A {}
-_A getValue() => new _A();
+_A getValue() => _A();
 main() {
   var v = getValue();
 }
 ''');
     await assertHasAssistAt('var ', '''
 class _A {}
-_A getValue() => new _A();
+_A getValue() => _A();
 main() {
   _A v = getValue();
 }
@@ -540,7 +540,7 @@
 library my_lib;
 class A {}
 class _B extends A {}
-_B getValue() => new _B();
+_B getValue() => _B();
 ''');
     await resolveTestUnit('''
 import 'my_lib.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/assist/assist_processor.dart b/pkg/analysis_server/test/src/services/correction/assist/assist_processor.dart
index 1ff780c..cf9d0ba 100644
--- a/pkg/analysis_server/test/src/services/correction/assist/assist_processor.dart
+++ b/pkg/analysis_server/test/src/services/correction/assist/assist_processor.dart
@@ -55,7 +55,6 @@
   /// have been applied.
   Future<void> assertHasAssist(String expected,
       {Map<String, List<String>> additionallyChangedFiles}) async {
-    _setSelection();
     Assist assist = await _assertHasAssist();
     _change = assist.change;
     expect(_change.id, kind.id);
@@ -107,7 +106,6 @@
 
   /// Asserts that there is no [Assist] of the given [kind] at [_offset].
   Future<void> assertNoAssist() async {
-    _setSelection();
     List<Assist> assists = await _computeAssists();
     for (Assist assist in assists) {
       if (assist.kind == kind) {
@@ -136,6 +134,32 @@
     }).toList();
   }
 
+  @override
+  Future<void> resolveTestUnit(String code) async {
+    var offset = code.indexOf('/*caret*/');
+    if (offset >= 0) {
+      var endOffset = offset + '/*caret*/'.length;
+      code = code.substring(0, offset) + code.substring(endOffset);
+      _offset = offset;
+      _length = 0;
+    } else {
+      var startOffset = code.indexOf('// start\n');
+      var endOffset = code.indexOf('// end\n');
+      if (startOffset >= 0 && endOffset >= 0) {
+        var startLength = '// start\n'.length;
+        code = code.substring(0, startOffset) +
+            code.substring(startOffset + startLength, endOffset) +
+            code.substring(endOffset + '// end\n'.length);
+        _offset = startOffset;
+        _length = endOffset - startLength - _offset;
+      } else {
+        _offset = 0;
+        _length = 0;
+      }
+    }
+    return super.resolveTestUnit(code);
+  }
+
   /// Computes assists and verifies that there is an assist of the given kind.
   Future<Assist> _assertHasAssist() async {
     List<Assist> assists = await _computeAssists();
@@ -166,21 +190,4 @@
     }
     return positions;
   }
-
-  void _setSelection() {
-    _offset = testCode.indexOf('/*caret*/');
-    if (_offset >= 0) {
-      _offset += '/*caret*/'.length;
-      _length = 0;
-    } else {
-      _offset = testCode.indexOf('// start\n');
-      if (_offset >= 0) {
-        _offset += '// start\n'.length;
-        _length = testCode.indexOf('// end') - _offset;
-      } else {
-        _offset = 0;
-        _length = 0;
-      }
-    }
-  }
 }
diff --git a/pkg/analysis_server/test/src/services/correction/assist/convert_to_int_literal_test.dart b/pkg/analysis_server/test/src/services/correction/assist/convert_to_int_literal_test.dart
index d76730c..79859c4 100644
--- a/pkg/analysis_server/test/src/services/correction/assist/convert_to_int_literal_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/assist/convert_to_int_literal_test.dart
@@ -24,7 +24,7 @@
 const double myDouble = /*caret*/42.0;
 ''');
     await assertHasAssist('''
-const double myDouble = /*caret*/42;
+const double myDouble = 42;
 ''');
   }
 
@@ -40,7 +40,7 @@
 const double myDouble = /*caret*/4.2e1;
 ''');
     await assertHasAssist('''
-const double myDouble = /*caret*/42;
+const double myDouble = 42;
 ''');
   }
 
diff --git a/pkg/analysis_server/test/src/services/correction/assist/convert_to_multiline_string_test.dart b/pkg/analysis_server/test/src/services/correction/assist/convert_to_multiline_string_test.dart
new file mode 100644
index 0000000..f4b1317
--- /dev/null
+++ b/pkg/analysis_server/test/src/services/correction/assist/convert_to_multiline_string_test.dart
@@ -0,0 +1,180 @@
+// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:analysis_server/src/services/correction/assist.dart';
+import 'package:analyzer_plugin/utilities/assist/assist.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+
+import 'assist_processor.dart';
+
+main() {
+  defineReflectiveSuite(() {
+    defineReflectiveTests(ConvertToMultilineStringTest);
+  });
+}
+
+@reflectiveTest
+class ConvertToMultilineStringTest extends AssistProcessorTest {
+  @override
+  AssistKind get kind => DartAssistKind.CONVERT_TO_MULTILINE_STRING;
+
+  test_doubleQuoted() async {
+    await resolveTestUnit('''
+main() {
+  print("abc");
+}
+''');
+    await assertHasAssistAt('abc', '''
+main() {
+  print("""
+abc""");
+}
+''');
+  }
+
+  test_doubleQuoted_alreadyMultiline() async {
+    await resolveTestUnit('''
+main() {
+  print("""abc""");
+}
+''');
+    await assertNoAssistAt('abc');
+  }
+
+  test_doubleQuoted_interpolation_expressionElement() async {
+    await resolveTestUnit(r"""
+main() {
+  var b = 'b';
+  var c = 'c';
+  print("a $b - ${c} d");
+}
+""");
+    await assertNoAssistAt(r'c}');
+  }
+
+  test_doubleQuoted_interpolation_stringElement_begin() async {
+    await resolveTestUnit(r"""
+main() {
+  var b = 'b';
+  var c = 'c';
+  print("a $b - ${c} d");
+}
+""");
+    await assertHasAssistAt('"a ', r'''
+main() {
+  var b = 'b';
+  var c = 'c';
+  print("""
+a $b - ${c} d""");
+}
+''');
+  }
+
+  test_doubleQuoted_interpolation_stringElement_middle() async {
+    await resolveTestUnit(r"""
+main() {
+  var b = 'b';
+  var c = 'c';
+  print("a $b - ${c} d");
+}
+""");
+    await assertHasAssistAt('- ', r'''
+main() {
+  var b = 'b';
+  var c = 'c';
+  print("""
+a $b - ${c} d""");
+}
+''');
+  }
+
+  test_doubleQuoted_raw() async {
+    await resolveTestUnit('''
+main() {
+  print(r"abc");
+}
+''');
+    await assertHasAssistAt('abc', '''
+main() {
+  print(r"""
+abc""");
+}
+''');
+  }
+
+  test_singleQuoted() async {
+    await resolveTestUnit('''
+main() {
+  print('abc');
+}
+''');
+    await assertHasAssistAt('abc', """
+main() {
+  print('''
+abc''');
+}
+""");
+  }
+
+  test_singleQuoted_interpolation_expressionElement() async {
+    await resolveTestUnit(r"""
+main() {
+  var b = 'b';
+  var c = 'c';
+  print('a $b - ${c} d');
+}
+""");
+    await assertNoAssistAt(r'c}');
+  }
+
+  test_singleQuoted_interpolation_stringElement_begin() async {
+    await resolveTestUnit(r"""
+main() {
+  var b = 'b';
+  var c = 'c';
+  print('a $b - ${c} d');
+}
+""");
+    await assertHasAssistAt("'a ", r"""
+main() {
+  var b = 'b';
+  var c = 'c';
+  print('''
+a $b - ${c} d''');
+}
+""");
+  }
+
+  test_singleQuoted_interpolation_stringElement_middle() async {
+    await resolveTestUnit(r"""
+main() {
+  var b = 'b';
+  var c = 'c';
+  print('a $b - ${c} d');
+}
+""");
+    await assertHasAssistAt("- ", r"""
+main() {
+  var b = 'b';
+  var c = 'c';
+  print('''
+a $b - ${c} d''');
+}
+""");
+  }
+
+  test_singleQuoted_raw() async {
+    await resolveTestUnit('''
+main() {
+  print(r'abc');
+}
+''');
+    await assertHasAssistAt('abc', """
+main() {
+  print(r'''
+abc''');
+}
+""");
+  }
+}
diff --git a/pkg/analysis_server/test/src/services/correction/assist/flutter_convert_to_children_test.dart b/pkg/analysis_server/test/src/services/correction/assist/flutter_convert_to_children_test.dart
index 8d34099..00e8383 100644
--- a/pkg/analysis_server/test/src/services/correction/assist/flutter_convert_to_children_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/assist/flutter_convert_to_children_test.dart
@@ -25,8 +25,8 @@
     await resolveTestUnit('''
 import 'package:flutter/material.dart';
 build() {
-  return new Row(
-    /*caret*/child: new Container()
+  return Row(
+    /*caret*/child: Container()
   );
 }
 ''');
@@ -38,34 +38,30 @@
     await resolveTestUnit('''
 import 'package:flutter/material.dart';
 build() {
-  return new Scaffold(
-// start
-    body: new Center(
-      /*caret*/child: new Container(
+  return Scaffold(
+    body: Center(
+      /*caret*/child: Container(
         width: 200.0,
         height: 300.0,
       ),
       key: null,
     ),
-// end
   );
 }
 ''');
     await assertHasAssist('''
 import 'package:flutter/material.dart';
 build() {
-  return new Scaffold(
-// start
-    body: new Center(
-      /*caret*/children: <Widget>[
-        new Container(
+  return Scaffold(
+    body: Center(
+      children: <Widget>[
+        Container(
           width: 200.0,
           height: 300.0,
         ),
       ],
       key: null,
     ),
-// end
   );
 }
 ''');
@@ -77,35 +73,31 @@
     await resolveTestUnit('''
 import 'package:flutter/material.dart';
 build() {
-  return new Scaffold(
-// start
-    body: new Center(
+  return Scaffold(
+    body: Center(
       /*caret*/child:
-          new Container(
+          Container(
         width: 200.0,
         height: 300.0,
       ),
       key: null,
     ),
-// end
   );
 }
 ''');
     await assertHasAssist('''
 import 'package:flutter/material.dart';
 build() {
-  return new Scaffold(
-// start
-    body: new Center(
-      /*caret*/children: <Widget>[
-        new Container(
+  return Scaffold(
+    body: Center(
+      children: <Widget>[
+        Container(
           width: 200.0,
           height: 300.0,
         ),
       ],
       key: null,
     ),
-// end
   );
 }
 ''');
@@ -116,9 +108,9 @@
     await resolveTestUnit('''
 import 'package:flutter/material.dart';
 build() {
-  return new Scaffold(
-    body: /*caret*/new Center(
-      child: new Container(),
+  return Scaffold(
+    body: /*caret*/Center(
+      child: Container(),
     ),
   );
 }
@@ -131,26 +123,22 @@
     await resolveTestUnit('''
 import 'package:flutter/material.dart';
 build() {
-  return new Scaffold(
-// start
-    body: new Center(
-      /*caret*/child: new GestureDetector(),
+  return Scaffold(
+    body: Center(
+      /*caret*/child: GestureDetector(),
       key: null,
     ),
-// end
   );
 }
 ''');
     await assertHasAssist('''
 import 'package:flutter/material.dart';
 build() {
-  return new Scaffold(
-// start
-    body: new Center(
-      /*caret*/children: <Widget>[new GestureDetector()],
+  return Scaffold(
+    body: Center(
+      children: <Widget>[GestureDetector()],
       key: null,
     ),
-// end
   );
 }
 ''');
diff --git a/pkg/analysis_server/test/src/services/correction/assist/flutter_convert_to_stateful_widget_test.dart b/pkg/analysis_server/test/src/services/correction/assist/flutter_convert_to_stateful_widget_test.dart
index 977ea72..f4d13a4 100644
--- a/pkg/analysis_server/test/src/services/correction/assist/flutter_convert_to_stateful_widget_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/assist/flutter_convert_to_stateful_widget_test.dart
@@ -27,24 +27,24 @@
 class /*caret*/MyWidget extends StatelessWidget {
   @override
   Widget build(BuildContext context) {
-    return new Container();
+    return Container();
   }
 }
 ''');
     await assertHasAssist(r'''
 import 'package:flutter/material.dart';
 
-class /*caret*/MyWidget extends StatefulWidget {
+class MyWidget extends StatefulWidget {
   @override
   MyWidgetState createState() {
-    return new MyWidgetState();
+    return MyWidgetState();
   }
 }
 
 class MyWidgetState extends State<MyWidget> {
   @override
   Widget build(BuildContext context) {
-    return new Container();
+    return Container();
   }
 }
 ''');
@@ -72,16 +72,16 @@
   @override
   Widget build(BuildContext context) {
     instanceField4 = instanceField1;
-    return new Row(
+    return Row(
       children: [
-        new Text(instanceField1),
-        new Text(instanceField2),
-        new Text(instanceField3),
-        new Text(instanceField4),
-        new Text(instanceField5),
-        new Text(staticField1),
-        new Text(staticField2),
-        new Text(staticField3),
+        Text(instanceField1),
+        Text(instanceField2),
+        Text(instanceField3),
+        Text(instanceField4),
+        Text(instanceField5),
+        Text(staticField1),
+        Text(staticField2),
+        Text(staticField3),
       ],
     );
   }
@@ -90,7 +90,7 @@
     await assertHasAssist(r'''
 import 'package:flutter/material.dart';
 
-class /*caret*/MyWidget extends StatefulWidget {
+class MyWidget extends StatefulWidget {
   static String staticField1;
   final String instanceField1;
   final String instanceField2;
@@ -104,7 +104,7 @@
 
   @override
   MyWidgetState createState() {
-    return new MyWidgetState();
+    return MyWidgetState();
   }
 }
 
@@ -116,16 +116,16 @@
   @override
   Widget build(BuildContext context) {
     instanceField4 = widget.instanceField1;
-    return new Row(
+    return Row(
       children: [
-        new Text(widget.instanceField1),
-        new Text(widget.instanceField2),
-        new Text(widget.instanceField3),
-        new Text(instanceField4),
-        new Text(instanceField5),
-        new Text(MyWidget.staticField1),
-        new Text(MyWidget.staticField2),
-        new Text(MyWidget.staticField3),
+        Text(widget.instanceField1),
+        Text(widget.instanceField2),
+        Text(widget.instanceField3),
+        Text(instanceField4),
+        Text(instanceField5),
+        Text(MyWidget.staticField1),
+        Text(MyWidget.staticField2),
+        Text(MyWidget.staticField3),
       ],
     );
   }
@@ -141,12 +141,12 @@
 class /*caret*/MyWidget extends StatelessWidget {
   @override
   Widget build(BuildContext context) {
-    return new Row(
+    return Row(
       children: [
-        new Text(staticGetter1),
-        new Text(staticGetter2),
-        new Text(instanceGetter1),
-        new Text(instanceGetter2),
+        Text(staticGetter1),
+        Text(staticGetter2),
+        Text(instanceGetter1),
+        Text(instanceGetter2),
       ],
     );
   }
@@ -163,10 +163,10 @@
     await assertHasAssist(r'''
 import 'package:flutter/material.dart';
 
-class /*caret*/MyWidget extends StatefulWidget {
+class MyWidget extends StatefulWidget {
   @override
   MyWidgetState createState() {
-    return new MyWidgetState();
+    return MyWidgetState();
   }
 
   static String get staticGetter1 => '';
@@ -177,12 +177,12 @@
 class MyWidgetState extends State<MyWidget> {
   @override
   Widget build(BuildContext context) {
-    return new Row(
+    return Row(
       children: [
-        new Text(MyWidget.staticGetter1),
-        new Text(MyWidget.staticGetter2),
-        new Text(instanceGetter1),
-        new Text(instanceGetter2),
+        Text(MyWidget.staticGetter1),
+        Text(MyWidget.staticGetter2),
+        Text(instanceGetter1),
+        Text(instanceGetter2),
       ],
     );
   }
@@ -208,11 +208,11 @@
 
   @override
   Widget build(BuildContext context) {
-    return new Row(
+    return Row(
       children: [
-        new Text(instanceField1),
-        new Text(instanceField2),
-        new Text(staticField),
+        Text(instanceField1),
+        Text(instanceField2),
+        Text(staticField),
       ],
     );
   }
@@ -239,7 +239,7 @@
     await assertHasAssist(r'''
 import 'package:flutter/material.dart';
 
-class /*caret*/MyWidget extends StatefulWidget {
+class MyWidget extends StatefulWidget {
   static String staticField;
   final String instanceField1;
 
@@ -247,7 +247,7 @@
 
   @override
   MyWidgetState createState() {
-    return new MyWidgetState();
+    return MyWidgetState();
   }
 
   static void staticMethod1() {
@@ -264,11 +264,11 @@
 
   @override
   Widget build(BuildContext context) {
-    return new Row(
+    return Row(
       children: [
-        new Text(widget.instanceField1),
-        new Text(instanceField2),
-        new Text(MyWidget.staticField),
+        Text(widget.instanceField1),
+        Text(instanceField2),
+        Text(MyWidget.staticField),
       ],
     );
   }
@@ -328,12 +328,12 @@
 
   @override
   Widget build(BuildContext context) {
-    return new Row(
+    return Row(
       children: [
-        new Text(aaa),
-        new Text(bbb),
-        new Text('$aaa'),
-        new Text('${bbb}'),
+        Text(aaa),
+        Text(bbb),
+        Text('$aaa'),
+        Text('${bbb}'),
       ],
     );
   }
@@ -342,7 +342,7 @@
     await assertHasAssist(r'''
 import 'package:flutter/material.dart';
 
-class /*caret*/MyWidget extends StatefulWidget {
+class MyWidget extends StatefulWidget {
   final String aaa;
   final String bbb;
 
@@ -350,19 +350,19 @@
 
   @override
   MyWidgetState createState() {
-    return new MyWidgetState();
+    return MyWidgetState();
   }
 }
 
 class MyWidgetState extends State<MyWidget> {
   @override
   Widget build(BuildContext context) {
-    return new Row(
+    return Row(
       children: [
-        new Text(widget.aaa),
-        new Text(widget.bbb),
-        new Text('${widget.aaa}'),
-        new Text('${widget.bbb}'),
+        Text(widget.aaa),
+        Text(widget.bbb),
+        Text('${widget.aaa}'),
+        Text('${widget.bbb}'),
       ],
     );
   }
@@ -378,24 +378,24 @@
 class /*caret*/MyWidget extends StatelessWidget {
   @override
   Widget build(BuildContext context) {
-    return new Container();
+    return Container();
   }
 }
 ''');
     await assertHasAssist(r'''
 import 'package:flutter/material.dart';
 
-class /*caret*/MyWidget extends StatefulWidget {
+class MyWidget extends StatefulWidget {
   @override
   MyWidgetState createState() {
-    return new MyWidgetState();
+    return MyWidgetState();
   }
 }
 
 class MyWidgetState extends State<MyWidget> {
   @override
   Widget build(BuildContext context) {
-    return new Container();
+    return Container();
   }
 }
 ''');
diff --git a/pkg/analysis_server/test/src/services/correction/assist/flutter_move_down_test.dart b/pkg/analysis_server/test/src/services/correction/assist/flutter_move_down_test.dart
index 5885e70..27069f0e 100644
--- a/pkg/analysis_server/test/src/services/correction/assist/flutter_move_down_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/assist/flutter_move_down_test.dart
@@ -24,11 +24,11 @@
     await resolveTestUnit('''
 import 'package:flutter/material.dart';
 main() {
-  new Column(
+  Column(
     children: <Widget>[
-      new Text('aaa'),
-      /*caret*/new Text('bbbbbb'),
-      new Text('ccccccccc'),
+      Text('aaa'),
+      /*caret*/Text('bbbbbb'),
+      Text('ccccccccc'),
     ],
   );
 }
@@ -36,16 +36,16 @@
     await assertHasAssist('''
 import 'package:flutter/material.dart';
 main() {
-  new Column(
+  Column(
     children: <Widget>[
-      new Text('aaa'),
-      /*caret*/new Text('ccccccccc'),
-      new Text('bbbbbb'),
+      Text('aaa'),
+      Text('ccccccccc'),
+      Text('bbbbbb'),
     ],
   );
 }
 ''');
-    assertExitPosition(before: "new Text('bbbbbb')");
+    assertExitPosition(before: "Text('bbbbbb')");
   }
 
   test_last() async {
@@ -53,11 +53,11 @@
     await resolveTestUnit('''
 import 'package:flutter/material.dart';
 main() {
-  new Column(
+  Column(
     children: <Widget>[
-      new Text('aaa'),
-      new Text('bbb'),
-      /*caret*/new Text('ccc'),
+      Text('aaa'),
+      Text('bbb'),
+      /*caret*/Text('ccc'),
     ],
   );
 }
@@ -70,8 +70,8 @@
     await resolveTestUnit('''
 import 'package:flutter/material.dart';
 main() {
-  new Center(
-    child: /*caret*/new Text('aaa'),
+  Center(
+    child: /*caret*/Text('aaa'),
   );
 }
 ''');
diff --git a/pkg/analysis_server/test/src/services/correction/assist/flutter_move_up_test.dart b/pkg/analysis_server/test/src/services/correction/assist/flutter_move_up_test.dart
index 771bb73..a6b58b6 100644
--- a/pkg/analysis_server/test/src/services/correction/assist/flutter_move_up_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/assist/flutter_move_up_test.dart
@@ -24,11 +24,11 @@
     await resolveTestUnit('''
 import 'package:flutter/material.dart';
 main() {
-  new Column(
+  Column(
     children: <Widget>[
-      /*caret*/new Text('aaa'),
-      new Text('bbb'),
-      new Text('ccc'),
+      /*caret*/Text('aaa'),
+      Text('bbb'),
+      Text('ccc'),
     ],
   );
 }
@@ -41,11 +41,11 @@
     await resolveTestUnit('''
 import 'package:flutter/material.dart';
 main() {
-  new Column(
+  Column(
     children: <Widget>[
-      new Text('aaa'),
-      /*caret*/new Text('bbbbbb'),
-      new Text('ccccccccc'),
+      Text('aaa'),
+      /*caret*/Text('bbbbbb'),
+      Text('ccccccccc'),
     ],
   );
 }
@@ -53,16 +53,16 @@
     await assertHasAssist('''
 import 'package:flutter/material.dart';
 main() {
-  new Column(
+  Column(
     children: <Widget>[
-      new Text('bbbbbb'),
-      /*caret*/new Text('aaa'),
-      new Text('ccccccccc'),
+      Text('bbbbbb'),
+      Text('aaa'),
+      Text('ccccccccc'),
     ],
   );
 }
 ''');
-    assertExitPosition(before: "new Text('bbbbbb')");
+    assertExitPosition(before: "Text('bbbbbb')");
   }
 
   test_notInList() async {
@@ -70,8 +70,8 @@
     await resolveTestUnit('''
 import 'package:flutter/material.dart';
 main() {
-  new Center(
-    child: /*caret*/new Text('aaa'),
+  Center(
+    child: /*caret*/Text('aaa'),
   );
 }
 ''');
diff --git a/pkg/analysis_server/test/src/services/correction/assist/flutter_remove_widget_test.dart b/pkg/analysis_server/test/src/services/correction/assist/flutter_remove_widget_test.dart
index 842b191..03f1287 100644
--- a/pkg/analysis_server/test/src/services/correction/assist/flutter_remove_widget_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/assist/flutter_remove_widget_test.dart
@@ -24,14 +24,14 @@
     await resolveTestUnit('''
 import 'package:flutter/material.dart';
 main() {
-  new Column(
+  Column(
     children: <Widget>[
-      new Center(
-        child: new /*caret*/Padding(
+      Center(
+        child: /*caret*/Padding(
           padding: const EdgeInsets.all(8.0),
-          child: new Center(
+          child: Center(
             heightFactor: 0.5,
-            child: new Text('foo'),
+            child: Text('foo'),
           ),
         ),
       ),
@@ -42,12 +42,12 @@
     await assertHasAssist('''
 import 'package:flutter/material.dart';
 main() {
-  new Column(
+  Column(
     children: <Widget>[
-      new Center(
-        child: new Center(
+      Center(
+        child: Center(
           heightFactor: 0.5,
-          child: new Text('foo'),
+          child: Text('foo'),
         ),
       ),
     ],
@@ -61,11 +61,11 @@
     await resolveTestUnit('''
 import 'package:flutter/material.dart';
 main() {
-  new Padding(
+  Padding(
     padding: const EdgeInsets.all(8.0),
-    child: new /*caret*/Center(
+    child: /*caret*/Center(
       heightFactor: 0.5,
-      child: new Text('foo'),
+      child: Text('foo'),
     ),
   );
 }
@@ -73,9 +73,9 @@
     await assertHasAssist('''
 import 'package:flutter/material.dart';
 main() {
-  new Padding(
+  Padding(
     padding: const EdgeInsets.all(8.0),
-    child: new Text('foo'),
+    child: Text('foo'),
   );
 }
 ''');
@@ -86,17 +86,17 @@
     await resolveTestUnit('''
 import 'package:flutter/material.dart';
 main() {
-  new Column(
+  Column(
     children: <Widget>[
-      new Text('foo'),
-      new /*caret*/Center(
+      Text('foo'),
+      /*caret*/Center(
         heightFactor: 0.5,
-        child: new Padding(
+        child: Padding(
           padding: const EdgeInsets.all(8.0),
-          child: new Text('bar'),
+          child: Text('bar'),
         ),
       ),
-      new Text('baz'),
+      Text('baz'),
     ],
   );
 }
@@ -104,14 +104,14 @@
     await assertHasAssist('''
 import 'package:flutter/material.dart';
 main() {
-  new Column(
+  Column(
     children: <Widget>[
-      new Text('foo'),
-      new Padding(
+      Text('foo'),
+      Padding(
         padding: const EdgeInsets.all(8.0),
-        child: new Text('bar'),
+        child: Text('bar'),
       ),
-      new Text('baz'),
+      Text('baz'),
     ],
   );
 }
@@ -123,11 +123,11 @@
     await resolveTestUnit('''
 import 'package:flutter/material.dart';
 main() {
-  new Center(
-    child: new /*caret*/Row(
+  Center(
+    child: /*caret*/Row(
       children: [
-        new Text('aaa'),
-        new Text('bbb'),
+        Text('aaa'),
+        Text('bbb'),
       ],
     ),
   );
@@ -141,10 +141,10 @@
     await resolveTestUnit('''
 import 'package:flutter/material.dart';
 main() {
-  new Center(
-    child: /*caret*/new Column(
+  Center(
+    child: /*caret*/Column(
       children: [
-        new Text('foo'),
+        Text('foo'),
       ],
     ),
   );
@@ -153,8 +153,8 @@
     await assertHasAssist('''
 import 'package:flutter/material.dart';
 main() {
-  new Center(
-    child: /*caret*/new Text('foo'),
+  Center(
+    child: Text('foo'),
   );
 }
 ''');
@@ -165,9 +165,9 @@
     await resolveTestUnit('''
 import 'package:flutter/material.dart';
 main() {
-  return /*caret*/new Column(
+  return /*caret*/Column(
     children: [
-      new Text('foo'),
+      Text('foo'),
     ],
   );
 }
@@ -175,7 +175,7 @@
     await assertHasAssist('''
 import 'package:flutter/material.dart';
 main() {
-  return /*caret*/new Text('foo');
+  return Text('foo');
 }
 ''');
   }
@@ -185,26 +185,26 @@
     await resolveTestUnit('''
 import 'package:flutter/material.dart';
 main() {
-  new Column(
+  Column(
     children: <Widget>[
-      new Text('aaa'),
-      new /*caret*/Column(
+      Text('aaa'),
+      /*caret*/Column(
         children: [
-          new Row(
+          Row(
             children: [
-              new Text('bbb'),
-              new Text('ccc'),
+              Text('bbb'),
+              Text('ccc'),
             ],
           ),
-          new Row(
+          Row(
             children: [
-              new Text('ddd'),
-              new Text('eee'),
+              Text('ddd'),
+              Text('eee'),
             ],
           ),
         ],
       ),
-      new Text('fff'),
+      Text('fff'),
     ],
   );
 }
@@ -212,22 +212,22 @@
     await assertHasAssist('''
 import 'package:flutter/material.dart';
 main() {
-  new Column(
+  Column(
     children: <Widget>[
-      new Text('aaa'),
-      new Row(
+      Text('aaa'),
+      Row(
         children: [
-          new Text('bbb'),
-          new Text('ccc'),
+          Text('bbb'),
+          Text('ccc'),
         ],
       ),
-      new Row(
+      Row(
         children: [
-          new Text('ddd'),
-          new Text('eee'),
+          Text('ddd'),
+          Text('eee'),
         ],
       ),
-      new Text('fff'),
+      Text('fff'),
     ],
   );
 }
diff --git a/pkg/analysis_server/test/src/services/correction/assist/flutter_swap_with_child_test.dart b/pkg/analysis_server/test/src/services/correction/assist/flutter_swap_with_child_test.dart
index 03b6f84..7ec4246 100644
--- a/pkg/analysis_server/test/src/services/correction/assist/flutter_swap_with_child_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/assist/flutter_swap_with_child_test.dart
@@ -24,11 +24,11 @@
     await resolveTestUnit('''
 import 'package:flutter/material.dart';
 build() {
-  return new Scaffold(
-    body: new /*caret*/GestureDetector(
+  return Scaffold(
+    body: /*caret*/GestureDetector(
       onTap: () => startResize(),
-      child: new Center(
-        child: new Container(
+      child: Center(
+        child: Container(
           width: 200.0,
           height: 300.0,
         ),
@@ -42,12 +42,12 @@
     await assertHasAssist('''
 import 'package:flutter/material.dart';
 build() {
-  return new Scaffold(
-    body: new Center(
+  return Scaffold(
+    body: Center(
       key: null,
-      child: new /*caret*/GestureDetector(
+      child: GestureDetector(
         onTap: () => startResize(),
-        child: new Container(
+        child: Container(
           width: 200.0,
           height: 300.0,
         ),
@@ -66,16 +66,16 @@
 
 class Foo extends StatefulWidget {
   @override
-  _State createState() => new _State();
+  _State createState() => _State();
 }
 
 class _State extends State<Foo> {
   @override
   Widget build(BuildContext context) {
-    return new /*caret*/Expanded(
+    return /*caret*/Expanded(
       flex: 2,
-      child: new GestureDetector(
-        child: new Text(
+      child: GestureDetector(
+        child: Text(
           'foo',
         ), onTap: () {
           print(42);
@@ -89,19 +89,19 @@
 
 class Foo extends StatefulWidget {
   @override
-  _State createState() => new _State();
+  _State createState() => _State();
 }
 
 class _State extends State<Foo> {
   @override
   Widget build(BuildContext context) {
-    return new GestureDetector(
+    return GestureDetector(
       onTap: () {
         print(42);
     },
-      child: new /*caret*/Expanded(
+      child: Expanded(
         flex: 2,
-        child: new Text(
+        child: Text(
           'foo',
         ),
       ),
diff --git a/pkg/analysis_server/test/src/services/correction/assist/flutter_swap_with_parent_test.dart b/pkg/analysis_server/test/src/services/correction/assist/flutter_swap_with_parent_test.dart
index d5ad1d3..13a88b7 100644
--- a/pkg/analysis_server/test/src/services/correction/assist/flutter_swap_with_parent_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/assist/flutter_swap_with_parent_test.dart
@@ -24,11 +24,11 @@
     await resolveTestUnit('''
 import 'package:flutter/material.dart';
 build() {
-  return new Scaffold(
-    body: new Center(
-      child: new /*caret*/GestureDetector(
+  return Scaffold(
+    body: Center(
+      child: /*caret*/GestureDetector(
         onTap: () => startResize(),
-        child: new Container(
+        child: Container(
           width: 200.0,
           height: 300.0,
         ),
@@ -42,12 +42,12 @@
     await assertHasAssist('''
 import 'package:flutter/material.dart';
 build() {
-  return new Scaffold(
-    body: new /*caret*/GestureDetector(
+  return Scaffold(
+    body: GestureDetector(
       onTap: () => startResize(),
-      child: new Center(
+      child: Center(
         key: null,
-        child: new Container(
+        child: Container(
           width: 200.0,
           height: 300.0,
         ),
@@ -66,15 +66,15 @@
 
 class Foo extends StatefulWidget {
   @override
-  _State createState() => new _State();
+  _State createState() => _State();
 }
 
 class _State extends State<Foo> {
   @override
   Widget build(BuildContext context) {
-    return new GestureDetector(
-      child: new /*caret*/Expanded(
-        child: new Text(
+    return GestureDetector(
+      child: /*caret*/Expanded(
+        child: Text(
           'foo',
         ),
         flex: 2,
@@ -89,19 +89,19 @@
 
 class Foo extends StatefulWidget {
   @override
-  _State createState() => new _State();
+  _State createState() => _State();
 }
 
 class _State extends State<Foo> {
   @override
   Widget build(BuildContext context) {
-    return new /*caret*/Expanded(
+    return Expanded(
       flex: 2,
-      child: new GestureDetector(
+      child: GestureDetector(
         onTap: () {
           print(42);
       },
-        child: new Text(
+        child: Text(
           'foo',
         ),
       ),
@@ -115,14 +115,14 @@
     await resolveTestUnit('''
 import 'package:flutter/material.dart';
 main() {
-  new Column(
+  Column(
     children: [
-      new Column(
+      Column(
         children: [
-          new Padding(
-            padding: new EdgeInsets.all(16.0),
-            child: new /*caret*/Center(
-              child: new Column(
+          Padding(
+            padding: EdgeInsets.all(16.0),
+            child: /*caret*/Center(
+              child: Column(
                 crossAxisAlignment: CrossAxisAlignment.start,
                 children: <Widget>[],
               ),
@@ -137,14 +137,14 @@
     await assertHasAssist('''
 import 'package:flutter/material.dart';
 main() {
-  new Column(
+  Column(
     children: [
-      new Column(
+      Column(
         children: [
-          new /*caret*/Center(
-            child: new Padding(
-              padding: new EdgeInsets.all(16.0),
-              child: new Column(
+          Center(
+            child: Padding(
+              padding: EdgeInsets.all(16.0),
+              child: Column(
                 crossAxisAlignment: CrossAxisAlignment.start,
                 children: <Widget>[],
               ),
diff --git a/pkg/analysis_server/test/src/services/correction/assist/flutter_wrap_center_test.dart b/pkg/analysis_server/test/src/services/correction/assist/flutter_wrap_center_test.dart
index 4e300e2..f51ffa7 100644
--- a/pkg/analysis_server/test/src/services/correction/assist/flutter_wrap_center_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/assist/flutter_wrap_center_test.dart
@@ -25,7 +25,7 @@
 import 'package:flutter/widgets.dart';
 class FakeFlutter {
   main() {
-    return /*caret*/new Center();
+    return /*caret*/Center();
   }
 }
 ''');
@@ -38,7 +38,7 @@
 import 'package:flutter/widgets.dart';
 class FakeFlutter {
   main() {
-    return /*caret*/new Container();
+    return /*caret*/Container();
   }
 }
 ''');
@@ -46,7 +46,7 @@
 import 'package:flutter/widgets.dart';
 class FakeFlutter {
   main() {
-    return /*caret*/Center(child: new Container());
+    return Center(child: Container());
   }
 }
 ''');
@@ -77,7 +77,7 @@
 }
 
 main() {
-  return Center(child: MyWidget./*caret*/named());
+  return Center(child: MyWidget.named());
 }
 ''');
   }
diff --git a/pkg/analysis_server/test/src/services/correction/assist/flutter_wrap_column_test.dart b/pkg/analysis_server/test/src/services/correction/assist/flutter_wrap_column_test.dart
index cad4036..6e668f3 100644
--- a/pkg/analysis_server/test/src/services/correction/assist/flutter_wrap_column_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/assist/flutter_wrap_column_test.dart
@@ -26,8 +26,8 @@
 
 class FakeFlutter {
   main() {
-    return new Container(
-      child: new /*caret*/Text('aaa'),
+    return Container(
+      child: /*caret*/Text('aaa'),
     );
   }
 }
@@ -37,10 +37,10 @@
 
 class FakeFlutter {
   main() {
-    return new Container(
+    return Container(
       child: Column(
         children: <Widget>[
-          new /*caret*/Text('aaa'),
+          Text('aaa'),
         ],
       ),
     );
@@ -56,13 +56,13 @@
 
 class FakeFlutter {
   main() {
-    return new Row(children: [
-      new Text('aaa'),
+    return Row(children: [
+      Text('aaa'),
 // start
-      new Text('bbb'),
-      new Text('ccc'),
+      Text('bbb'),
+      Text('ccc'),
 // end
-      new Text('ddd'),
+      Text('ddd'),
     ]);
   }
 }
@@ -72,17 +72,15 @@
 
 class FakeFlutter {
   main() {
-    return new Row(children: [
-      new Text('aaa'),
-// start
+    return Row(children: [
+      Text('aaa'),
       Column(
         children: <Widget>[
-          new Text('bbb'),
-          new Text('ccc'),
+          Text('bbb'),
+          Text('ccc'),
         ],
       ),
-// end
-      new Text('ddd'),
+      Text('ddd'),
     ]);
   }
 }
diff --git a/pkg/analysis_server/test/src/services/correction/assist/flutter_wrap_container_test.dart b/pkg/analysis_server/test/src/services/correction/assist/flutter_wrap_container_test.dart
index 15f8433..f52a92c 100644
--- a/pkg/analysis_server/test/src/services/correction/assist/flutter_wrap_container_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/assist/flutter_wrap_container_test.dart
@@ -24,7 +24,7 @@
     await resolveTestUnit('''
 import 'package:flutter/widgets.dart';
 main() {
-  return /*caret*/new Container();
+  return /*caret*/Container();
 }
 ''');
     await assertNoAssist();
@@ -35,13 +35,13 @@
     await resolveTestUnit('''
 import 'package:flutter/widgets.dart';
 main() {
-  /*caret*/new Text('a');
+  /*caret*/Text('a');
 }
 ''');
     await assertHasAssist('''
 import 'package:flutter/widgets.dart';
 main() {
-  /*caret*/Container(child: new Text('a'));
+  Container(child: Text('a'));
 }
 ''');
   }
diff --git a/pkg/analysis_server/test/src/services/correction/assist/flutter_wrap_generic_test.dart b/pkg/analysis_server/test/src/services/correction/assist/flutter_wrap_generic_test.dart
index 30b416b..40983c8 100644
--- a/pkg/analysis_server/test/src/services/correction/assist/flutter_wrap_generic_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/assist/flutter_wrap_generic_test.dart
@@ -32,15 +32,13 @@
     await resolveTestUnit('''
 import 'package:flutter/widgets.dart';
 build() {
-  return new Container(
-    child: new Row(
-// start
+  return Container(
+    child: Row(
       children: [/*caret*/
-        new Text('111'),
-        new Text('222'),
-        new Container(),
+        Text('111'),
+        Text('222'),
+        Container(),
       ],
-// end
     ),
   );
 }
@@ -48,19 +46,17 @@
     await assertHasAssist('''
 import 'package:flutter/widgets.dart';
 build() {
-  return new Container(
-    child: new Row(
-// start
+  return Container(
+    child: Row(
       children: [
-        new widget(
-          children: [/*caret*/
-            new Text('111'),
-            new Text('222'),
-            new Container(),
+        widget(
+          children: [
+            Text('111'),
+            Text('222'),
+            Container(),
           ],
         ),
       ],
-// end
     ),
   );
 }
@@ -73,13 +69,13 @@
     await resolveTestUnit('''
 import 'package:flutter/widgets.dart';
 build() {
-  return new Container(
-    child: new Row(
+  return Container(
+    child: Row(
       children: [/*caret*/
 // start
-        new Transform(),
-        new Object(),
-        new AspectRatio(),
+        Transform(),
+        Object(),
+        AspectRatio(),
 // end
       ],
     ),
@@ -95,17 +91,15 @@
 import 'package:flutter/widgets.dart';
 class FakeFlutter {
   main() {
-    return new Container(
-// start
-      child: new /*caret*/DefaultTextStyle(
-        child: new Row(
+    return Container(
+      child: /*caret*/DefaultTextStyle(
+        child: Row(
           children: <Widget>[
-            new Container(
+            Container(
             ),
           ],
         ),
       ),
-// end
     );
   }
 }
@@ -114,19 +108,17 @@
 import 'package:flutter/widgets.dart';
 class FakeFlutter {
   main() {
-    return new Container(
-// start
+    return Container(
       child: widget(
-        child: new /*caret*/DefaultTextStyle(
-          child: new Row(
+        child: DefaultTextStyle(
+          child: Row(
             children: <Widget>[
-              new Container(
+              Container(
               ),
             ],
           ),
         ),
       ),
-// end
     );
   }
 }
@@ -139,17 +131,15 @@
 import 'package:flutter/widgets.dart';
 class FakeFlutter {\r
   main() {\r
-    return new Container(\r
-// start\r
-      child: new /*caret*/DefaultTextStyle(\r
-        child: new Row(\r
+    return Container(\r
+      child: /*caret*/DefaultTextStyle(\r
+        child: Row(\r
           children: <Widget>[\r
-            new Container(\r
+            Container(\r
             ),\r
           ],\r
         ),\r
       ),\r
-// end\r
     );\r
   }\r
 }\r
@@ -158,19 +148,17 @@
 import 'package:flutter/widgets.dart';
 class FakeFlutter {\r
   main() {\r
-    return new Container(\r
-// start\r
+    return Container(\r
       child: widget(\r
-        child: new /*caret*/DefaultTextStyle(\r
-          child: new Row(\r
+        child: DefaultTextStyle(\r
+          child: Row(\r
             children: <Widget>[\r
-              new Container(\r
+              Container(\r
               ),\r
             ],\r
           ),\r
         ),\r
       ),\r
-// end\r
     );\r
   }\r
 }\r
@@ -198,7 +186,7 @@
 }
 
 main(Foo foo) {
-  return widget(child: foo./*caret*/bar);
+  return widget(child: foo.bar);
 }
 ''');
   }
@@ -224,7 +212,7 @@
 }
 
 main(Foo foo) {
-  return /*caret*/widget(child: foo.bar);
+  return widget(child: foo.bar);
 }
 ''');
   }
@@ -236,9 +224,7 @@
 class FakeFlutter {
   main() {
   var obj;
-// start
-    return new Row(children: [/*caret*/ new Container()]);
-// end
+    return Row(children: [/*caret*/ Container()]);
   }
 }
 ''');
@@ -251,9 +237,7 @@
 import 'package:flutter/widgets.dart';
 class FakeFlutter {
   main() {
-// start
-    return /*caret*/new Container();
-// end
+    return /*caret*/Container();
   }
 }
 ''');
@@ -261,9 +245,7 @@
 import 'package:flutter/widgets.dart';
 class FakeFlutter {
   main() {
-// start
-    return /*caret*/widget(child: new Container());
-// end
+    return widget(child: Container());
   }
 }
 ''');
@@ -275,7 +257,7 @@
 import 'package:flutter/widgets.dart';
 class FakeFlutter {
   main() {
-    return new ClipRect./*caret*/rect();
+    return ClipRect./*caret*/rect();
   }
 }
 ''');
@@ -283,7 +265,7 @@
 import 'package:flutter/widgets.dart';
 class FakeFlutter {
   main() {
-    return widget(child: new ClipRect./*caret*/rect());
+    return widget(child: ClipRect.rect());
   }
 }
 ''');
@@ -295,7 +277,7 @@
 import 'package:flutter/widgets.dart';
 class FakeFlutter {
   main() {
-    var container = new Container();
+    var container = Container();
     return /*caret*/container;
   }
 }
@@ -304,8 +286,8 @@
 import 'package:flutter/widgets.dart';
 class FakeFlutter {
   main() {
-    var container = new Container();
-    return /*caret*/widget(child: container);
+    var container = Container();
+    return widget(child: container);
   }
 }
 ''');
diff --git a/pkg/analysis_server/test/src/services/correction/assist/flutter_wrap_padding_test.dart b/pkg/analysis_server/test/src/services/correction/assist/flutter_wrap_padding_test.dart
index 50b927b..acc611a 100644
--- a/pkg/analysis_server/test/src/services/correction/assist/flutter_wrap_padding_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/assist/flutter_wrap_padding_test.dart
@@ -25,7 +25,7 @@
 import 'package:flutter/widgets.dart';
 class FakeFlutter {
   main() {
-    return /*caret*/new Container();
+    return /*caret*/Container();
   }
 }
 ''');
@@ -33,9 +33,9 @@
 import 'package:flutter/widgets.dart';
 class FakeFlutter {
   main() {
-    return /*caret*/Padding(
+    return Padding(
       padding: const EdgeInsets.all(8.0),
-      child: new Container(),
+      child: Container(),
     );
   }
 }
@@ -48,7 +48,7 @@
 import 'package:flutter/widgets.dart';
 class FakeFlutter {
   main() {
-    return /*caret*/new Padding();
+    return /*caret*/Padding();
   }
 }
 ''');
diff --git a/pkg/analysis_server/test/src/services/correction/assist/flutter_wrap_row_test.dart b/pkg/analysis_server/test/src/services/correction/assist/flutter_wrap_row_test.dart
index c18ac34..32331c2 100644
--- a/pkg/analysis_server/test/src/services/correction/assist/flutter_wrap_row_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/assist/flutter_wrap_row_test.dart
@@ -26,13 +26,13 @@
 
 class FakeFlutter {
   main() {
-    return new Column(children: [
-      new Text('aaa'),
+    return Column(children: [
+      Text('aaa'),
 // start
-      new Text('bbb'),
-      new Text('ccc'),
+      Text('bbb'),
+      Text('ccc'),
 // end
-      new Text('ddd'),
+      Text('ddd'),
     ]);
   }
 }
@@ -42,17 +42,15 @@
 
 class FakeFlutter {
   main() {
-    return new Column(children: [
-      new Text('aaa'),
-// start
+    return Column(children: [
+      Text('aaa'),
       Row(
         children: <Widget>[
-          new Text('bbb'),
-          new Text('ccc'),
+          Text('bbb'),
+          Text('ccc'),
         ],
       ),
-// end
-      new Text('ddd'),
+      Text('ddd'),
     ]);
   }
 }
diff --git a/pkg/analysis_server/test/src/services/correction/assist/flutter_wrap_stream_builder_test.dart b/pkg/analysis_server/test/src/services/correction/assist/flutter_wrap_stream_builder_test.dart
index be7d5c2..c924f7e 100644
--- a/pkg/analysis_server/test/src/services/correction/assist/flutter_wrap_stream_builder_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/assist/flutter_wrap_stream_builder_test.dart
@@ -40,17 +40,17 @@
 import 'package:flutter/widgets.dart';
 
 main() {
-  /*caret*/new Text('a');
+  /*caret*/Text('a');
 }
 ''');
     await assertHasAssist('''
 import 'package:flutter/widgets.dart';
 
 main() {
-  /*caret*/StreamBuilder<Object>(
+  StreamBuilder<Object>(
     stream: null,
     builder: (context, snapshot) {
-      return new Text('a');
+      return Text('a');
     }
   );
 }
diff --git a/pkg/analysis_server/test/src/services/correction/assist/surround_with_block_test.dart b/pkg/analysis_server/test/src/services/correction/assist/surround_with_block_test.dart
index f4647be..52f5125 100644
--- a/pkg/analysis_server/test/src/services/correction/assist/surround_with_block_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/assist/surround_with_block_test.dart
@@ -30,12 +30,10 @@
 ''');
     await assertHasAssist('''
 main() {
-// start
   {
     print(0);
     print(1);
   }
-// end
 }
 ''');
   }
diff --git a/pkg/analysis_server/test/src/services/correction/assist/surround_with_do_while_test.dart b/pkg/analysis_server/test/src/services/correction/assist/surround_with_do_while_test.dart
index 96fbd14..56d81c3 100644
--- a/pkg/analysis_server/test/src/services/correction/assist/surround_with_do_while_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/assist/surround_with_do_while_test.dart
@@ -30,12 +30,10 @@
 ''');
     await assertHasAssist('''
 main() {
-// start
   do {
     print(0);
     print(1);
   } while (condition);
-// end
 }
 ''');
     assertLinkedGroup(0, ['condition);']);
diff --git a/pkg/analysis_server/test/src/services/correction/assist/surround_with_for_in_test.dart b/pkg/analysis_server/test/src/services/correction/assist/surround_with_for_in_test.dart
index c775e1c..6427730 100644
--- a/pkg/analysis_server/test/src/services/correction/assist/surround_with_for_in_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/assist/surround_with_for_in_test.dart
@@ -30,12 +30,10 @@
 ''');
     await assertHasAssist('''
 main() {
-// start
   for (var item in iterable) {
     print(0);
     print(1);
   }
-// end
 }
 ''');
     assertLinkedGroup(0, ['item']);
diff --git a/pkg/analysis_server/test/src/services/correction/assist/surround_with_for_test.dart b/pkg/analysis_server/test/src/services/correction/assist/surround_with_for_test.dart
index 770684c..095f0ed 100644
--- a/pkg/analysis_server/test/src/services/correction/assist/surround_with_for_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/assist/surround_with_for_test.dart
@@ -30,12 +30,10 @@
 ''');
     await assertHasAssist('''
 main() {
-// start
   for (var v = init; condition; increment) {
     print(0);
     print(1);
   }
-// end
 }
 ''');
     assertLinkedGroup(0, ['v =']);
diff --git a/pkg/analysis_server/test/src/services/correction/assist/surround_with_if_test.dart b/pkg/analysis_server/test/src/services/correction/assist/surround_with_if_test.dart
index de8df15..5780cfa 100644
--- a/pkg/analysis_server/test/src/services/correction/assist/surround_with_if_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/assist/surround_with_if_test.dart
@@ -30,12 +30,10 @@
 ''');
     await assertHasAssist('''
 main() {
-// start
   if (condition) {
     print(0);
     print(1);
   }
-// end
 }
 ''');
     assertLinkedGroup(0, ['condition']);
diff --git a/pkg/analysis_server/test/src/services/correction/assist/surround_with_try_catch_test.dart b/pkg/analysis_server/test/src/services/correction/assist/surround_with_try_catch_test.dart
index f39a5e0..bf806e9 100644
--- a/pkg/analysis_server/test/src/services/correction/assist/surround_with_try_catch_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/assist/surround_with_try_catch_test.dart
@@ -30,14 +30,12 @@
 ''');
     await assertHasAssist('''
 main() {
-// start
   try {
     print(0);
     print(1);
   } on Exception catch (e) {
     // TODO
   }
-// end
 }
 ''');
     assertLinkedGroup(0, ['Exception']);
diff --git a/pkg/analysis_server/test/src/services/correction/assist/surround_with_try_finally_test.dart b/pkg/analysis_server/test/src/services/correction/assist/surround_with_try_finally_test.dart
index 7e9267c..8527cd7 100644
--- a/pkg/analysis_server/test/src/services/correction/assist/surround_with_try_finally_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/assist/surround_with_try_finally_test.dart
@@ -30,14 +30,12 @@
 ''');
     await assertHasAssist('''
 main() {
-// start
   try {
     print(0);
     print(1);
   } finally {
     // TODO
   }
-// end
 }
 ''');
     assertLinkedGroup(0, ['// TODO']);
diff --git a/pkg/analysis_server/test/src/services/correction/assist/surround_with_while_test.dart b/pkg/analysis_server/test/src/services/correction/assist/surround_with_while_test.dart
index 939e211..38f0beb 100644
--- a/pkg/analysis_server/test/src/services/correction/assist/surround_with_while_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/assist/surround_with_while_test.dart
@@ -30,12 +30,10 @@
 ''');
     await assertHasAssist('''
 main() {
-// start
   while (condition) {
     print(0);
     print(1);
   }
-// end
 }
 ''');
     assertLinkedGroup(0, ['condition']);
diff --git a/pkg/analysis_server/test/src/services/correction/assist/test_all.dart b/pkg/analysis_server/test/src/services/correction/assist/test_all.dart
index be58fce..a090848 100644
--- a/pkg/analysis_server/test/src/services/correction/assist/test_all.dart
+++ b/pkg/analysis_server/test/src/services/correction/assist/test_all.dart
@@ -26,6 +26,7 @@
     as convert_to_double_quoted_string;
 import 'convert_to_field_parameter_test.dart' as convert_to_field_parameter;
 import 'convert_to_int_literal_test.dart' as convert_to_int_literal;
+import 'convert_to_multiline_string_test.dart' as convert_to_multiline_string;
 import 'convert_to_normal_parameter_test.dart' as convert_to_normal_parameter;
 import 'convert_to_single_quoted_string_test.dart'
     as convert_to_single_quoted_string;
@@ -88,6 +89,7 @@
     convert_to_double_quoted_string.main();
     convert_to_field_parameter.main();
     convert_to_int_literal.main();
+    convert_to_multiline_string.main();
     convert_to_normal_parameter.main();
     convert_to_single_quoted_string.main();
     encapsulate_field.main();
diff --git a/pkg/analysis_server/test/src/services/correction/fix/remove_annotation_test.dart b/pkg/analysis_server/test/src/services/correction/fix/remove_annotation_test.dart
new file mode 100644
index 0000000..1874b6f
--- /dev/null
+++ b/pkg/analysis_server/test/src/services/correction/fix/remove_annotation_test.dart
@@ -0,0 +1,178 @@
+// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:analysis_server/src/services/correction/fix.dart';
+import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+
+import 'fix_processor.dart';
+
+main() {
+  defineReflectiveSuite(() {
+    defineReflectiveTests(RemoveAnnotationTest);
+  });
+}
+
+@reflectiveTest
+class RemoveAnnotationTest extends FixProcessorTest {
+  @override
+  FixKind get kind => DartFixKind.REMOVE_ANNOTATION;
+
+  @override
+  void setUp() {
+    super.setUp();
+    addMetaPackage();
+  }
+
+  test_factory() async {
+    await resolveTestUnit('''
+import 'package:meta/meta.dart';
+
+@factory
+f() {}
+''');
+    await assertHasFix('''
+import 'package:meta/meta.dart';
+
+f() {}
+''');
+  }
+
+  test_immutable() async {
+    await resolveTestUnit('''
+import 'package:meta/meta.dart';
+
+@immutable
+f() {}
+''');
+    await assertHasFix('''
+import 'package:meta/meta.dart';
+
+f() {}
+''');
+  }
+
+  test_literal() async {
+    await resolveTestUnit('''
+import 'package:meta/meta.dart';
+
+@literal
+f() {}
+''');
+    await assertHasFix('''
+import 'package:meta/meta.dart';
+
+f() {}
+''');
+  }
+
+  test_override_field() async {
+    await resolveTestUnit('''
+class A {
+  @override
+  String name;
+}
+''');
+    await assertHasFix('''
+class A {
+  String name;
+}
+''');
+  }
+
+  test_override_getter() async {
+    await resolveTestUnit('''
+class A {
+  @override
+  int get zero => 0;
+}
+''');
+    await assertHasFix('''
+class A {
+  int get zero => 0;
+}
+''');
+  }
+
+  test_override_method() async {
+    await resolveTestUnit('''
+class A {
+  @override
+  void m() {}
+}
+''');
+    await assertHasFix('''
+class A {
+  void m() {}
+}
+''');
+  }
+
+  test_override_setter() async {
+    await resolveTestUnit('''
+class A {
+  @override
+  set value(v) {}
+}
+''');
+    await assertHasFix('''
+class A {
+  set value(v) {}
+}
+''');
+  }
+
+  test_required_namedWithDefault() async {
+    await resolveTestUnit('''
+import 'package:meta/meta.dart';
+
+f({@required int x = 0}) {}
+''');
+    await assertHasFix('''
+import 'package:meta/meta.dart';
+
+f({int x = 0}) {}
+''');
+  }
+
+  test_required_positional() async {
+    await resolveTestUnit('''
+import 'package:meta/meta.dart';
+
+f([@required int x]) {}
+''');
+    await assertHasFix('''
+import 'package:meta/meta.dart';
+
+f([int x]) {}
+''');
+  }
+
+  test_required_required() async {
+    await resolveTestUnit('''
+import 'package:meta/meta.dart';
+
+f(@required int x) {}
+''');
+    await assertHasFix('''
+import 'package:meta/meta.dart';
+
+f(int x) {}
+''');
+  }
+
+  test_sealed() async {
+    await resolveTestUnit('''
+import 'package:meta/meta.dart';
+
+@sealed
+f() {}
+''');
+    await assertHasFix('''
+import 'package:meta/meta.dart';
+
+f() {}
+''');
+  }
+}
diff --git a/pkg/analysis_server/test/src/services/correction/fix/remove_dead_code_test.dart b/pkg/analysis_server/test/src/services/correction/fix/remove_dead_code_test.dart
index eec8f7c..7f2fc41 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/remove_dead_code_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/remove_dead_code_test.dart
@@ -19,6 +19,73 @@
   @override
   FixKind get kind => DartFixKind.REMOVE_DEAD_CODE;
 
+  test_catch_afterCatchAll_catch() async {
+    await resolveTestUnit('''
+main() {
+  try {
+  } catch (e) {
+    print('a');
+  } catch (e) {
+    print('b');
+  }
+}
+''');
+    await assertHasFix('''
+main() {
+  try {
+  } catch (e) {
+    print('a');
+  }
+}
+''');
+  }
+
+  test_catch_afterCatchAll_on() async {
+    await resolveTestUnit('''
+main() {
+  try {
+  } on Object {
+    print('a');
+  } catch (e) {
+    print('b');
+  }
+}
+''');
+    await assertHasFix('''
+main() {
+  try {
+  } on Object {
+    print('a');
+  }
+}
+''');
+  }
+
+  test_catch_subtype() async {
+    await resolveTestUnit('''
+class A {}
+class B extends A {}
+main() {
+  try {
+  } on A {
+    print('a');
+  } on B {
+    print('b');
+  }
+}
+''');
+    await assertHasFix('''
+class A {}
+class B extends A {}
+main() {
+  try {
+  } on A {
+    print('a');
+  }
+}
+''');
+  }
+
   test_condition() async {
     await resolveTestUnit('''
 main(int p) {
diff --git a/pkg/analysis_server/test/src/services/correction/fix/remove_name_from_combinator_test.dart b/pkg/analysis_server/test/src/services/correction/fix/remove_name_from_combinator_test.dart
new file mode 100644
index 0000000..3ed155e
--- /dev/null
+++ b/pkg/analysis_server/test/src/services/correction/fix/remove_name_from_combinator_test.dart
@@ -0,0 +1,357 @@
+// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:analysis_server/src/services/correction/fix.dart';
+import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+
+import 'fix_processor.dart';
+
+main() {
+  defineReflectiveSuite(() {
+    defineReflectiveTests(RemoveNameFromCombinatorTest);
+  });
+}
+
+@reflectiveTest
+class RemoveNameFromCombinatorTest extends FixProcessorTest {
+  @override
+  FixKind get kind => DartFixKind.REMOVE_NAME_FROM_COMBINATOR;
+
+  test_duplicateHiddenName_last() async {
+    await resolveTestUnit('''
+import 'dart:math' hide cos, sin, sin;
+
+main() {
+  print(min(0, 1));
+}
+''');
+    await assertHasFix('''
+import 'dart:math' hide cos, sin;
+
+main() {
+  print(min(0, 1));
+}
+''');
+  }
+
+  test_duplicateHiddenName_middle() async {
+    await resolveTestUnit('''
+import 'dart:math' hide cos, cos, sin;
+
+main() {
+  print(min(0, 1));
+}
+''');
+    await assertHasFix('''
+import 'dart:math' hide cos, sin;
+
+main() {
+  print(min(0, 1));
+}
+''');
+  }
+
+  @failingTest
+  test_duplicateHiddenName_only_last() async {
+    // It appears that the hint does not detect names that are duplicated across
+    // multiple combinators.
+    await resolveTestUnit('''
+import 'dart:math' hide cos, sin hide sin;
+
+main() {
+  print(min(0, 1));
+}
+''');
+    await assertHasFix('''
+import 'dart:math' hide cos, sin;
+
+main() {
+  print(min(0, 1));
+}
+''');
+  }
+
+  @failingTest
+  test_duplicateHiddenName_only_middle() async {
+    // It appears that the hint does not detect names that are duplicated across
+    // multiple combinators.
+    await resolveTestUnit('''
+import 'dart:math' hide cos hide cos hide sin;
+
+main() {
+  print(min(0, 1));
+}
+''');
+    await assertHasFix('''
+import 'dart:math' hide cos hide sin;
+
+main() {
+  print(min(0, 1));
+}
+''');
+  }
+
+  test_duplicateShownName_last() async {
+    await resolveTestUnit(
+      '''
+import 'dart:math' show cos, sin, sin;
+
+f(x) {
+  print(cos(x) + sin(x));
+}
+''',
+    );
+    await assertHasFix('''
+import 'dart:math' show cos, sin;
+
+f(x) {
+  print(cos(x) + sin(x));
+}
+''');
+  }
+
+  test_duplicateShownName_middle() async {
+    await resolveTestUnit('''
+import 'dart:math' show cos, cos, sin;
+
+f(x) {
+  print(cos(x) + sin(x));
+}
+''');
+    await assertHasFix('''
+import 'dart:math' show cos, sin;
+
+f(x) {
+  print(cos(x) + sin(x));
+}
+''');
+  }
+
+  test_undefinedHiddenName_first() async {
+    await resolveTestUnit('''
+import 'dart:math' hide aaa, sin, tan;
+
+f(x) {
+  print(cos(x));
+}
+''');
+    await assertHasFix('''
+import 'dart:math' hide sin, tan;
+
+f(x) {
+  print(cos(x));
+}
+''');
+  }
+
+  test_undefinedHiddenName_last() async {
+    await resolveTestUnit('''
+import 'dart:math' hide cos, sin, xxx;
+
+f(x) {
+  print(tan(x));
+}
+''');
+    await assertHasFix('''
+import 'dart:math' hide cos, sin;
+
+f(x) {
+  print(tan(x));
+}
+''');
+  }
+
+  test_undefinedHiddenName_middle() async {
+    await resolveTestUnit('''
+import 'dart:math' hide cos, mmm, tan;
+
+f(x) {
+  print(sin(x));
+}
+''');
+    await assertHasFix('''
+import 'dart:math' hide cos, tan;
+
+f(x) {
+  print(sin(x));
+}
+''');
+  }
+
+  test_undefinedHiddenName_only_first() async {
+    await resolveTestUnit('''
+import 'dart:math' hide aaa hide cos, sin;
+
+main() {
+  print(min(0, 1));
+}
+''');
+    await assertHasFix('''
+import 'dart:math' hide cos, sin;
+
+main() {
+  print(min(0, 1));
+}
+''');
+  }
+
+  test_undefinedHiddenName_only_last() async {
+    await resolveTestUnit('''
+import 'dart:math' hide cos, sin hide aaa;
+
+main() {
+  print(min(0, 1));
+}
+''');
+    await assertHasFix('''
+import 'dart:math' hide cos, sin;
+
+main() {
+  print(min(0, 1));
+}
+''');
+  }
+
+  test_undefinedHiddenName_only_middle() async {
+    await resolveTestUnit('''
+import 'dart:math' hide cos hide aaa hide sin;
+
+main() {
+  print(min(0, 1));
+}
+''');
+    await assertHasFix('''
+import 'dart:math' hide cos hide sin;
+
+main() {
+  print(min(0, 1));
+}
+''');
+  }
+
+  test_undefinedHiddenName_only_only() async {
+    await resolveTestUnit('''
+import 'dart:math' hide aaa;
+var c = sin(0.3);
+''');
+    await assertHasFix('''
+import 'dart:math';
+var c = sin(0.3);
+''');
+  }
+
+  test_undefinedHiddenName_only_only_withAs() async {
+    await resolveTestUnit('''
+import 'dart:math' as math hide aaa;
+var c = math.sin(0.3);
+''');
+    await assertHasFix('''
+import 'dart:math' as math;
+var c = math.sin(0.3);
+''');
+  }
+
+  test_undefinedShownName_first() async {
+    await resolveTestUnit('''
+import 'dart:math' show aaa, sin, tan;
+
+f(x) {
+  print(sin(x) + tan(x));
+}
+''');
+    await assertHasFix('''
+import 'dart:math' show sin, tan;
+
+f(x) {
+  print(sin(x) + tan(x));
+}
+''');
+  }
+
+  test_undefinedShownName_last() async {
+    await resolveTestUnit('''
+import 'dart:math' show cos, sin, xxx;
+
+f(x) {
+  print(cos(x) + sin(x));
+}
+''');
+    await assertHasFix('''
+import 'dart:math' show cos, sin;
+
+f(x) {
+  print(cos(x) + sin(x));
+}
+''');
+  }
+
+  test_undefinedShownName_middle() async {
+    await resolveTestUnit('''
+import 'dart:math' show cos, mmm, tan;
+
+f(x) {
+  print(cos(x) + tan(x));
+}
+''');
+    await assertHasFix('''
+import 'dart:math' show cos, tan;
+
+f(x) {
+  print(cos(x) + tan(x));
+}
+''');
+  }
+
+  test_unusedShownName_first() async {
+    await resolveTestUnit('''
+import 'dart:math' show cos, sin, tan;
+
+f(x) {
+  print(sin(x) + tan(x));
+}
+''');
+    await assertHasFix('''
+import 'dart:math' show sin, tan;
+
+f(x) {
+  print(sin(x) + tan(x));
+}
+''');
+  }
+
+  test_unusedShownName_last() async {
+    await resolveTestUnit('''
+import 'dart:math' show cos, sin, tan;
+
+f(x) {
+  print(cos(x) + sin(x));
+}
+''');
+    await assertHasFix('''
+import 'dart:math' show cos, sin;
+
+f(x) {
+  print(cos(x) + sin(x));
+}
+''');
+  }
+
+  test_unusedShownName_middle() async {
+    await resolveTestUnit('''
+import 'dart:math' show cos, sin, tan;
+
+f(x) {
+  print(cos(x) + tan(x));
+}
+''');
+    await assertHasFix('''
+import 'dart:math' show cos, tan;
+
+f(x) {
+  print(cos(x) + tan(x));
+}
+''');
+  }
+}
diff --git a/pkg/analysis_server/test/src/services/correction/fix/remove_unused_import_test.dart b/pkg/analysis_server/test/src/services/correction/fix/remove_unused_import_test.dart
index 96ee02f..e7a4db9 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/remove_unused_import_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/remove_unused_import_test.dart
@@ -86,6 +86,24 @@
 ''');
   }
 
+  test_duplicateImport() async {
+    await resolveTestUnit('''
+import 'dart:math';
+import 'dart:math';
+
+main() {
+  print(min(0, 1));
+}
+''');
+    await assertHasFix('''
+import 'dart:math';
+
+main() {
+  print(min(0, 1));
+}
+''');
+  }
+
   test_multipleOfSame_all() async {
     await resolveTestUnit('''
 import 'dart:math';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/test_all.dart b/pkg/analysis_server/test/src/services/correction/fix/test_all.dart
index de6f043..30cad40 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/test_all.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/test_all.dart
@@ -54,6 +54,7 @@
 import 'make_field_not_final_test.dart' as make_field_not_final;
 import 'make_final_test.dart' as make_final;
 import 'move_type_arguments_to_class_test.dart' as move_type_arguments_to_class;
+import 'remove_annotation_test.dart' as remove_annotation;
 import 'remove_await_test.dart' as remove_await;
 import 'remove_dead_code_test.dart' as remove_dead_code;
 import 'remove_empty_catch_test.dart' as remove_empty_catch;
@@ -64,6 +65,7 @@
 import 'remove_initializer_test.dart' as remove_initializer;
 import 'remove_interpolation_braces_test.dart' as remove_interpolation_braces;
 import 'remove_method_declaration_test.dart' as remove_method_declaration;
+import 'remove_name_from_combinator_test.dart' as remove_name_from_combinator;
 import 'remove_parameters_in_getter_declaration_test.dart'
     as remove_parameters_in_getter_declaration;
 import 'remove_parentheses_in_getter_invocation_test.dart'
@@ -141,6 +143,7 @@
     make_field_not_final.main();
     make_final.main();
     move_type_arguments_to_class.main();
+    remove_annotation.main();
     remove_await.main();
     remove_dead_code.main();
     remove_empty_catch.main();
@@ -150,6 +153,7 @@
     remove_initializer.main();
     remove_interpolation_braces.main();
     remove_method_declaration.main();
+    remove_name_from_combinator.main();
     remove_parameters_in_getter_declaration.main();
     remove_parentheses_in_getter_invocation.main();
     remove_this_expression.main();
diff --git a/pkg/analysis_server/test/tool/lsp_spec/typescript_test.dart b/pkg/analysis_server/test/tool/lsp_spec/typescript_test.dart
index abf1791..f100429 100644
--- a/pkg/analysis_server/test/tool/lsp_spec/typescript_test.dart
+++ b/pkg/analysis_server/test/tool/lsp_spec/typescript_test.dart
@@ -102,7 +102,7 @@
 
     test('parses an interface with type args', () {
       final String input = '''
-interface ResponseError<D> {
+interface MyInterface<D> {
 	data?: D;
 }
     ''';
diff --git a/pkg/analysis_server/tool/lsp_spec/README.md b/pkg/analysis_server/tool/lsp_spec/README.md
index fe5bf80..b696b00 100644
--- a/pkg/analysis_server/tool/lsp_spec/README.md
+++ b/pkg/analysis_server/tool/lsp_spec/README.md
@@ -37,8 +37,10 @@
 | telemetry/event | | | | |
 | client/registerCapability | | | | | unused, but should be used for DocumentSelector at least
 | client/unregisterCapability | | | | |
-| workspace/didChangeWatchedFiles | | | | | unused, server does own watching |
+| workspace/workspaceFolders | | | | |
 | workspace/didChangeWorkspaceFolders | ✅ | ✅ | ✅ | ✅ |
+| workspace/configuration | | | | |
+| workspace/didChangeWatchedFiles | | | | | unused, server does own watching |
 | workspace/symbol | | | | |
 | workspace/executeCommand | ✅ | ✅ | ✅ | ✅ |
 | workspace/applyEdit | ✅ | ✅ | ✅ | ✅ |
@@ -52,6 +54,7 @@
 | completionItem/resolve | | | | | not required |
 | textDocument/hover | ✅ | ✅ | ✅ | ✅ |
 | textDocument/signatureHelp | ✅ | ✅ | ✅ | ✅ | trigger character handling outstanding
+| textDocument/declaration | | | | |
 | textDocument/definition | ✅ | ✅ | ✅ | ✅ |
 | textDocument/typeDefinition | | | | |
 | textDocument/implementation | | | | |
@@ -67,10 +70,13 @@
 | codeLens/resolve | | | | |
 | textDocument/documentLink | | | | |
 | documentLink/resolve | | | | |
+| textDocument/documentColor | | | | |
+| textDocument/colorPresentation | | | | |
 | textDocument/formatting | ✅ | ✅ | ✅ | ✅ |
 | textDocument/rangeFormatting | | | | | requires support from dart_style?
 | textDocument/onTypeFormatting | ✅ | ✅ | ✅ | ✅ |
-| textDocument/rename | ✅ | ✅ | Incomplete! | |
+| textDocument/rename | ✅ | ✅ | ✅ | ✅ |
 | textDocument/prepareRename | | | | |
-| textDocument/foldingRange | | | | |
+| textDocument/foldingRange | ✅ | ✅ | ✅ | ✅ |
+
 
diff --git a/pkg/analysis_server/tool/lsp_spec/codegen_dart.dart b/pkg/analysis_server/tool/lsp_spec/codegen_dart.dart
index 6c87b90..839da75 100644
--- a/pkg/analysis_server/tool/lsp_spec/codegen_dart.dart
+++ b/pkg/analysis_server/tool/lsp_spec/codegen_dart.dart
@@ -24,7 +24,7 @@
   // TODO(dantup): This should return true by default, and allow opt-out for
   // those things we know are not supported. This behaviour matches the old
   // code in order to simplify diffs while migrating.
-  return name == 'ErrorCodes' || name == 'CodeActionKind';
+  return name == 'ErrorCodes' || name == 'CodeActionKind' || name == 'Method';
 }
 
 String generateDartForTypes(List<AstNode> types) {
diff --git a/pkg/analysis_server/tool/lsp_spec/generate_all.dart b/pkg/analysis_server/tool/lsp_spec/generate_all.dart
index 909a06b..23fb23f 100644
--- a/pkg/analysis_server/tool/lsp_spec/generate_all.dart
+++ b/pkg/analysis_server/tool/lsp_spec/generate_all.dart
@@ -7,6 +7,8 @@
 
 import 'package:analysis_server/src/services/correction/strings.dart';
 import 'package:http/http.dart' as http;
+
+import 'package:args/args.dart';
 import 'package:path/path.dart' as path;
 
 import 'codegen_dart.dart';
@@ -14,14 +16,40 @@
 import 'typescript.dart';
 import 'typescript_parser.dart';
 
-main() async {
+const argHelp = 'help';
+const argDownload = 'download';
+
+final argParser = new ArgParser()
+  ..addFlag(argHelp, hide: true)
+  ..addFlag(argDownload,
+      negatable: false,
+      abbr: 'd',
+      help:
+          'Download the latest version of the LSP spec before generating types');
+
+main(List<String> arguments) async {
+  final args = argParser.parse(arguments);
+  if (args[argHelp]) {
+    print(argParser.usage);
+    return;
+  }
+
   final String script = Platform.script.toFilePath();
   // 3x parent = file -> lsp_spec -> tool -> analysis_server.
   final String packageFolder = new File(script).parent.parent.parent.path;
   final String outFolder = path.join(packageFolder, 'lib', 'lsp_protocol');
   new Directory(outFolder).createSync();
 
-  final String spec = await fetchSpec();
+  await writeSpecClasses(args, outFolder);
+  await writeCustomClasses(args, outFolder);
+}
+
+Future writeSpecClasses(ArgResults args, String outFolder) async {
+  if (args[argDownload]) {
+    await downloadSpec();
+  }
+  final String spec = await readSpec();
+
   final List<AstNode> types = extractTypeScriptBlocks(spec)
       .where(shouldIncludeScriptBlock)
       .map(parseString)
@@ -39,7 +67,28 @@
   final String output = generateDartForTypes(types);
 
   new File(path.join(outFolder, 'protocol_generated.dart'))
-      .writeAsStringSync(_generatedFileHeader + output);
+      .writeAsStringSync(generatedFileHeader(2018) + output);
+}
+
+/// Writes classes used by Dart's custom LSP methods.
+Future writeCustomClasses(ArgResults args, String outFolder) async {
+  interface(String name, List<Member> fields) {
+    return new Interface(null, Token.identifier(name), [], [], fields);
+  }
+
+  field(String name, {String type, canBeNull: false, canBeUndefined: false}) {
+    return new Field(null, Token.identifier(name), Type.identifier(type),
+        canBeNull, canBeUndefined);
+  }
+
+  final List<AstNode> customTypes = [
+    interface('DartDiagnosticServer', [field('port', type: 'number')]),
+  ];
+
+  final String output = generateDartForTypes(customTypes);
+
+  new File(path.join(outFolder, 'protocol_custom_generated.dart'))
+      .writeAsStringSync(generatedFileHeader(2019) + output);
 }
 
 Namespace extractMethodsEnum(String spec) {
@@ -68,8 +117,8 @@
       comment, new Token.identifier('Method'), methodConstants);
 }
 
-const _generatedFileHeader = '''
-// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
+String generatedFileHeader(int year) => '''
+// Copyright (c) $year, the Dart project authors. Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
@@ -78,13 +127,16 @@
 // "pkg/analysis_server/tool/lsp_spec/generate_all.dart".
 
 // ignore_for_file: deprecated_member_use
+// ignore_for_file: deprecated_member_use_from_same_package
 // ignore_for_file: unnecessary_brace_in_string_interps
+// ignore_for_file: unused_import
 
 import 'dart:core' hide deprecated;
 import 'dart:core' as core show deprecated;
 import 'dart:convert' show JsonEncoder;
 import 'package:analysis_server/lsp_protocol/protocol_special.dart';
-import 'package:analysis_server/src/protocol/protocol_internal.dart' show listEqual, mapEqual;
+import 'package:analysis_server/src/protocol/protocol_internal.dart'
+    show listEqual, mapEqual;
 import 'package:analyzer/src/generated/utilities_general.dart';
 
 const jsonEncoder = const JsonEncoder.withIndent('    ');
@@ -93,6 +145,10 @@
 
 final Uri specUri = Uri.parse(
     'https://raw.githubusercontent.com/Microsoft/language-server-protocol/gh-pages/specification.md');
+final Uri specLicenseUri = Uri.parse(
+    'https://raw.githubusercontent.com/Microsoft/language-server-protocol/gh-pages/License.txt');
+final String localSpecPath = path.join(
+    path.dirname(Platform.script.toFilePath()), 'lsp_specification.md');
 
 /// Pattern to extract inline types from the `result: {xx, yy }` notes in the spec.
 /// Doesn't parse past full stops as some of these have english sentences tagged on
@@ -130,11 +186,27 @@
       .toList();
 }
 
-Future<String> fetchSpec() async {
-  final resp = await http.get(specUri);
-  return resp.body;
+Future<void> downloadSpec() async {
+  final specResp = await http.get(specUri);
+  final licenseResp = await http.get(specLicenseUri);
+  final text = [
+    '''
+This is an unmodified copy of the Language Server Protocol Specification,
+downloaded from $specUri. It is the version of the specification that was
+used to generate a portion of the Dart code used to support the protocol.
+
+To regenerate the generated code, run the script in
+"analysis_server/tool/lsp_spec/generate_all.dart" with no arguments. To
+download the latest version of the specification before regenerating the
+code, run the same script with an argument of "--download".''',
+    licenseResp.body,
+    specResp.body
+  ];
+  return new File(localSpecPath).writeAsString(text.join('\n\n---\n\n'));
 }
 
+Future<String> readSpec() => new File(localSpecPath).readAsString();
+
 /// Returns whether a script block should be parsed or not.
 bool shouldIncludeScriptBlock(String input) {
   // We can't parse literal arrays, but this script block is just an example
diff --git a/pkg/analysis_server/tool/lsp_spec/lsp_specification.md b/pkg/analysis_server/tool/lsp_spec/lsp_specification.md
new file mode 100644
index 0000000..2bb235d
--- /dev/null
+++ b/pkg/analysis_server/tool/lsp_spec/lsp_specification.md
@@ -0,0 +1,4433 @@
+This is an unmodified copy of the Language Server Protocol Specification,
+downloaded from https://raw.githubusercontent.com/Microsoft/language-server-protocol/gh-pages/specification.md. It is the version of the specification that was
+used to generate a portion of the Dart code used to support the protocol.
+
+To regenerate the generated code, run the script in
+"analysis_server/tool/lsp_spec/generate_all.dart" with no arguments. To
+download the latest version of the specification before regenerating the
+code, run the same script with an argument of "--download".
+
+
+---
+
+Copyright (c) Microsoft Corporation.
+ 
+All rights reserved. 
+
+Distributed under the following terms:
+
+1.	Documentation is licensed under the Creative Commons Attribution 3.0 United States License. Code is licensed under the MIT License.
+2. This license does not grant you rights to use any trademarks or logos of Microsoft. For Microsoft’s general trademark guidelines, go to http://go.microsoft.com/fwlink/?LinkID=254653
+
+---
+
+---
+title: Specification
+layout: specification
+sectionid: specification
+toc: true
+---
+# Language Server Protocol Specification
+
+This document describes version 3.x of the language server protocol. An implementation for node of the 3.0 version of the protocol can be found [here](https://github.com/Microsoft/vscode-languageserver-node).
+
+The 2.x version of this document can be found [here](https://github.com/Microsoft/language-server-protocol/blob/master/versions/protocol-2-x.md).
+The 1.x version of this document can be found [here](https://github.com/Microsoft/language-server-protocol/blob/master/versions/protocol-1-x.md).
+
+**Note:** edits to this specification can be made via a pull request against this markdown [document](https://github.com/Microsoft/language-server-protocol/blob/gh-pages/specification.md).
+
+## Base Protocol
+
+The base protocol consists of a header and a content part (comparable to HTTP). The header and content part are
+separated by a '\r\n'.
+
+### Header Part
+
+The header part consists of header fields. Each header field is comprised of a name and a value,
+separated by ': ' (a colon and a space).
+Each header field is terminated by '\r\n'.
+Considering the last header field and the overall header itself are each terminated with '\r\n',
+and that at least one header is mandatory, this means that two '\r\n' sequences always
+immediately precede the content part of a message.
+
+Currently the following header fields are supported:
+
+| Header Field Name | Value Type  | Description |
+|:------------------|:------------|:------------|
+| Content-Length    | number      | The length of the content part in bytes. This header is required. |
+| Content-Type      | string      | The mime type of the content part. Defaults to application/vscode-jsonrpc; charset=utf-8 |
+{: .table .table-bordered .table-responsive}
+
+The header part is encoded using the 'ascii' encoding. This includes the '\r\n' separating the header and content part.
+
+### Content Part
+
+Contains the actual content of the message. The content part of a message uses [JSON-RPC](http://www.jsonrpc.org/) to describe requests, responses and notifications. The content part is encoded using the charset provided in the Content-Type field. It defaults to `utf-8`, which is the only encoding supported right now. If a server or client receives a header with a different encoding then `utf-8` it should respond with an error.
+
+(Prior versions of the protocol used the string constant `utf8` which is not a correct encoding constant according to [specification](http://www.iana.org/assignments/character-sets/character-sets.xhtml).) For backwards compatibility it is highly recommended that a client and a server treats the string `utf8` as `utf-8`.
+
+### Example:
+
+```
+Content-Length: ...\r\n
+\r\n
+{
+	"jsonrpc": "2.0",
+	"id": 1,
+	"method": "textDocument/didOpen",
+	"params": {
+		...
+	}
+}
+```
+### Base Protocol JSON structures
+
+The following TypeScript definitions describe the base [JSON-RPC protocol](http://www.jsonrpc.org/specification):
+
+#### Abstract Message
+
+A general message as defined by JSON-RPC. The language server protocol always uses "2.0" as the `jsonrpc` version.
+
+```typescript
+interface Message {
+	jsonrpc: string;
+}
+```
+#### Request Message
+
+A request message to describe a request between the client and the server. Every processed request must send a response back to the sender of the request.
+
+```typescript
+interface RequestMessage extends Message {
+
+	/**
+	 * The request id.
+	 */
+	id: number | string;
+
+	/**
+	 * The method to be invoked.
+	 */
+	method: string;
+
+	/**
+	 * The method's params.
+	 */
+	params?: Array<any> | object;
+}
+```
+
+#### Response Message
+
+A Response Message sent as a result of a request. If a request doesn't provide a result value the receiver of a request still needs to return a response message to conform to the JSON RPC specification. The result property of the ResponseMessage should be set to `null` in this case to signal a successful request.
+
+```typescript
+interface ResponseMessage extends Message {
+	/**
+	 * The request id.
+	 */
+	id: number | string | null;
+
+	/**
+	 * The result of a request. This can be omitted in
+	 * the case of an error.
+	 */
+	result?: any;
+
+	/**
+	 * The error object in case a request fails.
+	 */
+	error?: ResponseError<any>;
+}
+
+interface ResponseError<D> {
+	/**
+	 * A number indicating the error type that occurred.
+	 */
+	code: number;
+
+	/**
+	 * A string providing a short description of the error.
+	 */
+	message: string;
+
+	/**
+	 * A Primitive or Structured value that contains additional
+	 * information about the error. Can be omitted.
+	 */
+	data?: D;
+}
+
+export namespace ErrorCodes {
+	// Defined by JSON RPC
+	export const ParseError: number = -32700;
+	export const InvalidRequest: number = -32600;
+	export const MethodNotFound: number = -32601;
+	export const InvalidParams: number = -32602;
+	export const InternalError: number = -32603;
+	export const serverErrorStart: number = -32099;
+	export const serverErrorEnd: number = -32000;
+	export const ServerNotInitialized: number = -32002;
+	export const UnknownErrorCode: number = -32001;
+
+	// Defined by the protocol.
+	export const RequestCancelled: number = -32800;
+	export const ContentModified: number = -32801;
+}
+```
+#### Notification Message
+
+A notification message. A processed notification message must not send a response back. They work like events.
+
+```typescript
+interface NotificationMessage extends Message {
+	/**
+	 * The method to be invoked.
+	 */
+	method: string;
+
+	/**
+	 * The notification's params.
+	 */
+	params?: Array<any> | object;
+}
+```
+
+#### $ Notifications and Requests
+
+Notification and requests whose methods start with '$/' are messages which are protocol implementation dependent and might not be implementable in all clients or servers. For example if the server implementation uses a single threaded synchronous programming language then there is little a server can do to react to a '$/cancelRequest' notification. If a server or client receives notifications starting with '$/' it is free to ignore the notification. If a server or client receives a requests starting with '$/' it must error the request with error code `MethodNotFound` (e.g. `-32601`).
+
+#### <a href="#cancelRequest" name="cancelRequest" class="anchor"> Cancellation Support (:arrow_right: :arrow_left:)</a>
+
+The base protocol offers support for request cancellation. To cancel a request, a notification message with the following properties is sent:
+
+_Notification_:
+* method: '$/cancelRequest'
+* params: `CancelParams` defined as follows:
+
+```typescript
+interface CancelParams {
+	/**
+	 * The request id to cancel.
+	 */
+	id: number | string;
+}
+```
+
+A request that got canceled still needs to return from the server and send a response back. It can not be left open / hanging. This is in line with the JSON RPC protocol that requires that every request sends a response back. In addition it allows for returning partial results on cancel. If the request returns an error response on cancellation it is advised to set the error code to `ErrorCodes.RequestCancelled`.
+
+## Language Server Protocol
+
+The language server protocol defines a set of JSON-RPC request, response and notification messages which are exchanged using the above base protocol. This section starts describing the basic JSON structures used in the protocol. The document uses TypeScript interfaces to describe these. Based on the basic JSON structures, the actual requests with their responses and the notifications are described.
+
+In general, the language server protocol supports JSON-RPC messages, however the base protocol defined here uses a convention such that the parameters passed to request/notification messages should be of `object` type (if passed at all). However, this does not disallow using `Array` parameter types in custom messages.
+
+The protocol currently assumes that one server serves one tool. There is currently no support in the protocol to share one server between different tools. Such a sharing would require additional protocol e.g. to lock a document to support concurrent editing.
+
+### Basic JSON Structures
+
+#### URI
+
+URI's are transferred as strings. The URI's format is defined in [http://tools.ietf.org/html/rfc3986](http://tools.ietf.org/html/rfc3986)
+
+```
+  foo://example.com:8042/over/there?name=ferret#nose
+  \_/   \______________/\_________/ \_________/ \__/
+   |           |            |            |        |
+scheme     authority       path        query   fragment
+   |   _____________________|__
+  / \ /                        \
+  urn:example:animal:ferret:nose
+```
+
+We also maintain a node module to parse a string into `scheme`, `authority`, `path`, `query`, and `fragment` URI components. The GitHub repository is [https://github.com/Microsoft/vscode-uri](https://github.com/Microsoft/vscode-uri) the npm module is [https://www.npmjs.com/package/vscode-uri](https://www.npmjs.com/package/vscode-uri).
+
+Many of the interfaces contain fields that correspond to the URI of a document. For clarity, the type of such a field is declared as a `DocumentUri`. Over the wire, it will still be transferred as a string, but this guarantees that the contents of that string can be parsed as a valid URI.
+
+```typescript
+type DocumentUri = string;
+```
+
+#### Text Documents
+
+The current protocol is tailored for textual documents whose content can be represented as a string. There is currently no support for binary documents. A position inside a document (see Position definition below) is expressed as a zero-based line and character offset. The offsets are based on a UTF-16 string representation. So a string of the form `a𐐀b` the character offset of the character `a` is 0, the character offset of `𐐀` is 1 and the character offset of b is 3 since `𐐀` is represented using two code units in UTF-16. To ensure that both client and server split the string into the same line representation the protocol specifies the following end-of-line sequences: '\n', '\r\n' and '\r'.
+
+Positions are line end character agnostic. So you can not specify  a position that denotes `\r|\n` or `\n|` where `|` represents the character offset.
+
+```typescript
+export const EOL: string[] = ['\n', '\r\n', '\r'];
+```
+
+#### Position
+
+Position in a text document expressed as zero-based line and zero-based character offset. A position is between two characters like an 'insert' cursor in a editor.
+
+```typescript
+interface Position {
+	/**
+	 * Line position in a document (zero-based).
+	 */
+	line: number;
+
+	/**
+	 * Character offset on a line in a document (zero-based). Assuming that the line is
+	 * represented as a string, the `character` value represents the gap between the
+	 * `character` and `character + 1`.
+	 *
+	 * If the character value is greater than the line length it defaults back to the
+	 * line length.
+	 */
+	character: number;
+}
+```
+#### Range
+
+A range in a text document expressed as (zero-based) start and end positions. A range is comparable to a selection in an editor. Therefore the end position is exclusive. If you want to specify a range that contains a line including the line ending character(s) then use an end position denoting the start of the next line. For example:
+```typescript
+{
+    start: { line: 5, character: 23 },
+    end : { line 6, character : 0 }
+}
+```
+
+```typescript
+interface Range {
+	/**
+	 * The range's start position.
+	 */
+	start: Position;
+
+	/**
+	 * The range's end position.
+	 */
+	end: Position;
+}
+```
+
+#### Location
+
+Represents a location inside a resource, such as a line inside a text file.
+```typescript
+interface Location {
+	uri: DocumentUri;
+	range: Range;
+}
+```
+
+#### LocationLink
+
+Represents a link between a source and a target location.
+
+```typescript
+interface LocationLink {
+
+	/**
+	 * Span of the origin of this link.
+	 *
+	 * Used as the underlined span for mouse interaction. Defaults to the word range at
+	 * the mouse position.
+	 */
+	originSelectionRange?: Range;
+
+	/**
+	 * The target resource identifier of this link.
+	 */
+	targetUri: string;
+
+	/**
+	 * The full target range of this link. If the target for example is a symbol then target range is the
+	 * range enclosing this symbol not including leading/trailing whitespace but everything else
+	 * like comments. This information is typically used to highlight the range in the editor.
+	 */
+	targetRange: Range;
+
+	/**
+	 * The range that should be selected and revealed when this link is being followed, e.g the name of a function.
+	 * Must be contained by the the `targetRange`. See also `DocumentSymbol#range`
+	 */
+	targetSelectionRange: Range;
+}
+```
+
+#### Diagnostic
+
+Represents a diagnostic, such as a compiler error or warning. Diagnostic objects are only valid in the scope of a resource.
+
+```typescript
+interface Diagnostic {
+	/**
+	 * The range at which the message applies.
+	 */
+	range: Range;
+
+	/**
+	 * The diagnostic's severity. Can be omitted. If omitted it is up to the
+	 * client to interpret diagnostics as error, warning, info or hint.
+	 */
+	severity?: number;
+
+	/**
+	 * The diagnostic's code, which might appear in the user interface.
+	 */
+	code?: number | string;
+
+	/**
+	 * A human-readable string describing the source of this
+	 * diagnostic, e.g. 'typescript' or 'super lint'.
+	 */
+	source?: string;
+
+	/**
+	 * The diagnostic's message.
+	 */
+	message: string;
+
+	/**
+	 * An array of related diagnostic information, e.g. when symbol-names within
+	 * a scope collide all definitions can be marked via this property.
+	 */
+	relatedInformation?: DiagnosticRelatedInformation[];
+}
+```
+
+The protocol currently supports the following diagnostic severities:
+
+```typescript
+namespace DiagnosticSeverity {
+	/**
+	 * Reports an error.
+	 */
+	export const Error = 1;
+	/**
+	 * Reports a warning.
+	 */
+	export const Warning = 2;
+	/**
+	 * Reports an information.
+	 */
+	export const Information = 3;
+	/**
+	 * Reports a hint.
+	 */
+	export const Hint = 4;
+}
+```
+
+```typescript
+/**
+ * Represents a related message and source code location for a diagnostic. This should be
+ * used to point to code locations that cause or related to a diagnostics, e.g when duplicating
+ * a symbol in a scope.
+ */
+export interface DiagnosticRelatedInformation {
+	/**
+	 * The location of this related diagnostic information.
+	 */
+	location: Location;
+
+	/**
+	 * The message of this related diagnostic information.
+	 */
+	message: string;
+}
+```
+
+#### Command
+
+Represents a reference to a command. Provides a title which will be used to represent a command in the UI. Commands are identified by a string identifier. The recommended way to handle commands is to implement their execution on the server side if the client and server provides the corresponding capabilities. Alternatively the tool extension code could handle the command. The protocol currently doesn't specify a set of well-known commands.
+
+```typescript
+interface Command {
+	/**
+	 * Title of the command, like `save`.
+	 */
+	title: string;
+	/**
+	 * The identifier of the actual command handler.
+	 */
+	command: string;
+	/**
+	 * Arguments that the command handler should be
+	 * invoked with.
+	 */
+	arguments?: any[];
+}
+```
+
+#### TextEdit
+
+A textual edit applicable to a text document.
+
+```typescript
+interface TextEdit {
+	/**
+	 * The range of the text document to be manipulated. To insert
+	 * text into a document create a range where start === end.
+	 */
+	range: Range;
+
+	/**
+	 * The string to be inserted. For delete operations use an
+	 * empty string.
+	 */
+	newText: string;
+}
+```
+
+#### TextEdit[]
+
+Complex text manipulations are described with an array of `TextEdit`'s, representing a single change to the document.
+
+All text edits ranges refer to positions in the original document. Text edits ranges must never overlap, that means no part of the original document must be manipulated by more than one edit. However, it is possible that multiple edits have the same start position: multiple inserts, or any number of inserts followed by a single remove or replace edit. If multiple inserts have the same position, the order in the array defines the order in which the inserted strings appear in the resulting text.
+
+#### TextDocumentEdit
+
+Describes textual changes on a single text document. The text document is referred to as a `VersionedTextDocumentIdentifier` to allow clients to check the text document version before an edit is applied. A `TextDocumentEdit` describes all changes on a version Si and after they are applied move the document to version Si+1. So the creator of a `TextDocumentEdit` doesn't need to sort the array or do any kind of ordering. However the edits must be non overlapping.
+
+```typescript
+export interface TextDocumentEdit {
+	/**
+	 * The text document to change.
+	 */
+	textDocument: VersionedTextDocumentIdentifier;
+
+	/**
+	 * The edits to be applied.
+	 */
+	edits: TextEdit[];
+}
+```
+
+### File Resource changes
+
+> New in version 3.13:
+
+File resource changes allow servers to create, rename and delete files and folders via the client. Note that the names talk about files but the operations are supposed to work on files and folders. This is in line with other naming in the Language Server Protocol (see file watchers which can watch files and folders). The corresponding change literals look as follows:
+
+```typescript
+/**
+ * Options to create a file.
+ */
+export interface CreateFileOptions {
+	/**
+	 * Overwrite existing file. Overwrite wins over `ignoreIfExists`
+	 */
+	overwrite?: boolean;
+	/**
+	 * Ignore if exists.
+	 */
+	ignoreIfExists?: boolean;
+}
+
+/**
+ * Create file operation
+ */
+export interface CreateFile {
+	/**
+	 * A create
+	 */
+	kind: 'create';
+	/**
+	 * The resource to create.
+	 */
+	uri: string;
+	/**
+	 * Additional options
+	 */
+	options?: CreateFileOptions;
+}
+
+/**
+ * Rename file options
+ */
+export interface RenameFileOptions {
+	/**
+	 * Overwrite target if existing. Overwrite wins over `ignoreIfExists`
+	 */
+	overwrite?: boolean;
+	/**
+	 * Ignores if target exists.
+	 */
+	ignoreIfExists?: boolean;
+}
+
+/**
+ * Rename file operation
+ */
+export interface RenameFile {
+	/**
+	 * A rename
+	 */
+	kind: 'rename';
+	/**
+	 * The old (existing) location.
+	 */
+	oldUri: string;
+	/**
+	 * The new location.
+	 */
+	newUri: string;
+	/**
+	 * Rename options.
+	 */
+	options?: RenameFileOptions;
+}
+
+/**
+ * Delete file options
+ */
+export interface DeleteFileOptions {
+	/**
+	 * Delete the content recursively if a folder is denoted.
+	 */
+	recursive?: boolean;
+	/**
+	 * Ignore the operation if the file doesn't exist.
+	 */
+	ignoreIfNotExists?: boolean;
+}
+
+/**
+ * Delete file operation
+ */
+export interface DeleteFile {
+	/**
+	 * A delete
+	 */
+	kind: 'delete';
+	/**
+	 * The file to delete.
+	 */
+	uri: string;
+	/**
+	 * Delete options.
+	 */
+	options?: DeleteFileOptions;
+}
+```
+
+#### WorkspaceEdit
+
+A workspace edit represents changes to many resources managed in the workspace. The edit should either provide `changes` or `documentChanges`. If the client can handle versioned document edits and if `documentChange`s are present, the latter are preferred over `changes`.
+
+```typescript
+export interface WorkspaceEdit {
+	/**
+	 * Holds changes to existing resources.
+	 */
+	changes?: { [uri: string]: TextEdit[]; };
+
+	/**
+	 * Depending on the client capability `workspace.workspaceEdit.resourceOperations` document changes
+	 * are either an array of `TextDocumentEdit`s to express changes to n different text documents
+	 * where each text document edit addresses a specific version of a text document. Or it can contain
+	 * above `TextDocumentEdit`s mixed with create, rename and delete file / folder operations.
+	 *
+	 * Whether a client supports versioned document edits is expressed via
+	 * `workspace.workspaceEdit.documentChanges` client capability.
+	 *
+	 * If a client neither supports `documentChanges` nor `workspace.workspaceEdit.resourceOperations` then
+	 * only plain `TextEdit`s using the `changes` property are supported.
+	 */
+	documentChanges?: (TextDocumentEdit[] | (TextDocumentEdit | CreateFile | RenameFile | DeleteFile)[]);
+}
+```
+
+#### TextDocumentIdentifier
+
+Text documents are identified using a URI. On the protocol level, URIs are passed as strings. The corresponding JSON structure looks like this:
+```typescript
+interface TextDocumentIdentifier {
+	/**
+	 * The text document's URI.
+	 */
+	uri: DocumentUri;
+}
+```
+
+#### TextDocumentItem
+
+An item to transfer a text document from the client to the server.
+
+```typescript
+interface TextDocumentItem {
+	/**
+	 * The text document's URI.
+	 */
+	uri: DocumentUri;
+
+	/**
+	 * The text document's language identifier.
+	 */
+	languageId: string;
+
+	/**
+	 * The version number of this document (it will increase after each
+	 * change, including undo/redo).
+	 */
+	version: number;
+
+	/**
+	 * The content of the opened text document.
+	 */
+	text: string;
+}
+```
+
+Text documents have a language identifier to identify a document on the server side when it handles more than one language to avoid re-interpreting the file extension. If a document refers to one of the programming languages listed below it is recommended that clients use those ids.
+
+Language | Identifier
+-------- | ----------
+Windows Bat | `bat`
+BibTeX | `bibtex`
+Clojure | `clojure`
+Coffeescript | `coffeescript`
+C | `c`
+C++ | `cpp`
+C# | `csharp`
+CSS | `css`
+Diff | `diff`
+Dart | `dart`
+Dockerfile | `dockerfile`
+F# | `fsharp`
+Git | `git-commit` and `git-rebase`
+Go | `go`
+Groovy | `groovy`
+Handlebars | `handlebars`
+HTML | `html`
+Ini | `ini`
+Java | `java`
+JavaScript | `javascript`
+JSON | `json`
+LaTeX | `latex`
+Less | `less`
+Lua | `lua`
+Makefile | `makefile`
+Markdown | `markdown`
+Objective-C | `objective-c`
+Objective-C++ | `objective-cpp`
+Perl | `perl` and `perl6`
+PHP | `php`
+Powershell | `powershell`
+Pug | `jade`
+Python | `python`
+R | `r`
+Razor (cshtml) | `razor`
+Ruby | `ruby`
+Rust | `rust`
+Sass | `scss` (syntax using curly brackets), `sass` (indented syntax)
+Scala | `scala`
+ShaderLab | `shaderlab`
+Shell Script (Bash) | `shellscript`
+SQL | `sql`
+Swift | `swift`
+TypeScript | `typescript`
+TeX | `tex`
+Visual Basic | `vb`
+XML | `xml`
+XSL | `xsl`
+YAML | `yaml`
+{: .table .table-bordered .table-responsive}
+
+#### VersionedTextDocumentIdentifier
+
+An identifier to denote a specific version of a text document.
+
+```typescript
+interface VersionedTextDocumentIdentifier extends TextDocumentIdentifier {
+	/**
+	 * The version number of this document. If a versioned text document identifier
+	 * is sent from the server to the client and the file is not open in the editor
+	 * (the server has not received an open notification before) the server can send
+	 * `null` to indicate that the version is known and the content on disk is the
+	 * truth (as speced with document content ownership).
+	 *
+	 * The version number of a document will increase after each change, including
+	 * undo/redo. The number doesn't need to be consecutive.
+	 */
+	version: number | null;
+}
+```
+
+#### TextDocumentPositionParams
+
+Was `TextDocumentPosition` in 1.0 with inlined parameters.
+
+A parameter literal used in requests to pass a text document and a position inside that document.
+
+```typescript
+interface TextDocumentPositionParams {
+	/**
+	 * The text document.
+	 */
+	textDocument: TextDocumentIdentifier;
+
+	/**
+	 * The position inside the text document.
+	 */
+	position: Position;
+}
+```
+
+#### DocumentFilter
+
+A document filter denotes a document through properties like `language`, `scheme` or `pattern`. An example is a filter that applies to TypeScript files on disk. Another example is a filter the applies to JSON files with name `package.json`:
+```typescript
+{ language: 'typescript', scheme: 'file' }
+{ language: 'json', pattern: '**/package.json' }
+```
+
+```typescript
+export interface DocumentFilter {
+	/**
+	 * A language id, like `typescript`.
+	 */
+	language?: string;
+
+	/**
+	 * A Uri [scheme](#Uri.scheme), like `file` or `untitled`.
+	 */
+	scheme?: string;
+
+	/**
+	 * A glob pattern, like `*.{ts,js}`.
+	 *
+	 * Glob patterns can have the following syntax:
+	 * - `*` to match one or more characters in a path segment
+	 * - `?` to match on one character in a path segment
+	 * - `**` to match any number of path segments, including none
+	 * - `{}` to group conditions (e.g. `**​/*.{ts,js}` matches all TypeScript and JavaScript files)
+	 * - `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …)
+	 * - `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`)
+	 */
+	pattern?: string;
+}
+```
+
+A document selector is the combination of one or more document filters.
+
+```typescript
+export type DocumentSelector = DocumentFilter[];
+```
+
+#### MarkupContent
+
+ A `MarkupContent` literal represents a string value which content can be represented in different formats. Currently `plaintext` and `markdown` are supported formats. A `MarkupContent` is usually used in documentation properties of result literals like `CompletionItem` or `SignatureInformation`.
+
+```typescript
+/**
+ * Describes the content type that a client supports in various
+ * result literals like `Hover`, `ParameterInfo` or `CompletionItem`.
+ *
+ * Please note that `MarkupKinds` must not start with a `$`. This kinds
+ * are reserved for internal usage.
+ */
+export namespace MarkupKind {
+	/**
+	 * Plain text is supported as a content format
+	 */
+	export const PlainText: 'plaintext' = 'plaintext';
+
+	/**
+	 * Markdown is supported as a content format
+	 */
+	export const Markdown: 'markdown' = 'markdown';
+}
+export type MarkupKind = 'plaintext' | 'markdown';
+
+/**
+ * A `MarkupContent` literal represents a string value which content is interpreted base on its
+ * kind flag. Currently the protocol supports `plaintext` and `markdown` as markup kinds.
+ *
+ * If the kind is `markdown` then the value can contain fenced code blocks like in GitHub issues.
+ * See https://help.github.com/articles/creating-and-highlighting-code-blocks/#syntax-highlighting
+ *
+ * Here is an example how such a string can be constructed using JavaScript / TypeScript:
+ * ```typescript
+ * let markdown: MarkdownContent = {
+ *  kind: MarkupKind.Markdown,
+ *	value: [
+ *		'# Header',
+ *		'Some text',
+ *		'```typescript',
+ *		'someCode();',
+ *		'```'
+ *	].join('\n')
+ * };
+ * ```
+ *
+ * *Please Note* that clients might sanitize the return markdown. A client could decide to
+ * remove HTML from the markdown to avoid script execution.
+ */
+export interface MarkupContent {
+	/**
+	 * The type of the Markup
+	 */
+	kind: MarkupKind;
+
+	/**
+	 * The content itself
+	 */
+	value: string;
+}
+```
+
+### Actual Protocol
+
+This section documents the actual language server protocol. It uses the following format:
+
+* a header describing the request
+* a _Request_: section describing the format of the request sent. The method is a string identifying the request the params are documented using a TypeScript interface
+* a _Response_: section describing the format of the response. The result item describes the returned data in case of a success. The error.data describes the returned data in case of an error. Please remember that in case of a failure the response already contains an error.code and an error.message field. These fields are only spec'd if the protocol forces the use of certain error codes or messages. In cases where the server can decide on these values freely they aren't listed here.
+* a _Registration Options_ section describing the registration option if the request or notification supports dynamic capability registration.
+
+#### Request, Notification and Response ordering
+
+Responses to requests should be sent in roughly the same order as the requests appear on the server or client side. So for example if a server receives a `textDocument/completion` request and then a `textDocument/signatureHelp` request it will usually first return the response for the `textDocument/completion` and then the response for `textDocument/signatureHelp`.
+
+However, the server may decide to use a parallel execution strategy and may wish to return responses in a different order than the requests were received. The server may do so as long as this reordering doesn't affect the correctness of the responses. For example, reordering the result of `textDocument/completion` and `textDocument/signatureHelp` is allowed, as these each of these requests usually won't affect the output of the other. On the other hand, the server most likely should not reorder `textDocument/definition` and `textDocument/rename` requests, since the executing the latter may affect the result of the former.
+
+#### Server lifetime
+
+The current protocol specification defines that the lifetime of a server is managed by the client (e.g. a tool like VS Code or Emacs). It is up to the client to decide when to start (process-wise) and when to shutdown a server.
+
+#### <a href="#initialize" name="initialize" class="anchor">Initialize Request (:leftwards_arrow_with_hook:)</a>
+
+The initialize request is sent as the first request from the client to the server. If the server receives a request or notification before the `initialize` request it should act as follows:
+
+* For a request the response should be an error with `code: -32002`. The message can be picked by the server.
+* Notifications should be dropped, except for the exit notification. This will allow the exit of a server without an initialize request.
+
+Until the server has responded to the `initialize` request with an `InitializeResult`, the client must not send any additional requests or notifications to the server. In addition the server is not allowed to send any requests or notifications to the client until it has responded with an `InitializeResult`, with the exception that during the `initialize` request the server is allowed to send the notifications `window/showMessage`, `window/logMessage` and `telemetry/event` as well as the `window/showMessageRequest` request to the client.
+
+The `initialize` request may only be sent once.
+
+_Request_:
+* method: 'initialize'
+* params: `InitializeParams` defined as follows:
+
+```typescript
+interface InitializeParams {
+	/**
+	 * The process Id of the parent process that started
+	 * the server. Is null if the process has not been started by another process.
+	 * If the parent process is not alive then the server should exit (see exit notification) its process.
+	 */
+	processId: number | null;
+
+	/**
+	 * The rootPath of the workspace. Is null
+	 * if no folder is open.
+	 *
+	 * @deprecated in favour of rootUri.
+	 */
+	rootPath?: string | null;
+
+	/**
+	 * The rootUri of the workspace. Is null if no
+	 * folder is open. If both `rootPath` and `rootUri` are set
+	 * `rootUri` wins.
+	 */
+	rootUri: DocumentUri | null;
+
+	/**
+	 * User provided initialization options.
+	 */
+	initializationOptions?: any;
+
+	/**
+	 * The capabilities provided by the client (editor or tool)
+	 */
+	capabilities: ClientCapabilities;
+
+	/**
+	 * The initial trace setting. If omitted trace is disabled ('off').
+	 */
+	trace?: 'off' | 'messages' | 'verbose';
+
+	/**
+	 * The workspace folders configured in the client when the server starts.
+	 * This property is only available if the client supports workspace folders.
+	 * It can be `null` if the client supports workspace folders but none are
+	 * configured.
+	 *
+	 * Since 3.6.0
+	 */
+	workspaceFolders?: WorkspaceFolder[] | null;
+}
+```
+Where `ClientCapabilities`, `TextDocumentClientCapabilities` and `WorkspaceClientCapabilities` are defined as follows:
+
+##### `WorkspaceClientCapabilities` define capabilities the editor / tool provides on the workspace:
+
+> New in version 3.13: `ResourceOperationKind` and `FailureHandlingKind` and the client capability `workspace.workspaceEdit.resourceOperations` as well as `workspace.workspaceEdit.failureHandling`.
+
+```typescript
+
+/**
+ * The kind of resource operations supported by the client.
+ */
+export type ResourceOperationKind = 'create' | 'rename' | 'delete';
+
+export namespace ResourceOperationKind {
+
+	/**
+	 * Supports creating new files and folders.
+	 */
+	export const Create: ResourceOperationKind = 'create';
+
+	/**
+	 * Supports renaming existing files and folders.
+	 */
+	export const Rename: ResourceOperationKind = 'rename';
+
+	/**
+	 * Supports deleting existing files and folders.
+	 */
+	export const Delete: ResourceOperationKind = 'delete';
+}
+
+export type FailureHandlingKind = 'abort' | 'transactional' | 'undo' | 'textOnlyTransactional';
+
+export namespace FailureHandlingKind {
+
+	/**
+	 * Applying the workspace change is simply aborted if one of the changes provided
+	 * fails. All operations executed before the failing operation stay executed.
+	 */
+	export const Abort: FailureHandlingKind = 'abort';
+
+	/**
+	 * All operations are executed transactional. That means they either all
+	 * succeed or no changes at all are applied to the workspace.
+	 */
+	export const Transactional: FailureHandlingKind = 'transactional';
+
+
+	/**
+	 * If the workspace edit contains only textual file changes they are executed transactional.
+	 * If resource changes (create, rename or delete file) are part of the change the failure
+	 * handling strategy is abort.
+	 */
+	export const TextOnlyTransactional: FailureHandlingKind = 'textOnlyTransactional';
+
+	/**
+	 * The client tries to undo the operations already executed. But there is no
+	 * guarantee that this is succeeding.
+	 */
+	export const Undo: FailureHandlingKind = 'undo';
+}
+
+/**
+ * Workspace specific client capabilities.
+ */
+export interface WorkspaceClientCapabilities {
+	/**
+	 * The client supports applying batch edits to the workspace by supporting
+	 * the request 'workspace/applyEdit'
+	 */
+	applyEdit?: boolean;
+
+	/**
+	 * Capabilities specific to `WorkspaceEdit`s
+	 */
+	workspaceEdit?: {
+		/**
+		 * The client supports versioned document changes in `WorkspaceEdit`s
+		 */
+		documentChanges?: boolean;
+
+		/**
+		 * The resource operations the client supports. Clients should at least
+		 * support 'create', 'rename' and 'delete' files and folders.
+		 */
+		resourceOperations?: ResourceOperationKind[];
+
+		/**
+		 * The failure handling strategy of a client if applying the workspace edit
+		 * fails.
+		 */
+		failureHandling?: FailureHandlingKind;
+	};
+
+	/**
+	 * Capabilities specific to the `workspace/didChangeConfiguration` notification.
+	 */
+	didChangeConfiguration?: {
+		/**
+		 * Did change configuration notification supports dynamic registration.
+		 */
+		dynamicRegistration?: boolean;
+	};
+
+	/**
+	 * Capabilities specific to the `workspace/didChangeWatchedFiles` notification.
+	 */
+	didChangeWatchedFiles?: {
+		/**
+		 * Did change watched files notification supports dynamic registration. Please note
+		 * that the current protocol doesn't support static configuration for file changes
+		 * from the server side.
+		 */
+		dynamicRegistration?: boolean;
+	};
+
+	/**
+	 * Capabilities specific to the `workspace/symbol` request.
+	 */
+	symbol?: {
+		/**
+		 * Symbol request supports dynamic registration.
+		 */
+		dynamicRegistration?: boolean;
+
+		/**
+		 * Specific capabilities for the `SymbolKind` in the `workspace/symbol` request.
+		 */
+		symbolKind?: {
+			/**
+			 * The symbol kind values the client supports. When this
+			 * property exists the client also guarantees that it will
+			 * handle values outside its set gracefully and falls back
+			 * to a default value when unknown.
+			 *
+			 * If this property is not present the client only supports
+			 * the symbol kinds from `File` to `Array` as defined in
+			 * the initial version of the protocol.
+			 */
+			valueSet?: SymbolKind[];
+		}
+	};
+
+	/**
+	 * Capabilities specific to the `workspace/executeCommand` request.
+	 */
+	executeCommand?: {
+		/**
+		 * Execute command supports dynamic registration.
+		 */
+		dynamicRegistration?: boolean;
+	};
+
+	/**
+	 * The client has support for workspace folders.
+	 *
+	 * Since 3.6.0
+	 */
+	workspaceFolders?: boolean;
+
+	/**
+	 * The client supports `workspace/configuration` requests.
+	 *
+	 * Since 3.6.0
+	 */
+	configuration?: boolean;
+}
+```
+
+##### `TextDocumentClientCapabilities` define capabilities the editor / tool provides on text documents.
+
+```typescript
+/**
+ * Text document specific client capabilities.
+ */
+export interface TextDocumentClientCapabilities {
+
+	synchronization?: {
+		/**
+		 * Whether text document synchronization supports dynamic registration.
+		 */
+		dynamicRegistration?: boolean;
+
+		/**
+		 * The client supports sending will save notifications.
+		 */
+		willSave?: boolean;
+
+		/**
+		 * The client supports sending a will save request and
+		 * waits for a response providing text edits which will
+		 * be applied to the document before it is saved.
+		 */
+		willSaveWaitUntil?: boolean;
+
+		/**
+		 * The client supports did save notifications.
+		 */
+		didSave?: boolean;
+	}
+
+	/**
+	 * Capabilities specific to the `textDocument/completion`
+	 */
+	completion?: {
+		/**
+		 * Whether completion supports dynamic registration.
+		 */
+		dynamicRegistration?: boolean;
+
+		/**
+		 * The client supports the following `CompletionItem` specific
+		 * capabilities.
+		 */
+		completionItem?: {
+			/**
+			 * The client supports snippets as insert text.
+			 *
+			 * A snippet can define tab stops and placeholders with `$1`, `$2`
+			 * and `${3:foo}`. `$0` defines the final tab stop, it defaults to
+			 * the end of the snippet. Placeholders with equal identifiers are linked,
+			 * that is typing in one will update others too.
+			 */
+			snippetSupport?: boolean;
+
+			/**
+			 * The client supports commit characters on a completion item.
+			 */
+			commitCharactersSupport?: boolean
+
+			/**
+			 * The client supports the following content formats for the documentation
+			 * property. The order describes the preferred format of the client.
+			 */
+			documentationFormat?: MarkupKind[];
+
+			/**
+			 * The client supports the deprecated property on a completion item.
+			 */
+			deprecatedSupport?: boolean;
+
+			/**
+			 * The client supports the preselect property on a completion item.
+			 */
+			preselectSupport?: boolean;
+		}
+
+		completionItemKind?: {
+			/**
+			 * The completion item kind values the client supports. When this
+			 * property exists the client also guarantees that it will
+			 * handle values outside its set gracefully and falls back
+			 * to a default value when unknown.
+			 *
+			 * If this property is not present the client only supports
+			 * the completion items kinds from `Text` to `Reference` as defined in
+			 * the initial version of the protocol.
+			 */
+			valueSet?: CompletionItemKind[];
+		},
+
+		/**
+		 * The client supports to send additional context information for a
+		 * `textDocument/completion` request.
+		 */
+		contextSupport?: boolean;
+	};
+
+	/**
+	 * Capabilities specific to the `textDocument/hover`
+	 */
+	hover?: {
+		/**
+		 * Whether hover supports dynamic registration.
+		 */
+		dynamicRegistration?: boolean;
+
+		/**
+		 * The client supports the follow content formats for the content
+		 * property. The order describes the preferred format of the client.
+		 */
+		contentFormat?: MarkupKind[];
+	};
+
+	/**
+	 * Capabilities specific to the `textDocument/signatureHelp`
+	 */
+	signatureHelp?: {
+		/**
+		 * Whether signature help supports dynamic registration.
+		 */
+		dynamicRegistration?: boolean;
+
+		/**
+		 * The client supports the following `SignatureInformation`
+		 * specific properties.
+		 */
+		signatureInformation?: {
+			/**
+			 * The client supports the follow content formats for the documentation
+			 * property. The order describes the preferred format of the client.
+			 */
+			documentationFormat?: MarkupKind[];
+
+			/**
+			 * Client capabilities specific to parameter information.
+			 */
+			parameterInformation?: {
+				/**
+				 * The client supports processing label offsets instead of a
+				 * simple label string.
+				 *
+				 * Since 3.14.0
+				 */
+				labelOffsetSupport?: boolean;
+			}
+		};
+	};
+
+	/**
+	 * Capabilities specific to the `textDocument/references`
+	 */
+	references?: {
+		/**
+		 * Whether references supports dynamic registration.
+		 */
+		dynamicRegistration?: boolean;
+	};
+
+	/**
+	 * Capabilities specific to the `textDocument/documentHighlight`
+	 */
+	documentHighlight?: {
+		/**
+		 * Whether document highlight supports dynamic registration.
+		 */
+		dynamicRegistration?: boolean;
+	};
+
+	/**
+	 * Capabilities specific to the `textDocument/documentSymbol`
+	 */
+	documentSymbol?: {
+		/**
+		 * Whether document symbol supports dynamic registration.
+		 */
+		dynamicRegistration?: boolean;
+
+		/**
+		 * Specific capabilities for the `SymbolKind`.
+		 */
+		symbolKind?: {
+			/**
+			 * The symbol kind values the client supports. When this
+			 * property exists the client also guarantees that it will
+			 * handle values outside its set gracefully and falls back
+			 * to a default value when unknown.
+			 *
+			 * If this property is not present the client only supports
+			 * the symbol kinds from `File` to `Array` as defined in
+			 * the initial version of the protocol.
+			 */
+			valueSet?: SymbolKind[];
+		}
+
+		/**
+		 * The client supports hierarchical document symbols.
+		 */
+		hierarchicalDocumentSymbolSupport?: boolean;
+	};
+
+	/**
+	 * Capabilities specific to the `textDocument/formatting`
+	 */
+	formatting?: {
+		/**
+		 * Whether formatting supports dynamic registration.
+		 */
+		dynamicRegistration?: boolean;
+	};
+
+	/**
+	 * Capabilities specific to the `textDocument/rangeFormatting`
+	 */
+	rangeFormatting?: {
+		/**
+		 * Whether range formatting supports dynamic registration.
+		 */
+		dynamicRegistration?: boolean;
+	};
+
+	/**
+	 * Capabilities specific to the `textDocument/onTypeFormatting`
+	 */
+	onTypeFormatting?: {
+		/**
+		 * Whether on type formatting supports dynamic registration.
+		 */
+		dynamicRegistration?: boolean;
+	};
+
+	/**
+		* Capabilities specific to the `textDocument/declaration`
+		*/
+	declaration?: {
+		/**
+		 * Whether declaration supports dynamic registration. If this is set to `true`
+		 * the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`
+		 * return value for the corresponding server capability as well.
+		 */
+		dynamicRegistration?: boolean;
+
+		/**
+		 * The client supports additional metadata in the form of declaration links.
+		 *
+		 * Since 3.14.0
+		 */
+		linkSupport?: boolean;
+	};
+
+	/**
+	 * Capabilities specific to the `textDocument/definition`.
+	 *
+	 * Since 3.14.0
+	 */
+	definition?: {
+		/**
+		 * Whether definition supports dynamic registration.
+		 */
+		dynamicRegistration?: boolean;
+
+		/**
+		 * The client supports additional metadata in the form of definition links.
+		 */
+		linkSupport?: boolean;
+	};
+
+	/**
+	 * Capabilities specific to the `textDocument/typeDefinition`
+	 *
+	 * Since 3.6.0
+	 */
+	typeDefinition?: {
+		/**
+		 * Whether typeDefinition supports dynamic registration. If this is set to `true`
+		 * the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`
+		 * return value for the corresponding server capability as well.
+		 */
+		dynamicRegistration?: boolean;
+
+		/**
+		 * The client supports additional metadata in the form of definition links.
+		 *
+		 * Since 3.14.0
+		 */
+		linkSupport?: boolean;
+	};
+
+	/**
+	 * Capabilities specific to the `textDocument/implementation`.
+	 *
+	 * Since 3.6.0
+	 */
+	implementation?: {
+		/**
+		 * Whether implementation supports dynamic registration. If this is set to `true`
+		 * the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`
+		 * return value for the corresponding server capability as well.
+		 */
+		dynamicRegistration?: boolean;
+
+		/**
+		 * The client supports additional metadata in the form of definition links.
+		 *
+		 * Since 3.14.0
+		 */
+		linkSupport?: boolean;
+	};
+
+	/**
+	 * Capabilities specific to the `textDocument/codeAction`
+	 */
+	codeAction?: {
+		/**
+		 * Whether code action supports dynamic registration.
+		 */
+		dynamicRegistration?: boolean;
+		/**
+		 * The client support code action literals as a valid
+		 * response of the `textDocument/codeAction` request.
+		 *
+		 * Since 3.8.0
+		 */
+		codeActionLiteralSupport?: {
+			/**
+			 * The code action kind is support with the following value
+			 * set.
+			 */
+			codeActionKind: {
+
+				/**
+				 * The code action kind values the client supports. When this
+				 * property exists the client also guarantees that it will
+				 * handle values outside its set gracefully and falls back
+				 * to a default value when unknown.
+				 */
+				valueSet: CodeActionKind[];
+			};
+		};
+	};
+
+	/**
+	 * Capabilities specific to the `textDocument/codeLens`
+	 */
+	codeLens?: {
+		/**
+		 * Whether code lens supports dynamic registration.
+		 */
+		dynamicRegistration?: boolean;
+	};
+
+	/**
+	 * Capabilities specific to the `textDocument/documentLink`
+	 */
+	documentLink?: {
+		/**
+		 * Whether document link supports dynamic registration.
+		 */
+		dynamicRegistration?: boolean;
+	};
+
+	/**
+	 * Capabilities specific to the `textDocument/documentColor` and the
+	 * `textDocument/colorPresentation` request.
+	 *
+	 * Since 3.6.0
+	 */
+	colorProvider?: {
+		/**
+		 * Whether colorProvider supports dynamic registration. If this is set to `true`
+		 * the client supports the new `(ColorProviderOptions & TextDocumentRegistrationOptions & StaticRegistrationOptions)`
+		 * return value for the corresponding server capability as well.
+		 */
+		dynamicRegistration?: boolean;
+	}
+
+	/**
+	 * Capabilities specific to the `textDocument/rename`
+	 */
+	rename?: {
+		/**
+		 * Whether rename supports dynamic registration.
+		 */
+		dynamicRegistration?: boolean;
+		/**
+		 * The client supports testing for validity of rename operations
+		 * before execution.
+		 */
+		prepareSupport?: boolean;
+	};
+
+	/**
+	 * Capabilities specific to `textDocument/publishDiagnostics`.
+	 */
+	publishDiagnostics?: {
+		/**
+		 * Whether the clients accepts diagnostics with related information.
+		 */
+		relatedInformation?: boolean;
+	};
+	/**
+	 * Capabilities specific to `textDocument/foldingRange` requests.
+	 *
+	 * Since 3.10.0
+	 */
+	foldingRange?: {
+		/**
+		 * Whether implementation supports dynamic registration for folding range providers. If this is set to `true`
+		 * the client supports the new `(FoldingRangeProviderOptions & TextDocumentRegistrationOptions & StaticRegistrationOptions)`
+		 * return value for the corresponding server capability as well.
+		 */
+		dynamicRegistration?: boolean;
+		/**
+		 * The maximum number of folding ranges that the client prefers to receive per document. The value serves as a
+		 * hint, servers are free to follow the limit.
+		 */
+		rangeLimit?: number;
+		/**
+		 * If set, the client signals that it only supports folding complete lines. If set, client will
+		 * ignore specified `startCharacter` and `endCharacter` properties in a FoldingRange.
+		 */
+		lineFoldingOnly?: boolean;
+	};
+}
+```
+
+`ClientCapabilities` now define capabilities for dynamic registration, workspace and text document features the client supports. The `experimental` can be used to pass experimental capabilities under development. For future compatibility a `ClientCapabilities` object literal can have more properties set than currently defined. Servers receiving a `ClientCapabilities` object literal with unknown properties should ignore these properties. A missing property should be interpreted as an absence of the capability. If a missing property normally defines sub properties, all missing sub properties should be interpreted as an absence of the corresponding capability.
+
+Client capabilities got introduced with version 3.0 of the protocol. They therefore only describe capabilities that got introduced in 3.x or later. Capabilities that existed in the 2.x version of the protocol are still mandatory for clients. Clients cannot opt out of providing them. So even if a client omits the `ClientCapabilities.textDocument.synchronization` it is still required that the client provides text document synchronization (e.g. open, changed and close notifications).
+
+```typescript
+interface ClientCapabilities {
+	/**
+	 * Workspace specific client capabilities.
+	 */
+	workspace?: WorkspaceClientCapabilities;
+
+	/**
+	 * Text document specific client capabilities.
+	 */
+	textDocument?: TextDocumentClientCapabilities;
+
+	/**
+	 * Experimental client capabilities.
+	 */
+	experimental?: any;
+}
+```
+
+_Response_:
+* result: `InitializeResult` defined as follows:
+
+```typescript
+interface InitializeResult {
+	/**
+	 * The capabilities the language server provides.
+	 */
+	capabilities: ServerCapabilities;
+}
+```
+* error.code:
+
+```typescript
+/**
+ * Known error codes for an `InitializeError`;
+ */
+export namespace InitializeError {
+	/**
+	 * If the protocol version provided by the client can't be handled by the server.
+	 * @deprecated This initialize error got replaced by client capabilities. There is
+	 * no version handshake in version 3.0x
+	 */
+	export const unknownProtocolVersion: number = 1;
+}
+```
+
+* error.data:
+
+```typescript
+interface InitializeError {
+	/**
+	 * Indicates whether the client execute the following retry logic:
+	 * (1) show the message provided by the ResponseError to the user
+	 * (2) user selects retry or cancel
+	 * (3) if user selected retry the initialize method is sent again.
+	 */
+	retry: boolean;
+}
+```
+
+The server can signal the following capabilities:
+
+```typescript
+/**
+ * Defines how the host (editor) should sync document changes to the language server.
+ */
+export namespace TextDocumentSyncKind {
+	/**
+	 * Documents should not be synced at all.
+	 */
+	export const None = 0;
+
+	/**
+	 * Documents are synced by always sending the full content
+	 * of the document.
+	 */
+	export const Full = 1;
+
+	/**
+	 * Documents are synced by sending the full content on open.
+	 * After that only incremental updates to the document are
+	 * send.
+	 */
+	export const Incremental = 2;
+}
+
+/**
+ * Completion options.
+ */
+export interface CompletionOptions {
+	/**
+	 * The server provides support to resolve additional
+	 * information for a completion item.
+	 */
+	resolveProvider?: boolean;
+
+	/**
+	 * The characters that trigger completion automatically.
+	 */
+	triggerCharacters?: string[];
+}
+/**
+ * Signature help options.
+ */
+export interface SignatureHelpOptions {
+	/**
+	 * The characters that trigger signature help
+	 * automatically.
+	 */
+	triggerCharacters?: string[];
+}
+
+/**
+ * Code Action options.
+ */
+export interface CodeActionOptions {
+	/**
+	 * CodeActionKinds that this server may return.
+	 *
+	 * The list of kinds may be generic, such as `CodeActionKind.Refactor`, or the server
+	 * may list out every specific kind they provide.
+	 */
+	codeActionKinds?: CodeActionKind[];
+}
+
+/**
+ * Code Lens options.
+ */
+export interface CodeLensOptions {
+	/**
+	 * Code lens has a resolve provider as well.
+	 */
+	resolveProvider?: boolean;
+}
+
+/**
+ * Format document on type options.
+ */
+export interface DocumentOnTypeFormattingOptions {
+	/**
+	 * A character on which formatting should be triggered, like `}`.
+	 */
+	firstTriggerCharacter: string;
+
+	/**
+	 * More trigger characters.
+	 */
+	moreTriggerCharacter?: string[];
+}
+
+/**
+ * Rename options
+ */
+export interface RenameOptions {
+	/**
+	 * Renames should be checked and tested before being executed.
+	 */
+	prepareProvider?: boolean;
+}
+
+/**
+ * Document link options.
+ */
+export interface DocumentLinkOptions {
+	/**
+	 * Document links have a resolve provider as well.
+	 */
+	resolveProvider?: boolean;
+}
+
+/**
+ * Execute command options.
+ */
+export interface ExecuteCommandOptions {
+	/**
+	 * The commands to be executed on the server
+	 */
+	commands: string[]
+}
+
+/**
+ * Save options.
+ */
+export interface SaveOptions {
+	/**
+	 * The client is supposed to include the content on save.
+	 */
+	includeText?: boolean;
+}
+
+/**
+ * Color provider options.
+ */
+export interface ColorProviderOptions {
+}
+
+/**
+ * Folding range provider options.
+ */
+export interface FoldingRangeProviderOptions {
+}
+
+export interface TextDocumentSyncOptions {
+	/**
+	 * Open and close notifications are sent to the server.
+	 */
+	openClose?: boolean;
+	/**
+	 * Change notifications are sent to the server. See TextDocumentSyncKind.None, TextDocumentSyncKind.Full
+	 * and TextDocumentSyncKind.Incremental. If omitted it defaults to TextDocumentSyncKind.None.
+	 */
+	change?: number;
+	/**
+	 * Will save notifications are sent to the server.
+	 */
+	willSave?: boolean;
+	/**
+	 * Will save wait until requests are sent to the server.
+	 */
+	willSaveWaitUntil?: boolean;
+	/**
+	 * Save notifications are sent to the server.
+	 */
+	save?: SaveOptions;
+}
+
+/**
+ * Static registration options to be returned in the initialize request.
+ */
+interface StaticRegistrationOptions {
+	/**
+	 * The id used to register the request. The id can be used to deregister
+	 * the request again. See also Registration#id.
+	 */
+	id?: string;
+}
+
+interface ServerCapabilities {
+	/**
+	 * Defines how text documents are synced. Is either a detailed structure defining each notification or
+	 * for backwards compatibility the TextDocumentSyncKind number. If omitted it defaults to `TextDocumentSyncKind.None`.
+	 */
+	textDocumentSync?: TextDocumentSyncOptions | number;
+	/**
+	 * The server provides hover support.
+	 */
+	hoverProvider?: boolean;
+	/**
+	 * The server provides completion support.
+	 */
+	completionProvider?: CompletionOptions;
+	/**
+	 * The server provides signature help support.
+	 */
+	signatureHelpProvider?: SignatureHelpOptions;
+	/**
+	 * The server provides goto definition support.
+	 */
+	definitionProvider?: boolean;
+	/**
+	 * The server provides Goto Type Definition support.
+	 *
+	 * Since 3.6.0
+	 */
+	typeDefinitionProvider?: boolean | (TextDocumentRegistrationOptions & StaticRegistrationOptions);
+	/**
+	 * The server provides Goto Implementation support.
+	 *
+	 * Since 3.6.0
+	 */
+	implementationProvider?: boolean | (TextDocumentRegistrationOptions & StaticRegistrationOptions);
+	/**
+	 * The server provides find references support.
+	 */
+	referencesProvider?: boolean;
+	/**
+	 * The server provides document highlight support.
+	 */
+	documentHighlightProvider?: boolean;
+	/**
+	 * The server provides document symbol support.
+	 */
+	documentSymbolProvider?: boolean;
+	/**
+	 * The server provides workspace symbol support.
+	 */
+	workspaceSymbolProvider?: boolean;
+	/**
+	 * The server provides code actions. The `CodeActionOptions` return type is only
+	 * valid if the client signals code action literal support via the property
+	 * `textDocument.codeAction.codeActionLiteralSupport`.
+	 */
+	codeActionProvider?: boolean | CodeActionOptions;
+	/**
+	 * The server provides code lens.
+	 */
+	codeLensProvider?: CodeLensOptions;
+	/**
+	 * The server provides document formatting.
+	 */
+	documentFormattingProvider?: boolean;
+	/**
+	 * The server provides document range formatting.
+	 */
+	documentRangeFormattingProvider?: boolean;
+	/**
+	 * The server provides document formatting on typing.
+	 */
+	documentOnTypeFormattingProvider?: DocumentOnTypeFormattingOptions;
+	/**
+	 * The server provides rename support. RenameOptions may only be
+	 * specified if the client states that it supports
+	 * `prepareSupport` in its initial `initialize` request.
+	 */
+	renameProvider?: boolean | RenameOptions;
+	/**
+	 * The server provides document link support.
+	 */
+	documentLinkProvider?: DocumentLinkOptions;
+	/**
+	 * The server provides color provider support.
+	 *
+	 * Since 3.6.0
+	 */
+	colorProvider?: boolean | ColorProviderOptions | (ColorProviderOptions & TextDocumentRegistrationOptions & StaticRegistrationOptions);
+	/**
+	 * The server provides folding provider support.
+	 *
+	 * Since 3.10.0
+	 */
+	foldingRangeProvider?: boolean | FoldingRangeProviderOptions | (FoldingRangeProviderOptions & TextDocumentRegistrationOptions & StaticRegistrationOptions);
+	/**
+	 * The server provides execute command support.
+	 */
+	executeCommandProvider?: ExecuteCommandOptions;
+	/**
+	 * Workspace specific server capabilities
+	 */
+	workspace?: {
+		/**
+		 * The server supports workspace folder.
+		 *
+		 * Since 3.6.0
+		 */
+		workspaceFolders?: {
+			/**
+			* The server has support for workspace folders
+			*/
+			supported?: boolean;
+			/**
+			* Whether the server wants to receive workspace folder
+			* change notifications.
+			*
+			* If a strings is provided the string is treated as a ID
+			* under which the notification is registered on the client
+			* side. The ID can be used to unregister for these events
+			* using the `client/unregisterCapability` request.
+			*/
+			changeNotifications?: string | boolean;
+		}
+	}
+	/**
+	 * Experimental server capabilities.
+	 */
+	experimental?: any;
+}
+```
+
+#### <a href="#initialized" name="initialized" class="anchor">Initialized Notification (:arrow_right:)</a>
+
+The initialized notification is sent from the client to the server after the client received the result of the `initialize` request but before the client is sending any other request or notification to the server. The server can use the `initialized` notification for example to dynamically register capabilities. The `initialized` notification may only be sent once.
+
+_Notification_:
+* method: 'initialized'
+* params: `InitializedParams` defined as follows:
+
+```typescript
+interface InitializedParams {
+}
+```
+
+#### <a href="#shutdown" name="shutdown" class="anchor">Shutdown Request (:leftwards_arrow_with_hook:)</a>
+
+The shutdown request is sent from the client to the server. It asks the server to shut down, but to not exit (otherwise the response might not be delivered correctly to the client). There is a separate exit notification that asks the server to exit.
+
+_Request_:
+* method: 'shutdown'
+* params: void
+
+_Response_:
+* result: null
+* error: code and message set in case an exception happens during shutdown request.
+
+#### <a href="#exit" name="exit" class="anchor">Exit Notification (:arrow_right:)</a>
+
+A notification to ask the server to exit its process.
+The server should exit with `success` code 0 if the shutdown request has been received before; otherwise with `error` code 1.
+
+_Notification_:
+* method: 'exit'
+* params: void
+
+#### <a href="#window_showMessage" name="window_showMessage" class="anchor">ShowMessage Notification (:arrow_left:)</a>
+
+The show message notification is sent from a server to a client to ask the client to display a particular message in the user interface.
+
+_Notification_:
+* method: 'window/showMessage'
+* params: `ShowMessageParams` defined as follows:
+
+```typescript
+interface ShowMessageParams {
+	/**
+	 * The message type. See {@link MessageType}.
+	 */
+	type: number;
+
+	/**
+	 * The actual message.
+	 */
+	message: string;
+}
+```
+
+Where the type is defined as follows:
+
+```typescript
+export namespace MessageType {
+	/**
+	 * An error message.
+	 */
+	export const Error = 1;
+	/**
+	 * A warning message.
+	 */
+	export const Warning = 2;
+	/**
+	 * An information message.
+	 */
+	export const Info = 3;
+	/**
+	 * A log message.
+	 */
+	export const Log = 4;
+}
+```
+
+#### <a href="#window_showMessageRequest" name="window_showMessageRequest" class="anchor">ShowMessage Request (:arrow_right_hook:)</a>
+
+The show message request is sent from a server to a client to ask the client to display a particular message in the user interface. In addition to the show message notification the request allows to pass actions and to wait for an answer from the client.
+
+_Request_:
+* method: 'window/showMessageRequest'
+* params: `ShowMessageRequestParams` defined as follows:
+
+_Response_:
+* result: the selected `MessageActionItem` \| `null` if none got selected.
+* error: code and message set in case an exception happens during showing a message.
+
+```typescript
+interface ShowMessageRequestParams {
+	/**
+	 * The message type. See {@link MessageType}
+	 */
+	type: number;
+
+	/**
+	 * The actual message
+	 */
+	message: string;
+
+	/**
+	 * The message action items to present.
+	 */
+	actions?: MessageActionItem[];
+}
+```
+
+Where the `MessageActionItem` is defined as follows:
+
+```typescript
+interface MessageActionItem {
+	/**
+	 * A short title like 'Retry', 'Open Log' etc.
+	 */
+	title: string;
+}
+```
+
+#### <a href="#window_logMessage" name="window_logMessage" class="anchor">LogMessage Notification (:arrow_left:)</a>
+
+The log message notification is sent from the server to the client to ask the client to log a particular message.
+
+_Notification_:
+* method: 'window/logMessage'
+* params: `LogMessageParams` defined as follows:
+
+```typescript
+interface LogMessageParams {
+	/**
+	 * The message type. See {@link MessageType}
+	 */
+	type: number;
+
+	/**
+	 * The actual message
+	 */
+	message: string;
+}
+```
+
+Where type is defined as above.
+
+#### <a href="#telemetry_event" name="telemetry_event" class="anchor">Telemetry Notification (:arrow_left:)</a>
+
+The telemetry notification is sent from the server to the client to ask the client to log a telemetry event.
+
+_Notification_:
+* method: 'telemetry/event'
+* params: 'any'
+
+#### <a href="#client_registerCapability" name="client_registerCapability" class="anchor">Register Capability (:arrow_right_hook:)</a>
+
+The `client/registerCapability` request is sent from the server to the client to register for a new capability on the client side. Not all clients need to support dynamic capability registration. A client opts in via the `dynamicRegistration` property on the specific client capabilities. A client can even provide dynamic registration for capability A but not for capability B (see `TextDocumentClientCapabilities` as an example).
+
+_Request_:
+* method: 'client/registerCapability'
+* params: `RegistrationParams`
+
+Where `RegistrationParams` are defined as follows:
+
+```typescript
+/**
+ * General parameters to register for a capability.
+ */
+export interface Registration {
+	/**
+	 * The id used to register the request. The id can be used to deregister
+	 * the request again.
+	 */
+	id: string;
+
+	/**
+	 * The method / capability to register for.
+	 */
+	method: string;
+
+	/**
+	 * Options necessary for the registration.
+	 */
+	registerOptions?: any;
+}
+
+export interface RegistrationParams {
+	registrations: Registration[];
+}
+```
+
+Since most of the registration options require to specify a document selector there is a base interface that can be used.
+
+```typescript
+export interface TextDocumentRegistrationOptions {
+	/**
+	 * A document selector to identify the scope of the registration. If set to null
+	 * the document selector provided on the client side will be used.
+	 */
+	documentSelector: DocumentSelector | null;
+}
+```
+
+An example JSON RPC message to register dynamically for the `textDocument/willSaveWaitUntil` feature on the client side is as follows (only details shown):
+
+```json
+{
+	"method": "client/registerCapability",
+	"params": {
+		"registrations": [
+			{
+				"id": "79eee87c-c409-4664-8102-e03263673f6f",
+				"method": "textDocument/willSaveWaitUntil",
+				"registerOptions": {
+					"documentSelector": [
+						{ "language": "javascript" }
+					]
+				}
+			}
+		]
+	}
+}
+```
+
+This message is sent from the server to the client and after the client has successfully executed the request further `textDocument/willSaveWaitUntil` requests for JavaScript text documents are sent from the client to the server.
+
+_Response_:
+* result: void.
+* error: code and message set in case an exception happens during the request.
+
+#### <a href="#client_unregisterCapability" name="client_unregisterCapability" class="anchor">Unregister Capability (:arrow_right_hook:)</a>
+
+The `client/unregisterCapability` request is sent from the server to the client to unregister a previously registered capability.
+
+_Request_:
+* method: 'client/unregisterCapability'
+* params: `UnregistrationParams`
+
+Where `UnregistrationParams` are defined as follows:
+
+```typescript
+/**
+ * General parameters to unregister a capability.
+ */
+export interface Unregistration {
+	/**
+	 * The id used to unregister the request or notification. Usually an id
+	 * provided during the register request.
+	 */
+	id: string;
+
+	/**
+	 * The method / capability to unregister for.
+	 */
+	method: string;
+}
+
+export interface UnregistrationParams {
+	unregisterations: Unregistration[];
+}
+```
+
+An example JSON RPC message to unregister the above registered `textDocument/willSaveWaitUntil` feature looks like this:
+
+```json
+{
+	"method": "client/unregisterCapability",
+	"params": {
+		"unregisterations": [
+			{
+				"id": "79eee87c-c409-4664-8102-e03263673f6f",
+				"method": "textDocument/willSaveWaitUntil"
+			}
+		]
+	}
+}
+```
+_Response_:
+* result: void.
+* error: code and message set in case an exception happens during the request.
+
+##### <a href="#workspace_workspaceFolders" name="workspace_workspaceFolders" class="anchor">Workspace folders request (:arrow_right_hook:)</a>
+
+> *Since version 3.6.0*
+
+Many tools support more than one root folder per workspace. Examples for this are VS Code's multi-root support, Atom's project folder support or Sublime's project support. If a client workspace consists of multiple roots then a server typically needs to know about this. The protocol up to now assumes one root folder which is announced to the server by the `rootUri` property of the `InitializeParams`. If the client supports workspace folders and announces them via the corresponding `workspaceFolders` client capability, the `InitializeParams` contain an additional property `workspaceFolders` with the configured workspace folders when the server starts.
+
+The `workspace/workspaceFolders` request is sent from the server to the client to fetch the current open list of workspace folders. Returns `null` in the response if only a single file is open in the tool. Returns an empty array if a workspace is open but no folders are configured.
+
+_Request_:
+
+* method: 'workspace/workspaceFolders'
+* params: none
+
+_Response_:
+
+* result: `WorkspaceFolder[] | null` defined as follows:
+
+```typescript
+export interface WorkspaceFolder {
+	/**
+	 * The associated URI for this workspace folder.
+	 */
+	uri: string;
+
+	/**
+	 * The name of the workspace folder. Defaults to the
+	 * uri's basename.
+	 */
+	name: string;
+}
+```
+* error: code and message set in case an exception happens during the 'workspace/workspaceFolders' request
+
+##### <a href="#workspace_didChangeWorkspaceFolders" name="workspace_didChangeWorkspaceFolders" class="anchor">DidChangeWorkspaceFolders Notification (:arrow_right:)</a>
+
+> *Since version 3.6.0*
+
+The `workspace/didChangeWorkspaceFolders` notification is sent from the client to the server to inform the server about workspace folder configuration changes. The notification is sent by default if both _ServerCapabilities/workspace/workspaceFolders_ and _ClientCapabilities/workspace/workspaceFolders_ are true; or if the server has registered itself to receive this notification. To register for the `workspace/didChangeWorkspaceFolders` send a `client/registerCapability` request from the server to the client. The registration parameter must have a `registrations` item of the following form, where `id` is a unique id used to unregister the capability (the example uses a UUID):
+```ts
+{
+	id: "28c6150c-bd7b-11e7-abc4-cec278b6b50a",
+	method: "workspace/didChangeWorkspaceFolders"
+}
+```
+
+_Notification_:
+
+* method: 'workspace/didChangeWorkspaceFolders'
+* params: `DidChangeWorkspaceFoldersParams` defined as follows:
+
+```typescript
+export interface DidChangeWorkspaceFoldersParams {
+	/**
+	 * The actual workspace folder change event.
+	 */
+	event: WorkspaceFoldersChangeEvent;
+}
+
+/**
+ * The workspace folder change event.
+ */
+export interface WorkspaceFoldersChangeEvent {
+	/**
+	 * The array of added workspace folders
+	 */
+	added: WorkspaceFolder[];
+
+	/**
+	 * The array of the removed workspace folders
+	 */
+	removed: WorkspaceFolder[];
+}
+```
+
+#### <a href="#workspace_didChangeConfiguration" name="workspace_didChangeConfiguration" class="anchor">DidChangeConfiguration Notification (:arrow_right:)</a>
+
+A notification sent from the client to the server to signal the change of configuration settings.
+
+_Notification_:
+* method: 'workspace/didChangeConfiguration',
+* params: `DidChangeConfigurationParams` defined as follows:
+
+```typescript
+interface DidChangeConfigurationParams {
+	/**
+	 * The actual changed settings
+	 */
+	settings: any;
+}
+```
+
+#### <a href="#workspace_configuration" name="workspace_configuration" class="anchor">Configuration Request (:arrow_right_hook:)</a>
+
+> *Since version 3.6.0*
+
+The `workspace/configuration` request is sent from the server to the client to fetch configuration settings from the client. The request can fetch several configuration settings in one roundtrip. The order of the returned configuration settings correspond to the order of the passed `ConfigurationItems` (e.g. the first item in the response is the result for the first configuration item in the params).
+
+A `ConfigurationItem` consists of the configuration section to ask for and an additional scope URI. The configuration section ask for is defined by the server and doesn't necessarily need to correspond to the configuration store used be the client. So a server might ask for a configuration `cpp.formatterOptions` but the client stores the configuration in a XML store layout differently. It is up to the client to do the necessary conversion. If a scope URI is provided the client should return the setting scoped to the provided resource. If the client for example uses [EditorConfig](http://editorconfig.org/) to manage its settings the configuration should be returned for the passed resource URI. If the client can't provide a configuration setting for a given scope then `null` need to be present in the returned array.
+
+_Request_:
+
+* method: 'workspace/configuration'
+* params: `ConfigurationParams` defined as follows
+
+```typescript
+export interface ConfigurationParams {
+	items: ConfigurationItem[];
+}
+
+export interface ConfigurationItem {
+	/**
+	 * The scope to get the configuration section for.
+	 */
+	scopeUri?: string;
+
+	/**
+	 * The configuration section asked for.
+	 */
+	section?: string;
+}
+```
+
+_Response_:
+* result: any[]
+* error: code and message set in case an exception happens during the 'workspace/configuration' request
+
+#### <a href="#workspace_didChangeWatchedFiles" name="workspace_didChangeWatchedFiles" class="anchor">DidChangeWatchedFiles Notification (:arrow_right:)</a>
+
+The watched files notification is sent from the client to the server when the client detects changes to files watched by the language client. It is recommended that servers register for these file events using the registration mechanism. In former implementations clients pushed file events without the server actively asking for it.
+
+Servers are allowed to run their own file watching mechanism and not rely on clients to provide file events. However this is not recommended due to the following reasons:
+
+- to our experience getting file watching on disk right is challenging, especially if it needs to be supported across multiple OSes.
+- file watching is not for free especially if the implementation uses some sort of polling and keeps a file tree in memory to compare time stamps (as for example some node modules do)
+- a client usually starts more than one server. If every server runs its own file watching it can become a CPU or memory problem.
+- in general there are more server than client implementations. So this problem is better solved on the client side.
+
+
+_Notification_:
+* method: 'workspace/didChangeWatchedFiles'
+* params: `DidChangeWatchedFilesParams` defined as follows:
+
+```typescript
+interface DidChangeWatchedFilesParams {
+	/**
+	 * The actual file events.
+	 */
+	changes: FileEvent[];
+}
+```
+
+Where FileEvents are described as follows:
+
+```typescript
+/**
+ * An event describing a file change.
+ */
+interface FileEvent {
+	/**
+	 * The file's URI.
+	 */
+	uri: DocumentUri;
+	/**
+	 * The change type.
+	 */
+	type: number;
+}
+
+/**
+ * The file event type.
+ */
+export namespace FileChangeType {
+	/**
+	 * The file got created.
+	 */
+	export const Created = 1;
+	/**
+	 * The file got changed.
+	 */
+	export const Changed = 2;
+	/**
+	 * The file got deleted.
+	 */
+	export const Deleted = 3;
+}
+```
+
+_Registration Options_: `DidChangeWatchedFilesRegistrationOptions` defined as follows
+
+```typescript
+/**
+ * Describe options to be used when registering for text document change events.
+ */
+export interface DidChangeWatchedFilesRegistrationOptions {
+	/**
+	 * The watchers to register.
+	 */
+	watchers: FileSystemWatcher[];
+}
+
+export interface FileSystemWatcher {
+	/**
+	 * The  glob pattern to watch.
+	 *
+	 * Glob patterns can have the following syntax:
+	 * - `*` to match one or more characters in a path segment
+	 * - `?` to match on one character in a path segment
+	 * - `**` to match any number of path segments, including none
+	 * - `{}` to group conditions (e.g. `**​/*.{ts,js}` matches all TypeScript and JavaScript files)
+	 * - `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …)
+	 * - `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`)
+	 */
+	globPattern: string;
+
+	/**
+	 * The kind of events of interest. If omitted it defaults
+	 * to WatchKind.Create | WatchKind.Change | WatchKind.Delete
+	 * which is 7.
+	 */
+	kind?: number;
+}
+
+export namespace WatchKind {
+	/**
+	 * Interested in create events.
+	 */
+	export const Create = 1;
+
+	/**
+	 * Interested in change events
+	 */
+	export const Change = 2;
+
+	/**
+	 * Interested in delete events
+	 */
+	export const Delete = 4;
+}
+```
+
+#### <a href="#workspace_symbol" name="workspace_symbol" class="anchor">Workspace Symbols Request (:leftwards_arrow_with_hook:)</a>
+
+The workspace symbol request is sent from the client to the server to list project-wide symbols matching the query string.
+
+_Request_:
+* method: 'workspace/symbol'
+* params: `WorkspaceSymbolParams` defined as follows:
+
+```typescript
+/**
+ * The parameters of a Workspace Symbol Request.
+ */
+interface WorkspaceSymbolParams {
+	/**
+	 * A non-empty query string
+	 */
+	query: string;
+}
+```
+
+_Response_:
+* result: `SymbolInformation[]` \| `null` as defined above.
+* error: code and message set in case an exception happens during the workspace symbol request.
+
+_Registration Options_: void
+
+
+#### <a href="#workspace_executeCommand" name="workspace_executeCommand" class="anchor">Execute a command (:leftwards_arrow_with_hook:)</a>
+
+The `workspace/executeCommand` request is sent from the client to the server to trigger command execution on the server. In most cases
+the server creates a `WorkspaceEdit` structure and applies the changes to the workspace using the request `workspace/applyEdit` which is
+sent from the server to the client.
+
+_Request:_
+* method: 'workspace/executeCommand'
+* params: `ExecuteCommandParams` defined as follows:
+
+```typescript
+export interface ExecuteCommandParams {
+
+	/**
+	 * The identifier of the actual command handler.
+	 */
+	command: string;
+	/**
+	 * Arguments that the command should be invoked with.
+	 */
+	arguments?: any[];
+}
+```
+
+The arguments are typically specified when a command is returned from the server to the client. Example requests that return a command are `textDocument/codeAction` or `textDocument/codeLens`.
+
+_Response_:
+* result: `any` \| `null`
+* error: code and message set in case an exception happens during the request.
+
+_Registration Options_: `ExecuteCommandRegistrationOptions` defined as follows:
+
+```typescript
+/**
+ * Execute command registration options.
+ */
+export interface ExecuteCommandRegistrationOptions {
+	/**
+	 * The commands to be executed on the server
+	 */
+	commands: string[]
+}
+```
+
+
+#### <a href="#workspace_applyEdit" name="workspace_applyEdit" class="anchor">Applies a WorkspaceEdit (:arrow_right_hook:)</a>
+
+The `workspace/applyEdit` request is sent from the server to the client to modify resource on the client side.
+
+_Request_:
+* method: 'workspace/applyEdit'
+* params: `ApplyWorkspaceEditParams` defined as follows:
+
+```typescript
+export interface ApplyWorkspaceEditParams {
+	/**
+	 * An optional label of the workspace edit. This label is
+	 * presented in the user interface for example on an undo
+	 * stack to undo the workspace edit.
+	 */
+	label?: string;
+
+	/**
+	 * The edits to apply.
+	 */
+	edit: WorkspaceEdit;
+}
+```
+
+_Response_:
+* result: `ApplyWorkspaceEditResponse` defined as follows:
+
+```typescript
+export interface ApplyWorkspaceEditResponse {
+	/**
+	 * Indicates whether the edit was applied or not.
+	 */
+	applied: boolean;
+}
+```
+* error: code and message set in case an exception happens during the request.
+
+
+#### <a href="#textDocument_didOpen" name="textDocument_didOpen" class="anchor">DidOpenTextDocument Notification (:arrow_right:)</a>
+
+The document open notification is sent from the client to the server to signal newly opened text documents. The document's truth is now managed by the client and the server must not try to read the document's truth using the document's Uri. Open in this sense means it is managed by the client. It doesn't necessarily mean that its content is presented in an editor. An open notification must not be sent more than once without a corresponding close notification send before. This means open and close notification must be balanced and the max open count for a particular textDocument is one. Note that a server's ability to fulfill requests is independent of whether a text document is open or closed.
+
+The `DidOpenTextDocumentParams` contain the language id the document is associated with. If the language Id of a document changes, the client needs to send a `textDocument/didClose` to the server followed by a `textDocument/didOpen` with the new language id if the server handles the new language id as well.
+
+_Notification_:
+* method: 'textDocument/didOpen'
+* params: `DidOpenTextDocumentParams` defined as follows:
+
+```typescript
+interface DidOpenTextDocumentParams {
+	/**
+	 * The document that was opened.
+	 */
+	textDocument: TextDocumentItem;
+}
+```
+
+_Registration Options_: `TextDocumentRegistrationOptions`
+
+
+#### <a href="#textDocument_didChange" name="textDocument_didChange" class="anchor">DidChangeTextDocument Notification (:arrow_right:)</a>
+
+The document change notification is sent from the client to the server to signal changes to a text document. In 2.0 the shape of the params has changed to include proper version numbers and language ids.
+
+_Notification_:
+* method: 'textDocument/didChange'
+* params: `DidChangeTextDocumentParams` defined as follows:
+
+```typescript
+interface DidChangeTextDocumentParams {
+	/**
+	 * The document that did change. The version number points
+	 * to the version after all provided content changes have
+	 * been applied.
+	 */
+	textDocument: VersionedTextDocumentIdentifier;
+
+	/**
+	 * The actual content changes. The content changes describe single state changes
+	 * to the document. So if there are two content changes c1 and c2 for a document
+	 * in state S then c1 move the document to S' and c2 to S''.
+	 */
+	contentChanges: TextDocumentContentChangeEvent[];
+}
+
+/**
+ * An event describing a change to a text document. If range and rangeLength are omitted
+ * the new text is considered to be the full content of the document.
+ */
+interface TextDocumentContentChangeEvent {
+	/**
+	 * The range of the document that changed.
+	 */
+	range?: Range;
+
+	/**
+	 * The length of the range that got replaced.
+	 */
+	rangeLength?: number;
+
+	/**
+	 * The new text of the range/document.
+	 */
+	text: string;
+}
+```
+
+_Registration Options_: `TextDocumentChangeRegistrationOptions` defined as follows:
+
+```typescript
+/**
+ * Describe options to be used when registering for text document change events.
+ */
+export interface TextDocumentChangeRegistrationOptions extends TextDocumentRegistrationOptions {
+	/**
+	 * How documents are synced to the server. See TextDocumentSyncKind.Full
+	 * and TextDocumentSyncKind.Incremental.
+	 */
+	syncKind: number;
+}
+```
+
+
+#### <a href="#textDocument_willSave" name="textDocument_willSave" class="anchor">WillSaveTextDocument Notification (:arrow_right:)</a>
+
+The document will save notification is sent from the client to the server before the document is actually saved.
+
+_Notification_:
+* method: 'textDocument/willSave'
+* params: `WillSaveTextDocumentParams` defined as follows:
+
+```typescript
+/**
+ * The parameters send in a will save text document notification.
+ */
+export interface WillSaveTextDocumentParams {
+	/**
+	 * The document that will be saved.
+	 */
+	textDocument: TextDocumentIdentifier;
+
+	/**
+	 * The 'TextDocumentSaveReason'.
+	 */
+	reason: number;
+}
+
+/**
+ * Represents reasons why a text document is saved.
+ */
+export namespace TextDocumentSaveReason {
+
+	/**
+	 * Manually triggered, e.g. by the user pressing save, by starting debugging,
+	 * or by an API call.
+	 */
+	export const Manual = 1;
+
+	/**
+	 * Automatic after a delay.
+	 */
+	export const AfterDelay = 2;
+
+	/**
+	 * When the editor lost focus.
+	 */
+	export const FocusOut = 3;
+}
+```
+
+_Registration Options_: `TextDocumentRegistrationOptions`
+
+
+#### <a href="#textDocument_willSaveWaitUntil" name="textDocument_willSaveWaitUntil" class="anchor">WillSaveWaitUntilTextDocument Request (:leftwards_arrow_with_hook:)</a>
+
+The document will save request is sent from the client to the server before the document is actually saved. The request can return an array of TextEdits which will be applied to the text document before it is saved. Please note that clients might drop results if computing the text edits took too long or if a server constantly fails on this request. This is done to keep the save fast and reliable.
+
+_Request_:
+* method: 'textDocument/willSaveWaitUntil'
+* params: `WillSaveTextDocumentParams`
+
+_Response_:
+* result:`TextEdit[]` \| `null`
+* error: code and message set in case an exception happens during the `willSaveWaitUntil` request.
+
+_Registration Options_: `TextDocumentRegistrationOptions`
+
+#### <a href="#textDocument_didSave" name="textDocument_didSave" class="anchor">DidSaveTextDocument Notification (:arrow_right:)</a>
+
+The document save notification is sent from the client to the server when the document was saved in the client.
+
+* method: 'textDocument/didSave'
+* params: `DidSaveTextDocumentParams` defined as follows:
+
+```typescript
+interface DidSaveTextDocumentParams {
+	/**
+	 * The document that was saved.
+	 */
+	textDocument: TextDocumentIdentifier;
+
+	/**
+	 * Optional the content when saved. Depends on the includeText value
+	 * when the save notification was requested.
+	 */
+	text?: string;
+}
+```
+
+_Registration Options_: `TextDocumentSaveRegistrationOptions` defined as follows:
+
+```typescript
+export interface TextDocumentSaveRegistrationOptions extends TextDocumentRegistrationOptions {
+	/**
+	 * The client is supposed to include the content on save.
+	 */
+	includeText?: boolean;
+}
+```
+
+#### <a href="#textDocument_didClose" name="textDocument_didClose" class="anchor">DidCloseTextDocument Notification (:arrow_right:)</a>
+
+The document close notification is sent from the client to the server when the document got closed in the client. The document's truth now exists where the document's Uri points to (e.g. if the document's Uri is a file Uri the truth now exists on disk). As with the open notification the close notification is about managing the document's content. Receiving a close notification doesn't mean that the document was open in an editor before. A close notification requires a previous open notification to be sent. Note that a server's ability to fulfill requests is independent of whether a text document is open or closed.
+
+_Notification_:
+* method: 'textDocument/didClose'
+* params: `DidCloseTextDocumentParams` defined as follows:
+
+```typescript
+interface DidCloseTextDocumentParams {
+	/**
+	 * The document that was closed.
+	 */
+	textDocument: TextDocumentIdentifier;
+}
+```
+
+_Registration Options_: `TextDocumentRegistrationOptions`
+
+
+#### <a href="#textDocument_publishDiagnostics" name="textDocument_publishDiagnostics" class="anchor">PublishDiagnostics Notification (:arrow_left:)</a>
+
+Diagnostics notification are sent from the server to the client to signal results of validation runs.
+
+Diagnostics are "owned" by the server so it is the server's responsibility to clear them if necessary. The following rule is used for VS Code servers that generate diagnostics:
+
+* if a language is single file only (for example HTML) then diagnostics are cleared by the server when the file is closed.
+* if a language has a project system (for example C#) diagnostics are not cleared when a file closes. When a project is opened all diagnostics for all files are recomputed (or read from a cache).
+
+When a file changes it is the server's responsibility to re-compute diagnostics and push them to the client. If the computed set is empty it has to push the empty array to clear former diagnostics. Newly pushed diagnostics always replace previously pushed diagnostics. There is no merging that happens on the client side.
+
+_Notification_:
+* method: 'textDocument/publishDiagnostics'
+* params: `PublishDiagnosticsParams` defined as follows:
+
+```typescript
+interface PublishDiagnosticsParams {
+	/**
+	 * The URI for which diagnostic information is reported.
+	 */
+	uri: DocumentUri;
+
+	/**
+	 * An array of diagnostic information items.
+	 */
+	diagnostics: Diagnostic[];
+}
+```
+
+#### <a href="#textDocument_completion" name="textDocument_completion" class="anchor">Completion Request (:leftwards_arrow_with_hook:)</a>
+
+The Completion request is sent from the client to the server to compute completion items at a given cursor position. Completion items are presented in the [IntelliSense](https://code.visualstudio.com/docs/editor/editingevolved#_intellisense) user interface. If computing full completion items is expensive, servers can additionally provide a handler for the completion item resolve request ('completionItem/resolve'). This request is sent when a completion item is selected in the user interface. A typical use case is for example: the 'textDocument/completion' request doesn't fill in the `documentation` property for returned completion items since it is expensive to compute. When the item is selected in the user interface then a 'completionItem/resolve' request is sent with the selected completion item as a parameter. The returned completion item should have the documentation property filled in. The request can delay the computation of the `detail` and `documentation` properties. However, properties that are needed for the initial sorting and filtering, like `sortText`, `filterText`, `insertText`, and `textEdit` must be provided in the `textDocument/completion` response and must not be changed during resolve.
+
+_Request_:
+* method: 'textDocument/completion'
+* params: `CompletionParams` defined as follows:
+
+```typescript
+export interface CompletionParams extends TextDocumentPositionParams {
+
+	/**
+	 * The completion context. This is only available if the client specifies
+	 * to send this using `ClientCapabilities.textDocument.completion.contextSupport === true`
+	 */
+	context?: CompletionContext;
+}
+
+/**
+ * How a completion was triggered
+ */
+export namespace CompletionTriggerKind {
+	/**
+	 * Completion was triggered by typing an identifier (24x7 code
+	 * complete), manual invocation (e.g Ctrl+Space) or via API.
+	 */
+	export const Invoked: 1 = 1;
+
+	/**
+	 * Completion was triggered by a trigger character specified by
+	 * the `triggerCharacters` properties of the `CompletionRegistrationOptions`.
+	 */
+	export const TriggerCharacter: 2 = 2;
+
+	/**
+	 * Completion was re-triggered as the current completion list is incomplete.
+	 */
+	export const TriggerForIncompleteCompletions: 3 = 3;
+}
+export type CompletionTriggerKind = 1 | 2 | 3;
+
+
+/**
+ * Contains additional information about the context in which a completion request is triggered.
+ */
+export interface CompletionContext {
+	/**
+	 * How the completion was triggered.
+	 */
+	triggerKind: CompletionTriggerKind;
+
+	/**
+	 * The trigger character (a single character) that has trigger code complete.
+	 * Is undefined if `triggerKind !== CompletionTriggerKind.TriggerCharacter`
+	 */
+	triggerCharacter?: string;
+}
+```
+
+_Response_:
+* result: `CompletionItem[]` \| `CompletionList` \| `null`. If a `CompletionItem[]` is provided it is interpreted to be complete. So it is the same as `{ isIncomplete: false, items }`
+
+```typescript
+/**
+ * Represents a collection of [completion items](#CompletionItem) to be presented
+ * in the editor.
+ */
+interface CompletionList {
+	/**
+	 * This list it not complete. Further typing should result in recomputing
+	 * this list.
+	 */
+	isIncomplete: boolean;
+
+	/**
+	 * The completion items.
+	 */
+	items: CompletionItem[];
+}
+
+/**
+ * Defines whether the insert text in a completion item should be interpreted as
+ * plain text or a snippet.
+ */
+namespace InsertTextFormat {
+	/**
+	 * The primary text to be inserted is treated as a plain string.
+	 */
+	export const PlainText = 1;
+
+	/**
+	 * The primary text to be inserted is treated as a snippet.
+	 *
+	 * A snippet can define tab stops and placeholders with `$1`, `$2`
+	 * and `${3:foo}`. `$0` defines the final tab stop, it defaults to
+	 * the end of the snippet. Placeholders with equal identifiers are linked,
+	 * that is typing in one will update others too.
+	 */
+	export const Snippet = 2;
+}
+
+type InsertTextFormat = 1 | 2;
+
+interface CompletionItem {
+	/**
+	 * The label of this completion item. By default
+	 * also the text that is inserted when selecting
+	 * this completion.
+	 */
+	label: string;
+
+	/**
+	 * The kind of this completion item. Based of the kind
+	 * an icon is chosen by the editor.
+	 */
+	kind?: number;
+
+	/**
+	 * A human-readable string with additional information
+	 * about this item, like type or symbol information.
+	 */
+	detail?: string;
+
+	/**
+	 * A human-readable string that represents a doc-comment.
+	 */
+	documentation?: string | MarkupContent;
+
+	/**
+	 * Indicates if this item is deprecated.
+	 */
+	deprecated?: boolean;
+
+	/**
+	 * Select this item when showing.
+	 *
+	 * *Note* that only one completion item can be selected and that the
+	 * tool / client decides which item that is. The rule is that the *first*
+	 * item of those that match best is selected.
+	 */
+	preselect?: boolean;
+
+	/**
+	 * A string that should be used when comparing this item
+	 * with other items. When `falsy` the label is used.
+	 */
+	sortText?: string;
+
+	/**
+	 * A string that should be used when filtering a set of
+	 * completion items. When `falsy` the label is used.
+	 */
+	filterText?: string;
+
+	/**
+	 * A string that should be inserted into a document when selecting
+	 * this completion. When `falsy` the label is used.
+	 *
+	 * The `insertText` is subject to interpretation by the client side.
+	 * Some tools might not take the string literally. For example
+	 * VS Code when code complete is requested in this example `con<cursor position>`
+	 * and a completion item with an `insertText` of `console` is provided it
+	 * will only insert `sole`. Therefore it is recommended to use `textEdit` instead
+	 * since it avoids additional client side interpretation.
+	 *
+	 * @deprecated Use textEdit instead.
+	 */
+	insertText?: string;
+
+	/**
+	 * The format of the insert text. The format applies to both the `insertText` property
+	 * and the `newText` property of a provided `textEdit`.
+	 */
+	insertTextFormat?: InsertTextFormat;
+
+	/**
+	 * An edit which is applied to a document when selecting this completion. When an edit is provided the value of
+	 * `insertText` is ignored.
+	 *
+	 * *Note:* The range of the edit must be a single line range and it must contain the position at which completion
+	 * has been requested.
+	 */
+	textEdit?: TextEdit;
+
+	/**
+	 * An optional array of additional text edits that are applied when
+	 * selecting this completion. Edits must not overlap (including the same insert position)
+	 * with the main edit nor with themselves.
+	 *
+	 * Additional text edits should be used to change text unrelated to the current cursor position
+	 * (for example adding an import statement at the top of the file if the completion item will
+	 * insert an unqualified type).
+	 */
+	additionalTextEdits?: TextEdit[];
+
+	/**
+	 * An optional set of characters that when pressed while this completion is active will accept it first and
+	 * then type that character. *Note* that all commit characters should have `length=1` and that superfluous
+	 * characters will be ignored.
+	 */
+	commitCharacters?: string[];
+
+	/**
+	 * An optional command that is executed *after* inserting this completion. *Note* that
+	 * additional modifications to the current document should be described with the
+	 * additionalTextEdits-property.
+	 */
+	command?: Command;
+
+	/**
+	 * An data entry field that is preserved on a completion item between
+	 * a completion and a completion resolve request.
+	 */
+	data?: any
+}
+
+/**
+ * The kind of a completion entry.
+ */
+namespace CompletionItemKind {
+	export const Text = 1;
+	export const Method = 2;
+	export const Function = 3;
+	export const Constructor = 4;
+	export const Field = 5;
+	export const Variable = 6;
+	export const Class = 7;
+	export const Interface = 8;
+	export const Module = 9;
+	export const Property = 10;
+	export const Unit = 11;
+	export const Value = 12;
+	export const Enum = 13;
+	export const Keyword = 14;
+	export const Snippet = 15;
+	export const Color = 16;
+	export const File = 17;
+	export const Reference = 18;
+	export const Folder = 19;
+	export const EnumMember = 20;
+	export const Constant = 21;
+	export const Struct = 22;
+	export const Event = 23;
+	export const Operator = 24;
+	export const TypeParameter = 25;
+}
+```
+* error: code and message set in case an exception happens during the completion request.
+
+_Registration Options_: `CompletionRegistrationOptions` options defined as follows:
+
+```typescript
+export interface CompletionRegistrationOptions extends TextDocumentRegistrationOptions {
+	/**
+	 * Most tools trigger completion request automatically without explicitly requesting
+	 * it using a keyboard shortcut (e.g. Ctrl+Space). Typically they do so when the user
+	 * starts to type an identifier. For example if the user types `c` in a JavaScript file
+	 * code complete will automatically pop up present `console` besides others as a
+	 * completion item. Characters that make up identifiers don't need to be listed here.
+	 *
+	 * If code complete should automatically be trigger on characters not being valid inside
+	 * an identifier (for example `.` in JavaScript) list them in `triggerCharacters`.
+	 */
+	triggerCharacters?: string[];
+
+	/**
+	 * The server provides support to resolve additional
+	 * information for a completion item.
+	 */
+	resolveProvider?: boolean;
+}
+```
+
+Completion items support snippets (see `InsertTextFormat.Snippet`). The snippet format is as follows:
+
+##### Snippet Syntax
+
+The `body` of a snippet can use special constructs to control cursors and the text being inserted. The following are supported features and their syntaxes:
+
+##### Tab stops
+
+With tab stops, you can make the editor cursor move inside a snippet. Use `$1`, `$2` to specify cursor locations. The number is the order in which tab stops will be visited, whereas `$0` denotes the final cursor position. Multiple tab stops are linked and updated in sync.
+
+##### Placeholders
+
+Placeholders are tab stops with values, like `${1:foo}`. The placeholder text will be inserted and selected such that it can be easily changed. Placeholders can be nested, like `${1:another ${2:placeholder}}`.
+
+##### Choice
+
+Placeholders can have choices as values. The syntax is a comma separated enumeration of values, enclosed with the pipe-character, for example `${1|one,two,three|}`. When the snippet is inserted and the placeholder selected, choices will prompt the user to pick one of the values.
+
+##### Variables
+
+With `$name` or `${name:default}` you can insert the value of a variable. When a variable isn’t set, its *default* or the empty string is inserted. When a variable is unknown (that is, its name isn’t defined) the name of the variable is inserted and it is transformed into a placeholder.
+
+The following variables can be used:
+
+* `TM_SELECTED_TEXT` The currently selected text or the empty string
+* `TM_CURRENT_LINE` The contents of the current line
+* `TM_CURRENT_WORD` The contents of the word under cursor or the empty string
+* `TM_LINE_INDEX` The zero-index based line number
+* `TM_LINE_NUMBER` The one-index based line number
+* `TM_FILENAME` The filename of the current document
+* `TM_FILENAME_BASE` The filename of the current document without its extensions
+* `TM_DIRECTORY` The directory of the current document
+* `TM_FILEPATH` The full file path of the current document
+
+##### Variable Transforms
+
+Transformations allow you to modify the value of a variable before it is inserted. The definition of a transformation consists of three parts:
+
+1. A regular expression that is matched against the value of a variable, or the empty string when the variable cannot be resolved.
+2. A "format string" that allows to reference matching groups from the regular expression. The format string allows for conditional inserts and simple modifications.
+3. Options that are passed to the regular expression.
+
+The following example inserts the name of the current file without its ending, so from `foo.txt` it makes `foo`.
+
+```
+${TM_FILENAME/(.*)\..+$/$1/}
+  |           |         | |
+  |           |         | |-> no options
+  |           |         |
+  |           |         |-> references the contents of the first
+  |           |             capture group
+  |           |
+  |           |-> regex to capture everything before
+  |               the final `.suffix`
+  |
+  |-> resolves to the filename
+```
+
+##### Grammar
+
+Below is the EBNF ([extended Backus-Naur form](https://en.wikipedia.org/wiki/Extended_Backus-Naur_form)) for snippets. With `\` (backslash), you can escape `$`, `}` and `\`. Within choice elements, the backslash also escapes comma and pipe characters.
+
+```
+any         ::= tabstop | placeholder | choice | variable | text
+tabstop     ::= '$' int | '${' int '}'
+placeholder ::= '${' int ':' any '}'
+choice      ::= '${' int '|' text (',' text)* '|}'
+variable    ::= '$' var | '${' var }'
+                | '${' var ':' any '}'
+                | '${' var '/' regex '/' (format | text)+ '/' options '}'
+format      ::= '$' int | '${' int '}'
+                | '${' int ':' '/upcase' | '/downcase' | '/capitalize' '}'
+                | '${' int ':+' if '}'
+                | '${' int ':?' if ':' else '}'
+                | '${' int ':-' else '}' | '${' int ':' else '}'
+regex       ::= JavaScript Regular Expression value (ctor-string)
+options     ::= JavaScript Regular Expression option (ctor-options)
+var         ::= [_a-zA-Z] [_a-zA-Z0-9]*
+int         ::= [0-9]+
+text        ::= .*
+```
+
+#### <a href="#completionItem_resolve" name="completionItem_resolve" class="anchor">Completion Item Resolve Request (:leftwards_arrow_with_hook:)</a>
+
+The request is sent from the client to the server to resolve additional information for a given completion item.
+
+_Request_:
+* method: 'completionItem/resolve'
+* params: `CompletionItem`
+
+_Response_:
+* result: `CompletionItem`
+* error: code and message set in case an exception happens during the completion resolve request.
+
+#### <a href="#textDocument_hover" name="textDocument_hover" class="anchor">Hover Request (:leftwards_arrow_with_hook:)</a>
+
+The hover request is sent from the client to the server to request hover information at a given text document position.
+
+_Request_:
+* method: 'textDocument/hover'
+* params: [`TextDocumentPositionParams`](#textdocumentpositionparams)
+
+_Response_:
+* result: `Hover` \| `null` defined as follows:
+
+```typescript
+/**
+ * The result of a hover request.
+ */
+interface Hover {
+	/**
+	 * The hover's content
+	 */
+	contents: MarkedString | MarkedString[] | MarkupContent;
+
+	/**
+	 * An optional range is a range inside a text document
+	 * that is used to visualize a hover, e.g. by changing the background color.
+	 */
+	range?: Range;
+}
+```
+
+Where `MarkedString` is defined as follows:
+
+```typescript
+/**
+ * MarkedString can be used to render human readable text. It is either a markdown string
+ * or a code-block that provides a language and a code snippet. The language identifier
+ * is semantically equal to the optional language identifier in fenced code blocks in GitHub
+ * issues. See https://help.github.com/articles/creating-and-highlighting-code-blocks/#syntax-highlighting
+ *
+ * The pair of a language and a value is an equivalent to markdown:
+ * ```${language}
+ * ${value}
+ * ```
+ *
+ * Note that markdown strings will be sanitized - that means html will be escaped.
+* @deprecated use MarkupContent instead.
+*/
+type MarkedString = string | { language: string; value: string };
+```
+
+* error: code and message set in case an exception happens during the hover request.
+
+_Registration Options_: `TextDocumentRegistrationOptions`
+
+#### <a href="#textDocument_signatureHelp" name="textDocument_signatureHelp" class="anchor">Signature Help Request (:leftwards_arrow_with_hook:)</a>
+
+The signature help request is sent from the client to the server to request signature information at a given cursor position.
+
+_Request_:
+* method: 'textDocument/signatureHelp'
+* params: [`TextDocumentPositionParams`](#textdocumentpositionparams)
+
+_Response_:
+* result: `SignatureHelp` \| `null` defined as follows:
+
+```typescript
+/**
+ * Signature help represents the signature of something
+ * callable. There can be multiple signature but only one
+ * active and only one active parameter.
+ */
+interface SignatureHelp {
+	/**
+	 * One or more signatures.
+	 */
+	signatures: SignatureInformation[];
+
+	/**
+	 * The active signature. If omitted or the value lies outside the
+	 * range of `signatures` the value defaults to zero or is ignored if
+	 * `signatures.length === 0`. Whenever possible implementors should
+	 * make an active decision about the active signature and shouldn't
+	 * rely on a default value.
+	 * In future version of the protocol this property might become
+	 * mandatory to better express this.
+	 */
+	activeSignature?: number;
+
+	/**
+	 * The active parameter of the active signature. If omitted or the value
+	 * lies outside the range of `signatures[activeSignature].parameters`
+	 * defaults to 0 if the active signature has parameters. If
+	 * the active signature has no parameters it is ignored.
+	 * In future version of the protocol this property might become
+	 * mandatory to better express the active parameter if the
+	 * active signature does have any.
+	 */
+	activeParameter?: number;
+}
+
+/**
+ * Represents the signature of something callable. A signature
+ * can have a label, like a function-name, a doc-comment, and
+ * a set of parameters.
+ */
+interface SignatureInformation {
+	/**
+	 * The label of this signature. Will be shown in
+	 * the UI.
+	 */
+	label: string;
+
+	/**
+	 * The human-readable doc-comment of this signature. Will be shown
+	 * in the UI but can be omitted.
+	 */
+	documentation?: string | MarkupContent;
+
+	/**
+	 * The parameters of this signature.
+	 */
+	parameters?: ParameterInformation[];
+}
+
+/**
+ * Represents a parameter of a callable-signature. A parameter can
+ * have a label and a doc-comment.
+ */
+interface ParameterInformation {
+
+	/**
+	 * The label of this parameter information.
+	 *
+	 * Either a string or an inclusive start and exclusive end offsets within its containing
+	 * signature label. (see SignatureInformation.label). The offsets are based on a UTF-16
+	 * string representation as `Position` and `Range` does.
+	 *
+	 * *Note*: a label of type string should be a substring of its containing signature label.
+	 * Its intended use case is to highlight the parameter label part in the `SignatureInformation.label`.
+	 */
+	label: string | [number, number];
+
+	/**
+	 * The human-readable doc-comment of this parameter. Will be shown
+	 * in the UI but can be omitted.
+	 */
+	documentation?: string | MarkupContent;
+}
+```
+
+* error: code and message set in case an exception happens during the signature help request.
+
+_Registration Options_: `SignatureHelpRegistrationOptions` defined as follows:
+
+```typescript
+export interface SignatureHelpRegistrationOptions extends TextDocumentRegistrationOptions {
+	/**
+	 * The characters that trigger signature help
+	 * automatically.
+	 */
+	triggerCharacters?: string[];
+}
+```
+#### <a href="#textDocument_declaration" name="textDocument_declaration" class="anchor">Goto Declaration Request (:leftwards_arrow_with_hook:)</a>
+
+> *Since version 3.14.0*
+
+The go to declaration request is sent from the client to the server to resolve the declaration location of a symbol at a given text document position.
+
+The result type [`LocationLink`](#locationlink)[] got introduce with version 3.14.0 and depends in the corresponding client capability `clientCapabilities.textDocument.declaration.linkSupport`.
+
+_Request_:
+* method: 'textDocument/declaration'
+* params: [`TextDocumentPositionParams`](#textdocumentpositionparams)
+
+_Response_:
+* result: [`Location`](#location) \| [`Location`](#location)[] \| [`LocationLink`](#locationlink)[] \|`null`
+* error: code and message set in case an exception happens during the declaration request.
+
+_Registration Options_: `TextDocumentRegistrationOptions`
+
+#### <a href="#textDocument_definition" name="textDocument_definition" class="anchor">Goto Definition Request (:leftwards_arrow_with_hook:)</a>
+
+> *Since version 3.14.0*
+
+The go to definition request is sent from the client to the server to resolve the definition location of a symbol at a given text document position.
+`
+The result type [`LocationLink`](#locationlink)[] got introduce with version 3.14.0 and depends in the corresponding client capability `clientCapabilities.textDocument.definition.linkSupport`.
+
+_Request_:
+* method: 'textDocument/definition'
+* params: [`TextDocumentPositionParams`](#textdocumentpositionparams)
+
+_Response_:
+* result: [`Location`](#location) \| [`Location`](#location)[] \| [`LocationLink`](#locationlink)[] \| `null`
+* error: code and message set in case an exception happens during the definition request.
+
+_Registration Options_: `TextDocumentRegistrationOptions`
+
+#### <a href="#textDocument_typeDefinition" name="textDocument_typeDefinition" class="anchor">Goto Type Definition Request (:leftwards_arrow_with_hook:)</a>
+
+> *Since version 3.6.0*
+
+The go to type definition request is sent from the client to the server to resolve the type definition location of a symbol at a given text document position.
+
+The result type [`LocationLink`](#locationlink)[] got introduce with version 3.14.0 and depends in the corresponding client capability `clientCapabilities.textDocument.typeDefinition.linkSupport`.
+
+_Request_:
+* method: 'textDocument/typeDefinition'
+* params: [`TextDocumentPositionParams`](#textdocumentpositionparams)
+
+_Response_:
+* result: [`Location`](#location) \| [`Location`](#location)[] \| [`LocationLink`](#locationlink)[] \| `null`
+* error: code and message set in case an exception happens during the definition request.
+
+_Registration Options_: `TextDocumentRegistrationOptions`
+
+#### <a href="#textDocument_implementation" name="textDocument_implementation" class="anchor">Goto Implementation Request (:leftwards_arrow_with_hook:)</a>
+
+> *Since version 3.6.0*
+
+The go to implementation request is sent from the client to the server to resolve the implementation location of a symbol at a given text document position.
+
+The result type [`LocationLink`](#locationlink)[] got introduce with version 3.14.0 and depends in the corresponding client capability `clientCapabilities.implementation.typeDefinition.linkSupport`.
+
+_Request_:
+* method: 'textDocument/implementation'
+* params: [`TextDocumentPositionParams`](#textdocumentpositionparams)
+
+_Response_:
+* result: [`Location`](#location) \| [`Location`](#location)[] \| [`LocationLink`](#locationlink)[] \| `null`
+* error: code and message set in case an exception happens during the definition request.
+
+_Registration Options_: `TextDocumentRegistrationOptions`
+
+#### <a href="#textDocument_references" name="textDocument_references" class="anchor">Find References Request (:leftwards_arrow_with_hook:)</a>
+
+The references request is sent from the client to the server to resolve project-wide references for the symbol denoted by the given text document position.
+
+_Request_:
+* method: 'textDocument/references'
+* params: `ReferenceParams` defined as follows:
+
+```typescript
+interface ReferenceParams extends TextDocumentPositionParams {
+	context: ReferenceContext
+}
+
+interface ReferenceContext {
+	/**
+	 * Include the declaration of the current symbol.
+	 */
+	includeDeclaration: boolean;
+}
+```
+_Response_:
+* result: [`Location`](#location)[] \| `null`
+* error: code and message set in case an exception happens during the reference request.
+
+_Registration Options_: `TextDocumentRegistrationOptions`
+
+#### <a href="#textDocument_documentHighlight" name="textDocument_documentHighlight" class="anchor">Document Highlights Request (:leftwards_arrow_with_hook:)</a>
+
+The document highlight request is sent from the client to the server to resolve a document highlights for a given text document position.
+For programming languages this usually highlights all references to the symbol scoped to this file. However we kept 'textDocument/documentHighlight'
+and 'textDocument/references' separate requests since the first one is allowed to be more fuzzy. Symbol matches usually have a `DocumentHighlightKind`
+of `Read` or `Write` whereas fuzzy or textual matches use `Text`as the kind.
+
+_Request_:
+* method: 'textDocument/documentHighlight'
+* params: [`TextDocumentPositionParams`](#textdocumentpositionparams)
+
+_Response_:
+* result: `DocumentHighlight[]` \| `null` defined as follows:
+
+```typescript
+/**
+ * A document highlight is a range inside a text document which deserves
+ * special attention. Usually a document highlight is visualized by changing
+ * the background color of its range.
+ *
+ */
+interface DocumentHighlight {
+	/**
+	 * The range this highlight applies to.
+	 */
+	range: Range;
+
+	/**
+	 * The highlight kind, default is DocumentHighlightKind.Text.
+	 */
+	kind?: number;
+}
+
+/**
+ * A document highlight kind.
+ */
+export namespace DocumentHighlightKind {
+	/**
+	 * A textual occurrence.
+	 */
+	export const Text = 1;
+
+	/**
+	 * Read-access of a symbol, like reading a variable.
+	 */
+	export const Read = 2;
+
+	/**
+	 * Write-access of a symbol, like writing to a variable.
+	 */
+	export const Write = 3;
+}
+```
+
+* error: code and message set in case an exception happens during the document highlight request.
+
+_Registration Options_: `TextDocumentRegistrationOptions`
+
+#### <a href="#textDocument_documentSymbol" name="textDocument_documentSymbol" class="anchor">Document Symbols Request (:leftwards_arrow_with_hook:)</a>
+
+The document symbol request is sent from the client to the server to return a flat list of all symbols found in a given text document. Neither the symbol's location range nor the symbol's container name should be used to infer a hierarchy.
+
+_Request_:
+* method: 'textDocument/documentSymbol'
+* params: `DocumentSymbolParams` defined as follows:
+
+```typescript
+interface DocumentSymbolParams {
+	/**
+	 * The text document.
+	 */
+	textDocument: TextDocumentIdentifier;
+}
+```
+
+_Response_:
+* result: `DocumentSymbol[]` \| `SymbolInformation[]` \| `null` defined as follows:
+
+```typescript
+/**
+ * A symbol kind.
+ */
+export namespace SymbolKind {
+	export const File = 1;
+	export const Module = 2;
+	export const Namespace = 3;
+	export const Package = 4;
+	export const Class = 5;
+	export const Method = 6;
+	export const Property = 7;
+	export const Field = 8;
+	export const Constructor = 9;
+	export const Enum = 10;
+	export const Interface = 11;
+	export const Function = 12;
+	export const Variable = 13;
+	export const Constant = 14;
+	export const String = 15;
+	export const Number = 16;
+	export const Boolean = 17;
+	export const Array = 18;
+	export const Object = 19;
+	export const Key = 20;
+	export const Null = 21;
+	export const EnumMember = 22;
+	export const Struct = 23;
+	export const Event = 24;
+	export const Operator = 25;
+	export const TypeParameter = 26;
+}
+
+/**
+ * Represents programming constructs like variables, classes, interfaces etc. that appear in a document. Document symbols can be
+ * hierarchical and they have two ranges: one that encloses its definition and one that points to its most interesting range,
+ * e.g. the range of an identifier.
+ */
+export class DocumentSymbol {
+
+	/**
+	 * The name of this symbol. Will be displayed in the user interface and therefore must not be
+	 * an empty string or a string only consisting of white spaces.
+	 */
+	name: string;
+
+	/**
+	 * More detail for this symbol, e.g the signature of a function.
+	 */
+	detail?: string;
+
+	/**
+	 * The kind of this symbol.
+	 */
+	kind: SymbolKind;
+
+	/**
+	 * Indicates if this symbol is deprecated.
+	 */
+	deprecated?: boolean;
+
+	/**
+	 * The range enclosing this symbol not including leading/trailing whitespace but everything else
+	 * like comments. This information is typically used to determine if the clients cursor is
+	 * inside the symbol to reveal in the symbol in the UI.
+	 */
+	range: Range;
+
+	/**
+	 * The range that should be selected and revealed when this symbol is being picked, e.g the name of a function.
+	 * Must be contained by the `range`.
+	 */
+	selectionRange: Range;
+
+	/**
+	 * Children of this symbol, e.g. properties of a class.
+	 */
+	children?: DocumentSymbol[];
+}
+
+/**
+ * Represents information about programming constructs like variables, classes,
+ * interfaces etc.
+ */
+interface SymbolInformation {
+	/**
+	 * The name of this symbol.
+	 */
+	name: string;
+
+	/**
+	 * The kind of this symbol.
+	 */
+	kind: number;
+
+	/**
+	 * Indicates if this symbol is deprecated.
+	 */
+	deprecated?: boolean;
+
+	/**
+	 * The location of this symbol. The location's range is used by a tool
+	 * to reveal the location in the editor. If the symbol is selected in the
+	 * tool the range's start information is used to position the cursor. So
+	 * the range usually spans more then the actual symbol's name and does
+	 * normally include things like visibility modifiers.
+	 *
+	 * The range doesn't have to denote a node range in the sense of a abstract
+	 * syntax tree. It can therefore not be used to re-construct a hierarchy of
+	 * the symbols.
+	 */
+	location: Location;
+
+	/**
+	 * The name of the symbol containing this symbol. This information is for
+	 * user interface purposes (e.g. to render a qualifier in the user interface
+	 * if necessary). It can't be used to re-infer a hierarchy for the document
+	 * symbols.
+	 */
+	containerName?: string;
+}
+
+```
+
+* error: code and message set in case an exception happens during the document symbol request.
+
+_Registration Options_: `TextDocumentRegistrationOptions`
+
+#### <a href="#textDocument_codeAction" name="textDocument_codeAction" class="anchor">Code Action Request (:leftwards_arrow_with_hook:)</a>
+
+The code action request is sent from the client to the server to compute commands for a given text document and range. These commands are typically code fixes to either fix problems or to beautify/refactor code. The result of a `textDocument/codeAction` request is an array of `Command` literals which are typically presented in the user interface. To ensure that a server is useful in many clients the commands specified in a code actions should be handled by the server and not by the client (see `workspace/executeCommand` and `ServerCapabilities.executeCommandProvider`). If the client supports providing edits with a code action then the mode should be used.
+
+When the command is selected the server should be contacted again (via the `workspace/executeCommand`) request to execute the command.
+
+> *Since version 3.8.0:* support for CodeAction literals to enable the following scenarios:
+
+- the ability to directly return a workspace edit from the code action request. This avoids having another server roundtrip to execute an actual code action. However server providers should be aware that if the code action is expensive to compute or the edits are huge it might still be beneficial if the result is simply a command and the actual edit is only computed when needed.
+- the ability to group code actions using a kind. Clients are allowed to ignore that information. However it allows them to better group code action for example into corresponding menus (e.g. all refactor code actions into a refactor menu).
+
+Clients need to announce their support for code action literals and code action kinds via the corresponding client capability `textDocument.codeAction.codeActionLiteralSupport`.
+
+_Request_:
+* method: 'textDocument/codeAction'
+* params: `CodeActionParams` defined as follows:
+
+```typescript
+/**
+ * Params for the CodeActionRequest
+ */
+interface CodeActionParams {
+	/**
+	 * The document in which the command was invoked.
+	 */
+	textDocument: TextDocumentIdentifier;
+
+	/**
+	 * The range for which the command was invoked.
+	 */
+	range: Range;
+
+	/**
+	 * Context carrying additional information.
+	 */
+	context: CodeActionContext;
+}
+
+/**
+ * The kind of a code action.
+ *
+ * Kinds are a hierarchical list of identifiers separated by `.`, e.g. `"refactor.extract.function"`.
+ *
+ * The set of kinds is open and client needs to announce the kinds it supports to the server during
+ * initialization.
+ */
+export type CodeActionKind = string;
+
+/**
+ * A set of predefined code action kinds
+ */
+export namespace CodeActionKind {
+	/**
+	 * Base kind for quickfix actions: 'quickfix'
+	 */
+	export const QuickFix: CodeActionKind = 'quickfix';
+
+	/**
+	 * Base kind for refactoring actions: 'refactor'
+	 */
+	export const Refactor: CodeActionKind = 'refactor';
+
+	/**
+	 * Base kind for refactoring extraction actions: 'refactor.extract'
+	 *
+	 * Example extract actions:
+	 *
+	 * - Extract method
+	 * - Extract function
+	 * - Extract variable
+	 * - Extract interface from class
+	 * - ...
+	 */
+	export const RefactorExtract: CodeActionKind = 'refactor.extract';
+
+	/**
+	 * Base kind for refactoring inline actions: 'refactor.inline'
+	 *
+	 * Example inline actions:
+	 *
+	 * - Inline function
+	 * - Inline variable
+	 * - Inline constant
+	 * - ...
+	 */
+	export const RefactorInline: CodeActionKind = 'refactor.inline';
+
+	/**
+	 * Base kind for refactoring rewrite actions: 'refactor.rewrite'
+	 *
+	 * Example rewrite actions:
+	 *
+	 * - Convert JavaScript function to class
+	 * - Add or remove parameter
+	 * - Encapsulate field
+	 * - Make method static
+	 * - Move method to base class
+	 * - ...
+	 */
+	export const RefactorRewrite: CodeActionKind = 'refactor.rewrite';
+
+	/**
+	 * Base kind for source actions: `source`
+	 *
+	 * Source code actions apply to the entire file.
+	 */
+	export const Source: CodeActionKind = 'source';
+
+	/**
+	 * Base kind for an organize imports source action: `source.organizeImports`
+	 */
+	export const SourceOrganizeImports: CodeActionKind = 'source.organizeImports';
+}
+
+/**
+ * Contains additional diagnostic information about the context in which
+ * a code action is run.
+ */
+interface CodeActionContext {
+	/**
+	 * An array of diagnostics.
+	 */
+	diagnostics: Diagnostic[];
+
+	/**
+	 * Requested kind of actions to return.
+	 *
+	 * Actions not of this kind are filtered out by the client before being shown. So servers
+	 * can omit computing them.
+	 */
+	only?: CodeActionKind[];
+}
+```
+
+_Response_:
+* result: `(Command | CodeAction)[]` \| `null` where `CodeAction` is defined as follows:
+
+```typescript
+/**
+ * A code action represents a change that can be performed in code, e.g. to fix a problem or
+ * to refactor code.
+ *
+ * A CodeAction must set either `edit` and/or a `command`. If both are supplied, the `edit` is applied first, then the `command` is executed.
+ */
+export interface CodeAction {
+
+	/**
+	 * A short, human-readable, title for this code action.
+	 */
+	title: string;
+
+	/**
+	 * The kind of the code action.
+	 *
+	 * Used to filter code actions.
+	 */
+	kind?: CodeActionKind;
+
+	/**
+	 * The diagnostics that this code action resolves.
+	 */
+	diagnostics?: Diagnostic[];
+
+	/**
+	 * The workspace edit this code action performs.
+	 */
+	edit?: WorkspaceEdit;
+
+	/**
+	 * A command this code action executes. If a code action
+	 * provides an edit and a command, first the edit is
+	 * executed and then the command.
+	 */
+	command?: Command;
+}
+```
+
+* error: code and message set in case an exception happens during the code action request.
+
+_Registration Options_: `CodeActionRegistrationOptions`  defined as follows:
+
+```typescript
+export interface CodeActionRegistrationOptions extends TextDocumentRegistrationOptions, CodeActionOptions {
+}
+```
+
+
+#### <a href="#textDocument_codeLens" name="textDocument_codeLens" class="anchor">Code Lens Request (:leftwards_arrow_with_hook:)</a>
+
+The code lens request is sent from the client to the server to compute code lenses for a given text document.
+
+_Request_:
+* method: 'textDocument/codeLens'
+* params: `CodeLensParams` defined as follows:
+
+```typescript
+interface CodeLensParams {
+	/**
+	 * The document to request code lens for.
+	 */
+	textDocument: TextDocumentIdentifier;
+}
+```
+
+_Response_:
+* result: `CodeLens[]` \| `null` defined as follows:
+
+```typescript
+/**
+ * A code lens represents a command that should be shown along with
+ * source text, like the number of references, a way to run tests, etc.
+ *
+ * A code lens is _unresolved_ when no command is associated to it. For performance
+ * reasons the creation of a code lens and resolving should be done in two stages.
+ */
+interface CodeLens {
+	/**
+	 * The range in which this code lens is valid. Should only span a single line.
+	 */
+	range: Range;
+
+	/**
+	 * The command this code lens represents.
+	 */
+	command?: Command;
+
+	/**
+	 * A data entry field that is preserved on a code lens item between
+	 * a code lens and a code lens resolve request.
+	 */
+	data?: any
+}
+```
+* error: code and message set in case an exception happens during the code lens request.
+
+_Registration Options_: `CodeLensRegistrationOptions` defined as follows:
+
+```typescript
+export interface CodeLensRegistrationOptions extends TextDocumentRegistrationOptions {
+	/**
+	 * Code lens has a resolve provider as well.
+	 */
+	resolveProvider?: boolean;
+}
+```
+
+#### <a href="#codeLens_resolve" name="codeLens_resolve" class="anchor">Code Lens Resolve Request (:leftwards_arrow_with_hook:)</a>
+
+The code lens resolve request is sent from the client to the server to resolve the command for a given code lens item.
+
+_Request_:
+* method: 'codeLens/resolve'
+* params: `CodeLens`
+
+_Response_:
+* result: `CodeLens`
+* error: code and message set in case an exception happens during the code lens resolve request.
+
+#### <a href="#textDocument_documentLink" name="textDocument_documentLink" class="anchor">Document Link Request (:leftwards_arrow_with_hook:)</a>
+
+The document links request is sent from the client to the server to request the location of links in a document.
+
+_Request_:
+* method: 'textDocument/documentLink'
+* params: `DocumentLinkParams`, defined as follows:
+
+```typescript
+interface DocumentLinkParams {
+	/**
+	 * The document to provide document links for.
+	 */
+	textDocument: TextDocumentIdentifier;
+}
+```
+
+_Response_:
+* result: An array of `DocumentLink` \| `null`.
+
+```typescript
+/**
+ * A document link is a range in a text document that links to an internal or external resource, like another
+ * text document or a web site.
+ */
+interface DocumentLink {
+	/**
+	 * The range this link applies to.
+	 */
+	range: Range;
+	/**
+	 * The uri this link points to. If missing a resolve request is sent later.
+	 */
+	target?: DocumentUri;
+	/**
+	 * A data entry field that is preserved on a document link between a
+	 * DocumentLinkRequest and a DocumentLinkResolveRequest.
+	 */
+	data?: any;
+}
+```
+* error: code and message set in case an exception happens during the document link request.
+
+_Registration Options_: `DocumentLinkRegistrationOptions` defined as follows:
+
+```typescript
+export interface DocumentLinkRegistrationOptions extends TextDocumentRegistrationOptions {
+	/**
+	 * Document links have a resolve provider as well.
+	 */
+	resolveProvider?: boolean;
+}
+```
+
+#### <a href="#documentLink_resolve" name="documentLink_resolve" class="anchor">Document Link Resolve Request (:leftwards_arrow_with_hook:)</a>
+
+The document link resolve request is sent from the client to the server to resolve the target of a given document link.
+
+_Request_:
+* method: 'documentLink/resolve'
+* params: `DocumentLink`
+
+_Response_:
+* result: `DocumentLink`
+* error: code and message set in case an exception happens during the document link resolve request.
+
+#### <a href="#textDocument_documentColor" name="textDocument_documentColor" class="anchor">Document Color Request (:leftwards_arrow_with_hook:)</a>
+
+> *Since version 3.6.0*
+
+The document color request is sent from the client to the server to list all color references found in a given text document. Along with the range, a color value in RGB is returned.
+
+Clients can use the result to decorate color references in an editor. For example:
+- Color boxes showing the actual color next to the reference
+- Show a color picker when a color reference is edited
+
+_Request_:
+
+* method: 'textDocument/documentColor'
+* params: `DocumentColorParams` defined as follows
+
+```ts
+interface DocumentColorParams {
+	/**
+	 * The text document.
+	 */
+	textDocument: TextDocumentIdentifier;
+}
+```
+
+_Response_:
+* result: `ColorInformation[]` defined as follows:
+
+```typescript
+interface ColorInformation {
+	/**
+	 * The range in the document where this color appears.
+	 */
+	range: Range;
+
+	/**
+	 * The actual color value for this color range.
+	 */
+	color: Color;
+}
+
+/**
+ * Represents a color in RGBA space.
+ */
+interface Color {
+
+	/**
+	 * The red component of this color in the range [0-1].
+	 */
+	readonly red: number;
+
+	/**
+	 * The green component of this color in the range [0-1].
+	 */
+	readonly green: number;
+
+	/**
+	 * The blue component of this color in the range [0-1].
+	 */
+	readonly blue: number;
+
+	/**
+	 * The alpha component of this color in the range [0-1].
+	 */
+	readonly alpha: number;
+}
+```
+* error: code and message set in case an exception happens during the 'textDocument/documentColor' request
+
+#### <a href="#textDocument_colorPresentation" name="textDocument_colorPresentation" class="anchor">Color Presentation Request (:leftwards_arrow_with_hook:)</a>
+
+> *Since version 3.6.0*
+
+The color presentation request is sent from the client to the server to obtain a list of presentations for a color value at a given location. Clients can use the result to
+- modify a color reference.
+- show in a color picker and let users pick one of the presentations
+
+
+_Request_:
+
+* method: 'textDocument/colorPresentation'
+* params: `ColorPresentationParams` defined as follows
+
+```typescript
+interface ColorPresentationParams {
+	/**
+	 * The text document.
+	 */
+	textDocument: TextDocumentIdentifier;
+
+	/**
+	 * The color information to request presentations for.
+	 */
+	color: Color;
+
+	/**
+	 * The range where the color would be inserted. Serves as a context.
+	 */
+	range: Range;
+}
+```
+
+_Response_:
+* result: `ColorPresentation[]` defined as follows:
+
+```typescript
+interface ColorPresentation {
+	/**
+	 * The label of this color presentation. It will be shown on the color
+	 * picker header. By default this is also the text that is inserted when selecting
+	 * this color presentation.
+	 */
+	label: string;
+	/**
+	 * An [edit](#TextEdit) which is applied to a document when selecting
+	 * this presentation for the color.  When `falsy` the [label](#ColorPresentation.label)
+	 * is used.
+	 */
+	textEdit?: TextEdit;
+	/**
+	 * An optional array of additional [text edits](#TextEdit) that are applied when
+	 * selecting this color presentation. Edits must not overlap with the main [edit](#ColorPresentation.textEdit) nor with themselves.
+	 */
+	additionalTextEdits?: TextEdit[];
+}
+```
+
+* error: code and message set in case an exception happens during the 'textDocument/colorPresentation' request
+
+#### <a href="#textDocument_formatting" name="textDocument_formatting" class="anchor">Document Formatting Request  (:leftwards_arrow_with_hook:)</a>
+
+The document formatting request is sent from the client to the server to format a whole document.
+
+_Request_:
+* method: 'textDocument/formatting'
+* params: `DocumentFormattingParams` defined as follows
+
+```typescript
+interface DocumentFormattingParams {
+	/**
+	 * The document to format.
+	 */
+	textDocument: TextDocumentIdentifier;
+
+	/**
+	 * The format options.
+	 */
+	options: FormattingOptions;
+}
+
+/**
+ * Value-object describing what options formatting should use.
+ */
+interface FormattingOptions {
+	/**
+	 * Size of a tab in spaces.
+	 */
+	tabSize: number;
+
+	/**
+	 * Prefer spaces over tabs.
+	 */
+	insertSpaces: boolean;
+
+	/**
+	 * Signature for further properties.
+	 */
+	[key: string]: boolean | number | string;
+}
+```
+
+_Response_:
+* result: [`TextEdit[]`](#textedit) \| `null` describing the modification to the document to be formatted.
+* error: code and message set in case an exception happens during the formatting request.
+
+_Registration Options_: `TextDocumentRegistrationOptions`
+
+#### <a href="#textDocument_rangeFormatting" name="textDocument_rangeFormatting" class="anchor">Document Range Formatting Request (:leftwards_arrow_with_hook:)</a>
+
+The document range formatting request is sent from the client to the server to format a given range in a document.
+
+_Request_:
+* method: 'textDocument/rangeFormatting',
+* params: `DocumentRangeFormattingParams` defined as follows:
+
+```typescript
+interface DocumentRangeFormattingParams {
+	/**
+	 * The document to format.
+	 */
+	textDocument: TextDocumentIdentifier;
+
+	/**
+	 * The range to format
+	 */
+	range: Range;
+
+	/**
+	 * The format options
+	 */
+	options: FormattingOptions;
+}
+```
+
+_Response_:
+* result: [`TextEdit[]`](#textedit) \| `null` describing the modification to the document to be formatted.
+* error: code and message set in case an exception happens during the range formatting request.
+
+_Registration Options_: `TextDocumentRegistrationOptions`
+
+#### <a href="#textDocument_onTypeFormatting" name="textDocument_onTypeFormatting" class="anchor">Document on Type Formatting Request (:leftwards_arrow_with_hook:)</a>
+
+The document on type formatting request is sent from the client to the server to format parts of the document during typing.
+
+_Request_:
+* method: 'textDocument/onTypeFormatting'
+* params: `DocumentOnTypeFormattingParams` defined as follows:
+
+```typescript
+interface DocumentOnTypeFormattingParams {
+	/**
+	 * The document to format.
+	 */
+	textDocument: TextDocumentIdentifier;
+
+	/**
+	 * The position at which this request was sent.
+	 */
+	position: Position;
+
+	/**
+	 * The character that has been typed.
+	 */
+	ch: string;
+
+	/**
+	 * The format options.
+	 */
+	options: FormattingOptions;
+}
+```
+
+_Response_:
+* result: [`TextEdit[]`](#textedit) \| `null` describing the modification to the document.
+* error: code and message set in case an exception happens during the range formatting request.
+
+_Registration Options_: `DocumentOnTypeFormattingRegistrationOptions` defined as follows:
+
+```typescript
+export interface DocumentOnTypeFormattingRegistrationOptions extends TextDocumentRegistrationOptions {
+	/**
+	 * A character on which formatting should be triggered, like `}`.
+	 */
+	firstTriggerCharacter: string;
+	/**
+	 * More trigger characters.
+	 */
+	moreTriggerCharacter?: string[]
+}
+```
+#### <a href="#textDocument_rename" name="textDocument_rename" class="anchor">Rename Request (:leftwards_arrow_with_hook:)</a>
+
+The rename request is sent from the client to the server to perform a workspace-wide rename of a symbol.
+
+_Request_:
+* method: 'textDocument/rename'
+* params: `RenameParams` defined as follows
+
+```typescript
+interface RenameParams {
+	/**
+	 * The document to rename.
+	 */
+	textDocument: TextDocumentIdentifier;
+
+	/**
+	 * The position at which this request was sent.
+	 */
+	position: Position;
+
+	/**
+	 * The new name of the symbol. If the given name is not valid the
+	 * request must return a [ResponseError](#ResponseError) with an
+	 * appropriate message set.
+	 */
+	newName: string;
+}
+```
+
+_Response_:
+* result: [`WorkspaceEdit`](#workspaceedit) \| `null` describing the modification to the workspace.
+* error: code and message set in case an exception happens during the rename request.
+
+_Registration Options_: `RenameRegistrationOptions` defined as follows:
+
+```typescript
+export interface RenameRegistrationOptions extends TextDocumentRegistrationOptions {
+	/**
+	 * Renames should be checked and tested for validity before being executed.
+	 */
+	prepareProvider?: boolean;
+}
+```
+
+#### <a href="#textDocument_prepareRename" name="textDocument_prepareRename" class="anchor">Prepare Rename Request (:leftwards_arrow_with_hook:)</a>
+
+> *Since version 3.12.0*
+
+The prepare rename request is sent from the client to the server to setup and test the validity of a rename operation at a given location.
+
+_Request_:
+* method: 'textDocument/prepareRename'
+* params: [`TextDocumentPositionParams`](#textdocumentpositionparams)
+
+_Response_:
+* result: [`Range`](#range) \| `{ range: Range, placeholder: string }` \| `null` describing the range of the string to rename and optionally a placeholder text of the string content to be renamed. If `null` is returned then it is deemed that a 'textDocument/rename' request is not valid at the given position.
+* error: code and message set in case an exception happens during the prepare rename request.
+
+#### <a href="#textDocument_foldingRange" name="textDocument_foldingRange" class="anchor">Folding Range Request (:leftwards_arrow_with_hook:)</a>
+
+> *Since version 3.10.0*
+
+The folding range request is sent from the client to the server to return all folding ranges found in a given text document.
+
+_Request_:
+
+* method: 'textDocument/foldingRange'
+* params: `FoldingRangeParams` defined as follows
+
+```typescript
+export interface FoldingRangeParams {
+	/**
+	 * The text document.
+	 */
+	textDocument: TextDocumentIdentifier;
+}
+
+```
+
+_Response_:
+* result: `FoldingRange[] | null` defined as follows:
+
+```typescript
+/**
+ * Enum of known range kinds
+ */
+export enum FoldingRangeKind {
+	/**
+	 * Folding range for a comment
+	 */
+	Comment = 'comment',
+	/**
+	 * Folding range for a imports or includes
+	 */
+	Imports = 'imports',
+	/**
+	 * Folding range for a region (e.g. `#region`)
+	 */
+	Region = 'region'
+}
+
+/**
+ * Represents a folding range.
+ */
+export interface FoldingRange {
+
+	/**
+	 * The zero-based line number from where the folded range starts.
+	 */
+	startLine: number;
+
+	/**
+	 * The zero-based character offset from where the folded range starts. If not defined, defaults to the length of the start line.
+	 */
+	startCharacter?: number;
+
+	/**
+	 * The zero-based line number where the folded range ends.
+	 */
+	endLine: number;
+
+	/**
+	 * The zero-based character offset before the folded range ends. If not defined, defaults to the length of the end line.
+	 */
+	endCharacter?: number;
+
+	/**
+	 * Describes the kind of the folding range such as `comment' or 'region'. The kind
+	 * is used to categorize folding ranges and used by commands like 'Fold all comments'. See
+	 * [FoldingRangeKind](#FoldingRangeKind) for an enumeration of standardized kinds.
+	 */
+	kind?: string;
+}
+```
+
+* error: code and message set in case an exception happens during the 'textDocument/foldingRange' request
+
+### Implementation considerations
+
+Language servers usually run in a separate process and client communicate with them in an asynchronous fashion. Additionally clients usually allow users to interact with the source code even if request results are pending. We recommend the following implementation pattern to avoid that clients apply outdated response results:
+
+- if a client sends a request to the server and the client state changes in a way that the result will be invalid it should cancel the server request and ignore the result. If necessary it can resend the request to receive an up to date result.
+- if a server detects a state change that invalidates the result of a request in execution the server can error these requests with `ContentModified`. If clients receive a `ContentModified` error, it generally should not show it in the UI for the end-user. Clients can resend the request if appropriate.
+- if servers end up in an inconsistent state they should log this to the client using the `window/logMessage` request. If they can't recover from this the best they can do right now is to exit themselves. We are considering an [extension to the protocol](https://github.com/Microsoft/language-server-protocol/issues/646) that allows servers to request a restart on the client side.
+- if a client notices that a server exists unexpectedly it should try to restart the server. However clients should be careful to not restart a crashing server endlessly. VS Code for example doesn't restart a server if it crashes 5 times in the last 180 seconds.
+
+### <a href="#changeLog" name="changeLog" class="anchor">Change Log</a>
+
+#### <a href="#version_3_14_0" name="version_3_14_0" class="anchor">3.14.0 (12/13/2018)</a>
+
+* Add support for signature label offsets.
+* Add support for location links.
+* Add support for `textDocument/declaration` request.
+
+#### <a href="#version_3_13_0" name="version_3_13_0" class="anchor">3.13.0 (9/11/2018)</a>
+
+* Add support for file and folder operations (create, rename, move) to workspace edits.
+
+#### <a href="#version_3_12_0" name="version_3_12_0" class="anchor">3.12.0 (8/23/2018)</a>
+
+* Add support for `textDocument/prepareRename` request.
+
+#### <a href="#version_3_11_0" name="version_3_11_0" class="anchor">3.11.0 (8/21/2018)</a>
+
+* Add support for CodeActionOptions to allow a server to provide a list of code action it supports.
+
+#### <a href="#version_3_10_0" name="version_3_10_0" class="anchor">3.10.0 (7/23/2018)</a>
+
+* Add support for hierarchical document symbols as a valid response to a `textDocument/documentSymbol` request.
+* Add support for folding ranges as a valid response to a `textDocument/foldingRange` request.
+
+#### <a href="#version_3_9_0" name="version_3_9_0" class="anchor">3.9.0 (7/10/2018)</a>
+
+* Add support for `preselect` property in `CompletionItem`
+
+#### <a href="#version_3_8_0" name="version_3_8_0" class="anchor">3.8.0 (6/11/2018)</a>
+
+* Added support for CodeAction literals to the `textDocument/codeAction` request.
+* ColorServerCapabilities.colorProvider can also be a boolean
+* Corrected ColorPresentationParams.colorInfo to color (as in the `d.ts` and in implementations)
+
+#### <a href="#version_3_7_0" name="version_3_7_0" class="anchor">3.7.0 (4/5/2018)</a>
+
+* Added support for related information to Diagnostics.
+
+#### <a href="#version_3_6_0" name="version_3_6_0" class="anchor">3.6.0 (2/22/2018)</a>
+
+Merge the proposed protocol for workspace folders, configuration, go to type definition, go to implementation and document color provider into the main branch of the specification. For details see:
+
+* [Get Workspace Folders](https://microsoft.github.io/language-server-protocol/specification#workspace_workspaceFolders)
+* [DidChangeWorkspaceFolders Notification](https://microsoft.github.io/language-server-protocol/specification#workspace_didChangeWorkspaceFolders)
+* [Get Configuration](https://microsoft.github.io/language-server-protocol/specification#workspace_configuration)
+* [Go to Type Definition](https://microsoft.github.io/language-server-protocol/specification#textDocument_typeDefinition)
+* [Go to Implementation](https://microsoft.github.io/language-server-protocol/specification#textDocument_implementation)
+* [Document Color](https://microsoft.github.io/language-server-protocol/specification#textDocument_documentColor)
+* [Color Presentation](https://microsoft.github.io/language-server-protocol/specification#textDocument_colorPresentation)
+
+In addition we enhanced the `CompletionTriggerKind` with a new value `TriggerForIncompleteCompletions: 3 = 3` to signal the a completion request got trigger since the last result was incomplete.
+
+#### <a href="#version_3_5_0" name="version_3_5_0" class="anchor">3.5.0</a>
+
+Decided to skip this version to bring the protocol version number in sync the with npm module vscode-languageserver-protocol.
+
+#### <a href="#version_3_4_0" name="version_3_4_0" class="anchor">3.4.0 (11/27/2017)</a>
+
+* [extensible completion item and symbol kinds](https://github.com/Microsoft/language-server-protocol/issues/129)
+
+#### <a href="version_3_3_0" name="version_3_3_0" class="anchor">3.3.0 (11/24/2017)</a>
+
+* Added support for `CompletionContext`
+* Added support for `MarkupContent`
+* Removed old New and Updated markers.
+
+#### <a href="version_3_2_0" name="version_3_2_0" class="anchor">3.2.0 (09/26/2017)</a>
+
+* Added optional `commitCharacters` property to the `CompletionItem`
+
+#### <a href="version_3_1_0" name="version_3_1_0" class="anchor">3.1.0 (02/28/2017)</a>
+
+* Make the `WorkspaceEdit` changes backwards compatible.
+* Updated the specification to correctly describe the breaking changes from 2.x to 3.x around `WorkspaceEdit`and `TextDocumentEdit`.
+
+#### <a href="#version_3_0_0" name="version_3_0_0" class="anchor">3.0 Version</a>
+
+- add support for client feature flags to support that servers can adapt to different client capabilities. An example is the new `textDocument/willSaveWaitUntil` request which not all clients might be able to support. If the feature is disabled in the client capabilities sent on the initialize request, the server can't rely on receiving the request.
+- add support to experiment with new features. The new `ClientCapabilities.experimental` section together with feature flags allow servers to provide experimental feature without the need of ALL clients to adopt them immediately.
+- servers can more dynamically react to client features. Capabilities can now be registered and unregistered after the initialize request using the new `client/registerCapability` and `client/unregisterCapability`. This for example allows servers to react to settings or configuration changes without a restart.
+- add support for `textDocument/willSave` notification and `textDocument/willSaveWaitUntil` request.
+- add support for `textDocument/documentLink` request.
+- add a `rootUri` property to the initializeParams in favor of the `rootPath` property.
diff --git a/pkg/analysis_server/tool/lsp_spec/typescript.dart b/pkg/analysis_server/tool/lsp_spec/typescript.dart
index 6ff12a9..afa5b76 100644
--- a/pkg/analysis_server/tool/lsp_spec/typescript.dart
+++ b/pkg/analysis_server/tool/lsp_spec/typescript.dart
@@ -64,6 +64,11 @@
     },
     "ResponseError": {
       "code": "ErrorCodes",
+      // This is dynamic normally, but since this class can be serialised
+      // we will crash if it data is set to something that can't be converted to
+      // JSON (for ex. Uri) so this forces anyone setting this to convert to a
+      // String.
+      "data": "String",
     },
     "NotificationMessage": {
       "method": "Method",
@@ -89,6 +94,21 @@
   return interface != null ? interface[fieldName] : null;
 }
 
+/// Improves comments in generated code to support where types may have been
+/// altered (for ex. with [getImprovedType] above).
+String getImprovedComment(String interfaceName, String fieldName) {
+  const Map<String, Map<String, String>> _improvedComments = {
+    "ResponseError": {
+      "data":
+          "// A string that contains additional information about the error. Can be omitted.",
+    },
+  };
+
+  final interface = _improvedComments[interfaceName];
+
+  return interface != null ? interface[fieldName] : null;
+}
+
 List<String> getSpecialBaseTypes(Interface interface) {
   if (interface.name == 'RequestMessage' ||
       interface.name == 'NotificationMessage') {
diff --git a/pkg/analysis_server/tool/lsp_spec/typescript_parser.dart b/pkg/analysis_server/tool/lsp_spec/typescript_parser.dart
index bd303e1..2412309 100644
--- a/pkg/analysis_server/tool/lsp_spec/typescript_parser.dart
+++ b/pkg/analysis_server/tool/lsp_spec/typescript_parser.dart
@@ -306,6 +306,12 @@
     type = _type(containerName, name.lexeme,
         includeUndefined: canBeUndefined, improveTypes: true);
 
+    // Overwrite comment if we have an improved one.
+    final improvedComment = getImprovedComment(containerName, name.lexeme);
+    leadingComment = improvedComment != null
+        ? new Comment(new Token(TokenType.COMMENT, improvedComment))
+        : leadingComment;
+
     // Some fields have weird comments like this in the spec:
     //     {@link MessageType}
     // These seem to be the correct type of the field, while the field is
diff --git a/pkg/analyzer/CHANGELOG.md b/pkg/analyzer/CHANGELOG.md
index 5a574ca..f7ff184 100644
--- a/pkg/analyzer/CHANGELOG.md
+++ b/pkg/analyzer/CHANGELOG.md
@@ -1,6 +1,32 @@
+## 0.35.0
+* Added support in the AST structure for the control_flow_collections and
+  spread_collections experiments. This includes adding new visitor methods to
+  `AstVisitor`, which will need to be implemented by any classes that implement
+  `AstVisitor` directly. Concrete implementations were added to other visitor
+  classes (such as `RecursiveAstVisitor`) so that clients that extend those
+  other classes will not be impacted.
+* Removed `EMPTY_LIST` constants.  Please use `const <...>[]` instead.
+* Disabled support for the task model.  Please use the new `AnalysisSession`
+  API.
+* Removed `StrongTypeSystemImpl`.  Please use `Dart2TypeSystem` instead.
+
 ## 0.34.2
 * Removed support for the `@checked` annotation.  Please use the `covariant`
-  keyword instead.
+  keyword instead (#28797).
+* Did additional work on the new set_literals and constant_update_2018 features.
+* Began adding a string representation of initializer expressions to summaries
+  (#35418).
+* Added a pub aware workspace so that pub packages can be handled properly.
+* Added logging in an effort to track down #35551.
+* Split off DEPRECATED_MEMBER_USE_FROM_SAME_PACKAGE from DEPRECATED_MEMBER_USE
+  (#30084).
+* Removed the unused hint code INVALID_ASSIGNMENT.
+* Added a hint enforcing the contract of `@literal`:
+  NON_CONST_CALL_TO_LITERAL_CONSTRUCTOR.
+* Added a hint INVALID_LITERAL_ANNOTATION (#34259).
+* Fixed handling of @immutable on mixins.
+* Did work on @sealed annotation for classes and mixins.
+* Bug fixes: #25860, #29394, #33930, #35090, #35441, #35458, #35467, #35548.
 
 ## 0.34.1
 * Added logic to report a hint if a deprecated lint is specified in the user's
diff --git a/pkg/analyzer/lib/dart/analysis/results.dart b/pkg/analyzer/lib/dart/analysis/results.dart
index 55defb7..7f82c94 100644
--- a/pkg/analyzer/lib/dart/analysis/results.dart
+++ b/pkg/analyzer/lib/dart/analysis/results.dart
@@ -89,7 +89,7 @@
 /// those discovered during scanning and parsing.
 ///
 /// Clients may not extend, implement or mix-in this class.
-// ignore: deprecated_member_use
+// ignore: deprecated_member_use_from_same_package
 abstract class ParsedUnitResult implements ParseResult {}
 
 /// The result of parsing of a single file. The errors returned include only
@@ -128,7 +128,7 @@
 /// include both syntactic and semantic errors.
 ///
 /// Clients may not extend, implement or mix-in this class.
-// ignore: deprecated_member_use
+// ignore: deprecated_member_use_from_same_package
 abstract class ResolvedUnitResult implements ResolveResult {}
 
 /// The result of building a resolved AST for a single file. The errors returned
diff --git a/pkg/analyzer/lib/dart/ast/ast.dart b/pkg/analyzer/lib/dart/ast/ast.dart
index 2378850..1094872 100644
--- a/pkg/analyzer/lib/dart/ast/ast.dart
+++ b/pkg/analyzer/lib/dart/ast/ast.dart
@@ -444,12 +444,6 @@
  */
 abstract class AstNode implements SyntacticEntity {
   /**
-   * An empty list of AST nodes.
-   */
-  @deprecated
-  static const List<AstNode> EMPTY_LIST = const <AstNode>[];
-
-  /**
    * A comparator that can be used to sort AST nodes in lexical order. In other
    * words, `compare` will return a negative value if the offset of the first
    * node is less than the offset of the second node, zero (0) if the nodes have
@@ -620,6 +614,10 @@
 
   R visitClassTypeAlias(ClassTypeAlias node);
 
+  R visitCollectionForElement(CollectionForElement node);
+
+  R visitCollectionIfElement(CollectionIfElement node);
+
   R visitComment(Comment node);
 
   R visitCommentReference(CommentReference node);
@@ -668,12 +666,22 @@
 
   R visitFieldFormalParameter(FieldFormalParameter node);
 
+  R visitForEachPartsWithDeclaration(ForEachPartsWithDeclaration node);
+
+  R visitForEachPartsWithIdentifier(ForEachPartsWithIdentifier node);
+
   R visitForEachStatement(ForEachStatement node);
 
   R visitFormalParameterList(FormalParameterList node);
 
+  R visitForPartsWithDeclarations(ForPartsWithDeclarations node);
+
+  R visitForPartsWithExpression(ForPartsWithExpression node);
+
   R visitForStatement(ForStatement node);
 
+  R visitForStatement2(ForStatement2 node);
+
   R visitFunctionDeclaration(FunctionDeclaration node);
 
   R visitFunctionDeclarationStatement(FunctionDeclarationStatement node);
@@ -720,8 +728,16 @@
 
   R visitListLiteral(ListLiteral node);
 
+  R visitListLiteral2(ListLiteral2 node);
+
+  R visitMapForElement(MapForElement node);
+
+  R visitMapIfElement(MapIfElement node);
+
   R visitMapLiteral(MapLiteral node);
 
+  R visitMapLiteral2(MapLiteral2 node);
+
   R visitMapLiteralEntry(MapLiteralEntry node);
 
   R visitMethodDeclaration(MethodDeclaration node);
@@ -765,6 +781,8 @@
 
   R visitSetLiteral(SetLiteral node);
 
+  R visitSetLiteral2(SetLiteral2 node);
+
   R visitShowCombinator(ShowCombinator node);
 
   R visitSimpleFormalParameter(SimpleFormalParameter node);
@@ -773,6 +791,8 @@
 
   R visitSimpleStringLiteral(SimpleStringLiteral node);
 
+  R visitSpreadElement(SpreadElement node);
+
   R visitStringInterpolation(StringInterpolation node);
 
   R visitSuperConstructorInvocation(SuperConstructorInvocation node);
@@ -1308,6 +1328,8 @@
 
 /**
  * The declaration of a class or mixin.
+ *
+ * Clients may not extend, implement or mix-in this class.
  */
 abstract class ClassOrMixinDeclaration extends NamedCompilationUnitMember {
   @override
@@ -1437,6 +1459,42 @@
 }
 
 /**
+ * An element in a literal list or literal set.
+ *
+ *    collectionElement ::=
+ *        [Expression]
+ *      | [IfElement<CollectionElement>]
+ *      | [ForElement<CollectionElement>]
+ *      | [SpreadElement]
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+abstract class CollectionElement implements AstNode {}
+
+/**
+ * A for element in a literal list or literal set.
+ *
+ *    forElement ::=
+ *        'await'? 'for' '(' [ForLoopParts] ')' [CollectionElement | MapElement]
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+abstract class CollectionForElement
+    implements CollectionElement, ForElement<CollectionElement> {}
+
+/**
+ * An if element in a literal list or literal set.
+ *
+ *    ifElement ::=
+ *        'if' '(' [Expression] ')' [CollectionElement]
+ *        ( 'else' [CollectionElement] )?
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+abstract class CollectionIfElement
+    implements CollectionElement, IfElement<CollectionElement> {}
+
+/**
  * A combinator associated with an import or export directive.
  *
  *    combinator ::=
@@ -2118,7 +2176,7 @@
  *
  * Clients may not extend, implement or mix-in this class.
  */
-abstract class ConstructorReferenceNode {
+abstract class ConstructorReferenceNode implements AstNode {
   /**
    * Return the element associated with the referenced constructor based on
    * static type information, or `null` if the AST structure has not been
@@ -2623,13 +2681,7 @@
  *
  * Clients may not extend, implement or mix-in this class.
  */
-abstract class Expression extends AstNode {
-  /**
-   * An empty list of expressions.
-   */
-  @deprecated
-  static const List<Expression> EMPTY_LIST = const <Expression>[];
-
+abstract class Expression implements CollectionElement {
   /**
    * Return the best parameter element information available for this
    * expression. If type propagation was able to find a better parameter element
@@ -2981,12 +3033,66 @@
 }
 
 /**
+ * The parts of a for-each loop that control the iteration.
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+abstract class ForEachParts implements ForLoopParts {
+  /**
+   * Return the token representing the 'in' keyword.
+   */
+  Token get inKeyword;
+
+  /**
+   * Return the expression evaluated to produce the iterator.
+   */
+  Expression get iterable;
+}
+
+/**
+ * The parts of a for-each loop that control the iteration when the loop
+ * variable is declared as part of the for loop.
+ *
+ *   forLoopParts ::=
+ *       [DeclaredIdentifier] 'in' [Expression]
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+abstract class ForEachPartsWithDeclaration implements ForEachParts {
+  /**
+   * Return the declaration of the loop variable.
+   */
+  DeclaredIdentifier get loopVariable;
+}
+
+/**
+ * The parts of a for-each loop that control the iteration when the loop
+ * variable is declared outside of the for loop.
+ *
+ *   forLoopParts ::=
+ *       [SimpleIdentifier] 'in' [Expression]
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+abstract class ForEachPartsWithIdentifier implements ForEachParts {
+  /**
+   * Return the loop variable.
+   */
+  SimpleIdentifier get identifier;
+}
+
+/**
  * A for-each statement.
  *
  *    forEachStatement ::=
  *        'await'? 'for' '(' [DeclaredIdentifier] 'in' [Expression] ')' [Block]
  *      | 'await'? 'for' '(' [SimpleIdentifier] 'in' [Expression] ')' [Block]
  *
+ * This is the class that is used to represent a for-each loop when neither the
+ * 'control-flow-collections' nor 'spread-collections' experiments are enabled.
+ * If either of those experiments are enabled, then [ForStatement2] will be
+ * used.
+ *
  * Clients may not extend, implement or mix-in this class.
  */
 abstract class ForEachStatement extends Statement {
@@ -3086,6 +3192,60 @@
 }
 
 /**
+ * The basic structure of a for element.
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+abstract class ForElement<E> implements AstNode {
+  /**
+   * Return the token representing the 'await' keyword, or `null` if there was
+   * no 'await' keyword.
+   */
+  Token get awaitKeyword;
+
+  /**
+   * Return the body of the loop.
+   */
+  E get body;
+
+  /**
+   * Return the token representing the 'for' keyword.
+   */
+  Token get forKeyword;
+
+  /**
+   * Return the parts of the for element that control the iteration.
+   */
+  ForLoopParts get forLoopParts;
+
+  /**
+   * Return the left parenthesis.
+   */
+  Token get leftParenthesis;
+
+  /**
+   * Return the right parenthesis.
+   */
+  Token get rightParenthesis;
+}
+
+/**
+ * The parts of a for or for-each loop that control the iteration.
+ *
+ *   forLoopParts ::=
+ *       [VariableDeclaration] ';' [Expression]? ';' expressionList?
+ *     | [Expression]? ';' [Expression]? ';' expressionList?
+ *     | [DeclaredIdentifier] 'in' [Expression]
+ *     | [SimpleIdentifier] 'in' [Expression]
+ *
+ *   expressionList ::=
+ *       [Expression] (',' [Expression])*
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+abstract class ForLoopParts implements AstNode {}
+
+/**
  * A node representing a parameter to a function.
  *
  *    formalParameter ::=
@@ -3265,6 +3425,71 @@
 }
 
 /**
+ * The parts of a for loop that control the iteration.
+ *
+ *   forLoopParts ::=
+ *       [VariableDeclaration] ';' [Expression]? ';' expressionList?
+ *     | [Expression]? ';' [Expression]? ';' expressionList?
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+abstract class ForParts implements ForLoopParts {
+  /**
+   * Return the condition used to determine when to terminate the loop, or
+   * `null` if there is no condition.
+   */
+  Expression get condition;
+
+  /**
+   * Return the semicolon separating the initializer and the condition.
+   */
+  Token get leftSeparator;
+
+  /**
+   * Return the semicolon separating the condition and the updater.
+   */
+  Token get rightSeparator;
+
+  /**
+   * Return the list of expressions run after each execution of the loop body.
+   */
+  NodeList<Expression> get updaters;
+}
+
+/**
+ * The parts of a for loop that control the iteration when there are one or more
+ * variable declarations as part of the for loop.
+ *
+ *   forLoopParts ::=
+ *       [VariableDeclarationList] ';' [Expression]? ';' expressionList?
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+abstract class ForPartsWithDeclarations implements ForParts {
+  /**
+   * Return the declaration of the loop variables.
+   */
+  VariableDeclarationList get variables;
+}
+
+/**
+ * The parts of a for loop that control the iteration when there are no variable
+ * declarations as part of the for loop.
+ *
+ *   forLoopParts ::=
+ *       [Expression]? ';' [Expression]? ';' expressionList?
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+abstract class ForPartsWithExpression implements ForParts {
+  /**
+   * Return the initialization expression, or `null` if there is no
+   * initialization expression.
+   */
+  Expression get initialization;
+}
+
+/**
  * A for statement.
  *
  *    forStatement ::=
@@ -3277,6 +3502,11 @@
  *        [DefaultFormalParameter]
  *      | [Expression]?
  *
+ * This is the class that is used to represent a for loop when neither the
+ * 'control-flow-collections' nor 'spread-collections' experiments are enabled.
+ * If either of those experiments are enabled, then [ForStatement2] will be
+ * used.
+ *
  * Clients may not extend, implement or mix-in this class.
  */
 abstract class ForStatement extends Statement {
@@ -3383,6 +3613,58 @@
 }
 
 /**
+ * A for or for-each statement.
+ *
+ *    forStatement ::=
+ *        'for' '(' forLoopParts ')' [Statement]
+ *
+ *    forLoopParts ::=
+ *       [VariableDeclaration] ';' [Expression]? ';' expressionList?
+ *     | [Expression]? ';' [Expression]? ';' expressionList?
+ *     | [DeclaredIdentifier] 'in' [Expression]
+ *     | [SimpleIdentifier] 'in' [Expression]
+ *
+ * This is the class that is used to represent a for loop when either the
+ * 'control-flow-collections' or 'spread-collections' experiments are enabled.
+ * If neither of those experiments are enabled, then either [ForStatement] or
+ * [ForEachStatement] will be used.
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+abstract class ForStatement2 extends Statement {
+  /**
+   * Return the token representing the 'await' keyword, or `null` if there is no
+   * 'await' keyword.
+   */
+  Token get awaitKeyword;
+
+  /**
+   * Return the body of the loop.
+   */
+  Statement get body;
+
+  /**
+   * Return the token representing the 'for' keyword.
+   */
+  Token get forKeyword;
+
+  /**
+   * Return the parts of the for element that control the iteration.
+   */
+  ForLoopParts get forLoopParts;
+
+  /**
+   * Return the left parenthesis.
+   */
+  Token get leftParenthesis;
+
+  /**
+   * Return the right parenthesis.
+   */
+  Token get rightParenthesis;
+}
+
+/**
  * A node representing the body of a function or method.
  *
  *    functionBody ::=
@@ -3984,6 +4266,51 @@
 }
 
 /**
+ * The basic structure of an if element.
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+abstract class IfElement<E> implements AstNode {
+  /**
+   * Return the condition used to determine which of the statements is executed
+   * next.
+   */
+  Expression get condition;
+
+  /**
+   * Return the statement that is executed if the condition evaluates to
+   * `false`, or `null` if there is no else statement.
+   */
+  E get elseElement;
+
+  /**
+   * Return the token representing the 'else' keyword, or `null` if there is no
+   * else statement.
+   */
+  Token get elseKeyword;
+
+  /**
+   * Return the token representing the 'if' keyword.
+   */
+  Token get ifKeyword;
+
+  /**
+   * Return the left parenthesis.
+   */
+  Token get leftParenthesis;
+
+  /**
+   * Return the right parenthesis.
+   */
+  Token get rightParenthesis;
+
+  /**
+   * Return the statement that is executed if the condition evaluates to `true`.
+   */
+  E get thenElement;
+}
+
+/**
  * An if statement.
  *
  *    ifStatement ::=
@@ -4791,6 +5118,10 @@
  *    listLiteral ::=
  *        'const'? ('<' [TypeAnnotation] '>')? '[' ([Expression] ','?)? ']'
  *
+ * This is the class that is used to represent a list literal when neither the
+ * 'control-flow-collections' nor 'spread-collections' experiments are enabled.
+ * If either of those experiments are enabled, then [ListLiteral2] will be used.
+ *
  * Clients may not extend, implement or mix-in this class.
  */
 abstract class ListLiteral extends TypedLiteral {
@@ -4821,6 +5152,46 @@
 }
 
 /**
+ * A list literal.
+ *
+ *    listLiteral ::=
+ *        'const'? ('<' [TypeAnnotation] '>')?
+ *        '[' ([CollectionElement] ','?)? ']'
+ *
+ * This is the class that is used to represent a list literal when either the
+ * 'control-flow-collections' or 'spread-collections' experiments are enabled.
+ * If neither of those experiments are enabled, then [ListLiteral] will be used.
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+abstract class ListLiteral2 extends TypedLiteral {
+  /**
+   * Return the expressions used to compute the elements of the list.
+   */
+  NodeList<CollectionElement> get elements;
+
+  /**
+   * Return the left square bracket.
+   */
+  Token get leftBracket;
+
+  /**
+   * Set the left square bracket to the given [token].
+   */
+  void set leftBracket(Token token);
+
+  /**
+   * Return the right square bracket.
+   */
+  Token get rightBracket;
+
+  /**
+   * Set the right square bracket to the given [token].
+   */
+  void set rightBracket(Token token);
+}
+
+/**
  * A node that represents a literal expression.
  *
  *    literal ::=
@@ -4837,12 +5208,49 @@
 abstract class Literal extends Expression {}
 
 /**
+ * An element in a literal map.
+ *
+ *    mapElement ::=
+ *        [Expression]
+ *      | [IfElement<MapElement>]
+ *      | [ForElement<MapElement>]
+ *      | [SpreadElement]
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+abstract class MapElement implements AstNode {}
+
+/**
+ * A for element in a literal map.
+ *
+ *    forElement ::=
+ *        'await'? 'for' '(' [ForLoopParts] ')' [CollectionElement | MapElement]
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+abstract class MapForElement implements ForElement<MapElement>, MapElement {}
+
+/**
+ * An if element in a map in a literal map.
+ *
+ *    ifElement ::=
+ *        'if' '(' [Expression] ')' [MapElement] ( 'else' [MapElement] )?
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+abstract class MapIfElement implements IfElement<MapElement>, MapElement {}
+
+/**
  * A literal map.
  *
  *    mapLiteral ::=
  *        'const'? ('<' [TypeAnnotation] (',' [TypeAnnotation])* '>')?
  *        '{' ([MapLiteralEntry] (',' [MapLiteralEntry])* ','?)? '}'
  *
+ * This is the class that is used to represent a map literal when neither the
+ * 'control-flow-collections' nor 'spread-collections' experiments are enabled.
+ * If either of those experiments are enabled, then [MapLiteral2] will be used.
+ *
  * Clients may not extend, implement or mix-in this class.
  */
 abstract class MapLiteral extends TypedLiteral {
@@ -4873,6 +5281,46 @@
 }
 
 /**
+ * A literal map.
+ *
+ *    mapLiteral ::=
+ *        'const'? ('<' [TypeAnnotation] (',' [TypeAnnotation])* '>')?
+ *        '{' ([MapElement] (',' [MapElement])* ','?)? '}'
+ *
+ * This is the class that is used to represent a map literal when either the
+ * 'control-flow-collections' or 'spread-collections' experiments are enabled.
+ * If neither of those experiments are enabled, then [MapLiteral] will be used.
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+abstract class MapLiteral2 extends TypedLiteral {
+  /**
+   * Return the entries in the map.
+   */
+  NodeList<MapElement> get entries;
+
+  /**
+   * Return the left curly bracket.
+   */
+  Token get leftBracket;
+
+  /**
+   * Set the left curly bracket to the given [token].
+   */
+  void set leftBracket(Token token);
+
+  /**
+   * Return the right curly bracket.
+   */
+  Token get rightBracket;
+
+  /**
+   * Set the right curly bracket to the given [token].
+   */
+  void set rightBracket(Token token);
+}
+
+/**
  * A single key/value pair in a map literal.
  *
  *    mapLiteralEntry ::=
@@ -4880,7 +5328,7 @@
  *
  * Clients may not extend, implement or mix-in this class.
  */
-abstract class MapLiteralEntry extends AstNode {
+abstract class MapLiteralEntry implements MapElement {
   /**
    * Return the expression computing the key with which the value will be
    * associated.
@@ -5150,7 +5598,7 @@
  *
  * Clients may not extend, implement or mix-in this class.
  */
-abstract class MethodReferenceExpression {
+abstract class MethodReferenceExpression implements AstNode {
   /**
    * Return the best element available for this expression. If resolution was
    * able to find a better element based on type propagation, that element will
@@ -6067,6 +6515,10 @@
  *        '{' [Expression] (',' [Expression])* ','? '}'
  *      | 'const'? ('<' [TypeAnnotation] '>')? '{' '}'
  *
+ * This is the class that is used to represent a set literal when neither the
+ * 'control-flow-collections' nor 'spread-collections' experiments are enabled.
+ * If either of those experiments are enabled, then [SetLiteral2] will be used.
+ *
  * Clients may not extend, implement or mix-in this class.
  */
 abstract class SetLiteral extends TypedLiteral {
@@ -6097,6 +6549,47 @@
 }
 
 /**
+ * A literal set.
+ *
+ *    setLiteral ::=
+ *        'const'? ('<' [TypeAnnotation] '>')?
+ *        '{' [CollectionElement] (',' [CollectionElement])* ','? '}'
+ *      | 'const'? ('<' [TypeAnnotation] '>')? '{' '}'
+ *
+ * This is the class that is used to represent a set literal when either the
+ * 'control-flow-collections' or 'spread-collections' experiments are enabled.
+ * If neither of those experiments are enabled, then [SetLiteral] will be used.
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+abstract class SetLiteral2 extends TypedLiteral {
+  /**
+   * Return the expressions used to compute the elements of the set.
+   */
+  NodeList<CollectionElement> get elements;
+
+  /**
+   * Return the left curly bracket.
+   */
+  Token get leftBracket;
+
+  /**
+   * Set the left curly bracket to the given [token].
+   */
+  void set leftBracket(Token token);
+
+  /**
+   * Return the right curly bracket.
+   */
+  Token get rightBracket;
+
+  /**
+   * Set the right curly bracket to the given [token].
+   */
+  void set rightBracket(Token token);
+}
+
+/**
  * A combinator that restricts the names being imported to those in a given list.
  *
  *    showCombinator ::=
@@ -6319,6 +6812,26 @@
 }
 
 /**
+ * A spread element.
+ *
+ *    spreadElement:
+ *        ( '...' | '...?' ) [Expression]
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+abstract class SpreadElement implements CollectionElement, MapElement {
+  /**
+   * The expression used to compute the collection being spread.
+   */
+  Expression get expression;
+
+  /**
+   * The spread operator, either '...' or '...?'.
+   */
+  Token get spreadOperator;
+}
+
+/**
  * A node that represents a statement.
  *
  *    statement ::=
diff --git a/pkg/analyzer/lib/dart/ast/ast_factory.dart b/pkg/analyzer/lib/dart/ast/ast_factory.dart
index 1a49333..fee50cb 100644
--- a/pkg/analyzer/lib/dart/ast/ast_factory.dart
+++ b/pkg/analyzer/lib/dart/ast/ast_factory.dart
@@ -185,6 +185,31 @@
       Token semicolon);
 
   /**
+   * Returns a newly created for element that can be part of a list or set
+   * literal.
+   */
+  CollectionForElement collectionForElement(
+      {Token awaitKeyword,
+      Token forKeyword,
+      Token leftParenthesis,
+      ForLoopParts forLoopParts,
+      Token rightParenthesis,
+      CollectionElement body});
+
+  /**
+   * Returns a newly created if element that can be part of a list or set
+   * literal.
+   */
+  CollectionIfElement collectionIfElement(
+      {Token ifKeyword,
+      Token leftParenthesis,
+      Expression condition,
+      Token rightParenthesis,
+      CollectionElement thenElement,
+      Token elseKeyword,
+      CollectionElement elseElement});
+
+  /**
    * Returns a newly created reference to a Dart element. The [newKeyword]
    * can be `null` if the reference is not to a constructor.
    */
@@ -384,6 +409,7 @@
       List<Configuration> configurations,
       List<Combinator> combinators,
       Token semicolon);
+
   /**
    * Returns a newly created function body consisting of a block of
    * statements. The [keyword] can be `null` if the function body is not an
@@ -474,6 +500,19 @@
       FormalParameterList parameters});
 
   /**
+   * Returns a newly created for each part that includes a declaration.
+   */
+  ForEachPartsWithDeclaration forEachPartsWithDeclaration(
+      {DeclaredIdentifier loopVariable, Token inKeyword, Expression iterable});
+
+  /**
+   * Returns a newly created for each part that includes an identifier that is
+   * declared outside of the loop.
+   */
+  ForEachPartsWithIdentifier forEachPartsWithIdentifier(
+      {SimpleIdentifier identifier, Token inKeyword, Expression iterable});
+
+  /**
    * Returns a newly created for-each statement whose loop control variable
    * is declared internally (in the for-loop part). The [awaitKeyword] can be
    * `null` if this is not an asynchronous for loop.
@@ -516,6 +555,26 @@
       Token rightParenthesis);
 
   /**
+   * Returns a newly created for part that includes a declaration.
+   */
+  ForPartsWithDeclarations forPartsWithDeclarations(
+      {VariableDeclarationList variables,
+      Token leftSeparator,
+      Expression condition,
+      Token rightSeparator,
+      List<Expression> updaters});
+
+  /**
+   * Returns a newly created for part that includes an expression.
+   */
+  ForPartsWithExpression forPartsWithExpression(
+      {Expression initialization,
+      Token leftSeparator,
+      Expression condition,
+      Token rightSeparator,
+      List<Expression> updaters});
+
+  /**
    * Returns a newly created for statement. Either the [variableList] or the
    * [initialization] must be `null`. Either the [condition] and the list of
    * [updaters] can be `null` if the loop does not have the corresponding
@@ -534,6 +593,17 @@
       Statement body);
 
   /**
+   * Returns a newly created for statement.
+   */
+  ForStatement2 forStatement2(
+      {Token awaitKeyword,
+      Token forKeyword,
+      Token leftParenthesis,
+      ForLoopParts forLoopParts,
+      Token rightParenthesis,
+      Statement body});
+
+  /**
    * Returns a newly created function declaration. Either or both of the
    * [comment] and [metadata] can be `null` if the function does not have the
    * corresponding attribute. The [externalKeyword] can be `null` if the
@@ -764,6 +834,39 @@
       Token leftBracket, List<Expression> elements, Token rightBracket);
 
   /**
+   * Returns a newly created list literal.
+   */
+  ListLiteral2 listLiteral2(
+      {Token constKeyword,
+      TypeArgumentList typeArguments,
+      Token leftBracket,
+      List<CollectionElement> elements,
+      Token rightBracket});
+
+  /**
+   * Returns a newly created for element that can be part of a map literal.
+   */
+  MapForElement mapForElement(
+      {Token awaitKeyword,
+      Token forKeyword,
+      Token leftParenthesis,
+      ForLoopParts forLoopParts,
+      Token rightParenthesis,
+      MapElement body});
+
+  /**
+   * Returns a newly created if element that can be part of a map literal.
+   */
+  MapIfElement mapIfElement(
+      {Token ifKeyword,
+      Token leftParenthesis,
+      Expression condition,
+      Token rightParenthesis,
+      MapElement thenElement,
+      Token elseKeyword,
+      MapElement elseElement});
+
+  /**
    * Returns a newly created map literal. The [constKeyword] can be `null` if
    * the literal is not a constant. The [typeArguments] can be `null` if no type
    * arguments were declared. The [entries] can be `null` if the map is empty.
@@ -772,6 +875,16 @@
       Token leftBracket, List<MapLiteralEntry> entries, Token rightBracket);
 
   /**
+   * Returns a newly created map literal.
+   */
+  MapLiteral2 mapLiteral2(
+      {Token constKeyword,
+      TypeArgumentList typeArguments,
+      Token leftBracket,
+      List<MapElement> entries,
+      Token rightBracket});
+
+  /**
    * Returns a newly created map literal entry.
    */
   MapLiteralEntry mapLiteralEntry(
@@ -949,6 +1062,16 @@
       Token leftBracket, List<Expression> elements, Token rightBracket);
 
   /**
+   * Returns a newly created set literal.
+   */
+  SetLiteral2 setLiteral2(
+      {Token constKeyword,
+      TypeArgumentList typeArguments,
+      Token leftBracket,
+      List<CollectionElement> elements,
+      Token rightBracket});
+
+  /**
    * Returns a newly created import show combinator.
    */
   ShowCombinator showCombinator(
@@ -995,6 +1118,11 @@
   SimpleStringLiteral simpleStringLiteral(Token literal, String value);
 
   /**
+   * Returns a newly created spread element.
+   */
+  SpreadElement spreadElement({Token spreadOperator, Expression expression});
+
+  /**
    * Returns a newly created string interpolation expression.
    */
   StringInterpolation stringInterpolation(List<InterpolationElement> elements);
diff --git a/pkg/analyzer/lib/dart/ast/visitor.dart b/pkg/analyzer/lib/dart/ast/visitor.dart
index 53ff333..e1c77f4 100644
--- a/pkg/analyzer/lib/dart/ast/visitor.dart
+++ b/pkg/analyzer/lib/dart/ast/visitor.dart
@@ -205,6 +205,14 @@
   @override
   R visitClassTypeAlias(ClassTypeAlias node) => visitTypeAlias(node);
 
+  @override
+  R visitCollectionForElement(CollectionForElement node) =>
+      visitForElement<CollectionElement>(node);
+
+  @override
+  R visitCollectionIfElement(CollectionIfElement node) =>
+      visitIfElement<CollectionElement>(node);
+
   R visitCombinator(Combinator node) => visitNode(node);
 
   @override
@@ -298,17 +306,42 @@
   R visitFieldFormalParameter(FieldFormalParameter node) =>
       visitNormalFormalParameter(node);
 
+  R visitForEachParts(ForEachParts node) => visitNode(node);
+
+  @override
+  R visitForEachPartsWithDeclaration(ForEachPartsWithDeclaration node) =>
+      visitForEachParts(node);
+
+  @override
+  R visitForEachPartsWithIdentifier(ForEachPartsWithIdentifier node) =>
+      visitForEachParts(node);
+
   @override
   R visitForEachStatement(ForEachStatement node) => visitStatement(node);
 
+  R visitForElement<E>(ForElement<E> node) => visitNode(node);
+
   R visitFormalParameter(FormalParameter node) => visitNode(node);
 
   @override
   R visitFormalParameterList(FormalParameterList node) => visitNode(node);
 
+  R visitForParts(ForParts node) => visitNode(node);
+
+  @override
+  R visitForPartsWithDeclarations(ForPartsWithDeclarations node) =>
+      visitForParts(node);
+
+  @override
+  R visitForPartsWithExpression(ForPartsWithExpression node) =>
+      visitForParts(node);
+
   @override
   R visitForStatement(ForStatement node) => visitStatement(node);
 
+  @override
+  R visitForStatement2(ForStatement2 node) => visitStatement(node);
+
   R visitFunctionBody(FunctionBody node) => visitNode(node);
 
   @override
@@ -345,6 +378,8 @@
 
   R visitIdentifier(Identifier node) => visitExpression(node);
 
+  R visitIfElement<E>(IfElement<E> node) => visitNode(node);
+
   @override
   R visitIfStatement(IfStatement node) => visitStatement(node);
 
@@ -395,12 +430,24 @@
   @override
   R visitListLiteral(ListLiteral node) => visitTypedLiteral(node);
 
+  @override
+  R visitListLiteral2(ListLiteral2 node) => visitTypedLiteral(node);
+
   R visitLiteral(Literal node) => visitExpression(node);
 
   @override
+  R visitMapForElement(MapForElement node) => visitForElement<MapElement>(node);
+
+  @override
+  R visitMapIfElement(MapIfElement node) => visitIfElement<MapElement>(node);
+
+  @override
   R visitMapLiteral(MapLiteral node) => visitTypedLiteral(node);
 
   @override
+  R visitMapLiteral2(MapLiteral2 node) => visitTypedLiteral(node);
+
+  @override
   R visitMapLiteralEntry(MapLiteralEntry node) => visitNode(node);
 
   @override
@@ -483,6 +530,9 @@
   R visitSetLiteral(SetLiteral node) => visitTypedLiteral(node);
 
   @override
+  R visitSetLiteral2(SetLiteral2 node) => visitTypedLiteral(node);
+
+  @override
   R visitShowCombinator(ShowCombinator node) => visitCombinator(node);
 
   @override
@@ -499,6 +549,9 @@
   R visitSingleStringLiteral(SingleStringLiteral node) =>
       visitStringLiteral(node);
 
+  @override
+  R visitSpreadElement(SpreadElement node) => visitNode(node);
+
   R visitStatement(Statement node) => visitNode(node);
 
   @override
@@ -699,6 +752,18 @@
   }
 
   @override
+  R visitCollectionForElement(CollectionForElement node) {
+    node.visitChildren(this);
+    return null;
+  }
+
+  @override
+  R visitCollectionIfElement(CollectionIfElement node) {
+    node.visitChildren(this);
+    return null;
+  }
+
+  @override
   R visitComment(Comment node) {
     node.visitChildren(this);
     return null;
@@ -843,6 +908,18 @@
   }
 
   @override
+  R visitForEachPartsWithDeclaration(ForEachPartsWithDeclaration node) {
+    node.visitChildren(this);
+    return null;
+  }
+
+  @override
+  R visitForEachPartsWithIdentifier(ForEachPartsWithIdentifier node) {
+    node.visitChildren(this);
+    return null;
+  }
+
+  @override
   R visitForEachStatement(ForEachStatement node) {
     node.visitChildren(this);
     return null;
@@ -855,12 +932,30 @@
   }
 
   @override
+  R visitForPartsWithDeclarations(ForPartsWithDeclarations node) {
+    node.visitChildren(this);
+    return null;
+  }
+
+  @override
+  R visitForPartsWithExpression(ForPartsWithExpression node) {
+    node.visitChildren(this);
+    return null;
+  }
+
+  @override
   R visitForStatement(ForStatement node) {
     node.visitChildren(this);
     return null;
   }
 
   @override
+  R visitForStatement2(ForStatement2 node) {
+    node.visitChildren(this);
+    return null;
+  }
+
+  @override
   R visitFunctionDeclaration(FunctionDeclaration node) {
     node.visitChildren(this);
     return null;
@@ -999,12 +1094,36 @@
   }
 
   @override
+  R visitListLiteral2(ListLiteral2 node) {
+    node.visitChildren(this);
+    return null;
+  }
+
+  @override
+  R visitMapForElement(MapForElement node) {
+    node.visitChildren(this);
+    return null;
+  }
+
+  @override
+  R visitMapIfElement(MapIfElement node) {
+    node.visitChildren(this);
+    return null;
+  }
+
+  @override
   R visitMapLiteral(MapLiteral node) {
     node.visitChildren(this);
     return null;
   }
 
   @override
+  R visitMapLiteral2(MapLiteral2 node) {
+    node.visitChildren(this);
+    return null;
+  }
+
+  @override
   R visitMapLiteralEntry(MapLiteralEntry node) {
     node.visitChildren(this);
     return null;
@@ -1132,6 +1251,12 @@
   }
 
   @override
+  R visitSetLiteral2(SetLiteral2 node) {
+    node.visitChildren(this);
+    return null;
+  }
+
+  @override
   R visitShowCombinator(ShowCombinator node) {
     node.visitChildren(this);
     return null;
@@ -1156,6 +1281,12 @@
   }
 
   @override
+  R visitSpreadElement(SpreadElement node) {
+    node.visitChildren(this);
+    return null;
+  }
+
+  @override
   R visitStringInterpolation(StringInterpolation node) {
     node.visitChildren(this);
     return null;
@@ -1343,6 +1474,12 @@
   R visitClassTypeAlias(ClassTypeAlias node) => null;
 
   @override
+  R visitCollectionForElement(CollectionForElement node) => null;
+
+  @override
+  R visitCollectionIfElement(CollectionIfElement node) => null;
+
+  @override
   R visitComment(Comment node) => null;
 
   @override
@@ -1415,15 +1552,30 @@
   R visitFieldFormalParameter(FieldFormalParameter node) => null;
 
   @override
+  R visitForEachPartsWithDeclaration(ForEachPartsWithDeclaration node) => null;
+
+  @override
+  R visitForEachPartsWithIdentifier(ForEachPartsWithIdentifier node) => null;
+
+  @override
   R visitForEachStatement(ForEachStatement node) => null;
 
   @override
   R visitFormalParameterList(FormalParameterList node) => null;
 
   @override
+  R visitForPartsWithDeclarations(ForPartsWithDeclarations node) => null;
+
+  @override
+  R visitForPartsWithExpression(ForPartsWithExpression node) => null;
+
+  @override
   R visitForStatement(ForStatement node) => null;
 
   @override
+  R visitForStatement2(ForStatement2 node) => null;
+
+  @override
   R visitFunctionDeclaration(FunctionDeclaration node) => null;
 
   @override
@@ -1496,9 +1648,21 @@
   R visitListLiteral(ListLiteral node) => null;
 
   @override
+  R visitListLiteral2(ListLiteral2 node) => null;
+
+  @override
+  R visitMapForElement(MapForElement node) => null;
+
+  @override
+  R visitMapIfElement(MapIfElement node) => null;
+
+  @override
   R visitMapLiteral(MapLiteral node) => null;
 
   @override
+  R visitMapLiteral2(MapLiteral2 node) => null;
+
+  @override
   R visitMapLiteralEntry(MapLiteralEntry node) => null;
 
   @override
@@ -1564,6 +1728,9 @@
   R visitSetLiteral(SetLiteral node) => null;
 
   @override
+  R visitSetLiteral2(SetLiteral2 node) => null;
+
+  @override
   R visitShowCombinator(ShowCombinator node) => null;
 
   @override
@@ -1576,6 +1743,9 @@
   R visitSimpleStringLiteral(SimpleStringLiteral node) => null;
 
   @override
+  R visitSpreadElement(SpreadElement node) => null;
+
+  @override
   R visitStringInterpolation(StringInterpolation node) => null;
 
   @override
@@ -1702,6 +1872,12 @@
   R visitClassTypeAlias(ClassTypeAlias node) => _throw(node);
 
   @override
+  R visitCollectionForElement(CollectionForElement node) => _throw(node);
+
+  @override
+  R visitCollectionIfElement(CollectionIfElement node) => _throw(node);
+
+  @override
   R visitComment(Comment node) => _throw(node);
 
   @override
@@ -1775,15 +1951,33 @@
   R visitFieldFormalParameter(FieldFormalParameter node) => _throw(node);
 
   @override
+  R visitForEachPartsWithDeclaration(ForEachPartsWithDeclaration node) =>
+      _throw(node);
+
+  @override
+  R visitForEachPartsWithIdentifier(ForEachPartsWithIdentifier node) =>
+      _throw(node);
+
+  @override
   R visitForEachStatement(ForEachStatement node) => _throw(node);
 
   @override
   R visitFormalParameterList(FormalParameterList node) => _throw(node);
 
   @override
+  R visitForPartsWithDeclarations(ForPartsWithDeclarations node) =>
+      _throw(node);
+
+  @override
+  R visitForPartsWithExpression(ForPartsWithExpression node) => _throw(node);
+
+  @override
   R visitForStatement(ForStatement node) => _throw(node);
 
   @override
+  R visitForStatement2(ForStatement2 node) => _throw(node);
+
+  @override
   R visitFunctionDeclaration(FunctionDeclaration node) => _throw(node);
 
   @override
@@ -1857,9 +2051,21 @@
   R visitListLiteral(ListLiteral node) => _throw(node);
 
   @override
+  R visitListLiteral2(ListLiteral2 node) => _throw(node);
+
+  @override
+  R visitMapForElement(MapForElement node) => _throw(node);
+
+  @override
+  R visitMapIfElement(MapIfElement node) => _throw(node);
+
+  @override
   R visitMapLiteral(MapLiteral node) => _throw(node);
 
   @override
+  R visitMapLiteral2(MapLiteral2 node) => _throw(node);
+
+  @override
   R visitMapLiteralEntry(MapLiteralEntry node) => _throw(node);
 
   @override
@@ -1925,6 +2131,9 @@
   R visitSetLiteral(SetLiteral node) => _throw(node);
 
   @override
+  R visitSetLiteral2(SetLiteral2 node) => _throw(node);
+
+  @override
   R visitShowCombinator(ShowCombinator node) => _throw(node);
 
   @override
@@ -1937,6 +2146,9 @@
   R visitSimpleStringLiteral(SimpleStringLiteral node) => _throw(node);
 
   @override
+  R visitSpreadElement(SpreadElement node) => _throw(node);
+
+  @override
   R visitStringInterpolation(StringInterpolation node) => _throw(node);
 
   @override
@@ -2166,6 +2378,22 @@
   }
 
   @override
+  T visitCollectionForElement(CollectionForElement node) {
+    stopwatch.start();
+    T result = _baseVisitor.visitCollectionForElement(node);
+    stopwatch.stop();
+    return result;
+  }
+
+  @override
+  T visitCollectionIfElement(CollectionIfElement node) {
+    stopwatch.start();
+    T result = _baseVisitor.visitCollectionIfElement(node);
+    stopwatch.stop();
+    return result;
+  }
+
+  @override
   T visitComment(Comment node) {
     stopwatch.start();
     T result = _baseVisitor.visitComment(node);
@@ -2358,6 +2586,22 @@
   }
 
   @override
+  T visitForEachPartsWithDeclaration(ForEachPartsWithDeclaration node) {
+    stopwatch.start();
+    T result = _baseVisitor.visitForEachPartsWithDeclaration(node);
+    stopwatch.stop();
+    return result;
+  }
+
+  @override
+  T visitForEachPartsWithIdentifier(ForEachPartsWithIdentifier node) {
+    stopwatch.start();
+    T result = _baseVisitor.visitForEachPartsWithIdentifier(node);
+    stopwatch.stop();
+    return result;
+  }
+
+  @override
   T visitForEachStatement(ForEachStatement node) {
     stopwatch.start();
     T result = _baseVisitor.visitForEachStatement(node);
@@ -2374,6 +2618,22 @@
   }
 
   @override
+  T visitForPartsWithDeclarations(ForPartsWithDeclarations node) {
+    stopwatch.start();
+    T result = _baseVisitor.visitForPartsWithDeclarations(node);
+    stopwatch.stop();
+    return result;
+  }
+
+  @override
+  T visitForPartsWithExpression(ForPartsWithExpression node) {
+    stopwatch.start();
+    T result = _baseVisitor.visitForPartsWithExpression(node);
+    stopwatch.stop();
+    return result;
+  }
+
+  @override
   T visitForStatement(ForStatement node) {
     stopwatch.start();
     T result = _baseVisitor.visitForStatement(node);
@@ -2382,6 +2642,14 @@
   }
 
   @override
+  T visitForStatement2(ForStatement2 node) {
+    stopwatch.start();
+    T result = _baseVisitor.visitForStatement2(node);
+    stopwatch.stop();
+    return result;
+  }
+
+  @override
   T visitFunctionDeclaration(FunctionDeclaration node) {
     stopwatch.start();
     T result = _baseVisitor.visitFunctionDeclaration(node);
@@ -2566,6 +2834,30 @@
   }
 
   @override
+  T visitListLiteral2(ListLiteral2 node) {
+    stopwatch.start();
+    T result = _baseVisitor.visitListLiteral2(node);
+    stopwatch.stop();
+    return result;
+  }
+
+  @override
+  T visitMapForElement(MapForElement node) {
+    stopwatch.start();
+    T result = _baseVisitor.visitMapForElement(node);
+    stopwatch.stop();
+    return result;
+  }
+
+  @override
+  T visitMapIfElement(MapIfElement node) {
+    stopwatch.start();
+    T result = _baseVisitor.visitMapIfElement(node);
+    stopwatch.stop();
+    return result;
+  }
+
+  @override
   T visitMapLiteral(MapLiteral node) {
     stopwatch.start();
     T result = _baseVisitor.visitMapLiteral(node);
@@ -2574,6 +2866,14 @@
   }
 
   @override
+  T visitMapLiteral2(MapLiteral2 node) {
+    stopwatch.start();
+    T result = _baseVisitor.visitMapLiteral2(node);
+    stopwatch.stop();
+    return result;
+  }
+
+  @override
   T visitMapLiteralEntry(MapLiteralEntry node) {
     stopwatch.start();
     T result = _baseVisitor.visitMapLiteralEntry(node);
@@ -2743,6 +3043,14 @@
   }
 
   @override
+  T visitSetLiteral2(SetLiteral2 node) {
+    stopwatch.start();
+    T result = _baseVisitor.visitSetLiteral2(node);
+    stopwatch.stop();
+    return result;
+  }
+
+  @override
   T visitShowCombinator(ShowCombinator node) {
     stopwatch.start();
     T result = _baseVisitor.visitShowCombinator(node);
@@ -2775,6 +3083,14 @@
   }
 
   @override
+  T visitSpreadElement(SpreadElement node) {
+    stopwatch.start();
+    T result = _baseVisitor.visitSpreadElement(node);
+    stopwatch.stop();
+    return result;
+  }
+
+  @override
   T visitStringInterpolation(StringInterpolation node) {
     stopwatch.start();
     T result = _baseVisitor.visitStringInterpolation(node);
@@ -3008,6 +3324,12 @@
   R visitClassTypeAlias(ClassTypeAlias node) => visitNode(node);
 
   @override
+  R visitCollectionForElement(CollectionForElement node) => visitNode(node);
+
+  @override
+  R visitCollectionIfElement(CollectionIfElement node) => visitNode(node);
+
+  @override
   R visitComment(Comment node) => visitNode(node);
 
   @override
@@ -3082,15 +3404,33 @@
   R visitFieldFormalParameter(FieldFormalParameter node) => visitNode(node);
 
   @override
+  R visitForEachPartsWithDeclaration(ForEachPartsWithDeclaration node) =>
+      visitNode(node);
+
+  @override
+  R visitForEachPartsWithIdentifier(ForEachPartsWithIdentifier node) =>
+      visitNode(node);
+
+  @override
   R visitForEachStatement(ForEachStatement node) => visitNode(node);
 
   @override
   R visitFormalParameterList(FormalParameterList node) => visitNode(node);
 
   @override
+  R visitForPartsWithDeclarations(ForPartsWithDeclarations node) =>
+      visitNode(node);
+
+  @override
+  R visitForPartsWithExpression(ForPartsWithExpression node) => visitNode(node);
+
+  @override
   R visitForStatement(ForStatement node) => visitNode(node);
 
   @override
+  R visitForStatement2(ForStatement2 node) => visitNode(node);
+
+  @override
   R visitFunctionDeclaration(FunctionDeclaration node) => visitNode(node);
 
   @override
@@ -3165,9 +3505,21 @@
   R visitListLiteral(ListLiteral node) => visitNode(node);
 
   @override
+  R visitListLiteral2(ListLiteral2 node) => visitNode(node);
+
+  @override
+  R visitMapForElement(MapForElement node) => visitNode(node);
+
+  @override
+  R visitMapIfElement(MapIfElement node) => visitNode(node);
+
+  @override
   R visitMapLiteral(MapLiteral node) => visitNode(node);
 
   @override
+  R visitMapLiteral2(MapLiteral2 node) => visitNode(node);
+
+  @override
   R visitMapLiteralEntry(MapLiteralEntry node) => visitNode(node);
 
   @override
@@ -3239,6 +3591,9 @@
   R visitSetLiteral(SetLiteral node) => visitNode(node);
 
   @override
+  R visitSetLiteral2(SetLiteral2 node) => visitNode(node);
+
+  @override
   R visitShowCombinator(ShowCombinator node) => visitNode(node);
 
   @override
@@ -3251,6 +3606,9 @@
   R visitSimpleStringLiteral(SimpleStringLiteral node) => visitNode(node);
 
   @override
+  R visitSpreadElement(SpreadElement node) => visitNode(node);
+
+  @override
   R visitStringInterpolation(StringInterpolation node) => visitNode(node);
 
   @override
diff --git a/pkg/analyzer/lib/dart/element/element.dart b/pkg/analyzer/lib/dart/element/element.dart
index 0260c07..f4ce6d91 100644
--- a/pkg/analyzer/lib/dart/element/element.dart
+++ b/pkg/analyzer/lib/dart/element/element.dart
@@ -54,10 +54,6 @@
 /// Clients may not extend, implement or mix-in this class.
 abstract class ClassElement
     implements TypeDefiningElement, TypeParameterizedElement {
-  /// An empty list of class elements.
-  @deprecated
-  static const List<ClassElement> EMPTY_LIST = const <ClassElement>[];
-
   /// Return a list containing all of the accessors (getters and setters)
   /// declared in this class.
   List<PropertyAccessorElement> get accessors;
@@ -365,11 +361,6 @@
 ///
 /// Clients may not extend, implement or mix-in this class.
 abstract class CompilationUnitElement implements Element, UriReferencedElement {
-  /// An empty list of compilation unit elements.
-  @deprecated
-  static const List<CompilationUnitElement> EMPTY_LIST =
-      const <CompilationUnitElement>[];
-
   /// Return a list containing all of the top-level accessors (getters and
   /// setters) contained in this compilation unit.
   List<PropertyAccessorElement> get accessors;
@@ -429,11 +420,6 @@
 /// Clients may not extend, implement or mix-in this class.
 abstract class ConstructorElement
     implements ClassMemberElement, ExecutableElement, ConstantEvaluationTarget {
-  /// An empty list of constructor elements.
-  @deprecated
-  static const List<ConstructorElement> EMPTY_LIST =
-      const <ConstructorElement>[];
-
   /// Return `true` if this constructor is a const constructor.
   bool get isConst;
 
@@ -712,10 +698,6 @@
 ///
 /// Clients may not extend, implement or mix-in this class.
 abstract class ElementAnnotation implements ConstantEvaluationTarget {
-  /// An empty list of annotations.
-  @deprecated
-  static const List<ElementAnnotation> EMPTY_LIST = const <ElementAnnotation>[];
-
   /// Return the errors that were produced while computing a value for this
   /// annotation, or `null` if no value has been computed. If a value has been
   /// produced but no errors were generated, then the list will be empty.
@@ -998,10 +980,6 @@
 ///
 /// Clients may not extend, implement or mix-in this class.
 abstract class ExecutableElement implements FunctionTypedElement {
-  /// An empty list of executable elements.
-  @deprecated
-  static const List<ExecutableElement> EMPTY_LIST = const <ExecutableElement>[];
-
   /// Return `true` if this executable element did not have an explicit return
   /// type specified for it in the original source. Note that if there was no
   /// explicit return type, and if the element model is fully populated, then
@@ -1044,10 +1022,6 @@
 ///
 /// Clients may not extend, implement or mix-in this class.
 abstract class ExportElement implements Element, UriReferencedElement {
-  /// An empty list of export elements.
-  @deprecated
-  static const List<ExportElement> EMPTY_LIST = const <ExportElement>[];
-
   /// Return a list containing the combinators that were specified as part of
   /// the export directive in the order in which they were specified.
   List<NamespaceCombinator> get combinators;
@@ -1062,10 +1036,6 @@
 /// Clients may not extend, implement or mix-in this class.
 abstract class FieldElement
     implements ClassMemberElement, PropertyInducingElement {
-  /// An empty list of field elements.
-  @deprecated
-  static const List<FieldElement> EMPTY_LIST = const <FieldElement>[];
-
   /// Return `true` if this field was explicitly marked as being covariant.
   bool get isCovariant;
 
@@ -1096,10 +1066,6 @@
 ///
 /// Clients may not extend, implement or mix-in this class.
 abstract class FunctionElement implements ExecutableElement, LocalElement {
-  /// An empty list of function elements.
-  @deprecated
-  static const List<FunctionElement> EMPTY_LIST = const <FunctionElement>[];
-
   /// The name of the method that can be implemented by a class to allow its
   /// instances to be invoked as if they were a function.
   static final String CALL_METHOD_NAME = "call";
@@ -1129,11 +1095,6 @@
 /// Clients may not extend, implement or mix-in this class.
 abstract class FunctionTypeAliasElement
     implements FunctionTypedElement, TypeDefiningElement {
-  /// An empty array of type alias elements.
-  @deprecated
-  static List<FunctionTypeAliasElement> EMPTY_LIST =
-      new List<FunctionTypeAliasElement>(0);
-
   @override
   CompilationUnitElement get enclosingElement;
 
@@ -1201,10 +1162,6 @@
 ///
 /// Clients may not extend, implement or mix-in this class.
 abstract class ImportElement implements Element, UriReferencedElement {
-  /// An empty list of import elements.
-  @deprecated
-  static const List<ImportElement> EMPTY_LIST = const <ImportElement>[];
-
   /// Return a list containing the combinators that were specified as part of
   /// the import directive in the order in which they were specified.
   List<NamespaceCombinator> get combinators;
@@ -1233,10 +1190,6 @@
 ///
 /// Clients may not extend, implement or mix-in this class.
 abstract class LabelElement implements Element {
-  /// An empty list of label elements.
-  @deprecated
-  static const List<LabelElement> EMPTY_LIST = const <LabelElement>[];
-
   @override
   ExecutableElement get enclosingElement;
 }
@@ -1245,10 +1198,6 @@
 ///
 /// Clients may not extend, implement or mix-in this class.
 abstract class LibraryElement implements Element {
-  /// An empty list of library elements.
-  @deprecated
-  static const List<LibraryElement> EMPTY_LIST = const <LibraryElement>[];
-
   /// Return the compilation unit that defines this library.
   CompilationUnitElement get definingCompilationUnit;
 
@@ -1367,21 +1316,12 @@
 /// A local variable.
 ///
 /// Clients may not extend, implement or mix-in this class.
-abstract class LocalVariableElement implements LocalElement, VariableElement {
-  /// An empty list of field elements.
-  @deprecated
-  static const List<LocalVariableElement> EMPTY_LIST =
-      const <LocalVariableElement>[];
-}
+abstract class LocalVariableElement implements LocalElement, VariableElement {}
 
 /// An element that represents a method defined within a type.
 ///
 /// Clients may not extend, implement or mix-in this class.
 abstract class MethodElement implements ClassMemberElement, ExecutableElement {
-  /// An empty list of method elements.
-  @deprecated
-  static const List<MethodElement> EMPTY_LIST = const <MethodElement>[];
-
   @deprecated
   @override
   MethodDeclaration computeNode();
@@ -1424,22 +1364,13 @@
 /// An object that controls how namespaces are combined.
 ///
 /// Clients may not extend, implement or mix-in this class.
-abstract class NamespaceCombinator {
-  /// An empty list of namespace combinators.
-  @deprecated
-  static const List<NamespaceCombinator> EMPTY_LIST =
-      const <NamespaceCombinator>[];
-}
+abstract class NamespaceCombinator {}
 
 /// A parameter defined within an executable element.
 ///
 /// Clients may not extend, implement or mix-in this class.
 abstract class ParameterElement
     implements LocalElement, VariableElement, ConstantEvaluationTarget {
-  /// An empty list of parameter elements.
-  @deprecated
-  static const List<ParameterElement> EMPTY_LIST = const <ParameterElement>[];
-
   /// Return the Dart code of the default value, or `null` if no default value.
   String get defaultValueCode;
 
@@ -1502,10 +1433,6 @@
 ///
 /// Clients may not extend, implement or mix-in this class.
 abstract class PrefixElement implements Element {
-  /// An empty list of prefix elements.
-  @deprecated
-  static const List<PrefixElement> EMPTY_LIST = const <PrefixElement>[];
-
   @override
   LibraryElement get enclosingElement;
 
@@ -1532,11 +1459,6 @@
 ///
 /// Clients may not extend, implement or mix-in this class.
 abstract class PropertyAccessorElement implements ExecutableElement {
-  /// An empty list of property accessor elements.
-  @deprecated
-  static const List<PropertyAccessorElement> EMPTY_LIST =
-      const <PropertyAccessorElement>[];
-
   /// Return the accessor representing the getter that corresponds to (has the
   /// same name as) this setter, or `null` if this accessor is not a setter or
   /// if there is no corresponding getter.
@@ -1577,11 +1499,6 @@
 ///
 /// Clients may not extend, implement or mix-in this class.
 abstract class PropertyInducingElement implements VariableElement {
-  /// An empty list of elements.
-  @deprecated
-  static const List<PropertyInducingElement> EMPTY_LIST =
-      const <PropertyInducingElement>[];
-
   /// Return the getter associated with this variable. If this variable was
   /// explicitly defined (is not synthetic) then the getter associated with it
   /// will be synthetic.
@@ -1623,11 +1540,6 @@
 ///
 /// Clients may not extend, implement or mix-in this class.
 abstract class TopLevelVariableElement implements PropertyInducingElement {
-  /// An empty list of top-level variable elements.
-  @deprecated
-  static const List<TopLevelVariableElement> EMPTY_LIST =
-      const <TopLevelVariableElement>[];
-
   @deprecated
   @override
   VariableDeclaration computeNode();
@@ -1645,11 +1557,6 @@
 ///
 /// Clients may not extend, implement or mix-in this class.
 abstract class TypeParameterElement implements TypeDefiningElement {
-  /// An empty list of type parameter elements.
-  @deprecated
-  static const List<TypeParameterElement> EMPTY_LIST =
-      const <TypeParameterElement>[];
-
   /// Return the type representing the bound associated with this parameter, or
   /// `null` if this parameter does not have an explicit bound.
   DartType get bound;
@@ -1709,10 +1616,6 @@
 ///
 /// Clients may not extend, implement or mix-in this class.
 abstract class VariableElement implements Element, ConstantEvaluationTarget {
-  /// An empty list of variable elements.
-  @deprecated
-  static const List<VariableElement> EMPTY_LIST = const <VariableElement>[];
-
   /// Return a representation of the value of this variable.
   ///
   /// Return `null` if either this variable was not declared with the 'const'
diff --git a/pkg/analyzer/lib/dart/element/type.dart b/pkg/analyzer/lib/dart/element/type.dart
index f2ddef8..19c217d 100644
--- a/pkg/analyzer/lib/dart/element/type.dart
+++ b/pkg/analyzer/lib/dart/element/type.dart
@@ -32,12 +32,6 @@
  */
 abstract class DartType {
   /**
-   * An empty list of types.
-   */
-  @deprecated
-  static const List<DartType> EMPTY_LIST = const <DartType>[];
-
-  /**
    * Return the name of this type as it should appear when presented to users in
    * contexts such as error messages.
    */
@@ -69,6 +63,12 @@
   bool get isDartAsyncFutureOr;
 
   /**
+   * Return `true` if this type represents the type 'bool' defined in the
+   * dart:core library.
+   */
+  bool get isDartCoreBool;
+
+  /**
    * Return `true` if this type represents the type 'Function' defined in the
    * dart:core library.
    */
@@ -356,12 +356,6 @@
  */
 abstract class InterfaceType implements ParameterizedType {
   /**
-   * An empty list of types.
-   */
-  @deprecated
-  static const List<InterfaceType> EMPTY_LIST = const <InterfaceType>[];
-
-  /**
    * Return a list containing all of the accessors (getters and setters)
    * declared in this type.
    */
@@ -730,12 +724,6 @@
  */
 abstract class TypeParameterType implements DartType {
   /**
-   * An empty list of type parameter types.
-   */
-  @deprecated
-  static const List<TypeParameterType> EMPTY_LIST = const <TypeParameterType>[];
-
-  /**
    * Return the type representing the bound associated with this parameter,
    * or `dynamic` if there was no explicit bound.
    */
diff --git a/pkg/analyzer/lib/error/error.dart b/pkg/analyzer/lib/error/error.dart
index fdaed1b..2a13c74 100644
--- a/pkg/analyzer/lib/error/error.dart
+++ b/pkg/analyzer/lib/error/error.dart
@@ -648,6 +648,7 @@
   StaticWarningCode.UNDEFINED_IDENTIFIER_AWAIT,
   StaticWarningCode.UNDEFINED_NAMED_PARAMETER,
   StaticWarningCode.USE_OF_VOID_RESULT,
+  StaticWarningCode.UNCHECKED_USE_OF_NULLABLE_VALUE,
   StrongModeCode.ASSIGNMENT_CAST,
   StrongModeCode.COULD_NOT_INFER,
   StrongModeCode.DOWN_CAST_COMPOSITE,
diff --git a/pkg/analyzer/lib/source/error_processor.dart b/pkg/analyzer/lib/source/error_processor.dart
index b1cf472..3391264 100644
--- a/pkg/analyzer/lib/source/error_processor.dart
+++ b/pkg/analyzer/lib/source/error_processor.dart
@@ -3,7 +3,6 @@
 // BSD-style license that can be found in the LICENSE file.
 
 import 'package:analyzer/error/error.dart';
-import 'package:analyzer/src/error/codes.dart';
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/utilities_general.dart';
 import 'package:analyzer/src/task/options.dart';
@@ -99,33 +98,7 @@
 
     // Add the strong mode processor.
     processors = processors.toList();
-    processors.add(_StrongModeTypeErrorProcessor.instance);
     return processors.firstWhere((ErrorProcessor p) => p.appliesTo(error),
         orElse: () => null);
   }
 }
-
-/// In strong mode, this upgrades static type warnings to errors.
-class _StrongModeTypeErrorProcessor implements ErrorProcessor {
-  static final instance = new _StrongModeTypeErrorProcessor();
-
-  // TODO(rnystrom): As far as I know, this is only used to implement
-  // appliesTo(). Consider making it private in ErrorProcessor if possible.
-  String get code => throw new UnsupportedError(
-      "_StrongModeTypeErrorProcessor is not specific to an error code.");
-
-  @override
-  String get description => 'allStrongWarnings -> ERROR';
-
-  /// In strong mode, type warnings are upgraded to errors.
-  ErrorSeverity get severity => ErrorSeverity.ERROR;
-
-  /// Check if this processor applies to the given [error].
-  bool appliesTo(AnalysisError error) {
-    ErrorCode errorCode = error.errorCode;
-    if (errorCode is StaticWarningCode) {
-      return true;
-    }
-    return false;
-  }
-}
diff --git a/pkg/analyzer/lib/source/line_info.dart b/pkg/analyzer/lib/source/line_info.dart
index 5d0dee9..5d5be56 100644
--- a/pkg/analyzer/lib/source/line_info.dart
+++ b/pkg/analyzer/lib/source/line_info.dart
@@ -8,7 +8,7 @@
 /**
  * The location of a character represented as a line and column pair.
  */
-// ignore: deprecated_member_use
+// ignore: deprecated_member_use_from_same_package
 class CharacterLocation extends LineInfo_Location {
   // TODO(brianwilkerson) Replace the body of this class with the body of
   // LineInfo_Location and remove LineInfo_Location.
@@ -64,10 +64,10 @@
    * Return the location information for the character at the given [offset].
    *
    * A future version of this API will return a [CharacterLocation] rather than
-        // ignore: deprecated_member_use
+        // ignore: deprecated_member_use_from_same_package
    * a [LineInfo_Location].
    */
-  // ignore: deprecated_member_use
+  // ignore: deprecated_member_use_from_same_package
   LineInfo_Location getLocation(int offset) {
     var min = 0;
     var max = lineStarts.length - 1;
diff --git a/pkg/analyzer/lib/src/context/builder.dart b/pkg/analyzer/lib/src/context/builder.dart
index 960c862..86cdd07 100644
--- a/pkg/analyzer/lib/src/context/builder.dart
+++ b/pkg/analyzer/lib/src/context/builder.dart
@@ -30,7 +30,6 @@
 import 'package:analyzer/src/generated/sdk.dart';
 import 'package:analyzer/src/generated/source.dart';
 import 'package:analyzer/src/hint/sdk_constraint_extractor.dart';
-import 'package:analyzer/src/lint/registry.dart';
 import 'package:analyzer/src/plugin/resolver_provider.dart';
 import 'package:analyzer/src/summary/package_bundle_reader.dart';
 import 'package:analyzer/src/summary/summary_sdk.dart';
@@ -483,11 +482,6 @@
       if (builderOptions.argResults != null) {
         applyAnalysisOptionFlags(options, builderOptions.argResults,
             verbosePrint: verbosePrint);
-        // If lints turned on but none specified, then enable default lints
-        if (options.lint && options.lintRules.isEmpty) {
-          options.lintRules = Registry.ruleRegistry.defaultRules;
-          verbose('Using default lint rules');
-        }
       }
     } else {
       verbose('Using default analysis options');
diff --git a/pkg/analyzer/lib/src/dart/analysis/driver.dart b/pkg/analyzer/lib/src/dart/analysis/driver.dart
index e8c9902..895a8ec 100644
--- a/pkg/analyzer/lib/src/dart/analysis/driver.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/driver.dart
@@ -94,7 +94,7 @@
   /**
    * The version of data format, should be incremented on every format change.
    */
-  static const int DATA_VERSION = 76;
+  static const int DATA_VERSION = 77;
 
   /**
    * The number of exception contexts allowed to write. Once this field is
@@ -1989,6 +1989,14 @@
 
   bool _started = false;
 
+  /**
+   * The optional worker that is invoked when its work priority is higher
+   * than work priorities in drivers.
+   *
+   * Don't use outside of Analyzer and Analysis Server.
+   */
+  SchedulerWorker outOfBandWorker;
+
   AnalysisDriverScheduler(this._logger, {this.driverWatcher});
 
   /**
@@ -2100,6 +2108,17 @@
         }
       }
 
+      if (outOfBandWorker != null) {
+        var workerPriority = outOfBandWorker.workPriority;
+        if (workerPriority != AnalysisDriverPriority.nothing) {
+          if (workerPriority.index > bestPriority.index) {
+            await outOfBandWorker.performWork();
+            _hasWork.notify();
+            continue;
+          }
+        }
+      }
+
       // Transition to idle if no files to analyze.
       if (!_hasFilesToAnalyze) {
         _statusSupport.transitionToIdle();
@@ -2262,6 +2281,15 @@
   ExceptionResult(this.path, this.exception, this.contextKey);
 }
 
+/// Worker in [AnalysisDriverScheduler].
+abstract class SchedulerWorker {
+  /// Return the priority of work that this worker needs to perform.
+  AnalysisDriverPriority get workPriority;
+
+  /// Perform a single chunk of work.
+  Future<void> performWork();
+}
+
 /**
  * Task that discovers all files that are available to the driver, and makes
  * them known.
diff --git a/pkg/analyzer/lib/src/dart/analysis/experiments.dart b/pkg/analyzer/lib/src/dart/analysis/experiments.dart
index 4a016fa..4cdd478 100644
--- a/pkg/analyzer/lib/src/dart/analysis/experiments.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/experiments.dart
@@ -113,11 +113,18 @@
   /// Initializes a newly created set of experiments based on optional
   /// arguments.
   ExperimentStatus(
-      {bool constant_update_2018, bool set_literals, bool non_nullable})
+      {bool constant_update_2018,
+      bool control_flow_collections,
+      bool non_nullable,
+      bool set_literals,
+      bool spread_collections})
       : _enableFlags = <bool>[
           constant_update_2018 ?? IsEnabledByDefault.constant_update_2018,
           set_literals ?? IsEnabledByDefault.set_literals,
           non_nullable ?? IsEnabledByDefault.non_nullable,
+          control_flow_collections ??
+              IsEnabledByDefault.control_flow_collections,
+          spread_collections ?? IsEnabledByDefault.spread_collections,
         ];
 
   /// Decodes the strings given in [flags] into a representation of the set of
@@ -139,12 +146,18 @@
   /// Current state for the flag "constant-update-2018"
   bool get constant_update_2018 => _enableFlags[0];
 
+  /// Current state for the flag "control_flow_collections"
+  bool get control_flow_collections => _enableFlags[3];
+
   /// Current state for the flag "non-nullable"
   bool get non_nullable => _enableFlags[2];
 
   /// Current state for the flag "set-literals"
   bool get set_literals => _enableFlags[1];
 
+  /// Current state for the flag "spread_collections"
+  bool get spread_collections => _enableFlags[4];
+
   /// Queries whether the given [feature] is enabled or disabled.
   bool isEnabled(ExperimentalFeature feature) => feature.isExpired
       ? feature.isEnabledByDefault
diff --git a/pkg/analyzer/lib/src/dart/analysis/file_state.dart b/pkg/analyzer/lib/src/dart/analysis/file_state.dart
index e9526b0..7e4e1aa 100644
--- a/pkg/analyzer/lib/src/dart/analysis/file_state.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/file_state.dart
@@ -711,6 +711,9 @@
     parser.enableOptionalNewAndConst = true;
     parser.enableSetLiterals = experimentStatus.set_literals;
     parser.enableNonNullable = experimentStatus.non_nullable;
+    parser.enableSpreadCollections = experimentStatus.spread_collections;
+    parser.enableControlFlowCollections =
+        experimentStatus.control_flow_collections;
     CompilationUnit unit = parser.parseCompilationUnit(token);
     unit.lineInfo = lineInfo;
 
diff --git a/pkg/analyzer/lib/src/dart/ast/ast.dart b/pkg/analyzer/lib/src/dart/ast/ast.dart
index 749f864..d6abf5e 100644
--- a/pkg/analyzer/lib/src/dart/ast/ast.dart
+++ b/pkg/analyzer/lib/src/dart/ast/ast.dart
@@ -2056,6 +2056,128 @@
   }
 }
 
+abstract class CollectionElementImpl extends AstNodeImpl
+    implements CollectionElement {}
+
+class CollectionForElementImpl extends CollectionElementImpl
+    with ForMixin
+    implements CollectionForElement {
+  /**
+   * The body of the loop.
+   */
+  CollectionElementImpl _body;
+
+  /**
+   * Initialize a newly created for element.
+   */
+  CollectionForElementImpl(
+      Token awaitKeyword,
+      Token forKeyword,
+      Token leftParenthesis,
+      ForLoopPartsImpl forLoopParts,
+      Token rightParenthesis,
+      CollectionElementImpl body) {
+    this.awaitKeyword = awaitKeyword;
+    this.forKeyword = forKeyword;
+    this.leftParenthesis = leftParenthesis;
+    _forLoopParts = _becomeParentOf(forLoopParts);
+    this.rightParenthesis = rightParenthesis;
+    _body = _becomeParentOf(body);
+  }
+
+  @override
+  CollectionElement get body => _body;
+
+  void set body(CollectionElement statement) {
+    _body = _becomeParentOf(statement as CollectionElementImpl);
+  }
+
+  @override
+  Iterable<SyntacticEntity> get childEntities => new ChildEntities()
+    ..addAll(super.childEntities)
+    ..add(_body);
+
+  @override
+  Token get endToken => _body.endToken;
+
+  @override
+  E accept<E>(AstVisitor<E> visitor) => visitor.visitCollectionForElement(this);
+
+  @override
+  void visitChildren(AstVisitor visitor) {
+    _forLoopParts?.accept(visitor);
+    _body?.accept(visitor);
+  }
+}
+
+class CollectionIfElementImpl extends CollectionElementImpl
+    with IfMixin
+    implements CollectionIfElement {
+  /**
+   * The element to be executed if the condition is `true`.
+   */
+  CollectionElementImpl _thenElement;
+
+  /**
+   * The element to be executed if the condition is `false`, or `null` if there
+   * is no such element.
+   */
+  CollectionElementImpl _elseElement;
+
+  /**
+   * Initialize a newly created for element.
+   */
+  CollectionIfElementImpl(
+      Token ifKeyword,
+      Token leftParenthesis,
+      ExpressionImpl condition,
+      Token rightParenthesis,
+      CollectionElementImpl thenElement,
+      Token elseKeyword,
+      CollectionElementImpl elseElement) {
+    this.ifKeyword = ifKeyword;
+    this.leftParenthesis = leftParenthesis;
+    _condition = _becomeParentOf(condition);
+    this.rightParenthesis = rightParenthesis;
+    _thenElement = _becomeParentOf(thenElement);
+    this.elseKeyword = elseKeyword;
+    _elseElement = _becomeParentOf(elseElement);
+  }
+
+  @override
+  Iterable<SyntacticEntity> get childEntities => new ChildEntities()
+    ..addAll(super.childEntities)
+    ..add(_thenElement)
+    ..add(_elseElement);
+
+  @override
+  CollectionElement get elseElement => _elseElement;
+
+  set elseElement(CollectionElement element) {
+    _elseElement = _becomeParentOf(element as CollectionElementImpl);
+  }
+
+  @override
+  Token get endToken => _elseElement?.endToken ?? _thenElement.endToken;
+
+  @override
+  CollectionElement get thenElement => _thenElement;
+
+  set thenElement(CollectionElement element) {
+    _thenElement = _becomeParentOf(element as CollectionElementImpl);
+  }
+
+  @override
+  E accept<E>(AstVisitor<E> visitor) => visitor.visitCollectionIfElement(this);
+
+  @override
+  void visitChildren(AstVisitor visitor) {
+    super.visitChildren(visitor);
+    _thenElement?.accept(visitor);
+    _elseElement?.accept(visitor);
+  }
+}
+
 /**
  * A combinator associated with an import or export directive.
  *
@@ -4074,7 +4196,8 @@
  *      | [ConditionalExpression] cascadeSection*
  *      | [ThrowExpression]
  */
-abstract class ExpressionImpl extends AstNodeImpl implements Expression {
+abstract class ExpressionImpl extends AstNodeImpl
+    implements CollectionElementImpl, Expression {
   /**
    * The static type of this expression, or `null` if the AST structure has not
    * been resolved.
@@ -4121,7 +4244,10 @@
     AstNode child = this;
     while (child is Expression ||
         child is ArgumentList ||
-        child is MapLiteralEntry) {
+        child is MapLiteralEntry ||
+        child is SpreadElement ||
+        child is IfElement ||
+        child is ForElement) {
       AstNode parent = child.parent;
       if (parent is TypedLiteralImpl && parent.constKeyword != null) {
         // Inside an explicitly `const` list or map literal.
@@ -4549,6 +4675,134 @@
   }
 }
 
+abstract class ForEachPartsImpl extends ForLoopPartsImpl
+    implements ForEachParts {
+  @override
+  Token inKeyword;
+
+  /**
+   * The expression evaluated to produce the iterator.
+   */
+  ExpressionImpl _iterable;
+
+  /**
+   * Initialize a newly created for-each statement whose loop control variable
+   * is declared internally (in the for-loop part). The [awaitKeyword] can be
+   * `null` if this is not an asynchronous for loop.
+   */
+  ForEachPartsImpl(this.inKeyword, ExpressionImpl iterator) {
+    _iterable = _becomeParentOf(iterator);
+  }
+
+  @override
+  Token get beginToken => inKeyword;
+
+  @override
+  Iterable<SyntacticEntity> get childEntities =>
+      new ChildEntities()..add(inKeyword)..add(_iterable);
+
+  @override
+  Token get endToken => _iterable.endToken;
+
+  @override
+  Expression get iterable => _iterable;
+
+  void set iterable(Expression expression) {
+    _iterable = _becomeParentOf(expression as ExpressionImpl);
+  }
+
+  @override
+  void visitChildren(AstVisitor visitor) {
+    _iterable?.accept(visitor);
+  }
+}
+
+class ForEachPartsWithDeclarationImpl extends ForEachPartsImpl
+    implements ForEachPartsWithDeclaration {
+  /**
+   * The declaration of the loop variable.
+   */
+  DeclaredIdentifierImpl _loopVariable;
+
+  /**
+   * Initialize a newly created for-each statement whose loop control variable
+   * is declared internally (inside the for-loop part).
+   */
+  ForEachPartsWithDeclarationImpl(DeclaredIdentifierImpl loopVariable,
+      Token inKeyword, ExpressionImpl iterator)
+      : super(inKeyword, iterator) {
+    _loopVariable = _becomeParentOf(loopVariable);
+  }
+
+  @override
+  Token get beginToken => _loopVariable.beginToken;
+
+  @override
+  Iterable<SyntacticEntity> get childEntities => new ChildEntities()
+    ..add(_loopVariable)
+    ..addAll(super.childEntities);
+
+  @override
+  DeclaredIdentifier get loopVariable => _loopVariable;
+
+  void set loopVariable(DeclaredIdentifier variable) {
+    _loopVariable = _becomeParentOf(variable as DeclaredIdentifierImpl);
+  }
+
+  @override
+  E accept<E>(AstVisitor<E> visitor) =>
+      visitor.visitForEachPartsWithDeclaration(this);
+
+  @override
+  void visitChildren(AstVisitor visitor) {
+    _loopVariable?.accept(visitor);
+    super.visitChildren(visitor);
+  }
+}
+
+class ForEachPartsWithIdentifierImpl extends ForEachPartsImpl
+    implements ForEachPartsWithIdentifier {
+  /**
+   * The loop variable.
+   */
+  SimpleIdentifierImpl _identifier;
+
+  /**
+   * Initialize a newly created for-each statement whose loop control variable
+   * is declared externally (outside the for-loop part).
+   */
+  ForEachPartsWithIdentifierImpl(
+      SimpleIdentifierImpl identifier, Token inKeyword, ExpressionImpl iterator)
+      : super(inKeyword, iterator) {
+    _identifier = _becomeParentOf(identifier);
+  }
+
+  @override
+  Token get beginToken => _identifier.beginToken;
+
+  @override
+  Iterable<SyntacticEntity> get childEntities => new ChildEntities()
+    ..add(_identifier)
+    ..addAll(super.childEntities);
+
+  @override
+  SimpleIdentifier get identifier => _identifier;
+
+  void set identifier(SimpleIdentifier identifier) {
+    _identifier = _becomeParentOf(identifier as SimpleIdentifierImpl);
+  }
+
+  @override
+  E accept<E>(AstVisitor<E> visitor) =>
+      visitor.visitForEachPartsWithIdentifier(this);
+
+  @override
+  void visitChildren(AstVisitor visitor) {
+    _identifier?.accept(visitor);
+    _iterable?.accept(visitor);
+  }
+}
+
 /**
  * A for-each statement.
  *
@@ -4648,7 +4902,7 @@
   }
 
   @override
-  Token get beginToken => forKeyword;
+  Token get beginToken => awaitKeyword ?? forKeyword;
 
   @override
   Statement get body => _body;
@@ -4709,6 +4963,8 @@
   }
 }
 
+abstract class ForLoopPartsImpl extends AstNodeImpl implements ForLoopParts {}
+
 /**
  * A node representing a parameter to a function.
  *
@@ -4873,6 +5129,243 @@
   }
 }
 
+mixin ForMixin on AstNodeImpl {
+  Token awaitKeyword;
+
+  Token forKeyword;
+
+  Token leftParenthesis;
+
+  ForLoopPartsImpl _forLoopParts;
+
+  Token rightParenthesis;
+
+  @override
+  Token get beginToken => awaitKeyword ?? forKeyword;
+
+  @override
+  Iterable<SyntacticEntity> get childEntities => new ChildEntities()
+    ..add(awaitKeyword)
+    ..add(forKeyword)
+    ..add(leftParenthesis)
+    ..add(_forLoopParts)
+    ..add(rightParenthesis);
+
+  ForLoopParts get forLoopParts => _forLoopParts;
+
+  void set forLoopParts(ForLoopParts forLoopParts) {
+    _forLoopParts = _becomeParentOf(forLoopParts as ForLoopPartsImpl);
+  }
+}
+
+abstract class ForPartsImpl extends ForLoopPartsImpl implements ForParts {
+  @override
+  Token leftSeparator;
+
+  /**
+   * The condition used to determine when to terminate the loop, or `null` if
+   * there is no condition.
+   */
+  ExpressionImpl _condition;
+
+  @override
+  Token rightSeparator;
+
+  /**
+   * The list of expressions run after each execution of the loop body.
+   */
+  NodeList<Expression> _updaters;
+
+  /**
+   * Initialize a newly created for statement. Either the [variableList] or the
+   * [initialization] must be `null`. Either the [condition] and the list of
+   * [updaters] can be `null` if the loop does not have the corresponding
+   * attribute.
+   */
+  ForPartsImpl(this.leftSeparator, ExpressionImpl condition,
+      this.rightSeparator, List<Expression> updaters) {
+    _condition = _becomeParentOf(condition);
+    _updaters = new NodeListImpl<Expression>(this, updaters);
+  }
+
+  @override
+  Token get beginToken => leftSeparator;
+
+  @override
+  Iterable<SyntacticEntity> get childEntities => new ChildEntities()
+    ..add(leftSeparator)
+    ..add(_condition)
+    ..add(rightSeparator)
+    ..addAll(_updaters);
+
+  @override
+  Expression get condition => _condition;
+
+  void set condition(Expression expression) {
+    _condition = _becomeParentOf(expression as ExpressionImpl);
+  }
+
+  @override
+  Token get endToken => _updaters?.endToken ?? rightSeparator;
+
+  @override
+  NodeList<Expression> get updaters => _updaters;
+
+  @override
+  void visitChildren(AstVisitor visitor) {
+    _condition?.accept(visitor);
+    _updaters.accept(visitor);
+  }
+}
+
+class ForPartsWithDeclarationsImpl extends ForPartsImpl
+    implements ForPartsWithDeclarations {
+  /**
+   * The declaration of the loop variables, or `null` if there are no variables.
+   * Note that a for statement cannot have both a variable list and an
+   * initialization expression, but can validly have neither.
+   */
+  VariableDeclarationListImpl _variableList;
+
+  /**
+   * Initialize a newly created for statement. Both the [condition] and the list
+   * of [updaters] can be `null` if the loop does not have the corresponding
+   * attribute.
+   */
+  ForPartsWithDeclarationsImpl(
+      VariableDeclarationListImpl variableList,
+      Token leftSeparator,
+      ExpressionImpl condition,
+      Token rightSeparator,
+      List<Expression> updaters)
+      : super(leftSeparator, condition, rightSeparator, updaters) {
+    _variableList = _becomeParentOf(variableList);
+  }
+
+  @override
+  Token get beginToken => _variableList?.beginToken ?? super.beginToken;
+
+  @override
+  Iterable<SyntacticEntity> get childEntities => new ChildEntities()
+    ..add(_variableList)
+    ..addAll(super.childEntities);
+
+  @override
+  VariableDeclarationList get variables => _variableList;
+
+  void set variables(VariableDeclarationList variableList) {
+    _variableList =
+        _becomeParentOf(variableList as VariableDeclarationListImpl);
+  }
+
+  @override
+  E accept<E>(AstVisitor<E> visitor) =>
+      visitor.visitForPartsWithDeclarations(this);
+
+  @override
+  void visitChildren(AstVisitor visitor) {
+    _variableList?.accept(visitor);
+    super.visitChildren(visitor);
+  }
+}
+
+class ForPartsWithExpressionImpl extends ForPartsImpl
+    implements ForPartsWithExpression {
+  /**
+   * The initialization expression, or `null` if there is no initialization
+   * expression. Note that a for statement cannot have both a variable list and
+   * an initialization expression, but can validly have neither.
+   */
+  ExpressionImpl _initialization;
+
+  /**
+   * Initialize a newly created for statement. Both the [condition] and the list
+   * of [updaters] can be `null` if the loop does not have the corresponding
+   * attribute.
+   */
+  ForPartsWithExpressionImpl(ExpressionImpl initialization, Token leftSeparator,
+      ExpressionImpl condition, Token rightSeparator, List<Expression> updaters)
+      : super(leftSeparator, condition, rightSeparator, updaters) {
+    _initialization = _becomeParentOf(initialization);
+  }
+
+  @override
+  Token get beginToken => initialization?.beginToken ?? super.beginToken;
+
+  @override
+  Iterable<SyntacticEntity> get childEntities => new ChildEntities()
+    ..add(_initialization)
+    ..addAll(super.childEntities);
+
+  @override
+  Expression get initialization => _initialization;
+
+  void set initialization(Expression initialization) {
+    _initialization = _becomeParentOf(initialization as ExpressionImpl);
+  }
+
+  @override
+  E accept<E>(AstVisitor<E> visitor) =>
+      visitor.visitForPartsWithExpression(this);
+
+  @override
+  void visitChildren(AstVisitor visitor) {
+    _initialization?.accept(visitor);
+    super.visitChildren(visitor);
+  }
+}
+
+class ForStatement2Impl extends StatementImpl
+    with ForMixin
+    implements ForStatement2 {
+  /**
+   * The body of the loop.
+   */
+  StatementImpl _body;
+
+  /**
+   * Initialize a newly created for statement.
+   */
+  ForStatement2Impl(
+      Token awaitKeyword,
+      Token forKeyword,
+      Token leftParenthesis,
+      ForLoopPartsImpl forLoopParts,
+      Token rightParenthesis,
+      StatementImpl body) {
+    this.awaitKeyword = awaitKeyword;
+    this.forKeyword = forKeyword;
+    this.leftParenthesis = leftParenthesis;
+    _forLoopParts = _becomeParentOf(forLoopParts);
+    this.rightParenthesis = rightParenthesis;
+    _body = _becomeParentOf(body);
+  }
+
+  @override
+  Statement get body => _body;
+
+  void set body(Statement statement) {
+    _body = _becomeParentOf(statement as StatementImpl);
+  }
+
+  @override
+  Iterable<SyntacticEntity> get childEntities => new ChildEntities()
+    ..addAll(super.childEntities)
+    ..add(_body);
+
+  @override
+  Token get endToken => _body.endToken;
+
+  @override
+  E accept<E>(AstVisitor<E> visitor) => visitor.visitForStatement2(this);
+
+  @override
+  void visitChildren(AstVisitor visitor) {
+    _forLoopParts?.accept(visitor);
+    _body?.accept(visitor);
+  }
+}
+
 /**
  * A for statement.
  *
@@ -5952,6 +6445,43 @@
   bool get isAssignable => true;
 }
 
+mixin IfMixin on AstNodeImpl {
+  Token ifKeyword;
+
+  Token leftParenthesis;
+
+  /**
+   * The condition used to determine which of the branches is executed next.
+   */
+  ExpressionImpl _condition;
+
+  Token rightParenthesis;
+
+  Token elseKeyword;
+
+  @override
+  Token get beginToken => ifKeyword;
+
+  @override
+  Iterable<SyntacticEntity> get childEntities => new ChildEntities()
+    ..add(ifKeyword)
+    ..add(leftParenthesis)
+    ..add(_condition)
+    ..add(rightParenthesis)
+    ..add(elseKeyword);
+
+  Expression get condition => _condition;
+
+  void set condition(Expression expression) {
+    _condition = _becomeParentOf(expression as ExpressionImpl);
+  }
+
+  @override
+  void visitChildren(AstVisitor visitor) {
+    _condition?.accept(visitor);
+  }
+}
+
 /**
  * An if statement.
  *
@@ -7277,7 +7807,81 @@
  * A list literal.
  *
  *    listLiteral ::=
+ *        'const'? ('<' [TypeAnnotation] '>')?
+ *        '[' ([CollectionLiteralElement] ','?)? ']'
+ *
+ * This is the class that is used to represent a list literal when either the
+ * 'control-flow-collections' or 'spread-collections' experiments are enabled.
+ * If neither of those experiments are enabled, then [ListLiteral] will be used.
+ */
+class ListLiteral2Impl extends TypedLiteralImpl implements ListLiteral2 {
+  @override
+  Token leftBracket;
+
+  /**
+   * The elements used to compute the elements of the list.
+   */
+  NodeList<CollectionElement> _elements;
+
+  @override
+  Token rightBracket;
+
+  /**
+   * Initialize a newly created list literal. The [constKeyword] can be `null`
+   * if the literal is not a constant. The [typeArguments] can be `null` if no
+   * type arguments were declared. The list of [elements] can be `null` if the
+   * list is empty.
+   */
+  ListLiteral2Impl(Token constKeyword, TypeArgumentListImpl typeArguments,
+      this.leftBracket, List<CollectionElement> elements, this.rightBracket)
+      : super(constKeyword, typeArguments) {
+    _elements = new NodeListImpl<CollectionElement>(this, elements);
+  }
+
+  @override
+  Token get beginToken {
+    if (constKeyword != null) {
+      return constKeyword;
+    }
+    TypeArgumentList typeArguments = this.typeArguments;
+    if (typeArguments != null) {
+      return typeArguments.beginToken;
+    }
+    return leftBracket;
+  }
+
+  @override
+  // TODO(paulberry): add commas.
+  Iterable<SyntacticEntity> get childEntities => super._childEntities
+    ..add(leftBracket)
+    ..addAll(_elements)
+    ..add(rightBracket);
+
+  @override
+  NodeList<CollectionElement> get elements => _elements;
+
+  @override
+  Token get endToken => rightBracket;
+
+  @override
+  E accept<E>(AstVisitor<E> visitor) => visitor.visitListLiteral2(this);
+
+  @override
+  void visitChildren(AstVisitor visitor) {
+    super.visitChildren(visitor);
+    _elements.accept(visitor);
+  }
+}
+
+/**
+ * A list literal.
+ *
+ *    listLiteral ::=
  *        'const'? ('<' [TypeName] '>')? '[' ([Expression] ','?)? ']'
+ *
+ * This is the class that is used to represent a list literal when neither the
+ * 'control-flow-collections' nor 'spread-collections' experiments are enabled.
+ * If either of those experiments are enabled, then [ListLiteral2] will be used.
  */
 class ListLiteralImpl extends TypedLiteralImpl implements ListLiteral {
   /**
@@ -7381,13 +7985,203 @@
       new Set<VariableElement>();
 }
 
+abstract class MapElementImpl extends AstNodeImpl implements MapElement {}
+
+class MapForElementImpl extends MapElementImpl
+    with ForMixin
+    implements MapForElement {
+  /**
+   * The body of the loop.
+   */
+  MapElementImpl _body;
+
+  /**
+   * Initialize a newly created for element.
+   */
+  MapForElementImpl(
+      Token awaitKeyword,
+      Token forKeyword,
+      Token leftParenthesis,
+      ForLoopPartsImpl forLoopParts,
+      Token rightParenthesis,
+      MapElementImpl body) {
+    this.awaitKeyword = awaitKeyword;
+    this.forKeyword = forKeyword;
+    this.leftParenthesis = leftParenthesis;
+    _forLoopParts = _becomeParentOf(forLoopParts);
+    this.rightParenthesis = rightParenthesis;
+    _body = _becomeParentOf(body);
+  }
+
+  @override
+  MapElement get body => _body;
+
+  void set body(MapElement statement) {
+    _body = _becomeParentOf(statement as MapElementImpl);
+  }
+
+  @override
+  Iterable<SyntacticEntity> get childEntities => new ChildEntities()
+    ..addAll(super.childEntities)
+    ..add(_body);
+
+  @override
+  Token get endToken => _body.endToken;
+
+  @override
+  E accept<E>(AstVisitor<E> visitor) => visitor.visitMapForElement(this);
+
+  @override
+  void visitChildren(AstVisitor visitor) {
+    _forLoopParts?.accept(visitor);
+    _body?.accept(visitor);
+  }
+}
+
+class MapIfElementImpl extends MapElementImpl
+    with IfMixin
+    implements MapIfElement {
+  /**
+   * The element to be executed if the condition is `true`.
+   */
+  MapElementImpl _thenElement;
+
+  /**
+   * The element to be executed if the condition is `false`, or `null` if there
+   * is no such element.
+   */
+  MapElementImpl _elseElement;
+
+  /**
+   * Initialize a newly created for element.
+   */
+  MapIfElementImpl(
+      Token ifKeyword,
+      Token leftParenthesis,
+      ExpressionImpl condition,
+      Token rightParenthesis,
+      MapElementImpl thenElement,
+      Token elseKeyword,
+      MapElementImpl elseElement) {
+    this.ifKeyword = ifKeyword;
+    this.leftParenthesis = leftParenthesis;
+    _condition = _becomeParentOf(condition);
+    this.rightParenthesis = rightParenthesis;
+    _thenElement = _becomeParentOf(thenElement);
+    this.elseKeyword = elseKeyword;
+    _elseElement = _becomeParentOf(elseElement);
+  }
+
+  @override
+  Iterable<SyntacticEntity> get childEntities => new ChildEntities()
+    ..addAll(super.childEntities)
+    ..add(_thenElement)
+    ..add(_elseElement);
+
+  @override
+  MapElement get elseElement => _elseElement;
+
+  set elseElement(MapElement element) {
+    _elseElement = _becomeParentOf(element as MapElementImpl);
+  }
+
+  @override
+  Token get endToken => _elseElement?.endToken ?? _thenElement.endToken;
+
+  @override
+  MapElement get thenElement => _thenElement;
+
+  set thenElement(MapElement element) {
+    _thenElement = _becomeParentOf(element as MapElementImpl);
+  }
+
+  @override
+  E accept<E>(AstVisitor<E> visitor) => visitor.visitMapIfElement(this);
+
+  @override
+  void visitChildren(AstVisitor visitor) {
+    super.visitChildren(visitor);
+    _thenElement?.accept(visitor);
+    _elseElement?.accept(visitor);
+  }
+}
+
+/**
+ * A literal map.
+ *
+ *    mapLiteral ::=
+ *        'const'? ('<' [TypeAnnotation] (',' [TypeAnnotation])* '>')?
+ *        '{' ([MapElement] (',' [MapElement])* ','?)? '}'
+ *
+ * This is the class that is used to represent a map literal when either the
+ * 'control-flow-collections' or 'spread-collections' experiments are enabled.
+ * If neither of those experiments are enabled, then [MapLiteral] will be used.
+ */
+class MapLiteral2Impl extends TypedLiteralImpl implements MapLiteral2 {
+  @override
+  Token leftBracket;
+
+  /**
+   * The entries in the map.
+   */
+  NodeList<MapElement> _entries;
+
+  @override
+  Token rightBracket;
+
+  /**
+   * Initialize a newly created map literal. The [constKeyword] can be `null` if
+   * the literal is not a constant. The [typeArguments] can be `null` if no type
+   * arguments were declared. The [entries] can be `null` if the map is empty.
+   */
+  MapLiteral2Impl(Token constKeyword, TypeArgumentListImpl typeArguments,
+      this.leftBracket, List<MapElement> entries, this.rightBracket)
+      : super(constKeyword, typeArguments) {
+    _entries = new NodeListImpl<MapElement>(this, entries);
+  }
+
+  @override
+  Token get beginToken {
+    if (constKeyword != null) {
+      return constKeyword;
+    }
+    TypeArgumentList typeArguments = this.typeArguments;
+    if (typeArguments != null) {
+      return typeArguments.beginToken;
+    }
+    return leftBracket;
+  }
+
+  @override
+  // TODO(paulberry): add commas.
+  Iterable<SyntacticEntity> get childEntities => super._childEntities
+    ..add(leftBracket)
+    ..addAll(entries)
+    ..add(rightBracket);
+
+  @override
+  Token get endToken => rightBracket;
+
+  @override
+  NodeList<MapElement> get entries => _entries;
+
+  @override
+  E accept<E>(AstVisitor<E> visitor) => visitor.visitMapLiteral2(this);
+
+  @override
+  void visitChildren(AstVisitor visitor) {
+    super.visitChildren(visitor);
+    _entries.accept(visitor);
+  }
+}
+
 /**
  * A single key/value pair in a map literal.
  *
  *    mapLiteralEntry ::=
  *        [Expression] ':' [Expression]
  */
-class MapLiteralEntryImpl extends AstNodeImpl implements MapLiteralEntry {
+class MapLiteralEntryImpl extends MapElementImpl implements MapLiteralEntry {
   /**
    * The expression computing the key with which the value will be associated.
    */
@@ -9507,8 +10301,82 @@
  *
  *    setLiteral ::=
  *        'const'? ('<' [TypeAnnotation] '>')?
+ *        '{' [CollectionElement] (',' [Expression])* ','? '}'
+ *      | 'const'? ('<' [TypeAnnotation] '>')? '{' '}'
+ *
+ * This is the class that is used to represent a set literal when either the
+ * 'control-flow-collections' or 'spread-collections' experiments are enabled.
+ * If neither of those experiments are enabled, then [SetLiteral] will be used.
+ */
+class SetLiteral2Impl extends TypedLiteralImpl implements SetLiteral2 {
+  @override
+  Token leftBracket;
+
+  /**
+   * The elements in the set.
+   */
+  NodeList<CollectionElement> _elements;
+
+  @override
+  Token rightBracket;
+
+  /**
+   * Initialize a newly created set literal. The [constKeyword] can be `null` if
+   * the literal is not a constant. The [typeArguments] can be `null` if no type
+   * arguments were declared. The [elements] can be `null` if the set is empty.
+   */
+  SetLiteral2Impl(Token constKeyword, TypeArgumentListImpl typeArguments,
+      this.leftBracket, List<CollectionElement> elements, this.rightBracket)
+      : super(constKeyword, typeArguments) {
+    _elements = new NodeListImpl<CollectionElement>(this, elements);
+  }
+
+  @override
+  Token get beginToken {
+    if (constKeyword != null) {
+      return constKeyword;
+    }
+    TypeArgumentList typeArguments = this.typeArguments;
+    if (typeArguments != null) {
+      return typeArguments.beginToken;
+    }
+    return leftBracket;
+  }
+
+  @override
+  // TODO(paulberry): add commas.
+  Iterable<SyntacticEntity> get childEntities => super._childEntities
+    ..add(leftBracket)
+    ..addAll(elements)
+    ..add(rightBracket);
+
+  @override
+  NodeList<CollectionElement> get elements => _elements;
+
+  @override
+  Token get endToken => rightBracket;
+
+  @override
+  E accept<E>(AstVisitor<E> visitor) => visitor.visitSetLiteral2(this);
+
+  @override
+  void visitChildren(AstVisitor visitor) {
+    super.visitChildren(visitor);
+    _elements.accept(visitor);
+  }
+}
+
+/**
+ * A literal set.
+ *
+ *    setLiteral ::=
+ *        'const'? ('<' [TypeAnnotation] '>')?
  *        '{' [Expression] (',' [Expression])* ','? '}'
  *      | 'const'? ('<' [TypeAnnotation] '>')? '{' '}'
+ *
+ * This is the class that is used to represent a set literal when neither the
+ * 'control-flow-collections' nor 'spread-collections' experiments are enabled.
+ * If either of those experiments are enabled, then [SetLiteral2] will be used.
  */
 class SetLiteralImpl extends TypedLiteralImpl implements SetLiteral {
   /**
@@ -9999,6 +10867,44 @@
 abstract class SingleStringLiteralImpl extends StringLiteralImpl
     implements SingleStringLiteral {}
 
+class SpreadElementImpl extends AstNodeImpl
+    implements CollectionElementImpl, MapElementImpl, SpreadElement {
+  Token spreadOperator;
+
+  ExpressionImpl _expression;
+
+  SpreadElementImpl(this.spreadOperator, ExpressionImpl expression) {
+    _expression = _becomeParentOf(expression);
+  }
+
+  @override
+  Token get beginToken => spreadOperator;
+
+  @override
+  Iterable<SyntacticEntity> get childEntities =>
+      new ChildEntities()..add(spreadOperator)..add(_expression);
+
+  @override
+  Token get endToken => _expression.endToken;
+
+  @override
+  Expression get expression => _expression;
+
+  set expression(Expression expression) {
+    _expression = _becomeParentOf(expression as ExpressionImpl);
+  }
+
+  @override
+  E accept<E>(AstVisitor<E> visitor) {
+    return visitor.visitSpreadElement(this);
+  }
+
+  @override
+  void visitChildren(AstVisitor visitor) {
+    _expression?.accept(visitor);
+  }
+}
+
 /**
  * A node that represents a statement.
  *
diff --git a/pkg/analyzer/lib/src/dart/ast/ast_factory.dart b/pkg/analyzer/lib/src/dart/ast/ast_factory.dart
index cc7023a..cad9671 100644
--- a/pkg/analyzer/lib/src/dart/ast/ast_factory.dart
+++ b/pkg/analyzer/lib/src/dart/ast/ast_factory.dart
@@ -173,6 +173,29 @@
           semicolon);
 
   @override
+  CollectionForElement collectionForElement(
+          {Token awaitKeyword,
+          Token forKeyword,
+          Token leftParenthesis,
+          ForLoopParts forLoopParts,
+          Token rightParenthesis,
+          CollectionElement body}) =>
+      new CollectionForElementImpl(awaitKeyword, forKeyword, leftParenthesis,
+          forLoopParts, rightParenthesis, body);
+
+  @override
+  CollectionIfElement collectionIfElement(
+          {Token ifKeyword,
+          Token leftParenthesis,
+          Expression condition,
+          Token rightParenthesis,
+          CollectionElement thenElement,
+          Token elseKeyword,
+          CollectionElement elseElement}) =>
+      new CollectionIfElementImpl(ifKeyword, leftParenthesis, condition,
+          rightParenthesis, thenElement, elseKeyword, elseElement);
+
+  @override
   CommentReference commentReference(Token newKeyword, Identifier identifier) =>
       new CommentReferenceImpl(newKeyword, identifier);
 
@@ -338,6 +361,7 @@
           Token semicolon) =>
       new ExportDirectiveImpl(comment, metadata, keyword, libraryUri,
           configurations, combinators, semicolon);
+
   @override
   ExpressionFunctionBody expressionFunctionBody(Token keyword,
           Token functionDefinition, Expression expression, Token semicolon) =>
@@ -404,6 +428,20 @@
           type, thisKeyword, period, identifier, typeParameters, parameters);
 
   @override
+  ForEachPartsWithDeclaration forEachPartsWithDeclaration(
+          {DeclaredIdentifier loopVariable,
+          Token inKeyword,
+          Expression iterable}) =>
+      new ForEachPartsWithDeclarationImpl(loopVariable, inKeyword, iterable);
+
+  @override
+  ForEachPartsWithIdentifier forEachPartsWithIdentifier(
+          {SimpleIdentifier identifier,
+          Token inKeyword,
+          Expression iterable}) =>
+      new ForEachPartsWithIdentifierImpl(identifier, inKeyword, iterable);
+
+  @override
   ForEachStatement forEachStatementWithDeclaration(
           Token awaitKeyword,
           Token forKeyword,
@@ -454,6 +492,26 @@
           rightDelimiter, rightParenthesis);
 
   @override
+  ForPartsWithDeclarations forPartsWithDeclarations(
+          {VariableDeclarationList variables,
+          Token leftSeparator,
+          Expression condition,
+          Token rightSeparator,
+          List<Expression> updaters}) =>
+      new ForPartsWithDeclarationsImpl(
+          variables, leftSeparator, condition, rightSeparator, updaters);
+
+  @override
+  ForPartsWithExpression forPartsWithExpression(
+          {Expression initialization,
+          Token leftSeparator,
+          Expression condition,
+          Token rightSeparator,
+          List<Expression> updaters}) =>
+      new ForPartsWithExpressionImpl(
+          initialization, leftSeparator, condition, rightSeparator, updaters);
+
+  @override
   ForStatement forStatement(
           Token forKeyword,
           Token leftParenthesis,
@@ -478,6 +536,17 @@
           body);
 
   @override
+  ForStatement2 forStatement2(
+          {Token awaitKeyword,
+          Token forKeyword,
+          Token leftParenthesis,
+          ForLoopParts forLoopParts,
+          Token rightParenthesis,
+          Statement body}) =>
+      new ForStatement2Impl(awaitKeyword, forKeyword, leftParenthesis,
+          forLoopParts, rightParenthesis, body);
+
+  @override
   FunctionDeclaration functionDeclaration(
           Comment comment,
           List<Annotation> metadata,
@@ -673,6 +742,39 @@
           constKeyword, typeArguments, leftBracket, elements, rightBracket);
 
   @override
+  ListLiteral2 listLiteral2(
+          {Token constKeyword,
+          TypeArgumentList typeArguments,
+          Token leftBracket,
+          List<CollectionElement> elements,
+          Token rightBracket}) =>
+      new ListLiteral2Impl(
+          constKeyword, typeArguments, leftBracket, elements, rightBracket);
+
+  @override
+  MapForElement mapForElement(
+          {Token awaitKeyword,
+          Token forKeyword,
+          Token leftParenthesis,
+          ForLoopParts forLoopParts,
+          Token rightParenthesis,
+          MapElement body}) =>
+      new MapForElementImpl(awaitKeyword, forKeyword, leftParenthesis,
+          forLoopParts, rightParenthesis, body);
+
+  @override
+  MapIfElement mapIfElement(
+          {Token ifKeyword,
+          Token leftParenthesis,
+          Expression condition,
+          Token rightParenthesis,
+          MapElement thenElement,
+          Token elseKeyword,
+          MapElement elseElement}) =>
+      new MapIfElementImpl(ifKeyword, leftParenthesis, condition,
+          rightParenthesis, thenElement, elseKeyword, elseElement);
+
+  @override
   MapLiteral mapLiteral(
           Token constKeyword,
           TypeArgumentList typeArguments,
@@ -683,6 +785,16 @@
           constKeyword, typeArguments, leftBracket, entries, rightBracket);
 
   @override
+  MapLiteral2 mapLiteral2(
+          {Token constKeyword,
+          TypeArgumentList typeArguments,
+          Token leftBracket,
+          List<MapElement> entries,
+          Token rightBracket}) =>
+      new MapLiteral2Impl(
+          constKeyword, typeArguments, leftBracket, entries, rightBracket);
+
+  @override
   MapLiteralEntry mapLiteralEntry(
           Expression key, Token separator, Expression value) =>
       new MapLiteralEntryImpl(key, separator, value);
@@ -840,6 +952,16 @@
           constKeyword, typeArguments, leftBracket, elements, rightBracket);
 
   @override
+  SetLiteral2 setLiteral2(
+          {Token constKeyword,
+          TypeArgumentList typeArguments,
+          Token leftBracket,
+          List<CollectionElement> elements,
+          Token rightBracket}) =>
+      new SetLiteral2Impl(
+          constKeyword, typeArguments, leftBracket, elements, rightBracket);
+
+  @override
   ShowCombinator showCombinator(
           Token keyword, List<SimpleIdentifier> shownNames) =>
       new ShowCombinatorImpl(keyword, shownNames);
@@ -878,6 +1000,10 @@
       new SimpleStringLiteralImpl(literal, value);
 
   @override
+  SpreadElement spreadElement({Token spreadOperator, Expression expression}) =>
+      new SpreadElementImpl(spreadOperator, expression);
+
+  @override
   StringInterpolation stringInterpolation(
           List<InterpolationElement> elements) =>
       new StringInterpolationImpl(elements);
diff --git a/pkg/analyzer/lib/src/dart/ast/utilities.dart b/pkg/analyzer/lib/src/dart/ast/utilities.dart
index 051fa2b..5d53fc0 100644
--- a/pkg/analyzer/lib/src/dart/ast/utilities.dart
+++ b/pkg/analyzer/lib/src/dart/ast/utilities.dart
@@ -248,6 +248,26 @@
   }
 
   @override
+  CollectionForElement visitCollectionForElement(CollectionForElement node) =>
+      astFactory.collectionForElement(
+          forKeyword: cloneToken(node.forKeyword),
+          leftParenthesis: cloneToken(node.leftParenthesis),
+          forLoopParts: cloneNode(node.forLoopParts),
+          rightParenthesis: cloneToken(node.rightParenthesis),
+          body: cloneNode(node.body));
+
+  @override
+  CollectionIfElement visitCollectionIfElement(CollectionIfElement node) =>
+      astFactory.collectionIfElement(
+          ifKeyword: cloneToken(node.ifKeyword),
+          leftParenthesis: cloneToken(node.leftParenthesis),
+          condition: cloneNode(node.condition),
+          rightParenthesis: cloneToken(node.rightParenthesis),
+          thenElement: cloneNode(node.thenElement),
+          elseKeyword: cloneToken(node.elseKeyword),
+          elseElement: cloneNode(node.elseElement));
+
+  @override
   Comment visitComment(Comment node) {
     if (node.isDocumentation) {
       return astFactory.documentationComment(
@@ -363,7 +383,7 @@
   @override
   DefaultFormalParameter visitDefaultFormalParameter(
           DefaultFormalParameter node) =>
-      // ignore: deprecated_member_use
+      // ignore: deprecated_member_use_from_same_package
       astFactory.defaultFormalParameter(cloneNode(node.parameter), node.kind,
           cloneToken(node.separator), cloneNode(node.defaultValue));
 
@@ -470,6 +490,22 @@
           parameters: cloneNode(node.parameters));
 
   @override
+  ForEachPartsWithDeclaration visitForEachPartsWithDeclaration(
+          ForEachPartsWithDeclaration node) =>
+      astFactory.forEachPartsWithDeclaration(
+          loopVariable: cloneNode(node.loopVariable),
+          inKeyword: cloneToken(node.inKeyword),
+          iterable: cloneNode(node.iterable));
+
+  @override
+  ForEachPartsWithIdentifier visitForEachPartsWithIdentifier(
+          ForEachPartsWithIdentifier node) =>
+      astFactory.forEachPartsWithIdentifier(
+          identifier: cloneNode(node.identifier),
+          inKeyword: cloneToken(node.inKeyword),
+          iterable: cloneNode(node.iterable));
+
+  @override
   ForEachStatement visitForEachStatement(ForEachStatement node) {
     DeclaredIdentifier loopVariable = node.loopVariable;
     if (loopVariable == null) {
@@ -504,6 +540,26 @@
           cloneToken(node.rightParenthesis));
 
   @override
+  ForPartsWithDeclarations visitForPartsWithDeclarations(
+          ForPartsWithDeclarations node) =>
+      astFactory.forPartsWithDeclarations(
+          variables: cloneNode(node.variables),
+          leftSeparator: cloneToken(node.leftSeparator),
+          condition: cloneNode(node.condition),
+          rightSeparator: cloneToken(node.rightSeparator),
+          updaters: cloneNodeList(node.updaters));
+
+  @override
+  ForPartsWithExpression visitForPartsWithExpression(
+          ForPartsWithExpression node) =>
+      astFactory.forPartsWithExpression(
+          initialization: cloneNode(node.initialization),
+          leftSeparator: cloneToken(node.leftSeparator),
+          condition: cloneNode(node.condition),
+          rightSeparator: cloneToken(node.rightSeparator),
+          updaters: cloneNodeList(node.updaters));
+
+  @override
   ForStatement visitForStatement(ForStatement node) => astFactory.forStatement(
       cloneToken(node.forKeyword),
       cloneToken(node.leftParenthesis),
@@ -517,6 +573,15 @@
       cloneNode(node.body));
 
   @override
+  ForStatement2 visitForStatement2(ForStatement2 node) =>
+      astFactory.forStatement2(
+          forKeyword: cloneToken(node.forKeyword),
+          leftParenthesis: cloneToken(node.leftParenthesis),
+          forLoopParts: cloneNode(node.forLoopParts),
+          rightParenthesis: cloneToken(node.rightParenthesis),
+          body: cloneNode(node.body));
+
+  @override
   FunctionDeclaration visitFunctionDeclaration(FunctionDeclaration node) =>
       astFactory.functionDeclaration(
           cloneNode(node.documentationComment),
@@ -704,6 +769,33 @@
       cloneToken(node.rightBracket));
 
   @override
+  ListLiteral2 visitListLiteral2(ListLiteral2 node) => astFactory.listLiteral2(
+      constKeyword: cloneToken(node.constKeyword),
+      typeArguments: cloneNode(node.typeArguments),
+      leftBracket: cloneToken(node.leftBracket),
+      elements: cloneNodeList(node.elements),
+      rightBracket: cloneToken(node.rightBracket));
+
+  @override
+  MapForElement visitMapForElement(MapForElement node) =>
+      astFactory.mapForElement(
+          forKeyword: cloneToken(node.forKeyword),
+          leftParenthesis: cloneToken(node.leftParenthesis),
+          forLoopParts: cloneNode(node.forLoopParts),
+          rightParenthesis: cloneToken(node.rightParenthesis),
+          body: cloneNode(node.body));
+
+  @override
+  MapIfElement visitMapIfElement(MapIfElement node) => astFactory.mapIfElement(
+      ifKeyword: cloneToken(node.ifKeyword),
+      leftParenthesis: cloneToken(node.leftParenthesis),
+      condition: cloneNode(node.condition),
+      rightParenthesis: cloneToken(node.rightParenthesis),
+      thenElement: cloneNode(node.thenElement),
+      elseKeyword: cloneToken(node.elseKeyword),
+      elseElement: cloneNode(node.elseElement));
+
+  @override
   MapLiteral visitMapLiteral(MapLiteral node) => astFactory.mapLiteral(
       cloneToken(node.constKeyword),
       cloneNode(node.typeArguments),
@@ -712,6 +804,14 @@
       cloneToken(node.rightBracket));
 
   @override
+  MapLiteral2 visitMapLiteral2(MapLiteral2 node) => astFactory.mapLiteral2(
+      constKeyword: cloneToken(node.constKeyword),
+      typeArguments: cloneNode(node.typeArguments),
+      leftBracket: cloneToken(node.leftBracket),
+      entries: cloneNodeList(node.entries),
+      rightBracket: cloneToken(node.rightBracket));
+
+  @override
   MapLiteralEntry visitMapLiteralEntry(MapLiteralEntry node) =>
       astFactory.mapLiteralEntry(cloneNode(node.key),
           cloneToken(node.separator), cloneNode(node.value));
@@ -854,6 +954,14 @@
       cloneToken(node.rightBracket));
 
   @override
+  SetLiteral2 visitSetLiteral2(SetLiteral2 node) => astFactory.setLiteral2(
+      constKeyword: cloneToken(node.constKeyword),
+      typeArguments: cloneNode(node.typeArguments),
+      leftBracket: cloneToken(node.leftBracket),
+      elements: cloneNodeList(node.elements),
+      rightBracket: cloneToken(node.rightBracket));
+
+  @override
   ShowCombinator visitShowCombinator(ShowCombinator node) => astFactory
       .showCombinator(cloneToken(node.keyword), cloneNodeList(node.shownNames));
 
@@ -878,6 +986,12 @@
       astFactory.simpleStringLiteral(cloneToken(node.literal), node.value);
 
   @override
+  SpreadElement visitSpreadElement(SpreadElement node) =>
+      astFactory.spreadElement(
+          spreadOperator: cloneToken(node.spreadOperator),
+          expression: cloneNode(node.expression));
+
+  @override
   StringInterpolation visitStringInterpolation(StringInterpolation node) =>
       astFactory.stringInterpolation(cloneNodeList(node.elements));
 
@@ -1335,6 +1449,28 @@
   }
 
   @override
+  bool visitCollectionForElement(CollectionForElement node) {
+    CollectionForElement other = _other as CollectionForElement;
+    return isEqualTokens(node.forKeyword, other.forKeyword) &&
+        isEqualTokens(node.leftParenthesis, other.leftParenthesis) &&
+        isEqualNodes(node.forLoopParts, other.forLoopParts) &&
+        isEqualTokens(node.rightParenthesis, other.rightParenthesis) &&
+        isEqualNodes(node.body, other.body);
+  }
+
+  @override
+  bool visitCollectionIfElement(CollectionIfElement node) {
+    CollectionIfElement other = _other as CollectionIfElement;
+    return isEqualTokens(node.ifKeyword, other.ifKeyword) &&
+        isEqualTokens(node.leftParenthesis, other.leftParenthesis) &&
+        isEqualNodes(node.condition, other.condition) &&
+        isEqualTokens(node.rightParenthesis, other.rightParenthesis) &&
+        isEqualNodes(node.thenElement, other.thenElement) &&
+        isEqualTokens(node.elseKeyword, other.elseKeyword) &&
+        isEqualNodes(node.elseElement, other.elseElement);
+  }
+
+  @override
   bool visitComment(Comment node) {
     Comment other = _other as Comment;
     return _isEqualNodeLists(node.references, other.references);
@@ -1439,7 +1575,7 @@
   bool visitDefaultFormalParameter(DefaultFormalParameter node) {
     DefaultFormalParameter other = _other as DefaultFormalParameter;
     return isEqualNodes(node.parameter, other.parameter) &&
-        // ignore: deprecated_member_use
+        // ignore: deprecated_member_use_from_same_package
         node.kind == other.kind &&
         isEqualTokens(node.separator, other.separator) &&
         isEqualNodes(node.defaultValue, other.defaultValue);
@@ -1563,6 +1699,22 @@
   }
 
   @override
+  bool visitForEachPartsWithDeclaration(ForEachPartsWithDeclaration node) {
+    ForEachPartsWithDeclaration other = _other as ForEachPartsWithDeclaration;
+    return isEqualNodes(node.loopVariable, other.loopVariable) &&
+        isEqualTokens(node.inKeyword, other.inKeyword) &&
+        isEqualNodes(node.iterable, other.iterable);
+  }
+
+  @override
+  bool visitForEachPartsWithIdentifier(ForEachPartsWithIdentifier node) {
+    ForEachPartsWithIdentifier other = _other as ForEachPartsWithIdentifier;
+    return isEqualNodes(node.identifier, other.identifier) &&
+        isEqualTokens(node.inKeyword, other.inKeyword) &&
+        isEqualNodes(node.iterable, other.iterable);
+  }
+
+  @override
   bool visitForEachStatement(ForEachStatement node) {
     ForEachStatement other = _other as ForEachStatement;
     return isEqualTokens(node.forKeyword, other.forKeyword) &&
@@ -1585,6 +1737,26 @@
   }
 
   @override
+  bool visitForPartsWithDeclarations(ForPartsWithDeclarations node) {
+    ForPartsWithDeclarations other = _other as ForPartsWithDeclarations;
+    return isEqualNodes(node.variables, other.variables) &&
+        isEqualTokens(node.leftSeparator, other.leftSeparator) &&
+        isEqualNodes(node.condition, other.condition) &&
+        isEqualTokens(node.rightSeparator, other.rightSeparator) &&
+        _isEqualNodeLists(node.updaters, other.updaters);
+  }
+
+  @override
+  bool visitForPartsWithExpression(ForPartsWithExpression node) {
+    ForPartsWithExpression other = _other as ForPartsWithExpression;
+    return isEqualNodes(node.initialization, other.initialization) &&
+        isEqualTokens(node.leftSeparator, other.leftSeparator) &&
+        isEqualNodes(node.condition, other.condition) &&
+        isEqualTokens(node.rightSeparator, other.rightSeparator) &&
+        _isEqualNodeLists(node.updaters, other.updaters);
+  }
+
+  @override
   bool visitForStatement(ForStatement node) {
     ForStatement other = _other as ForStatement;
     return isEqualTokens(node.forKeyword, other.forKeyword) &&
@@ -1600,6 +1772,16 @@
   }
 
   @override
+  bool visitForStatement2(ForStatement2 node) {
+    ForStatement2 other = _other as ForStatement2;
+    return isEqualTokens(node.forKeyword, other.forKeyword) &&
+        isEqualTokens(node.leftParenthesis, other.leftParenthesis) &&
+        isEqualNodes(node.forLoopParts, other.forLoopParts) &&
+        isEqualTokens(node.rightParenthesis, other.rightParenthesis) &&
+        isEqualNodes(node.body, other.body);
+  }
+
+  @override
   bool visitFunctionDeclaration(FunctionDeclaration node) {
     FunctionDeclaration other = _other as FunctionDeclaration;
     return isEqualNodes(
@@ -1812,6 +1994,38 @@
   }
 
   @override
+  bool visitListLiteral2(ListLiteral2 node) {
+    ListLiteral2 other = _other as ListLiteral2;
+    return isEqualTokens(node.constKeyword, other.constKeyword) &&
+        isEqualNodes(node.typeArguments, other.typeArguments) &&
+        isEqualTokens(node.leftBracket, other.leftBracket) &&
+        _isEqualNodeLists(node.elements, other.elements) &&
+        isEqualTokens(node.rightBracket, other.rightBracket);
+  }
+
+  @override
+  bool visitMapForElement(MapForElement node) {
+    MapForElement other = _other as MapForElement;
+    return isEqualTokens(node.forKeyword, other.forKeyword) &&
+        isEqualTokens(node.leftParenthesis, other.leftParenthesis) &&
+        isEqualNodes(node.forLoopParts, other.forLoopParts) &&
+        isEqualTokens(node.rightParenthesis, other.rightParenthesis) &&
+        isEqualNodes(node.body, other.body);
+  }
+
+  @override
+  bool visitMapIfElement(MapIfElement node) {
+    MapIfElement other = _other as MapIfElement;
+    return isEqualTokens(node.ifKeyword, other.ifKeyword) &&
+        isEqualTokens(node.leftParenthesis, other.leftParenthesis) &&
+        isEqualNodes(node.condition, other.condition) &&
+        isEqualTokens(node.rightParenthesis, other.rightParenthesis) &&
+        isEqualNodes(node.thenElement, other.thenElement) &&
+        isEqualTokens(node.elseKeyword, other.elseKeyword) &&
+        isEqualNodes(node.elseElement, other.elseElement);
+  }
+
+  @override
   bool visitMapLiteral(MapLiteral node) {
     MapLiteral other = _other as MapLiteral;
     return isEqualTokens(node.constKeyword, other.constKeyword) &&
@@ -1822,6 +2036,16 @@
   }
 
   @override
+  bool visitMapLiteral2(MapLiteral2 node) {
+    MapLiteral2 other = _other as MapLiteral2;
+    return isEqualTokens(node.constKeyword, other.constKeyword) &&
+        isEqualNodes(node.typeArguments, other.typeArguments) &&
+        isEqualTokens(node.leftBracket, other.leftBracket) &&
+        _isEqualNodeLists(node.entries, other.entries) &&
+        isEqualTokens(node.rightBracket, other.rightBracket);
+  }
+
+  @override
   bool visitMapLiteralEntry(MapLiteralEntry node) {
     MapLiteralEntry other = _other as MapLiteralEntry;
     return isEqualNodes(node.key, other.key) &&
@@ -2009,6 +2233,16 @@
   }
 
   @override
+  bool visitSetLiteral2(SetLiteral2 node) {
+    SetLiteral2 other = _other as SetLiteral2;
+    return isEqualTokens(node.constKeyword, other.constKeyword) &&
+        isEqualNodes(node.typeArguments, other.typeArguments) &&
+        isEqualTokens(node.leftBracket, other.leftBracket) &&
+        _isEqualNodeLists(node.elements, other.elements) &&
+        isEqualTokens(node.rightBracket, other.rightBracket);
+  }
+
+  @override
   bool visitShowCombinator(ShowCombinator node) {
     ShowCombinator other = _other as ShowCombinator;
     return isEqualTokens(node.keyword, other.keyword) &&
@@ -2040,6 +2274,13 @@
   }
 
   @override
+  bool visitSpreadElement(SpreadElement node) {
+    SpreadElement other = _other as SpreadElement;
+    return isEqualTokens(node.spreadOperator, other.spreadOperator) &&
+        isEqualNodes(node.expression, other.expression);
+  }
+
+  @override
   bool visitStringInterpolation(StringInterpolation node) {
     StringInterpolation other = _other as StringInterpolation;
     return _isEqualNodeLists(node.elements, other.elements);
@@ -3058,6 +3299,26 @@
           _mapToken(node.semicolon));
 
   @override
+  CollectionForElement visitCollectionForElement(CollectionForElement node) =>
+      astFactory.collectionForElement(
+          forKeyword: _mapToken(node.forKeyword),
+          leftParenthesis: _mapToken(node.leftParenthesis),
+          forLoopParts: _cloneNode(node.forLoopParts),
+          rightParenthesis: _mapToken(node.rightParenthesis),
+          body: _cloneNode(node.body));
+
+  @override
+  CollectionIfElement visitCollectionIfElement(CollectionIfElement node) =>
+      astFactory.collectionIfElement(
+          ifKeyword: _mapToken(node.ifKeyword),
+          leftParenthesis: _mapToken(node.leftParenthesis),
+          condition: _cloneNode(node.condition),
+          rightParenthesis: _mapToken(node.rightParenthesis),
+          thenElement: _cloneNode(node.thenElement),
+          elseKeyword: _mapToken(node.elseKeyword),
+          elseElement: _cloneNode(node.elseElement));
+
+  @override
   Comment visitComment(Comment node) {
     if (node.isDocumentation) {
       return astFactory.documentationComment(
@@ -3272,6 +3533,22 @@
           parameters: _cloneNode(node.parameters));
 
   @override
+  ForEachPartsWithDeclaration visitForEachPartsWithDeclaration(
+          ForEachPartsWithDeclaration node) =>
+      astFactory.forEachPartsWithDeclaration(
+          loopVariable: _cloneNode(node.loopVariable),
+          inKeyword: _mapToken(node.inKeyword),
+          iterable: _cloneNode(node.iterable));
+
+  @override
+  ForEachPartsWithIdentifier visitForEachPartsWithIdentifier(
+          ForEachPartsWithIdentifier node) =>
+      astFactory.forEachPartsWithIdentifier(
+          identifier: _cloneNode(node.identifier),
+          inKeyword: _mapToken(node.inKeyword),
+          iterable: _cloneNode(node.iterable));
+
+  @override
   ForEachStatement visitForEachStatement(ForEachStatement node) {
     DeclaredIdentifier loopVariable = node.loopVariable;
     if (loopVariable == null) {
@@ -3306,6 +3583,26 @@
           _mapToken(node.rightParenthesis));
 
   @override
+  ForPartsWithDeclarations visitForPartsWithDeclarations(
+          ForPartsWithDeclarations node) =>
+      astFactory.forPartsWithDeclarations(
+          variables: _cloneNode(node.variables),
+          leftSeparator: _mapToken(node.leftSeparator),
+          condition: _cloneNode(node.condition),
+          rightSeparator: _mapToken(node.rightSeparator),
+          updaters: _cloneNodeList(node.updaters));
+
+  @override
+  ForPartsWithExpression visitForPartsWithExpression(
+          ForPartsWithExpression node) =>
+      astFactory.forPartsWithExpression(
+          initialization: _cloneNode(node.initialization),
+          leftSeparator: _mapToken(node.leftSeparator),
+          condition: _cloneNode(node.condition),
+          rightSeparator: _mapToken(node.rightSeparator),
+          updaters: _cloneNodeList(node.updaters));
+
+  @override
   ForStatement visitForStatement(ForStatement node) => astFactory.forStatement(
       _mapToken(node.forKeyword),
       _mapToken(node.leftParenthesis),
@@ -3319,6 +3616,15 @@
       _cloneNode(node.body));
 
   @override
+  ForStatement2 visitForStatement2(ForStatement2 node) =>
+      astFactory.forStatement2(
+          forKeyword: _mapToken(node.forKeyword),
+          leftParenthesis: _mapToken(node.leftParenthesis),
+          forLoopParts: _cloneNode(node.forLoopParts),
+          rightParenthesis: _mapToken(node.rightParenthesis),
+          body: _cloneNode(node.body));
+
+  @override
   FunctionDeclaration visitFunctionDeclaration(FunctionDeclaration node) =>
       astFactory.functionDeclaration(
           _cloneNode(node.documentationComment),
@@ -3546,6 +3852,33 @@
   }
 
   @override
+  ListLiteral2 visitListLiteral2(ListLiteral2 node) => astFactory.listLiteral2(
+      constKeyword: _mapToken(node.constKeyword),
+      typeArguments: _cloneNode(node.typeArguments),
+      leftBracket: _mapToken(node.leftBracket),
+      elements: _cloneNodeList(node.elements),
+      rightBracket: _mapToken(node.rightBracket));
+
+  @override
+  MapForElement visitMapForElement(MapForElement node) =>
+      astFactory.mapForElement(
+          forKeyword: _mapToken(node.forKeyword),
+          leftParenthesis: _mapToken(node.leftParenthesis),
+          forLoopParts: _cloneNode(node.forLoopParts),
+          rightParenthesis: _mapToken(node.rightParenthesis),
+          body: _cloneNode(node.body));
+
+  @override
+  MapIfElement visitMapIfElement(MapIfElement node) => astFactory.mapIfElement(
+      ifKeyword: _mapToken(node.ifKeyword),
+      leftParenthesis: _mapToken(node.leftParenthesis),
+      condition: _cloneNode(node.condition),
+      rightParenthesis: _mapToken(node.rightParenthesis),
+      thenElement: _cloneNode(node.thenElement),
+      elseKeyword: _mapToken(node.elseKeyword),
+      elseElement: _cloneNode(node.elseElement));
+
+  @override
   MapLiteral visitMapLiteral(MapLiteral node) {
     MapLiteral copy = astFactory.mapLiteral(
         _mapToken(node.constKeyword),
@@ -3558,6 +3891,14 @@
   }
 
   @override
+  MapLiteral2 visitMapLiteral2(MapLiteral2 node) => astFactory.mapLiteral2(
+      constKeyword: _mapToken(node.constKeyword),
+      typeArguments: _cloneNode(node.typeArguments),
+      leftBracket: _mapToken(node.leftBracket),
+      entries: _cloneNodeList(node.entries),
+      rightBracket: _mapToken(node.rightBracket));
+
+  @override
   MapLiteralEntry visitMapLiteralEntry(MapLiteralEntry node) =>
       astFactory.mapLiteralEntry(_cloneNode(node.key),
           _mapToken(node.separator), _cloneNode(node.value));
@@ -3747,6 +4088,14 @@
   }
 
   @override
+  SetLiteral2 visitSetLiteral2(SetLiteral2 node) => astFactory.setLiteral2(
+      constKeyword: _mapToken(node.constKeyword),
+      typeArguments: _cloneNode(node.typeArguments),
+      leftBracket: _mapToken(node.leftBracket),
+      elements: _cloneNodeList(node.elements),
+      rightBracket: _mapToken(node.rightBracket));
+
+  @override
   ShowCombinator visitShowCombinator(ShowCombinator node) => astFactory
       .showCombinator(_mapToken(node.keyword), _cloneNodeList(node.shownNames));
 
@@ -3789,6 +4138,12 @@
   }
 
   @override
+  SpreadElement visitSpreadElement(SpreadElement node) =>
+      astFactory.spreadElement(
+          spreadOperator: _mapToken(node.spreadOperator),
+          expression: _cloneNode(node.expression));
+
+  @override
   StringInterpolation visitStringInterpolation(StringInterpolation node) {
     StringInterpolation copy =
         astFactory.stringInterpolation(_cloneNodeList(node.elements));
@@ -4422,6 +4777,36 @@
   }
 
   @override
+  bool visitCollectionForElement(CollectionForElement node) {
+    if (identical(node.forLoopParts, _oldNode)) {
+      (node as CollectionForElementImpl).forLoopParts =
+          _newNode as ForLoopParts;
+      return true;
+    } else if (identical(node.body, _oldNode)) {
+      (node as CollectionForElementImpl).body = _newNode as CollectionElement;
+      return true;
+    }
+    return visitNode(node);
+  }
+
+  @override
+  bool visitCollectionIfElement(CollectionIfElement node) {
+    if (identical(node.condition, _oldNode)) {
+      (node as CollectionIfElementImpl).condition = _newNode as Expression;
+      return true;
+    } else if (identical(node.thenElement, _oldNode)) {
+      (node as CollectionIfElementImpl).thenElement =
+          _newNode as CollectionElement;
+      return true;
+    } else if (identical(node.elseElement, _oldNode)) {
+      (node as CollectionIfElementImpl).elseElement =
+          _newNode as CollectionElement;
+      return true;
+    }
+    return visitNode(node);
+  }
+
+  @override
   bool visitComment(Comment node) {
     if (_replaceInList(node.references)) {
       return true;
@@ -4663,6 +5048,34 @@
   }
 
   @override
+  bool visitForEachPartsWithDeclaration(ForEachPartsWithDeclaration node) {
+    if (identical(node.loopVariable, _oldNode)) {
+      (node as ForEachPartsWithDeclarationImpl).loopVariable =
+          _newNode as DeclaredIdentifier;
+      return true;
+    } else if (identical(node.iterable, _oldNode)) {
+      (node as ForEachPartsWithDeclarationImpl).iterable =
+          _newNode as Expression;
+      return true;
+    }
+    return visitNode(node);
+  }
+
+  @override
+  bool visitForEachPartsWithIdentifier(ForEachPartsWithIdentifier node) {
+    if (identical(node.identifier, _oldNode)) {
+      (node as ForEachPartsWithIdentifierImpl).identifier =
+          _newNode as SimpleIdentifier;
+      return true;
+    } else if (identical(node.iterable, _oldNode)) {
+      (node as ForEachPartsWithIdentifierImpl).iterable =
+          _newNode as Expression;
+      return true;
+    }
+    return visitNode(node);
+  }
+
+  @override
   bool visitForEachStatement(ForEachStatement node) {
     if (identical(node.loopVariable, _oldNode)) {
       node.loopVariable = _newNode as DeclaredIdentifier;
@@ -4689,6 +5102,36 @@
   }
 
   @override
+  bool visitForPartsWithDeclarations(ForPartsWithDeclarations node) {
+    if (identical(node.variables, _oldNode)) {
+      (node as ForPartsWithDeclarationsImpl).variables =
+          _newNode as VariableDeclarationList;
+      return true;
+    } else if (identical(node.condition, _oldNode)) {
+      (node as ForPartsWithDeclarationsImpl).condition = _newNode as Expression;
+      return true;
+    } else if (_replaceInList(node.updaters)) {
+      return true;
+    }
+    return visitNode(node);
+  }
+
+  @override
+  bool visitForPartsWithExpression(ForPartsWithExpression node) {
+    if (identical(node.initialization, _oldNode)) {
+      (node as ForPartsWithExpressionImpl).initialization =
+          _newNode as Expression;
+      return true;
+    } else if (identical(node.condition, _oldNode)) {
+      (node as ForPartsWithExpressionImpl).condition = _newNode as Expression;
+      return true;
+    } else if (_replaceInList(node.updaters)) {
+      return true;
+    }
+    return visitNode(node);
+  }
+
+  @override
   bool visitForStatement(ForStatement node) {
     if (identical(node.variables, _oldNode)) {
       node.variables = _newNode as VariableDeclarationList;
@@ -4709,6 +5152,18 @@
   }
 
   @override
+  bool visitForStatement2(ForStatement2 node) {
+    if (identical(node.forLoopParts, _oldNode)) {
+      (node as ForStatement2Impl).forLoopParts = _newNode as ForLoopParts;
+      return true;
+    } else if (identical(node.body, _oldNode)) {
+      (node as ForStatement2Impl).body = _newNode as Statement;
+      return true;
+    }
+    return visitNode(node);
+  }
+
+  @override
   bool visitFunctionDeclaration(FunctionDeclaration node) {
     if (identical(node.returnType, _oldNode)) {
       node.returnType = _newNode as TypeAnnotation;
@@ -4955,6 +5410,44 @@
   }
 
   @override
+  bool visitListLiteral2(ListLiteral2 node) {
+    if (identical(node.typeArguments, _oldNode)) {
+      (node as ListLiteral2Impl).typeArguments = _newNode as TypeArgumentList;
+      return true;
+    } else if (_replaceInList(node.elements)) {
+      return true;
+    }
+    return visitNode(node);
+  }
+
+  @override
+  bool visitMapForElement(MapForElement node) {
+    if (identical(node.forLoopParts, _oldNode)) {
+      (node as MapForElementImpl).forLoopParts = _newNode as ForLoopParts;
+      return true;
+    } else if (identical(node.body, _oldNode)) {
+      (node as MapForElementImpl).body = _newNode as MapElement;
+      return true;
+    }
+    return visitNode(node);
+  }
+
+  @override
+  bool visitMapIfElement(MapIfElement node) {
+    if (identical(node.condition, _oldNode)) {
+      (node as MapIfElementImpl).condition = _newNode as Expression;
+      return true;
+    } else if (identical(node.thenElement, _oldNode)) {
+      (node as MapIfElementImpl).thenElement = _newNode as MapElement;
+      return true;
+    } else if (identical(node.elseElement, _oldNode)) {
+      (node as MapIfElementImpl).elseElement = _newNode as MapElement;
+      return true;
+    }
+    return visitNode(node);
+  }
+
+  @override
   bool visitMapLiteral(MapLiteral node) {
     if (_replaceInList(node.entries)) {
       return true;
@@ -4963,6 +5456,17 @@
   }
 
   @override
+  bool visitMapLiteral2(MapLiteral2 node) {
+    if (identical(node.typeArguments, _oldNode)) {
+      (node as MapLiteral2Impl).typeArguments = _newNode as TypeArgumentList;
+      return true;
+    } else if (_replaceInList(node.entries)) {
+      return true;
+    }
+    return visitNode(node);
+  }
+
+  @override
   bool visitMapLiteralEntry(MapLiteralEntry node) {
     if (identical(node.key, _oldNode)) {
       node.key = _newNode as Expression;
@@ -5199,6 +5703,17 @@
   }
 
   @override
+  bool visitSetLiteral2(SetLiteral2 node) {
+    if (identical(node.typeArguments, _oldNode)) {
+      (node as SetLiteral2Impl).typeArguments = _newNode as TypeArgumentList;
+      return true;
+    } else if (_replaceInList(node.elements)) {
+      return true;
+    }
+    return visitNode(node);
+  }
+
+  @override
   bool visitShowCombinator(ShowCombinator node) {
     if (_replaceInList(node.shownNames)) {
       return true;
@@ -5222,6 +5737,15 @@
   bool visitSimpleStringLiteral(SimpleStringLiteral node) => visitNode(node);
 
   @override
+  bool visitSpreadElement(SpreadElement node) {
+    if (identical(node.expression, _oldNode)) {
+      (node as SpreadElementImpl).expression = _newNode as Expression;
+      return true;
+    }
+    return visitNode(node);
+  }
+
+  @override
   bool visitStringInterpolation(StringInterpolation node) {
     if (_replaceInList(node.elements)) {
       return true;
@@ -5689,6 +6213,30 @@
   }
 
   @override
+  bool visitCollectionForElement(CollectionForElement node) {
+    CollectionForElement toNode = this._toNode as CollectionForElement;
+    return _and(
+        _isEqualTokens(node.forKeyword, toNode.forKeyword),
+        _isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
+        _isEqualNodes(node.forLoopParts, toNode.forLoopParts),
+        _isEqualTokens(node.rightParenthesis, toNode.rightParenthesis),
+        _isEqualNodes(node.body, toNode.body));
+  }
+
+  @override
+  bool visitCollectionIfElement(CollectionIfElement node) {
+    CollectionIfElement toNode = this._toNode as CollectionIfElement;
+    return _and(
+        _isEqualTokens(node.ifKeyword, toNode.ifKeyword),
+        _isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
+        _isEqualNodes(node.condition, toNode.condition),
+        _isEqualTokens(node.rightParenthesis, toNode.rightParenthesis),
+        _isEqualNodes(node.thenElement, toNode.thenElement),
+        _isEqualTokens(node.elseKeyword, toNode.elseKeyword),
+        _isEqualNodes(node.elseElement, toNode.elseElement));
+  }
+
+  @override
   bool visitComment(Comment node) {
     Comment toNode = this._toNode as Comment;
     return _isEqualNodeLists(node.references, toNode.references);
@@ -5824,7 +6372,7 @@
     DefaultFormalParameter toNode = this._toNode as DefaultFormalParameter;
     return _and(
         _isEqualNodes(node.parameter, toNode.parameter),
-        // ignore: deprecated_member_use
+        // ignore: deprecated_member_use_from_same_package
         node.kind == toNode.kind,
         _isEqualTokens(node.separator, toNode.separator),
         _isEqualNodes(node.defaultValue, toNode.defaultValue));
@@ -5958,6 +6506,26 @@
   }
 
   @override
+  bool visitForEachPartsWithDeclaration(ForEachPartsWithDeclaration node) {
+    ForEachPartsWithDeclaration toNode =
+        this._toNode as ForEachPartsWithDeclaration;
+    return _and(
+        _isEqualNodes(node.loopVariable, toNode.loopVariable),
+        _isEqualTokens(node.inKeyword, toNode.inKeyword),
+        _isEqualNodes(node.iterable, toNode.iterable));
+  }
+
+  @override
+  bool visitForEachPartsWithIdentifier(ForEachPartsWithIdentifier node) {
+    ForEachPartsWithIdentifier toNode =
+        this._toNode as ForEachPartsWithIdentifier;
+    return _and(
+        _isEqualNodes(node.identifier, toNode.identifier),
+        _isEqualTokens(node.inKeyword, toNode.inKeyword),
+        _isEqualNodes(node.iterable, toNode.iterable));
+  }
+
+  @override
   bool visitForEachStatement(ForEachStatement node) {
     ForEachStatement toNode = this._toNode as ForEachStatement;
     return _and(
@@ -5983,6 +6551,28 @@
   }
 
   @override
+  bool visitForPartsWithDeclarations(ForPartsWithDeclarations node) {
+    ForPartsWithDeclarations toNode = this._toNode as ForPartsWithDeclarations;
+    return _and(
+        _isEqualNodes(node.variables, toNode.variables),
+        _isEqualTokens(node.leftSeparator, toNode.leftSeparator),
+        _isEqualNodes(node.condition, toNode.condition),
+        _isEqualTokens(node.rightSeparator, toNode.rightSeparator),
+        _isEqualNodeLists(node.updaters, toNode.updaters));
+  }
+
+  @override
+  bool visitForPartsWithExpression(ForPartsWithExpression node) {
+    ForPartsWithExpression toNode = this._toNode as ForPartsWithExpression;
+    return _and(
+        _isEqualNodes(node.initialization, toNode.initialization),
+        _isEqualTokens(node.leftSeparator, toNode.leftSeparator),
+        _isEqualNodes(node.condition, toNode.condition),
+        _isEqualTokens(node.rightSeparator, toNode.rightSeparator),
+        _isEqualNodeLists(node.updaters, toNode.updaters));
+  }
+
+  @override
   bool visitForStatement(ForStatement node) {
     ForStatement toNode = this._toNode as ForStatement;
     return _and(
@@ -5999,6 +6589,17 @@
   }
 
   @override
+  bool visitForStatement2(ForStatement2 node) {
+    ForStatement2 toNode = this._toNode as ForStatement2;
+    return _and(
+        _isEqualTokens(node.forKeyword, toNode.forKeyword),
+        _isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
+        _isEqualNodes(node.forLoopParts, toNode.forLoopParts),
+        _isEqualTokens(node.rightParenthesis, toNode.rightParenthesis),
+        _isEqualNodes(node.body, toNode.body));
+  }
+
+  @override
   bool visitFunctionDeclaration(FunctionDeclaration node) {
     FunctionDeclaration toNode = this._toNode as FunctionDeclaration;
     return _and(
@@ -6277,6 +6878,45 @@
   }
 
   @override
+  bool visitListLiteral2(ListLiteral2 node) {
+    ListLiteral2 toNode = this._toNode as ListLiteral2;
+    if (_and(
+        _isEqualTokens(node.constKeyword, toNode.constKeyword),
+        _isEqualNodes(node.typeArguments, toNode.typeArguments),
+        _isEqualTokens(node.leftBracket, toNode.leftBracket),
+        _isEqualNodeLists(node.elements, toNode.elements),
+        _isEqualTokens(node.rightBracket, toNode.rightBracket))) {
+      toNode.staticType = node.staticType;
+      return true;
+    }
+    return false;
+  }
+
+  @override
+  bool visitMapForElement(MapForElement node) {
+    MapForElement toNode = this._toNode as MapForElement;
+    return _and(
+        _isEqualTokens(node.forKeyword, toNode.forKeyword),
+        _isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
+        _isEqualNodes(node.forLoopParts, toNode.forLoopParts),
+        _isEqualTokens(node.rightParenthesis, toNode.rightParenthesis),
+        _isEqualNodes(node.body, toNode.body));
+  }
+
+  @override
+  bool visitMapIfElement(MapIfElement node) {
+    MapIfElement toNode = this._toNode as MapIfElement;
+    return _and(
+        _isEqualTokens(node.ifKeyword, toNode.ifKeyword),
+        _isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
+        _isEqualNodes(node.condition, toNode.condition),
+        _isEqualTokens(node.rightParenthesis, toNode.rightParenthesis),
+        _isEqualNodes(node.thenElement, toNode.thenElement),
+        _isEqualTokens(node.elseKeyword, toNode.elseKeyword),
+        _isEqualNodes(node.elseElement, toNode.elseElement));
+  }
+
+  @override
   bool visitMapLiteral(MapLiteral node) {
     MapLiteral toNode = this._toNode as MapLiteral;
     if (_and(
@@ -6292,6 +6932,21 @@
   }
 
   @override
+  bool visitMapLiteral2(MapLiteral2 node) {
+    MapLiteral2 toNode = this._toNode as MapLiteral2;
+    if (_and(
+        _isEqualTokens(node.constKeyword, toNode.constKeyword),
+        _isEqualNodes(node.typeArguments, toNode.typeArguments),
+        _isEqualTokens(node.leftBracket, toNode.leftBracket),
+        _isEqualNodeLists(node.entries, toNode.entries),
+        _isEqualTokens(node.rightBracket, toNode.rightBracket))) {
+      toNode.staticType = node.staticType;
+      return true;
+    }
+    return false;
+  }
+
+  @override
   bool visitMapLiteralEntry(MapLiteralEntry node) {
     MapLiteralEntry toNode = this._toNode as MapLiteralEntry;
     return _and(
@@ -6545,6 +7200,21 @@
   }
 
   @override
+  bool visitSetLiteral2(SetLiteral2 node) {
+    SetLiteral2 toNode = this._toNode as SetLiteral2;
+    if (_and(
+        _isEqualTokens(node.constKeyword, toNode.constKeyword),
+        _isEqualNodes(node.typeArguments, toNode.typeArguments),
+        _isEqualTokens(node.leftBracket, toNode.leftBracket),
+        _isEqualNodeLists(node.elements, toNode.elements),
+        _isEqualTokens(node.rightBracket, toNode.rightBracket))) {
+      toNode.staticType = node.staticType;
+      return true;
+    }
+    return false;
+  }
+
+  @override
   bool visitShowCombinator(ShowCombinator node) {
     ShowCombinator toNode = this._toNode as ShowCombinator;
     return _and(_isEqualTokens(node.keyword, toNode.keyword),
@@ -6591,6 +7261,13 @@
   }
 
   @override
+  bool visitSpreadElement(SpreadElement node) {
+    SpreadElement toNode = this._toNode as SpreadElement;
+    return _and(_isEqualTokens(node.spreadOperator, toNode.spreadOperator),
+        _isEqualNodes(node.expression, toNode.expression));
+  }
+
+  @override
   bool visitStringInterpolation(StringInterpolation node) {
     StringInterpolation toNode = this._toNode as StringInterpolation;
     if (_isEqualNodeLists(node.elements, toNode.elements)) {
@@ -6991,6 +7668,12 @@
   }
 
   @override
+  void visitForEachPartsWithDeclaration(ForEachPartsWithDeclaration node) {
+    _addToScope(node.loopVariable.identifier);
+    super.visitForEachPartsWithDeclaration(node);
+  }
+
+  @override
   void visitForEachStatement(ForEachStatement node) {
     DeclaredIdentifier loopVariable = node.loopVariable;
     if (loopVariable != null) {
@@ -7000,6 +7683,12 @@
   }
 
   @override
+  void visitForPartsWithDeclarations(ForPartsWithDeclarations node) {
+    _addVariables(node.variables.variables);
+    super.visitForPartsWithDeclarations(node);
+  }
+
+  @override
   void visitForStatement(ForStatement node) {
     if (!identical(_immediateChild, node.variables) && node.variables != null) {
       _addVariables(node.variables.variables);
@@ -7293,6 +7982,23 @@
   }
 
   @override
+  void visitCollectionForElement(CollectionForElement node) {
+    _writer.print('for (');
+    _visitNode(node.forLoopParts);
+    _writer.print(') ');
+    _visitNode(node.body);
+  }
+
+  @override
+  void visitCollectionIfElement(CollectionIfElement node) {
+    _writer.print('if (');
+    _visitNode(node.condition);
+    _writer.print(') ');
+    _visitNode(node.thenElement);
+    _visitNodeWithPrefix(' else ', node.elseElement);
+  }
+
+  @override
   void visitComment(Comment node) {}
 
   @override
@@ -7483,6 +8189,20 @@
   }
 
   @override
+  void visitForEachPartsWithDeclaration(ForEachPartsWithDeclaration node) {
+    _visitNode(node.loopVariable);
+    _writer.print(' in ');
+    _visitNode(node.iterable);
+  }
+
+  @override
+  void visitForEachPartsWithIdentifier(ForEachPartsWithIdentifier node) {
+    _visitNode(node.identifier);
+    _writer.print(' in ');
+    _visitNode(node.iterable);
+  }
+
+  @override
   void visitForEachStatement(ForEachStatement node) {
     DeclaredIdentifier loopVariable = node.loopVariable;
     if (node.awaitKeyword != null) {
@@ -7529,6 +8249,24 @@
   }
 
   @override
+  void visitForPartsWithDeclarations(ForPartsWithDeclarations node) {
+    _visitNode(node.variables);
+    _writer.print(';');
+    _visitNodeWithPrefix(' ', node.condition);
+    _writer.print(';');
+    _visitNodeListWithSeparatorAndPrefix(' ', node.updaters, ', ');
+  }
+
+  @override
+  void visitForPartsWithExpression(ForPartsWithExpression node) {
+    _visitNode(node.initialization);
+    _writer.print(';');
+    _visitNodeWithPrefix(' ', node.condition);
+    _writer.print(';');
+    _visitNodeListWithSeparatorAndPrefix(" ", node.updaters, ', ');
+  }
+
+  @override
   void visitForStatement(ForStatement node) {
     Expression initialization = node.initialization;
     _writer.print("for (");
@@ -7546,6 +8284,14 @@
   }
 
   @override
+  void visitForStatement2(ForStatement2 node) {
+    _writer.print('for (');
+    _visitNode(node.forLoopParts);
+    _writer.print(') ');
+    _visitNode(node.body);
+  }
+
+  @override
   void visitFunctionDeclaration(FunctionDeclaration node) {
     _visitNodeListWithSeparatorAndSuffix(node.metadata, " ", " ");
     _visitTokenWithSuffix(node.externalKeyword, " ");
@@ -7743,6 +8489,32 @@
   }
 
   @override
+  void visitListLiteral2(ListLiteral2 node) {
+    _visitTokenWithSuffix(node.constKeyword, ' ');
+    _visitNode(node.typeArguments);
+    _writer.print('[');
+    _visitNodeListWithSeparator(node.elements, ', ');
+    _writer.print(']');
+  }
+
+  @override
+  void visitMapForElement(MapForElement node) {
+    _writer.print('for (');
+    _visitNode(node.forLoopParts);
+    _writer.print(') ');
+    _visitNode(node.body);
+  }
+
+  @override
+  void visitMapIfElement(MapIfElement node) {
+    _writer.print('if (');
+    _visitNode(node.condition);
+    _writer.print(') ');
+    _visitNode(node.thenElement);
+    _visitNodeWithPrefix(' else ', node.elseElement);
+  }
+
+  @override
   void visitMapLiteral(MapLiteral node) {
     if (node.constKeyword != null) {
       _writer.print(node.constKeyword.lexeme);
@@ -7755,6 +8527,15 @@
   }
 
   @override
+  void visitMapLiteral2(MapLiteral2 node) {
+    _visitTokenWithSuffix(node.constKeyword, ' ');
+    _visitNode(node.typeArguments);
+    _writer.print('{');
+    _visitNodeListWithSeparator(node.entries, ', ');
+    _writer.print('}');
+  }
+
+  @override
   void visitMapLiteralEntry(MapLiteralEntry node) {
     _visitNode(node.key);
     _writer.print(" : ");
@@ -7931,6 +8712,15 @@
   }
 
   @override
+  void visitSetLiteral2(SetLiteral2 node) {
+    _visitTokenWithSuffix(node.constKeyword, ' ');
+    _visitNode(node.typeArguments);
+    _writer.print('{');
+    _visitNodeListWithSeparator(node.elements, ', ');
+    _writer.print('}');
+  }
+
+  @override
   void visitShowCombinator(ShowCombinator node) {
     _writer.print("show ");
     _visitNodeListWithSeparator(node.shownNames, ", ");
@@ -7959,6 +8749,12 @@
   }
 
   @override
+  void visitSpreadElement(SpreadElement node) {
+    _writer.print(node.spreadOperator.lexeme);
+    _visitNode(node.expression);
+  }
+
+  @override
   void visitStringInterpolation(StringInterpolation node) {
     _visitNodeList(node.elements);
   }
@@ -8530,6 +9326,23 @@
   }
 
   @override
+  void visitCollectionForElement(CollectionForElement node) {
+    sink.write('for (');
+    safelyVisitNode(node.forLoopParts);
+    sink.write(') ');
+    safelyVisitNode(node.body);
+  }
+
+  @override
+  void visitCollectionIfElement(CollectionIfElement node) {
+    sink.write('if (');
+    safelyVisitNode(node.condition);
+    sink.write(') ');
+    safelyVisitNode(node.thenElement);
+    safelyVisitNodeWithPrefix(' else ', node.elseElement);
+  }
+
+  @override
   void visitComment(Comment node) {}
 
   @override
@@ -8720,6 +9533,20 @@
   }
 
   @override
+  void visitForEachPartsWithDeclaration(ForEachPartsWithDeclaration node) {
+    safelyVisitNode(node.loopVariable);
+    sink.write(' in ');
+    safelyVisitNode(node.iterable);
+  }
+
+  @override
+  void visitForEachPartsWithIdentifier(ForEachPartsWithIdentifier node) {
+    safelyVisitNode(node.identifier);
+    sink.write(' in ');
+    safelyVisitNode(node.iterable);
+  }
+
+  @override
   void visitForEachStatement(ForEachStatement node) {
     DeclaredIdentifier loopVariable = node.loopVariable;
     if (node.awaitKeyword != null) {
@@ -8766,6 +9593,24 @@
   }
 
   @override
+  void visitForPartsWithDeclarations(ForPartsWithDeclarations node) {
+    safelyVisitNode(node.variables);
+    sink.write(';');
+    safelyVisitNodeWithPrefix(' ', node.condition);
+    sink.write(';');
+    safelyVisitNodeListWithSeparatorAndPrefix(' ', node.updaters, ', ');
+  }
+
+  @override
+  void visitForPartsWithExpression(ForPartsWithExpression node) {
+    safelyVisitNode(node.initialization);
+    sink.write(';');
+    safelyVisitNodeWithPrefix(' ', node.condition);
+    sink.write(';');
+    safelyVisitNodeListWithSeparatorAndPrefix(" ", node.updaters, ', ');
+  }
+
+  @override
   void visitForStatement(ForStatement node) {
     Expression initialization = node.initialization;
     sink.write("for (");
@@ -8783,6 +9628,14 @@
   }
 
   @override
+  void visitForStatement2(ForStatement2 node) {
+    sink.write('for (');
+    safelyVisitNode(node.forLoopParts);
+    sink.write(') ');
+    safelyVisitNode(node.body);
+  }
+
+  @override
   void visitFunctionDeclaration(FunctionDeclaration node) {
     safelyVisitNodeListWithSeparatorAndSuffix(node.metadata, " ", " ");
     safelyVisitTokenWithSuffix(node.externalKeyword, " ");
@@ -8969,10 +9822,7 @@
 
   @override
   void visitListLiteral(ListLiteral node) {
-    if (node.constKeyword != null) {
-      sink.write(node.constKeyword.lexeme);
-      sink.write(' ');
-    }
+    safelyVisitTokenWithSuffix(node.constKeyword, ' ');
     safelyVisitNodeWithSuffix(node.typeArguments, " ");
     sink.write("[");
     safelyVisitNodeListWithSeparator(node.elements, ", ");
@@ -8980,11 +9830,34 @@
   }
 
   @override
+  void visitListLiteral2(ListLiteral2 node) {
+    safelyVisitTokenWithSuffix(node.constKeyword, ' ');
+    safelyVisitNode(node.typeArguments);
+    sink.write('[');
+    safelyVisitNodeListWithSeparator(node.elements, ', ');
+    sink.write(']');
+  }
+
+  @override
+  void visitMapForElement(MapForElement node) {
+    sink.write('for (');
+    safelyVisitNode(node.forLoopParts);
+    sink.write(') ');
+    safelyVisitNode(node.body);
+  }
+
+  @override
+  void visitMapIfElement(MapIfElement node) {
+    sink.write('if (');
+    safelyVisitNode(node.condition);
+    sink.write(') ');
+    safelyVisitNode(node.thenElement);
+    safelyVisitNodeWithPrefix(' else ', node.elseElement);
+  }
+
+  @override
   void visitMapLiteral(MapLiteral node) {
-    if (node.constKeyword != null) {
-      sink.write(node.constKeyword.lexeme);
-      sink.write(' ');
-    }
+    safelyVisitTokenWithSuffix(node.constKeyword, ' ');
     safelyVisitNodeWithSuffix(node.typeArguments, " ");
     sink.write("{");
     safelyVisitNodeListWithSeparator(node.entries, ", ");
@@ -8992,6 +9865,15 @@
   }
 
   @override
+  void visitMapLiteral2(MapLiteral2 node) {
+    safelyVisitTokenWithSuffix(node.constKeyword, ' ');
+    safelyVisitNode(node.typeArguments);
+    sink.write('{');
+    safelyVisitNodeListWithSeparator(node.entries, ', ');
+    sink.write('}');
+  }
+
+  @override
   void visitMapLiteralEntry(MapLiteralEntry node) {
     safelyVisitNode(node.key);
     sink.write(" : ");
@@ -9157,10 +10039,7 @@
 
   @override
   void visitSetLiteral(SetLiteral node) {
-    if (node.constKeyword != null) {
-      sink.write(node.constKeyword.lexeme);
-      sink.write(' ');
-    }
+    safelyVisitTokenWithSuffix(node.constKeyword, ' ');
     safelyVisitNodeWithSuffix(node.typeArguments, " ");
     sink.write("{");
     safelyVisitNodeListWithSeparator(node.elements, ", ");
@@ -9168,6 +10047,15 @@
   }
 
   @override
+  void visitSetLiteral2(SetLiteral2 node) {
+    safelyVisitTokenWithSuffix(node.constKeyword, ' ');
+    safelyVisitNode(node.typeArguments);
+    sink.write('{');
+    safelyVisitNodeListWithSeparator(node.elements, ', ');
+    sink.write('}');
+  }
+
+  @override
   void visitShowCombinator(ShowCombinator node) {
     sink.write("show ");
     safelyVisitNodeListWithSeparator(node.shownNames, ", ");
@@ -9196,6 +10084,12 @@
   }
 
   @override
+  void visitSpreadElement(SpreadElement node) {
+    sink.write(node.spreadOperator.lexeme);
+    safelyVisitNode(node.expression);
+  }
+
+  @override
   void visitStringInterpolation(StringInterpolation node) {
     safelyVisitNodeList(node.elements);
   }
diff --git a/pkg/analyzer/lib/src/dart/constant/evaluation.dart b/pkg/analyzer/lib/src/dart/constant/evaluation.dart
index 545cd6c..4e6bcd8 100644
--- a/pkg/analyzer/lib/src/dart/constant/evaluation.dart
+++ b/pkg/analyzer/lib/src/dart/constant/evaluation.dart
@@ -1360,6 +1360,30 @@
   }
 
   @override
+  DartObjectImpl visitListLiteral2(ListLiteral2 node) {
+    if (!node.isConst) {
+      _errorReporter.reportErrorForNode(
+          CompileTimeErrorCode.MISSING_CONST_IN_LIST_LITERAL, node);
+      return null;
+    }
+    bool errorOccurred = false;
+    List<DartObjectImpl> list = [];
+    for (CollectionElement element in node.elements) {
+      errorOccurred = errorOccurred | _addElementsToList(list, element);
+    }
+    if (errorOccurred) {
+      return null;
+    }
+    DartType nodeType = node.staticType;
+    DartType elementType =
+        nodeType is InterfaceType && nodeType.typeArguments.isNotEmpty
+            ? nodeType.typeArguments[0]
+            : _typeProvider.dynamicType;
+    InterfaceType listType = _typeProvider.listType.instantiate([elementType]);
+    return new DartObjectImpl(listType, new ListState(list));
+  }
+
+  @override
   DartObjectImpl visitMapLiteral(MapLiteral node) {
     if (!node.isConst) {
       _errorReporter.reportErrorForNode(
@@ -1397,6 +1421,36 @@
   }
 
   @override
+  DartObjectImpl visitMapLiteral2(MapLiteral2 node) {
+    if (!node.isConst) {
+      _errorReporter.reportErrorForNode(
+          CompileTimeErrorCode.MISSING_CONST_IN_MAP_LITERAL, node);
+      return null;
+    }
+    Map<DartObjectImpl, DartObjectImpl> map = {};
+    bool errorOccurred = false;
+    for (MapElement element in node.entries) {
+      errorOccurred = errorOccurred | _addElementsToMap(map, element);
+    }
+    if (errorOccurred) {
+      return null;
+    }
+    DartType keyType = _typeProvider.dynamicType;
+    DartType valueType = _typeProvider.dynamicType;
+    DartType nodeType = node.staticType;
+    if (nodeType is InterfaceType) {
+      var typeArguments = nodeType.typeArguments;
+      if (typeArguments.length >= 2) {
+        keyType = typeArguments[0];
+        valueType = typeArguments[1];
+      }
+    }
+    InterfaceType mapType =
+        _typeProvider.mapType.instantiate([keyType, valueType]);
+    return new DartObjectImpl(mapType, new MapState(map));
+  }
+
+  @override
   DartObjectImpl visitMethodInvocation(MethodInvocation node) {
     Element element = node.methodName.staticElement;
     if (element is FunctionElement) {
@@ -1523,6 +1577,30 @@
   }
 
   @override
+  DartObjectImpl visitSetLiteral2(SetLiteral2 node) {
+    if (!node.isConst) {
+      _errorReporter.reportErrorForNode(
+          CompileTimeErrorCode.MISSING_CONST_IN_SET_LITERAL, node);
+      return null;
+    }
+    bool errorOccurred = false;
+    Set<DartObjectImpl> set = new Set<DartObjectImpl>();
+    for (CollectionElement element in node.elements) {
+      errorOccurred = errorOccurred | _addElementsToSet(set, element);
+    }
+    if (errorOccurred) {
+      return null;
+    }
+    DartType nodeType = node.staticType;
+    DartType elementType =
+        nodeType is InterfaceType && nodeType.typeArguments.isNotEmpty
+            ? nodeType.typeArguments[0]
+            : _typeProvider.dynamicType;
+    InterfaceType setType = _typeProvider.setType.instantiate([elementType]);
+    return new DartObjectImpl(setType, new SetState(set));
+  }
+
+  @override
   DartObjectImpl visitSimpleIdentifier(SimpleIdentifier node) {
     if (_lexicalEnvironment != null &&
         _lexicalEnvironment.containsKey(node.name)) {
@@ -1577,6 +1655,119 @@
   DartObjectImpl visitTypeName(TypeName node) => visitTypeAnnotation(node);
 
   /**
+   * Add the entries produced by evaluating the given collection [element] to
+   * the given [list]. Return `true` if the evaluation of one or more of the
+   * elements failed.
+   */
+  bool _addElementsToList(List<DartObject> list, CollectionElement element) {
+    if (element is CollectionIfElement) {
+      DartObjectImpl conditionResult = element.condition.accept(this);
+      bool conditionValue = conditionResult?.toBoolValue();
+      if (conditionValue == null) {
+        return true;
+      } else if (conditionValue) {
+        return _addElementsToList(list, element.thenElement);
+      } else if (element.elseElement != null) {
+        return _addElementsToList(list, element.elseElement);
+      }
+      return false;
+    } else if (element is Expression) {
+      DartObjectImpl value = element.accept(this);
+      if (value == null) {
+        return true;
+      }
+      list.add(value);
+      return false;
+    } else if (element is SpreadElement) {
+      DartObjectImpl elementResult = element.expression.accept(this);
+      List<DartObject> value = elementResult?.toListValue();
+      if (value == null) {
+        return true;
+      }
+      list.addAll(value);
+      return false;
+    }
+    // This error should have been reported elsewhere.
+    return true;
+  }
+
+  /**
+   * Add the entries produced by evaluating the given map [element] to the given
+   * [map]. Return `true` if the evaluation of one or more of the entries
+   * failed.
+   */
+  bool _addElementsToMap(
+      Map<DartObjectImpl, DartObjectImpl> map, MapElement element) {
+    if (element is MapIfElement) {
+      DartObjectImpl conditionResult = element.condition.accept(this);
+      bool conditionValue = conditionResult?.toBoolValue();
+      if (conditionValue == null) {
+        return true;
+      } else if (conditionValue) {
+        return _addElementsToMap(map, element.thenElement);
+      } else if (element.elseElement != null) {
+        return _addElementsToMap(map, element.elseElement);
+      }
+      return false;
+    } else if (element is MapLiteralEntry) {
+      DartObjectImpl keyResult = element.key.accept(this);
+      DartObjectImpl valueResult = element.value.accept(this);
+      if (keyResult == null || valueResult == null) {
+        return true;
+      }
+      map[keyResult] = valueResult;
+      return false;
+    } else if (element is SpreadElement) {
+      DartObjectImpl elementResult = element.expression.accept(this);
+      Map<DartObject, DartObject> value = elementResult?.toMapValue();
+      if (value == null) {
+        return true;
+      }
+      map.addAll(value);
+      return false;
+    }
+    // This error should have been reported elsewhere.
+    return true;
+  }
+
+  /**
+   * Add the entries produced by evaluating the given collection [element] to
+   * the given [set]. Return `true` if the evaluation of one or more of the
+   * elements failed.
+   */
+  bool _addElementsToSet(Set<DartObject> set, CollectionElement element) {
+    if (element is CollectionIfElement) {
+      DartObjectImpl conditionResult = element.condition.accept(this);
+      bool conditionValue = conditionResult?.toBoolValue();
+      if (conditionValue == null) {
+        return true;
+      } else if (conditionValue) {
+        return _addElementsToSet(set, element.thenElement);
+      } else if (element.elseElement != null) {
+        return _addElementsToSet(set, element.elseElement);
+      }
+      return false;
+    } else if (element is Expression) {
+      DartObjectImpl value = element.accept(this);
+      if (value == null) {
+        return true;
+      }
+      set.add(value);
+      return false;
+    } else if (element is SpreadElement) {
+      DartObjectImpl elementResult = element.expression.accept(this);
+      Set<DartObject> value = elementResult?.toSetValue();
+      if (value == null) {
+        return true;
+      }
+      set.addAll(value);
+      return false;
+    }
+    // This error should have been reported elsewhere.
+    return true;
+  }
+
+  /**
    * Create an error associated with the given [node]. The error will have the
    * given error [code].
    */
diff --git a/pkg/analyzer/lib/src/dart/constant/utilities.dart b/pkg/analyzer/lib/src/dart/constant/utilities.dart
index 6a806c3..95223de 100644
--- a/pkg/analyzer/lib/src/dart/constant/utilities.dart
+++ b/pkg/analyzer/lib/src/dart/constant/utilities.dart
@@ -95,6 +95,16 @@
   }
 
   @override
+  ListLiteral2 visitListLiteral2(ListLiteral2 node) {
+    ListLiteral2 literal = super.visitListLiteral2(node);
+    literal.staticType = node.staticType;
+    if (node.constKeyword == null && node.isConst) {
+      literal.constKeyword = new KeywordToken(Keyword.CONST, node.offset);
+    }
+    return literal;
+  }
+
+  @override
   MapLiteral visitMapLiteral(MapLiteral node) {
     MapLiteral literal = super.visitMapLiteral(node);
     literal.staticType = node.staticType;
@@ -105,6 +115,16 @@
   }
 
   @override
+  MapLiteral2 visitMapLiteral2(MapLiteral2 node) {
+    MapLiteral2 literal = super.visitMapLiteral2(node);
+    literal.staticType = node.staticType;
+    if (node.constKeyword == null && node.isConst) {
+      literal.constKeyword = new KeywordToken(Keyword.CONST, node.offset);
+    }
+    return literal;
+  }
+
+  @override
   RedirectingConstructorInvocation visitRedirectingConstructorInvocation(
       RedirectingConstructorInvocation node) {
     RedirectingConstructorInvocation invocation =
@@ -124,6 +144,16 @@
   }
 
   @override
+  SetLiteral2 visitSetLiteral2(SetLiteral2 node) {
+    SetLiteral2 literal = super.visitSetLiteral2(node);
+    literal.staticType = node.staticType;
+    if (node.constKeyword == null && node.isConst) {
+      literal.constKeyword = new KeywordToken(Keyword.CONST, node.offset);
+    }
+    return literal;
+  }
+
+  @override
   SimpleIdentifier visitSimpleIdentifier(SimpleIdentifier node) {
     SimpleIdentifier identifier = super.visitSimpleIdentifier(node);
     identifier.staticElement = node.staticElement;
diff --git a/pkg/analyzer/lib/src/dart/constant/value.dart b/pkg/analyzer/lib/src/dart/constant/value.dart
index 4666351..c95889d 100644
--- a/pkg/analyzer/lib/src/dart/constant/value.dart
+++ b/pkg/analyzer/lib/src/dart/constant/value.dart
@@ -171,12 +171,6 @@
  * A representation of an instance of a Dart class.
  */
 class DartObjectImpl implements DartObject {
-  /**
-   * An empty list of objects.
-   */
-  @deprecated
-  static const List<DartObjectImpl> EMPTY_LIST = const <DartObjectImpl>[];
-
   @override
   final ParameterizedType type;
 
diff --git a/pkg/analyzer/lib/src/dart/element/builder.dart b/pkg/analyzer/lib/src/dart/element/builder.dart
index 5d439ae..9aac7f7 100644
--- a/pkg/analyzer/lib/src/dart/element/builder.dart
+++ b/pkg/analyzer/lib/src/dart/element/builder.dart
@@ -1432,7 +1432,7 @@
     parameter.isConst = node.isConst;
     parameter.isExplicitlyCovariant = node.parameter.covariantKeyword != null;
     parameter.isFinal = node.isFinal;
-    // ignore: deprecated_member_use
+    // ignore: deprecated_member_use_from_same_package
     parameter.parameterKind = node.kind;
     // visible range
     _setParameterVisibleRange(node, parameter);
@@ -1459,7 +1459,7 @@
       parameter.isConst = node.isConst;
       parameter.isExplicitlyCovariant = node.covariantKeyword != null;
       parameter.isFinal = node.isFinal;
-      // ignore: deprecated_member_use
+      // ignore: deprecated_member_use_from_same_package
       parameter.parameterKind = node.kind;
       _currentHolder.addParameter(parameter);
       parameterName.staticElement = parameter;
@@ -1488,7 +1488,7 @@
       parameter.isConst = node.isConst;
       parameter.isExplicitlyCovariant = node.covariantKeyword != null;
       parameter.isFinal = node.isFinal;
-      // ignore: deprecated_member_use
+      // ignore: deprecated_member_use_from_same_package
       parameter.parameterKind = node.kind;
       _setParameterVisibleRange(node, parameter);
       _currentHolder.addParameter(parameter);
@@ -1531,7 +1531,7 @@
       parameter.isConst = node.isConst;
       parameter.isExplicitlyCovariant = node.covariantKeyword != null;
       parameter.isFinal = node.isFinal;
-      // ignore: deprecated_member_use
+      // ignore: deprecated_member_use_from_same_package
       parameter.parameterKind = node.kind;
       _setParameterVisibleRange(node, parameter);
       if (node.type == null) {
diff --git a/pkg/analyzer/lib/src/dart/element/element.dart b/pkg/analyzer/lib/src/dart/element/element.dart
index f764d36..56e2f2a 100644
--- a/pkg/analyzer/lib/src/dart/element/element.dart
+++ b/pkg/analyzer/lib/src/dart/element/element.dart
@@ -1133,7 +1133,7 @@
           }
           implicitParameter.isConst = superParameter.isConst;
           implicitParameter.isFinal = superParameter.isFinal;
-          // ignore: deprecated_member_use
+          // ignore: deprecated_member_use_from_same_package
           implicitParameter.parameterKind = superParameter.parameterKind;
           implicitParameter.isSynthetic = true;
           implicitParameter.type =
@@ -3868,7 +3868,7 @@
           buffer.write(", ");
         }
         ParameterElement parameter = parameters[i];
-        // ignore: deprecated_member_use
+        // ignore: deprecated_member_use_from_same_package
         ParameterKind parameterKind = parameter.parameterKind;
         if (parameterKind != kind) {
           if (closing != null) {
diff --git a/pkg/analyzer/lib/src/dart/element/inheritance_manager2.dart b/pkg/analyzer/lib/src/dart/element/inheritance_manager2.dart
index 799dbc8..8acdc92 100644
--- a/pkg/analyzer/lib/src/dart/element/inheritance_manager2.dart
+++ b/pkg/analyzer/lib/src/dart/element/inheritance_manager2.dart
@@ -84,8 +84,10 @@
       }
 
       if (classElement.isMixin) {
+        var superClassCandidates = <Name, List<FunctionType>>{};
         for (var constraint in type.superclassConstraints) {
           var interfaceObj = getInterface(constraint);
+          _addCandidates(superClassCandidates, interfaceObj);
           _addCandidates(namedCandidates, interfaceObj);
         }
 
@@ -93,9 +95,9 @@
 
         // `mixin M on S1, S2 {}` can call using `super` any instance member
         // from its superclass constraints, whether it is abstract or concrete.
-        Map<Name, FunctionType> mixinSuperClass = {};
-        _findMostSpecificFromNamedCandidates(mixinSuperClass, namedCandidates);
-        superImplemented.add(mixinSuperClass);
+        var superClass = <Name, FunctionType>{};
+        _findMostSpecificFromNamedCandidates(superClass, superClassCandidates);
+        superImplemented.add(superClass);
       } else {
         if (type.superclass != null) {
           superInterface = getInterface(type.superclass);
@@ -448,6 +450,11 @@
     this._superImplemented,
     this.conflicts,
   );
+
+  /// Return `true` if the [name] is implemented in the supertype.
+  bool isSuperImplemented(Name name) {
+    return _superImplemented.last.containsKey(name);
+  }
 }
 
 /// A public name, or a private name qualified by a library URI.
diff --git a/pkg/analyzer/lib/src/dart/element/member.dart b/pkg/analyzer/lib/src/dart/element/member.dart
index 484458a..845d59d 100644
--- a/pkg/analyzer/lib/src/dart/element/member.dart
+++ b/pkg/analyzer/lib/src/dart/element/member.dart
@@ -636,7 +636,7 @@
         buffer.write(", ");
       }
       ParameterElement parameter = parameters[i];
-      // ignore: deprecated_member_use
+      // ignore: deprecated_member_use_from_same_package
       ParameterKind parameterKind = parameter.parameterKind;
       if (parameterKind != kind) {
         if (closing != null) {
diff --git a/pkg/analyzer/lib/src/dart/element/type.dart b/pkg/analyzer/lib/src/dart/element/type.dart
index 6b7d311..85712c3 100644
--- a/pkg/analyzer/lib/src/dart/element/type.dart
+++ b/pkg/analyzer/lib/src/dart/element/type.dart
@@ -920,7 +920,7 @@
       return new ParameterElementImpl.synthetic(
           p.name,
           newType,
-          // ignore: deprecated_member_use
+          // ignore: deprecated_member_use_from_same_package
           p.parameterKind);
     }
 
@@ -1496,6 +1496,15 @@
   }
 
   @override
+  bool get isDartCoreBool {
+    ClassElement element = this.element;
+    if (element == null) {
+      return false;
+    }
+    return element.name == "bool" && element.library.isDartCore;
+  }
+
+  @override
   bool get isDartCoreFunction {
     ClassElement element = this.element;
     if (element == null) {
@@ -2735,6 +2744,9 @@
   bool get isDartAsyncFutureOr => false;
 
   @override
+  bool get isDartCoreBool => false;
+
+  @override
   bool get isDartCoreFunction => false;
 
   @override
@@ -3717,7 +3729,7 @@
     int length = parameters.length;
     for (int i = 0; i < length; i++) {
       ParameterElement parameter = parameters[i];
-      // ignore: deprecated_member_use
+      // ignore: deprecated_member_use_from_same_package
       if (parameter.parameterKind == kind) {
         TypeImpl type = parameter.type ?? DynamicTypeImpl.instance;
         if (typeArguments.length != 0 &&
@@ -3798,7 +3810,7 @@
       return new ParameterElementImpl.synthetic(
           p.name,
           newType,
-          // ignore: deprecated_member_use
+          // ignore: deprecated_member_use_from_same_package
           p.parameterKind);
     }
 
@@ -3853,7 +3865,7 @@
       return new ParameterElementImpl.synthetic(
           p.name,
           newType,
-          // ignore: deprecated_member_use
+          // ignore: deprecated_member_use_from_same_package
           p.parameterKind);
     }
 
@@ -3880,7 +3892,7 @@
   void _forEachParameterType(
       ParameterKind kind, Function(String name, DartType type) callback) {
     for (var parameter in parameters) {
-      // ignore: deprecated_member_use
+      // ignore: deprecated_member_use_from_same_package
       if (parameter.parameterKind == kind) {
         callback(parameter.name, parameter.type);
       }
diff --git a/pkg/analyzer/lib/src/dart/element/wrapped.dart b/pkg/analyzer/lib/src/dart/element/wrapped.dart
index 3c6f7f1..10c3f75 100644
--- a/pkg/analyzer/lib/src/dart/element/wrapped.dart
+++ b/pkg/analyzer/lib/src/dart/element/wrapped.dart
@@ -185,7 +185,7 @@
 
   @override
   String computeDocumentationComment() => wrappedUnit
-      .computeDocumentationComment(); // ignore: deprecated_member_use
+      .computeDocumentationComment(); // ignore: deprecated_member_use_from_same_package
 
   @deprecated
   @override
@@ -377,7 +377,7 @@
 
   @override
   String computeDocumentationComment() => wrappedImport
-      .computeDocumentationComment(); // ignore: deprecated_member_use
+      .computeDocumentationComment(); // ignore: deprecated_member_use_from_same_package
 
   @deprecated
   @override
@@ -599,8 +599,8 @@
   T accept<T>(ElementVisitor<T> visitor) => wrappedLib.accept(visitor);
 
   @override
-  String computeDocumentationComment() =>
-      wrappedLib.computeDocumentationComment(); // ignore: deprecated_member_use
+  String computeDocumentationComment() => wrappedLib
+      .computeDocumentationComment(); // ignore: deprecated_member_use_from_same_package
 
   @deprecated
   @override
diff --git a/pkg/analyzer/lib/src/dart/resolver/definite_assignment.dart b/pkg/analyzer/lib/src/dart/resolver/definite_assignment.dart
index 0b1cd1d..8edf986 100644
--- a/pkg/analyzer/lib/src/dart/resolver/definite_assignment.dart
+++ b/pkg/analyzer/lib/src/dart/resolver/definite_assignment.dart
@@ -1,4 +1,4 @@
-// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
@@ -546,6 +546,12 @@
     _statementToStackIndex[statement] = _stack.length;
   }
 
+  void beginForStatement2(ForStatement2 statement) {
+    // Not strongly necessary, because we discard everything anyway.
+    // Just for consistency, so that `break` is handled without `null`.
+    _statementToStackIndex[statement] = _stack.length;
+  }
+
   void beginForStatementBody() {
     _stack.add(_current); // break set
     _stack.add(_ElementSet.empty); // continue set
diff --git a/pkg/analyzer/lib/src/dart/resolver/flow_analysis.dart b/pkg/analyzer/lib/src/dart/resolver/flow_analysis.dart
new file mode 100644
index 0000000..5301558
--- /dev/null
+++ b/pkg/analyzer/lib/src/dart/resolver/flow_analysis.dart
@@ -0,0 +1,731 @@
+// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:analyzer/dart/ast/ast.dart';
+import 'package:analyzer/dart/element/element.dart';
+import 'package:analyzer/dart/element/type.dart';
+import 'package:analyzer/dart/element/type_system.dart';
+
+class FlowAnalysis {
+  /// The output list of variables that were read before they were written.
+  /// TODO(scheglov) use _ElementSet?
+  final List<LocalVariableElement> readBeforeWritten = [];
+
+  /// The [TypeSystem] of the enclosing library, used to check subtyping.
+  final TypeSystem typeSystem;
+
+  /// The enclosing [FunctionBody], used to check for potential mutations.
+  final FunctionBody functionBody;
+
+  /// The stack of states of variables that are not definitely assigned.
+  final List<_State> _stack = [];
+
+  /// The mapping from labeled [Statement]s to the index in the [_stack]
+  /// where the first related element is located.  The number of elements
+  /// is statement specific.  Loops have two elements: `break` and `continue`
+  /// states.
+  final Map<Statement, int> _statementToStackIndex = {};
+
+  _State _current;
+
+  /// The last boolean condition, for [_conditionTrue] and [_conditionFalse].
+  Expression _condition;
+
+  /// The state when [_condition] evaluates to `true`.
+  _State _conditionTrue;
+
+  /// The state when [_condition] evaluates to `false`.
+  _State _conditionFalse;
+
+  FlowAnalysis(this.typeSystem, this.functionBody) {
+    _current = _State(true, _ElementSet.empty, const {});
+  }
+
+  /// Return `true` if the current state is reachable.
+  bool get isReachable => _current.reachable;
+
+  /// Add a new [variable], which might be already [assigned].
+  void add(LocalVariableElement variable, {bool assigned: false}) {
+    if (!assigned) {
+      _current = _current.add(variable);
+    }
+  }
+
+  void conditional_elseBegin(ConditionalExpression node, bool isBool) {
+    var afterThen = _current;
+    var falseCondition = _stack.removeLast();
+
+    if (isBool) {
+      _conditionalEnd(node.thenExpression);
+      // Tail of the stack: falseThen, trueThen
+    }
+
+    _stack.add(afterThen);
+    _current = falseCondition;
+  }
+
+  void conditional_end(ConditionalExpression node, bool isBool) {
+    var afterThen = _stack.removeLast();
+    var afterElse = _current;
+
+    if (isBool) {
+      _conditionalEnd(node.elseExpression);
+      // Tail of the stack: falseThen, trueThen, falseElse, trueElse
+
+      var trueElse = _stack.removeLast();
+      var falseElse = _stack.removeLast();
+
+      var trueThen = _stack.removeLast();
+      var falseThen = _stack.removeLast();
+
+      var trueResult = trueThen.combine(typeSystem, trueElse);
+      var falseResult = falseThen.combine(typeSystem, falseElse);
+
+      _condition = node;
+      _conditionTrue = trueResult;
+      _conditionFalse = falseResult;
+    }
+
+    _current = afterThen.combine(typeSystem, afterElse);
+  }
+
+  void conditional_thenBegin(ConditionalExpression node) {
+    _conditionalEnd(node.condition);
+    // Tail of the stack: falseCondition, trueCondition
+
+    var trueCondition = _stack.removeLast();
+    _current = trueCondition;
+  }
+
+  void doStatement_bodyBegin(
+      DoStatement node, Set<VariableElement> loopAssigned) {
+    _current = _current.removePromotedAll(loopAssigned);
+
+    _statementToStackIndex[node] = _stack.length;
+    _stack.add(_State.identity); // break
+    _stack.add(_State.identity); // continue
+  }
+
+  void doStatement_conditionBegin() {
+    // Tail of the stack: break, continue
+
+    var continueState = _stack.removeLast();
+    _current = _current.combine(typeSystem, continueState);
+  }
+
+  void doStatement_end(DoStatement node) {
+    _conditionalEnd(node.condition);
+    // Tail of the stack:  break, falseCondition, trueCondition
+
+    _stack.removeLast(); // trueCondition
+    var falseCondition = _stack.removeLast();
+    var breakState = _stack.removeLast();
+
+    _current = falseCondition.combine(typeSystem, breakState);
+  }
+
+  void falseLiteral(BooleanLiteral expression) {
+    _condition = expression;
+    _conditionTrue = _State.identity;
+    _conditionFalse = _current;
+  }
+
+  void forEachStatement_bodyBegin(Set<VariableElement> loopAssigned) {
+    _stack.add(_current);
+    _current = _current.removePromotedAll(loopAssigned);
+  }
+
+  void forEachStatement_end() {
+    var afterIterable = _stack.removeLast();
+    _current = _current.combine(typeSystem, afterIterable);
+  }
+
+  void forStatement_bodyBegin(Statement node, Expression condition) {
+    _conditionalEnd(condition);
+    // Tail of the stack: falseCondition, trueCondition
+
+    var trueCondition = _stack.removeLast();
+
+    _statementToStackIndex[node] = _stack.length;
+    _stack.add(_State.identity); // break
+    _stack.add(_State.identity); // continue
+
+    _current = trueCondition;
+  }
+
+  void forStatement_conditionBegin(Set<VariableElement> loopAssigned) {
+    _current = _current.removePromotedAll(loopAssigned);
+  }
+
+  void forStatement_end() {
+    // Tail of the stack: falseCondition, break
+    var breakState = _stack.removeLast();
+    var falseCondition = _stack.removeLast();
+
+    _current = falseCondition.combine(typeSystem, breakState);
+  }
+
+  void forStatement_updaterBegin() {
+    // Tail of the stack: falseCondition, break, continue
+    var afterBody = _current;
+    var continueState = _stack.removeLast();
+
+    _current = afterBody.combine(typeSystem, continueState);
+  }
+
+  void functionExpression_begin() {
+    _stack.add(_current);
+
+    Set<VariableElement> notPromoted = null;
+    for (var variable in _current.promoted.keys) {
+      if (functionBody.isPotentiallyMutatedInScope(variable)) {
+        notPromoted ??= Set<VariableElement>.identity();
+        notPromoted.add(variable);
+      }
+    }
+
+    if (notPromoted != null) {
+      _current = _current.removePromotedAll(notPromoted);
+    }
+  }
+
+  void functionExpression_end() {
+    _current = _stack.removeLast();
+  }
+
+  void handleBreak(AstNode target) {
+    var breakIndex = _statementToStackIndex[target];
+    if (breakIndex != null) {
+      _stack[breakIndex] = _stack[breakIndex].combine(typeSystem, _current);
+    }
+    _current = _State.identity;
+  }
+
+  void handleContinue(AstNode target) {
+    var breakIndex = _statementToStackIndex[target];
+    if (breakIndex != null) {
+      var continueIndex = breakIndex + 1;
+      _stack[continueIndex] =
+          _stack[continueIndex].combine(typeSystem, _current);
+    }
+    _current = _State.identity;
+  }
+
+  /// Register the fact that the current state definitely exists, e.g. returns
+  /// from the body, throws an exception, etc.
+  void handleExit() {
+    _current = _State.identity;
+  }
+
+  void ifNullExpression_end() {
+    var afterLeft = _stack.removeLast();
+    _current = _current.combine(typeSystem, afterLeft);
+  }
+
+  void ifNullExpression_rightBegin() {
+    _stack.add(_current); // afterLeft
+  }
+
+  void ifStatement_elseBegin() {
+    var afterThen = _current;
+    var falseCondition = _stack.removeLast();
+    _stack.add(afterThen);
+    _current = falseCondition;
+  }
+
+  void ifStatement_end(bool hasElse) {
+    _State afterThen;
+    _State afterElse;
+    if (hasElse) {
+      afterThen = _stack.removeLast();
+      afterElse = _current;
+    } else {
+      afterThen = _current; // no `else`, so `then` is still current
+      afterElse = _stack.removeLast(); // `falseCond` is still on the stack
+    }
+    _current = afterThen.combine(typeSystem, afterElse);
+  }
+
+  void ifStatement_thenBegin(IfStatement ifStatement) {
+    _conditionalEnd(ifStatement.condition);
+    // Tail of the stack:  falseCondition, trueCondition
+
+    var trueCondition = _stack.removeLast();
+    _current = trueCondition;
+  }
+
+  void isExpression_end(
+      IsExpression isExpression, VariableElement variable, DartType type) {
+    if (functionBody.isPotentiallyMutatedInClosure(variable)) {
+      return;
+    }
+
+    _condition = isExpression;
+    if (isExpression.notOperator == null) {
+      _conditionTrue = _current.promote(typeSystem, variable, type);
+      _conditionFalse = _current;
+    } else {
+      _conditionTrue = _current;
+      _conditionFalse = _current.promote(typeSystem, variable, type);
+    }
+  }
+
+  void logicalAnd_end(BinaryExpression andExpression) {
+    _conditionalEnd(andExpression.rightOperand);
+    // Tail of the stack: falseLeft, trueLeft, falseRight, trueRight
+
+    var trueRight = _stack.removeLast();
+    var falseRight = _stack.removeLast();
+
+    _stack.removeLast(); // trueLeft is not used
+    var falseLeft = _stack.removeLast();
+
+    var trueResult = trueRight;
+    var falseResult = falseLeft.combine(typeSystem, falseRight);
+    var afterResult = trueResult.combine(typeSystem, falseResult);
+
+    _condition = andExpression;
+    _conditionTrue = trueResult;
+    _conditionFalse = falseResult;
+
+    _current = afterResult;
+  }
+
+  void logicalAnd_rightBegin(BinaryExpression andExpression) {
+    _conditionalEnd(andExpression.leftOperand);
+    // Tail of the stack: falseLeft, trueLeft
+
+    var trueLeft = _stack.last;
+    _current = trueLeft;
+  }
+
+  void logicalNot_end(PrefixExpression notExpression) {
+    _conditionalEnd(notExpression.operand);
+    var trueExpr = _stack.removeLast();
+    var falseExpr = _stack.removeLast();
+
+    _condition = notExpression;
+    _conditionTrue = falseExpr;
+    _conditionFalse = trueExpr;
+  }
+
+  void logicalOr_end(BinaryExpression orExpression) {
+    _conditionalEnd(orExpression.rightOperand);
+    // Tail of the stack: falseLeft, trueLeft, falseRight, trueRight
+
+    var trueRight = _stack.removeLast();
+    var falseRight = _stack.removeLast();
+
+    var trueLeft = _stack.removeLast();
+    _stack.removeLast(); // falseLeft is not used
+
+    var trueResult = trueLeft.combine(typeSystem, trueRight);
+    var falseResult = falseRight;
+    var afterResult = trueResult.combine(typeSystem, falseResult);
+
+    _condition = orExpression;
+    _conditionTrue = trueResult;
+    _conditionFalse = falseResult;
+
+    _current = afterResult;
+  }
+
+  void logicalOr_rightBegin(BinaryExpression orExpression) {
+    _conditionalEnd(orExpression.leftOperand);
+    // Tail of the stack: falseLeft, trueLeft
+
+    var falseLeft = _stack[_stack.length - 2];
+    _current = falseLeft;
+  }
+
+  /// Retrieves the type that the [variable] is promoted to, if the [variable]
+  /// is currently promoted.  Otherwise returns `null`.
+  DartType promotedType(VariableElement variable) {
+    return _current.promoted[variable];
+  }
+
+  /// Register read of the given [variable] in the current state.
+  void read(LocalVariableElement variable) {
+    if (_current.notAssigned.contains(variable)) {
+      // Add to the list of violating variables, if not there yet.
+      for (var i = 0; i < readBeforeWritten.length; ++i) {
+        var violatingVariable = readBeforeWritten[i];
+        if (identical(violatingVariable, variable)) {
+          return;
+        }
+      }
+      readBeforeWritten.add(variable);
+    }
+  }
+
+  /// The [notPromoted] set contains all variables that are potentially
+  /// assigned in other cases that might target this with `continue`, so
+  /// these variables might have different types and are "un-promoted" from
+  /// the "afterExpression" state.
+  void switchStatement_beginCase(Set<VariableElement> notPromoted) {
+    _current = _stack.last.removePromotedAll(notPromoted);
+  }
+
+  void switchStatement_end(SwitchStatement node, bool hasDefault) {
+    // Tail of the stack: break, continue, afterExpression
+    var afterExpression = _current = _stack.removeLast();
+    _stack.removeLast(); // continue
+    var breakState = _stack.removeLast();
+
+    if (hasDefault) {
+      _current = breakState;
+    } else {
+      _current = breakState.combine(typeSystem, afterExpression);
+    }
+  }
+
+  void switchStatement_expressionEnd(SwitchStatement node) {
+    _statementToStackIndex[node] = _stack.length;
+    _stack.add(_State.identity); // break
+    _stack.add(_State.identity); // continue
+    _stack.add(_current); // afterExpression
+  }
+
+  void trueLiteral(BooleanLiteral expression) {
+    _condition = expression;
+    _conditionTrue = _current;
+    _conditionFalse = _State.identity;
+  }
+
+  void tryStatement_bodyBegin() {
+    _stack.add(_current);
+    // Tail of the stack: beforeBody
+  }
+
+  void tryStatement_bodyEnd(Set<VariableElement> notPromoted) {
+    var beforeBody = _stack.removeLast();
+    var beforeCatch = beforeBody.removePromotedAll(notPromoted);
+    _stack.add(beforeCatch);
+    _stack.add(_current); // afterBodyAndCatches
+    // Tail of the stack: beforeCatch, afterBodyAndCatches
+  }
+
+  void tryStatement_catchBegin() {
+    var beforeCatch = _stack[_stack.length - 2];
+    _current = beforeCatch;
+  }
+
+  void tryStatement_catchEnd() {
+    var afterBodyAndCatches = _stack.last;
+    _stack.last = afterBodyAndCatches.combine(typeSystem, _current);
+  }
+
+  void tryStatement_end() {
+    var afterBodyAndCatches = _stack.removeLast();
+    _current = _current.setReachable(afterBodyAndCatches.reachable);
+  }
+
+  void tryStatement_finallyBegin() {
+    // TODO(scheglov) This code is incomplete, so has bug.
+    // `finally` might be executed:
+    // (1) on exception in the body or a catch;
+    // (2) on normal completion of the body or a catch;
+    // The code below only works for (1).
+    var afterBodyAndCatches = _stack.removeLast();
+    var beforeCatch = _stack.removeLast();
+
+    _current = afterBodyAndCatches.setReachable(beforeCatch.reachable);
+    _stack.add(afterBodyAndCatches); // for 'reachable'
+  }
+
+  void verifyStackEmpty() {
+    assert(_stack.isEmpty);
+  }
+
+  void whileStatement_bodyBegin(WhileStatement node) {
+    _conditionalEnd(node.condition);
+    // Tail of the stack: falseCondition, trueCondition
+
+    var trueCondition = _stack.removeLast();
+
+    _statementToStackIndex[node] = _stack.length;
+    _stack.add(_State.identity); // break
+    _stack.add(_State.identity); // continue
+
+    _current = trueCondition;
+  }
+
+  void whileStatement_conditionBegin(Set<VariableElement> loopAssigned) {
+    _current = _current.removePromotedAll(loopAssigned);
+  }
+
+  void whileStatement_end() {
+    _stack.removeLast(); // continue
+    var breakState = _stack.removeLast();
+    var falseCondition = _stack.removeLast();
+
+    _current = falseCondition.combine(typeSystem, breakState);
+  }
+
+  /// Register write of the given [variable] in the current state.
+  void write(VariableElement variable) {
+    _current = _current.write(variable);
+  }
+
+  void _conditionalEnd(Expression condition) {
+    while (condition is ParenthesizedExpression) {
+      condition = (condition as ParenthesizedExpression).expression;
+    }
+    if (identical(condition, _condition)) {
+      _stack.add(_conditionFalse);
+      _stack.add(_conditionTrue);
+    } else {
+      _stack.add(_current);
+      _stack.add(_current);
+    }
+  }
+}
+
+/// Sets of variables that are potentially assigned in loops.
+class LoopAssignedVariables {
+  static final emptySet = Set<VariableElement>();
+
+  /// Mapping from a loop [AstNode] to the set of variables that are
+  /// potentially assigned in this loop.
+  final Map<AstNode, Set<VariableElement>> _map = {};
+
+  /// The stack of nested loops.
+  final List<Set<VariableElement>> _stack = [];
+
+  /// Return the set of variables that are potentially assigned in the [loop].
+  Set<VariableElement> operator [](AstNode loop) {
+    return _map[loop] ?? emptySet;
+  }
+
+  void beginLoop() {
+    var set = Set<VariableElement>.identity();
+    _stack.add(set);
+  }
+
+  void endLoop(AstNode loop) {
+    _map[loop] = _stack.removeLast();
+  }
+
+  void write(VariableElement variable) {
+    for (var i = 0; i < _stack.length; ++i) {
+      _stack[i].add(variable);
+    }
+  }
+}
+
+/// List based immutable set of elements.
+class _ElementSet {
+  static final empty = _ElementSet._(
+    List<LocalVariableElement>(0),
+  );
+
+  final List<LocalVariableElement> elements;
+
+  _ElementSet._(this.elements);
+
+  _ElementSet add(LocalVariableElement addedElement) {
+    if (contains(addedElement)) {
+      return this;
+    }
+
+    var length = elements.length;
+    var newElements = List<LocalVariableElement>(length + 1);
+    for (var i = 0; i < length; ++i) {
+      newElements[i] = elements[i];
+    }
+    newElements[length] = addedElement;
+    return _ElementSet._(newElements);
+  }
+
+  bool contains(LocalVariableElement element) {
+    var length = elements.length;
+    for (var i = 0; i < length; ++i) {
+      if (identical(elements[i], element)) {
+        return true;
+      }
+    }
+    return false;
+  }
+
+  _ElementSet remove(LocalVariableElement removedElement) {
+    if (!contains(removedElement)) {
+      return this;
+    }
+
+    var length = elements.length;
+    if (length == 1) {
+      return empty;
+    }
+
+    var newElements = List<LocalVariableElement>(length - 1);
+    var newIndex = 0;
+    for (var i = 0; i < length; ++i) {
+      var element = elements[i];
+      if (!identical(element, removedElement)) {
+        newElements[newIndex++] = element;
+      }
+    }
+
+    return _ElementSet._(newElements);
+  }
+
+  _ElementSet union(_ElementSet other) {
+    if (other == null || other.elements.isEmpty) {
+      return this;
+    }
+
+    var result = this;
+    var otherElements = other.elements;
+    for (var i = 0; i < otherElements.length; ++i) {
+      var otherElement = otherElements[i];
+      result = result.add(otherElement);
+    }
+    return result;
+  }
+}
+
+class _State {
+  static final identity = _State(false, _ElementSet.empty, const {});
+
+  final bool reachable;
+  final _ElementSet notAssigned;
+  final Map<VariableElement, DartType> promoted;
+
+  _State(this.reachable, this.notAssigned, this.promoted);
+
+  /// Add a new [variable] to track definite assignment.
+  _State add(LocalVariableElement variable) {
+    var newNotAssigned = notAssigned.add(variable);
+    if (identical(newNotAssigned, notAssigned)) return this;
+    return _State(reachable, newNotAssigned, promoted);
+  }
+
+  _State combine(TypeSystem typeSystem, _State other) {
+    if (identical(this, identity)) return other;
+    if (identical(other, identity)) return this;
+
+    var newReachable = reachable || other.reachable;
+    var newNotAssigned = notAssigned.union(other.notAssigned);
+    var newPromoted = _combinePromoted(typeSystem, promoted, other.promoted);
+
+    if (reachable == newReachable &&
+        identical(notAssigned, newNotAssigned) &&
+        identical(promoted, newPromoted)) {
+      return this;
+    }
+    if (other.reachable == newReachable &&
+        identical(other.notAssigned, newNotAssigned) &&
+        identical(other.promoted, newPromoted)) {
+      return other;
+    }
+
+    return _State(newReachable, newNotAssigned, newPromoted);
+  }
+
+  _State promote(
+      TypeSystem typeSystem, VariableElement variable, DartType type) {
+    var previousType = promoted[variable];
+    previousType ??= variable.type;
+
+    if (typeSystem.isSubtypeOf(type, previousType) && type != previousType) {
+      var newPromoted = <VariableElement, DartType>{}..addAll(promoted);
+      newPromoted[variable] = type;
+      return _State(reachable, notAssigned, newPromoted);
+    }
+
+    return this;
+  }
+
+  _State removePromotedAll(Set<VariableElement> variables) {
+    var newPromoted = _removePromotedAll(promoted, variables);
+
+    if (identical(newPromoted, promoted)) return this;
+
+    return _State(reachable, notAssigned, newPromoted);
+  }
+
+  _State setReachable(bool reachable) {
+    if (this.reachable == reachable) return this;
+
+    return _State(reachable, notAssigned, promoted);
+  }
+
+  _State write(VariableElement variable) {
+    var newNotAssigned = variable is LocalVariableElement
+        ? notAssigned.remove(variable)
+        : notAssigned;
+    var newPromoted = _removePromoted(promoted, variable);
+
+    if (identical(newNotAssigned, notAssigned) &&
+        identical(newPromoted, promoted)) {
+      return this;
+    }
+
+    return _State(reachable, newNotAssigned, newPromoted);
+  }
+
+  static Map<VariableElement, DartType> _combinePromoted(TypeSystem typeSystem,
+      Map<VariableElement, DartType> a, Map<VariableElement, DartType> b) {
+    if (identical(a, b)) return a;
+    if (a.isEmpty || b.isEmpty) return const {};
+
+    var result = <VariableElement, DartType>{};
+    var alwaysA = true;
+    var alwaysB = true;
+    for (var element in a.keys) {
+      var aType = a[element];
+      var bType = b[element];
+      if (aType != null && bType != null) {
+        if (typeSystem.isSubtypeOf(aType, bType)) {
+          result[element] = bType;
+          alwaysA = false;
+        } else if (typeSystem.isSubtypeOf(bType, aType)) {
+          result[element] = aType;
+          alwaysB = false;
+        } else {
+          alwaysA = false;
+          alwaysB = false;
+        }
+      } else {
+        alwaysA = false;
+        alwaysB = false;
+      }
+    }
+
+    if (alwaysA) return a;
+    if (alwaysB) return b;
+    if (result.isEmpty) return const {};
+    return result;
+  }
+
+  static Map<VariableElement, DartType> _removePromoted(
+      Map<VariableElement, DartType> map, VariableElement variable) {
+    if (map.isEmpty) return const {};
+
+    var result = <VariableElement, DartType>{};
+    for (var key in map.keys) {
+      if (!identical(key, variable)) {
+        result[key] = map[key];
+      }
+    }
+
+    if (result.isEmpty) return const {};
+    return result;
+  }
+
+  static Map<VariableElement, DartType> _removePromotedAll(
+      Map<VariableElement, DartType> map, Set<VariableElement> variables) {
+    if (map.isEmpty) return const {};
+
+    var result = <VariableElement, DartType>{};
+    for (var key in map.keys) {
+      if (!variables.contains(key)) {
+        result[key] = map[key];
+      }
+    }
+
+    if (result.isEmpty) return const {};
+    return result;
+  }
+}
diff --git a/pkg/analyzer/lib/src/dart/resolver/inheritance_manager.dart b/pkg/analyzer/lib/src/dart/resolver/inheritance_manager.dart
index 846de52..ed4f68e 100644
--- a/pkg/analyzer/lib/src/dart/resolver/inheritance_manager.dart
+++ b/pkg/analyzer/lib/src/dart/resolver/inheritance_manager.dart
@@ -798,7 +798,7 @@
     List<ParameterElement> parameters = executableElement.parameters;
     for (int i = 0; i < parameters.length; i++) {
       ParameterElement parameterElement = parameters[i];
-      // ignore: deprecated_member_use
+      // ignore: deprecated_member_use_from_same_package
       if (parameterElement.parameterKind == parameterKind) {
         parameterCount++;
       }
diff --git a/pkg/analyzer/lib/src/dart/resolver/method_invocation_resolver.dart b/pkg/analyzer/lib/src/dart/resolver/method_invocation_resolver.dart
index 10e01f6..6471484 100644
--- a/pkg/analyzer/lib/src/dart/resolver/method_invocation_resolver.dart
+++ b/pkg/analyzer/lib/src/dart/resolver/method_invocation_resolver.dart
@@ -7,7 +7,6 @@
 import 'package:analyzer/dart/element/element.dart';
 import 'package:analyzer/dart/element/type.dart';
 import 'package:analyzer/src/dart/ast/ast.dart';
-import 'package:analyzer/src/dart/element/element.dart';
 import 'package:analyzer/src/dart/element/inheritance_manager2.dart';
 import 'package:analyzer/src/dart/element/member.dart';
 import 'package:analyzer/src/dart/element/type.dart';
@@ -496,13 +495,6 @@
       var calleeType = _getCalleeType(node, targetType);
       _setResolution(node, calleeType);
 
-      ClassElementImpl receiverSuperClass = AbstractClassElementImpl.getImpl(
-        receiverType.element.supertype.element,
-      );
-      if (receiverSuperClass.hasNoSuchMethod) {
-        return;
-      }
-
       _resolver.errorReporter.reportErrorForNode(
           CompileTimeErrorCode.ABSTRACT_SUPER_MEMBER_REFERENCE,
           nameNode,
diff --git a/pkg/analyzer/lib/src/error/codes.dart b/pkg/analyzer/lib/src/error/codes.dart
index bd26015..599447e 100644
--- a/pkg/analyzer/lib/src/error/codes.dart
+++ b/pkg/analyzer/lib/src/error/codes.dart
@@ -4597,6 +4597,19 @@
               "defining a new parameter with this name.");
 
   /**
+   * For the purposes of experimenting with potential non-null type semantics.
+   *
+   * Parameters: none
+   */
+  static const StaticWarningCode UNCHECKED_USE_OF_NULLABLE_VALUE =
+      const StaticWarningCode(
+          'UNCHECKED_USE_OF_NULLABLE_VALUE',
+          'The expression is nullable and must be null-checked before it can be'
+          ' used.',
+          correction:
+              'Try casting or check the value is not null before using it.');
+
+  /**
    * It is a static warning to assign void to any non-void type in dart.
    * compile-time error). Report that error specially for a better user
    * experience.
@@ -4611,6 +4624,9 @@
           " call that returns void you didn't expect. Also check type parameters"
           ' and variables which, in rare cases, may be void as well.');
 
+  @override
+  final ErrorSeverity errorSeverity;
+
   /**
    * Initialize a newly created error code to have the given [name]. The message
    * associated with the error will be created from the given [message]
@@ -4618,15 +4634,14 @@
    * given [correction] template.
    */
   const StaticWarningCode(String name, String message,
-      {String correction, bool isUnresolvedIdentifier: false})
+      {String correction,
+      this.errorSeverity: ErrorSeverity.ERROR,
+      bool isUnresolvedIdentifier: false})
       : super.temporary(name, message,
             correction: correction,
             isUnresolvedIdentifier: isUnresolvedIdentifier);
 
   @override
-  ErrorSeverity get errorSeverity => ErrorType.STATIC_WARNING.severity;
-
-  @override
   ErrorType get type => ErrorType.STATIC_WARNING;
 }
 
diff --git a/pkg/analyzer/lib/src/fasta/ast_builder.dart b/pkg/analyzer/lib/src/fasta/ast_builder.dart
index 94a0fbe..0413025 100644
--- a/pkg/analyzer/lib/src/fasta/ast_builder.dart
+++ b/pkg/analyzer/lib/src/fasta/ast_builder.dart
@@ -46,7 +46,8 @@
         messageStaticConstructor,
         messageTypedefNotFunction,
         templateDuplicateLabelInSwitchStatement,
-        templateExpectedIdentifier;
+        templateExpectedIdentifier,
+        templateUnexpectedToken;
 import 'package:front_end/src/fasta/quote.dart';
 import 'package:front_end/src/fasta/scanner/token_constants.dart';
 import 'package:front_end/src/fasta/source/stack_listener.dart'
@@ -99,6 +100,12 @@
   /// `true` if non-nullable behavior is enabled
   bool enableNonNullable = false;
 
+  /// `true` if spread-collections behavior is enabled
+  bool enableSpreadCollections = false;
+
+  /// `true` if control-flow-collections behavior is enabled
+  bool enableControlFlowCollections = false;
+
   /// Is `true` if [enableNonNullable] is enabled, and the library directive
   /// is annotated with `@pragma('analyzer:non-nullable')`.
   bool hasPragmaAnalyzerNonNullable = false;
@@ -270,6 +277,62 @@
     scriptTag = ast.scriptTag(token);
   }
 
+  void beginIfControlFlow(Token ifToken) {
+    push(ifToken);
+  }
+
+  @override
+  void handleElseControlFlow(Token elseToken) {
+    push(elseToken);
+  }
+
+  @override
+  void endIfControlFlow(Token token) {
+    var thenElement = pop();
+    ParenthesizedExpression condition = pop();
+    Token ifToken = pop();
+    pushIfControlFlowInfo(ifToken, condition, thenElement, null, null);
+  }
+
+  @override
+  void endIfElseControlFlow(Token token) {
+    var elseElement = pop();
+    Token elseToken = pop();
+    var thenElement = pop();
+    ParenthesizedExpression condition = pop();
+    Token ifToken = pop();
+    pushIfControlFlowInfo(
+        ifToken, condition, thenElement, elseToken, elseElement);
+  }
+
+  void pushIfControlFlowInfo(Token ifToken, ParenthesizedExpression condition,
+      var thenElement, Token elseToken, var elseElement) {
+    if (enableControlFlowCollections) {
+      push(new _IfControlFlowInfo(
+          ifToken,
+          condition.leftParenthesis,
+          condition.expression,
+          condition.rightParenthesis,
+          thenElement,
+          elseToken,
+          elseElement));
+    } else {
+      handleRecoverableError(
+          templateUnexpectedToken.withArguments(ifToken), ifToken, ifToken);
+      push(thenElement);
+    }
+  }
+
+  @override
+  void handleSpreadExpression(Token spreadToken) {
+    if (enableSpreadCollections) {
+      push(ast.spreadElement(spreadOperator: spreadToken, expression: pop()));
+    } else {
+      handleRecoverableError(templateUnexpectedToken.withArguments(spreadToken),
+          spreadToken, spreadToken);
+    }
+  }
+
   void handleStringJuxtaposition(int literalCount) {
     debugEvent("StringJuxtaposition");
 
@@ -802,26 +865,17 @@
   }
 
   @override
-  void endForStatement(Token forKeyword, Token leftParen, Token leftSeparator,
-      int updateExpressionCount, Token endToken) {
+  void handleForLoopParts(Token forKeyword, Token leftParen,
+      Token leftSeparator, int updateExpressionCount) {
     assert(optional('for', forKeyword));
     assert(optional('(', leftParen));
     assert(optional(';', leftSeparator));
-    debugEvent("ForStatement");
+    assert(updateExpressionCount >= 0);
 
-    Statement body = pop();
     List<Expression> updates = popTypedList(updateExpressionCount);
     Statement conditionStatement = pop();
     Object initializerPart = pop();
 
-    VariableDeclarationList variableList;
-    Expression initializer;
-    if (initializerPart is VariableDeclarationStatement) {
-      variableList = initializerPart.variables;
-    } else {
-      initializer = initializerPart as Expression;
-    }
-
     Expression condition;
     Token rightSeparator;
     if (conditionStatement is ExpressionStatement) {
@@ -831,17 +885,89 @@
       rightSeparator = (conditionStatement as EmptyStatement).semicolon;
     }
 
-    push(ast.forStatement(
-        forKeyword,
-        leftParen,
-        variableList,
-        initializer,
-        leftSeparator,
-        condition,
-        rightSeparator,
-        updates,
-        leftParen?.endGroup,
-        body));
+    ForParts forLoopParts;
+    if (initializerPart is VariableDeclarationStatement) {
+      forLoopParts = ast.forPartsWithDeclarations(
+        variables: initializerPart.variables,
+        leftSeparator: leftSeparator,
+        condition: condition,
+        rightSeparator: rightSeparator,
+        updaters: updates,
+      );
+    } else {
+      forLoopParts = ast.forPartsWithExpression(
+        initialization: initializerPart as Expression,
+        leftSeparator: leftSeparator,
+        condition: condition,
+        rightSeparator: rightSeparator,
+        updaters: updates,
+      );
+    }
+
+    push(forKeyword);
+    push(leftParen);
+    push(forLoopParts);
+  }
+
+  @override
+  void endForControlFlow(Token token) {
+    debugEvent("endForControlFlow");
+    var entry = pop();
+    ForParts forLoopParts = pop();
+    Token leftParen = pop();
+    Token forToken = pop();
+
+    pushForControlFlowInfo(null, forToken, leftParen, forLoopParts, entry);
+  }
+
+  void pushForControlFlowInfo(Token awaitToken, Token forToken,
+      Token leftParenthesis, ForLoopParts forLoopParts, Object entry) {
+    if (enableControlFlowCollections) {
+      push(new _ForControlFlowInfo(awaitToken, forToken, leftParenthesis,
+          forLoopParts, leftParenthesis.endGroup, entry));
+    } else {
+      handleRecoverableError(
+          templateUnexpectedToken.withArguments(forToken), forToken, forToken);
+      push(entry);
+    }
+  }
+
+  @override
+  void endForStatement(Token endToken) {
+    debugEvent("ForStatement");
+    Statement body = pop();
+    ForParts forLoopParts = pop();
+    Token leftParen = pop();
+    Token forToken = pop();
+
+    if (enableControlFlowCollections || enableSpreadCollections) {
+      push(ast.forStatement2(
+        forKeyword: forToken,
+        leftParenthesis: leftParen,
+        forLoopParts: forLoopParts,
+        rightParenthesis: leftParen.endGroup,
+        body: body,
+      ));
+    } else {
+      VariableDeclarationList variableList;
+      Expression initializer;
+      if (forLoopParts is ForPartsWithDeclarations) {
+        variableList = forLoopParts.variables;
+      } else {
+        initializer = (forLoopParts as ForPartsWithExpression).initialization;
+      }
+      push(ast.forStatement(
+          forToken,
+          leftParen,
+          variableList,
+          initializer,
+          forLoopParts.leftSeparator,
+          forLoopParts.condition,
+          forLoopParts.rightSeparator,
+          forLoopParts.updaters,
+          leftParen?.endGroup,
+          body));
+    }
   }
 
   void handleLiteralList(
@@ -851,10 +977,28 @@
     assert(optional(']', rightBracket));
     debugEvent("LiteralList");
 
-    List<Expression> expressions = popTypedList(count);
-    TypeArgumentList typeArguments = pop();
-    push(ast.listLiteral(
-        constKeyword, typeArguments, leftBracket, expressions, rightBracket));
+    if (enableControlFlowCollections || enableSpreadCollections) {
+      List<CollectionElement> elements = <CollectionElement>[];
+      popTypedList(count)?.forEach((element) {
+        elements.add(element is _EntryInfo
+            ? element.asCollectionElement(ast)
+            : element as CollectionElement);
+      });
+
+      TypeArgumentList typeArguments = pop();
+      push(ast.listLiteral2(
+        constKeyword: constKeyword,
+        typeArguments: typeArguments,
+        leftBracket: leftBracket,
+        elements: elements,
+        rightBracket: rightBracket,
+      ));
+    } else {
+      List<Expression> expressions = popTypedList(count);
+      TypeArgumentList typeArguments = pop();
+      push(ast.listLiteral(
+          constKeyword, typeArguments, leftBracket, expressions, rightBracket));
+    }
   }
 
   void handleAsyncModifier(Token asyncToken, Token starToken) {
@@ -898,13 +1042,12 @@
   }
 
   @override
-  void handleEmptyLiteralSetOrMap(
-      Token leftBrace, Token constKeyword, Token rightBrace) {
+  void handleLiteralSetOrMap(
+      int count, Token leftBrace, Token constKeyword, Token rightBrace) {
     // TODO(danrubel): From a type resolution standpoint, this could be either
     // a set literal or a map literal depending upon the context
     // in which this expression occurs.
-    // For now, generate a map literal.
-    handleLiteralMap(0, leftBrace, constKeyword, rightBrace);
+    handleLiteralMap(count, leftBrace, constKeyword, rightBrace);
   }
 
   void handleLiteralSet(
@@ -914,10 +1057,28 @@
     assert(optional('}', rightBracket));
     debugEvent("LiteralSet");
 
-    List<Expression> entries = popTypedList(count) ?? <Expression>[];
-    TypeArgumentList typeArguments = pop();
-    push(ast.setLiteral(
-        constKeyword, typeArguments, leftBracket, entries, rightBracket));
+    if (enableControlFlowCollections || enableSpreadCollections) {
+      List<CollectionElement> elements = <CollectionElement>[];
+      popTypedList(count)?.forEach((element) {
+        elements.add(element is _EntryInfo
+            ? element.asCollectionElement(ast)
+            : element as CollectionElement);
+      });
+
+      TypeArgumentList typeArguments = pop();
+      push(ast.setLiteral2(
+        constKeyword: constKeyword,
+        typeArguments: typeArguments,
+        leftBracket: leftBracket,
+        elements: elements,
+        rightBracket: rightBracket,
+      ));
+    } else {
+      List<Expression> entries = popTypedList(count) ?? <Expression>[];
+      TypeArgumentList typeArguments = pop();
+      push(ast.setLiteral(
+          constKeyword, typeArguments, leftBracket, entries, rightBracket));
+    }
   }
 
   void handleLiteralMap(
@@ -927,10 +1088,34 @@
     assert(optional('}', rightBracket));
     debugEvent("LiteralMap");
 
-    List<MapLiteralEntry> entries = popTypedList(count) ?? <MapLiteralEntry>[];
-    TypeArgumentList typeArguments = pop();
-    push(ast.mapLiteral(
-        constKeyword, typeArguments, leftBracket, entries, rightBracket));
+    if (enableControlFlowCollections || enableSpreadCollections) {
+      List<MapElement> entries = <MapElement>[];
+      popTypedList(count)?.forEach((entry) {
+        entries.add(entry is _EntryInfo
+            ? entry.asMapElement(ast)
+            : entry as MapElement);
+      });
+
+      TypeArgumentList typeArguments = pop();
+      push(ast.mapLiteral2(
+        constKeyword: constKeyword,
+        typeArguments: typeArguments,
+        leftBracket: leftBracket,
+        entries: entries,
+        rightBracket: rightBracket,
+      ));
+    } else {
+      List<MapLiteralEntry> entries = <MapLiteralEntry>[];
+      popTypedList(count)?.forEach((entry) {
+        if (entry is MapLiteralEntry) {
+          entries.add(entry);
+        }
+      });
+
+      TypeArgumentList typeArguments = pop();
+      push(ast.mapLiteral(
+          constKeyword, typeArguments, leftBracket, entries, rightBracket));
+    }
   }
 
   void handleLiteralMapEntry(Token colon, Token endToken) {
@@ -1154,33 +1339,29 @@
   }
 
   @override
-  void endForIn(Token awaitToken, Token forToken, Token leftParenthesis,
-      Token inKeyword, Token endToken) {
+  void handleForInLoopParts(Token awaitToken, Token forToken,
+      Token leftParenthesis, Token inKeyword) {
     assert(optionalOrNull('await', awaitToken));
     assert(optional('for', forToken));
     assert(optional('(', leftParenthesis));
     assert(optional('in', inKeyword) || optional(':', inKeyword));
-    debugEvent("ForInExpression");
 
-    Statement body = pop();
     Expression iterator = pop();
     Object variableOrDeclaration = pop();
+
+    ForEachParts forLoopParts;
     if (variableOrDeclaration is VariableDeclarationStatement) {
       VariableDeclarationList variableList = variableOrDeclaration.variables;
-      push(ast.forEachStatementWithDeclaration(
-          awaitToken,
-          forToken,
-          leftParenthesis,
-          ast.declaredIdentifier(
-              variableList.documentationComment,
-              variableList.metadata,
-              variableList.keyword,
-              variableList.type,
-              variableList.variables.first.name),
-          inKeyword,
-          iterator,
-          leftParenthesis?.endGroup,
-          body));
+      forLoopParts = ast.forEachPartsWithDeclaration(
+        loopVariable: ast.declaredIdentifier(
+            variableList.documentationComment,
+            variableList.metadata,
+            variableList.keyword,
+            variableList.type,
+            variableList.variables.first.name),
+        inKeyword: inKeyword,
+        iterable: iterator,
+      );
     } else {
       if (variableOrDeclaration is! SimpleIdentifier) {
         // Parser has already reported the error.
@@ -1192,13 +1373,70 @@
         }
         variableOrDeclaration = ast.simpleIdentifier(leftParenthesis.next);
       }
+      forLoopParts = ast.forEachPartsWithIdentifier(
+        identifier: variableOrDeclaration,
+        inKeyword: inKeyword,
+        iterable: iterator,
+      );
+    }
+
+    push(awaitToken ?? NullValue.AwaitToken);
+    push(forToken);
+    push(leftParenthesis);
+    push(forLoopParts);
+  }
+
+  @override
+  void endForInControlFlow(Token token) {
+    debugEvent("endForInControlFlow");
+
+    var entry = pop();
+    ForEachParts forLoopParts = pop();
+    Token leftParenthesis = pop();
+    Token forToken = pop();
+    Token awaitToken = pop(NullValue.AwaitToken);
+
+    pushForControlFlowInfo(
+        awaitToken, forToken, leftParenthesis, forLoopParts, entry);
+  }
+
+  @override
+  void endForIn(Token endToken) {
+    debugEvent("ForInExpression");
+
+    Statement body = pop();
+    ForEachParts forLoopParts = pop();
+    Token leftParenthesis = pop();
+    Token forToken = pop();
+    Token awaitToken = pop(NullValue.AwaitToken);
+
+    if (enableControlFlowCollections || enableSpreadCollections) {
+      push(ast.forStatement2(
+        awaitKeyword: awaitToken,
+        forKeyword: forToken,
+        leftParenthesis: leftParenthesis,
+        forLoopParts: forLoopParts,
+        rightParenthesis: leftParenthesis.endGroup,
+        body: body,
+      ));
+    } else if (forLoopParts is ForEachPartsWithDeclaration) {
+      push(ast.forEachStatementWithDeclaration(
+          awaitToken,
+          forToken,
+          leftParenthesis,
+          forLoopParts.loopVariable,
+          forLoopParts.inKeyword,
+          forLoopParts.iterable,
+          leftParenthesis?.endGroup,
+          body));
+    } else {
       push(ast.forEachStatementWithReference(
           awaitToken,
           forToken,
           leftParenthesis,
-          variableOrDeclaration,
-          inKeyword,
-          iterator,
+          (forLoopParts as ForEachPartsWithIdentifier).identifier,
+          forLoopParts.inKeyword,
+          forLoopParts.iterable,
           leftParenthesis?.endGroup,
           body));
     }
@@ -3032,3 +3270,94 @@
 
   _ConstructorNameWithInvalidTypeArgs(this.name, this.invalidTypeArgs);
 }
+
+abstract class _EntryInfo {
+  CollectionElement asCollectionElement(AstFactory ast);
+  MapElement asMapElement(AstFactory ast);
+}
+
+class _ForControlFlowInfo implements _EntryInfo {
+  final Token awaitToken;
+  final Token forKeyword;
+  final Token leftParenthesis;
+  final ForLoopParts forLoopParts;
+  final Token rightParenthesis;
+  final entry;
+
+  _ForControlFlowInfo(this.awaitToken, this.forKeyword, this.leftParenthesis,
+      this.forLoopParts, this.rightParenthesis, this.entry);
+
+  @override
+  CollectionElement asCollectionElement(AstFactory ast) =>
+      ast.collectionForElement(
+        awaitKeyword: awaitToken,
+        forKeyword: forKeyword,
+        leftParenthesis: leftParenthesis,
+        forLoopParts: forLoopParts,
+        rightParenthesis: rightParenthesis,
+        body: entry is _EntryInfo
+            ? entry.asCollectionElement(ast)
+            : entry as CollectionElement,
+      );
+
+  @override
+  MapElement asMapElement(AstFactory ast) => ast.mapForElement(
+        awaitKeyword: awaitToken,
+        forKeyword: forKeyword,
+        leftParenthesis: leftParenthesis,
+        forLoopParts: forLoopParts,
+        rightParenthesis: rightParenthesis,
+        body:
+            entry is _EntryInfo ? entry.asMapElement(ast) : entry as MapElement,
+      );
+}
+
+class _IfControlFlowInfo implements _EntryInfo {
+  final Token ifToken;
+  final Token leftParenthesis;
+  final Expression conditionExpression;
+  final Token rightParenthesis;
+  final thenElement;
+  final Token elseToken;
+  final elseElement;
+
+  _IfControlFlowInfo(
+      this.ifToken,
+      this.leftParenthesis,
+      this.conditionExpression,
+      this.rightParenthesis,
+      this.thenElement,
+      this.elseToken,
+      this.elseElement);
+
+  @override
+  CollectionElement asCollectionElement(AstFactory ast) =>
+      ast.collectionIfElement(
+        ifKeyword: ifToken,
+        leftParenthesis: leftParenthesis,
+        condition: conditionExpression,
+        rightParenthesis: rightParenthesis,
+        thenElement: thenElement is _EntryInfo
+            ? thenElement.asCollectionElement(ast)
+            : thenElement as CollectionElement,
+        elseKeyword: elseToken,
+        elseElement: elseElement is _EntryInfo
+            ? elseElement.asCollectionElement(ast)
+            : elseElement as CollectionElement,
+      );
+
+  @override
+  MapElement asMapElement(AstFactory ast) => ast.mapIfElement(
+        ifKeyword: ifToken,
+        leftParenthesis: leftParenthesis,
+        condition: conditionExpression,
+        rightParenthesis: rightParenthesis,
+        thenElement: thenElement is _EntryInfo
+            ? thenElement.asMapElement(ast)
+            : thenElement as MapElement,
+        elseKeyword: elseToken,
+        elseElement: elseElement is _EntryInfo
+            ? elseElement.asMapElement(ast)
+            : elseElement as MapElement,
+      );
+}
diff --git a/pkg/analyzer/lib/src/generated/element_resolver.dart b/pkg/analyzer/lib/src/generated/element_resolver.dart
index dbb487e..cc16f64 100644
--- a/pkg/analyzer/lib/src/generated/element_resolver.dart
+++ b/pkg/analyzer/lib/src/generated/element_resolver.dart
@@ -9,6 +9,7 @@
 import 'package:analyzer/dart/element/element.dart';
 import 'package:analyzer/dart/element/type.dart';
 import 'package:analyzer/error/error.dart';
+import 'package:analyzer/src/dart/analysis/experiments.dart';
 import 'package:analyzer/src/dart/ast/ast.dart'
     show
         ChildEntities,
@@ -109,6 +110,11 @@
    */
   InterfaceType _typeType;
 
+  /**
+   * The enabled experiments
+   */
+  ExperimentStatus _experimentStatus;
+
   /// Whether constant evaluation errors should be reported during resolution.
   final bool reportConstEvaluationErrors;
 
@@ -124,6 +130,9 @@
         _methodInvocationResolver = new MethodInvocationResolver(_resolver) {
     _dynamicType = _resolver.typeProvider.dynamicType;
     _typeType = _resolver.typeProvider.typeType;
+    _experimentStatus = (_resolver.definingLibrary.context.analysisOptions
+            as AnalysisOptionsImpl)
+        .experimentStatus;
   }
 
   /**
@@ -145,14 +154,21 @@
     Expression leftHandSide = node.leftHandSide;
     DartType staticType = _getStaticType(leftHandSide, read: true);
 
-    // For any compound assignments to a void variable, report bad void usage.
+    // For any compound assignments to a void or nullable variable, report it.
     // Example: `y += voidFn()`, not allowed.
-    if (operatorType != TokenType.EQ &&
-        staticType != null &&
-        staticType.isVoid) {
-      _recordUndefinedToken(
-          null, StaticWarningCode.USE_OF_VOID_RESULT, operator, []);
-      return;
+    if (operatorType != TokenType.EQ) {
+      if (staticType != null && staticType.isVoid) {
+        _recordUndefinedToken(
+            null, StaticWarningCode.USE_OF_VOID_RESULT, operator, []);
+        return;
+      }
+      if (_experimentStatus.non_nullable &&
+          staticType != null &&
+          (staticType as TypeImpl).nullability == Nullability.nullable) {
+        _recordUndefinedToken(null,
+            StaticWarningCode.UNCHECKED_USE_OF_NULLABLE_VALUE, operator, []);
+        return;
+      }
     }
 
     if (operatorType != TokenType.AMPERSAND_AMPERSAND_EQ &&
@@ -165,7 +181,7 @@
         MethodElement staticMethod =
             _lookUpMethod(leftHandSide, staticType, methodName);
         node.staticElement = staticMethod;
-        if (_shouldReportMissingMember(staticType, staticMethod)) {
+        if (_shouldReportInvalidMember(staticType, staticMethod)) {
           _recordUndefinedToken(
               staticType.element,
               StaticTypeWarningCode.UNDEFINED_METHOD,
@@ -533,7 +549,7 @@
     DartType staticType = _getStaticType(operand);
     MethodElement staticMethod = _lookUpMethod(operand, staticType, methodName);
     node.staticElement = staticMethod;
-    if (_shouldReportMissingMember(staticType, staticMethod)) {
+    if (_shouldReportInvalidMember(staticType, staticMethod)) {
       if (operand is SuperExpression) {
         _recordUndefinedToken(
             staticType.element,
@@ -646,7 +662,7 @@
       MethodElement staticMethod =
           _lookUpMethod(operand, staticType, methodName);
       node.staticElement = staticMethod;
-      if (_shouldReportMissingMember(staticType, staticMethod)) {
+      if (_shouldReportInvalidMember(staticType, staticMethod)) {
         if (operand is SuperExpression) {
           _recordUndefinedToken(
               staticType.element,
@@ -891,7 +907,7 @@
       String methodName,
       MethodElement staticMethod,
       DartType staticType) {
-    if (_shouldReportMissingMember(staticType, staticMethod)) {
+    if (_shouldReportInvalidMember(staticType, staticMethod)) {
       Token leftBracket = expression.leftBracket;
       Token rightBracket = expression.rightBracket;
       ErrorCode errorCode;
@@ -901,6 +917,11 @@
       } else if (staticType != null && staticType.isVoid) {
         errorCode = StaticWarningCode.USE_OF_VOID_RESULT;
         errorArguments = [];
+      } else if (staticType != null &&
+          _experimentStatus.non_nullable &&
+          (staticType as TypeImpl).nullability == Nullability.nullable) {
+        errorCode = StaticWarningCode.UNCHECKED_USE_OF_NULLABLE_VALUE;
+        errorArguments = [];
       } else {
         errorCode = StaticTypeWarningCode.UNDEFINED_OPERATOR;
       }
@@ -1443,7 +1464,7 @@
       var invokeElement = invokeType?.element;
       node.staticElement = invokeElement;
       node.staticInvokeType = invokeType;
-      if (_shouldReportMissingMember(leftType, invokeElement)) {
+      if (_shouldReportInvalidMember(leftType, invokeElement)) {
         if (isSuper) {
           _recordUndefinedToken(
               leftType.element,
@@ -1608,7 +1629,7 @@
       return;
     }
     propertyName.staticElement = staticElement;
-    if (_shouldReportMissingMember(staticType, staticElement)) {
+    if (_shouldReportInvalidMember(staticType, staticElement)) {
       Element staticOrPropagatedEnclosingElt = staticType.element;
       bool isStaticProperty = _isStatic(staticOrPropagatedEnclosingElt);
       // Special getter cases.
@@ -1641,6 +1662,11 @@
           if (staticType.isVoid) {
             errorCode = StaticWarningCode.USE_OF_VOID_RESULT;
             arguments = [];
+          } else if ((staticType as TypeImpl).nullability ==
+                  Nullability.nullable &&
+              _experimentStatus.non_nullable) {
+            errorCode = StaticWarningCode.UNCHECKED_USE_OF_NULLABLE_VALUE;
+            arguments = [];
           } else {
             errorCode = StaticTypeWarningCode.UNDEFINED_SETTER;
           }
@@ -1656,6 +1682,11 @@
           if (staticType.isVoid) {
             errorCode = StaticWarningCode.USE_OF_VOID_RESULT;
             arguments = [];
+          } else if ((staticType as TypeImpl).nullability ==
+                  Nullability.nullable &&
+              _experimentStatus.non_nullable) {
+            errorCode = StaticWarningCode.UNCHECKED_USE_OF_NULLABLE_VALUE;
+            arguments = [];
           } else {
             errorCode = StaticTypeWarningCode.UNDEFINED_GETTER;
           }
@@ -1731,12 +1762,15 @@
       type?.resolveToBound(_resolver.typeProvider.objectType);
 
   /**
-   * Return `true` if we should report an error as a result of looking up a
-   * [member] in the given [type] and not finding any member.
+   * Return `true` if we should report an error for a [member] lookup that found
+   * no match on the given [type], or accessing a [member] on a nullable type.
    */
-  bool _shouldReportMissingMember(DartType type, Element member) {
-    return member == null &&
+  bool _shouldReportInvalidMember(DartType type, Element member) {
+    bool unchecked = _experimentStatus.non_nullable &&
         type != null &&
+        (type as TypeImpl).nullability == Nullability.nullable;
+    return type != null &&
+        (member == null || unchecked) &&
         !type.isDynamic &&
         !type.isDartCoreNull;
   }
diff --git a/pkg/analyzer/lib/src/generated/engine.dart b/pkg/analyzer/lib/src/generated/engine.dart
index 527f2ed..3b581fa 100644
--- a/pkg/analyzer/lib/src/generated/engine.dart
+++ b/pkg/analyzer/lib/src/generated/engine.dart
@@ -95,12 +95,6 @@
  */
 abstract class AnalysisContext {
   /**
-   * An empty list of contexts.
-   */
-  @deprecated
-  static const List<AnalysisContext> EMPTY_LIST = const <AnalysisContext>[];
-
-  /**
    * The file resolver provider used to override the way file URI's are
    * resolved in some contexts.
    */
@@ -2058,12 +2052,6 @@
  */
 class ChangeNoticeImpl implements ChangeNotice {
   /**
-   * An empty list of change notices.
-   */
-  @deprecated
-  static const List<ChangeNoticeImpl> EMPTY_LIST = const <ChangeNoticeImpl>[];
-
-  /**
    * The source for which the result is being reported.
    */
   @override
diff --git a/pkg/analyzer/lib/src/generated/error_verifier.dart b/pkg/analyzer/lib/src/generated/error_verifier.dart
index 5283d92..185f11d 100644
--- a/pkg/analyzer/lib/src/generated/error_verifier.dart
+++ b/pkg/analyzer/lib/src/generated/error_verifier.dart
@@ -394,10 +394,17 @@
       _checkForAssignability(node.rightOperand, _boolType,
           StaticTypeWarningCode.NON_BOOL_OPERAND, [lexeme]);
       _checkForUseOfVoidResult(node.rightOperand);
+      _checkForNullableDereference(node.rightOperand);
     } else {
       _checkForArgumentTypeNotAssignableForArgument(node.rightOperand);
     }
+
+    if (type != TokenType.EQ_EQ && type != TokenType.BANG_EQ) {
+      _checkForNullableDereference(node.leftOperand);
+    }
+
     _checkForUseOfVoidResult(node.leftOperand);
+
     super.visitBinaryExpression(node);
   }
 
@@ -532,9 +539,6 @@
   @override
   void visitConditionalExpression(ConditionalExpression node) {
     _checkForNonBoolCondition(node.condition);
-    // TODO(mfairhurst) Enable this and get code compliant.
-    //_checkForUseOfVoidResult(node.thenExpression);
-    //_checkForUseOfVoidResult(node.elseExpression);
     super.visitConditionalExpression(node);
   }
 
@@ -775,7 +779,8 @@
   void visitFunctionExpressionInvocation(FunctionExpressionInvocation node) {
     Expression functionExpression = node.function;
     DartType expressionType = functionExpression.staticType;
-    if (!_checkForUseOfVoidResult(functionExpression) &&
+    if (!_checkForNullableDereference(functionExpression) &&
+        !_checkForUseOfVoidResult(functionExpression) &&
         !_isFunctionType(expressionType)) {
       _errorReporter.reportErrorForNode(
           StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION_EXPRESSION,
@@ -1025,7 +1030,7 @@
 
       _initializeInitialFieldElementsMap(_enclosingClass.fields);
       _checkForFinalNotInitializedInClass(members);
-//      _checkForBadFunctionUse(node);
+      //      _checkForBadFunctionUse(node);
       super.visitMixinDeclaration(node);
     } finally {
       _initialFieldElementsMap = null;
@@ -1079,6 +1084,7 @@
       _checkForAssignmentToFinal(operand);
     }
     _checkForIntNotAssignable(operand);
+    _checkForNullableDereference(operand);
     _checkForUseOfVoidResult(operand);
     super.visitPrefixExpression(node);
   }
@@ -1208,6 +1214,7 @@
   @override
   void visitThrowExpression(ThrowExpression node) {
     _checkForConstEvalThrowsException(node);
+    _checkForNullableDereference(node.expression);
     _checkForUseOfVoidResult(node.expression);
     super.visitThrowExpression(node);
   }
@@ -1312,6 +1319,9 @@
   void visitYieldStatement(YieldStatement node) {
     if (_inGenerator) {
       _checkForYieldOfInvalidType(node.expression, node.star != null);
+      if (node.star != null) {
+        _checkForNullableDereference(node.expression);
+      }
     } else {
       CompileTimeErrorCode errorCode;
       if (node.star != null) {
@@ -3586,6 +3596,10 @@
       return;
     }
 
+    if (_checkForNullableDereference(node.iterable)) {
+      return;
+    }
+
     if (_checkForUseOfVoidResult(node.iterable)) {
       return;
     }
@@ -3599,9 +3613,6 @@
     SimpleIdentifier variable = node.identifier ?? loopVariable.identifier;
     DartType variableType = getStaticType(variable);
 
-    // TODO(mfairhurst) Check and guard against `for(void x in _)`?
-    //_checkForUseOfVoidResult(variable);
-
     DartType loopType = node.awaitKeyword != null
         ? _typeProvider.streamType
         : _typeProvider.iterableType;
@@ -4423,7 +4434,8 @@
    */
   void _checkForNonBoolCondition(Expression condition) {
     DartType conditionType = getStaticType(condition);
-    if (!_checkForUseOfVoidResult(condition) &&
+    if (!_checkForNullableDereference(condition) &&
+        !_checkForUseOfVoidResult(condition) &&
         conditionType != null &&
         !_typeSystem.isAssignableTo(conditionType, _boolType)) {
       _errorReporter.reportErrorForNode(
@@ -4536,6 +4548,33 @@
   }
 
   /**
+   * Check for illegal derefences of nullables, ie, "unchecked" usages of
+   * nullable values. Note that *any* usage of a null value is an "unchecked"
+   * usage, because proper checks will promote the type to a non-nullable value.
+   *
+   * See [StaticWarningCode.UNCHECKED_USE_OF_NULLABLE_VALUE]
+   */
+  bool _checkForNullableDereference(Expression expression) {
+    if (expression == null ||
+        !_options.experimentStatus.non_nullable ||
+        (expression.staticType as TypeImpl).nullability !=
+            Nullability.nullable) {
+      return false;
+    }
+
+    StaticWarningCode code = StaticWarningCode.UNCHECKED_USE_OF_NULLABLE_VALUE;
+
+    if (expression is MethodInvocation) {
+      SimpleIdentifier methodName = expression.methodName;
+      _errorReporter.reportErrorForNode(code, methodName, []);
+    } else {
+      _errorReporter.reportErrorForNode(code, expression, []);
+    }
+
+    return true;
+  }
+
+  /**
    * Verify that all classes of the given [onClause] are valid.
    *
    * See [CompileTimeErrorCode.MIXIN_SUPER_CLASS_CONSTRAINT_DISALLOWED_CLASS],
diff --git a/pkg/analyzer/lib/src/generated/parser.dart b/pkg/analyzer/lib/src/generated/parser.dart
index b75defe..9ea56c4 100644
--- a/pkg/analyzer/lib/src/generated/parser.dart
+++ b/pkg/analyzer/lib/src/generated/parser.dart
@@ -251,6 +251,22 @@
     }
   }
 
+  /// Enables or disables parsing of spread collections.
+  void set enableSpreadCollections(bool value) {
+    if (value) {
+      throw new UnimplementedError(
+          'spread_collections experiment not supported by analyzer parser');
+    }
+  }
+
+  /// Enables or disables parsing of control flow collections.
+  void set enableControlFlowCollections(bool value) {
+    if (value) {
+      throw new UnimplementedError('control_flow_collections experiment'
+          ' not supported by analyzer parser');
+    }
+  }
+
   /// Return `true` if the parser is to allow URI's in part-of directives.
   @deprecated
   bool get enableUriInPartOf => true;
diff --git a/pkg/analyzer/lib/src/generated/parser_fasta.dart b/pkg/analyzer/lib/src/generated/parser_fasta.dart
index 389c230..62e616e 100644
--- a/pkg/analyzer/lib/src/generated/parser_fasta.dart
+++ b/pkg/analyzer/lib/src/generated/parser_fasta.dart
@@ -63,6 +63,26 @@
   }
 
   @override
+  void set enableSpreadCollections(bool value) {
+    if (IsExpired.spread_collections &&
+        value != IsEnabledByDefault.spread_collections) {
+      throw new StateError('spread_collections may only be set'
+          ' to ${IsEnabledByDefault.spread_collections}');
+    }
+    astBuilder.enableSpreadCollections = value;
+  }
+
+  @override
+  void set enableControlFlowCollections(bool value) {
+    if (IsExpired.control_flow_collections &&
+        value != IsEnabledByDefault.control_flow_collections) {
+      throw new StateError('control_flow_collections may only be set'
+          ' to ${IsEnabledByDefault.control_flow_collections}');
+    }
+    astBuilder.enableControlFlowCollections = value;
+  }
+
+  @override
   void set parseFunctionBodies(bool parseFunctionBodies) {
     astBuilder.parseFunctionBodies = parseFunctionBodies;
   }
diff --git a/pkg/analyzer/lib/src/generated/resolver.dart b/pkg/analyzer/lib/src/generated/resolver.dart
index 9dc3ff1..e4b1515 100644
--- a/pkg/analyzer/lib/src/generated/resolver.dart
+++ b/pkg/analyzer/lib/src/generated/resolver.dart
@@ -306,8 +306,10 @@
             new _InvalidAccessVerifier(_errorReporter, _currentLibrary) {
     _inDeprecatedMember = _currentLibrary.hasDeprecated;
     String libraryPath = _currentLibrary.source.fullName;
-    Workspace workspace = ContextBuilder.createWorkspace(
-        resourceProvider, libraryPath, null /* ContextBuilder */);
+    ContextBuilder builder = new ContextBuilder(
+        resourceProvider, null /* sdkManager */, null /* contentCache */);
+    Workspace workspace =
+        ContextBuilder.createWorkspace(resourceProvider, libraryPath, builder);
     _workspacePackage = workspace.findPackageFor(libraryPath);
     _linterContext = LinterContextImpl(null /* allUnits */,
         null /* currentUnit */, declaredVariables, typeProvider, _typeSystem);
@@ -338,8 +340,8 @@
       }
     } else if (element?.isSealed == true) {
       if (!(parent is ClassDeclaration || parent is ClassTypeAlias)) {
-        _errorReporter.reportErrorForNode(HintCode.INVALID_SEALED_ANNOTATION,
-            node.parent, [node.element.name]);
+        _errorReporter.reportErrorForNode(
+            HintCode.INVALID_SEALED_ANNOTATION, node, [node.element.name]);
       }
     }
     super.visitAnnotation(node);
@@ -2614,6 +2616,64 @@
   }
 
   @override
+  bool visitForStatement2(ForStatement2 node) {
+    bool outerBreakValue = _enclosingBlockContainsBreak;
+    _enclosingBlockContainsBreak = false;
+    ForLoopParts parts = node.forLoopParts;
+    try {
+      if (parts is ForEachParts) {
+        bool iterableExits = _nodeExits(parts.iterable);
+        // Discard whether the for-each body exits; since the for-each iterable
+        // may be empty, execution may never enter the body, so it doesn't matter
+        // if it exits or not.  We still must visit the body, to accurately
+        // manage `_enclosingBlockBreaksLabel`.
+        _nodeExits(node.body);
+        return iterableExits;
+      }
+      VariableDeclarationList variables;
+      Expression initialization;
+      Expression condition;
+      NodeList<Expression> updaters;
+      if (parts is ForPartsWithDeclarations) {
+        variables = parts.variables;
+        condition = parts.condition;
+        updaters = parts.updaters;
+      } else if (parts is ForPartsWithExpression) {
+        initialization = parts.initialization;
+        condition = parts.condition;
+        updaters = parts.updaters;
+      }
+      if (variables != null &&
+          _visitVariableDeclarations(variables.variables)) {
+        return true;
+      }
+      if (initialization != null && _nodeExits(initialization)) {
+        return true;
+      }
+      if (condition != null && _nodeExits(condition)) {
+        return true;
+      }
+      if (_visitExpressions(updaters)) {
+        return true;
+      }
+      bool blockReturns = _nodeExits(node.body);
+      // TODO(jwren) Do we want to take all constant expressions into account?
+      // If for(; true; ) (or for(;;)), and the body doesn't return or the body
+      // doesn't have a break, then return true.
+      bool implicitOrExplictTrue =
+          condition == null || (condition is BooleanLiteral && condition.value);
+      if (implicitOrExplictTrue) {
+        if (blockReturns || !_enclosingBlockContainsBreak) {
+          return true;
+        }
+      }
+      return false;
+    } finally {
+      _enclosingBlockContainsBreak = outerBreakValue;
+    }
+  }
+
+  @override
   bool visitFunctionDeclarationStatement(FunctionDeclarationStatement node) =>
       false;
 
@@ -3382,26 +3442,31 @@
     }
   }
 
-  /// Report an [HintCode.UNUSED_SHOWN_NAME] hint for each unused shown name.
+  /// Use the error [reporter] to report an [HintCode.UNUSED_SHOWN_NAME] hint
+  /// for each unused shown name.
   ///
-  /// Only call this method after all of the compilation units have been visited
-  /// by this visitor.
-  ///
-  /// @param errorReporter the error reporter used to report the set of
-  ///        [HintCode.UNUSED_SHOWN_NAME] hints
+  /// This method should only be invoked after all of the compilation units have
+  /// been visited by this visitor.
   void generateUnusedShownNameHints(ErrorReporter reporter) {
     _unusedShownNamesMap.forEach(
         (ImportDirective importDirective, List<SimpleIdentifier> identifiers) {
       if (_unusedImports.contains(importDirective)) {
-        // This import is actually wholly unused, not just one or more shown names from it.
-        // This is then an "unused import", rather than unused shown names.
+        // The whole import is unused, not just one or more shown names from it,
+        // so an "unused_import" hint will be generated, making it unnecessary
+        // to generate hints for the individual names.
         return;
       }
       int length = identifiers.length;
       for (int i = 0; i < length; i++) {
         Identifier identifier = identifiers[i];
-        reporter.reportErrorForNode(
-            HintCode.UNUSED_SHOWN_NAME, identifier, [identifier.name]);
+        List<SimpleIdentifier> duplicateNames =
+            _duplicateShownNamesMap[importDirective];
+        if (duplicateNames == null || !duplicateNames.contains(identifier)) {
+          // Only generate a hint if we won't also generate a
+          // "duplicate_shown_name" hint for the same identifier.
+          reporter.reportErrorForNode(
+              HintCode.UNUSED_SHOWN_NAME, identifier, [identifier.name]);
+        }
       }
     });
   }
@@ -4450,7 +4515,6 @@
   void visitAssertStatement(AssertStatement node) {
     InferenceContext.setType(node.condition, typeProvider.boolType);
     super.visitAssertStatement(node);
-    _propagateTrueState(node.condition);
   }
 
   @override
@@ -4491,7 +4555,6 @@
         try {
           _promoteManager.enterScope();
           try {
-            _propagateTrueState(leftOperand);
             // Type promotion.
             _promoteTypes(leftOperand);
             _clearTypePromotionsIfPotentiallyMutatedIn(leftOperand);
@@ -4515,7 +4578,6 @@
       if (rightOperand != null) {
         _overrideManager.enterScope();
         try {
-          _propagateFalseState(leftOperand);
           rightOperand.accept(this);
         } finally {
           _overrideManager.exitScope();
@@ -4677,7 +4739,6 @@
       try {
         _promoteManager.enterScope();
         try {
-          _propagateTrueState(condition);
           // Type promotion.
           _promoteTypes(condition);
           _clearTypePromotionsIfPotentiallyMutatedIn(thenExpression);
@@ -4697,7 +4758,6 @@
     if (elseExpression != null) {
       _overrideManager.enterScope();
       try {
-        _propagateFalseState(condition);
         InferenceContext.setTypeFromNode(elseExpression, node);
         elseExpression.accept(this);
       } finally {
@@ -4706,15 +4766,6 @@
     }
     node.accept(elementResolver);
     node.accept(typeAnalyzer);
-    bool thenIsAbrupt = _isAbruptTerminationExpression(thenExpression);
-    bool elseIsAbrupt = _isAbruptTerminationExpression(elseExpression);
-    if (elseIsAbrupt && !thenIsAbrupt) {
-      _propagateTrueState(condition);
-      _propagateState(thenExpression);
-    } else if (thenIsAbrupt && !elseIsAbrupt) {
-      _propagateFalseState(condition);
-      _propagateState(elseExpression);
-    }
   }
 
   @override
@@ -4977,6 +5028,22 @@
   }
 
   @override
+  void visitForStatement2(ForStatement2 node) {
+    _overrideManager.enterScope();
+    try {
+      super.visitForStatement2(node);
+    } finally {
+      _overrideManager.exitScope();
+    }
+  }
+
+  @override
+  void visitForStatement2InScope(ForStatement2 node) {
+    throw new UnsupportedError('Implement this');
+    visitStatementInScope(node.body); // ignore: dead_code
+  }
+
+  @override
   void visitForStatementInScope(ForStatement node) {
     node.variables?.accept(this);
     node.initialization?.accept(this);
@@ -4984,14 +5051,11 @@
     node.condition?.accept(this);
     _overrideManager.enterScope();
     try {
-      _propagateTrueState(node.condition);
       visitStatementInScope(node.body);
       node.updaters.accept(this);
     } finally {
       _overrideManager.exitScope();
     }
-    // TODO(brianwilkerson) If the loop can only be exited because the condition
-    // is false, then propagateFalseState(condition);
   }
 
   @override
@@ -5101,7 +5165,6 @@
       try {
         _promoteManager.enterScope();
         try {
-          _propagateTrueState(condition);
           // Type promotion.
           _promoteTypes(condition);
           _clearTypePromotionsIfPotentiallyMutatedIn(thenStatement);
@@ -5123,7 +5186,6 @@
     if (elseStatement != null) {
       _overrideManager.enterScope();
       try {
-        _propagateFalseState(condition);
         visitStatementInScope(elseStatement);
       } finally {
         elseOverrides = _overrideManager.captureLocalOverrides();
@@ -5136,10 +5198,8 @@
     bool thenIsAbrupt = _isAbruptTerminationStatement(thenStatement);
     bool elseIsAbrupt = _isAbruptTerminationStatement(elseStatement);
     if (elseIsAbrupt && !thenIsAbrupt) {
-      _propagateTrueState(condition);
       _overrideManager.applyOverrides(thenOverrides);
     } else if (thenIsAbrupt && !elseIsAbrupt) {
-      _propagateFalseState(condition);
       _overrideManager.applyOverrides(elseOverrides);
     } else if (!thenIsAbrupt && !elseIsAbrupt) {
       List<Map<VariableElement, DartType>> perBranchOverrides =
@@ -5203,6 +5263,29 @@
   }
 
   @override
+  void visitListLiteral2(ListLiteral2 node) {
+    InterfaceType listT;
+
+    if (node.typeArguments != null) {
+      var targs = node.typeArguments.arguments.map((t) => t.type).toList();
+      if (targs.length == 1 && !targs[0].isDynamic) {
+        listT = typeProvider.listType.instantiate([targs[0]]);
+      }
+    } else {
+      listT = typeAnalyzer.inferListType2(node, downwards: true);
+    }
+    if (listT != null) {
+      for (CollectionElement element in node.elements) {
+        _pushCollectionTypesDown(element, listT);
+      }
+      InferenceContext.setType(node, listT);
+    } else {
+      InferenceContext.clearType(node);
+    }
+    super.visitListLiteral2(node);
+  }
+
+  @override
   void visitMapLiteral(MapLiteral node) {
     InterfaceType mapT;
     if (node.typeArguments != null) {
@@ -5237,6 +5320,54 @@
   }
 
   @override
+  void visitMapLiteral2(MapLiteral2 node) {
+    InterfaceType mapT;
+    if (node.typeArguments != null) {
+      var targs = node.typeArguments.arguments.map((t) => t.type).toList();
+      if (targs.length == 2 && targs.any((t) => !t.isDynamic)) {
+        mapT = typeProvider.mapType.instantiate([targs[0], targs[1]]);
+      }
+    } else {
+      mapT = typeAnalyzer.inferMapType2(node, downwards: true);
+      if (mapT != null &&
+          node.typeArguments == null &&
+          node.entries.isEmpty &&
+          typeSystem.isAssignableTo(typeProvider.iterableObjectType, mapT) &&
+          !typeSystem.isAssignableTo(typeProvider.mapObjectObjectType, mapT)) {
+        // The node is really an empty set literal with no type arguments, so
+        // don't try to visit the replaced map literal.
+        return;
+      }
+    }
+    if (mapT != null) {
+      DartType kType = mapT.typeArguments[0];
+      DartType vType = mapT.typeArguments[1];
+
+      void pushTypesDown(MapElement element) {
+        if (element is MapForElement) {
+          pushTypesDown(element.body);
+        } else if (element is MapIfElement) {
+          pushTypesDown(element.thenElement);
+          pushTypesDown(element.elseElement);
+        } else if (element is MapLiteralEntry) {
+          InferenceContext.setType(element.key, kType);
+          InferenceContext.setType(element.value, vType);
+        } else if (element is SpreadElement) {
+          InferenceContext.setType(element.expression, mapT);
+        }
+      }
+
+      for (MapElement element in node.entries) {
+        pushTypesDown(element);
+      }
+      InferenceContext.setType(node, mapT);
+    } else {
+      InferenceContext.clearType(node);
+    }
+    super.visitMapLiteral2(node);
+  }
+
+  @override
   void visitMethodDeclaration(MethodDeclaration node) {
     ExecutableElement outerFunction = _enclosingFunction;
     FunctionBody outerFunctionBody = _currentFunctionBody;
@@ -5397,6 +5528,32 @@
   }
 
   @override
+  void visitSetLiteral2(SetLiteral2 node) {
+    InterfaceType setT;
+
+    TypeArgumentList typeArguments = node.typeArguments;
+    if (typeArguments != null) {
+      if (typeArguments.length == 1) {
+        DartType elementType = typeArguments.arguments[0].type;
+        if (!elementType.isDynamic) {
+          setT = typeProvider.setType.instantiate([elementType]);
+        }
+      }
+    } else {
+      setT = typeAnalyzer.inferSetType2(node, downwards: true);
+    }
+    if (setT != null) {
+      for (CollectionElement element in node.elements) {
+        _pushCollectionTypesDown(element, setT);
+      }
+      InferenceContext.setType(node, setT);
+    } else {
+      InferenceContext.clearType(node);
+    }
+    super.visitSetLiteral2(node);
+  }
+
+  @override
   void visitShowCombinator(ShowCombinator node) {}
 
   @override
@@ -5506,7 +5663,6 @@
       if (body != null) {
         _overrideManager.enterScope();
         try {
-          _propagateTrueState(condition);
           visitStatementInScope(body);
         } finally {
           _overrideManager.exitScope();
@@ -5963,50 +6119,17 @@
     }
   }
 
-  /// Propagate any type information that results from knowing that the given
-  /// condition will have been evaluated to 'false'.
-  ///
-  /// @param condition the condition that will have evaluated to 'false'
-  void _propagateFalseState(Expression condition) {
-    if (condition is BinaryExpression) {
-      if (condition.operator.type == TokenType.BAR_BAR) {
-        _propagateFalseState(condition.leftOperand);
-        _propagateFalseState(condition.rightOperand);
-      }
-    } else if (condition is PrefixExpression) {
-      if (condition.operator.type == TokenType.BANG) {
-        _propagateTrueState(condition.operand);
-      }
-    } else if (condition is ParenthesizedExpression) {
-      _propagateFalseState(condition.expression);
-    }
-  }
-
-  /// Propagate any type information that results from knowing that the given
-  /// expression will have been evaluated without altering the flow of
-  /// execution.
-  ///
-  /// @param expression the expression that will have been evaluated
-  void _propagateState(Expression expression) {
-    // TODO(brianwilkerson) Implement this.
-  }
-
-  /// Propagate any type information that results from knowing that the given
-  /// condition will have been evaluated to 'true'.
-  ///
-  /// @param condition the condition that will have evaluated to 'true'
-  void _propagateTrueState(Expression condition) {
-    if (condition is BinaryExpression) {
-      if (condition.operator.type == TokenType.AMPERSAND_AMPERSAND) {
-        _propagateTrueState(condition.leftOperand);
-        _propagateTrueState(condition.rightOperand);
-      }
-    } else if (condition is PrefixExpression) {
-      if (condition.operator.type == TokenType.BANG) {
-        _propagateFalseState(condition.operand);
-      }
-    } else if (condition is ParenthesizedExpression) {
-      _propagateTrueState(condition.expression);
+  void _pushCollectionTypesDown(
+      CollectionElement element, ParameterizedType collectionType) {
+    if (element is CollectionForElement) {
+      _pushCollectionTypesDown(element.body, collectionType);
+    } else if (element is CollectionIfElement) {
+      _pushCollectionTypesDown(element.thenElement, collectionType);
+      _pushCollectionTypesDown(element.elseElement, collectionType);
+    } else if (element is Expression) {
+      InferenceContext.setType(element, collectionType.typeArguments[0]);
+    } else if (element is SpreadElement) {
+      InferenceContext.setType(element.expression, collectionType);
     }
   }
 
@@ -6457,6 +6580,30 @@
     }
   }
 
+  @override
+  void visitForStatement2(ForStatement2 node) {
+    Scope outerNameScope = nameScope;
+    ImplicitLabelScope outerImplicitScope = _implicitLabelScope;
+    try {
+      nameScope = new EnclosedScope(nameScope);
+      _implicitLabelScope = _implicitLabelScope.nest(node);
+      visitForStatement2InScope(node);
+    } finally {
+      nameScope = outerNameScope;
+      _implicitLabelScope = outerImplicitScope;
+    }
+  }
+
+  /// Visit the given [node] after it's scope has been created. This replaces
+  /// the normal call to the inherited visit method so that ResolverVisitor can
+  /// intervene when type propagation is enabled.
+  void visitForStatement2InScope(ForStatement2 node) {
+    // TODO(brianwilkerson) Investigate the possibility of removing the
+    //  visit...InScope methods now that type propagation is no longer done.
+    node.forLoopParts?.accept(this);
+    visitStatementInScope(node.body);
+  }
+
   /// Visit the given statement after it's scope has been created. This replaces
   /// the normal call to the inherited visit method so that ResolverVisitor can
   /// intervene when type propagation is enabled.
diff --git a/pkg/analyzer/lib/src/generated/source.dart b/pkg/analyzer/lib/src/generated/source.dart
index 9b1d4e7..f2d604f 100644
--- a/pkg/analyzer/lib/src/generated/source.dart
+++ b/pkg/analyzer/lib/src/generated/source.dart
@@ -370,12 +370,6 @@
  */
 abstract class Source implements AnalysisTarget {
   /**
-   * An empty list of sources.
-   */
-  @deprecated
-  static const List<Source> EMPTY_LIST = const <Source>[];
-
-  /**
    * Get the contents and timestamp of this source.
    *
    * Clients should consider using the method [AnalysisContext.getContents]
diff --git a/pkg/analyzer/lib/src/generated/static_type_analyzer.dart b/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
index 88f8f3b..b55d885 100644
--- a/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
+++ b/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
@@ -182,6 +182,40 @@
     return inferred;
   }
 
+  DartType inferListType2(ListLiteral2 node, {bool downwards: false}) {
+    DartType contextType = InferenceContext.getContext(node);
+
+    var ts = _typeSystem as Dart2TypeSystem;
+    List<DartType> elementTypes;
+    List<ParameterElement> parameters;
+
+    if (downwards) {
+      if (contextType == null) {
+        return null;
+      }
+      elementTypes = [];
+      parameters = [];
+    } else {
+      // Also use upwards information to infer the type.
+      elementTypes = node.elements
+          .map((element) => _computeElementType(element))
+          .where((t) => t != null)
+          .toList();
+      TypeParameterType listTypeParam =
+          _typeProvider.listType.typeParameters[0].type;
+      ParameterElementImpl syntheticParamElement =
+          new ParameterElementImpl.synthetic(
+              'element', listTypeParam, ParameterKind.POSITIONAL);
+      parameters = new List.filled(elementTypes.length, syntheticParamElement);
+    }
+    InterfaceType inferred = ts.inferGenericFunctionOrType<InterfaceType>(
+        _typeProvider.listType, parameters, elementTypes, contextType,
+        downwards: downwards,
+        errorReporter: _resolver.errorReporter,
+        errorNode: node);
+    return inferred;
+  }
+
   ParameterizedType inferMapType(MapLiteral node, {bool downwards: false}) {
     DartType contextType = InferenceContext.getContext(node);
     if (contextType != null && _experimentStatus.set_literals) {
@@ -247,6 +281,73 @@
     return inferred;
   }
 
+  ParameterizedType inferMapType2(MapLiteral2 node, {bool downwards: false}) {
+    DartType contextType = InferenceContext.getContext(node);
+    if (contextType != null && _experimentStatus.set_literals) {
+      DartType unwrap(DartType type) {
+        if (type is InterfaceType &&
+            type.isDartAsyncFutureOr &&
+            type.typeArguments.length == 1) {
+          return unwrap(type.typeArguments[0]);
+        }
+        return type;
+      }
+
+      DartType unwrappedContextType = unwrap(contextType);
+      if (node.typeArguments == null &&
+          node.entries.isEmpty &&
+          _typeSystem.isAssignableTo(
+              _typeProvider.iterableObjectType, unwrappedContextType) &&
+          !_typeSystem.isAssignableTo(
+              _typeProvider.mapObjectObjectType, unwrappedContextType)) {
+        // The node is really an empty set literal with no type arguments.
+        // Rewrite the AST and infer the type of the set as appropriate.
+        SetLiteral setLiteral = new AstFactoryImpl().setLiteral(
+            node.constKeyword, null, node.leftBracket, null, node.rightBracket);
+        InferenceContext.setType(setLiteral, contextType);
+        NodeReplacer.replace(node, setLiteral);
+        DartType type = inferSetType(setLiteral, downwards: downwards);
+        setLiteral.staticType = type;
+        return type;
+      }
+    }
+    List<DartType> elementTypes;
+    List<ParameterElement> parameters;
+    if (downwards) {
+      if (contextType == null) {
+        return null;
+      }
+      elementTypes = [];
+      parameters = [];
+    } else {
+      var keyTypes = node.entries
+          .map((entry) => _computeKeyType(entry))
+          .where((t) => t != null);
+      var valueTypes = node.entries
+          .map((entry) => _computeValueType(entry))
+          .where((t) => t != null);
+      var keyTypeParam = _typeProvider.mapType.typeParameters[0].type;
+      var valueTypeParam = _typeProvider.mapType.typeParameters[1].type;
+      var syntheticKeyParameter = new ParameterElementImpl.synthetic(
+          'key', keyTypeParam, ParameterKind.POSITIONAL);
+      var syntheticValueParameter = new ParameterElementImpl.synthetic(
+          'value', valueTypeParam, ParameterKind.POSITIONAL);
+      parameters = new List.filled(keyTypes.length, syntheticKeyParameter,
+          growable: true)
+        ..addAll(new List.filled(valueTypes.length, syntheticValueParameter));
+      elementTypes = new List<DartType>.from(keyTypes)..addAll(valueTypes);
+    }
+
+    // Use both downwards and upwards information to infer the type.
+    var ts = _typeSystem as Dart2TypeSystem;
+    ParameterizedType inferred = ts.inferGenericFunctionOrType(
+        _typeProvider.mapType, parameters, elementTypes, contextType,
+        downwards: downwards,
+        errorReporter: _resolver.errorReporter,
+        errorNode: node);
+    return inferred;
+  }
+
   DartType inferSetType(SetLiteral node, {bool downwards: false}) {
     DartType contextType = InferenceContext.getContext(node);
 
@@ -280,6 +381,41 @@
     return inferred;
   }
 
+  DartType inferSetType2(SetLiteral2 node, {bool downwards: false}) {
+    DartType contextType = InferenceContext.getContext(node);
+
+    var ts = _typeSystem as Dart2TypeSystem;
+    List<DartType> elementTypes;
+    List<ParameterElement> parameters;
+
+    if (downwards) {
+      if (contextType == null) {
+        return null;
+      }
+
+      elementTypes = [];
+      parameters = [];
+    } else {
+      // Also use upwards information to infer the type.
+      elementTypes = node.elements
+          .map((element) => _computeElementType(element))
+          .where((t) => t != null)
+          .toList();
+      TypeParameterType setTypeParam =
+          _typeProvider.setType.typeParameters[0].type;
+      ParameterElementImpl syntheticParamElement =
+          new ParameterElementImpl.synthetic(
+              'element', setTypeParam, ParameterKind.POSITIONAL);
+      parameters = new List.filled(elementTypes.length, syntheticParamElement);
+    }
+    DartType inferred = ts.inferGenericFunctionOrType<InterfaceType>(
+        _typeProvider.setType, parameters, elementTypes, contextType,
+        downwards: downwards,
+        errorReporter: _resolver.errorReporter,
+        errorNode: node);
+    return inferred;
+  }
+
   /**
    * The Dart Language Specification, 12.5: <blockquote>The static type of a string literal is
    * `String`.</blockquote>
@@ -694,6 +830,45 @@
     _recordStaticType(node, listDynamicType);
   }
 
+  @override
+  void visitListLiteral2(ListLiteral2 node) {
+    TypeArgumentList typeArguments = node.typeArguments;
+
+    // If we have explicit arguments, use them
+    if (typeArguments != null) {
+      DartType staticType = _dynamicType;
+      NodeList<TypeAnnotation> arguments = typeArguments.arguments;
+      if (arguments != null && arguments.length == 1) {
+        DartType argumentType = _getType(arguments[0]);
+        if (argumentType != null) {
+          staticType = argumentType;
+        }
+      }
+      _recordStaticType(
+          node, _typeProvider.listType.instantiate(<DartType>[staticType]));
+      return;
+    }
+
+    DartType listDynamicType =
+        _typeProvider.listType.instantiate(<DartType>[_dynamicType]);
+
+    // If there are no type arguments, try to infer some arguments.
+    DartType inferred = inferListType2(node);
+
+    if (inferred != listDynamicType) {
+      // TODO(jmesserly): this results in an "inferred" message even when we
+      // in fact had an error above, because it will still attempt to return
+      // a type. Perhaps we should record inference from TypeSystem if
+      // everything was successful?
+      _resolver.inferenceContext.recordInference(node, inferred);
+      _recordStaticType(node, inferred);
+      return;
+    }
+
+    // If we have no type arguments and couldn't infer any, use dynamic.
+    _recordStaticType(node, listDynamicType);
+  }
+
   /**
    * The Dart Language Specification, 12.7: <blockquote>The static type of a map literal of the form
    * <i><b>const</b> &lt;K, V&gt; {k<sub>1</sub>:e<sub>1</sub>, &hellip;,
@@ -752,6 +927,52 @@
     _recordStaticType(node, mapDynamicType);
   }
 
+  @override
+  void visitMapLiteral2(MapLiteral2 node) {
+    TypeArgumentList typeArguments = node.typeArguments;
+
+    // If we have type arguments, use them
+    if (typeArguments != null) {
+      DartType staticKeyType = _dynamicType;
+      DartType staticValueType = _dynamicType;
+      NodeList<TypeAnnotation> arguments = typeArguments.arguments;
+      if (arguments != null && arguments.length == 2) {
+        DartType entryKeyType = _getType(arguments[0]);
+        if (entryKeyType != null) {
+          staticKeyType = entryKeyType;
+        }
+        DartType entryValueType = _getType(arguments[1]);
+        if (entryValueType != null) {
+          staticValueType = entryValueType;
+        }
+      }
+      _recordStaticType(
+          node,
+          _typeProvider.mapType
+              .instantiate(<DartType>[staticKeyType, staticValueType]));
+      return;
+    }
+
+    DartType mapDynamicType = _typeProvider.mapType
+        .instantiate(<DartType>[_dynamicType, _dynamicType]);
+
+    // If we have no explicit type arguments, try to infer type arguments.
+    ParameterizedType inferred = inferMapType2(node);
+
+    if (inferred != mapDynamicType) {
+      // TODO(jmesserly): this results in an "inferred" message even when we
+      // in fact had an error above, because it will still attempt to return
+      // a type. Perhaps we should record inference from TypeSystem if
+      // everything was successful?
+      _resolver.inferenceContext.recordInference(node, inferred);
+      _recordStaticType(node, inferred);
+      return;
+    }
+
+    // If no type arguments and no inference, use dynamic
+    _recordStaticType(node, mapDynamicType);
+  }
+
   /**
    * The Dart Language Specification, 12.15.1: <blockquote>An ordinary method invocation <i>i</i>
    * has the form <i>o.m(a<sub>1</sub>, &hellip;, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</sub>,
@@ -1038,6 +1259,45 @@
     _recordStaticType(node, setDynamicType);
   }
 
+  @override
+  void visitSetLiteral2(SetLiteral2 node) {
+    TypeArgumentList typeArguments = node.typeArguments;
+
+    // If we have type arguments, use them
+    if (typeArguments != null) {
+      DartType elementType = _dynamicType;
+      NodeList<TypeAnnotation> arguments = typeArguments.arguments;
+      if (arguments != null && arguments.length == 1) {
+        DartType type = _getType(arguments[0]);
+        if (type != null) {
+          elementType = type;
+        }
+      }
+      _recordStaticType(
+          node, _typeProvider.setType.instantiate(<DartType>[elementType]));
+      return;
+    }
+
+    DartType setDynamicType =
+        _typeProvider.setType.instantiate(<DartType>[_dynamicType]);
+
+    // If we have no explicit type arguments, try to infer type arguments.
+    ParameterizedType inferred = inferSetType2(node);
+
+    if (inferred != setDynamicType) {
+      // TODO(jmesserly): this results in an "inferred" message even when we
+      // in fact had an error above, because it will still attempt to return
+      // a type. Perhaps we should record inference from TypeSystem if
+      // everything was successful?
+      _resolver.inferenceContext.recordInference(node, inferred);
+      _recordStaticType(node, inferred);
+      return;
+    }
+
+    // If no type arguments and no inference, use dynamic
+    _recordStaticType(node, setDynamicType);
+  }
+
   /**
    * The Dart Language Specification, 12.30: <blockquote>Evaluation of an identifier expression
    * <i>e</i> of the form <i>id</i> proceeds as follows:
@@ -1246,6 +1506,30 @@
     return _dynamicType;
   }
 
+  DartType _computeElementType(CollectionElement element) {
+    if (element is CollectionForElement) {
+      return _computeElementType(element.body);
+    } else if (element is CollectionIfElement) {
+      DartType thenType = _computeElementType(element.thenElement);
+      if (element.elseElement == null) {
+        return thenType;
+      }
+      DartType elseType = _computeElementType(element.elseElement);
+      return _typeSystem.leastUpperBound(thenType, elseType);
+    } else if (element is Expression) {
+      return element.staticType;
+    } else if (element is SpreadElement) {
+      DartType collectionType = element.expression.staticType;
+      if (collectionType is ParameterizedType) {
+        List<DartType> typeArguments = collectionType.typeArguments;
+        if (typeArguments.length == 1) {
+          return typeArguments[0];
+        }
+      }
+    }
+    return null;
+  }
+
   /**
    * Compute the return type of the method or function represented by the given
    * type that is being invoked.
@@ -1261,6 +1545,30 @@
     return _dynamicType;
   }
 
+  DartType _computeKeyType(MapElement element) {
+    if (element is MapForElement) {
+      return _computeKeyType(element.body);
+    } else if (element is MapIfElement) {
+      DartType thenType = _computeKeyType(element.thenElement);
+      if (element.elseElement == null) {
+        return thenType;
+      }
+      DartType elseType = _computeKeyType(element.elseElement);
+      return _typeSystem.leastUpperBound(thenType, elseType);
+    } else if (element is MapLiteralEntry) {
+      return element.key.staticType;
+    } else if (element is SpreadElement) {
+      DartType collectionType = element.expression.staticType;
+      if (collectionType is ParameterizedType) {
+        List<DartType> typeArguments = collectionType.typeArguments;
+        if (typeArguments.length == 2) {
+          return typeArguments[0];
+        }
+      }
+    }
+    return null;
+  }
+
   /**
    * Given a function body and its return type, compute the return type of
    * the entire function, taking into account whether the function body
@@ -1327,6 +1635,30 @@
     return returnType.type;
   }
 
+  DartType _computeValueType(MapElement element) {
+    if (element is MapForElement) {
+      return _computeValueType(element.body);
+    } else if (element is MapIfElement) {
+      DartType thenType = _computeValueType(element.thenElement);
+      if (element.elseElement == null) {
+        return thenType;
+      }
+      DartType elseType = _computeValueType(element.elseElement);
+      return _typeSystem.leastUpperBound(thenType, elseType);
+    } else if (element is MapLiteralEntry) {
+      return element.value.staticType;
+    } else if (element is SpreadElement) {
+      DartType collectionType = element.expression.staticType;
+      if (collectionType is ParameterizedType) {
+        List<DartType> typeArguments = collectionType.typeArguments;
+        if (typeArguments.length == 2) {
+          return typeArguments[1];
+        }
+      }
+    }
+    return null;
+  }
+
   DartType _findIteratedType(DartType type, DartType targetType) {
     // TODO(vsm): Use leafp's matchType here?
     // Set by _find if match is found
diff --git a/pkg/analyzer/lib/src/generated/testing/ast_test_factory.dart b/pkg/analyzer/lib/src/generated/testing/ast_test_factory.dart
index 824767b..b6f7ccd 100644
--- a/pkg/analyzer/lib/src/generated/testing/ast_test_factory.dart
+++ b/pkg/analyzer/lib/src/generated/testing/ast_test_factory.dart
@@ -842,6 +842,10 @@
       astFactory.mapLiteralEntry(
           key, TokenFactory.tokenFromType(TokenType.COLON), value);
 
+  static MapLiteralEntry mapLiteralEntry3(String key, String value) =>
+      astFactory.mapLiteralEntry(string2(key),
+          TokenFactory.tokenFromType(TokenType.COLON), string2(value));
+
   static MethodDeclaration methodDeclaration(
           Keyword modifier,
           TypeAnnotation returnType,
diff --git a/pkg/analyzer/lib/src/generated/type_system.dart b/pkg/analyzer/lib/src/generated/type_system.dart
index 6a4ffba..0a792c4 100644
--- a/pkg/analyzer/lib/src/generated/type_system.dart
+++ b/pkg/analyzer/lib/src/generated/type_system.dart
@@ -625,7 +625,7 @@
     // For a type parameter `T extends U`, allow promoting the upper bound
     // `U` to `S` where `S <: U`, yielding a type parameter `T extends S`.
     if (from is TypeParameterType) {
-      if (isSubtypeOf(to, from.resolveToBound(DynamicTypeImpl.instance))) {
+      if (isSubtypeOf(to, from.bound ?? DynamicTypeImpl.instance)) {
         return new TypeParameterMember(from.element, null, to).type;
       }
     }
@@ -908,10 +908,9 @@
         var newType =
             _substituteForUnknownType(p.type, lowerBound: !lowerBound);
         return new ParameterElementImpl.synthetic(
-            // ignore: deprecated_member_use
             p.name,
             newType,
-            // ignore: deprecated_member_use
+            // ignore: deprecated_member_use_from_same_package
             p.parameterKind);
       });
       // Return type is covariant.
@@ -1663,14 +1662,6 @@
 }
 
 /**
- * A type system that implements the type semantics for strong mode.
- */
-@deprecated
-class StrongTypeSystemImpl extends Dart2TypeSystem {
-  StrongTypeSystemImpl(TypeProvider typeProvider) : super(typeProvider);
-}
-
-/**
  * The interface `TypeSystem` defines the behavior of an object representing
  * the type system.  This provides a common location to put methods that act on
  * types but may need access to more global data structures, and it paves the
diff --git a/pkg/analyzer/lib/src/lint/linter_visitor.dart b/pkg/analyzer/lib/src/lint/linter_visitor.dart
index 7b2374e..54d81f6 100644
--- a/pkg/analyzer/lib/src/lint/linter_visitor.dart
+++ b/pkg/analyzer/lib/src/lint/linter_visitor.dart
@@ -109,6 +109,18 @@
   }
 
   @override
+  void visitCollectionForElement(CollectionForElement node) {
+    _runSubscriptions(node, registry._forCollectionForElement);
+    super.visitCollectionForElement(node);
+  }
+
+  @override
+  void visitCollectionIfElement(CollectionIfElement node) {
+    _runSubscriptions(node, registry._forCollectionIfElement);
+    super.visitCollectionIfElement(node);
+  }
+
+  @override
   void visitComment(Comment node) {
     _runSubscriptions(node, registry._forComment);
     super.visitComment(node);
@@ -253,6 +265,18 @@
   }
 
   @override
+  void visitForEachPartsWithDeclaration(ForEachPartsWithDeclaration node) {
+    _runSubscriptions(node, registry._forForEachPartsWithDeclaration);
+    super.visitForEachPartsWithDeclaration(node);
+  }
+
+  @override
+  void visitForEachPartsWithIdentifier(ForEachPartsWithIdentifier node) {
+    _runSubscriptions(node, registry._forForEachPartsWithIdentifier);
+    super.visitForEachPartsWithIdentifier(node);
+  }
+
+  @override
   void visitForEachStatement(ForEachStatement node) {
     _runSubscriptions(node, registry._forForEachStatement);
     super.visitForEachStatement(node);
@@ -265,12 +289,30 @@
   }
 
   @override
+  void visitForPartsWithDeclarations(ForPartsWithDeclarations node) {
+    _runSubscriptions(node, registry._forForPartsWithDeclarations);
+    super.visitForPartsWithDeclarations(node);
+  }
+
+  @override
+  void visitForPartsWithExpression(ForPartsWithExpression node) {
+    _runSubscriptions(node, registry._forForPartsWithExpression);
+    super.visitForPartsWithExpression(node);
+  }
+
+  @override
   void visitForStatement(ForStatement node) {
     _runSubscriptions(node, registry._forForStatement);
     super.visitForStatement(node);
   }
 
   @override
+  void visitForStatement2(ForStatement2 node) {
+    _runSubscriptions(node, registry._forForStatement2);
+    super.visitForStatement2(node);
+  }
+
+  @override
   void visitFunctionDeclaration(FunctionDeclaration node) {
     _runSubscriptions(node, registry._forFunctionDeclaration);
     super.visitFunctionDeclaration(node);
@@ -409,12 +451,36 @@
   }
 
   @override
+  void visitListLiteral2(ListLiteral2 node) {
+    _runSubscriptions(node, registry._forListLiteral2);
+    super.visitListLiteral2(node);
+  }
+
+  @override
+  void visitMapForElement(MapForElement node) {
+    _runSubscriptions(node, registry._forMapForElement);
+    super.visitMapForElement(node);
+  }
+
+  @override
+  void visitMapIfElement(MapIfElement node) {
+    _runSubscriptions(node, registry._forMapIfElement);
+    super.visitMapIfElement(node);
+  }
+
+  @override
   void visitMapLiteral(MapLiteral node) {
     _runSubscriptions(node, registry._forMapLiteral);
     super.visitMapLiteral(node);
   }
 
   @override
+  void visitMapLiteral2(MapLiteral2 node) {
+    _runSubscriptions(node, registry._forMapLiteral2);
+    super.visitMapLiteral2(node);
+  }
+
+  @override
   void visitMapLiteralEntry(MapLiteralEntry node) {
     _runSubscriptions(node, registry._forMapLiteralEntry);
     super.visitMapLiteralEntry(node);
@@ -518,6 +584,12 @@
   }
 
   @override
+  void visitSetLiteral2(SetLiteral2 node) {
+    _runSubscriptions(node, registry._forSetLiteral2);
+    super.visitSetLiteral2(node);
+  }
+
+  @override
   void visitShowCombinator(ShowCombinator node) {
     _runSubscriptions(node, registry._forShowCombinator);
     super.visitShowCombinator(node);
@@ -542,6 +614,12 @@
   }
 
   @override
+  void visitSpreadElement(SpreadElement node) {
+    _runSubscriptions(node, registry._forSpreadElement);
+    super.visitSpreadElement(node);
+  }
+
+  @override
   void visitStringInterpolation(StringInterpolation node) {
     _runSubscriptions(node, registry._forStringInterpolation);
     super.visitStringInterpolation(node);
@@ -701,6 +779,8 @@
   final List<_Subscription<CatchClause>> _forCatchClause = [];
   final List<_Subscription<ClassDeclaration>> _forClassDeclaration = [];
   final List<_Subscription<ClassTypeAlias>> _forClassTypeAlias = [];
+  final List<_Subscription<CollectionForElement>> _forCollectionForElement = [];
+  final List<_Subscription<CollectionIfElement>> _forCollectionIfElement = [];
   final List<_Subscription<Comment>> _forComment = [];
   final List<_Subscription<CommentReference>> _forCommentReference = [];
   final List<_Subscription<CompilationUnit>> _forCompilationUnit = [];
@@ -731,9 +811,18 @@
   final List<_Subscription<ExtendsClause>> _forExtendsClause = [];
   final List<_Subscription<FieldDeclaration>> _forFieldDeclaration = [];
   final List<_Subscription<FieldFormalParameter>> _forFieldFormalParameter = [];
+  final List<_Subscription<ForEachPartsWithDeclaration>>
+      _forForEachPartsWithDeclaration = [];
+  final List<_Subscription<ForEachPartsWithIdentifier>>
+      _forForEachPartsWithIdentifier = [];
   final List<_Subscription<ForEachStatement>> _forForEachStatement = [];
   final List<_Subscription<FormalParameterList>> _forFormalParameterList = [];
+  final List<_Subscription<ForPartsWithDeclarations>>
+      _forForPartsWithDeclarations = [];
+  final List<_Subscription<ForPartsWithExpression>> _forForPartsWithExpression =
+      [];
   final List<_Subscription<ForStatement>> _forForStatement = [];
+  final List<_Subscription<ForStatement2>> _forForStatement2 = [];
   final List<_Subscription<FunctionDeclaration>> _forFunctionDeclaration = [];
   final List<_Subscription<FunctionDeclarationStatement>>
       _forFunctionDeclarationStatement = [];
@@ -762,7 +851,11 @@
   final List<_Subscription<LibraryDirective>> _forLibraryDirective = [];
   final List<_Subscription<LibraryIdentifier>> _forLibraryIdentifier = [];
   final List<_Subscription<ListLiteral>> _forListLiteral = [];
+  final List<_Subscription<ListLiteral2>> _forListLiteral2 = [];
+  final List<_Subscription<MapForElement>> _forMapForElement = [];
+  final List<_Subscription<MapIfElement>> _forMapIfElement = [];
   final List<_Subscription<MapLiteral>> _forMapLiteral = [];
+  final List<_Subscription<MapLiteral2>> _forMapLiteral2 = [];
   final List<_Subscription<MapLiteralEntry>> _forMapLiteralEntry = [];
   final List<_Subscription<MethodDeclaration>> _forMethodDeclaration = [];
   final List<_Subscription<MethodInvocation>> _forMethodInvocation = [];
@@ -782,11 +875,13 @@
       _forRedirectingConstructorInvocation = [];
   final List<_Subscription<RethrowExpression>> _forRethrowExpression = [];
   final List<_Subscription<ReturnStatement>> _forReturnStatement = [];
+  final List<_Subscription<SetLiteral2>> _forSetLiteral2 = [];
   final List<_Subscription<ShowCombinator>> _forShowCombinator = [];
   final List<_Subscription<SimpleFormalParameter>> _forSimpleFormalParameter =
       [];
   final List<_Subscription<SimpleIdentifier>> _forSimpleIdentifier = [];
   final List<_Subscription<SimpleStringLiteral>> _forSimpleStringLiteral = [];
+  final List<_Subscription<SpreadElement>> _forSpreadElement = [];
   final List<_Subscription<StringInterpolation>> _forStringInterpolation = [];
   final List<_Subscription<SuperConstructorInvocation>>
       _forSuperConstructorInvocation = [];
@@ -886,6 +981,16 @@
         .add(new _Subscription(linter, visitor, _getTimer(linter)));
   }
 
+  void addCollectionForElement(LintRule linter, AstVisitor visitor) {
+    _forCollectionForElement
+        .add(new _Subscription(linter, visitor, _getTimer(linter)));
+  }
+
+  void addCollectionIfElement(LintRule linter, AstVisitor visitor) {
+    _forCollectionIfElement
+        .add(new _Subscription(linter, visitor, _getTimer(linter)));
+  }
+
   void addComment(LintRule linter, AstVisitor visitor) {
     _forComment.add(new _Subscription(linter, visitor, _getTimer(linter)));
   }
@@ -1003,6 +1108,16 @@
         .add(new _Subscription(linter, visitor, _getTimer(linter)));
   }
 
+  void addForEachPartsWithDeclaration(LintRule linter, AstVisitor visitor) {
+    _forForEachPartsWithDeclaration
+        .add(new _Subscription(linter, visitor, _getTimer(linter)));
+  }
+
+  void addForEachPartsWithIdentifier(LintRule linter, AstVisitor visitor) {
+    _forForEachPartsWithIdentifier
+        .add(new _Subscription(linter, visitor, _getTimer(linter)));
+  }
+
   void addForEachStatement(LintRule linter, AstVisitor visitor) {
     _forForEachStatement
         .add(new _Subscription(linter, visitor, _getTimer(linter)));
@@ -1013,10 +1128,25 @@
         .add(new _Subscription(linter, visitor, _getTimer(linter)));
   }
 
+  void addForPartsWithDeclarations(LintRule linter, AstVisitor visitor) {
+    _forForPartsWithDeclarations
+        .add(new _Subscription(linter, visitor, _getTimer(linter)));
+  }
+
+  void addForPartsWithExpression(LintRule linter, AstVisitor visitor) {
+    _forForPartsWithExpression
+        .add(new _Subscription(linter, visitor, _getTimer(linter)));
+  }
+
   void addForStatement(LintRule linter, AstVisitor visitor) {
     _forForStatement.add(new _Subscription(linter, visitor, _getTimer(linter)));
   }
 
+  void addForStatement2(LintRule linter, AstVisitor visitor) {
+    _forForStatement2
+        .add(new _Subscription(linter, visitor, _getTimer(linter)));
+  }
+
   void addFunctionDeclaration(LintRule linter, AstVisitor visitor) {
     _forFunctionDeclaration
         .add(new _Subscription(linter, visitor, _getTimer(linter)));
@@ -1128,10 +1258,27 @@
     _forListLiteral.add(new _Subscription(linter, visitor, _getTimer(linter)));
   }
 
+  void addListLiteral2(LintRule linter, AstVisitor visitor) {
+    _forListLiteral2.add(new _Subscription(linter, visitor, _getTimer(linter)));
+  }
+
+  void addMapForElement(LintRule linter, AstVisitor visitor) {
+    _forMapForElement
+        .add(new _Subscription(linter, visitor, _getTimer(linter)));
+  }
+
+  void addMapIfElement(LintRule linter, AstVisitor visitor) {
+    _forMapIfElement.add(new _Subscription(linter, visitor, _getTimer(linter)));
+  }
+
   void addMapLiteral(LintRule linter, AstVisitor visitor) {
     _forMapLiteral.add(new _Subscription(linter, visitor, _getTimer(linter)));
   }
 
+  void addMapLiteral2(LintRule linter, AstVisitor visitor) {
+    _forMapLiteral2.add(new _Subscription(linter, visitor, _getTimer(linter)));
+  }
+
   void addMapLiteralEntry(LintRule linter, AstVisitor visitor) {
     _forMapLiteralEntry
         .add(new _Subscription(linter, visitor, _getTimer(linter)));
@@ -1216,6 +1363,10 @@
         .add(new _Subscription(linter, visitor, _getTimer(linter)));
   }
 
+  void addSetLiteral2(LintRule linter, AstVisitor visitor) {
+    _forSetLiteral2.add(new _Subscription(linter, visitor, _getTimer(linter)));
+  }
+
   void addShowCombinator(LintRule linter, AstVisitor visitor) {
     _forShowCombinator
         .add(new _Subscription(linter, visitor, _getTimer(linter)));
@@ -1236,6 +1387,11 @@
         .add(new _Subscription(linter, visitor, _getTimer(linter)));
   }
 
+  void addSpreadElement(LintRule linter, AstVisitor visitor) {
+    _forSpreadElement
+        .add(new _Subscription(linter, visitor, _getTimer(linter)));
+  }
+
   void addStringInterpolation(LintRule linter, AstVisitor visitor) {
     _forStringInterpolation
         .add(new _Subscription(linter, visitor, _getTimer(linter)));
diff --git a/pkg/analyzer/lib/src/lint/registry.dart b/pkg/analyzer/lib/src/lint/registry.dart
index 4e02ac7..e72f804 100644
--- a/pkg/analyzer/lib/src/lint/registry.dart
+++ b/pkg/analyzer/lib/src/lint/registry.dart
@@ -21,16 +21,6 @@
    */
   Map<String, LintRule> _ruleMap = <String, LintRule>{};
 
-  /**
-   * A list of the default lint rules.
-   */
-  List<LintRule> _defaultRules = <LintRule>[];
-
-  /**
-   * Return a list of the default lint rules.
-   */
-  List<LintRule> get defaultRules => _defaultRules;
-
   @override
   Iterator<LintRule> get iterator => _ruleMap.values.iterator;
 
@@ -69,12 +59,9 @@
     _ruleMap[rule.name] = rule;
   }
 
-  /**
-   * Add the given lint [rule] to this registry and mark it as being a default
-   * lint (one that will be run if lints are requested but no rules are enabled.
-   */
+  // todo (pq): remove once linter-0.1.79 is in DEPS.
+  @deprecated
   void registerDefault(LintRule rule) {
     register(rule);
-    _defaultRules.add(rule);
   }
 }
diff --git a/pkg/analyzer/lib/src/services/available_declarations.dart b/pkg/analyzer/lib/src/services/available_declarations.dart
new file mode 100644
index 0000000..fd417fc
--- /dev/null
+++ b/pkg/analyzer/lib/src/services/available_declarations.dart
@@ -0,0 +1,1065 @@
+// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:async';
+import 'dart:collection';
+
+import 'package:analyzer/dart/analysis/analysis_context.dart';
+import 'package:analyzer/dart/ast/ast.dart';
+import 'package:analyzer/error/listener.dart';
+import 'package:analyzer/file_system/file_system.dart';
+import 'package:analyzer/src/dart/analysis/byte_store.dart';
+import 'package:analyzer/src/dart/scanner/reader.dart';
+import 'package:analyzer/src/dart/scanner/scanner.dart';
+import 'package:analyzer/src/generated/parser.dart';
+import 'package:analyzer/src/generated/utilities_dart.dart';
+import 'package:analyzer/src/string_source.dart';
+import 'package:analyzer/src/summary/api_signature.dart';
+import 'package:analyzer/src/summary/format.dart' as idl;
+import 'package:analyzer/src/summary/idl.dart' as idl;
+import 'package:analyzer/src/summary/link.dart' as graph
+    show DependencyWalker, Node;
+import 'package:convert/convert.dart';
+import 'package:yaml/yaml.dart';
+
+/// A top-level public declaration.
+class Declaration {
+  final String name;
+  final DeclarationKind kind;
+
+  Declaration(this.name, this.kind);
+
+  @override
+  String toString() {
+    return '($name, $kind)';
+  }
+}
+
+/// A kind of a top-level declaration.
+enum DeclarationKind {
+  CLASS,
+  CLASS_TYPE_ALIAS,
+  ENUM,
+  FUNCTION,
+  FUNCTION_TYPE_ALIAS,
+  MIXIN,
+  VARIABLE
+}
+
+/// The context in which completions happens, so declarations are collected.
+class DeclarationsContext {
+  final DeclarationsTracker _tracker;
+
+  /// The analysis context for this context.  Declarations from all files in
+  /// the root are included into completion, even in 'lib/src' folders.
+  final AnalysisContext _analysisContext;
+
+  /// Packages in the analysis context.
+  ///
+  /// Packages are sorted so that inner packages are before outer.
+  final List<_Package> _packages = [];
+
+  /// The list of paths of all files inside the context.
+  final List<String> _contextPathList = [];
+
+  /// The list of paths of all SDK libraries.
+  final List<String> _sdkLibraryPathList = [];
+
+  /// Map of path prefixes to lists of paths of files from dependencies
+  /// (both libraries and parts, we don't know at the time when we fill this
+  /// map) that libraries with paths starting with these prefixes can access.
+  ///
+  /// The path prefix keys are sorted so that the longest keys are first.
+  final Map<String, List<String>> _pathPrefixToDependencyPathList = {};
+
+  DeclarationsContext(this._tracker, this._analysisContext);
+
+  /// Return libraries that are available to the file with the given [path].
+  ///
+  /// With `Pub`, files below the `pubspec.yaml` file can access libraries
+  /// of packages listed as `dependencies`, and files in the `test` directory
+  /// can in addition access libraries of packages listed as `dev_dependencies`.
+  ///
+  /// With `Bazel` sets of accessible libraries are specified explicitly by
+  /// the client using [setDependencies].
+  Libraries getLibraries(String path) {
+    var sdkLibraries = <Library>[];
+    _addLibrariesWithPaths(sdkLibraries, _sdkLibraryPathList);
+
+    var dependencyLibraries = <Library>[];
+    for (var pathPrefix in _pathPrefixToDependencyPathList.keys) {
+      if (path.startsWith(pathPrefix)) {
+        var pathList = _pathPrefixToDependencyPathList[pathPrefix];
+        _addLibrariesWithPaths(dependencyLibraries, pathList);
+        break;
+      }
+    }
+
+    _Package package;
+    for (var candidatePackage in _packages) {
+      if (candidatePackage.contains(path)) {
+        package = candidatePackage;
+        break;
+      }
+    }
+
+    var contextPathList = <String>[];
+    if (package != null) {
+      var containingFolder = package.folderInRootContaining(path);
+      if (containingFolder != null) {
+        for (var contextPath in _contextPathList) {
+          // `lib/` can see only libraries in `lib/`.
+          // `test/` can see libraries in `lib/` and in `test/`.
+          if (package.containsInLib(contextPath) ||
+              containingFolder.contains(contextPath)) {
+            contextPathList.add(contextPath);
+          }
+        }
+      }
+    } else {
+      // Not in a package, include all libraries of the context.
+      contextPathList = _contextPathList;
+    }
+
+    var contextLibraries = <Library>[];
+    _addLibrariesWithPaths(contextLibraries, contextPathList);
+
+    return Libraries(sdkLibraries, dependencyLibraries, contextLibraries);
+  }
+
+  /// Set dependencies for path prefixes in this context.
+  ///
+  /// The map [pathPrefixToPathList] specifies the list of paths of libraries
+  /// and directories with libraries that are accessible to the files with
+  /// paths that start with the path that is the key in the map.  The longest
+  /// (so most specific) key will be used, each list of paths is complete, and
+  /// is not combined with any enclosing locations.
+  ///
+  /// For `Pub` packages this method is invoked automatically, because their
+  /// dependencies, described in `pubspec.yaml` files, and can be automatically
+  /// included.  This method is useful for `Bazel` contexts, where dependencies
+  /// are specified externally, in form of `BUILD` files.
+  ///
+  /// New dependencies will replace any previously set dependencies for this
+  /// context.
+  ///
+  /// Every path in the list must be absolute and normalized.
+  void setDependencies(Map<String, List<String>> pathPrefixToPathList) {
+    var rootFolder = _analysisContext.contextRoot.root;
+    _pathPrefixToDependencyPathList.removeWhere((pathPrefix, _) {
+      return rootFolder.isOrContains(pathPrefix);
+    });
+
+    var sortedPrefixes = pathPrefixToPathList.keys.toList();
+    sortedPrefixes.sort((a, b) {
+      return b.compareTo(a);
+    });
+
+    for (var pathPrefix in sortedPrefixes) {
+      var pathList = pathPrefixToPathList[pathPrefix];
+      var files = <String>[];
+      for (var path in pathList) {
+        var resource = _tracker._resourceProvider.getResource(path);
+        _scheduleDependencyResource(files, resource);
+      }
+      _pathPrefixToDependencyPathList[pathPrefix] = files;
+    }
+  }
+
+  void _addLibrariesWithPaths(List<Library> libraries, List<String> pathList) {
+    for (var path in pathList) {
+      var file = _tracker._pathToFile[path];
+      if (file != null && file.isLibrary) {
+        var library = _tracker._idToLibrary[file.id];
+        if (library != null) {
+          libraries.add(library);
+        }
+      }
+    }
+  }
+
+  /// Traverse the folders of this context and fill [_packages];  use
+  /// `pubspec.yaml` files to set `Pub` dependencies.
+  void _findPackages() {
+    var pathContext = _tracker._resourceProvider.pathContext;
+    var pubPathPrefixToPathList = <String, List<String>>{};
+
+    void visitFolder(Folder folder) {
+      var buildFile = folder.getChildAssumingFile('BUILD');
+      var pubspecFile = folder.getChildAssumingFile('pubspec.yaml');
+      if (buildFile.exists) {
+        _packages.add(_Package(folder));
+      } else if (pubspecFile.exists) {
+        var dependencies = _parsePubspecDependencies(pubspecFile);
+        var libPaths = _resolvePackageNamesToLibPaths(dependencies.lib);
+        var devPaths = _resolvePackageNamesToLibPaths(dependencies.dev);
+
+        var packagePath = folder.path;
+        pubPathPrefixToPathList[packagePath] = <String>[]
+          ..addAll(libPaths)
+          ..addAll(devPaths);
+
+        var libPath = pathContext.join(packagePath, 'lib');
+        pubPathPrefixToPathList[libPath] = libPaths;
+
+        _packages.add(_Package(folder));
+      }
+
+      try {
+        for (var resource in folder.getChildren()) {
+          if (resource is Folder) {
+            visitFolder(resource);
+          }
+        }
+      } on FileSystemException {}
+    }
+
+    visitFolder(_analysisContext.contextRoot.root);
+    setDependencies(pubPathPrefixToPathList);
+
+    _packages.sort((a, b) {
+      var aRoot = a.root.path;
+      var bRoot = b.root.path;
+      return bRoot.compareTo(aRoot);
+    });
+  }
+
+  bool _isLibSrcPath(String path) {
+    var parts = _tracker._resourceProvider.pathContext.split(path);
+    for (var i = 0; i < parts.length - 1; ++i) {
+      if (parts[i] == 'lib' && parts[i + 1] == 'src') return true;
+    }
+    return false;
+  }
+
+  List<String> _resolvePackageNamesToLibPaths(List<String> packageNames) {
+    return packageNames
+        .map(_resolvePackageNameToLibPath)
+        .where((path) => path != null)
+        .toList();
+  }
+
+  String _resolvePackageNameToLibPath(String packageName) {
+    try {
+      var uri = Uri.parse('package:$packageName/ref.dart');
+
+      var path = _resolveUri(uri);
+      if (path == null) return null;
+
+      return _tracker._resourceProvider.pathContext.dirname(path);
+    } on FormatException {
+      return null;
+    }
+  }
+
+  String _resolveUri(Uri uri) {
+    var uriConverter = _analysisContext.currentSession.uriConverter;
+    return uriConverter.uriToPath(uri);
+  }
+
+  Uri _restoreUri(String path) {
+    var uriConverter = _analysisContext.currentSession.uriConverter;
+    return uriConverter.pathToUri(path);
+  }
+
+  void _scheduleContextFiles() {
+    var contextFiles = _analysisContext.contextRoot.analyzedFiles();
+    for (var path in contextFiles) {
+      _contextPathList.add(path);
+      _tracker._addFile(this, path);
+    }
+  }
+
+  void _scheduleDependencyFolder(List<String> files, Folder folder) {
+    if (_isLibSrcPath(folder.path)) return;
+    try {
+      for (var resource in folder.getChildren()) {
+        _scheduleDependencyResource(files, resource);
+      }
+    } on FileSystemException catch (_) {}
+  }
+
+  void _scheduleDependencyResource(List<String> files, Resource resource) {
+    if (resource is File) {
+      files.add(resource.path);
+      _tracker._addFile(this, resource.path);
+    } else if (resource is Folder) {
+      _scheduleDependencyFolder(files, resource);
+    }
+  }
+
+  void _scheduleSdkLibraries() {
+    // ignore: deprecated_member_use_from_same_package
+    var sdk = _analysisContext.currentSession.sourceFactory.dartSdk;
+    for (var uriStr in sdk.uris) {
+      var uri = Uri.parse(uriStr);
+      var path = _resolveUri(uri);
+      if (path != null) {
+        _sdkLibraryPathList.add(path);
+        _tracker._addFile(this, path);
+      }
+    }
+  }
+
+  static _PubspecDependencies _parsePubspecDependencies(File pubspecFile) {
+    var dependencies = <String>[];
+    var devDependencies = <String>[];
+    try {
+      var fileContent = pubspecFile.readAsStringSync();
+      var document = loadYamlDocument(fileContent);
+      var contents = document.contents;
+      if (contents is YamlMap) {
+        var dependenciesNode = contents.nodes['dependencies'];
+        if (dependenciesNode is YamlMap) {
+          dependencies = dependenciesNode.keys.whereType<String>().toList();
+        }
+
+        var devDependenciesNode = contents.nodes['dev_dependencies'];
+        if (devDependenciesNode is YamlMap) {
+          devDependencies =
+              devDependenciesNode.keys.whereType<String>().toList();
+        }
+      }
+    } catch (e) {}
+    return _PubspecDependencies(dependencies, devDependencies);
+  }
+}
+
+/// Tracker for top-level declarations across multiple analysis contexts
+/// and their dependencies.
+class DeclarationsTracker {
+  final ByteStore _byteStore;
+  final ResourceProvider _resourceProvider;
+
+  final Map<AnalysisContext, DeclarationsContext> _contexts = {};
+  final Map<String, _File> _pathToFile = {};
+  final Map<Uri, _File> _uriToFile = {};
+  final Map<int, Library> _idToLibrary = {};
+
+  final _changesController = _StreamController<LibraryChange>();
+
+  /// The list of changed file paths.
+  final List<String> _changedPaths = [];
+
+  /// The list of files scheduled for processing.  It may include parts and
+  /// libraries, but parts are ignored when we detect them.
+  final List<_ScheduledFile> _scheduledFiles = [];
+
+  DeclarationsTracker(this._byteStore, this._resourceProvider);
+
+  /// The stream of changes to the set of libraries used by the added contexts.
+  Stream<LibraryChange> get changes => _changesController.stream;
+
+  /// Return `true` if there is scheduled work to do, as a result of adding
+  /// new contexts, or changes to files.
+  bool get hasWork {
+    return _changedPaths.isNotEmpty || _scheduledFiles.isNotEmpty;
+  }
+
+  /// Add the [analysisContext], so that its libraries are reported via the
+  /// [changes] stream, and return the [DeclarationsContext] that can be used
+  /// to set additional dependencies and request libraries available to this
+  /// context.
+  DeclarationsContext addContext(AnalysisContext analysisContext) {
+    if (_contexts.containsKey(analysisContext)) {
+      throw StateError('The analysis context has already been added.');
+    }
+
+    var declarationsContext = DeclarationsContext(this, analysisContext);
+    _contexts[analysisContext] = declarationsContext;
+
+    declarationsContext._scheduleContextFiles();
+    declarationsContext._scheduleSdkLibraries();
+    declarationsContext._findPackages();
+    return declarationsContext;
+  }
+
+  /// The file with the given [path] was changed - added, updated, or removed.
+  ///
+  /// The [path] must be absolute and normalized.
+  ///
+  /// Usually causes [hasWork] to return `true`, so that [doWork] should
+  /// be invoked to send updates to [changes] that reflect changes to the
+  /// library of the file, and other libraries that export it.
+  void changeFile(String path) {
+    _changedPaths.add(path);
+  }
+
+  /// Do a single piece of work.
+  ///
+  /// The client should call this method until [hasWork] returns `false`.
+  /// This would mean that all previous changes have been processed, and
+  /// updates scheduled to be delivered via the [changes] stream.
+  void doWork() {
+    if (_changedPaths.isNotEmpty) {
+      var path = _changedPaths.removeLast();
+      _performChangeFile(path);
+      return;
+    }
+
+    if (_scheduledFiles.isNotEmpty) {
+      var scheduledFile = _scheduledFiles.removeLast();
+      var file = _getFileByPath(scheduledFile.context, scheduledFile.path);
+
+      if (!file.isLibrary) return;
+
+      if (file.exportedDeclarations == null) {
+        new _LibraryWalker().walkLibrary(file);
+        assert(file.exportedDeclarations != null);
+      }
+
+      var library = Library._(
+        file.id,
+        file.path,
+        file.uri,
+        file.exportedDeclarations,
+      );
+      _idToLibrary[file.id] = library;
+      _changesController.add(
+        LibraryChange._([library], []),
+      );
+    }
+  }
+
+  /// The [analysisContext] is being disposed, it does not need declarations.
+  void removeContext(AnalysisContext analysisContext) {
+    _contexts.remove(analysisContext);
+
+    _scheduledFiles.removeWhere((f) {
+      return f.context._analysisContext == analysisContext;
+    });
+  }
+
+  void _addFile(DeclarationsContext context, String path) {
+    if (path.endsWith('.dart')) {
+      _scheduledFiles.add(_ScheduledFile(context, path));
+    }
+  }
+
+  /// Compute exported declarations for the given [libraries].
+  void _computeExportedDeclarations(Set<_File> libraries) {
+    var walker = new _LibraryWalker();
+    for (var library in libraries) {
+      if (library.isLibrary && library.exportedDeclarations == null) {
+        walker.walkLibrary(library);
+        assert(library.exportedDeclarations != null);
+      }
+    }
+  }
+
+  _File _getFileByPath(DeclarationsContext context, String path) {
+    var file = _pathToFile[path];
+    if (file == null) {
+      var uri = context._restoreUri(path);
+      if (uri != null) {
+        file = _File(this, path, uri);
+        _pathToFile[path] = file;
+        _uriToFile[uri] = file;
+        file.refresh(context);
+      }
+    }
+    return file;
+  }
+
+  _File _getFileByUri(DeclarationsContext context, Uri uri) {
+    var file = _uriToFile[uri];
+    if (file == null) {
+      var path = context._resolveUri(uri);
+      if (path != null) {
+        file = _File(this, path, uri);
+        _pathToFile[path] = file;
+        _uriToFile[uri] = file;
+        file.refresh(context);
+      }
+    }
+    return file;
+  }
+
+  /// Recursively invalidate exported declarations of the given [library]
+  /// and libraries that export it.
+  void _invalidateExportedDeclarations(Set<_File> libraries, _File library) {
+    if (libraries.add(library)) {
+      library.exportedDeclarations = null;
+      for (var exporter in library.directExporters) {
+        _invalidateExportedDeclarations(libraries, exporter);
+      }
+    }
+  }
+
+  void _performChangeFile(String path) {
+    DeclarationsContext containingContext;
+    for (var context in _contexts.values) {
+      var uri = context._restoreUri(path);
+      if (uri != null) {
+        containingContext = context;
+        break;
+      }
+    }
+    if (containingContext == null) return;
+
+    var file = _getFileByPath(containingContext, path);
+    if (file == null) return;
+
+    var isLibrary = file.isLibrary;
+    var library = isLibrary ? file : file.library;
+
+    if (isLibrary) {
+      file.refresh(containingContext);
+    } else {
+      file.refresh(containingContext);
+      library.refresh(containingContext);
+    }
+
+    var invalidatedLibraries = Set<_File>();
+    _invalidateExportedDeclarations(invalidatedLibraries, library);
+    _computeExportedDeclarations(invalidatedLibraries);
+
+    var changedLibraries = <Library>[];
+    var removedLibraries = <int>[];
+    for (var library in invalidatedLibraries) {
+      if (library.exists) {
+        changedLibraries.add(Library._(
+          library.id,
+          library.path,
+          library.uri,
+          library.exportedDeclarations,
+        ));
+      } else {
+        removedLibraries.add(library.id);
+      }
+    }
+    _changesController.add(
+      LibraryChange._(changedLibraries, removedLibraries),
+    );
+  }
+}
+
+class Libraries {
+  final List<Library> sdk;
+  final List<Library> dependencies;
+  final List<Library> context;
+
+  Libraries(this.sdk, this.dependencies, this.context);
+}
+
+/// A library with declarations.
+class Library {
+  /// The unique identifier of a library with the given [path].
+  final int id;
+
+  /// The path to the file that defines this library.
+  final String path;
+
+  /// The URI of the library.
+  final Uri uri;
+
+  /// All public declaration that the library declares or (re)exports.
+  final List<Declaration> declarations;
+
+  Library._(this.id, this.path, this.uri, this.declarations);
+
+  @override
+  String toString() {
+    return '(uri: $uri, path: $path)';
+  }
+}
+
+/// A change to the set of libraries and their declarations.
+class LibraryChange {
+  /// The list of new or changed libraries.
+  final List<Library> changed;
+
+  /// The list of identifier of libraries that are removed, either because
+  /// the corresponding files were removed, or because none of the contexts
+  /// has these libraries as dependencies, so that they cannot be used anymore.
+  final List<int> removed;
+
+  LibraryChange._(this.changed, this.removed);
+}
+
+class _Export {
+  final Uri uri;
+  final List<_ExportCombinator> combinators;
+
+  _File file;
+
+  _Export(this.uri, this.combinators);
+
+  Iterable<Declaration> filter(List<Declaration> declarations) {
+    return declarations.where((d) {
+      for (var combinator in combinators) {
+        if (combinator.shows.isNotEmpty) {
+          if (!combinator.shows.contains(d.name)) return false;
+        }
+        if (combinator.hides.isNotEmpty) {
+          if (combinator.hides.contains(d.name)) return false;
+        }
+      }
+      return true;
+    });
+  }
+}
+
+class _ExportCombinator {
+  final List<String> shows;
+  final List<String> hides;
+
+  _ExportCombinator(this.shows, this.hides);
+}
+
+class _File {
+  /// The version of data format, should be incremented on every format change.
+  static const int DATA_VERSION = 1;
+
+  /// The next value for [id].
+  static int _nextId = 0;
+
+  final DeclarationsTracker tracker;
+
+  final int id = _nextId++;
+  final String path;
+  final Uri uri;
+
+  bool exists = false;
+  bool isLibrary = false;
+  List<_Export> exports = [];
+  List<_Part> parts = [];
+
+  /// If this file is a part, the containing library.
+  _File library;
+
+  /// If this file is a library, libraries that export it.
+  List<_File> directExporters = [];
+
+  List<Declaration> fileDeclarations = [];
+  List<Declaration> libraryDeclarations = [];
+  List<Declaration> exportedDeclarations;
+
+  _File(this.tracker, this.path, this.uri);
+
+  void refresh(DeclarationsContext context) {
+    var resource = tracker._resourceProvider.getFile(path);
+
+    int modificationStamp;
+    try {
+      modificationStamp = resource.modificationStamp;
+      exists = true;
+    } catch (e) {
+      modificationStamp = -1;
+      exists = false;
+    }
+
+    // When a file changes, its modification stamp changes.
+    String pathKey;
+    {
+      var pathKeyBuilder = ApiSignature();
+      pathKeyBuilder.addInt(DATA_VERSION);
+      pathKeyBuilder.addString(path);
+      pathKeyBuilder.addInt(modificationStamp);
+      pathKey = pathKeyBuilder.toHex() + '.declarations_content';
+    }
+
+    // With Bazel multiple workspaces might be copies of the same workspace,
+    // and have files with the same content, but with different paths.
+    // So, we use the content hash to reuse their declarations without parsing.
+    String content;
+    String contentKey;
+    {
+      var contentHashBytes = tracker._byteStore.get(pathKey);
+      if (contentHashBytes == null) {
+        content = _readContent(resource);
+
+        var contentHashBuilder = ApiSignature();
+        contentHashBuilder.addInt(DATA_VERSION);
+        contentHashBuilder.addString(content);
+        contentHashBytes = contentHashBuilder.toByteList();
+
+        tracker._byteStore.put(pathKey, contentHashBytes);
+      }
+
+      contentKey = hex.encode(contentHashBytes) + '.declarations';
+    }
+
+    var bytes = tracker._byteStore.get(contentKey);
+    if (bytes == null) {
+      content ??= _readContent(resource);
+
+      CompilationUnit unit = _parse(content);
+      _buildFileDeclarations(unit);
+      _putFileDeclarationsToByteStore(contentKey);
+    } else {
+      _readFileDeclarationsFromBytes(bytes);
+    }
+
+    // Resolve exports and parts.
+    for (var export in exports) {
+      export.file = _fileForRelativeUri(context, export.uri);
+    }
+    for (var part in parts) {
+      part.file = _fileForRelativeUri(context, part.uri);
+    }
+    exports.removeWhere((e) => e.file == null);
+    parts.removeWhere((e) => e.file == null);
+
+    // Set back pointers.
+    for (var export in exports) {
+      export.file.directExporters.add(this);
+    }
+    for (var part in parts) {
+      part.file.library = this;
+      part.file.isLibrary = false;
+    }
+
+    // Compute library declarations.
+    if (isLibrary) {
+      libraryDeclarations = <Declaration>[];
+      libraryDeclarations.addAll(fileDeclarations);
+      for (var part in parts) {
+        libraryDeclarations.addAll(part.file.fileDeclarations);
+      }
+    }
+  }
+
+  void _buildFileDeclarations(CompilationUnit unit) {
+    isLibrary = true;
+    exports = [];
+    fileDeclarations = [];
+    libraryDeclarations = null;
+    exportedDeclarations = null;
+
+    void addDeclaration(Identifier name, DeclarationKind kind) {
+      if (!Identifier.isPrivateName(name.name)) {
+        fileDeclarations.add(Declaration(name.name, kind));
+      }
+    }
+
+    for (var astDirective in unit.directives) {
+      if (astDirective is PartOfDirective) {
+        isLibrary = false;
+      } else if (astDirective is ExportDirective) {
+        var uri = _uriFromAst(astDirective.uri);
+        if (uri == null) continue;
+
+        var combinators = <_ExportCombinator>[];
+        for (var astCombinator in astDirective.combinators) {
+          if (astCombinator is ShowCombinator) {
+            combinators.add(_ExportCombinator(
+              astCombinator.shownNames.map((id) => id.name).toList(),
+              const [],
+            ));
+          } else if (astCombinator is HideCombinator) {
+            combinators.add(_ExportCombinator(
+              const [],
+              astCombinator.hiddenNames.map((id) => id.name).toList(),
+            ));
+          }
+        }
+
+        exports.add(_Export(uri, combinators));
+      } else if (astDirective is PartDirective) {
+        var uri = _uriFromAst(astDirective.uri);
+        if (uri == null) continue;
+
+        parts.add(_Part(uri));
+      }
+    }
+
+    for (var node in unit.declarations) {
+      if (node is ClassDeclaration) {
+        addDeclaration(node.name, DeclarationKind.CLASS);
+      } else if (node is ClassTypeAlias) {
+        addDeclaration(node.name, DeclarationKind.CLASS_TYPE_ALIAS);
+      } else if (node is EnumDeclaration) {
+        addDeclaration(node.name, DeclarationKind.ENUM);
+      } else if (node is FunctionDeclaration) {
+        addDeclaration(node.name, DeclarationKind.FUNCTION);
+      } else if (node is GenericTypeAlias) {
+        addDeclaration(node.name, DeclarationKind.FUNCTION_TYPE_ALIAS);
+      } else if (node is MixinDeclaration) {
+        addDeclaration(node.name, DeclarationKind.MIXIN);
+      } else if (node is TopLevelVariableDeclaration) {
+        for (var variable in node.variables.variables) {
+          addDeclaration(variable.name, DeclarationKind.VARIABLE);
+        }
+      }
+    }
+  }
+
+  /// Return the [_File] for the given [relative] URI, maybe `null`.
+  _File _fileForRelativeUri(DeclarationsContext context, Uri relative) {
+    var absoluteUri = resolveRelativeUri(uri, relative);
+    return tracker._getFileByUri(context, absoluteUri);
+  }
+
+  void _putFileDeclarationsToByteStore(String contentKey) {
+    var builder = idl.AvailableFileBuilder(
+      isLibrary: isLibrary,
+      exports: exports.map((e) {
+        return idl.AvailableFileExportBuilder(
+          uri: e.uri.toString(),
+          combinators: e.combinators.map((c) {
+            return idl.AvailableFileExportCombinatorBuilder(
+                shows: c.shows, hides: c.hides);
+          }).toList(),
+        );
+      }).toList(),
+      parts: parts.map((p) => p.uri.toString()).toList(),
+      declarations: fileDeclarations.map((d) {
+        var idlKind = _kindToIdl(d.kind);
+        return idl.AvailableDeclarationBuilder(kind: idlKind, name: d.name);
+      }).toList(),
+    );
+    var bytes = builder.toBuffer();
+    tracker._byteStore.put(contentKey, bytes);
+  }
+
+  void _readFileDeclarationsFromBytes(List<int> bytes) {
+    var idlFile = idl.AvailableFile.fromBuffer(bytes);
+
+    isLibrary = idlFile.isLibrary;
+
+    exports = idlFile.exports.map((e) {
+      return _Export(
+        Uri.parse(e.uri),
+        e.combinators.map((c) {
+          return _ExportCombinator(c.shows.toList(), c.hides.toList());
+        }).toList(),
+      );
+    }).toList();
+
+    parts = idlFile.parts.map((e) {
+      var uri = Uri.parse(e);
+      return _Part(uri);
+    }).toList();
+
+    fileDeclarations = idlFile.declarations.map((e) {
+      var kind = _kindFromIdl(e.kind);
+      return Declaration(e.name, kind);
+    }).toList();
+  }
+
+  static DeclarationKind _kindFromIdl(idl.AvailableDeclarationKind kind) {
+    switch (kind) {
+      case idl.AvailableDeclarationKind.CLASS:
+        return DeclarationKind.CLASS;
+      case idl.AvailableDeclarationKind.CLASS_TYPE_ALIAS:
+        return DeclarationKind.CLASS_TYPE_ALIAS;
+      case idl.AvailableDeclarationKind.ENUM:
+        return DeclarationKind.ENUM;
+      case idl.AvailableDeclarationKind.FUNCTION:
+        return DeclarationKind.FUNCTION;
+      case idl.AvailableDeclarationKind.FUNCTION_TYPE_ALIAS:
+        return DeclarationKind.FUNCTION_TYPE_ALIAS;
+      case idl.AvailableDeclarationKind.MIXIN:
+        return DeclarationKind.MIXIN;
+      case idl.AvailableDeclarationKind.VARIABLE:
+        return DeclarationKind.VARIABLE;
+      default:
+        throw StateError('Unknown kind: $kind');
+    }
+  }
+
+  static idl.AvailableDeclarationKind _kindToIdl(DeclarationKind kind) {
+    switch (kind) {
+      case DeclarationKind.CLASS:
+        return idl.AvailableDeclarationKind.CLASS;
+      case DeclarationKind.CLASS_TYPE_ALIAS:
+        return idl.AvailableDeclarationKind.CLASS_TYPE_ALIAS;
+      case DeclarationKind.ENUM:
+        return idl.AvailableDeclarationKind.ENUM;
+      case DeclarationKind.FUNCTION:
+        return idl.AvailableDeclarationKind.FUNCTION;
+      case DeclarationKind.FUNCTION_TYPE_ALIAS:
+        return idl.AvailableDeclarationKind.FUNCTION_TYPE_ALIAS;
+      case DeclarationKind.MIXIN:
+        return idl.AvailableDeclarationKind.MIXIN;
+      case DeclarationKind.VARIABLE:
+        return idl.AvailableDeclarationKind.VARIABLE;
+      default:
+        throw StateError('Unknown kind: $kind');
+    }
+  }
+
+  static CompilationUnit _parse(String content) {
+    var errorListener = AnalysisErrorListener.NULL_LISTENER;
+    var source = StringSource(content, '');
+
+    var reader = new CharSequenceReader(content);
+    var scanner = new Scanner(null, reader, errorListener);
+    var token = scanner.tokenize();
+
+    var parser = new Parser(source, errorListener, useFasta: true);
+    return parser.parseCompilationUnit(token);
+  }
+
+  static String _readContent(File resource) {
+    try {
+      return resource.readAsStringSync();
+    } catch (e) {
+      return '';
+    }
+  }
+
+  static Uri _uriFromAst(StringLiteral astUri) {
+    if (astUri is SimpleStringLiteral) {
+      var uriStr = astUri.value;
+      try {
+        return Uri.parse(uriStr);
+      } catch (_) {}
+    }
+    return null;
+  }
+}
+
+class _LibraryNode extends graph.Node<_LibraryNode> {
+  final _LibraryWalker walker;
+  final _File file;
+
+  _LibraryNode(this.walker, this.file);
+
+  @override
+  bool get isEvaluated => file.exportedDeclarations != null;
+
+  @override
+  List<_LibraryNode> computeDependencies() {
+    return file.exports.map((e) => e.file).map(walker.getNode).toList();
+  }
+}
+
+class _LibraryWalker extends graph.DependencyWalker<_LibraryNode> {
+  final Map<_File, _LibraryNode> nodesOfFiles = {};
+
+  @override
+  void evaluate(_LibraryNode node) {
+    var file = node.file;
+    var resultSet = _newDeclarationSet();
+    resultSet.addAll(file.libraryDeclarations);
+
+    for (var export in file.exports) {
+      var exportedDeclarations = export.file.exportedDeclarations;
+      resultSet.addAll(export.filter(exportedDeclarations));
+    }
+
+    file.exportedDeclarations = resultSet.toList();
+  }
+
+  @override
+  void evaluateScc(List<_LibraryNode> scc) {
+    for (var node in scc) {
+      var visitedFiles = Set<_File>();
+
+      List<Declaration> computeExported(_File file) {
+        if (file.exportedDeclarations != null) {
+          return file.exportedDeclarations;
+        }
+
+        if (!visitedFiles.add(file)) {
+          return const [];
+        }
+
+        var resultSet = _newDeclarationSet();
+        resultSet.addAll(file.libraryDeclarations);
+
+        for (var export in file.exports) {
+          var exportedDeclarations = computeExported(export.file);
+          resultSet.addAll(export.filter(exportedDeclarations));
+        }
+
+        return resultSet.toList();
+      }
+
+      var file = node.file;
+      file.exportedDeclarations = computeExported(file);
+    }
+  }
+
+  _LibraryNode getNode(_File file) {
+    return nodesOfFiles.putIfAbsent(file, () => new _LibraryNode(this, file));
+  }
+
+  void walkLibrary(_File file) {
+    var node = getNode(file);
+    walk(node);
+  }
+
+  static Set<Declaration> _newDeclarationSet() {
+    return HashSet<Declaration>(
+      hashCode: (e) => e.name.hashCode,
+      equals: (a, b) => a.name == b.name,
+    );
+  }
+}
+
+/// Information about a package: `Pub` or `Bazel`.
+class _Package {
+  final Folder root;
+  final Folder lib;
+
+  _Package(this.root) : lib = root.getChildAssumingFolder('lib');
+
+  /// Return `true` if the [path] is anywhere in the [root] of the package.
+  ///
+  /// Note, that this method does not check if the are nested packages, that
+  /// might actually contain the [path].
+  bool contains(String path) {
+    return root.contains(path);
+  }
+
+  /// Return `true` if the [path] is in the `lib` folder of this package.
+  bool containsInLib(String path) {
+    return lib.contains(path);
+  }
+
+  /// Return the direct child folder of the root, that contains the [path].
+  ///
+  /// So, we can know if the [path] is in `lib/`, or `test/`, or `bin/`.
+  Folder folderInRootContaining(String path) {
+    try {
+      var children = root.getChildren();
+      for (var folder in children) {
+        if (folder is Folder && folder.contains(path)) {
+          return folder;
+        }
+      }
+    } on FileSystemException {}
+    return null;
+  }
+}
+
+class _Part {
+  final Uri uri;
+
+  _File file;
+
+  _Part(this.uri);
+}
+
+/// Normal and dev dependencies specified in a `pubspec.yaml` file.
+class _PubspecDependencies {
+  final List<String> lib;
+  final List<String> dev;
+
+  _PubspecDependencies(this.lib, this.dev);
+}
+
+class _ScheduledFile {
+  final DeclarationsContext context;
+  final String path;
+
+  _ScheduledFile(this.context, this.path);
+}
+
+/// Wrapper for a [StreamController] and its unique [Stream] instance.
+class _StreamController<T> {
+  final StreamController<T> controller = StreamController<T>();
+  Stream<T> stream;
+
+  _StreamController() {
+    stream = controller.stream;
+  }
+
+  void add(T event) {
+    controller.add(event);
+  }
+}
diff --git a/pkg/analyzer/lib/src/summary/format.dart b/pkg/analyzer/lib/src/summary/format.dart
index 3c8019c..7bf2bad 100644
--- a/pkg/analyzer/lib/src/summary/format.dart
+++ b/pkg/analyzer/lib/src/summary/format.dart
@@ -14,6 +14,22 @@
 
 import 'idl.dart' as idl;
 
+class _AvailableDeclarationKindReader
+    extends fb.Reader<idl.AvailableDeclarationKind> {
+  const _AvailableDeclarationKindReader() : super();
+
+  @override
+  int get size => 1;
+
+  @override
+  idl.AvailableDeclarationKind read(fb.BufferContext bc, int offset) {
+    int index = const fb.Uint8Reader().read(bc, offset);
+    return index < idl.AvailableDeclarationKind.values.length
+        ? idl.AvailableDeclarationKind.values[index]
+        : idl.AvailableDeclarationKind.CLASS;
+  }
+}
+
 class _EntityRefKindReader extends fb.Reader<idl.EntityRefKind> {
   const _EntityRefKindReader() : super();
 
@@ -2095,6 +2111,586 @@
   String toString() => convert.json.encode(toJson());
 }
 
+class AvailableDeclarationBuilder extends Object
+    with _AvailableDeclarationMixin
+    implements idl.AvailableDeclaration {
+  idl.AvailableDeclarationKind _kind;
+  String _name;
+
+  @override
+  idl.AvailableDeclarationKind get kind =>
+      _kind ??= idl.AvailableDeclarationKind.CLASS;
+
+  /// The kind of the declaration.
+  void set kind(idl.AvailableDeclarationKind value) {
+    this._kind = value;
+  }
+
+  @override
+  String get name => _name ??= '';
+
+  /// The name of the declaration.
+  void set name(String value) {
+    this._name = value;
+  }
+
+  AvailableDeclarationBuilder({idl.AvailableDeclarationKind kind, String name})
+      : _kind = kind,
+        _name = name;
+
+  /**
+   * Flush [informative] data recursively.
+   */
+  void flushInformative() {}
+
+  /**
+   * Accumulate non-[informative] data into [signature].
+   */
+  void collectApiSignature(api_sig.ApiSignature signature) {
+    signature.addString(this._name ?? '');
+    signature.addInt(this._kind == null ? 0 : this._kind.index);
+  }
+
+  fb.Offset finish(fb.Builder fbBuilder) {
+    fb.Offset offset_name;
+    if (_name != null) {
+      offset_name = fbBuilder.writeString(_name);
+    }
+    fbBuilder.startTable();
+    if (_kind != null && _kind != idl.AvailableDeclarationKind.CLASS) {
+      fbBuilder.addUint8(1, _kind.index);
+    }
+    if (offset_name != null) {
+      fbBuilder.addOffset(0, offset_name);
+    }
+    return fbBuilder.endTable();
+  }
+}
+
+class _AvailableDeclarationReader
+    extends fb.TableReader<_AvailableDeclarationImpl> {
+  const _AvailableDeclarationReader();
+
+  @override
+  _AvailableDeclarationImpl createObject(fb.BufferContext bc, int offset) =>
+      new _AvailableDeclarationImpl(bc, offset);
+}
+
+class _AvailableDeclarationImpl extends Object
+    with _AvailableDeclarationMixin
+    implements idl.AvailableDeclaration {
+  final fb.BufferContext _bc;
+  final int _bcOffset;
+
+  _AvailableDeclarationImpl(this._bc, this._bcOffset);
+
+  idl.AvailableDeclarationKind _kind;
+  String _name;
+
+  @override
+  idl.AvailableDeclarationKind get kind {
+    _kind ??= const _AvailableDeclarationKindReader()
+        .vTableGet(_bc, _bcOffset, 1, idl.AvailableDeclarationKind.CLASS);
+    return _kind;
+  }
+
+  @override
+  String get name {
+    _name ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 0, '');
+    return _name;
+  }
+}
+
+abstract class _AvailableDeclarationMixin implements idl.AvailableDeclaration {
+  @override
+  Map<String, Object> toJson() {
+    Map<String, Object> _result = <String, Object>{};
+    if (kind != idl.AvailableDeclarationKind.CLASS)
+      _result["kind"] = kind.toString().split('.')[1];
+    if (name != '') _result["name"] = name;
+    return _result;
+  }
+
+  @override
+  Map<String, Object> toMap() => {
+        "kind": kind,
+        "name": name,
+      };
+
+  @override
+  String toString() => convert.json.encode(toJson());
+}
+
+class AvailableFileBuilder extends Object
+    with _AvailableFileMixin
+    implements idl.AvailableFile {
+  List<AvailableDeclarationBuilder> _declarations;
+  List<AvailableFileExportBuilder> _exports;
+  bool _isLibrary;
+  List<String> _parts;
+
+  @override
+  List<AvailableDeclarationBuilder> get declarations =>
+      _declarations ??= <AvailableDeclarationBuilder>[];
+
+  /// Declarations of the file.
+  void set declarations(List<AvailableDeclarationBuilder> value) {
+    this._declarations = value;
+  }
+
+  @override
+  List<AvailableFileExportBuilder> get exports =>
+      _exports ??= <AvailableFileExportBuilder>[];
+
+  /// Exports directives of the file.
+  void set exports(List<AvailableFileExportBuilder> value) {
+    this._exports = value;
+  }
+
+  @override
+  bool get isLibrary => _isLibrary ??= false;
+
+  /// Is `true` if this file is a library.
+  void set isLibrary(bool value) {
+    this._isLibrary = value;
+  }
+
+  @override
+  List<String> get parts => _parts ??= <String>[];
+
+  /// URIs of `part` directives.
+  void set parts(List<String> value) {
+    this._parts = value;
+  }
+
+  AvailableFileBuilder(
+      {List<AvailableDeclarationBuilder> declarations,
+      List<AvailableFileExportBuilder> exports,
+      bool isLibrary,
+      List<String> parts})
+      : _declarations = declarations,
+        _exports = exports,
+        _isLibrary = isLibrary,
+        _parts = parts;
+
+  /**
+   * Flush [informative] data recursively.
+   */
+  void flushInformative() {
+    _declarations?.forEach((b) => b.flushInformative());
+    _exports?.forEach((b) => b.flushInformative());
+  }
+
+  /**
+   * Accumulate non-[informative] data into [signature].
+   */
+  void collectApiSignature(api_sig.ApiSignature signature) {
+    signature.addBool(this._isLibrary == true);
+    if (this._exports == null) {
+      signature.addInt(0);
+    } else {
+      signature.addInt(this._exports.length);
+      for (var x in this._exports) {
+        x?.collectApiSignature(signature);
+      }
+    }
+    if (this._parts == null) {
+      signature.addInt(0);
+    } else {
+      signature.addInt(this._parts.length);
+      for (var x in this._parts) {
+        signature.addString(x);
+      }
+    }
+    if (this._declarations == null) {
+      signature.addInt(0);
+    } else {
+      signature.addInt(this._declarations.length);
+      for (var x in this._declarations) {
+        x?.collectApiSignature(signature);
+      }
+    }
+  }
+
+  List<int> toBuffer() {
+    fb.Builder fbBuilder = new fb.Builder();
+    return fbBuilder.finish(finish(fbBuilder), "UICF");
+  }
+
+  fb.Offset finish(fb.Builder fbBuilder) {
+    fb.Offset offset_declarations;
+    fb.Offset offset_exports;
+    fb.Offset offset_parts;
+    if (!(_declarations == null || _declarations.isEmpty)) {
+      offset_declarations = fbBuilder
+          .writeList(_declarations.map((b) => b.finish(fbBuilder)).toList());
+    }
+    if (!(_exports == null || _exports.isEmpty)) {
+      offset_exports = fbBuilder
+          .writeList(_exports.map((b) => b.finish(fbBuilder)).toList());
+    }
+    if (!(_parts == null || _parts.isEmpty)) {
+      offset_parts = fbBuilder
+          .writeList(_parts.map((b) => fbBuilder.writeString(b)).toList());
+    }
+    fbBuilder.startTable();
+    if (offset_declarations != null) {
+      fbBuilder.addOffset(3, offset_declarations);
+    }
+    if (offset_exports != null) {
+      fbBuilder.addOffset(1, offset_exports);
+    }
+    if (_isLibrary == true) {
+      fbBuilder.addBool(0, true);
+    }
+    if (offset_parts != null) {
+      fbBuilder.addOffset(2, offset_parts);
+    }
+    return fbBuilder.endTable();
+  }
+}
+
+idl.AvailableFile readAvailableFile(List<int> buffer) {
+  fb.BufferContext rootRef = new fb.BufferContext.fromBytes(buffer);
+  return const _AvailableFileReader().read(rootRef, 0);
+}
+
+class _AvailableFileReader extends fb.TableReader<_AvailableFileImpl> {
+  const _AvailableFileReader();
+
+  @override
+  _AvailableFileImpl createObject(fb.BufferContext bc, int offset) =>
+      new _AvailableFileImpl(bc, offset);
+}
+
+class _AvailableFileImpl extends Object
+    with _AvailableFileMixin
+    implements idl.AvailableFile {
+  final fb.BufferContext _bc;
+  final int _bcOffset;
+
+  _AvailableFileImpl(this._bc, this._bcOffset);
+
+  List<idl.AvailableDeclaration> _declarations;
+  List<idl.AvailableFileExport> _exports;
+  bool _isLibrary;
+  List<String> _parts;
+
+  @override
+  List<idl.AvailableDeclaration> get declarations {
+    _declarations ??= const fb.ListReader<idl.AvailableDeclaration>(
+            const _AvailableDeclarationReader())
+        .vTableGet(_bc, _bcOffset, 3, const <idl.AvailableDeclaration>[]);
+    return _declarations;
+  }
+
+  @override
+  List<idl.AvailableFileExport> get exports {
+    _exports ??= const fb.ListReader<idl.AvailableFileExport>(
+            const _AvailableFileExportReader())
+        .vTableGet(_bc, _bcOffset, 1, const <idl.AvailableFileExport>[]);
+    return _exports;
+  }
+
+  @override
+  bool get isLibrary {
+    _isLibrary ??= const fb.BoolReader().vTableGet(_bc, _bcOffset, 0, false);
+    return _isLibrary;
+  }
+
+  @override
+  List<String> get parts {
+    _parts ??= const fb.ListReader<String>(const fb.StringReader())
+        .vTableGet(_bc, _bcOffset, 2, const <String>[]);
+    return _parts;
+  }
+}
+
+abstract class _AvailableFileMixin implements idl.AvailableFile {
+  @override
+  Map<String, Object> toJson() {
+    Map<String, Object> _result = <String, Object>{};
+    if (declarations.isNotEmpty)
+      _result["declarations"] =
+          declarations.map((_value) => _value.toJson()).toList();
+    if (exports.isNotEmpty)
+      _result["exports"] = exports.map((_value) => _value.toJson()).toList();
+    if (isLibrary != false) _result["isLibrary"] = isLibrary;
+    if (parts.isNotEmpty) _result["parts"] = parts;
+    return _result;
+  }
+
+  @override
+  Map<String, Object> toMap() => {
+        "declarations": declarations,
+        "exports": exports,
+        "isLibrary": isLibrary,
+        "parts": parts,
+      };
+
+  @override
+  String toString() => convert.json.encode(toJson());
+}
+
+class AvailableFileExportBuilder extends Object
+    with _AvailableFileExportMixin
+    implements idl.AvailableFileExport {
+  List<AvailableFileExportCombinatorBuilder> _combinators;
+  String _uri;
+
+  @override
+  List<AvailableFileExportCombinatorBuilder> get combinators =>
+      _combinators ??= <AvailableFileExportCombinatorBuilder>[];
+
+  /// Combinators contained in this export directive.
+  void set combinators(List<AvailableFileExportCombinatorBuilder> value) {
+    this._combinators = value;
+  }
+
+  @override
+  String get uri => _uri ??= '';
+
+  /// URI of the exported library.
+  void set uri(String value) {
+    this._uri = value;
+  }
+
+  AvailableFileExportBuilder(
+      {List<AvailableFileExportCombinatorBuilder> combinators, String uri})
+      : _combinators = combinators,
+        _uri = uri;
+
+  /**
+   * Flush [informative] data recursively.
+   */
+  void flushInformative() {
+    _combinators?.forEach((b) => b.flushInformative());
+  }
+
+  /**
+   * Accumulate non-[informative] data into [signature].
+   */
+  void collectApiSignature(api_sig.ApiSignature signature) {
+    signature.addString(this._uri ?? '');
+    if (this._combinators == null) {
+      signature.addInt(0);
+    } else {
+      signature.addInt(this._combinators.length);
+      for (var x in this._combinators) {
+        x?.collectApiSignature(signature);
+      }
+    }
+  }
+
+  fb.Offset finish(fb.Builder fbBuilder) {
+    fb.Offset offset_combinators;
+    fb.Offset offset_uri;
+    if (!(_combinators == null || _combinators.isEmpty)) {
+      offset_combinators = fbBuilder
+          .writeList(_combinators.map((b) => b.finish(fbBuilder)).toList());
+    }
+    if (_uri != null) {
+      offset_uri = fbBuilder.writeString(_uri);
+    }
+    fbBuilder.startTable();
+    if (offset_combinators != null) {
+      fbBuilder.addOffset(1, offset_combinators);
+    }
+    if (offset_uri != null) {
+      fbBuilder.addOffset(0, offset_uri);
+    }
+    return fbBuilder.endTable();
+  }
+}
+
+class _AvailableFileExportReader
+    extends fb.TableReader<_AvailableFileExportImpl> {
+  const _AvailableFileExportReader();
+
+  @override
+  _AvailableFileExportImpl createObject(fb.BufferContext bc, int offset) =>
+      new _AvailableFileExportImpl(bc, offset);
+}
+
+class _AvailableFileExportImpl extends Object
+    with _AvailableFileExportMixin
+    implements idl.AvailableFileExport {
+  final fb.BufferContext _bc;
+  final int _bcOffset;
+
+  _AvailableFileExportImpl(this._bc, this._bcOffset);
+
+  List<idl.AvailableFileExportCombinator> _combinators;
+  String _uri;
+
+  @override
+  List<idl.AvailableFileExportCombinator> get combinators {
+    _combinators ??= const fb.ListReader<idl.AvailableFileExportCombinator>(
+            const _AvailableFileExportCombinatorReader())
+        .vTableGet(
+            _bc, _bcOffset, 1, const <idl.AvailableFileExportCombinator>[]);
+    return _combinators;
+  }
+
+  @override
+  String get uri {
+    _uri ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 0, '');
+    return _uri;
+  }
+}
+
+abstract class _AvailableFileExportMixin implements idl.AvailableFileExport {
+  @override
+  Map<String, Object> toJson() {
+    Map<String, Object> _result = <String, Object>{};
+    if (combinators.isNotEmpty)
+      _result["combinators"] =
+          combinators.map((_value) => _value.toJson()).toList();
+    if (uri != '') _result["uri"] = uri;
+    return _result;
+  }
+
+  @override
+  Map<String, Object> toMap() => {
+        "combinators": combinators,
+        "uri": uri,
+      };
+
+  @override
+  String toString() => convert.json.encode(toJson());
+}
+
+class AvailableFileExportCombinatorBuilder extends Object
+    with _AvailableFileExportCombinatorMixin
+    implements idl.AvailableFileExportCombinator {
+  List<String> _hides;
+  List<String> _shows;
+
+  @override
+  List<String> get hides => _hides ??= <String>[];
+
+  /// List of names which are hidden.  Empty if this is a `show` combinator.
+  void set hides(List<String> value) {
+    this._hides = value;
+  }
+
+  @override
+  List<String> get shows => _shows ??= <String>[];
+
+  /// List of names which are shown.  Empty if this is a `hide` combinator.
+  void set shows(List<String> value) {
+    this._shows = value;
+  }
+
+  AvailableFileExportCombinatorBuilder({List<String> hides, List<String> shows})
+      : _hides = hides,
+        _shows = shows;
+
+  /**
+   * Flush [informative] data recursively.
+   */
+  void flushInformative() {}
+
+  /**
+   * Accumulate non-[informative] data into [signature].
+   */
+  void collectApiSignature(api_sig.ApiSignature signature) {
+    if (this._shows == null) {
+      signature.addInt(0);
+    } else {
+      signature.addInt(this._shows.length);
+      for (var x in this._shows) {
+        signature.addString(x);
+      }
+    }
+    if (this._hides == null) {
+      signature.addInt(0);
+    } else {
+      signature.addInt(this._hides.length);
+      for (var x in this._hides) {
+        signature.addString(x);
+      }
+    }
+  }
+
+  fb.Offset finish(fb.Builder fbBuilder) {
+    fb.Offset offset_hides;
+    fb.Offset offset_shows;
+    if (!(_hides == null || _hides.isEmpty)) {
+      offset_hides = fbBuilder
+          .writeList(_hides.map((b) => fbBuilder.writeString(b)).toList());
+    }
+    if (!(_shows == null || _shows.isEmpty)) {
+      offset_shows = fbBuilder
+          .writeList(_shows.map((b) => fbBuilder.writeString(b)).toList());
+    }
+    fbBuilder.startTable();
+    if (offset_hides != null) {
+      fbBuilder.addOffset(1, offset_hides);
+    }
+    if (offset_shows != null) {
+      fbBuilder.addOffset(0, offset_shows);
+    }
+    return fbBuilder.endTable();
+  }
+}
+
+class _AvailableFileExportCombinatorReader
+    extends fb.TableReader<_AvailableFileExportCombinatorImpl> {
+  const _AvailableFileExportCombinatorReader();
+
+  @override
+  _AvailableFileExportCombinatorImpl createObject(
+          fb.BufferContext bc, int offset) =>
+      new _AvailableFileExportCombinatorImpl(bc, offset);
+}
+
+class _AvailableFileExportCombinatorImpl extends Object
+    with _AvailableFileExportCombinatorMixin
+    implements idl.AvailableFileExportCombinator {
+  final fb.BufferContext _bc;
+  final int _bcOffset;
+
+  _AvailableFileExportCombinatorImpl(this._bc, this._bcOffset);
+
+  List<String> _hides;
+  List<String> _shows;
+
+  @override
+  List<String> get hides {
+    _hides ??= const fb.ListReader<String>(const fb.StringReader())
+        .vTableGet(_bc, _bcOffset, 1, const <String>[]);
+    return _hides;
+  }
+
+  @override
+  List<String> get shows {
+    _shows ??= const fb.ListReader<String>(const fb.StringReader())
+        .vTableGet(_bc, _bcOffset, 0, const <String>[]);
+    return _shows;
+  }
+}
+
+abstract class _AvailableFileExportCombinatorMixin
+    implements idl.AvailableFileExportCombinator {
+  @override
+  Map<String, Object> toJson() {
+    Map<String, Object> _result = <String, Object>{};
+    if (hides.isNotEmpty) _result["hides"] = hides;
+    if (shows.isNotEmpty) _result["shows"] = shows;
+    return _result;
+  }
+
+  @override
+  Map<String, Object> toMap() => {
+        "hides": hides,
+        "shows": shows,
+      };
+
+  @override
+  String toString() => convert.json.encode(toJson());
+}
+
 class CodeRangeBuilder extends Object
     with _CodeRangeMixin
     implements idl.CodeRange {
diff --git a/pkg/analyzer/lib/src/summary/format.fbs b/pkg/analyzer/lib/src/summary/format.fbs
index 5d328ce..25a04e6 100644
--- a/pkg/analyzer/lib/src/summary/format.fbs
+++ b/pkg/analyzer/lib/src/summary/format.fbs
@@ -6,6 +6,23 @@
 // To regenerate the file, use the script "pkg/analyzer/tool/generate_files".
 
 
+/// Enum of declaration kinds in available files.
+enum AvailableDeclarationKind : byte {
+  CLASS,
+
+  CLASS_TYPE_ALIAS,
+
+  ENUM,
+
+  FUNCTION,
+
+  FUNCTION_TYPE_ALIAS,
+
+  MIXIN,
+
+  VARIABLE
+}
+
 /// Enum used to indicate the kind of an entity reference.
 enum EntityRefKind : byte {
   /// The entity represents a named type.
@@ -845,6 +862,48 @@
   unit:UnlinkedUnit (id: 1);
 }
 
+/// Information about a single declaration.
+table AvailableDeclaration {
+  /// The kind of the declaration.
+  kind:AvailableDeclarationKind (id: 1);
+
+  /// The name of the declaration.
+  name:string (id: 0);
+}
+
+/// Information about an available, even if not yet imported file.
+table AvailableFile {
+  /// Declarations of the file.
+  declarations:[AvailableDeclaration] (id: 3);
+
+  /// Exports directives of the file.
+  exports:[AvailableFileExport] (id: 1);
+
+  /// Is `true` if this file is a library.
+  isLibrary:bool (id: 0);
+
+  /// URIs of `part` directives.
+  parts:[string] (id: 2);
+}
+
+/// Information about an export directive.
+table AvailableFileExport {
+  /// Combinators contained in this export directive.
+  combinators:[AvailableFileExportCombinator] (id: 1);
+
+  /// URI of the exported library.
+  uri:string (id: 0);
+}
+
+/// Information about a `show` or `hide` combinator in an export directive.
+table AvailableFileExportCombinator {
+  /// List of names which are hidden.  Empty if this is a `show` combinator.
+  hides:[string] (id: 1);
+
+  /// List of names which are shown.  Empty if this is a `hide` combinator.
+  shows:[string] (id: 0);
+}
+
 /// Information about an element code range.
 table CodeRange {
   /// Length of the element code.
diff --git a/pkg/analyzer/lib/src/summary/idl.dart b/pkg/analyzer/lib/src/summary/idl.dart
index d3dff59..e997afb 100644
--- a/pkg/analyzer/lib/src/summary/idl.dart
+++ b/pkg/analyzer/lib/src/summary/idl.dart
@@ -283,6 +283,73 @@
   UnlinkedUnit get unit;
 }
 
+/// Information about a single declaration.
+abstract class AvailableDeclaration extends base.SummaryClass {
+  /// The kind of the declaration.
+  @Id(1)
+  AvailableDeclarationKind get kind;
+
+  /// The name of the declaration.
+  @Id(0)
+  String get name;
+}
+
+/// Enum of declaration kinds in available files.
+enum AvailableDeclarationKind {
+  CLASS,
+  CLASS_TYPE_ALIAS,
+  ENUM,
+  FUNCTION,
+  FUNCTION_TYPE_ALIAS,
+  MIXIN,
+  VARIABLE
+}
+
+/// Information about an available, even if not yet imported file.
+@TopLevel('UICF')
+abstract class AvailableFile extends base.SummaryClass {
+  factory AvailableFile.fromBuffer(List<int> buffer) =>
+      generated.readAvailableFile(buffer);
+
+  /// Declarations of the file.
+  @Id(3)
+  List<AvailableDeclaration> get declarations;
+
+  /// Exports directives of the file.
+  @Id(1)
+  List<AvailableFileExport> get exports;
+
+  /// Is `true` if this file is a library.
+  @Id(0)
+  bool get isLibrary;
+
+  /// URIs of `part` directives.
+  @Id(2)
+  List<String> get parts;
+}
+
+/// Information about an export directive.
+abstract class AvailableFileExport extends base.SummaryClass {
+  /// Combinators contained in this export directive.
+  @Id(1)
+  List<AvailableFileExportCombinator> get combinators;
+
+  /// URI of the exported library.
+  @Id(0)
+  String get uri;
+}
+
+/// Information about a `show` or `hide` combinator in an export directive.
+abstract class AvailableFileExportCombinator extends base.SummaryClass {
+  /// List of names which are hidden.  Empty if this is a `show` combinator.
+  @Id(1)
+  List<String> get hides;
+
+  /// List of names which are shown.  Empty if this is a `hide` combinator.
+  @Id(0)
+  List<String> get shows;
+}
+
 /// Information about an element code range.
 abstract class CodeRange extends base.SummaryClass {
   /// Length of the element code.
diff --git a/pkg/analyzer/lib/src/summary/summarize_ast.dart b/pkg/analyzer/lib/src/summary/summarize_ast.dart
index df89a01..1f05586 100644
--- a/pkg/analyzer/lib/src/summary/summarize_ast.dart
+++ b/pkg/analyzer/lib/src/summary/summarize_ast.dart
@@ -817,7 +817,7 @@
     } else if (node.isNamed) {
       b.kind = UnlinkedParamKind.named;
     } else {
-      // ignore: deprecated_member_use
+      // ignore: deprecated_member_use_from_same_package
       throw new StateError('Unexpected parameter kind: ${node.kind}');
     }
     return b;
diff --git a/pkg/analyzer/lib/src/task/api/dart.dart b/pkg/analyzer/lib/src/task/api/dart.dart
index d8f28ff..f1f19e6 100644
--- a/pkg/analyzer/lib/src/task/api/dart.dart
+++ b/pkg/analyzer/lib/src/task/api/dart.dart
@@ -140,10 +140,6 @@
  * change if a single part is included in more than one library.
  */
 class LibrarySpecificUnit implements AnalysisTarget {
-  @deprecated
-  static const List<LibrarySpecificUnit> EMPTY_LIST =
-      const <LibrarySpecificUnit>[];
-
   /**
    * The defining compilation unit of the library in which the [unit]
    * is analyzed.
diff --git a/pkg/analyzer/lib/src/task/api/model.dart b/pkg/analyzer/lib/src/task/api/model.dart
index fbfadff..fe0edef 100644
--- a/pkg/analyzer/lib/src/task/api/model.dart
+++ b/pkg/analyzer/lib/src/task/api/model.dart
@@ -526,12 +526,6 @@
  */
 class TargetedResult {
   /**
-   * An empty list of results.
-   */
-  @deprecated
-  static final List<TargetedResult> EMPTY_LIST = const <TargetedResult>[];
-
-  /**
    * The target with which the result is associated.
    */
   final AnalysisTarget target;
diff --git a/pkg/analyzer/lib/src/task/driver.dart b/pkg/analyzer/lib/src/task/driver.dart
index 66eba45..c7f12e2 100644
--- a/pkg/analyzer/lib/src/task/driver.dart
+++ b/pkg/analyzer/lib/src/task/driver.dart
@@ -178,7 +178,7 @@
     }
     try {
       WorkItem workItem =
-          new WorkItem(context, target, taskDescriptor, result, 0, null);
+          new WorkItem._(context, target, taskDescriptor, result, 0, null);
       return new WorkOrder(taskManager, workItem);
     } catch (exception, stackTrace) {
       throw new AnalysisException(
@@ -645,8 +645,9 @@
    * Initialize a newly created work item to compute the inputs for the task
    * described by the given descriptor.
    */
-  WorkItem(this.context, this.target, this.descriptor, this.spawningResult,
+  WorkItem._(this.context, this.target, this.descriptor, this.spawningResult,
       this.level, this.workOrder) {
+    _checkInternalUseOfTaskModel();
     AnalysisTarget actualTarget =
         identical(target, AnalysisContextTarget.request)
             ? new AnalysisContextTarget(context)
@@ -762,8 +763,8 @@
               // inputs.
               builder.currentValueNotAvailable();
             } else {
-              return new WorkItem(context, inputTarget, descriptor, inputResult,
-                  level + 1, workOrder);
+              return new WorkItem._(context, inputTarget, descriptor,
+                  inputResult, level + 1, workOrder);
             }
           } on AnalysisException catch (exception, stackTrace) {
             this.exception = new CaughtException(exception, stackTrace);
@@ -791,6 +792,13 @@
 
   @override
   String toString() => 'Run $descriptor on $target';
+
+  static void _checkInternalUseOfTaskModel() {
+    if (!StackTrace.current.toString().contains('/analyzer/test/')) {
+      throw new StateError(
+          'The analyzer task model is no longer supported.  Please use the AnalysisSession API.');
+    }
+  }
 }
 
 /**
diff --git a/pkg/analyzer/lib/src/task/html.dart b/pkg/analyzer/lib/src/task/html.dart
index c72d99f..502db66 100644
--- a/pkg/analyzer/lib/src/task/html.dart
+++ b/pkg/analyzer/lib/src/task/html.dart
@@ -37,12 +37,6 @@
  */
 class DartScript implements Source {
   /**
-   * An empty list of scripts.
-   */
-  @deprecated
-  static final List<DartScript> EMPTY_LIST = const <DartScript>[];
-
-  /**
    * The source containing this script.
    */
   final Source source;
diff --git a/pkg/analyzer/lib/src/task/strong/checker.dart b/pkg/analyzer/lib/src/task/strong/checker.dart
index 3583fb3..c3f3647 100644
--- a/pkg/analyzer/lib/src/task/strong/checker.dart
+++ b/pkg/analyzer/lib/src/task/strong/checker.dart
@@ -579,6 +579,30 @@
   }
 
   @override
+  void visitSetLiteral(SetLiteral node) {
+    DartType type = DynamicTypeImpl.instance;
+    if (node.typeArguments != null) {
+      NodeList<TypeAnnotation> targs = node.typeArguments.arguments;
+      if (targs.length > 0) {
+        type = targs[0].type;
+      }
+    } else {
+      DartType staticType = node.staticType;
+      if (staticType is InterfaceType) {
+        List<DartType> typeArguments = staticType.typeArguments;
+        if (typeArguments != null && typeArguments.length > 0) {
+          type = typeArguments[0];
+        }
+      }
+    }
+    NodeList<Expression> elements = node.elements;
+    for (int i = 0; i < elements.length; i++) {
+      checkArgument(elements[i], type);
+    }
+    super.visitSetLiteral(node);
+  }
+
+  @override
   void visitSuperConstructorInvocation(SuperConstructorInvocation node) {
     var element = node.staticElement;
     if (element != null) {
diff --git a/pkg/analyzer/lib/src/test_utilities/mock_sdk.dart b/pkg/analyzer/lib/src/test_utilities/mock_sdk.dart
index b68d13e..7420ee9 100644
--- a/pkg/analyzer/lib/src/test_utilities/mock_sdk.dart
+++ b/pkg/analyzer/lib/src/test_utilities/mock_sdk.dart
@@ -435,6 +435,7 @@
 external double cos(num radians);
 external double sin(num radians);
 external double sqrt(num radians);
+external double tan(num radians);
 class Random {
   bool nextBool() => true;
   double nextDouble() => 2.0;
diff --git a/pkg/analyzer/lib/src/workspace/basic.dart b/pkg/analyzer/lib/src/workspace/basic.dart
index 89b270f..0b177f0 100644
--- a/pkg/analyzer/lib/src/workspace/basic.dart
+++ b/pkg/analyzer/lib/src/workspace/basic.dart
@@ -4,10 +4,6 @@
 
 import 'package:analyzer/file_system/file_system.dart';
 import 'package:analyzer/src/context/builder.dart';
-import 'package:analyzer/src/generated/sdk.dart';
-import 'package:analyzer/src/generated/source.dart';
-import 'package:analyzer/src/source/package_map_resolver.dart';
-import 'package:analyzer/src/summary/package_bundle_reader.dart';
 import 'package:analyzer/src/workspace/simple.dart';
 import 'package:analyzer/src/workspace/workspace.dart';
 import 'package:package_config/packages.dart';
diff --git a/pkg/analyzer/lib/src/workspace/package_build.dart b/pkg/analyzer/lib/src/workspace/package_build.dart
index d33e17a..c5c74673 100644
--- a/pkg/analyzer/lib/src/workspace/package_build.dart
+++ b/pkg/analyzer/lib/src/workspace/package_build.dart
@@ -37,6 +37,10 @@
       return null;
     }
     String filePath = fileUriToNormalizedPath(provider.pathContext, uri);
+    Resource resource = provider.getResource(filePath);
+    if (resource is! File) {
+      return null;
+    }
     File file = workspace.findFile(filePath);
     if (file != null) {
       return file.createSource(actualUri ?? uri);
@@ -213,8 +217,8 @@
       return null;
     }
     path.Context context = provider.pathContext;
-    String fullBuiltPath = context.join(
-        root, _dartToolRootName, 'build', 'generated', packageName, builtPath);
+    String fullBuiltPath = context.normalize(context.join(
+        root, _dartToolRootName, 'build', 'generated', packageName, builtPath));
     return provider.getFile(fullBuiltPath);
   }
 
@@ -247,18 +251,19 @@
   }
 
   /**
-   * Return the file with the given [filePath], looking first into directories for
-   * source files, and then in the generated directory
-   * `.dart_tool/build/generated/$projectPackageName/$FILE`. The file in the
-   * workspace root is returned even if it does not exist. Return `null` if the
-   * given [filePath] is not in the workspace [root].
+   * Return the file with the given [filePath], looking first in the generated
+   * directory `.dart_tool/build/generated/$projectPackageName/`, then in
+   * source directories.
+   *
+   * The file in the workspace [root] is returned even if it does not exist.
+   * Return `null` if the given [filePath] is not in the workspace root.
    */
   File findFile(String filePath) {
     path.Context context = provider.pathContext;
     assert(context.isAbsolute(filePath), 'Not an absolute path: $filePath');
     try {
-      final String builtPath = context.relative(filePath, from: root);
-      final File file = builtFile(builtPath, projectPackageName);
+      final String relativePath = context.relative(filePath, from: root);
+      final File file = builtFile(relativePath, projectPackageName);
 
       if (file.exists) {
         return file;
@@ -332,10 +337,11 @@
   PackageBuildWorkspacePackage(this.root, this.workspace);
 
   @override
-  bool contains(String path) {
+  bool contains(String filePath) {
     // There is a 1-1 relationship between PackageBuildWorkspaces and
     // PackageBuildWorkspacePackages. If a file is in a package's workspace,
     // then it is in the package as well.
-    return workspace.findFile(path) != null;
+    return workspace.provider.pathContext.isWithin(workspace.root, filePath) &&
+        workspace.findFile(filePath) != null;
   }
 }
diff --git a/pkg/analyzer/lib/src/workspace/pub.dart b/pkg/analyzer/lib/src/workspace/pub.dart
index f89937c..3cfbe59 100644
--- a/pkg/analyzer/lib/src/workspace/pub.dart
+++ b/pkg/analyzer/lib/src/workspace/pub.dart
@@ -4,10 +4,6 @@
 
 import 'package:analyzer/file_system/file_system.dart';
 import 'package:analyzer/src/context/builder.dart';
-import 'package:analyzer/src/generated/sdk.dart';
-import 'package:analyzer/src/generated/source.dart';
-import 'package:analyzer/src/source/package_map_resolver.dart';
-import 'package:analyzer/src/summary/package_bundle_reader.dart';
 import 'package:analyzer/src/workspace/simple.dart';
 import 'package:analyzer/src/workspace/workspace.dart';
 import 'package:package_config/packages.dart';
diff --git a/pkg/analyzer/pubspec.yaml b/pkg/analyzer/pubspec.yaml
index 33c10f2..053be37 100644
--- a/pkg/analyzer/pubspec.yaml
+++ b/pkg/analyzer/pubspec.yaml
@@ -1,5 +1,5 @@
 name: analyzer
-version: 0.34.2-dev
+version: 0.35.0-dev
 author: Dart Team <misc@dartlang.org>
 description: Static analyzer for Dart.
 homepage: https://github.com/dart-lang/sdk/tree/master/pkg/analyzer
@@ -11,10 +11,10 @@
   collection: ^1.10.1
   convert: ^2.0.0
   crypto: '>=1.1.1 <3.0.0'
-  front_end: 0.1.8
+  front_end: 0.1.9
   glob: ^1.0.3
   html: '>=0.12.0 <1.14.0'
-  kernel: 0.3.8
+  kernel: 0.3.9
   meta: ^1.0.2
   package_config: '>=0.1.5 <2.0.0'
   path: '>=0.9.0 <2.0.0'
diff --git a/pkg/analyzer/test/generated/all_the_rest_test.dart b/pkg/analyzer/test/generated/all_the_rest_test.dart
index 0c87fa9..a759002 100644
--- a/pkg/analyzer/test/generated/all_the_rest_test.dart
+++ b/pkg/analyzer/test/generated/all_the_rest_test.dart
@@ -45,7 +45,7 @@
 main() {
   defineReflectiveSuite(() {
     defineReflectiveTests(ContentCacheTest);
-    // ignore: deprecated_member_use
+    // ignore: deprecated_member_use_from_same_package
     defineReflectiveTests(CustomUriResolverTest);
     defineReflectiveTests(DartUriResolverTest);
     defineReflectiveTests(ElementLocatorTest);
@@ -57,7 +57,7 @@
     defineReflectiveTests(ExitDetectorTest2);
     defineReflectiveTests(FileBasedSourceTest);
     defineReflectiveTests(ResolveRelativeUriTest);
-    // ignore: deprecated_member_use
+    // ignore: deprecated_member_use_from_same_package
     defineReflectiveTests(SDKLibrariesReaderTest);
     defineReflectiveTests(UriKindTest);
   });
@@ -165,6 +165,8 @@
   }
 }
 
+/// TODO(paulberry): migrate this test away from the task model.
+/// See dartbug.com/35734.
 @reflectiveTest
 class ElementLocatorTest extends ResolverTestCase {
   void fail_locate_Identifier_partOfDirective() {
@@ -734,6 +736,8 @@
   }
 }
 
+/// TODO(paulberry): migrate this test away from the task model.
+/// See dartbug.com/35734.
 @reflectiveTest
 class ErrorReporterTest2 extends ResolverTestCase {
   test_reportTypeErrorForNode_sameName_functionType() async {
@@ -1563,6 +1567,8 @@
  * Tests for the [ExitDetector] that require that the AST be resolved.
  *
  * See [ExitDetectorTest] for tests that do not require the AST to be resolved.
+ * TODO(paulberry): migrate this test away from the task model.
+ * See dartbug.com/35734.
  */
 @reflectiveTest
 class ExitDetectorTest2 extends ResolverTestCase {
diff --git a/pkg/analyzer/test/generated/checked_mode_compile_time_error_code.dart b/pkg/analyzer/test/generated/checked_mode_compile_time_error_code.dart
new file mode 100644
index 0000000..a666f7a
--- /dev/null
+++ b/pkg/analyzer/test/generated/checked_mode_compile_time_error_code.dart
@@ -0,0 +1,683 @@
+// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:analyzer/src/error/codes.dart';
+import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/generated/source_io.dart';
+
+import 'resolver_test_case.dart';
+
+abstract class CheckedModeCompileTimeErrorCodeTest extends ResolverTestCase {
+  @override
+  AnalysisOptions get defaultAnalysisOptions => new AnalysisOptionsImpl();
+
+  test_assertion_throws() async {
+    Source source = addSource(r'''
+class A {
+  const A(int x, int y) : assert(x < y);
+}
+var v = const A(3, 2);
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION]);
+    verify([source]);
+  }
+
+  test_fieldFormalParameterAssignableToField_extends() async {
+    // According to checked-mode type checking rules, a value of type B is
+    // assignable to a field of type A, because B extends A (and hence is a
+    // subtype of A).
+    Source source = addSource(r'''
+class A {
+  const A();
+}
+class B extends A {
+  const B();
+}
+class C {
+  final A a;
+  const C(this.a);
+}
+var v = const C(const B());''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_fieldFormalParameterAssignableToField_fieldType_unresolved_null() async {
+    // Null always passes runtime type checks, even when the type is
+    // unresolved.
+    Source source = addSource(r'''
+class A {
+  final Unresolved x;
+  const A(String this.x);
+}
+var v = const A(null);''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [StaticWarningCode.UNDEFINED_CLASS]);
+    verify([source]);
+  }
+
+  test_fieldFormalParameterAssignableToField_implements() async {
+    // According to checked-mode type checking rules, a value of type B is
+    // assignable to a field of type A, because B implements A (and hence is a
+    // subtype of A).
+    Source source = addSource(r'''
+class A {}
+class B implements A {
+  const B();
+}
+class C {
+  final A a;
+  const C(this.a);
+}
+var v = const C(const B());''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_fieldFormalParameterAssignableToField_list_dynamic() async {
+    // [1, 2, 3] has type List<dynamic>, which is a subtype of List<int>.
+    Source source = addSource(r'''
+class A {
+  const A(List<int> x);
+}
+var x = const A(const [1, 2, 3]);''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_fieldFormalParameterAssignableToField_list_nonDynamic() async {
+    // <int>[1, 2, 3] has type List<int>, which is a subtype of List<num>.
+    Source source = addSource(r'''
+class A {
+  const A(List<num> x);
+}
+var x = const A(const <int>[1, 2, 3]);''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_fieldFormalParameterAssignableToField_map_dynamic() async {
+    // {1: 2} has type Map<dynamic, dynamic>, which is a subtype of
+    // Map<int, int>.
+    Source source = addSource(r'''
+class A {
+  const A(Map<int, int> x);
+}
+var x = const A(const {1: 2});''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_fieldFormalParameterAssignableToField_map_keyDifferent() async {
+    // <int, int>{1: 2} has type Map<int, int>, which is a subtype of
+    // Map<num, int>.
+    Source source = addSource(r'''
+class A {
+  const A(Map<num, int> x);
+}
+var x = const A(const <int, int>{1: 2});''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_fieldFormalParameterAssignableToField_map_valueDifferent() async {
+    // <int, int>{1: 2} has type Map<int, int>, which is a subtype of
+    // Map<int, num>.
+    Source source = addSource(r'''
+class A {
+  const A(Map<int, num> x);
+}
+var x = const A(const <int, int>{1: 2});''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_fieldFormalParameterAssignableToField_notype() async {
+    // If a field is declared without a type, then any value may be assigned to
+    // it.
+    Source source = addSource(r'''
+class A {
+  final x;
+  const A(this.x);
+}
+var v = const A(5);''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_fieldFormalParameterAssignableToField_null() async {
+    // Null is assignable to anything.
+    Source source = addSource(r'''
+class A {
+  final int x;
+  const A(this.x);
+}
+var v = const A(null);''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_fieldFormalParameterAssignableToField_typedef() async {
+    // foo has the runtime type dynamic -> dynamic, so it is not assignable
+    // to A.f.
+    Source source = addSource(r'''
+typedef String Int2String(int x);
+class A {
+  final Int2String f;
+  const A(this.f);
+}
+foo(x) => 1;
+var v = const A(foo);''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE]);
+    verify([source]);
+  }
+
+  test_fieldFormalParameterAssignableToField_typeSubstitution() async {
+    // foo has the runtime type dynamic -> dynamic, so it should be assignable
+    // to A.f.
+    Source source = addSource(r'''
+class A<T> {
+  final T x;
+  const A(this.x);
+}
+var v = const A<int>(3);''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_fieldFormalParameterNotAssignableToField() async {
+    Source source = addSource(r'''
+class A {
+  final int x;
+  const A(this.x);
+}
+var v = const A('foo');''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH,
+      StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE
+    ]);
+    verify([source]);
+  }
+
+  test_fieldFormalParameterNotAssignableToField_extends() async {
+    // According to checked-mode type checking rules, a value of type A is not
+    // assignable to a field of type B, because B extends A (the subtyping
+    // relationship is in the wrong direction).
+    Source source = addSource(r'''
+class A {
+  const A();
+}
+class B extends A {
+  const B();
+}
+class C {
+  final B b;
+  const C(this.b);
+}
+const A u = const A();
+var v = const C(u);''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH
+    ]);
+    verify([source]);
+  }
+
+  test_fieldFormalParameterNotAssignableToField_fieldType() async {
+    Source source = addSource(r'''
+class A {
+  final int x;
+  const A(this.x);
+}
+var v = const A('foo');''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH,
+      StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE
+    ]);
+    verify([source]);
+  }
+
+  test_fieldFormalParameterNotAssignableToField_fieldType_unresolved() async {
+    Source source = addSource(r'''
+class A {
+  final Unresolved x;
+  const A(String this.x);
+}
+var v = const A('foo');''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH,
+      StaticWarningCode.UNDEFINED_CLASS
+    ]);
+    verify([source]);
+  }
+
+  test_fieldFormalParameterNotAssignableToField_implements() async {
+    // According to checked-mode type checking rules, a value of type A is not
+    // assignable to a field of type B, because B implements A (the subtyping
+    // relationship is in the wrong direction).
+    Source source = addSource(r'''
+class A {
+  const A();
+}
+class B implements A {}
+class C {
+  final B b;
+  const C(this.b);
+}
+const A u = const A();
+var v = const C(u);''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH
+    ]);
+    verify([source]);
+  }
+
+  test_fieldFormalParameterNotAssignableToField_list() async {
+    // <num>[1, 2, 3] has type List<num>, which is not a subtype of List<int>.
+    Source source = addSource(r'''
+class A {
+  const A(List<int> x);
+}
+const dynamic w = const <num>[1, 2, 3];
+var x = const A(w);''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH
+    ]);
+    verify([source]);
+  }
+
+  test_fieldFormalParameterNotAssignableToField_map_keyMismatch() async {
+    // <num, int>{1: 2} has type Map<num, int>, which is not a subtype of
+    // Map<int, int>.
+    Source source = addSource(r'''
+class A {
+  const A(Map<int, int> x);
+}
+const dynamic w = const <num, int>{1: 2};
+var x = const A(w);''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH
+    ]);
+    verify([source]);
+  }
+
+  test_fieldFormalParameterNotAssignableToField_map_valueMismatch() async {
+    // <int, num>{1: 2} has type Map<int, num>, which is not a subtype of
+    // Map<int, int>.
+    Source source = addSource(r'''
+class A {
+  const A(Map<int, int> x);
+}
+const dynamic w = const <int, num>{1: 2};
+var x = const A(w);''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH
+    ]);
+    verify([source]);
+  }
+
+  test_fieldFormalParameterNotAssignableToField_optional() async {
+    Source source = addSource(r'''
+class A {
+  final int x;
+  const A([this.x = 'foo']);
+}
+var v = const A();''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH,
+      StaticTypeWarningCode.INVALID_ASSIGNMENT
+    ]);
+    verify([source]);
+  }
+
+  test_fieldFormalParameterNotAssignableToField_typedef() async {
+    // foo has the runtime type String -> int, so it should not be assignable
+    // to A.f (A.f requires it to be int -> String).
+    Source source = addSource(r'''
+typedef String Int2String(int x);
+class A {
+  final Int2String f;
+  const A(this.f);
+}
+int foo(String x) => 1;
+var v = const A(foo);''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH,
+      StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE
+    ]);
+    verify([source]);
+  }
+
+  test_fieldInitializerNotAssignable() async {
+    Source source = addSource(r'''
+class A {
+  final int x;
+  const A() : x = '';
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CheckedModeCompileTimeErrorCode.CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE,
+      StaticWarningCode.FIELD_INITIALIZER_NOT_ASSIGNABLE
+    ]);
+    verify([source]);
+  }
+
+  test_fieldTypeMismatch() async {
+    Source source = addSource(r'''
+class A {
+  const A(x) : y = x;
+  final int y;
+}
+var v = const A('foo');''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_FIELD_TYPE_MISMATCH
+    ]);
+    verify([source]);
+  }
+
+  test_fieldTypeMismatch_generic() async {
+    Source source = addSource(r'''
+class C<T> {
+  final T x = y;
+  const C();
+}
+const int y = 1;
+var v = const C<String>();
+''');
+    await computeAnalysisResult(source);
+    assertErrors(
+      source,
+      [
+        CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_FIELD_TYPE_MISMATCH,
+        StaticTypeWarningCode.INVALID_ASSIGNMENT
+      ],
+    );
+    verify([source]);
+  }
+
+  test_fieldTypeMismatch_unresolved() async {
+    Source source = addSource(r'''
+class A {
+  const A(x) : y = x;
+  final Unresolved y;
+}
+var v = const A('foo');''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_FIELD_TYPE_MISMATCH,
+      StaticWarningCode.UNDEFINED_CLASS
+    ]);
+    verify([source]);
+  }
+
+  test_fieldTypeOk_generic() async {
+    Source source = addSource(r'''
+class C<T> {
+  final T x = y;
+  const C();
+}
+const int y = 1;
+var v = const C<int>();
+''');
+    await computeAnalysisResult(source);
+    assertErrors(
+      source,
+      [StaticTypeWarningCode.INVALID_ASSIGNMENT],
+    );
+    verify([source]);
+  }
+
+  test_fieldTypeOk_null() async {
+    Source source = addSource(r'''
+class A {
+  const A(x) : y = x;
+  final int y;
+}
+var v = const A(null);''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_fieldTypeOk_unresolved_null() async {
+    // Null always passes runtime type checks, even when the type is
+    // unresolved.
+    Source source = addSource(r'''
+class A {
+  const A(x) : y = x;
+  final Unresolved y;
+}
+var v = const A(null);''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [StaticWarningCode.UNDEFINED_CLASS]);
+    verify([source]);
+  }
+
+  test_listElementTypeNotAssignable() async {
+    Source source = addSource("var v = const <String> [42];");
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CheckedModeCompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE,
+      StaticWarningCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE
+    ]);
+    verify([source]);
+  }
+
+  test_listLiteral_inferredElementType() async {
+    Source source = addSource('''
+const Object x = [1];
+const List<String> y = x;
+''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CheckedModeCompileTimeErrorCode.VARIABLE_TYPE_MISMATCH]);
+    verify([source]);
+  }
+
+  test_mapKeyTypeNotAssignable() async {
+    Source source = addSource("var v = const <String, int > {1 : 2};");
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CheckedModeCompileTimeErrorCode.MAP_KEY_TYPE_NOT_ASSIGNABLE,
+      StaticWarningCode.MAP_KEY_TYPE_NOT_ASSIGNABLE
+    ]);
+    verify([source]);
+  }
+
+  test_mapLiteral_inferredKeyType() async {
+    Source source = addSource('''
+const Object x = {1: 1};
+const Map<String, dynamic> y = x;
+''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CheckedModeCompileTimeErrorCode.VARIABLE_TYPE_MISMATCH]);
+    verify([source]);
+  }
+
+  test_mapLiteral_inferredValueType() async {
+    Source source = addSource('''
+const Object x = {1: 1};
+const Map<dynamic, String> y = x;
+''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CheckedModeCompileTimeErrorCode.VARIABLE_TYPE_MISMATCH]);
+    verify([source]);
+  }
+
+  test_mapValueTypeNotAssignable() async {
+    Source source = addSource("var v = const <String, String> {'a' : 2};");
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CheckedModeCompileTimeErrorCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE,
+      StaticWarningCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE
+    ]);
+    verify([source]);
+  }
+
+  test_parameterAssignable_null() async {
+    // Null is assignable to anything.
+    Source source = addSource(r'''
+class A {
+  const A(int x);
+}
+var v = const A(null);''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_parameterAssignable_typeSubstitution() async {
+    Source source = addSource(r'''
+class A<T> {
+  const A(T x);
+}
+var v = const A<int>(3);''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_parameterAssignable_undefined_null() async {
+    // Null always passes runtime type checks, even when the type is
+    // unresolved.
+    Source source = addSource(r'''
+class A {
+  const A(Unresolved x);
+}
+var v = const A(null);''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [StaticWarningCode.UNDEFINED_CLASS]);
+    verify([source]);
+  }
+
+  test_parameterNotAssignable() async {
+    Source source = addSource(r'''
+class A {
+  const A(int x);
+}
+var v = const A('foo');''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH,
+      StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE
+    ]);
+    verify([source]);
+  }
+
+  test_parameterNotAssignable_typeSubstitution() async {
+    Source source = addSource(r'''
+class A<T> {
+  const A(T x);
+}
+var v = const A<int>('foo');''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH,
+      StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE
+    ]);
+    verify([source]);
+  }
+
+  test_parameterNotAssignable_undefined() async {
+    Source source = addSource(r'''
+class A {
+  const A(Unresolved x);
+}
+var v = const A('foo');''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH,
+      StaticWarningCode.UNDEFINED_CLASS
+    ]);
+    verify([source]);
+  }
+
+  test_redirectingConstructor_paramTypeMismatch() async {
+    Source source = addSource(r'''
+class A {
+  const A.a1(x) : this.a2(x);
+  const A.a2(String x);
+}
+var v = const A.a1(0);''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION]);
+    verify([source]);
+  }
+
+  test_superConstructor_paramTypeMismatch() async {
+    Source source = addSource(r'''
+class C {
+  final double d;
+  const C(this.d);
+}
+class D extends C {
+  const D(d) : super(d);
+}
+const f = const D('0.0');
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION]);
+    verify([source]);
+  }
+
+  test_topLevelVarAssignable_null() async {
+    Source source = addSource("const int x = null;");
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_topLevelVarAssignable_undefined_null() async {
+    // Null always passes runtime type checks, even when the type is
+    // unresolved.
+    Source source = addSource("const Unresolved x = null;");
+    await computeAnalysisResult(source);
+    assertErrors(source, [StaticWarningCode.UNDEFINED_CLASS]);
+    verify([source]);
+  }
+
+  test_topLevelVarNotAssignable() async {
+    Source source = addSource("const int x = 'foo';");
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CheckedModeCompileTimeErrorCode.VARIABLE_TYPE_MISMATCH,
+      StaticTypeWarningCode.INVALID_ASSIGNMENT
+    ]);
+    verify([source]);
+  }
+
+  test_topLevelVarNotAssignable_undefined() async {
+    Source source = addSource("const Unresolved x = 'foo';");
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CheckedModeCompileTimeErrorCode.VARIABLE_TYPE_MISMATCH,
+      StaticWarningCode.UNDEFINED_CLASS
+    ]);
+    verify([source]);
+  }
+}
diff --git a/pkg/analyzer/test/generated/checked_mode_compile_time_error_code_driver_test.dart b/pkg/analyzer/test/generated/checked_mode_compile_time_error_code_driver_test.dart
index 2a3d968..f8d85f2 100644
--- a/pkg/analyzer/test/generated/checked_mode_compile_time_error_code_driver_test.dart
+++ b/pkg/analyzer/test/generated/checked_mode_compile_time_error_code_driver_test.dart
@@ -7,7 +7,7 @@
 import 'package:analyzer/src/generated/source.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import 'checked_mode_compile_time_error_code_test.dart';
+import 'checked_mode_compile_time_error_code.dart';
 import 'resolver_test_case.dart';
 
 main() {
diff --git a/pkg/analyzer/test/generated/checked_mode_compile_time_error_code_test.dart b/pkg/analyzer/test/generated/checked_mode_compile_time_error_code_test.dart
deleted file mode 100644
index 6bfb23d..0000000
--- a/pkg/analyzer/test/generated/checked_mode_compile_time_error_code_test.dart
+++ /dev/null
@@ -1,691 +0,0 @@
-// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'package:analyzer/src/error/codes.dart';
-import 'package:analyzer/src/generated/engine.dart';
-import 'package:analyzer/src/generated/source_io.dart';
-import 'package:test_reflective_loader/test_reflective_loader.dart';
-
-import 'resolver_test_case.dart';
-
-main() {
-  defineReflectiveSuite(() {
-    defineReflectiveTests(CheckedModeCompileTimeErrorCodeTest);
-  });
-}
-
-@reflectiveTest
-class CheckedModeCompileTimeErrorCodeTest extends ResolverTestCase {
-  @override
-  AnalysisOptions get defaultAnalysisOptions => new AnalysisOptionsImpl();
-
-  test_assertion_throws() async {
-    Source source = addSource(r'''
-class A {
-  const A(int x, int y) : assert(x < y);
-}
-var v = const A(3, 2);
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION]);
-    verify([source]);
-  }
-
-  test_fieldFormalParameterAssignableToField_extends() async {
-    // According to checked-mode type checking rules, a value of type B is
-    // assignable to a field of type A, because B extends A (and hence is a
-    // subtype of A).
-    Source source = addSource(r'''
-class A {
-  const A();
-}
-class B extends A {
-  const B();
-}
-class C {
-  final A a;
-  const C(this.a);
-}
-var v = const C(const B());''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_fieldFormalParameterAssignableToField_fieldType_unresolved_null() async {
-    // Null always passes runtime type checks, even when the type is
-    // unresolved.
-    Source source = addSource(r'''
-class A {
-  final Unresolved x;
-  const A(String this.x);
-}
-var v = const A(null);''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [StaticWarningCode.UNDEFINED_CLASS]);
-    verify([source]);
-  }
-
-  test_fieldFormalParameterAssignableToField_implements() async {
-    // According to checked-mode type checking rules, a value of type B is
-    // assignable to a field of type A, because B implements A (and hence is a
-    // subtype of A).
-    Source source = addSource(r'''
-class A {}
-class B implements A {
-  const B();
-}
-class C {
-  final A a;
-  const C(this.a);
-}
-var v = const C(const B());''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_fieldFormalParameterAssignableToField_list_dynamic() async {
-    // [1, 2, 3] has type List<dynamic>, which is a subtype of List<int>.
-    Source source = addSource(r'''
-class A {
-  const A(List<int> x);
-}
-var x = const A(const [1, 2, 3]);''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_fieldFormalParameterAssignableToField_list_nonDynamic() async {
-    // <int>[1, 2, 3] has type List<int>, which is a subtype of List<num>.
-    Source source = addSource(r'''
-class A {
-  const A(List<num> x);
-}
-var x = const A(const <int>[1, 2, 3]);''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_fieldFormalParameterAssignableToField_map_dynamic() async {
-    // {1: 2} has type Map<dynamic, dynamic>, which is a subtype of
-    // Map<int, int>.
-    Source source = addSource(r'''
-class A {
-  const A(Map<int, int> x);
-}
-var x = const A(const {1: 2});''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_fieldFormalParameterAssignableToField_map_keyDifferent() async {
-    // <int, int>{1: 2} has type Map<int, int>, which is a subtype of
-    // Map<num, int>.
-    Source source = addSource(r'''
-class A {
-  const A(Map<num, int> x);
-}
-var x = const A(const <int, int>{1: 2});''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_fieldFormalParameterAssignableToField_map_valueDifferent() async {
-    // <int, int>{1: 2} has type Map<int, int>, which is a subtype of
-    // Map<int, num>.
-    Source source = addSource(r'''
-class A {
-  const A(Map<int, num> x);
-}
-var x = const A(const <int, int>{1: 2});''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_fieldFormalParameterAssignableToField_notype() async {
-    // If a field is declared without a type, then any value may be assigned to
-    // it.
-    Source source = addSource(r'''
-class A {
-  final x;
-  const A(this.x);
-}
-var v = const A(5);''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_fieldFormalParameterAssignableToField_null() async {
-    // Null is assignable to anything.
-    Source source = addSource(r'''
-class A {
-  final int x;
-  const A(this.x);
-}
-var v = const A(null);''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_fieldFormalParameterAssignableToField_typedef() async {
-    // foo has the runtime type dynamic -> dynamic, so it is not assignable
-    // to A.f.
-    Source source = addSource(r'''
-typedef String Int2String(int x);
-class A {
-  final Int2String f;
-  const A(this.f);
-}
-foo(x) => 1;
-var v = const A(foo);''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE]);
-    verify([source]);
-  }
-
-  test_fieldFormalParameterAssignableToField_typeSubstitution() async {
-    // foo has the runtime type dynamic -> dynamic, so it should be assignable
-    // to A.f.
-    Source source = addSource(r'''
-class A<T> {
-  final T x;
-  const A(this.x);
-}
-var v = const A<int>(3);''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_fieldFormalParameterNotAssignableToField() async {
-    Source source = addSource(r'''
-class A {
-  final int x;
-  const A(this.x);
-}
-var v = const A('foo');''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH,
-      StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE
-    ]);
-    verify([source]);
-  }
-
-  test_fieldFormalParameterNotAssignableToField_extends() async {
-    // According to checked-mode type checking rules, a value of type A is not
-    // assignable to a field of type B, because B extends A (the subtyping
-    // relationship is in the wrong direction).
-    Source source = addSource(r'''
-class A {
-  const A();
-}
-class B extends A {
-  const B();
-}
-class C {
-  final B b;
-  const C(this.b);
-}
-const A u = const A();
-var v = const C(u);''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH
-    ]);
-    verify([source]);
-  }
-
-  test_fieldFormalParameterNotAssignableToField_fieldType() async {
-    Source source = addSource(r'''
-class A {
-  final int x;
-  const A(this.x);
-}
-var v = const A('foo');''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH,
-      StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE
-    ]);
-    verify([source]);
-  }
-
-  test_fieldFormalParameterNotAssignableToField_fieldType_unresolved() async {
-    Source source = addSource(r'''
-class A {
-  final Unresolved x;
-  const A(String this.x);
-}
-var v = const A('foo');''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH,
-      StaticWarningCode.UNDEFINED_CLASS
-    ]);
-    verify([source]);
-  }
-
-  test_fieldFormalParameterNotAssignableToField_implements() async {
-    // According to checked-mode type checking rules, a value of type A is not
-    // assignable to a field of type B, because B implements A (the subtyping
-    // relationship is in the wrong direction).
-    Source source = addSource(r'''
-class A {
-  const A();
-}
-class B implements A {}
-class C {
-  final B b;
-  const C(this.b);
-}
-const A u = const A();
-var v = const C(u);''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH
-    ]);
-    verify([source]);
-  }
-
-  test_fieldFormalParameterNotAssignableToField_list() async {
-    // <num>[1, 2, 3] has type List<num>, which is not a subtype of List<int>.
-    Source source = addSource(r'''
-class A {
-  const A(List<int> x);
-}
-const dynamic w = const <num>[1, 2, 3];
-var x = const A(w);''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH
-    ]);
-    verify([source]);
-  }
-
-  test_fieldFormalParameterNotAssignableToField_map_keyMismatch() async {
-    // <num, int>{1: 2} has type Map<num, int>, which is not a subtype of
-    // Map<int, int>.
-    Source source = addSource(r'''
-class A {
-  const A(Map<int, int> x);
-}
-const dynamic w = const <num, int>{1: 2};
-var x = const A(w);''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH
-    ]);
-    verify([source]);
-  }
-
-  test_fieldFormalParameterNotAssignableToField_map_valueMismatch() async {
-    // <int, num>{1: 2} has type Map<int, num>, which is not a subtype of
-    // Map<int, int>.
-    Source source = addSource(r'''
-class A {
-  const A(Map<int, int> x);
-}
-const dynamic w = const <int, num>{1: 2};
-var x = const A(w);''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH
-    ]);
-    verify([source]);
-  }
-
-  test_fieldFormalParameterNotAssignableToField_optional() async {
-    Source source = addSource(r'''
-class A {
-  final int x;
-  const A([this.x = 'foo']);
-}
-var v = const A();''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH,
-      StaticTypeWarningCode.INVALID_ASSIGNMENT
-    ]);
-    verify([source]);
-  }
-
-  test_fieldFormalParameterNotAssignableToField_typedef() async {
-    // foo has the runtime type String -> int, so it should not be assignable
-    // to A.f (A.f requires it to be int -> String).
-    Source source = addSource(r'''
-typedef String Int2String(int x);
-class A {
-  final Int2String f;
-  const A(this.f);
-}
-int foo(String x) => 1;
-var v = const A(foo);''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH,
-      StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE
-    ]);
-    verify([source]);
-  }
-
-  test_fieldInitializerNotAssignable() async {
-    Source source = addSource(r'''
-class A {
-  final int x;
-  const A() : x = '';
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CheckedModeCompileTimeErrorCode.CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE,
-      StaticWarningCode.FIELD_INITIALIZER_NOT_ASSIGNABLE
-    ]);
-    verify([source]);
-  }
-
-  test_fieldTypeMismatch() async {
-    Source source = addSource(r'''
-class A {
-  const A(x) : y = x;
-  final int y;
-}
-var v = const A('foo');''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_FIELD_TYPE_MISMATCH
-    ]);
-    verify([source]);
-  }
-
-  test_fieldTypeMismatch_generic() async {
-    Source source = addSource(r'''
-class C<T> {
-  final T x = y;
-  const C();
-}
-const int y = 1;
-var v = const C<String>();
-''');
-    await computeAnalysisResult(source);
-    assertErrors(
-      source,
-      [
-        CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_FIELD_TYPE_MISMATCH,
-        StaticTypeWarningCode.INVALID_ASSIGNMENT
-      ],
-    );
-    verify([source]);
-  }
-
-  test_fieldTypeMismatch_unresolved() async {
-    Source source = addSource(r'''
-class A {
-  const A(x) : y = x;
-  final Unresolved y;
-}
-var v = const A('foo');''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_FIELD_TYPE_MISMATCH,
-      StaticWarningCode.UNDEFINED_CLASS
-    ]);
-    verify([source]);
-  }
-
-  test_fieldTypeOk_generic() async {
-    Source source = addSource(r'''
-class C<T> {
-  final T x = y;
-  const C();
-}
-const int y = 1;
-var v = const C<int>();
-''');
-    await computeAnalysisResult(source);
-    assertErrors(
-      source,
-      [StaticTypeWarningCode.INVALID_ASSIGNMENT],
-    );
-    verify([source]);
-  }
-
-  test_fieldTypeOk_null() async {
-    Source source = addSource(r'''
-class A {
-  const A(x) : y = x;
-  final int y;
-}
-var v = const A(null);''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_fieldTypeOk_unresolved_null() async {
-    // Null always passes runtime type checks, even when the type is
-    // unresolved.
-    Source source = addSource(r'''
-class A {
-  const A(x) : y = x;
-  final Unresolved y;
-}
-var v = const A(null);''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [StaticWarningCode.UNDEFINED_CLASS]);
-    verify([source]);
-  }
-
-  test_listElementTypeNotAssignable() async {
-    Source source = addSource("var v = const <String> [42];");
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CheckedModeCompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE,
-      StaticWarningCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE
-    ]);
-    verify([source]);
-  }
-
-  test_listLiteral_inferredElementType() async {
-    Source source = addSource('''
-const Object x = [1];
-const List<String> y = x;
-''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CheckedModeCompileTimeErrorCode.VARIABLE_TYPE_MISMATCH]);
-    verify([source]);
-  }
-
-  test_mapKeyTypeNotAssignable() async {
-    Source source = addSource("var v = const <String, int > {1 : 2};");
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CheckedModeCompileTimeErrorCode.MAP_KEY_TYPE_NOT_ASSIGNABLE,
-      StaticWarningCode.MAP_KEY_TYPE_NOT_ASSIGNABLE
-    ]);
-    verify([source]);
-  }
-
-  test_mapLiteral_inferredKeyType() async {
-    Source source = addSource('''
-const Object x = {1: 1};
-const Map<String, dynamic> y = x;
-''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CheckedModeCompileTimeErrorCode.VARIABLE_TYPE_MISMATCH]);
-    verify([source]);
-  }
-
-  test_mapLiteral_inferredValueType() async {
-    Source source = addSource('''
-const Object x = {1: 1};
-const Map<dynamic, String> y = x;
-''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CheckedModeCompileTimeErrorCode.VARIABLE_TYPE_MISMATCH]);
-    verify([source]);
-  }
-
-  test_mapValueTypeNotAssignable() async {
-    Source source = addSource("var v = const <String, String> {'a' : 2};");
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CheckedModeCompileTimeErrorCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE,
-      StaticWarningCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE
-    ]);
-    verify([source]);
-  }
-
-  test_parameterAssignable_null() async {
-    // Null is assignable to anything.
-    Source source = addSource(r'''
-class A {
-  const A(int x);
-}
-var v = const A(null);''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_parameterAssignable_typeSubstitution() async {
-    Source source = addSource(r'''
-class A<T> {
-  const A(T x);
-}
-var v = const A<int>(3);''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_parameterAssignable_undefined_null() async {
-    // Null always passes runtime type checks, even when the type is
-    // unresolved.
-    Source source = addSource(r'''
-class A {
-  const A(Unresolved x);
-}
-var v = const A(null);''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [StaticWarningCode.UNDEFINED_CLASS]);
-    verify([source]);
-  }
-
-  test_parameterNotAssignable() async {
-    Source source = addSource(r'''
-class A {
-  const A(int x);
-}
-var v = const A('foo');''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH,
-      StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE
-    ]);
-    verify([source]);
-  }
-
-  test_parameterNotAssignable_typeSubstitution() async {
-    Source source = addSource(r'''
-class A<T> {
-  const A(T x);
-}
-var v = const A<int>('foo');''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH,
-      StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE
-    ]);
-    verify([source]);
-  }
-
-  test_parameterNotAssignable_undefined() async {
-    Source source = addSource(r'''
-class A {
-  const A(Unresolved x);
-}
-var v = const A('foo');''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH,
-      StaticWarningCode.UNDEFINED_CLASS
-    ]);
-    verify([source]);
-  }
-
-  test_redirectingConstructor_paramTypeMismatch() async {
-    Source source = addSource(r'''
-class A {
-  const A.a1(x) : this.a2(x);
-  const A.a2(String x);
-}
-var v = const A.a1(0);''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION]);
-    verify([source]);
-  }
-
-  test_superConstructor_paramTypeMismatch() async {
-    Source source = addSource(r'''
-class C {
-  final double d;
-  const C(this.d);
-}
-class D extends C {
-  const D(d) : super(d);
-}
-const f = const D('0.0');
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION]);
-    verify([source]);
-  }
-
-  test_topLevelVarAssignable_null() async {
-    Source source = addSource("const int x = null;");
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_topLevelVarAssignable_undefined_null() async {
-    // Null always passes runtime type checks, even when the type is
-    // unresolved.
-    Source source = addSource("const Unresolved x = null;");
-    await computeAnalysisResult(source);
-    assertErrors(source, [StaticWarningCode.UNDEFINED_CLASS]);
-    verify([source]);
-  }
-
-  test_topLevelVarNotAssignable() async {
-    Source source = addSource("const int x = 'foo';");
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CheckedModeCompileTimeErrorCode.VARIABLE_TYPE_MISMATCH,
-      StaticTypeWarningCode.INVALID_ASSIGNMENT
-    ]);
-    verify([source]);
-  }
-
-  test_topLevelVarNotAssignable_undefined() async {
-    Source source = addSource("const Unresolved x = 'foo';");
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CheckedModeCompileTimeErrorCode.VARIABLE_TYPE_MISMATCH,
-      StaticWarningCode.UNDEFINED_CLASS
-    ]);
-    verify([source]);
-  }
-}
diff --git a/pkg/analyzer/test/generated/compile_time_error_code.dart b/pkg/analyzer/test/generated/compile_time_error_code.dart
new file mode 100644
index 0000000..b14a030
--- /dev/null
+++ b/pkg/analyzer/test/generated/compile_time_error_code.dart
@@ -0,0 +1,6464 @@
+// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:async';
+
+import 'package:analyzer/dart/analysis/declared_variables.dart';
+import 'package:analyzer/error/error.dart';
+import 'package:analyzer/src/context/context.dart';
+import 'package:analyzer/src/error/codes.dart';
+import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/generated/parser.dart' show ParserErrorCode;
+import 'package:analyzer/src/generated/source_io.dart';
+import 'package:test/test.dart' show expect;
+
+import 'resolver_test_case.dart';
+
+class CompileTimeErrorCodeTestBase extends ResolverTestCase {
+  disabled_test_conflictingGenericInterfaces_hierarchyLoop_infinite() async {
+    // There is an interface conflict here due to a loop in the class
+    // hierarchy leading to an infinite set of implemented types; this loop
+    // shouldn't cause non-termination.
+
+    // TODO(paulberry): this test is currently disabled due to non-termination
+    // bugs elsewhere in the analyzer.
+    Source source = addSource('''
+class A<T> implements B<List<T>> {}
+class B<T> implements A<List<T>> {}
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.CONFLICTING_GENERIC_INTERFACES]);
+  }
+
+  test_accessPrivateEnumField() async {
+    Source source = addSource(r'''
+enum E { ONE }
+String name(E e) {
+  return e._name;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.ACCESS_PRIVATE_ENUM_FIELD]);
+    // Cannot verify because "_name" cannot be resolved.
+  }
+
+  test_ambiguousExport() async {
+    Source source = addSource(r'''
+library L;
+export 'lib1.dart';
+export 'lib2.dart';''');
+    addNamedSource("/lib1.dart", r'''
+library lib1;
+class N {}''');
+    addNamedSource("/lib2.dart", r'''
+library lib2;
+class N {}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.AMBIGUOUS_EXPORT]);
+    verify([source]);
+  }
+
+  test_annotationWithNotClass() async {
+    Source source = addSource('''
+class Property {
+  final int value;
+  const Property(this.value);
+}
+
+const Property property = const Property(42);
+
+@property(123)
+main() {
+}
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.ANNOTATION_WITH_NON_CLASS]);
+    verify([source]);
+  }
+
+  test_annotationWithNotClass_prefixed() async {
+    addNamedSource("/annotations.dart", r'''
+class Property {
+  final int value;
+  const Property(this.value);
+}
+
+const Property property = const Property(42);
+''');
+    Source source = addSource('''
+import 'annotations.dart' as pref;
+@pref.property(123)
+main() {
+}
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.ANNOTATION_WITH_NON_CLASS]);
+    verify([source]);
+  }
+
+  test_async_used_as_identifier_in_annotation() async {
+    Source source = addSource('''
+const int async = 0;
+f() async {
+  g(@async x) {}
+  g(0);
+}
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER]);
+    verify([source]);
+  }
+
+  test_async_used_as_identifier_in_argument_label() async {
+    Source source = addSource('''
+f(c) async {
+  c.g(async: 0);
+}
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER]);
+    verify([source]);
+  }
+
+  test_async_used_as_identifier_in_async_method() async {
+    Source source = addSource('''
+f() async {
+  var async = 1;
+}
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER]);
+    verify([source]);
+  }
+
+  test_async_used_as_identifier_in_async_star_method() async {
+    Source source = addSource('''
+f() async* {
+  var async = 1;
+}
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER]);
+    verify([source]);
+  }
+
+  test_async_used_as_identifier_in_break_statement() async {
+    Source source = addSource('''
+f() async {
+  while (true) {
+    break async;
+  }
+}
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER,
+      CompileTimeErrorCode.LABEL_UNDEFINED
+    ]);
+    // Note: we don't call verify([source]) because the reference to the
+    // "async" label is unresolved.
+  }
+
+  test_async_used_as_identifier_in_cascaded_invocation() async {
+    Source source = addSource('''
+class C {
+  int async() => 1;
+}
+f() async {
+  return new C()..async();
+}
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER]);
+    verify([source]);
+  }
+
+  test_async_used_as_identifier_in_cascaded_setter_invocation() async {
+    Source source = addSource('''
+class C {
+  void set async(int i) {}
+}
+f() async {
+  return new C()..async = 1;
+}
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER]);
+    verify([source]);
+  }
+
+  test_async_used_as_identifier_in_catch_exception_argument() async {
+    Source source = addSource('''
+g() {}
+f() async {
+  try {
+    g();
+  } catch (async) { }
+}
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER]);
+    verify([source]);
+  }
+
+  test_async_used_as_identifier_in_catch_stacktrace_argument() async {
+    Source source = addSource('''
+g() {}
+f() async {
+  try {
+    g();
+  } catch (e, async) { }
+}
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER]);
+    verify([source]);
+  }
+
+  test_async_used_as_identifier_in_continue_statement() async {
+    Source source = addSource('''
+f() async {
+  while (true) {
+    continue async;
+  }
+}
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER,
+      CompileTimeErrorCode.LABEL_UNDEFINED
+    ]);
+    // Note: we don't call verify([source]) because the reference to the
+    // "async" label is unresolved.
+  }
+
+  test_async_used_as_identifier_in_for_statement() async {
+    Source source = addSource('''
+var async;
+f() async {
+  for (async in []) {}
+}
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER]);
+    verify([source]);
+  }
+
+  test_async_used_as_identifier_in_formal_parameter_name() async {
+    Source source = addSource('''
+f() async {
+  g(int async) {}
+  g(0);
+}
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER]);
+    verify([source]);
+  }
+
+  test_async_used_as_identifier_in_getter_name() async {
+    Source source = addSource('''
+class C {
+  int get async => 1;
+}
+f() async {
+  return new C().async;
+}
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER]);
+    verify([source]);
+  }
+
+  test_async_used_as_identifier_in_invocation() async {
+    Source source = addSource('''
+class C {
+  int async() => 1;
+}
+f() async {
+  return new C().async();
+}
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER]);
+    verify([source]);
+  }
+
+  test_async_used_as_identifier_in_local_function_name() async {
+    Source source = addSource('''
+f() async {
+  int async() => null;
+}
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER]);
+    verify([source]);
+  }
+
+  test_async_used_as_identifier_in_prefix() async {
+    Source source = addSource('''
+import 'dart:async' as async;
+f() async {
+  return new async.Future.value(0);
+}
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER]);
+    verify([source]);
+  }
+
+  test_async_used_as_identifier_in_setter_name() async {
+    Source source = addSource('''
+class C {
+  void set async(int i) {}
+}
+f() async {
+  new C().async = 1;
+}
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER]);
+    verify([source]);
+  }
+
+  test_async_used_as_identifier_in_statement_label() async {
+    Source source = addSource('''
+f() async {
+  async: g();
+}
+g() {}
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER,
+      HintCode.UNUSED_LABEL
+    ]);
+    verify([source]);
+  }
+
+  test_async_used_as_identifier_in_string_interpolation() async {
+    Source source = addSource(r'''
+int async = 1;
+f() async {
+  return "$async";
+}
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER]);
+    verify([source]);
+  }
+
+  test_async_used_as_identifier_in_suffix() async {
+    addNamedSource("/lib1.dart", r'''
+library lib1;
+int async;
+''');
+    Source source = addSource('''
+import 'lib1.dart' as l;
+f() async {
+  return l.async;
+}
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER]);
+    verify([source]);
+  }
+
+  test_async_used_as_identifier_in_switch_label() async {
+    Source source = addSource('''
+f() async {
+  switch (0) {
+    async: case 0: break;
+  }
+}
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER,
+      HintCode.UNUSED_LABEL
+    ]);
+    verify([source]);
+  }
+
+  test_async_used_as_identifier_in_sync_star_method() async {
+    Source source = addSource('''
+f() sync* {
+  var async = 1;
+}
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER]);
+    verify([source]);
+  }
+
+  test_asyncForInWrongContext() async {
+    Source source = addSource(r'''
+f(list) {
+  await for (var e in list) {
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.ASYNC_FOR_IN_WRONG_CONTEXT]);
+    verify([source]);
+  }
+
+  test_await_used_as_identifier_in_async_method() async {
+    Source source = addSource('''
+f() async {
+  var await = 1;
+}
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER]);
+    verify([source]);
+  }
+
+  test_await_used_as_identifier_in_async_star_method() async {
+    Source source = addSource('''
+f() async* {
+  var await = 1;
+}
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER]);
+    verify([source]);
+  }
+
+  test_await_used_as_identifier_in_sync_star_method() async {
+    Source source = addSource('''
+f() sync* {
+  var await = 1;
+}
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER]);
+    verify([source]);
+  }
+
+  test_awaitInWrongContext_sync() async {
+    // This test requires better error recovery than we currently have. In
+    // particular, we need to be able to distinguish between an await expression
+    // in the wrong context, and the use of 'await' as an identifier.
+    Source source = addSource(r'''
+f(x) {
+  return await x;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.AWAIT_IN_WRONG_CONTEXT]);
+    verify([source]);
+  }
+
+  test_awaitInWrongContext_syncStar() async {
+    // This test requires better error recovery than we currently have. In
+    // particular, we need to be able to distinguish between an await expression
+    // in the wrong context, and the use of 'await' as an identifier.
+    Source source = addSource(r'''
+f(x) sync* {
+  yield await x;
+}''');
+    await computeAnalysisResult(source);
+    if (usingFastaParser) {
+      assertErrors(source, [CompileTimeErrorCode.AWAIT_IN_WRONG_CONTEXT]);
+    }
+    verify([source]);
+  }
+
+  test_bug_23176() async {
+    Source source = addSource('''
+class A {
+  const A([x]);
+}
+class B {
+  dynamic @A(const A()) x;
+}
+''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source,
+        usingFastaParser
+            ? [
+                ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE,
+                ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE,
+                ParserErrorCode.EXPECTED_TOKEN
+              ]
+            : [
+                ParserErrorCode.EXPECTED_CLASS_MEMBER,
+                ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE
+              ]);
+    verify([source]);
+  }
+
+  test_builtInIdentifierAsMixinName_classTypeAlias() async {
+    Source source = addSource(r'''
+class A {}
+class B {}
+class as = A with B;''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME]);
+    verify([source]);
+  }
+
+  test_builtInIdentifierAsPrefixName() async {
+    Source source = addSource("import 'dart:async' as abstract;");
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_PREFIX_NAME,
+      HintCode.UNUSED_IMPORT
+    ]);
+    verify([source]);
+  }
+
+  test_builtInIdentifierAsType_dynamicMissingPrefix() async {
+    Source source = addSource(r"""
+import 'dart:core' as core;
+
+dynamic x;
+""");
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE]);
+  }
+
+  test_builtInIdentifierAsType_formalParameter_field() async {
+    Source source = addSource(r'''
+class A {
+  var x;
+  A(static this.x);
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source,
+        usingFastaParser
+            ? [ParserErrorCode.EXTRANEOUS_MODIFIER]
+            : [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE]);
+    verify([source]);
+  }
+
+  test_builtInIdentifierAsType_formalParameter_simple() async {
+    Source source = addSource(r'''
+f(static x) {
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source,
+        usingFastaParser
+            ? [ParserErrorCode.EXTRANEOUS_MODIFIER]
+            : [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE]);
+    verify([source]);
+  }
+
+  test_builtInIdentifierAsType_variableDeclaration() async {
+    Source source = addSource(r'''
+f() {
+  typedef x;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source,
+        usingFastaParser
+            ? [
+                StaticWarningCode.UNDEFINED_IDENTIFIER,
+                StaticWarningCode.UNDEFINED_IDENTIFIER,
+                ParserErrorCode.EXPECTED_TOKEN
+              ]
+            : [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE]);
+    verify([source]);
+  }
+
+  test_builtInIdentifierAsTypedefName_functionTypeAlias() async {
+    Source source = addSource("typedef bool as();");
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME]);
+    verify([source]);
+  }
+
+  test_builtInIdentifierAsTypeName() async {
+    Source source = addSource("class as {}");
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_NAME]);
+    verify([source]);
+  }
+
+  test_builtInIdentifierAsTypeParameterName() async {
+    Source source = addSource("class A<as> {}");
+    await computeAnalysisResult(source);
+    assertErrors(source,
+        [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME]);
+    verify([source]);
+  }
+
+  test_caseExpressionTypeImplementsEquals() async {
+    Source source = addSource(r'''
+class IntWrapper {
+  final int value;
+  const IntWrapper(this.value);
+  bool operator ==(Object x) {
+    return x is IntWrapper && x.value == value;
+  }
+  get hashCode => value;
+}
+
+f(var a) {
+  switch(a) {
+    case(const IntWrapper(1)) : return 1;
+    default: return 0;
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS]);
+    verify([source]);
+  }
+
+  test_conflictingGenericInterfaces_hierarchyLoop() async {
+    // There is no interface conflict here, but there is a loop in the class
+    // hierarchy leading to a finite set of implemented types; this loop
+    // shouldn't cause non-termination.
+    Source source = addSource('''
+class A<T> implements B<T> {}
+class B<T> implements A<T> {}
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
+      CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE
+    ]);
+  }
+
+  test_conflictingGenericInterfaces_noConflict() async {
+    Source source = addSource('''
+class I<T> {}
+class A implements I<int> {}
+class B implements I<int> {}
+class C extends A implements B {}
+    ''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+  }
+
+  test_conflictingTypeVariableAndClass() async {
+    Source source = addSource(r'''
+class T<T> {
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_CLASS]);
+    verify([source]);
+  }
+
+  test_conflictingTypeVariableAndMember_field() async {
+    Source source = addSource(r'''
+class A<T> {
+  var T;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER]);
+    verify([source]);
+  }
+
+  test_conflictingTypeVariableAndMember_getter() async {
+    Source source = addSource(r'''
+class A<T> {
+  get T => null;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER]);
+    verify([source]);
+  }
+
+  test_conflictingTypeVariableAndMember_method() async {
+    Source source = addSource(r'''
+class A<T> {
+  T() {}
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER]);
+    verify([source]);
+  }
+
+  test_conflictingTypeVariableAndMember_method_static() async {
+    Source source = addSource(r'''
+class A<T> {
+  static T() {}
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER]);
+    verify([source]);
+  }
+
+  test_conflictingTypeVariableAndMember_setter() async {
+    Source source = addSource(r'''
+class A<T> {
+  set T(x) {}
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER]);
+    verify([source]);
+  }
+
+  test_consistentCaseExpressionTypes_dynamic() async {
+    // Even though A.S and S have a static type of "dynamic", we should see
+    // that they match 'abc', because they are constant strings.
+    Source source = addSource(r'''
+class A {
+  static const S = 'A.S';
+}
+
+const S = 'S';
+
+foo(var p) {
+  switch (p) {
+    case S:
+      break;
+    case A.S:
+      break;
+    case 'abc':
+      break;
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_const_invalid_constructorFieldInitializer_fromLibrary() async {
+    addNamedSource('/lib.dart', r'''
+class A<T> {
+  final int f;
+  const A() : f = T.foo;
+}
+''');
+    Source source = addSource(r'''
+import 'lib.dart';
+const a = const A();
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION]);
+  }
+
+  test_constConstructor_redirect_generic() async {
+    Source source = addSource(r'''
+class A<T> {
+  const A(T value) : this._(value);
+  const A._(T value) : value = value;
+  final T value;
+}
+
+void main(){
+  const A<int>(1);
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_constConstructorWithFieldInitializedByNonConst() async {
+    Source source = addSource(r'''
+class A {
+  final int i = f();
+  const A();
+}
+int f() {
+  return 3;
+}''');
+    // TODO(paulberry): the error CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE is
+    // redundant and ought to be suppressed.
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CompileTimeErrorCode
+          .CONST_CONSTRUCTOR_WITH_FIELD_INITIALIZED_BY_NON_CONST,
+      CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE
+    ]);
+    verify([source]);
+  }
+
+  test_constConstructorWithFieldInitializedByNonConst_static() async {
+    Source source = addSource(r'''
+class A {
+  static final int i = f();
+  const A();
+}
+int f() {
+  return 3;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_constConstructorWithNonConstSuper_explicit() async {
+    Source source = addSource(r'''
+class A {
+  A();
+}
+class B extends A {
+  const B(): super();
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER]);
+    verify([source]);
+  }
+
+  test_constConstructorWithNonConstSuper_implicit() async {
+    Source source = addSource(r'''
+class A {
+  A();
+}
+class B extends A {
+  const B();
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER]);
+    verify([source]);
+  }
+
+  test_constConstructorWithNonFinalField_mixin() async {
+    Source source = addSource(r'''
+class A {
+  var a;
+}
+class B extends Object with A {
+  const B();
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_MIXIN_WITH_FIELD,
+      CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD
+    ]);
+    verify([source]);
+  }
+
+  test_constConstructorWithNonFinalField_super() async {
+    Source source = addSource(r'''
+class A {
+  var a;
+}
+class B extends A {
+  const B();
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD,
+      CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER
+    ]);
+    verify([source]);
+  }
+
+  test_constConstructorWithNonFinalField_this() async {
+    Source source = addSource(r'''
+class A {
+  int x;
+  const A();
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD]);
+    verify([source]);
+  }
+
+  test_constDeferredClass() async {
+    await resolveWithErrors(<String>[
+      r'''
+library lib1;
+class A {
+  const A();
+}''',
+      r'''
+library root;
+import 'lib1.dart' deferred as a;
+main() {
+  const a.A();
+}'''
+    ], <ErrorCode>[
+      CompileTimeErrorCode.CONST_DEFERRED_CLASS
+    ]);
+  }
+
+  test_constDeferredClass_namedConstructor() async {
+    await resolveWithErrors(<String>[
+      r'''
+library lib1;
+class A {
+  const A.b();
+}''',
+      r'''
+library root;
+import 'lib1.dart' deferred as a;
+main() {
+  const a.A.b();
+}'''
+    ], <ErrorCode>[
+      CompileTimeErrorCode.CONST_DEFERRED_CLASS
+    ]);
+  }
+
+  test_constEval_newInstance_constConstructor() async {
+    Source source = addSource(r'''
+class A {
+  const A();
+}
+const a = new A();''');
+    await computeAnalysisResult(source);
+    assertErrors(source,
+        [CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE]);
+    verify([source]);
+  }
+
+  test_constEval_newInstance_externalFactoryConstConstructor() async {
+    // We can't evaluate "const A()" because its constructor is external.  But
+    // the code is correct--we shouldn't report an error.
+    Source source = addSource(r'''
+class A {
+  external const factory A();
+}
+const x = const A();''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_constEval_nonStaticField_inGenericClass() async {
+    Source source = addSource('''
+class C<T> {
+  const C();
+  T get t => null;
+}
+
+const x = const C().t;''');
+    await computeAnalysisResult(source);
+    assertErrors(source,
+        [CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE]);
+    verify([source]);
+  }
+
+  test_constEval_propertyExtraction_targetNotConst() async {
+    Source source = addSource(r'''
+class A {
+  const A();
+  int m() => 0;
+}
+final a = const A();
+const C = a.m;''');
+    await computeAnalysisResult(source);
+    assertErrors(source,
+        [CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE]);
+    verify([source]);
+  }
+
+  test_constEvalThrowsException() async {
+    Source source = addSource(r'''
+class C {
+  const C();
+}
+f() { return const C(); }''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.CONST_CONSTRUCTOR_THROWS_EXCEPTION]);
+    verify([source]);
+  }
+
+  test_constEvalThrowsException_binaryMinus_null() async {
+    await _check_constEvalThrowsException_binary_null("null - 5", false);
+    await _check_constEvalThrowsException_binary_null("5 - null", true);
+  }
+
+  test_constEvalThrowsException_binaryPlus_null() async {
+    await _check_constEvalThrowsException_binary_null("null + 5", false);
+    await _check_constEvalThrowsException_binary_null("5 + null", true);
+  }
+
+  test_constEvalThrowsException_divisionByZero() async {
+    Source source = addSource("const C = 1 ~/ 0;");
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.CONST_EVAL_THROWS_IDBZE]);
+    verify([source]);
+  }
+
+  test_constEvalThrowsException_finalAlreadySet_initializer() async {
+    // If a final variable has an initializer at the site of its declaration,
+    // and at the site of the constructor, then invoking that constructor would
+    // produce a runtime error; hence invoking that constructor via the "const"
+    // keyword results in a compile-time error.
+    Source source = addSource('''
+class C {
+  final x = 1;
+  const C() : x = 2;
+}
+var x = const C();
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION,
+      StaticWarningCode.FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION
+    ]);
+    verify([source]);
+  }
+
+  test_constEvalThrowsException_finalAlreadySet_initializing_formal() async {
+    // If a final variable has an initializer at the site of its declaration,
+    // and it is initialized using an initializing formal at the site of the
+    // constructor, then invoking that constructor would produce a runtime
+    // error; hence invoking that constructor via the "const" keyword results
+    // in a compile-time error.
+    Source source = addSource('''
+class C {
+  final x = 1;
+  const C(this.x);
+}
+var x = const C(2);
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION,
+      StaticWarningCode.FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR
+    ]);
+    verify([source]);
+  }
+
+  test_constEvalThrowsException_unaryBitNot_null() async {
+    Source source = addSource("const C = ~null;");
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION]);
+    // no verify(), '~null' is not resolved
+  }
+
+  test_constEvalThrowsException_unaryNegated_null() async {
+    Source source = addSource("const C = -null;");
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION]);
+    // no verify(), '-null' is not resolved
+  }
+
+  test_constEvalThrowsException_unaryNot_null() async {
+    Source source = addSource("const C = !null;");
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION]);
+    verify([source]);
+  }
+
+  test_constEvalTypeBool_binary() async {
+    await _check_constEvalTypeBool_withParameter_binary("p && ''");
+    await _check_constEvalTypeBool_withParameter_binary("p || ''");
+  }
+
+  test_constEvalTypeBool_binary_leftTrue() async {
+    Source source = addSource("const C = (true || 0);");
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [StaticTypeWarningCode.NON_BOOL_OPERAND, HintCode.DEAD_CODE]);
+    verify([source]);
+  }
+
+  test_constEvalTypeBool_logicalOr_trueLeftOperand() async {
+    Source source = addSource(r'''
+class C {
+  final int x;
+  const C({this.x}) : assert(x == null || x >= 0);
+}
+const c = const C();
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_constEvalTypeBoolNumString_equal() async {
+    Source source = addSource(r'''
+class A {
+  const A();
+}
+class B {
+  final a;
+  const B(num p) : a = p == const A();
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL_NUM_STRING]);
+    verify([source]);
+  }
+
+  test_constEvalTypeBoolNumString_notEqual() async {
+    Source source = addSource(r'''
+class A {
+  const A();
+}
+class B {
+  final a;
+  const B(String p) : a = p != const A();
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL_NUM_STRING]);
+    verify([source]);
+  }
+
+  test_constEvalTypeInt_binary() async {
+    await _check_constEvalTypeBoolOrInt_withParameter_binary("p ^ ''");
+    await _check_constEvalTypeBoolOrInt_withParameter_binary("p & ''");
+    await _check_constEvalTypeBoolOrInt_withParameter_binary("p | ''");
+    await _check_constEvalTypeInt_withParameter_binary("p >> ''");
+    await _check_constEvalTypeInt_withParameter_binary("p << ''");
+  }
+
+  test_constEvalTypeNum_binary() async {
+    await _check_constEvalTypeNum_withParameter_binary("p + ''");
+    await _check_constEvalTypeNum_withParameter_binary("p - ''");
+    await _check_constEvalTypeNum_withParameter_binary("p * ''");
+    await _check_constEvalTypeNum_withParameter_binary("p / ''");
+    await _check_constEvalTypeNum_withParameter_binary("p ~/ ''");
+    await _check_constEvalTypeNum_withParameter_binary("p > ''");
+    await _check_constEvalTypeNum_withParameter_binary("p < ''");
+    await _check_constEvalTypeNum_withParameter_binary("p >= ''");
+    await _check_constEvalTypeNum_withParameter_binary("p <= ''");
+    await _check_constEvalTypeNum_withParameter_binary("p % ''");
+  }
+
+  test_constFormalParameter_fieldFormalParameter() async {
+    Source source = addSource(r'''
+class A {
+  var x;
+  A(const this.x) {}
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source,
+        usingFastaParser
+            ? [
+                CompileTimeErrorCode.CONST_FORMAL_PARAMETER,
+                ParserErrorCode.EXTRANEOUS_MODIFIER
+              ]
+            : [CompileTimeErrorCode.CONST_FORMAL_PARAMETER]);
+    verify([source]);
+  }
+
+  test_constFormalParameter_simpleFormalParameter() async {
+    Source source = addSource("f(const x) {}");
+    await computeAnalysisResult(source);
+    assertErrors(
+        source,
+        usingFastaParser
+            ? [
+                CompileTimeErrorCode.CONST_FORMAL_PARAMETER,
+                ParserErrorCode.EXTRANEOUS_MODIFIER
+              ]
+            : [CompileTimeErrorCode.CONST_FORMAL_PARAMETER]);
+    verify([source]);
+  }
+
+  test_constInitializedWithNonConstValue() async {
+    Source source = addSource(r'''
+f(p) {
+  const C = p;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source,
+        [CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE]);
+    verify([source]);
+  }
+
+  test_constInitializedWithNonConstValue_finalField() async {
+    // Regression test for bug #25526 which previously
+    // caused two errors to be reported.
+    Source source = addSource(r'''
+class Foo {
+  final field = 0;
+  foo([int x = field]) {}
+}
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE]);
+    verify([source]);
+  }
+
+  test_constInitializedWithNonConstValue_missingConstInListLiteral() async {
+    Source source = addSource("const List L = [0];");
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_constInitializedWithNonConstValue_missingConstInMapLiteral() async {
+    Source source = addSource("const Map M = {'a' : 0};");
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_constInitializedWithNonConstValueFromDeferredClass() async {
+    await resolveWithErrors(<String>[
+      r'''
+library lib1;
+const V = 1;''',
+      r'''
+library root;
+import 'lib1.dart' deferred as a;
+const B = a.V;'''
+    ], <ErrorCode>[
+      CompileTimeErrorCode
+          .CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE_FROM_DEFERRED_LIBRARY
+    ]);
+  }
+
+  test_constInitializedWithNonConstValueFromDeferredClass_nested() async {
+    await resolveWithErrors(<String>[
+      r'''
+library lib1;
+const V = 1;''',
+      r'''
+library root;
+import 'lib1.dart' deferred as a;
+const B = a.V + 1;'''
+    ], <ErrorCode>[
+      CompileTimeErrorCode
+          .CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE_FROM_DEFERRED_LIBRARY
+    ]);
+  }
+
+  test_constInstanceField() async {
+    Source source = addSource(r'''
+class C {
+  const int f = 0;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.CONST_INSTANCE_FIELD]);
+    verify([source]);
+  }
+
+  test_constMapKeyTypeImplementsEquals_direct() async {
+    Source source = addSource(r'''
+class A {
+  const A();
+  operator ==(other) => false;
+}
+main() {
+  const {const A() : 0};
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source,
+        [CompileTimeErrorCode.CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQUALS]);
+    verify([source]);
+  }
+
+  test_constMapKeyTypeImplementsEquals_dynamic() async {
+    // Note: static type of B.a is "dynamic", but actual type of the const
+    // object is A.  We need to make sure we examine the actual type when
+    // deciding whether there is a problem with operator==.
+    Source source = addSource(r'''
+class A {
+  const A();
+  operator ==(other) => false;
+}
+class B {
+  static const a = const A();
+}
+main() {
+  const {B.a : 0};
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source,
+        [CompileTimeErrorCode.CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQUALS]);
+    verify([source]);
+  }
+
+  test_constMapKeyTypeImplementsEquals_factory() async {
+    Source source = addSource(r'''
+class A { const factory A() = B; }
+
+class B implements A {
+  const B();
+
+  operator ==(o) => true;
+}
+
+main() {
+  var m = const { const A(): 42 };
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source,
+        [CompileTimeErrorCode.CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQUALS]);
+    verify([source]);
+  }
+
+  test_constMapKeyTypeImplementsEquals_super() async {
+    Source source = addSource(r'''
+class A {
+  const A();
+  operator ==(other) => false;
+}
+class B extends A {
+  const B();
+}
+main() {
+  const {const B() : 0};
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source,
+        [CompileTimeErrorCode.CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQUALS]);
+    verify([source]);
+  }
+
+  test_constWithInvalidTypeParameters() async {
+    Source source = addSource(r'''
+class A {
+  const A();
+}
+f() { return const A<A>(); }''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.CONST_WITH_INVALID_TYPE_PARAMETERS]);
+    verify([source]);
+  }
+
+  test_constWithInvalidTypeParameters_tooFew() async {
+    Source source = addSource(r'''
+class A {}
+class C<K, V> {
+  const C();
+}
+f(p) {
+  return const C<A>();
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.CONST_WITH_INVALID_TYPE_PARAMETERS]);
+    verify([source]);
+  }
+
+  test_constWithInvalidTypeParameters_tooMany() async {
+    Source source = addSource(r'''
+class A {}
+class C<E> {
+  const C();
+}
+f(p) {
+  return const C<A, A>();
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.CONST_WITH_INVALID_TYPE_PARAMETERS]);
+    verify([source]);
+  }
+
+  test_constWithNonConst() async {
+    Source source = addSource(r'''
+class T {
+  T(a, b, {c, d}) {}
+}
+f() { return const T(0, 1, c: 2, d: 3); }''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.CONST_WITH_NON_CONST]);
+    verify([source]);
+  }
+
+  test_constWithNonConst_in_const_context() async {
+    Source source = addSource(r'''
+class A {
+  const A(x);
+}
+class B {
+}
+main() {
+  const A(B());
+}
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.CONST_WITH_NON_CONST]);
+    verify([source]);
+  }
+
+  test_constWithNonConstantArgument_annotation() async {
+    Source source = addSource(r'''
+class A {
+  const A(int p);
+}
+var v = 42;
+@A(v)
+main() {
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.CONST_WITH_NON_CONSTANT_ARGUMENT]);
+    verify([source]);
+  }
+
+  test_constWithNonConstantArgument_instanceCreation() async {
+    Source source = addSource(r'''
+class A {
+  const A(a);
+}
+f(p) { return const A(p); }''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CompileTimeErrorCode.CONST_WITH_NON_CONSTANT_ARGUMENT,
+    ]);
+    verify([source]);
+  }
+
+  test_constWithNonType() async {
+    Source source = addSource(r'''
+int A;
+f() {
+  return const A();
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.CONST_WITH_NON_TYPE]);
+    verify([source]);
+  }
+
+  test_constWithNonType_fromLibrary() async {
+    Source source1 = addNamedSource("/lib.dart", "");
+    Source source2 = addNamedSource("/lib2.dart", r'''
+import 'lib.dart' as lib;
+void f() {
+  const lib.A();
+}''');
+    await computeAnalysisResult(source1);
+    await computeAnalysisResult(source2);
+    assertErrors(source2, [CompileTimeErrorCode.CONST_WITH_NON_TYPE]);
+    verify([source1]);
+  }
+
+  test_constWithTypeParameters_direct() async {
+    Source source = addSource(r'''
+class A<T> {
+  static const V = const A<T>();
+  const A();
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS,
+      StaticWarningCode.TYPE_PARAMETER_REFERENCED_BY_STATIC
+    ]);
+    verify([source]);
+  }
+
+  test_constWithTypeParameters_indirect() async {
+    Source source = addSource(r'''
+class A<T> {
+  static const V = const A<List<T>>();
+  const A();
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS,
+      StaticWarningCode.TYPE_PARAMETER_REFERENCED_BY_STATIC
+    ]);
+    verify([source]);
+  }
+
+  test_constWithUndefinedConstructor() async {
+    Source source = addSource(r'''
+class A {
+  const A();
+}
+f() {
+  return const A.noSuchConstructor();
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.CONST_WITH_UNDEFINED_CONSTRUCTOR]);
+    // no verify(), 'noSuchConstructor' is not resolved
+  }
+
+  test_constWithUndefinedConstructorDefault() async {
+    Source source = addSource(r'''
+class A {
+  const A.name();
+}
+f() {
+  return const A();
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source,
+        [CompileTimeErrorCode.CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT]);
+    verify([source]);
+  }
+
+  test_defaultValueInFunctionTypeAlias_new_named() async {
+    Source source = addSource('''
+typedef F = int Function({Map<String, String> m: const {}});
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      ParserErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPE,
+      StrongModeCode.INVALID_CAST_LITERAL_MAP
+    ]);
+    verify([source]);
+  }
+
+  test_defaultValueInFunctionTypeAlias_new_positional() async {
+    Source source = addSource('''
+typedef F = int Function([Map<String, String> m = const {}]);
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      ParserErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPE,
+      StrongModeCode.INVALID_CAST_LITERAL_MAP
+    ]);
+    verify([source]);
+  }
+
+  test_defaultValueInFunctionTypeAlias_old_named() async {
+    Source source = addSource("typedef F([x = 0]);");
+    await computeAnalysisResult(source);
+    assertErrors(
+        source,
+        usingFastaParser
+            ? [
+                CompileTimeErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS,
+                ParserErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPE
+              ]
+            : [CompileTimeErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS]);
+    verify([source]);
+  }
+
+  test_defaultValueInFunctionTypeAlias_old_positional() async {
+    Source source = addSource("typedef F([x = 0]);");
+    await computeAnalysisResult(source);
+    assertErrors(
+        source,
+        usingFastaParser
+            ? [
+                CompileTimeErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS,
+                ParserErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPE
+              ]
+            : [CompileTimeErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS]);
+    verify([source]);
+  }
+
+  test_defaultValueInFunctionTypedParameter_named() async {
+    Source source = addSource("f(g({p: null})) {}");
+    await computeAnalysisResult(source);
+    assertErrors(
+        source,
+        usingFastaParser
+            ? [
+                CompileTimeErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPED_PARAMETER,
+                ParserErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPE
+              ]
+            : [CompileTimeErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPED_PARAMETER]);
+    verify([source]);
+  }
+
+  test_defaultValueInFunctionTypedParameter_optional() async {
+    Source source = addSource("f(g([p = null])) {}");
+    await computeAnalysisResult(source);
+    assertErrors(
+        source,
+        usingFastaParser
+            ? [
+                CompileTimeErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPED_PARAMETER,
+                ParserErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPE
+              ]
+            : [CompileTimeErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPED_PARAMETER]);
+    verify([source]);
+  }
+
+  test_defaultValueInRedirectingFactoryConstructor() async {
+    Source source = addSource(r'''
+class A {
+  factory A([int x = 0]) = B;
+}
+
+class B implements A {
+  B([int x = 1]) {}
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CompileTimeErrorCode.DEFAULT_VALUE_IN_REDIRECTING_FACTORY_CONSTRUCTOR
+    ]);
+    verify([source]);
+  }
+
+  test_deferredImportWithInvalidUri() async {
+    Source source = addSource(r'''
+import '[invalid uri]' deferred as p;
+main() {
+  p.loadLibrary();
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.URI_DOES_NOT_EXIST]);
+  }
+
+  test_duplicateDefinition_acrossLibraries() async {
+    Source librarySource = addNamedSource("/lib.dart", r'''
+library lib;
+
+part 'a.dart';
+part 'b.dart';''');
+    Source sourceA = addNamedSource("/a.dart", r'''
+part of lib;
+
+class A {}''');
+    Source sourceB = addNamedSource("/b.dart", r'''
+part of lib;
+
+class A {}''');
+    await computeAnalysisResult(librarySource);
+    await computeAnalysisResult(sourceA);
+    await computeAnalysisResult(sourceB);
+    assertNoErrors(librarySource);
+    assertErrors(sourceB, [CompileTimeErrorCode.DUPLICATE_DEFINITION]);
+    verify([librarySource, sourceA, sourceB]);
+  }
+
+  test_duplicateDefinition_catch() async {
+    Source source = addSource(r'''
+main() {
+  try {} catch (e, e) {}
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.DUPLICATE_DEFINITION]);
+    verify([source]);
+  }
+
+  test_duplicateDefinition_inPart() async {
+    Source librarySource = addNamedSource("/lib.dart", r'''
+library test;
+part 'a.dart';
+class A {}''');
+    Source sourceA = addNamedSource("/a.dart", r'''
+part of test;
+class A {}''');
+    await computeAnalysisResult(librarySource);
+    await computeAnalysisResult(sourceA);
+    assertNoErrors(librarySource);
+    assertErrors(sourceA, [CompileTimeErrorCode.DUPLICATE_DEFINITION]);
+    verify([librarySource, sourceA]);
+  }
+
+  test_duplicateDefinition_locals_inCase() async {
+    Source source = addSource(r'''
+main() {
+  switch(1) {
+    case 1:
+      var a;
+      var a;
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.DUPLICATE_DEFINITION]);
+    verify([source]);
+  }
+
+  test_duplicateDefinition_locals_inFunctionBlock() async {
+    Source source = addSource(r'''
+main() {
+  int m = 0;
+  m(a) {}
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.DUPLICATE_DEFINITION]);
+    verify([source]);
+  }
+
+  test_duplicateDefinition_locals_inIf() async {
+    Source source = addSource(r'''
+main(int p) {
+  if (p != 0) {
+    var a;
+    var a;
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.DUPLICATE_DEFINITION]);
+    verify([source]);
+  }
+
+  test_duplicateDefinition_locals_inMethodBlock() async {
+    Source source = addSource(r'''
+class A {
+  m() {
+    int a;
+    int a;
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.DUPLICATE_DEFINITION]);
+    verify([source]);
+  }
+
+  test_duplicateDefinition_parameters_inConstructor() async {
+    Source source = addSource(r'''
+class A {
+  int a;
+  A(int a, this.a);
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.DUPLICATE_DEFINITION]);
+    verify([source]);
+  }
+
+  test_duplicateDefinition_parameters_inFunctionTypeAlias() async {
+    Source source = addSource(r'''
+typedef F(int a, double a);
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.DUPLICATE_DEFINITION]);
+    verify([source]);
+  }
+
+  test_duplicateDefinition_parameters_inLocalFunction() async {
+    Source source = addSource(r'''
+main() {
+  f(int a, double a) {
+  };
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.DUPLICATE_DEFINITION]);
+    verify([source]);
+  }
+
+  test_duplicateDefinition_parameters_inMethod() async {
+    Source source = addSource(r'''
+class A {
+  m(int a, double a) {
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.DUPLICATE_DEFINITION]);
+    verify([source]);
+  }
+
+  test_duplicateDefinition_parameters_inTopLevelFunction() async {
+    Source source = addSource(r'''
+f(int a, double a) {
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.DUPLICATE_DEFINITION]);
+    verify([source]);
+  }
+
+  test_duplicateDefinition_typeParameters() async {
+    Source source = addSource(r'''
+class A<T, T> {
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.DUPLICATE_DEFINITION]);
+    verify([source]);
+  }
+
+  test_duplicateNamedArgument() async {
+    Source source = addSource(r'''
+f({a, b}) {}
+main() {
+  f(a: 1, a: 2);
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.DUPLICATE_NAMED_ARGUMENT]);
+    verify([source]);
+  }
+
+  test_duplicatePart_sameSource() async {
+    addNamedSource('/part.dart', 'part of lib;');
+    Source source = addSource(r'''
+library lib;
+part 'part.dart';
+part 'foo/../part.dart';
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.DUPLICATE_PART]);
+    verify([source]);
+  }
+
+  test_duplicatePart_sameUri() async {
+    addNamedSource('/part.dart', 'part of lib;');
+    Source source = addSource(r'''
+library lib;
+part 'part.dart';
+part 'part.dart';
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.DUPLICATE_PART]);
+    verify([source]);
+  }
+
+  test_exportInternalLibrary() async {
+    Source source = addSource("export 'dart:_interceptors';");
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.EXPORT_INTERNAL_LIBRARY]);
+    verify([source]);
+  }
+
+  test_exportOfNonLibrary() async {
+    Source source = addSource(r'''
+library L;
+export 'lib1.dart';''');
+    addNamedSource("/lib1.dart", "part of lib;");
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.EXPORT_OF_NON_LIBRARY]);
+    verify([source]);
+  }
+
+  test_extendsDeferredClass() async {
+    await resolveWithErrors(<String>[
+      r'''
+library lib1;
+class A {}''',
+      r'''
+library root;
+import 'lib1.dart' deferred as a;
+class B extends a.A {}'''
+    ], <ErrorCode>[
+      CompileTimeErrorCode.EXTENDS_DEFERRED_CLASS
+    ]);
+  }
+
+  test_extendsDeferredClass_classTypeAlias() async {
+    await resolveWithErrors(<String>[
+      r'''
+library lib1;
+class A {}''',
+      r'''
+library root;
+import 'lib1.dart' deferred as a;
+class M {}
+class C = a.A with M;'''
+    ], <ErrorCode>[
+      CompileTimeErrorCode.EXTENDS_DEFERRED_CLASS
+    ]);
+  }
+
+  test_extendsDisallowedClass_class_bool() async {
+    Source source = addSource("class A extends bool {}");
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS,
+      CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT
+    ]);
+    verify([source]);
+  }
+
+  test_extendsDisallowedClass_class_double() async {
+    Source source = addSource("class A extends double {}");
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS]);
+    verify([source]);
+  }
+
+  test_extendsDisallowedClass_class_int() async {
+    Source source = addSource("class A extends int {}");
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS,
+      CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT
+    ]);
+    verify([source]);
+  }
+
+  test_extendsDisallowedClass_class_Null() async {
+    Source source = addSource("class A extends Null {}");
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS,
+      CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT
+    ]);
+    verify([source]);
+  }
+
+  test_extendsDisallowedClass_class_num() async {
+    Source source = addSource("class A extends num {}");
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS]);
+    verify([source]);
+  }
+
+  test_extendsDisallowedClass_class_String() async {
+    Source source = addSource("class A extends String {}");
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS,
+      CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT
+    ]);
+    verify([source]);
+  }
+
+  test_extendsDisallowedClass_classTypeAlias_bool() async {
+    Source source = addSource(r'''
+class M {}
+class C = bool with M;''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS]);
+    verify([source]);
+  }
+
+  test_extendsDisallowedClass_classTypeAlias_double() async {
+    Source source = addSource(r'''
+class M {}
+class C = double with M;''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS]);
+    verify([source]);
+  }
+
+  test_extendsDisallowedClass_classTypeAlias_int() async {
+    Source source = addSource(r'''
+class M {}
+class C = int with M;''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS]);
+    verify([source]);
+  }
+
+  test_extendsDisallowedClass_classTypeAlias_Null() async {
+    Source source = addSource(r'''
+class M {}
+class C = Null with M;''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS]);
+    verify([source]);
+  }
+
+  test_extendsDisallowedClass_classTypeAlias_num() async {
+    Source source = addSource(r'''
+class M {}
+class C = num with M;''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS]);
+    verify([source]);
+  }
+
+  test_extendsDisallowedClass_classTypeAlias_String() async {
+    Source source = addSource(r'''
+class M {}
+class C = String with M;''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS]);
+    verify([source]);
+  }
+
+  test_extraPositionalArguments_const() async {
+    Source source = addSource(r'''
+class A {
+  const A();
+}
+main() {
+  const A(0);
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.EXTRA_POSITIONAL_ARGUMENTS]);
+    verify([source]);
+  }
+
+  test_extraPositionalArguments_const_super() async {
+    Source source = addSource(r'''
+class A {
+  const A();
+}
+class B extends A {
+  const B() : super(0);
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.EXTRA_POSITIONAL_ARGUMENTS]);
+    verify([source]);
+  }
+
+  test_extraPositionalArgumentsCouldBeNamed_const() async {
+    Source source = addSource(r'''
+class A {
+  const A({int x});
+}
+main() {
+  const A(0);
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source,
+        [CompileTimeErrorCode.EXTRA_POSITIONAL_ARGUMENTS_COULD_BE_NAMED]);
+    verify([source]);
+  }
+
+  test_extraPositionalArgumentsCouldBeNamed_const_super() async {
+    Source source = addSource(r'''
+class A {
+  const A({int x});
+}
+class B extends A {
+  const B() : super(0);
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source,
+        [CompileTimeErrorCode.EXTRA_POSITIONAL_ARGUMENTS_COULD_BE_NAMED]);
+    verify([source]);
+  }
+
+  test_fieldFormalParameter_assignedInInitializer() async {
+    Source source = addSource(r'''
+class A {
+  int x;
+  A(this.x) : x = 3 {}
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source,
+        [CompileTimeErrorCode.FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER]);
+    verify([source]);
+  }
+
+  test_fieldInitializedByMultipleInitializers() async {
+    Source source = addSource(r'''
+class A {
+  int x;
+  A() : x = 0, x = 1 {}
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source,
+        [CompileTimeErrorCode.FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS]);
+    verify([source]);
+  }
+
+  test_fieldInitializedByMultipleInitializers_multipleInits() async {
+    Source source = addSource(r'''
+class A {
+  int x;
+  A() : x = 0, x = 1, x = 2 {}
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CompileTimeErrorCode.FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS,
+      CompileTimeErrorCode.FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS
+    ]);
+    verify([source]);
+  }
+
+  test_fieldInitializedByMultipleInitializers_multipleNames() async {
+    Source source = addSource(r'''
+class A {
+  int x;
+  int y;
+  A() : x = 0, x = 1, y = 0, y = 1 {}
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CompileTimeErrorCode.FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS,
+      CompileTimeErrorCode.FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS
+    ]);
+    verify([source]);
+  }
+
+  test_fieldInitializedInParameterAndInitializer() async {
+    Source source = addSource(r'''
+class A {
+  int x;
+  A(this.x) : x = 1 {}
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source,
+        [CompileTimeErrorCode.FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER]);
+    verify([source]);
+  }
+
+  test_fieldInitializerFactoryConstructor() async {
+    Source source = addSource(r'''
+class A {
+  int x;
+  factory A(this.x) => null;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.FIELD_INITIALIZER_FACTORY_CONSTRUCTOR]);
+    verify([source]);
+  }
+
+  test_fieldInitializerOutsideConstructor() async {
+    // TODO(brianwilkerson) Fix the duplicate error messages.
+    Source source = addSource(r'''
+class A {
+  int x;
+  m(this.x) {}
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      ParserErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR,
+      CompileTimeErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR
+    ]);
+    verify([source]);
+  }
+
+  test_fieldInitializerOutsideConstructor_defaultParameter() async {
+    Source source = addSource(r'''
+class A {
+  int x;
+  m([this.x]) {}
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR]);
+    verify([source]);
+  }
+
+  test_fieldInitializerOutsideConstructor_inFunctionTypeParameter() async {
+    Source source = addSource(r'''
+class A {
+  int x;
+  A(int p(this.x));
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR]);
+    verify([source]);
+  }
+
+  test_fieldInitializerRedirectingConstructor_afterRedirection() async {
+    Source source = addSource(r'''
+class A {
+  int x;
+  A.named() {}
+  A() : this.named(), x = 42;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source,
+        [CompileTimeErrorCode.FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR]);
+    verify([source]);
+  }
+
+  test_fieldInitializerRedirectingConstructor_beforeRedirection() async {
+    Source source = addSource(r'''
+class A {
+  int x;
+  A.named() {}
+  A() : x = 42, this.named();
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source,
+        [CompileTimeErrorCode.FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR]);
+    verify([source]);
+  }
+
+  test_fieldInitializingFormalRedirectingConstructor() async {
+    Source source = addSource(r'''
+class A {
+  int x;
+  A.named() {}
+  A(this.x) : this.named();
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source,
+        [CompileTimeErrorCode.FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR]);
+    verify([source]);
+  }
+
+  test_finalInitializedMultipleTimes_initializers() async {
+    Source source = addSource(r'''
+class A {
+  final x;
+  A() : x = 0, x = 0 {}
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source,
+        [CompileTimeErrorCode.FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS]);
+    verify([source]);
+  }
+
+  /**
+   * This test doesn't test the FINAL_INITIALIZED_MULTIPLE_TIMES code, but tests the
+   * FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER code instead. It is provided here to show
+   * coverage over all of the permutations of initializers in constructor declarations.
+   *
+   * Note: FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER covers a subset of
+   * FINAL_INITIALIZED_MULTIPLE_TIMES, since it more specific, we use it instead of the broader code
+   */
+  test_finalInitializedMultipleTimes_initializingFormal_initializer() async {
+    Source source = addSource(r'''
+class A {
+  final x;
+  A(this.x) : x = 0 {}
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source,
+        [CompileTimeErrorCode.FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER]);
+    verify([source]);
+  }
+
+  test_finalInitializedMultipleTimes_initializingFormals() async {
+    Source source = addSource(r'''
+class A {
+  final x;
+  A(this.x, this.x) {}
+}''');
+    // TODO(brianwilkerson) There should only be one error here.
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CompileTimeErrorCode.DUPLICATE_DEFINITION,
+      CompileTimeErrorCode.FINAL_INITIALIZED_MULTIPLE_TIMES
+    ]);
+    verify([source]);
+  }
+
+  test_finalNotInitialized_instanceField_const_static() async {
+    Source source = addSource(r'''
+class A {
+  static const F;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.CONST_NOT_INITIALIZED]);
+    verify([source]);
+  }
+
+  test_finalNotInitialized_library_const() async {
+    Source source = addSource("const F;");
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.CONST_NOT_INITIALIZED]);
+    verify([source]);
+  }
+
+  test_finalNotInitialized_local_const() async {
+    Source source = addSource(r'''
+f() {
+  const int x;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.CONST_NOT_INITIALIZED]);
+    verify([source]);
+  }
+
+  test_forInWithConstVariable_forEach_identifier() async {
+    Source source = addSource(r'''
+f() {
+  const x = 0;
+  for (x in [0, 1, 2]) {}
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.FOR_IN_WITH_CONST_VARIABLE]);
+    verify([source]);
+  }
+
+  test_forInWithConstVariable_forEach_loopVariable() async {
+    Source source = addSource(r'''
+f() {
+  for (const x in [0, 1, 2]) {}
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.FOR_IN_WITH_CONST_VARIABLE]);
+    verify([source]);
+  }
+
+  test_fromEnvironment_bool_badArgs() async {
+    Source source = addSource(r'''
+var b1 = const bool.fromEnvironment(1);
+var b2 = const bool.fromEnvironment('x', defaultValue: 1);''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION,
+      StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE,
+      CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION,
+      StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE
+    ]);
+    verify([source]);
+  }
+
+  test_fromEnvironment_bool_badDefault_whenDefined() async {
+    // The type of the defaultValue needs to be correct even when the default
+    // value isn't used (because the variable is defined in the environment).
+    if (enableNewAnalysisDriver) {
+      driver.declaredVariables = new DeclaredVariables.fromMap({'x': 'true'});
+    } else {
+      (analysisContext2 as AnalysisContextImpl).declaredVariables =
+          new DeclaredVariables.fromMap({'x': 'true'});
+    }
+    Source source =
+        addSource("var b = const bool.fromEnvironment('x', defaultValue: 1);");
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION,
+      StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE
+    ]);
+    verify([source]);
+  }
+
+  test_genericFunctionTypeArgument_inference_function() async {
+    Source source = addSource(r'''
+T f<T>(T t) => null;
+main() { f(<S>(S s) => s); }''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [StrongModeCode.COULD_NOT_INFER]);
+    verify([source]);
+  }
+
+  test_genericFunctionTypeArgument_inference_functionType() async {
+    Source source = addSource(r'''
+T Function<T>(T) f;
+main() { f(<S>(S s) => s); }''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [StrongModeCode.COULD_NOT_INFER]);
+    verify([source]);
+  }
+
+  test_genericFunctionTypeArgument_inference_method() async {
+    Source source = addSource(r'''
+class C {
+  T f<T>(T t) => null;
+}
+main() { new C().f(<S>(S s) => s); }''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [StrongModeCode.COULD_NOT_INFER]);
+    verify([source]);
+  }
+
+  test_genericFunctionTypeAsBound_class() async {
+    Source source = addSource(r'''
+class C<T extends S Function<S>(S)> {
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.GENERIC_FUNCTION_TYPE_CANNOT_BE_BOUND]);
+    verify([source]);
+  }
+
+  test_genericFunctionTypeAsBound_genericFunction() async {
+    Source source = addSource(r'''
+T Function<T extends S Function<S>(S)>(T) fun;
+''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.GENERIC_FUNCTION_TYPE_CANNOT_BE_BOUND]);
+    verify([source]);
+  }
+
+  test_genericFunctionTypeAsBound_genericFunctionTypedef() async {
+    Source source = addSource(r'''
+typedef foo = T Function<T extends S Function<S>(S)>(T t);
+''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.GENERIC_FUNCTION_TYPE_CANNOT_BE_BOUND]);
+    verify([source]);
+  }
+
+  test_genericFunctionTypeAsBound_parameterOfFunction() async {
+    Source source = addSource(r'''
+class C<T extends void Function(S Function<S>(S))> {
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_genericFunctionTypeAsBound_typedef() async {
+    Source source = addSource(r'''
+typedef T foo<T extends S Function<S>(S)>(T t);
+''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.GENERIC_FUNCTION_TYPE_CANNOT_BE_BOUND]);
+    verify([source]);
+  }
+
+  test_genericFunctionTypedParameter() async {
+    // Once dartbug.com/28515 is fixed, this syntax should no longer generate an
+    // error.
+    // TODO(paulberry): When dartbug.com/28515 is fixed, convert this into a
+    // NonErrorResolverTest.
+    Source source = addSource('void g(T f<T>(T x)) {}');
+    await computeAnalysisResult(source);
+    var expectedErrorCodes = <ErrorCode>[
+      CompileTimeErrorCode.GENERIC_FUNCTION_TYPED_PARAM_UNSUPPORTED
+    ];
+    if (enableNewAnalysisDriver) {
+      // Due to dartbug.com/28515, some additional errors appear when using the
+      // new analysis driver.
+      expectedErrorCodes.addAll([
+        StaticWarningCode.UNDEFINED_CLASS,
+        StaticWarningCode.UNDEFINED_CLASS
+      ]);
+    }
+    assertErrors(source, expectedErrorCodes);
+    verify([source]);
+  }
+
+  test_implementsDeferredClass() async {
+    await resolveWithErrors(<String>[
+      r'''
+library lib1;
+class A {}''',
+      r'''
+library root;
+import 'lib1.dart' deferred as a;
+class B implements a.A {}'''
+    ], <ErrorCode>[
+      CompileTimeErrorCode.IMPLEMENTS_DEFERRED_CLASS
+    ]);
+  }
+
+  test_implementsDeferredClass_classTypeAlias() async {
+    await resolveWithErrors(<String>[
+      r'''
+library lib1;
+class A {}''',
+      r'''
+library root;
+import 'lib1.dart' deferred as a;
+class B {}
+class M {}
+class C = B with M implements a.A;'''
+    ], <ErrorCode>[
+      CompileTimeErrorCode.IMPLEMENTS_DEFERRED_CLASS
+    ]);
+  }
+
+  test_implementsDisallowedClass_class_bool() async {
+    Source source = addSource("class A implements bool {}");
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS]);
+    verify([source]);
+  }
+
+  test_implementsDisallowedClass_class_double() async {
+    Source source = addSource("class A implements double {}");
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS]);
+    verify([source]);
+  }
+
+  test_implementsDisallowedClass_class_int() async {
+    Source source = addSource("class A implements int {}");
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS]);
+    verify([source]);
+  }
+
+  test_implementsDisallowedClass_class_Null() async {
+    Source source = addSource("class A implements Null {}");
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS]);
+    verify([source]);
+  }
+
+  test_implementsDisallowedClass_class_num() async {
+    Source source = addSource("class A implements num {}");
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS]);
+    verify([source]);
+  }
+
+  test_implementsDisallowedClass_class_String() async {
+    Source source = addSource("class A implements String {}");
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS]);
+    verify([source]);
+  }
+
+  test_implementsDisallowedClass_class_String_num() async {
+    Source source = addSource("class A implements String, num {}");
+    await computeAnalysisResult(source);
+    if (enableNewAnalysisDriver) {
+      assertErrors(source, [
+        CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS,
+        CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS
+      ]);
+    } else {
+      assertErrors(source, [
+        CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS,
+        CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS
+      ]);
+    }
+    verify([source]);
+  }
+
+  test_implementsDisallowedClass_classTypeAlias_bool() async {
+    Source source = addSource(r'''
+class A {}
+class M {}
+class C = A with M implements bool;''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS]);
+    verify([source]);
+  }
+
+  test_implementsDisallowedClass_classTypeAlias_double() async {
+    Source source = addSource(r'''
+class A {}
+class M {}
+class C = A with M implements double;''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS]);
+    verify([source]);
+  }
+
+  test_implementsDisallowedClass_classTypeAlias_int() async {
+    Source source = addSource(r'''
+class A {}
+class M {}
+class C = A with M implements int;''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS]);
+    verify([source]);
+  }
+
+  test_implementsDisallowedClass_classTypeAlias_Null() async {
+    Source source = addSource(r'''
+class A {}
+class M {}
+class C = A with M implements Null;''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS]);
+    verify([source]);
+  }
+
+  test_implementsDisallowedClass_classTypeAlias_num() async {
+    Source source = addSource(r'''
+class A {}
+class M {}
+class C = A with M implements num;''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS]);
+    verify([source]);
+  }
+
+  test_implementsDisallowedClass_classTypeAlias_String() async {
+    Source source = addSource(r'''
+class A {}
+class M {}
+class C = A with M implements String;''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS]);
+    verify([source]);
+  }
+
+  test_implementsDisallowedClass_classTypeAlias_String_num() async {
+    Source source = addSource(r'''
+class A {}
+class M {}
+class C = A with M implements String, num;''');
+    await computeAnalysisResult(source);
+    if (enableNewAnalysisDriver) {
+      assertErrors(source, [
+        CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS,
+        CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS
+      ]);
+    } else {
+      assertErrors(source, [
+        CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS,
+        CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS
+      ]);
+    }
+    verify([source]);
+  }
+
+  test_implementsNonClass_class() async {
+    Source source = addSource(r'''
+int A;
+class B implements A {}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_NON_CLASS]);
+    verify([source]);
+  }
+
+  test_implementsNonClass_dynamic() async {
+    Source source = addSource("class A implements dynamic {}");
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_NON_CLASS]);
+    verify([source]);
+  }
+
+  test_implementsNonClass_enum() async {
+    Source source = addSource(r'''
+enum E { ONE }
+class A implements E {}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_NON_CLASS]);
+    verify([source]);
+  }
+
+  test_implementsNonClass_typeAlias() async {
+    Source source = addSource(r'''
+class A {}
+class M {}
+int B;
+class C = A with M implements B;''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_NON_CLASS]);
+    verify([source]);
+  }
+
+  test_implementsSuperClass() async {
+    Source source = addSource(r'''
+class A {}
+class B extends A implements A {}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_SUPER_CLASS]);
+    verify([source]);
+  }
+
+  test_implementsSuperClass_Object() async {
+    Source source = addSource("class A implements Object {}");
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_SUPER_CLASS]);
+    verify([source]);
+  }
+
+  test_implementsSuperClass_Object_typeAlias() async {
+    Source source = addSource(r'''
+class M {}
+class A = Object with M implements Object;
+    ''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_SUPER_CLASS]);
+    verify([source]);
+  }
+
+  test_implementsSuperClass_typeAlias() async {
+    Source source = addSource(r'''
+class A {}
+class M {}
+class B = A with M implements A;''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_SUPER_CLASS]);
+    verify([source]);
+  }
+
+  test_implicitThisReferenceInInitializer_field() async {
+    Source source = addSource(r'''
+class A {
+  var v;
+  A() : v = f;
+  var f;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER]);
+    verify([source]);
+  }
+
+  test_implicitThisReferenceInInitializer_field2() async {
+    Source source = addSource(r'''
+class A {
+  final x = 0;
+  final y = x;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER,
+      StrongModeCode.TOP_LEVEL_INSTANCE_GETTER
+    ]);
+    verify([source]);
+  }
+
+  test_implicitThisReferenceInInitializer_invocation() async {
+    Source source = addSource(r'''
+class A {
+  var v;
+  A() : v = f();
+  f() {}
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER]);
+    verify([source]);
+  }
+
+  test_implicitThisReferenceInInitializer_invocationInStatic() async {
+    Source source = addSource(r'''
+class A {
+  static var F = m();
+  int m() => 0;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER]);
+    verify([source]);
+  }
+
+  test_implicitThisReferenceInInitializer_redirectingConstructorInvocation() async {
+    Source source = addSource(r'''
+class A {
+  A(p) {}
+  A.named() : this(f);
+  var f;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER]);
+    verify([source]);
+  }
+
+  test_implicitThisReferenceInInitializer_superConstructorInvocation() async {
+    Source source = addSource(r'''
+class A {
+  A(p) {}
+}
+class B extends A {
+  B() : super(f);
+  var f;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER]);
+    verify([source]);
+  }
+
+  test_importInternalLibrary() async {
+    Source source = addSource("import 'dart:_interceptors';");
+    // Note, in these error cases we may generate an UNUSED_IMPORT hint, while
+    // we could prevent the hint from being generated by testing the import
+    // directive for the error, this is such a minor corner case that we don't
+    // think we should add the additional computation time to figure out such
+    // cases.
+    await computeAnalysisResult(source);
+    assertErrors(source,
+        [CompileTimeErrorCode.IMPORT_INTERNAL_LIBRARY, HintCode.UNUSED_IMPORT]);
+    verify([source]);
+  }
+
+  test_importOfNonLibrary() async {
+    Source source = addSource(r'''
+library lib;
+import 'part.dart';
+A a;''');
+    addNamedSource("/part.dart", r'''
+part of lib;
+class A{}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.IMPORT_OF_NON_LIBRARY]);
+    verify([source]);
+  }
+
+  test_inconsistentCaseExpressionTypes() async {
+    Source source = addSource(r'''
+f(var p) {
+  switch (p) {
+    case 1:
+      break;
+    case 'a':
+      break;
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.INCONSISTENT_CASE_EXPRESSION_TYPES]);
+    verify([source]);
+  }
+
+  test_inconsistentCaseExpressionTypes_dynamic() async {
+    // Even though A.S and S have a static type of "dynamic", we should see
+    // that they fail to match 3, because they are constant strings.
+    Source source = addSource(r'''
+class A {
+  static const S = 'A.S';
+}
+
+const S = 'S';
+
+foo(var p) {
+  switch (p) {
+    case 3:
+      break;
+    case S:
+      break;
+    case A.S:
+      break;
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CompileTimeErrorCode.INCONSISTENT_CASE_EXPRESSION_TYPES,
+      CompileTimeErrorCode.INCONSISTENT_CASE_EXPRESSION_TYPES
+    ]);
+    verify([source]);
+  }
+
+  test_inconsistentCaseExpressionTypes_repeated() async {
+    Source source = addSource(r'''
+f(var p) {
+  switch (p) {
+    case 1:
+      break;
+    case 'a':
+      break;
+    case 'b':
+      break;
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CompileTimeErrorCode.INCONSISTENT_CASE_EXPRESSION_TYPES,
+      CompileTimeErrorCode.INCONSISTENT_CASE_EXPRESSION_TYPES
+    ]);
+    verify([source]);
+  }
+
+  test_initializerForNonExistent_const() async {
+    // Check that the absence of a matching field doesn't cause a
+    // crash during constant evaluation.
+    Source source = addSource(r'''
+class A {
+  const A() : x = 'foo';
+}
+A a = const A();''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.INITIALIZER_FOR_NON_EXISTENT_FIELD]);
+  }
+
+  test_initializerForNonExistent_initializer() async {
+    Source source = addSource(r'''
+class A {
+  A() : x = 0 {}
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.INITIALIZER_FOR_NON_EXISTENT_FIELD]);
+  }
+
+  test_initializerForStaticField() async {
+    Source source = addSource(r'''
+class A {
+  static int x;
+  A() : x = 0 {}
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.INITIALIZER_FOR_STATIC_FIELD]);
+    verify([source]);
+  }
+
+  test_initializingFormalForNonExistentField() async {
+    Source source = addSource(r'''
+class A {
+  A(this.x) {}
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source,
+        [CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD]);
+    verify([source]);
+  }
+
+  test_initializingFormalForNonExistentField_notInEnclosingClass() async {
+    Source source = addSource(r'''
+class A {
+int x;
+}
+class B extends A {
+  B(this.x) {}
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source,
+        [CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD]);
+    verify([source]);
+  }
+
+  test_initializingFormalForNonExistentField_optional() async {
+    Source source = addSource(r'''
+class A {
+  A([this.x]) {}
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source,
+        [CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD]);
+    verify([source]);
+  }
+
+  test_initializingFormalForNonExistentField_synthetic() async {
+    Source source = addSource(r'''
+class A {
+  int get x => 1;
+  A(this.x) {}
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source,
+        [CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD]);
+    verify([source]);
+  }
+
+  test_initializingFormalForStaticField() async {
+    Source source = addSource(r'''
+class A {
+  static int x;
+  A([this.x]) {}
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_STATIC_FIELD]);
+    verify([source]);
+  }
+
+  test_instanceMemberAccessFromFactory_named() async {
+    Source source = addSource(r'''
+class A {
+  m() {}
+  A();
+  factory A.make() {
+    m();
+    return new A();
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_FACTORY]);
+    verify([source]);
+  }
+
+  test_instanceMemberAccessFromFactory_unnamed() async {
+    Source source = addSource(r'''
+class A {
+  m() {}
+  A._();
+  factory A() {
+    m();
+    return new A._();
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_FACTORY]);
+    verify([source]);
+  }
+
+  test_instanceMemberAccessFromStatic_field() async {
+    Source source = addSource(r'''
+class A {
+  int f;
+  static foo() {
+    f;
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_STATIC]);
+    verify([source]);
+  }
+
+  test_instanceMemberAccessFromStatic_getter() async {
+    Source source = addSource(r'''
+class A {
+  get g => null;
+  static foo() {
+    g;
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_STATIC]);
+    verify([source]);
+  }
+
+  test_instanceMemberAccessFromStatic_method() async {
+    Source source = addSource(r'''
+class A {
+  m() {}
+  static foo() {
+    m();
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_STATIC]);
+    verify([source]);
+  }
+
+  test_instantiate_to_bounds_not_matching_bounds() async {
+    Source source = addSource('''
+class Foo<T> {}
+class Bar<T extends Foo<T>> {}
+class Baz extends Bar {}
+void main() {}
+''');
+    var result = await computeAnalysisResult(source);
+    // Instantiate-to-bounds should have instantiated "Bar" to "Bar<Foo>"
+    expect(result.unit.declaredElement.getType('Baz').supertype.toString(),
+        'Bar<Foo<dynamic>>');
+    // Therefore there should be an error, since Bar's type argument T is Foo,
+    // which doesn't extends Foo<T>.
+    assertErrors(
+        source, [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
+  }
+
+  test_instantiateEnum_const() async {
+    Source source = addSource(r'''
+enum E { ONE }
+E e(String name) {
+  return const E();
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.INSTANTIATE_ENUM]);
+    verify([source]);
+  }
+
+  test_instantiateEnum_new() async {
+    Source source = addSource(r'''
+enum E { ONE }
+E e(String name) {
+  return new E();
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.INSTANTIATE_ENUM]);
+    verify([source]);
+  }
+
+  test_integerLiteralAsDoubleOutOfRange_excessiveExponent() async {
+    Source source = addSource(
+        'double x = 0xfffffffffffff80000000000000000000000000000000000000000000'
+        '0000000000000000000000000000000000000000000000000000000000000000000000'
+        '0000000000000000000000000000000000000000000000000000000000000000000000'
+        '000000000000000000000000000000000000000000000000000000000000;');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.INTEGER_LITERAL_IMPRECISE_AS_DOUBLE]);
+    AnalysisError error = analysisResults[source].errors[0];
+
+    // Check that we suggest the max double instead.
+    expect(
+        true,
+        error.correction.contains(
+            '179769313486231570814527423731704356798070567525844996598917476803'
+            '157260780028538760589558632766878171540458953514382464234321326889'
+            '464182768467546703537516986049910576551282076245490090389328944075'
+            '868508455133942304583236903222948165808559332123348274797826204144'
+            '723168738177180919299881250404026184124858368'));
+  }
+
+  test_integerLiteralAsDoubleOutOfRange_excessiveMantissa() async {
+    Source source = addSource('double x = 9223372036854775809;');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.INTEGER_LITERAL_IMPRECISE_AS_DOUBLE]);
+    AnalysisError error = analysisResults[source].errors[0];
+    // Check that we suggest a valid double instead.
+    expect(true, error.correction.contains('9223372036854775808'));
+  }
+
+  test_integerLiteralOutOfRange_negative() async {
+    Source source = addSource('int x = -9223372036854775809;');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.INTEGER_LITERAL_OUT_OF_RANGE]);
+  }
+
+  test_integerLiteralOutOfRange_positive() async {
+    Source source = addSource('int x = 9223372036854775808;');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.INTEGER_LITERAL_OUT_OF_RANGE]);
+  }
+
+  test_invalidAnnotation_importWithPrefix_notConstantVariable() async {
+    addNamedSource("/lib.dart", r'''
+library lib;
+final V = 0;''');
+    Source source = addSource(r'''
+import 'lib.dart' as p;
+@p.V
+main() {
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.INVALID_ANNOTATION]);
+    verify([source]);
+  }
+
+  test_invalidAnnotation_importWithPrefix_notVariableOrConstructorInvocation() async {
+    addNamedSource("/lib.dart", r'''
+library lib;
+typedef V();''');
+    Source source = addSource(r'''
+import 'lib.dart' as p;
+@p.V
+main() {
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.INVALID_ANNOTATION]);
+    verify([source]);
+  }
+
+  test_invalidAnnotation_notConstantVariable() async {
+    Source source = addSource(r'''
+final V = 0;
+@V
+main() {
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.INVALID_ANNOTATION]);
+    verify([source]);
+  }
+
+  test_invalidAnnotation_notVariableOrConstructorInvocation() async {
+    Source source = addSource(r'''
+typedef V();
+@V
+main() {
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.INVALID_ANNOTATION]);
+    verify([source]);
+  }
+
+  test_invalidAnnotation_staticMethodReference() async {
+    Source source = addSource(r'''
+class A {
+  static f() {}
+}
+@A.f
+main() {
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.INVALID_ANNOTATION]);
+    verify([source]);
+  }
+
+  test_invalidAnnotationFromDeferredLibrary() async {
+    // See test_invalidAnnotation_notConstantVariable
+    await resolveWithErrors(<String>[
+      r'''
+library lib1;
+class V { const V(); }
+const v = const V();''',
+      r'''
+library root;
+import 'lib1.dart' deferred as a;
+@a.v main () {}'''
+    ], <ErrorCode>[
+      CompileTimeErrorCode.INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY
+    ]);
+  }
+
+  test_invalidAnnotationFromDeferredLibrary_constructor() async {
+    // See test_invalidAnnotation_notConstantVariable
+    await resolveWithErrors(<String>[
+      r'''
+library lib1;
+class C { const C(); }''',
+      r'''
+library root;
+import 'lib1.dart' deferred as a;
+@a.C() main () {}'''
+    ], <ErrorCode>[
+      CompileTimeErrorCode.INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY
+    ]);
+  }
+
+  test_invalidAnnotationFromDeferredLibrary_namedConstructor() async {
+    // See test_invalidAnnotation_notConstantVariable
+    await resolveWithErrors(<String>[
+      r'''
+library lib1;
+class C { const C.name(); }''',
+      r'''
+library root;
+import 'lib1.dart' deferred as a;
+@a.C.name() main () {}'''
+    ], <ErrorCode>[
+      CompileTimeErrorCode.INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY
+    ]);
+  }
+
+  test_invalidAnnotationGetter_getter() async {
+    Source source = addSource(r'''
+get V => 0;
+@V
+main() {
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.INVALID_ANNOTATION_GETTER]);
+    verify([source]);
+  }
+
+  test_invalidAnnotationGetter_importWithPrefix_getter() async {
+    addNamedSource("/lib.dart", r'''
+library lib;
+get V => 0;''');
+    Source source = addSource(r'''
+import 'lib.dart' as p;
+@p.V
+main() {
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.INVALID_ANNOTATION_GETTER]);
+    verify([source]);
+  }
+
+  test_invalidConstructorName_notEnclosingClassName_defined() async {
+    Source source = addSource(r'''
+class A {
+  B() : super();
+}
+class B {}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.INVALID_CONSTRUCTOR_NAME]);
+    // no verify() call, "B" is not resolved
+  }
+
+  test_invalidConstructorName_notEnclosingClassName_undefined() async {
+    Source source = addSource(r'''
+class A {
+  B() : super();
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.INVALID_CONSTRUCTOR_NAME]);
+    // no verify() call, "B" is not resolved
+  }
+
+  test_invalidFactoryNameNotAClass_notClassName() async {
+    Source source = addSource(r'''
+int B;
+class A {
+  factory B() => null;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.INVALID_FACTORY_NAME_NOT_A_CLASS]);
+    verify([source]);
+  }
+
+  test_invalidFactoryNameNotAClass_notEnclosingClassName() async {
+    Source source = addSource(r'''
+class A {
+  factory B() => null;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.INVALID_FACTORY_NAME_NOT_A_CLASS]);
+    // no verify() call, "B" is not resolved
+  }
+
+  test_invalidIdentifierInAsync_async() async {
+    // TODO(brianwilkerson) Report this error.
+    Source source = addSource(r'''
+class A {
+  m() async {
+    int async;
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.INVALID_IDENTIFIER_IN_ASYNC]);
+    verify([source]);
+  }
+
+  test_invalidIdentifierInAsync_await() async {
+    // TODO(brianwilkerson) Report this error.
+    Source source = addSource(r'''
+class A {
+  m() async {
+    int await;
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.INVALID_IDENTIFIER_IN_ASYNC]);
+    verify([source]);
+  }
+
+  test_invalidIdentifierInAsync_yield() async {
+    // TODO(brianwilkerson) Report this error.
+    Source source = addSource(r'''
+class A {
+  m() async {
+    int yield;
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.INVALID_IDENTIFIER_IN_ASYNC]);
+    verify([source]);
+  }
+
+  test_invalidModifierOnConstructor_async() async {
+    Source source = addSource(r'''
+class A {
+  A() async {}
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.INVALID_MODIFIER_ON_CONSTRUCTOR]);
+    verify([source]);
+  }
+
+  test_invalidModifierOnConstructor_asyncStar() async {
+    Source source = addSource(r'''
+class A {
+  A() async* {}
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.INVALID_MODIFIER_ON_CONSTRUCTOR]);
+    verify([source]);
+  }
+
+  test_invalidModifierOnConstructor_syncStar() async {
+    Source source = addSource(r'''
+class A {
+  A() sync* {}
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.INVALID_MODIFIER_ON_CONSTRUCTOR]);
+    verify([source]);
+  }
+
+  test_invalidModifierOnSetter_member_async() async {
+    Source source = addSource(r'''
+class A {
+  set x(v) async {}
+}''');
+    await computeAnalysisResult(source);
+    // TODO(danrubel): Investigate why error message is duplicated when
+    // using fasta parser.
+    assertErrors(
+        source,
+        usingFastaParser
+            ? [
+                CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER,
+                CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER
+              ]
+            : [CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER]);
+    verify([source]);
+  }
+
+  test_invalidModifierOnSetter_member_asyncStar() async {
+    Source source = addSource(r'''
+class A {
+  set x(v) async* {}
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source,
+        usingFastaParser
+            ? [
+                CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER,
+                CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER
+              ]
+            : [CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER]);
+    verify([source]);
+  }
+
+  test_invalidModifierOnSetter_member_syncStar() async {
+    Source source = addSource(r'''
+class A {
+  set x(v) sync* {}
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source,
+        usingFastaParser
+            ? [
+                CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER,
+                CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER
+              ]
+            : [CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER]);
+    verify([source]);
+  }
+
+  test_invalidModifierOnSetter_topLevel_async() async {
+    Source source = addSource("set x(v) async {}");
+    await computeAnalysisResult(source);
+    assertErrors(
+        source,
+        usingFastaParser
+            ? [
+                CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER,
+                CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER
+              ]
+            : [CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER]);
+    verify([source]);
+  }
+
+  test_invalidModifierOnSetter_topLevel_asyncStar() async {
+    Source source = addSource("set x(v) async* {}");
+    await computeAnalysisResult(source);
+    assertErrors(
+        source,
+        usingFastaParser
+            ? [
+                CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER,
+                CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER
+              ]
+            : [CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER]);
+    verify([source]);
+  }
+
+  test_invalidModifierOnSetter_topLevel_syncStar() async {
+    Source source = addSource("set x(v) sync* {}");
+    await computeAnalysisResult(source);
+    assertErrors(
+        source,
+        usingFastaParser
+            ? [
+                CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER,
+                CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER
+              ]
+            : [CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER]);
+    verify([source]);
+  }
+
+  test_invalidReferenceToThis_factoryConstructor() async {
+    Source source = addSource(r'''
+class A {
+  factory A() { return this; }
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.INVALID_REFERENCE_TO_THIS]);
+    verify([source]);
+  }
+
+  test_invalidReferenceToThis_instanceVariableInitializer_inConstructor() async {
+    Source source = addSource(r'''
+class A {
+  var f;
+  A() : f = this;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.INVALID_REFERENCE_TO_THIS]);
+    verify([source]);
+  }
+
+  test_invalidReferenceToThis_instanceVariableInitializer_inDeclaration() async {
+    Source source = addSource(r'''
+class A {
+  var f = this;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.INVALID_REFERENCE_TO_THIS]);
+    verify([source]);
+  }
+
+  test_invalidReferenceToThis_staticMethod() async {
+    Source source = addSource(r'''
+class A {
+  static m() { return this; }
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.INVALID_REFERENCE_TO_THIS]);
+    verify([source]);
+  }
+
+  test_invalidReferenceToThis_staticVariableInitializer() async {
+    Source source = addSource(r'''
+class A {
+  static A f = this;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.INVALID_REFERENCE_TO_THIS]);
+    verify([source]);
+  }
+
+  test_invalidReferenceToThis_superInitializer() async {
+    Source source = addSource(r'''
+class A {
+  A(var x) {}
+}
+class B extends A {
+  B() : super(this);
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.INVALID_REFERENCE_TO_THIS]);
+    verify([source]);
+  }
+
+  test_invalidReferenceToThis_topLevelFunction() async {
+    Source source = addSource("f() { return this; }");
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.INVALID_REFERENCE_TO_THIS]);
+    verify([source]);
+  }
+
+  test_invalidReferenceToThis_variableInitializer() async {
+    Source source = addSource("int x = this;");
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.INVALID_REFERENCE_TO_THIS]);
+    verify([source]);
+  }
+
+  test_invalidTypeArgumentInConstList() async {
+    Source source = addSource(r'''
+class A<E> {
+  m() {
+    return const <E>[];
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_IN_CONST_LIST]);
+    verify([source]);
+  }
+
+  test_invalidTypeArgumentInConstMap() async {
+    Source source = addSource(r'''
+class A<E> {
+  m() {
+    return const <String, E>{};
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_IN_CONST_MAP]);
+    verify([source]);
+  }
+
+  test_invalidUri_export() async {
+    Source source = addSource("export 'ht:';");
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.INVALID_URI]);
+  }
+
+  test_invalidUri_import() async {
+    Source source = addSource("import 'ht:';");
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.INVALID_URI]);
+  }
+
+  test_invalidUri_part() async {
+    Source source = addSource(r'''
+library lib;
+part 'ht:';''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.INVALID_URI]);
+  }
+
+  test_isInConstInstanceCreation_restored() async {
+    // If ErrorVerifier._isInConstInstanceCreation is not properly restored on
+    // exit from visitInstanceCreationExpression, the error at (1) will be
+    // treated as a warning rather than an error.
+    Source source = addSource(r'''
+class Foo<T extends num> {
+  const Foo(x, y);
+}
+const x = const Foo<int>(const Foo<int>(0, 1),
+    const <Foo<String>>[]); // (1)
+''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
+    verify([source]);
+  }
+
+  test_isInInstanceVariableInitializer_restored() async {
+    // If ErrorVerifier._isInInstanceVariableInitializer is not properly
+    // restored on exit from visitVariableDeclaration, the error at (1)
+    // won't be detected.
+    Source source = addSource(r'''
+class Foo {
+  var bar;
+  Map foo = {
+    'bar': () {
+        var _bar;
+    },
+    'bop': _foo // (1)
+  };
+  _foo() {
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER]);
+    verify([source]);
+  }
+
+  test_labelInOuterScope() async {
+    Source source = addSource(r'''
+class A {
+  void m(int i) {
+    l: while (i > 0) {
+      void f() {
+        break l;
+      };
+    }
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.LABEL_IN_OUTER_SCOPE]);
+    // We cannot verify resolution with unresolvable labels
+  }
+
+  test_labelUndefined_break() async {
+    Source source = addSource(r'''
+f() {
+  x: while (true) {
+    break y;
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.LABEL_UNDEFINED, HintCode.UNUSED_LABEL]);
+    // We cannot verify resolution with undefined labels
+  }
+
+  test_labelUndefined_continue() async {
+    Source source = addSource(r'''
+f() {
+  x: while (true) {
+    continue y;
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.LABEL_UNDEFINED, HintCode.UNUSED_LABEL]);
+    // We cannot verify resolution with undefined labels
+  }
+
+  test_length_of_erroneous_constant() async {
+    // Attempting to compute the length of constant that couldn't be evaluated
+    // (due to an error) should not crash the analyzer (see dartbug.com/23383)
+    Source source = addSource("const int i = (1 ? 'alpha' : 'beta').length;");
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE,
+      CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL,
+      StaticTypeWarningCode.NON_BOOL_CONDITION
+    ]);
+    verify([source]);
+  }
+
+  test_memberWithClassName_field() async {
+    Source source = addSource(r'''
+class A {
+  int A = 0;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.MEMBER_WITH_CLASS_NAME]);
+    verify([source]);
+  }
+
+  test_memberWithClassName_field2() async {
+    Source source = addSource(r'''
+class A {
+  int z, A, b = 0;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.MEMBER_WITH_CLASS_NAME]);
+    verify([source]);
+  }
+
+  test_memberWithClassName_getter() async {
+    Source source = addSource(r'''
+class A {
+  get A => 0;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.MEMBER_WITH_CLASS_NAME]);
+    verify([source]);
+  }
+
+  test_memberWithClassName_method() async {
+    // no test because indistinguishable from constructor
+  }
+
+  test_mixinClassDeclaresConstructor_classDeclaration() async {
+    Source source = addSource(r'''
+class A {
+  A() {}
+}
+class B extends Object with A {}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+      source,
+      [CompileTimeErrorCode.MIXIN_CLASS_DECLARES_CONSTRUCTOR],
+    );
+    verify([source]);
+  }
+
+  test_mixinClassDeclaresConstructor_typeAlias() async {
+    Source source = addSource(r'''
+class A {
+  A() {}
+}
+class B = Object with A;''');
+    await computeAnalysisResult(source);
+    assertErrors(
+      source,
+      [CompileTimeErrorCode.MIXIN_CLASS_DECLARES_CONSTRUCTOR],
+    );
+    verify([source]);
+  }
+
+  test_mixinDeferredClass() async {
+    await resolveWithErrors(<String>[
+      r'''
+library lib1;
+class A {}''',
+      r'''
+library root;
+import 'lib1.dart' deferred as a;
+class B extends Object with a.A {}'''
+    ], <ErrorCode>[
+      CompileTimeErrorCode.MIXIN_DEFERRED_CLASS
+    ]);
+  }
+
+  test_mixinDeferredClass_classTypeAlias() async {
+    await resolveWithErrors(<String>[
+      r'''
+library lib1;
+class A {}''',
+      r'''
+library root;
+import 'lib1.dart' deferred as a;
+class B {}
+class C = B with a.A;'''
+    ], <ErrorCode>[
+      CompileTimeErrorCode.MIXIN_DEFERRED_CLASS
+    ]);
+  }
+
+  test_mixinInference_matchingClass_inPreviousMixin_new_syntax() async {
+    Source source = addSource('''
+abstract class A<T> {}
+class B {}
+mixin M1 implements A<B> {}
+mixin M2<T> on A<T> {}
+class C extends Object with M1, M2 {}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+  }
+
+  test_mixinInference_matchingClass_new_syntax() async {
+    Source source = addSource('''
+abstract class A<T> {}
+class B {}
+mixin M<T> on A<T> {}
+class C extends A<int> with M {}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+  }
+
+  test_mixinInference_noMatchingClass_namedMixinApplication_new_syntax() async {
+    Source source = addSource('''
+abstract class A<T> {}
+class B {}
+mixin M<T> on A<T> {}
+class C = Object with M;
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source,
+        [CompileTimeErrorCode.MIXIN_APPLICATION_NOT_IMPLEMENTED_INTERFACE]);
+  }
+
+  test_mixinInference_noMatchingClass_new_syntax() async {
+    Source source = addSource('''
+abstract class A<T> {}
+class B {}
+mixin M<T> on A<T> {}
+class C extends Object with M {}
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source,
+        [CompileTimeErrorCode.MIXIN_APPLICATION_NOT_IMPLEMENTED_INTERFACE]);
+  }
+
+  test_mixinInference_noMatchingClass_noSuperclassConstraint_new_syntax() async {
+    Source source = addSource('''
+abstract class A<T> {}
+class B {}
+mixin M<T> {}
+class C extends Object with M {}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+  }
+
+  test_mixinInference_noMatchingClass_typeParametersSupplied_new_syntax() async {
+    Source source = addSource('''
+abstract class A<T> {}
+class B {}
+mixin M<T> on A<T> {}
+class C extends Object with M<int> {}
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source,
+        [CompileTimeErrorCode.MIXIN_APPLICATION_NOT_IMPLEMENTED_INTERFACE]);
+  }
+
+  test_mixinInference_recursiveSubtypeCheck_new_syntax() async {
+    // See dartbug.com/32353 for a detailed explanation.
+    Source source = addSource('''
+class ioDirectory implements ioFileSystemEntity {}
+
+class ioFileSystemEntity {}
+
+abstract class _LocalDirectory
+    extends _LocalFileSystemEntity<_LocalDirectory, ioDirectory>
+    with ForwardingDirectory, DirectoryAddOnsMixin {}
+
+abstract class _LocalFileSystemEntity<T extends FileSystemEntity,
+  D extends ioFileSystemEntity> extends ForwardingFileSystemEntity<T, D> {}
+
+abstract class FileSystemEntity implements ioFileSystemEntity {}
+
+abstract class ForwardingFileSystemEntity<T extends FileSystemEntity,
+  D extends ioFileSystemEntity> implements FileSystemEntity {}
+
+
+mixin ForwardingDirectory<T extends Directory>
+    on ForwardingFileSystemEntity<T, ioDirectory>
+    implements Directory {}
+
+abstract class Directory implements FileSystemEntity, ioDirectory {}
+
+mixin DirectoryAddOnsMixin implements Directory {}
+''');
+    var analysisResult = await computeAnalysisResult(source);
+    assertNoErrors(source);
+    var mixins =
+        analysisResult.unit.declaredElement.getType('_LocalDirectory').mixins;
+    expect(mixins[0].toString(), 'ForwardingDirectory<_LocalDirectory>');
+  }
+
+  test_mixinInheritsFromNotObject_classDeclaration_extends() async {
+    Source source = addSource(r'''
+class A {}
+class B extends A {}
+class C extends Object with B {}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT]);
+    verify([source]);
+  }
+
+  test_mixinInheritsFromNotObject_classDeclaration_with() async {
+    Source source = addSource(r'''
+class A {}
+class B extends Object with A {}
+class C extends Object with B {}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT]);
+    verify([source]);
+  }
+
+  test_mixinInheritsFromNotObject_typeAlias_extends() async {
+    Source source = addSource(r'''
+class A {}
+class B extends A {}
+class C = Object with B;''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT]);
+    verify([source]);
+  }
+
+  test_mixinInheritsFromNotObject_typeAlias_with() async {
+    Source source = addSource(r'''
+class A {}
+class B extends Object with A {}
+class C = Object with B;''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT]);
+    verify([source]);
+  }
+
+  test_mixinOfDisallowedClass_class_bool() async {
+    Source source = addSource("class A extends Object with bool {}");
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS]);
+    verify([source]);
+  }
+
+  test_mixinOfDisallowedClass_class_double() async {
+    Source source = addSource("class A extends Object with double {}");
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS]);
+    verify([source]);
+  }
+
+  test_mixinOfDisallowedClass_class_int() async {
+    Source source = addSource("class A extends Object with int {}");
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS]);
+    verify([source]);
+  }
+
+  test_mixinOfDisallowedClass_class_Null() async {
+    Source source = addSource("class A extends Object with Null {}");
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS]);
+    verify([source]);
+  }
+
+  test_mixinOfDisallowedClass_class_num() async {
+    Source source = addSource("class A extends Object with num {}");
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS]);
+    verify([source]);
+  }
+
+  test_mixinOfDisallowedClass_class_String() async {
+    Source source = addSource("class A extends Object with String {}");
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS]);
+    verify([source]);
+  }
+
+  test_mixinOfDisallowedClass_classTypeAlias_bool() async {
+    Source source = addSource(r'''
+class A {}
+class C = A with bool;''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS]);
+    verify([source]);
+  }
+
+  test_mixinOfDisallowedClass_classTypeAlias_double() async {
+    Source source = addSource(r'''
+class A {}
+class C = A with double;''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS]);
+    verify([source]);
+  }
+
+  test_mixinOfDisallowedClass_classTypeAlias_int() async {
+    Source source = addSource(r'''
+class A {}
+class C = A with int;''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS]);
+    verify([source]);
+  }
+
+  test_mixinOfDisallowedClass_classTypeAlias_Null() async {
+    Source source = addSource(r'''
+class A {}
+class C = A with Null;''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS]);
+    verify([source]);
+  }
+
+  test_mixinOfDisallowedClass_classTypeAlias_num() async {
+    Source source = addSource(r'''
+class A {}
+class C = A with num;''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS]);
+    verify([source]);
+  }
+
+  test_mixinOfDisallowedClass_classTypeAlias_String() async {
+    Source source = addSource(r'''
+class A {}
+class C = A with String;''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS]);
+    verify([source]);
+  }
+
+  test_mixinOfDisallowedClass_classTypeAlias_String_num() async {
+    Source source = addSource(r'''
+class A {}
+class C = A with String, num;''');
+    await computeAnalysisResult(source);
+    if (enableNewAnalysisDriver) {
+      assertErrors(source, [
+        CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS,
+        CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS
+      ]);
+    } else {
+      assertErrors(source, [
+        CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS,
+        CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS
+      ]);
+    }
+    verify([source]);
+  }
+
+  test_mixinOfNonClass() async {
+    // TODO(brianwilkerson) Compare with MIXIN_WITH_NON_CLASS_SUPERCLASS.
+    Source source = addSource(r'''
+var A;
+class B extends Object mixin A {}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.MIXIN_OF_NON_CLASS]);
+    verify([source]);
+  }
+
+  test_mixinOfNonClass_class() async {
+    Source source = addSource(r'''
+int A;
+class B extends Object with A {}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.MIXIN_OF_NON_CLASS]);
+    verify([source]);
+  }
+
+  test_mixinOfNonClass_enum() async {
+    Source source = addSource(r'''
+enum E { ONE }
+class A extends Object with E {}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.MIXIN_OF_NON_CLASS]);
+    verify([source]);
+  }
+
+  test_mixinOfNonClass_typeAlias() async {
+    Source source = addSource(r'''
+class A {}
+int B;
+class C = A with B;''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.MIXIN_OF_NON_CLASS]);
+    verify([source]);
+  }
+
+  test_mixinReferencesSuper() async {
+    Source source = addSource(r'''
+class A {
+  toString() => super.toString();
+}
+class B extends Object with A {}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.MIXIN_REFERENCES_SUPER]);
+    verify([source]);
+  }
+
+  test_mixinWithNonClassSuperclass_class() async {
+    Source source = addSource(r'''
+int A;
+class B {}
+class C extends A with B {}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.MIXIN_WITH_NON_CLASS_SUPERCLASS]);
+    verify([source]);
+  }
+
+  test_mixinWithNonClassSuperclass_typeAlias() async {
+    Source source = addSource(r'''
+int A;
+class B {}
+class C = A with B;''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.MIXIN_WITH_NON_CLASS_SUPERCLASS]);
+    verify([source]);
+  }
+
+  test_multipleRedirectingConstructorInvocations() async {
+    Source source = addSource(r'''
+class A {
+  A() : this.a(), this.b();
+  A.a() {}
+  A.b() {}
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source,
+        [CompileTimeErrorCode.MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS]);
+    verify([source]);
+  }
+
+  test_multipleSuperInitializers() async {
+    Source source = addSource(r'''
+class A {}
+class B extends A {
+  B() : super(), super() {}
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CompileTimeErrorCode.MULTIPLE_SUPER_INITIALIZERS,
+      StrongModeCode.INVALID_SUPER_INVOCATION
+    ]);
+    verify([source]);
+  }
+
+  test_nativeClauseInNonSDKCode() async {
+    // TODO(jwren) Move this test somewhere else: This test verifies a parser
+    // error code is generated through the ErrorVerifier, it is not a
+    // CompileTimeErrorCode.
+    Source source = addSource("class A native 'string' {}");
+    await computeAnalysisResult(source);
+    assertErrors(source, [ParserErrorCode.NATIVE_CLAUSE_IN_NON_SDK_CODE]);
+    verify([source]);
+  }
+
+  test_nativeFunctionBodyInNonSDKCode_function() async {
+    // TODO(jwren) Move this test somewhere else: This test verifies a parser
+    // error code is generated through the ErrorVerifier, it is not a
+    // CompileTimeErrorCode.
+    Source source = addSource("int m(a) native 'string';");
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [ParserErrorCode.NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE]);
+    verify([source]);
+  }
+
+  test_nativeFunctionBodyInNonSDKCode_method() async {
+    // TODO(jwren) Move this test somewhere else: This test verifies a parser
+    // error code is generated through the ErrorVerifier, it is not a
+    // CompileTimeErrorCode.
+    Source source = addSource(r'''
+class A{
+  static int m(a) native 'string';
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [ParserErrorCode.NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE]);
+    verify([source]);
+  }
+
+  test_noAnnotationConstructorArguments() async {
+    Source source = addSource(r'''
+class A {
+  const A();
+}
+@A
+main() {
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS]);
+    verify([source]);
+  }
+
+  test_noDefaultSuperConstructorExplicit() async {
+    Source source = addSource(r'''
+class A {
+  A(p);
+}
+class B extends A {
+  B() {}
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT]);
+    verify([source]);
+  }
+
+  test_noDefaultSuperConstructorImplicit_superHasParameters() async {
+    Source source = addSource(r'''
+class A {
+  A(p);
+}
+class B extends A {
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT]);
+    verify([source]);
+  }
+
+  test_noDefaultSuperConstructorImplicit_superOnlyNamed() async {
+    Source source = addSource(r'''
+class A { A.named() {} }
+class B extends A {}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT]);
+    verify([source]);
+  }
+
+  test_nonConstantAnnotationConstructor_named() async {
+    Source source = addSource(r'''
+class A {
+  A.fromInt() {}
+}
+@A.fromInt()
+main() {
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.NON_CONSTANT_ANNOTATION_CONSTRUCTOR]);
+    verify([source]);
+  }
+
+  test_nonConstantAnnotationConstructor_unnamed() async {
+    Source source = addSource(r'''
+class A {
+  A() {}
+}
+@A()
+main() {
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.NON_CONSTANT_ANNOTATION_CONSTRUCTOR]);
+    verify([source]);
+  }
+
+  test_nonConstantDefaultValue_function_named() async {
+    Source source = addSource(r'''
+int y;
+f({x : y}) {}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE]);
+    verify([source]);
+  }
+
+  test_nonConstantDefaultValue_function_positional() async {
+    Source source = addSource(r'''
+int y;
+f([x = y]) {}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE]);
+    verify([source]);
+  }
+
+  test_nonConstantDefaultValue_inConstructor_named() async {
+    Source source = addSource(r'''
+class A {
+  int y;
+  A({x : y}) {}
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE]);
+    verify([source]);
+  }
+
+  test_nonConstantDefaultValue_inConstructor_positional() async {
+    Source source = addSource(r'''
+class A {
+  int y;
+  A([x = y]) {}
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE]);
+    verify([source]);
+  }
+
+  test_nonConstantDefaultValue_method_named() async {
+    Source source = addSource(r'''
+class A {
+  int y;
+  m({x : y}) {}
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE]);
+    verify([source]);
+  }
+
+  test_nonConstantDefaultValue_method_positional() async {
+    Source source = addSource(r'''
+class A {
+  int y;
+  m([x = y]) {}
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE]);
+    verify([source]);
+  }
+
+  test_nonConstantDefaultValueFromDeferredLibrary() async {
+    await resolveWithErrors(<String>[
+      r'''
+library lib1;
+const V = 1;''',
+      r'''
+library root;
+import 'lib1.dart' deferred as a;
+f({x : a.V}) {}'''
+    ], <ErrorCode>[
+      CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED_LIBRARY
+    ]);
+  }
+
+  test_nonConstantDefaultValueFromDeferredLibrary_nested() async {
+    await resolveWithErrors(<String>[
+      r'''
+library lib1;
+const V = 1;''',
+      r'''
+library root;
+import 'lib1.dart' deferred as a;
+f({x : a.V + 1}) {}'''
+    ], <ErrorCode>[
+      CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED_LIBRARY
+    ]);
+  }
+
+  test_nonConstCaseExpression() async {
+    Source source = addSource(r'''
+f(int p, int q) {
+  switch (p) {
+    case 3 + q:
+      break;
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.NON_CONSTANT_CASE_EXPRESSION]);
+    verify([source]);
+  }
+
+  test_nonConstCaseExpressionFromDeferredLibrary() async {
+    await resolveWithErrors(<String>[
+      r'''
+library lib1;
+const int c = 1;''',
+      r'''
+library root;
+import 'lib1.dart' deferred as a;
+main (int p) {
+  switch (p) {
+    case a.c:
+      break;
+  }
+}'''
+    ], [
+      CompileTimeErrorCode.NON_CONSTANT_CASE_EXPRESSION_FROM_DEFERRED_LIBRARY
+    ]);
+  }
+
+  test_nonConstCaseExpressionFromDeferredLibrary_nested() async {
+    await resolveWithErrors(<String>[
+      r'''
+library lib1;
+const int c = 1;''',
+      r'''
+library root;
+import 'lib1.dart' deferred as a;
+main (int p) {
+  switch (p) {
+    case a.c + 1:
+      break;
+  }
+}'''
+    ], [
+      CompileTimeErrorCode.NON_CONSTANT_CASE_EXPRESSION_FROM_DEFERRED_LIBRARY
+    ]);
+  }
+
+  test_nonConstListElement() async {
+    Source source = addSource(r'''
+f(a) {
+  return const [a];
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.NON_CONSTANT_LIST_ELEMENT]);
+    verify([source]);
+  }
+
+  test_nonConstListElementFromDeferredLibrary() async {
+    await resolveWithErrors(<String>[
+      r'''
+library lib1;
+const int c = 1;''',
+      r'''
+library root;
+import 'lib1.dart' deferred as a;
+f() {
+  return const [a.c];
+}'''
+    ], [
+      CompileTimeErrorCode.NON_CONSTANT_LIST_ELEMENT_FROM_DEFERRED_LIBRARY
+    ]);
+  }
+
+  test_nonConstListElementFromDeferredLibrary_nested() async {
+    await resolveWithErrors(<String>[
+      r'''
+library lib1;
+const int c = 1;''',
+      r'''
+library root;
+import 'lib1.dart' deferred as a;
+f() {
+  return const [a.c + 1];
+}'''
+    ], [
+      CompileTimeErrorCode.NON_CONSTANT_LIST_ELEMENT_FROM_DEFERRED_LIBRARY
+    ]);
+  }
+
+  test_nonConstMapAsExpressionStatement_begin() async {
+    Source source = addSource(r'''
+f() {
+  {'a' : 0, 'b' : 1}.length;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source,
+        usingFastaParser
+            ? [
+                // TODO(danrubel): Consider improving recovery
+                ParserErrorCode.EXPECTED_TOKEN,
+                ParserErrorCode.EXPECTED_TOKEN,
+                ParserErrorCode.EXPECTED_TOKEN,
+                ParserErrorCode.EXPECTED_TOKEN,
+                ParserErrorCode.EXPECTED_TOKEN,
+                ParserErrorCode.EXPECTED_TOKEN,
+                ParserErrorCode.EXPECTED_TOKEN,
+                ParserErrorCode.MISSING_IDENTIFIER,
+                ParserErrorCode.MISSING_IDENTIFIER,
+                ParserErrorCode.MISSING_IDENTIFIER,
+                ParserErrorCode.MISSING_IDENTIFIER,
+                ParserErrorCode.UNEXPECTED_TOKEN,
+                ParserErrorCode.UNEXPECTED_TOKEN,
+                ParserErrorCode.UNEXPECTED_TOKEN,
+              ]
+            : [CompileTimeErrorCode.NON_CONST_MAP_AS_EXPRESSION_STATEMENT]);
+    verify([source]);
+  }
+
+  test_nonConstMapAsExpressionStatement_only() async {
+    Source source = addSource(r'''
+f() {
+  {'a' : 0, 'b' : 1};
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source,
+        usingFastaParser
+            ? [
+                ParserErrorCode.EXPECTED_TOKEN,
+                ParserErrorCode.EXPECTED_TOKEN,
+                ParserErrorCode.EXPECTED_TOKEN,
+                ParserErrorCode.EXPECTED_TOKEN,
+                ParserErrorCode.EXPECTED_TOKEN,
+                ParserErrorCode.EXPECTED_TOKEN,
+                ParserErrorCode.EXPECTED_TOKEN,
+                ParserErrorCode.MISSING_IDENTIFIER,
+                ParserErrorCode.MISSING_IDENTIFIER,
+                ParserErrorCode.MISSING_IDENTIFIER,
+                ParserErrorCode.UNEXPECTED_TOKEN,
+                ParserErrorCode.UNEXPECTED_TOKEN,
+                ParserErrorCode.UNEXPECTED_TOKEN,
+              ]
+            : [CompileTimeErrorCode.NON_CONST_MAP_AS_EXPRESSION_STATEMENT]);
+    verify([source]);
+  }
+
+  test_nonConstMapKey() async {
+    Source source = addSource(r'''
+f(a) {
+  return const {a : 0};
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.NON_CONSTANT_MAP_KEY]);
+    verify([source]);
+  }
+
+  test_nonConstMapKeyFromDeferredLibrary() async {
+    await resolveWithErrors(<String>[
+      r'''
+library lib1;
+const int c = 1;''',
+      r'''
+library root;
+import 'lib1.dart' deferred as a;
+f() {
+  return const {a.c : 0};
+}'''
+    ], [
+      CompileTimeErrorCode.NON_CONSTANT_MAP_KEY_FROM_DEFERRED_LIBRARY
+    ]);
+  }
+
+  test_nonConstMapKeyFromDeferredLibrary_nested() async {
+    await resolveWithErrors(<String>[
+      r'''
+library lib1;
+const int c = 1;''',
+      r'''
+library root;
+import 'lib1.dart' deferred as a;
+f() {
+  return const {a.c + 1 : 0};
+}'''
+    ], [
+      CompileTimeErrorCode.NON_CONSTANT_MAP_KEY_FROM_DEFERRED_LIBRARY
+    ]);
+  }
+
+  test_nonConstMapValue() async {
+    Source source = addSource(r'''
+f(a) {
+  return const {'a' : a};
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.NON_CONSTANT_MAP_VALUE]);
+    verify([source]);
+  }
+
+  test_nonConstMapValueFromDeferredLibrary() async {
+    await resolveWithErrors(<String>[
+      r'''
+library lib1;
+const int c = 1;''',
+      r'''
+library root;
+import 'lib1.dart' deferred as a;
+f() {
+  return const {'a' : a.c};
+}'''
+    ], [
+      CompileTimeErrorCode.NON_CONSTANT_MAP_VALUE_FROM_DEFERRED_LIBRARY
+    ]);
+  }
+
+  test_nonConstMapValueFromDeferredLibrary_nested() async {
+    await resolveWithErrors(<String>[
+      r'''
+library lib1;
+const int c = 1;''',
+      r'''
+library root;
+import 'lib1.dart' deferred as a;
+f() {
+  return const {'a' : a.c + 1};
+}'''
+    ], [
+      CompileTimeErrorCode.NON_CONSTANT_MAP_VALUE_FROM_DEFERRED_LIBRARY
+    ]);
+  }
+
+  test_nonConstValueInInitializer_assert_condition() async {
+    Source source = addSource(r'''
+class A {
+  const A(int i) : assert(i.isNegative);
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.NON_CONSTANT_VALUE_IN_INITIALIZER]);
+    verify([source]);
+  }
+
+  test_nonConstValueInInitializer_assert_message() async {
+    Source source = addSource(r'''
+class A {
+  const A(int i) : assert(i < 0, 'isNegative = ${i.isNegative}');
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.NON_CONSTANT_VALUE_IN_INITIALIZER]);
+    verify([source]);
+  }
+
+  test_nonConstValueInInitializer_binary_notBool_left() async {
+    Source source = addSource(r'''
+class A {
+  final bool a;
+  const A(String p) : a = p && true;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL,
+      StaticTypeWarningCode.NON_BOOL_OPERAND
+    ]);
+    verify([source]);
+  }
+
+  test_nonConstValueInInitializer_binary_notBool_right() async {
+    Source source = addSource(r'''
+class A {
+  final bool a;
+  const A(String p) : a = true && p;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL,
+      StaticTypeWarningCode.NON_BOOL_OPERAND
+    ]);
+    verify([source]);
+  }
+
+  test_nonConstValueInInitializer_binary_notInt() async {
+    Source source = addSource(r'''
+class A {
+  final int a;
+  const A(String p) : a = 5 & p;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL_INT,
+      StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE
+    ]);
+    verify([source]);
+  }
+
+  test_nonConstValueInInitializer_binary_notNum() async {
+    Source source = addSource(r'''
+class A {
+  final int a;
+  const A(String p) : a = 5 + p;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CompileTimeErrorCode.CONST_EVAL_TYPE_NUM,
+      StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE
+    ]);
+    verify([source]);
+  }
+
+  test_nonConstValueInInitializer_field() async {
+    Source source = addSource(r'''
+class A {
+  static int C;
+  final int a;
+  const A() : a = C;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.NON_CONSTANT_VALUE_IN_INITIALIZER]);
+    verify([source]);
+  }
+
+  test_nonConstValueInInitializer_instanceCreation() async {
+    Source source = addSource(r'''
+class A {
+  A();
+}
+class B {
+  const B() : a = new A();
+  final a;
+}
+var b = const B();''');
+    // TODO(scheglov): the error CONST_EVAL_THROWS_EXCEPTION is redundant and
+    // ought to be suppressed. Or not?
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CompileTimeErrorCode.NON_CONSTANT_VALUE_IN_INITIALIZER,
+      CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION
+    ]);
+    verify([source]);
+  }
+
+  test_nonConstValueInInitializer_instanceCreation_inDifferentFile() async {
+    Source sourceA = addNamedSource('/a.dart', r'''
+import 'b.dart';
+const v = const MyClass();
+''');
+    Source sourceB = addNamedSource('/b.dart', r'''
+class MyClass {
+  const MyClass([p = foo]);
+}
+''');
+    await computeAnalysisResult(sourceA);
+    assertNoErrors(sourceA);
+    await computeAnalysisResult(sourceB);
+    assertErrors(sourceB, [
+      CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE,
+      StaticWarningCode.UNDEFINED_IDENTIFIER
+    ]);
+  }
+
+  test_nonConstValueInInitializer_redirecting() async {
+    Source source = addSource(r'''
+class A {
+  static var C;
+  const A.named(p);
+  const A() : this.named(C);
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.NON_CONSTANT_VALUE_IN_INITIALIZER]);
+    verify([source]);
+  }
+
+  test_nonConstValueInInitializer_super() async {
+    Source source = addSource(r'''
+class A {
+  const A(p);
+}
+class B extends A {
+  static var C;
+  const B() : super(C);
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.NON_CONSTANT_VALUE_IN_INITIALIZER]);
+    verify([source]);
+  }
+
+  test_nonConstValueInInitializerFromDeferredLibrary_field() async {
+    await resolveWithErrors(<String>[
+      r'''
+library lib1;
+const int c = 1;''',
+      r'''
+library root;
+import 'lib1.dart' deferred as a;
+class A {
+  final int x;
+  const A() : x = a.c;
+}'''
+    ], <ErrorCode>[
+      CompileTimeErrorCode
+          .NON_CONSTANT_VALUE_IN_INITIALIZER_FROM_DEFERRED_LIBRARY
+    ]);
+  }
+
+  test_nonConstValueInInitializerFromDeferredLibrary_field_nested() async {
+    await resolveWithErrors(<String>[
+      r'''
+library lib1;
+const int c = 1;''',
+      r'''
+library root;
+import 'lib1.dart' deferred as a;
+class A {
+  final int x;
+  const A() : x = a.c + 1;
+}'''
+    ], <ErrorCode>[
+      CompileTimeErrorCode
+          .NON_CONSTANT_VALUE_IN_INITIALIZER_FROM_DEFERRED_LIBRARY
+    ]);
+  }
+
+  test_nonConstValueInInitializerFromDeferredLibrary_redirecting() async {
+    await resolveWithErrors(<String>[
+      r'''
+library lib1;
+const int c = 1;''',
+      r'''
+library root;
+import 'lib1.dart' deferred as a;
+class A {
+  const A.named(p);
+  const A() : this.named(a.c);
+}'''
+    ], <ErrorCode>[
+      CompileTimeErrorCode
+          .NON_CONSTANT_VALUE_IN_INITIALIZER_FROM_DEFERRED_LIBRARY
+    ]);
+  }
+
+  test_nonConstValueInInitializerFromDeferredLibrary_super() async {
+    await resolveWithErrors(<String>[
+      r'''
+library lib1;
+const int c = 1;''',
+      r'''
+library root;
+import 'lib1.dart' deferred as a;
+class A {
+  const A(p);
+}
+class B extends A {
+  const B() : super(a.c);
+}'''
+    ], <ErrorCode>[
+      CompileTimeErrorCode
+          .NON_CONSTANT_VALUE_IN_INITIALIZER_FROM_DEFERRED_LIBRARY
+    ]);
+  }
+
+  test_nonGenerativeConstructor_explicit() async {
+    Source source = addSource(r'''
+class A {
+  factory A.named() => null;
+}
+class B extends A {
+  B() : super.named();
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.NON_GENERATIVE_CONSTRUCTOR]);
+    verify([source]);
+  }
+
+  test_nonGenerativeConstructor_implicit() async {
+    Source source = addSource(r'''
+class A {
+  factory A() => null;
+}
+class B extends A {
+  B();
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.NON_GENERATIVE_CONSTRUCTOR]);
+    verify([source]);
+  }
+
+  test_nonGenerativeConstructor_implicit2() async {
+    Source source = addSource(r'''
+class A {
+  factory A() => null;
+}
+class B extends A {
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.NON_GENERATIVE_CONSTRUCTOR]);
+    verify([source]);
+  }
+
+  test_notEnoughRequiredArguments_const() async {
+    Source source = addSource(r'''
+class A {
+  const A(int p);
+}
+main() {
+  const A();
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.NOT_ENOUGH_REQUIRED_ARGUMENTS]);
+    verify([source]);
+  }
+
+  test_notEnoughRequiredArguments_const_super() async {
+    Source source = addSource(r'''
+class A {
+  const A(int p);
+}
+class B extends A {
+  const B() : super();
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.NOT_ENOUGH_REQUIRED_ARGUMENTS]);
+    verify([source]);
+  }
+
+  test_objectCannotExtendAnotherClass() async {
+    Source source = addSource(r'''
+''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.OBJECT_CANNOT_EXTEND_ANOTHER_CLASS]);
+    verify([source]);
+  }
+
+  test_optionalParameterInOperator_named() async {
+    Source source = addSource(r'''
+class A {
+  operator +({p}) {}
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.OPTIONAL_PARAMETER_IN_OPERATOR]);
+    verify([source]);
+  }
+
+  test_optionalParameterInOperator_positional() async {
+    Source source = addSource(r'''
+class A {
+  operator +([p]) {}
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.OPTIONAL_PARAMETER_IN_OPERATOR]);
+    verify([source]);
+  }
+
+  test_partOfNonPart() async {
+    Source source = addSource(r'''
+library l1;
+part 'l2.dart';''');
+    addNamedSource("/l2.dart", "library l2;");
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.PART_OF_NON_PART]);
+    verify([source]);
+  }
+
+  test_partOfNonPart_self() async {
+    Source source = addSource(r'''
+library lib;
+part 'test.dart';''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.PART_OF_NON_PART]);
+    verify([source]);
+  }
+
+  test_prefix_assignment_compound_in_method() async {
+    addNamedSource('/lib.dart', 'library lib;');
+    Source source = addSource('''
+import 'lib.dart' as p;
+class C {
+  f() {
+    p += 1;
+  }
+}
+''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT]);
+    verify([source]);
+  }
+
+  test_prefix_assignment_compound_not_in_method() async {
+    addNamedSource('/lib.dart', 'library lib;');
+    Source source = addSource('''
+import 'lib.dart' as p;
+f() {
+  p += 1;
+}
+''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT]);
+    verify([source]);
+  }
+
+  test_prefix_assignment_in_method() async {
+    addNamedSource('/lib.dart', 'library lib;');
+    Source source = addSource('''
+import 'lib.dart' as p;
+class C {
+  f() {
+    p = 1;
+  }
+}
+''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT]);
+    verify([source]);
+  }
+
+  test_prefix_assignment_not_in_method() async {
+    addNamedSource('/lib.dart', 'library lib;');
+    Source source = addSource('''
+import 'lib.dart' as p;
+f() {
+  p = 1;
+}
+''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT]);
+    verify([source]);
+  }
+
+  test_prefix_conditionalPropertyAccess_call_loadLibrary() async {
+    addNamedSource('/lib.dart', '''
+library lib;
+''');
+    Source source = addSource('''
+import 'lib.dart' deferred as p;
+f() {
+  p?.loadLibrary();
+}
+''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT]);
+    verify([source]);
+  }
+
+  test_prefix_conditionalPropertyAccess_get() async {
+    addNamedSource('/lib.dart', '''
+library lib;
+var x;
+''');
+    Source source = addSource('''
+import 'lib.dart' as p;
+f() {
+  return p?.x;
+}
+''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT]);
+    verify([source]);
+  }
+
+  test_prefix_conditionalPropertyAccess_get_loadLibrary() async {
+    addNamedSource('/lib.dart', '''
+library lib;
+''');
+    Source source = addSource('''
+import 'lib.dart' deferred as p;
+f() {
+  return p?.loadLibrary;
+}
+''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT]);
+    verify([source]);
+  }
+
+  test_prefix_conditionalPropertyAccess_set() async {
+    addNamedSource('/lib.dart', '''
+library lib;
+var x;
+''');
+    Source source = addSource('''
+import 'lib.dart' as p;
+f() {
+  p?.x = null;
+}
+''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT]);
+    verify([source]);
+  }
+
+  test_prefix_conditionalPropertyAccess_set_loadLibrary() async {
+    addNamedSource('/lib.dart', '''
+library lib;
+''');
+    Source source = addSource('''
+import 'lib.dart' deferred as p;
+f() {
+  p?.loadLibrary = null;
+}
+''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT]);
+    verify([source]);
+  }
+
+  test_prefixCollidesWithTopLevelMembers_functionTypeAlias() async {
+    addNamedSource("/lib.dart", r'''
+library lib;
+class A{}''');
+    Source source = addSource(r'''
+import 'lib.dart' as p;
+typedef p();
+p.A a;''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER]);
+    verify([source]);
+  }
+
+  test_prefixCollidesWithTopLevelMembers_topLevelFunction() async {
+    addNamedSource("/lib.dart", r'''
+library lib;
+class A{}''');
+    Source source = addSource(r'''
+import 'lib.dart' as p;
+p() {}
+p.A a;''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER]);
+    verify([source]);
+  }
+
+  test_prefixCollidesWithTopLevelMembers_topLevelVariable() async {
+    addNamedSource("/lib.dart", r'''
+library lib;
+class A{}''');
+    Source source = addSource(r'''
+import 'lib.dart' as p;
+var p = null;
+p.A a;''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER]);
+    verify([source]);
+  }
+
+  test_prefixCollidesWithTopLevelMembers_type() async {
+    addNamedSource("/lib.dart", r'''
+library lib;
+class A{}''');
+    Source source = addSource(r'''
+import 'lib.dart' as p;
+class p {}
+p.A a;''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER]);
+    verify([source]);
+  }
+
+  test_prefixNotFollowedByDot() async {
+    addNamedSource('/lib.dart', 'library lib;');
+    Source source = addSource('''
+import 'lib.dart' as p;
+f() {
+  return p;
+}
+''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT]);
+    verify([source]);
+  }
+
+  test_prefixNotFollowedByDot_compoundAssignment() async {
+    addNamedSource('/lib.dart', 'library lib;');
+    Source source = addSource('''
+import 'lib.dart' as p;
+f() {
+  p += 1;
+}
+''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT]);
+    verify([source]);
+  }
+
+  test_prefixNotFollowedByDot_conditionalMethodInvocation() async {
+    addNamedSource('/lib.dart', '''
+library lib;
+g() {}
+''');
+    Source source = addSource('''
+import 'lib.dart' as p;
+f() {
+  p?.g();
+}
+''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT]);
+    verify([source]);
+  }
+
+  test_privateCollisionInClassTypeAlias_mixinAndMixin() {
+    return _privateCollisionInMixinApplicationTest('''
+import 'lib1.dart';
+class C = Object with A, B;
+''');
+  }
+
+  test_privateCollisionInClassTypeAlias_mixinAndMixin_indirect() {
+    return _privateCollisionInMixinApplicationTest('''
+import 'lib1.dart';
+class C = Object with A;
+class D = C with B;
+''');
+  }
+
+  test_privateCollisionInClassTypeAlias_superclassAndMixin() {
+    return _privateCollisionInMixinApplicationTest('''
+import 'lib1.dart';
+class C = A with B;
+''');
+  }
+
+  test_privateCollisionInClassTypeAlias_superclassAndMixin_same() {
+    return _privateCollisionInMixinApplicationTest('''
+import 'lib1.dart';
+class C = A with A;
+''');
+  }
+
+  test_privateCollisionInMixinApplication_mixinAndMixin() {
+    return _privateCollisionInMixinApplicationTest('''
+import 'lib1.dart';
+class C extends Object with A, B {}
+''');
+  }
+
+  test_privateCollisionInMixinApplication_mixinAndMixin_indirect() {
+    return _privateCollisionInMixinApplicationTest('''
+import 'lib1.dart';
+class C extends Object with A {}
+class D extends C with B {}
+''');
+  }
+
+  test_privateCollisionInMixinApplication_superclassAndMixin() {
+    return _privateCollisionInMixinApplicationTest('''
+import 'lib1.dart';
+class C extends A with B {}
+''');
+  }
+
+  test_privateCollisionInMixinApplication_superclassAndMixin_same() {
+    return _privateCollisionInMixinApplicationTest('''
+import 'lib1.dart';
+class C extends A with A {}
+''');
+  }
+
+  test_privateOptionalParameter() async {
+    Source source = addSource("f({var _p}) {}");
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.PRIVATE_OPTIONAL_PARAMETER]);
+    verify([source]);
+  }
+
+  test_privateOptionalParameter_fieldFormal() async {
+    Source source = addSource(r'''
+class A {
+  var _p;
+  A({this._p: 0});
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.PRIVATE_OPTIONAL_PARAMETER]);
+    verify([source]);
+  }
+
+  test_privateOptionalParameter_withDefaultValue() async {
+    Source source = addSource("f({_p : 0}) {}");
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.PRIVATE_OPTIONAL_PARAMETER]);
+    verify([source]);
+  }
+
+  test_recursiveCompileTimeConstant() async {
+    Source source = addSource(r'''
+class A {
+  const A();
+  final m = const A();
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.RECURSIVE_COMPILE_TIME_CONSTANT]);
+    verify([source]);
+  }
+
+  test_recursiveCompileTimeConstant_cycle() async {
+    Source source = addSource(r'''
+const x = y + 1;
+const y = x + 1;''');
+    await computeAnalysisResult(source);
+    if (!enableNewAnalysisDriver) {
+      assertErrors(source, [
+        CompileTimeErrorCode.RECURSIVE_COMPILE_TIME_CONSTANT,
+        CompileTimeErrorCode.RECURSIVE_COMPILE_TIME_CONSTANT,
+      ]);
+    } else {
+      assertErrors(source, [
+        CompileTimeErrorCode.RECURSIVE_COMPILE_TIME_CONSTANT,
+        CompileTimeErrorCode.RECURSIVE_COMPILE_TIME_CONSTANT,
+        StrongModeCode.TOP_LEVEL_CYCLE,
+        StrongModeCode.TOP_LEVEL_CYCLE,
+      ]);
+    }
+    verify([source]);
+  }
+
+  test_recursiveCompileTimeConstant_fromMapLiteral() async {
+    newFile(
+      '/constants.dart',
+      content: r'''
+const int x = y;
+const int y = x;
+''',
+    );
+    Source source = addSource(r'''
+import 'constants.dart';
+final z = {x: 0, y: 1};
+''');
+    await computeAnalysisResult(source);
+    // No errors, because the cycle is not in this source.
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_recursiveCompileTimeConstant_initializer_after_toplevel_var() async {
+    Source source = addSource('''
+const y = const C();
+class C {
+  const C() : x = y;
+  final x;
+}
+''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.RECURSIVE_COMPILE_TIME_CONSTANT]);
+    verify([source]);
+  }
+
+  test_recursiveCompileTimeConstant_singleVariable() async {
+    Source source = addSource(r'''
+const x = x;
+''');
+    await computeAnalysisResult(source);
+    if (!enableNewAnalysisDriver) {
+      assertErrors(source, [
+        CompileTimeErrorCode.RECURSIVE_COMPILE_TIME_CONSTANT,
+      ]);
+    } else {
+      assertErrors(source, [
+        CompileTimeErrorCode.RECURSIVE_COMPILE_TIME_CONSTANT,
+        StrongModeCode.TOP_LEVEL_CYCLE
+      ]);
+    }
+    verify([source]);
+  }
+
+  test_recursiveCompileTimeConstant_singleVariable_fromConstList() async {
+    Source source = addSource(r'''
+const elems = const [
+  const [
+    1, elems, 3,
+  ],
+];
+''');
+    await computeAnalysisResult(source);
+    if (!enableNewAnalysisDriver) {
+      assertErrors(source, [
+        CompileTimeErrorCode.RECURSIVE_COMPILE_TIME_CONSTANT,
+      ]);
+    } else {
+      assertErrors(source, [
+        CompileTimeErrorCode.RECURSIVE_COMPILE_TIME_CONSTANT,
+        StrongModeCode.TOP_LEVEL_CYCLE,
+      ]);
+    }
+    verify([source]);
+  }
+
+  test_recursiveConstructorRedirect() async {
+    Source source = addSource(r'''
+class A {
+  A.a() : this.b();
+  A.b() : this.a();
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CompileTimeErrorCode.RECURSIVE_CONSTRUCTOR_REDIRECT,
+      CompileTimeErrorCode.RECURSIVE_CONSTRUCTOR_REDIRECT
+    ]);
+    verify([source]);
+  }
+
+  test_recursiveConstructorRedirect_directSelfReference() async {
+    Source source = addSource(r'''
+class A {
+  A() : this();
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.RECURSIVE_CONSTRUCTOR_REDIRECT]);
+    verify([source]);
+  }
+
+  test_recursiveFactoryRedirect() async {
+    Source source = addSource(r'''
+class A implements B {
+  factory A() = C;
+}
+class B implements C {
+  factory B() = A;
+}
+class C implements A {
+  factory C() = B;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
+      CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
+      CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
+      CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
+      CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
+      CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE
+    ]);
+    verify([source]);
+  }
+
+  test_recursiveFactoryRedirect_directSelfReference() async {
+    Source source = addSource(r'''
+class A {
+  factory A() = A;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT]);
+    verify([source]);
+  }
+
+  test_recursiveFactoryRedirect_diverging() async {
+    // Analysis should terminate even though the redirections don't reach a
+    // fixed point.  (C<int> redirects to C<C<int>>, then to C<C<C<int>>>, and
+    // so on).
+    Source source = addSource('''
+class C<T> {
+  const factory C() = C<C<T>>;
+}
+main() {
+  const C<int>();
+}
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT]);
+    verify([source]);
+  }
+
+  test_recursiveFactoryRedirect_generic() async {
+    Source source = addSource(r'''
+class A<T> implements B<T> {
+  factory A() = C;
+}
+class B<T> implements C<T> {
+  factory B() = A;
+}
+class C<T> implements A<T> {
+  factory C() = B;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
+      CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
+      CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
+      CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
+      CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
+      CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE
+    ]);
+    verify([source]);
+  }
+
+  test_recursiveFactoryRedirect_named() async {
+    Source source = addSource(r'''
+class A implements B {
+  factory A.nameA() = C.nameC;
+}
+class B implements C {
+  factory B.nameB() = A.nameA;
+}
+class C implements A {
+  factory C.nameC() = B.nameB;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
+      CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
+      CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
+      CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
+      CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
+      CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE
+    ]);
+    verify([source]);
+  }
+
+  /**
+   * "A" references "C" which has cycle with "B". But we should not report problem for "A" - it is
+   * not the part of a cycle.
+   */
+  test_recursiveFactoryRedirect_outsideCycle() async {
+    Source source = addSource(r'''
+class A {
+  factory A() = C;
+}
+class B implements C {
+  factory B() = C;
+}
+class C implements A, B {
+  factory C() = B;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
+      CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
+      CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
+      CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE
+    ]);
+    verify([source]);
+  }
+
+  test_redirectGenerativeToMissingConstructor() async {
+    Source source = addSource(r'''
+class A {
+  A() : this.noSuchConstructor();
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source,
+        [CompileTimeErrorCode.REDIRECT_GENERATIVE_TO_MISSING_CONSTRUCTOR]);
+  }
+
+  test_redirectGenerativeToNonGenerativeConstructor() async {
+    Source source = addSource(r'''
+class A {
+  A() : this.x();
+  factory A.x() => null;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CompileTimeErrorCode.REDIRECT_GENERATIVE_TO_NON_GENERATIVE_CONSTRUCTOR
+    ]);
+    verify([source]);
+  }
+
+  test_redirectToMissingConstructor_named() async {
+    Source source = addSource(r'''
+class A implements B{
+  A() {}
+}
+class B {
+  const factory B() = A.name;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.REDIRECT_TO_MISSING_CONSTRUCTOR]);
+  }
+
+  test_redirectToMissingConstructor_unnamed() async {
+    Source source = addSource(r'''
+class A implements B{
+  A.name() {}
+}
+class B {
+  const factory B() = A;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.REDIRECT_TO_MISSING_CONSTRUCTOR]);
+  }
+
+  test_redirectToNonClass_notAType() async {
+    Source source = addSource(r'''
+int A;
+class B {
+  const factory B() = A;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.REDIRECT_TO_NON_CLASS]);
+    verify([source]);
+  }
+
+  test_redirectToNonClass_undefinedIdentifier() async {
+    Source source = addSource(r'''
+class B {
+  const factory B() = A;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.REDIRECT_TO_NON_CLASS]);
+    verify([source]);
+  }
+
+  test_redirectToNonConstConstructor() async {
+    Source source = addSource(r'''
+class A {
+  A.a() {}
+  const factory A.b() = A.a;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.REDIRECT_TO_NON_CONST_CONSTRUCTOR]);
+    verify([source]);
+  }
+
+  test_referencedBeforeDeclaration_hideInBlock_comment() async {
+    Source source = addSource(r'''
+main() {
+  /// [v] is a variable.
+  var v = 2;
+}
+print(x) {}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+  }
+
+  test_referencedBeforeDeclaration_hideInBlock_function() async {
+    Source source = addSource(r'''
+var v = 1;
+main() {
+  print(v);
+  v() {}
+}
+print(x) {}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.REFERENCED_BEFORE_DECLARATION]);
+  }
+
+  test_referencedBeforeDeclaration_hideInBlock_local() async {
+    Source source = addSource(r'''
+var v = 1;
+main() {
+  print(v);
+  var v = 2;
+}
+print(x) {}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.REFERENCED_BEFORE_DECLARATION]);
+  }
+
+  test_referencedBeforeDeclaration_hideInBlock_subBlock() async {
+    Source source = addSource(r'''
+var v = 1;
+main() {
+  {
+    print(v);
+  }
+  var v = 2;
+}
+print(x) {}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.REFERENCED_BEFORE_DECLARATION]);
+  }
+
+  test_referencedBeforeDeclaration_inInitializer_closure() async {
+    Source source = addSource(r'''
+main() {
+  var v = () => v;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.REFERENCED_BEFORE_DECLARATION]);
+  }
+
+  test_referencedBeforeDeclaration_inInitializer_directly() async {
+    Source source = addSource(r'''
+main() {
+  var v = v;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.REFERENCED_BEFORE_DECLARATION]);
+  }
+
+  test_referencedBeforeDeclaration_type_localFunction() async {
+    Source source = addSource(r'''
+void testTypeRef() {
+  String s = '';
+  int String(int x) => x + 1;
+}
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.REFERENCED_BEFORE_DECLARATION]);
+  }
+
+  test_referencedBeforeDeclaration_type_localVariable() async {
+    Source source = addSource(r'''
+void testTypeRef() {
+  String s = '';
+  var String = '';
+}
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.REFERENCED_BEFORE_DECLARATION]);
+  }
+
+  test_rethrowOutsideCatch() async {
+    Source source = addSource(r'''
+f() {
+  rethrow;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.RETHROW_OUTSIDE_CATCH]);
+    verify([source]);
+  }
+
+  test_returnInGenerativeConstructor() async {
+    Source source = addSource(r'''
+class A {
+  A() { return 0; }
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.RETURN_IN_GENERATIVE_CONSTRUCTOR]);
+    verify([source]);
+  }
+
+  test_returnInGenerativeConstructor_expressionFunctionBody() async {
+    Source source = addSource(r'''
+class A {
+  A() => null;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.RETURN_IN_GENERATIVE_CONSTRUCTOR]);
+    verify([source]);
+  }
+
+  test_returnInGenerator_asyncStar() async {
+    Source source = addSource(r'''
+f() async* {
+  return 0;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source,
+        usingFastaParser
+            ? [
+                CompileTimeErrorCode.RETURN_IN_GENERATOR,
+                CompileTimeErrorCode.RETURN_IN_GENERATOR
+              ]
+            : [CompileTimeErrorCode.RETURN_IN_GENERATOR]);
+    verify([source]);
+  }
+
+  test_returnInGenerator_syncStar() async {
+    Source source = addSource(r'''
+f() sync* {
+  return 0;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source,
+        usingFastaParser
+            ? [
+                CompileTimeErrorCode.RETURN_IN_GENERATOR,
+                CompileTimeErrorCode.RETURN_IN_GENERATOR
+              ]
+            : [CompileTimeErrorCode.RETURN_IN_GENERATOR]);
+    verify([source]);
+  }
+
+  test_sharedDeferredPrefix() async {
+    await resolveWithErrors(<String>[
+      r'''
+library lib1;
+f1() {}''',
+      r'''
+library lib2;
+f2() {}''',
+      r'''
+library root;
+import 'lib1.dart' deferred as lib;
+import 'lib2.dart' as lib;
+main() { lib.f1(); lib.f2(); }'''
+    ], <ErrorCode>[
+      CompileTimeErrorCode.SHARED_DEFERRED_PREFIX
+    ]);
+  }
+
+  test_superInInvalidContext_binaryExpression() async {
+    Source source = addSource("var v = super + 0;");
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.SUPER_IN_INVALID_CONTEXT]);
+    // no verify(), 'super.v' is not resolved
+  }
+
+  test_superInInvalidContext_constructorFieldInitializer() async {
+    Source source = addSource(r'''
+class A {
+  m() {}
+}
+class B extends A {
+  var f;
+  B() : f = super.m();
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.SUPER_IN_INVALID_CONTEXT]);
+    // no verify(), 'super.m' is not resolved
+  }
+
+  test_superInInvalidContext_factoryConstructor() async {
+    Source source = addSource(r'''
+class A {
+  m() {}
+}
+class B extends A {
+  factory B() {
+    super.m();
+    return null;
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.SUPER_IN_INVALID_CONTEXT]);
+    // no verify(), 'super.m' is not resolved
+  }
+
+  test_superInInvalidContext_instanceVariableInitializer() async {
+    Source source = addSource(r'''
+class A {
+  var a;
+}
+class B extends A {
+ var b = super.a;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.SUPER_IN_INVALID_CONTEXT]);
+    // no verify(), 'super.a' is not resolved
+  }
+
+  test_superInInvalidContext_staticMethod() async {
+    Source source = addSource(r'''
+class A {
+  static m() {}
+}
+class B extends A {
+  static n() { return super.m(); }
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.SUPER_IN_INVALID_CONTEXT]);
+    // no verify(), 'super.m' is not resolved
+  }
+
+  test_superInInvalidContext_staticVariableInitializer() async {
+    Source source = addSource(r'''
+class A {
+  static int a = 0;
+}
+class B extends A {
+  static int b = super.a;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.SUPER_IN_INVALID_CONTEXT]);
+    // no verify(), 'super.a' is not resolved
+  }
+
+  test_superInInvalidContext_topLevelFunction() async {
+    Source source = addSource(r'''
+f() {
+  super.f();
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.SUPER_IN_INVALID_CONTEXT]);
+    // no verify(), 'super.f' is not resolved
+  }
+
+  test_superInInvalidContext_topLevelVariableInitializer() async {
+    Source source = addSource("var v = super.y;");
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.SUPER_IN_INVALID_CONTEXT]);
+    // no verify(), 'super.y' is not resolved
+  }
+
+  test_superInitializerInObject() async {
+    Source source = addSource(r'''
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.SUPER_INITIALIZER_IN_OBJECT]);
+    verify([source]);
+  }
+
+  test_superInRedirectingConstructor_redirectionSuper() async {
+    Source source = addSource(r'''
+class A {}
+class B {
+  B() : this.name(), super();
+  B.name() {}
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.SUPER_IN_REDIRECTING_CONSTRUCTOR]);
+    verify([source]);
+  }
+
+  test_superInRedirectingConstructor_superRedirection() async {
+    Source source = addSource(r'''
+class A {}
+class B {
+  B() : super(), this.name();
+  B.name() {}
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CompileTimeErrorCode.SUPER_IN_REDIRECTING_CONSTRUCTOR,
+      StrongModeCode.INVALID_SUPER_INVOCATION
+    ]);
+    verify([source]);
+  }
+
+  test_symbol_constructor_badArgs() async {
+    Source source = addSource(r'''
+var s1 = const Symbol('3');
+var s2 = const Symbol(3);
+var s3 = const Symbol();
+var s4 = const Symbol('x', 'y');
+var s5 = const Symbol('x', foo: 'x');''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION,
+      CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION,
+      StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE,
+      CompileTimeErrorCode.NOT_ENOUGH_REQUIRED_ARGUMENTS,
+      CompileTimeErrorCode.EXTRA_POSITIONAL_ARGUMENTS,
+      CompileTimeErrorCode.UNDEFINED_NAMED_PARAMETER
+    ]);
+    verify([source]);
+  }
+
+  test_test_fieldInitializerOutsideConstructor_topLevelFunction() async {
+    Source source = addSource(r'''
+f(this.x(y)) {}
+''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source,
+        usingFastaParser
+            ? [CompileTimeErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR]
+            : [
+                ParserErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR,
+                CompileTimeErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR
+              ]);
+    verify([source]);
+  }
+
+  test_typeAliasCannotReferenceItself_11987() async {
+    Source source = addSource(r'''
+typedef void F(List<G> l);
+typedef void G(List<F> l);
+main() {
+  F foo(G g) => g;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF,
+      CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF
+    ]);
+    verify([source]);
+  }
+
+  test_typeAliasCannotReferenceItself_19459() async {
+    // A complex example involving multiple classes.  This is legal, since
+    // typedef F references itself only via a class.
+    Source source = addSource(r'''
+class A<B, C> {}
+abstract class D {
+  f(E e);
+}
+abstract class E extends A<dynamic, F> {}
+typedef D F();
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_typeAliasCannotReferenceItself_functionTypedParameter_returnType() async {
+    Source source = addSource("typedef A(A b());");
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF]);
+    verify([source]);
+  }
+
+  test_typeAliasCannotReferenceItself_generic() async {
+    Source source = addSource(r'''
+typedef F = void Function(List<G> l);
+typedef G = void Function(List<F> l);
+main() {
+  F foo(G g) => g;
+}
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF,
+      CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF
+    ]);
+    verify([source]);
+  }
+
+  test_typeAliasCannotReferenceItself_parameterType_named() async {
+    Source source = addSource("typedef A({A a});");
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF]);
+    verify([source]);
+  }
+
+  test_typeAliasCannotReferenceItself_parameterType_positional() async {
+    Source source = addSource("typedef A([A a]);");
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF]);
+    verify([source]);
+  }
+
+  test_typeAliasCannotReferenceItself_parameterType_required() async {
+    Source source = addSource("typedef A(A a);");
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF]);
+    verify([source]);
+  }
+
+  test_typeAliasCannotReferenceItself_parameterType_typeArgument() async {
+    Source source = addSource("typedef A(List<A> a);");
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF]);
+    verify([source]);
+  }
+
+  test_typeAliasCannotReferenceItself_returnClass_withTypeAlias() async {
+    // A typedef is allowed to indirectly reference itself via a class.
+    Source source = addSource(r'''
+typedef C A();
+typedef A B();
+class C {
+  B a;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_typeAliasCannotReferenceItself_returnType() async {
+    Source source = addSource("typedef A A();");
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF]);
+    verify([source]);
+  }
+
+  test_typeAliasCannotReferenceItself_returnType_indirect() async {
+    Source source = addSource(r'''
+typedef B A();
+typedef A B();''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF,
+      CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF
+    ]);
+    verify([source]);
+  }
+
+  test_typeAliasCannotReferenceItself_typeVariableBounds() async {
+    Source source = addSource("typedef A<T extends A<int>>();");
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF,
+      StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS
+    ]);
+    verify([source]);
+  }
+
+  test_typeArgumentNotMatchingBounds_const() async {
+    Source source = addSource(r'''
+class A {}
+class B {}
+class G<E extends A> {
+  const G();
+}
+f() { return const G<B>(); }''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
+    verify([source]);
+  }
+
+  test_typedef_infiniteParameterBoundCycle() async {
+    Source source = addSource(r'''
+typedef F<X extends F> = F Function();
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF,
+      StrongModeCode.NOT_INSTANTIATED_BOUND,
+    ]);
+    verify([source]);
+  }
+
+  test_undefinedAnnotation_unresolved_identifier() async {
+    Source source = addSource(r'''
+@unresolved
+main() {
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.UNDEFINED_ANNOTATION]);
+  }
+
+  test_undefinedAnnotation_unresolved_invocation() async {
+    Source source = addSource(r'''
+@Unresolved()
+main() {
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.UNDEFINED_ANNOTATION]);
+  }
+
+  test_undefinedAnnotation_unresolved_prefixedIdentifier() async {
+    Source source = addSource(r'''
+import 'dart:math' as p;
+@p.unresolved
+main() {
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.UNDEFINED_ANNOTATION]);
+  }
+
+  test_undefinedAnnotation_useLibraryScope() async {
+    Source source = addSource(r'''
+@foo
+class A {
+  static const foo = null;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.UNDEFINED_ANNOTATION]);
+  }
+
+  test_undefinedClass_const() async {
+    Source source = addSource(r'''
+f() {
+  return const A();
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [StaticWarningCode.UNDEFINED_CLASS]);
+    verify([source]);
+  }
+
+  test_undefinedConstructorInInitializer_explicit_named() async {
+    Source source = addSource(r'''
+class A {}
+class B extends A {
+  B() : super.named();
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER]);
+    // no verify(), "super.named()" is not resolved
+  }
+
+  test_undefinedConstructorInInitializer_explicit_unnamed() async {
+    Source source = addSource(r'''
+class A {
+  A.named() {}
+}
+class B extends A {
+  B() : super();
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source,
+        [CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT]);
+    verify([source]);
+  }
+
+  test_undefinedConstructorInInitializer_implicit() async {
+    Source source = addSource(r'''
+class A {
+  A.named() {}
+}
+class B extends A {
+  B();
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source,
+        [CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT]);
+    verify([source]);
+  }
+
+  test_undefinedNamedParameter() async {
+    Source source = addSource(r'''
+class A {
+  const A();
+}
+main() {
+  const A(p: 0);
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.UNDEFINED_NAMED_PARAMETER]);
+    // no verify(), 'p' is not resolved
+  }
+
+  test_uriDoesNotExist_export() async {
+    Source source = addSource("export 'unknown.dart';");
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.URI_DOES_NOT_EXIST]);
+  }
+
+  test_uriDoesNotExist_import() async {
+    Source source = addSource("import 'unknown.dart';");
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.URI_DOES_NOT_EXIST]);
+  }
+
+  test_uriDoesNotExist_import_appears_after_deleting_target() async {
+    Source test = addSource("import 'target.dart';");
+    Source target = addNamedSource("/target.dart", "");
+    await computeAnalysisResult(test);
+    assertErrors(test, [HintCode.UNUSED_IMPORT]);
+
+    // Remove the overlay in the same way as AnalysisServer.
+    deleteFile(target.fullName);
+    if (enableNewAnalysisDriver) {
+      driver.removeFile(target.fullName);
+    } else {
+      analysisContext2.setContents(target, null);
+      ChangeSet changeSet = new ChangeSet()..removedSource(target);
+      analysisContext2.applyChanges(changeSet);
+    }
+
+    await computeAnalysisResult(test);
+    assertErrors(test, [CompileTimeErrorCode.URI_DOES_NOT_EXIST]);
+  }
+
+  test_uriDoesNotExist_import_disappears_when_fixed() async {
+    Source source = addSource("import 'target.dart';");
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.URI_DOES_NOT_EXIST]);
+
+    String targetPath = convertPath('/target.dart');
+    if (enableNewAnalysisDriver) {
+      // Add an overlay in the same way as AnalysisServer.
+      fileContentOverlay[targetPath] = '';
+      driver.changeFile(targetPath);
+    } else {
+      // Check that the file is represented as missing.
+      Source target = analysisContext2.getSourcesWithFullName(targetPath).first;
+      expect(analysisContext2.getModificationStamp(target), -1);
+
+      // Add an overlay in the same way as AnalysisServer.
+      analysisContext2
+        ..setContents(target, "")
+        ..handleContentsChanged(target, null, "", true);
+    }
+
+    // Make sure the error goes away.
+    await computeAnalysisResult(source);
+    assertErrors(source, [HintCode.UNUSED_IMPORT]);
+  }
+
+  test_uriDoesNotExist_part() async {
+    Source source = addSource(r'''
+library lib;
+part 'unknown.dart';''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.URI_DOES_NOT_EXIST]);
+  }
+
+  test_uriWithInterpolation_constant() async {
+    Source source = addSource("import 'stuff_\$platform.dart';");
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CompileTimeErrorCode.URI_WITH_INTERPOLATION,
+      StaticWarningCode.UNDEFINED_IDENTIFIER
+    ]);
+    // We cannot verify resolution with an unresolvable
+    // URI: 'stuff_$platform.dart'
+  }
+
+  test_uriWithInterpolation_nonConstant() async {
+    Source source = addSource(r'''
+library lib;
+part '${'a'}.dart';''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.URI_WITH_INTERPOLATION]);
+    // We cannot verify resolution with an unresolvable URI: '${'a'}.dart'
+  }
+
+  test_wrongNumberOfParametersForOperator1() async {
+    await _check_wrongNumberOfParametersForOperator1("<");
+    await _check_wrongNumberOfParametersForOperator1(">");
+    await _check_wrongNumberOfParametersForOperator1("<=");
+    await _check_wrongNumberOfParametersForOperator1(">=");
+    await _check_wrongNumberOfParametersForOperator1("+");
+    await _check_wrongNumberOfParametersForOperator1("/");
+    await _check_wrongNumberOfParametersForOperator1("~/");
+    await _check_wrongNumberOfParametersForOperator1("*");
+    await _check_wrongNumberOfParametersForOperator1("%");
+    await _check_wrongNumberOfParametersForOperator1("|");
+    await _check_wrongNumberOfParametersForOperator1("^");
+    await _check_wrongNumberOfParametersForOperator1("&");
+    await _check_wrongNumberOfParametersForOperator1("<<");
+    await _check_wrongNumberOfParametersForOperator1(">>");
+    await _check_wrongNumberOfParametersForOperator1("[]");
+  }
+
+  test_wrongNumberOfParametersForOperator_minus() async {
+    Source source = addSource(r'''
+class A {
+  operator -(a, b) {}
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source,
+        [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINUS]);
+    verify([source]);
+  }
+
+  test_wrongNumberOfParametersForOperator_tilde() async {
+    await _check_wrongNumberOfParametersForOperator("~", "a");
+    await _check_wrongNumberOfParametersForOperator("~", "a, b");
+  }
+
+  test_wrongNumberOfParametersForSetter_function_named() async {
+    Source source = addSource("set x({p}) {}");
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER]);
+    verify([source]);
+  }
+
+  test_wrongNumberOfParametersForSetter_function_optional() async {
+    Source source = addSource("set x([p]) {}");
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER]);
+    verify([source]);
+  }
+
+  test_wrongNumberOfParametersForSetter_function_tooFew() async {
+    Source source = addSource("set x() {}");
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER]);
+    verify([source]);
+  }
+
+  test_wrongNumberOfParametersForSetter_function_tooMany() async {
+    Source source = addSource("set x(a, b) {}");
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER]);
+    verify([source]);
+  }
+
+  test_wrongNumberOfParametersForSetter_method_named() async {
+    Source source = addSource(r'''
+class A {
+  set x({p}) {}
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER]);
+    verify([source]);
+  }
+
+  test_wrongNumberOfParametersForSetter_method_optional() async {
+    Source source = addSource(r'''
+class A {
+  set x([p]) {}
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER]);
+    verify([source]);
+  }
+
+  test_wrongNumberOfParametersForSetter_method_tooFew() async {
+    Source source = addSource(r'''
+class A {
+  set x() {}
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER]);
+    verify([source]);
+  }
+
+  test_wrongNumberOfParametersForSetter_method_tooMany() async {
+    Source source = addSource(r'''
+class A {
+  set x(a, b) {}
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER]);
+    verify([source]);
+  }
+
+  test_yield_used_as_identifier_in_async_method() async {
+    Source source = addSource('''
+f() async {
+  var yield = 1;
+}
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER]);
+    verify([source]);
+  }
+
+  test_yield_used_as_identifier_in_async_star_method() async {
+    Source source = addSource('''
+f() async* {
+  var yield = 1;
+}
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER]);
+    verify([source]);
+  }
+
+  test_yield_used_as_identifier_in_sync_star_method() async {
+    Source source = addSource('''
+f() sync* {
+  var yield = 1;
+}
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER]);
+    verify([source]);
+  }
+
+  test_yieldEachInNonGenerator_async() async {
+    // TODO(brianwilkerson) We are currently parsing the yield statement as a
+    // binary expression.
+    Source source = addSource(r'''
+f() async {
+  yield* 0;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.YIELD_EACH_IN_NON_GENERATOR]);
+    verify([source]);
+  }
+
+  test_yieldEachInNonGenerator_sync() async {
+    // TODO(brianwilkerson) We are currently parsing the yield statement as a
+    // binary expression.
+    Source source = addSource(r'''
+f() {
+  yield* 0;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.YIELD_IN_NON_GENERATOR]);
+    verify([source]);
+  }
+
+  test_yieldInNonGenerator_async() async {
+    // TODO(brianwilkerson) We are currently trying to parse the yield statement
+    // as a binary expression.
+    Source source = addSource(r'''
+f() async {
+  yield 0;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.YIELD_IN_NON_GENERATOR]);
+    verify([source]);
+  }
+
+  test_yieldInNonGenerator_sync() async {
+    // TODO(brianwilkerson) We are currently trying to parse the yield statement
+    // as a binary expression.
+    Source source = addSource(r'''
+f() {
+  yield 0;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.YIELD_EACH_IN_NON_GENERATOR]);
+    verify([source]);
+  }
+
+  Future<void> _check_constEvalThrowsException_binary_null(
+      String expr, bool resolved) async {
+    Source source = addSource("const C = $expr;");
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION]);
+    if (resolved) {
+      verify([source]);
+    }
+  }
+
+  Future<void> _check_constEvalTypeBool_withParameter_binary(
+      String expr) async {
+    Source source = addSource('''
+class A {
+  final a;
+  const A(bool p) : a = $expr;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL,
+      StaticTypeWarningCode.NON_BOOL_OPERAND
+    ]);
+    verify([source]);
+  }
+
+  Future<void> _check_constEvalTypeBoolOrInt_withParameter_binary(
+      String expr) async {
+    Source source = addSource('''
+class A {
+  final a;
+  const A(int p) : a = $expr;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL_INT,
+      StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE
+    ]);
+    verify([source]);
+  }
+
+  Future<void> _check_constEvalTypeInt_withParameter_binary(String expr) async {
+    Source source = addSource('''
+class A {
+  final a;
+  const A(int p) : a = $expr;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CompileTimeErrorCode.CONST_EVAL_TYPE_INT,
+      StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE
+    ]);
+    verify([source]);
+  }
+
+  Future<void> _check_constEvalTypeNum_withParameter_binary(String expr) async {
+    Source source = addSource('''
+class A {
+  final a;
+  const A(num p) : a = $expr;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CompileTimeErrorCode.CONST_EVAL_TYPE_NUM,
+      StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE
+    ]);
+    verify([source]);
+  }
+
+  Future<void> _check_wrongNumberOfParametersForOperator(
+      String name, String parameters) async {
+    Source source = addSource('''
+class A {
+  operator $name($parameters) {}
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR]);
+    verify([source]);
+  }
+
+  Future<void> _check_wrongNumberOfParametersForOperator1(String name) async {
+    await _check_wrongNumberOfParametersForOperator(name, "");
+    await _check_wrongNumberOfParametersForOperator(name, "a, b");
+  }
+
+  Future<void> _privateCollisionInMixinApplicationTest(String testCode) async {
+    addNamedSource('/lib1.dart', '''
+class A {
+  int _x;
+}
+
+class B {
+  int _x;
+}
+''');
+    Source source = addSource(testCode);
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.PRIVATE_COLLISION_IN_MIXIN_APPLICATION]);
+    verify([source]);
+  }
+}
diff --git a/pkg/analyzer/test/generated/compile_time_error_code_driver_test.dart b/pkg/analyzer/test/generated/compile_time_error_code_driver_test.dart
index 9ff1460..472a581 100644
--- a/pkg/analyzer/test/generated/compile_time_error_code_driver_test.dart
+++ b/pkg/analyzer/test/generated/compile_time_error_code_driver_test.dart
@@ -7,7 +7,7 @@
 import 'package:analyzer/src/generated/source.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import 'compile_time_error_code_test.dart';
+import 'compile_time_error_code.dart';
 import 'resolver_test_case.dart';
 
 main() {
diff --git a/pkg/analyzer/test/generated/compile_time_error_code_test.dart b/pkg/analyzer/test/generated/compile_time_error_code_test.dart
deleted file mode 100644
index c266770..0000000
--- a/pkg/analyzer/test/generated/compile_time_error_code_test.dart
+++ /dev/null
@@ -1,6559 +0,0 @@
-// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'dart:async';
-
-import 'package:analyzer/dart/analysis/declared_variables.dart';
-import 'package:analyzer/error/error.dart';
-import 'package:analyzer/src/context/context.dart';
-import 'package:analyzer/src/error/codes.dart';
-import 'package:analyzer/src/generated/engine.dart';
-import 'package:analyzer/src/generated/parser.dart' show ParserErrorCode;
-import 'package:analyzer/src/generated/source_io.dart';
-import 'package:test/test.dart' show expect;
-import 'package:test_reflective_loader/test_reflective_loader.dart';
-
-import 'resolver_test_case.dart';
-
-main() {
-  defineReflectiveSuite(() {
-    defineReflectiveTests(CompileTimeErrorCodeTest);
-  });
-}
-
-@reflectiveTest
-class CompileTimeErrorCodeTest extends CompileTimeErrorCodeTestBase {
-  @override
-  @failingTest
-  test_awaitInWrongContext_sync() {
-    return super.test_awaitInWrongContext_sync();
-  }
-
-  @override
-  @failingTest
-  test_constEvalThrowsException() {
-    return super.test_constEvalThrowsException();
-  }
-
-  @override
-  @failingTest
-  test_invalidIdentifierInAsync_async() {
-    return super.test_invalidIdentifierInAsync_async();
-  }
-
-  @override
-  @failingTest
-  test_invalidIdentifierInAsync_await() {
-    return super.test_invalidIdentifierInAsync_await();
-  }
-
-  @override
-  @failingTest
-  test_invalidIdentifierInAsync_yield() {
-    return super.test_invalidIdentifierInAsync_yield();
-  }
-
-  @override
-  @failingTest // Does not work with old task model
-  test_mixinInference_recursiveSubtypeCheck_new_syntax() {
-    return super.test_mixinInference_recursiveSubtypeCheck_new_syntax();
-  }
-
-  @override
-  @failingTest
-  test_mixinOfNonClass() {
-    return super.test_mixinOfNonClass();
-  }
-
-  @override
-  @failingTest
-  test_objectCannotExtendAnotherClass() {
-    return super.test_objectCannotExtendAnotherClass();
-  }
-
-  @override
-  @failingTest
-  test_superInitializerInObject() {
-    return super.test_superInitializerInObject();
-  }
-
-  @override
-  @failingTest
-  test_typedef_infiniteParameterBoundCycle() {
-    // Does not work with the task model.
-    return super.test_typedef_infiniteParameterBoundCycle();
-  }
-
-  @override
-  @failingTest
-  test_yieldEachInNonGenerator_async() {
-    return super.test_yieldEachInNonGenerator_async();
-  }
-
-  @override
-  @failingTest
-  test_yieldEachInNonGenerator_sync() {
-    return super.test_yieldEachInNonGenerator_sync();
-  }
-
-  @override
-  @failingTest
-  test_yieldInNonGenerator_async() {
-    return super.test_yieldInNonGenerator_async();
-  }
-
-  @override
-  @failingTest
-  test_yieldInNonGenerator_sync() {
-    return super.test_yieldInNonGenerator_sync();
-  }
-}
-
-class CompileTimeErrorCodeTestBase extends ResolverTestCase {
-  disabled_test_conflictingGenericInterfaces_hierarchyLoop_infinite() async {
-    // There is an interface conflict here due to a loop in the class
-    // hierarchy leading to an infinite set of implemented types; this loop
-    // shouldn't cause non-termination.
-
-    // TODO(paulberry): this test is currently disabled due to non-termination
-    // bugs elsewhere in the analyzer.
-    Source source = addSource('''
-class A<T> implements B<List<T>> {}
-class B<T> implements A<List<T>> {}
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.CONFLICTING_GENERIC_INTERFACES]);
-  }
-
-  test_accessPrivateEnumField() async {
-    Source source = addSource(r'''
-enum E { ONE }
-String name(E e) {
-  return e._name;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.ACCESS_PRIVATE_ENUM_FIELD]);
-    // Cannot verify because "_name" cannot be resolved.
-  }
-
-  test_ambiguousExport() async {
-    Source source = addSource(r'''
-library L;
-export 'lib1.dart';
-export 'lib2.dart';''');
-    addNamedSource("/lib1.dart", r'''
-library lib1;
-class N {}''');
-    addNamedSource("/lib2.dart", r'''
-library lib2;
-class N {}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.AMBIGUOUS_EXPORT]);
-    verify([source]);
-  }
-
-  test_annotationWithNotClass() async {
-    Source source = addSource('''
-class Property {
-  final int value;
-  const Property(this.value);
-}
-
-const Property property = const Property(42);
-
-@property(123)
-main() {
-}
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.ANNOTATION_WITH_NON_CLASS]);
-    verify([source]);
-  }
-
-  test_annotationWithNotClass_prefixed() async {
-    addNamedSource("/annotations.dart", r'''
-class Property {
-  final int value;
-  const Property(this.value);
-}
-
-const Property property = const Property(42);
-''');
-    Source source = addSource('''
-import 'annotations.dart' as pref;
-@pref.property(123)
-main() {
-}
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.ANNOTATION_WITH_NON_CLASS]);
-    verify([source]);
-  }
-
-  test_async_used_as_identifier_in_annotation() async {
-    Source source = addSource('''
-const int async = 0;
-f() async {
-  g(@async x) {}
-  g(0);
-}
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER]);
-    verify([source]);
-  }
-
-  test_async_used_as_identifier_in_argument_label() async {
-    Source source = addSource('''
-f(c) async {
-  c.g(async: 0);
-}
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER]);
-    verify([source]);
-  }
-
-  test_async_used_as_identifier_in_async_method() async {
-    Source source = addSource('''
-f() async {
-  var async = 1;
-}
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER]);
-    verify([source]);
-  }
-
-  test_async_used_as_identifier_in_async_star_method() async {
-    Source source = addSource('''
-f() async* {
-  var async = 1;
-}
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER]);
-    verify([source]);
-  }
-
-  test_async_used_as_identifier_in_break_statement() async {
-    Source source = addSource('''
-f() async {
-  while (true) {
-    break async;
-  }
-}
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER,
-      CompileTimeErrorCode.LABEL_UNDEFINED
-    ]);
-    // Note: we don't call verify([source]) because the reference to the
-    // "async" label is unresolved.
-  }
-
-  test_async_used_as_identifier_in_cascaded_invocation() async {
-    Source source = addSource('''
-class C {
-  int async() => 1;
-}
-f() async {
-  return new C()..async();
-}
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER]);
-    verify([source]);
-  }
-
-  test_async_used_as_identifier_in_cascaded_setter_invocation() async {
-    Source source = addSource('''
-class C {
-  void set async(int i) {}
-}
-f() async {
-  return new C()..async = 1;
-}
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER]);
-    verify([source]);
-  }
-
-  test_async_used_as_identifier_in_catch_exception_argument() async {
-    Source source = addSource('''
-g() {}
-f() async {
-  try {
-    g();
-  } catch (async) { }
-}
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER]);
-    verify([source]);
-  }
-
-  test_async_used_as_identifier_in_catch_stacktrace_argument() async {
-    Source source = addSource('''
-g() {}
-f() async {
-  try {
-    g();
-  } catch (e, async) { }
-}
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER]);
-    verify([source]);
-  }
-
-  test_async_used_as_identifier_in_continue_statement() async {
-    Source source = addSource('''
-f() async {
-  while (true) {
-    continue async;
-  }
-}
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER,
-      CompileTimeErrorCode.LABEL_UNDEFINED
-    ]);
-    // Note: we don't call verify([source]) because the reference to the
-    // "async" label is unresolved.
-  }
-
-  test_async_used_as_identifier_in_for_statement() async {
-    Source source = addSource('''
-var async;
-f() async {
-  for (async in []) {}
-}
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER]);
-    verify([source]);
-  }
-
-  test_async_used_as_identifier_in_formal_parameter_name() async {
-    Source source = addSource('''
-f() async {
-  g(int async) {}
-  g(0);
-}
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER]);
-    verify([source]);
-  }
-
-  test_async_used_as_identifier_in_getter_name() async {
-    Source source = addSource('''
-class C {
-  int get async => 1;
-}
-f() async {
-  return new C().async;
-}
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER]);
-    verify([source]);
-  }
-
-  test_async_used_as_identifier_in_invocation() async {
-    Source source = addSource('''
-class C {
-  int async() => 1;
-}
-f() async {
-  return new C().async();
-}
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER]);
-    verify([source]);
-  }
-
-  test_async_used_as_identifier_in_local_function_name() async {
-    Source source = addSource('''
-f() async {
-  int async() => null;
-}
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER]);
-    verify([source]);
-  }
-
-  test_async_used_as_identifier_in_prefix() async {
-    Source source = addSource('''
-import 'dart:async' as async;
-f() async {
-  return new async.Future.value(0);
-}
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER]);
-    verify([source]);
-  }
-
-  test_async_used_as_identifier_in_setter_name() async {
-    Source source = addSource('''
-class C {
-  void set async(int i) {}
-}
-f() async {
-  new C().async = 1;
-}
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER]);
-    verify([source]);
-  }
-
-  test_async_used_as_identifier_in_statement_label() async {
-    Source source = addSource('''
-f() async {
-  async: g();
-}
-g() {}
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER,
-      HintCode.UNUSED_LABEL
-    ]);
-    verify([source]);
-  }
-
-  test_async_used_as_identifier_in_string_interpolation() async {
-    Source source = addSource(r'''
-int async = 1;
-f() async {
-  return "$async";
-}
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER]);
-    verify([source]);
-  }
-
-  test_async_used_as_identifier_in_suffix() async {
-    addNamedSource("/lib1.dart", r'''
-library lib1;
-int async;
-''');
-    Source source = addSource('''
-import 'lib1.dart' as l;
-f() async {
-  return l.async;
-}
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER]);
-    verify([source]);
-  }
-
-  test_async_used_as_identifier_in_switch_label() async {
-    Source source = addSource('''
-f() async {
-  switch (0) {
-    async: case 0: break;
-  }
-}
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER,
-      HintCode.UNUSED_LABEL
-    ]);
-    verify([source]);
-  }
-
-  test_async_used_as_identifier_in_sync_star_method() async {
-    Source source = addSource('''
-f() sync* {
-  var async = 1;
-}
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER]);
-    verify([source]);
-  }
-
-  test_asyncForInWrongContext() async {
-    Source source = addSource(r'''
-f(list) {
-  await for (var e in list) {
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.ASYNC_FOR_IN_WRONG_CONTEXT]);
-    verify([source]);
-  }
-
-  test_await_used_as_identifier_in_async_method() async {
-    Source source = addSource('''
-f() async {
-  var await = 1;
-}
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER]);
-    verify([source]);
-  }
-
-  test_await_used_as_identifier_in_async_star_method() async {
-    Source source = addSource('''
-f() async* {
-  var await = 1;
-}
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER]);
-    verify([source]);
-  }
-
-  test_await_used_as_identifier_in_sync_star_method() async {
-    Source source = addSource('''
-f() sync* {
-  var await = 1;
-}
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER]);
-    verify([source]);
-  }
-
-  test_awaitInWrongContext_sync() async {
-    // This test requires better error recovery than we currently have. In
-    // particular, we need to be able to distinguish between an await expression
-    // in the wrong context, and the use of 'await' as an identifier.
-    Source source = addSource(r'''
-f(x) {
-  return await x;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.AWAIT_IN_WRONG_CONTEXT]);
-    verify([source]);
-  }
-
-  test_awaitInWrongContext_syncStar() async {
-    // This test requires better error recovery than we currently have. In
-    // particular, we need to be able to distinguish between an await expression
-    // in the wrong context, and the use of 'await' as an identifier.
-    Source source = addSource(r'''
-f(x) sync* {
-  yield await x;
-}''');
-    await computeAnalysisResult(source);
-    if (usingFastaParser) {
-      assertErrors(source, [CompileTimeErrorCode.AWAIT_IN_WRONG_CONTEXT]);
-    }
-    verify([source]);
-  }
-
-  test_bug_23176() async {
-    Source source = addSource('''
-class A {
-  const A([x]);
-}
-class B {
-  dynamic @A(const A()) x;
-}
-''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source,
-        usingFastaParser
-            ? [
-                ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE,
-                ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE,
-                ParserErrorCode.EXPECTED_TOKEN
-              ]
-            : [
-                ParserErrorCode.EXPECTED_CLASS_MEMBER,
-                ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE
-              ]);
-    verify([source]);
-  }
-
-  test_builtInIdentifierAsMixinName_classTypeAlias() async {
-    Source source = addSource(r'''
-class A {}
-class B {}
-class as = A with B;''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME]);
-    verify([source]);
-  }
-
-  test_builtInIdentifierAsPrefixName() async {
-    Source source = addSource("import 'dart:async' as abstract;");
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_PREFIX_NAME,
-      HintCode.UNUSED_IMPORT
-    ]);
-    verify([source]);
-  }
-
-  test_builtInIdentifierAsType_dynamicMissingPrefix() async {
-    Source source = addSource(r"""
-import 'dart:core' as core;
-
-dynamic x;
-""");
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE]);
-  }
-
-  test_builtInIdentifierAsType_formalParameter_field() async {
-    Source source = addSource(r'''
-class A {
-  var x;
-  A(static this.x);
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source,
-        usingFastaParser
-            ? [ParserErrorCode.EXTRANEOUS_MODIFIER]
-            : [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE]);
-    verify([source]);
-  }
-
-  test_builtInIdentifierAsType_formalParameter_simple() async {
-    Source source = addSource(r'''
-f(static x) {
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source,
-        usingFastaParser
-            ? [ParserErrorCode.EXTRANEOUS_MODIFIER]
-            : [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE]);
-    verify([source]);
-  }
-
-  test_builtInIdentifierAsType_variableDeclaration() async {
-    Source source = addSource(r'''
-f() {
-  typedef x;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source,
-        usingFastaParser
-            ? [
-                StaticWarningCode.UNDEFINED_IDENTIFIER,
-                StaticWarningCode.UNDEFINED_IDENTIFIER,
-                ParserErrorCode.EXPECTED_TOKEN
-              ]
-            : [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE]);
-    verify([source]);
-  }
-
-  test_builtInIdentifierAsTypedefName_functionTypeAlias() async {
-    Source source = addSource("typedef bool as();");
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME]);
-    verify([source]);
-  }
-
-  test_builtInIdentifierAsTypeName() async {
-    Source source = addSource("class as {}");
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_NAME]);
-    verify([source]);
-  }
-
-  test_builtInIdentifierAsTypeParameterName() async {
-    Source source = addSource("class A<as> {}");
-    await computeAnalysisResult(source);
-    assertErrors(source,
-        [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME]);
-    verify([source]);
-  }
-
-  test_caseExpressionTypeImplementsEquals() async {
-    Source source = addSource(r'''
-class IntWrapper {
-  final int value;
-  const IntWrapper(this.value);
-  bool operator ==(Object x) {
-    return x is IntWrapper && x.value == value;
-  }
-  get hashCode => value;
-}
-
-f(var a) {
-  switch(a) {
-    case(const IntWrapper(1)) : return 1;
-    default: return 0;
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS]);
-    verify([source]);
-  }
-
-  test_conflictingGenericInterfaces_hierarchyLoop() async {
-    // There is no interface conflict here, but there is a loop in the class
-    // hierarchy leading to a finite set of implemented types; this loop
-    // shouldn't cause non-termination.
-    Source source = addSource('''
-class A<T> implements B<T> {}
-class B<T> implements A<T> {}
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
-      CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE
-    ]);
-  }
-
-  test_conflictingGenericInterfaces_noConflict() async {
-    Source source = addSource('''
-class I<T> {}
-class A implements I<int> {}
-class B implements I<int> {}
-class C extends A implements B {}
-    ''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-  }
-
-  test_conflictingTypeVariableAndClass() async {
-    Source source = addSource(r'''
-class T<T> {
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_CLASS]);
-    verify([source]);
-  }
-
-  test_conflictingTypeVariableAndMember_field() async {
-    Source source = addSource(r'''
-class A<T> {
-  var T;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER]);
-    verify([source]);
-  }
-
-  test_conflictingTypeVariableAndMember_getter() async {
-    Source source = addSource(r'''
-class A<T> {
-  get T => null;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER]);
-    verify([source]);
-  }
-
-  test_conflictingTypeVariableAndMember_method() async {
-    Source source = addSource(r'''
-class A<T> {
-  T() {}
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER]);
-    verify([source]);
-  }
-
-  test_conflictingTypeVariableAndMember_method_static() async {
-    Source source = addSource(r'''
-class A<T> {
-  static T() {}
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER]);
-    verify([source]);
-  }
-
-  test_conflictingTypeVariableAndMember_setter() async {
-    Source source = addSource(r'''
-class A<T> {
-  set T(x) {}
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER]);
-    verify([source]);
-  }
-
-  test_consistentCaseExpressionTypes_dynamic() async {
-    // Even though A.S and S have a static type of "dynamic", we should see
-    // that they match 'abc', because they are constant strings.
-    Source source = addSource(r'''
-class A {
-  static const S = 'A.S';
-}
-
-const S = 'S';
-
-foo(var p) {
-  switch (p) {
-    case S:
-      break;
-    case A.S:
-      break;
-    case 'abc':
-      break;
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_const_invalid_constructorFieldInitializer_fromLibrary() async {
-    addNamedSource('/lib.dart', r'''
-class A<T> {
-  final int f;
-  const A() : f = T.foo;
-}
-''');
-    Source source = addSource(r'''
-import 'lib.dart';
-const a = const A();
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION]);
-  }
-
-  test_constConstructor_redirect_generic() async {
-    Source source = addSource(r'''
-class A<T> {
-  const A(T value) : this._(value);
-  const A._(T value) : value = value;
-  final T value;
-}
-
-void main(){
-  const A<int>(1);
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_constConstructorWithFieldInitializedByNonConst() async {
-    Source source = addSource(r'''
-class A {
-  final int i = f();
-  const A();
-}
-int f() {
-  return 3;
-}''');
-    // TODO(paulberry): the error CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE is
-    // redundant and ought to be suppressed.
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CompileTimeErrorCode
-          .CONST_CONSTRUCTOR_WITH_FIELD_INITIALIZED_BY_NON_CONST,
-      CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE
-    ]);
-    verify([source]);
-  }
-
-  test_constConstructorWithFieldInitializedByNonConst_static() async {
-    Source source = addSource(r'''
-class A {
-  static final int i = f();
-  const A();
-}
-int f() {
-  return 3;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_constConstructorWithNonConstSuper_explicit() async {
-    Source source = addSource(r'''
-class A {
-  A();
-}
-class B extends A {
-  const B(): super();
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER]);
-    verify([source]);
-  }
-
-  test_constConstructorWithNonConstSuper_implicit() async {
-    Source source = addSource(r'''
-class A {
-  A();
-}
-class B extends A {
-  const B();
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER]);
-    verify([source]);
-  }
-
-  test_constConstructorWithNonFinalField_mixin() async {
-    Source source = addSource(r'''
-class A {
-  var a;
-}
-class B extends Object with A {
-  const B();
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_MIXIN_WITH_FIELD,
-      CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD
-    ]);
-    verify([source]);
-  }
-
-  test_constConstructorWithNonFinalField_super() async {
-    Source source = addSource(r'''
-class A {
-  var a;
-}
-class B extends A {
-  const B();
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD,
-      CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER
-    ]);
-    verify([source]);
-  }
-
-  test_constConstructorWithNonFinalField_this() async {
-    Source source = addSource(r'''
-class A {
-  int x;
-  const A();
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD]);
-    verify([source]);
-  }
-
-  test_constDeferredClass() async {
-    await resolveWithErrors(<String>[
-      r'''
-library lib1;
-class A {
-  const A();
-}''',
-      r'''
-library root;
-import 'lib1.dart' deferred as a;
-main() {
-  const a.A();
-}'''
-    ], <ErrorCode>[
-      CompileTimeErrorCode.CONST_DEFERRED_CLASS
-    ]);
-  }
-
-  test_constDeferredClass_namedConstructor() async {
-    await resolveWithErrors(<String>[
-      r'''
-library lib1;
-class A {
-  const A.b();
-}''',
-      r'''
-library root;
-import 'lib1.dart' deferred as a;
-main() {
-  const a.A.b();
-}'''
-    ], <ErrorCode>[
-      CompileTimeErrorCode.CONST_DEFERRED_CLASS
-    ]);
-  }
-
-  test_constEval_newInstance_constConstructor() async {
-    Source source = addSource(r'''
-class A {
-  const A();
-}
-const a = new A();''');
-    await computeAnalysisResult(source);
-    assertErrors(source,
-        [CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE]);
-    verify([source]);
-  }
-
-  test_constEval_newInstance_externalFactoryConstConstructor() async {
-    // We can't evaluate "const A()" because its constructor is external.  But
-    // the code is correct--we shouldn't report an error.
-    Source source = addSource(r'''
-class A {
-  external const factory A();
-}
-const x = const A();''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_constEval_nonStaticField_inGenericClass() async {
-    Source source = addSource('''
-class C<T> {
-  const C();
-  T get t => null;
-}
-
-const x = const C().t;''');
-    await computeAnalysisResult(source);
-    assertErrors(source,
-        [CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE]);
-    verify([source]);
-  }
-
-  test_constEval_propertyExtraction_targetNotConst() async {
-    Source source = addSource(r'''
-class A {
-  const A();
-  int m() => 0;
-}
-final a = const A();
-const C = a.m;''');
-    await computeAnalysisResult(source);
-    assertErrors(source,
-        [CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE]);
-    verify([source]);
-  }
-
-  test_constEvalThrowsException() async {
-    Source source = addSource(r'''
-class C {
-  const C();
-}
-f() { return const C(); }''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.CONST_CONSTRUCTOR_THROWS_EXCEPTION]);
-    verify([source]);
-  }
-
-  test_constEvalThrowsException_binaryMinus_null() async {
-    await _check_constEvalThrowsException_binary_null("null - 5", false);
-    await _check_constEvalThrowsException_binary_null("5 - null", true);
-  }
-
-  test_constEvalThrowsException_binaryPlus_null() async {
-    await _check_constEvalThrowsException_binary_null("null + 5", false);
-    await _check_constEvalThrowsException_binary_null("5 + null", true);
-  }
-
-  test_constEvalThrowsException_divisionByZero() async {
-    Source source = addSource("const C = 1 ~/ 0;");
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.CONST_EVAL_THROWS_IDBZE]);
-    verify([source]);
-  }
-
-  test_constEvalThrowsException_finalAlreadySet_initializer() async {
-    // If a final variable has an initializer at the site of its declaration,
-    // and at the site of the constructor, then invoking that constructor would
-    // produce a runtime error; hence invoking that constructor via the "const"
-    // keyword results in a compile-time error.
-    Source source = addSource('''
-class C {
-  final x = 1;
-  const C() : x = 2;
-}
-var x = const C();
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION,
-      StaticWarningCode.FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION
-    ]);
-    verify([source]);
-  }
-
-  test_constEvalThrowsException_finalAlreadySet_initializing_formal() async {
-    // If a final variable has an initializer at the site of its declaration,
-    // and it is initialized using an initializing formal at the site of the
-    // constructor, then invoking that constructor would produce a runtime
-    // error; hence invoking that constructor via the "const" keyword results
-    // in a compile-time error.
-    Source source = addSource('''
-class C {
-  final x = 1;
-  const C(this.x);
-}
-var x = const C(2);
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION,
-      StaticWarningCode.FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR
-    ]);
-    verify([source]);
-  }
-
-  test_constEvalThrowsException_unaryBitNot_null() async {
-    Source source = addSource("const C = ~null;");
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION]);
-    // no verify(), '~null' is not resolved
-  }
-
-  test_constEvalThrowsException_unaryNegated_null() async {
-    Source source = addSource("const C = -null;");
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION]);
-    // no verify(), '-null' is not resolved
-  }
-
-  test_constEvalThrowsException_unaryNot_null() async {
-    Source source = addSource("const C = !null;");
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION]);
-    verify([source]);
-  }
-
-  test_constEvalTypeBool_binary() async {
-    await _check_constEvalTypeBool_withParameter_binary("p && ''");
-    await _check_constEvalTypeBool_withParameter_binary("p || ''");
-  }
-
-  test_constEvalTypeBool_binary_leftTrue() async {
-    Source source = addSource("const C = (true || 0);");
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [StaticTypeWarningCode.NON_BOOL_OPERAND, HintCode.DEAD_CODE]);
-    verify([source]);
-  }
-
-  test_constEvalTypeBool_logicalOr_trueLeftOperand() async {
-    Source source = addSource(r'''
-class C {
-  final int x;
-  const C({this.x}) : assert(x == null || x >= 0);
-}
-const c = const C();
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_constEvalTypeBoolNumString_equal() async {
-    Source source = addSource(r'''
-class A {
-  const A();
-}
-class B {
-  final a;
-  const B(num p) : a = p == const A();
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL_NUM_STRING]);
-    verify([source]);
-  }
-
-  test_constEvalTypeBoolNumString_notEqual() async {
-    Source source = addSource(r'''
-class A {
-  const A();
-}
-class B {
-  final a;
-  const B(String p) : a = p != const A();
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL_NUM_STRING]);
-    verify([source]);
-  }
-
-  test_constEvalTypeInt_binary() async {
-    await _check_constEvalTypeBoolOrInt_withParameter_binary("p ^ ''");
-    await _check_constEvalTypeBoolOrInt_withParameter_binary("p & ''");
-    await _check_constEvalTypeBoolOrInt_withParameter_binary("p | ''");
-    await _check_constEvalTypeInt_withParameter_binary("p >> ''");
-    await _check_constEvalTypeInt_withParameter_binary("p << ''");
-  }
-
-  test_constEvalTypeNum_binary() async {
-    await _check_constEvalTypeNum_withParameter_binary("p + ''");
-    await _check_constEvalTypeNum_withParameter_binary("p - ''");
-    await _check_constEvalTypeNum_withParameter_binary("p * ''");
-    await _check_constEvalTypeNum_withParameter_binary("p / ''");
-    await _check_constEvalTypeNum_withParameter_binary("p ~/ ''");
-    await _check_constEvalTypeNum_withParameter_binary("p > ''");
-    await _check_constEvalTypeNum_withParameter_binary("p < ''");
-    await _check_constEvalTypeNum_withParameter_binary("p >= ''");
-    await _check_constEvalTypeNum_withParameter_binary("p <= ''");
-    await _check_constEvalTypeNum_withParameter_binary("p % ''");
-  }
-
-  test_constFormalParameter_fieldFormalParameter() async {
-    Source source = addSource(r'''
-class A {
-  var x;
-  A(const this.x) {}
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source,
-        usingFastaParser
-            ? [
-                CompileTimeErrorCode.CONST_FORMAL_PARAMETER,
-                ParserErrorCode.EXTRANEOUS_MODIFIER
-              ]
-            : [CompileTimeErrorCode.CONST_FORMAL_PARAMETER]);
-    verify([source]);
-  }
-
-  test_constFormalParameter_simpleFormalParameter() async {
-    Source source = addSource("f(const x) {}");
-    await computeAnalysisResult(source);
-    assertErrors(
-        source,
-        usingFastaParser
-            ? [
-                CompileTimeErrorCode.CONST_FORMAL_PARAMETER,
-                ParserErrorCode.EXTRANEOUS_MODIFIER
-              ]
-            : [CompileTimeErrorCode.CONST_FORMAL_PARAMETER]);
-    verify([source]);
-  }
-
-  test_constInitializedWithNonConstValue() async {
-    Source source = addSource(r'''
-f(p) {
-  const C = p;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source,
-        [CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE]);
-    verify([source]);
-  }
-
-  test_constInitializedWithNonConstValue_finalField() async {
-    // Regression test for bug #25526 which previously
-    // caused two errors to be reported.
-    Source source = addSource(r'''
-class Foo {
-  final field = 0;
-  foo([int x = field]) {}
-}
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE]);
-    verify([source]);
-  }
-
-  test_constInitializedWithNonConstValue_missingConstInListLiteral() async {
-    Source source = addSource("const List L = [0];");
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_constInitializedWithNonConstValue_missingConstInMapLiteral() async {
-    Source source = addSource("const Map M = {'a' : 0};");
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_constInitializedWithNonConstValueFromDeferredClass() async {
-    await resolveWithErrors(<String>[
-      r'''
-library lib1;
-const V = 1;''',
-      r'''
-library root;
-import 'lib1.dart' deferred as a;
-const B = a.V;'''
-    ], <ErrorCode>[
-      CompileTimeErrorCode
-          .CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE_FROM_DEFERRED_LIBRARY
-    ]);
-  }
-
-  test_constInitializedWithNonConstValueFromDeferredClass_nested() async {
-    await resolveWithErrors(<String>[
-      r'''
-library lib1;
-const V = 1;''',
-      r'''
-library root;
-import 'lib1.dart' deferred as a;
-const B = a.V + 1;'''
-    ], <ErrorCode>[
-      CompileTimeErrorCode
-          .CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE_FROM_DEFERRED_LIBRARY
-    ]);
-  }
-
-  test_constInstanceField() async {
-    Source source = addSource(r'''
-class C {
-  const int f = 0;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.CONST_INSTANCE_FIELD]);
-    verify([source]);
-  }
-
-  test_constMapKeyTypeImplementsEquals_direct() async {
-    Source source = addSource(r'''
-class A {
-  const A();
-  operator ==(other) => false;
-}
-main() {
-  const {const A() : 0};
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source,
-        [CompileTimeErrorCode.CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQUALS]);
-    verify([source]);
-  }
-
-  test_constMapKeyTypeImplementsEquals_dynamic() async {
-    // Note: static type of B.a is "dynamic", but actual type of the const
-    // object is A.  We need to make sure we examine the actual type when
-    // deciding whether there is a problem with operator==.
-    Source source = addSource(r'''
-class A {
-  const A();
-  operator ==(other) => false;
-}
-class B {
-  static const a = const A();
-}
-main() {
-  const {B.a : 0};
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source,
-        [CompileTimeErrorCode.CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQUALS]);
-    verify([source]);
-  }
-
-  test_constMapKeyTypeImplementsEquals_factory() async {
-    Source source = addSource(r'''
-class A { const factory A() = B; }
-
-class B implements A {
-  const B();
-
-  operator ==(o) => true;
-}
-
-main() {
-  var m = const { const A(): 42 };
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source,
-        [CompileTimeErrorCode.CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQUALS]);
-    verify([source]);
-  }
-
-  test_constMapKeyTypeImplementsEquals_super() async {
-    Source source = addSource(r'''
-class A {
-  const A();
-  operator ==(other) => false;
-}
-class B extends A {
-  const B();
-}
-main() {
-  const {const B() : 0};
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source,
-        [CompileTimeErrorCode.CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQUALS]);
-    verify([source]);
-  }
-
-  test_constWithInvalidTypeParameters() async {
-    Source source = addSource(r'''
-class A {
-  const A();
-}
-f() { return const A<A>(); }''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.CONST_WITH_INVALID_TYPE_PARAMETERS]);
-    verify([source]);
-  }
-
-  test_constWithInvalidTypeParameters_tooFew() async {
-    Source source = addSource(r'''
-class A {}
-class C<K, V> {
-  const C();
-}
-f(p) {
-  return const C<A>();
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.CONST_WITH_INVALID_TYPE_PARAMETERS]);
-    verify([source]);
-  }
-
-  test_constWithInvalidTypeParameters_tooMany() async {
-    Source source = addSource(r'''
-class A {}
-class C<E> {
-  const C();
-}
-f(p) {
-  return const C<A, A>();
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.CONST_WITH_INVALID_TYPE_PARAMETERS]);
-    verify([source]);
-  }
-
-  test_constWithNonConst() async {
-    Source source = addSource(r'''
-class T {
-  T(a, b, {c, d}) {}
-}
-f() { return const T(0, 1, c: 2, d: 3); }''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.CONST_WITH_NON_CONST]);
-    verify([source]);
-  }
-
-  test_constWithNonConst_in_const_context() async {
-    Source source = addSource(r'''
-class A {
-  const A(x);
-}
-class B {
-}
-main() {
-  const A(B());
-}
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.CONST_WITH_NON_CONST]);
-    verify([source]);
-  }
-
-  test_constWithNonConstantArgument_annotation() async {
-    Source source = addSource(r'''
-class A {
-  const A(int p);
-}
-var v = 42;
-@A(v)
-main() {
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.CONST_WITH_NON_CONSTANT_ARGUMENT]);
-    verify([source]);
-  }
-
-  test_constWithNonConstantArgument_instanceCreation() async {
-    Source source = addSource(r'''
-class A {
-  const A(a);
-}
-f(p) { return const A(p); }''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CompileTimeErrorCode.CONST_WITH_NON_CONSTANT_ARGUMENT,
-    ]);
-    verify([source]);
-  }
-
-  test_constWithNonType() async {
-    Source source = addSource(r'''
-int A;
-f() {
-  return const A();
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.CONST_WITH_NON_TYPE]);
-    verify([source]);
-  }
-
-  test_constWithNonType_fromLibrary() async {
-    Source source1 = addNamedSource("/lib.dart", "");
-    Source source2 = addNamedSource("/lib2.dart", r'''
-import 'lib.dart' as lib;
-void f() {
-  const lib.A();
-}''');
-    await computeAnalysisResult(source1);
-    await computeAnalysisResult(source2);
-    assertErrors(source2, [CompileTimeErrorCode.CONST_WITH_NON_TYPE]);
-    verify([source1]);
-  }
-
-  test_constWithTypeParameters_direct() async {
-    Source source = addSource(r'''
-class A<T> {
-  static const V = const A<T>();
-  const A();
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS,
-      StaticWarningCode.TYPE_PARAMETER_REFERENCED_BY_STATIC
-    ]);
-    verify([source]);
-  }
-
-  test_constWithTypeParameters_indirect() async {
-    Source source = addSource(r'''
-class A<T> {
-  static const V = const A<List<T>>();
-  const A();
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS,
-      StaticWarningCode.TYPE_PARAMETER_REFERENCED_BY_STATIC
-    ]);
-    verify([source]);
-  }
-
-  test_constWithUndefinedConstructor() async {
-    Source source = addSource(r'''
-class A {
-  const A();
-}
-f() {
-  return const A.noSuchConstructor();
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.CONST_WITH_UNDEFINED_CONSTRUCTOR]);
-    // no verify(), 'noSuchConstructor' is not resolved
-  }
-
-  test_constWithUndefinedConstructorDefault() async {
-    Source source = addSource(r'''
-class A {
-  const A.name();
-}
-f() {
-  return const A();
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source,
-        [CompileTimeErrorCode.CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT]);
-    verify([source]);
-  }
-
-  test_defaultValueInFunctionTypeAlias_new_named() async {
-    Source source = addSource('''
-typedef F = int Function({Map<String, String> m: const {}});
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      ParserErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPE,
-      StrongModeCode.INVALID_CAST_LITERAL_MAP
-    ]);
-    verify([source]);
-  }
-
-  test_defaultValueInFunctionTypeAlias_new_positional() async {
-    Source source = addSource('''
-typedef F = int Function([Map<String, String> m = const {}]);
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      ParserErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPE,
-      StrongModeCode.INVALID_CAST_LITERAL_MAP
-    ]);
-    verify([source]);
-  }
-
-  test_defaultValueInFunctionTypeAlias_old_named() async {
-    Source source = addSource("typedef F([x = 0]);");
-    await computeAnalysisResult(source);
-    assertErrors(
-        source,
-        usingFastaParser
-            ? [
-                CompileTimeErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS,
-                ParserErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPE
-              ]
-            : [CompileTimeErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS]);
-    verify([source]);
-  }
-
-  test_defaultValueInFunctionTypeAlias_old_positional() async {
-    Source source = addSource("typedef F([x = 0]);");
-    await computeAnalysisResult(source);
-    assertErrors(
-        source,
-        usingFastaParser
-            ? [
-                CompileTimeErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS,
-                ParserErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPE
-              ]
-            : [CompileTimeErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS]);
-    verify([source]);
-  }
-
-  test_defaultValueInFunctionTypedParameter_named() async {
-    Source source = addSource("f(g({p: null})) {}");
-    await computeAnalysisResult(source);
-    assertErrors(
-        source,
-        usingFastaParser
-            ? [
-                CompileTimeErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPED_PARAMETER,
-                ParserErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPE
-              ]
-            : [CompileTimeErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPED_PARAMETER]);
-    verify([source]);
-  }
-
-  test_defaultValueInFunctionTypedParameter_optional() async {
-    Source source = addSource("f(g([p = null])) {}");
-    await computeAnalysisResult(source);
-    assertErrors(
-        source,
-        usingFastaParser
-            ? [
-                CompileTimeErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPED_PARAMETER,
-                ParserErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPE
-              ]
-            : [CompileTimeErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPED_PARAMETER]);
-    verify([source]);
-  }
-
-  test_defaultValueInRedirectingFactoryConstructor() async {
-    Source source = addSource(r'''
-class A {
-  factory A([int x = 0]) = B;
-}
-
-class B implements A {
-  B([int x = 1]) {}
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CompileTimeErrorCode.DEFAULT_VALUE_IN_REDIRECTING_FACTORY_CONSTRUCTOR
-    ]);
-    verify([source]);
-  }
-
-  test_deferredImportWithInvalidUri() async {
-    Source source = addSource(r'''
-import '[invalid uri]' deferred as p;
-main() {
-  p.loadLibrary();
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.URI_DOES_NOT_EXIST]);
-  }
-
-  test_duplicateDefinition_acrossLibraries() async {
-    Source librarySource = addNamedSource("/lib.dart", r'''
-library lib;
-
-part 'a.dart';
-part 'b.dart';''');
-    Source sourceA = addNamedSource("/a.dart", r'''
-part of lib;
-
-class A {}''');
-    Source sourceB = addNamedSource("/b.dart", r'''
-part of lib;
-
-class A {}''');
-    await computeAnalysisResult(librarySource);
-    await computeAnalysisResult(sourceA);
-    await computeAnalysisResult(sourceB);
-    assertNoErrors(librarySource);
-    assertErrors(sourceB, [CompileTimeErrorCode.DUPLICATE_DEFINITION]);
-    verify([librarySource, sourceA, sourceB]);
-  }
-
-  test_duplicateDefinition_catch() async {
-    Source source = addSource(r'''
-main() {
-  try {} catch (e, e) {}
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.DUPLICATE_DEFINITION]);
-    verify([source]);
-  }
-
-  test_duplicateDefinition_inPart() async {
-    Source librarySource = addNamedSource("/lib.dart", r'''
-library test;
-part 'a.dart';
-class A {}''');
-    Source sourceA = addNamedSource("/a.dart", r'''
-part of test;
-class A {}''');
-    await computeAnalysisResult(librarySource);
-    await computeAnalysisResult(sourceA);
-    assertNoErrors(librarySource);
-    assertErrors(sourceA, [CompileTimeErrorCode.DUPLICATE_DEFINITION]);
-    verify([librarySource, sourceA]);
-  }
-
-  test_duplicateDefinition_locals_inCase() async {
-    Source source = addSource(r'''
-main() {
-  switch(1) {
-    case 1:
-      var a;
-      var a;
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.DUPLICATE_DEFINITION]);
-    verify([source]);
-  }
-
-  test_duplicateDefinition_locals_inFunctionBlock() async {
-    Source source = addSource(r'''
-main() {
-  int m = 0;
-  m(a) {}
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.DUPLICATE_DEFINITION]);
-    verify([source]);
-  }
-
-  test_duplicateDefinition_locals_inIf() async {
-    Source source = addSource(r'''
-main(int p) {
-  if (p != 0) {
-    var a;
-    var a;
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.DUPLICATE_DEFINITION]);
-    verify([source]);
-  }
-
-  test_duplicateDefinition_locals_inMethodBlock() async {
-    Source source = addSource(r'''
-class A {
-  m() {
-    int a;
-    int a;
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.DUPLICATE_DEFINITION]);
-    verify([source]);
-  }
-
-  test_duplicateDefinition_parameters_inConstructor() async {
-    Source source = addSource(r'''
-class A {
-  int a;
-  A(int a, this.a);
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.DUPLICATE_DEFINITION]);
-    verify([source]);
-  }
-
-  test_duplicateDefinition_parameters_inFunctionTypeAlias() async {
-    Source source = addSource(r'''
-typedef F(int a, double a);
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.DUPLICATE_DEFINITION]);
-    verify([source]);
-  }
-
-  test_duplicateDefinition_parameters_inLocalFunction() async {
-    Source source = addSource(r'''
-main() {
-  f(int a, double a) {
-  };
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.DUPLICATE_DEFINITION]);
-    verify([source]);
-  }
-
-  test_duplicateDefinition_parameters_inMethod() async {
-    Source source = addSource(r'''
-class A {
-  m(int a, double a) {
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.DUPLICATE_DEFINITION]);
-    verify([source]);
-  }
-
-  test_duplicateDefinition_parameters_inTopLevelFunction() async {
-    Source source = addSource(r'''
-f(int a, double a) {
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.DUPLICATE_DEFINITION]);
-    verify([source]);
-  }
-
-  test_duplicateDefinition_typeParameters() async {
-    Source source = addSource(r'''
-class A<T, T> {
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.DUPLICATE_DEFINITION]);
-    verify([source]);
-  }
-
-  test_duplicateNamedArgument() async {
-    Source source = addSource(r'''
-f({a, b}) {}
-main() {
-  f(a: 1, a: 2);
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.DUPLICATE_NAMED_ARGUMENT]);
-    verify([source]);
-  }
-
-  test_duplicatePart_sameSource() async {
-    addNamedSource('/part.dart', 'part of lib;');
-    Source source = addSource(r'''
-library lib;
-part 'part.dart';
-part 'foo/../part.dart';
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.DUPLICATE_PART]);
-    verify([source]);
-  }
-
-  test_duplicatePart_sameUri() async {
-    addNamedSource('/part.dart', 'part of lib;');
-    Source source = addSource(r'''
-library lib;
-part 'part.dart';
-part 'part.dart';
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.DUPLICATE_PART]);
-    verify([source]);
-  }
-
-  test_exportInternalLibrary() async {
-    Source source = addSource("export 'dart:_interceptors';");
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.EXPORT_INTERNAL_LIBRARY]);
-    verify([source]);
-  }
-
-  test_exportOfNonLibrary() async {
-    Source source = addSource(r'''
-library L;
-export 'lib1.dart';''');
-    addNamedSource("/lib1.dart", "part of lib;");
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.EXPORT_OF_NON_LIBRARY]);
-    verify([source]);
-  }
-
-  test_extendsDeferredClass() async {
-    await resolveWithErrors(<String>[
-      r'''
-library lib1;
-class A {}''',
-      r'''
-library root;
-import 'lib1.dart' deferred as a;
-class B extends a.A {}'''
-    ], <ErrorCode>[
-      CompileTimeErrorCode.EXTENDS_DEFERRED_CLASS
-    ]);
-  }
-
-  test_extendsDeferredClass_classTypeAlias() async {
-    await resolveWithErrors(<String>[
-      r'''
-library lib1;
-class A {}''',
-      r'''
-library root;
-import 'lib1.dart' deferred as a;
-class M {}
-class C = a.A with M;'''
-    ], <ErrorCode>[
-      CompileTimeErrorCode.EXTENDS_DEFERRED_CLASS
-    ]);
-  }
-
-  test_extendsDisallowedClass_class_bool() async {
-    Source source = addSource("class A extends bool {}");
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS,
-      CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT
-    ]);
-    verify([source]);
-  }
-
-  test_extendsDisallowedClass_class_double() async {
-    Source source = addSource("class A extends double {}");
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS]);
-    verify([source]);
-  }
-
-  test_extendsDisallowedClass_class_int() async {
-    Source source = addSource("class A extends int {}");
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS,
-      CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT
-    ]);
-    verify([source]);
-  }
-
-  test_extendsDisallowedClass_class_Null() async {
-    Source source = addSource("class A extends Null {}");
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS,
-      CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT
-    ]);
-    verify([source]);
-  }
-
-  test_extendsDisallowedClass_class_num() async {
-    Source source = addSource("class A extends num {}");
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS]);
-    verify([source]);
-  }
-
-  test_extendsDisallowedClass_class_String() async {
-    Source source = addSource("class A extends String {}");
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS,
-      CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT
-    ]);
-    verify([source]);
-  }
-
-  test_extendsDisallowedClass_classTypeAlias_bool() async {
-    Source source = addSource(r'''
-class M {}
-class C = bool with M;''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS]);
-    verify([source]);
-  }
-
-  test_extendsDisallowedClass_classTypeAlias_double() async {
-    Source source = addSource(r'''
-class M {}
-class C = double with M;''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS]);
-    verify([source]);
-  }
-
-  test_extendsDisallowedClass_classTypeAlias_int() async {
-    Source source = addSource(r'''
-class M {}
-class C = int with M;''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS]);
-    verify([source]);
-  }
-
-  test_extendsDisallowedClass_classTypeAlias_Null() async {
-    Source source = addSource(r'''
-class M {}
-class C = Null with M;''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS]);
-    verify([source]);
-  }
-
-  test_extendsDisallowedClass_classTypeAlias_num() async {
-    Source source = addSource(r'''
-class M {}
-class C = num with M;''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS]);
-    verify([source]);
-  }
-
-  test_extendsDisallowedClass_classTypeAlias_String() async {
-    Source source = addSource(r'''
-class M {}
-class C = String with M;''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS]);
-    verify([source]);
-  }
-
-  test_extraPositionalArguments_const() async {
-    Source source = addSource(r'''
-class A {
-  const A();
-}
-main() {
-  const A(0);
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.EXTRA_POSITIONAL_ARGUMENTS]);
-    verify([source]);
-  }
-
-  test_extraPositionalArguments_const_super() async {
-    Source source = addSource(r'''
-class A {
-  const A();
-}
-class B extends A {
-  const B() : super(0);
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.EXTRA_POSITIONAL_ARGUMENTS]);
-    verify([source]);
-  }
-
-  test_extraPositionalArgumentsCouldBeNamed_const() async {
-    Source source = addSource(r'''
-class A {
-  const A({int x});
-}
-main() {
-  const A(0);
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source,
-        [CompileTimeErrorCode.EXTRA_POSITIONAL_ARGUMENTS_COULD_BE_NAMED]);
-    verify([source]);
-  }
-
-  test_extraPositionalArgumentsCouldBeNamed_const_super() async {
-    Source source = addSource(r'''
-class A {
-  const A({int x});
-}
-class B extends A {
-  const B() : super(0);
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source,
-        [CompileTimeErrorCode.EXTRA_POSITIONAL_ARGUMENTS_COULD_BE_NAMED]);
-    verify([source]);
-  }
-
-  test_fieldFormalParameter_assignedInInitializer() async {
-    Source source = addSource(r'''
-class A {
-  int x;
-  A(this.x) : x = 3 {}
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source,
-        [CompileTimeErrorCode.FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER]);
-    verify([source]);
-  }
-
-  test_fieldInitializedByMultipleInitializers() async {
-    Source source = addSource(r'''
-class A {
-  int x;
-  A() : x = 0, x = 1 {}
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source,
-        [CompileTimeErrorCode.FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS]);
-    verify([source]);
-  }
-
-  test_fieldInitializedByMultipleInitializers_multipleInits() async {
-    Source source = addSource(r'''
-class A {
-  int x;
-  A() : x = 0, x = 1, x = 2 {}
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CompileTimeErrorCode.FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS,
-      CompileTimeErrorCode.FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS
-    ]);
-    verify([source]);
-  }
-
-  test_fieldInitializedByMultipleInitializers_multipleNames() async {
-    Source source = addSource(r'''
-class A {
-  int x;
-  int y;
-  A() : x = 0, x = 1, y = 0, y = 1 {}
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CompileTimeErrorCode.FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS,
-      CompileTimeErrorCode.FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS
-    ]);
-    verify([source]);
-  }
-
-  test_fieldInitializedInParameterAndInitializer() async {
-    Source source = addSource(r'''
-class A {
-  int x;
-  A(this.x) : x = 1 {}
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source,
-        [CompileTimeErrorCode.FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER]);
-    verify([source]);
-  }
-
-  test_fieldInitializerFactoryConstructor() async {
-    Source source = addSource(r'''
-class A {
-  int x;
-  factory A(this.x) => null;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.FIELD_INITIALIZER_FACTORY_CONSTRUCTOR]);
-    verify([source]);
-  }
-
-  test_fieldInitializerOutsideConstructor() async {
-    // TODO(brianwilkerson) Fix the duplicate error messages.
-    Source source = addSource(r'''
-class A {
-  int x;
-  m(this.x) {}
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      ParserErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR,
-      CompileTimeErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR
-    ]);
-    verify([source]);
-  }
-
-  test_fieldInitializerOutsideConstructor_defaultParameter() async {
-    Source source = addSource(r'''
-class A {
-  int x;
-  m([this.x]) {}
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR]);
-    verify([source]);
-  }
-
-  test_fieldInitializerOutsideConstructor_inFunctionTypeParameter() async {
-    Source source = addSource(r'''
-class A {
-  int x;
-  A(int p(this.x));
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR]);
-    verify([source]);
-  }
-
-  test_fieldInitializerRedirectingConstructor_afterRedirection() async {
-    Source source = addSource(r'''
-class A {
-  int x;
-  A.named() {}
-  A() : this.named(), x = 42;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source,
-        [CompileTimeErrorCode.FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR]);
-    verify([source]);
-  }
-
-  test_fieldInitializerRedirectingConstructor_beforeRedirection() async {
-    Source source = addSource(r'''
-class A {
-  int x;
-  A.named() {}
-  A() : x = 42, this.named();
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source,
-        [CompileTimeErrorCode.FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR]);
-    verify([source]);
-  }
-
-  test_fieldInitializingFormalRedirectingConstructor() async {
-    Source source = addSource(r'''
-class A {
-  int x;
-  A.named() {}
-  A(this.x) : this.named();
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source,
-        [CompileTimeErrorCode.FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR]);
-    verify([source]);
-  }
-
-  test_finalInitializedMultipleTimes_initializers() async {
-    Source source = addSource(r'''
-class A {
-  final x;
-  A() : x = 0, x = 0 {}
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source,
-        [CompileTimeErrorCode.FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS]);
-    verify([source]);
-  }
-
-  /**
-   * This test doesn't test the FINAL_INITIALIZED_MULTIPLE_TIMES code, but tests the
-   * FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER code instead. It is provided here to show
-   * coverage over all of the permutations of initializers in constructor declarations.
-   *
-   * Note: FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER covers a subset of
-   * FINAL_INITIALIZED_MULTIPLE_TIMES, since it more specific, we use it instead of the broader code
-   */
-  test_finalInitializedMultipleTimes_initializingFormal_initializer() async {
-    Source source = addSource(r'''
-class A {
-  final x;
-  A(this.x) : x = 0 {}
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source,
-        [CompileTimeErrorCode.FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER]);
-    verify([source]);
-  }
-
-  test_finalInitializedMultipleTimes_initializingFormals() async {
-    Source source = addSource(r'''
-class A {
-  final x;
-  A(this.x, this.x) {}
-}''');
-    // TODO(brianwilkerson) There should only be one error here.
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CompileTimeErrorCode.DUPLICATE_DEFINITION,
-      CompileTimeErrorCode.FINAL_INITIALIZED_MULTIPLE_TIMES
-    ]);
-    verify([source]);
-  }
-
-  test_finalNotInitialized_instanceField_const_static() async {
-    Source source = addSource(r'''
-class A {
-  static const F;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.CONST_NOT_INITIALIZED]);
-    verify([source]);
-  }
-
-  test_finalNotInitialized_library_const() async {
-    Source source = addSource("const F;");
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.CONST_NOT_INITIALIZED]);
-    verify([source]);
-  }
-
-  test_finalNotInitialized_local_const() async {
-    Source source = addSource(r'''
-f() {
-  const int x;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.CONST_NOT_INITIALIZED]);
-    verify([source]);
-  }
-
-  test_forInWithConstVariable_forEach_identifier() async {
-    Source source = addSource(r'''
-f() {
-  const x = 0;
-  for (x in [0, 1, 2]) {}
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.FOR_IN_WITH_CONST_VARIABLE]);
-    verify([source]);
-  }
-
-  test_forInWithConstVariable_forEach_loopVariable() async {
-    Source source = addSource(r'''
-f() {
-  for (const x in [0, 1, 2]) {}
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.FOR_IN_WITH_CONST_VARIABLE]);
-    verify([source]);
-  }
-
-  test_fromEnvironment_bool_badArgs() async {
-    Source source = addSource(r'''
-var b1 = const bool.fromEnvironment(1);
-var b2 = const bool.fromEnvironment('x', defaultValue: 1);''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION,
-      StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE,
-      CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION,
-      StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE
-    ]);
-    verify([source]);
-  }
-
-  test_fromEnvironment_bool_badDefault_whenDefined() async {
-    // The type of the defaultValue needs to be correct even when the default
-    // value isn't used (because the variable is defined in the environment).
-    if (enableNewAnalysisDriver) {
-      driver.declaredVariables = new DeclaredVariables.fromMap({'x': 'true'});
-    } else {
-      (analysisContext2 as AnalysisContextImpl).declaredVariables =
-          new DeclaredVariables.fromMap({'x': 'true'});
-    }
-    Source source =
-        addSource("var b = const bool.fromEnvironment('x', defaultValue: 1);");
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION,
-      StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE
-    ]);
-    verify([source]);
-  }
-
-  test_genericFunctionTypeArgument_inference_function() async {
-    Source source = addSource(r'''
-T f<T>(T t) => null;
-main() { f(<S>(S s) => s); }''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [StrongModeCode.COULD_NOT_INFER]);
-    verify([source]);
-  }
-
-  test_genericFunctionTypeArgument_inference_functionType() async {
-    Source source = addSource(r'''
-T Function<T>(T) f;
-main() { f(<S>(S s) => s); }''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [StrongModeCode.COULD_NOT_INFER]);
-    verify([source]);
-  }
-
-  test_genericFunctionTypeArgument_inference_method() async {
-    Source source = addSource(r'''
-class C {
-  T f<T>(T t) => null;
-}
-main() { new C().f(<S>(S s) => s); }''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [StrongModeCode.COULD_NOT_INFER]);
-    verify([source]);
-  }
-
-  test_genericFunctionTypeAsBound_class() async {
-    Source source = addSource(r'''
-class C<T extends S Function<S>(S)> {
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.GENERIC_FUNCTION_TYPE_CANNOT_BE_BOUND]);
-    verify([source]);
-  }
-
-  test_genericFunctionTypeAsBound_genericFunction() async {
-    Source source = addSource(r'''
-T Function<T extends S Function<S>(S)>(T) fun;
-''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.GENERIC_FUNCTION_TYPE_CANNOT_BE_BOUND]);
-    verify([source]);
-  }
-
-  test_genericFunctionTypeAsBound_genericFunctionTypedef() async {
-    Source source = addSource(r'''
-typedef foo = T Function<T extends S Function<S>(S)>(T t);
-''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.GENERIC_FUNCTION_TYPE_CANNOT_BE_BOUND]);
-    verify([source]);
-  }
-
-  test_genericFunctionTypeAsBound_parameterOfFunction() async {
-    Source source = addSource(r'''
-class C<T extends void Function(S Function<S>(S))> {
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_genericFunctionTypeAsBound_typedef() async {
-    Source source = addSource(r'''
-typedef T foo<T extends S Function<S>(S)>(T t);
-''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.GENERIC_FUNCTION_TYPE_CANNOT_BE_BOUND]);
-    verify([source]);
-  }
-
-  test_genericFunctionTypedParameter() async {
-    // Once dartbug.com/28515 is fixed, this syntax should no longer generate an
-    // error.
-    // TODO(paulberry): When dartbug.com/28515 is fixed, convert this into a
-    // NonErrorResolverTest.
-    Source source = addSource('void g(T f<T>(T x)) {}');
-    await computeAnalysisResult(source);
-    var expectedErrorCodes = <ErrorCode>[
-      CompileTimeErrorCode.GENERIC_FUNCTION_TYPED_PARAM_UNSUPPORTED
-    ];
-    if (enableNewAnalysisDriver) {
-      // Due to dartbug.com/28515, some additional errors appear when using the
-      // new analysis driver.
-      expectedErrorCodes.addAll([
-        StaticWarningCode.UNDEFINED_CLASS,
-        StaticWarningCode.UNDEFINED_CLASS
-      ]);
-    }
-    assertErrors(source, expectedErrorCodes);
-    verify([source]);
-  }
-
-  test_implementsDeferredClass() async {
-    await resolveWithErrors(<String>[
-      r'''
-library lib1;
-class A {}''',
-      r'''
-library root;
-import 'lib1.dart' deferred as a;
-class B implements a.A {}'''
-    ], <ErrorCode>[
-      CompileTimeErrorCode.IMPLEMENTS_DEFERRED_CLASS
-    ]);
-  }
-
-  test_implementsDeferredClass_classTypeAlias() async {
-    await resolveWithErrors(<String>[
-      r'''
-library lib1;
-class A {}''',
-      r'''
-library root;
-import 'lib1.dart' deferred as a;
-class B {}
-class M {}
-class C = B with M implements a.A;'''
-    ], <ErrorCode>[
-      CompileTimeErrorCode.IMPLEMENTS_DEFERRED_CLASS
-    ]);
-  }
-
-  test_implementsDisallowedClass_class_bool() async {
-    Source source = addSource("class A implements bool {}");
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS]);
-    verify([source]);
-  }
-
-  test_implementsDisallowedClass_class_double() async {
-    Source source = addSource("class A implements double {}");
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS]);
-    verify([source]);
-  }
-
-  test_implementsDisallowedClass_class_int() async {
-    Source source = addSource("class A implements int {}");
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS]);
-    verify([source]);
-  }
-
-  test_implementsDisallowedClass_class_Null() async {
-    Source source = addSource("class A implements Null {}");
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS]);
-    verify([source]);
-  }
-
-  test_implementsDisallowedClass_class_num() async {
-    Source source = addSource("class A implements num {}");
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS]);
-    verify([source]);
-  }
-
-  test_implementsDisallowedClass_class_String() async {
-    Source source = addSource("class A implements String {}");
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS]);
-    verify([source]);
-  }
-
-  test_implementsDisallowedClass_class_String_num() async {
-    Source source = addSource("class A implements String, num {}");
-    await computeAnalysisResult(source);
-    if (enableNewAnalysisDriver) {
-      assertErrors(source, [
-        CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS,
-        CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS
-      ]);
-    } else {
-      assertErrors(source, [
-        CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS,
-        CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS
-      ]);
-    }
-    verify([source]);
-  }
-
-  test_implementsDisallowedClass_classTypeAlias_bool() async {
-    Source source = addSource(r'''
-class A {}
-class M {}
-class C = A with M implements bool;''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS]);
-    verify([source]);
-  }
-
-  test_implementsDisallowedClass_classTypeAlias_double() async {
-    Source source = addSource(r'''
-class A {}
-class M {}
-class C = A with M implements double;''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS]);
-    verify([source]);
-  }
-
-  test_implementsDisallowedClass_classTypeAlias_int() async {
-    Source source = addSource(r'''
-class A {}
-class M {}
-class C = A with M implements int;''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS]);
-    verify([source]);
-  }
-
-  test_implementsDisallowedClass_classTypeAlias_Null() async {
-    Source source = addSource(r'''
-class A {}
-class M {}
-class C = A with M implements Null;''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS]);
-    verify([source]);
-  }
-
-  test_implementsDisallowedClass_classTypeAlias_num() async {
-    Source source = addSource(r'''
-class A {}
-class M {}
-class C = A with M implements num;''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS]);
-    verify([source]);
-  }
-
-  test_implementsDisallowedClass_classTypeAlias_String() async {
-    Source source = addSource(r'''
-class A {}
-class M {}
-class C = A with M implements String;''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS]);
-    verify([source]);
-  }
-
-  test_implementsDisallowedClass_classTypeAlias_String_num() async {
-    Source source = addSource(r'''
-class A {}
-class M {}
-class C = A with M implements String, num;''');
-    await computeAnalysisResult(source);
-    if (enableNewAnalysisDriver) {
-      assertErrors(source, [
-        CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS,
-        CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS
-      ]);
-    } else {
-      assertErrors(source, [
-        CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS,
-        CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS
-      ]);
-    }
-    verify([source]);
-  }
-
-  test_implementsNonClass_class() async {
-    Source source = addSource(r'''
-int A;
-class B implements A {}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_NON_CLASS]);
-    verify([source]);
-  }
-
-  test_implementsNonClass_dynamic() async {
-    Source source = addSource("class A implements dynamic {}");
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_NON_CLASS]);
-    verify([source]);
-  }
-
-  test_implementsNonClass_enum() async {
-    Source source = addSource(r'''
-enum E { ONE }
-class A implements E {}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_NON_CLASS]);
-    verify([source]);
-  }
-
-  test_implementsNonClass_typeAlias() async {
-    Source source = addSource(r'''
-class A {}
-class M {}
-int B;
-class C = A with M implements B;''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_NON_CLASS]);
-    verify([source]);
-  }
-
-  test_implementsSuperClass() async {
-    Source source = addSource(r'''
-class A {}
-class B extends A implements A {}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_SUPER_CLASS]);
-    verify([source]);
-  }
-
-  test_implementsSuperClass_Object() async {
-    Source source = addSource("class A implements Object {}");
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_SUPER_CLASS]);
-    verify([source]);
-  }
-
-  test_implementsSuperClass_Object_typeAlias() async {
-    Source source = addSource(r'''
-class M {}
-class A = Object with M implements Object;
-    ''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_SUPER_CLASS]);
-    verify([source]);
-  }
-
-  test_implementsSuperClass_typeAlias() async {
-    Source source = addSource(r'''
-class A {}
-class M {}
-class B = A with M implements A;''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_SUPER_CLASS]);
-    verify([source]);
-  }
-
-  test_implicitThisReferenceInInitializer_field() async {
-    Source source = addSource(r'''
-class A {
-  var v;
-  A() : v = f;
-  var f;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER]);
-    verify([source]);
-  }
-
-  test_implicitThisReferenceInInitializer_field2() async {
-    Source source = addSource(r'''
-class A {
-  final x = 0;
-  final y = x;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER,
-      StrongModeCode.TOP_LEVEL_INSTANCE_GETTER
-    ]);
-    verify([source]);
-  }
-
-  test_implicitThisReferenceInInitializer_invocation() async {
-    Source source = addSource(r'''
-class A {
-  var v;
-  A() : v = f();
-  f() {}
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER]);
-    verify([source]);
-  }
-
-  test_implicitThisReferenceInInitializer_invocationInStatic() async {
-    Source source = addSource(r'''
-class A {
-  static var F = m();
-  int m() => 0;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER]);
-    verify([source]);
-  }
-
-  test_implicitThisReferenceInInitializer_redirectingConstructorInvocation() async {
-    Source source = addSource(r'''
-class A {
-  A(p) {}
-  A.named() : this(f);
-  var f;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER]);
-    verify([source]);
-  }
-
-  test_implicitThisReferenceInInitializer_superConstructorInvocation() async {
-    Source source = addSource(r'''
-class A {
-  A(p) {}
-}
-class B extends A {
-  B() : super(f);
-  var f;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER]);
-    verify([source]);
-  }
-
-  test_importInternalLibrary() async {
-    Source source = addSource("import 'dart:_interceptors';");
-    // Note, in these error cases we may generate an UNUSED_IMPORT hint, while
-    // we could prevent the hint from being generated by testing the import
-    // directive for the error, this is such a minor corner case that we don't
-    // think we should add the additional computation time to figure out such
-    // cases.
-    await computeAnalysisResult(source);
-    assertErrors(source,
-        [CompileTimeErrorCode.IMPORT_INTERNAL_LIBRARY, HintCode.UNUSED_IMPORT]);
-    verify([source]);
-  }
-
-  test_importOfNonLibrary() async {
-    Source source = addSource(r'''
-library lib;
-import 'part.dart';
-A a;''');
-    addNamedSource("/part.dart", r'''
-part of lib;
-class A{}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.IMPORT_OF_NON_LIBRARY]);
-    verify([source]);
-  }
-
-  test_inconsistentCaseExpressionTypes() async {
-    Source source = addSource(r'''
-f(var p) {
-  switch (p) {
-    case 1:
-      break;
-    case 'a':
-      break;
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.INCONSISTENT_CASE_EXPRESSION_TYPES]);
-    verify([source]);
-  }
-
-  test_inconsistentCaseExpressionTypes_dynamic() async {
-    // Even though A.S and S have a static type of "dynamic", we should see
-    // that they fail to match 3, because they are constant strings.
-    Source source = addSource(r'''
-class A {
-  static const S = 'A.S';
-}
-
-const S = 'S';
-
-foo(var p) {
-  switch (p) {
-    case 3:
-      break;
-    case S:
-      break;
-    case A.S:
-      break;
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CompileTimeErrorCode.INCONSISTENT_CASE_EXPRESSION_TYPES,
-      CompileTimeErrorCode.INCONSISTENT_CASE_EXPRESSION_TYPES
-    ]);
-    verify([source]);
-  }
-
-  test_inconsistentCaseExpressionTypes_repeated() async {
-    Source source = addSource(r'''
-f(var p) {
-  switch (p) {
-    case 1:
-      break;
-    case 'a':
-      break;
-    case 'b':
-      break;
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CompileTimeErrorCode.INCONSISTENT_CASE_EXPRESSION_TYPES,
-      CompileTimeErrorCode.INCONSISTENT_CASE_EXPRESSION_TYPES
-    ]);
-    verify([source]);
-  }
-
-  test_initializerForNonExistent_const() async {
-    // Check that the absence of a matching field doesn't cause a
-    // crash during constant evaluation.
-    Source source = addSource(r'''
-class A {
-  const A() : x = 'foo';
-}
-A a = const A();''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.INITIALIZER_FOR_NON_EXISTENT_FIELD]);
-  }
-
-  test_initializerForNonExistent_initializer() async {
-    Source source = addSource(r'''
-class A {
-  A() : x = 0 {}
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.INITIALIZER_FOR_NON_EXISTENT_FIELD]);
-  }
-
-  test_initializerForStaticField() async {
-    Source source = addSource(r'''
-class A {
-  static int x;
-  A() : x = 0 {}
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.INITIALIZER_FOR_STATIC_FIELD]);
-    verify([source]);
-  }
-
-  test_initializingFormalForNonExistentField() async {
-    Source source = addSource(r'''
-class A {
-  A(this.x) {}
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source,
-        [CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD]);
-    verify([source]);
-  }
-
-  test_initializingFormalForNonExistentField_notInEnclosingClass() async {
-    Source source = addSource(r'''
-class A {
-int x;
-}
-class B extends A {
-  B(this.x) {}
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source,
-        [CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD]);
-    verify([source]);
-  }
-
-  test_initializingFormalForNonExistentField_optional() async {
-    Source source = addSource(r'''
-class A {
-  A([this.x]) {}
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source,
-        [CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD]);
-    verify([source]);
-  }
-
-  test_initializingFormalForNonExistentField_synthetic() async {
-    Source source = addSource(r'''
-class A {
-  int get x => 1;
-  A(this.x) {}
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source,
-        [CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD]);
-    verify([source]);
-  }
-
-  test_initializingFormalForStaticField() async {
-    Source source = addSource(r'''
-class A {
-  static int x;
-  A([this.x]) {}
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_STATIC_FIELD]);
-    verify([source]);
-  }
-
-  test_instanceMemberAccessFromFactory_named() async {
-    Source source = addSource(r'''
-class A {
-  m() {}
-  A();
-  factory A.make() {
-    m();
-    return new A();
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_FACTORY]);
-    verify([source]);
-  }
-
-  test_instanceMemberAccessFromFactory_unnamed() async {
-    Source source = addSource(r'''
-class A {
-  m() {}
-  A._();
-  factory A() {
-    m();
-    return new A._();
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_FACTORY]);
-    verify([source]);
-  }
-
-  test_instanceMemberAccessFromStatic_field() async {
-    Source source = addSource(r'''
-class A {
-  int f;
-  static foo() {
-    f;
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_STATIC]);
-    verify([source]);
-  }
-
-  test_instanceMemberAccessFromStatic_getter() async {
-    Source source = addSource(r'''
-class A {
-  get g => null;
-  static foo() {
-    g;
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_STATIC]);
-    verify([source]);
-  }
-
-  test_instanceMemberAccessFromStatic_method() async {
-    Source source = addSource(r'''
-class A {
-  m() {}
-  static foo() {
-    m();
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_STATIC]);
-    verify([source]);
-  }
-
-  test_instantiate_to_bounds_not_matching_bounds() async {
-    Source source = addSource('''
-class Foo<T> {}
-class Bar<T extends Foo<T>> {}
-class Baz extends Bar {}
-void main() {}
-''');
-    var result = await computeAnalysisResult(source);
-    // Instantiate-to-bounds should have instantiated "Bar" to "Bar<Foo>"
-    expect(result.unit.declaredElement.getType('Baz').supertype.toString(),
-        'Bar<Foo<dynamic>>');
-    // Therefore there should be an error, since Bar's type argument T is Foo,
-    // which doesn't extends Foo<T>.
-    assertErrors(
-        source, [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
-  }
-
-  test_instantiateEnum_const() async {
-    Source source = addSource(r'''
-enum E { ONE }
-E e(String name) {
-  return const E();
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.INSTANTIATE_ENUM]);
-    verify([source]);
-  }
-
-  test_instantiateEnum_new() async {
-    Source source = addSource(r'''
-enum E { ONE }
-E e(String name) {
-  return new E();
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.INSTANTIATE_ENUM]);
-    verify([source]);
-  }
-
-  test_integerLiteralAsDoubleOutOfRange_excessiveExponent() async {
-    Source source = addSource(
-        'double x = 0xfffffffffffff80000000000000000000000000000000000000000000'
-        '0000000000000000000000000000000000000000000000000000000000000000000000'
-        '0000000000000000000000000000000000000000000000000000000000000000000000'
-        '000000000000000000000000000000000000000000000000000000000000;');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.INTEGER_LITERAL_IMPRECISE_AS_DOUBLE]);
-    AnalysisError error = analysisResults[source].errors[0];
-
-    // Check that we suggest the max double instead.
-    expect(
-        true,
-        error.correction.contains(
-            '179769313486231570814527423731704356798070567525844996598917476803'
-            '157260780028538760589558632766878171540458953514382464234321326889'
-            '464182768467546703537516986049910576551282076245490090389328944075'
-            '868508455133942304583236903222948165808559332123348274797826204144'
-            '723168738177180919299881250404026184124858368'));
-  }
-
-  test_integerLiteralAsDoubleOutOfRange_excessiveMantissa() async {
-    Source source = addSource('double x = 9223372036854775809;');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.INTEGER_LITERAL_IMPRECISE_AS_DOUBLE]);
-    AnalysisError error = analysisResults[source].errors[0];
-    // Check that we suggest a valid double instead.
-    expect(true, error.correction.contains('9223372036854775808'));
-  }
-
-  test_integerLiteralOutOfRange_negative() async {
-    Source source = addSource('int x = -9223372036854775809;');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.INTEGER_LITERAL_OUT_OF_RANGE]);
-  }
-
-  test_integerLiteralOutOfRange_positive() async {
-    Source source = addSource('int x = 9223372036854775808;');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.INTEGER_LITERAL_OUT_OF_RANGE]);
-  }
-
-  test_invalidAnnotation_importWithPrefix_notConstantVariable() async {
-    addNamedSource("/lib.dart", r'''
-library lib;
-final V = 0;''');
-    Source source = addSource(r'''
-import 'lib.dart' as p;
-@p.V
-main() {
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.INVALID_ANNOTATION]);
-    verify([source]);
-  }
-
-  test_invalidAnnotation_importWithPrefix_notVariableOrConstructorInvocation() async {
-    addNamedSource("/lib.dart", r'''
-library lib;
-typedef V();''');
-    Source source = addSource(r'''
-import 'lib.dart' as p;
-@p.V
-main() {
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.INVALID_ANNOTATION]);
-    verify([source]);
-  }
-
-  test_invalidAnnotation_notConstantVariable() async {
-    Source source = addSource(r'''
-final V = 0;
-@V
-main() {
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.INVALID_ANNOTATION]);
-    verify([source]);
-  }
-
-  test_invalidAnnotation_notVariableOrConstructorInvocation() async {
-    Source source = addSource(r'''
-typedef V();
-@V
-main() {
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.INVALID_ANNOTATION]);
-    verify([source]);
-  }
-
-  test_invalidAnnotation_staticMethodReference() async {
-    Source source = addSource(r'''
-class A {
-  static f() {}
-}
-@A.f
-main() {
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.INVALID_ANNOTATION]);
-    verify([source]);
-  }
-
-  test_invalidAnnotationFromDeferredLibrary() async {
-    // See test_invalidAnnotation_notConstantVariable
-    await resolveWithErrors(<String>[
-      r'''
-library lib1;
-class V { const V(); }
-const v = const V();''',
-      r'''
-library root;
-import 'lib1.dart' deferred as a;
-@a.v main () {}'''
-    ], <ErrorCode>[
-      CompileTimeErrorCode.INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY
-    ]);
-  }
-
-  test_invalidAnnotationFromDeferredLibrary_constructor() async {
-    // See test_invalidAnnotation_notConstantVariable
-    await resolveWithErrors(<String>[
-      r'''
-library lib1;
-class C { const C(); }''',
-      r'''
-library root;
-import 'lib1.dart' deferred as a;
-@a.C() main () {}'''
-    ], <ErrorCode>[
-      CompileTimeErrorCode.INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY
-    ]);
-  }
-
-  test_invalidAnnotationFromDeferredLibrary_namedConstructor() async {
-    // See test_invalidAnnotation_notConstantVariable
-    await resolveWithErrors(<String>[
-      r'''
-library lib1;
-class C { const C.name(); }''',
-      r'''
-library root;
-import 'lib1.dart' deferred as a;
-@a.C.name() main () {}'''
-    ], <ErrorCode>[
-      CompileTimeErrorCode.INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY
-    ]);
-  }
-
-  test_invalidAnnotationGetter_getter() async {
-    Source source = addSource(r'''
-get V => 0;
-@V
-main() {
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.INVALID_ANNOTATION_GETTER]);
-    verify([source]);
-  }
-
-  test_invalidAnnotationGetter_importWithPrefix_getter() async {
-    addNamedSource("/lib.dart", r'''
-library lib;
-get V => 0;''');
-    Source source = addSource(r'''
-import 'lib.dart' as p;
-@p.V
-main() {
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.INVALID_ANNOTATION_GETTER]);
-    verify([source]);
-  }
-
-  test_invalidConstructorName_notEnclosingClassName_defined() async {
-    Source source = addSource(r'''
-class A {
-  B() : super();
-}
-class B {}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.INVALID_CONSTRUCTOR_NAME]);
-    // no verify() call, "B" is not resolved
-  }
-
-  test_invalidConstructorName_notEnclosingClassName_undefined() async {
-    Source source = addSource(r'''
-class A {
-  B() : super();
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.INVALID_CONSTRUCTOR_NAME]);
-    // no verify() call, "B" is not resolved
-  }
-
-  test_invalidFactoryNameNotAClass_notClassName() async {
-    Source source = addSource(r'''
-int B;
-class A {
-  factory B() => null;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.INVALID_FACTORY_NAME_NOT_A_CLASS]);
-    verify([source]);
-  }
-
-  test_invalidFactoryNameNotAClass_notEnclosingClassName() async {
-    Source source = addSource(r'''
-class A {
-  factory B() => null;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.INVALID_FACTORY_NAME_NOT_A_CLASS]);
-    // no verify() call, "B" is not resolved
-  }
-
-  test_invalidIdentifierInAsync_async() async {
-    // TODO(brianwilkerson) Report this error.
-    Source source = addSource(r'''
-class A {
-  m() async {
-    int async;
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.INVALID_IDENTIFIER_IN_ASYNC]);
-    verify([source]);
-  }
-
-  test_invalidIdentifierInAsync_await() async {
-    // TODO(brianwilkerson) Report this error.
-    Source source = addSource(r'''
-class A {
-  m() async {
-    int await;
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.INVALID_IDENTIFIER_IN_ASYNC]);
-    verify([source]);
-  }
-
-  test_invalidIdentifierInAsync_yield() async {
-    // TODO(brianwilkerson) Report this error.
-    Source source = addSource(r'''
-class A {
-  m() async {
-    int yield;
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.INVALID_IDENTIFIER_IN_ASYNC]);
-    verify([source]);
-  }
-
-  test_invalidModifierOnConstructor_async() async {
-    Source source = addSource(r'''
-class A {
-  A() async {}
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.INVALID_MODIFIER_ON_CONSTRUCTOR]);
-    verify([source]);
-  }
-
-  test_invalidModifierOnConstructor_asyncStar() async {
-    Source source = addSource(r'''
-class A {
-  A() async* {}
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.INVALID_MODIFIER_ON_CONSTRUCTOR]);
-    verify([source]);
-  }
-
-  test_invalidModifierOnConstructor_syncStar() async {
-    Source source = addSource(r'''
-class A {
-  A() sync* {}
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.INVALID_MODIFIER_ON_CONSTRUCTOR]);
-    verify([source]);
-  }
-
-  test_invalidModifierOnSetter_member_async() async {
-    Source source = addSource(r'''
-class A {
-  set x(v) async {}
-}''');
-    await computeAnalysisResult(source);
-    // TODO(danrubel): Investigate why error message is duplicated when
-    // using fasta parser.
-    assertErrors(
-        source,
-        usingFastaParser
-            ? [
-                CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER,
-                CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER
-              ]
-            : [CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER]);
-    verify([source]);
-  }
-
-  test_invalidModifierOnSetter_member_asyncStar() async {
-    Source source = addSource(r'''
-class A {
-  set x(v) async* {}
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source,
-        usingFastaParser
-            ? [
-                CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER,
-                CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER
-              ]
-            : [CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER]);
-    verify([source]);
-  }
-
-  test_invalidModifierOnSetter_member_syncStar() async {
-    Source source = addSource(r'''
-class A {
-  set x(v) sync* {}
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source,
-        usingFastaParser
-            ? [
-                CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER,
-                CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER
-              ]
-            : [CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER]);
-    verify([source]);
-  }
-
-  test_invalidModifierOnSetter_topLevel_async() async {
-    Source source = addSource("set x(v) async {}");
-    await computeAnalysisResult(source);
-    assertErrors(
-        source,
-        usingFastaParser
-            ? [
-                CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER,
-                CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER
-              ]
-            : [CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER]);
-    verify([source]);
-  }
-
-  test_invalidModifierOnSetter_topLevel_asyncStar() async {
-    Source source = addSource("set x(v) async* {}");
-    await computeAnalysisResult(source);
-    assertErrors(
-        source,
-        usingFastaParser
-            ? [
-                CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER,
-                CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER
-              ]
-            : [CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER]);
-    verify([source]);
-  }
-
-  test_invalidModifierOnSetter_topLevel_syncStar() async {
-    Source source = addSource("set x(v) sync* {}");
-    await computeAnalysisResult(source);
-    assertErrors(
-        source,
-        usingFastaParser
-            ? [
-                CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER,
-                CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER
-              ]
-            : [CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER]);
-    verify([source]);
-  }
-
-  test_invalidReferenceToThis_factoryConstructor() async {
-    Source source = addSource(r'''
-class A {
-  factory A() { return this; }
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.INVALID_REFERENCE_TO_THIS]);
-    verify([source]);
-  }
-
-  test_invalidReferenceToThis_instanceVariableInitializer_inConstructor() async {
-    Source source = addSource(r'''
-class A {
-  var f;
-  A() : f = this;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.INVALID_REFERENCE_TO_THIS]);
-    verify([source]);
-  }
-
-  test_invalidReferenceToThis_instanceVariableInitializer_inDeclaration() async {
-    Source source = addSource(r'''
-class A {
-  var f = this;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.INVALID_REFERENCE_TO_THIS]);
-    verify([source]);
-  }
-
-  test_invalidReferenceToThis_staticMethod() async {
-    Source source = addSource(r'''
-class A {
-  static m() { return this; }
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.INVALID_REFERENCE_TO_THIS]);
-    verify([source]);
-  }
-
-  test_invalidReferenceToThis_staticVariableInitializer() async {
-    Source source = addSource(r'''
-class A {
-  static A f = this;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.INVALID_REFERENCE_TO_THIS]);
-    verify([source]);
-  }
-
-  test_invalidReferenceToThis_superInitializer() async {
-    Source source = addSource(r'''
-class A {
-  A(var x) {}
-}
-class B extends A {
-  B() : super(this);
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.INVALID_REFERENCE_TO_THIS]);
-    verify([source]);
-  }
-
-  test_invalidReferenceToThis_topLevelFunction() async {
-    Source source = addSource("f() { return this; }");
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.INVALID_REFERENCE_TO_THIS]);
-    verify([source]);
-  }
-
-  test_invalidReferenceToThis_variableInitializer() async {
-    Source source = addSource("int x = this;");
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.INVALID_REFERENCE_TO_THIS]);
-    verify([source]);
-  }
-
-  test_invalidTypeArgumentInConstList() async {
-    Source source = addSource(r'''
-class A<E> {
-  m() {
-    return const <E>[];
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_IN_CONST_LIST]);
-    verify([source]);
-  }
-
-  test_invalidTypeArgumentInConstMap() async {
-    Source source = addSource(r'''
-class A<E> {
-  m() {
-    return const <String, E>{};
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_IN_CONST_MAP]);
-    verify([source]);
-  }
-
-  test_invalidUri_export() async {
-    Source source = addSource("export 'ht:';");
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.INVALID_URI]);
-  }
-
-  test_invalidUri_import() async {
-    Source source = addSource("import 'ht:';");
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.INVALID_URI]);
-  }
-
-  test_invalidUri_part() async {
-    Source source = addSource(r'''
-library lib;
-part 'ht:';''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.INVALID_URI]);
-  }
-
-  test_isInConstInstanceCreation_restored() async {
-    // If ErrorVerifier._isInConstInstanceCreation is not properly restored on
-    // exit from visitInstanceCreationExpression, the error at (1) will be
-    // treated as a warning rather than an error.
-    Source source = addSource(r'''
-class Foo<T extends num> {
-  const Foo(x, y);
-}
-const x = const Foo<int>(const Foo<int>(0, 1),
-    const <Foo<String>>[]); // (1)
-''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
-    verify([source]);
-  }
-
-  test_isInInstanceVariableInitializer_restored() async {
-    // If ErrorVerifier._isInInstanceVariableInitializer is not properly
-    // restored on exit from visitVariableDeclaration, the error at (1)
-    // won't be detected.
-    Source source = addSource(r'''
-class Foo {
-  var bar;
-  Map foo = {
-    'bar': () {
-        var _bar;
-    },
-    'bop': _foo // (1)
-  };
-  _foo() {
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER]);
-    verify([source]);
-  }
-
-  test_labelInOuterScope() async {
-    Source source = addSource(r'''
-class A {
-  void m(int i) {
-    l: while (i > 0) {
-      void f() {
-        break l;
-      };
-    }
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.LABEL_IN_OUTER_SCOPE]);
-    // We cannot verify resolution with unresolvable labels
-  }
-
-  test_labelUndefined_break() async {
-    Source source = addSource(r'''
-f() {
-  x: while (true) {
-    break y;
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.LABEL_UNDEFINED, HintCode.UNUSED_LABEL]);
-    // We cannot verify resolution with undefined labels
-  }
-
-  test_labelUndefined_continue() async {
-    Source source = addSource(r'''
-f() {
-  x: while (true) {
-    continue y;
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.LABEL_UNDEFINED, HintCode.UNUSED_LABEL]);
-    // We cannot verify resolution with undefined labels
-  }
-
-  test_length_of_erroneous_constant() async {
-    // Attempting to compute the length of constant that couldn't be evaluated
-    // (due to an error) should not crash the analyzer (see dartbug.com/23383)
-    Source source = addSource("const int i = (1 ? 'alpha' : 'beta').length;");
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE,
-      CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL,
-      StaticTypeWarningCode.NON_BOOL_CONDITION
-    ]);
-    verify([source]);
-  }
-
-  test_memberWithClassName_field() async {
-    Source source = addSource(r'''
-class A {
-  int A = 0;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.MEMBER_WITH_CLASS_NAME]);
-    verify([source]);
-  }
-
-  test_memberWithClassName_field2() async {
-    Source source = addSource(r'''
-class A {
-  int z, A, b = 0;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.MEMBER_WITH_CLASS_NAME]);
-    verify([source]);
-  }
-
-  test_memberWithClassName_getter() async {
-    Source source = addSource(r'''
-class A {
-  get A => 0;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.MEMBER_WITH_CLASS_NAME]);
-    verify([source]);
-  }
-
-  test_memberWithClassName_method() async {
-    // no test because indistinguishable from constructor
-  }
-
-  test_mixinClassDeclaresConstructor_classDeclaration() async {
-    Source source = addSource(r'''
-class A {
-  A() {}
-}
-class B extends Object with A {}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-      source,
-      [CompileTimeErrorCode.MIXIN_CLASS_DECLARES_CONSTRUCTOR],
-    );
-    verify([source]);
-  }
-
-  test_mixinClassDeclaresConstructor_typeAlias() async {
-    Source source = addSource(r'''
-class A {
-  A() {}
-}
-class B = Object with A;''');
-    await computeAnalysisResult(source);
-    assertErrors(
-      source,
-      [CompileTimeErrorCode.MIXIN_CLASS_DECLARES_CONSTRUCTOR],
-    );
-    verify([source]);
-  }
-
-  test_mixinDeferredClass() async {
-    await resolveWithErrors(<String>[
-      r'''
-library lib1;
-class A {}''',
-      r'''
-library root;
-import 'lib1.dart' deferred as a;
-class B extends Object with a.A {}'''
-    ], <ErrorCode>[
-      CompileTimeErrorCode.MIXIN_DEFERRED_CLASS
-    ]);
-  }
-
-  test_mixinDeferredClass_classTypeAlias() async {
-    await resolveWithErrors(<String>[
-      r'''
-library lib1;
-class A {}''',
-      r'''
-library root;
-import 'lib1.dart' deferred as a;
-class B {}
-class C = B with a.A;'''
-    ], <ErrorCode>[
-      CompileTimeErrorCode.MIXIN_DEFERRED_CLASS
-    ]);
-  }
-
-  test_mixinInference_matchingClass_inPreviousMixin_new_syntax() async {
-    Source source = addSource('''
-abstract class A<T> {}
-class B {}
-mixin M1 implements A<B> {}
-mixin M2<T> on A<T> {}
-class C extends Object with M1, M2 {}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-  }
-
-  test_mixinInference_matchingClass_new_syntax() async {
-    Source source = addSource('''
-abstract class A<T> {}
-class B {}
-mixin M<T> on A<T> {}
-class C extends A<int> with M {}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-  }
-
-  test_mixinInference_noMatchingClass_namedMixinApplication_new_syntax() async {
-    Source source = addSource('''
-abstract class A<T> {}
-class B {}
-mixin M<T> on A<T> {}
-class C = Object with M;
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source,
-        [CompileTimeErrorCode.MIXIN_APPLICATION_NOT_IMPLEMENTED_INTERFACE]);
-  }
-
-  test_mixinInference_noMatchingClass_new_syntax() async {
-    Source source = addSource('''
-abstract class A<T> {}
-class B {}
-mixin M<T> on A<T> {}
-class C extends Object with M {}
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source,
-        [CompileTimeErrorCode.MIXIN_APPLICATION_NOT_IMPLEMENTED_INTERFACE]);
-  }
-
-  test_mixinInference_noMatchingClass_noSuperclassConstraint_new_syntax() async {
-    Source source = addSource('''
-abstract class A<T> {}
-class B {}
-mixin M<T> {}
-class C extends Object with M {}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-  }
-
-  test_mixinInference_noMatchingClass_typeParametersSupplied_new_syntax() async {
-    Source source = addSource('''
-abstract class A<T> {}
-class B {}
-mixin M<T> on A<T> {}
-class C extends Object with M<int> {}
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source,
-        [CompileTimeErrorCode.MIXIN_APPLICATION_NOT_IMPLEMENTED_INTERFACE]);
-  }
-
-  test_mixinInference_recursiveSubtypeCheck_new_syntax() async {
-    // See dartbug.com/32353 for a detailed explanation.
-    Source source = addSource('''
-class ioDirectory implements ioFileSystemEntity {}
-
-class ioFileSystemEntity {}
-
-abstract class _LocalDirectory
-    extends _LocalFileSystemEntity<_LocalDirectory, ioDirectory>
-    with ForwardingDirectory, DirectoryAddOnsMixin {}
-
-abstract class _LocalFileSystemEntity<T extends FileSystemEntity,
-  D extends ioFileSystemEntity> extends ForwardingFileSystemEntity<T, D> {}
-
-abstract class FileSystemEntity implements ioFileSystemEntity {}
-
-abstract class ForwardingFileSystemEntity<T extends FileSystemEntity,
-  D extends ioFileSystemEntity> implements FileSystemEntity {}
-
-
-mixin ForwardingDirectory<T extends Directory>
-    on ForwardingFileSystemEntity<T, ioDirectory>
-    implements Directory {}
-
-abstract class Directory implements FileSystemEntity, ioDirectory {}
-
-mixin DirectoryAddOnsMixin implements Directory {}
-''');
-    var analysisResult = await computeAnalysisResult(source);
-    assertNoErrors(source);
-    var mixins =
-        analysisResult.unit.declaredElement.getType('_LocalDirectory').mixins;
-    expect(mixins[0].toString(), 'ForwardingDirectory<_LocalDirectory>');
-  }
-
-  test_mixinInheritsFromNotObject_classDeclaration_extends() async {
-    Source source = addSource(r'''
-class A {}
-class B extends A {}
-class C extends Object with B {}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT]);
-    verify([source]);
-  }
-
-  test_mixinInheritsFromNotObject_classDeclaration_with() async {
-    Source source = addSource(r'''
-class A {}
-class B extends Object with A {}
-class C extends Object with B {}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT]);
-    verify([source]);
-  }
-
-  test_mixinInheritsFromNotObject_typeAlias_extends() async {
-    Source source = addSource(r'''
-class A {}
-class B extends A {}
-class C = Object with B;''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT]);
-    verify([source]);
-  }
-
-  test_mixinInheritsFromNotObject_typeAlias_with() async {
-    Source source = addSource(r'''
-class A {}
-class B extends Object with A {}
-class C = Object with B;''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT]);
-    verify([source]);
-  }
-
-  test_mixinOfDisallowedClass_class_bool() async {
-    Source source = addSource("class A extends Object with bool {}");
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS]);
-    verify([source]);
-  }
-
-  test_mixinOfDisallowedClass_class_double() async {
-    Source source = addSource("class A extends Object with double {}");
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS]);
-    verify([source]);
-  }
-
-  test_mixinOfDisallowedClass_class_int() async {
-    Source source = addSource("class A extends Object with int {}");
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS]);
-    verify([source]);
-  }
-
-  test_mixinOfDisallowedClass_class_Null() async {
-    Source source = addSource("class A extends Object with Null {}");
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS]);
-    verify([source]);
-  }
-
-  test_mixinOfDisallowedClass_class_num() async {
-    Source source = addSource("class A extends Object with num {}");
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS]);
-    verify([source]);
-  }
-
-  test_mixinOfDisallowedClass_class_String() async {
-    Source source = addSource("class A extends Object with String {}");
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS]);
-    verify([source]);
-  }
-
-  test_mixinOfDisallowedClass_classTypeAlias_bool() async {
-    Source source = addSource(r'''
-class A {}
-class C = A with bool;''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS]);
-    verify([source]);
-  }
-
-  test_mixinOfDisallowedClass_classTypeAlias_double() async {
-    Source source = addSource(r'''
-class A {}
-class C = A with double;''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS]);
-    verify([source]);
-  }
-
-  test_mixinOfDisallowedClass_classTypeAlias_int() async {
-    Source source = addSource(r'''
-class A {}
-class C = A with int;''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS]);
-    verify([source]);
-  }
-
-  test_mixinOfDisallowedClass_classTypeAlias_Null() async {
-    Source source = addSource(r'''
-class A {}
-class C = A with Null;''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS]);
-    verify([source]);
-  }
-
-  test_mixinOfDisallowedClass_classTypeAlias_num() async {
-    Source source = addSource(r'''
-class A {}
-class C = A with num;''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS]);
-    verify([source]);
-  }
-
-  test_mixinOfDisallowedClass_classTypeAlias_String() async {
-    Source source = addSource(r'''
-class A {}
-class C = A with String;''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS]);
-    verify([source]);
-  }
-
-  test_mixinOfDisallowedClass_classTypeAlias_String_num() async {
-    Source source = addSource(r'''
-class A {}
-class C = A with String, num;''');
-    await computeAnalysisResult(source);
-    if (enableNewAnalysisDriver) {
-      assertErrors(source, [
-        CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS,
-        CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS
-      ]);
-    } else {
-      assertErrors(source, [
-        CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS,
-        CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS
-      ]);
-    }
-    verify([source]);
-  }
-
-  test_mixinOfNonClass() async {
-    // TODO(brianwilkerson) Compare with MIXIN_WITH_NON_CLASS_SUPERCLASS.
-    Source source = addSource(r'''
-var A;
-class B extends Object mixin A {}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.MIXIN_OF_NON_CLASS]);
-    verify([source]);
-  }
-
-  test_mixinOfNonClass_class() async {
-    Source source = addSource(r'''
-int A;
-class B extends Object with A {}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.MIXIN_OF_NON_CLASS]);
-    verify([source]);
-  }
-
-  test_mixinOfNonClass_enum() async {
-    Source source = addSource(r'''
-enum E { ONE }
-class A extends Object with E {}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.MIXIN_OF_NON_CLASS]);
-    verify([source]);
-  }
-
-  test_mixinOfNonClass_typeAlias() async {
-    Source source = addSource(r'''
-class A {}
-int B;
-class C = A with B;''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.MIXIN_OF_NON_CLASS]);
-    verify([source]);
-  }
-
-  test_mixinReferencesSuper() async {
-    Source source = addSource(r'''
-class A {
-  toString() => super.toString();
-}
-class B extends Object with A {}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.MIXIN_REFERENCES_SUPER]);
-    verify([source]);
-  }
-
-  test_mixinWithNonClassSuperclass_class() async {
-    Source source = addSource(r'''
-int A;
-class B {}
-class C extends A with B {}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.MIXIN_WITH_NON_CLASS_SUPERCLASS]);
-    verify([source]);
-  }
-
-  test_mixinWithNonClassSuperclass_typeAlias() async {
-    Source source = addSource(r'''
-int A;
-class B {}
-class C = A with B;''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.MIXIN_WITH_NON_CLASS_SUPERCLASS]);
-    verify([source]);
-  }
-
-  test_multipleRedirectingConstructorInvocations() async {
-    Source source = addSource(r'''
-class A {
-  A() : this.a(), this.b();
-  A.a() {}
-  A.b() {}
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source,
-        [CompileTimeErrorCode.MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS]);
-    verify([source]);
-  }
-
-  test_multipleSuperInitializers() async {
-    Source source = addSource(r'''
-class A {}
-class B extends A {
-  B() : super(), super() {}
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CompileTimeErrorCode.MULTIPLE_SUPER_INITIALIZERS,
-      StrongModeCode.INVALID_SUPER_INVOCATION
-    ]);
-    verify([source]);
-  }
-
-  test_nativeClauseInNonSDKCode() async {
-    // TODO(jwren) Move this test somewhere else: This test verifies a parser
-    // error code is generated through the ErrorVerifier, it is not a
-    // CompileTimeErrorCode.
-    Source source = addSource("class A native 'string' {}");
-    await computeAnalysisResult(source);
-    assertErrors(source, [ParserErrorCode.NATIVE_CLAUSE_IN_NON_SDK_CODE]);
-    verify([source]);
-  }
-
-  test_nativeFunctionBodyInNonSDKCode_function() async {
-    // TODO(jwren) Move this test somewhere else: This test verifies a parser
-    // error code is generated through the ErrorVerifier, it is not a
-    // CompileTimeErrorCode.
-    Source source = addSource("int m(a) native 'string';");
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [ParserErrorCode.NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE]);
-    verify([source]);
-  }
-
-  test_nativeFunctionBodyInNonSDKCode_method() async {
-    // TODO(jwren) Move this test somewhere else: This test verifies a parser
-    // error code is generated through the ErrorVerifier, it is not a
-    // CompileTimeErrorCode.
-    Source source = addSource(r'''
-class A{
-  static int m(a) native 'string';
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [ParserErrorCode.NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE]);
-    verify([source]);
-  }
-
-  test_noAnnotationConstructorArguments() async {
-    Source source = addSource(r'''
-class A {
-  const A();
-}
-@A
-main() {
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS]);
-    verify([source]);
-  }
-
-  test_noDefaultSuperConstructorExplicit() async {
-    Source source = addSource(r'''
-class A {
-  A(p);
-}
-class B extends A {
-  B() {}
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT]);
-    verify([source]);
-  }
-
-  test_noDefaultSuperConstructorImplicit_superHasParameters() async {
-    Source source = addSource(r'''
-class A {
-  A(p);
-}
-class B extends A {
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT]);
-    verify([source]);
-  }
-
-  test_noDefaultSuperConstructorImplicit_superOnlyNamed() async {
-    Source source = addSource(r'''
-class A { A.named() {} }
-class B extends A {}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT]);
-    verify([source]);
-  }
-
-  test_nonConstantAnnotationConstructor_named() async {
-    Source source = addSource(r'''
-class A {
-  A.fromInt() {}
-}
-@A.fromInt()
-main() {
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.NON_CONSTANT_ANNOTATION_CONSTRUCTOR]);
-    verify([source]);
-  }
-
-  test_nonConstantAnnotationConstructor_unnamed() async {
-    Source source = addSource(r'''
-class A {
-  A() {}
-}
-@A()
-main() {
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.NON_CONSTANT_ANNOTATION_CONSTRUCTOR]);
-    verify([source]);
-  }
-
-  test_nonConstantDefaultValue_function_named() async {
-    Source source = addSource(r'''
-int y;
-f({x : y}) {}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE]);
-    verify([source]);
-  }
-
-  test_nonConstantDefaultValue_function_positional() async {
-    Source source = addSource(r'''
-int y;
-f([x = y]) {}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE]);
-    verify([source]);
-  }
-
-  test_nonConstantDefaultValue_inConstructor_named() async {
-    Source source = addSource(r'''
-class A {
-  int y;
-  A({x : y}) {}
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE]);
-    verify([source]);
-  }
-
-  test_nonConstantDefaultValue_inConstructor_positional() async {
-    Source source = addSource(r'''
-class A {
-  int y;
-  A([x = y]) {}
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE]);
-    verify([source]);
-  }
-
-  test_nonConstantDefaultValue_method_named() async {
-    Source source = addSource(r'''
-class A {
-  int y;
-  m({x : y}) {}
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE]);
-    verify([source]);
-  }
-
-  test_nonConstantDefaultValue_method_positional() async {
-    Source source = addSource(r'''
-class A {
-  int y;
-  m([x = y]) {}
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE]);
-    verify([source]);
-  }
-
-  test_nonConstantDefaultValueFromDeferredLibrary() async {
-    await resolveWithErrors(<String>[
-      r'''
-library lib1;
-const V = 1;''',
-      r'''
-library root;
-import 'lib1.dart' deferred as a;
-f({x : a.V}) {}'''
-    ], <ErrorCode>[
-      CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED_LIBRARY
-    ]);
-  }
-
-  test_nonConstantDefaultValueFromDeferredLibrary_nested() async {
-    await resolveWithErrors(<String>[
-      r'''
-library lib1;
-const V = 1;''',
-      r'''
-library root;
-import 'lib1.dart' deferred as a;
-f({x : a.V + 1}) {}'''
-    ], <ErrorCode>[
-      CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED_LIBRARY
-    ]);
-  }
-
-  test_nonConstCaseExpression() async {
-    Source source = addSource(r'''
-f(int p, int q) {
-  switch (p) {
-    case 3 + q:
-      break;
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.NON_CONSTANT_CASE_EXPRESSION]);
-    verify([source]);
-  }
-
-  test_nonConstCaseExpressionFromDeferredLibrary() async {
-    await resolveWithErrors(<String>[
-      r'''
-library lib1;
-const int c = 1;''',
-      r'''
-library root;
-import 'lib1.dart' deferred as a;
-main (int p) {
-  switch (p) {
-    case a.c:
-      break;
-  }
-}'''
-    ], [
-      CompileTimeErrorCode.NON_CONSTANT_CASE_EXPRESSION_FROM_DEFERRED_LIBRARY
-    ]);
-  }
-
-  test_nonConstCaseExpressionFromDeferredLibrary_nested() async {
-    await resolveWithErrors(<String>[
-      r'''
-library lib1;
-const int c = 1;''',
-      r'''
-library root;
-import 'lib1.dart' deferred as a;
-main (int p) {
-  switch (p) {
-    case a.c + 1:
-      break;
-  }
-}'''
-    ], [
-      CompileTimeErrorCode.NON_CONSTANT_CASE_EXPRESSION_FROM_DEFERRED_LIBRARY
-    ]);
-  }
-
-  test_nonConstListElement() async {
-    Source source = addSource(r'''
-f(a) {
-  return const [a];
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.NON_CONSTANT_LIST_ELEMENT]);
-    verify([source]);
-  }
-
-  test_nonConstListElementFromDeferredLibrary() async {
-    await resolveWithErrors(<String>[
-      r'''
-library lib1;
-const int c = 1;''',
-      r'''
-library root;
-import 'lib1.dart' deferred as a;
-f() {
-  return const [a.c];
-}'''
-    ], [
-      CompileTimeErrorCode.NON_CONSTANT_LIST_ELEMENT_FROM_DEFERRED_LIBRARY
-    ]);
-  }
-
-  test_nonConstListElementFromDeferredLibrary_nested() async {
-    await resolveWithErrors(<String>[
-      r'''
-library lib1;
-const int c = 1;''',
-      r'''
-library root;
-import 'lib1.dart' deferred as a;
-f() {
-  return const [a.c + 1];
-}'''
-    ], [
-      CompileTimeErrorCode.NON_CONSTANT_LIST_ELEMENT_FROM_DEFERRED_LIBRARY
-    ]);
-  }
-
-  test_nonConstMapAsExpressionStatement_begin() async {
-    Source source = addSource(r'''
-f() {
-  {'a' : 0, 'b' : 1}.length;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source,
-        usingFastaParser
-            ? [
-                // TODO(danrubel): Consider improving recovery
-                ParserErrorCode.EXPECTED_TOKEN,
-                ParserErrorCode.EXPECTED_TOKEN,
-                ParserErrorCode.EXPECTED_TOKEN,
-                ParserErrorCode.EXPECTED_TOKEN,
-                ParserErrorCode.EXPECTED_TOKEN,
-                ParserErrorCode.EXPECTED_TOKEN,
-                ParserErrorCode.EXPECTED_TOKEN,
-                ParserErrorCode.MISSING_IDENTIFIER,
-                ParserErrorCode.MISSING_IDENTIFIER,
-                ParserErrorCode.MISSING_IDENTIFIER,
-                ParserErrorCode.MISSING_IDENTIFIER,
-                ParserErrorCode.UNEXPECTED_TOKEN,
-                ParserErrorCode.UNEXPECTED_TOKEN,
-                ParserErrorCode.UNEXPECTED_TOKEN,
-              ]
-            : [CompileTimeErrorCode.NON_CONST_MAP_AS_EXPRESSION_STATEMENT]);
-    verify([source]);
-  }
-
-  test_nonConstMapAsExpressionStatement_only() async {
-    Source source = addSource(r'''
-f() {
-  {'a' : 0, 'b' : 1};
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source,
-        usingFastaParser
-            ? [
-                ParserErrorCode.EXPECTED_TOKEN,
-                ParserErrorCode.EXPECTED_TOKEN,
-                ParserErrorCode.EXPECTED_TOKEN,
-                ParserErrorCode.EXPECTED_TOKEN,
-                ParserErrorCode.EXPECTED_TOKEN,
-                ParserErrorCode.EXPECTED_TOKEN,
-                ParserErrorCode.EXPECTED_TOKEN,
-                ParserErrorCode.MISSING_IDENTIFIER,
-                ParserErrorCode.MISSING_IDENTIFIER,
-                ParserErrorCode.MISSING_IDENTIFIER,
-                ParserErrorCode.UNEXPECTED_TOKEN,
-                ParserErrorCode.UNEXPECTED_TOKEN,
-                ParserErrorCode.UNEXPECTED_TOKEN,
-              ]
-            : [CompileTimeErrorCode.NON_CONST_MAP_AS_EXPRESSION_STATEMENT]);
-    verify([source]);
-  }
-
-  test_nonConstMapKey() async {
-    Source source = addSource(r'''
-f(a) {
-  return const {a : 0};
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.NON_CONSTANT_MAP_KEY]);
-    verify([source]);
-  }
-
-  test_nonConstMapKeyFromDeferredLibrary() async {
-    await resolveWithErrors(<String>[
-      r'''
-library lib1;
-const int c = 1;''',
-      r'''
-library root;
-import 'lib1.dart' deferred as a;
-f() {
-  return const {a.c : 0};
-}'''
-    ], [
-      CompileTimeErrorCode.NON_CONSTANT_MAP_KEY_FROM_DEFERRED_LIBRARY
-    ]);
-  }
-
-  test_nonConstMapKeyFromDeferredLibrary_nested() async {
-    await resolveWithErrors(<String>[
-      r'''
-library lib1;
-const int c = 1;''',
-      r'''
-library root;
-import 'lib1.dart' deferred as a;
-f() {
-  return const {a.c + 1 : 0};
-}'''
-    ], [
-      CompileTimeErrorCode.NON_CONSTANT_MAP_KEY_FROM_DEFERRED_LIBRARY
-    ]);
-  }
-
-  test_nonConstMapValue() async {
-    Source source = addSource(r'''
-f(a) {
-  return const {'a' : a};
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.NON_CONSTANT_MAP_VALUE]);
-    verify([source]);
-  }
-
-  test_nonConstMapValueFromDeferredLibrary() async {
-    await resolveWithErrors(<String>[
-      r'''
-library lib1;
-const int c = 1;''',
-      r'''
-library root;
-import 'lib1.dart' deferred as a;
-f() {
-  return const {'a' : a.c};
-}'''
-    ], [
-      CompileTimeErrorCode.NON_CONSTANT_MAP_VALUE_FROM_DEFERRED_LIBRARY
-    ]);
-  }
-
-  test_nonConstMapValueFromDeferredLibrary_nested() async {
-    await resolveWithErrors(<String>[
-      r'''
-library lib1;
-const int c = 1;''',
-      r'''
-library root;
-import 'lib1.dart' deferred as a;
-f() {
-  return const {'a' : a.c + 1};
-}'''
-    ], [
-      CompileTimeErrorCode.NON_CONSTANT_MAP_VALUE_FROM_DEFERRED_LIBRARY
-    ]);
-  }
-
-  test_nonConstValueInInitializer_assert_condition() async {
-    Source source = addSource(r'''
-class A {
-  const A(int i) : assert(i.isNegative);
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.NON_CONSTANT_VALUE_IN_INITIALIZER]);
-    verify([source]);
-  }
-
-  test_nonConstValueInInitializer_assert_message() async {
-    Source source = addSource(r'''
-class A {
-  const A(int i) : assert(i < 0, 'isNegative = ${i.isNegative}');
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.NON_CONSTANT_VALUE_IN_INITIALIZER]);
-    verify([source]);
-  }
-
-  test_nonConstValueInInitializer_binary_notBool_left() async {
-    Source source = addSource(r'''
-class A {
-  final bool a;
-  const A(String p) : a = p && true;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL,
-      StaticTypeWarningCode.NON_BOOL_OPERAND
-    ]);
-    verify([source]);
-  }
-
-  test_nonConstValueInInitializer_binary_notBool_right() async {
-    Source source = addSource(r'''
-class A {
-  final bool a;
-  const A(String p) : a = true && p;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL,
-      StaticTypeWarningCode.NON_BOOL_OPERAND
-    ]);
-    verify([source]);
-  }
-
-  test_nonConstValueInInitializer_binary_notInt() async {
-    Source source = addSource(r'''
-class A {
-  final int a;
-  const A(String p) : a = 5 & p;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL_INT,
-      StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE
-    ]);
-    verify([source]);
-  }
-
-  test_nonConstValueInInitializer_binary_notNum() async {
-    Source source = addSource(r'''
-class A {
-  final int a;
-  const A(String p) : a = 5 + p;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CompileTimeErrorCode.CONST_EVAL_TYPE_NUM,
-      StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE
-    ]);
-    verify([source]);
-  }
-
-  test_nonConstValueInInitializer_field() async {
-    Source source = addSource(r'''
-class A {
-  static int C;
-  final int a;
-  const A() : a = C;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.NON_CONSTANT_VALUE_IN_INITIALIZER]);
-    verify([source]);
-  }
-
-  test_nonConstValueInInitializer_instanceCreation() async {
-    Source source = addSource(r'''
-class A {
-  A();
-}
-class B {
-  const B() : a = new A();
-  final a;
-}
-var b = const B();''');
-    // TODO(scheglov): the error CONST_EVAL_THROWS_EXCEPTION is redundant and
-    // ought to be suppressed. Or not?
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CompileTimeErrorCode.NON_CONSTANT_VALUE_IN_INITIALIZER,
-      CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION
-    ]);
-    verify([source]);
-  }
-
-  test_nonConstValueInInitializer_instanceCreation_inDifferentFile() async {
-    Source sourceA = addNamedSource('/a.dart', r'''
-import 'b.dart';
-const v = const MyClass();
-''');
-    Source sourceB = addNamedSource('/b.dart', r'''
-class MyClass {
-  const MyClass([p = foo]);
-}
-''');
-    await computeAnalysisResult(sourceA);
-    assertNoErrors(sourceA);
-    await computeAnalysisResult(sourceB);
-    assertErrors(sourceB, [
-      CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE,
-      StaticWarningCode.UNDEFINED_IDENTIFIER
-    ]);
-  }
-
-  test_nonConstValueInInitializer_redirecting() async {
-    Source source = addSource(r'''
-class A {
-  static var C;
-  const A.named(p);
-  const A() : this.named(C);
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.NON_CONSTANT_VALUE_IN_INITIALIZER]);
-    verify([source]);
-  }
-
-  test_nonConstValueInInitializer_super() async {
-    Source source = addSource(r'''
-class A {
-  const A(p);
-}
-class B extends A {
-  static var C;
-  const B() : super(C);
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.NON_CONSTANT_VALUE_IN_INITIALIZER]);
-    verify([source]);
-  }
-
-  test_nonConstValueInInitializerFromDeferredLibrary_field() async {
-    await resolveWithErrors(<String>[
-      r'''
-library lib1;
-const int c = 1;''',
-      r'''
-library root;
-import 'lib1.dart' deferred as a;
-class A {
-  final int x;
-  const A() : x = a.c;
-}'''
-    ], <ErrorCode>[
-      CompileTimeErrorCode
-          .NON_CONSTANT_VALUE_IN_INITIALIZER_FROM_DEFERRED_LIBRARY
-    ]);
-  }
-
-  test_nonConstValueInInitializerFromDeferredLibrary_field_nested() async {
-    await resolveWithErrors(<String>[
-      r'''
-library lib1;
-const int c = 1;''',
-      r'''
-library root;
-import 'lib1.dart' deferred as a;
-class A {
-  final int x;
-  const A() : x = a.c + 1;
-}'''
-    ], <ErrorCode>[
-      CompileTimeErrorCode
-          .NON_CONSTANT_VALUE_IN_INITIALIZER_FROM_DEFERRED_LIBRARY
-    ]);
-  }
-
-  test_nonConstValueInInitializerFromDeferredLibrary_redirecting() async {
-    await resolveWithErrors(<String>[
-      r'''
-library lib1;
-const int c = 1;''',
-      r'''
-library root;
-import 'lib1.dart' deferred as a;
-class A {
-  const A.named(p);
-  const A() : this.named(a.c);
-}'''
-    ], <ErrorCode>[
-      CompileTimeErrorCode
-          .NON_CONSTANT_VALUE_IN_INITIALIZER_FROM_DEFERRED_LIBRARY
-    ]);
-  }
-
-  test_nonConstValueInInitializerFromDeferredLibrary_super() async {
-    await resolveWithErrors(<String>[
-      r'''
-library lib1;
-const int c = 1;''',
-      r'''
-library root;
-import 'lib1.dart' deferred as a;
-class A {
-  const A(p);
-}
-class B extends A {
-  const B() : super(a.c);
-}'''
-    ], <ErrorCode>[
-      CompileTimeErrorCode
-          .NON_CONSTANT_VALUE_IN_INITIALIZER_FROM_DEFERRED_LIBRARY
-    ]);
-  }
-
-  test_nonGenerativeConstructor_explicit() async {
-    Source source = addSource(r'''
-class A {
-  factory A.named() => null;
-}
-class B extends A {
-  B() : super.named();
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.NON_GENERATIVE_CONSTRUCTOR]);
-    verify([source]);
-  }
-
-  test_nonGenerativeConstructor_implicit() async {
-    Source source = addSource(r'''
-class A {
-  factory A() => null;
-}
-class B extends A {
-  B();
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.NON_GENERATIVE_CONSTRUCTOR]);
-    verify([source]);
-  }
-
-  test_nonGenerativeConstructor_implicit2() async {
-    Source source = addSource(r'''
-class A {
-  factory A() => null;
-}
-class B extends A {
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.NON_GENERATIVE_CONSTRUCTOR]);
-    verify([source]);
-  }
-
-  test_notEnoughRequiredArguments_const() async {
-    Source source = addSource(r'''
-class A {
-  const A(int p);
-}
-main() {
-  const A();
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.NOT_ENOUGH_REQUIRED_ARGUMENTS]);
-    verify([source]);
-  }
-
-  test_notEnoughRequiredArguments_const_super() async {
-    Source source = addSource(r'''
-class A {
-  const A(int p);
-}
-class B extends A {
-  const B() : super();
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.NOT_ENOUGH_REQUIRED_ARGUMENTS]);
-    verify([source]);
-  }
-
-  test_objectCannotExtendAnotherClass() async {
-    Source source = addSource(r'''
-''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.OBJECT_CANNOT_EXTEND_ANOTHER_CLASS]);
-    verify([source]);
-  }
-
-  test_optionalParameterInOperator_named() async {
-    Source source = addSource(r'''
-class A {
-  operator +({p}) {}
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.OPTIONAL_PARAMETER_IN_OPERATOR]);
-    verify([source]);
-  }
-
-  test_optionalParameterInOperator_positional() async {
-    Source source = addSource(r'''
-class A {
-  operator +([p]) {}
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.OPTIONAL_PARAMETER_IN_OPERATOR]);
-    verify([source]);
-  }
-
-  test_partOfNonPart() async {
-    Source source = addSource(r'''
-library l1;
-part 'l2.dart';''');
-    addNamedSource("/l2.dart", "library l2;");
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.PART_OF_NON_PART]);
-    verify([source]);
-  }
-
-  test_partOfNonPart_self() async {
-    Source source = addSource(r'''
-library lib;
-part 'test.dart';''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.PART_OF_NON_PART]);
-    verify([source]);
-  }
-
-  test_prefix_assignment_compound_in_method() async {
-    addNamedSource('/lib.dart', 'library lib;');
-    Source source = addSource('''
-import 'lib.dart' as p;
-class C {
-  f() {
-    p += 1;
-  }
-}
-''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT]);
-    verify([source]);
-  }
-
-  test_prefix_assignment_compound_not_in_method() async {
-    addNamedSource('/lib.dart', 'library lib;');
-    Source source = addSource('''
-import 'lib.dart' as p;
-f() {
-  p += 1;
-}
-''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT]);
-    verify([source]);
-  }
-
-  test_prefix_assignment_in_method() async {
-    addNamedSource('/lib.dart', 'library lib;');
-    Source source = addSource('''
-import 'lib.dart' as p;
-class C {
-  f() {
-    p = 1;
-  }
-}
-''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT]);
-    verify([source]);
-  }
-
-  test_prefix_assignment_not_in_method() async {
-    addNamedSource('/lib.dart', 'library lib;');
-    Source source = addSource('''
-import 'lib.dart' as p;
-f() {
-  p = 1;
-}
-''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT]);
-    verify([source]);
-  }
-
-  test_prefix_conditionalPropertyAccess_call_loadLibrary() async {
-    addNamedSource('/lib.dart', '''
-library lib;
-''');
-    Source source = addSource('''
-import 'lib.dart' deferred as p;
-f() {
-  p?.loadLibrary();
-}
-''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT]);
-    verify([source]);
-  }
-
-  test_prefix_conditionalPropertyAccess_get() async {
-    addNamedSource('/lib.dart', '''
-library lib;
-var x;
-''');
-    Source source = addSource('''
-import 'lib.dart' as p;
-f() {
-  return p?.x;
-}
-''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT]);
-    verify([source]);
-  }
-
-  test_prefix_conditionalPropertyAccess_get_loadLibrary() async {
-    addNamedSource('/lib.dart', '''
-library lib;
-''');
-    Source source = addSource('''
-import 'lib.dart' deferred as p;
-f() {
-  return p?.loadLibrary;
-}
-''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT]);
-    verify([source]);
-  }
-
-  test_prefix_conditionalPropertyAccess_set() async {
-    addNamedSource('/lib.dart', '''
-library lib;
-var x;
-''');
-    Source source = addSource('''
-import 'lib.dart' as p;
-f() {
-  p?.x = null;
-}
-''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT]);
-    verify([source]);
-  }
-
-  test_prefix_conditionalPropertyAccess_set_loadLibrary() async {
-    addNamedSource('/lib.dart', '''
-library lib;
-''');
-    Source source = addSource('''
-import 'lib.dart' deferred as p;
-f() {
-  p?.loadLibrary = null;
-}
-''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT]);
-    verify([source]);
-  }
-
-  test_prefixCollidesWithTopLevelMembers_functionTypeAlias() async {
-    addNamedSource("/lib.dart", r'''
-library lib;
-class A{}''');
-    Source source = addSource(r'''
-import 'lib.dart' as p;
-typedef p();
-p.A a;''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER]);
-    verify([source]);
-  }
-
-  test_prefixCollidesWithTopLevelMembers_topLevelFunction() async {
-    addNamedSource("/lib.dart", r'''
-library lib;
-class A{}''');
-    Source source = addSource(r'''
-import 'lib.dart' as p;
-p() {}
-p.A a;''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER]);
-    verify([source]);
-  }
-
-  test_prefixCollidesWithTopLevelMembers_topLevelVariable() async {
-    addNamedSource("/lib.dart", r'''
-library lib;
-class A{}''');
-    Source source = addSource(r'''
-import 'lib.dart' as p;
-var p = null;
-p.A a;''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER]);
-    verify([source]);
-  }
-
-  test_prefixCollidesWithTopLevelMembers_type() async {
-    addNamedSource("/lib.dart", r'''
-library lib;
-class A{}''');
-    Source source = addSource(r'''
-import 'lib.dart' as p;
-class p {}
-p.A a;''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER]);
-    verify([source]);
-  }
-
-  test_prefixNotFollowedByDot() async {
-    addNamedSource('/lib.dart', 'library lib;');
-    Source source = addSource('''
-import 'lib.dart' as p;
-f() {
-  return p;
-}
-''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT]);
-    verify([source]);
-  }
-
-  test_prefixNotFollowedByDot_compoundAssignment() async {
-    addNamedSource('/lib.dart', 'library lib;');
-    Source source = addSource('''
-import 'lib.dart' as p;
-f() {
-  p += 1;
-}
-''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT]);
-    verify([source]);
-  }
-
-  test_prefixNotFollowedByDot_conditionalMethodInvocation() async {
-    addNamedSource('/lib.dart', '''
-library lib;
-g() {}
-''');
-    Source source = addSource('''
-import 'lib.dart' as p;
-f() {
-  p?.g();
-}
-''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT]);
-    verify([source]);
-  }
-
-  test_privateCollisionInClassTypeAlias_mixinAndMixin() {
-    return _privateCollisionInMixinApplicationTest('''
-import 'lib1.dart';
-class C = Object with A, B;
-''');
-  }
-
-  test_privateCollisionInClassTypeAlias_mixinAndMixin_indirect() {
-    return _privateCollisionInMixinApplicationTest('''
-import 'lib1.dart';
-class C = Object with A;
-class D = C with B;
-''');
-  }
-
-  test_privateCollisionInClassTypeAlias_superclassAndMixin() {
-    return _privateCollisionInMixinApplicationTest('''
-import 'lib1.dart';
-class C = A with B;
-''');
-  }
-
-  test_privateCollisionInClassTypeAlias_superclassAndMixin_same() {
-    return _privateCollisionInMixinApplicationTest('''
-import 'lib1.dart';
-class C = A with A;
-''');
-  }
-
-  test_privateCollisionInMixinApplication_mixinAndMixin() {
-    return _privateCollisionInMixinApplicationTest('''
-import 'lib1.dart';
-class C extends Object with A, B {}
-''');
-  }
-
-  test_privateCollisionInMixinApplication_mixinAndMixin_indirect() {
-    return _privateCollisionInMixinApplicationTest('''
-import 'lib1.dart';
-class C extends Object with A {}
-class D extends C with B {}
-''');
-  }
-
-  test_privateCollisionInMixinApplication_superclassAndMixin() {
-    return _privateCollisionInMixinApplicationTest('''
-import 'lib1.dart';
-class C extends A with B {}
-''');
-  }
-
-  test_privateCollisionInMixinApplication_superclassAndMixin_same() {
-    return _privateCollisionInMixinApplicationTest('''
-import 'lib1.dart';
-class C extends A with A {}
-''');
-  }
-
-  test_privateOptionalParameter() async {
-    Source source = addSource("f({var _p}) {}");
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.PRIVATE_OPTIONAL_PARAMETER]);
-    verify([source]);
-  }
-
-  test_privateOptionalParameter_fieldFormal() async {
-    Source source = addSource(r'''
-class A {
-  var _p;
-  A({this._p: 0});
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.PRIVATE_OPTIONAL_PARAMETER]);
-    verify([source]);
-  }
-
-  test_privateOptionalParameter_withDefaultValue() async {
-    Source source = addSource("f({_p : 0}) {}");
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.PRIVATE_OPTIONAL_PARAMETER]);
-    verify([source]);
-  }
-
-  test_recursiveCompileTimeConstant() async {
-    Source source = addSource(r'''
-class A {
-  const A();
-  final m = const A();
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.RECURSIVE_COMPILE_TIME_CONSTANT]);
-    verify([source]);
-  }
-
-  test_recursiveCompileTimeConstant_cycle() async {
-    Source source = addSource(r'''
-const x = y + 1;
-const y = x + 1;''');
-    await computeAnalysisResult(source);
-    if (!enableNewAnalysisDriver) {
-      assertErrors(source, [
-        CompileTimeErrorCode.RECURSIVE_COMPILE_TIME_CONSTANT,
-        CompileTimeErrorCode.RECURSIVE_COMPILE_TIME_CONSTANT,
-      ]);
-    } else {
-      assertErrors(source, [
-        CompileTimeErrorCode.RECURSIVE_COMPILE_TIME_CONSTANT,
-        CompileTimeErrorCode.RECURSIVE_COMPILE_TIME_CONSTANT,
-        StrongModeCode.TOP_LEVEL_CYCLE,
-        StrongModeCode.TOP_LEVEL_CYCLE,
-      ]);
-    }
-    verify([source]);
-  }
-
-  test_recursiveCompileTimeConstant_fromMapLiteral() async {
-    newFile(
-      '/constants.dart',
-      content: r'''
-const int x = y;
-const int y = x;
-''',
-    );
-    Source source = addSource(r'''
-import 'constants.dart';
-final z = {x: 0, y: 1};
-''');
-    await computeAnalysisResult(source);
-    // No errors, because the cycle is not in this source.
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_recursiveCompileTimeConstant_initializer_after_toplevel_var() async {
-    Source source = addSource('''
-const y = const C();
-class C {
-  const C() : x = y;
-  final x;
-}
-''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.RECURSIVE_COMPILE_TIME_CONSTANT]);
-    verify([source]);
-  }
-
-  test_recursiveCompileTimeConstant_singleVariable() async {
-    Source source = addSource(r'''
-const x = x;
-''');
-    await computeAnalysisResult(source);
-    if (!enableNewAnalysisDriver) {
-      assertErrors(source, [
-        CompileTimeErrorCode.RECURSIVE_COMPILE_TIME_CONSTANT,
-      ]);
-    } else {
-      assertErrors(source, [
-        CompileTimeErrorCode.RECURSIVE_COMPILE_TIME_CONSTANT,
-        StrongModeCode.TOP_LEVEL_CYCLE
-      ]);
-    }
-    verify([source]);
-  }
-
-  test_recursiveCompileTimeConstant_singleVariable_fromConstList() async {
-    Source source = addSource(r'''
-const elems = const [
-  const [
-    1, elems, 3,
-  ],
-];
-''');
-    await computeAnalysisResult(source);
-    if (!enableNewAnalysisDriver) {
-      assertErrors(source, [
-        CompileTimeErrorCode.RECURSIVE_COMPILE_TIME_CONSTANT,
-      ]);
-    } else {
-      assertErrors(source, [
-        CompileTimeErrorCode.RECURSIVE_COMPILE_TIME_CONSTANT,
-        StrongModeCode.TOP_LEVEL_CYCLE,
-      ]);
-    }
-    verify([source]);
-  }
-
-  test_recursiveConstructorRedirect() async {
-    Source source = addSource(r'''
-class A {
-  A.a() : this.b();
-  A.b() : this.a();
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CompileTimeErrorCode.RECURSIVE_CONSTRUCTOR_REDIRECT,
-      CompileTimeErrorCode.RECURSIVE_CONSTRUCTOR_REDIRECT
-    ]);
-    verify([source]);
-  }
-
-  test_recursiveConstructorRedirect_directSelfReference() async {
-    Source source = addSource(r'''
-class A {
-  A() : this();
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.RECURSIVE_CONSTRUCTOR_REDIRECT]);
-    verify([source]);
-  }
-
-  test_recursiveFactoryRedirect() async {
-    Source source = addSource(r'''
-class A implements B {
-  factory A() = C;
-}
-class B implements C {
-  factory B() = A;
-}
-class C implements A {
-  factory C() = B;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
-      CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
-      CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
-      CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
-      CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
-      CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE
-    ]);
-    verify([source]);
-  }
-
-  test_recursiveFactoryRedirect_directSelfReference() async {
-    Source source = addSource(r'''
-class A {
-  factory A() = A;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT]);
-    verify([source]);
-  }
-
-  test_recursiveFactoryRedirect_diverging() async {
-    // Analysis should terminate even though the redirections don't reach a
-    // fixed point.  (C<int> redirects to C<C<int>>, then to C<C<C<int>>>, and
-    // so on).
-    Source source = addSource('''
-class C<T> {
-  const factory C() = C<C<T>>;
-}
-main() {
-  const C<int>();
-}
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT]);
-    verify([source]);
-  }
-
-  test_recursiveFactoryRedirect_generic() async {
-    Source source = addSource(r'''
-class A<T> implements B<T> {
-  factory A() = C;
-}
-class B<T> implements C<T> {
-  factory B() = A;
-}
-class C<T> implements A<T> {
-  factory C() = B;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
-      CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
-      CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
-      CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
-      CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
-      CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE
-    ]);
-    verify([source]);
-  }
-
-  test_recursiveFactoryRedirect_named() async {
-    Source source = addSource(r'''
-class A implements B {
-  factory A.nameA() = C.nameC;
-}
-class B implements C {
-  factory B.nameB() = A.nameA;
-}
-class C implements A {
-  factory C.nameC() = B.nameB;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
-      CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
-      CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
-      CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
-      CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
-      CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE
-    ]);
-    verify([source]);
-  }
-
-  /**
-   * "A" references "C" which has cycle with "B". But we should not report problem for "A" - it is
-   * not the part of a cycle.
-   */
-  test_recursiveFactoryRedirect_outsideCycle() async {
-    Source source = addSource(r'''
-class A {
-  factory A() = C;
-}
-class B implements C {
-  factory B() = C;
-}
-class C implements A, B {
-  factory C() = B;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
-      CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
-      CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
-      CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE
-    ]);
-    verify([source]);
-  }
-
-  test_redirectGenerativeToMissingConstructor() async {
-    Source source = addSource(r'''
-class A {
-  A() : this.noSuchConstructor();
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source,
-        [CompileTimeErrorCode.REDIRECT_GENERATIVE_TO_MISSING_CONSTRUCTOR]);
-  }
-
-  test_redirectGenerativeToNonGenerativeConstructor() async {
-    Source source = addSource(r'''
-class A {
-  A() : this.x();
-  factory A.x() => null;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CompileTimeErrorCode.REDIRECT_GENERATIVE_TO_NON_GENERATIVE_CONSTRUCTOR
-    ]);
-    verify([source]);
-  }
-
-  test_redirectToMissingConstructor_named() async {
-    Source source = addSource(r'''
-class A implements B{
-  A() {}
-}
-class B {
-  const factory B() = A.name;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.REDIRECT_TO_MISSING_CONSTRUCTOR]);
-  }
-
-  test_redirectToMissingConstructor_unnamed() async {
-    Source source = addSource(r'''
-class A implements B{
-  A.name() {}
-}
-class B {
-  const factory B() = A;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.REDIRECT_TO_MISSING_CONSTRUCTOR]);
-  }
-
-  test_redirectToNonClass_notAType() async {
-    Source source = addSource(r'''
-int A;
-class B {
-  const factory B() = A;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.REDIRECT_TO_NON_CLASS]);
-    verify([source]);
-  }
-
-  test_redirectToNonClass_undefinedIdentifier() async {
-    Source source = addSource(r'''
-class B {
-  const factory B() = A;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.REDIRECT_TO_NON_CLASS]);
-    verify([source]);
-  }
-
-  test_redirectToNonConstConstructor() async {
-    Source source = addSource(r'''
-class A {
-  A.a() {}
-  const factory A.b() = A.a;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.REDIRECT_TO_NON_CONST_CONSTRUCTOR]);
-    verify([source]);
-  }
-
-  test_referencedBeforeDeclaration_hideInBlock_comment() async {
-    Source source = addSource(r'''
-main() {
-  /// [v] is a variable.
-  var v = 2;
-}
-print(x) {}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-  }
-
-  test_referencedBeforeDeclaration_hideInBlock_function() async {
-    Source source = addSource(r'''
-var v = 1;
-main() {
-  print(v);
-  v() {}
-}
-print(x) {}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.REFERENCED_BEFORE_DECLARATION]);
-  }
-
-  test_referencedBeforeDeclaration_hideInBlock_local() async {
-    Source source = addSource(r'''
-var v = 1;
-main() {
-  print(v);
-  var v = 2;
-}
-print(x) {}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.REFERENCED_BEFORE_DECLARATION]);
-  }
-
-  test_referencedBeforeDeclaration_hideInBlock_subBlock() async {
-    Source source = addSource(r'''
-var v = 1;
-main() {
-  {
-    print(v);
-  }
-  var v = 2;
-}
-print(x) {}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.REFERENCED_BEFORE_DECLARATION]);
-  }
-
-  test_referencedBeforeDeclaration_inInitializer_closure() async {
-    Source source = addSource(r'''
-main() {
-  var v = () => v;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.REFERENCED_BEFORE_DECLARATION]);
-  }
-
-  test_referencedBeforeDeclaration_inInitializer_directly() async {
-    Source source = addSource(r'''
-main() {
-  var v = v;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.REFERENCED_BEFORE_DECLARATION]);
-  }
-
-  test_referencedBeforeDeclaration_type_localFunction() async {
-    Source source = addSource(r'''
-void testTypeRef() {
-  String s = '';
-  int String(int x) => x + 1;
-}
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.REFERENCED_BEFORE_DECLARATION]);
-  }
-
-  test_referencedBeforeDeclaration_type_localVariable() async {
-    Source source = addSource(r'''
-void testTypeRef() {
-  String s = '';
-  var String = '';
-}
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.REFERENCED_BEFORE_DECLARATION]);
-  }
-
-  test_rethrowOutsideCatch() async {
-    Source source = addSource(r'''
-f() {
-  rethrow;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.RETHROW_OUTSIDE_CATCH]);
-    verify([source]);
-  }
-
-  test_returnInGenerativeConstructor() async {
-    Source source = addSource(r'''
-class A {
-  A() { return 0; }
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.RETURN_IN_GENERATIVE_CONSTRUCTOR]);
-    verify([source]);
-  }
-
-  test_returnInGenerativeConstructor_expressionFunctionBody() async {
-    Source source = addSource(r'''
-class A {
-  A() => null;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.RETURN_IN_GENERATIVE_CONSTRUCTOR]);
-    verify([source]);
-  }
-
-  test_returnInGenerator_asyncStar() async {
-    Source source = addSource(r'''
-f() async* {
-  return 0;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source,
-        usingFastaParser
-            ? [
-                CompileTimeErrorCode.RETURN_IN_GENERATOR,
-                CompileTimeErrorCode.RETURN_IN_GENERATOR
-              ]
-            : [CompileTimeErrorCode.RETURN_IN_GENERATOR]);
-    verify([source]);
-  }
-
-  test_returnInGenerator_syncStar() async {
-    Source source = addSource(r'''
-f() sync* {
-  return 0;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source,
-        usingFastaParser
-            ? [
-                CompileTimeErrorCode.RETURN_IN_GENERATOR,
-                CompileTimeErrorCode.RETURN_IN_GENERATOR
-              ]
-            : [CompileTimeErrorCode.RETURN_IN_GENERATOR]);
-    verify([source]);
-  }
-
-  test_sharedDeferredPrefix() async {
-    await resolveWithErrors(<String>[
-      r'''
-library lib1;
-f1() {}''',
-      r'''
-library lib2;
-f2() {}''',
-      r'''
-library root;
-import 'lib1.dart' deferred as lib;
-import 'lib2.dart' as lib;
-main() { lib.f1(); lib.f2(); }'''
-    ], <ErrorCode>[
-      CompileTimeErrorCode.SHARED_DEFERRED_PREFIX
-    ]);
-  }
-
-  test_superInInvalidContext_binaryExpression() async {
-    Source source = addSource("var v = super + 0;");
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.SUPER_IN_INVALID_CONTEXT]);
-    // no verify(), 'super.v' is not resolved
-  }
-
-  test_superInInvalidContext_constructorFieldInitializer() async {
-    Source source = addSource(r'''
-class A {
-  m() {}
-}
-class B extends A {
-  var f;
-  B() : f = super.m();
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.SUPER_IN_INVALID_CONTEXT]);
-    // no verify(), 'super.m' is not resolved
-  }
-
-  test_superInInvalidContext_factoryConstructor() async {
-    Source source = addSource(r'''
-class A {
-  m() {}
-}
-class B extends A {
-  factory B() {
-    super.m();
-    return null;
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.SUPER_IN_INVALID_CONTEXT]);
-    // no verify(), 'super.m' is not resolved
-  }
-
-  test_superInInvalidContext_instanceVariableInitializer() async {
-    Source source = addSource(r'''
-class A {
-  var a;
-}
-class B extends A {
- var b = super.a;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.SUPER_IN_INVALID_CONTEXT]);
-    // no verify(), 'super.a' is not resolved
-  }
-
-  test_superInInvalidContext_staticMethod() async {
-    Source source = addSource(r'''
-class A {
-  static m() {}
-}
-class B extends A {
-  static n() { return super.m(); }
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.SUPER_IN_INVALID_CONTEXT]);
-    // no verify(), 'super.m' is not resolved
-  }
-
-  test_superInInvalidContext_staticVariableInitializer() async {
-    Source source = addSource(r'''
-class A {
-  static int a = 0;
-}
-class B extends A {
-  static int b = super.a;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.SUPER_IN_INVALID_CONTEXT]);
-    // no verify(), 'super.a' is not resolved
-  }
-
-  test_superInInvalidContext_topLevelFunction() async {
-    Source source = addSource(r'''
-f() {
-  super.f();
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.SUPER_IN_INVALID_CONTEXT]);
-    // no verify(), 'super.f' is not resolved
-  }
-
-  test_superInInvalidContext_topLevelVariableInitializer() async {
-    Source source = addSource("var v = super.y;");
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.SUPER_IN_INVALID_CONTEXT]);
-    // no verify(), 'super.y' is not resolved
-  }
-
-  test_superInitializerInObject() async {
-    Source source = addSource(r'''
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.SUPER_INITIALIZER_IN_OBJECT]);
-    verify([source]);
-  }
-
-  test_superInRedirectingConstructor_redirectionSuper() async {
-    Source source = addSource(r'''
-class A {}
-class B {
-  B() : this.name(), super();
-  B.name() {}
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.SUPER_IN_REDIRECTING_CONSTRUCTOR]);
-    verify([source]);
-  }
-
-  test_superInRedirectingConstructor_superRedirection() async {
-    Source source = addSource(r'''
-class A {}
-class B {
-  B() : super(), this.name();
-  B.name() {}
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CompileTimeErrorCode.SUPER_IN_REDIRECTING_CONSTRUCTOR,
-      StrongModeCode.INVALID_SUPER_INVOCATION
-    ]);
-    verify([source]);
-  }
-
-  test_symbol_constructor_badArgs() async {
-    Source source = addSource(r'''
-var s1 = const Symbol('3');
-var s2 = const Symbol(3);
-var s3 = const Symbol();
-var s4 = const Symbol('x', 'y');
-var s5 = const Symbol('x', foo: 'x');''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION,
-      CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION,
-      StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE,
-      CompileTimeErrorCode.NOT_ENOUGH_REQUIRED_ARGUMENTS,
-      CompileTimeErrorCode.EXTRA_POSITIONAL_ARGUMENTS,
-      CompileTimeErrorCode.UNDEFINED_NAMED_PARAMETER
-    ]);
-    verify([source]);
-  }
-
-  test_test_fieldInitializerOutsideConstructor_topLevelFunction() async {
-    Source source = addSource(r'''
-f(this.x(y)) {}
-''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source,
-        usingFastaParser
-            ? [CompileTimeErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR]
-            : [
-                ParserErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR,
-                CompileTimeErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR
-              ]);
-    verify([source]);
-  }
-
-  test_typeAliasCannotReferenceItself_11987() async {
-    Source source = addSource(r'''
-typedef void F(List<G> l);
-typedef void G(List<F> l);
-main() {
-  F foo(G g) => g;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF,
-      CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF
-    ]);
-    verify([source]);
-  }
-
-  test_typeAliasCannotReferenceItself_19459() async {
-    // A complex example involving multiple classes.  This is legal, since
-    // typedef F references itself only via a class.
-    Source source = addSource(r'''
-class A<B, C> {}
-abstract class D {
-  f(E e);
-}
-abstract class E extends A<dynamic, F> {}
-typedef D F();
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_typeAliasCannotReferenceItself_functionTypedParameter_returnType() async {
-    Source source = addSource("typedef A(A b());");
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF]);
-    verify([source]);
-  }
-
-  test_typeAliasCannotReferenceItself_generic() async {
-    Source source = addSource(r'''
-typedef F = void Function(List<G> l);
-typedef G = void Function(List<F> l);
-main() {
-  F foo(G g) => g;
-}
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF,
-      CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF
-    ]);
-    verify([source]);
-  }
-
-  test_typeAliasCannotReferenceItself_parameterType_named() async {
-    Source source = addSource("typedef A({A a});");
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF]);
-    verify([source]);
-  }
-
-  test_typeAliasCannotReferenceItself_parameterType_positional() async {
-    Source source = addSource("typedef A([A a]);");
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF]);
-    verify([source]);
-  }
-
-  test_typeAliasCannotReferenceItself_parameterType_required() async {
-    Source source = addSource("typedef A(A a);");
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF]);
-    verify([source]);
-  }
-
-  test_typeAliasCannotReferenceItself_parameterType_typeArgument() async {
-    Source source = addSource("typedef A(List<A> a);");
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF]);
-    verify([source]);
-  }
-
-  test_typeAliasCannotReferenceItself_returnClass_withTypeAlias() async {
-    // A typedef is allowed to indirectly reference itself via a class.
-    Source source = addSource(r'''
-typedef C A();
-typedef A B();
-class C {
-  B a;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_typeAliasCannotReferenceItself_returnType() async {
-    Source source = addSource("typedef A A();");
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF]);
-    verify([source]);
-  }
-
-  test_typeAliasCannotReferenceItself_returnType_indirect() async {
-    Source source = addSource(r'''
-typedef B A();
-typedef A B();''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF,
-      CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF
-    ]);
-    verify([source]);
-  }
-
-  test_typeAliasCannotReferenceItself_typeVariableBounds() async {
-    Source source = addSource("typedef A<T extends A<int>>();");
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF,
-      StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS
-    ]);
-    verify([source]);
-  }
-
-  test_typeArgumentNotMatchingBounds_const() async {
-    Source source = addSource(r'''
-class A {}
-class B {}
-class G<E extends A> {
-  const G();
-}
-f() { return const G<B>(); }''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
-    verify([source]);
-  }
-
-  test_typedef_infiniteParameterBoundCycle() async {
-    Source source = addSource(r'''
-typedef F<X extends F> = F Function();
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF,
-      StrongModeCode.NOT_INSTANTIATED_BOUND,
-    ]);
-    verify([source]);
-  }
-
-  test_undefinedAnnotation_unresolved_identifier() async {
-    Source source = addSource(r'''
-@unresolved
-main() {
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.UNDEFINED_ANNOTATION]);
-  }
-
-  test_undefinedAnnotation_unresolved_invocation() async {
-    Source source = addSource(r'''
-@Unresolved()
-main() {
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.UNDEFINED_ANNOTATION]);
-  }
-
-  test_undefinedAnnotation_unresolved_prefixedIdentifier() async {
-    Source source = addSource(r'''
-import 'dart:math' as p;
-@p.unresolved
-main() {
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.UNDEFINED_ANNOTATION]);
-  }
-
-  test_undefinedAnnotation_useLibraryScope() async {
-    Source source = addSource(r'''
-@foo
-class A {
-  static const foo = null;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.UNDEFINED_ANNOTATION]);
-  }
-
-  test_undefinedClass_const() async {
-    Source source = addSource(r'''
-f() {
-  return const A();
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [StaticWarningCode.UNDEFINED_CLASS]);
-    verify([source]);
-  }
-
-  test_undefinedConstructorInInitializer_explicit_named() async {
-    Source source = addSource(r'''
-class A {}
-class B extends A {
-  B() : super.named();
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER]);
-    // no verify(), "super.named()" is not resolved
-  }
-
-  test_undefinedConstructorInInitializer_explicit_unnamed() async {
-    Source source = addSource(r'''
-class A {
-  A.named() {}
-}
-class B extends A {
-  B() : super();
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source,
-        [CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT]);
-    verify([source]);
-  }
-
-  test_undefinedConstructorInInitializer_implicit() async {
-    Source source = addSource(r'''
-class A {
-  A.named() {}
-}
-class B extends A {
-  B();
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source,
-        [CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT]);
-    verify([source]);
-  }
-
-  test_undefinedNamedParameter() async {
-    Source source = addSource(r'''
-class A {
-  const A();
-}
-main() {
-  const A(p: 0);
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.UNDEFINED_NAMED_PARAMETER]);
-    // no verify(), 'p' is not resolved
-  }
-
-  test_uriDoesNotExist_export() async {
-    Source source = addSource("export 'unknown.dart';");
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.URI_DOES_NOT_EXIST]);
-  }
-
-  test_uriDoesNotExist_import() async {
-    Source source = addSource("import 'unknown.dart';");
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.URI_DOES_NOT_EXIST]);
-  }
-
-  test_uriDoesNotExist_import_appears_after_deleting_target() async {
-    Source test = addSource("import 'target.dart';");
-    Source target = addNamedSource("/target.dart", "");
-    await computeAnalysisResult(test);
-    assertErrors(test, [HintCode.UNUSED_IMPORT]);
-
-    // Remove the overlay in the same way as AnalysisServer.
-    deleteFile(target.fullName);
-    if (enableNewAnalysisDriver) {
-      driver.removeFile(target.fullName);
-    } else {
-      analysisContext2.setContents(target, null);
-      ChangeSet changeSet = new ChangeSet()..removedSource(target);
-      analysisContext2.applyChanges(changeSet);
-    }
-
-    await computeAnalysisResult(test);
-    assertErrors(test, [CompileTimeErrorCode.URI_DOES_NOT_EXIST]);
-  }
-
-  test_uriDoesNotExist_import_disappears_when_fixed() async {
-    Source source = addSource("import 'target.dart';");
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.URI_DOES_NOT_EXIST]);
-
-    String targetPath = convertPath('/target.dart');
-    if (enableNewAnalysisDriver) {
-      // Add an overlay in the same way as AnalysisServer.
-      fileContentOverlay[targetPath] = '';
-      driver.changeFile(targetPath);
-    } else {
-      // Check that the file is represented as missing.
-      Source target = analysisContext2.getSourcesWithFullName(targetPath).first;
-      expect(analysisContext2.getModificationStamp(target), -1);
-
-      // Add an overlay in the same way as AnalysisServer.
-      analysisContext2
-        ..setContents(target, "")
-        ..handleContentsChanged(target, null, "", true);
-    }
-
-    // Make sure the error goes away.
-    await computeAnalysisResult(source);
-    assertErrors(source, [HintCode.UNUSED_IMPORT]);
-  }
-
-  test_uriDoesNotExist_part() async {
-    Source source = addSource(r'''
-library lib;
-part 'unknown.dart';''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.URI_DOES_NOT_EXIST]);
-  }
-
-  test_uriWithInterpolation_constant() async {
-    Source source = addSource("import 'stuff_\$platform.dart';");
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CompileTimeErrorCode.URI_WITH_INTERPOLATION,
-      StaticWarningCode.UNDEFINED_IDENTIFIER
-    ]);
-    // We cannot verify resolution with an unresolvable
-    // URI: 'stuff_$platform.dart'
-  }
-
-  test_uriWithInterpolation_nonConstant() async {
-    Source source = addSource(r'''
-library lib;
-part '${'a'}.dart';''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.URI_WITH_INTERPOLATION]);
-    // We cannot verify resolution with an unresolvable URI: '${'a'}.dart'
-  }
-
-  test_wrongNumberOfParametersForOperator1() async {
-    await _check_wrongNumberOfParametersForOperator1("<");
-    await _check_wrongNumberOfParametersForOperator1(">");
-    await _check_wrongNumberOfParametersForOperator1("<=");
-    await _check_wrongNumberOfParametersForOperator1(">=");
-    await _check_wrongNumberOfParametersForOperator1("+");
-    await _check_wrongNumberOfParametersForOperator1("/");
-    await _check_wrongNumberOfParametersForOperator1("~/");
-    await _check_wrongNumberOfParametersForOperator1("*");
-    await _check_wrongNumberOfParametersForOperator1("%");
-    await _check_wrongNumberOfParametersForOperator1("|");
-    await _check_wrongNumberOfParametersForOperator1("^");
-    await _check_wrongNumberOfParametersForOperator1("&");
-    await _check_wrongNumberOfParametersForOperator1("<<");
-    await _check_wrongNumberOfParametersForOperator1(">>");
-    await _check_wrongNumberOfParametersForOperator1("[]");
-  }
-
-  test_wrongNumberOfParametersForOperator_minus() async {
-    Source source = addSource(r'''
-class A {
-  operator -(a, b) {}
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source,
-        [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINUS]);
-    verify([source]);
-  }
-
-  test_wrongNumberOfParametersForOperator_tilde() async {
-    await _check_wrongNumberOfParametersForOperator("~", "a");
-    await _check_wrongNumberOfParametersForOperator("~", "a, b");
-  }
-
-  test_wrongNumberOfParametersForSetter_function_named() async {
-    Source source = addSource("set x({p}) {}");
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER]);
-    verify([source]);
-  }
-
-  test_wrongNumberOfParametersForSetter_function_optional() async {
-    Source source = addSource("set x([p]) {}");
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER]);
-    verify([source]);
-  }
-
-  test_wrongNumberOfParametersForSetter_function_tooFew() async {
-    Source source = addSource("set x() {}");
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER]);
-    verify([source]);
-  }
-
-  test_wrongNumberOfParametersForSetter_function_tooMany() async {
-    Source source = addSource("set x(a, b) {}");
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER]);
-    verify([source]);
-  }
-
-  test_wrongNumberOfParametersForSetter_method_named() async {
-    Source source = addSource(r'''
-class A {
-  set x({p}) {}
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER]);
-    verify([source]);
-  }
-
-  test_wrongNumberOfParametersForSetter_method_optional() async {
-    Source source = addSource(r'''
-class A {
-  set x([p]) {}
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER]);
-    verify([source]);
-  }
-
-  test_wrongNumberOfParametersForSetter_method_tooFew() async {
-    Source source = addSource(r'''
-class A {
-  set x() {}
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER]);
-    verify([source]);
-  }
-
-  test_wrongNumberOfParametersForSetter_method_tooMany() async {
-    Source source = addSource(r'''
-class A {
-  set x(a, b) {}
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER]);
-    verify([source]);
-  }
-
-  test_yield_used_as_identifier_in_async_method() async {
-    Source source = addSource('''
-f() async {
-  var yield = 1;
-}
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER]);
-    verify([source]);
-  }
-
-  test_yield_used_as_identifier_in_async_star_method() async {
-    Source source = addSource('''
-f() async* {
-  var yield = 1;
-}
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER]);
-    verify([source]);
-  }
-
-  test_yield_used_as_identifier_in_sync_star_method() async {
-    Source source = addSource('''
-f() sync* {
-  var yield = 1;
-}
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER]);
-    verify([source]);
-  }
-
-  test_yieldEachInNonGenerator_async() async {
-    // TODO(brianwilkerson) We are currently parsing the yield statement as a
-    // binary expression.
-    Source source = addSource(r'''
-f() async {
-  yield* 0;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.YIELD_EACH_IN_NON_GENERATOR]);
-    verify([source]);
-  }
-
-  test_yieldEachInNonGenerator_sync() async {
-    // TODO(brianwilkerson) We are currently parsing the yield statement as a
-    // binary expression.
-    Source source = addSource(r'''
-f() {
-  yield* 0;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.YIELD_IN_NON_GENERATOR]);
-    verify([source]);
-  }
-
-  test_yieldInNonGenerator_async() async {
-    // TODO(brianwilkerson) We are currently trying to parse the yield statement
-    // as a binary expression.
-    Source source = addSource(r'''
-f() async {
-  yield 0;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.YIELD_IN_NON_GENERATOR]);
-    verify([source]);
-  }
-
-  test_yieldInNonGenerator_sync() async {
-    // TODO(brianwilkerson) We are currently trying to parse the yield statement
-    // as a binary expression.
-    Source source = addSource(r'''
-f() {
-  yield 0;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.YIELD_EACH_IN_NON_GENERATOR]);
-    verify([source]);
-  }
-
-  Future<void> _check_constEvalThrowsException_binary_null(
-      String expr, bool resolved) async {
-    Source source = addSource("const C = $expr;");
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION]);
-    if (resolved) {
-      verify([source]);
-    }
-  }
-
-  Future<void> _check_constEvalTypeBool_withParameter_binary(
-      String expr) async {
-    Source source = addSource('''
-class A {
-  final a;
-  const A(bool p) : a = $expr;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL,
-      StaticTypeWarningCode.NON_BOOL_OPERAND
-    ]);
-    verify([source]);
-  }
-
-  Future<void> _check_constEvalTypeBoolOrInt_withParameter_binary(
-      String expr) async {
-    Source source = addSource('''
-class A {
-  final a;
-  const A(int p) : a = $expr;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL_INT,
-      StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE
-    ]);
-    verify([source]);
-  }
-
-  Future<void> _check_constEvalTypeInt_withParameter_binary(String expr) async {
-    Source source = addSource('''
-class A {
-  final a;
-  const A(int p) : a = $expr;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CompileTimeErrorCode.CONST_EVAL_TYPE_INT,
-      StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE
-    ]);
-    verify([source]);
-  }
-
-  Future<void> _check_constEvalTypeNum_withParameter_binary(String expr) async {
-    Source source = addSource('''
-class A {
-  final a;
-  const A(num p) : a = $expr;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CompileTimeErrorCode.CONST_EVAL_TYPE_NUM,
-      StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE
-    ]);
-    verify([source]);
-  }
-
-  Future<void> _check_wrongNumberOfParametersForOperator(
-      String name, String parameters) async {
-    Source source = addSource('''
-class A {
-  operator $name($parameters) {}
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR]);
-    verify([source]);
-  }
-
-  Future<void> _check_wrongNumberOfParametersForOperator1(String name) async {
-    await _check_wrongNumberOfParametersForOperator(name, "");
-    await _check_wrongNumberOfParametersForOperator(name, "a, b");
-  }
-
-  Future<void> _privateCollisionInMixinApplicationTest(String testCode) async {
-    addNamedSource('/lib1.dart', '''
-class A {
-  int _x;
-}
-
-class B {
-  int _x;
-}
-''');
-    Source source = addSource(testCode);
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.PRIVATE_COLLISION_IN_MIXIN_APPLICATION]);
-    verify([source]);
-  }
-}
diff --git a/pkg/analyzer/test/generated/constant_test.dart b/pkg/analyzer/test/generated/constant_test.dart
index 12c9c85..5d3312f 100644
--- a/pkg/analyzer/test/generated/constant_test.dart
+++ b/pkg/analyzer/test/generated/constant_test.dart
@@ -22,6 +22,8 @@
   });
 }
 
+/// TODO(paulberry): migrate this test away from the task model.
+/// See dartbug.com/35734.
 @reflectiveTest
 class ConstantEvaluatorTest extends ResolverTestCase {
   void fail_identifier_class() {
diff --git a/pkg/analyzer/test/generated/declaration_resolver_test.dart b/pkg/analyzer/test/generated/declaration_resolver_test.dart
index 26dd5a1..cf9bb77 100644
--- a/pkg/analyzer/test/generated/declaration_resolver_test.dart
+++ b/pkg/analyzer/test/generated/declaration_resolver_test.dart
@@ -39,6 +39,8 @@
       root, code, search, (n) => n is SimpleIdentifier);
 }
 
+/// TODO(paulberry): migrate this test away from the task model.
+/// See dartbug.com/35734.
 @reflectiveTest
 class DeclarationResolverMetadataTest extends ResolverTestCase {
   String code;
@@ -363,6 +365,8 @@
   }
 }
 
+/// TODO(paulberry): migrate this test away from the task model.
+/// See dartbug.com/35734.
 @reflectiveTest
 class DeclarationResolverTest extends ResolverTestCase {
   @override
@@ -809,6 +813,8 @@
 
 /**
  * Strong mode DeclarationResolver tests
+ * TODO(paulberry): migrate this test away from the task model.
+ * See dartbug.com/35734.
  */
 @reflectiveTest
 class StrongModeDeclarationResolverTest extends ResolverTestCase {
diff --git a/pkg/analyzer/test/generated/element_resolver_test.dart b/pkg/analyzer/test/generated/element_resolver_test.dart
index 58c0a5c..4987c63 100644
--- a/pkg/analyzer/test/generated/element_resolver_test.dart
+++ b/pkg/analyzer/test/generated/element_resolver_test.dart
@@ -49,6 +49,8 @@
   fail(message);
 }
 
+/// TODO(paulberry): migrate this test away from the task model.
+/// See dartbug.com/35734.
 @reflectiveTest
 class ElementResolverCodeTest extends ResolverTestCase {
   test_annotation_class_namedConstructor() async {
diff --git a/pkg/analyzer/test/generated/error_suppression.dart b/pkg/analyzer/test/generated/error_suppression.dart
new file mode 100644
index 0000000..80027a4
--- /dev/null
+++ b/pkg/analyzer/test/generated/error_suppression.dart
@@ -0,0 +1,229 @@
+// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:analyzer/error/error.dart';
+import 'package:analyzer/src/error/codes.dart';
+import 'package:analyzer/src/generated/source.dart';
+import 'package:analyzer/src/generated/source_io.dart';
+
+import 'resolver_test_case.dart';
+
+abstract class ErrorSuppressionTest extends ResolverTestCase {
+  String get ignoredCode => 'const_initialized_with_non_constant_value';
+
+  List<ErrorCode> get reportedCodes => [
+        CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE,
+      ];
+
+  List<ErrorCode> get reportedCodesWithAssignment => [
+        StaticTypeWarningCode.INVALID_ASSIGNMENT,
+        CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE,
+      ];
+
+  test_error_code_mismatch() async {
+    Source source = addSource('''
+// ignore: $ignoredCode
+int x = '';
+const y = x; //CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, reportedCodesWithAssignment);
+  }
+
+  test_ignore_first() async {
+    Source source = addSource('''
+// ignore: invalid_assignment
+int x = '';
+// ... but no ignore here ...
+const y = x; //CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, reportedCodes);
+  }
+
+  test_ignore_first_trailing() async {
+    Source source = addSource('''
+int x = ''; // ignore: invalid_assignment
+// ... but no ignore here ...
+const y = x; //CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, reportedCodes);
+  }
+
+  test_ignore_for_file() async {
+    Source source = addSource('''
+int x = '';  //INVALID_ASSIGNMENT
+const y = x; //CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE
+// ignore_for_file: invalid_assignment
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, reportedCodes);
+  }
+
+  test_ignore_for_file_whitespace_variant() async {
+    Source source = addSource('''
+//ignore_for_file:   $ignoredCode , invalid_assignment
+int x = '';  //INVALID_ASSIGNMENT
+const y = x; //CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, []);
+  }
+
+  test_ignore_only_trailing() async {
+    Source source = addSource('''
+int x = ''; // ignore: invalid_assignment
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, []);
+  }
+
+  test_ignore_second() async {
+    Source source = addSource('''
+//INVALID_ASSIGNMENT
+int x = '';
+// ignore: $ignoredCode
+const y = x; //CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [StaticTypeWarningCode.INVALID_ASSIGNMENT]);
+  }
+
+  test_ignore_second_trailing() async {
+    Source source = addSource('''
+//INVALID_ASSIGNMENT
+int x = '';
+const y = x; // ignore: $ignoredCode
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [StaticTypeWarningCode.INVALID_ASSIGNMENT]);
+  }
+
+  test_ignore_upper_case() async {
+    Source source = addSource('''
+int x = ''; // ignore: INVALID_ASSIGNMENT
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, []);
+  }
+
+  test_invalid_error_code() async {
+    Source source = addSource('''
+// ignore: right_format_wrong_code
+int x = '';
+const y = x; //CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, reportedCodesWithAssignment);
+  }
+
+  test_missing_error_codes() async {
+    Source source = addSource('''
+    int x = 3;
+// ignore:
+const String y = x; //INVALID_ASSIGNMENT, CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, reportedCodesWithAssignment);
+  }
+
+  test_missing_metadata_suffix() async {
+    Source source = addSource('''
+// ignore invalid_assignment
+String y = 3; //INVALID_ASSIGNMENT
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [StaticTypeWarningCode.INVALID_ASSIGNMENT]);
+  }
+
+  test_multiple_comments() async {
+    Source source = addSource('''
+int x = ''; //This is the first comment...
+// ignore: $ignoredCode
+const y = x; //CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [StaticTypeWarningCode.INVALID_ASSIGNMENT]);
+  }
+
+  test_multiple_ignore_for_files() async {
+    Source source = addSource('''
+int x = '';  //INVALID_ASSIGNMENT
+const y = x; //CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE
+// ignore_for_file: invalid_assignment,$ignoredCode
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, []);
+  }
+
+  test_multiple_ignores() async {
+    Source source = addSource('''
+int x = 3;
+// ignore: invalid_assignment, $ignoredCode
+const String y = x; //INVALID_ASSIGNMENT, CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, []);
+  }
+
+  test_multiple_ignores_trailing() async {
+    Source source = addSource('''
+int x = 3;
+const String y = x; // ignore: invalid_assignment, $ignoredCode
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, []);
+  }
+
+  test_multiple_ignores_whitespace_variant_1() async {
+    Source source = addSource('''
+int x = 3;
+//ignore:invalid_assignment,$ignoredCode
+const String y = x; //INVALID_ASSIGNMENT, CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, []);
+  }
+
+  test_multiple_ignores_whitespace_variant_2() async {
+    Source source = addSource('''
+int x = 3;
+//ignore: invalid_assignment,$ignoredCode
+const String y = x; //INVALID_ASSIGNMENT, CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, []);
+  }
+
+  test_multiple_ignores_whitespace_variant_3() async {
+    Source source = addSource('''
+int x = 3;
+// ignore: invalid_assignment,$ignoredCode
+const String y = x; //INVALID_ASSIGNMENT, CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, []);
+  }
+
+  test_no_ignores() async {
+    Source source = addSource('''
+int x = '';  //INVALID_ASSIGNMENT
+const y = x; //CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, reportedCodesWithAssignment);
+  }
+
+  test_trailing_not_above() async {
+    Source source = addSource('''
+int x = ''; // ignore: invalid_assignment
+int y = '';
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      StaticTypeWarningCode.INVALID_ASSIGNMENT,
+    ]);
+  }
+}
diff --git a/pkg/analyzer/test/generated/error_suppression_driver_test.dart b/pkg/analyzer/test/generated/error_suppression_driver_test.dart
index 9bc552e..77e0f57 100644
--- a/pkg/analyzer/test/generated/error_suppression_driver_test.dart
+++ b/pkg/analyzer/test/generated/error_suppression_driver_test.dart
@@ -4,7 +4,7 @@
 
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import 'error_suppression_test.dart';
+import 'error_suppression.dart';
 
 main() {
   defineReflectiveSuite(() {
diff --git a/pkg/analyzer/test/generated/error_suppression_test.dart b/pkg/analyzer/test/generated/error_suppression_test.dart
deleted file mode 100644
index 0e5d6106..0000000
--- a/pkg/analyzer/test/generated/error_suppression_test.dart
+++ /dev/null
@@ -1,237 +0,0 @@
-// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'package:analyzer/error/error.dart';
-import 'package:analyzer/src/error/codes.dart';
-import 'package:analyzer/src/generated/source.dart';
-import 'package:analyzer/src/generated/source_io.dart';
-import 'package:test_reflective_loader/test_reflective_loader.dart';
-
-import 'resolver_test_case.dart';
-
-main() {
-  defineReflectiveSuite(() {
-    defineReflectiveTests(ErrorSuppressionTest);
-  });
-}
-
-@reflectiveTest
-class ErrorSuppressionTest extends ResolverTestCase {
-  String get ignoredCode => 'const_initialized_with_non_constant_value';
-
-  List<ErrorCode> get reportedCodes => [
-        CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE,
-      ];
-
-  List<ErrorCode> get reportedCodesWithAssignment => [
-        StaticTypeWarningCode.INVALID_ASSIGNMENT,
-        CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE,
-      ];
-
-  test_error_code_mismatch() async {
-    Source source = addSource('''
-// ignore: $ignoredCode
-int x = '';
-const y = x; //CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, reportedCodesWithAssignment);
-  }
-
-  test_ignore_first() async {
-    Source source = addSource('''
-// ignore: invalid_assignment
-int x = '';
-// ... but no ignore here ...
-const y = x; //CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, reportedCodes);
-  }
-
-  test_ignore_first_trailing() async {
-    Source source = addSource('''
-int x = ''; // ignore: invalid_assignment
-// ... but no ignore here ...
-const y = x; //CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, reportedCodes);
-  }
-
-  test_ignore_for_file() async {
-    Source source = addSource('''
-int x = '';  //INVALID_ASSIGNMENT
-const y = x; //CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE
-// ignore_for_file: invalid_assignment
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, reportedCodes);
-  }
-
-  test_ignore_for_file_whitespace_variant() async {
-    Source source = addSource('''
-//ignore_for_file:   $ignoredCode , invalid_assignment
-int x = '';  //INVALID_ASSIGNMENT
-const y = x; //CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, []);
-  }
-
-  test_ignore_only_trailing() async {
-    Source source = addSource('''
-int x = ''; // ignore: invalid_assignment
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, []);
-  }
-
-  test_ignore_second() async {
-    Source source = addSource('''
-//INVALID_ASSIGNMENT
-int x = '';
-// ignore: $ignoredCode
-const y = x; //CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [StaticTypeWarningCode.INVALID_ASSIGNMENT]);
-  }
-
-  test_ignore_second_trailing() async {
-    Source source = addSource('''
-//INVALID_ASSIGNMENT
-int x = '';
-const y = x; // ignore: $ignoredCode
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [StaticTypeWarningCode.INVALID_ASSIGNMENT]);
-  }
-
-  test_ignore_upper_case() async {
-    Source source = addSource('''
-int x = ''; // ignore: INVALID_ASSIGNMENT
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, []);
-  }
-
-  test_invalid_error_code() async {
-    Source source = addSource('''
-// ignore: right_format_wrong_code
-int x = '';
-const y = x; //CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, reportedCodesWithAssignment);
-  }
-
-  test_missing_error_codes() async {
-    Source source = addSource('''
-    int x = 3;
-// ignore:
-const String y = x; //INVALID_ASSIGNMENT, CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, reportedCodesWithAssignment);
-  }
-
-  test_missing_metadata_suffix() async {
-    Source source = addSource('''
-// ignore invalid_assignment
-String y = 3; //INVALID_ASSIGNMENT
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [StaticTypeWarningCode.INVALID_ASSIGNMENT]);
-  }
-
-  test_multiple_comments() async {
-    Source source = addSource('''
-int x = ''; //This is the first comment...
-// ignore: $ignoredCode
-const y = x; //CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [StaticTypeWarningCode.INVALID_ASSIGNMENT]);
-  }
-
-  test_multiple_ignore_for_files() async {
-    Source source = addSource('''
-int x = '';  //INVALID_ASSIGNMENT
-const y = x; //CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE
-// ignore_for_file: invalid_assignment,$ignoredCode
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, []);
-  }
-
-  test_multiple_ignores() async {
-    Source source = addSource('''
-int x = 3;
-// ignore: invalid_assignment, $ignoredCode
-const String y = x; //INVALID_ASSIGNMENT, CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, []);
-  }
-
-  test_multiple_ignores_trailing() async {
-    Source source = addSource('''
-int x = 3;
-const String y = x; // ignore: invalid_assignment, $ignoredCode
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, []);
-  }
-
-  test_multiple_ignores_whitespace_variant_1() async {
-    Source source = addSource('''
-int x = 3;
-//ignore:invalid_assignment,$ignoredCode
-const String y = x; //INVALID_ASSIGNMENT, CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, []);
-  }
-
-  test_multiple_ignores_whitespace_variant_2() async {
-    Source source = addSource('''
-int x = 3;
-//ignore: invalid_assignment,$ignoredCode
-const String y = x; //INVALID_ASSIGNMENT, CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, []);
-  }
-
-  test_multiple_ignores_whitespace_variant_3() async {
-    Source source = addSource('''
-int x = 3;
-// ignore: invalid_assignment,$ignoredCode
-const String y = x; //INVALID_ASSIGNMENT, CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, []);
-  }
-
-  test_no_ignores() async {
-    Source source = addSource('''
-int x = '';  //INVALID_ASSIGNMENT
-const y = x; //CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, reportedCodesWithAssignment);
-  }
-
-  test_trailing_not_above() async {
-    Source source = addSource('''
-int x = ''; // ignore: invalid_assignment
-int y = '';
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      StaticTypeWarningCode.INVALID_ASSIGNMENT,
-    ]);
-  }
-}
diff --git a/pkg/analyzer/test/generated/hint_code_test.dart b/pkg/analyzer/test/generated/hint_code_test.dart
index e33ea7d..7f1d918 100644
--- a/pkg/analyzer/test/generated/hint_code_test.dart
+++ b/pkg/analyzer/test/generated/hint_code_test.dart
@@ -18,7 +18,6 @@
 main() {
   defineReflectiveSuite(() {
     defineReflectiveTests(CrossPackageHintCodeTest);
-    defineReflectiveTests(HintCodeTest);
   });
 }
 
diff --git a/pkg/analyzer/test/generated/invalid_code.dart b/pkg/analyzer/test/generated/invalid_code.dart
new file mode 100644
index 0000000..b7e6944
--- /dev/null
+++ b/pkg/analyzer/test/generated/invalid_code.dart
@@ -0,0 +1,48 @@
+// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:async';
+
+import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/generated/source.dart';
+import 'package:test/test.dart';
+
+import 'resolver_test_case.dart';
+
+/**
+ * Tests for various end-to-end cases when invalid code caused exceptions
+ * in one or another Analyzer subsystem. We are not interested not in specific
+ * errors generated, but we want to make sure that there is at least one,
+ * and analysis finishes without exceptions.
+ */
+abstract class InvalidCodeTest extends ResolverTestCase {
+  @override
+  AnalysisOptions get defaultAnalysisOptions => new AnalysisOptionsImpl();
+
+  /**
+   * This code results in a method with the empty name, and the default
+   * constructor, which also has the empty name. The `Map` in `f` initializer
+   * references the empty name.
+   */
+  test_constructorAndMethodNameCollision() async {
+    await _assertCanBeAnalyzed('''
+class C {
+  var f = { : };
+  @ ();
+}
+''');
+  }
+
+  test_genericFunction_asTypeArgument_ofUnresolvedClass() async {
+    await _assertCanBeAnalyzed(r'''
+C<int Function()> c;
+''');
+  }
+
+  Future<void> _assertCanBeAnalyzed(String text) async {
+    Source source = addSource(text);
+    var analysisResult = await computeAnalysisResult(source);
+    expect(analysisResult.errors, isNotEmpty);
+  }
+}
diff --git a/pkg/analyzer/test/generated/invalid_code_driver_test.dart b/pkg/analyzer/test/generated/invalid_code_driver_test.dart
index cdccd25..b457f67 100644
--- a/pkg/analyzer/test/generated/invalid_code_driver_test.dart
+++ b/pkg/analyzer/test/generated/invalid_code_driver_test.dart
@@ -4,7 +4,7 @@
 
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import 'invalid_code_test.dart';
+import 'invalid_code.dart';
 
 main() {
   defineReflectiveSuite(() {
diff --git a/pkg/analyzer/test/generated/invalid_code_test.dart b/pkg/analyzer/test/generated/invalid_code_test.dart
deleted file mode 100644
index 3d24f99..0000000
--- a/pkg/analyzer/test/generated/invalid_code_test.dart
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'dart:async';
-
-import 'package:analyzer/src/generated/engine.dart';
-import 'package:analyzer/src/generated/source.dart';
-import 'package:test/test.dart';
-import 'package:test_reflective_loader/test_reflective_loader.dart';
-
-import 'resolver_test_case.dart';
-
-main() {
-  defineReflectiveSuite(() {
-    defineReflectiveTests(InvalidCodeTest);
-  });
-}
-
-/**
- * Tests for various end-to-end cases when invalid code caused exceptions
- * in one or another Analyzer subsystem. We are not interested not in specific
- * errors generated, but we want to make sure that there is at least one,
- * and analysis finishes without exceptions.
- */
-@reflectiveTest
-class InvalidCodeTest extends ResolverTestCase {
-  @override
-  AnalysisOptions get defaultAnalysisOptions => new AnalysisOptionsImpl();
-
-  /**
-   * This code results in a method with the empty name, and the default
-   * constructor, which also has the empty name. The `Map` in `f` initializer
-   * references the empty name.
-   */
-  test_constructorAndMethodNameCollision() async {
-    await _assertCanBeAnalyzed('''
-class C {
-  var f = { : };
-  @ ();
-}
-''');
-  }
-
-  test_genericFunction_asTypeArgument_ofUnresolvedClass() async {
-    await _assertCanBeAnalyzed(r'''
-C<int Function()> c;
-''');
-  }
-
-  Future<void> _assertCanBeAnalyzed(String text) async {
-    Source source = addSource(text);
-    var analysisResult = await computeAnalysisResult(source);
-    expect(analysisResult.errors, isNotEmpty);
-  }
-}
diff --git a/pkg/analyzer/test/generated/non_error_resolver.dart b/pkg/analyzer/test/generated/non_error_resolver.dart
new file mode 100644
index 0000000..2cf5077
--- /dev/null
+++ b/pkg/analyzer/test/generated/non_error_resolver.dart
@@ -0,0 +1,6095 @@
+// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:async';
+
+import 'package:analyzer/dart/ast/ast.dart';
+import 'package:analyzer/dart/ast/standard_resolution_map.dart';
+import 'package:analyzer/dart/element/element.dart';
+import 'package:analyzer/error/error.dart';
+import 'package:analyzer/src/error/codes.dart';
+import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/generated/parser.dart' show ParserErrorCode;
+import 'package:analyzer/src/generated/source_io.dart';
+import 'package:test/test.dart';
+
+import 'resolver_test_case.dart';
+
+class NonErrorResolverTestBase extends ResolverTestCase {
+  @override
+  AnalysisOptions get defaultAnalysisOptions => new AnalysisOptionsImpl();
+
+  fail_undefinedEnumConstant() async {
+    Source source = addSource(r'''
+enum E { ONE }
+E e() {
+  return E.TWO;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_ambiguousExport() async {
+    Source source = addSource(r'''
+library L;
+export 'lib1.dart';
+export 'lib2.dart';''');
+    addNamedSource("/lib1.dart", r'''
+library lib1;
+class M {}''');
+    addNamedSource("/lib2.dart", r'''
+library lib2;
+class N {}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_ambiguousExport_combinators_hide() async {
+    Source source = addSource(r'''
+library L;
+export 'lib1.dart';
+export 'lib2.dart' hide B;''');
+    addNamedSource("/lib1.dart", r'''
+library L1;
+class A {}
+class B {}''');
+    addNamedSource("/lib2.dart", r'''
+library L2;
+class B {}
+class C {}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_ambiguousExport_combinators_show() async {
+    Source source = addSource(r'''
+library L;
+export 'lib1.dart';
+export 'lib2.dart' show C;''');
+    addNamedSource("/lib1.dart", r'''
+library L1;
+class A {}
+class B {}''');
+    addNamedSource("/lib2.dart", r'''
+library L2;
+class B {}
+class C {}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_ambiguousExport_sameDeclaration() async {
+    Source source = addSource(r'''
+library L;
+export 'lib.dart';
+export 'lib.dart';''');
+    addNamedSource("/lib.dart", r'''
+library lib;
+class N {}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_ambiguousImport_dart_implicitHide() async {
+    Source source = addSource(r'''
+import 'dart:async';
+import 'lib.dart';
+main() {
+  print(Future.zero);
+}
+''');
+    addNamedSource('/lib.dart', r'''
+class Future {
+  static const zero = 0;
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+  }
+
+  test_ambiguousImport_hideCombinator() async {
+    Source source = addSource(r'''
+import 'lib1.dart';
+import 'lib2.dart';
+import 'lib3.dart' hide N;
+main() {
+  new N1();
+  new N2();
+  new N3();
+}''');
+    addNamedSource("/lib1.dart", r'''
+library lib1;
+class N {}
+class N1 {}''');
+    addNamedSource("/lib2.dart", r'''
+library lib2;
+class N {}
+class N2 {}''');
+    addNamedSource("/lib3.dart", r'''
+library lib3;
+class N {}
+class N3 {}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+  }
+
+  test_ambiguousImport_showCombinator() async {
+    Source source = addSource(r'''
+import 'lib1.dart';
+import 'lib2.dart' show N, N2;
+main() {
+  new N1();
+  new N2();
+}''');
+    addNamedSource("/lib1.dart", r'''
+library lib1;
+class N {}
+class N1 {}''');
+    addNamedSource("/lib2.dart", r'''
+library lib2;
+class N {}
+class N2 {}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [HintCode.UNUSED_SHOWN_NAME]);
+  }
+
+  test_annotated_partOfDeclaration() async {
+    Source source = addSource('library L; part "part.dart";');
+    addNamedSource('/part.dart', '@deprecated part of L;');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_argumentTypeNotAssignable_classWithCall_Function() async {
+    Source source = addSource(r'''
+  caller(Function callee) {
+    callee();
+  }
+
+  class CallMeBack {
+    call() => 0;
+  }
+
+  main() {
+    caller(new CallMeBack());
+  }''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_argumentTypeNotAssignable_fieldFormalParameterElement_member() async {
+    Source source = addSource(r'''
+class ObjectSink<T> {
+  void sink(T object) {
+    new TimestampedObject<T>(object);
+  }
+}
+class TimestampedObject<E> {
+  E object2;
+  TimestampedObject(this.object2);
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_argumentTypeNotAssignable_invocation_functionParameter_generic() async {
+    Source source = addSource(r'''
+class A<K> {
+  m(f(K k), K v) {
+    f(v);
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_argumentTypeNotAssignable_invocation_typedef_generic() async {
+    Source source = addSource(r'''
+typedef A<T>(T p);
+f(A<int> a) {
+  a(1);
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_argumentTypeNotAssignable_Object_Function() async {
+    Source source = addSource(r'''
+main() {
+  process(() {});
+}
+process(Object x) {}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_argumentTypeNotAssignable_optionalNew() async {
+    resetWith(options: new AnalysisOptionsImpl());
+    Source source = addSource(r'''
+class Widget { }
+
+class MaterialPageRoute {
+  final Widget Function() builder;
+  const MaterialPageRoute({this.builder});
+}
+
+void main() {
+  print(MaterialPageRoute(
+      builder: () { return Widget(); }
+  ));
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_argumentTypeNotAssignable_typedef_local() async {
+    Source source = addSource(r'''
+typedef A(int p1, String p2);
+A getA() => null;
+f() {
+  A a = getA();
+  a(1, '2');
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_argumentTypeNotAssignable_typedef_parameter() async {
+    Source source = addSource(r'''
+typedef A(int p1, String p2);
+f(A a) {
+  a(1, '2');
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_assert_with_message_await() async {
+    Source source = addSource('''
+import 'dart:async';
+f() async {
+  assert(false, await g());
+}
+Future<String> g() => null;
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_assert_with_message_dynamic() async {
+    Source source = addSource('''
+f() {
+  assert(false, g());
+}
+g() => null;
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_assert_with_message_non_string() async {
+    Source source = addSource('''
+f() {
+  assert(false, 3);
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_assert_with_message_null() async {
+    Source source = addSource('''
+f() {
+  assert(false, null);
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_assert_with_message_string() async {
+    Source source = addSource('''
+f() {
+  assert(false, 'message');
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_assert_with_message_suppresses_unused_var_hint() async {
+    Source source = addSource('''
+f() {
+  String message = 'msg';
+  assert(true, message);
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_assignability_function_expr_rettype_from_typedef_cls() async {
+    // In the code below, the type of (() => f()) has a return type which is
+    // a class, and that class is inferred from the return type of the typedef
+    // F.
+    Source source = addSource('''
+class C {}
+typedef C F();
+F f;
+main() {
+  F f2 = (() => f());
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_assignability_function_expr_rettype_from_typedef_typedef() async {
+    // In the code below, the type of (() => f()) has a return type which is
+    // a typedef, and that typedef is inferred from the return type of the
+    // typedef F.
+    Source source = addSource('''
+typedef G F();
+typedef G();
+F f;
+main() {
+  F f2 = (() => f());
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_assignmentToFinal_prefixNegate() async {
+    Source source = addSource(r'''
+f() {
+  final x = 0;
+  -x;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_assignmentToFinalNoSetter_prefixedIdentifier() async {
+    Source source = addSource(r'''
+class A {
+  int get x => 0;
+  set x(v) {}
+}
+main() {
+  A a = new A();
+  a.x = 0;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_assignmentToFinalNoSetter_propertyAccess() async {
+    Source source = addSource(r'''
+class A {
+  int get x => 0;
+  set x(v) {}
+}
+class B {
+  static A a;
+}
+main() {
+  B.a.x = 0;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_assignmentToFinals_importWithPrefix() async {
+    Source source = addSource(r'''
+library lib;
+import 'lib1.dart' as foo;
+main() {
+  foo.x = true;
+}''');
+    addNamedSource("/lib1.dart", r'''
+library lib1;
+bool x = false;''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_async_dynamic_with_return() async {
+    Source source = addSource('''
+dynamic f() async {
+  return;
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_async_dynamic_with_return_value() async {
+    Source source = addSource('''
+dynamic f() async {
+  return 5;
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_async_dynamic_without_return() async {
+    Source source = addSource('''
+dynamic f() async {}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_async_expression_function_type() async {
+    Source source = addSource('''
+import 'dart:async';
+typedef Future<int> F(int i);
+main() {
+  F f = (int i) async => i;
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_async_flattened() async {
+    Source source = addSource('''
+import 'dart:async';
+typedef Future<int> CreatesFutureInt();
+main() {
+  CreatesFutureInt createFutureInt = () async => f();
+  Future<int> futureInt = createFutureInt();
+  futureInt.then((int i) => print(i));
+}
+Future<int> f() => null;
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_async_future_dynamic_with_return() async {
+    Source source = addSource('''
+import 'dart:async';
+Future<dynamic> f() async {
+  return;
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_async_future_dynamic_with_return_value() async {
+    Source source = addSource('''
+import 'dart:async';
+Future<dynamic> f() async {
+  return 5;
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_async_future_dynamic_without_return() async {
+    Source source = addSource('''
+import 'dart:async';
+Future<dynamic> f() async {}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_async_future_int_with_return_future_int() async {
+    Source source = addSource('''
+import 'dart:async';
+Future<int> f() async {
+  return new Future<int>.value(5);
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_async_future_int_with_return_value() async {
+    Source source = addSource('''
+import 'dart:async';
+Future<int> f() async {
+  return 5;
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_async_future_null_with_return() async {
+    Source source = addSource('''
+import 'dart:async';
+Future<Null> f() async {
+  return;
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_async_future_null_without_return() async {
+    Source source = addSource('''
+import 'dart:async';
+Future<Null> f() async {}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_async_future_object_with_return_value() async {
+    Source source = addSource('''
+import 'dart:async';
+Future<Object> f() async {
+  return 5;
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_async_future_with_return() async {
+    Source source = addSource('''
+import 'dart:async';
+Future f() async {
+  return;
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_async_future_with_return_value() async {
+    Source source = addSource('''
+import 'dart:async';
+Future f() async {
+  return 5;
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_async_future_without_return() async {
+    Source source = addSource('''
+import 'dart:async';
+Future f() async {}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_async_with_return() async {
+    Source source = addSource('''
+f() async {
+  return;
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_async_with_return_value() async {
+    Source source = addSource('''
+f() async {
+  return 5;
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_async_without_return() async {
+    Source source = addSource('''
+f() async {}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_asyncForInWrongContext_async() async {
+    Source source = addSource(r'''
+f(list) async {
+  await for (var e in list) {
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_asyncForInWrongContext_asyncStar() async {
+    Source source = addSource(r'''
+f(list) async* {
+  await for (var e in list) {
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_await_flattened() async {
+    Source source = addSource('''
+import 'dart:async';
+Future<Future<int>> ffi() => null;
+f() async {
+  Future<int> b = await ffi();
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_await_simple() async {
+    Source source = addSource('''
+import 'dart:async';
+Future<int> fi() => null;
+f() async {
+  int a = await fi();
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_awaitInWrongContext_async() async {
+    Source source = addSource(r'''
+f(x, y) async {
+  return await x + await y;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_awaitInWrongContext_asyncStar() async {
+    Source source = addSource(r'''
+f(x, y) async* {
+  yield await x + await y;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_breakWithoutLabelInSwitch() async {
+    Source source = addSource(r'''
+class A {
+  void m(int i) {
+    switch (i) {
+      case 0:
+        break;
+    }
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_bug_24539_getter() async {
+    Source source = addSource('''
+class C<T> {
+  List<Foo> get x => null;
+}
+
+typedef Foo(param);
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_bug_24539_setter() async {
+    Source source = addSource('''
+class C<T> {
+  void set x(List<Foo> value) {}
+}
+
+typedef Foo(param);
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_builtInIdentifierAsType_dynamic() async {
+    Source source = addSource(r'''
+f() {
+  dynamic x;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_caseBlockNotTerminated() async {
+    Source source = addSource(r'''
+f(int p) {
+  for (int i = 0; i < 10; i++) {
+    switch (p) {
+      case 0:
+        break;
+      case 1:
+        continue;
+      case 2:
+        return;
+      case 3:
+        throw new Object();
+      case 4:
+      case 5:
+        return;
+      case 6:
+      default:
+        return;
+    }
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_caseBlockNotTerminated_lastCase() async {
+    Source source = addSource(r'''
+f(int p) {
+  switch (p) {
+    case 0:
+      p = p + 1;
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_caseExpressionTypeImplementsEquals() async {
+    Source source = addSource(r'''
+print(p) {}
+
+abstract class B {
+  final id;
+  const B(this.id);
+  String toString() => 'C($id)';
+  /** Equality is identity equality, the id isn't used. */
+  bool operator==(Object other);
+  }
+
+class C extends B {
+  const C(id) : super(id);
+}
+
+void doSwitch(c) {
+  switch (c) {
+  case const C(0): print('Switch: 0'); break;
+  case const C(1): print('Switch: 1'); break;
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_caseExpressionTypeImplementsEquals_int() async {
+    Source source = addSource(r'''
+f(int i) {
+  switch(i) {
+    case(1) : return 1;
+    default: return 0;
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_caseExpressionTypeImplementsEquals_Object() async {
+    Source source = addSource(r'''
+class IntWrapper {
+  final int value;
+  const IntWrapper(this.value);
+}
+
+f(IntWrapper intWrapper) {
+  switch(intWrapper) {
+    case(const IntWrapper(1)) : return 1;
+    default: return 0;
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_caseExpressionTypeImplementsEquals_String() async {
+    Source source = addSource(r'''
+f(String s) {
+  switch(s) {
+    case('1') : return 1;
+    default: return 0;
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_class_type_alias_documentationComment() async {
+    Source source = addSource('''
+/**
+ * Documentation
+ */
+class C = D with E;
+
+class D {}
+class E {}''');
+    TestAnalysisResult analysisResult = await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+    CompilationUnit unit = analysisResult.unit;
+    ClassElement classC =
+        resolutionMap.elementDeclaredByCompilationUnit(unit).getType('C');
+    expect(classC.documentationComment, isNotNull);
+  }
+
+  test_concreteClassWithAbstractMember() async {
+    Source source = addSource(r'''
+abstract class A {
+  m();
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_concreteClassWithAbstractMember_inherited() async {
+    Source source = addSource(r'''
+class A {
+  m() {}
+}
+class B extends A {
+  m();
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_conflictingConstructorNameAndMember_setter() async {
+    Source source = addSource(r'''
+class A {
+A.x() {}
+set x(_) {}
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_conflictingStaticGetterAndInstanceSetter_thisClass() async {
+    Source source = addSource(r'''
+class A {
+  static get x => 0;
+  static set x(int p) {}
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_const_constructor_with_named_generic_parameter() async {
+    Source source = addSource('''
+class C<T> {
+  const C({T t});
+}
+const c = const C(t: 1);
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_const_dynamic() async {
+    Source source = addSource('''
+const Type d = dynamic;
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_const_imported_defaultParameterValue_withImportPrefix() async {
+    Source source = addNamedSource("/a.dart", r'''
+import 'b.dart';
+const b = const B();
+''');
+    addNamedSource("/b.dart", r'''
+import 'c.dart' as ccc;
+class B {
+  const B([p = ccc.value]);
+}
+''');
+    addNamedSource("/c.dart", r'''
+const int value = 12345;
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_constConstructorWithNonConstSuper_explicit() async {
+    Source source = addSource(r'''
+class A {
+  const A();
+}
+class B extends A {
+  const B(): super();
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_constConstructorWithNonConstSuper_redirectingFactory() async {
+    Source source = addSource(r'''
+class A {
+  A();
+}
+class B implements C {
+  const B();
+}
+class C extends A {
+  const factory C() = B;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_constConstructorWithNonConstSuper_unresolved() async {
+    Source source = addSource(r'''
+class A {
+  A.a();
+}
+class B extends A {
+  const B(): super();
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source,
+        [CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT]);
+    verify([source]);
+  }
+
+  test_constConstructorWithNonFinalField_finalInstanceVar() async {
+    Source source = addSource(r'''
+class A {
+  final int x = 0;
+  const A();
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_constConstructorWithNonFinalField_static() async {
+    Source source = addSource(r'''
+class A {
+  static int x;
+  const A();
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_constConstructorWithNonFinalField_syntheticField() async {
+    Source source = addSource(r'''
+class A {
+  const A();
+  set x(value) {}
+  get x {return 0;}
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_constDeferredClass_new() async {
+    await resolveWithErrors(<String>[
+      r'''
+library lib1;
+class A {
+  const A.b();
+}''',
+      r'''
+library root;
+import 'lib1.dart' deferred as a;
+main() {
+  new a.A.b();
+}'''
+    ], <ErrorCode>[]);
+  }
+
+  test_constEval_functionTypeLiteral() async {
+    Source source = addSource(r'''
+typedef F();
+const C = F;''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_constEval_propertyExtraction_fieldStatic_targetType() async {
+    addNamedSource("/math.dart", r'''
+library math;
+const PI = 3.14;''');
+    Source source = addSource(r'''
+import 'math.dart' as math;
+const C = math.PI;''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_constEval_propertyExtraction_methodStatic_targetType() async {
+    Source source = addSource(r'''
+class A {
+  const A();
+  static m() {}
+}
+const C = A.m;''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_constEval_symbol() async {
+    addNamedSource("/math.dart", r'''
+library math;
+const PI = 3.14;''');
+    Source source = addSource(r'''
+const C = #foo;
+foo() {}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_constEvalTypeBoolNumString_equal() async {
+    Source source = addSource(r'''
+class B {
+  final v;
+  const B.a1(bool p) : v = p == true;
+  const B.a2(bool p) : v = p == false;
+  const B.a3(bool p) : v = p == 0;
+  const B.a4(bool p) : v = p == 0.0;
+  const B.a5(bool p) : v = p == '';
+  const B.b1(int p) : v = p == true;
+  const B.b2(int p) : v = p == false;
+  const B.b3(int p) : v = p == 0;
+  const B.b4(int p) : v = p == 0.0;
+  const B.b5(int p) : v = p == '';
+  const B.c1(String p) : v = p == true;
+  const B.c2(String p) : v = p == false;
+  const B.c3(String p) : v = p == 0;
+  const B.c4(String p) : v = p == 0.0;
+  const B.c5(String p) : v = p == '';
+  const B.n1(num p) : v = p == null;
+  const B.n2(num p) : v = null == p;
+  const B.n3(Object p) : v = p == null;
+  const B.n4(Object p) : v = null == p;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+  }
+
+  test_constEvalTypeBoolNumString_notEqual() async {
+    Source source = addSource(r'''
+class B {
+  final v;
+  const B.a1(bool p) : v = p != true;
+  const B.a2(bool p) : v = p != false;
+  const B.a3(bool p) : v = p != 0;
+  const B.a4(bool p) : v = p != 0.0;
+  const B.a5(bool p) : v = p != '';
+  const B.b1(int p) : v = p != true;
+  const B.b2(int p) : v = p != false;
+  const B.b3(int p) : v = p != 0;
+  const B.b4(int p) : v = p != 0.0;
+  const B.b5(int p) : v = p != '';
+  const B.c1(String p) : v = p != true;
+  const B.c2(String p) : v = p != false;
+  const B.c3(String p) : v = p != 0;
+  const B.c4(String p) : v = p != 0.0;
+  const B.c5(String p) : v = p != '';
+  const B.n1(num p) : v = p != null;
+  const B.n2(num p) : v = null != p;
+  const B.n3(Object p) : v = p != null;
+  const B.n4(Object p) : v = null != p;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_constEvAlTypeNum_String() async {
+    Source source = addSource(r'''
+const String A = 'a';
+const String B = A + 'b';
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_constMapKeyExpressionTypeImplementsEquals_abstract() async {
+    Source source = addSource(r'''
+abstract class B {
+  final id;
+  const B(this.id);
+  String toString() => 'C($id)';
+  /** Equality is identity equality, the id isn't used. */
+  bool operator==(Object other);
+  }
+
+class C extends B {
+  const C(id) : super(id);
+}
+
+Map getMap() {
+  return const { const C(0): 'Map: 0' };
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_constNotInitialized_field() async {
+    Source source = addSource(r'''
+class A {
+  static const int x = 0;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_constNotInitialized_local() async {
+    Source source = addSource(r'''
+main() {
+  const int x = 0;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_constRedirectSkipsSupertype() async {
+    // Since C redirects to C.named, it doesn't implicitly refer to B's
+    // unnamed constructor.  Therefore there is no cycle.
+    Source source = addSource('''
+class B {
+  final x;
+  const B() : x = y;
+  const B.named() : x = null;
+}
+class C extends B {
+  const C() : this.named();
+  const C.named() : super.named();
+}
+const y = const C();
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_constructorDeclaration_scope_signature() async {
+    Source source = addSource(r'''
+const app = 0;
+class A {
+  A(@app int app) {}
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_constWithNonConstantArgument_constField() async {
+    Source source = addSource(r'''
+class A {
+  const A(x);
+}
+main() {
+  const A(double.INFINITY);
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_constWithNonConstantArgument_literals() async {
+    Source source = addSource(r'''
+class A {
+  const A(a, b, c, d);
+}
+f() { return const A(true, 0, 1.0, '2'); }''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_constWithTypeParameters_direct() async {
+    Source source = addSource(r'''
+class A<T> {
+  static const V = const A<int>();
+  const A();
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_constWithUndefinedConstructor() async {
+    Source source = addSource(r'''
+class A {
+  const A.name();
+}
+f() {
+  return const A.name();
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_constWithUndefinedConstructorDefault() async {
+    Source source = addSource(r'''
+class A {
+  const A();
+}
+f() {
+  return const A();
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_defaultValueInFunctionTypeAlias() async {
+    Source source = addSource("typedef F([x]);");
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_defaultValueInFunctionTypedParameter_named() async {
+    Source source = addSource("f(g({p})) {}");
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_defaultValueInFunctionTypedParameter_optional() async {
+    Source source = addSource("f(g([p])) {}");
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_deprecatedMemberUse_hide() async {
+    Source source = addSource(r'''
+library lib;
+import 'lib1.dart' hide B;
+A a = new A();''');
+    addNamedSource("/lib1.dart", r'''
+library lib1;
+class A {}
+@deprecated
+class B {}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_duplicateDefinition_emptyName() async {
+    // Note: This code has two FunctionElements '() {}' with an empty name,
+    // this tests that the empty string is not put into the scope
+    // (more than once).
+    Source source = addSource(r'''
+Map _globalMap = {
+  'a' : () {},
+  'b' : () {}
+};''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_duplicateDefinition_getter() async {
+    Source source = addSource("bool get a => true;");
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_duplicatePart() async {
+    addNamedSource('/part1.dart', 'part of lib;');
+    addNamedSource('/part2.dart', 'part of lib;');
+    Source source = addSource(r'''
+library lib;
+part 'part1.dart';
+part 'part2.dart';
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_dynamicIdentifier() async {
+    Source source = addSource(r'''
+main() {
+  var v = dynamic;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_empty_generator_async() async {
+    Source source = addSource('''
+import 'dart:async';
+Stream<int> f() async* {
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_empty_generator_sync() async {
+    Source source = addSource('''
+Iterable<int> f() sync* {
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_expectedOneListTypeArgument() async {
+    Source source = addSource(r'''
+main() {
+  <int> [];
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_expectedTwoMapTypeArguments() async {
+    Source source = addSource(r'''
+main() {
+  <int, int> {};
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_exportDuplicatedLibraryUnnamed() async {
+    Source source = addSource(r'''
+library test;
+export 'lib1.dart';
+export 'lib2.dart';''');
+    addNamedSource("/lib1.dart", "");
+    addNamedSource("/lib2.dart", "");
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_exportOfNonLibrary_libraryDeclared() async {
+    Source source = addSource(r'''
+library L;
+export 'lib1.dart';''');
+    addNamedSource("/lib1.dart", "library lib1;");
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_exportOfNonLibrary_libraryNotDeclared() async {
+    Source source = addSource(r'''
+library L;
+export 'lib1.dart';''');
+    addNamedSource("/lib1.dart", "");
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_extraPositionalArguments_function() async {
+    Source source = addSource(r'''
+f(p1, p2) {}
+main() {
+  f(1, 2);
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_extraPositionalArguments_Function() async {
+    Source source = addSource(r'''
+f(Function a) {
+  a(1, 2);
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_extraPositionalArguments_typedef_local() async {
+    Source source = addSource(r'''
+typedef A(p1, p2);
+A getA() => null;
+f() {
+  A a = getA();
+  a(1, 2);
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_extraPositionalArguments_typedef_parameter() async {
+    Source source = addSource(r'''
+typedef A(p1, p2);
+f(A a) {
+  a(1, 2);
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_fieldFormalParameter_functionTyped_named() async {
+    Source source = addSource(r'''
+class C {
+  final Function field;
+
+  C({String this.field(int value)});
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_fieldFormalParameter_genericFunctionTyped() async {
+    Source source = addSource(r'''
+class C {
+  final Object Function(int, double) field;
+
+  C(String Function(num, Object) this.field);
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_fieldFormalParameter_genericFunctionTyped_named() async {
+    Source source = addSource(r'''
+class C {
+  final Object Function(int, double) field;
+
+  C({String Function(num, Object) this.field});
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_fieldInitializedByMultipleInitializers() async {
+    Source source = addSource(r'''
+class A {
+  int x;
+  int y;
+  A() : x = 0, y = 0 {}
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_fieldInitializedInInitializerAndDeclaration_fieldNotFinal() async {
+    Source source = addSource(r'''
+class A {
+  int x = 0;
+  A() : x = 1 {}
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_fieldInitializedInInitializerAndDeclaration_finalFieldNotSet() async {
+    Source source = addSource(r'''
+class A {
+  final int x;
+  A() : x = 1 {}
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_fieldInitializerOutsideConstructor() async {
+    Source source = addSource(r'''
+class A {
+  int x;
+  A(this.x) {}
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_fieldInitializerOutsideConstructor_defaultParameters() async {
+    Source source = addSource(r'''
+class A {
+  int x;
+  A([this.x]) {}
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_fieldInitializerRedirectingConstructor_super() async {
+    Source source = addSource(r'''
+class A {
+  A() {}
+}
+class B extends A {
+  int x;
+  B(this.x) : super();
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_finalInitializedInDeclarationAndConstructor_initializer() async {
+    Source source = addSource(r'''
+class A {
+  final x;
+  A() : x = 1 {}
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_finalInitializedInDeclarationAndConstructor_initializingFormal() async {
+    Source source = addSource(r'''
+class A {
+  final x;
+  A(this.x) {}
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_finalNotInitialized_atDeclaration() async {
+    Source source = addSource(r'''
+class A {
+  final int x = 0;
+  A() {}
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_finalNotInitialized_fieldFormal() async {
+    Source source = addSource(r'''
+class A {
+  final int x = 0;
+  A() {}
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_finalNotInitialized_functionTypedFieldFormal() async {
+    Source source = addSource(r'''
+class A {
+  final Function x;
+  A(int this.x(int p)) {}
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_finalNotInitialized_hasNativeClause_hasConstructor() async {
+    Source source = addSource(r'''
+class A native 'something' {
+  final int x;
+  A() {}
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [ParserErrorCode.NATIVE_CLAUSE_IN_NON_SDK_CODE]);
+    verify([source]);
+  }
+
+  test_finalNotInitialized_hasNativeClause_noConstructor() async {
+    Source source = addSource(r'''
+class A native 'something' {
+  final int x;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [ParserErrorCode.NATIVE_CLAUSE_IN_NON_SDK_CODE]);
+    verify([source]);
+  }
+
+  test_finalNotInitialized_initializer() async {
+    Source source = addSource(r'''
+class A {
+  final int x;
+  A() : x = 0 {}
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_finalNotInitialized_redirectingConstructor() async {
+    Source source = addSource(r'''
+class A {
+  final int x;
+  A(this.x);
+  A.named() : this (42);
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_forEach_genericFunctionType() async {
+    Source source = addSource(r'''
+main() {
+  for (Null Function<T>(T, Null) e in <dynamic>[]) {
+    e;
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_functionDeclaration_scope_returnType() async {
+    Source source = addSource("int f(int) { return 0; }");
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_functionDeclaration_scope_signature() async {
+    Source source = addSource(r'''
+const app = 0;
+f(@app int app) {}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_functionTypeAlias_scope_returnType() async {
+    Source source = addSource("typedef int f(int);");
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_functionTypeAlias_scope_signature() async {
+    Source source = addSource(r'''
+const app = 0;
+typedef int f(@app int app);''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_functionWithoutCall() async {
+    Source source = addSource(r'''
+abstract class A implements Function {
+}
+class B implements A {
+  void call() {}
+}
+class C extends A {
+  void call() {}
+}
+class D extends C {
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_functionWithoutCall_doesNotImplementFunction() async {
+    Source source = addSource("class A {}");
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_functionWithoutCall_staticCallMethod() async {
+    Source source = addSource(r'''
+class A { }
+class B extends A {
+  static call() { }
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_functionWithoutCall_withNoSuchMethod() async {
+    // 16078
+    Source source = addSource(r'''
+class A implements Function {
+  noSuchMethod(inv) {
+    return 42;
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_functionWithoutCall_withNoSuchMethod_mixin() async {
+    Source source = addSource(r'''
+class A {
+  noSuchMethod(inv) {}
+}
+class B extends Object with A implements Function {
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_functionWithoutCall_withNoSuchMethod_superclass() async {
+    Source source = addSource(r'''
+class A {
+  noSuchMethod(inv) {}
+}
+class B extends A implements Function {
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_genericTypeAlias_castsAndTypeChecks_hasTypeParameters() async {
+    Source source = addSource('''
+typedef Foo<S> = S Function<T>(T x);
+
+main(Object p) {
+  (p as Foo)<int>(3);
+  if (p is Foo) {
+    p<int>(3);
+  }
+  (p as Foo<String>)<int>(3);
+  if (p is Foo<String>) {
+    p<int>(3);
+  }
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_genericTypeAlias_castsAndTypeChecks_noTypeParameters() async {
+    Source source = addSource('''
+typedef Foo = T Function<T>(T x);
+
+main(Object p) {
+  (p as Foo)<int>(3);
+  if (p is Foo) {
+    p<int>(3);
+  }
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_genericTypeAlias_fieldAndReturnType_noTypeParameters() async {
+    Source source = addSource(r'''
+typedef Foo = int Function<T>(T x);
+int foo<T>(T x) => 3;
+Foo bar() => foo;
+void test1() {
+  bar()<String>("hello");
+}
+
+class A {
+  Foo f;
+  void test() {
+    f<String>("hello");
+  }
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_genericTypeAlias_fieldAndReturnType_typeParameters_arguments() async {
+    Source source = addSource(r'''
+typedef Foo<S> = S Function<T>(T x);
+int foo<T>(T x) => 3;
+Foo<int> bar() => foo;
+void test1() {
+  bar()<String>("hello");
+}
+
+class A {
+  Foo<int> f;
+  void test() {
+    f<String>("hello");
+  }
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_genericTypeAlias_fieldAndReturnType_typeParameters_noArguments() async {
+    Source source = addSource(r'''
+typedef Foo<S> = S Function<T>(T x);
+int foo<T>(T x) => 3;
+Foo bar() => foo;
+void test1() {
+  bar()<String>("hello");
+}
+
+class A {
+  Foo f;
+  void test() {
+    f<String>("hello");
+  }
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_genericTypeAlias_invalidGenericFunctionType() async {
+    Source source = addSource('''
+typedef F = int;
+main(p) {
+  p is F;
+}
+''');
+    await computeAnalysisResult(source);
+    // There is a parse error, but no crashes.
+    assertErrors(source, [ParserErrorCode.INVALID_GENERIC_FUNCTION_TYPE]);
+    verify([source]);
+  }
+
+  test_genericTypeAlias_noTypeParameters() async {
+    Source source = addSource(r'''
+typedef Foo = int Function<T>(T x);
+int foo<T>(T x) => 3;
+void test1() {
+  Foo y = foo;
+  // These two should be equivalent
+  foo<String>("hello");
+  y<String>("hello");
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_genericTypeAlias_typeParameters() async {
+    Source source = addSource(r'''
+typedef Foo<S> = S Function<T>(T x);
+int foo<T>(T x) => 3;
+void test1() {
+  Foo<int> y = foo;
+  // These two should be equivalent
+  foo<String>("hello");
+  y<String>("hello");
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_implicitThisReferenceInInitializer_constructorName() async {
+    Source source = addSource(r'''
+class A {
+  A.named() {}
+}
+class B {
+  var v;
+  B() : v = new A.named();
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_implicitThisReferenceInInitializer_prefixedIdentifier() async {
+    Source source = addSource(r'''
+class A {
+  var f;
+}
+class B {
+  var v;
+  B(A a) : v = a.f;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_implicitThisReferenceInInitializer_qualifiedMethodInvocation() async {
+    Source source = addSource(r'''
+class A {
+  f() {}
+}
+class B {
+  var v;
+  B() : v = new A().f();
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_implicitThisReferenceInInitializer_qualifiedPropertyAccess() async {
+    Source source = addSource(r'''
+class A {
+  var f;
+}
+class B {
+  var v;
+  B() : v = new A().f;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_implicitThisReferenceInInitializer_staticField_thisClass() async {
+    Source source = addSource(r'''
+class A {
+  var v;
+  A() : v = f;
+  static var f;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_implicitThisReferenceInInitializer_staticGetter() async {
+    Source source = addSource(r'''
+class A {
+  var v;
+  A() : v = f;
+  static get f => 42;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_implicitThisReferenceInInitializer_staticMethod() async {
+    Source source = addSource(r'''
+class A {
+  var v;
+  A() : v = f();
+  static f() => 42;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_implicitThisReferenceInInitializer_topLevelField() async {
+    Source source = addSource(r'''
+class A {
+  var v;
+  A() : v = f;
+}
+var f = 42;''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_implicitThisReferenceInInitializer_topLevelFunction() async {
+    Source source = addSource(r'''
+class A {
+  var v;
+  A() : v = f();
+}
+f() => 42;''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_implicitThisReferenceInInitializer_topLevelGetter() async {
+    Source source = addSource(r'''
+class A {
+  var v;
+  A() : v = f;
+}
+get f => 42;''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_implicitThisReferenceInInitializer_typeParameter() async {
+    Source source = addSource(r'''
+class A<T> {
+  var v;
+  A(p) : v = (p is T);
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_importDuplicatedLibraryName() async {
+    Source source = addSource(r'''
+library test;
+import 'lib.dart';
+import 'lib.dart';''');
+    addNamedSource("/lib.dart", "library lib;");
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      HintCode.UNUSED_IMPORT,
+      HintCode.UNUSED_IMPORT,
+      HintCode.DUPLICATE_IMPORT
+    ]);
+    verify([source]);
+  }
+
+  test_importDuplicatedLibraryUnnamed() async {
+    Source source = addSource(r'''
+library test;
+import 'lib1.dart';
+import 'lib2.dart';''');
+    addNamedSource("/lib1.dart", "");
+    addNamedSource("/lib2.dart", "");
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      // No warning on duplicate import (https://github.com/dart-lang/sdk/issues/24156)
+      HintCode.UNUSED_IMPORT,
+      HintCode.UNUSED_IMPORT
+    ]);
+    verify([source]);
+  }
+
+  test_importOfNonLibrary_libraryDeclared() async {
+    Source source = addSource(r'''
+library lib;
+import 'part.dart';
+A a;''');
+    addNamedSource("/part.dart", r'''
+library lib1;
+class A {}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_importOfNonLibrary_libraryNotDeclared() async {
+    Source source = addSource(r'''
+library lib;
+import 'part.dart';
+A a;''');
+    addNamedSource("/part.dart", "class A {}");
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_importPrefixes_withFirstLetterDifference() async {
+    Source source = addSource(r'''
+library L;
+import 'lib1.dart' as math;
+import 'lib2.dart' as path;
+main() {
+  math.test1();
+  path.test2();
+}''');
+    addNamedSource("/lib1.dart", r'''
+library lib1;
+test1() {}''');
+    addNamedSource("/lib2.dart", r'''
+library lib2;
+test2() {}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_inconsistentCaseExpressionTypes() async {
+    Source source = addSource(r'''
+f(var p) {
+  switch (p) {
+    case 1:
+      break;
+    case 2:
+      break;
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_inconsistentMethodInheritance_accessors_typeParameter2() async {
+    Source source = addSource(r'''
+abstract class A<E> {
+  E get x {return null;}
+}
+class B<E> {
+  E get x {return null;}
+}
+class C<E> extends A<E> implements B<E> {}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_inconsistentMethodInheritance_accessors_typeParameters1() async {
+    Source source = addSource(r'''
+abstract class A<E> {
+  E get x;
+}
+abstract class B<E> {
+  E get x;
+}
+class C<E> implements A<E>, B<E> {
+  E get x => null;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_inconsistentMethodInheritance_accessors_typeParameters_diamond() async {
+    Source source = addSource(r'''
+abstract class F<E> extends B<E> {}
+class D<E> extends F<E> {
+  external E get g;
+}
+abstract class C<E> {
+  E get g;
+}
+abstract class B<E> implements C<E> {
+  E get g { return null; }
+}
+class A<E> extends B<E> implements D<E> {
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_inconsistentMethodInheritance_methods_typeParameter2() async {
+    Source source = addSource(r'''
+class A<E> {
+  x(E e) {}
+}
+class B<E> {
+  x(E e) {}
+}
+class C<E> extends A<E> implements B<E> {
+  x(E e) {}
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_inconsistentMethodInheritance_methods_typeParameters1() async {
+    Source source = addSource(r'''
+class A<E> {
+  x(E e) {}
+}
+class B<E> {
+  x(E e) {}
+}
+class C<E> implements A<E>, B<E> {
+  x(E e) {}
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_inconsistentMethodInheritance_simple() async {
+    Source source = addSource(r'''
+abstract class A {
+  x();
+}
+abstract class B {
+  x();
+}
+class C implements A, B {
+  x() {}
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_infer_mixin_new_syntax() async {
+    Source source = addSource('''
+abstract class A<T> {}
+
+class B {}
+
+mixin M<T> on A<T> {}
+
+class C extends A<B> with M {}
+''');
+    TestAnalysisResult analysisResult = await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+    CompilationUnit unit = analysisResult.unit;
+    ClassElement classC =
+        resolutionMap.elementDeclaredByCompilationUnit(unit).getType('C');
+    expect(classC.mixins, hasLength(1));
+    expect(classC.mixins[0].toString(), 'M<B>');
+  }
+
+  test_infer_mixin_with_substitution_functionType_new_syntax() async {
+    Source source = addSource('''
+abstract class A<T> {}
+
+class B {}
+
+mixin M<T, U> on A<T Function(U)> {}
+
+class C extends A<int Function(String)> with M {}
+''');
+    TestAnalysisResult analysisResult = await computeAnalysisResult(source);
+    assertNoErrors(source);
+    CompilationUnit unit = analysisResult.unit;
+    ClassElement classC =
+        resolutionMap.elementDeclaredByCompilationUnit(unit).getType('C');
+    expect(classC.mixins, hasLength(1));
+    expect(classC.mixins[0].toString(), 'M<int, String>');
+  }
+
+  test_infer_mixin_with_substitution_new_syntax() async {
+    Source source = addSource('''
+abstract class A<T> {}
+
+class B {}
+
+mixin M<T> on A<List<T>> {}
+
+class C extends A<List<B>> with M {}
+''');
+    TestAnalysisResult analysisResult = await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+    CompilationUnit unit = analysisResult.unit;
+    ClassElement classC =
+        resolutionMap.elementDeclaredByCompilationUnit(unit).getType('C');
+    expect(classC.mixins, hasLength(1));
+    expect(classC.mixins[0].toString(), 'M<B>');
+  }
+
+  test_initializingFormalForNonExistentField() async {
+    Source source = addSource(r'''
+class A {
+  int x;
+  A(this.x) {}
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_instance_creation_inside_annotation() async {
+    Source source = addSource('''
+class C {
+  const C();
+}
+class D {
+  final C c;
+  const D(this.c);
+}
+@D(const C())
+f() {}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_instanceAccessToStaticMember_fromComment() async {
+    Source source = addSource(r'''
+class A {
+  static m() {}
+}
+/// [A.m]
+main() {
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_instanceAccessToStaticMember_topLevel() async {
+    Source source = addSource(r'''
+m() {}
+main() {
+  m();
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_instanceMemberAccessFromStatic_fromComment() async {
+    Source source = addSource(r'''
+class A {
+  m() {}
+  /// [m]
+  static foo() {
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_instanceMethodNameCollidesWithSuperclassStatic_field() async {
+    Source source = addSource(r'''
+import 'lib.dart';
+class B extends A {
+  _m() {}
+}''');
+    addNamedSource("/lib.dart", r'''
+library L;
+class A {
+  static var _m;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_instanceMethodNameCollidesWithSuperclassStatic_method() async {
+    Source source = addSource(r'''
+import 'lib.dart';
+class B extends A {
+  _m() {}
+}''');
+    addNamedSource("/lib.dart", r'''
+library L;
+class A {
+  static _m() {}
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_integerLiteralOutOfRange_negative_leadingZeros() async {
+    Source source = addSource('int x = -000923372036854775809;');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+  }
+
+  test_integerLiteralOutOfRange_negative_small() async {
+    Source source = addSource('int x = -42;');
+    await computeAnalysisResult(source);
+    assertErrors(source);
+  }
+
+  test_integerLiteralOutOfRange_negative_valid() async {
+    Source source = addSource('int x = -9223372036854775808;');
+    await computeAnalysisResult(source);
+    assertErrors(source);
+  }
+
+  test_integerLiteralOutOfRange_positive_leadingZeros() async {
+    Source source = addSource('int x = 000923372036854775808;');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+  }
+
+  test_integerLiteralOutOfRange_positive_valid() async {
+    Source source = addSource('int x = 9223372036854775807;');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+  }
+
+  test_integerLiteralOutOfRange_positive_zero() async {
+    Source source = addSource('int x = 0;');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+  }
+
+  test_intLiteralInDoubleContext() async {
+    Source source = addSource(r'''
+void takeDouble(double x) {}
+void main() {
+  takeDouble(0);
+  takeDouble(-0);
+  takeDouble(0x0);
+  takeDouble(-0x0);
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_intLiteralInDoubleContext_const() async {
+    Source source = addSource(r'''
+class C {
+  const C(double x)
+    : assert((x + 3) / 2 == 1.5)
+    , assert(x == 0.0);
+}
+@C(0)
+@C(-0)
+@C(0x0)
+@C(-0x0)
+void main() {
+  const C(0);
+  const C(-0);
+  const C(0x0);
+  const C(-0x0);
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_invalidAnnotation_constantVariable_field() async {
+    Source source = addSource(r'''
+@A.C
+class A {
+  static const C = 0;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_invalidAnnotation_constantVariable_field_importWithPrefix() async {
+    addNamedSource("/lib.dart", r'''
+library lib;
+class A {
+  static const C = 0;
+}''');
+    Source source = addSource(r'''
+import 'lib.dart' as p;
+@p.A.C
+main() {
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_invalidAnnotation_constantVariable_topLevel() async {
+    Source source = addSource(r'''
+const C = 0;
+@C
+main() {
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_invalidAnnotation_constantVariable_topLevel_importWithPrefix() async {
+    addNamedSource("/lib.dart", r'''
+library lib;
+const C = 0;''');
+    Source source = addSource(r'''
+import 'lib.dart' as p;
+@p.C
+main() {
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_invalidAnnotation_constConstructor_importWithPrefix() async {
+    addNamedSource("/lib.dart", r'''
+library lib;
+class A {
+  const A(int p);
+}''');
+    Source source = addSource(r'''
+import 'lib.dart' as p;
+@p.A(42)
+main() {
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_invalidAnnotation_constConstructor_named_importWithPrefix() async {
+    addNamedSource("/lib.dart", r'''
+library lib;
+class A {
+  const A.named(int p);
+}''');
+    Source source = addSource(r'''
+import 'lib.dart' as p;
+@p.A.named(42)
+main() {
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_invalidAssignment() async {
+    Source source = addSource(r'''
+f() {
+  var x;
+  var y;
+  x = y;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_invalidAssignment_compoundAssignment() async {
+    Source source = addSource(r'''
+class byte {
+  int _value;
+  byte(this._value);
+  byte operator +(int val) { return this; }
+}
+
+void main() {
+  byte b = new byte(52);
+  b += 3;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_invalidAssignment_defaultValue_named() async {
+    Source source = addSource(r'''
+f({String x: '0'}) {
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_invalidAssignment_defaultValue_optional() async {
+    Source source = addSource(r'''
+f([String x = '0']) {
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_invalidAssignment_ifNullAssignment_compatibleType() async {
+    Source source = addSource('''
+void f(int i) {
+  num n;
+  n ??= i;
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_invalidAssignment_ifNullAssignment_sameType() async {
+    Source source = addSource('''
+void f(int i) {
+  int j;
+  j ??= i;
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_invalidAssignment_implicitlyImplementFunctionViaCall_1() async {
+    // 18341
+    //
+    // This test and
+    // 'test_invalidAssignment_implicitlyImplementFunctionViaCall_2()'
+    // are closely related: here we see that 'I' checks as a subtype of
+    // 'IntToInt'.
+    Source source = addSource(r'''
+class I {
+  int call(int x) => 0;
+}
+class C implements I {
+  noSuchMethod(_) => null;
+}
+typedef int IntToInt(int x);
+IntToInt f = new I();''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_invalidAssignment_implicitlyImplementFunctionViaCall_2() async {
+    // 18341
+    //
+    // Here 'C' checks as a subtype of 'I', but 'C' does not
+    // check as a subtype of 'IntToInt'. Together with
+    // 'test_invalidAssignment_implicitlyImplementFunctionViaCall_1()' we see
+    // that subtyping is not transitive here.
+    Source source = addSource(r'''
+class I {
+  int call(int x) => 0;
+}
+class C implements I {
+  noSuchMethod(_) => null;
+}
+typedef int IntToInt(int x);
+IntToInt f = new C();''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_invalidAssignment_implicitlyImplementFunctionViaCall_3() async {
+    // 18341
+    //
+    // Like 'test_invalidAssignment_implicitlyImplementFunctionViaCall_2()',
+    // but uses type 'Function' instead of more precise type 'IntToInt' for 'f'.
+    Source source = addSource(r'''
+class I {
+  int call(int x) => 0;
+}
+class C implements I {
+  noSuchMethod(_) => null;
+}
+typedef int IntToInt(int x);
+Function f = new C();''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_invalidAssignment_implicitlyImplementFunctionViaCall_4() async {
+    // 18341
+    //
+    // Like 'test_invalidAssignment_implicitlyImplementFunctionViaCall_2()',
+    // but uses type 'VoidToInt' instead of more precise type 'IntToInt' for
+    // 'f'.
+    //
+    // Here 'C <: IntToInt <: VoidToInt', but the spec gives no transitivity
+    // rule for '<:'. However, many of the :/tools/test.py tests assume this
+    // transitivity for 'JsBuilder' objects, assigning them to
+    // '(String) -> dynamic'. The declared type of 'JsBuilder.call' is
+    // '(String, [dynamic]) -> Expression'.
+    Source source = addSource(r'''
+class I {
+  int call([int x]) => 0;
+}
+class C implements I {
+  noSuchMethod(_) => null;
+}
+typedef int VoidToInt();
+VoidToInt f = new C();''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_invalidAssignment_postfixExpression_localVariable() async {
+    Source source = addSource(r'''
+class A {
+  A operator+(_) => this;
+}
+
+f(A a) {
+  a++;
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_invalidAssignment_postfixExpression_property() async {
+    Source source = addSource(r'''
+class A {
+  A operator+(_) => this;
+}
+
+class C {
+  A a;
+}
+
+f(C c) {
+  c.a++;
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_invalidAssignment_prefixExpression_localVariable() async {
+    Source source = addSource(r'''
+class A {
+  A operator+(_) => this;
+}
+
+f(A a) {
+  ++a;
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_invalidAssignment_prefixExpression_property() async {
+    Source source = addSource(r'''
+class A {
+  A operator+(_) => this;
+}
+
+class C {
+  A a;
+}
+
+f(C c) {
+  ++c.a;
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_invalidAssignment_toDynamic() async {
+    Source source = addSource(r'''
+f() {
+  var g;
+  g = () => 0;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_invalidFactoryNameNotAClass() async {
+    Source source = addSource(r'''
+class A {
+  factory A() => null;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_invalidIdentifierInAsync() async {
+    Source source = addSource(r'''
+class A {
+  m() {
+    int async;
+    int await;
+    int yield;
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_invalidMethodOverrideNamedParamType() async {
+    Source source = addSource(r'''
+class A {
+  m({int a}) {}
+}
+class B implements A {
+  m({int a, int b}) {}
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_invalidOverrideDifferentDefaultValues_named() async {
+    Source source = addSource(r'''
+class A {
+  m({int p : 0}) {}
+}
+class B extends A {
+  m({int p : 0}) {}
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_invalidOverrideDifferentDefaultValues_named_function() async {
+    Source source = addSource(r'''
+nothing() => 'nothing';
+class A {
+  thing(String a, {orElse : nothing}) {}
+}
+class B extends A {
+  thing(String a, {orElse : nothing}) {}
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_invalidOverrideDifferentDefaultValues_positional() async {
+    Source source = addSource(r'''
+class A {
+  m([int p = 0]) {}
+}
+class B extends A {
+  m([int p = 0]) {}
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_invalidOverrideDifferentDefaultValues_positional_changedOrder() async {
+    Source source = addSource(r'''
+class A {
+  m([int a = 0, String b = '0']) {}
+}
+class B extends A {
+  m([int b = 0, String a = '0']) {}
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_invalidOverrideDifferentDefaultValues_positional_function() async {
+    Source source = addSource(r'''
+nothing() => 'nothing';
+class A {
+  thing(String a, [orElse = nothing]) {}
+}
+class B extends A {
+  thing(String a, [orElse = nothing]) {}
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_invalidOverrideNamed_unorderedNamedParameter() async {
+    Source source = addSource(r'''
+class A {
+  m({a, b}) {}
+}
+class B extends A {
+  m({b, a}) {}
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_invalidOverrideRequired_less() async {
+    Source source = addSource(r'''
+class A {
+  m(a, b) {}
+}
+class B extends A {
+  m(a, [b]) {}
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_invalidOverrideRequired_same() async {
+    Source source = addSource(r'''
+class A {
+  m(a) {}
+}
+class B extends A {
+  m(a) {}
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_invalidOverrideReturnType_returnType_interface() async {
+    Source source = addNamedSource("/test.dart", r'''
+abstract class A {
+  num m();
+}
+class B implements A {
+  int m() { return 1; }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_invalidOverrideReturnType_returnType_interface2() async {
+    Source source = addNamedSource("/test.dart", r'''
+abstract class A {
+  num m();
+}
+abstract class B implements A {
+}
+class C implements B {
+  int m() { return 1; }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_invalidOverrideReturnType_returnType_mixin() async {
+    Source source = addNamedSource("/test.dart", r'''
+class A {
+  num m() { return 0; }
+}
+class B extends Object with A {
+  int m() { return 1; }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_invalidOverrideReturnType_returnType_parameterizedTypes() async {
+    Source source = addSource(r'''
+abstract class A<E> {
+  List<E> m();
+}
+class B extends A<dynamic> {
+  List<dynamic> m() { return new List<dynamic>(); }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_invalidOverrideReturnType_returnType_sameType() async {
+    Source source = addNamedSource("/test.dart", r'''
+class A {
+  int m() { return 0; }
+}
+class B extends A {
+  int m() { return 1; }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_invalidOverrideReturnType_returnType_superclass() async {
+    Source source = addNamedSource("/test.dart", r'''
+class A {
+  num m() { return 0; }
+}
+class B extends A {
+  int m() { return 1; }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_invalidOverrideReturnType_returnType_superclass2() async {
+    Source source = addNamedSource("/test.dart", r'''
+class A {
+  num m() { return 0; }
+}
+class B extends A {
+}
+class C extends B {
+  int m() { return 1; }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_invalidOverrideReturnType_returnType_void() async {
+    Source source = addSource(r'''
+class A {
+  void m() {}
+}
+class B extends A {
+  int m() { return 0; }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_invalidReferenceToThis_constructor() async {
+    Source source = addSource(r'''
+class A {
+  A() {
+    var v = this;
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_invalidReferenceToThis_instanceMethod() async {
+    Source source = addSource(r'''
+class A {
+  m() {
+    var v = this;
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_invalidTypeArgumentForKey() async {
+    Source source = addSource(r'''
+class A {
+  m() {
+    return const <int, int>{};
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_invalidTypeArgumentInConstList() async {
+    Source source = addSource(r'''
+class A<E> {
+  m() {
+    return <E>[];
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_invalidTypeArgumentInConstMap() async {
+    Source source = addSource(r'''
+class A<E> {
+  m() {
+    return <String, E>{};
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  Future test_issue32114() async {
+    addNamedSource('/a.dart', '''
+class O {}
+
+typedef T Func<T extends O>(T e);
+''');
+    addNamedSource('/b.dart', '''
+import 'a.dart';
+export 'a.dart' show Func;
+
+abstract class A<T extends O> {
+  Func<T> get func;
+}
+''');
+    final Source source = addSource('''
+import 'b.dart';
+
+class B extends A {
+  Func get func => (x) => x;
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_issue_24191() async {
+    Source source = addSource('''
+import 'dart:async';
+
+abstract class S extends Stream {}
+f(S s) async {
+  await for (var v in s) {
+    print(v);
+  }
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_issue_32394() async {
+    Source source = addSource('''
+var x = y.map((a) => a.toString());
+var y = [3];
+var z = x.toList();
+
+void main() {
+  String p = z;
+}
+''');
+    var result = await computeAnalysisResult(source);
+    var z = result.unit.declaredElement.topLevelVariables
+        .where((e) => e.name == 'z')
+        .single;
+    expect(z.type.toString(), 'List<String>');
+    assertErrors(source, [StaticTypeWarningCode.INVALID_ASSIGNMENT]);
+    verify([source]);
+  }
+
+  test_issue_35320_lists() async {
+    addNamedSource('/lib.dart', '''
+const x = const <String>['a'];
+''');
+    Source source = addSource('''
+import 'lib.dart';
+const y = const <String>['b'];
+int f(v) {
+  switch(v) {
+    case x:
+      return 0;
+    case y:
+      return 1;
+    default:
+      return 2;
+  }
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_issue_35320_maps() async {
+    addNamedSource('/lib.dart', '''
+const x = const <String, String>{'a': 'b'};
+''');
+    Source source = addSource('''
+import 'lib.dart';
+const y = const <String, String>{'c': 'd'};
+int f(v) {
+  switch(v) {
+    case x:
+      return 0;
+    case y:
+      return 1;
+    default:
+      return 2;
+  }
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_listElementTypeNotAssignable() async {
+    Source source = addSource(r'''
+var v1 = <int> [42];
+var v2 = const <int> [42];''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_loadLibraryDefined() async {
+    await resolveWithErrors(<String>[
+      r'''
+library lib1;
+foo() => 22;''',
+      r'''
+import 'lib1.dart' deferred as other;
+main() {
+  other.loadLibrary().then((_) => other.foo());
+}'''
+    ], <ErrorCode>[]);
+  }
+
+  test_local_generator_async() async {
+    Source source = addSource('''
+f() {
+  return () async* { yield 0; };
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_local_generator_sync() async {
+    Source source = addSource('''
+f() {
+  return () sync* { yield 0; };
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_mapKeyTypeNotAssignable() async {
+    Source source = addSource("var v = <String, int > {'a' : 1};");
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_metadata_enumConstantDeclaration() async {
+    Source source = addSource(r'''
+const x = 1;
+enum E {
+  aaa,
+  @x
+  bbb
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_methodDeclaration_scope_signature() async {
+    Source source = addSource(r'''
+const app = 0;
+class A {
+  foo(@app int app) {}
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_misMatchedGetterAndSetterTypes_instance_sameTypes() async {
+    Source source = addSource(r'''
+class C {
+  int get x => 0;
+  set x(int v) {}
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_misMatchedGetterAndSetterTypes_instance_unspecifiedGetter() async {
+    Source source = addSource(r'''
+class C {
+  get x => 0;
+  set x(String v) {}
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_misMatchedGetterAndSetterTypes_instance_unspecifiedSetter() async {
+    Source source = addSource(r'''
+class C {
+  int get x => 0;
+  set x(v) {}
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_misMatchedGetterAndSetterTypes_topLevel_sameTypes() async {
+    Source source = addSource(r'''
+int get x => 0;
+set x(int v) {}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_misMatchedGetterAndSetterTypes_topLevel_unspecifiedGetter() async {
+    Source source = addSource(r'''
+get x => 0;
+set x(String v) {}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_misMatchedGetterAndSetterTypes_topLevel_unspecifiedSetter() async {
+    Source source = addSource(r'''
+int get x => 0;
+set x(v) {}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_missingEnumConstantInSwitch_all() async {
+    Source source = addSource(r'''
+enum E { A, B, C }
+
+f(E e) {
+  switch (e) {
+    case E.A: break;
+    case E.B: break;
+    case E.C: break;
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_missingEnumConstantInSwitch_default() async {
+    Source source = addSource(r'''
+enum E { A, B, C }
+
+f(E e) {
+  switch (e) {
+    case E.B: break;
+    default: break;
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_mixedReturnTypes_differentScopes() async {
+    Source source = addSource(r'''
+class C {
+  m(int x) {
+    f(int y) {
+      return;
+    }
+    f(x);
+    return 0;
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_mixedReturnTypes_ignoreImplicit() async {
+    Source source = addSource(r'''
+f(bool p) {
+  if (p) return 42;
+  // implicit 'return;' is ignored
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_mixedReturnTypes_ignoreImplicit2() async {
+    Source source = addSource(r'''
+f(bool p) {
+  if (p) {
+    return 42;
+  } else {
+    return 42;
+  }
+  // implicit 'return;' is ignored
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_mixedReturnTypes_sameKind() async {
+    Source source = addSource(r'''
+class C {
+  m(int x) {
+    if (x < 0) {
+      return 1;
+    }
+    return 0;
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_mixin_of_mixin_type_argument_inference() async {
+    // In the code below, B's superclass constraints don't include A, because
+    // superclass constraints are determined from the mixin's superclass, and
+    // B's superclass is Object.  So no mixin type inference is attempted, and
+    // "with B" is interpreted as "with B<dynamic>".
+    Source source = addSource('''
+class A<T> {}
+class B<T> = Object with A<T>;
+class C = Object with B;
+''');
+    var result = await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+    var bReference = result.unit.declaredElement.getType('C').mixins[0];
+    expect(bReference.typeArguments[0].toString(), 'dynamic');
+  }
+
+  test_mixin_of_mixin_type_argument_inference_cascaded_mixin() async {
+    // In the code below, B has a single superclass constraint, A1, because
+    // superclass constraints are determined from the mixin's superclass, and
+    // B's superclass is "Object with A1<T>".  So mixin type inference succeeds
+    // (since C's base class implements A1<int>), and "with B" is interpreted as
+    // "with B<int>".
+    Source source = addSource('''
+class A1<T> {}
+class A2<T> {}
+class B<T> = Object with A1<T>, A2<T>;
+class Base implements A1<int> {}
+class C = Base with B;
+''');
+    var result = await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+    var bReference = result.unit.declaredElement.getType('C').mixins[0];
+    expect(bReference.typeArguments[0].toString(), 'int');
+  }
+
+  test_mixinDeclaresConstructor() async {
+    Source source = addSource(r'''
+class A {
+  m() {}
+}
+class B extends Object with A {}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_mixinDeclaresConstructor_factory() async {
+    Source source = addSource(r'''
+class A {
+  factory A() => null;
+}
+class B extends Object with A {}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_mixinInference_with_actual_mixins() async {
+    Source source = addSource('''
+class I<X> {}
+
+mixin M0<T> on I<T> {}
+
+mixin M1<T> on I<T> {
+  T foo() => null;
+}
+
+class A = I<int> with M0, M1;
+
+void main () {
+  var x = new A().foo();
+}
+''');
+    var result = await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+    var main = result.unit.declarations.last as FunctionDeclaration;
+    var mainBody = main.functionExpression.body as BlockFunctionBody;
+    var xDecl = mainBody.block.statements[0] as VariableDeclarationStatement;
+    var xElem = xDecl.variables.variables[0].declaredElement;
+    expect(xElem.type.toString(), 'int');
+  }
+
+  test_mixinInheritsFromNotObject_classDeclaration_extends_new_syntax() async {
+    Source source = addSource(r'''
+class A {}
+mixin B on A {}
+class C extends A with B {}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_mixinInheritsFromNotObject_classDeclaration_mixTypeAlias() async {
+    Source source = addSource(r'''
+class A {}
+class B = Object with A;
+class C extends Object with B {}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_mixinInheritsFromNotObject_typeAlias_extends_new_syntax() async {
+    Source source = addSource(r'''
+class A {}
+mixin B on A {}
+class C = A with B;''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_mixinInheritsFromNotObject_typedef_mixTypeAlias() async {
+    Source source = addSource(r'''
+class A {}
+class B = Object with A;
+class C = Object with B;''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_mixinReferencesSuper_new_syntax() async {
+    Source source = addSource(r'''
+mixin A {
+  toString() => super.toString();
+}
+class B extends Object with A {}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_multipleSuperInitializers_no() async {
+    Source source = addSource(r'''
+class A {}
+class B extends A {
+  B() {}
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_multipleSuperInitializers_single() async {
+    Source source = addSource(r'''
+class A {}
+class B extends A {
+  B() : super() {}
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nativeConstConstructor() async {
+    Source source = addSource(r'''
+import 'dart-ext:x';
+class Foo {
+  const Foo() native 'Foo_Foo';
+  const factory Foo.foo() native 'Foo_Foo_foo';
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [ParserErrorCode.CONST_CONSTRUCTOR_WITH_BODY]);
+    // Cannot verify the AST because the import's URI cannot be resolved.
+  }
+
+  test_nativeFunctionBodyInNonSDKCode_function() async {
+    Source source = addSource(r'''
+import 'dart-ext:x';
+int m(a) native 'string';''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    // Cannot verify the AST because the import's URI cannot be resolved.
+  }
+
+  test_newWithAbstractClass_factory() async {
+    Source source = addSource(r'''
+abstract class A {
+  factory A() { return new B(); }
+}
+class B implements A {
+  B() {}
+}
+A f() {
+  return new A();
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_newWithUndefinedConstructor() async {
+    Source source = addSource(r'''
+class A {
+  A.name() {}
+}
+f() {
+  new A.name();
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_newWithUndefinedConstructorDefault() async {
+    Source source = addSource(r'''
+class A {
+  A() {}
+}
+f() {
+  new A();
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nonAbstractClassInheritsAbstractMemberOne_abstractsDontOverrideConcretes_getter() async {
+    Source source = addSource(r'''
+class A {
+  int get g => 0;
+}
+abstract class B extends A {
+  int get g;
+}
+class C extends B {}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nonAbstractClassInheritsAbstractMemberOne_abstractsDontOverrideConcretes_method() async {
+    Source source = addSource(r'''
+class A {
+  m(p) {}
+}
+abstract class B extends A {
+  m(p);
+}
+class C extends B {}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nonAbstractClassInheritsAbstractMemberOne_abstractsDontOverrideConcretes_setter() async {
+    Source source = addSource(r'''
+class A {
+  set s(v) {}
+}
+abstract class B extends A {
+  set s(v);
+}
+class C extends B {}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nonAbstractClassInheritsAbstractMemberOne_classTypeAlias_interface() async {
+    // 15979
+    Source source = addSource(r'''
+abstract class M {}
+abstract class A {}
+abstract class I {
+  m();
+}
+abstract class B = A with M implements I;''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nonAbstractClassInheritsAbstractMemberOne_classTypeAlias_mixin() async {
+    // 15979
+    Source source = addSource(r'''
+abstract class M {
+  m();
+}
+abstract class A {}
+abstract class B = A with M;''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nonAbstractClassInheritsAbstractMemberOne_classTypeAlias_superclass() async {
+    // 15979
+    Source source = addSource(r'''
+class M {}
+abstract class A {
+  m();
+}
+abstract class B = A with M;''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nonAbstractClassInheritsAbstractMemberOne_mixin_getter() async {
+    // 17034
+    Source source = addSource(r'''
+class A {
+  var a;
+}
+abstract class M {
+  get a;
+}
+class B extends A with M {}
+class C extends B {}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nonAbstractClassInheritsAbstractMemberOne_mixin_method() async {
+    Source source = addSource(r'''
+class A {
+  m() {}
+}
+abstract class M {
+  m();
+}
+class B extends A with M {}
+class C extends B {}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nonAbstractClassInheritsAbstractMemberOne_mixin_setter() async {
+    Source source = addSource(r'''
+class A {
+  var a;
+}
+abstract class M {
+  set a(dynamic v);
+}
+class B extends A with M {}
+class C extends B {}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nonAbstractClassInheritsAbstractMemberOne_noSuchMethod_accessor() async {
+    Source source = addSource(r'''
+abstract class A {
+  int get g;
+}
+class B extends A {
+  noSuchMethod(v) => '';
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nonAbstractClassInheritsAbstractMemberOne_noSuchMethod_method() async {
+    Source source = addSource(r'''
+abstract class A {
+  m(p);
+}
+class B extends A {
+  noSuchMethod(v) => '';
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nonAbstractClassInheritsAbstractMemberOne_noSuchMethod_mixin() async {
+    Source source = addSource(r'''
+class A {
+  noSuchMethod(v) => '';
+}
+class B extends Object with A {
+  m(p);
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nonAbstractClassInheritsAbstractMemberOne_noSuchMethod_superclass() async {
+    Source source = addSource(r'''
+class A {
+  noSuchMethod(v) => '';
+}
+class B extends A {
+  m(p);
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nonAbstractClassInheritsAbstractMemberOne_overridesMethodInObject() async {
+    Source source = addSource(r'''
+class A {
+  String toString([String prefix = '']) => '${prefix}Hello';
+}
+class C {}
+class B extends A with C {}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nonBoolExpression_interfaceType() async {
+    Source source = addSource(r'''
+f() {
+  assert(true);
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nonBoolNegationExpression() async {
+    Source source = addSource(r'''
+f(bool pb, pd) {
+  !true;
+  !false;
+  !pb;
+  !pd;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nonBoolNegationExpression_dynamic() async {
+    Source source = addSource(r'''
+f1(bool dynamic) {
+  !dynamic;
+}
+f2() {
+  bool dynamic = true;
+  !dynamic;
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nonBoolOperand_and_bool() async {
+    Source source = addSource(r'''
+bool f(bool left, bool right) {
+  return left && right;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nonBoolOperand_and_dynamic() async {
+    Source source = addSource(r'''
+bool f(left, dynamic right) {
+  return left && right;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nonBoolOperand_or_bool() async {
+    Source source = addSource(r'''
+bool f(bool left, bool right) {
+  return left || right;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nonBoolOperand_or_dynamic() async {
+    Source source = addSource(r'''
+bool f(dynamic left, right) {
+  return left || right;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nonConstantDefaultValue_constField() async {
+    Source source = addSource(r'''
+f([a = double.INFINITY]) {
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nonConstantDefaultValue_function_named() async {
+    Source source = addSource("f({x : 2 + 3}) {}");
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nonConstantDefaultValue_function_positional() async {
+    Source source = addSource("f([x = 2 + 3]) {}");
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nonConstantDefaultValue_inConstructor_named() async {
+    Source source = addSource(r'''
+class A {
+  A({x : 2 + 3}) {}
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nonConstantDefaultValue_inConstructor_positional() async {
+    Source source = addSource(r'''
+class A {
+  A([x = 2 + 3]) {}
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nonConstantDefaultValue_method_named() async {
+    Source source = addSource(r'''
+class A {
+  m({x : 2 + 3}) {}
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nonConstantDefaultValue_method_positional() async {
+    Source source = addSource(r'''
+class A {
+  m([x = 2 + 3]) {}
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nonConstantDefaultValue_typedConstList() async {
+    Source source = addSource(r'''
+class A {
+  m([p111 = const <String>[]]) {}
+}
+class B extends A {
+  m([p222 = const <String>[]]) {}
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nonConstantValueInInitializer_namedArgument() async {
+    Source source = addSource(r'''
+class A {
+  final a;
+  const A({this.a});
+}
+class B extends A {
+  const B({b}) : super(a: b);
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nonConstCaseExpression_constField() async {
+    Source source = addSource(r'''
+f(double p) {
+  switch (p) {
+    case double.INFINITY:
+      return true;
+    default:
+      return false;
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [CompileTimeErrorCode.CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS]);
+    verify([source]);
+  }
+
+  test_nonConstCaseExpression_typeLiteral() async {
+    Source source = addSource(r'''
+f(Type t) {
+  switch (t) {
+    case bool:
+    case int:
+      return true;
+    default:
+      return false;
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nonConstListElement_constField() async {
+    Source source = addSource(r'''
+main() {
+  const [double.INFINITY];
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nonConstMapAsExpressionStatement_const() async {
+    Source source = addSource(r'''
+f() {
+  const {'a' : 0, 'b' : 1};
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nonConstMapAsExpressionStatement_notExpressionStatement() async {
+    Source source = addSource(r'''
+f() {
+  var m = {'a' : 0, 'b' : 1};
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nonConstMapAsExpressionStatement_typeArguments() async {
+    Source source = addSource(r'''
+f() {
+  <String, int> {'a' : 0, 'b' : 1};
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nonConstMapKey_constField() async {
+    Source source = addSource(r'''
+main() {
+  const {double.INFINITY: 0};
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source,
+        [CompileTimeErrorCode.CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQUALS]);
+    verify([source]);
+  }
+
+  test_nonConstMapValue_constField() async {
+    Source source = addSource(r'''
+main() {
+  const {0: double.INFINITY};
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nonConstValueInInitializer_binary_bool() async {
+    Source source = addSource(r'''
+class A {
+  final v;
+  const A.a1(bool p) : v = p && true;
+  const A.a2(bool p) : v = true && p;
+  const A.b1(bool p) : v = p || true;
+  const A.b2(bool p) : v = true || p;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [HintCode.DEAD_CODE]);
+    verify([source]);
+  }
+
+  test_nonConstValueInInitializer_binary_dynamic() async {
+    Source source = addSource(r'''
+class A {
+  final v;
+  const A.a1(p) : v = p + 5;
+  const A.a2(p) : v = 5 + p;
+  const A.b1(p) : v = p - 5;
+  const A.b2(p) : v = 5 - p;
+  const A.c1(p) : v = p * 5;
+  const A.c2(p) : v = 5 * p;
+  const A.d1(p) : v = p / 5;
+  const A.d2(p) : v = 5 / p;
+  const A.e1(p) : v = p ~/ 5;
+  const A.e2(p) : v = 5 ~/ p;
+  const A.f1(p) : v = p > 5;
+  const A.f2(p) : v = 5 > p;
+  const A.g1(p) : v = p < 5;
+  const A.g2(p) : v = 5 < p;
+  const A.h1(p) : v = p >= 5;
+  const A.h2(p) : v = 5 >= p;
+  const A.i1(p) : v = p <= 5;
+  const A.i2(p) : v = 5 <= p;
+  const A.j1(p) : v = p % 5;
+  const A.j2(p) : v = 5 % p;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    // operations on "p" are not resolved
+  }
+
+  test_nonConstValueInInitializer_binary_int() async {
+    Source source = addSource(r'''
+class A {
+  final v;
+  const A.a1(int p) : v = p ^ 5;
+  const A.a2(int p) : v = 5 ^ p;
+  const A.b1(int p) : v = p & 5;
+  const A.b2(int p) : v = 5 & p;
+  const A.c1(int p) : v = p | 5;
+  const A.c2(int p) : v = 5 | p;
+  const A.d1(int p) : v = p >> 5;
+  const A.d2(int p) : v = 5 >> p;
+  const A.e1(int p) : v = p << 5;
+  const A.e2(int p) : v = 5 << p;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nonConstValueInInitializer_binary_num() async {
+    Source source = addSource(r'''
+class A {
+  final v;
+  const A.a1(num p) : v = p + 5;
+  const A.a2(num p) : v = 5 + p;
+  const A.b1(num p) : v = p - 5;
+  const A.b2(num p) : v = 5 - p;
+  const A.c1(num p) : v = p * 5;
+  const A.c2(num p) : v = 5 * p;
+  const A.d1(num p) : v = p / 5;
+  const A.d2(num p) : v = 5 / p;
+  const A.e1(num p) : v = p ~/ 5;
+  const A.e2(num p) : v = 5 ~/ p;
+  const A.f1(num p) : v = p > 5;
+  const A.f2(num p) : v = 5 > p;
+  const A.g1(num p) : v = p < 5;
+  const A.g2(num p) : v = 5 < p;
+  const A.h1(num p) : v = p >= 5;
+  const A.h2(num p) : v = 5 >= p;
+  const A.i1(num p) : v = p <= 5;
+  const A.i2(num p) : v = 5 <= p;
+  const A.j1(num p) : v = p % 5;
+  const A.j2(num p) : v = 5 % p;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nonConstValueInInitializer_field() async {
+    Source source = addSource(r'''
+class A {
+  final int a;
+  const A() : a = 5;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nonConstValueInInitializer_redirecting() async {
+    Source source = addSource(r'''
+class A {
+  const A.named(p);
+  const A() : this.named(42);
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nonConstValueInInitializer_super() async {
+    Source source = addSource(r'''
+class A {
+  const A(p);
+}
+class B extends A {
+  const B() : super(42);
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nonConstValueInInitializer_unary() async {
+    Source source = addSource(r'''
+class A {
+  final v;
+  const A.a(bool p) : v = !p;
+  const A.b(int p) : v = ~p;
+  const A.c(num p) : v = -p;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nonGenerativeConstructor() async {
+    Source source = addSource(r'''
+class A {
+  A.named() {}
+  factory A() => null;
+}
+class B extends A {
+  B() : super.named();
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nonTypeInCatchClause_isClass() async {
+    Source source = addSource(r'''
+f() {
+  try {
+  } on String catch (e) {
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nonTypeInCatchClause_isFunctionTypeAlias() async {
+    Source source = addSource(r'''
+typedef F();
+f() {
+  try {
+  } on F catch (e) {
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nonTypeInCatchClause_isTypeParameter() async {
+    Source source = addSource(r'''
+class A<T> {
+  f() {
+    try {
+    } on T catch (e) {
+    }
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nonTypeInCatchClause_noType() async {
+    Source source = addSource(r'''
+f() {
+  try {
+  } catch (e) {
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nonVoidReturnForOperator_no() async {
+    Source source = addSource(r'''
+class A {
+  operator []=(a, b) {}
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nonVoidReturnForOperator_void() async {
+    Source source = addSource(r'''
+class A {
+  void operator []=(a, b) {}
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nonVoidReturnForSetter_function_no() async {
+    Source source = addSource("set x(v) {}");
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nonVoidReturnForSetter_function_void() async {
+    Source source = addSource("void set x(v) {}");
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nonVoidReturnForSetter_method_no() async {
+    Source source = addSource(r'''
+class A {
+  set x(v) {}
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nonVoidReturnForSetter_method_void() async {
+    Source source = addSource(r'''
+class A {
+  void set x(v) {}
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_null_callOperator() async {
+    Source source = addSource(r'''
+main() {
+  null + 5;
+  null == 5;
+  null[0];
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      StaticTypeWarningCode.UNDEFINED_METHOD,
+      StaticTypeWarningCode.UNDEFINED_METHOD
+    ]);
+  }
+
+  test_optionalNew_rewrite() async {
+    resetWith(options: new AnalysisOptionsImpl());
+    Source source = addSource(r'''
+import 'b.dart';
+main() {
+  const B.named1();
+  const B.named2();
+  const B.named3();
+  const B.named4();
+}
+''');
+    addNamedSource("/a.dart", r'''
+class A {
+  const A();
+  const A.named();
+}
+''');
+    addNamedSource("/b.dart", r'''
+import 'a.dart';
+import 'a.dart' as p;
+
+const _a1 = A();
+const _a2 = A.named();
+const _a3 = p.A();
+const _a4 = p.A.named();
+
+class B {
+  const B.named1({this.a: _a1}) : assert(a != null);
+  const B.named2({this.a: _a2}) : assert(a != null);
+  const B.named3({this.a: _a3}) : assert(a != null);
+  const B.named4({this.a: _a4}) : assert(a != null);
+
+  final A a;
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_optionalNew_rewrite_instantiatesToBounds() async {
+    resetWith(options: new AnalysisOptionsImpl());
+    Source source = addSource(r'''
+import 'b.dart';
+
+@B.named1()
+@B.named2()
+@B.named3()
+@B.named4()
+@B.named5()
+@B.named6()
+@B.named7()
+@B.named8()
+main() {}
+''');
+    addNamedSource("/a.dart", r'''
+class Unbounded<T> {
+  const Unbounded();
+  const Unbounded.named();
+}
+class Bounded<T extends String> {
+  const Bounded();
+  const Bounded.named();
+}
+''');
+    addNamedSource("/b.dart", r'''
+import 'a.dart';
+import 'a.dart' as p;
+
+const unbounded1 = Unbounded();
+const unbounded2 = Unbounded.named();
+const unbounded3 = p.Unbounded();
+const unbounded4 = p.Unbounded.named();
+const bounded1 = Bounded();
+const bounded2 = Bounded.named();
+const bounded3 = p.Bounded();
+const bounded4 = p.Bounded.named();
+
+class B {
+  const B.named1({this.unbounded: unbounded1}) : bounded = null;
+  const B.named2({this.unbounded: unbounded2}) : bounded = null;
+  const B.named3({this.unbounded: unbounded3}) : bounded = null;
+  const B.named4({this.unbounded: unbounded4}) : bounded = null;
+  const B.named5({this.bounded: bounded1}) : unbounded = null;
+  const B.named6({this.bounded: bounded2}) : unbounded = null;
+  const B.named7({this.bounded: bounded3}) : unbounded = null;
+  const B.named8({this.bounded: bounded4}) : unbounded = null;
+
+  final Unbounded unbounded;
+  final Bounded bounded;
+}
+''');
+    final result = await computeAnalysisResult(source);
+    expect(result.unit.declarations, hasLength(1));
+    final mainDecl = result.unit.declarations[0];
+    expect(mainDecl.metadata, hasLength(8));
+    mainDecl.metadata.forEach((metadata) {
+      final value = metadata.elementAnnotation.computeConstantValue();
+      expect(value, isNotNull);
+      expect(value.type.toString(), 'B');
+      final unbounded = value.getField('unbounded');
+      final bounded = value.getField('bounded');
+      if (!unbounded.isNull) {
+        expect(bounded.isNull, true);
+        expect(unbounded.type.name, 'Unbounded');
+        expect(unbounded.type.typeArguments, hasLength(1));
+        expect(unbounded.type.typeArguments[0].isDynamic, isTrue);
+      } else {
+        expect(unbounded.isNull, true);
+        expect(bounded.type.name, 'Bounded');
+        expect(bounded.type.typeArguments, hasLength(1));
+        expect(bounded.type.typeArguments[0].name, 'String');
+      }
+    });
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_optionalParameterInOperator_required() async {
+    Source source = addSource(r'''
+class A {
+  operator +(p) {}
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_parameterScope_local() async {
+    // Parameter names shouldn't conflict with the name of the function they
+    // are enclosed in.
+    Source source = addSource(r'''
+f() {
+  g(g) {
+    h(g);
+  }
+}
+h(x) {}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_parameterScope_method() async {
+    // Parameter names shouldn't conflict with the name of the function they
+    // are enclosed in.
+    Source source = addSource(r'''
+class C {
+  g(g) {
+    h(g);
+  }
+}
+h(x) {}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_parameterScope_topLevel() async {
+    // Parameter names shouldn't conflict with the name of the function they
+    // are enclosed in.
+    Source source = addSource(r'''
+g(g) {
+  h(g);
+}
+h(x) {}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_parametricCallFunction() async {
+    Source source = addSource(r'''
+f() {
+  var c = new C();
+  c<String>().codeUnits;
+}
+
+class C {
+  T call<T>() => null;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_prefixCollidesWithTopLevelMembers() async {
+    addNamedSource("/lib.dart", r'''
+library lib;
+class A {}''');
+    Source source = addSource(r'''
+import 'lib.dart' as p;
+typedef P();
+p2() {}
+var p3;
+class p4 {}
+p.A a;''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_propagateTypeArgs_intoBounds() async {
+    Source source = addSource(r'''
+abstract class A<E> {}
+abstract class B<F> implements A<F>{}
+abstract class C<G, H extends A<G>> {}
+class D<I> extends C<I, B<I>> {}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_propagateTypeArgs_intoSupertype() async {
+    Source source = addSource(r'''
+class A<T> {
+  A(T p);
+  A.named(T p);
+}
+class B<S> extends A<S> {
+  B(S p) : super(p);
+  B.named(S p) : super.named(p);
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_recursiveConstructorRedirect() async {
+    Source source = addSource(r'''
+class A {
+  A.a() : this.b();
+  A.b() : this.c();
+  A.c() {}
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_recursiveFactoryRedirect() async {
+    Source source = addSource(r'''
+class A {
+  factory A() = B;
+}
+class B implements A {
+  factory B() = C;
+}
+class C implements B {
+  factory C() => null;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_redirectToInvalidFunctionType() async {
+    Source source = addSource(r'''
+class A implements B {
+  A(int p) {}
+}
+class B {
+  factory B(int p) = A;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_redirectToNonConstConstructor() async {
+    Source source = addSource(r'''
+class A {
+  const A.a();
+  const factory A.b() = A.a;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_referencedBeforeDeclaration_cascade() async {
+    Source source = addSource(r'''
+testRequestHandler() {}
+
+main() {
+  var s1 = null;
+  testRequestHandler()
+    ..stream(s1);
+  var stream = 123;
+  print(stream);
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_referenceToDeclaredVariableInInitializer_constructorName() async {
+    Source source = addSource(r'''
+class A {
+  A.x() {}
+}
+f() {
+  var x = new A.x();
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_referenceToDeclaredVariableInInitializer_methodName() async {
+    Source source = addSource(r'''
+class A {
+  x() {}
+}
+f(A a) {
+  var x = a.x();
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_referenceToDeclaredVariableInInitializer_propertyName() async {
+    Source source = addSource(r'''
+class A {
+  var x;
+}
+f(A a) {
+  var x = a.x;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_regress34906() async {
+    Source source = addSource(r'''
+typedef G<X, Y extends Function(X)> = X Function(Function(Y));
+G<dynamic, Function(Null)> superBoundedG;
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_rethrowOutsideCatch() async {
+    Source source = addSource(r'''
+class A {
+  void m() {
+    try {} catch (e) {rethrow;}
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_return_in_generator_async() async {
+    Source source = addSource('''
+import 'dart:async';
+Stream<int> f() async* {
+  return;
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_return_in_generator_sync() async {
+    Source source = addSource('''
+Iterable<int> f() sync* {
+  return;
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_returnInGenerativeConstructor() async {
+    Source source = addSource(r'''
+class A {
+  A() { return; }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_returnInGenerator_async() async {
+    Source source = addSource(r'''
+f() async {
+  return 0;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_returnInGenerator_sync() async {
+    Source source = addSource(r'''
+f() {
+  return 0;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_returnOfInvalidType_async() async {
+    Source source = addSource(r'''
+import 'dart:async';
+class A {
+  Future<int> m() async {
+    return 0;
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_returnOfInvalidType_dynamic() async {
+    Source source = addSource(r'''
+class TypeError {}
+class A {
+  static void testLogicalOp() {
+    testOr(a, b, onTypeError) {
+      try {
+        return a || b;
+      } on TypeError catch (t) {
+        return onTypeError;
+      }
+    }
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_returnOfInvalidType_subtype() async {
+    Source source = addSource(r'''
+class A {}
+class B extends A {}
+A f(B b) { return b; }''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_returnOfInvalidType_supertype() async {
+    Source source = addSource(r'''
+class A {}
+class B extends A {}
+B f(A a) { return a; }''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_returnOfInvalidType_typeParameter_18468() async {
+    // https://code.google.com/p/dart/issues/detail?id=18468
+    //
+    // This test verifies that the type of T is more specific than Type,
+    // where T is a type parameter and Type is the type Type from
+    // core, this particular test case comes from issue 18468.
+    //
+    // A test cannot be added to TypeParameterTypeImplTest since the types
+    // returned out of the TestTypeProvider don't have a mock 'dart.core'
+    // enclosing library element.
+    // See TypeParameterTypeImpl.isMoreSpecificThan().
+    Source source = addSource(r'''
+class Foo<T> {
+  Type get t => T;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source);
+    verify([source]);
+  }
+
+  test_returnOfInvalidType_void() async {
+    Source source = addSource(r'''
+void f1() {}
+void f2() { return; }
+void f3() { return null; }
+void f4() { return g1(); }
+void f5() { return g2(); }
+void f6() => throw 42;
+g1() {}
+void g2() {}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_returnWithoutValue_noReturnType() async {
+    Source source = addSource("f() { return; }");
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_returnWithoutValue_void() async {
+    Source source = addSource("void f() { return; }");
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_reversedTypeArguments() async {
+    Source source = addSource(r'''
+class Codec<S1, T1> {
+  Codec<T1, S1> get inverted => new _InvertedCodec<T1, S1>(this);
+}
+class _InvertedCodec<T2, S2> extends Codec<T2, S2> {
+  _InvertedCodec(Codec<S2, T2> codec);
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_sharedDeferredPrefix() async {
+    await resolveWithErrors(<String>[
+      r'''
+library lib1;
+f1() {}''',
+      r'''
+library lib2;
+f2() {}''',
+      r'''
+library lib3;
+f3() {}''',
+      r'''
+library root;
+import 'lib1.dart' deferred as lib1;
+import 'lib2.dart' as lib;
+import 'lib3.dart' as lib;
+main() { lib1.f1(); lib.f2(); lib.f3(); }'''
+    ], <ErrorCode>[]);
+  }
+
+  test_staticAccessToInstanceMember_annotation() async {
+    Source source = addSource(r'''
+class A {
+  const A.name();
+}
+@A.name()
+main() {
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_staticAccessToInstanceMember_method() async {
+    Source source = addSource(r'''
+class A {
+  static m() {}
+}
+main() {
+  A.m;
+  A.m();
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_staticAccessToInstanceMember_propertyAccess_field() async {
+    Source source = addSource(r'''
+class A {
+  static var f;
+}
+main() {
+  A.f;
+  A.f = 1;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_staticAccessToInstanceMember_propertyAccess_propertyAccessor() async {
+    Source source = addSource(r'''
+class A {
+  static get f => 42;
+  static set f(x) {}
+}
+main() {
+  A.f;
+  A.f = 1;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_superInInvalidContext() async {
+    Source source = addSource(r'''
+class A {
+  m() {}
+}
+class B extends A {
+  B() {
+    var v = super.m();
+  }
+  n() {
+    var v = super.m();
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_typeAliasCannotReferenceItself_returnClass_withTypeAlias() async {
+    Source source = addSource(r'''
+typedef B A();
+class B {
+  A a;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_typeArgument_boundToFunctionType() async {
+    Source source = addSource("class A<T extends void Function(T)>{}");
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_typeArgumentNotMatchingBounds_const() async {
+    Source source = addSource(r'''
+class A {}
+class B extends A {}
+class G<E extends A> {
+  const G();
+}
+f() { return const G<B>(); }''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_typeArgumentNotMatchingBounds_new() async {
+    Source source = addSource(r'''
+class A {}
+class B extends A {}
+class G<E extends A> {}
+f() { return new G<B>(); }''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_typeArgumentNotMatchingBounds_ofFunctionTypeAlias_hasBound() async {
+    Source source = addSource(r'''
+class A {}
+class B extends A {}
+typedef F<T extends A>();
+F<A> fa;
+F<B> fb;
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_typeArgumentNotMatchingBounds_ofFunctionTypeAlias_hasBound2() async {
+    Source source = addSource(r'''
+class MyClass<T> {}
+typedef MyFunction<T, P extends MyClass<T>>();
+class A<T, P extends MyClass<T>> {
+  MyFunction<T, P> f;
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_typeArgumentNotMatchingBounds_ofFunctionTypeAlias_noBound() async {
+    Source source = addSource(r'''
+typedef F<T>();
+F<int> f1;
+F<String> f2;
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_typePromotion_booleanAnd_useInRight() async {
+    Source source = addSource(r'''
+main(Object p) {
+  p is String && p.length != 0;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_typePromotion_booleanAnd_useInRight_accessedInClosureRight_noAssignment() async {
+    Source source = addSource(r'''
+callMe(f()) { f(); }
+main(Object p) {
+  (p is String) && callMe(() { p.length; });
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_typePromotion_conditional_issue14655() async {
+    Source source = addSource(r'''
+class A {}
+class B extends A {}
+class C extends B {
+  mc() {}
+}
+print(_) {}
+main(A p) {
+  (p is C) && (print(() => p) && (p is B)) ? p.mc() : p = null;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_typePromotion_conditional_useInThen() async {
+    Source source = addSource(r'''
+main(Object p) {
+  p is String ? p.length : 0;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_typePromotion_conditional_useInThen_accessedInClosure_noAssignment() async {
+    Source source = addSource(r'''
+callMe(f()) { f(); }
+main(Object p) {
+  p is String ? callMe(() { p.length; }) : 0;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_typePromotion_functionType_arg_ignoreIfNotMoreSpecific() async {
+    Source source = addSource(r'''
+typedef FuncB(B b);
+typedef FuncA(A a);
+class A {}
+class B {}
+main(FuncA f) {
+  if (f is FuncB) {
+    f(new A());
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_typePromotion_functionType_return_ignoreIfNotMoreSpecific() async {
+    Source source = addSource(r'''
+class A {}
+typedef FuncAtoDyn(A a);
+typedef FuncDynToDyn(x);
+main(FuncAtoDyn f) {
+  if (f is FuncDynToDyn) {
+    A a = f(new A());
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_typePromotion_functionType_return_voidToDynamic() async {
+    Source source = addSource(r'''
+typedef FuncDynToDyn(x);
+typedef void FuncDynToVoid(x);
+class A {}
+main(FuncDynToVoid f) {
+  if (f is FuncDynToDyn) {
+    A a = f(null);
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_typePromotion_if_accessedInClosure_noAssignment() async {
+    Source source = addSource(r'''
+callMe(f()) { f(); }
+main(Object p) {
+  if (p is String) {
+    callMe(() {
+      p.length;
+    });
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_typePromotion_if_extends_moreSpecific() async {
+    Source source = addSource(r'''
+class V {}
+class VP extends V {}
+class A<T> {}
+class B<S> extends A<S> {
+  var b;
+}
+
+main(A<V> p) {
+  if (p is B<VP>) {
+    p.b;
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_typePromotion_if_hasAssignment_outsideAfter() async {
+    Source source = addSource(r'''
+main(Object p) {
+  if (p is String) {
+    p.length;
+  }
+  p = 0;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_typePromotion_if_hasAssignment_outsideBefore() async {
+    Source source = addSource(r'''
+main(Object p, Object p2) {
+  p = p2;
+  if (p is String) {
+    p.length;
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_typePromotion_if_implements_moreSpecific() async {
+    Source source = addSource(r'''
+class V {}
+class VP extends V {}
+class A<T> {}
+class B<S> implements A<S> {
+  var b;
+}
+
+main(A<V> p) {
+  if (p is B<VP>) {
+    p.b;
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_typePromotion_if_inClosure_assignedAfter_inSameFunction() async {
+    Source source = addSource(r'''
+main() {
+  f(Object p) {
+    if (p is String) {
+      p.length;
+    }
+    p = 0;
+  };
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_typePromotion_if_is_and_left() async {
+    Source source = addSource(r'''
+bool tt() => true;
+main(Object p) {
+  if (p is String && tt()) {
+    p.length;
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_typePromotion_if_is_and_right() async {
+    Source source = addSource(r'''
+bool tt() => true;
+main(Object p) {
+  if (tt() && p is String) {
+    p.length;
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_typePromotion_if_is_and_subThenSuper() async {
+    Source source = addSource(r'''
+class A {
+  var a;
+}
+class B extends A {
+  var b;
+}
+main(Object p) {
+  if (p is B && p is A) {
+    p.a;
+    p.b;
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_typePromotion_if_is_parenthesized() async {
+    Source source = addSource(r'''
+main(Object p) {
+  if ((p is String)) {
+    p.length;
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_typePromotion_if_is_single() async {
+    Source source = addSource(r'''
+main(Object p) {
+  if (p is String) {
+    p.length;
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_typePromotion_parentheses() async {
+    Source source = addSource(r'''
+main(Object p) {
+  (p is String) ? p.length : 0;
+  (p) is String ? p.length : 0;
+  ((p)) is String ? p.length : 0;
+  ((p) is String) ? p.length : 0;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_typeType_class() async {
+    Source source = addSource(r'''
+class C {}
+f(Type t) {}
+main() {
+  f(C);
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_typeType_class_prefixed() async {
+    addNamedSource("/lib.dart", r'''
+library lib;
+class C {}''');
+    Source source = addSource(r'''
+import 'lib.dart' as p;
+f(Type t) {}
+main() {
+  f(p.C);
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_typeType_functionTypeAlias() async {
+    Source source = addSource(r'''
+typedef F();
+f(Type t) {}
+main() {
+  f(F);
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_typeType_functionTypeAlias_prefixed() async {
+    addNamedSource("/lib.dart", r'''
+library lib;
+typedef F();''');
+    Source source = addSource(r'''
+import 'lib.dart' as p;
+f(Type t) {}
+main() {
+  f(p.F);
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_undefinedConstructorInInitializer_explicit_named() async {
+    Source source = addSource(r'''
+class A {
+  A.named() {}
+}
+class B extends A {
+  B() : super.named();
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_undefinedConstructorInInitializer_explicit_unnamed() async {
+    Source source = addSource(r'''
+class A {
+  A() {}
+}
+class B extends A {
+  B() : super();
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_undefinedConstructorInInitializer_hasOptionalParameters() async {
+    Source source = addSource(r'''
+class A {
+  A([p]) {}
+}
+class B extends A {
+  B();
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_undefinedConstructorInInitializer_implicit() async {
+    Source source = addSource(r'''
+class A {
+  A() {}
+}
+class B extends A {
+  B();
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_undefinedConstructorInInitializer_redirecting() async {
+    Source source = addSource(r'''
+class Foo {
+  Foo.ctor();
+}
+class Bar extends Foo {
+  Bar() : this.ctor();
+  Bar.ctor() : super.ctor();
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_undefinedGetter_static_conditionalAccess() async {
+    // The conditional access operator '?.' can be used to access static
+    // fields.
+    Source source = addSource('''
+class A {
+  static var x;
+}
+var a = A?.x;
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_undefinedGetter_typeSubstitution() async {
+    Source source = addSource(r'''
+class A<E> {
+  E element;
+}
+class B extends A<List> {
+  m() {
+    element.last;
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_undefinedIdentifier_synthetic_whenExpression() async {
+    Source source = addSource(r'''
+print(x) {}
+main() {
+  print(is String);
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [ParserErrorCode.MISSING_IDENTIFIER]);
+  }
+
+  test_undefinedIdentifier_synthetic_whenMethodName() async {
+    Source source = addSource(r'''
+print(x) {}
+main(int p) {
+  p.();
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      ParserErrorCode.MISSING_IDENTIFIER,
+      ParserErrorCode.MISSING_IDENTIFIER,
+      StaticTypeWarningCode.UNDEFINED_GETTER
+    ]);
+  }
+
+  test_undefinedMethod_functionExpression_callMethod() async {
+    Source source = addSource(r'''
+main() {
+  (() => null).call();
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    // A call to verify(source) fails as '.call()' isn't resolved.
+  }
+
+  test_undefinedMethod_functionExpression_directCall() async {
+    Source source = addSource(r'''
+main() {
+  (() => null)();
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    // A call to verify(source) fails as '(() => null)()' isn't resolved.
+  }
+
+  test_undefinedMethod_static_conditionalAccess() async {
+    // The conditional access operator '?.' can be used to access static
+    // methods.
+    Source source = addSource('''
+class A {
+  static void m() {}
+}
+f() { A?.m(); }
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_undefinedOperator_index() async {
+    Source source = addSource(r'''
+class A {
+  operator [](a) {}
+  operator []=(a, b) {}
+}
+f(A a) {
+  a[0];
+  a[0] = 1;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_undefinedOperator_tilde() async {
+    Source source = addSource(r'''
+const A = 3;
+const B = ~((1 << A) - 1);''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_undefinedSetter_importWithPrefix() async {
+    addNamedSource("/lib.dart", r'''
+library lib;
+set y(int value) {}''');
+    Source source = addSource(r'''
+import 'lib.dart' as x;
+main() {
+  x.y = 0;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_undefinedSetter_static_conditionalAccess() async {
+    // The conditional access operator '?.' can be used to access static
+    // fields.
+    Source source = addSource('''
+class A {
+  static var x;
+}
+f() { A?.x = 1; }
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_undefinedSuperMethod_field() async {
+    Source source = addSource(r'''
+class A {
+  var m;
+}
+class B extends A {
+  f() {
+    super.m();
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_undefinedSuperMethod_method() async {
+    Source source = addSource(r'''
+class A {
+  m() {}
+}
+class B extends A {
+  f() {
+    super.m();
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_unusedShownName_unresolved() async {
+    Source source = addSource(r'''
+import 'dart:math' show max, FooBar;
+main() {
+  print(max(1, 2));
+}
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [HintCode.UNDEFINED_SHOWN_NAME]);
+  }
+
+  test_uriDoesNotExist_dll() async {
+    addNamedSource("/lib.dll", "");
+    Source source = addSource("import 'dart-ext:lib';");
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+  }
+
+  test_uriDoesNotExist_dylib() async {
+    addNamedSource("/lib.dylib", "");
+    Source source = addSource("import 'dart-ext:lib';");
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+  }
+
+  test_uriDoesNotExist_so() async {
+    addNamedSource("/lib.so", "");
+    Source source = addSource("import 'dart-ext:lib';");
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+  }
+
+  Future test_useDynamicWithPrefix() async {
+    final Source source = addSource('''
+import 'dart:core' as core;
+
+core.dynamic dynamicVariable;
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_wrongNumberOfParametersForOperator1() async {
+    await _check_wrongNumberOfParametersForOperator1("<");
+    await _check_wrongNumberOfParametersForOperator1(">");
+    await _check_wrongNumberOfParametersForOperator1("<=");
+    await _check_wrongNumberOfParametersForOperator1(">=");
+    await _check_wrongNumberOfParametersForOperator1("+");
+    await _check_wrongNumberOfParametersForOperator1("/");
+    await _check_wrongNumberOfParametersForOperator1("~/");
+    await _check_wrongNumberOfParametersForOperator1("*");
+    await _check_wrongNumberOfParametersForOperator1("%");
+    await _check_wrongNumberOfParametersForOperator1("|");
+    await _check_wrongNumberOfParametersForOperator1("^");
+    await _check_wrongNumberOfParametersForOperator1("&");
+    await _check_wrongNumberOfParametersForOperator1("<<");
+    await _check_wrongNumberOfParametersForOperator1(">>");
+    await _check_wrongNumberOfParametersForOperator1("[]");
+  }
+
+  test_wrongNumberOfParametersForOperator_index() async {
+    Source source = addSource(r'''
+class A {
+  operator []=(a, b) {}
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_wrongNumberOfParametersForOperator_minus() async {
+    await _check_wrongNumberOfParametersForOperator("-", "");
+    await _check_wrongNumberOfParametersForOperator("-", "a");
+  }
+
+  test_wrongNumberOfParametersForSetter() async {
+    Source source = addSource(r'''
+class A {
+  set x(a) {}
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_yield_async_to_dynamic_type() async {
+    Source source = addSource('''
+dynamic f() async* {
+  yield 3;
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_yield_async_to_generic_type() async {
+    Source source = addSource('''
+import 'dart:async';
+Stream f() async* {
+  yield 3;
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_yield_async_to_parameterized_type() async {
+    Source source = addSource('''
+import 'dart:async';
+Stream<int> f() async* {
+  yield 3;
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_yield_async_to_untyped() async {
+    Source source = addSource('''
+f() async* {
+  yield 3;
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_yield_each_async_dynamic_to_dynamic() async {
+    Source source = addSource('''
+f() async* {
+  yield* g();
+}
+g() => null;
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_yield_each_async_dynamic_to_stream() async {
+    Source source = addSource('''
+import 'dart:async';
+Stream f() async* {
+  yield* g();
+}
+g() => null;
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_yield_each_async_dynamic_to_typed_stream() async {
+    Source source = addSource('''
+import 'dart:async';
+Stream<int> f() async* {
+  yield* g();
+}
+g() => null;
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_yield_each_async_stream_to_dynamic() async {
+    Source source = addSource('''
+import 'dart:async';
+f() async* {
+  yield* g();
+}
+Stream g() => null;
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_yield_each_async_typed_stream_to_dynamic() async {
+    Source source = addSource('''
+import 'dart:async';
+f() async* {
+  yield* g();
+}
+Stream<int> g() => null;
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_yield_each_async_typed_stream_to_typed_stream() async {
+    Source source = addSource('''
+import 'dart:async';
+Stream<int> f() async* {
+  yield* g();
+}
+Stream<int> g() => null;
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_yield_each_sync_dynamic_to_dynamic() async {
+    Source source = addSource('''
+f() sync* {
+  yield* g();
+}
+g() => null;
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_yield_each_sync_dynamic_to_iterable() async {
+    Source source = addSource('''
+Iterable f() sync* {
+  yield* g();
+}
+g() => null;
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_yield_each_sync_dynamic_to_typed_iterable() async {
+    Source source = addSource('''
+Iterable<int> f() sync* {
+  yield* g();
+}
+g() => null;
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_yield_each_sync_iterable_to_dynamic() async {
+    Source source = addSource('''
+f() sync* {
+  yield* g();
+}
+Iterable g() => null;
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_yield_each_sync_typed_iterable_to_dynamic() async {
+    Source source = addSource('''
+f() sync* {
+  yield* g();
+}
+Iterable<int> g() => null;
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_yield_each_sync_typed_iterable_to_typed_iterable() async {
+    Source source = addSource('''
+Iterable<int> f() sync* {
+  yield* g();
+}
+Iterable<int> g() => null;
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_yield_sync_to_dynamic_type() async {
+    Source source = addSource('''
+dynamic f() sync* {
+  yield 3;
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_yield_sync_to_generic_type() async {
+    Source source = addSource('''
+Iterable f() sync* {
+  yield 3;
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_yield_sync_to_parameterized_type() async {
+    Source source = addSource('''
+Iterable<int> f() sync* {
+  yield 3;
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_yield_sync_to_untyped() async {
+    Source source = addSource('''
+f() sync* {
+  yield 3;
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_yieldInNonGenerator_asyncStar() async {
+    Source source = addSource(r'''
+f() async* {
+  yield 0;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_yieldInNonGenerator_syncStar() async {
+    Source source = addSource(r'''
+f() sync* {
+  yield 0;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  Future<void> _check_wrongNumberOfParametersForOperator(
+      String name, String parameters) async {
+    Source source = addSource("""
+class A {
+  operator $name($parameters) {}
+}""");
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  Future<void> _check_wrongNumberOfParametersForOperator1(String name) async {
+    await _check_wrongNumberOfParametersForOperator(name, "a");
+  }
+}
diff --git a/pkg/analyzer/test/generated/non_error_resolver_driver_test.dart b/pkg/analyzer/test/generated/non_error_resolver_driver_test.dart
index 300cae8..0e14cfb 100644
--- a/pkg/analyzer/test/generated/non_error_resolver_driver_test.dart
+++ b/pkg/analyzer/test/generated/non_error_resolver_driver_test.dart
@@ -6,7 +6,7 @@
 import 'package:analyzer/src/generated/source.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import 'non_error_resolver_test.dart';
+import 'non_error_resolver.dart';
 import 'resolver_test_case.dart';
 
 main() {
diff --git a/pkg/analyzer/test/generated/non_error_resolver_test.dart b/pkg/analyzer/test/generated/non_error_resolver_test.dart
deleted file mode 100644
index 12a26e8..0000000
--- a/pkg/analyzer/test/generated/non_error_resolver_test.dart
+++ /dev/null
@@ -1,6147 +0,0 @@
-// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'dart:async';
-
-import 'package:analyzer/dart/ast/ast.dart';
-import 'package:analyzer/dart/ast/standard_resolution_map.dart';
-import 'package:analyzer/dart/element/element.dart';
-import 'package:analyzer/error/error.dart';
-import 'package:analyzer/src/error/codes.dart';
-import 'package:analyzer/src/generated/engine.dart';
-import 'package:analyzer/src/generated/parser.dart' show ParserErrorCode;
-import 'package:analyzer/src/generated/source_io.dart';
-import 'package:test/test.dart';
-import 'package:test_reflective_loader/test_reflective_loader.dart';
-
-import 'resolver_test_case.dart';
-
-main() {
-  defineReflectiveSuite(() {
-    defineReflectiveTests(NonErrorResolverTest);
-  });
-}
-
-@reflectiveTest
-class NonErrorResolverTest extends NonErrorResolverTestBase {
-  @override
-  @failingTest // Does not work with old task model
-  test_infer_mixin_new_syntax() {
-    return super.test_infer_mixin_new_syntax();
-  }
-
-  @override
-  @failingTest
-  test_infer_mixin_with_substitution_functionType_new_syntax() {
-    return super.test_infer_mixin_with_substitution_functionType_new_syntax();
-  }
-
-  @override
-  @failingTest // Does not work with old task model
-  test_infer_mixin_with_substitution_new_syntax() {
-    return super.test_infer_mixin_with_substitution_new_syntax();
-  }
-
-  @override
-  @failingTest // Fails with the old task model
-  test_issue_32394() {
-    return super.test_issue_32394();
-  }
-
-  @override
-  @failingTest // Does not work with old task model
-  test_mixin_of_mixin_type_argument_inference_cascaded_mixin() {
-    return super.test_mixin_of_mixin_type_argument_inference_cascaded_mixin();
-  }
-
-  @override
-  @failingTest // Does not work with old task model
-  test_mixinInference_with_actual_mixins() {
-    return super.test_mixinInference_with_actual_mixins();
-  }
-
-  @override
-  @failingTest
-  test_null_callOperator() {
-    return super.test_null_callOperator();
-  }
-}
-
-class NonErrorResolverTestBase extends ResolverTestCase {
-  @override
-  AnalysisOptions get defaultAnalysisOptions => new AnalysisOptionsImpl();
-
-  fail_undefinedEnumConstant() async {
-    Source source = addSource(r'''
-enum E { ONE }
-E e() {
-  return E.TWO;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_ambiguousExport() async {
-    Source source = addSource(r'''
-library L;
-export 'lib1.dart';
-export 'lib2.dart';''');
-    addNamedSource("/lib1.dart", r'''
-library lib1;
-class M {}''');
-    addNamedSource("/lib2.dart", r'''
-library lib2;
-class N {}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_ambiguousExport_combinators_hide() async {
-    Source source = addSource(r'''
-library L;
-export 'lib1.dart';
-export 'lib2.dart' hide B;''');
-    addNamedSource("/lib1.dart", r'''
-library L1;
-class A {}
-class B {}''');
-    addNamedSource("/lib2.dart", r'''
-library L2;
-class B {}
-class C {}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_ambiguousExport_combinators_show() async {
-    Source source = addSource(r'''
-library L;
-export 'lib1.dart';
-export 'lib2.dart' show C;''');
-    addNamedSource("/lib1.dart", r'''
-library L1;
-class A {}
-class B {}''');
-    addNamedSource("/lib2.dart", r'''
-library L2;
-class B {}
-class C {}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_ambiguousExport_sameDeclaration() async {
-    Source source = addSource(r'''
-library L;
-export 'lib.dart';
-export 'lib.dart';''');
-    addNamedSource("/lib.dart", r'''
-library lib;
-class N {}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_ambiguousImport_dart_implicitHide() async {
-    Source source = addSource(r'''
-import 'dart:async';
-import 'lib.dart';
-main() {
-  print(Future.zero);
-}
-''');
-    addNamedSource('/lib.dart', r'''
-class Future {
-  static const zero = 0;
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-  }
-
-  test_ambiguousImport_hideCombinator() async {
-    Source source = addSource(r'''
-import 'lib1.dart';
-import 'lib2.dart';
-import 'lib3.dart' hide N;
-main() {
-  new N1();
-  new N2();
-  new N3();
-}''');
-    addNamedSource("/lib1.dart", r'''
-library lib1;
-class N {}
-class N1 {}''');
-    addNamedSource("/lib2.dart", r'''
-library lib2;
-class N {}
-class N2 {}''');
-    addNamedSource("/lib3.dart", r'''
-library lib3;
-class N {}
-class N3 {}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-  }
-
-  test_ambiguousImport_showCombinator() async {
-    Source source = addSource(r'''
-import 'lib1.dart';
-import 'lib2.dart' show N, N2;
-main() {
-  new N1();
-  new N2();
-}''');
-    addNamedSource("/lib1.dart", r'''
-library lib1;
-class N {}
-class N1 {}''');
-    addNamedSource("/lib2.dart", r'''
-library lib2;
-class N {}
-class N2 {}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [HintCode.UNUSED_SHOWN_NAME]);
-  }
-
-  test_annotated_partOfDeclaration() async {
-    Source source = addSource('library L; part "part.dart";');
-    addNamedSource('/part.dart', '@deprecated part of L;');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_argumentTypeNotAssignable_classWithCall_Function() async {
-    Source source = addSource(r'''
-  caller(Function callee) {
-    callee();
-  }
-
-  class CallMeBack {
-    call() => 0;
-  }
-
-  main() {
-    caller(new CallMeBack());
-  }''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_argumentTypeNotAssignable_fieldFormalParameterElement_member() async {
-    Source source = addSource(r'''
-class ObjectSink<T> {
-  void sink(T object) {
-    new TimestampedObject<T>(object);
-  }
-}
-class TimestampedObject<E> {
-  E object2;
-  TimestampedObject(this.object2);
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_argumentTypeNotAssignable_invocation_functionParameter_generic() async {
-    Source source = addSource(r'''
-class A<K> {
-  m(f(K k), K v) {
-    f(v);
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_argumentTypeNotAssignable_invocation_typedef_generic() async {
-    Source source = addSource(r'''
-typedef A<T>(T p);
-f(A<int> a) {
-  a(1);
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_argumentTypeNotAssignable_Object_Function() async {
-    Source source = addSource(r'''
-main() {
-  process(() {});
-}
-process(Object x) {}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_argumentTypeNotAssignable_optionalNew() async {
-    resetWith(options: new AnalysisOptionsImpl());
-    Source source = addSource(r'''
-class Widget { }
-
-class MaterialPageRoute {
-  final Widget Function() builder;
-  const MaterialPageRoute({this.builder});
-}
-
-void main() {
-  print(MaterialPageRoute(
-      builder: () { return Widget(); }
-  ));
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_argumentTypeNotAssignable_typedef_local() async {
-    Source source = addSource(r'''
-typedef A(int p1, String p2);
-A getA() => null;
-f() {
-  A a = getA();
-  a(1, '2');
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_argumentTypeNotAssignable_typedef_parameter() async {
-    Source source = addSource(r'''
-typedef A(int p1, String p2);
-f(A a) {
-  a(1, '2');
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_assert_with_message_await() async {
-    Source source = addSource('''
-import 'dart:async';
-f() async {
-  assert(false, await g());
-}
-Future<String> g() => null;
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_assert_with_message_dynamic() async {
-    Source source = addSource('''
-f() {
-  assert(false, g());
-}
-g() => null;
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_assert_with_message_non_string() async {
-    Source source = addSource('''
-f() {
-  assert(false, 3);
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_assert_with_message_null() async {
-    Source source = addSource('''
-f() {
-  assert(false, null);
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_assert_with_message_string() async {
-    Source source = addSource('''
-f() {
-  assert(false, 'message');
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_assert_with_message_suppresses_unused_var_hint() async {
-    Source source = addSource('''
-f() {
-  String message = 'msg';
-  assert(true, message);
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_assignability_function_expr_rettype_from_typedef_cls() async {
-    // In the code below, the type of (() => f()) has a return type which is
-    // a class, and that class is inferred from the return type of the typedef
-    // F.
-    Source source = addSource('''
-class C {}
-typedef C F();
-F f;
-main() {
-  F f2 = (() => f());
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_assignability_function_expr_rettype_from_typedef_typedef() async {
-    // In the code below, the type of (() => f()) has a return type which is
-    // a typedef, and that typedef is inferred from the return type of the
-    // typedef F.
-    Source source = addSource('''
-typedef G F();
-typedef G();
-F f;
-main() {
-  F f2 = (() => f());
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_assignmentToFinal_prefixNegate() async {
-    Source source = addSource(r'''
-f() {
-  final x = 0;
-  -x;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_assignmentToFinalNoSetter_prefixedIdentifier() async {
-    Source source = addSource(r'''
-class A {
-  int get x => 0;
-  set x(v) {}
-}
-main() {
-  A a = new A();
-  a.x = 0;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_assignmentToFinalNoSetter_propertyAccess() async {
-    Source source = addSource(r'''
-class A {
-  int get x => 0;
-  set x(v) {}
-}
-class B {
-  static A a;
-}
-main() {
-  B.a.x = 0;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_assignmentToFinals_importWithPrefix() async {
-    Source source = addSource(r'''
-library lib;
-import 'lib1.dart' as foo;
-main() {
-  foo.x = true;
-}''');
-    addNamedSource("/lib1.dart", r'''
-library lib1;
-bool x = false;''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_async_dynamic_with_return() async {
-    Source source = addSource('''
-dynamic f() async {
-  return;
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_async_dynamic_with_return_value() async {
-    Source source = addSource('''
-dynamic f() async {
-  return 5;
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_async_dynamic_without_return() async {
-    Source source = addSource('''
-dynamic f() async {}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_async_expression_function_type() async {
-    Source source = addSource('''
-import 'dart:async';
-typedef Future<int> F(int i);
-main() {
-  F f = (int i) async => i;
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_async_flattened() async {
-    Source source = addSource('''
-import 'dart:async';
-typedef Future<int> CreatesFutureInt();
-main() {
-  CreatesFutureInt createFutureInt = () async => f();
-  Future<int> futureInt = createFutureInt();
-  futureInt.then((int i) => print(i));
-}
-Future<int> f() => null;
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_async_future_dynamic_with_return() async {
-    Source source = addSource('''
-import 'dart:async';
-Future<dynamic> f() async {
-  return;
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_async_future_dynamic_with_return_value() async {
-    Source source = addSource('''
-import 'dart:async';
-Future<dynamic> f() async {
-  return 5;
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_async_future_dynamic_without_return() async {
-    Source source = addSource('''
-import 'dart:async';
-Future<dynamic> f() async {}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_async_future_int_with_return_future_int() async {
-    Source source = addSource('''
-import 'dart:async';
-Future<int> f() async {
-  return new Future<int>.value(5);
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_async_future_int_with_return_value() async {
-    Source source = addSource('''
-import 'dart:async';
-Future<int> f() async {
-  return 5;
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_async_future_null_with_return() async {
-    Source source = addSource('''
-import 'dart:async';
-Future<Null> f() async {
-  return;
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_async_future_null_without_return() async {
-    Source source = addSource('''
-import 'dart:async';
-Future<Null> f() async {}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_async_future_object_with_return_value() async {
-    Source source = addSource('''
-import 'dart:async';
-Future<Object> f() async {
-  return 5;
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_async_future_with_return() async {
-    Source source = addSource('''
-import 'dart:async';
-Future f() async {
-  return;
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_async_future_with_return_value() async {
-    Source source = addSource('''
-import 'dart:async';
-Future f() async {
-  return 5;
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_async_future_without_return() async {
-    Source source = addSource('''
-import 'dart:async';
-Future f() async {}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_async_with_return() async {
-    Source source = addSource('''
-f() async {
-  return;
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_async_with_return_value() async {
-    Source source = addSource('''
-f() async {
-  return 5;
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_async_without_return() async {
-    Source source = addSource('''
-f() async {}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_asyncForInWrongContext_async() async {
-    Source source = addSource(r'''
-f(list) async {
-  await for (var e in list) {
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_asyncForInWrongContext_asyncStar() async {
-    Source source = addSource(r'''
-f(list) async* {
-  await for (var e in list) {
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_await_flattened() async {
-    Source source = addSource('''
-import 'dart:async';
-Future<Future<int>> ffi() => null;
-f() async {
-  Future<int> b = await ffi();
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_await_simple() async {
-    Source source = addSource('''
-import 'dart:async';
-Future<int> fi() => null;
-f() async {
-  int a = await fi();
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_awaitInWrongContext_async() async {
-    Source source = addSource(r'''
-f(x, y) async {
-  return await x + await y;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_awaitInWrongContext_asyncStar() async {
-    Source source = addSource(r'''
-f(x, y) async* {
-  yield await x + await y;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_breakWithoutLabelInSwitch() async {
-    Source source = addSource(r'''
-class A {
-  void m(int i) {
-    switch (i) {
-      case 0:
-        break;
-    }
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_bug_24539_getter() async {
-    Source source = addSource('''
-class C<T> {
-  List<Foo> get x => null;
-}
-
-typedef Foo(param);
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_bug_24539_setter() async {
-    Source source = addSource('''
-class C<T> {
-  void set x(List<Foo> value) {}
-}
-
-typedef Foo(param);
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_builtInIdentifierAsType_dynamic() async {
-    Source source = addSource(r'''
-f() {
-  dynamic x;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_caseBlockNotTerminated() async {
-    Source source = addSource(r'''
-f(int p) {
-  for (int i = 0; i < 10; i++) {
-    switch (p) {
-      case 0:
-        break;
-      case 1:
-        continue;
-      case 2:
-        return;
-      case 3:
-        throw new Object();
-      case 4:
-      case 5:
-        return;
-      case 6:
-      default:
-        return;
-    }
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_caseBlockNotTerminated_lastCase() async {
-    Source source = addSource(r'''
-f(int p) {
-  switch (p) {
-    case 0:
-      p = p + 1;
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_caseExpressionTypeImplementsEquals() async {
-    Source source = addSource(r'''
-print(p) {}
-
-abstract class B {
-  final id;
-  const B(this.id);
-  String toString() => 'C($id)';
-  /** Equality is identity equality, the id isn't used. */
-  bool operator==(Object other);
-  }
-
-class C extends B {
-  const C(id) : super(id);
-}
-
-void doSwitch(c) {
-  switch (c) {
-  case const C(0): print('Switch: 0'); break;
-  case const C(1): print('Switch: 1'); break;
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_caseExpressionTypeImplementsEquals_int() async {
-    Source source = addSource(r'''
-f(int i) {
-  switch(i) {
-    case(1) : return 1;
-    default: return 0;
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_caseExpressionTypeImplementsEquals_Object() async {
-    Source source = addSource(r'''
-class IntWrapper {
-  final int value;
-  const IntWrapper(this.value);
-}
-
-f(IntWrapper intWrapper) {
-  switch(intWrapper) {
-    case(const IntWrapper(1)) : return 1;
-    default: return 0;
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_caseExpressionTypeImplementsEquals_String() async {
-    Source source = addSource(r'''
-f(String s) {
-  switch(s) {
-    case('1') : return 1;
-    default: return 0;
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_class_type_alias_documentationComment() async {
-    Source source = addSource('''
-/**
- * Documentation
- */
-class C = D with E;
-
-class D {}
-class E {}''');
-    TestAnalysisResult analysisResult = await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-    CompilationUnit unit = analysisResult.unit;
-    ClassElement classC =
-        resolutionMap.elementDeclaredByCompilationUnit(unit).getType('C');
-    expect(classC.documentationComment, isNotNull);
-  }
-
-  test_concreteClassWithAbstractMember() async {
-    Source source = addSource(r'''
-abstract class A {
-  m();
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_concreteClassWithAbstractMember_inherited() async {
-    Source source = addSource(r'''
-class A {
-  m() {}
-}
-class B extends A {
-  m();
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_conflictingConstructorNameAndMember_setter() async {
-    Source source = addSource(r'''
-class A {
-A.x() {}
-set x(_) {}
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_conflictingStaticGetterAndInstanceSetter_thisClass() async {
-    Source source = addSource(r'''
-class A {
-  static get x => 0;
-  static set x(int p) {}
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_const_constructor_with_named_generic_parameter() async {
-    Source source = addSource('''
-class C<T> {
-  const C({T t});
-}
-const c = const C(t: 1);
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_const_dynamic() async {
-    Source source = addSource('''
-const Type d = dynamic;
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_const_imported_defaultParameterValue_withImportPrefix() async {
-    Source source = addNamedSource("/a.dart", r'''
-import 'b.dart';
-const b = const B();
-''');
-    addNamedSource("/b.dart", r'''
-import 'c.dart' as ccc;
-class B {
-  const B([p = ccc.value]);
-}
-''');
-    addNamedSource("/c.dart", r'''
-const int value = 12345;
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_constConstructorWithNonConstSuper_explicit() async {
-    Source source = addSource(r'''
-class A {
-  const A();
-}
-class B extends A {
-  const B(): super();
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_constConstructorWithNonConstSuper_redirectingFactory() async {
-    Source source = addSource(r'''
-class A {
-  A();
-}
-class B implements C {
-  const B();
-}
-class C extends A {
-  const factory C() = B;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_constConstructorWithNonConstSuper_unresolved() async {
-    Source source = addSource(r'''
-class A {
-  A.a();
-}
-class B extends A {
-  const B(): super();
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source,
-        [CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT]);
-    verify([source]);
-  }
-
-  test_constConstructorWithNonFinalField_finalInstanceVar() async {
-    Source source = addSource(r'''
-class A {
-  final int x = 0;
-  const A();
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_constConstructorWithNonFinalField_static() async {
-    Source source = addSource(r'''
-class A {
-  static int x;
-  const A();
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_constConstructorWithNonFinalField_syntheticField() async {
-    Source source = addSource(r'''
-class A {
-  const A();
-  set x(value) {}
-  get x {return 0;}
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_constDeferredClass_new() async {
-    await resolveWithErrors(<String>[
-      r'''
-library lib1;
-class A {
-  const A.b();
-}''',
-      r'''
-library root;
-import 'lib1.dart' deferred as a;
-main() {
-  new a.A.b();
-}'''
-    ], <ErrorCode>[]);
-  }
-
-  test_constEval_functionTypeLiteral() async {
-    Source source = addSource(r'''
-typedef F();
-const C = F;''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_constEval_propertyExtraction_fieldStatic_targetType() async {
-    addNamedSource("/math.dart", r'''
-library math;
-const PI = 3.14;''');
-    Source source = addSource(r'''
-import 'math.dart' as math;
-const C = math.PI;''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_constEval_propertyExtraction_methodStatic_targetType() async {
-    Source source = addSource(r'''
-class A {
-  const A();
-  static m() {}
-}
-const C = A.m;''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_constEval_symbol() async {
-    addNamedSource("/math.dart", r'''
-library math;
-const PI = 3.14;''');
-    Source source = addSource(r'''
-const C = #foo;
-foo() {}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_constEvalTypeBoolNumString_equal() async {
-    Source source = addSource(r'''
-class B {
-  final v;
-  const B.a1(bool p) : v = p == true;
-  const B.a2(bool p) : v = p == false;
-  const B.a3(bool p) : v = p == 0;
-  const B.a4(bool p) : v = p == 0.0;
-  const B.a5(bool p) : v = p == '';
-  const B.b1(int p) : v = p == true;
-  const B.b2(int p) : v = p == false;
-  const B.b3(int p) : v = p == 0;
-  const B.b4(int p) : v = p == 0.0;
-  const B.b5(int p) : v = p == '';
-  const B.c1(String p) : v = p == true;
-  const B.c2(String p) : v = p == false;
-  const B.c3(String p) : v = p == 0;
-  const B.c4(String p) : v = p == 0.0;
-  const B.c5(String p) : v = p == '';
-  const B.n1(num p) : v = p == null;
-  const B.n2(num p) : v = null == p;
-  const B.n3(Object p) : v = p == null;
-  const B.n4(Object p) : v = null == p;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-  }
-
-  test_constEvalTypeBoolNumString_notEqual() async {
-    Source source = addSource(r'''
-class B {
-  final v;
-  const B.a1(bool p) : v = p != true;
-  const B.a2(bool p) : v = p != false;
-  const B.a3(bool p) : v = p != 0;
-  const B.a4(bool p) : v = p != 0.0;
-  const B.a5(bool p) : v = p != '';
-  const B.b1(int p) : v = p != true;
-  const B.b2(int p) : v = p != false;
-  const B.b3(int p) : v = p != 0;
-  const B.b4(int p) : v = p != 0.0;
-  const B.b5(int p) : v = p != '';
-  const B.c1(String p) : v = p != true;
-  const B.c2(String p) : v = p != false;
-  const B.c3(String p) : v = p != 0;
-  const B.c4(String p) : v = p != 0.0;
-  const B.c5(String p) : v = p != '';
-  const B.n1(num p) : v = p != null;
-  const B.n2(num p) : v = null != p;
-  const B.n3(Object p) : v = p != null;
-  const B.n4(Object p) : v = null != p;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_constEvAlTypeNum_String() async {
-    Source source = addSource(r'''
-const String A = 'a';
-const String B = A + 'b';
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_constMapKeyExpressionTypeImplementsEquals_abstract() async {
-    Source source = addSource(r'''
-abstract class B {
-  final id;
-  const B(this.id);
-  String toString() => 'C($id)';
-  /** Equality is identity equality, the id isn't used. */
-  bool operator==(Object other);
-  }
-
-class C extends B {
-  const C(id) : super(id);
-}
-
-Map getMap() {
-  return const { const C(0): 'Map: 0' };
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_constNotInitialized_field() async {
-    Source source = addSource(r'''
-class A {
-  static const int x = 0;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_constNotInitialized_local() async {
-    Source source = addSource(r'''
-main() {
-  const int x = 0;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_constRedirectSkipsSupertype() async {
-    // Since C redirects to C.named, it doesn't implicitly refer to B's
-    // unnamed constructor.  Therefore there is no cycle.
-    Source source = addSource('''
-class B {
-  final x;
-  const B() : x = y;
-  const B.named() : x = null;
-}
-class C extends B {
-  const C() : this.named();
-  const C.named() : super.named();
-}
-const y = const C();
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_constructorDeclaration_scope_signature() async {
-    Source source = addSource(r'''
-const app = 0;
-class A {
-  A(@app int app) {}
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_constWithNonConstantArgument_constField() async {
-    Source source = addSource(r'''
-class A {
-  const A(x);
-}
-main() {
-  const A(double.INFINITY);
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_constWithNonConstantArgument_literals() async {
-    Source source = addSource(r'''
-class A {
-  const A(a, b, c, d);
-}
-f() { return const A(true, 0, 1.0, '2'); }''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_constWithTypeParameters_direct() async {
-    Source source = addSource(r'''
-class A<T> {
-  static const V = const A<int>();
-  const A();
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_constWithUndefinedConstructor() async {
-    Source source = addSource(r'''
-class A {
-  const A.name();
-}
-f() {
-  return const A.name();
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_constWithUndefinedConstructorDefault() async {
-    Source source = addSource(r'''
-class A {
-  const A();
-}
-f() {
-  return const A();
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_defaultValueInFunctionTypeAlias() async {
-    Source source = addSource("typedef F([x]);");
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_defaultValueInFunctionTypedParameter_named() async {
-    Source source = addSource("f(g({p})) {}");
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_defaultValueInFunctionTypedParameter_optional() async {
-    Source source = addSource("f(g([p])) {}");
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_deprecatedMemberUse_hide() async {
-    Source source = addSource(r'''
-library lib;
-import 'lib1.dart' hide B;
-A a = new A();''');
-    addNamedSource("/lib1.dart", r'''
-library lib1;
-class A {}
-@deprecated
-class B {}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_duplicateDefinition_emptyName() async {
-    // Note: This code has two FunctionElements '() {}' with an empty name,
-    // this tests that the empty string is not put into the scope
-    // (more than once).
-    Source source = addSource(r'''
-Map _globalMap = {
-  'a' : () {},
-  'b' : () {}
-};''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_duplicateDefinition_getter() async {
-    Source source = addSource("bool get a => true;");
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_duplicatePart() async {
-    addNamedSource('/part1.dart', 'part of lib;');
-    addNamedSource('/part2.dart', 'part of lib;');
-    Source source = addSource(r'''
-library lib;
-part 'part1.dart';
-part 'part2.dart';
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_dynamicIdentifier() async {
-    Source source = addSource(r'''
-main() {
-  var v = dynamic;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_empty_generator_async() async {
-    Source source = addSource('''
-import 'dart:async';
-Stream<int> f() async* {
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_empty_generator_sync() async {
-    Source source = addSource('''
-Iterable<int> f() sync* {
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_expectedOneListTypeArgument() async {
-    Source source = addSource(r'''
-main() {
-  <int> [];
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_expectedTwoMapTypeArguments() async {
-    Source source = addSource(r'''
-main() {
-  <int, int> {};
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_exportDuplicatedLibraryUnnamed() async {
-    Source source = addSource(r'''
-library test;
-export 'lib1.dart';
-export 'lib2.dart';''');
-    addNamedSource("/lib1.dart", "");
-    addNamedSource("/lib2.dart", "");
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_exportOfNonLibrary_libraryDeclared() async {
-    Source source = addSource(r'''
-library L;
-export 'lib1.dart';''');
-    addNamedSource("/lib1.dart", "library lib1;");
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_exportOfNonLibrary_libraryNotDeclared() async {
-    Source source = addSource(r'''
-library L;
-export 'lib1.dart';''');
-    addNamedSource("/lib1.dart", "");
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_extraPositionalArguments_function() async {
-    Source source = addSource(r'''
-f(p1, p2) {}
-main() {
-  f(1, 2);
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_extraPositionalArguments_Function() async {
-    Source source = addSource(r'''
-f(Function a) {
-  a(1, 2);
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_extraPositionalArguments_typedef_local() async {
-    Source source = addSource(r'''
-typedef A(p1, p2);
-A getA() => null;
-f() {
-  A a = getA();
-  a(1, 2);
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_extraPositionalArguments_typedef_parameter() async {
-    Source source = addSource(r'''
-typedef A(p1, p2);
-f(A a) {
-  a(1, 2);
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_fieldFormalParameter_functionTyped_named() async {
-    Source source = addSource(r'''
-class C {
-  final Function field;
-
-  C({String this.field(int value)});
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_fieldFormalParameter_genericFunctionTyped() async {
-    Source source = addSource(r'''
-class C {
-  final Object Function(int, double) field;
-
-  C(String Function(num, Object) this.field);
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_fieldFormalParameter_genericFunctionTyped_named() async {
-    Source source = addSource(r'''
-class C {
-  final Object Function(int, double) field;
-
-  C({String Function(num, Object) this.field});
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_fieldInitializedByMultipleInitializers() async {
-    Source source = addSource(r'''
-class A {
-  int x;
-  int y;
-  A() : x = 0, y = 0 {}
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_fieldInitializedInInitializerAndDeclaration_fieldNotFinal() async {
-    Source source = addSource(r'''
-class A {
-  int x = 0;
-  A() : x = 1 {}
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_fieldInitializedInInitializerAndDeclaration_finalFieldNotSet() async {
-    Source source = addSource(r'''
-class A {
-  final int x;
-  A() : x = 1 {}
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_fieldInitializerOutsideConstructor() async {
-    Source source = addSource(r'''
-class A {
-  int x;
-  A(this.x) {}
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_fieldInitializerOutsideConstructor_defaultParameters() async {
-    Source source = addSource(r'''
-class A {
-  int x;
-  A([this.x]) {}
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_fieldInitializerRedirectingConstructor_super() async {
-    Source source = addSource(r'''
-class A {
-  A() {}
-}
-class B extends A {
-  int x;
-  B(this.x) : super();
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_finalInitializedInDeclarationAndConstructor_initializer() async {
-    Source source = addSource(r'''
-class A {
-  final x;
-  A() : x = 1 {}
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_finalInitializedInDeclarationAndConstructor_initializingFormal() async {
-    Source source = addSource(r'''
-class A {
-  final x;
-  A(this.x) {}
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_finalNotInitialized_atDeclaration() async {
-    Source source = addSource(r'''
-class A {
-  final int x = 0;
-  A() {}
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_finalNotInitialized_fieldFormal() async {
-    Source source = addSource(r'''
-class A {
-  final int x = 0;
-  A() {}
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_finalNotInitialized_functionTypedFieldFormal() async {
-    Source source = addSource(r'''
-class A {
-  final Function x;
-  A(int this.x(int p)) {}
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_finalNotInitialized_hasNativeClause_hasConstructor() async {
-    Source source = addSource(r'''
-class A native 'something' {
-  final int x;
-  A() {}
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [ParserErrorCode.NATIVE_CLAUSE_IN_NON_SDK_CODE]);
-    verify([source]);
-  }
-
-  test_finalNotInitialized_hasNativeClause_noConstructor() async {
-    Source source = addSource(r'''
-class A native 'something' {
-  final int x;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [ParserErrorCode.NATIVE_CLAUSE_IN_NON_SDK_CODE]);
-    verify([source]);
-  }
-
-  test_finalNotInitialized_initializer() async {
-    Source source = addSource(r'''
-class A {
-  final int x;
-  A() : x = 0 {}
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_finalNotInitialized_redirectingConstructor() async {
-    Source source = addSource(r'''
-class A {
-  final int x;
-  A(this.x);
-  A.named() : this (42);
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_forEach_genericFunctionType() async {
-    Source source = addSource(r'''
-main() {
-  for (Null Function<T>(T, Null) e in <dynamic>[]) {
-    e;
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_functionDeclaration_scope_returnType() async {
-    Source source = addSource("int f(int) { return 0; }");
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_functionDeclaration_scope_signature() async {
-    Source source = addSource(r'''
-const app = 0;
-f(@app int app) {}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_functionTypeAlias_scope_returnType() async {
-    Source source = addSource("typedef int f(int);");
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_functionTypeAlias_scope_signature() async {
-    Source source = addSource(r'''
-const app = 0;
-typedef int f(@app int app);''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_functionWithoutCall() async {
-    Source source = addSource(r'''
-abstract class A implements Function {
-}
-class B implements A {
-  void call() {}
-}
-class C extends A {
-  void call() {}
-}
-class D extends C {
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_functionWithoutCall_doesNotImplementFunction() async {
-    Source source = addSource("class A {}");
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_functionWithoutCall_staticCallMethod() async {
-    Source source = addSource(r'''
-class A { }
-class B extends A {
-  static call() { }
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_functionWithoutCall_withNoSuchMethod() async {
-    // 16078
-    Source source = addSource(r'''
-class A implements Function {
-  noSuchMethod(inv) {
-    return 42;
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_functionWithoutCall_withNoSuchMethod_mixin() async {
-    Source source = addSource(r'''
-class A {
-  noSuchMethod(inv) {}
-}
-class B extends Object with A implements Function {
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_functionWithoutCall_withNoSuchMethod_superclass() async {
-    Source source = addSource(r'''
-class A {
-  noSuchMethod(inv) {}
-}
-class B extends A implements Function {
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_genericTypeAlias_castsAndTypeChecks_hasTypeParameters() async {
-    Source source = addSource('''
-typedef Foo<S> = S Function<T>(T x);
-
-main(Object p) {
-  (p as Foo)<int>(3);
-  if (p is Foo) {
-    p<int>(3);
-  }
-  (p as Foo<String>)<int>(3);
-  if (p is Foo<String>) {
-    p<int>(3);
-  }
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_genericTypeAlias_castsAndTypeChecks_noTypeParameters() async {
-    Source source = addSource('''
-typedef Foo = T Function<T>(T x);
-
-main(Object p) {
-  (p as Foo)<int>(3);
-  if (p is Foo) {
-    p<int>(3);
-  }
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_genericTypeAlias_fieldAndReturnType_noTypeParameters() async {
-    Source source = addSource(r'''
-typedef Foo = int Function<T>(T x);
-int foo<T>(T x) => 3;
-Foo bar() => foo;
-void test1() {
-  bar()<String>("hello");
-}
-
-class A {
-  Foo f;
-  void test() {
-    f<String>("hello");
-  }
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_genericTypeAlias_fieldAndReturnType_typeParameters_arguments() async {
-    Source source = addSource(r'''
-typedef Foo<S> = S Function<T>(T x);
-int foo<T>(T x) => 3;
-Foo<int> bar() => foo;
-void test1() {
-  bar()<String>("hello");
-}
-
-class A {
-  Foo<int> f;
-  void test() {
-    f<String>("hello");
-  }
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_genericTypeAlias_fieldAndReturnType_typeParameters_noArguments() async {
-    Source source = addSource(r'''
-typedef Foo<S> = S Function<T>(T x);
-int foo<T>(T x) => 3;
-Foo bar() => foo;
-void test1() {
-  bar()<String>("hello");
-}
-
-class A {
-  Foo f;
-  void test() {
-    f<String>("hello");
-  }
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_genericTypeAlias_invalidGenericFunctionType() async {
-    Source source = addSource('''
-typedef F = int;
-main(p) {
-  p is F;
-}
-''');
-    await computeAnalysisResult(source);
-    // There is a parse error, but no crashes.
-    assertErrors(source, [ParserErrorCode.INVALID_GENERIC_FUNCTION_TYPE]);
-    verify([source]);
-  }
-
-  test_genericTypeAlias_noTypeParameters() async {
-    Source source = addSource(r'''
-typedef Foo = int Function<T>(T x);
-int foo<T>(T x) => 3;
-void test1() {
-  Foo y = foo;
-  // These two should be equivalent
-  foo<String>("hello");
-  y<String>("hello");
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_genericTypeAlias_typeParameters() async {
-    Source source = addSource(r'''
-typedef Foo<S> = S Function<T>(T x);
-int foo<T>(T x) => 3;
-void test1() {
-  Foo<int> y = foo;
-  // These two should be equivalent
-  foo<String>("hello");
-  y<String>("hello");
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_implicitThisReferenceInInitializer_constructorName() async {
-    Source source = addSource(r'''
-class A {
-  A.named() {}
-}
-class B {
-  var v;
-  B() : v = new A.named();
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_implicitThisReferenceInInitializer_prefixedIdentifier() async {
-    Source source = addSource(r'''
-class A {
-  var f;
-}
-class B {
-  var v;
-  B(A a) : v = a.f;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_implicitThisReferenceInInitializer_qualifiedMethodInvocation() async {
-    Source source = addSource(r'''
-class A {
-  f() {}
-}
-class B {
-  var v;
-  B() : v = new A().f();
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_implicitThisReferenceInInitializer_qualifiedPropertyAccess() async {
-    Source source = addSource(r'''
-class A {
-  var f;
-}
-class B {
-  var v;
-  B() : v = new A().f;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_implicitThisReferenceInInitializer_staticField_thisClass() async {
-    Source source = addSource(r'''
-class A {
-  var v;
-  A() : v = f;
-  static var f;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_implicitThisReferenceInInitializer_staticGetter() async {
-    Source source = addSource(r'''
-class A {
-  var v;
-  A() : v = f;
-  static get f => 42;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_implicitThisReferenceInInitializer_staticMethod() async {
-    Source source = addSource(r'''
-class A {
-  var v;
-  A() : v = f();
-  static f() => 42;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_implicitThisReferenceInInitializer_topLevelField() async {
-    Source source = addSource(r'''
-class A {
-  var v;
-  A() : v = f;
-}
-var f = 42;''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_implicitThisReferenceInInitializer_topLevelFunction() async {
-    Source source = addSource(r'''
-class A {
-  var v;
-  A() : v = f();
-}
-f() => 42;''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_implicitThisReferenceInInitializer_topLevelGetter() async {
-    Source source = addSource(r'''
-class A {
-  var v;
-  A() : v = f;
-}
-get f => 42;''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_implicitThisReferenceInInitializer_typeParameter() async {
-    Source source = addSource(r'''
-class A<T> {
-  var v;
-  A(p) : v = (p is T);
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_importDuplicatedLibraryName() async {
-    Source source = addSource(r'''
-library test;
-import 'lib.dart';
-import 'lib.dart';''');
-    addNamedSource("/lib.dart", "library lib;");
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      HintCode.UNUSED_IMPORT,
-      HintCode.UNUSED_IMPORT,
-      HintCode.DUPLICATE_IMPORT
-    ]);
-    verify([source]);
-  }
-
-  test_importDuplicatedLibraryUnnamed() async {
-    Source source = addSource(r'''
-library test;
-import 'lib1.dart';
-import 'lib2.dart';''');
-    addNamedSource("/lib1.dart", "");
-    addNamedSource("/lib2.dart", "");
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      // No warning on duplicate import (https://github.com/dart-lang/sdk/issues/24156)
-      HintCode.UNUSED_IMPORT,
-      HintCode.UNUSED_IMPORT
-    ]);
-    verify([source]);
-  }
-
-  test_importOfNonLibrary_libraryDeclared() async {
-    Source source = addSource(r'''
-library lib;
-import 'part.dart';
-A a;''');
-    addNamedSource("/part.dart", r'''
-library lib1;
-class A {}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_importOfNonLibrary_libraryNotDeclared() async {
-    Source source = addSource(r'''
-library lib;
-import 'part.dart';
-A a;''');
-    addNamedSource("/part.dart", "class A {}");
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_importPrefixes_withFirstLetterDifference() async {
-    Source source = addSource(r'''
-library L;
-import 'lib1.dart' as math;
-import 'lib2.dart' as path;
-main() {
-  math.test1();
-  path.test2();
-}''');
-    addNamedSource("/lib1.dart", r'''
-library lib1;
-test1() {}''');
-    addNamedSource("/lib2.dart", r'''
-library lib2;
-test2() {}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_inconsistentCaseExpressionTypes() async {
-    Source source = addSource(r'''
-f(var p) {
-  switch (p) {
-    case 1:
-      break;
-    case 2:
-      break;
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_inconsistentMethodInheritance_accessors_typeParameter2() async {
-    Source source = addSource(r'''
-abstract class A<E> {
-  E get x {return null;}
-}
-class B<E> {
-  E get x {return null;}
-}
-class C<E> extends A<E> implements B<E> {}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_inconsistentMethodInheritance_accessors_typeParameters1() async {
-    Source source = addSource(r'''
-abstract class A<E> {
-  E get x;
-}
-abstract class B<E> {
-  E get x;
-}
-class C<E> implements A<E>, B<E> {
-  E get x => null;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_inconsistentMethodInheritance_accessors_typeParameters_diamond() async {
-    Source source = addSource(r'''
-abstract class F<E> extends B<E> {}
-class D<E> extends F<E> {
-  external E get g;
-}
-abstract class C<E> {
-  E get g;
-}
-abstract class B<E> implements C<E> {
-  E get g { return null; }
-}
-class A<E> extends B<E> implements D<E> {
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_inconsistentMethodInheritance_methods_typeParameter2() async {
-    Source source = addSource(r'''
-class A<E> {
-  x(E e) {}
-}
-class B<E> {
-  x(E e) {}
-}
-class C<E> extends A<E> implements B<E> {
-  x(E e) {}
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_inconsistentMethodInheritance_methods_typeParameters1() async {
-    Source source = addSource(r'''
-class A<E> {
-  x(E e) {}
-}
-class B<E> {
-  x(E e) {}
-}
-class C<E> implements A<E>, B<E> {
-  x(E e) {}
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_inconsistentMethodInheritance_simple() async {
-    Source source = addSource(r'''
-abstract class A {
-  x();
-}
-abstract class B {
-  x();
-}
-class C implements A, B {
-  x() {}
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_infer_mixin_new_syntax() async {
-    Source source = addSource('''
-abstract class A<T> {}
-
-class B {}
-
-mixin M<T> on A<T> {}
-
-class C extends A<B> with M {}
-''');
-    TestAnalysisResult analysisResult = await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-    CompilationUnit unit = analysisResult.unit;
-    ClassElement classC =
-        resolutionMap.elementDeclaredByCompilationUnit(unit).getType('C');
-    expect(classC.mixins, hasLength(1));
-    expect(classC.mixins[0].toString(), 'M<B>');
-  }
-
-  test_infer_mixin_with_substitution_functionType_new_syntax() async {
-    Source source = addSource('''
-abstract class A<T> {}
-
-class B {}
-
-mixin M<T, U> on A<T Function(U)> {}
-
-class C extends A<int Function(String)> with M {}
-''');
-    TestAnalysisResult analysisResult = await computeAnalysisResult(source);
-    assertNoErrors(source);
-    CompilationUnit unit = analysisResult.unit;
-    ClassElement classC =
-        resolutionMap.elementDeclaredByCompilationUnit(unit).getType('C');
-    expect(classC.mixins, hasLength(1));
-    expect(classC.mixins[0].toString(), 'M<int, String>');
-  }
-
-  test_infer_mixin_with_substitution_new_syntax() async {
-    Source source = addSource('''
-abstract class A<T> {}
-
-class B {}
-
-mixin M<T> on A<List<T>> {}
-
-class C extends A<List<B>> with M {}
-''');
-    TestAnalysisResult analysisResult = await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-    CompilationUnit unit = analysisResult.unit;
-    ClassElement classC =
-        resolutionMap.elementDeclaredByCompilationUnit(unit).getType('C');
-    expect(classC.mixins, hasLength(1));
-    expect(classC.mixins[0].toString(), 'M<B>');
-  }
-
-  test_initializingFormalForNonExistentField() async {
-    Source source = addSource(r'''
-class A {
-  int x;
-  A(this.x) {}
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_instance_creation_inside_annotation() async {
-    Source source = addSource('''
-class C {
-  const C();
-}
-class D {
-  final C c;
-  const D(this.c);
-}
-@D(const C())
-f() {}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_instanceAccessToStaticMember_fromComment() async {
-    Source source = addSource(r'''
-class A {
-  static m() {}
-}
-/// [A.m]
-main() {
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_instanceAccessToStaticMember_topLevel() async {
-    Source source = addSource(r'''
-m() {}
-main() {
-  m();
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_instanceMemberAccessFromStatic_fromComment() async {
-    Source source = addSource(r'''
-class A {
-  m() {}
-  /// [m]
-  static foo() {
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_instanceMethodNameCollidesWithSuperclassStatic_field() async {
-    Source source = addSource(r'''
-import 'lib.dart';
-class B extends A {
-  _m() {}
-}''');
-    addNamedSource("/lib.dart", r'''
-library L;
-class A {
-  static var _m;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_instanceMethodNameCollidesWithSuperclassStatic_method() async {
-    Source source = addSource(r'''
-import 'lib.dart';
-class B extends A {
-  _m() {}
-}''');
-    addNamedSource("/lib.dart", r'''
-library L;
-class A {
-  static _m() {}
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_integerLiteralOutOfRange_negative_leadingZeros() async {
-    Source source = addSource('int x = -000923372036854775809;');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-  }
-
-  test_integerLiteralOutOfRange_negative_small() async {
-    Source source = addSource('int x = -42;');
-    await computeAnalysisResult(source);
-    assertErrors(source);
-  }
-
-  test_integerLiteralOutOfRange_negative_valid() async {
-    Source source = addSource('int x = -9223372036854775808;');
-    await computeAnalysisResult(source);
-    assertErrors(source);
-  }
-
-  test_integerLiteralOutOfRange_positive_leadingZeros() async {
-    Source source = addSource('int x = 000923372036854775808;');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-  }
-
-  test_integerLiteralOutOfRange_positive_valid() async {
-    Source source = addSource('int x = 9223372036854775807;');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-  }
-
-  test_integerLiteralOutOfRange_positive_zero() async {
-    Source source = addSource('int x = 0;');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-  }
-
-  test_intLiteralInDoubleContext() async {
-    Source source = addSource(r'''
-void takeDouble(double x) {}
-void main() {
-  takeDouble(0);
-  takeDouble(-0);
-  takeDouble(0x0);
-  takeDouble(-0x0);
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_intLiteralInDoubleContext_const() async {
-    Source source = addSource(r'''
-class C {
-  const C(double x)
-    : assert((x + 3) / 2 == 1.5)
-    , assert(x == 0.0);
-}
-@C(0)
-@C(-0)
-@C(0x0)
-@C(-0x0)
-void main() {
-  const C(0);
-  const C(-0);
-  const C(0x0);
-  const C(-0x0);
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_invalidAnnotation_constantVariable_field() async {
-    Source source = addSource(r'''
-@A.C
-class A {
-  static const C = 0;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_invalidAnnotation_constantVariable_field_importWithPrefix() async {
-    addNamedSource("/lib.dart", r'''
-library lib;
-class A {
-  static const C = 0;
-}''');
-    Source source = addSource(r'''
-import 'lib.dart' as p;
-@p.A.C
-main() {
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_invalidAnnotation_constantVariable_topLevel() async {
-    Source source = addSource(r'''
-const C = 0;
-@C
-main() {
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_invalidAnnotation_constantVariable_topLevel_importWithPrefix() async {
-    addNamedSource("/lib.dart", r'''
-library lib;
-const C = 0;''');
-    Source source = addSource(r'''
-import 'lib.dart' as p;
-@p.C
-main() {
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_invalidAnnotation_constConstructor_importWithPrefix() async {
-    addNamedSource("/lib.dart", r'''
-library lib;
-class A {
-  const A(int p);
-}''');
-    Source source = addSource(r'''
-import 'lib.dart' as p;
-@p.A(42)
-main() {
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_invalidAnnotation_constConstructor_named_importWithPrefix() async {
-    addNamedSource("/lib.dart", r'''
-library lib;
-class A {
-  const A.named(int p);
-}''');
-    Source source = addSource(r'''
-import 'lib.dart' as p;
-@p.A.named(42)
-main() {
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_invalidAssignment() async {
-    Source source = addSource(r'''
-f() {
-  var x;
-  var y;
-  x = y;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_invalidAssignment_compoundAssignment() async {
-    Source source = addSource(r'''
-class byte {
-  int _value;
-  byte(this._value);
-  byte operator +(int val) { return this; }
-}
-
-void main() {
-  byte b = new byte(52);
-  b += 3;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_invalidAssignment_defaultValue_named() async {
-    Source source = addSource(r'''
-f({String x: '0'}) {
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_invalidAssignment_defaultValue_optional() async {
-    Source source = addSource(r'''
-f([String x = '0']) {
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_invalidAssignment_ifNullAssignment_compatibleType() async {
-    Source source = addSource('''
-void f(int i) {
-  num n;
-  n ??= i;
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_invalidAssignment_ifNullAssignment_sameType() async {
-    Source source = addSource('''
-void f(int i) {
-  int j;
-  j ??= i;
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_invalidAssignment_implicitlyImplementFunctionViaCall_1() async {
-    // 18341
-    //
-    // This test and
-    // 'test_invalidAssignment_implicitlyImplementFunctionViaCall_2()'
-    // are closely related: here we see that 'I' checks as a subtype of
-    // 'IntToInt'.
-    Source source = addSource(r'''
-class I {
-  int call(int x) => 0;
-}
-class C implements I {
-  noSuchMethod(_) => null;
-}
-typedef int IntToInt(int x);
-IntToInt f = new I();''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_invalidAssignment_implicitlyImplementFunctionViaCall_2() async {
-    // 18341
-    //
-    // Here 'C' checks as a subtype of 'I', but 'C' does not
-    // check as a subtype of 'IntToInt'. Together with
-    // 'test_invalidAssignment_implicitlyImplementFunctionViaCall_1()' we see
-    // that subtyping is not transitive here.
-    Source source = addSource(r'''
-class I {
-  int call(int x) => 0;
-}
-class C implements I {
-  noSuchMethod(_) => null;
-}
-typedef int IntToInt(int x);
-IntToInt f = new C();''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_invalidAssignment_implicitlyImplementFunctionViaCall_3() async {
-    // 18341
-    //
-    // Like 'test_invalidAssignment_implicitlyImplementFunctionViaCall_2()',
-    // but uses type 'Function' instead of more precise type 'IntToInt' for 'f'.
-    Source source = addSource(r'''
-class I {
-  int call(int x) => 0;
-}
-class C implements I {
-  noSuchMethod(_) => null;
-}
-typedef int IntToInt(int x);
-Function f = new C();''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_invalidAssignment_implicitlyImplementFunctionViaCall_4() async {
-    // 18341
-    //
-    // Like 'test_invalidAssignment_implicitlyImplementFunctionViaCall_2()',
-    // but uses type 'VoidToInt' instead of more precise type 'IntToInt' for
-    // 'f'.
-    //
-    // Here 'C <: IntToInt <: VoidToInt', but the spec gives no transitivity
-    // rule for '<:'. However, many of the :/tools/test.py tests assume this
-    // transitivity for 'JsBuilder' objects, assigning them to
-    // '(String) -> dynamic'. The declared type of 'JsBuilder.call' is
-    // '(String, [dynamic]) -> Expression'.
-    Source source = addSource(r'''
-class I {
-  int call([int x]) => 0;
-}
-class C implements I {
-  noSuchMethod(_) => null;
-}
-typedef int VoidToInt();
-VoidToInt f = new C();''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_invalidAssignment_postfixExpression_localVariable() async {
-    Source source = addSource(r'''
-class A {
-  A operator+(_) => this;
-}
-
-f(A a) {
-  a++;
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_invalidAssignment_postfixExpression_property() async {
-    Source source = addSource(r'''
-class A {
-  A operator+(_) => this;
-}
-
-class C {
-  A a;
-}
-
-f(C c) {
-  c.a++;
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_invalidAssignment_prefixExpression_localVariable() async {
-    Source source = addSource(r'''
-class A {
-  A operator+(_) => this;
-}
-
-f(A a) {
-  ++a;
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_invalidAssignment_prefixExpression_property() async {
-    Source source = addSource(r'''
-class A {
-  A operator+(_) => this;
-}
-
-class C {
-  A a;
-}
-
-f(C c) {
-  ++c.a;
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_invalidAssignment_toDynamic() async {
-    Source source = addSource(r'''
-f() {
-  var g;
-  g = () => 0;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_invalidFactoryNameNotAClass() async {
-    Source source = addSource(r'''
-class A {
-  factory A() => null;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_invalidIdentifierInAsync() async {
-    Source source = addSource(r'''
-class A {
-  m() {
-    int async;
-    int await;
-    int yield;
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_invalidMethodOverrideNamedParamType() async {
-    Source source = addSource(r'''
-class A {
-  m({int a}) {}
-}
-class B implements A {
-  m({int a, int b}) {}
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_invalidOverrideDifferentDefaultValues_named() async {
-    Source source = addSource(r'''
-class A {
-  m({int p : 0}) {}
-}
-class B extends A {
-  m({int p : 0}) {}
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_invalidOverrideDifferentDefaultValues_named_function() async {
-    Source source = addSource(r'''
-nothing() => 'nothing';
-class A {
-  thing(String a, {orElse : nothing}) {}
-}
-class B extends A {
-  thing(String a, {orElse : nothing}) {}
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_invalidOverrideDifferentDefaultValues_positional() async {
-    Source source = addSource(r'''
-class A {
-  m([int p = 0]) {}
-}
-class B extends A {
-  m([int p = 0]) {}
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_invalidOverrideDifferentDefaultValues_positional_changedOrder() async {
-    Source source = addSource(r'''
-class A {
-  m([int a = 0, String b = '0']) {}
-}
-class B extends A {
-  m([int b = 0, String a = '0']) {}
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_invalidOverrideDifferentDefaultValues_positional_function() async {
-    Source source = addSource(r'''
-nothing() => 'nothing';
-class A {
-  thing(String a, [orElse = nothing]) {}
-}
-class B extends A {
-  thing(String a, [orElse = nothing]) {}
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_invalidOverrideNamed_unorderedNamedParameter() async {
-    Source source = addSource(r'''
-class A {
-  m({a, b}) {}
-}
-class B extends A {
-  m({b, a}) {}
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_invalidOverrideRequired_less() async {
-    Source source = addSource(r'''
-class A {
-  m(a, b) {}
-}
-class B extends A {
-  m(a, [b]) {}
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_invalidOverrideRequired_same() async {
-    Source source = addSource(r'''
-class A {
-  m(a) {}
-}
-class B extends A {
-  m(a) {}
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_invalidOverrideReturnType_returnType_interface() async {
-    Source source = addNamedSource("/test.dart", r'''
-abstract class A {
-  num m();
-}
-class B implements A {
-  int m() { return 1; }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_invalidOverrideReturnType_returnType_interface2() async {
-    Source source = addNamedSource("/test.dart", r'''
-abstract class A {
-  num m();
-}
-abstract class B implements A {
-}
-class C implements B {
-  int m() { return 1; }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_invalidOverrideReturnType_returnType_mixin() async {
-    Source source = addNamedSource("/test.dart", r'''
-class A {
-  num m() { return 0; }
-}
-class B extends Object with A {
-  int m() { return 1; }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_invalidOverrideReturnType_returnType_parameterizedTypes() async {
-    Source source = addSource(r'''
-abstract class A<E> {
-  List<E> m();
-}
-class B extends A<dynamic> {
-  List<dynamic> m() { return new List<dynamic>(); }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_invalidOverrideReturnType_returnType_sameType() async {
-    Source source = addNamedSource("/test.dart", r'''
-class A {
-  int m() { return 0; }
-}
-class B extends A {
-  int m() { return 1; }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_invalidOverrideReturnType_returnType_superclass() async {
-    Source source = addNamedSource("/test.dart", r'''
-class A {
-  num m() { return 0; }
-}
-class B extends A {
-  int m() { return 1; }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_invalidOverrideReturnType_returnType_superclass2() async {
-    Source source = addNamedSource("/test.dart", r'''
-class A {
-  num m() { return 0; }
-}
-class B extends A {
-}
-class C extends B {
-  int m() { return 1; }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_invalidOverrideReturnType_returnType_void() async {
-    Source source = addSource(r'''
-class A {
-  void m() {}
-}
-class B extends A {
-  int m() { return 0; }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_invalidReferenceToThis_constructor() async {
-    Source source = addSource(r'''
-class A {
-  A() {
-    var v = this;
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_invalidReferenceToThis_instanceMethod() async {
-    Source source = addSource(r'''
-class A {
-  m() {
-    var v = this;
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_invalidTypeArgumentForKey() async {
-    Source source = addSource(r'''
-class A {
-  m() {
-    return const <int, int>{};
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_invalidTypeArgumentInConstList() async {
-    Source source = addSource(r'''
-class A<E> {
-  m() {
-    return <E>[];
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_invalidTypeArgumentInConstMap() async {
-    Source source = addSource(r'''
-class A<E> {
-  m() {
-    return <String, E>{};
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  Future test_issue32114() async {
-    addNamedSource('/a.dart', '''
-class O {}
-
-typedef T Func<T extends O>(T e);
-''');
-    addNamedSource('/b.dart', '''
-import 'a.dart';
-export 'a.dart' show Func;
-
-abstract class A<T extends O> {
-  Func<T> get func;
-}
-''');
-    final Source source = addSource('''
-import 'b.dart';
-
-class B extends A {
-  Func get func => (x) => x;
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_issue_24191() async {
-    Source source = addSource('''
-import 'dart:async';
-
-abstract class S extends Stream {}
-f(S s) async {
-  await for (var v in s) {
-    print(v);
-  }
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_issue_32394() async {
-    Source source = addSource('''
-var x = y.map((a) => a.toString());
-var y = [3];
-var z = x.toList();
-
-void main() {
-  String p = z;
-}
-''');
-    var result = await computeAnalysisResult(source);
-    var z = result.unit.declaredElement.topLevelVariables
-        .where((e) => e.name == 'z')
-        .single;
-    expect(z.type.toString(), 'List<String>');
-    assertErrors(source, [StaticTypeWarningCode.INVALID_ASSIGNMENT]);
-    verify([source]);
-  }
-
-  test_issue_35320_lists() async {
-    addNamedSource('/lib.dart', '''
-const x = const <String>['a'];
-''');
-    Source source = addSource('''
-import 'lib.dart';
-const y = const <String>['b'];
-int f(v) {
-  switch(v) {
-    case x:
-      return 0;
-    case y:
-      return 1;
-    default:
-      return 2;
-  }
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_issue_35320_maps() async {
-    addNamedSource('/lib.dart', '''
-const x = const <String, String>{'a': 'b'};
-''');
-    Source source = addSource('''
-import 'lib.dart';
-const y = const <String, String>{'c': 'd'};
-int f(v) {
-  switch(v) {
-    case x:
-      return 0;
-    case y:
-      return 1;
-    default:
-      return 2;
-  }
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_listElementTypeNotAssignable() async {
-    Source source = addSource(r'''
-var v1 = <int> [42];
-var v2 = const <int> [42];''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_loadLibraryDefined() async {
-    await resolveWithErrors(<String>[
-      r'''
-library lib1;
-foo() => 22;''',
-      r'''
-import 'lib1.dart' deferred as other;
-main() {
-  other.loadLibrary().then((_) => other.foo());
-}'''
-    ], <ErrorCode>[]);
-  }
-
-  test_local_generator_async() async {
-    Source source = addSource('''
-f() {
-  return () async* { yield 0; };
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_local_generator_sync() async {
-    Source source = addSource('''
-f() {
-  return () sync* { yield 0; };
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_mapKeyTypeNotAssignable() async {
-    Source source = addSource("var v = <String, int > {'a' : 1};");
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_metadata_enumConstantDeclaration() async {
-    Source source = addSource(r'''
-const x = 1;
-enum E {
-  aaa,
-  @x
-  bbb
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_methodDeclaration_scope_signature() async {
-    Source source = addSource(r'''
-const app = 0;
-class A {
-  foo(@app int app) {}
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_misMatchedGetterAndSetterTypes_instance_sameTypes() async {
-    Source source = addSource(r'''
-class C {
-  int get x => 0;
-  set x(int v) {}
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_misMatchedGetterAndSetterTypes_instance_unspecifiedGetter() async {
-    Source source = addSource(r'''
-class C {
-  get x => 0;
-  set x(String v) {}
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_misMatchedGetterAndSetterTypes_instance_unspecifiedSetter() async {
-    Source source = addSource(r'''
-class C {
-  int get x => 0;
-  set x(v) {}
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_misMatchedGetterAndSetterTypes_topLevel_sameTypes() async {
-    Source source = addSource(r'''
-int get x => 0;
-set x(int v) {}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_misMatchedGetterAndSetterTypes_topLevel_unspecifiedGetter() async {
-    Source source = addSource(r'''
-get x => 0;
-set x(String v) {}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_misMatchedGetterAndSetterTypes_topLevel_unspecifiedSetter() async {
-    Source source = addSource(r'''
-int get x => 0;
-set x(v) {}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_missingEnumConstantInSwitch_all() async {
-    Source source = addSource(r'''
-enum E { A, B, C }
-
-f(E e) {
-  switch (e) {
-    case E.A: break;
-    case E.B: break;
-    case E.C: break;
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_missingEnumConstantInSwitch_default() async {
-    Source source = addSource(r'''
-enum E { A, B, C }
-
-f(E e) {
-  switch (e) {
-    case E.B: break;
-    default: break;
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_mixedReturnTypes_differentScopes() async {
-    Source source = addSource(r'''
-class C {
-  m(int x) {
-    f(int y) {
-      return;
-    }
-    f(x);
-    return 0;
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_mixedReturnTypes_ignoreImplicit() async {
-    Source source = addSource(r'''
-f(bool p) {
-  if (p) return 42;
-  // implicit 'return;' is ignored
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_mixedReturnTypes_ignoreImplicit2() async {
-    Source source = addSource(r'''
-f(bool p) {
-  if (p) {
-    return 42;
-  } else {
-    return 42;
-  }
-  // implicit 'return;' is ignored
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_mixedReturnTypes_sameKind() async {
-    Source source = addSource(r'''
-class C {
-  m(int x) {
-    if (x < 0) {
-      return 1;
-    }
-    return 0;
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_mixin_of_mixin_type_argument_inference() async {
-    // In the code below, B's superclass constraints don't include A, because
-    // superclass constraints are determined from the mixin's superclass, and
-    // B's superclass is Object.  So no mixin type inference is attempted, and
-    // "with B" is interpreted as "with B<dynamic>".
-    Source source = addSource('''
-class A<T> {}
-class B<T> = Object with A<T>;
-class C = Object with B;
-''');
-    var result = await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-    var bReference = result.unit.declaredElement.getType('C').mixins[0];
-    expect(bReference.typeArguments[0].toString(), 'dynamic');
-  }
-
-  test_mixin_of_mixin_type_argument_inference_cascaded_mixin() async {
-    // In the code below, B has a single superclass constraint, A1, because
-    // superclass constraints are determined from the mixin's superclass, and
-    // B's superclass is "Object with A1<T>".  So mixin type inference succeeds
-    // (since C's base class implements A1<int>), and "with B" is interpreted as
-    // "with B<int>".
-    Source source = addSource('''
-class A1<T> {}
-class A2<T> {}
-class B<T> = Object with A1<T>, A2<T>;
-class Base implements A1<int> {}
-class C = Base with B;
-''');
-    var result = await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-    var bReference = result.unit.declaredElement.getType('C').mixins[0];
-    expect(bReference.typeArguments[0].toString(), 'int');
-  }
-
-  test_mixinDeclaresConstructor() async {
-    Source source = addSource(r'''
-class A {
-  m() {}
-}
-class B extends Object with A {}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_mixinDeclaresConstructor_factory() async {
-    Source source = addSource(r'''
-class A {
-  factory A() => null;
-}
-class B extends Object with A {}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_mixinInference_with_actual_mixins() async {
-    Source source = addSource('''
-class I<X> {}
-
-mixin M0<T> on I<T> {}
-
-mixin M1<T> on I<T> {
-  T foo() => null;
-}
-
-class A = I<int> with M0, M1;
-
-void main () {
-  var x = new A().foo();
-}
-''');
-    var result = await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-    var main = result.unit.declarations.last as FunctionDeclaration;
-    var mainBody = main.functionExpression.body as BlockFunctionBody;
-    var xDecl = mainBody.block.statements[0] as VariableDeclarationStatement;
-    var xElem = xDecl.variables.variables[0].declaredElement;
-    expect(xElem.type.toString(), 'int');
-  }
-
-  test_mixinInheritsFromNotObject_classDeclaration_extends_new_syntax() async {
-    Source source = addSource(r'''
-class A {}
-mixin B on A {}
-class C extends A with B {}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_mixinInheritsFromNotObject_classDeclaration_mixTypeAlias() async {
-    Source source = addSource(r'''
-class A {}
-class B = Object with A;
-class C extends Object with B {}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_mixinInheritsFromNotObject_typeAlias_extends_new_syntax() async {
-    Source source = addSource(r'''
-class A {}
-mixin B on A {}
-class C = A with B;''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_mixinInheritsFromNotObject_typedef_mixTypeAlias() async {
-    Source source = addSource(r'''
-class A {}
-class B = Object with A;
-class C = Object with B;''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_mixinReferencesSuper_new_syntax() async {
-    Source source = addSource(r'''
-mixin A {
-  toString() => super.toString();
-}
-class B extends Object with A {}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_multipleSuperInitializers_no() async {
-    Source source = addSource(r'''
-class A {}
-class B extends A {
-  B() {}
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_multipleSuperInitializers_single() async {
-    Source source = addSource(r'''
-class A {}
-class B extends A {
-  B() : super() {}
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nativeConstConstructor() async {
-    Source source = addSource(r'''
-import 'dart-ext:x';
-class Foo {
-  const Foo() native 'Foo_Foo';
-  const factory Foo.foo() native 'Foo_Foo_foo';
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [ParserErrorCode.CONST_CONSTRUCTOR_WITH_BODY]);
-    // Cannot verify the AST because the import's URI cannot be resolved.
-  }
-
-  test_nativeFunctionBodyInNonSDKCode_function() async {
-    Source source = addSource(r'''
-import 'dart-ext:x';
-int m(a) native 'string';''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    // Cannot verify the AST because the import's URI cannot be resolved.
-  }
-
-  test_newWithAbstractClass_factory() async {
-    Source source = addSource(r'''
-abstract class A {
-  factory A() { return new B(); }
-}
-class B implements A {
-  B() {}
-}
-A f() {
-  return new A();
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_newWithUndefinedConstructor() async {
-    Source source = addSource(r'''
-class A {
-  A.name() {}
-}
-f() {
-  new A.name();
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_newWithUndefinedConstructorDefault() async {
-    Source source = addSource(r'''
-class A {
-  A() {}
-}
-f() {
-  new A();
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nonAbstractClassInheritsAbstractMemberOne_abstractsDontOverrideConcretes_getter() async {
-    Source source = addSource(r'''
-class A {
-  int get g => 0;
-}
-abstract class B extends A {
-  int get g;
-}
-class C extends B {}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nonAbstractClassInheritsAbstractMemberOne_abstractsDontOverrideConcretes_method() async {
-    Source source = addSource(r'''
-class A {
-  m(p) {}
-}
-abstract class B extends A {
-  m(p);
-}
-class C extends B {}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nonAbstractClassInheritsAbstractMemberOne_abstractsDontOverrideConcretes_setter() async {
-    Source source = addSource(r'''
-class A {
-  set s(v) {}
-}
-abstract class B extends A {
-  set s(v);
-}
-class C extends B {}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nonAbstractClassInheritsAbstractMemberOne_classTypeAlias_interface() async {
-    // 15979
-    Source source = addSource(r'''
-abstract class M {}
-abstract class A {}
-abstract class I {
-  m();
-}
-abstract class B = A with M implements I;''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nonAbstractClassInheritsAbstractMemberOne_classTypeAlias_mixin() async {
-    // 15979
-    Source source = addSource(r'''
-abstract class M {
-  m();
-}
-abstract class A {}
-abstract class B = A with M;''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nonAbstractClassInheritsAbstractMemberOne_classTypeAlias_superclass() async {
-    // 15979
-    Source source = addSource(r'''
-class M {}
-abstract class A {
-  m();
-}
-abstract class B = A with M;''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nonAbstractClassInheritsAbstractMemberOne_mixin_getter() async {
-    // 17034
-    Source source = addSource(r'''
-class A {
-  var a;
-}
-abstract class M {
-  get a;
-}
-class B extends A with M {}
-class C extends B {}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nonAbstractClassInheritsAbstractMemberOne_mixin_method() async {
-    Source source = addSource(r'''
-class A {
-  m() {}
-}
-abstract class M {
-  m();
-}
-class B extends A with M {}
-class C extends B {}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nonAbstractClassInheritsAbstractMemberOne_mixin_setter() async {
-    Source source = addSource(r'''
-class A {
-  var a;
-}
-abstract class M {
-  set a(dynamic v);
-}
-class B extends A with M {}
-class C extends B {}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nonAbstractClassInheritsAbstractMemberOne_noSuchMethod_accessor() async {
-    Source source = addSource(r'''
-abstract class A {
-  int get g;
-}
-class B extends A {
-  noSuchMethod(v) => '';
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nonAbstractClassInheritsAbstractMemberOne_noSuchMethod_method() async {
-    Source source = addSource(r'''
-abstract class A {
-  m(p);
-}
-class B extends A {
-  noSuchMethod(v) => '';
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nonAbstractClassInheritsAbstractMemberOne_noSuchMethod_mixin() async {
-    Source source = addSource(r'''
-class A {
-  noSuchMethod(v) => '';
-}
-class B extends Object with A {
-  m(p);
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nonAbstractClassInheritsAbstractMemberOne_noSuchMethod_superclass() async {
-    Source source = addSource(r'''
-class A {
-  noSuchMethod(v) => '';
-}
-class B extends A {
-  m(p);
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nonAbstractClassInheritsAbstractMemberOne_overridesMethodInObject() async {
-    Source source = addSource(r'''
-class A {
-  String toString([String prefix = '']) => '${prefix}Hello';
-}
-class C {}
-class B extends A with C {}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nonBoolExpression_interfaceType() async {
-    Source source = addSource(r'''
-f() {
-  assert(true);
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nonBoolNegationExpression() async {
-    Source source = addSource(r'''
-f(bool pb, pd) {
-  !true;
-  !false;
-  !pb;
-  !pd;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nonBoolNegationExpression_dynamic() async {
-    Source source = addSource(r'''
-f1(bool dynamic) {
-  !dynamic;
-}
-f2() {
-  bool dynamic = true;
-  !dynamic;
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nonBoolOperand_and_bool() async {
-    Source source = addSource(r'''
-bool f(bool left, bool right) {
-  return left && right;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nonBoolOperand_and_dynamic() async {
-    Source source = addSource(r'''
-bool f(left, dynamic right) {
-  return left && right;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nonBoolOperand_or_bool() async {
-    Source source = addSource(r'''
-bool f(bool left, bool right) {
-  return left || right;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nonBoolOperand_or_dynamic() async {
-    Source source = addSource(r'''
-bool f(dynamic left, right) {
-  return left || right;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nonConstantDefaultValue_constField() async {
-    Source source = addSource(r'''
-f([a = double.INFINITY]) {
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nonConstantDefaultValue_function_named() async {
-    Source source = addSource("f({x : 2 + 3}) {}");
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nonConstantDefaultValue_function_positional() async {
-    Source source = addSource("f([x = 2 + 3]) {}");
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nonConstantDefaultValue_inConstructor_named() async {
-    Source source = addSource(r'''
-class A {
-  A({x : 2 + 3}) {}
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nonConstantDefaultValue_inConstructor_positional() async {
-    Source source = addSource(r'''
-class A {
-  A([x = 2 + 3]) {}
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nonConstantDefaultValue_method_named() async {
-    Source source = addSource(r'''
-class A {
-  m({x : 2 + 3}) {}
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nonConstantDefaultValue_method_positional() async {
-    Source source = addSource(r'''
-class A {
-  m([x = 2 + 3]) {}
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nonConstantDefaultValue_typedConstList() async {
-    Source source = addSource(r'''
-class A {
-  m([p111 = const <String>[]]) {}
-}
-class B extends A {
-  m([p222 = const <String>[]]) {}
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nonConstantValueInInitializer_namedArgument() async {
-    Source source = addSource(r'''
-class A {
-  final a;
-  const A({this.a});
-}
-class B extends A {
-  const B({b}) : super(a: b);
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nonConstCaseExpression_constField() async {
-    Source source = addSource(r'''
-f(double p) {
-  switch (p) {
-    case double.INFINITY:
-      return true;
-    default:
-      return false;
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [CompileTimeErrorCode.CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS]);
-    verify([source]);
-  }
-
-  test_nonConstCaseExpression_typeLiteral() async {
-    Source source = addSource(r'''
-f(Type t) {
-  switch (t) {
-    case bool:
-    case int:
-      return true;
-    default:
-      return false;
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nonConstListElement_constField() async {
-    Source source = addSource(r'''
-main() {
-  const [double.INFINITY];
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nonConstMapAsExpressionStatement_const() async {
-    Source source = addSource(r'''
-f() {
-  const {'a' : 0, 'b' : 1};
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nonConstMapAsExpressionStatement_notExpressionStatement() async {
-    Source source = addSource(r'''
-f() {
-  var m = {'a' : 0, 'b' : 1};
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nonConstMapAsExpressionStatement_typeArguments() async {
-    Source source = addSource(r'''
-f() {
-  <String, int> {'a' : 0, 'b' : 1};
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nonConstMapKey_constField() async {
-    Source source = addSource(r'''
-main() {
-  const {double.INFINITY: 0};
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source,
-        [CompileTimeErrorCode.CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQUALS]);
-    verify([source]);
-  }
-
-  test_nonConstMapValue_constField() async {
-    Source source = addSource(r'''
-main() {
-  const {0: double.INFINITY};
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nonConstValueInInitializer_binary_bool() async {
-    Source source = addSource(r'''
-class A {
-  final v;
-  const A.a1(bool p) : v = p && true;
-  const A.a2(bool p) : v = true && p;
-  const A.b1(bool p) : v = p || true;
-  const A.b2(bool p) : v = true || p;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [HintCode.DEAD_CODE]);
-    verify([source]);
-  }
-
-  test_nonConstValueInInitializer_binary_dynamic() async {
-    Source source = addSource(r'''
-class A {
-  final v;
-  const A.a1(p) : v = p + 5;
-  const A.a2(p) : v = 5 + p;
-  const A.b1(p) : v = p - 5;
-  const A.b2(p) : v = 5 - p;
-  const A.c1(p) : v = p * 5;
-  const A.c2(p) : v = 5 * p;
-  const A.d1(p) : v = p / 5;
-  const A.d2(p) : v = 5 / p;
-  const A.e1(p) : v = p ~/ 5;
-  const A.e2(p) : v = 5 ~/ p;
-  const A.f1(p) : v = p > 5;
-  const A.f2(p) : v = 5 > p;
-  const A.g1(p) : v = p < 5;
-  const A.g2(p) : v = 5 < p;
-  const A.h1(p) : v = p >= 5;
-  const A.h2(p) : v = 5 >= p;
-  const A.i1(p) : v = p <= 5;
-  const A.i2(p) : v = 5 <= p;
-  const A.j1(p) : v = p % 5;
-  const A.j2(p) : v = 5 % p;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    // operations on "p" are not resolved
-  }
-
-  test_nonConstValueInInitializer_binary_int() async {
-    Source source = addSource(r'''
-class A {
-  final v;
-  const A.a1(int p) : v = p ^ 5;
-  const A.a2(int p) : v = 5 ^ p;
-  const A.b1(int p) : v = p & 5;
-  const A.b2(int p) : v = 5 & p;
-  const A.c1(int p) : v = p | 5;
-  const A.c2(int p) : v = 5 | p;
-  const A.d1(int p) : v = p >> 5;
-  const A.d2(int p) : v = 5 >> p;
-  const A.e1(int p) : v = p << 5;
-  const A.e2(int p) : v = 5 << p;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nonConstValueInInitializer_binary_num() async {
-    Source source = addSource(r'''
-class A {
-  final v;
-  const A.a1(num p) : v = p + 5;
-  const A.a2(num p) : v = 5 + p;
-  const A.b1(num p) : v = p - 5;
-  const A.b2(num p) : v = 5 - p;
-  const A.c1(num p) : v = p * 5;
-  const A.c2(num p) : v = 5 * p;
-  const A.d1(num p) : v = p / 5;
-  const A.d2(num p) : v = 5 / p;
-  const A.e1(num p) : v = p ~/ 5;
-  const A.e2(num p) : v = 5 ~/ p;
-  const A.f1(num p) : v = p > 5;
-  const A.f2(num p) : v = 5 > p;
-  const A.g1(num p) : v = p < 5;
-  const A.g2(num p) : v = 5 < p;
-  const A.h1(num p) : v = p >= 5;
-  const A.h2(num p) : v = 5 >= p;
-  const A.i1(num p) : v = p <= 5;
-  const A.i2(num p) : v = 5 <= p;
-  const A.j1(num p) : v = p % 5;
-  const A.j2(num p) : v = 5 % p;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nonConstValueInInitializer_field() async {
-    Source source = addSource(r'''
-class A {
-  final int a;
-  const A() : a = 5;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nonConstValueInInitializer_redirecting() async {
-    Source source = addSource(r'''
-class A {
-  const A.named(p);
-  const A() : this.named(42);
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nonConstValueInInitializer_super() async {
-    Source source = addSource(r'''
-class A {
-  const A(p);
-}
-class B extends A {
-  const B() : super(42);
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nonConstValueInInitializer_unary() async {
-    Source source = addSource(r'''
-class A {
-  final v;
-  const A.a(bool p) : v = !p;
-  const A.b(int p) : v = ~p;
-  const A.c(num p) : v = -p;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nonGenerativeConstructor() async {
-    Source source = addSource(r'''
-class A {
-  A.named() {}
-  factory A() => null;
-}
-class B extends A {
-  B() : super.named();
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nonTypeInCatchClause_isClass() async {
-    Source source = addSource(r'''
-f() {
-  try {
-  } on String catch (e) {
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nonTypeInCatchClause_isFunctionTypeAlias() async {
-    Source source = addSource(r'''
-typedef F();
-f() {
-  try {
-  } on F catch (e) {
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nonTypeInCatchClause_isTypeParameter() async {
-    Source source = addSource(r'''
-class A<T> {
-  f() {
-    try {
-    } on T catch (e) {
-    }
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nonTypeInCatchClause_noType() async {
-    Source source = addSource(r'''
-f() {
-  try {
-  } catch (e) {
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nonVoidReturnForOperator_no() async {
-    Source source = addSource(r'''
-class A {
-  operator []=(a, b) {}
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nonVoidReturnForOperator_void() async {
-    Source source = addSource(r'''
-class A {
-  void operator []=(a, b) {}
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nonVoidReturnForSetter_function_no() async {
-    Source source = addSource("set x(v) {}");
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nonVoidReturnForSetter_function_void() async {
-    Source source = addSource("void set x(v) {}");
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nonVoidReturnForSetter_method_no() async {
-    Source source = addSource(r'''
-class A {
-  set x(v) {}
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nonVoidReturnForSetter_method_void() async {
-    Source source = addSource(r'''
-class A {
-  void set x(v) {}
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_null_callOperator() async {
-    Source source = addSource(r'''
-main() {
-  null + 5;
-  null == 5;
-  null[0];
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      StaticTypeWarningCode.UNDEFINED_METHOD,
-      StaticTypeWarningCode.UNDEFINED_METHOD
-    ]);
-  }
-
-  test_optionalNew_rewrite() async {
-    resetWith(options: new AnalysisOptionsImpl());
-    Source source = addSource(r'''
-import 'b.dart';
-main() {
-  const B.named1();
-  const B.named2();
-  const B.named3();
-  const B.named4();
-}
-''');
-    addNamedSource("/a.dart", r'''
-class A {
-  const A();
-  const A.named();
-}
-''');
-    addNamedSource("/b.dart", r'''
-import 'a.dart';
-import 'a.dart' as p;
-
-const _a1 = A();
-const _a2 = A.named();
-const _a3 = p.A();
-const _a4 = p.A.named();
-
-class B {
-  const B.named1({this.a: _a1}) : assert(a != null);
-  const B.named2({this.a: _a2}) : assert(a != null);
-  const B.named3({this.a: _a3}) : assert(a != null);
-  const B.named4({this.a: _a4}) : assert(a != null);
-
-  final A a;
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_optionalNew_rewrite_instantiatesToBounds() async {
-    resetWith(options: new AnalysisOptionsImpl());
-    Source source = addSource(r'''
-import 'b.dart';
-
-@B.named1()
-@B.named2()
-@B.named3()
-@B.named4()
-@B.named5()
-@B.named6()
-@B.named7()
-@B.named8()
-main() {}
-''');
-    addNamedSource("/a.dart", r'''
-class Unbounded<T> {
-  const Unbounded();
-  const Unbounded.named();
-}
-class Bounded<T extends String> {
-  const Bounded();
-  const Bounded.named();
-}
-''');
-    addNamedSource("/b.dart", r'''
-import 'a.dart';
-import 'a.dart' as p;
-
-const unbounded1 = Unbounded();
-const unbounded2 = Unbounded.named();
-const unbounded3 = p.Unbounded();
-const unbounded4 = p.Unbounded.named();
-const bounded1 = Bounded();
-const bounded2 = Bounded.named();
-const bounded3 = p.Bounded();
-const bounded4 = p.Bounded.named();
-
-class B {
-  const B.named1({this.unbounded: unbounded1}) : bounded = null;
-  const B.named2({this.unbounded: unbounded2}) : bounded = null;
-  const B.named3({this.unbounded: unbounded3}) : bounded = null;
-  const B.named4({this.unbounded: unbounded4}) : bounded = null;
-  const B.named5({this.bounded: bounded1}) : unbounded = null;
-  const B.named6({this.bounded: bounded2}) : unbounded = null;
-  const B.named7({this.bounded: bounded3}) : unbounded = null;
-  const B.named8({this.bounded: bounded4}) : unbounded = null;
-
-  final Unbounded unbounded;
-  final Bounded bounded;
-}
-''');
-    final result = await computeAnalysisResult(source);
-    expect(result.unit.declarations, hasLength(1));
-    final mainDecl = result.unit.declarations[0];
-    expect(mainDecl.metadata, hasLength(8));
-    mainDecl.metadata.forEach((metadata) {
-      final value = metadata.elementAnnotation.computeConstantValue();
-      expect(value, isNotNull);
-      expect(value.type.toString(), 'B');
-      final unbounded = value.getField('unbounded');
-      final bounded = value.getField('bounded');
-      if (!unbounded.isNull) {
-        expect(bounded.isNull, true);
-        expect(unbounded.type.name, 'Unbounded');
-        expect(unbounded.type.typeArguments, hasLength(1));
-        expect(unbounded.type.typeArguments[0].isDynamic, isTrue);
-      } else {
-        expect(unbounded.isNull, true);
-        expect(bounded.type.name, 'Bounded');
-        expect(bounded.type.typeArguments, hasLength(1));
-        expect(bounded.type.typeArguments[0].name, 'String');
-      }
-    });
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_optionalParameterInOperator_required() async {
-    Source source = addSource(r'''
-class A {
-  operator +(p) {}
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_parameterScope_local() async {
-    // Parameter names shouldn't conflict with the name of the function they
-    // are enclosed in.
-    Source source = addSource(r'''
-f() {
-  g(g) {
-    h(g);
-  }
-}
-h(x) {}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_parameterScope_method() async {
-    // Parameter names shouldn't conflict with the name of the function they
-    // are enclosed in.
-    Source source = addSource(r'''
-class C {
-  g(g) {
-    h(g);
-  }
-}
-h(x) {}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_parameterScope_topLevel() async {
-    // Parameter names shouldn't conflict with the name of the function they
-    // are enclosed in.
-    Source source = addSource(r'''
-g(g) {
-  h(g);
-}
-h(x) {}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_parametricCallFunction() async {
-    Source source = addSource(r'''
-f() {
-  var c = new C();
-  c<String>().codeUnits;
-}
-
-class C {
-  T call<T>() => null;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_prefixCollidesWithTopLevelMembers() async {
-    addNamedSource("/lib.dart", r'''
-library lib;
-class A {}''');
-    Source source = addSource(r'''
-import 'lib.dart' as p;
-typedef P();
-p2() {}
-var p3;
-class p4 {}
-p.A a;''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_propagateTypeArgs_intoBounds() async {
-    Source source = addSource(r'''
-abstract class A<E> {}
-abstract class B<F> implements A<F>{}
-abstract class C<G, H extends A<G>> {}
-class D<I> extends C<I, B<I>> {}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_propagateTypeArgs_intoSupertype() async {
-    Source source = addSource(r'''
-class A<T> {
-  A(T p);
-  A.named(T p);
-}
-class B<S> extends A<S> {
-  B(S p) : super(p);
-  B.named(S p) : super.named(p);
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_recursiveConstructorRedirect() async {
-    Source source = addSource(r'''
-class A {
-  A.a() : this.b();
-  A.b() : this.c();
-  A.c() {}
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_recursiveFactoryRedirect() async {
-    Source source = addSource(r'''
-class A {
-  factory A() = B;
-}
-class B implements A {
-  factory B() = C;
-}
-class C implements B {
-  factory C() => null;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_redirectToInvalidFunctionType() async {
-    Source source = addSource(r'''
-class A implements B {
-  A(int p) {}
-}
-class B {
-  factory B(int p) = A;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_redirectToNonConstConstructor() async {
-    Source source = addSource(r'''
-class A {
-  const A.a();
-  const factory A.b() = A.a;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_referencedBeforeDeclaration_cascade() async {
-    Source source = addSource(r'''
-testRequestHandler() {}
-
-main() {
-  var s1 = null;
-  testRequestHandler()
-    ..stream(s1);
-  var stream = 123;
-  print(stream);
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_referenceToDeclaredVariableInInitializer_constructorName() async {
-    Source source = addSource(r'''
-class A {
-  A.x() {}
-}
-f() {
-  var x = new A.x();
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_referenceToDeclaredVariableInInitializer_methodName() async {
-    Source source = addSource(r'''
-class A {
-  x() {}
-}
-f(A a) {
-  var x = a.x();
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_referenceToDeclaredVariableInInitializer_propertyName() async {
-    Source source = addSource(r'''
-class A {
-  var x;
-}
-f(A a) {
-  var x = a.x;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_regress34906() async {
-    Source source = addSource(r'''
-typedef G<X, Y extends Function(X)> = X Function(Function(Y));
-G<dynamic, Function(Null)> superBoundedG;
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_rethrowOutsideCatch() async {
-    Source source = addSource(r'''
-class A {
-  void m() {
-    try {} catch (e) {rethrow;}
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_return_in_generator_async() async {
-    Source source = addSource('''
-import 'dart:async';
-Stream<int> f() async* {
-  return;
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_return_in_generator_sync() async {
-    Source source = addSource('''
-Iterable<int> f() sync* {
-  return;
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_returnInGenerativeConstructor() async {
-    Source source = addSource(r'''
-class A {
-  A() { return; }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_returnInGenerator_async() async {
-    Source source = addSource(r'''
-f() async {
-  return 0;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_returnInGenerator_sync() async {
-    Source source = addSource(r'''
-f() {
-  return 0;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_returnOfInvalidType_async() async {
-    Source source = addSource(r'''
-import 'dart:async';
-class A {
-  Future<int> m() async {
-    return 0;
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_returnOfInvalidType_dynamic() async {
-    Source source = addSource(r'''
-class TypeError {}
-class A {
-  static void testLogicalOp() {
-    testOr(a, b, onTypeError) {
-      try {
-        return a || b;
-      } on TypeError catch (t) {
-        return onTypeError;
-      }
-    }
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_returnOfInvalidType_subtype() async {
-    Source source = addSource(r'''
-class A {}
-class B extends A {}
-A f(B b) { return b; }''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_returnOfInvalidType_supertype() async {
-    Source source = addSource(r'''
-class A {}
-class B extends A {}
-B f(A a) { return a; }''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_returnOfInvalidType_typeParameter_18468() async {
-    // https://code.google.com/p/dart/issues/detail?id=18468
-    //
-    // This test verifies that the type of T is more specific than Type,
-    // where T is a type parameter and Type is the type Type from
-    // core, this particular test case comes from issue 18468.
-    //
-    // A test cannot be added to TypeParameterTypeImplTest since the types
-    // returned out of the TestTypeProvider don't have a mock 'dart.core'
-    // enclosing library element.
-    // See TypeParameterTypeImpl.isMoreSpecificThan().
-    Source source = addSource(r'''
-class Foo<T> {
-  Type get t => T;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source);
-    verify([source]);
-  }
-
-  test_returnOfInvalidType_void() async {
-    Source source = addSource(r'''
-void f1() {}
-void f2() { return; }
-void f3() { return null; }
-void f4() { return g1(); }
-void f5() { return g2(); }
-void f6() => throw 42;
-g1() {}
-void g2() {}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_returnWithoutValue_noReturnType() async {
-    Source source = addSource("f() { return; }");
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_returnWithoutValue_void() async {
-    Source source = addSource("void f() { return; }");
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_reversedTypeArguments() async {
-    Source source = addSource(r'''
-class Codec<S1, T1> {
-  Codec<T1, S1> get inverted => new _InvertedCodec<T1, S1>(this);
-}
-class _InvertedCodec<T2, S2> extends Codec<T2, S2> {
-  _InvertedCodec(Codec<S2, T2> codec);
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_sharedDeferredPrefix() async {
-    await resolveWithErrors(<String>[
-      r'''
-library lib1;
-f1() {}''',
-      r'''
-library lib2;
-f2() {}''',
-      r'''
-library lib3;
-f3() {}''',
-      r'''
-library root;
-import 'lib1.dart' deferred as lib1;
-import 'lib2.dart' as lib;
-import 'lib3.dart' as lib;
-main() { lib1.f1(); lib.f2(); lib.f3(); }'''
-    ], <ErrorCode>[]);
-  }
-
-  test_staticAccessToInstanceMember_annotation() async {
-    Source source = addSource(r'''
-class A {
-  const A.name();
-}
-@A.name()
-main() {
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_staticAccessToInstanceMember_method() async {
-    Source source = addSource(r'''
-class A {
-  static m() {}
-}
-main() {
-  A.m;
-  A.m();
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_staticAccessToInstanceMember_propertyAccess_field() async {
-    Source source = addSource(r'''
-class A {
-  static var f;
-}
-main() {
-  A.f;
-  A.f = 1;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_staticAccessToInstanceMember_propertyAccess_propertyAccessor() async {
-    Source source = addSource(r'''
-class A {
-  static get f => 42;
-  static set f(x) {}
-}
-main() {
-  A.f;
-  A.f = 1;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_superInInvalidContext() async {
-    Source source = addSource(r'''
-class A {
-  m() {}
-}
-class B extends A {
-  B() {
-    var v = super.m();
-  }
-  n() {
-    var v = super.m();
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_typeAliasCannotReferenceItself_returnClass_withTypeAlias() async {
-    Source source = addSource(r'''
-typedef B A();
-class B {
-  A a;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_typeArgument_boundToFunctionType() async {
-    Source source = addSource("class A<T extends void Function(T)>{}");
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_typeArgumentNotMatchingBounds_const() async {
-    Source source = addSource(r'''
-class A {}
-class B extends A {}
-class G<E extends A> {
-  const G();
-}
-f() { return const G<B>(); }''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_typeArgumentNotMatchingBounds_new() async {
-    Source source = addSource(r'''
-class A {}
-class B extends A {}
-class G<E extends A> {}
-f() { return new G<B>(); }''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_typeArgumentNotMatchingBounds_ofFunctionTypeAlias_hasBound() async {
-    Source source = addSource(r'''
-class A {}
-class B extends A {}
-typedef F<T extends A>();
-F<A> fa;
-F<B> fb;
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_typeArgumentNotMatchingBounds_ofFunctionTypeAlias_hasBound2() async {
-    Source source = addSource(r'''
-class MyClass<T> {}
-typedef MyFunction<T, P extends MyClass<T>>();
-class A<T, P extends MyClass<T>> {
-  MyFunction<T, P> f;
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_typeArgumentNotMatchingBounds_ofFunctionTypeAlias_noBound() async {
-    Source source = addSource(r'''
-typedef F<T>();
-F<int> f1;
-F<String> f2;
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_typePromotion_booleanAnd_useInRight() async {
-    Source source = addSource(r'''
-main(Object p) {
-  p is String && p.length != 0;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_typePromotion_booleanAnd_useInRight_accessedInClosureRight_noAssignment() async {
-    Source source = addSource(r'''
-callMe(f()) { f(); }
-main(Object p) {
-  (p is String) && callMe(() { p.length; });
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_typePromotion_conditional_issue14655() async {
-    Source source = addSource(r'''
-class A {}
-class B extends A {}
-class C extends B {
-  mc() {}
-}
-print(_) {}
-main(A p) {
-  (p is C) && (print(() => p) && (p is B)) ? p.mc() : p = null;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_typePromotion_conditional_useInThen() async {
-    Source source = addSource(r'''
-main(Object p) {
-  p is String ? p.length : 0;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_typePromotion_conditional_useInThen_accessedInClosure_noAssignment() async {
-    Source source = addSource(r'''
-callMe(f()) { f(); }
-main(Object p) {
-  p is String ? callMe(() { p.length; }) : 0;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_typePromotion_functionType_arg_ignoreIfNotMoreSpecific() async {
-    Source source = addSource(r'''
-typedef FuncB(B b);
-typedef FuncA(A a);
-class A {}
-class B {}
-main(FuncA f) {
-  if (f is FuncB) {
-    f(new A());
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_typePromotion_functionType_return_ignoreIfNotMoreSpecific() async {
-    Source source = addSource(r'''
-class A {}
-typedef FuncAtoDyn(A a);
-typedef FuncDynToDyn(x);
-main(FuncAtoDyn f) {
-  if (f is FuncDynToDyn) {
-    A a = f(new A());
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_typePromotion_functionType_return_voidToDynamic() async {
-    Source source = addSource(r'''
-typedef FuncDynToDyn(x);
-typedef void FuncDynToVoid(x);
-class A {}
-main(FuncDynToVoid f) {
-  if (f is FuncDynToDyn) {
-    A a = f(null);
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_typePromotion_if_accessedInClosure_noAssignment() async {
-    Source source = addSource(r'''
-callMe(f()) { f(); }
-main(Object p) {
-  if (p is String) {
-    callMe(() {
-      p.length;
-    });
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_typePromotion_if_extends_moreSpecific() async {
-    Source source = addSource(r'''
-class V {}
-class VP extends V {}
-class A<T> {}
-class B<S> extends A<S> {
-  var b;
-}
-
-main(A<V> p) {
-  if (p is B<VP>) {
-    p.b;
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_typePromotion_if_hasAssignment_outsideAfter() async {
-    Source source = addSource(r'''
-main(Object p) {
-  if (p is String) {
-    p.length;
-  }
-  p = 0;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_typePromotion_if_hasAssignment_outsideBefore() async {
-    Source source = addSource(r'''
-main(Object p, Object p2) {
-  p = p2;
-  if (p is String) {
-    p.length;
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_typePromotion_if_implements_moreSpecific() async {
-    Source source = addSource(r'''
-class V {}
-class VP extends V {}
-class A<T> {}
-class B<S> implements A<S> {
-  var b;
-}
-
-main(A<V> p) {
-  if (p is B<VP>) {
-    p.b;
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_typePromotion_if_inClosure_assignedAfter_inSameFunction() async {
-    Source source = addSource(r'''
-main() {
-  f(Object p) {
-    if (p is String) {
-      p.length;
-    }
-    p = 0;
-  };
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_typePromotion_if_is_and_left() async {
-    Source source = addSource(r'''
-bool tt() => true;
-main(Object p) {
-  if (p is String && tt()) {
-    p.length;
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_typePromotion_if_is_and_right() async {
-    Source source = addSource(r'''
-bool tt() => true;
-main(Object p) {
-  if (tt() && p is String) {
-    p.length;
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_typePromotion_if_is_and_subThenSuper() async {
-    Source source = addSource(r'''
-class A {
-  var a;
-}
-class B extends A {
-  var b;
-}
-main(Object p) {
-  if (p is B && p is A) {
-    p.a;
-    p.b;
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_typePromotion_if_is_parenthesized() async {
-    Source source = addSource(r'''
-main(Object p) {
-  if ((p is String)) {
-    p.length;
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_typePromotion_if_is_single() async {
-    Source source = addSource(r'''
-main(Object p) {
-  if (p is String) {
-    p.length;
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_typePromotion_parentheses() async {
-    Source source = addSource(r'''
-main(Object p) {
-  (p is String) ? p.length : 0;
-  (p) is String ? p.length : 0;
-  ((p)) is String ? p.length : 0;
-  ((p) is String) ? p.length : 0;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_typeType_class() async {
-    Source source = addSource(r'''
-class C {}
-f(Type t) {}
-main() {
-  f(C);
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_typeType_class_prefixed() async {
-    addNamedSource("/lib.dart", r'''
-library lib;
-class C {}''');
-    Source source = addSource(r'''
-import 'lib.dart' as p;
-f(Type t) {}
-main() {
-  f(p.C);
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_typeType_functionTypeAlias() async {
-    Source source = addSource(r'''
-typedef F();
-f(Type t) {}
-main() {
-  f(F);
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_typeType_functionTypeAlias_prefixed() async {
-    addNamedSource("/lib.dart", r'''
-library lib;
-typedef F();''');
-    Source source = addSource(r'''
-import 'lib.dart' as p;
-f(Type t) {}
-main() {
-  f(p.F);
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_undefinedConstructorInInitializer_explicit_named() async {
-    Source source = addSource(r'''
-class A {
-  A.named() {}
-}
-class B extends A {
-  B() : super.named();
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_undefinedConstructorInInitializer_explicit_unnamed() async {
-    Source source = addSource(r'''
-class A {
-  A() {}
-}
-class B extends A {
-  B() : super();
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_undefinedConstructorInInitializer_hasOptionalParameters() async {
-    Source source = addSource(r'''
-class A {
-  A([p]) {}
-}
-class B extends A {
-  B();
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_undefinedConstructorInInitializer_implicit() async {
-    Source source = addSource(r'''
-class A {
-  A() {}
-}
-class B extends A {
-  B();
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_undefinedConstructorInInitializer_redirecting() async {
-    Source source = addSource(r'''
-class Foo {
-  Foo.ctor();
-}
-class Bar extends Foo {
-  Bar() : this.ctor();
-  Bar.ctor() : super.ctor();
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_undefinedGetter_static_conditionalAccess() async {
-    // The conditional access operator '?.' can be used to access static
-    // fields.
-    Source source = addSource('''
-class A {
-  static var x;
-}
-var a = A?.x;
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_undefinedGetter_typeSubstitution() async {
-    Source source = addSource(r'''
-class A<E> {
-  E element;
-}
-class B extends A<List> {
-  m() {
-    element.last;
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_undefinedIdentifier_synthetic_whenExpression() async {
-    Source source = addSource(r'''
-print(x) {}
-main() {
-  print(is String);
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [ParserErrorCode.MISSING_IDENTIFIER]);
-  }
-
-  test_undefinedIdentifier_synthetic_whenMethodName() async {
-    Source source = addSource(r'''
-print(x) {}
-main(int p) {
-  p.();
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      ParserErrorCode.MISSING_IDENTIFIER,
-      ParserErrorCode.MISSING_IDENTIFIER,
-      StaticTypeWarningCode.UNDEFINED_GETTER
-    ]);
-  }
-
-  test_undefinedMethod_functionExpression_callMethod() async {
-    Source source = addSource(r'''
-main() {
-  (() => null).call();
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    // A call to verify(source) fails as '.call()' isn't resolved.
-  }
-
-  test_undefinedMethod_functionExpression_directCall() async {
-    Source source = addSource(r'''
-main() {
-  (() => null)();
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    // A call to verify(source) fails as '(() => null)()' isn't resolved.
-  }
-
-  test_undefinedMethod_static_conditionalAccess() async {
-    // The conditional access operator '?.' can be used to access static
-    // methods.
-    Source source = addSource('''
-class A {
-  static void m() {}
-}
-f() { A?.m(); }
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_undefinedOperator_index() async {
-    Source source = addSource(r'''
-class A {
-  operator [](a) {}
-  operator []=(a, b) {}
-}
-f(A a) {
-  a[0];
-  a[0] = 1;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_undefinedOperator_tilde() async {
-    Source source = addSource(r'''
-const A = 3;
-const B = ~((1 << A) - 1);''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_undefinedSetter_importWithPrefix() async {
-    addNamedSource("/lib.dart", r'''
-library lib;
-set y(int value) {}''');
-    Source source = addSource(r'''
-import 'lib.dart' as x;
-main() {
-  x.y = 0;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_undefinedSetter_static_conditionalAccess() async {
-    // The conditional access operator '?.' can be used to access static
-    // fields.
-    Source source = addSource('''
-class A {
-  static var x;
-}
-f() { A?.x = 1; }
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_undefinedSuperMethod_field() async {
-    Source source = addSource(r'''
-class A {
-  var m;
-}
-class B extends A {
-  f() {
-    super.m();
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_undefinedSuperMethod_method() async {
-    Source source = addSource(r'''
-class A {
-  m() {}
-}
-class B extends A {
-  f() {
-    super.m();
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_unusedShownName_unresolved() async {
-    Source source = addSource(r'''
-import 'dart:math' show max, FooBar;
-main() {
-  print(max(1, 2));
-}
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [HintCode.UNDEFINED_SHOWN_NAME]);
-  }
-
-  test_uriDoesNotExist_dll() async {
-    addNamedSource("/lib.dll", "");
-    Source source = addSource("import 'dart-ext:lib';");
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-  }
-
-  test_uriDoesNotExist_dylib() async {
-    addNamedSource("/lib.dylib", "");
-    Source source = addSource("import 'dart-ext:lib';");
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-  }
-
-  test_uriDoesNotExist_so() async {
-    addNamedSource("/lib.so", "");
-    Source source = addSource("import 'dart-ext:lib';");
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-  }
-
-  Future test_useDynamicWithPrefix() async {
-    final Source source = addSource('''
-import 'dart:core' as core;
-
-core.dynamic dynamicVariable;
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_wrongNumberOfParametersForOperator1() async {
-    await _check_wrongNumberOfParametersForOperator1("<");
-    await _check_wrongNumberOfParametersForOperator1(">");
-    await _check_wrongNumberOfParametersForOperator1("<=");
-    await _check_wrongNumberOfParametersForOperator1(">=");
-    await _check_wrongNumberOfParametersForOperator1("+");
-    await _check_wrongNumberOfParametersForOperator1("/");
-    await _check_wrongNumberOfParametersForOperator1("~/");
-    await _check_wrongNumberOfParametersForOperator1("*");
-    await _check_wrongNumberOfParametersForOperator1("%");
-    await _check_wrongNumberOfParametersForOperator1("|");
-    await _check_wrongNumberOfParametersForOperator1("^");
-    await _check_wrongNumberOfParametersForOperator1("&");
-    await _check_wrongNumberOfParametersForOperator1("<<");
-    await _check_wrongNumberOfParametersForOperator1(">>");
-    await _check_wrongNumberOfParametersForOperator1("[]");
-  }
-
-  test_wrongNumberOfParametersForOperator_index() async {
-    Source source = addSource(r'''
-class A {
-  operator []=(a, b) {}
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_wrongNumberOfParametersForOperator_minus() async {
-    await _check_wrongNumberOfParametersForOperator("-", "");
-    await _check_wrongNumberOfParametersForOperator("-", "a");
-  }
-
-  test_wrongNumberOfParametersForSetter() async {
-    Source source = addSource(r'''
-class A {
-  set x(a) {}
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_yield_async_to_dynamic_type() async {
-    Source source = addSource('''
-dynamic f() async* {
-  yield 3;
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_yield_async_to_generic_type() async {
-    Source source = addSource('''
-import 'dart:async';
-Stream f() async* {
-  yield 3;
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_yield_async_to_parameterized_type() async {
-    Source source = addSource('''
-import 'dart:async';
-Stream<int> f() async* {
-  yield 3;
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_yield_async_to_untyped() async {
-    Source source = addSource('''
-f() async* {
-  yield 3;
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_yield_each_async_dynamic_to_dynamic() async {
-    Source source = addSource('''
-f() async* {
-  yield* g();
-}
-g() => null;
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_yield_each_async_dynamic_to_stream() async {
-    Source source = addSource('''
-import 'dart:async';
-Stream f() async* {
-  yield* g();
-}
-g() => null;
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_yield_each_async_dynamic_to_typed_stream() async {
-    Source source = addSource('''
-import 'dart:async';
-Stream<int> f() async* {
-  yield* g();
-}
-g() => null;
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_yield_each_async_stream_to_dynamic() async {
-    Source source = addSource('''
-import 'dart:async';
-f() async* {
-  yield* g();
-}
-Stream g() => null;
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_yield_each_async_typed_stream_to_dynamic() async {
-    Source source = addSource('''
-import 'dart:async';
-f() async* {
-  yield* g();
-}
-Stream<int> g() => null;
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_yield_each_async_typed_stream_to_typed_stream() async {
-    Source source = addSource('''
-import 'dart:async';
-Stream<int> f() async* {
-  yield* g();
-}
-Stream<int> g() => null;
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_yield_each_sync_dynamic_to_dynamic() async {
-    Source source = addSource('''
-f() sync* {
-  yield* g();
-}
-g() => null;
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_yield_each_sync_dynamic_to_iterable() async {
-    Source source = addSource('''
-Iterable f() sync* {
-  yield* g();
-}
-g() => null;
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_yield_each_sync_dynamic_to_typed_iterable() async {
-    Source source = addSource('''
-Iterable<int> f() sync* {
-  yield* g();
-}
-g() => null;
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_yield_each_sync_iterable_to_dynamic() async {
-    Source source = addSource('''
-f() sync* {
-  yield* g();
-}
-Iterable g() => null;
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_yield_each_sync_typed_iterable_to_dynamic() async {
-    Source source = addSource('''
-f() sync* {
-  yield* g();
-}
-Iterable<int> g() => null;
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_yield_each_sync_typed_iterable_to_typed_iterable() async {
-    Source source = addSource('''
-Iterable<int> f() sync* {
-  yield* g();
-}
-Iterable<int> g() => null;
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_yield_sync_to_dynamic_type() async {
-    Source source = addSource('''
-dynamic f() sync* {
-  yield 3;
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_yield_sync_to_generic_type() async {
-    Source source = addSource('''
-Iterable f() sync* {
-  yield 3;
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_yield_sync_to_parameterized_type() async {
-    Source source = addSource('''
-Iterable<int> f() sync* {
-  yield 3;
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_yield_sync_to_untyped() async {
-    Source source = addSource('''
-f() sync* {
-  yield 3;
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_yieldInNonGenerator_asyncStar() async {
-    Source source = addSource(r'''
-f() async* {
-  yield 0;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_yieldInNonGenerator_syncStar() async {
-    Source source = addSource(r'''
-f() sync* {
-  yield 0;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  Future<void> _check_wrongNumberOfParametersForOperator(
-      String name, String parameters) async {
-    Source source = addSource("""
-class A {
-  operator $name($parameters) {}
-}""");
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  Future<void> _check_wrongNumberOfParametersForOperator1(String name) async {
-    await _check_wrongNumberOfParametersForOperator(name, "a");
-  }
-}
diff --git a/pkg/analyzer/test/generated/non_hint_code.dart b/pkg/analyzer/test/generated/non_hint_code.dart
new file mode 100644
index 0000000..800b3c1
--- /dev/null
+++ b/pkg/analyzer/test/generated/non_hint_code.dart
@@ -0,0 +1,1108 @@
+// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:analyzer/error/error.dart';
+import 'package:analyzer/src/error/codes.dart';
+import 'package:analyzer/src/generated/source_io.dart';
+
+import 'resolver_test_case.dart';
+
+abstract class NonHintCodeTest extends ResolverTestCase {
+  @override
+  void reset() {
+    super.resetWith(packages: [
+      [
+        'meta',
+        r'''
+library meta;
+
+const _AlwaysThrows alwaysThrows = const _AlwaysThrows();
+const _Literal literal = const _Literal();
+
+class _AlwaysThrows {
+  const _AlwaysThrows();
+}
+class _Literal {
+  const _Literal();
+}
+'''
+      ]
+    ]);
+  }
+
+  test_async_future_object_without_return() async {
+    Source source = addSource('''
+import 'dart:async';
+Future<Object> f() async {}
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [HintCode.MISSING_RETURN]);
+    verify([source]);
+  }
+
+  test_deadCode_afterForEachWithBreakLabel() async {
+    Source source = addSource('''
+f() {
+  named: {
+    for (var x in [1]) {
+      if (x == null)
+        break named;
+    }
+    return;
+  }
+  print('not dead');
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_deadCode_afterForWithBreakLabel() async {
+    Source source = addSource('''
+f() {
+  named: {
+    for (int i = 0; i < 7; i++) {
+      if (i == null)
+        break named;
+    }
+    return;
+  }
+  print('not dead');
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_deadCode_afterTryCatch() async {
+    Source source = addSource('''
+main() {
+  try {
+    return f();
+  } catch (e) {
+    print(e);
+  }
+  print('not dead');
+}
+f() {
+  throw 'foo';
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_deadCode_deadBlock_conditionalElse_debugConst() async {
+    Source source = addSource(r'''
+const bool DEBUG = true;
+f() {
+  DEBUG ? 1 : 2;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_deadCode_deadBlock_conditionalIf_debugConst() async {
+    Source source = addSource(r'''
+const bool DEBUG = false;
+f() {
+  DEBUG ? 1 : 2;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_deadCode_deadBlock_else() async {
+    Source source = addSource(r'''
+const bool DEBUG = true;
+f() {
+  if(DEBUG) {} else {}
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_deadCode_deadBlock_if_debugConst_prefixedIdentifier() async {
+    Source source = addSource(r'''
+class A {
+  static const bool DEBUG = false;
+}
+f() {
+  if(A.DEBUG) {}
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_deadCode_deadBlock_if_debugConst_prefixedIdentifier2() async {
+    Source source = addSource(r'''
+library L;
+import 'lib2.dart';
+f() {
+  if(A.DEBUG) {}
+}''');
+    addNamedSource("/lib2.dart", r'''
+library lib2;
+class A {
+  static const bool DEBUG = false;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_deadCode_deadBlock_if_debugConst_propertyAccessor() async {
+    Source source = addSource(r'''
+library L;
+import 'lib2.dart' as LIB;
+f() {
+  if(LIB.A.DEBUG) {}
+}''');
+    addNamedSource("/lib2.dart", r'''
+library lib2;
+class A {
+  static const bool DEBUG = false;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_deadCode_deadBlock_if_debugConst_simpleIdentifier() async {
+    Source source = addSource(r'''
+const bool DEBUG = false;
+f() {
+  if(DEBUG) {}
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_deadCode_deadBlock_while_debugConst() async {
+    Source source = addSource(r'''
+const bool DEBUG = false;
+f() {
+  while(DEBUG) {}
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_deadCode_deadCatch_onCatchSubtype() async {
+    Source source = addSource(r'''
+class A {}
+class B extends A {}
+f() {
+  try {} on B catch (e) {} on A catch (e) {} catch (e) {}
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_deadCode_deadFinalBreakInCase() async {
+    Source source = addSource(r'''
+f() {
+  switch (true) {
+  case true:
+    try {
+      int a = 1;
+    } finally {
+      return;
+    }
+    break;
+  default:
+    break;
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_deadCode_deadOperandLHS_and_debugConst() async {
+    Source source = addSource(r'''
+const bool DEBUG = false;
+f() {
+  bool b = DEBUG && false;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_deadCode_deadOperandLHS_or_debugConst() async {
+    Source source = addSource(r'''
+const bool DEBUG = true;
+f() {
+  bool b = DEBUG || true;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_deadCode_statementAfterIfWithoutElse() async {
+    Source source = addSource(r'''
+f() {
+  if (1 < 0) {
+    return;
+  }
+  int a = 1;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_duplicateImport_as() async {
+    Source source = addSource(r'''
+library L;
+import 'lib1.dart';
+import 'lib1.dart' as one;
+A a;
+one.A a2;''');
+    addNamedSource("/lib1.dart", r'''
+library lib1;
+class A {}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_duplicateImport_hide() async {
+    Source source = addSource(r'''
+library L;
+import 'lib1.dart';
+import 'lib1.dart' hide A;
+A a;
+B b;''');
+    addNamedSource("/lib1.dart", r'''
+library lib1;
+class A {}
+class B {}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_duplicateImport_show() async {
+    Source source = addSource(r'''
+library L;
+import 'lib1.dart';
+import 'lib1.dart' show A;
+A a;
+B b;''');
+    addNamedSource("/lib1.dart", r'''
+library lib1;
+class A {}
+class B {}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_importDeferredLibraryWithLoadFunction() async {
+    await resolveWithErrors(<String>[
+      r'''
+library lib1;
+f() {}''',
+      r'''
+library root;
+import 'lib1.dart' deferred as lib1;
+main() { lib1.f(); }'''
+    ], const <ErrorCode>[]);
+  }
+
+  test_issue20904BuggyTypePromotionAtIfJoin_1() async {
+    // https://code.google.com/p/dart/issues/detail?id=20904
+    Source source = addSource(r'''
+f(var message, var dynamic_) {
+  if (message is Function) {
+    message = dynamic_;
+  }
+  int s = message;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_issue20904BuggyTypePromotionAtIfJoin_3() async {
+    // https://code.google.com/p/dart/issues/detail?id=20904
+    Source source = addSource(r'''
+f(var message) {
+  var dynamic_;
+  if (message is Function) {
+    message = dynamic_;
+  } else {
+    return;
+  }
+  int s = message;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_issue20904BuggyTypePromotionAtIfJoin_4() async {
+    // https://code.google.com/p/dart/issues/detail?id=20904
+    Source source = addSource(r'''
+f(var message) {
+  if (message is Function) {
+    message = '';
+  } else {
+    return;
+  }
+  String s = message;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_missingReturn_alwaysThrows() async {
+    Source source = addSource(r'''
+import 'package:meta/meta.dart';
+
+@alwaysThrows
+void a() {
+  throw 'msg';
+}
+
+int f() {
+  a();
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_missingReturn_emptyFunctionBody() async {
+    Source source = addSource(r'''
+abstract class A {
+  int m();
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_missingReturn_expressionFunctionBody() async {
+    Source source = addSource("int f() => 0;");
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_missingReturn_futureVoidReturnType() async {
+    Source source = addSource('''
+import 'dart:async';
+Future<void> f() async {}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_missingReturn_noReturnType() async {
+    Source source = addSource("f() {}");
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_missingReturn_voidReturnType() async {
+    Source source = addSource("void f() {}");
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nullAwareInCondition_for_noCondition() async {
+    Source source = addSource(r'''
+m(x) {
+  for (var v = x; ; v++) {}
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nullAwareInCondition_if_notTopLevel() async {
+    Source source = addSource(r'''
+m(x) {
+  if (x?.y == null) {}
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_overrideEqualsButNotHashCode() async {
+    Source source = addSource(r'''
+class A {
+  bool operator ==(x) { return x; }
+  get hashCode => 0;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_invalidLiteralAnnotation_constConstructor() async {
+    Source source = addSource(r'''
+import 'package:meta/meta.dart';
+class A {
+  @literal
+  const A();
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nonConstCallToLiteralConstructor_constCreation() async {
+    Source source = addSource(r'''
+import 'package:meta/meta.dart';
+class A {
+  @literal
+  const A();
+}
+
+void main() {
+  const a = const A();
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nonConstCallToLiteralConstructor_constContextCreation() async {
+    Source source = addSource(r'''
+import 'package:meta/meta.dart';
+class A {
+  @literal
+  const A();
+}
+
+void main() {
+  const a = A();
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_nonConstCallToLiteralConstructor_unconstableCreation() async {
+    Source source = addSource(r'''
+import 'package:meta/meta.dart';
+class A {
+  @literal
+  const A(List list);
+}
+
+void main() {
+  var a = A(new List());
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_overrideOnNonOverridingField_inInterface() async {
+    Source source = addSource(r'''
+class A {
+  int get a => 0;
+  void set b(_) {}
+  int c;
+}
+class B implements A {
+  @override
+  final int a = 1;
+  @override
+  int b;
+  @override
+  int c;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+      source,
+      [CompileTimeErrorCode.INVALID_OVERRIDE],
+    );
+    verify([source]);
+  }
+
+  test_overrideOnNonOverridingField_inSuperclass() async {
+    Source source = addSource(r'''
+class A {
+  int get a => 0;
+  void set b(_) {}
+  int c;
+}
+class B extends A {
+  @override
+  final int a = 1;
+  @override
+  int b;
+  @override
+  int c;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(
+      source,
+      [CompileTimeErrorCode.INVALID_OVERRIDE],
+    );
+    verify([source]);
+  }
+
+  test_overrideOnNonOverridingGetter_inInterface() async {
+    Source source = addSource(r'''
+class A {
+  int get m => 0;
+}
+class B implements A {
+  @override
+  int get m => 1;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_overrideOnNonOverridingGetter_inSuperclass() async {
+    Source source = addSource(r'''
+class A {
+  int get m => 0;
+}
+class B extends A {
+  @override
+  int get m => 1;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_overrideOnNonOverridingMethod_inInterface() async {
+    Source source = addSource(r'''
+class A {
+  int m() => 0;
+}
+class B implements A {
+  @override
+  int m() => 1;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_overrideOnNonOverridingMethod_inInterfaces() async {
+    Source source = addSource(r'''
+abstract class I {
+  void foo(int _);
+}
+
+abstract class J {
+  void foo(String _);
+}
+
+class C implements I, J {
+  @override
+  void foo(Object _) {}
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_overrideOnNonOverridingMethod_inSuperclass() async {
+    Source source = addSource(r'''
+class A {
+  int m() => 0;
+}
+class B extends A {
+  @override
+  int m() => 1;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_overrideOnNonOverridingMethod_inSuperclass_abstract() async {
+    Source source = addSource(r'''
+abstract class A {
+  int m();
+}
+class B extends A {
+  @override
+  int m() => 1;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_overrideOnNonOverridingSetter_inInterface() async {
+    Source source = addSource(r'''
+class A {
+  set m(int x) {}
+}
+class B implements A {
+  @override
+  set m(int x) {}
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_overrideOnNonOverridingSetter_inSuperclass() async {
+    Source source = addSource(r'''
+class A {
+  set m(int x) {}
+}
+class B extends A {
+  @override
+  set m(int x) {}
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_propagatedFieldType() async {
+    Source source = addSource(r'''
+class A { }
+class X<T> {
+  final x = new List<T>();
+}
+class Z {
+  final X<A> y = new X<A>();
+  foo() {
+    y.x.add(new A());
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_proxy_annotation_prefixed() async {
+    Source source = addSource(r'''
+library L;
+@proxy
+class A {}
+f(var a) {
+  a = new A();
+  a.m();
+  var x = a.g;
+  a.s = 1;
+  var y = a + a;
+  a++;
+  ++a;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+  }
+
+  test_proxy_annotation_prefixed2() async {
+    Source source = addSource(r'''
+library L;
+@proxy
+class A {}
+class B {
+  f(var a) {
+    a = new A();
+    a.m();
+    var x = a.g;
+    a.s = 1;
+    var y = a + a;
+    a++;
+    ++a;
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+  }
+
+  test_proxy_annotation_prefixed3() async {
+    Source source = addSource(r'''
+library L;
+class B {
+  f(var a) {
+    a = new A();
+    a.m();
+    var x = a.g;
+    a.s = 1;
+    var y = a + a;
+    a++;
+    ++a;
+  }
+}
+@proxy
+class A {}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+  }
+
+  test_undefinedGetter_inSubtype() async {
+    Source source = addSource(r'''
+class A {}
+class B extends A {
+  get b => 0;
+}
+f(var a) {
+  if(a is A) {
+    return a.b;
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [StaticTypeWarningCode.UNDEFINED_GETTER]);
+  }
+
+  test_undefinedMethod_assignmentExpression_inSubtype() async {
+    Source source = addSource(r'''
+class A {}
+class B extends A {
+  operator +(B b) {return new B();}
+}
+f(var a, var a2) {
+  a = new A();
+  a2 = new A();
+  a += a2;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+  }
+
+  test_undefinedMethod_dynamic() async {
+    Source source = addSource(r'''
+class D<T extends dynamic> {
+  fieldAccess(T t) => t.abc;
+  methodAccess(T t) => t.xyz(1, 2, 'three');
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+  }
+
+  test_undefinedMethod_unionType_all() async {
+    Source source = addSource(r'''
+class A {
+  int m(int x) => 0;
+}
+class B {
+  String m() => '0';
+}
+f(A a, B b) {
+  var ab;
+  if (0 < 1) {
+    ab = a;
+  } else {
+    ab = b;
+  }
+  ab.m();
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+  }
+
+  test_undefinedMethod_unionType_some() async {
+    Source source = addSource(r'''
+class A {
+  int m(int x) => 0;
+}
+class B {}
+f(A a, B b) {
+  var ab;
+  if (0 < 1) {
+    ab = a;
+  } else {
+    ab = b;
+  }
+  ab.m(0);
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+  }
+
+  test_undefinedOperator_binaryExpression_inSubtype() async {
+    Source source = addSource(r'''
+class A {}
+class B extends A {
+  operator +(B b) {}
+}
+f(var a) {
+  if(a is A) {
+    a + 1;
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [StaticTypeWarningCode.UNDEFINED_OPERATOR]);
+  }
+
+  test_undefinedOperator_indexBoth_inSubtype() async {
+    Source source = addSource(r'''
+class A {}
+class B extends A {
+  operator [](int index) {}
+}
+f(var a) {
+  if(a is A) {
+    a[0]++;
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      StaticTypeWarningCode.UNDEFINED_OPERATOR,
+      StaticTypeWarningCode.UNDEFINED_OPERATOR,
+    ]);
+  }
+
+  test_undefinedOperator_indexGetter_inSubtype() async {
+    Source source = addSource(r'''
+class A {}
+class B extends A {
+  operator [](int index) {}
+}
+f(var a) {
+  if(a is A) {
+    a[0];
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [StaticTypeWarningCode.UNDEFINED_OPERATOR]);
+  }
+
+  test_undefinedOperator_indexSetter_inSubtype() async {
+    Source source = addSource(r'''
+class A {}
+class B extends A {
+  operator []=(i, v) {}
+}
+f(var a) {
+  if(a is A) {
+    a[0] = 1;
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [StaticTypeWarningCode.UNDEFINED_OPERATOR]);
+  }
+
+  test_undefinedOperator_postfixExpression() async {
+    Source source = addSource(r'''
+class A {}
+class B extends A {
+  operator +(B b) {return new B();}
+}
+f(var a) {
+  if(a is A) {
+    a++;
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+  }
+
+  test_undefinedOperator_prefixExpression() async {
+    Source source = addSource(r'''
+class A {}
+class B extends A {
+  operator +(B b) {return new B();}
+}
+f(var a) {
+  if(a is A) {
+    ++a;
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+  }
+
+  test_undefinedSetter_inSubtype() async {
+    Source source = addSource(r'''
+class A {}
+class B extends A {
+  set b(x) {}
+}
+f(var a) {
+  if (a is A) {
+    a.b = 0;
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [StaticTypeWarningCode.UNDEFINED_SETTER]);
+  }
+
+  test_unnecessaryNoSuchMethod_blockBody_notReturnStatement() async {
+    Source source = addSource(r'''
+class A {
+  noSuchMethod(x) => super.noSuchMethod(x);
+}
+class B extends A {
+  mmm();
+  noSuchMethod(y) {
+    print(y);
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_unnecessaryNoSuchMethod_blockBody_notSingleStatement() async {
+    Source source = addSource(r'''
+class A {
+  noSuchMethod(x) => super.noSuchMethod(x);
+}
+class B extends A {
+  mmm();
+  noSuchMethod(y) {
+    print(y);
+    return super.noSuchMethod(y);
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_unnecessaryNoSuchMethod_expressionBody_notNoSuchMethod() async {
+    Source source = addSource(r'''
+class A {
+  noSuchMethod(x) => super.noSuchMethod(x);
+}
+class B extends A {
+  mmm();
+  noSuchMethod(y) => super.hashCode;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_unnecessaryNoSuchMethod_expressionBody_notSuper() async {
+    Source source = addSource(r'''
+class A {
+  noSuchMethod(x) => super.noSuchMethod(x);
+}
+class B extends A {
+  mmm();
+  noSuchMethod(y) => 42;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+}
+
+class PubSuggestionCodeTest extends ResolverTestCase {
+  // TODO(brianwilkerson) The tests in this class are not being run, and all but
+  //  the first would fail. We should implement these checks and enable the
+  //  tests.
+  test_import_package() async {
+    Source source = addSource("import 'package:somepackage/other.dart';");
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.URI_DOES_NOT_EXIST]);
+  }
+
+  test_import_packageWithDotDot() async {
+    Source source = addSource("import 'package:somepackage/../other.dart';");
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CompileTimeErrorCode.URI_DOES_NOT_EXIST,
+      HintCode.PACKAGE_IMPORT_CONTAINS_DOT_DOT
+    ]);
+  }
+
+  test_import_packageWithLeadingDotDot() async {
+    Source source = addSource("import 'package:../other.dart';");
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      CompileTimeErrorCode.URI_DOES_NOT_EXIST,
+      HintCode.PACKAGE_IMPORT_CONTAINS_DOT_DOT
+    ]);
+  }
+
+  test_import_referenceIntoLibDirectory() async {
+    addNamedSource("/myproj/pubspec.yaml", "");
+    addNamedSource("/myproj/lib/other.dart", "");
+    Source source =
+        addNamedSource("/myproj/web/test.dart", "import '../lib/other.dart';");
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [HintCode.FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE]);
+  }
+
+  test_import_referenceIntoLibDirectory_no_pubspec() async {
+    addNamedSource("/myproj/lib/other.dart", "");
+    Source source =
+        addNamedSource("/myproj/web/test.dart", "import '../lib/other.dart';");
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+  }
+
+  test_import_referenceOutOfLibDirectory() async {
+    addNamedSource("/myproj/pubspec.yaml", "");
+    addNamedSource("/myproj/web/other.dart", "");
+    Source source =
+        addNamedSource("/myproj/lib/test.dart", "import '../web/other.dart';");
+    await computeAnalysisResult(source);
+    assertErrors(
+        source, [HintCode.FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE]);
+  }
+
+  test_import_referenceOutOfLibDirectory_no_pubspec() async {
+    addNamedSource("/myproj/web/other.dart", "");
+    Source source =
+        addNamedSource("/myproj/lib/test.dart", "import '../web/other.dart';");
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+  }
+
+  test_import_valid_inside_lib1() async {
+    addNamedSource("/myproj/pubspec.yaml", "");
+    addNamedSource("/myproj/lib/other.dart", "");
+    Source source =
+        addNamedSource("/myproj/lib/test.dart", "import 'other.dart';");
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+  }
+
+  test_import_valid_inside_lib2() async {
+    addNamedSource("/myproj/pubspec.yaml", "");
+    addNamedSource("/myproj/lib/bar/other.dart", "");
+    Source source = addNamedSource(
+        "/myproj/lib/foo/test.dart", "import '../bar/other.dart';");
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+  }
+
+  test_import_valid_outside_lib() async {
+    addNamedSource("/myproj/pubspec.yaml", "");
+    addNamedSource("/myproj/web/other.dart", "");
+    Source source =
+        addNamedSource("/myproj/lib2/test.dart", "import '../web/other.dart';");
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+  }
+}
diff --git a/pkg/analyzer/test/generated/non_hint_code_driver_test.dart b/pkg/analyzer/test/generated/non_hint_code_driver_test.dart
index d13f558..c7c53cf 100644
--- a/pkg/analyzer/test/generated/non_hint_code_driver_test.dart
+++ b/pkg/analyzer/test/generated/non_hint_code_driver_test.dart
@@ -4,7 +4,7 @@
 
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import 'non_hint_code_test.dart';
+import 'non_hint_code.dart';
 
 main() {
   defineReflectiveSuite(() {
diff --git a/pkg/analyzer/test/generated/non_hint_code_test.dart b/pkg/analyzer/test/generated/non_hint_code_test.dart
deleted file mode 100644
index bf270f1..0000000
--- a/pkg/analyzer/test/generated/non_hint_code_test.dart
+++ /dev/null
@@ -1,1116 +0,0 @@
-// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'package:analyzer/error/error.dart';
-import 'package:analyzer/src/error/codes.dart';
-import 'package:analyzer/src/generated/source_io.dart';
-import 'package:test_reflective_loader/test_reflective_loader.dart';
-
-import 'resolver_test_case.dart';
-
-main() {
-  defineReflectiveSuite(() {
-    defineReflectiveTests(NonHintCodeTest);
-  });
-}
-
-@reflectiveTest
-class NonHintCodeTest extends ResolverTestCase {
-  @override
-  void reset() {
-    super.resetWith(packages: [
-      [
-        'meta',
-        r'''
-library meta;
-
-const _AlwaysThrows alwaysThrows = const _AlwaysThrows();
-const _Literal literal = const _Literal();
-
-class _AlwaysThrows {
-  const _AlwaysThrows();
-}
-class _Literal {
-  const _Literal();
-}
-'''
-      ]
-    ]);
-  }
-
-  test_async_future_object_without_return() async {
-    Source source = addSource('''
-import 'dart:async';
-Future<Object> f() async {}
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [HintCode.MISSING_RETURN]);
-    verify([source]);
-  }
-
-  test_deadCode_afterForEachWithBreakLabel() async {
-    Source source = addSource('''
-f() {
-  named: {
-    for (var x in [1]) {
-      if (x == null)
-        break named;
-    }
-    return;
-  }
-  print('not dead');
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_deadCode_afterForWithBreakLabel() async {
-    Source source = addSource('''
-f() {
-  named: {
-    for (int i = 0; i < 7; i++) {
-      if (i == null)
-        break named;
-    }
-    return;
-  }
-  print('not dead');
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_deadCode_afterTryCatch() async {
-    Source source = addSource('''
-main() {
-  try {
-    return f();
-  } catch (e) {
-    print(e);
-  }
-  print('not dead');
-}
-f() {
-  throw 'foo';
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_deadCode_deadBlock_conditionalElse_debugConst() async {
-    Source source = addSource(r'''
-const bool DEBUG = true;
-f() {
-  DEBUG ? 1 : 2;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_deadCode_deadBlock_conditionalIf_debugConst() async {
-    Source source = addSource(r'''
-const bool DEBUG = false;
-f() {
-  DEBUG ? 1 : 2;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_deadCode_deadBlock_else() async {
-    Source source = addSource(r'''
-const bool DEBUG = true;
-f() {
-  if(DEBUG) {} else {}
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_deadCode_deadBlock_if_debugConst_prefixedIdentifier() async {
-    Source source = addSource(r'''
-class A {
-  static const bool DEBUG = false;
-}
-f() {
-  if(A.DEBUG) {}
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_deadCode_deadBlock_if_debugConst_prefixedIdentifier2() async {
-    Source source = addSource(r'''
-library L;
-import 'lib2.dart';
-f() {
-  if(A.DEBUG) {}
-}''');
-    addNamedSource("/lib2.dart", r'''
-library lib2;
-class A {
-  static const bool DEBUG = false;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_deadCode_deadBlock_if_debugConst_propertyAccessor() async {
-    Source source = addSource(r'''
-library L;
-import 'lib2.dart' as LIB;
-f() {
-  if(LIB.A.DEBUG) {}
-}''');
-    addNamedSource("/lib2.dart", r'''
-library lib2;
-class A {
-  static const bool DEBUG = false;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_deadCode_deadBlock_if_debugConst_simpleIdentifier() async {
-    Source source = addSource(r'''
-const bool DEBUG = false;
-f() {
-  if(DEBUG) {}
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_deadCode_deadBlock_while_debugConst() async {
-    Source source = addSource(r'''
-const bool DEBUG = false;
-f() {
-  while(DEBUG) {}
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_deadCode_deadCatch_onCatchSubtype() async {
-    Source source = addSource(r'''
-class A {}
-class B extends A {}
-f() {
-  try {} on B catch (e) {} on A catch (e) {} catch (e) {}
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_deadCode_deadFinalBreakInCase() async {
-    Source source = addSource(r'''
-f() {
-  switch (true) {
-  case true:
-    try {
-      int a = 1;
-    } finally {
-      return;
-    }
-    break;
-  default:
-    break;
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_deadCode_deadOperandLHS_and_debugConst() async {
-    Source source = addSource(r'''
-const bool DEBUG = false;
-f() {
-  bool b = DEBUG && false;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_deadCode_deadOperandLHS_or_debugConst() async {
-    Source source = addSource(r'''
-const bool DEBUG = true;
-f() {
-  bool b = DEBUG || true;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_deadCode_statementAfterIfWithoutElse() async {
-    Source source = addSource(r'''
-f() {
-  if (1 < 0) {
-    return;
-  }
-  int a = 1;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_duplicateImport_as() async {
-    Source source = addSource(r'''
-library L;
-import 'lib1.dart';
-import 'lib1.dart' as one;
-A a;
-one.A a2;''');
-    addNamedSource("/lib1.dart", r'''
-library lib1;
-class A {}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_duplicateImport_hide() async {
-    Source source = addSource(r'''
-library L;
-import 'lib1.dart';
-import 'lib1.dart' hide A;
-A a;
-B b;''');
-    addNamedSource("/lib1.dart", r'''
-library lib1;
-class A {}
-class B {}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_duplicateImport_show() async {
-    Source source = addSource(r'''
-library L;
-import 'lib1.dart';
-import 'lib1.dart' show A;
-A a;
-B b;''');
-    addNamedSource("/lib1.dart", r'''
-library lib1;
-class A {}
-class B {}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_importDeferredLibraryWithLoadFunction() async {
-    await resolveWithErrors(<String>[
-      r'''
-library lib1;
-f() {}''',
-      r'''
-library root;
-import 'lib1.dart' deferred as lib1;
-main() { lib1.f(); }'''
-    ], const <ErrorCode>[]);
-  }
-
-  test_issue20904BuggyTypePromotionAtIfJoin_1() async {
-    // https://code.google.com/p/dart/issues/detail?id=20904
-    Source source = addSource(r'''
-f(var message, var dynamic_) {
-  if (message is Function) {
-    message = dynamic_;
-  }
-  int s = message;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_issue20904BuggyTypePromotionAtIfJoin_3() async {
-    // https://code.google.com/p/dart/issues/detail?id=20904
-    Source source = addSource(r'''
-f(var message) {
-  var dynamic_;
-  if (message is Function) {
-    message = dynamic_;
-  } else {
-    return;
-  }
-  int s = message;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_issue20904BuggyTypePromotionAtIfJoin_4() async {
-    // https://code.google.com/p/dart/issues/detail?id=20904
-    Source source = addSource(r'''
-f(var message) {
-  if (message is Function) {
-    message = '';
-  } else {
-    return;
-  }
-  String s = message;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_missingReturn_alwaysThrows() async {
-    Source source = addSource(r'''
-import 'package:meta/meta.dart';
-
-@alwaysThrows
-void a() {
-  throw 'msg';
-}
-
-int f() {
-  a();
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_missingReturn_emptyFunctionBody() async {
-    Source source = addSource(r'''
-abstract class A {
-  int m();
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_missingReturn_expressionFunctionBody() async {
-    Source source = addSource("int f() => 0;");
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_missingReturn_futureVoidReturnType() async {
-    Source source = addSource('''
-import 'dart:async';
-Future<void> f() async {}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_missingReturn_noReturnType() async {
-    Source source = addSource("f() {}");
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_missingReturn_voidReturnType() async {
-    Source source = addSource("void f() {}");
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nullAwareInCondition_for_noCondition() async {
-    Source source = addSource(r'''
-m(x) {
-  for (var v = x; ; v++) {}
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nullAwareInCondition_if_notTopLevel() async {
-    Source source = addSource(r'''
-m(x) {
-  if (x?.y == null) {}
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_overrideEqualsButNotHashCode() async {
-    Source source = addSource(r'''
-class A {
-  bool operator ==(x) { return x; }
-  get hashCode => 0;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_invalidLiteralAnnotation_constConstructor() async {
-    Source source = addSource(r'''
-import 'package:meta/meta.dart';
-class A {
-  @literal
-  const A();
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nonConstCallToLiteralConstructor_constCreation() async {
-    Source source = addSource(r'''
-import 'package:meta/meta.dart';
-class A {
-  @literal
-  const A();
-}
-
-void main() {
-  const a = const A();
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nonConstCallToLiteralConstructor_constContextCreation() async {
-    Source source = addSource(r'''
-import 'package:meta/meta.dart';
-class A {
-  @literal
-  const A();
-}
-
-void main() {
-  const a = A();
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_nonConstCallToLiteralConstructor_unconstableCreation() async {
-    Source source = addSource(r'''
-import 'package:meta/meta.dart';
-class A {
-  @literal
-  const A(List list);
-}
-
-void main() {
-  var a = A(new List());
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_overrideOnNonOverridingField_inInterface() async {
-    Source source = addSource(r'''
-class A {
-  int get a => 0;
-  void set b(_) {}
-  int c;
-}
-class B implements A {
-  @override
-  final int a = 1;
-  @override
-  int b;
-  @override
-  int c;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-      source,
-      [CompileTimeErrorCode.INVALID_OVERRIDE],
-    );
-    verify([source]);
-  }
-
-  test_overrideOnNonOverridingField_inSuperclass() async {
-    Source source = addSource(r'''
-class A {
-  int get a => 0;
-  void set b(_) {}
-  int c;
-}
-class B extends A {
-  @override
-  final int a = 1;
-  @override
-  int b;
-  @override
-  int c;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(
-      source,
-      [CompileTimeErrorCode.INVALID_OVERRIDE],
-    );
-    verify([source]);
-  }
-
-  test_overrideOnNonOverridingGetter_inInterface() async {
-    Source source = addSource(r'''
-class A {
-  int get m => 0;
-}
-class B implements A {
-  @override
-  int get m => 1;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_overrideOnNonOverridingGetter_inSuperclass() async {
-    Source source = addSource(r'''
-class A {
-  int get m => 0;
-}
-class B extends A {
-  @override
-  int get m => 1;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_overrideOnNonOverridingMethod_inInterface() async {
-    Source source = addSource(r'''
-class A {
-  int m() => 0;
-}
-class B implements A {
-  @override
-  int m() => 1;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_overrideOnNonOverridingMethod_inInterfaces() async {
-    Source source = addSource(r'''
-abstract class I {
-  void foo(int _);
-}
-
-abstract class J {
-  void foo(String _);
-}
-
-class C implements I, J {
-  @override
-  void foo(Object _) {}
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_overrideOnNonOverridingMethod_inSuperclass() async {
-    Source source = addSource(r'''
-class A {
-  int m() => 0;
-}
-class B extends A {
-  @override
-  int m() => 1;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_overrideOnNonOverridingMethod_inSuperclass_abstract() async {
-    Source source = addSource(r'''
-abstract class A {
-  int m();
-}
-class B extends A {
-  @override
-  int m() => 1;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_overrideOnNonOverridingSetter_inInterface() async {
-    Source source = addSource(r'''
-class A {
-  set m(int x) {}
-}
-class B implements A {
-  @override
-  set m(int x) {}
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_overrideOnNonOverridingSetter_inSuperclass() async {
-    Source source = addSource(r'''
-class A {
-  set m(int x) {}
-}
-class B extends A {
-  @override
-  set m(int x) {}
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_propagatedFieldType() async {
-    Source source = addSource(r'''
-class A { }
-class X<T> {
-  final x = new List<T>();
-}
-class Z {
-  final X<A> y = new X<A>();
-  foo() {
-    y.x.add(new A());
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_proxy_annotation_prefixed() async {
-    Source source = addSource(r'''
-library L;
-@proxy
-class A {}
-f(var a) {
-  a = new A();
-  a.m();
-  var x = a.g;
-  a.s = 1;
-  var y = a + a;
-  a++;
-  ++a;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-  }
-
-  test_proxy_annotation_prefixed2() async {
-    Source source = addSource(r'''
-library L;
-@proxy
-class A {}
-class B {
-  f(var a) {
-    a = new A();
-    a.m();
-    var x = a.g;
-    a.s = 1;
-    var y = a + a;
-    a++;
-    ++a;
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-  }
-
-  test_proxy_annotation_prefixed3() async {
-    Source source = addSource(r'''
-library L;
-class B {
-  f(var a) {
-    a = new A();
-    a.m();
-    var x = a.g;
-    a.s = 1;
-    var y = a + a;
-    a++;
-    ++a;
-  }
-}
-@proxy
-class A {}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-  }
-
-  test_undefinedGetter_inSubtype() async {
-    Source source = addSource(r'''
-class A {}
-class B extends A {
-  get b => 0;
-}
-f(var a) {
-  if(a is A) {
-    return a.b;
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [StaticTypeWarningCode.UNDEFINED_GETTER]);
-  }
-
-  test_undefinedMethod_assignmentExpression_inSubtype() async {
-    Source source = addSource(r'''
-class A {}
-class B extends A {
-  operator +(B b) {return new B();}
-}
-f(var a, var a2) {
-  a = new A();
-  a2 = new A();
-  a += a2;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-  }
-
-  test_undefinedMethod_dynamic() async {
-    Source source = addSource(r'''
-class D<T extends dynamic> {
-  fieldAccess(T t) => t.abc;
-  methodAccess(T t) => t.xyz(1, 2, 'three');
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-  }
-
-  test_undefinedMethod_unionType_all() async {
-    Source source = addSource(r'''
-class A {
-  int m(int x) => 0;
-}
-class B {
-  String m() => '0';
-}
-f(A a, B b) {
-  var ab;
-  if (0 < 1) {
-    ab = a;
-  } else {
-    ab = b;
-  }
-  ab.m();
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-  }
-
-  test_undefinedMethod_unionType_some() async {
-    Source source = addSource(r'''
-class A {
-  int m(int x) => 0;
-}
-class B {}
-f(A a, B b) {
-  var ab;
-  if (0 < 1) {
-    ab = a;
-  } else {
-    ab = b;
-  }
-  ab.m(0);
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-  }
-
-  test_undefinedOperator_binaryExpression_inSubtype() async {
-    Source source = addSource(r'''
-class A {}
-class B extends A {
-  operator +(B b) {}
-}
-f(var a) {
-  if(a is A) {
-    a + 1;
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [StaticTypeWarningCode.UNDEFINED_OPERATOR]);
-  }
-
-  test_undefinedOperator_indexBoth_inSubtype() async {
-    Source source = addSource(r'''
-class A {}
-class B extends A {
-  operator [](int index) {}
-}
-f(var a) {
-  if(a is A) {
-    a[0]++;
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      StaticTypeWarningCode.UNDEFINED_OPERATOR,
-      StaticTypeWarningCode.UNDEFINED_OPERATOR,
-    ]);
-  }
-
-  test_undefinedOperator_indexGetter_inSubtype() async {
-    Source source = addSource(r'''
-class A {}
-class B extends A {
-  operator [](int index) {}
-}
-f(var a) {
-  if(a is A) {
-    a[0];
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [StaticTypeWarningCode.UNDEFINED_OPERATOR]);
-  }
-
-  test_undefinedOperator_indexSetter_inSubtype() async {
-    Source source = addSource(r'''
-class A {}
-class B extends A {
-  operator []=(i, v) {}
-}
-f(var a) {
-  if(a is A) {
-    a[0] = 1;
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [StaticTypeWarningCode.UNDEFINED_OPERATOR]);
-  }
-
-  test_undefinedOperator_postfixExpression() async {
-    Source source = addSource(r'''
-class A {}
-class B extends A {
-  operator +(B b) {return new B();}
-}
-f(var a) {
-  if(a is A) {
-    a++;
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-  }
-
-  test_undefinedOperator_prefixExpression() async {
-    Source source = addSource(r'''
-class A {}
-class B extends A {
-  operator +(B b) {return new B();}
-}
-f(var a) {
-  if(a is A) {
-    ++a;
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-  }
-
-  test_undefinedSetter_inSubtype() async {
-    Source source = addSource(r'''
-class A {}
-class B extends A {
-  set b(x) {}
-}
-f(var a) {
-  if (a is A) {
-    a.b = 0;
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [StaticTypeWarningCode.UNDEFINED_SETTER]);
-  }
-
-  test_unnecessaryNoSuchMethod_blockBody_notReturnStatement() async {
-    Source source = addSource(r'''
-class A {
-  noSuchMethod(x) => super.noSuchMethod(x);
-}
-class B extends A {
-  mmm();
-  noSuchMethod(y) {
-    print(y);
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_unnecessaryNoSuchMethod_blockBody_notSingleStatement() async {
-    Source source = addSource(r'''
-class A {
-  noSuchMethod(x) => super.noSuchMethod(x);
-}
-class B extends A {
-  mmm();
-  noSuchMethod(y) {
-    print(y);
-    return super.noSuchMethod(y);
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_unnecessaryNoSuchMethod_expressionBody_notNoSuchMethod() async {
-    Source source = addSource(r'''
-class A {
-  noSuchMethod(x) => super.noSuchMethod(x);
-}
-class B extends A {
-  mmm();
-  noSuchMethod(y) => super.hashCode;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_unnecessaryNoSuchMethod_expressionBody_notSuper() async {
-    Source source = addSource(r'''
-class A {
-  noSuchMethod(x) => super.noSuchMethod(x);
-}
-class B extends A {
-  mmm();
-  noSuchMethod(y) => 42;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-}
-
-class PubSuggestionCodeTest extends ResolverTestCase {
-  // TODO(brianwilkerson) The tests in this class are not being run, and all but
-  //  the first would fail. We should implement these checks and enable the
-  //  tests.
-  test_import_package() async {
-    Source source = addSource("import 'package:somepackage/other.dart';");
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.URI_DOES_NOT_EXIST]);
-  }
-
-  test_import_packageWithDotDot() async {
-    Source source = addSource("import 'package:somepackage/../other.dart';");
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CompileTimeErrorCode.URI_DOES_NOT_EXIST,
-      HintCode.PACKAGE_IMPORT_CONTAINS_DOT_DOT
-    ]);
-  }
-
-  test_import_packageWithLeadingDotDot() async {
-    Source source = addSource("import 'package:../other.dart';");
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      CompileTimeErrorCode.URI_DOES_NOT_EXIST,
-      HintCode.PACKAGE_IMPORT_CONTAINS_DOT_DOT
-    ]);
-  }
-
-  test_import_referenceIntoLibDirectory() async {
-    addNamedSource("/myproj/pubspec.yaml", "");
-    addNamedSource("/myproj/lib/other.dart", "");
-    Source source =
-        addNamedSource("/myproj/web/test.dart", "import '../lib/other.dart';");
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [HintCode.FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE]);
-  }
-
-  test_import_referenceIntoLibDirectory_no_pubspec() async {
-    addNamedSource("/myproj/lib/other.dart", "");
-    Source source =
-        addNamedSource("/myproj/web/test.dart", "import '../lib/other.dart';");
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-  }
-
-  test_import_referenceOutOfLibDirectory() async {
-    addNamedSource("/myproj/pubspec.yaml", "");
-    addNamedSource("/myproj/web/other.dart", "");
-    Source source =
-        addNamedSource("/myproj/lib/test.dart", "import '../web/other.dart';");
-    await computeAnalysisResult(source);
-    assertErrors(
-        source, [HintCode.FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE]);
-  }
-
-  test_import_referenceOutOfLibDirectory_no_pubspec() async {
-    addNamedSource("/myproj/web/other.dart", "");
-    Source source =
-        addNamedSource("/myproj/lib/test.dart", "import '../web/other.dart';");
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-  }
-
-  test_import_valid_inside_lib1() async {
-    addNamedSource("/myproj/pubspec.yaml", "");
-    addNamedSource("/myproj/lib/other.dart", "");
-    Source source =
-        addNamedSource("/myproj/lib/test.dart", "import 'other.dart';");
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-  }
-
-  test_import_valid_inside_lib2() async {
-    addNamedSource("/myproj/pubspec.yaml", "");
-    addNamedSource("/myproj/lib/bar/other.dart", "");
-    Source source = addNamedSource(
-        "/myproj/lib/foo/test.dart", "import '../bar/other.dart';");
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-  }
-
-  test_import_valid_outside_lib() async {
-    addNamedSource("/myproj/pubspec.yaml", "");
-    addNamedSource("/myproj/web/other.dart", "");
-    Source source =
-        addNamedSource("/myproj/lib2/test.dart", "import '../web/other.dart';");
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-  }
-}
diff --git a/pkg/analyzer/test/generated/parser_fasta_listener.dart b/pkg/analyzer/test/generated/parser_fasta_listener.dart
index 0808c6b..7217806 100644
--- a/pkg/analyzer/test/generated/parser_fasta_listener.dart
+++ b/pkg/analyzer/test/generated/parser_fasta_listener.dart
@@ -214,6 +214,12 @@
   }
 
   @override
+  void beginForControlFlow(Token awaitToken, Token forToken) {
+    super.beginForControlFlow(awaitToken, forToken);
+    begin('ForControlFlow');
+  }
+
+  @override
   void beginForInBody(Token token) {
     super.beginForInBody(token);
     begin('ForInBody');
@@ -251,6 +257,12 @@
   }
 
   @override
+  void beginIfControlFlow(Token ifToken) {
+    super.beginIfControlFlow(ifToken);
+    begin('IfControlFlow');
+  }
+
+  @override
   void beginLocalFunctionDeclaration(Token token) {
     super.beginLocalFunctionDeclaration(token);
     begin('LocalFunctionDeclaration');
@@ -698,10 +710,21 @@
   }
 
   @override
-  void endForIn(Token awaitToken, Token forToken, Token leftParen,
-      Token inKeyword, Token endToken) {
+  void endForControlFlow(Token token) {
+    end('ForControlFlow');
+    super.endForControlFlow(token);
+  }
+
+  @override
+  void endForInControlFlow(Token token) {
+    end('ForControlFlow');
+    super.endForInControlFlow(token);
+  }
+
+  @override
+  void endForIn(Token endToken) {
     end('ForStatement');
-    super.endForIn(awaitToken, forToken, leftParen, inKeyword, endToken);
+    super.endForIn(endToken);
   }
 
   @override
@@ -717,11 +740,9 @@
   }
 
   @override
-  void endForStatement(Token forKeyword, Token leftParen, Token leftSeparator,
-      int updateExpressionCount, Token endToken) {
+  void endForStatement(Token endToken) {
     end('ForStatement');
-    super.endForStatement(
-        forKeyword, leftParen, leftSeparator, updateExpressionCount, endToken);
+    super.endForStatement(endToken);
   }
 
   @override
@@ -789,6 +810,18 @@
   }
 
   @override
+  void endIfControlFlow(Token token) {
+    end('IfControlFlow');
+    super.endIfControlFlow(token);
+  }
+
+  @override
+  void endIfElseControlFlow(Token token) {
+    end('IfControlFlow');
+    super.endIfElseControlFlow(token);
+  }
+
+  @override
   void endIfStatement(Token ifToken, Token elseToken) {
     end('IfStatement');
     super.endIfStatement(ifToken, elseToken);
diff --git a/pkg/analyzer/test/generated/parser_fasta_test.dart b/pkg/analyzer/test/generated/parser_fasta_test.dart
index b022212..7dbd7f4 100644
--- a/pkg/analyzer/test/generated/parser_fasta_test.dart
+++ b/pkg/analyzer/test/generated/parser_fasta_test.dart
@@ -15,6 +15,7 @@
 import 'package:analyzer/src/generated/parser.dart' as analyzer;
 import 'package:analyzer/src/generated/utilities_dart.dart';
 import 'package:analyzer/src/string_source.dart';
+import 'package:front_end/src/fasta/parser/async_modifier.dart';
 import 'package:front_end/src/fasta/parser/forwarding_listener.dart' as fasta;
 import 'package:front_end/src/fasta/parser/parser.dart' as fasta;
 import 'package:front_end/src/fasta/scanner.dart'
@@ -33,6 +34,7 @@
 main() {
   defineReflectiveSuite(() {
     defineReflectiveTests(ClassMemberParserTest_Fasta);
+    defineReflectiveTests(CollectionLiteralParserTest);
     defineReflectiveTests(ComplexParserTest_Fasta);
     defineReflectiveTests(ErrorParserTest_Fasta);
     defineReflectiveTests(ExpressionParserTest_Fasta);
@@ -105,6 +107,626 @@
 }
 
 /**
+ * Tests of the fasta parser based on [ExpressionParserTestMixin].
+ */
+@reflectiveTest
+class CollectionLiteralParserTest extends FastaParserTestCase {
+  Expression parseCollectionLiteral(String source,
+      {List<ErrorCode> codes,
+      List<ExpectedError> errors,
+      int expectedEndOffset,
+      bool inAsync = false}) {
+    return parseExpression(source,
+        codes: codes,
+        errors: errors,
+        expectedEndOffset: expectedEndOffset,
+        inAsync: inAsync,
+        parseSetLiterals: true,
+        parseSpreadCollections: true,
+        parseControlFlowCollections: true);
+  }
+
+  void test_listLiteral_for() {
+    ListLiteral2 list = parseCollectionLiteral(
+      '[1, await for (var x in list) 2]',
+      inAsync: true,
+    );
+    expect(list.elements, hasLength(2));
+    IntegerLiteral first = list.elements[0];
+    expect(first.value, 1);
+
+    CollectionForElement second = list.elements[1];
+    expect(second.awaitKeyword, isNotNull);
+    expect(second.forKeyword.isKeyword, isTrue);
+    expect(second.leftParenthesis.lexeme, '(');
+    expect(second.rightParenthesis.lexeme, ')');
+    ForEachPartsWithDeclaration forLoopParts = second.forLoopParts;
+    DeclaredIdentifier forLoopVar = forLoopParts.loopVariable;
+    expect(forLoopVar.identifier.name, 'x');
+    expect(forLoopParts.inKeyword, isNotNull);
+    SimpleIdentifier iterable = forLoopParts.iterable;
+    expect(iterable.name, 'list');
+  }
+
+  void test_listLiteral_forIf() {
+    ListLiteral2 list = parseCollectionLiteral(
+      '[1, await for (var x in list) if (c) 2]',
+      inAsync: true,
+    );
+    expect(list.elements, hasLength(2));
+    IntegerLiteral first = list.elements[0];
+    expect(first.value, 1);
+
+    CollectionForElement second = list.elements[1];
+    expect(second.awaitKeyword, isNotNull);
+    expect(second.forKeyword.isKeyword, isTrue);
+    expect(second.leftParenthesis.lexeme, '(');
+    expect(second.rightParenthesis.lexeme, ')');
+    ForEachPartsWithDeclaration forLoopParts = second.forLoopParts;
+    DeclaredIdentifier forLoopVar = forLoopParts.loopVariable;
+    expect(forLoopVar.identifier.name, 'x');
+    expect(forLoopParts.inKeyword, isNotNull);
+    SimpleIdentifier iterable = forLoopParts.iterable;
+    expect(iterable.name, 'list');
+
+    CollectionIfElement body = second.body;
+    SimpleIdentifier condition = body.condition;
+    expect(condition.name, 'c');
+    IntegerLiteral thenElement = body.thenElement;
+    expect(thenElement.value, 2);
+  }
+
+  void test_listLiteral_forSpread() {
+    ListLiteral2 list =
+        parseCollectionLiteral('[1, for (int x = 0; x < 10; ++x) ...[2]]');
+    expect(list.elements, hasLength(2));
+    IntegerLiteral first = list.elements[0];
+    expect(first.value, 1);
+
+    CollectionForElement second = list.elements[1];
+    expect(second.awaitKeyword, isNull);
+    expect(second.forKeyword.isKeyword, isTrue);
+    expect(second.leftParenthesis.lexeme, '(');
+    expect(second.rightParenthesis.lexeme, ')');
+    ForPartsWithDeclarations forLoopParts = second.forLoopParts;
+    VariableDeclaration forLoopVar = forLoopParts.variables.variables[0];
+    expect(forLoopVar.name.name, 'x');
+    BinaryExpression condition = forLoopParts.condition;
+    IntegerLiteral rightOperand = condition.rightOperand;
+    expect(rightOperand.value, 10);
+    PrefixExpression updater = forLoopParts.updaters[0];
+    SimpleIdentifier updaterOperand = updater.operand;
+    expect(updaterOperand.name, 'x');
+  }
+
+  void test_listLiteral_if() {
+    ListLiteral2 list = parseCollectionLiteral('[1, if (true) 2]');
+    expect(list.elements, hasLength(2));
+    IntegerLiteral first = list.elements[0];
+    expect(first.value, 1);
+
+    CollectionIfElement second = list.elements[1];
+    BooleanLiteral condition = second.condition;
+    expect(condition.value, isTrue);
+    IntegerLiteral thenElement = second.thenElement;
+    expect(thenElement.value, 2);
+    expect(second.elseElement, isNull);
+  }
+
+  void test_listLiteral_ifElse() {
+    ListLiteral2 list = parseCollectionLiteral('[1, if (true) 2 else 5]');
+    expect(list.elements, hasLength(2));
+    IntegerLiteral first = list.elements[0];
+    expect(first.value, 1);
+
+    CollectionIfElement second = list.elements[1];
+    BooleanLiteral condition = second.condition;
+    expect(condition.value, isTrue);
+    IntegerLiteral thenElement = second.thenElement;
+    expect(thenElement.value, 2);
+    IntegerLiteral elseElement = second.elseElement;
+    expect(elseElement.value, 5);
+  }
+
+  void test_listLiteral_ifElseFor() {
+    ListLiteral2 list =
+        parseCollectionLiteral('[1, if (true) 2 else for (a in b) 5]');
+    expect(list.elements, hasLength(2));
+    IntegerLiteral first = list.elements[0];
+    expect(first.value, 1);
+
+    CollectionIfElement second = list.elements[1];
+    BooleanLiteral condition = second.condition;
+    expect(condition.value, isTrue);
+    IntegerLiteral thenElement = second.thenElement;
+    expect(thenElement.value, 2);
+
+    CollectionForElement elseElement = second.elseElement;
+    ForEachPartsWithIdentifier forLoopParts = elseElement.forLoopParts;
+    expect(forLoopParts.identifier.name, 'a');
+
+    IntegerLiteral forValue = elseElement.body;
+    expect(forValue.value, 5);
+  }
+
+  void test_listLiteral_ifFor() {
+    ListLiteral2 list = parseCollectionLiteral('[1, if (true) for (a in b) 2]');
+    expect(list.elements, hasLength(2));
+    IntegerLiteral first = list.elements[0];
+    expect(first.value, 1);
+
+    CollectionIfElement second = list.elements[1];
+    BooleanLiteral condition = second.condition;
+    expect(condition.value, isTrue);
+
+    CollectionForElement thenElement = second.thenElement;
+    ForEachPartsWithIdentifier forLoopParts = thenElement.forLoopParts;
+    expect(forLoopParts.identifier.name, 'a');
+
+    IntegerLiteral forValue = thenElement.body;
+    expect(forValue.value, 2);
+    expect(second.elseElement, isNull);
+  }
+
+  void test_listLiteral_ifSpread() {
+    ListLiteral2 list = parseCollectionLiteral('[1, if (true) ...[2]]');
+    expect(list.elements, hasLength(2));
+    IntegerLiteral first = list.elements[0];
+    expect(first.value, 1);
+
+    CollectionIfElement second = list.elements[1];
+    BooleanLiteral condition = second.condition;
+    expect(condition.value, isTrue);
+    SpreadElement thenElement = second.thenElement;
+    expect(thenElement.spreadOperator.lexeme, '...');
+    expect(second.elseElement, isNull);
+  }
+
+  void test_listLiteral_ifElseSpread() {
+    ListLiteral2 list =
+        parseCollectionLiteral('[1, if (true) ...[2] else ...?[5]]');
+    expect(list.elements, hasLength(2));
+    IntegerLiteral first = list.elements[0];
+    expect(first.value, 1);
+
+    CollectionIfElement second = list.elements[1];
+    BooleanLiteral condition = second.condition;
+    expect(condition.value, isTrue);
+    SpreadElement thenElement = second.thenElement;
+    expect(thenElement.spreadOperator.lexeme, '...');
+    SpreadElement elseElement = second.elseElement;
+    expect(elseElement.spreadOperator.lexeme, '...?');
+  }
+
+  void test_listLiteral_spread() {
+    ListLiteral2 list = parseCollectionLiteral('[1, ...[2]]');
+    expect(list.elements, hasLength(2));
+    IntegerLiteral first = list.elements[0];
+    expect(first.value, 1);
+
+    SpreadElement element = list.elements[1];
+    expect(element.spreadOperator.lexeme, '...');
+    ListLiteral2 spreadExpression = element.expression;
+    expect(spreadExpression.elements, hasLength(1));
+  }
+
+  void test_listLiteral_spreadQ() {
+    ListLiteral2 list = parseCollectionLiteral('[1, ...?[2]]');
+    expect(list.elements, hasLength(2));
+    IntegerLiteral first = list.elements[0];
+    expect(first.value, 1);
+
+    SpreadElement element = list.elements[1];
+    expect(element.spreadOperator.lexeme, '...?');
+    ListLiteral2 spreadExpression = element.expression;
+    expect(spreadExpression.elements, hasLength(1));
+  }
+
+  void test_mapLiteral_for() {
+    MapLiteral2 map = parseCollectionLiteral('{1:7, await for (y in list) 2:3}',
+        inAsync: true);
+    expect(map.entries, hasLength(2));
+    MapLiteralEntry first = map.entries[0];
+    IntegerLiteral firstValue = first.value;
+    expect(firstValue.value, 7);
+
+    MapForElement second = map.entries[1];
+    expect(second.awaitKeyword, isNotNull);
+    expect(second.forKeyword.isKeyword, isTrue);
+    expect(second.leftParenthesis.lexeme, '(');
+    expect(second.rightParenthesis.lexeme, ')');
+    ForEachPartsWithIdentifier forLoopParts = second.forLoopParts;
+    SimpleIdentifier forLoopVar = forLoopParts.identifier;
+    expect(forLoopVar.name, 'y');
+    expect(forLoopParts.inKeyword, isNotNull);
+    SimpleIdentifier iterable = forLoopParts.iterable;
+    expect(iterable.name, 'list');
+  }
+
+  void test_mapLiteral_forIf() {
+    MapLiteral2 map = parseCollectionLiteral(
+        '{1:7, await for (y in list) if (c) 2:3}',
+        inAsync: true);
+    expect(map.entries, hasLength(2));
+    MapLiteralEntry first = map.entries[0];
+    IntegerLiteral firstValue = first.value;
+    expect(firstValue.value, 7);
+
+    MapForElement second = map.entries[1];
+    expect(second.awaitKeyword, isNotNull);
+    expect(second.forKeyword.isKeyword, isTrue);
+    expect(second.leftParenthesis.lexeme, '(');
+    expect(second.rightParenthesis.lexeme, ')');
+    ForEachPartsWithIdentifier forLoopParts = second.forLoopParts;
+    SimpleIdentifier forLoopVar = forLoopParts.identifier;
+    expect(forLoopVar.name, 'y');
+    expect(forLoopParts.inKeyword, isNotNull);
+    SimpleIdentifier iterable = forLoopParts.iterable;
+    expect(iterable.name, 'list');
+
+    MapIfElement body = second.body;
+    SimpleIdentifier condition = body.condition;
+    expect(condition.name, 'c');
+    MapLiteralEntry thenElement = body.thenElement;
+    IntegerLiteral thenValue = thenElement.value;
+    expect(thenValue.value, 3);
+  }
+
+  void test_mapLiteral_forSpread() {
+    MapLiteral2 map =
+        parseCollectionLiteral('{1:7, for (x = 0; x < 10; ++x) ...{2:3}}');
+    expect(map.entries, hasLength(2));
+    MapLiteralEntry first = map.entries[0];
+    IntegerLiteral firstValue = first.value;
+    expect(firstValue.value, 7);
+
+    MapForElement second = map.entries[1];
+    expect(second.awaitKeyword, isNull);
+    expect(second.forKeyword.isKeyword, isTrue);
+    expect(second.leftParenthesis.lexeme, '(');
+    expect(second.rightParenthesis.lexeme, ')');
+    ForPartsWithExpression forLoopParts = second.forLoopParts;
+    AssignmentExpression forLoopInit = forLoopParts.initialization;
+    SimpleIdentifier forLoopVar = forLoopInit.leftHandSide;
+    expect(forLoopVar.name, 'x');
+    BinaryExpression condition = forLoopParts.condition;
+    IntegerLiteral rightOperand = condition.rightOperand;
+    expect(rightOperand.value, 10);
+    PrefixExpression updater = forLoopParts.updaters[0];
+    SimpleIdentifier updaterOperand = updater.operand;
+    expect(updaterOperand.name, 'x');
+  }
+
+  void test_mapLiteral_if() {
+    MapLiteral2 map = parseCollectionLiteral('{1:1, if (true) 2:4}');
+    expect(map.entries, hasLength(2));
+    MapLiteralEntry first = map.entries[0];
+    IntegerLiteral firstValue = first.value;
+    expect(firstValue.value, 1);
+
+    MapIfElement second = map.entries[1];
+    BooleanLiteral condition = second.condition;
+    expect(condition.value, isTrue);
+    MapLiteralEntry thenElement = second.thenElement;
+    IntegerLiteral thenElementValue = thenElement.value;
+    expect(thenElementValue.value, 4);
+    expect(second.elseElement, isNull);
+  }
+
+  void test_mapLiteral_ifElse() {
+    MapLiteral2 map = parseCollectionLiteral('{1:1, if (true) 2:4 else 5:6}');
+    expect(map.entries, hasLength(2));
+    MapLiteralEntry first = map.entries[0];
+    IntegerLiteral firstValue = first.value;
+    expect(firstValue.value, 1);
+
+    MapIfElement second = map.entries[1];
+    BooleanLiteral condition = second.condition;
+    expect(condition.value, isTrue);
+    MapLiteralEntry thenElement = second.thenElement;
+    IntegerLiteral thenElementValue = thenElement.value;
+    expect(thenElementValue.value, 4);
+    MapLiteralEntry elseElement = second.elseElement;
+    IntegerLiteral elseElementValue = elseElement.value;
+    expect(elseElementValue.value, 6);
+  }
+
+  void test_mapLiteral_ifElseFor() {
+    MapLiteral2 map =
+        parseCollectionLiteral('{1:1, if (true) 2:4 else for (c in d) 5:6}');
+    expect(map.entries, hasLength(2));
+    MapLiteralEntry first = map.entries[0];
+    IntegerLiteral firstValue = first.value;
+    expect(firstValue.value, 1);
+
+    MapIfElement second = map.entries[1];
+    BooleanLiteral condition = second.condition;
+    expect(condition.value, isTrue);
+    MapLiteralEntry thenElement = second.thenElement;
+    IntegerLiteral thenElementValue = thenElement.value;
+    expect(thenElementValue.value, 4);
+
+    MapForElement elseElement = second.elseElement;
+    ForEachPartsWithIdentifier forLoopParts = elseElement.forLoopParts;
+    expect(forLoopParts.identifier.name, 'c');
+
+    MapLiteralEntry body = elseElement.body;
+    IntegerLiteral bodyValue = body.value;
+    expect(bodyValue.value, 6);
+  }
+
+  void test_mapLiteral_ifFor() {
+    MapLiteral2 map =
+        parseCollectionLiteral('{1:1, if (true) for (a in b) 2:4}');
+    expect(map.entries, hasLength(2));
+    MapLiteralEntry first = map.entries[0];
+    IntegerLiteral firstValue = first.value;
+    expect(firstValue.value, 1);
+
+    MapIfElement second = map.entries[1];
+    BooleanLiteral condition = second.condition;
+    expect(condition.value, isTrue);
+
+    MapForElement thenElement = second.thenElement;
+    ForEachPartsWithIdentifier forLoopParts = thenElement.forLoopParts;
+    expect(forLoopParts.identifier.name, 'a');
+
+    MapLiteralEntry body = thenElement.body;
+    IntegerLiteral thenElementValue = body.value;
+    expect(thenElementValue.value, 4);
+    expect(second.elseElement, isNull);
+  }
+
+  void test_mapLiteral_ifSpread() {
+    MapLiteral2 map = parseCollectionLiteral('{1:1, if (true) ...{2:4}}');
+    expect(map.entries, hasLength(2));
+    MapLiteralEntry first = map.entries[0];
+    IntegerLiteral firstValue = first.value;
+    expect(firstValue.value, 1);
+
+    MapIfElement second = map.entries[1];
+    BooleanLiteral condition = second.condition;
+    expect(condition.value, isTrue);
+    SpreadElement thenElement = second.thenElement;
+    expect(thenElement.spreadOperator.lexeme, '...');
+    expect(second.elseElement, isNull);
+  }
+
+  void test_mapLiteral_ifElseSpread() {
+    MapLiteral2 map =
+        parseCollectionLiteral('{1:7, if (true) ...{2:4} else ...?{5:6}}');
+    expect(map.entries, hasLength(2));
+    MapLiteralEntry first = map.entries[0];
+    IntegerLiteral firstValue = first.value;
+    expect(firstValue.value, 7);
+
+    MapIfElement second = map.entries[1];
+    BooleanLiteral condition = second.condition;
+    expect(condition.value, isTrue);
+    SpreadElement thenElement = second.thenElement;
+    expect(thenElement.spreadOperator.lexeme, '...');
+    SpreadElement elseElement = second.elseElement;
+    expect(elseElement.spreadOperator.lexeme, '...?');
+    MapLiteral2 elseElementExpression = elseElement.expression;
+    expect(elseElementExpression.entries, hasLength(1));
+    MapLiteralEntry entry = elseElementExpression.entries[0];
+    IntegerLiteral entryValue = entry.value;
+    expect(entryValue.value, 6);
+  }
+
+  void test_mapLiteral_spread() {
+    MapLiteral2 map = parseCollectionLiteral('{1: 2, ...{3: 4}}');
+    expect(map.constKeyword, isNull);
+    expect(map.typeArguments, isNull);
+    expect(map.entries, hasLength(2));
+
+    SpreadElement element = map.entries[1];
+    expect(element.spreadOperator.lexeme, '...');
+    MapLiteral2 spreadExpression = element.expression;
+    expect(spreadExpression.entries, hasLength(1));
+  }
+
+  void test_mapLiteral_spreadQ() {
+    MapLiteral2 map = parseCollectionLiteral('{1: 2, ...?{3: 4}}');
+    expect(map.constKeyword, isNull);
+    expect(map.typeArguments, isNull);
+    expect(map.entries, hasLength(2));
+
+    SpreadElement element = map.entries[1];
+    expect(element.spreadOperator.lexeme, '...?');
+    MapLiteral2 spreadExpression = element.expression;
+    expect(spreadExpression.entries, hasLength(1));
+  }
+
+  void test_mapLiteral_spread_typed() {
+    MapLiteral2 map = parseCollectionLiteral('<int, int>{...{3: 4}}');
+    expect(map.constKeyword, isNull);
+    expect(map.typeArguments.arguments, hasLength(2));
+    expect(map.entries, hasLength(1));
+
+    SpreadElement element = map.entries[0];
+    expect(element.spreadOperator.lexeme, '...');
+    MapLiteral2 spreadExpression = element.expression;
+    expect(spreadExpression.entries, hasLength(1));
+  }
+
+  void test_mapLiteral_spreadQ_typed() {
+    MapLiteral2 map = parseCollectionLiteral('<int, int>{...?{3: 4}}');
+    expect(map.constKeyword, isNull);
+    expect(map.typeArguments.arguments, hasLength(2));
+    expect(map.entries, hasLength(1));
+
+    SpreadElement element = map.entries[0];
+    expect(element.spreadOperator.lexeme, '...?');
+    MapLiteral2 spreadExpression = element.expression;
+    expect(spreadExpression.entries, hasLength(1));
+  }
+
+  void test_mapLiteral_spread2_typed() {
+    MapLiteral2 map = parseCollectionLiteral('<int, int>{1: 2, ...{3: 4}}');
+    expect(map.constKeyword, isNull);
+    expect(map.typeArguments.arguments, hasLength(2));
+    expect(map.entries, hasLength(2));
+
+    SpreadElement element = map.entries[1];
+    expect(element.spreadOperator.lexeme, '...');
+    MapLiteral2 spreadExpression = element.expression;
+    expect(spreadExpression.entries, hasLength(1));
+  }
+
+  void test_mapLiteral_spreadQ2_typed() {
+    MapLiteral2 map = parseCollectionLiteral('<int, int>{1: 2, ...?{3: 4}}');
+    expect(map.constKeyword, isNull);
+    expect(map.typeArguments.arguments, hasLength(2));
+    expect(map.entries, hasLength(2));
+
+    SpreadElement element = map.entries[1];
+    expect(element.spreadOperator.lexeme, '...?');
+    MapLiteral2 spreadExpression = element.expression;
+    expect(spreadExpression.entries, hasLength(1));
+  }
+
+  void test_setLiteral_if() {
+    SetLiteral2 setLiteral = parseCollectionLiteral('{1, if (true) 2}');
+    expect(setLiteral.elements, hasLength(2));
+    IntegerLiteral first = setLiteral.elements[0];
+    expect(first.value, 1);
+
+    CollectionIfElement second = setLiteral.elements[1];
+    BooleanLiteral condition = second.condition;
+    expect(condition.value, isTrue);
+    IntegerLiteral thenElement = second.thenElement;
+    expect(thenElement.value, 2);
+    expect(second.elseElement, isNull);
+  }
+
+  void test_setLiteral_ifElse() {
+    SetLiteral2 setLiteral = parseCollectionLiteral('{1, if (true) 2 else 5}');
+    expect(setLiteral.elements, hasLength(2));
+    IntegerLiteral first = setLiteral.elements[0];
+    expect(first.value, 1);
+
+    CollectionIfElement second = setLiteral.elements[1];
+    BooleanLiteral condition = second.condition;
+    expect(condition.value, isTrue);
+    IntegerLiteral thenElement = second.thenElement;
+    expect(thenElement.value, 2);
+    IntegerLiteral elseElement = second.elseElement;
+    expect(elseElement.value, 5);
+  }
+
+  void test_setLiteral_ifSpread() {
+    SetLiteral2 setLiteral = parseCollectionLiteral('{1, if (true) ...[2]}');
+    expect(setLiteral.elements, hasLength(2));
+    IntegerLiteral first = setLiteral.elements[0];
+    expect(first.value, 1);
+
+    CollectionIfElement second = setLiteral.elements[1];
+    BooleanLiteral condition = second.condition;
+    expect(condition.value, isTrue);
+    SpreadElement thenElement = second.thenElement;
+    expect(thenElement.spreadOperator.lexeme, '...');
+    expect(second.elseElement, isNull);
+  }
+
+  void test_setLiteral_ifElseSpread() {
+    SetLiteral2 setLiteral =
+        parseCollectionLiteral('{1, if (true) ...{2} else ...?[5]}');
+    expect(setLiteral.elements, hasLength(2));
+    IntegerLiteral first = setLiteral.elements[0];
+    expect(first.value, 1);
+
+    CollectionIfElement second = setLiteral.elements[1];
+    BooleanLiteral condition = second.condition;
+    expect(condition.value, isTrue);
+    SpreadElement thenElement = second.thenElement;
+    expect(thenElement.spreadOperator.lexeme, '...');
+    SetLiteral2 theExpression = thenElement.expression;
+    expect(theExpression.elements, hasLength(1));
+    SpreadElement elseElement = second.elseElement;
+    expect(elseElement.spreadOperator.lexeme, '...?');
+    ListLiteral2 elseExpression = elseElement.expression;
+    expect(elseExpression.elements, hasLength(1));
+  }
+
+  void test_setLiteral_spread2() {
+    SetLiteral2 set = parseCollectionLiteral('{3, ...[4]}');
+    expect(set.constKeyword, isNull);
+    expect(set.typeArguments, isNull);
+    expect(set.elements, hasLength(2));
+    IntegerLiteral value = set.elements[0];
+    expect(value.value, 3);
+
+    SpreadElement element = set.elements[1];
+    expect(element.spreadOperator.lexeme, '...');
+    ListLiteral2 spreadExpression = element.expression;
+    expect(spreadExpression.elements, hasLength(1));
+  }
+
+  void test_setLiteral_spread2Q() {
+    SetLiteral2 set = parseCollectionLiteral('{3, ...?[4]}');
+    expect(set.constKeyword, isNull);
+    expect(set.typeArguments, isNull);
+    expect(set.elements, hasLength(2));
+    IntegerLiteral value = set.elements[0];
+    expect(value.value, 3);
+
+    SpreadElement element = set.elements[1];
+    expect(element.spreadOperator.lexeme, '...?');
+    ListLiteral2 spreadExpression = element.expression;
+    expect(spreadExpression.elements, hasLength(1));
+  }
+
+  void test_setLiteral_spread_typed() {
+    SetLiteral2 set = parseCollectionLiteral('<int>{...[3]}');
+    expect(set.constKeyword, isNull);
+    expect(set.typeArguments, isNotNull);
+    expect(set.elements, hasLength(1));
+
+    SpreadElement element = set.elements[0];
+    expect(element.spreadOperator.lexeme, '...');
+    ListLiteral2 spreadExpression = element.expression;
+    expect(spreadExpression.elements, hasLength(1));
+  }
+
+  void test_setLiteral_spreadQ_typed() {
+    SetLiteral2 set = parseCollectionLiteral('<int>{...?[3]}');
+    expect(set.constKeyword, isNull);
+    expect(set.typeArguments, isNotNull);
+    expect(set.elements, hasLength(1));
+
+    SpreadElement element = set.elements[0];
+    expect(element.spreadOperator.lexeme, '...?');
+    ListLiteral2 spreadExpression = element.expression;
+    expect(spreadExpression.elements, hasLength(1));
+  }
+
+  void test_setOrMapLiteral_spread() {
+    MapLiteral2 map = parseCollectionLiteral('{...{3: 4}}');
+    expect(map.constKeyword, isNull);
+    expect(map.typeArguments, isNull);
+    expect(map.entries, hasLength(1));
+
+    SpreadElement element = map.entries[0];
+    expect(element.spreadOperator.lexeme, '...');
+    MapLiteral2 spreadExpression = element.expression;
+    expect(spreadExpression.entries, hasLength(1));
+  }
+
+  void test_setOrMapLiteral_spreadQ() {
+    MapLiteral2 map = parseCollectionLiteral('{...?{3: 4}}');
+    expect(map.constKeyword, isNull);
+    expect(map.typeArguments, isNull);
+    expect(map.entries, hasLength(1));
+
+    SpreadElement element = map.entries[0];
+    expect(element.spreadOperator.lexeme, '...?');
+    MapLiteral2 spreadExpression = element.expression;
+    expect(spreadExpression.entries, hasLength(1));
+  }
+}
+
+/**
  * Tests of the fasta parser based on [ComplexParserTestMixin].
  */
 @reflectiveTest
@@ -260,6 +882,30 @@
     super.test_parseUnaryExpression_decrement_super_withComment();
   }
 
+  void test_listLiteral_spread() {
+    // TODO(danrubel): Remove this once spread_collections is enabled by default
+    ListLiteral list = parseExpression('[1, ...[2]]', errors: [
+      expectedError(ParserErrorCode.UNEXPECTED_TOKEN, 4, 3),
+    ]);
+    expect(list.elements, hasLength(2));
+    IntegerLiteral first = list.elements[0];
+    expect(first.value, 1);
+    ListLiteral second = list.elements[1];
+    expect(second.elements, hasLength(1));
+  }
+
+  void test_listLiteral_spreadQ() {
+    // TODO(danrubel): Remove this once spread_collections is enabled by default
+    ListLiteral list = parseExpression('[1, ...?[2]]', errors: [
+      expectedError(ParserErrorCode.UNEXPECTED_TOKEN, 4, 4),
+    ]);
+    expect(list.elements, hasLength(2));
+    IntegerLiteral first = list.elements[0];
+    expect(first.value, 1);
+    ListLiteral second = list.elements[1];
+    expect(second.elements, hasLength(1));
+  }
+
   void test_mapLiteral() {
     MapLiteral map = parseExpression('{3: 6}', parseSetLiterals: true);
     expect(map.constKeyword, isNull);
@@ -284,6 +930,109 @@
     expect(value.value, 6);
   }
 
+  void test_mapLiteral_invalid_set_entry() {
+    MapLiteral map =
+        parseExpression('<int, int>{1}', parseSetLiterals: true, errors: [
+      expectedError(ParserErrorCode.EXPECTED_TOKEN, 12, 1),
+      expectedError(ParserErrorCode.MISSING_IDENTIFIER, 12, 1),
+    ]);
+    expect(map.constKeyword, isNull);
+    expect(map.typeArguments.arguments, hasLength(2));
+    expect(map.entries, hasLength(1));
+  }
+
+  @failingTest
+  void test_mapLiteral_invalid_too_many_type_arguments1() {
+    MapLiteral map =
+        parseExpression('<int, int, int>{}', parseSetLiterals: true, errors: [
+      // TODO(danrubel): Currently the resolver reports invalid number of
+      // type arguments, but the parser could report this.
+      expectedError(
+          /* ParserErrorCode.EXPECTED_ONE_OR_TWO_TYPE_VARIABLES */
+          ParserErrorCode.EXPECTED_TOKEN,
+          11,
+          3),
+    ]);
+    expect(map.constKeyword, isNull);
+    expect(map.entries, hasLength(0));
+  }
+
+  @failingTest
+  void test_mapLiteral_invalid_too_many_type_arguments2() {
+    MapLiteral map =
+        parseExpression('<int, int, int>{1}', parseSetLiterals: true, errors: [
+      // TODO(danrubel): Currently the resolver reports invalid number of
+      // type arguments, but the parser could report this.
+      expectedError(
+          /* ParserErrorCode.EXPECTED_ONE_OR_TWO_TYPE_VARIABLES */
+          ParserErrorCode.EXPECTED_TOKEN,
+          11,
+          3),
+    ]);
+    expect(map.constKeyword, isNull);
+    expect(map.entries, hasLength(0));
+  }
+
+  void test_mapLiteral_spread() {
+    // TODO(danrubel): Remove this once spread_collections is enabled by default
+    MapLiteral map = parseExpression('{1: 2, ...{3: 4}}',
+        parseSetLiterals: true,
+        errors: [expectedError(ParserErrorCode.UNEXPECTED_TOKEN, 7, 3)]);
+    expect(map.constKeyword, isNull);
+    expect(map.typeArguments, isNull);
+    expect(map.entries, hasLength(1));
+  }
+
+  void test_mapLiteral_spreadQ() {
+    // TODO(danrubel): Remove this once spread_collections is enabled by default
+    MapLiteral map = parseExpression('{1: 2, ...?{3: 4}}',
+        parseSetLiterals: true,
+        errors: [expectedError(ParserErrorCode.UNEXPECTED_TOKEN, 7, 4)]);
+    expect(map.constKeyword, isNull);
+    expect(map.typeArguments, isNull);
+    expect(map.entries, hasLength(1));
+  }
+
+  void test_mapLiteral_spread_typed() {
+    // TODO(danrubel): Remove this once spread_collections is enabled by default
+    MapLiteral map = parseExpression('<int, int>{...{3: 4}}',
+        parseSetLiterals: true,
+        errors: [expectedError(ParserErrorCode.UNEXPECTED_TOKEN, 11, 3)]);
+    expect(map.constKeyword, isNull);
+    expect(map.typeArguments.arguments, hasLength(2));
+    expect(map.entries, hasLength(0));
+  }
+
+  void test_mapLiteral_spreadQ_typed() {
+    // TODO(danrubel): Remove this once spread_collections is enabled by default
+    MapLiteral map = parseExpression('<int, int>{...?{3: 4}}',
+        parseSetLiterals: true,
+        errors: [expectedError(ParserErrorCode.UNEXPECTED_TOKEN, 11, 4)]);
+    expect(map.constKeyword, isNull);
+    expect(map.typeArguments.arguments, hasLength(2));
+    expect(map.entries, hasLength(0));
+  }
+
+  void test_mapLiteral_spread2_typed() {
+    // TODO(danrubel): Remove this once spread_collections is enabled by default
+    MapLiteral map = parseExpression('<int, int>{1: 2, ...{3: 4}}',
+        parseSetLiterals: true,
+        errors: [expectedError(ParserErrorCode.UNEXPECTED_TOKEN, 17, 3)]);
+    expect(map.constKeyword, isNull);
+    expect(map.typeArguments.arguments, hasLength(2));
+    expect(map.entries, hasLength(1));
+  }
+
+  void test_mapLiteral_spreadQ2_typed() {
+    // TODO(danrubel): Remove this once spread_collections is enabled by default
+    MapLiteral map = parseExpression('<int, int>{1: 2, ...?{3: 4}}',
+        parseSetLiterals: true,
+        errors: [expectedError(ParserErrorCode.UNEXPECTED_TOKEN, 17, 4)]);
+    expect(map.constKeyword, isNull);
+    expect(map.typeArguments.arguments, hasLength(2));
+    expect(map.entries, hasLength(1));
+  }
+
   void test_setLiteral() {
     SetLiteral set = parseExpression('{3}', parseSetLiterals: true);
     expect(set.constKeyword, isNull);
@@ -304,7 +1053,7 @@
     expect(value2.value, 6);
   }
 
-  void test_setLiteral_const_typeArgument() {
+  void test_setLiteral_const_typed() {
     SetLiteral set = parseExpression('const <int>{3}', parseSetLiterals: true);
     expect(set.constKeyword, isNotNull);
     expect(set.typeArguments.arguments, hasLength(1));
@@ -316,48 +1065,15 @@
   }
 
   void test_setLiteral_invalid_map_entry() {
-    parseExpression('<int>{1: 1}', parseSetLiterals: true, errors: [
+    SetLiteral set =
+        parseExpression('<int>{1: 1}', parseSetLiterals: true, errors: [
       expectedError(ParserErrorCode.EXPECTED_TOKEN, 7, 1),
     ]);
-  }
-
-  @failingTest
-  void test_setLiteral_invalid_too_many_type_arguments1() {
-    parseExpression('<int, int, int>{}', parseSetLiterals: true, errors: [
-      // TODO(danrubel): Currently the resolver reports invalid number of
-      // type arguments, but the parser could report this.
-      expectedError(
-          /* ParserErrorCode.EXPECTED_ONE_TYPE_VARIABLE */
-          ParserErrorCode.EXPECTED_TOKEN,
-          15,
-          1),
-    ]);
-  }
-
-  @failingTest
-  void test_setLiteral_invalid_too_many_type_arguments2() {
-    parseExpression('<int, int, int>{1}', parseSetLiterals: true, errors: [
-      // TODO(danrubel): Currently the resolver reports invalid number of
-      // type arguments, but the parser could report this.
-      expectedError(
-          /* ParserErrorCode.EXPECTED_ONE_TYPE_VARIABLE */
-          ParserErrorCode.EXPECTED_TOKEN,
-          15,
-          1),
-    ]);
-  }
-
-  @failingTest
-  void test_setLiteral_invalid_too_many_type_arguments3() {
-    parseExpression('<int, int>{1}', parseSetLiterals: true, errors: [
-      // TODO(danrubel): Currently the resolver reports invalid number of
-      // type arguments, but the parser could report this.
-      expectedError(
-          /* ParserErrorCode.EXPECTED_ONE_TYPE_VARIABLE */
-          ParserErrorCode.EXPECTED_TOKEN,
-          10,
-          1),
-    ]);
+    expect(set.constKeyword, isNull);
+    expect(set.typeArguments.arguments, hasLength(1));
+    NamedType typeArg = set.typeArguments.arguments[0];
+    expect(typeArg.name.name, 'int');
+    expect(set.elements.length, 1);
   }
 
   void test_setLiteral_nested_typeArgument() {
@@ -376,7 +1092,59 @@
     expect(value.value, 3);
   }
 
-  void test_setLiteral_typeArgument() {
+  void test_setLiteral_spread2() {
+    // TODO(danrubel): Remove this once spread_collections is enabled by default
+    SetLiteral set = parseExpression('{3, ...[4]}',
+        parseSetLiterals: true,
+        errors: [expectedError(ParserErrorCode.UNEXPECTED_TOKEN, 4, 3)]);
+    expect(set.constKeyword, isNull);
+    expect(set.typeArguments, isNull);
+    expect(set.elements, hasLength(2));
+    IntegerLiteral value = set.elements[0];
+    expect(value.value, 3);
+    ListLiteral list = set.elements[1];
+    expect(list.elements, hasLength(1));
+  }
+
+  void test_setLiteral_spread2Q() {
+    // TODO(danrubel): Remove this once spread_collections is enabled by default
+    SetLiteral set = parseExpression('{3, ...?[4]}',
+        parseSetLiterals: true,
+        errors: [expectedError(ParserErrorCode.UNEXPECTED_TOKEN, 4, 4)]);
+    expect(set.constKeyword, isNull);
+    expect(set.typeArguments, isNull);
+    expect(set.elements, hasLength(2));
+    IntegerLiteral value = set.elements[0];
+    expect(value.value, 3);
+    ListLiteral list = set.elements[1];
+    expect(list.elements, hasLength(1));
+  }
+
+  void test_setLiteral_spread_typed() {
+    // TODO(danrubel): Remove this once spread_collections is enabled by default
+    SetLiteral set = parseExpression('<int>{...[3]}',
+        parseSetLiterals: true,
+        errors: [expectedError(ParserErrorCode.UNEXPECTED_TOKEN, 6, 3)]);
+    expect(set.constKeyword, isNull);
+    expect(set.typeArguments, isNotNull);
+    expect(set.elements, hasLength(1));
+    ListLiteral list = set.elements[0];
+    expect(list.elements, hasLength(1));
+  }
+
+  void test_setLiteral_spreadQ_typed() {
+    // TODO(danrubel): Remove this once spread_collections is enabled by default
+    SetLiteral set = parseExpression('<int>{...?[3]}',
+        parseSetLiterals: true,
+        errors: [expectedError(ParserErrorCode.UNEXPECTED_TOKEN, 6, 4)]);
+    expect(set.constKeyword, isNull);
+    expect(set.typeArguments, isNotNull);
+    expect(set.elements, hasLength(1));
+    ListLiteral list = set.elements[0];
+    expect(list.elements, hasLength(1));
+  }
+
+  void test_setLiteral_typed() {
     SetLiteral set = parseExpression('<int>{3}', parseSetLiterals: true);
     expect(set.constKeyword, isNull);
     expect(set.typeArguments.arguments, hasLength(1));
@@ -386,6 +1154,26 @@
     IntegerLiteral value = set.elements[0];
     expect(value.value, 3);
   }
+
+  void test_setOrMapLiteral_spread() {
+    // TODO(danrubel): Remove this once spread_collections is enabled by default
+    MapLiteral set = parseExpression('{...{3: 4}}',
+        parseSetLiterals: true,
+        errors: [expectedError(ParserErrorCode.UNEXPECTED_TOKEN, 1, 3)]);
+    expect(set.constKeyword, isNull);
+    expect(set.typeArguments, isNull);
+    expect(set.entries, hasLength(0));
+  }
+
+  void test_setOrMapLiteral_spreadQ() {
+    // TODO(danrubel): Remove this once spread_collections is enabled by default
+    MapLiteral set = parseExpression('{...?{3: 4}}',
+        parseSetLiterals: true,
+        errors: [expectedError(ParserErrorCode.UNEXPECTED_TOKEN, 1, 4)]);
+    expect(set.constKeyword, isNull);
+    expect(set.typeArguments, isNull);
+    expect(set.entries, hasLength(0));
+  }
 }
 
 /**
@@ -644,9 +1432,18 @@
       {List<ErrorCode> codes,
       List<ExpectedError> errors,
       int expectedEndOffset,
-      bool parseSetLiterals = false}) {
+      bool inAsync = false,
+      bool parseSetLiterals = false,
+      bool parseSpreadCollections = false,
+      bool parseControlFlowCollections = false}) {
     createParser(source, expectedEndOffset: expectedEndOffset);
     _parserProxy.fastaParser.enableSetLiterals = parseSetLiterals;
+    _parserProxy.astBuilder.enableSpreadCollections = parseSpreadCollections;
+    _parserProxy.astBuilder.enableControlFlowCollections =
+        parseControlFlowCollections;
+    if (inAsync) {
+      _parserProxy.fastaParser.asyncState = AsyncModifier.Async;
+    }
     Expression result = _parserProxy.parseExpression2();
     assertErrors(codes: codes, errors: errors);
     return result;
@@ -823,8 +1620,20 @@
 
   @override
   Statement parseStatement(String source,
-      {bool enableLazyAssignmentOperators, int expectedEndOffset}) {
+      {bool enableLazyAssignmentOperators,
+      int expectedEndOffset,
+      bool parseSetLiterals = false,
+      bool parseSpreadCollections = false,
+      bool parseControlFlowCollections = false,
+      bool inAsync = false}) {
     createParser(source, expectedEndOffset: expectedEndOffset);
+    _parserProxy.fastaParser.enableSetLiterals = parseSetLiterals;
+    _parserProxy.astBuilder.enableSpreadCollections = parseSpreadCollections;
+    _parserProxy.astBuilder.enableControlFlowCollections =
+        parseControlFlowCollections;
+    if (inAsync) {
+      _parserProxy.fastaParser.asyncState = AsyncModifier.Async;
+    }
     Statement statement = _parserProxy.parseStatement2();
     assertErrors(codes: NO_ERROR_COMPARISON);
     return statement;
@@ -1108,6 +1917,21 @@
     ]);
   }
 
+  void test_incompleteForEach2() {
+    ForStatement2 statement = parseStatement('for (String item i) {}',
+        parseControlFlowCollections: true);
+    listener.assertErrors([
+      expectedError(ParserErrorCode.EXPECTED_TOKEN, 12, 4),
+      expectedError(ParserErrorCode.EXPECTED_TOKEN, 17, 1)
+    ]);
+    expect(statement.toSource(), 'for (String item; i;) {}');
+    ForPartsWithDeclarations forLoopParts = statement.forLoopParts;
+    expect(forLoopParts.leftSeparator, isNotNull);
+    expect(forLoopParts.leftSeparator.type, TokenType.SEMICOLON);
+    expect(forLoopParts.rightSeparator, isNotNull);
+    expect(forLoopParts.rightSeparator.type, TokenType.SEMICOLON);
+  }
+
   void test_invalidTypeParameters_super() {
     parseCompilationUnit('class C<X super Y> {}', errors: [
       // TODO(danrubel): Improve recovery.
@@ -1211,6 +2035,304 @@
     }
   }
 
+  void test_parseForStatement_each_await2() {
+    ForStatement2 forStatement = parseStatement(
+      'await for (element in list) {}',
+      inAsync: true,
+      parseControlFlowCollections: true,
+    );
+    assertNoErrors();
+    expect(forStatement.awaitKeyword, isNotNull);
+    expect(forStatement.forKeyword, isNotNull);
+    expect(forStatement.leftParenthesis, isNotNull);
+    ForEachPartsWithIdentifier forLoopParts = forStatement.forLoopParts;
+    expect(forLoopParts.identifier, isNotNull);
+    expect(forLoopParts.inKeyword, isNotNull);
+    expect(forLoopParts.iterable, isNotNull);
+    expect(forStatement.rightParenthesis, isNotNull);
+    expect(forStatement.body, isNotNull);
+  }
+
+  void test_parseForStatement_each_genericFunctionType2() {
+    ForStatement2 forStatement = parseStatement(
+      'for (void Function<T>(T) element in list) {}',
+      parseControlFlowCollections: true,
+    );
+    assertNoErrors();
+    expect(forStatement.awaitKeyword, isNull);
+    expect(forStatement.forKeyword, isNotNull);
+    expect(forStatement.leftParenthesis, isNotNull);
+    ForEachPartsWithDeclaration forLoopParts = forStatement.forLoopParts;
+    expect(forLoopParts.loopVariable, isNotNull);
+    expect(forLoopParts.inKeyword, isNotNull);
+    expect(forLoopParts.iterable, isNotNull);
+    expect(forStatement.rightParenthesis, isNotNull);
+    expect(forStatement.body, isNotNull);
+  }
+
+  void test_parseForStatement_each_identifier2() {
+    ForStatement2 forStatement = parseStatement(
+      'for (element in list) {}',
+      parseControlFlowCollections: true,
+    );
+    assertNoErrors();
+    expect(forStatement.awaitKeyword, isNull);
+    expect(forStatement.forKeyword, isNotNull);
+    expect(forStatement.leftParenthesis, isNotNull);
+    ForEachPartsWithIdentifier forLoopParts = forStatement.forLoopParts;
+    expect(forLoopParts.identifier, isNotNull);
+    expect(forLoopParts.inKeyword, isNotNull);
+    expect(forLoopParts.iterable, isNotNull);
+    expect(forStatement.rightParenthesis, isNotNull);
+    expect(forStatement.body, isNotNull);
+  }
+
+  void test_parseForStatement_each_noType_metadata2() {
+    ForStatement2 forStatement = parseStatement(
+      'for (@A var element in list) {}',
+      parseControlFlowCollections: true,
+    );
+    assertNoErrors();
+    expect(forStatement.awaitKeyword, isNull);
+    expect(forStatement.forKeyword, isNotNull);
+    expect(forStatement.leftParenthesis, isNotNull);
+    ForEachPartsWithDeclaration forLoopParts = forStatement.forLoopParts;
+    expect(forLoopParts.loopVariable, isNotNull);
+    expect(forLoopParts.loopVariable.metadata, hasLength(1));
+    expect(forLoopParts.inKeyword, isNotNull);
+    expect(forLoopParts.iterable, isNotNull);
+    expect(forStatement.rightParenthesis, isNotNull);
+    expect(forStatement.body, isNotNull);
+  }
+
+  void test_parseForStatement_each_type2() {
+    ForStatement2 forStatement = parseStatement(
+      'for (A element in list) {}',
+      parseControlFlowCollections: true,
+    );
+    assertNoErrors();
+    expect(forStatement.awaitKeyword, isNull);
+    expect(forStatement.forKeyword, isNotNull);
+    expect(forStatement.leftParenthesis, isNotNull);
+    ForEachPartsWithDeclaration forLoopParts = forStatement.forLoopParts;
+    expect(forLoopParts.loopVariable, isNotNull);
+    expect(forLoopParts.inKeyword, isNotNull);
+    expect(forLoopParts.iterable, isNotNull);
+    expect(forStatement.rightParenthesis, isNotNull);
+    expect(forStatement.body, isNotNull);
+  }
+
+  void test_parseForStatement_each_var2() {
+    ForStatement2 forStatement = parseStatement(
+      'for (var element in list) {}',
+      parseControlFlowCollections: true,
+    );
+    assertNoErrors();
+    expect(forStatement.awaitKeyword, isNull);
+    expect(forStatement.forKeyword, isNotNull);
+    expect(forStatement.leftParenthesis, isNotNull);
+    ForEachPartsWithDeclaration forLoopParts = forStatement.forLoopParts;
+    expect(forLoopParts.loopVariable, isNotNull);
+    expect(forLoopParts.inKeyword, isNotNull);
+    expect(forLoopParts.iterable, isNotNull);
+    expect(forStatement.rightParenthesis, isNotNull);
+    expect(forStatement.body, isNotNull);
+  }
+
+  void test_parseForStatement_loop_c2() {
+    ForStatement2 forStatement = parseStatement(
+      'for (; i < count;) {}',
+      parseControlFlowCollections: true,
+    );
+    assertNoErrors();
+    expect(forStatement.forKeyword, isNotNull);
+    expect(forStatement.leftParenthesis, isNotNull);
+    ForPartsWithExpression forLoopParts = forStatement.forLoopParts;
+    expect(forLoopParts.initialization, isNull);
+    expect(forLoopParts.leftSeparator, isNotNull);
+    expect(forLoopParts.condition, isNotNull);
+    expect(forLoopParts.rightSeparator, isNotNull);
+    expect(forLoopParts.updaters, hasLength(0));
+    expect(forStatement.rightParenthesis, isNotNull);
+    expect(forStatement.body, isNotNull);
+  }
+
+  void test_parseForStatement_loop_cu2() {
+    ForStatement2 forStatement = parseStatement(
+      'for (; i < count; i++) {}',
+      parseControlFlowCollections: true,
+    );
+    assertNoErrors();
+    expect(forStatement.forKeyword, isNotNull);
+    expect(forStatement.leftParenthesis, isNotNull);
+    ForPartsWithExpression forLoopParts = forStatement.forLoopParts;
+    expect(forLoopParts.initialization, isNull);
+    expect(forLoopParts.leftSeparator, isNotNull);
+    expect(forLoopParts.condition, isNotNull);
+    expect(forLoopParts.rightSeparator, isNotNull);
+    expect(forLoopParts.updaters, hasLength(1));
+    expect(forStatement.rightParenthesis, isNotNull);
+    expect(forStatement.body, isNotNull);
+  }
+
+  void test_parseForStatement_loop_ecu2() {
+    ForStatement2 forStatement = parseStatement(
+      'for (i--; i < count; i++) {}',
+      parseSpreadCollections: true,
+    );
+    assertNoErrors();
+    expect(forStatement.forKeyword, isNotNull);
+    expect(forStatement.leftParenthesis, isNotNull);
+    ForPartsWithExpression forLoopParts = forStatement.forLoopParts;
+    expect(forLoopParts.initialization, isNotNull);
+    expect(forLoopParts.leftSeparator, isNotNull);
+    expect(forLoopParts.condition, isNotNull);
+    expect(forLoopParts.rightSeparator, isNotNull);
+    expect(forLoopParts.updaters, hasLength(1));
+    expect(forStatement.rightParenthesis, isNotNull);
+    expect(forStatement.body, isNotNull);
+  }
+
+  void test_parseForStatement_loop_i2() {
+    ForStatement2 forStatement = parseStatement(
+      'for (var i = 0;;) {}',
+      parseSpreadCollections: true,
+    );
+    assertNoErrors();
+    expect(forStatement.forKeyword, isNotNull);
+    expect(forStatement.leftParenthesis, isNotNull);
+    ForPartsWithDeclarations forLoopParts = forStatement.forLoopParts;
+    VariableDeclarationList variables = forLoopParts.variables;
+    expect(variables, isNotNull);
+    expect(variables.metadata, hasLength(0));
+    expect(variables.variables, hasLength(1));
+    expect(forLoopParts.leftSeparator, isNotNull);
+    expect(forLoopParts.condition, isNull);
+    expect(forLoopParts.rightSeparator, isNotNull);
+    expect(forLoopParts.updaters, hasLength(0));
+    expect(forStatement.rightParenthesis, isNotNull);
+    expect(forStatement.body, isNotNull);
+  }
+
+  void test_parseForStatement_loop_i_withMetadata2() {
+    ForStatement2 forStatement = parseStatement(
+      'for (@A var i = 0;;) {}',
+      parseSpreadCollections: true,
+    );
+    assertNoErrors();
+    expect(forStatement.forKeyword, isNotNull);
+    expect(forStatement.leftParenthesis, isNotNull);
+    ForPartsWithDeclarations forLoopParts = forStatement.forLoopParts;
+    VariableDeclarationList variables = forLoopParts.variables;
+    expect(variables, isNotNull);
+    expect(variables.metadata, hasLength(1));
+    expect(variables.variables, hasLength(1));
+    expect(forLoopParts.leftSeparator, isNotNull);
+    expect(forLoopParts.condition, isNull);
+    expect(forLoopParts.rightSeparator, isNotNull);
+    expect(forLoopParts.updaters, hasLength(0));
+    expect(forStatement.rightParenthesis, isNotNull);
+    expect(forStatement.body, isNotNull);
+  }
+
+  void test_parseForStatement_loop_ic2() {
+    ForStatement2 forStatement = parseStatement(
+      'for (var i = 0; i < count;) {}',
+      parseSpreadCollections: true,
+    );
+    assertNoErrors();
+    expect(forStatement.forKeyword, isNotNull);
+    expect(forStatement.leftParenthesis, isNotNull);
+    ForPartsWithDeclarations forLoopParts = forStatement.forLoopParts;
+    VariableDeclarationList variables = forLoopParts.variables;
+    expect(variables, isNotNull);
+    expect(variables.variables, hasLength(1));
+    expect(forLoopParts.leftSeparator, isNotNull);
+    expect(forLoopParts.condition, isNotNull);
+    expect(forLoopParts.rightSeparator, isNotNull);
+    expect(forLoopParts.updaters, hasLength(0));
+    expect(forStatement.rightParenthesis, isNotNull);
+    expect(forStatement.body, isNotNull);
+  }
+
+  void test_parseForStatement_loop_icu2() {
+    ForStatement2 forStatement = parseStatement(
+      'for (var i = 0; i < count; i++) {}',
+      parseSpreadCollections: true,
+    );
+    assertNoErrors();
+    expect(forStatement.forKeyword, isNotNull);
+    expect(forStatement.leftParenthesis, isNotNull);
+    ForPartsWithDeclarations forLoopParts = forStatement.forLoopParts;
+    VariableDeclarationList variables = forLoopParts.variables;
+    expect(variables, isNotNull);
+    expect(variables.variables, hasLength(1));
+    expect(forLoopParts.leftSeparator, isNotNull);
+    expect(forLoopParts.condition, isNotNull);
+    expect(forLoopParts.rightSeparator, isNotNull);
+    expect(forLoopParts.updaters, hasLength(1));
+    expect(forStatement.rightParenthesis, isNotNull);
+    expect(forStatement.body, isNotNull);
+  }
+
+  void test_parseForStatement_loop_iicuu2() {
+    ForStatement2 forStatement = parseStatement(
+      'for (int i = 0, j = count; i < j; i++, j--) {}',
+      parseSpreadCollections: true,
+    );
+    assertNoErrors();
+    expect(forStatement.forKeyword, isNotNull);
+    expect(forStatement.leftParenthesis, isNotNull);
+    ForPartsWithDeclarations forLoopParts = forStatement.forLoopParts;
+    VariableDeclarationList variables = forLoopParts.variables;
+    expect(variables, isNotNull);
+    expect(variables.variables, hasLength(2));
+    expect(forLoopParts.leftSeparator, isNotNull);
+    expect(forLoopParts.condition, isNotNull);
+    expect(forLoopParts.rightSeparator, isNotNull);
+    expect(forLoopParts.updaters, hasLength(2));
+    expect(forStatement.rightParenthesis, isNotNull);
+    expect(forStatement.body, isNotNull);
+  }
+
+  void test_parseForStatement_loop_iu2() {
+    ForStatement2 forStatement = parseStatement(
+      'for (var i = 0;; i++) {}',
+      parseSpreadCollections: true,
+    );
+    assertNoErrors();
+    expect(forStatement.forKeyword, isNotNull);
+    expect(forStatement.leftParenthesis, isNotNull);
+    ForPartsWithDeclarations forLoopParts = forStatement.forLoopParts;
+    VariableDeclarationList variables = forLoopParts.variables;
+    expect(variables, isNotNull);
+    expect(variables.variables, hasLength(1));
+    expect(forLoopParts.leftSeparator, isNotNull);
+    expect(forLoopParts.condition, isNull);
+    expect(forLoopParts.rightSeparator, isNotNull);
+    expect(forLoopParts.updaters, hasLength(1));
+    expect(forStatement.rightParenthesis, isNotNull);
+    expect(forStatement.body, isNotNull);
+  }
+
+  void test_parseForStatement_loop_u2() {
+    ForStatement2 forStatement = parseStatement(
+      'for (;; i++) {}',
+      parseSpreadCollections: true,
+    );
+    assertNoErrors();
+    expect(forStatement.forKeyword, isNotNull);
+    expect(forStatement.leftParenthesis, isNotNull);
+    ForPartsWithExpression forLoopParts = forStatement.forLoopParts;
+    expect(forLoopParts.initialization, isNull);
+    expect(forLoopParts.leftSeparator, isNotNull);
+    expect(forLoopParts.condition, isNull);
+    expect(forLoopParts.rightSeparator, isNotNull);
+    expect(forLoopParts.updaters, hasLength(1));
+    expect(forStatement.rightParenthesis, isNotNull);
+    expect(forStatement.body, isNotNull);
+  }
+
   void test_partial_typeArg1_34850() {
     var unit = parseCompilationUnit('<bar<', errors: [
       expectedError(ParserErrorCode.EXPECTED_EXECUTABLE, 0, 1),
@@ -1493,14 +2615,15 @@
  */
 @reflectiveTest
 class NNBDParserTest_Fasta extends FastaParserTestCase {
-  parseNNBDCompilationUnit(String code, {List<ExpectedError> errors}) {
+  CompilationUnit parseNNBDCompilationUnit(String code,
+      {List<ExpectedError> errors}) {
     createParser('''
 @pragma('analyzer:non-nullable') library nnbd.parser.test;
 $code
 ''');
     _parserProxy.astBuilder.enableNonNullable = true;
     CompilationUnit unit = _parserProxy.parseCompilationUnit2();
-    assertNoErrors();
+    assertErrors(errors: errors);
     return unit;
   }
 
@@ -1532,6 +2655,19 @@
     parseNNBDCompilationUnit('main() { C.a? Function()? x = 7; }');
   }
 
+  void test_binary_expression_statement() {
+    final unit = parseNNBDCompilationUnit('D? foo(X? x) { X ?? x2; }');
+    FunctionDeclaration funct = unit.declarations[0];
+    BlockFunctionBody body = funct.functionExpression.body;
+    ExpressionStatement statement = body.block.statements[0];
+    BinaryExpression expression = statement.expression;
+    SimpleIdentifier lhs = expression.leftOperand;
+    expect(lhs.name, 'X');
+    expect(expression.operator.lexeme, '??');
+    SimpleIdentifier rhs = expression.rightOperand;
+    expect(rhs.name, 'x2');
+  }
+
   void test_conditional() {
     parseNNBDCompilationUnit('D? foo(X? x) { X ? 7 : y; }');
   }
@@ -1540,6 +2676,15 @@
     parseNNBDCompilationUnit('D? foo(X? x) { X ? x2 = x + bar(7) : y; }');
   }
 
+  void test_conditional_error() {
+    parseNNBDCompilationUnit('D? foo(X? x) { X ? ? x2 = x + bar(7) : y; }',
+        errors: [
+          expectedError(ParserErrorCode.MISSING_IDENTIFIER, 78, 1),
+          expectedError(ParserErrorCode.EXPECTED_TOKEN, 99, 1),
+          expectedError(ParserErrorCode.MISSING_IDENTIFIER, 99, 1),
+        ]);
+  }
+
   void test_conditional_simple() {
     parseNNBDCompilationUnit('D? foo(X? x) { X ? x2 = x : y; }');
   }
diff --git a/pkg/analyzer/test/generated/parser_test.dart b/pkg/analyzer/test/generated/parser_test.dart
index e6fbf65..9d5b456 100644
--- a/pkg/analyzer/test/generated/parser_test.dart
+++ b/pkg/analyzer/test/generated/parser_test.dart
@@ -10860,6 +10860,8 @@
   }
 
   void test_incompleteForEach() {
+    // TODO(danrubel): remove this once control flow and spread collection
+    // entry parsing is enabled by default
     ForStatement statement = parseStatement('for (String item i) {}');
     listener.assertErrors([
       expectedError(ParserErrorCode.EXPECTED_TOKEN, 12, 4),
@@ -14571,6 +14573,8 @@
   }
 
   void test_parseForStatement_each_await() {
+    // TODO(danrubel): remove this once control flow and spread collection
+    // entry parsing is enabled by default
     String code = 'await for (element in list) {}';
     var forStatement = _parseAsyncStatement(code) as ForEachStatement;
     assertNoErrors();
@@ -14586,6 +14590,8 @@
   }
 
   void test_parseForStatement_each_genericFunctionType() {
+    // TODO(danrubel): remove this once control flow and spread collection
+    // entry parsing is enabled by default
     var forStatement =
         parseStatement('for (void Function<T>(T) element in list) {}')
             as ForEachStatement;
@@ -14602,6 +14608,8 @@
   }
 
   void test_parseForStatement_each_identifier() {
+    // TODO(danrubel): remove this once control flow and spread collection
+    // entry parsing is enabled by default
     var forStatement =
         parseStatement('for (element in list) {}') as ForEachStatement;
     assertNoErrors();
@@ -14617,6 +14625,8 @@
   }
 
   void test_parseForStatement_each_noType_metadata() {
+    // TODO(danrubel): remove this once control flow and spread collection
+    // entry parsing is enabled by default
     var forStatement =
         parseStatement('for (@A var element in list) {}') as ForEachStatement;
     assertNoErrors();
@@ -14633,6 +14643,8 @@
   }
 
   void test_parseForStatement_each_type() {
+    // TODO(danrubel): remove this once control flow and spread collection
+    // entry parsing is enabled by default
     var forStatement =
         parseStatement('for (A element in list) {}') as ForEachStatement;
     assertNoErrors();
@@ -14648,6 +14660,8 @@
   }
 
   void test_parseForStatement_each_var() {
+    // TODO(danrubel): remove this once control flow and spread collection
+    // entry parsing is enabled by default
     var forStatement =
         parseStatement('for (var element in list) {}') as ForEachStatement;
     assertNoErrors();
@@ -14663,6 +14677,8 @@
   }
 
   void test_parseForStatement_loop_c() {
+    // TODO(danrubel): remove this once control flow and spread collection
+    // entry parsing is enabled by default
     var forStatement = parseStatement('for (; i < count;) {}') as ForStatement;
     assertNoErrors();
     expect(forStatement.forKeyword, isNotNull);
@@ -14678,6 +14694,8 @@
   }
 
   void test_parseForStatement_loop_cu() {
+    // TODO(danrubel): remove this once control flow and spread collection
+    // entry parsing is enabled by default
     var forStatement =
         parseStatement('for (; i < count; i++) {}') as ForStatement;
     assertNoErrors();
@@ -14694,6 +14712,8 @@
   }
 
   void test_parseForStatement_loop_ecu() {
+    // TODO(danrubel): remove this once control flow and spread collection
+    // entry parsing is enabled by default
     var forStatement =
         parseStatement('for (i--; i < count; i++) {}') as ForStatement;
     assertNoErrors();
@@ -14710,6 +14730,8 @@
   }
 
   void test_parseForStatement_loop_i() {
+    // TODO(danrubel): remove this once control flow and spread collection
+    // entry parsing is enabled by default
     var forStatement = parseStatement('for (var i = 0;;) {}') as ForStatement;
     assertNoErrors();
     expect(forStatement.forKeyword, isNotNull);
@@ -14728,6 +14750,8 @@
   }
 
   void test_parseForStatement_loop_i_withMetadata() {
+    // TODO(danrubel): remove this once control flow and spread collection
+    // entry parsing is enabled by default
     var forStatement =
         parseStatement('for (@A var i = 0;;) {}') as ForStatement;
     assertNoErrors();
@@ -14747,6 +14771,8 @@
   }
 
   void test_parseForStatement_loop_ic() {
+    // TODO(danrubel): remove this once control flow and spread collection
+    // entry parsing is enabled by default
     var forStatement =
         parseStatement('for (var i = 0; i < count;) {}') as ForStatement;
     assertNoErrors();
@@ -14765,6 +14791,8 @@
   }
 
   void test_parseForStatement_loop_icu() {
+    // TODO(danrubel): remove this once control flow and spread collection
+    // entry parsing is enabled by default
     var forStatement =
         parseStatement('for (var i = 0; i < count; i++) {}') as ForStatement;
     assertNoErrors();
@@ -14783,6 +14811,8 @@
   }
 
   void test_parseForStatement_loop_iicuu() {
+    // TODO(danrubel): remove this once control flow and spread collection
+    // entry parsing is enabled by default
     var forStatement =
         parseStatement('for (int i = 0, j = count; i < j; i++, j--) {}')
             as ForStatement;
@@ -14802,6 +14832,8 @@
   }
 
   void test_parseForStatement_loop_iu() {
+    // TODO(danrubel): remove this once control flow and spread collection
+    // entry parsing is enabled by default
     var forStatement =
         parseStatement('for (var i = 0;; i++) {}') as ForStatement;
     assertNoErrors();
@@ -14820,6 +14852,8 @@
   }
 
   void test_parseForStatement_loop_u() {
+    // TODO(danrubel): remove this once control flow and spread collection
+    // entry parsing is enabled by default
     var forStatement = parseStatement('for (;; i++) {}') as ForStatement;
     assertNoErrors();
     expect(forStatement.forKeyword, isNotNull);
diff --git a/pkg/analyzer/test/generated/resolver_test.dart b/pkg/analyzer/test/generated/resolver_test.dart
index 69dc68b..6c1887b 100644
--- a/pkg/analyzer/test/generated/resolver_test.dart
+++ b/pkg/analyzer/test/generated/resolver_test.dart
@@ -45,9 +45,7 @@
     defineReflectiveTests(LibraryScopeTest);
     defineReflectiveTests(PrefixedNamespaceTest);
     defineReflectiveTests(ScopeTest);
-    defineReflectiveTests(StrictModeTest);
     defineReflectiveTests(TypeOverrideManagerTest);
-    defineReflectiveTests(TypePropagationTest);
     defineReflectiveTests(TypeProviderImplTest);
     defineReflectiveTests(TypeResolverVisitorTest);
   });
@@ -166,6 +164,8 @@
   }
 }
 
+/// TODO(paulberry): migrate this test away from the task model.
+/// See dartbug.com/35734.
 @reflectiveTest
 class ErrorResolverTest extends ResolverTestCase {
   test_breakLabelOnSwitchMember() async {
@@ -596,8 +596,7 @@
  * The class `StrictModeTest` contains tests to ensure that the correct errors and warnings
  * are reported when the analysis engine is run in strict mode.
  */
-@reflectiveTest
-class StrictModeTest extends ResolverTestCase {
+abstract class StrictModeTest extends ResolverTestCase {
   fail_for() async {
     Source source = addSource(r'''
 int f(List<int> list) {
@@ -810,8 +809,7 @@
   }
 }
 
-@reflectiveTest
-class TypePropagationTest extends ResolverTestCase {
+abstract class TypePropagationTest extends ResolverTestCase {
   fail_propagatedReturnType_functionExpression() async {
     // TODO(scheglov) disabled because we don't resolve function expression
     String code = r'''
diff --git a/pkg/analyzer/test/generated/simple_resolver_test.dart b/pkg/analyzer/test/generated/simple_resolver_test.dart
index 91bb80a..4327b26 100644
--- a/pkg/analyzer/test/generated/simple_resolver_test.dart
+++ b/pkg/analyzer/test/generated/simple_resolver_test.dart
@@ -23,6 +23,8 @@
   });
 }
 
+/// TODO(paulberry): migrate this test away from the task model.
+/// See dartbug.com/35734.
 @reflectiveTest
 class SimpleResolverTest extends ResolverTestCase {
   test_argumentResolution_required_matching() async {
diff --git a/pkg/analyzer/test/generated/static_type_analyzer_test.dart b/pkg/analyzer/test/generated/static_type_analyzer_test.dart
index fe9cb89..5deedc3 100644
--- a/pkg/analyzer/test/generated/static_type_analyzer_test.dart
+++ b/pkg/analyzer/test/generated/static_type_analyzer_test.dart
@@ -35,7 +35,6 @@
   defineReflectiveSuite(() {
     defineReflectiveTests(SetLiteralsTest);
     defineReflectiveTests(StaticTypeAnalyzerTest);
-    defineReflectiveTests(StaticTypeAnalyzer2Test);
     defineReflectiveTests(StaticTypeAnalyzer3Test);
     defineReflectiveTests(StaticTypeAnalyzerWithSetLiteralsTest);
   });
@@ -74,8 +73,7 @@
 /**
  * Like [StaticTypeAnalyzerTest], but as end-to-end tests.
  */
-@reflectiveTest
-class StaticTypeAnalyzer2Test extends StaticTypeAnalyzer2TestShared {
+abstract class StaticTypeAnalyzer2Test extends StaticTypeAnalyzer2TestShared {
   test_FunctionExpressionInvocation_block() async {
     String code = r'''
 main() {
@@ -1586,7 +1584,7 @@
     for (FormalParameter parameter in parameters.parameters) {
       ParameterElementImpl element =
           new ParameterElementImpl.forNode(parameter.identifier);
-      // ignore: deprecated_member_use
+      // ignore: deprecated_member_use_from_same_package
       element.parameterKind = parameter.kind;
       element.type = _typeProvider.dynamicType;
       parameter.identifier.staticElement = element;
diff --git a/pkg/analyzer/test/generated/static_type_warning_code.dart b/pkg/analyzer/test/generated/static_type_warning_code.dart
new file mode 100644
index 0000000..def61b4
--- /dev/null
+++ b/pkg/analyzer/test/generated/static_type_warning_code.dart
@@ -0,0 +1,1762 @@
+// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:analyzer/src/error/codes.dart';
+import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/generated/source_io.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+
+import 'resolver_test_case.dart';
+
+abstract class StaticTypeWarningCodeTest extends ResolverTestCase {
+  fail_undefinedEnumConstant() async {
+    // We need a way to set the parseEnum flag in the parser to true.
+    await assertErrorsInCode(r'''
+enum E { ONE }
+E e() {
+  return E.TWO;
+}''', [StaticTypeWarningCode.UNDEFINED_ENUM_CONSTANT]);
+  }
+
+  test_assert_message_suppresses_type_promotion() async {
+    // If a variable is assigned to inside the expression for an assert
+    // message, type promotion should be suppressed, just as it would be if the
+    // assignment occurred outside an assert statement.  (Note that it is a
+    // dubious practice for the computation of an assert message to have side
+    // effects, since it is only evaluated if the assert fails).
+    await assertErrorsInCode('''
+class C {
+  void foo() {}
+}
+
+f(Object x) {
+  if (x is C) {
+    x.foo();
+    assert(true, () { x = new C(); return 'msg'; }());
+  }
+}
+''', [StaticTypeWarningCode.UNDEFINED_METHOD]);
+    // Do not verify since `x.foo()` fails to resolve.
+  }
+
+  test_await_flattened() async {
+    await assertErrorsInCode('''
+import 'dart:async';
+Future<Future<int>> ffi() => null;
+f() async {
+  Future<int> b = await ffi(); 
+}
+''', []);
+  }
+
+  test_await_simple() async {
+    await assertErrorsInCode('''
+import 'dart:async';
+Future<int> fi() => null;
+f() async {
+  String a = await fi(); // Warning: int not assignable to String
+}
+''', [StaticTypeWarningCode.INVALID_ASSIGNMENT]);
+  }
+
+  test_awaitForIn_declaredVariableRightType() async {
+    await assertNoErrorsInCode('''
+import 'dart:async';
+f() async {
+  Stream<int> stream;
+  await for (int i in stream) {}
+}
+''');
+  }
+
+  test_awaitForIn_declaredVariableWrongType() async {
+    await assertErrorsInCode('''
+import 'dart:async';
+f() async {
+  Stream<String> stream;
+  await for (int i in stream) {}
+}
+''', [StaticTypeWarningCode.FOR_IN_OF_INVALID_ELEMENT_TYPE]);
+  }
+
+  test_awaitForIn_downcast() async {
+    await assertNoErrorsInCode('''
+import 'dart:async';
+f() async {
+  Stream<num> stream;
+  await for (int i in stream) {}
+}
+''');
+  }
+
+  test_awaitForIn_dynamicStream() async {
+    await assertNoErrorsInCode('''
+f() async {
+  dynamic stream;
+  await for (int i in stream) {}
+}
+''');
+  }
+
+  test_awaitForIn_dynamicVariable() async {
+    await assertNoErrorsInCode('''
+import 'dart:async';
+f() async {
+  Stream<int> stream;
+  await for (var i in stream) {}
+}
+''');
+  }
+
+  test_awaitForIn_existingVariableRightType() async {
+    await assertNoErrorsInCode('''
+import 'dart:async';
+f() async {
+  Stream<int> stream;
+  int i;
+  await for (i in stream) {}
+}
+''');
+  }
+
+  test_awaitForIn_existingVariableWrongType() async {
+    await assertErrorsInCode('''
+import 'dart:async';
+f() async {
+  Stream<String> stream;
+  int i;
+  await for (i in stream) {}
+}
+''', [StaticTypeWarningCode.FOR_IN_OF_INVALID_ELEMENT_TYPE]);
+  }
+
+  test_awaitForIn_notStream() async {
+    await assertErrorsInCode('''
+f() async {
+  await for (var i in true) {}
+}
+''', [StaticTypeWarningCode.FOR_IN_OF_INVALID_TYPE]);
+  }
+
+  test_awaitForIn_streamOfDynamic() async {
+    await assertNoErrorsInCode('''
+import 'dart:async';
+f() async {
+  Stream stream;
+  await for (int i in stream) {}
+}
+''');
+  }
+
+  test_awaitForIn_upcast() async {
+    await assertNoErrorsInCode('''
+import 'dart:async';
+f() async {
+  Stream<int> stream;
+  await for (num i in stream) {}
+}
+''');
+  }
+
+  test_bug21912() async {
+    await assertErrorsInCode('''
+class A {}
+class B extends A {}
+
+typedef T Function2<S, T>(S z);
+typedef B AToB(A x);
+typedef A BToA(B x);
+
+void main() {
+  {
+    Function2<Function2<A, B>, Function2<B, A>> t1;
+    Function2<AToB, BToA> t2;
+
+    Function2<Function2<int, double>, Function2<int, double>> left;
+
+    left = t1;
+    left = t2;
+  }
+}
+''', [
+      StaticTypeWarningCode.INVALID_ASSIGNMENT,
+      StaticTypeWarningCode.INVALID_ASSIGNMENT
+    ]);
+  }
+
+  test_defaultSetLiteralNotEnabled() async {
+    await assertErrorsInCode(r'''
+void main() {
+  Set _ = {};
+}''', [StaticTypeWarningCode.INVALID_ASSIGNMENT]);
+  }
+
+  test_expectedOneListTypeArgument() async {
+    await assertErrorsInCode(r'''
+main() {
+  <int, int> [];
+}''', [StaticTypeWarningCode.EXPECTED_ONE_LIST_TYPE_ARGUMENTS]);
+  }
+
+  @failingTest
+  test_expectedOneSetTypeArgument() async {
+    await assertErrorsInCode(r'''
+main() {
+  <int, int>{2, 3};
+}''', [StaticTypeWarningCode.EXPECTED_ONE_SET_TYPE_ARGUMENTS]);
+  }
+
+  test_expectedTwoMapTypeArguments_three() async {
+    await assertErrorsInCode(r'''
+main() {
+  <int, int, int> {};
+}''', [StaticTypeWarningCode.EXPECTED_TWO_MAP_TYPE_ARGUMENTS]);
+  }
+
+  test_forIn_declaredVariableRightType() async {
+    await assertNoErrorsInCode('''
+f() {
+  for (int i in <int>[]) {}
+}
+''');
+  }
+
+  test_forIn_declaredVariableWrongType() async {
+    await assertErrorsInCode('''
+f() {
+  for (int i in <String>[]) {}
+}
+''', [StaticTypeWarningCode.FOR_IN_OF_INVALID_ELEMENT_TYPE]);
+  }
+
+  test_forIn_downcast() async {
+    await assertNoErrorsInCode('''
+f() {
+  for (int i in <num>[]) {}
+}
+''');
+  }
+
+  test_forIn_dynamic() async {
+    await assertNoErrorsInCode('''
+f() {
+  dynamic d; // Could be [].
+  for (var i in d) {}
+}
+''');
+  }
+
+  test_forIn_dynamicIterable() async {
+    await assertNoErrorsInCode('''
+f() {
+  dynamic iterable;
+  for (int i in iterable) {}
+}
+''');
+  }
+
+  test_forIn_dynamicVariable() async {
+    await assertNoErrorsInCode('''
+f() {
+  for (var i in <int>[]) {}
+}
+''');
+  }
+
+  test_forIn_existingVariableRightType() async {
+    await assertNoErrorsInCode('''
+f() {
+  int i;
+  for (i in <int>[]) {}
+}
+''');
+  }
+
+  test_forIn_existingVariableWrongType() async {
+    await assertErrorsInCode('''
+f() {
+  int i;
+  for (i in <String>[]) {}
+}
+''', [StaticTypeWarningCode.FOR_IN_OF_INVALID_ELEMENT_TYPE]);
+  }
+
+  test_forIn_iterableOfDynamic() async {
+    await assertNoErrorsInCode('''
+f() {
+  for (int i in []) {}
+}
+''');
+  }
+
+  test_forIn_notIterable() async {
+    await assertErrorsInCode('''
+f() {
+  for (var i in true) {}
+}
+''', [StaticTypeWarningCode.FOR_IN_OF_INVALID_TYPE]);
+  }
+
+  test_forIn_object() async {
+    await assertNoErrorsInCode('''
+f() {
+  Object o; // Could be [].
+  for (var i in o) {}
+}
+''');
+  }
+
+  test_forIn_typeBoundBad() async {
+    await assertErrorsInCode('''
+class Foo<T extends Iterable<int>> {
+  void method(T iterable) {
+    for (String i in iterable) {}
+  }
+}
+''', [StaticTypeWarningCode.FOR_IN_OF_INVALID_ELEMENT_TYPE]);
+  }
+
+  test_forIn_typeBoundGood() async {
+    await assertNoErrorsInCode('''
+class Foo<T extends Iterable<int>> {
+  void method(T iterable) {
+    for (var i in iterable) {}
+  }
+}
+''');
+  }
+
+  test_forIn_upcast() async {
+    await assertNoErrorsInCode('''
+f() {
+  for (num i in <int>[]) {}
+}
+''');
+  }
+
+  test_illegalAsyncGeneratorReturnType_function_nonStream() async {
+    await assertErrorsInCode('''
+int f() async* {}
+''', [StaticTypeWarningCode.ILLEGAL_ASYNC_GENERATOR_RETURN_TYPE]);
+  }
+
+  test_illegalAsyncGeneratorReturnType_function_subtypeOfStream() async {
+    await assertErrorsInCode('''
+import 'dart:async';
+abstract class SubStream<T> implements Stream<T> {}
+SubStream<int> f() async* {}
+''', [StaticTypeWarningCode.ILLEGAL_ASYNC_GENERATOR_RETURN_TYPE]);
+  }
+
+  test_illegalAsyncGeneratorReturnType_method_nonStream() async {
+    await assertErrorsInCode('''
+class C {
+  int f() async* {}
+}
+''', [StaticTypeWarningCode.ILLEGAL_ASYNC_GENERATOR_RETURN_TYPE]);
+  }
+
+  test_illegalAsyncGeneratorReturnType_method_subtypeOfStream() async {
+    await assertErrorsInCode('''
+import 'dart:async';
+abstract class SubStream<T> implements Stream<T> {}
+class C {
+  SubStream<int> f() async* {}
+}
+''', [StaticTypeWarningCode.ILLEGAL_ASYNC_GENERATOR_RETURN_TYPE]);
+  }
+
+  test_illegalAsyncReturnType_function_nonFuture() async {
+    await assertErrorsInCode('''
+int f() async {}
+''', [
+      StaticTypeWarningCode.ILLEGAL_ASYNC_RETURN_TYPE,
+      HintCode.MISSING_RETURN
+    ]);
+  }
+
+  test_illegalAsyncReturnType_function_subtypeOfFuture() async {
+    await assertErrorsInCode('''
+import 'dart:async';
+abstract class SubFuture<T> implements Future<T> {}
+SubFuture<int> f() async {
+  return 0;
+}
+''', [StaticTypeWarningCode.ILLEGAL_ASYNC_RETURN_TYPE]);
+  }
+
+  test_illegalAsyncReturnType_method_nonFuture() async {
+    await assertErrorsInCode('''
+class C {
+  int m() async {}
+}
+''', [
+      StaticTypeWarningCode.ILLEGAL_ASYNC_RETURN_TYPE,
+      HintCode.MISSING_RETURN
+    ]);
+  }
+
+  test_illegalAsyncReturnType_method_subtypeOfFuture() async {
+    await assertErrorsInCode('''
+import 'dart:async';
+abstract class SubFuture<T> implements Future<T> {}
+class C {
+  SubFuture<int> m() async {
+    return 0;
+  }
+}
+''', [StaticTypeWarningCode.ILLEGAL_ASYNC_RETURN_TYPE]);
+  }
+
+  test_illegalSyncGeneratorReturnType_function_nonIterator() async {
+    await assertErrorsInCode('''
+int f() sync* {}
+''', [StaticTypeWarningCode.ILLEGAL_SYNC_GENERATOR_RETURN_TYPE]);
+  }
+
+  test_illegalSyncGeneratorReturnType_function_subclassOfIterator() async {
+    await assertErrorsInCode('''
+abstract class SubIterator<T> implements Iterator<T> {}
+SubIterator<int> f() sync* {}
+''', [StaticTypeWarningCode.ILLEGAL_SYNC_GENERATOR_RETURN_TYPE]);
+  }
+
+  test_illegalSyncGeneratorReturnType_method_nonIterator() async {
+    await assertErrorsInCode('''
+class C {
+  int f() sync* {}
+}
+''', [StaticTypeWarningCode.ILLEGAL_SYNC_GENERATOR_RETURN_TYPE]);
+  }
+
+  test_illegalSyncGeneratorReturnType_method_subclassOfIterator() async {
+    await assertErrorsInCode('''
+abstract class SubIterator<T> implements Iterator<T> {}
+class C {
+  SubIterator<int> f() sync* {}
+}
+''', [StaticTypeWarningCode.ILLEGAL_SYNC_GENERATOR_RETURN_TYPE]);
+  }
+
+  test_instanceAccessToStaticMember_method_reference() async {
+    await assertErrorsInCode(r'''
+class A {
+  static m() {}
+}
+main(A a) {
+  a.m;
+}''', [StaticTypeWarningCode.INSTANCE_ACCESS_TO_STATIC_MEMBER]);
+  }
+
+  test_instanceAccessToStaticMember_propertyAccess_field() async {
+    await assertErrorsInCode(r'''
+class A {
+  static var f;
+}
+main(A a) {
+  a.f;
+}''', [StaticTypeWarningCode.INSTANCE_ACCESS_TO_STATIC_MEMBER]);
+  }
+
+  test_instanceAccessToStaticMember_propertyAccess_getter() async {
+    await assertErrorsInCode(r'''
+class A {
+  static get f => 42;
+}
+main(A a) {
+  a.f;
+}''', [StaticTypeWarningCode.INSTANCE_ACCESS_TO_STATIC_MEMBER]);
+  }
+
+  test_instanceAccessToStaticMember_propertyAccess_setter() async {
+    await assertErrorsInCode(r'''
+class A {
+  static set f(x) {}
+}
+main(A a) {
+  a.f = 42;
+}''', [StaticTypeWarningCode.INSTANCE_ACCESS_TO_STATIC_MEMBER]);
+  }
+
+  test_invalidAssignment_compoundAssignment() async {
+    await assertErrorsInCode(r'''
+class byte {
+  int _value;
+  byte(this._value);
+  int operator +(int val) { return 0; }
+}
+
+void main() {
+  byte b = new byte(52);
+  b += 3;
+}''', [StaticTypeWarningCode.INVALID_ASSIGNMENT]);
+  }
+
+  test_invalidAssignment_defaultValue_named() async {
+    await assertErrorsInCode(r'''
+f({String x: 0}) {
+}''', [StaticTypeWarningCode.INVALID_ASSIGNMENT]);
+  }
+
+  test_invalidAssignment_defaultValue_optional() async {
+    await assertErrorsInCode(r'''
+f([String x = 0]) {
+}''', [StaticTypeWarningCode.INVALID_ASSIGNMENT]);
+  }
+
+  test_invalidAssignment_dynamic() async {
+    await assertErrorsInCode(r'''
+main() {
+  dynamic = 1;
+}
+''', [StaticTypeWarningCode.INVALID_ASSIGNMENT]);
+  }
+
+  test_invalidAssignment_functionExpressionInvocation() async {
+    await assertErrorsInCode('''
+main() {
+  String x = (() => 5)();
+}''', [StaticTypeWarningCode.INVALID_ASSIGNMENT]);
+  }
+
+  test_invalidAssignment_ifNullAssignment() async {
+    await assertErrorsInCode('''
+void f(int i) {
+  double d;
+  d ??= i;
+}
+''', [StaticTypeWarningCode.INVALID_ASSIGNMENT]);
+  }
+
+  test_invalidAssignment_instanceVariable() async {
+    await assertErrorsInCode(r'''
+class A {
+  int x;
+}
+f() {
+  A a;
+  a.x = '0';
+}''', [StaticTypeWarningCode.INVALID_ASSIGNMENT]);
+  }
+
+  test_invalidAssignment_localVariable() async {
+    await assertErrorsInCode(r'''
+f() {
+  int x;
+  x = '0';
+}''', [StaticTypeWarningCode.INVALID_ASSIGNMENT]);
+  }
+
+  test_invalidAssignment_postfixExpression_localVariable() async {
+    await assertErrorsInCode(r'''
+class A {
+  B operator+(_) => new B();
+}
+
+class B {}
+
+f(A a) {
+  a++;
+}
+''', [StaticTypeWarningCode.INVALID_ASSIGNMENT]);
+  }
+
+  test_invalidAssignment_postfixExpression_property() async {
+    await assertErrorsInCode(r'''
+class A {
+  B operator+(_) => new B();
+}
+
+class B {}
+
+class C {
+  A a;
+}
+
+f(C c) {
+  c.a++;
+}
+''', [StaticTypeWarningCode.INVALID_ASSIGNMENT]);
+  }
+
+  test_invalidAssignment_prefixExpression_localVariable() async {
+    await assertErrorsInCode(r'''
+class A {
+  B operator+(_) => new B();
+}
+
+class B {}
+
+f(A a) {
+  ++a;
+}
+''', [StaticTypeWarningCode.INVALID_ASSIGNMENT]);
+  }
+
+  test_invalidAssignment_prefixExpression_property() async {
+    await assertErrorsInCode(r'''
+class A {
+  B operator+(_) => new B();
+}
+
+class B {}
+
+class C {
+  A a;
+}
+
+f(C c) {
+  ++c.a;
+}
+''', [StaticTypeWarningCode.INVALID_ASSIGNMENT]);
+  }
+
+  test_invalidAssignment_regressionInIssue18468Fix() async {
+    // https://code.google.com/p/dart/issues/detail?id=18628
+    await assertErrorsInCode(r'''
+class C<T> {
+  T t = int;
+}''', [StaticTypeWarningCode.INVALID_ASSIGNMENT]);
+  }
+
+  test_invalidAssignment_staticVariable() async {
+    await assertErrorsInCode(r'''
+class A {
+  static int x;
+}
+f() {
+  A.x = '0';
+}''', [StaticTypeWarningCode.INVALID_ASSIGNMENT]);
+  }
+
+  test_invalidAssignment_topLevelVariableDeclaration() async {
+    await assertErrorsInCode(
+        "int x = 'string';", [StaticTypeWarningCode.INVALID_ASSIGNMENT]);
+  }
+
+  test_invalidAssignment_typeParameter() async {
+    // 14221
+    await assertErrorsInCode(r'''
+class B<T> {
+  T value;
+  void test(num n) {
+    value = n;
+  }
+}''', [StaticTypeWarningCode.INVALID_ASSIGNMENT]);
+  }
+
+  test_invalidAssignment_variableDeclaration() async {
+    await assertErrorsInCode(r'''
+class A {
+  int x = 'string';
+}''', [StaticTypeWarningCode.INVALID_ASSIGNMENT]);
+  }
+
+  test_invocationOfNonFunctionExpression_literal() async {
+    await assertErrorsInCode(r'''
+f() {
+  3(5);
+}''', [StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION_EXPRESSION]);
+  }
+
+  test_nonBoolCondition_conditional() async {
+    await assertErrorsInCode("f() { return 3 ? 2 : 1; }",
+        [StaticTypeWarningCode.NON_BOOL_CONDITION]);
+  }
+
+  test_nonBoolCondition_do() async {
+    await assertErrorsInCode(r'''
+f() {
+  do {} while (3);
+}''', [StaticTypeWarningCode.NON_BOOL_CONDITION]);
+  }
+
+  test_nonBoolCondition_for() async {
+    // https://github.com/dart-lang/sdk/issues/24713
+    await assertErrorsInCode(r'''
+f() {
+  for (;3;) {}
+}''', [StaticTypeWarningCode.NON_BOOL_CONDITION]);
+  }
+
+  test_nonBoolCondition_if() async {
+    await assertErrorsInCode(r'''
+f() {
+  if (3) return 2; else return 1;
+}''', [StaticTypeWarningCode.NON_BOOL_CONDITION]);
+  }
+
+  test_nonBoolCondition_while() async {
+    await assertErrorsInCode(r'''
+f() {
+  while (3) {}
+}''', [StaticTypeWarningCode.NON_BOOL_CONDITION]);
+  }
+
+  test_nonBoolExpression_functionType_bool() async {
+    Source source = addSource(r'''
+bool makeAssertion() => true;
+f() {
+  assert(makeAssertion);
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [StaticTypeWarningCode.NON_BOOL_EXPRESSION]);
+    verify([source]);
+  }
+
+  test_nonBoolExpression_functionType_int() async {
+    await assertErrorsInCode(r'''
+int makeAssertion() => 1;
+f() {
+  assert(makeAssertion);
+}''', [StaticTypeWarningCode.NON_BOOL_EXPRESSION]);
+  }
+
+  test_nonBoolExpression_interfaceType() async {
+    await assertErrorsInCode(r'''
+f() {
+  assert(0);
+}''', [StaticTypeWarningCode.NON_BOOL_EXPRESSION]);
+  }
+
+  test_nonBoolNegationExpression() async {
+    await assertErrorsInCode(r'''
+f() {
+  !42;
+}''', [StaticTypeWarningCode.NON_BOOL_NEGATION_EXPRESSION]);
+  }
+
+  test_nonBoolOperand_and_left() async {
+    await assertErrorsInCode(r'''
+bool f(int left, bool right) {
+  return left && right;
+}''', [StaticTypeWarningCode.NON_BOOL_OPERAND]);
+  }
+
+  test_nonBoolOperand_and_right() async {
+    await assertErrorsInCode(r'''
+bool f(bool left, String right) {
+  return left && right;
+}''', [StaticTypeWarningCode.NON_BOOL_OPERAND]);
+  }
+
+  test_nonBoolOperand_or_left() async {
+    await assertErrorsInCode(r'''
+bool f(List<int> left, bool right) {
+  return left || right;
+}''', [StaticTypeWarningCode.NON_BOOL_OPERAND]);
+  }
+
+  test_nonBoolOperand_or_right() async {
+    await assertErrorsInCode(r'''
+bool f(bool left, double right) {
+  return left || right;
+}''', [StaticTypeWarningCode.NON_BOOL_OPERAND]);
+  }
+
+  test_nonTypeAsTypeArgument_notAType() async {
+    await assertErrorsInCode(r'''
+int A;
+class B<E> {}
+f(B<A> b) {}''', [StaticTypeWarningCode.NON_TYPE_AS_TYPE_ARGUMENT]);
+  }
+
+  test_nonTypeAsTypeArgument_undefinedIdentifier() async {
+    await assertErrorsInCode(r'''
+class B<E> {}
+f(B<A> b) {}''', [StaticTypeWarningCode.NON_TYPE_AS_TYPE_ARGUMENT]);
+  }
+
+  test_returnOfInvalidType_async_future_future_int_mismatches_future_int() async {
+    await assertErrorsInCode('''
+import 'dart:async';
+Future<int> f() async {
+  return g();
+}
+Future<Future<int>> g() => null;
+''', [StaticTypeWarningCode.RETURN_OF_INVALID_TYPE]);
+  }
+
+  test_returnOfInvalidType_async_future_int_mismatches_future_string() async {
+    await assertErrorsInCode('''
+import 'dart:async';
+Future<String> f() async {
+  return 5;
+}
+''', [StaticTypeWarningCode.RETURN_OF_INVALID_TYPE]);
+  }
+
+  test_returnOfInvalidType_async_future_int_mismatches_int() async {
+    await assertErrorsInCode('''
+int f() async {
+  return 5;
+}
+''', [
+      StaticTypeWarningCode.RETURN_OF_INVALID_TYPE,
+      StaticTypeWarningCode.ILLEGAL_ASYNC_RETURN_TYPE
+    ]);
+  }
+
+  test_returnOfInvalidType_expressionFunctionBody_function() async {
+    await assertErrorsInCode(
+        "int f() => '0';", [StaticTypeWarningCode.RETURN_OF_INVALID_TYPE]);
+  }
+
+  test_returnOfInvalidType_expressionFunctionBody_getter() async {
+    await assertErrorsInCode(
+        "int get g => '0';", [StaticTypeWarningCode.RETURN_OF_INVALID_TYPE]);
+  }
+
+  test_returnOfInvalidType_expressionFunctionBody_localFunction() async {
+    await assertErrorsInCode(r'''
+class A {
+  String m() {
+    int f() => '0';
+    return '0';
+  }
+}''', [StaticTypeWarningCode.RETURN_OF_INVALID_TYPE]);
+  }
+
+  test_returnOfInvalidType_expressionFunctionBody_method() async {
+    await assertErrorsInCode(r'''
+class A {
+  int f() => '0';
+}''', [StaticTypeWarningCode.RETURN_OF_INVALID_TYPE]);
+  }
+
+  test_returnOfInvalidType_function() async {
+    await assertErrorsInCode("int f() { return '0'; }",
+        [StaticTypeWarningCode.RETURN_OF_INVALID_TYPE]);
+  }
+
+  test_returnOfInvalidType_getter() async {
+    await assertErrorsInCode("int get g { return '0'; }",
+        [StaticTypeWarningCode.RETURN_OF_INVALID_TYPE]);
+  }
+
+  test_returnOfInvalidType_localFunction() async {
+    await assertErrorsInCode(r'''
+class A {
+  String m() {
+    int f() { return '0'; }
+    return '0';
+  }
+}''', [StaticTypeWarningCode.RETURN_OF_INVALID_TYPE]);
+  }
+
+  test_returnOfInvalidType_method() async {
+    await assertErrorsInCode(r'''
+class A {
+  int f() { return '0'; }
+}''', [StaticTypeWarningCode.RETURN_OF_INVALID_TYPE]);
+  }
+
+  test_returnOfInvalidType_not_issued_for_expressionFunctionBody_void() async {
+    await assertNoErrorsInCode("void f() => 42;");
+  }
+
+  test_returnOfInvalidType_not_issued_for_valid_generic_return() async {
+    await assertNoErrorsInCode(r'''
+abstract class F<T, U>  {
+  U get value;
+}
+
+abstract class G<T> {
+  T test(F<int, T> arg) => arg.value;
+}
+
+abstract class H<S> {
+  S test(F<int, S> arg) => arg.value;
+}
+
+void main() { }''');
+  }
+
+  test_returnOfInvalidType_void() async {
+    await assertErrorsInCode("void f() { return 42; }",
+        [StaticTypeWarningCode.RETURN_OF_INVALID_TYPE]);
+  }
+
+  test_typeArgumentNotMatchingBounds_classTypeAlias() async {
+    await assertErrorsInCode(r'''
+class A {}
+class B {}
+class C {}
+class G<E extends A> {}
+class D = G<B> with C;
+''', [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
+  }
+
+  test_typeArgumentNotMatchingBounds_extends() async {
+    await assertErrorsInCode(r'''
+class A {}
+class B {}
+class G<E extends A> {}
+class C extends G<B>{}
+''', [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
+  }
+
+  test_typeArgumentNotMatchingBounds_extends_regressionInIssue18468Fix() async {
+    // https://code.google.com/p/dart/issues/detail?id=18628
+    await assertErrorsInCode(r'''
+class X<T extends Type> {}
+class Y<U> extends X<U> {}
+''', [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
+  }
+
+  test_typeArgumentNotMatchingBounds_fieldFormalParameter() async {
+    await assertErrorsInCode(r'''
+class A {}
+class B {}
+class G<E extends A> {}
+class C {
+  var f;
+  C(G<B> this.f) {}
+}''', [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
+  }
+
+  test_typeArgumentNotMatchingBounds_functionReturnType() async {
+    await assertErrorsInCode(r'''
+class A {}
+class B {}
+class G<E extends A> {}
+G<B> f() { return null; }
+''', [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
+  }
+
+  test_typeArgumentNotMatchingBounds_functionTypeAlias() async {
+    await assertErrorsInCode(r'''
+class A {}
+class B {}
+class G<E extends A> {}
+typedef G<B> f();
+''', [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
+  }
+
+  test_typeArgumentNotMatchingBounds_functionTypedFormalParameter() async {
+    await assertErrorsInCode(r'''
+class A {}
+class B {}
+class G<E extends A> {}
+f(G<B> h()) {}
+''', [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
+  }
+
+  test_typeArgumentNotMatchingBounds_implements() async {
+    await assertErrorsInCode(r'''
+class A {}
+class B {}
+class G<E extends A> {}
+class C implements G<B>{}
+''', [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
+  }
+
+  test_typeArgumentNotMatchingBounds_is() async {
+    await assertErrorsInCode(r'''
+class A {}
+class B {}
+class G<E extends A> {}
+var b = 1 is G<B>;
+''', [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
+  }
+
+  test_typeArgumentNotMatchingBounds_methodInvocation_localFunction() async {
+    await assertErrorsInCode(r'''
+class Point<T extends num> {
+  Point(T x, T y);
+}
+
+main() {
+  Point<T> f<T extends num>(T x, T y) {
+    return new Point<T>(x, y);
+  }
+  print(f<String>('hello', 'world'));
+}
+''', [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
+  }
+
+  test_typeArgumentNotMatchingBounds_methodInvocation_method() async {
+    await assertErrorsInCode(r'''
+class Point<T extends num> {
+  Point(T x, T y);
+}
+
+class PointFactory {
+  Point<T> point<T extends num>(T x, T y) {
+    return new Point<T>(x, y);
+  }
+}
+
+f(PointFactory factory) {
+  print(factory.point<String>('hello', 'world'));
+}
+''', [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
+  }
+
+  test_typeArgumentNotMatchingBounds_methodInvocation_topLevelFunction() async {
+    await assertErrorsInCode(r'''
+class Point<T extends num> {
+  Point(T x, T y);
+}
+
+Point<T> f<T extends num>(T x, T y) {
+  return new Point<T>(x, y);
+}
+
+main() {
+  print(f<String>('hello', 'world'));
+}
+''', [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
+  }
+
+  test_typeArgumentNotMatchingBounds_methodReturnType() async {
+    await assertErrorsInCode(r'''
+class A {}
+class B {}
+class G<E extends A> {}
+class C {
+  G<B> m() { return null; }
+}''', [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
+  }
+
+  test_typeArgumentNotMatchingBounds_new() async {
+    await assertErrorsInCode(r'''
+class A {}
+class B {}
+class G<E extends A> {}
+f() { return new G<B>(); }
+''', [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
+  }
+
+  test_typeArgumentNotMatchingBounds_new_superTypeOfUpperBound() async {
+    await assertErrorsInCode(r'''
+class A {}
+class B extends A {}
+class C extends B {}
+class G<E extends B> {}
+f() { return new G<A>(); }
+''', [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
+  }
+
+  test_typeArgumentNotMatchingBounds_ofFunctionTypeAlias() async {
+    await assertErrorsInCode(r'''
+class A {}
+class B {}
+typedef F<T extends A>();
+F<B> fff;
+''', [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
+  }
+
+  test_typeArgumentNotMatchingBounds_parameter() async {
+    await assertErrorsInCode(r'''
+class A {}
+class B {}
+class G<E extends A> {}
+f(G<B> g) {}
+''', [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
+  }
+
+  test_typeArgumentNotMatchingBounds_redirectingConstructor() async {
+    await assertErrorsInCode(r'''
+class A {}
+class B {}
+class X<T extends A> {
+  X(int x, int y) {}
+  factory X.name(int x, int y) = X<B>;
+}''', [
+      StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS,
+      StaticWarningCode.REDIRECT_TO_INVALID_RETURN_TYPE
+    ]);
+  }
+
+  test_typeArgumentNotMatchingBounds_typeArgumentList() async {
+    await assertErrorsInCode(r'''
+class A {}
+class B {}
+class C<E> {}
+class D<E extends A> {}
+C<D<B>> Var;
+''', [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
+  }
+
+  test_typeArgumentNotMatchingBounds_typeParameter() async {
+    await assertErrorsInCode(r'''
+class A {}
+class B {}
+class C {}
+class G<E extends A> {}
+class D<F extends G<B>> {}
+''', [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
+  }
+
+  test_typeArgumentNotMatchingBounds_variableDeclaration() async {
+    await assertErrorsInCode(r'''
+class A {}
+class B {}
+class G<E extends A> {}
+G<B> g;
+''', [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
+  }
+
+  test_typeArgumentNotMatchingBounds_with() async {
+    await assertErrorsInCode(r'''
+class A {}
+class B {}
+class G<E extends A> {}
+class C extends Object with G<B>{}
+''', [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
+  }
+
+  test_typeParameterSupertypeOfItsBound() async {
+    await assertErrorsInCode(r'''
+class A<T extends T> {
+}
+''', [StaticTypeWarningCode.TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND]);
+  }
+
+  test_typePromotion_booleanAnd_useInRight_accessedInClosureRight_mutated() async {
+    await assertErrorsInUnverifiedCode(r'''
+callMe(f()) { f(); }
+main(Object p) {
+  (p is String) && callMe(() { p.length; });
+  p = 0;
+}''', [StaticTypeWarningCode.UNDEFINED_GETTER]);
+  }
+
+  test_typePromotion_booleanAnd_useInRight_mutatedInLeft() async {
+    await assertErrorsInUnverifiedCode(r'''
+main(Object p) {
+  ((p is String) && ((p = 42) == 42)) && p.length != 0;
+}''', [StaticTypeWarningCode.UNDEFINED_GETTER]);
+  }
+
+  test_typePromotion_booleanAnd_useInRight_mutatedInRight() async {
+    await assertErrorsInUnverifiedCode(r'''
+main(Object p) {
+  (p is String) && (((p = 42) == 42) && p.length != 0);
+}''', [StaticTypeWarningCode.UNDEFINED_GETTER]);
+  }
+
+  test_typePromotion_conditional_useInThen_accessedInClosure_hasAssignment_after() async {
+    await assertErrorsInUnverifiedCode(r'''
+callMe(f()) { f(); }
+main(Object p) {
+  p is String ? callMe(() { p.length; }) : 0;
+  p = 42;
+}''', [StaticTypeWarningCode.UNDEFINED_GETTER]);
+  }
+
+  test_typePromotion_conditional_useInThen_accessedInClosure_hasAssignment_before() async {
+    await assertErrorsInUnverifiedCode(r'''
+callMe(f()) { f(); }
+main(Object p) {
+  p = 42;
+  p is String ? callMe(() { p.length; }) : 0;
+}''', [StaticTypeWarningCode.UNDEFINED_GETTER]);
+  }
+
+  test_typePromotion_conditional_useInThen_hasAssignment() async {
+    await assertErrorsInUnverifiedCode(r'''
+main(Object p) {
+  p is String ? (p.length + (p = 42)) : 0;
+}''', [StaticTypeWarningCode.UNDEFINED_GETTER]);
+  }
+
+  test_typePromotion_if_accessedInClosure_hasAssignment() async {
+    await assertErrorsInUnverifiedCode(r'''
+callMe(f()) { f(); }
+main(Object p) {
+  if (p is String) {
+    callMe(() {
+      p.length;
+    });
+  }
+  p = 0;
+}''', [StaticTypeWarningCode.UNDEFINED_GETTER]);
+  }
+
+  test_typePromotion_if_and_right_hasAssignment() async {
+    await assertErrorsInUnverifiedCode(r'''
+main(Object p) {
+  if (p is String && (p = null) == null) {
+    p.length;
+  }
+}''', [StaticTypeWarningCode.UNDEFINED_GETTER]);
+  }
+
+  test_typePromotion_if_extends_notMoreSpecific_dynamic() async {
+    await assertErrorsInUnverifiedCode(r'''
+class V {}
+class A<T> {}
+class B<S> extends A<S> {
+  var b;
+}
+
+main(A<V> p) {
+  if (p is B) {
+    p.b;
+  }
+}''', [StaticTypeWarningCode.UNDEFINED_GETTER]);
+  }
+
+  test_typePromotion_if_extends_notMoreSpecific_notMoreSpecificTypeArg() async {
+    await assertErrorsInUnverifiedCode(r'''
+class V {}
+class A<T> {}
+class B<S> extends A<S> {
+  var b;
+}
+
+main(A<V> p) {
+  if (p is B<int>) {
+    p.b;
+  }
+}''', [StaticTypeWarningCode.UNDEFINED_GETTER]);
+  }
+
+  test_typePromotion_if_hasAssignment_after() async {
+    await assertErrorsInUnverifiedCode(r'''
+main(Object p) {
+  if (p is String) {
+    p.length;
+    p = 0;
+  }
+}''', [StaticTypeWarningCode.UNDEFINED_GETTER]);
+  }
+
+  test_typePromotion_if_hasAssignment_before() async {
+    await assertErrorsInUnverifiedCode(r'''
+main(Object p) {
+  if (p is String) {
+    p = 0;
+    p.length;
+  }
+}''', [StaticTypeWarningCode.UNDEFINED_GETTER]);
+  }
+
+  test_typePromotion_if_hasAssignment_inClosure_anonymous_after() async {
+    await assertErrorsInUnverifiedCode(r'''
+main(Object p) {
+  if (p is String) {
+    p.length;
+  }
+  () {p = 0;};
+}''', [StaticTypeWarningCode.UNDEFINED_GETTER]);
+  }
+
+  test_typePromotion_if_hasAssignment_inClosure_anonymous_before() async {
+    await assertErrorsInUnverifiedCode(r'''
+main(Object p) {
+  () {p = 0;};
+  if (p is String) {
+    p.length;
+  }
+}''', [StaticTypeWarningCode.UNDEFINED_GETTER]);
+  }
+
+  test_typePromotion_if_hasAssignment_inClosure_function_after() async {
+    await assertErrorsInUnverifiedCode(r'''
+main(Object p) {
+  if (p is String) {
+    p.length;
+  }
+  f() {p = 0;};
+}''', [StaticTypeWarningCode.UNDEFINED_GETTER]);
+  }
+
+  test_typePromotion_if_hasAssignment_inClosure_function_before() async {
+    await assertErrorsInUnverifiedCode(r'''
+main(Object p) {
+  f() {p = 0;};
+  if (p is String) {
+    p.length;
+  }
+}''', [StaticTypeWarningCode.UNDEFINED_GETTER]);
+  }
+
+  test_typePromotion_if_implements_notMoreSpecific_dynamic() async {
+    await assertErrorsInUnverifiedCode(r'''
+class V {}
+class A<T> {}
+class B<S> implements A<S> {
+  var b;
+}
+
+main(A<V> p) {
+  if (p is B) {
+    p.b;
+  }
+}''', [StaticTypeWarningCode.UNDEFINED_GETTER]);
+  }
+
+  test_typePromotion_if_with_notMoreSpecific_dynamic() async {
+    await assertErrorsInUnverifiedCode(r'''
+class V {}
+class A<T> {}
+class B<S> extends Object with A<S> {
+  var b;
+}
+
+main(A<V> p) {
+  if (p is B) {
+    p.b;
+  }
+}''', [StaticTypeWarningCode.UNDEFINED_GETTER]);
+  }
+
+  test_undefinedGetter() async {
+    await assertErrorsInUnverifiedCode(r'''
+class T {}
+f(T e) { return e.m; }''', [StaticTypeWarningCode.UNDEFINED_GETTER]);
+  }
+
+  test_undefinedGetter_generic_function_call() async {
+    // Referencing `.call` on a `Function` type works similarly to referencing
+    // it on `dynamic`--the reference is accepted at compile time, and all type
+    // checking is deferred until runtime.
+    await assertErrorsInUnverifiedCode('''
+f(Function f) {
+  return f.call;
+}
+''', []);
+  }
+
+  test_undefinedGetter_object_call() async {
+    await assertErrorsInUnverifiedCode('''
+f(Object o) {
+  return o.call;
+}
+''', [StaticTypeWarningCode.UNDEFINED_GETTER]);
+  }
+
+  test_undefinedGetter_proxy_annotation_fakeProxy() async {
+    await assertErrorsInCode(r'''
+library L;
+class Fake {
+  const Fake();
+}
+const proxy = const Fake();
+@proxy class PrefixProxy {}
+main() {
+  new PrefixProxy().foo;
+}''', [StaticTypeWarningCode.UNDEFINED_GETTER]);
+  }
+
+  test_undefinedGetter_static() async {
+    await assertErrorsInUnverifiedCode(r'''
+class A {}
+var a = A.B;''', [StaticTypeWarningCode.UNDEFINED_GETTER]);
+  }
+
+  test_undefinedGetter_typeLiteral_cascadeTarget() async {
+    await assertErrorsInCode(r'''
+class T {
+  static int get foo => 42;
+}
+main() {
+  T..foo;
+}''', [StaticTypeWarningCode.UNDEFINED_GETTER]);
+  }
+
+  test_undefinedGetter_typeLiteral_conditionalAccess() async {
+    // When applied to a type literal, the conditional access operator '?.'
+    // cannot be used to access instance getters of Type.
+    // TODO(brianwilkerson) We cannot verify because hashCode isn't resolved.
+    await assertErrorsInCode('''
+class A {}
+f() => A?.hashCode;
+''', [StaticTypeWarningCode.UNDEFINED_GETTER], verify: false);
+  }
+
+  test_undefinedGetter_wrongNumberOfTypeArguments_tooLittle() async {
+    await assertErrorsInCode(r'''
+class A<K, V> {
+  K element;
+}
+main(A<int> a) {
+  a.element.anyGetterExistsInDynamic;
+}''', [StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS]);
+  }
+
+  test_undefinedGetter_wrongNumberOfTypeArguments_tooMany() async {
+    await assertErrorsInCode(r'''
+class A<E> {
+  E element;
+}
+main(A<int,int> a) {
+  a.element.anyGetterExistsInDynamic;
+}''', [StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS]);
+  }
+
+  test_undefinedGetter_wrongOfTypeArgument() async {
+    await assertErrorsInCode(r'''
+class A<E> {
+  E element;
+}
+main(A<NoSuchType> a) {
+  a.element.anyGetterExistsInDynamic;
+}''', [StaticTypeWarningCode.NON_TYPE_AS_TYPE_ARGUMENT]);
+  }
+
+  test_undefinedMethod_assignmentExpression() async {
+    await assertErrorsInCode(r'''
+class A {}
+class B {
+  f(A a) {
+    A a2 = new A();
+    a += a2;
+  }
+}''', [StaticTypeWarningCode.UNDEFINED_METHOD]);
+  }
+
+  test_undefinedMethod_ignoreTypePropagation() async {
+    await assertErrorsInCode(r'''
+class A {}
+class B extends A {
+  m() {}
+}
+class C {
+  f() {
+    A a = new B();
+    a.m();
+  }
+}''', [StaticTypeWarningCode.UNDEFINED_METHOD]);
+  }
+
+  test_undefinedMethod_leastUpperBoundWithNull() async {
+    await assertErrorsInCode('f(bool b, int i) => (b ? null : i).foo();',
+        [StaticTypeWarningCode.UNDEFINED_METHOD]);
+  }
+
+  test_undefinedMethod_ofNull() async {
+    // TODO(scheglov) Track https://github.com/dart-lang/sdk/issues/28430 to
+    // decide whether a warning should be reported here.
+    await assertErrorsInCode(r'''
+Null f(int x) => null;
+main() {
+  f(42).abs();
+}
+''', [StaticTypeWarningCode.UNDEFINED_METHOD]);
+  }
+
+  test_undefinedMethodWithConstructor() async {
+    // TODO(brianwilkerson) We cannot verify because 'C' could not be resolved.
+    await assertErrorsInCode(r'''
+class C {
+  C.m();
+}
+f() {
+  C c = C.m();
+}''', [], verify: false);
+  }
+
+  test_undefinedOperator_indexBoth() async {
+    await assertErrorsInUnverifiedCode(r'''
+class A {}
+f(A a) {
+  a[0]++;
+}''', [
+      StaticTypeWarningCode.UNDEFINED_OPERATOR,
+      StaticTypeWarningCode.UNDEFINED_OPERATOR,
+    ]);
+  }
+
+  test_undefinedOperator_indexGetter() async {
+    await assertErrorsInUnverifiedCode(r'''
+class A {}
+f(A a) {
+  a[0];
+}''', [StaticTypeWarningCode.UNDEFINED_OPERATOR]);
+  }
+
+  test_undefinedOperator_indexSetter() async {
+    await assertErrorsInUnverifiedCode(r'''
+class A {}
+f(A a) {
+  a[0] = 1;
+}''', [StaticTypeWarningCode.UNDEFINED_OPERATOR]);
+  }
+
+  test_undefinedOperator_plus() async {
+    await assertErrorsInUnverifiedCode(r'''
+class A {}
+f(A a) {
+  a + 1;
+}''', [StaticTypeWarningCode.UNDEFINED_OPERATOR]);
+  }
+
+  test_undefinedOperator_postfixExpression() async {
+    await assertErrorsInCode(r'''
+class A {}
+f(A a) {
+  a++;
+}''', [StaticTypeWarningCode.UNDEFINED_OPERATOR]);
+  }
+
+  test_undefinedOperator_prefixExpression() async {
+    await assertErrorsInCode(r'''
+class A {}
+f(A a) {
+  ++a;
+}''', [StaticTypeWarningCode.UNDEFINED_OPERATOR]);
+  }
+
+  test_undefinedSetter() async {
+    await assertErrorsInUnverifiedCode(r'''
+class T {}
+f(T e1) { e1.m = 0; }''', [StaticTypeWarningCode.UNDEFINED_SETTER]);
+  }
+
+  test_undefinedSetter_static() async {
+    await assertErrorsInUnverifiedCode(r'''
+class A {}
+f() { A.B = 0;}''', [StaticTypeWarningCode.UNDEFINED_SETTER]);
+  }
+
+  test_undefinedSetter_typeLiteral_cascadeTarget() async {
+    await assertErrorsInCode(r'''
+class T {
+  static void set foo(_) {}
+}
+main() {
+  T..foo = 42;
+}''', [StaticTypeWarningCode.UNDEFINED_SETTER]);
+  }
+
+  test_unqualifiedReferenceToNonLocalStaticMember_getter() async {
+    await assertErrorsInCode(r'''
+class A {
+  static int get a => 0;
+}
+class B extends A {
+  int b() {
+    return a;
+  }
+}''', [StaticTypeWarningCode.UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER]);
+  }
+
+  test_unqualifiedReferenceToNonLocalStaticMember_getter_invokeTarget() async {
+    await assertErrorsInCode(r'''
+class A {
+  static int foo;
+}
+
+class B extends A {
+  static bar() {
+    foo.abs();
+  }
+}
+''', [StaticTypeWarningCode.UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER]);
+  }
+
+  test_unqualifiedReferenceToNonLocalStaticMember_setter() async {
+    await assertErrorsInCode(r'''
+class A {
+  static set a(x) {}
+}
+class B extends A {
+  b(y) {
+    a = y;
+  }
+}''', [StaticTypeWarningCode.UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER]);
+  }
+
+  test_wrongNumberOfTypeArguments_class_tooFew() async {
+    await assertErrorsInCode(r'''
+class A<E, F> {}
+A<A> a = null;''', [StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS]);
+  }
+
+  test_wrongNumberOfTypeArguments_class_tooMany() async {
+    await assertErrorsInCode(r'''
+class A<E> {}
+A<A, A> a = null;''', [StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS]);
+  }
+
+  test_wrongNumberOfTypeArguments_classAlias() async {
+    await assertErrorsInCode(r'''
+class A {}
+class M {}
+class B<F extends num> = A<F> with M;''',
+        [StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS]);
+  }
+
+  test_wrongNumberOfTypeArguments_dynamic() async {
+    await assertErrorsInCode(r'''
+dynamic<int> v;
+''', [StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS]);
+  }
+
+  test_wrongNumberOfTypeArguments_typeParameter() async {
+    await assertErrorsInCode(r'''
+class C<T> {
+  T<int> f;
+}
+''', [StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS]);
+  }
+
+  test_wrongNumberOfTypeArguments_typeTest_tooFew() async {
+    await assertErrorsInCode(r'''
+class A {}
+class C<K, V> {}
+f(p) {
+  return p is C<A>;
+}''', [StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS]);
+  }
+
+  test_wrongNumberOfTypeArguments_typeTest_tooMany() async {
+    await assertErrorsInCode(r'''
+class A {}
+class C<E> {}
+f(p) {
+  return p is C<A, A>;
+}''', [StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS]);
+  }
+
+  test_yield_async_to_basic_type() async {
+    await assertErrorsInCode('''
+int f() async* {
+  yield 3;
+}
+''', [
+      StaticTypeWarningCode.YIELD_OF_INVALID_TYPE,
+      StaticTypeWarningCode.ILLEGAL_ASYNC_GENERATOR_RETURN_TYPE
+    ]);
+  }
+
+  test_yield_async_to_iterable() async {
+    await assertErrorsInCode('''
+Iterable<int> f() async* {
+  yield 3;
+}
+''', [
+      StaticTypeWarningCode.YIELD_OF_INVALID_TYPE,
+      StaticTypeWarningCode.ILLEGAL_ASYNC_GENERATOR_RETURN_TYPE
+    ]);
+  }
+
+  test_yield_async_to_mistyped_stream() async {
+    await assertErrorsInCode('''
+import 'dart:async';
+Stream<int> f() async* {
+  yield "foo";
+}
+''', [StaticTypeWarningCode.YIELD_OF_INVALID_TYPE]);
+  }
+
+  test_yield_each_async_non_stream() async {
+    await assertErrorsInCode('''
+f() async* {
+  yield* 0;
+}
+''', [StaticTypeWarningCode.YIELD_OF_INVALID_TYPE]);
+  }
+
+  test_yield_each_async_to_mistyped_stream() async {
+    await assertErrorsInCode('''
+import 'dart:async';
+Stream<int> f() async* {
+  yield* g();
+}
+Stream<String> g() => null;
+''', [StaticTypeWarningCode.YIELD_OF_INVALID_TYPE]);
+  }
+
+  test_yield_each_sync_non_iterable() async {
+    await assertErrorsInCode('''
+f() sync* {
+  yield* 0;
+}
+''', [StaticTypeWarningCode.YIELD_OF_INVALID_TYPE]);
+  }
+
+  test_yield_each_sync_to_mistyped_iterable() async {
+    await assertErrorsInCode('''
+Iterable<int> f() sync* {
+  yield* g();
+}
+Iterable<String> g() => null;
+''', [StaticTypeWarningCode.YIELD_OF_INVALID_TYPE]);
+  }
+
+  test_yield_sync_to_basic_type() async {
+    await assertErrorsInCode('''
+int f() sync* {
+  yield 3;
+}
+''', [
+      StaticTypeWarningCode.YIELD_OF_INVALID_TYPE,
+      StaticTypeWarningCode.ILLEGAL_SYNC_GENERATOR_RETURN_TYPE
+    ]);
+  }
+
+  test_yield_sync_to_mistyped_iterable() async {
+    await assertErrorsInCode('''
+Iterable<int> f() sync* {
+  yield "foo";
+}
+''', [StaticTypeWarningCode.YIELD_OF_INVALID_TYPE]);
+  }
+
+  test_yield_sync_to_stream() async {
+    await assertErrorsInCode('''
+import 'dart:async';
+Stream<int> f() sync* {
+  yield 3;
+}
+''', [
+      StaticTypeWarningCode.YIELD_OF_INVALID_TYPE,
+      StaticTypeWarningCode.ILLEGAL_SYNC_GENERATOR_RETURN_TYPE
+    ]);
+  }
+}
+
+abstract class StrongModeStaticTypeWarningCodeTest extends ResolverTestCase {
+  void setUp() {
+    super.setUp();
+    AnalysisOptionsImpl options = new AnalysisOptionsImpl();
+    resetWith(options: options);
+  }
+
+  test_legalAsyncGeneratorReturnType_function_supertypeOfStream() async {
+    await assertErrorsInCode('''
+import 'dart:async';
+f() async* { yield 42; }
+dynamic f2() async* { yield 42; }
+Object f3() async* { yield 42; }
+Stream f4() async* { yield 42; }
+Stream<dynamic> f5() async* { yield 42; }
+Stream<Object> f6() async* { yield 42; }
+Stream<num> f7() async* { yield 42; }
+Stream<int> f8() async* { yield 42; }
+''', []);
+  }
+
+  test_legalAsyncReturnType_function_supertypeOfFuture() async {
+    await assertErrorsInCode('''
+import 'dart:async';
+f() async { return 42; }
+dynamic f2() async { return 42; }
+Object f3() async { return 42; }
+Future f4() async { return 42; }
+Future<dynamic> f5() async { return 42; }
+Future<Object> f6() async { return 42; }
+Future<num> f7() async { return 42; }
+Future<int> f8() async { return 42; }
+''', []);
+  }
+
+  test_legalSyncGeneratorReturnType_function_supertypeOfIterable() async {
+    await assertErrorsInCode('''
+f() sync* { yield 42; }
+dynamic f2() sync* { yield 42; }
+Object f3() sync* { yield 42; }
+Iterable f4() sync* { yield 42; }
+Iterable<dynamic> f5() sync* { yield 42; }
+Iterable<Object> f6() sync* { yield 42; }
+Iterable<num> f7() sync* { yield 42; }
+Iterable<int> f8() sync* { yield 42; }
+''', []);
+  }
+}
diff --git a/pkg/analyzer/test/generated/static_type_warning_code_driver_test.dart b/pkg/analyzer/test/generated/static_type_warning_code_driver_test.dart
index fcb17db..6286728 100644
--- a/pkg/analyzer/test/generated/static_type_warning_code_driver_test.dart
+++ b/pkg/analyzer/test/generated/static_type_warning_code_driver_test.dart
@@ -4,7 +4,7 @@
 
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import 'static_type_warning_code_test.dart';
+import 'static_type_warning_code.dart';
 
 main() {
   defineReflectiveSuite(() {
diff --git a/pkg/analyzer/test/generated/static_type_warning_code_test.dart b/pkg/analyzer/test/generated/static_type_warning_code_test.dart
deleted file mode 100644
index 5c1f94b..0000000
--- a/pkg/analyzer/test/generated/static_type_warning_code_test.dart
+++ /dev/null
@@ -1,1771 +0,0 @@
-// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'package:analyzer/src/error/codes.dart';
-import 'package:analyzer/src/generated/engine.dart';
-import 'package:analyzer/src/generated/source_io.dart';
-import 'package:test_reflective_loader/test_reflective_loader.dart';
-
-import 'resolver_test_case.dart';
-
-main() {
-  defineReflectiveSuite(() {
-    defineReflectiveTests(StaticTypeWarningCodeTest);
-    defineReflectiveTests(StrongModeStaticTypeWarningCodeTest);
-  });
-}
-
-@reflectiveTest
-class StaticTypeWarningCodeTest extends ResolverTestCase {
-  fail_undefinedEnumConstant() async {
-    // We need a way to set the parseEnum flag in the parser to true.
-    await assertErrorsInCode(r'''
-enum E { ONE }
-E e() {
-  return E.TWO;
-}''', [StaticTypeWarningCode.UNDEFINED_ENUM_CONSTANT]);
-  }
-
-  test_assert_message_suppresses_type_promotion() async {
-    // If a variable is assigned to inside the expression for an assert
-    // message, type promotion should be suppressed, just as it would be if the
-    // assignment occurred outside an assert statement.  (Note that it is a
-    // dubious practice for the computation of an assert message to have side
-    // effects, since it is only evaluated if the assert fails).
-    await assertErrorsInCode('''
-class C {
-  void foo() {}
-}
-
-f(Object x) {
-  if (x is C) {
-    x.foo();
-    assert(true, () { x = new C(); return 'msg'; }());
-  }
-}
-''', [StaticTypeWarningCode.UNDEFINED_METHOD]);
-    // Do not verify since `x.foo()` fails to resolve.
-  }
-
-  test_await_flattened() async {
-    await assertErrorsInCode('''
-import 'dart:async';
-Future<Future<int>> ffi() => null;
-f() async {
-  Future<int> b = await ffi(); 
-}
-''', []);
-  }
-
-  test_await_simple() async {
-    await assertErrorsInCode('''
-import 'dart:async';
-Future<int> fi() => null;
-f() async {
-  String a = await fi(); // Warning: int not assignable to String
-}
-''', [StaticTypeWarningCode.INVALID_ASSIGNMENT]);
-  }
-
-  test_awaitForIn_declaredVariableRightType() async {
-    await assertNoErrorsInCode('''
-import 'dart:async';
-f() async {
-  Stream<int> stream;
-  await for (int i in stream) {}
-}
-''');
-  }
-
-  test_awaitForIn_declaredVariableWrongType() async {
-    await assertErrorsInCode('''
-import 'dart:async';
-f() async {
-  Stream<String> stream;
-  await for (int i in stream) {}
-}
-''', [StaticTypeWarningCode.FOR_IN_OF_INVALID_ELEMENT_TYPE]);
-  }
-
-  test_awaitForIn_downcast() async {
-    await assertNoErrorsInCode('''
-import 'dart:async';
-f() async {
-  Stream<num> stream;
-  await for (int i in stream) {}
-}
-''');
-  }
-
-  test_awaitForIn_dynamicStream() async {
-    await assertNoErrorsInCode('''
-f() async {
-  dynamic stream;
-  await for (int i in stream) {}
-}
-''');
-  }
-
-  test_awaitForIn_dynamicVariable() async {
-    await assertNoErrorsInCode('''
-import 'dart:async';
-f() async {
-  Stream<int> stream;
-  await for (var i in stream) {}
-}
-''');
-  }
-
-  test_awaitForIn_existingVariableRightType() async {
-    await assertNoErrorsInCode('''
-import 'dart:async';
-f() async {
-  Stream<int> stream;
-  int i;
-  await for (i in stream) {}
-}
-''');
-  }
-
-  test_awaitForIn_existingVariableWrongType() async {
-    await assertErrorsInCode('''
-import 'dart:async';
-f() async {
-  Stream<String> stream;
-  int i;
-  await for (i in stream) {}
-}
-''', [StaticTypeWarningCode.FOR_IN_OF_INVALID_ELEMENT_TYPE]);
-  }
-
-  test_awaitForIn_notStream() async {
-    await assertErrorsInCode('''
-f() async {
-  await for (var i in true) {}
-}
-''', [StaticTypeWarningCode.FOR_IN_OF_INVALID_TYPE]);
-  }
-
-  test_awaitForIn_streamOfDynamic() async {
-    await assertNoErrorsInCode('''
-import 'dart:async';
-f() async {
-  Stream stream;
-  await for (int i in stream) {}
-}
-''');
-  }
-
-  test_awaitForIn_upcast() async {
-    await assertNoErrorsInCode('''
-import 'dart:async';
-f() async {
-  Stream<int> stream;
-  await for (num i in stream) {}
-}
-''');
-  }
-
-  test_bug21912() async {
-    await assertErrorsInCode('''
-class A {}
-class B extends A {}
-
-typedef T Function2<S, T>(S z);
-typedef B AToB(A x);
-typedef A BToA(B x);
-
-void main() {
-  {
-    Function2<Function2<A, B>, Function2<B, A>> t1;
-    Function2<AToB, BToA> t2;
-
-    Function2<Function2<int, double>, Function2<int, double>> left;
-
-    left = t1;
-    left = t2;
-  }
-}
-''', [
-      StaticTypeWarningCode.INVALID_ASSIGNMENT,
-      StaticTypeWarningCode.INVALID_ASSIGNMENT
-    ]);
-  }
-
-  test_defaultSetLiteralNotEnabled() async {
-    await assertErrorsInCode(r'''
-void main() {
-  Set _ = {};
-}''', [StaticTypeWarningCode.INVALID_ASSIGNMENT]);
-  }
-
-  test_expectedOneListTypeArgument() async {
-    await assertErrorsInCode(r'''
-main() {
-  <int, int> [];
-}''', [StaticTypeWarningCode.EXPECTED_ONE_LIST_TYPE_ARGUMENTS]);
-  }
-
-  @failingTest
-  test_expectedOneSetTypeArgument() async {
-    await assertErrorsInCode(r'''
-main() {
-  <int, int>{2, 3};
-}''', [StaticTypeWarningCode.EXPECTED_ONE_SET_TYPE_ARGUMENTS]);
-  }
-
-  test_expectedTwoMapTypeArguments_three() async {
-    await assertErrorsInCode(r'''
-main() {
-  <int, int, int> {};
-}''', [StaticTypeWarningCode.EXPECTED_TWO_MAP_TYPE_ARGUMENTS]);
-  }
-
-  test_forIn_declaredVariableRightType() async {
-    await assertNoErrorsInCode('''
-f() {
-  for (int i in <int>[]) {}
-}
-''');
-  }
-
-  test_forIn_declaredVariableWrongType() async {
-    await assertErrorsInCode('''
-f() {
-  for (int i in <String>[]) {}
-}
-''', [StaticTypeWarningCode.FOR_IN_OF_INVALID_ELEMENT_TYPE]);
-  }
-
-  test_forIn_downcast() async {
-    await assertNoErrorsInCode('''
-f() {
-  for (int i in <num>[]) {}
-}
-''');
-  }
-
-  test_forIn_dynamic() async {
-    await assertNoErrorsInCode('''
-f() {
-  dynamic d; // Could be [].
-  for (var i in d) {}
-}
-''');
-  }
-
-  test_forIn_dynamicIterable() async {
-    await assertNoErrorsInCode('''
-f() {
-  dynamic iterable;
-  for (int i in iterable) {}
-}
-''');
-  }
-
-  test_forIn_dynamicVariable() async {
-    await assertNoErrorsInCode('''
-f() {
-  for (var i in <int>[]) {}
-}
-''');
-  }
-
-  test_forIn_existingVariableRightType() async {
-    await assertNoErrorsInCode('''
-f() {
-  int i;
-  for (i in <int>[]) {}
-}
-''');
-  }
-
-  test_forIn_existingVariableWrongType() async {
-    await assertErrorsInCode('''
-f() {
-  int i;
-  for (i in <String>[]) {}
-}
-''', [StaticTypeWarningCode.FOR_IN_OF_INVALID_ELEMENT_TYPE]);
-  }
-
-  test_forIn_iterableOfDynamic() async {
-    await assertNoErrorsInCode('''
-f() {
-  for (int i in []) {}
-}
-''');
-  }
-
-  test_forIn_notIterable() async {
-    await assertErrorsInCode('''
-f() {
-  for (var i in true) {}
-}
-''', [StaticTypeWarningCode.FOR_IN_OF_INVALID_TYPE]);
-  }
-
-  test_forIn_object() async {
-    await assertNoErrorsInCode('''
-f() {
-  Object o; // Could be [].
-  for (var i in o) {}
-}
-''');
-  }
-
-  test_forIn_typeBoundBad() async {
-    await assertErrorsInCode('''
-class Foo<T extends Iterable<int>> {
-  void method(T iterable) {
-    for (String i in iterable) {}
-  }
-}
-''', [StaticTypeWarningCode.FOR_IN_OF_INVALID_ELEMENT_TYPE]);
-  }
-
-  test_forIn_typeBoundGood() async {
-    await assertNoErrorsInCode('''
-class Foo<T extends Iterable<int>> {
-  void method(T iterable) {
-    for (var i in iterable) {}
-  }
-}
-''');
-  }
-
-  test_forIn_upcast() async {
-    await assertNoErrorsInCode('''
-f() {
-  for (num i in <int>[]) {}
-}
-''');
-  }
-
-  test_illegalAsyncGeneratorReturnType_function_nonStream() async {
-    await assertErrorsInCode('''
-int f() async* {}
-''', [StaticTypeWarningCode.ILLEGAL_ASYNC_GENERATOR_RETURN_TYPE]);
-  }
-
-  test_illegalAsyncGeneratorReturnType_function_subtypeOfStream() async {
-    await assertErrorsInCode('''
-import 'dart:async';
-abstract class SubStream<T> implements Stream<T> {}
-SubStream<int> f() async* {}
-''', [StaticTypeWarningCode.ILLEGAL_ASYNC_GENERATOR_RETURN_TYPE]);
-  }
-
-  test_illegalAsyncGeneratorReturnType_method_nonStream() async {
-    await assertErrorsInCode('''
-class C {
-  int f() async* {}
-}
-''', [StaticTypeWarningCode.ILLEGAL_ASYNC_GENERATOR_RETURN_TYPE]);
-  }
-
-  test_illegalAsyncGeneratorReturnType_method_subtypeOfStream() async {
-    await assertErrorsInCode('''
-import 'dart:async';
-abstract class SubStream<T> implements Stream<T> {}
-class C {
-  SubStream<int> f() async* {}
-}
-''', [StaticTypeWarningCode.ILLEGAL_ASYNC_GENERATOR_RETURN_TYPE]);
-  }
-
-  test_illegalAsyncReturnType_function_nonFuture() async {
-    await assertErrorsInCode('''
-int f() async {}
-''', [
-      StaticTypeWarningCode.ILLEGAL_ASYNC_RETURN_TYPE,
-      HintCode.MISSING_RETURN
-    ]);
-  }
-
-  test_illegalAsyncReturnType_function_subtypeOfFuture() async {
-    await assertErrorsInCode('''
-import 'dart:async';
-abstract class SubFuture<T> implements Future<T> {}
-SubFuture<int> f() async {
-  return 0;
-}
-''', [StaticTypeWarningCode.ILLEGAL_ASYNC_RETURN_TYPE]);
-  }
-
-  test_illegalAsyncReturnType_method_nonFuture() async {
-    await assertErrorsInCode('''
-class C {
-  int m() async {}
-}
-''', [
-      StaticTypeWarningCode.ILLEGAL_ASYNC_RETURN_TYPE,
-      HintCode.MISSING_RETURN
-    ]);
-  }
-
-  test_illegalAsyncReturnType_method_subtypeOfFuture() async {
-    await assertErrorsInCode('''
-import 'dart:async';
-abstract class SubFuture<T> implements Future<T> {}
-class C {
-  SubFuture<int> m() async {
-    return 0;
-  }
-}
-''', [StaticTypeWarningCode.ILLEGAL_ASYNC_RETURN_TYPE]);
-  }
-
-  test_illegalSyncGeneratorReturnType_function_nonIterator() async {
-    await assertErrorsInCode('''
-int f() sync* {}
-''', [StaticTypeWarningCode.ILLEGAL_SYNC_GENERATOR_RETURN_TYPE]);
-  }
-
-  test_illegalSyncGeneratorReturnType_function_subclassOfIterator() async {
-    await assertErrorsInCode('''
-abstract class SubIterator<T> implements Iterator<T> {}
-SubIterator<int> f() sync* {}
-''', [StaticTypeWarningCode.ILLEGAL_SYNC_GENERATOR_RETURN_TYPE]);
-  }
-
-  test_illegalSyncGeneratorReturnType_method_nonIterator() async {
-    await assertErrorsInCode('''
-class C {
-  int f() sync* {}
-}
-''', [StaticTypeWarningCode.ILLEGAL_SYNC_GENERATOR_RETURN_TYPE]);
-  }
-
-  test_illegalSyncGeneratorReturnType_method_subclassOfIterator() async {
-    await assertErrorsInCode('''
-abstract class SubIterator<T> implements Iterator<T> {}
-class C {
-  SubIterator<int> f() sync* {}
-}
-''', [StaticTypeWarningCode.ILLEGAL_SYNC_GENERATOR_RETURN_TYPE]);
-  }
-
-  test_instanceAccessToStaticMember_method_reference() async {
-    await assertErrorsInCode(r'''
-class A {
-  static m() {}
-}
-main(A a) {
-  a.m;
-}''', [StaticTypeWarningCode.INSTANCE_ACCESS_TO_STATIC_MEMBER]);
-  }
-
-  test_instanceAccessToStaticMember_propertyAccess_field() async {
-    await assertErrorsInCode(r'''
-class A {
-  static var f;
-}
-main(A a) {
-  a.f;
-}''', [StaticTypeWarningCode.INSTANCE_ACCESS_TO_STATIC_MEMBER]);
-  }
-
-  test_instanceAccessToStaticMember_propertyAccess_getter() async {
-    await assertErrorsInCode(r'''
-class A {
-  static get f => 42;
-}
-main(A a) {
-  a.f;
-}''', [StaticTypeWarningCode.INSTANCE_ACCESS_TO_STATIC_MEMBER]);
-  }
-
-  test_instanceAccessToStaticMember_propertyAccess_setter() async {
-    await assertErrorsInCode(r'''
-class A {
-  static set f(x) {}
-}
-main(A a) {
-  a.f = 42;
-}''', [StaticTypeWarningCode.INSTANCE_ACCESS_TO_STATIC_MEMBER]);
-  }
-
-  test_invalidAssignment_compoundAssignment() async {
-    await assertErrorsInCode(r'''
-class byte {
-  int _value;
-  byte(this._value);
-  int operator +(int val) { return 0; }
-}
-
-void main() {
-  byte b = new byte(52);
-  b += 3;
-}''', [StaticTypeWarningCode.INVALID_ASSIGNMENT]);
-  }
-
-  test_invalidAssignment_defaultValue_named() async {
-    await assertErrorsInCode(r'''
-f({String x: 0}) {
-}''', [StaticTypeWarningCode.INVALID_ASSIGNMENT]);
-  }
-
-  test_invalidAssignment_defaultValue_optional() async {
-    await assertErrorsInCode(r'''
-f([String x = 0]) {
-}''', [StaticTypeWarningCode.INVALID_ASSIGNMENT]);
-  }
-
-  test_invalidAssignment_dynamic() async {
-    await assertErrorsInCode(r'''
-main() {
-  dynamic = 1;
-}
-''', [StaticTypeWarningCode.INVALID_ASSIGNMENT]);
-  }
-
-  test_invalidAssignment_functionExpressionInvocation() async {
-    await assertErrorsInCode('''
-main() {
-  String x = (() => 5)();
-}''', [StaticTypeWarningCode.INVALID_ASSIGNMENT]);
-  }
-
-  test_invalidAssignment_ifNullAssignment() async {
-    await assertErrorsInCode('''
-void f(int i) {
-  double d;
-  d ??= i;
-}
-''', [StaticTypeWarningCode.INVALID_ASSIGNMENT]);
-  }
-
-  test_invalidAssignment_instanceVariable() async {
-    await assertErrorsInCode(r'''
-class A {
-  int x;
-}
-f() {
-  A a;
-  a.x = '0';
-}''', [StaticTypeWarningCode.INVALID_ASSIGNMENT]);
-  }
-
-  test_invalidAssignment_localVariable() async {
-    await assertErrorsInCode(r'''
-f() {
-  int x;
-  x = '0';
-}''', [StaticTypeWarningCode.INVALID_ASSIGNMENT]);
-  }
-
-  test_invalidAssignment_postfixExpression_localVariable() async {
-    await assertErrorsInCode(r'''
-class A {
-  B operator+(_) => new B();
-}
-
-class B {}
-
-f(A a) {
-  a++;
-}
-''', [StaticTypeWarningCode.INVALID_ASSIGNMENT]);
-  }
-
-  test_invalidAssignment_postfixExpression_property() async {
-    await assertErrorsInCode(r'''
-class A {
-  B operator+(_) => new B();
-}
-
-class B {}
-
-class C {
-  A a;
-}
-
-f(C c) {
-  c.a++;
-}
-''', [StaticTypeWarningCode.INVALID_ASSIGNMENT]);
-  }
-
-  test_invalidAssignment_prefixExpression_localVariable() async {
-    await assertErrorsInCode(r'''
-class A {
-  B operator+(_) => new B();
-}
-
-class B {}
-
-f(A a) {
-  ++a;
-}
-''', [StaticTypeWarningCode.INVALID_ASSIGNMENT]);
-  }
-
-  test_invalidAssignment_prefixExpression_property() async {
-    await assertErrorsInCode(r'''
-class A {
-  B operator+(_) => new B();
-}
-
-class B {}
-
-class C {
-  A a;
-}
-
-f(C c) {
-  ++c.a;
-}
-''', [StaticTypeWarningCode.INVALID_ASSIGNMENT]);
-  }
-
-  test_invalidAssignment_regressionInIssue18468Fix() async {
-    // https://code.google.com/p/dart/issues/detail?id=18628
-    await assertErrorsInCode(r'''
-class C<T> {
-  T t = int;
-}''', [StaticTypeWarningCode.INVALID_ASSIGNMENT]);
-  }
-
-  test_invalidAssignment_staticVariable() async {
-    await assertErrorsInCode(r'''
-class A {
-  static int x;
-}
-f() {
-  A.x = '0';
-}''', [StaticTypeWarningCode.INVALID_ASSIGNMENT]);
-  }
-
-  test_invalidAssignment_topLevelVariableDeclaration() async {
-    await assertErrorsInCode(
-        "int x = 'string';", [StaticTypeWarningCode.INVALID_ASSIGNMENT]);
-  }
-
-  test_invalidAssignment_typeParameter() async {
-    // 14221
-    await assertErrorsInCode(r'''
-class B<T> {
-  T value;
-  void test(num n) {
-    value = n;
-  }
-}''', [StaticTypeWarningCode.INVALID_ASSIGNMENT]);
-  }
-
-  test_invalidAssignment_variableDeclaration() async {
-    await assertErrorsInCode(r'''
-class A {
-  int x = 'string';
-}''', [StaticTypeWarningCode.INVALID_ASSIGNMENT]);
-  }
-
-  test_invocationOfNonFunctionExpression_literal() async {
-    await assertErrorsInCode(r'''
-f() {
-  3(5);
-}''', [StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION_EXPRESSION]);
-  }
-
-  test_nonBoolCondition_conditional() async {
-    await assertErrorsInCode("f() { return 3 ? 2 : 1; }",
-        [StaticTypeWarningCode.NON_BOOL_CONDITION]);
-  }
-
-  test_nonBoolCondition_do() async {
-    await assertErrorsInCode(r'''
-f() {
-  do {} while (3);
-}''', [StaticTypeWarningCode.NON_BOOL_CONDITION]);
-  }
-
-  test_nonBoolCondition_for() async {
-    // https://github.com/dart-lang/sdk/issues/24713
-    await assertErrorsInCode(r'''
-f() {
-  for (;3;) {}
-}''', [StaticTypeWarningCode.NON_BOOL_CONDITION]);
-  }
-
-  test_nonBoolCondition_if() async {
-    await assertErrorsInCode(r'''
-f() {
-  if (3) return 2; else return 1;
-}''', [StaticTypeWarningCode.NON_BOOL_CONDITION]);
-  }
-
-  test_nonBoolCondition_while() async {
-    await assertErrorsInCode(r'''
-f() {
-  while (3) {}
-}''', [StaticTypeWarningCode.NON_BOOL_CONDITION]);
-  }
-
-  test_nonBoolExpression_functionType_bool() async {
-    Source source = addSource(r'''
-bool makeAssertion() => true;
-f() {
-  assert(makeAssertion);
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [StaticTypeWarningCode.NON_BOOL_EXPRESSION]);
-    verify([source]);
-  }
-
-  test_nonBoolExpression_functionType_int() async {
-    await assertErrorsInCode(r'''
-int makeAssertion() => 1;
-f() {
-  assert(makeAssertion);
-}''', [StaticTypeWarningCode.NON_BOOL_EXPRESSION]);
-  }
-
-  test_nonBoolExpression_interfaceType() async {
-    await assertErrorsInCode(r'''
-f() {
-  assert(0);
-}''', [StaticTypeWarningCode.NON_BOOL_EXPRESSION]);
-  }
-
-  test_nonBoolNegationExpression() async {
-    await assertErrorsInCode(r'''
-f() {
-  !42;
-}''', [StaticTypeWarningCode.NON_BOOL_NEGATION_EXPRESSION]);
-  }
-
-  test_nonBoolOperand_and_left() async {
-    await assertErrorsInCode(r'''
-bool f(int left, bool right) {
-  return left && right;
-}''', [StaticTypeWarningCode.NON_BOOL_OPERAND]);
-  }
-
-  test_nonBoolOperand_and_right() async {
-    await assertErrorsInCode(r'''
-bool f(bool left, String right) {
-  return left && right;
-}''', [StaticTypeWarningCode.NON_BOOL_OPERAND]);
-  }
-
-  test_nonBoolOperand_or_left() async {
-    await assertErrorsInCode(r'''
-bool f(List<int> left, bool right) {
-  return left || right;
-}''', [StaticTypeWarningCode.NON_BOOL_OPERAND]);
-  }
-
-  test_nonBoolOperand_or_right() async {
-    await assertErrorsInCode(r'''
-bool f(bool left, double right) {
-  return left || right;
-}''', [StaticTypeWarningCode.NON_BOOL_OPERAND]);
-  }
-
-  test_nonTypeAsTypeArgument_notAType() async {
-    await assertErrorsInCode(r'''
-int A;
-class B<E> {}
-f(B<A> b) {}''', [StaticTypeWarningCode.NON_TYPE_AS_TYPE_ARGUMENT]);
-  }
-
-  test_nonTypeAsTypeArgument_undefinedIdentifier() async {
-    await assertErrorsInCode(r'''
-class B<E> {}
-f(B<A> b) {}''', [StaticTypeWarningCode.NON_TYPE_AS_TYPE_ARGUMENT]);
-  }
-
-  test_returnOfInvalidType_async_future_future_int_mismatches_future_int() async {
-    await assertErrorsInCode('''
-import 'dart:async';
-Future<int> f() async {
-  return g();
-}
-Future<Future<int>> g() => null;
-''', [StaticTypeWarningCode.RETURN_OF_INVALID_TYPE]);
-  }
-
-  test_returnOfInvalidType_async_future_int_mismatches_future_string() async {
-    await assertErrorsInCode('''
-import 'dart:async';
-Future<String> f() async {
-  return 5;
-}
-''', [StaticTypeWarningCode.RETURN_OF_INVALID_TYPE]);
-  }
-
-  test_returnOfInvalidType_async_future_int_mismatches_int() async {
-    await assertErrorsInCode('''
-int f() async {
-  return 5;
-}
-''', [
-      StaticTypeWarningCode.RETURN_OF_INVALID_TYPE,
-      StaticTypeWarningCode.ILLEGAL_ASYNC_RETURN_TYPE
-    ]);
-  }
-
-  test_returnOfInvalidType_expressionFunctionBody_function() async {
-    await assertErrorsInCode(
-        "int f() => '0';", [StaticTypeWarningCode.RETURN_OF_INVALID_TYPE]);
-  }
-
-  test_returnOfInvalidType_expressionFunctionBody_getter() async {
-    await assertErrorsInCode(
-        "int get g => '0';", [StaticTypeWarningCode.RETURN_OF_INVALID_TYPE]);
-  }
-
-  test_returnOfInvalidType_expressionFunctionBody_localFunction() async {
-    await assertErrorsInCode(r'''
-class A {
-  String m() {
-    int f() => '0';
-    return '0';
-  }
-}''', [StaticTypeWarningCode.RETURN_OF_INVALID_TYPE]);
-  }
-
-  test_returnOfInvalidType_expressionFunctionBody_method() async {
-    await assertErrorsInCode(r'''
-class A {
-  int f() => '0';
-}''', [StaticTypeWarningCode.RETURN_OF_INVALID_TYPE]);
-  }
-
-  test_returnOfInvalidType_function() async {
-    await assertErrorsInCode("int f() { return '0'; }",
-        [StaticTypeWarningCode.RETURN_OF_INVALID_TYPE]);
-  }
-
-  test_returnOfInvalidType_getter() async {
-    await assertErrorsInCode("int get g { return '0'; }",
-        [StaticTypeWarningCode.RETURN_OF_INVALID_TYPE]);
-  }
-
-  test_returnOfInvalidType_localFunction() async {
-    await assertErrorsInCode(r'''
-class A {
-  String m() {
-    int f() { return '0'; }
-    return '0';
-  }
-}''', [StaticTypeWarningCode.RETURN_OF_INVALID_TYPE]);
-  }
-
-  test_returnOfInvalidType_method() async {
-    await assertErrorsInCode(r'''
-class A {
-  int f() { return '0'; }
-}''', [StaticTypeWarningCode.RETURN_OF_INVALID_TYPE]);
-  }
-
-  test_returnOfInvalidType_not_issued_for_expressionFunctionBody_void() async {
-    await assertNoErrorsInCode("void f() => 42;");
-  }
-
-  test_returnOfInvalidType_not_issued_for_valid_generic_return() async {
-    await assertNoErrorsInCode(r'''
-abstract class F<T, U>  {
-  U get value;
-}
-
-abstract class G<T> {
-  T test(F<int, T> arg) => arg.value;
-}
-
-abstract class H<S> {
-  S test(F<int, S> arg) => arg.value;
-}
-
-void main() { }''');
-  }
-
-  test_returnOfInvalidType_void() async {
-    await assertErrorsInCode("void f() { return 42; }",
-        [StaticTypeWarningCode.RETURN_OF_INVALID_TYPE]);
-  }
-
-  test_typeArgumentNotMatchingBounds_classTypeAlias() async {
-    await assertErrorsInCode(r'''
-class A {}
-class B {}
-class C {}
-class G<E extends A> {}
-class D = G<B> with C;
-''', [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
-  }
-
-  test_typeArgumentNotMatchingBounds_extends() async {
-    await assertErrorsInCode(r'''
-class A {}
-class B {}
-class G<E extends A> {}
-class C extends G<B>{}
-''', [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
-  }
-
-  test_typeArgumentNotMatchingBounds_extends_regressionInIssue18468Fix() async {
-    // https://code.google.com/p/dart/issues/detail?id=18628
-    await assertErrorsInCode(r'''
-class X<T extends Type> {}
-class Y<U> extends X<U> {}
-''', [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
-  }
-
-  test_typeArgumentNotMatchingBounds_fieldFormalParameter() async {
-    await assertErrorsInCode(r'''
-class A {}
-class B {}
-class G<E extends A> {}
-class C {
-  var f;
-  C(G<B> this.f) {}
-}''', [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
-  }
-
-  test_typeArgumentNotMatchingBounds_functionReturnType() async {
-    await assertErrorsInCode(r'''
-class A {}
-class B {}
-class G<E extends A> {}
-G<B> f() { return null; }
-''', [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
-  }
-
-  test_typeArgumentNotMatchingBounds_functionTypeAlias() async {
-    await assertErrorsInCode(r'''
-class A {}
-class B {}
-class G<E extends A> {}
-typedef G<B> f();
-''', [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
-  }
-
-  test_typeArgumentNotMatchingBounds_functionTypedFormalParameter() async {
-    await assertErrorsInCode(r'''
-class A {}
-class B {}
-class G<E extends A> {}
-f(G<B> h()) {}
-''', [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
-  }
-
-  test_typeArgumentNotMatchingBounds_implements() async {
-    await assertErrorsInCode(r'''
-class A {}
-class B {}
-class G<E extends A> {}
-class C implements G<B>{}
-''', [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
-  }
-
-  test_typeArgumentNotMatchingBounds_is() async {
-    await assertErrorsInCode(r'''
-class A {}
-class B {}
-class G<E extends A> {}
-var b = 1 is G<B>;
-''', [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
-  }
-
-  test_typeArgumentNotMatchingBounds_methodInvocation_localFunction() async {
-    await assertErrorsInCode(r'''
-class Point<T extends num> {
-  Point(T x, T y);
-}
-
-main() {
-  Point<T> f<T extends num>(T x, T y) {
-    return new Point<T>(x, y);
-  }
-  print(f<String>('hello', 'world'));
-}
-''', [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
-  }
-
-  test_typeArgumentNotMatchingBounds_methodInvocation_method() async {
-    await assertErrorsInCode(r'''
-class Point<T extends num> {
-  Point(T x, T y);
-}
-
-class PointFactory {
-  Point<T> point<T extends num>(T x, T y) {
-    return new Point<T>(x, y);
-  }
-}
-
-f(PointFactory factory) {
-  print(factory.point<String>('hello', 'world'));
-}
-''', [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
-  }
-
-  test_typeArgumentNotMatchingBounds_methodInvocation_topLevelFunction() async {
-    await assertErrorsInCode(r'''
-class Point<T extends num> {
-  Point(T x, T y);
-}
-
-Point<T> f<T extends num>(T x, T y) {
-  return new Point<T>(x, y);
-}
-
-main() {
-  print(f<String>('hello', 'world'));
-}
-''', [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
-  }
-
-  test_typeArgumentNotMatchingBounds_methodReturnType() async {
-    await assertErrorsInCode(r'''
-class A {}
-class B {}
-class G<E extends A> {}
-class C {
-  G<B> m() { return null; }
-}''', [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
-  }
-
-  test_typeArgumentNotMatchingBounds_new() async {
-    await assertErrorsInCode(r'''
-class A {}
-class B {}
-class G<E extends A> {}
-f() { return new G<B>(); }
-''', [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
-  }
-
-  test_typeArgumentNotMatchingBounds_new_superTypeOfUpperBound() async {
-    await assertErrorsInCode(r'''
-class A {}
-class B extends A {}
-class C extends B {}
-class G<E extends B> {}
-f() { return new G<A>(); }
-''', [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
-  }
-
-  test_typeArgumentNotMatchingBounds_ofFunctionTypeAlias() async {
-    await assertErrorsInCode(r'''
-class A {}
-class B {}
-typedef F<T extends A>();
-F<B> fff;
-''', [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
-  }
-
-  test_typeArgumentNotMatchingBounds_parameter() async {
-    await assertErrorsInCode(r'''
-class A {}
-class B {}
-class G<E extends A> {}
-f(G<B> g) {}
-''', [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
-  }
-
-  test_typeArgumentNotMatchingBounds_redirectingConstructor() async {
-    await assertErrorsInCode(r'''
-class A {}
-class B {}
-class X<T extends A> {
-  X(int x, int y) {}
-  factory X.name(int x, int y) = X<B>;
-}''', [
-      StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS,
-      StaticWarningCode.REDIRECT_TO_INVALID_RETURN_TYPE
-    ]);
-  }
-
-  test_typeArgumentNotMatchingBounds_typeArgumentList() async {
-    await assertErrorsInCode(r'''
-class A {}
-class B {}
-class C<E> {}
-class D<E extends A> {}
-C<D<B>> Var;
-''', [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
-  }
-
-  test_typeArgumentNotMatchingBounds_typeParameter() async {
-    await assertErrorsInCode(r'''
-class A {}
-class B {}
-class C {}
-class G<E extends A> {}
-class D<F extends G<B>> {}
-''', [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
-  }
-
-  test_typeArgumentNotMatchingBounds_variableDeclaration() async {
-    await assertErrorsInCode(r'''
-class A {}
-class B {}
-class G<E extends A> {}
-G<B> g;
-''', [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
-  }
-
-  test_typeArgumentNotMatchingBounds_with() async {
-    await assertErrorsInCode(r'''
-class A {}
-class B {}
-class G<E extends A> {}
-class C extends Object with G<B>{}
-''', [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]);
-  }
-
-  test_typeParameterSupertypeOfItsBound() async {
-    await assertErrorsInCode(r'''
-class A<T extends T> {
-}
-''', [StaticTypeWarningCode.TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND]);
-  }
-
-  test_typePromotion_booleanAnd_useInRight_accessedInClosureRight_mutated() async {
-    await assertErrorsInUnverifiedCode(r'''
-callMe(f()) { f(); }
-main(Object p) {
-  (p is String) && callMe(() { p.length; });
-  p = 0;
-}''', [StaticTypeWarningCode.UNDEFINED_GETTER]);
-  }
-
-  test_typePromotion_booleanAnd_useInRight_mutatedInLeft() async {
-    await assertErrorsInUnverifiedCode(r'''
-main(Object p) {
-  ((p is String) && ((p = 42) == 42)) && p.length != 0;
-}''', [StaticTypeWarningCode.UNDEFINED_GETTER]);
-  }
-
-  test_typePromotion_booleanAnd_useInRight_mutatedInRight() async {
-    await assertErrorsInUnverifiedCode(r'''
-main(Object p) {
-  (p is String) && (((p = 42) == 42) && p.length != 0);
-}''', [StaticTypeWarningCode.UNDEFINED_GETTER]);
-  }
-
-  test_typePromotion_conditional_useInThen_accessedInClosure_hasAssignment_after() async {
-    await assertErrorsInUnverifiedCode(r'''
-callMe(f()) { f(); }
-main(Object p) {
-  p is String ? callMe(() { p.length; }) : 0;
-  p = 42;
-}''', [StaticTypeWarningCode.UNDEFINED_GETTER]);
-  }
-
-  test_typePromotion_conditional_useInThen_accessedInClosure_hasAssignment_before() async {
-    await assertErrorsInUnverifiedCode(r'''
-callMe(f()) { f(); }
-main(Object p) {
-  p = 42;
-  p is String ? callMe(() { p.length; }) : 0;
-}''', [StaticTypeWarningCode.UNDEFINED_GETTER]);
-  }
-
-  test_typePromotion_conditional_useInThen_hasAssignment() async {
-    await assertErrorsInUnverifiedCode(r'''
-main(Object p) {
-  p is String ? (p.length + (p = 42)) : 0;
-}''', [StaticTypeWarningCode.UNDEFINED_GETTER]);
-  }
-
-  test_typePromotion_if_accessedInClosure_hasAssignment() async {
-    await assertErrorsInUnverifiedCode(r'''
-callMe(f()) { f(); }
-main(Object p) {
-  if (p is String) {
-    callMe(() {
-      p.length;
-    });
-  }
-  p = 0;
-}''', [StaticTypeWarningCode.UNDEFINED_GETTER]);
-  }
-
-  test_typePromotion_if_and_right_hasAssignment() async {
-    await assertErrorsInUnverifiedCode(r'''
-main(Object p) {
-  if (p is String && (p = null) == null) {
-    p.length;
-  }
-}''', [StaticTypeWarningCode.UNDEFINED_GETTER]);
-  }
-
-  test_typePromotion_if_extends_notMoreSpecific_dynamic() async {
-    await assertErrorsInUnverifiedCode(r'''
-class V {}
-class A<T> {}
-class B<S> extends A<S> {
-  var b;
-}
-
-main(A<V> p) {
-  if (p is B) {
-    p.b;
-  }
-}''', [StaticTypeWarningCode.UNDEFINED_GETTER]);
-  }
-
-  test_typePromotion_if_extends_notMoreSpecific_notMoreSpecificTypeArg() async {
-    await assertErrorsInUnverifiedCode(r'''
-class V {}
-class A<T> {}
-class B<S> extends A<S> {
-  var b;
-}
-
-main(A<V> p) {
-  if (p is B<int>) {
-    p.b;
-  }
-}''', [StaticTypeWarningCode.UNDEFINED_GETTER]);
-  }
-
-  test_typePromotion_if_hasAssignment_after() async {
-    await assertErrorsInUnverifiedCode(r'''
-main(Object p) {
-  if (p is String) {
-    p.length;
-    p = 0;
-  }
-}''', [StaticTypeWarningCode.UNDEFINED_GETTER]);
-  }
-
-  test_typePromotion_if_hasAssignment_before() async {
-    await assertErrorsInUnverifiedCode(r'''
-main(Object p) {
-  if (p is String) {
-    p = 0;
-    p.length;
-  }
-}''', [StaticTypeWarningCode.UNDEFINED_GETTER]);
-  }
-
-  test_typePromotion_if_hasAssignment_inClosure_anonymous_after() async {
-    await assertErrorsInUnverifiedCode(r'''
-main(Object p) {
-  if (p is String) {
-    p.length;
-  }
-  () {p = 0;};
-}''', [StaticTypeWarningCode.UNDEFINED_GETTER]);
-  }
-
-  test_typePromotion_if_hasAssignment_inClosure_anonymous_before() async {
-    await assertErrorsInUnverifiedCode(r'''
-main(Object p) {
-  () {p = 0;};
-  if (p is String) {
-    p.length;
-  }
-}''', [StaticTypeWarningCode.UNDEFINED_GETTER]);
-  }
-
-  test_typePromotion_if_hasAssignment_inClosure_function_after() async {
-    await assertErrorsInUnverifiedCode(r'''
-main(Object p) {
-  if (p is String) {
-    p.length;
-  }
-  f() {p = 0;};
-}''', [StaticTypeWarningCode.UNDEFINED_GETTER]);
-  }
-
-  test_typePromotion_if_hasAssignment_inClosure_function_before() async {
-    await assertErrorsInUnverifiedCode(r'''
-main(Object p) {
-  f() {p = 0;};
-  if (p is String) {
-    p.length;
-  }
-}''', [StaticTypeWarningCode.UNDEFINED_GETTER]);
-  }
-
-  test_typePromotion_if_implements_notMoreSpecific_dynamic() async {
-    await assertErrorsInUnverifiedCode(r'''
-class V {}
-class A<T> {}
-class B<S> implements A<S> {
-  var b;
-}
-
-main(A<V> p) {
-  if (p is B) {
-    p.b;
-  }
-}''', [StaticTypeWarningCode.UNDEFINED_GETTER]);
-  }
-
-  test_typePromotion_if_with_notMoreSpecific_dynamic() async {
-    await assertErrorsInUnverifiedCode(r'''
-class V {}
-class A<T> {}
-class B<S> extends Object with A<S> {
-  var b;
-}
-
-main(A<V> p) {
-  if (p is B) {
-    p.b;
-  }
-}''', [StaticTypeWarningCode.UNDEFINED_GETTER]);
-  }
-
-  test_undefinedGetter() async {
-    await assertErrorsInUnverifiedCode(r'''
-class T {}
-f(T e) { return e.m; }''', [StaticTypeWarningCode.UNDEFINED_GETTER]);
-  }
-
-  test_undefinedGetter_generic_function_call() async {
-    // Referencing `.call` on a `Function` type works similarly to referencing
-    // it on `dynamic`--the reference is accepted at compile time, and all type
-    // checking is deferred until runtime.
-    await assertErrorsInUnverifiedCode('''
-f(Function f) {
-  return f.call;
-}
-''', []);
-  }
-
-  test_undefinedGetter_object_call() async {
-    await assertErrorsInUnverifiedCode('''
-f(Object o) {
-  return o.call;
-}
-''', [StaticTypeWarningCode.UNDEFINED_GETTER]);
-  }
-
-  test_undefinedGetter_proxy_annotation_fakeProxy() async {
-    await assertErrorsInCode(r'''
-library L;
-class Fake {
-  const Fake();
-}
-const proxy = const Fake();
-@proxy class PrefixProxy {}
-main() {
-  new PrefixProxy().foo;
-}''', [StaticTypeWarningCode.UNDEFINED_GETTER]);
-  }
-
-  test_undefinedGetter_static() async {
-    await assertErrorsInUnverifiedCode(r'''
-class A {}
-var a = A.B;''', [StaticTypeWarningCode.UNDEFINED_GETTER]);
-  }
-
-  test_undefinedGetter_typeLiteral_cascadeTarget() async {
-    await assertErrorsInCode(r'''
-class T {
-  static int get foo => 42;
-}
-main() {
-  T..foo;
-}''', [StaticTypeWarningCode.UNDEFINED_GETTER]);
-  }
-
-  test_undefinedGetter_typeLiteral_conditionalAccess() async {
-    // When applied to a type literal, the conditional access operator '?.'
-    // cannot be used to access instance getters of Type.
-    // TODO(brianwilkerson) We cannot verify because hashCode isn't resolved.
-    await assertErrorsInCode('''
-class A {}
-f() => A?.hashCode;
-''', [StaticTypeWarningCode.UNDEFINED_GETTER], verify: false);
-  }
-
-  test_undefinedGetter_wrongNumberOfTypeArguments_tooLittle() async {
-    await assertErrorsInCode(r'''
-class A<K, V> {
-  K element;
-}
-main(A<int> a) {
-  a.element.anyGetterExistsInDynamic;
-}''', [StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS]);
-  }
-
-  test_undefinedGetter_wrongNumberOfTypeArguments_tooMany() async {
-    await assertErrorsInCode(r'''
-class A<E> {
-  E element;
-}
-main(A<int,int> a) {
-  a.element.anyGetterExistsInDynamic;
-}''', [StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS]);
-  }
-
-  test_undefinedGetter_wrongOfTypeArgument() async {
-    await assertErrorsInCode(r'''
-class A<E> {
-  E element;
-}
-main(A<NoSuchType> a) {
-  a.element.anyGetterExistsInDynamic;
-}''', [StaticTypeWarningCode.NON_TYPE_AS_TYPE_ARGUMENT]);
-  }
-
-  test_undefinedMethod_assignmentExpression() async {
-    await assertErrorsInCode(r'''
-class A {}
-class B {
-  f(A a) {
-    A a2 = new A();
-    a += a2;
-  }
-}''', [StaticTypeWarningCode.UNDEFINED_METHOD]);
-  }
-
-  test_undefinedMethod_ignoreTypePropagation() async {
-    await assertErrorsInCode(r'''
-class A {}
-class B extends A {
-  m() {}
-}
-class C {
-  f() {
-    A a = new B();
-    a.m();
-  }
-}''', [StaticTypeWarningCode.UNDEFINED_METHOD]);
-  }
-
-  test_undefinedMethod_leastUpperBoundWithNull() async {
-    await assertErrorsInCode('f(bool b, int i) => (b ? null : i).foo();',
-        [StaticTypeWarningCode.UNDEFINED_METHOD]);
-  }
-
-  test_undefinedMethod_ofNull() async {
-    // TODO(scheglov) Track https://github.com/dart-lang/sdk/issues/28430 to
-    // decide whether a warning should be reported here.
-    await assertErrorsInCode(r'''
-Null f(int x) => null;
-main() {
-  f(42).abs();
-}
-''', [StaticTypeWarningCode.UNDEFINED_METHOD]);
-  }
-
-  test_undefinedMethodWithConstructor() async {
-    // TODO(brianwilkerson) We cannot verify because 'C' could not be resolved.
-    await assertErrorsInCode(r'''
-class C {
-  C.m();
-}
-f() {
-  C c = C.m();
-}''', [], verify: false);
-  }
-
-  test_undefinedOperator_indexBoth() async {
-    await assertErrorsInUnverifiedCode(r'''
-class A {}
-f(A a) {
-  a[0]++;
-}''', [
-      StaticTypeWarningCode.UNDEFINED_OPERATOR,
-      StaticTypeWarningCode.UNDEFINED_OPERATOR,
-    ]);
-  }
-
-  test_undefinedOperator_indexGetter() async {
-    await assertErrorsInUnverifiedCode(r'''
-class A {}
-f(A a) {
-  a[0];
-}''', [StaticTypeWarningCode.UNDEFINED_OPERATOR]);
-  }
-
-  test_undefinedOperator_indexSetter() async {
-    await assertErrorsInUnverifiedCode(r'''
-class A {}
-f(A a) {
-  a[0] = 1;
-}''', [StaticTypeWarningCode.UNDEFINED_OPERATOR]);
-  }
-
-  test_undefinedOperator_plus() async {
-    await assertErrorsInUnverifiedCode(r'''
-class A {}
-f(A a) {
-  a + 1;
-}''', [StaticTypeWarningCode.UNDEFINED_OPERATOR]);
-  }
-
-  test_undefinedOperator_postfixExpression() async {
-    await assertErrorsInCode(r'''
-class A {}
-f(A a) {
-  a++;
-}''', [StaticTypeWarningCode.UNDEFINED_OPERATOR]);
-  }
-
-  test_undefinedOperator_prefixExpression() async {
-    await assertErrorsInCode(r'''
-class A {}
-f(A a) {
-  ++a;
-}''', [StaticTypeWarningCode.UNDEFINED_OPERATOR]);
-  }
-
-  test_undefinedSetter() async {
-    await assertErrorsInUnverifiedCode(r'''
-class T {}
-f(T e1) { e1.m = 0; }''', [StaticTypeWarningCode.UNDEFINED_SETTER]);
-  }
-
-  test_undefinedSetter_static() async {
-    await assertErrorsInUnverifiedCode(r'''
-class A {}
-f() { A.B = 0;}''', [StaticTypeWarningCode.UNDEFINED_SETTER]);
-  }
-
-  test_undefinedSetter_typeLiteral_cascadeTarget() async {
-    await assertErrorsInCode(r'''
-class T {
-  static void set foo(_) {}
-}
-main() {
-  T..foo = 42;
-}''', [StaticTypeWarningCode.UNDEFINED_SETTER]);
-  }
-
-  test_unqualifiedReferenceToNonLocalStaticMember_getter() async {
-    await assertErrorsInCode(r'''
-class A {
-  static int get a => 0;
-}
-class B extends A {
-  int b() {
-    return a;
-  }
-}''', [StaticTypeWarningCode.UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER]);
-  }
-
-  test_unqualifiedReferenceToNonLocalStaticMember_getter_invokeTarget() async {
-    await assertErrorsInCode(r'''
-class A {
-  static int foo;
-}
-
-class B extends A {
-  static bar() {
-    foo.abs();
-  }
-}
-''', [StaticTypeWarningCode.UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER]);
-  }
-
-  test_unqualifiedReferenceToNonLocalStaticMember_setter() async {
-    await assertErrorsInCode(r'''
-class A {
-  static set a(x) {}
-}
-class B extends A {
-  b(y) {
-    a = y;
-  }
-}''', [StaticTypeWarningCode.UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER]);
-  }
-
-  test_wrongNumberOfTypeArguments_class_tooFew() async {
-    await assertErrorsInCode(r'''
-class A<E, F> {}
-A<A> a = null;''', [StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS]);
-  }
-
-  test_wrongNumberOfTypeArguments_class_tooMany() async {
-    await assertErrorsInCode(r'''
-class A<E> {}
-A<A, A> a = null;''', [StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS]);
-  }
-
-  test_wrongNumberOfTypeArguments_classAlias() async {
-    await assertErrorsInCode(r'''
-class A {}
-class M {}
-class B<F extends num> = A<F> with M;''',
-        [StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS]);
-  }
-
-  test_wrongNumberOfTypeArguments_dynamic() async {
-    await assertErrorsInCode(r'''
-dynamic<int> v;
-''', [StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS]);
-  }
-
-  test_wrongNumberOfTypeArguments_typeParameter() async {
-    await assertErrorsInCode(r'''
-class C<T> {
-  T<int> f;
-}
-''', [StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS]);
-  }
-
-  test_wrongNumberOfTypeArguments_typeTest_tooFew() async {
-    await assertErrorsInCode(r'''
-class A {}
-class C<K, V> {}
-f(p) {
-  return p is C<A>;
-}''', [StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS]);
-  }
-
-  test_wrongNumberOfTypeArguments_typeTest_tooMany() async {
-    await assertErrorsInCode(r'''
-class A {}
-class C<E> {}
-f(p) {
-  return p is C<A, A>;
-}''', [StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS]);
-  }
-
-  test_yield_async_to_basic_type() async {
-    await assertErrorsInCode('''
-int f() async* {
-  yield 3;
-}
-''', [
-      StaticTypeWarningCode.YIELD_OF_INVALID_TYPE,
-      StaticTypeWarningCode.ILLEGAL_ASYNC_GENERATOR_RETURN_TYPE
-    ]);
-  }
-
-  test_yield_async_to_iterable() async {
-    await assertErrorsInCode('''
-Iterable<int> f() async* {
-  yield 3;
-}
-''', [
-      StaticTypeWarningCode.YIELD_OF_INVALID_TYPE,
-      StaticTypeWarningCode.ILLEGAL_ASYNC_GENERATOR_RETURN_TYPE
-    ]);
-  }
-
-  test_yield_async_to_mistyped_stream() async {
-    await assertErrorsInCode('''
-import 'dart:async';
-Stream<int> f() async* {
-  yield "foo";
-}
-''', [StaticTypeWarningCode.YIELD_OF_INVALID_TYPE]);
-  }
-
-  test_yield_each_async_non_stream() async {
-    await assertErrorsInCode('''
-f() async* {
-  yield* 0;
-}
-''', [StaticTypeWarningCode.YIELD_OF_INVALID_TYPE]);
-  }
-
-  test_yield_each_async_to_mistyped_stream() async {
-    await assertErrorsInCode('''
-import 'dart:async';
-Stream<int> f() async* {
-  yield* g();
-}
-Stream<String> g() => null;
-''', [StaticTypeWarningCode.YIELD_OF_INVALID_TYPE]);
-  }
-
-  test_yield_each_sync_non_iterable() async {
-    await assertErrorsInCode('''
-f() sync* {
-  yield* 0;
-}
-''', [StaticTypeWarningCode.YIELD_OF_INVALID_TYPE]);
-  }
-
-  test_yield_each_sync_to_mistyped_iterable() async {
-    await assertErrorsInCode('''
-Iterable<int> f() sync* {
-  yield* g();
-}
-Iterable<String> g() => null;
-''', [StaticTypeWarningCode.YIELD_OF_INVALID_TYPE]);
-  }
-
-  test_yield_sync_to_basic_type() async {
-    await assertErrorsInCode('''
-int f() sync* {
-  yield 3;
-}
-''', [
-      StaticTypeWarningCode.YIELD_OF_INVALID_TYPE,
-      StaticTypeWarningCode.ILLEGAL_SYNC_GENERATOR_RETURN_TYPE
-    ]);
-  }
-
-  test_yield_sync_to_mistyped_iterable() async {
-    await assertErrorsInCode('''
-Iterable<int> f() sync* {
-  yield "foo";
-}
-''', [StaticTypeWarningCode.YIELD_OF_INVALID_TYPE]);
-  }
-
-  test_yield_sync_to_stream() async {
-    await assertErrorsInCode('''
-import 'dart:async';
-Stream<int> f() sync* {
-  yield 3;
-}
-''', [
-      StaticTypeWarningCode.YIELD_OF_INVALID_TYPE,
-      StaticTypeWarningCode.ILLEGAL_SYNC_GENERATOR_RETURN_TYPE
-    ]);
-  }
-}
-
-@reflectiveTest
-class StrongModeStaticTypeWarningCodeTest extends ResolverTestCase {
-  void setUp() {
-    super.setUp();
-    AnalysisOptionsImpl options = new AnalysisOptionsImpl();
-    resetWith(options: options);
-  }
-
-  test_legalAsyncGeneratorReturnType_function_supertypeOfStream() async {
-    await assertErrorsInCode('''
-import 'dart:async';
-f() async* { yield 42; }
-dynamic f2() async* { yield 42; }
-Object f3() async* { yield 42; }
-Stream f4() async* { yield 42; }
-Stream<dynamic> f5() async* { yield 42; }
-Stream<Object> f6() async* { yield 42; }
-Stream<num> f7() async* { yield 42; }
-Stream<int> f8() async* { yield 42; }
-''', []);
-  }
-
-  test_legalAsyncReturnType_function_supertypeOfFuture() async {
-    await assertErrorsInCode('''
-import 'dart:async';
-f() async { return 42; }
-dynamic f2() async { return 42; }
-Object f3() async { return 42; }
-Future f4() async { return 42; }
-Future<dynamic> f5() async { return 42; }
-Future<Object> f6() async { return 42; }
-Future<num> f7() async { return 42; }
-Future<int> f8() async { return 42; }
-''', []);
-  }
-
-  test_legalSyncGeneratorReturnType_function_supertypeOfIterable() async {
-    await assertErrorsInCode('''
-f() sync* { yield 42; }
-dynamic f2() sync* { yield 42; }
-Object f3() sync* { yield 42; }
-Iterable f4() sync* { yield 42; }
-Iterable<dynamic> f5() sync* { yield 42; }
-Iterable<Object> f6() sync* { yield 42; }
-Iterable<num> f7() sync* { yield 42; }
-Iterable<int> f8() sync* { yield 42; }
-''', []);
-  }
-}
diff --git a/pkg/analyzer/test/generated/static_warning_code_test.dart b/pkg/analyzer/test/generated/static_warning_code_test.dart
index f5b8968..cccdf34 100644
--- a/pkg/analyzer/test/generated/static_warning_code_test.dart
+++ b/pkg/analyzer/test/generated/static_warning_code_test.dart
@@ -15,7 +15,6 @@
 main() {
   defineReflectiveSuite(() {
     defineReflectiveTests(EqualValuesInConstSetTest);
-    defineReflectiveTests(StaticWarningCodeTest);
   });
 }
 
@@ -61,8 +60,7 @@
   }
 }
 
-@reflectiveTest
-class StaticWarningCodeTest extends ResolverTestCase {
+abstract class StaticWarningCodeTest extends ResolverTestCase {
   fail_argumentTypeNotAssignable_tearOff_required() async {
     Source source = addSource(r'''
 class C {
diff --git a/pkg/analyzer/test/generated/strong_mode.dart b/pkg/analyzer/test/generated/strong_mode.dart
new file mode 100644
index 0000000..01050fa
--- /dev/null
+++ b/pkg/analyzer/test/generated/strong_mode.dart
@@ -0,0 +1,4601 @@
+// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:async';
+
+import 'package:analyzer/dart/ast/ast.dart';
+import 'package:analyzer/dart/ast/standard_resolution_map.dart';
+import 'package:analyzer/dart/element/element.dart';
+import 'package:analyzer/dart/element/type.dart';
+import 'package:analyzer/src/dart/element/element.dart';
+import 'package:analyzer/src/error/codes.dart';
+import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/generated/source_io.dart';
+import 'package:analyzer/src/task/strong/ast_properties.dart';
+import 'package:front_end/src/base/errors.dart';
+import 'package:test/test.dart';
+
+import '../src/dart/resolution/find_node.dart';
+import '../utils.dart';
+import 'resolver_test_case.dart';
+
+/// Strong mode static analyzer local type inference tests
+abstract class StrongModeLocalInferenceTest extends ResolverTestCase {
+  TypeAssertions _assertions;
+
+  Asserter<DartType> _isDynamic;
+  Asserter<InterfaceType> _isFutureOfDynamic;
+  Asserter<InterfaceType> _isFutureOfInt;
+  Asserter<InterfaceType> _isFutureOfNull;
+  Asserter<InterfaceType> _isFutureOrOfInt;
+  Asserter<DartType> _isInt;
+  Asserter<DartType> _isNull;
+  Asserter<DartType> _isNum;
+  Asserter<DartType> _isObject;
+  Asserter<DartType> _isString;
+
+  AsserterBuilder2<Asserter<DartType>, Asserter<DartType>, DartType>
+      _isFunction2Of;
+  AsserterBuilder<List<Asserter<DartType>>, InterfaceType> _isFutureOf;
+  AsserterBuilder<List<Asserter<DartType>>, InterfaceType> _isFutureOrOf;
+  AsserterBuilderBuilder<Asserter<DartType>, List<Asserter<DartType>>, DartType>
+      _isInstantiationOf;
+  AsserterBuilder<Asserter<DartType>, InterfaceType> _isListOf;
+  AsserterBuilder2<Asserter<DartType>, Asserter<DartType>, InterfaceType>
+      _isMapOf;
+  AsserterBuilder<List<Asserter<DartType>>, InterfaceType> _isStreamOf;
+  AsserterBuilder<DartType, DartType> _isType;
+
+  AsserterBuilder<Element, DartType> _hasElement;
+  AsserterBuilder<DartType, DartType> _hasElementOf;
+
+  @override
+  Future<TestAnalysisResult> computeAnalysisResult(Source source) async {
+    TestAnalysisResult result = await super.computeAnalysisResult(source);
+    if (_assertions == null) {
+      _assertions = new TypeAssertions(typeProvider);
+      _isType = _assertions.isType;
+      _hasElement = _assertions.hasElement;
+      _isInstantiationOf = _assertions.isInstantiationOf;
+      _isInt = _assertions.isInt;
+      _isNull = _assertions.isNull;
+      _isNum = _assertions.isNum;
+      _isObject = _assertions.isObject;
+      _isString = _assertions.isString;
+      _isDynamic = _assertions.isDynamic;
+      _isListOf = _assertions.isListOf;
+      _isMapOf = _assertions.isMapOf;
+      _isFunction2Of = _assertions.isFunction2Of;
+      _hasElementOf = _assertions.hasElementOf;
+      _isFutureOf = _isInstantiationOf(_hasElementOf(typeProvider.futureType));
+      _isFutureOrOf =
+          _isInstantiationOf(_hasElementOf(typeProvider.futureOrType));
+      _isFutureOfDynamic = _isFutureOf([_isDynamic]);
+      _isFutureOfInt = _isFutureOf([_isInt]);
+      _isFutureOfNull = _isFutureOf([_isNull]);
+      _isFutureOrOfInt = _isFutureOrOf([_isInt]);
+      _isStreamOf = _isInstantiationOf(_hasElementOf(typeProvider.streamType));
+    }
+    return result;
+  }
+
+  @override
+  void setUp() {
+    super.setUp();
+    AnalysisOptionsImpl options = new AnalysisOptionsImpl();
+    resetWith(options: options);
+  }
+
+  test_async_method_propagation() async {
+    String code = r'''
+      import "dart:async";
+      class A {
+        Future f0() => new Future.value(3);
+        Future f1() async => new Future.value(3);
+        Future f2() async => await new Future.value(3);
+
+        Future<int> f3() => new Future.value(3);
+        Future<int> f4() async => new Future.value(3);
+        Future<int> f5() async => await new Future.value(3);
+
+        Future g0() { return new Future.value(3); }
+        Future g1() async { return new Future.value(3); }
+        Future g2() async { return await new Future.value(3); }
+
+        Future<int> g3() { return new Future.value(3); }
+        Future<int> g4() async { return new Future.value(3); }
+        Future<int> g5() async { return await new Future.value(3); }
+      }
+   ''';
+    CompilationUnit unit = await resolveSource(code);
+
+    void check(String name, Asserter<InterfaceType> typeTest) {
+      MethodDeclaration test = AstFinder.getMethodInClass(unit, "A", name);
+      FunctionBody body = test.body;
+      Expression returnExp;
+      if (body is ExpressionFunctionBody) {
+        returnExp = body.expression;
+      } else {
+        ReturnStatement stmt = (body as BlockFunctionBody).block.statements[0];
+        returnExp = stmt.expression;
+      }
+      DartType type = returnExp.staticType;
+      if (returnExp is AwaitExpression) {
+        type = returnExp.expression.staticType;
+      }
+      typeTest(type);
+    }
+
+    check("f0", _isFutureOfDynamic);
+    check("f1", _isFutureOfDynamic);
+    check("f2", _isFutureOfDynamic);
+
+    check("f3", _isFutureOfInt);
+    check("f4", _isFutureOfInt);
+    check("f5", _isFutureOfInt);
+
+    check("g0", _isFutureOfDynamic);
+    check("g1", _isFutureOfDynamic);
+    check("g2", _isFutureOfDynamic);
+
+    check("g3", _isFutureOfInt);
+    check("g4", _isFutureOfInt);
+    check("g5", _isFutureOfInt);
+  }
+
+  test_async_propagation() async {
+    String code = r'''
+      import "dart:async";
+
+      Future f0() => new Future.value(3);
+      Future f1() async => new Future.value(3);
+      Future f2() async => await new Future.value(3);
+
+      Future<int> f3() => new Future.value(3);
+      Future<int> f4() async => new Future.value(3);
+      Future<int> f5() async => await new Future.value(3);
+
+      Future g0() { return new Future.value(3); }
+      Future g1() async { return new Future.value(3); }
+      Future g2() async { return await new Future.value(3); }
+
+      Future<int> g3() { return new Future.value(3); }
+      Future<int> g4() async { return new Future.value(3); }
+      Future<int> g5() async { return await new Future.value(3); }
+   ''';
+    CompilationUnit unit = await resolveSource(code);
+
+    void check(String name, Asserter<InterfaceType> typeTest) {
+      FunctionDeclaration test = AstFinder.getTopLevelFunction(unit, name);
+      FunctionBody body = test.functionExpression.body;
+      Expression returnExp;
+      if (body is ExpressionFunctionBody) {
+        returnExp = body.expression;
+      } else {
+        ReturnStatement stmt = (body as BlockFunctionBody).block.statements[0];
+        returnExp = stmt.expression;
+      }
+      DartType type = returnExp.staticType;
+      if (returnExp is AwaitExpression) {
+        type = returnExp.expression.staticType;
+      }
+      typeTest(type);
+    }
+
+    check("f0", _isFutureOfDynamic);
+    check("f1", _isFutureOfDynamic);
+    check("f2", _isFutureOfDynamic);
+
+    check("f3", _isFutureOfInt);
+    check("f4", _isFutureOfInt);
+    check("f5", _isFutureOfInt);
+
+    check("g0", _isFutureOfDynamic);
+    check("g1", _isFutureOfDynamic);
+    check("g2", _isFutureOfDynamic);
+
+    check("g3", _isFutureOfInt);
+    check("g4", _isFutureOfInt);
+    check("g5", _isFutureOfInt);
+  }
+
+  test_async_star_method_propagation() async {
+    String code = r'''
+      import "dart:async";
+      class A {
+        Stream g0() async* { yield []; }
+        Stream g1() async* { yield* new Stream(); }
+
+        Stream<List<int>> g2() async* { yield []; }
+        Stream<List<int>> g3() async* { yield* new Stream(); }
+      }
+    ''';
+    CompilationUnit unit = await resolveSource(code);
+
+    void check(String name, Asserter<InterfaceType> typeTest) {
+      MethodDeclaration test = AstFinder.getMethodInClass(unit, "A", name);
+      BlockFunctionBody body = test.body;
+      YieldStatement stmt = body.block.statements[0];
+      Expression exp = stmt.expression;
+      typeTest(exp.staticType);
+    }
+
+    check("g0", _isListOf(_isDynamic));
+    check("g1", _isStreamOf([_isDynamic]));
+
+    check("g2", _isListOf(_isInt));
+    check("g3", _isStreamOf([(DartType type) => _isListOf(_isInt)(type)]));
+  }
+
+  test_async_star_propagation() async {
+    String code = r'''
+      import "dart:async";
+
+      Stream g0() async* { yield []; }
+      Stream g1() async* { yield* new Stream(); }
+
+      Stream<List<int>> g2() async* { yield []; }
+      Stream<List<int>> g3() async* { yield* new Stream(); }
+   ''';
+    CompilationUnit unit = await resolveSource(code);
+
+    void check(String name, Asserter<InterfaceType> typeTest) {
+      FunctionDeclaration test = AstFinder.getTopLevelFunction(unit, name);
+      BlockFunctionBody body = test.functionExpression.body;
+      YieldStatement stmt = body.block.statements[0];
+      Expression exp = stmt.expression;
+      typeTest(exp.staticType);
+    }
+
+    check("g0", _isListOf(_isDynamic));
+    check("g1", _isStreamOf([_isDynamic]));
+
+    check("g2", _isListOf(_isInt));
+    check("g3", _isStreamOf([(DartType type) => _isListOf(_isInt)(type)]));
+  }
+
+  test_cascadeExpression() async {
+    String code = r'''
+      class A<T> {
+        List<T> map(T a, List<T> mapper(T x)) => mapper(a);
+      }
+
+      void main () {
+        A<int> a = new A()..map(0, (x) => [x]);
+     }
+   ''';
+    CompilationUnit unit = await resolveSource(code);
+    List<Statement> statements =
+        AstFinder.getStatementsInTopLevelFunction(unit, "main");
+    CascadeExpression fetch(int i) {
+      VariableDeclarationStatement stmt = statements[i];
+      VariableDeclaration decl = stmt.variables.variables[0];
+      CascadeExpression exp = decl.initializer;
+      return exp;
+    }
+
+    Element elementA = AstFinder.getClass(unit, "A").declaredElement;
+
+    CascadeExpression cascade = fetch(0);
+    _isInstantiationOf(_hasElement(elementA))([_isInt])(cascade.staticType);
+    MethodInvocation invoke = cascade.cascadeSections[0];
+    FunctionExpression function = invoke.argumentList.arguments[1];
+    ExecutableElement f0 = function.declaredElement;
+    _isListOf(_isInt)(f0.type.returnType);
+    expect(f0.type.normalParameterTypes[0], typeProvider.intType);
+  }
+
+  test_constrainedByBounds1() async {
+    // Test that upwards inference with two type variables correctly
+    // propogates from the constrained variable to the unconstrained
+    // variable if they are ordered left to right.
+    String code = r'''
+    T f<S, T extends S>(S x) => null;
+    void test() { var x = f(3); }
+   ''';
+    Source source = addSource(code);
+    TestAnalysisResult analysisResult = await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+    CompilationUnit unit = analysisResult.unit;
+    List<Statement> statements =
+        AstFinder.getStatementsInTopLevelFunction(unit, "test");
+    VariableDeclarationStatement stmt = statements[0];
+    VariableDeclaration decl = stmt.variables.variables[0];
+    Expression call = decl.initializer;
+    _isInt(call.staticType);
+  }
+
+  test_constrainedByBounds2() async {
+    // Test that upwards inference with two type variables does
+    // propogate from the constrained variable to the unconstrained
+    // variable if they are ordered right to left.
+    String code = r'''
+    T f<T extends S, S>(S x) => null;
+    void test() { var x = f(3); }
+   ''';
+    Source source = addSource(code);
+    TestAnalysisResult analysisResult = await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+    CompilationUnit unit = analysisResult.unit;
+    List<Statement> statements =
+        AstFinder.getStatementsInTopLevelFunction(unit, "test");
+    VariableDeclarationStatement stmt = statements[0];
+    VariableDeclaration decl = stmt.variables.variables[0];
+    Expression call = decl.initializer;
+    _isInt(call.staticType);
+  }
+
+  test_constrainedByBounds3() async {
+    Source source = addSource(r'''
+      T f<T extends S, S extends int>(S x) => null;
+      void test() { var x = f(3); }
+   ''');
+    TestAnalysisResult analysisResult = await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+    CompilationUnit unit = analysisResult.unit;
+    List<Statement> statements =
+        AstFinder.getStatementsInTopLevelFunction(unit, "test");
+    VariableDeclarationStatement stmt = statements[0];
+    VariableDeclaration decl = stmt.variables.variables[0];
+    Expression call = decl.initializer;
+    _isInt(call.staticType);
+  }
+
+  test_constrainedByBounds4() async {
+    // Test that upwards inference with two type variables correctly
+    // propogates from the constrained variable to the unconstrained
+    // variable if they are ordered left to right, when the variable
+    // appears co and contra variantly
+    String code = r'''
+    typedef To Func1<From, To>(From x);
+    T f<S, T extends Func1<S, S>>(S x) => null;
+    void test() { var x = f(3)(4); }
+   ''';
+    Source source = addSource(code);
+    TestAnalysisResult analysisResult = await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+    CompilationUnit unit = analysisResult.unit;
+    List<Statement> statements =
+        AstFinder.getStatementsInTopLevelFunction(unit, "test");
+    VariableDeclarationStatement stmt = statements[0];
+    VariableDeclaration decl = stmt.variables.variables[0];
+    Expression call = decl.initializer;
+    _isInt(call.staticType);
+  }
+
+  test_constrainedByBounds5() async {
+    // Test that upwards inference with two type variables does not
+    // propogate from the constrained variable to the unconstrained
+    // variable if they are ordered right to left, when the variable
+    // appears co and contra variantly, and that an error is issued
+    // for the non-matching bound.
+    String code = r'''
+    typedef To Func1<From, To>(From x);
+    T f<T extends Func1<S, S>, S>(S x) => null;
+    void test() { var x = f(3)(null); }
+   ''';
+    Source source = addSource(code);
+    TestAnalysisResult analysisResult = await computeAnalysisResult(source);
+    assertErrors(source, [StrongModeCode.COULD_NOT_INFER]);
+    verify([source]);
+    CompilationUnit unit = analysisResult.unit;
+    List<Statement> statements =
+        AstFinder.getStatementsInTopLevelFunction(unit, "test");
+    VariableDeclarationStatement stmt = statements[0];
+    VariableDeclaration decl = stmt.variables.variables[0];
+    Expression call = decl.initializer;
+    _isDynamic(call.staticType);
+  }
+
+  test_constructorInitializer_propagation() async {
+    String code = r'''
+      class A {
+        List<String> x;
+        A() : this.x = [];
+      }
+   ''';
+    CompilationUnit unit = await resolveSource(code);
+    ConstructorDeclaration constructor =
+        AstFinder.getConstructorInClass(unit, "A", null);
+    ConstructorFieldInitializer assignment = constructor.initializers[0];
+    Expression exp = assignment.expression;
+    _isListOf(_isString)(exp.staticType);
+  }
+
+  test_covarianceChecks() async {
+    var source = addSource(r'''
+class C<T> {
+  add(T t) {}
+  forEach(void f(T t)) {}
+}
+class D extends C<int> {
+  add(int t) {}
+  forEach(void f(int t)) {}
+}
+class E extends C<int> {
+  add(Object t) {}
+  forEach(void f(Null t)) {}
+}
+''');
+    var unit = (await computeAnalysisResult(source)).unit;
+    assertNoErrors(source);
+    var cAdd = AstFinder.getMethodInClass(unit, "C", "add");
+    var covariantC = getClassCovariantParameters(AstFinder.getClass(unit, "C"));
+    expect(covariantC.toList(), [cAdd.declaredElement.parameters[0]]);
+
+    var dAdd = AstFinder.getMethodInClass(unit, "D", "add");
+    var covariantD = getClassCovariantParameters(AstFinder.getClass(unit, "D"));
+    expect(covariantD.toList(), [dAdd.declaredElement.parameters[0]]);
+
+    var covariantE = getClassCovariantParameters(AstFinder.getClass(unit, "E"));
+    expect(covariantE.toList(), []);
+  }
+
+  test_covarianceChecks2() async {
+    var content = r'''
+class View<T1> {
+  View<T1> create() => this;
+}
+
+class Bar<T2> extends View<Bar<T2>> {}
+
+main() {
+  var b = new Bar<int>();
+  b.create();
+}
+''';
+    var source = addSource(content);
+    var unit = (await computeAnalysisResult(source)).unit;
+    assertNoErrors(source);
+
+    var findNode = FindNode(content, unit);
+    expect(getImplicitCast(findNode.methodInvocation('b.create')), isNull);
+  }
+
+  test_covarianceChecks_genericMethods() async {
+    var source = addSource(r'''
+class C<T> {
+  add<S>(T t) {}
+  forEach<S>(S f(T t)) {}
+}
+class D extends C<int> {
+  add<S>(int t) {}
+  forEach<S>(S f(int t)) {}
+}
+class E extends C<int> {
+  add<S>(Object t) {}
+  forEach<S>(S f(Null t)) {}
+}
+''');
+    var unit = (await computeAnalysisResult(source)).unit;
+    assertNoErrors(source);
+
+    var cAdd = AstFinder.getMethodInClass(unit, "C", "add");
+    var covariantC = getClassCovariantParameters(AstFinder.getClass(unit, "C"));
+    expect(covariantC.toList(), [cAdd.declaredElement.parameters[0]]);
+
+    var dAdd = AstFinder.getMethodInClass(unit, "D", "add");
+    var covariantD = getClassCovariantParameters(AstFinder.getClass(unit, "D"));
+    expect(covariantD.toList(), [dAdd.declaredElement.parameters[0]]);
+
+    var covariantE = getClassCovariantParameters(AstFinder.getClass(unit, "E"));
+    expect(covariantE.toList(), []);
+  }
+
+  test_covarianceChecks_returnFunction() async {
+    var source = addSource(r'''
+typedef F<T>(T t);
+typedef T R<T>();
+class C<T> {
+  F<T> f;
+
+  C();
+  factory C.fact() => new C<Null>();
+
+  F<T> get g => null;
+  F<T> m1() => null;
+  R<F<T>> m2() => null;
+
+  casts(C<T> other, T t) {
+    other.f;
+    other.g(t);
+    other.m1();
+    other.m2;
+
+    new C<T>.fact().f(t);
+    new C<int>.fact().g;
+    new C<int>.fact().m1;
+    new C<T>.fact().m2();
+
+    new C<Object>.fact().f(42);
+    new C<Object>.fact().g;
+    new C<Object>.fact().m1;
+    new C<Object>.fact().m2();
+
+    new C.fact().f(42);
+    new C.fact().g;
+    new C.fact().m1;
+    new C.fact().m2();
+  }
+
+  noCasts(T t) {
+    f;
+    g;
+    m1();
+    m2();
+
+    f(t);
+    g(t);
+    (f)(t);
+    (g)(t);
+    m1;
+    m2;
+
+    this.f;
+    this.g;
+    this.m1();
+    this.m2();
+    this.m1;
+    this.m2;
+    (this.m1)();
+    (this.m2)();
+    this.f(t);
+    this.g(t);
+    (this.f)(t);
+    (this.g)(t);
+
+    new C<int>().f;
+    new C<T>().g;
+    new C<int>().m1();
+    new C().m2();
+
+    new D().f;
+    new D().g;
+    new D().m1();
+    new D().m2();
+  }
+}
+class D extends C<num> {
+  noCasts(t) {
+    f;
+    this.g;
+    this.m1();
+    m2;
+
+    super.f;
+    super.g;
+    super.m1;
+    super.m2();
+  }
+}
+
+D d;
+C<Object> c;
+C cD;
+C<Null> cN;
+F<Object> f;
+F<Null> fN;
+R<F<Object>> rf;
+R<F<Null>> rfN;
+R<R<F<Object>>> rrf;
+R<R<F<Null>>> rrfN;
+Object obj;
+F<int> fi;
+R<F<int>> rfi;
+R<R<F<int>>> rrfi;
+
+casts() {
+  c.f;
+  c.g;
+  c.m1;
+  c.m1();
+  c.m2();
+
+  fN = c.f;
+  fN = c.g;
+  rfN = c.m1;
+  rrfN = c.m2;
+  fN = c.m1();
+  rfN = c.m2();
+
+  f = c.f;
+  f = c.g;
+  rf = c.m1;
+  rrf = c.m2;
+  f = c.m1();
+  rf = c.m2();
+  c.m2()();
+
+  c.f(obj);
+  c.g(obj);
+  (c.f)(obj);
+  (c.g)(obj);
+  (c.m1)();
+  c.m1()(obj);
+  (c.m2)();
+
+  cD.f;
+  cD.g;
+  cD.m1;
+  cD.m1();
+  cD.m2();
+}
+
+noCasts() {
+  fi = d.f;
+  fi = d.g;
+  rfi = d.m1;
+  fi = d.m1();
+  rrfi = d.m2;
+  rfi = d.m2();
+  d.f(42);
+  d.g(42);
+  (d.f)(42);
+  (d.g)(42);
+  d.m1()(42);
+  d.m2()()(42);
+
+  cN.f;
+  cN.g;
+  cN.m1;
+  cN.m1();
+  cN.m2();
+}
+''');
+    var unit = (await computeAnalysisResult(source)).unit;
+    assertNoErrors(source);
+
+    void expectCast(Statement statement, bool hasCast) {
+      var value = (statement as ExpressionStatement).expression;
+      if (value is AssignmentExpression) {
+        value = (value as AssignmentExpression).rightHandSide;
+      }
+      while (value is FunctionExpressionInvocation) {
+        value = (value as FunctionExpressionInvocation).function;
+      }
+      while (value is ParenthesizedExpression) {
+        value = (value as ParenthesizedExpression).expression;
+      }
+      var isCallingGetter =
+          value is MethodInvocation && !value.methodName.name.startsWith('m');
+      var cast = isCallingGetter
+          ? getImplicitOperationCast(value)
+          : getImplicitCast(value);
+      var castKind = isCallingGetter ? 'special cast' : 'cast';
+      expect(cast, hasCast ? isNotNull : isNull,
+          reason: '`$statement` should ' +
+              (hasCast ? '' : 'not ') +
+              'have a $castKind on `$value`.');
+    }
+
+    for (var s in AstFinder.getStatementsInMethod(unit, 'C', 'noCasts')) {
+      expectCast(s, false);
+    }
+    for (var s in AstFinder.getStatementsInMethod(unit, 'C', 'casts')) {
+      expectCast(s, true);
+    }
+    for (var s in AstFinder.getStatementsInMethod(unit, 'D', 'noCasts')) {
+      expectCast(s, false);
+    }
+    for (var s in AstFinder.getStatementsInTopLevelFunction(unit, 'noCasts')) {
+      expectCast(s, false);
+    }
+    for (var s in AstFinder.getStatementsInTopLevelFunction(unit, 'casts')) {
+      expectCast(s, true);
+    }
+  }
+
+  test_covarianceChecks_superclass() async {
+    var source = addSource(r'''
+class C<T> {
+  add(T t) {}
+  forEach(void f(T t)) {}
+}
+class D {
+  add(int t) {}
+  forEach(void f(int t)) {}
+}
+class E extends D implements C<int> {}
+''');
+    var unit = (await computeAnalysisResult(source)).unit;
+    assertNoErrors(source);
+    var cAdd = AstFinder.getMethodInClass(unit, "C", "add");
+    var covariantC = getClassCovariantParameters(AstFinder.getClass(unit, "C"));
+    expect(covariantC.toList(), [cAdd.declaredElement.parameters[0]]);
+
+    var dAdd = AstFinder.getMethodInClass(unit, "D", "add");
+    var covariantD = getClassCovariantParameters(AstFinder.getClass(unit, "D"));
+    expect(covariantD, null);
+
+    var classE = AstFinder.getClass(unit, "E");
+    var covariantE = getClassCovariantParameters(classE);
+    var superCovariantE = getSuperclassCovariantParameters(classE);
+    expect(covariantE.toList(), []);
+    expect(superCovariantE.toList(), [dAdd.declaredElement.parameters[0]]);
+  }
+
+  test_factoryConstructor_propagation() async {
+    String code = r'''
+      class A<T> {
+        factory A() { return new B(); }
+      }
+      class B<S> extends A<S> {}
+   ''';
+    CompilationUnit unit = await resolveSource(code);
+
+    ConstructorDeclaration constructor =
+        AstFinder.getConstructorInClass(unit, "A", null);
+    BlockFunctionBody body = constructor.body;
+    ReturnStatement stmt = body.block.statements[0];
+    InstanceCreationExpression exp = stmt.expression;
+    ClassElement elementB = AstFinder.getClass(unit, "B").declaredElement;
+    ClassElement elementA = AstFinder.getClass(unit, "A").declaredElement;
+    expect(resolutionMap.typeForTypeName(exp.constructorName.type).element,
+        elementB);
+    _isInstantiationOf(_hasElement(elementB))(
+        [_isType(elementA.typeParameters[0].type)])(exp.staticType);
+  }
+
+  test_fieldDeclaration_propagation() async {
+    String code = r'''
+      class A {
+        List<String> f0 = ["hello"];
+      }
+   ''';
+    CompilationUnit unit = await resolveSource(code);
+
+    VariableDeclaration field = AstFinder.getFieldInClass(unit, "A", "f0");
+
+    _isListOf(_isString)(field.initializer.staticType);
+  }
+
+  test_functionDeclaration_body_propagation() async {
+    String code = r'''
+      typedef T Function2<S, T>(S x);
+
+      List<int> test1() => [];
+
+      Function2<int, int> test2 (int x) {
+        Function2<String, int> inner() {
+          return (x) => x.length;
+        }
+        return (x) => x;
+     }
+   ''';
+    CompilationUnit unit = await resolveSource(code);
+
+    Asserter<InterfaceType> assertListOfInt = _isListOf(_isInt);
+
+    FunctionDeclaration test1 = AstFinder.getTopLevelFunction(unit, "test1");
+    ExpressionFunctionBody body = test1.functionExpression.body;
+    assertListOfInt(body.expression.staticType);
+
+    List<Statement> statements =
+        AstFinder.getStatementsInTopLevelFunction(unit, "test2");
+
+    FunctionDeclaration inner =
+        (statements[0] as FunctionDeclarationStatement).functionDeclaration;
+    BlockFunctionBody body0 = inner.functionExpression.body;
+    ReturnStatement return0 = body0.block.statements[0];
+    Expression anon0 = return0.expression;
+    FunctionType type0 = anon0.staticType;
+    expect(type0.returnType, typeProvider.intType);
+    expect(type0.normalParameterTypes[0], typeProvider.stringType);
+
+    FunctionExpression anon1 = (statements[1] as ReturnStatement).expression;
+    FunctionType type1 =
+        resolutionMap.elementDeclaredByFunctionExpression(anon1).type;
+    expect(type1.returnType, typeProvider.intType);
+    expect(type1.normalParameterTypes[0], typeProvider.intType);
+  }
+
+  test_functionLiteral_assignment_typedArguments() async {
+    String code = r'''
+      typedef T Function2<S, T>(S x);
+
+      void main () {
+        Function2<int, String> l0 = (int x) => null;
+        Function2<int, String> l1 = (int x) => "hello";
+        Function2<int, String> l2 = (String x) => "hello";
+        Function2<int, String> l3 = (int x) => 3;
+        Function2<int, String> l4 = (int x) {return 3;};
+     }
+   ''';
+    CompilationUnit unit = await resolveSource(code);
+    List<Statement> statements =
+        AstFinder.getStatementsInTopLevelFunction(unit, "main");
+    DartType literal(int i) {
+      VariableDeclarationStatement stmt = statements[i];
+      VariableDeclaration decl = stmt.variables.variables[0];
+      FunctionExpression exp = decl.initializer;
+      return resolutionMap.elementDeclaredByFunctionExpression(exp).type;
+    }
+
+    _isFunction2Of(_isInt, _isNull)(literal(0));
+    _isFunction2Of(_isInt, _isString)(literal(1));
+    _isFunction2Of(_isString, _isString)(literal(2));
+    _isFunction2Of(_isInt, _isString)(literal(3));
+    _isFunction2Of(_isInt, _isString)(literal(4));
+  }
+
+  test_functionLiteral_assignment_unTypedArguments() async {
+    String code = r'''
+      typedef T Function2<S, T>(S x);
+
+      void main () {
+        Function2<int, String> l0 = (x) => null;
+        Function2<int, String> l1 = (x) => "hello";
+        Function2<int, String> l2 = (x) => "hello";
+        Function2<int, String> l3 = (x) => 3;
+        Function2<int, String> l4 = (x) {return 3;};
+     }
+   ''';
+    CompilationUnit unit = await resolveSource(code);
+    List<Statement> statements =
+        AstFinder.getStatementsInTopLevelFunction(unit, "main");
+    DartType literal(int i) {
+      VariableDeclarationStatement stmt = statements[i];
+      VariableDeclaration decl = stmt.variables.variables[0];
+      FunctionExpression exp = decl.initializer;
+      return resolutionMap.elementDeclaredByFunctionExpression(exp).type;
+    }
+
+    _isFunction2Of(_isInt, _isNull)(literal(0));
+    _isFunction2Of(_isInt, _isString)(literal(1));
+    _isFunction2Of(_isInt, _isString)(literal(2));
+    _isFunction2Of(_isInt, _isString)(literal(3));
+    _isFunction2Of(_isInt, _isString)(literal(4));
+  }
+
+  test_functionLiteral_body_propagation() async {
+    String code = r'''
+      typedef T Function2<S, T>(S x);
+
+      void main () {
+        Function2<int, List<String>> l0 = (int x) => ["hello"];
+        Function2<int, List<String>> l1 = (String x) => ["hello"];
+        Function2<int, List<String>> l2 = (int x) => [3];
+        Function2<int, List<String>> l3 = (int x) {return [3];};
+     }
+   ''';
+    CompilationUnit unit = await resolveSource(code);
+    List<Statement> statements =
+        AstFinder.getStatementsInTopLevelFunction(unit, "main");
+    Expression functionReturnValue(int i) {
+      VariableDeclarationStatement stmt = statements[i];
+      VariableDeclaration decl = stmt.variables.variables[0];
+      FunctionExpression exp = decl.initializer;
+      FunctionBody body = exp.body;
+      if (body is ExpressionFunctionBody) {
+        return body.expression;
+      } else {
+        Statement stmt = (body as BlockFunctionBody).block.statements[0];
+        return (stmt as ReturnStatement).expression;
+      }
+    }
+
+    Asserter<InterfaceType> assertListOfString = _isListOf(_isString);
+    assertListOfString(functionReturnValue(0).staticType);
+    assertListOfString(functionReturnValue(1).staticType);
+    assertListOfString(functionReturnValue(2).staticType);
+    assertListOfString(functionReturnValue(3).staticType);
+  }
+
+  test_functionLiteral_functionExpressionInvocation_typedArguments() async {
+    String code = r'''
+      class Mapper<F, T> {
+        T map(T mapper(F x)) => mapper(null);
+      }
+
+      void main () {
+        (new Mapper<int, String>().map)((int x) => null);
+        (new Mapper<int, String>().map)((int x) => "hello");
+        (new Mapper<int, String>().map)((String x) => "hello");
+        (new Mapper<int, String>().map)((int x) => 3);
+        (new Mapper<int, String>().map)((int x) {return 3;});
+     }
+   ''';
+    CompilationUnit unit = await resolveSource(code);
+    List<Statement> statements =
+        AstFinder.getStatementsInTopLevelFunction(unit, "main");
+    DartType literal(int i) {
+      ExpressionStatement stmt = statements[i];
+      FunctionExpressionInvocation invk = stmt.expression;
+      FunctionExpression exp = invk.argumentList.arguments[0];
+      return resolutionMap.elementDeclaredByFunctionExpression(exp).type;
+    }
+
+    _isFunction2Of(_isInt, _isNull)(literal(0));
+    _isFunction2Of(_isInt, _isString)(literal(1));
+    _isFunction2Of(_isString, _isString)(literal(2));
+    _isFunction2Of(_isInt, _isString)(literal(3));
+    _isFunction2Of(_isInt, _isString)(literal(4));
+  }
+
+  test_functionLiteral_functionExpressionInvocation_unTypedArguments() async {
+    String code = r'''
+      class Mapper<F, T> {
+        T map(T mapper(F x)) => mapper(null);
+      }
+
+      void main () {
+        (new Mapper<int, String>().map)((x) => null);
+        (new Mapper<int, String>().map)((x) => "hello");
+        (new Mapper<int, String>().map)((x) => "hello");
+        (new Mapper<int, String>().map)((x) => 3);
+        (new Mapper<int, String>().map)((x) {return 3;});
+     }
+   ''';
+    CompilationUnit unit = await resolveSource(code);
+    List<Statement> statements =
+        AstFinder.getStatementsInTopLevelFunction(unit, "main");
+    DartType literal(int i) {
+      ExpressionStatement stmt = statements[i];
+      FunctionExpressionInvocation invk = stmt.expression;
+      FunctionExpression exp = invk.argumentList.arguments[0];
+      return resolutionMap.elementDeclaredByFunctionExpression(exp).type;
+    }
+
+    _isFunction2Of(_isInt, _isNull)(literal(0));
+    _isFunction2Of(_isInt, _isString)(literal(1));
+    _isFunction2Of(_isInt, _isString)(literal(2));
+    _isFunction2Of(_isInt, _isString)(literal(3));
+    _isFunction2Of(_isInt, _isString)(literal(4));
+  }
+
+  test_functionLiteral_functionInvocation_typedArguments() async {
+    String code = r'''
+      String map(String mapper(int x)) => mapper(null);
+
+      void main () {
+        map((int x) => null);
+        map((int x) => "hello");
+        map((String x) => "hello");
+        map((int x) => 3);
+        map((int x) {return 3;});
+     }
+   ''';
+    CompilationUnit unit = await resolveSource(code);
+    List<Statement> statements =
+        AstFinder.getStatementsInTopLevelFunction(unit, "main");
+    DartType literal(int i) {
+      ExpressionStatement stmt = statements[i];
+      MethodInvocation invk = stmt.expression;
+      FunctionExpression exp = invk.argumentList.arguments[0];
+      return resolutionMap.elementDeclaredByFunctionExpression(exp).type;
+    }
+
+    _isFunction2Of(_isInt, _isNull)(literal(0));
+    _isFunction2Of(_isInt, _isString)(literal(1));
+    _isFunction2Of(_isString, _isString)(literal(2));
+    _isFunction2Of(_isInt, _isString)(literal(3));
+    _isFunction2Of(_isInt, _isString)(literal(4));
+  }
+
+  test_functionLiteral_functionInvocation_unTypedArguments() async {
+    String code = r'''
+      String map(String mapper(int x)) => mapper(null);
+
+      void main () {
+        map((x) => null);
+        map((x) => "hello");
+        map((x) => "hello");
+        map((x) => 3);
+        map((x) {return 3;});
+     }
+   ''';
+    CompilationUnit unit = await resolveSource(code);
+    List<Statement> statements =
+        AstFinder.getStatementsInTopLevelFunction(unit, "main");
+    DartType literal(int i) {
+      ExpressionStatement stmt = statements[i];
+      MethodInvocation invk = stmt.expression;
+      FunctionExpression exp = invk.argumentList.arguments[0];
+      return resolutionMap.elementDeclaredByFunctionExpression(exp).type;
+    }
+
+    _isFunction2Of(_isInt, _isNull)(literal(0));
+    _isFunction2Of(_isInt, _isString)(literal(1));
+    _isFunction2Of(_isInt, _isString)(literal(2));
+    _isFunction2Of(_isInt, _isString)(literal(3));
+    _isFunction2Of(_isInt, _isString)(literal(4));
+  }
+
+  test_functionLiteral_methodInvocation_typedArguments() async {
+    String code = r'''
+      class Mapper<F, T> {
+        T map(T mapper(F x)) => mapper(null);
+      }
+
+      void main () {
+        new Mapper<int, String>().map((int x) => null);
+        new Mapper<int, String>().map((int x) => "hello");
+        new Mapper<int, String>().map((String x) => "hello");
+        new Mapper<int, String>().map((int x) => 3);
+        new Mapper<int, String>().map((int x) {return 3;});
+     }
+   ''';
+    CompilationUnit unit = await resolveSource(code);
+    List<Statement> statements =
+        AstFinder.getStatementsInTopLevelFunction(unit, "main");
+    DartType literal(int i) {
+      ExpressionStatement stmt = statements[i];
+      MethodInvocation invk = stmt.expression;
+      FunctionExpression exp = invk.argumentList.arguments[0];
+      return resolutionMap.elementDeclaredByFunctionExpression(exp).type;
+    }
+
+    _isFunction2Of(_isInt, _isNull)(literal(0));
+    _isFunction2Of(_isInt, _isString)(literal(1));
+    _isFunction2Of(_isString, _isString)(literal(2));
+    _isFunction2Of(_isInt, _isString)(literal(3));
+    _isFunction2Of(_isInt, _isString)(literal(4));
+  }
+
+  test_functionLiteral_methodInvocation_unTypedArguments() async {
+    String code = r'''
+      class Mapper<F, T> {
+        T map(T mapper(F x)) => mapper(null);
+      }
+
+      void main () {
+        new Mapper<int, String>().map((x) => null);
+        new Mapper<int, String>().map((x) => "hello");
+        new Mapper<int, String>().map((x) => "hello");
+        new Mapper<int, String>().map((x) => 3);
+        new Mapper<int, String>().map((x) {return 3;});
+     }
+   ''';
+    CompilationUnit unit = await resolveSource(code);
+    List<Statement> statements =
+        AstFinder.getStatementsInTopLevelFunction(unit, "main");
+    DartType literal(int i) {
+      ExpressionStatement stmt = statements[i];
+      MethodInvocation invk = stmt.expression;
+      FunctionExpression exp = invk.argumentList.arguments[0];
+      return resolutionMap.elementDeclaredByFunctionExpression(exp).type;
+    }
+
+    _isFunction2Of(_isInt, _isNull)(literal(0));
+    _isFunction2Of(_isInt, _isString)(literal(1));
+    _isFunction2Of(_isInt, _isString)(literal(2));
+    _isFunction2Of(_isInt, _isString)(literal(3));
+    _isFunction2Of(_isInt, _isString)(literal(4));
+  }
+
+  test_functionLiteral_unTypedArgument_propagation() async {
+    String code = r'''
+      typedef T Function2<S, T>(S x);
+
+      void main () {
+        Function2<int, int> l0 = (x) => x;
+        Function2<int, int> l1 = (x) => x+1;
+        Function2<int, String> l2 = (x) => x;
+        Function2<int, String> l3 = (x) => x.toLowerCase();
+        Function2<String, String> l4 = (x) => x.toLowerCase();
+     }
+   ''';
+    CompilationUnit unit = await resolveSource(code);
+    List<Statement> statements =
+        AstFinder.getStatementsInTopLevelFunction(unit, "main");
+    Expression functionReturnValue(int i) {
+      VariableDeclarationStatement stmt = statements[i];
+      VariableDeclaration decl = stmt.variables.variables[0];
+      FunctionExpression exp = decl.initializer;
+      FunctionBody body = exp.body;
+      if (body is ExpressionFunctionBody) {
+        return body.expression;
+      } else {
+        Statement stmt = (body as BlockFunctionBody).block.statements[0];
+        return (stmt as ReturnStatement).expression;
+      }
+    }
+
+    expect(functionReturnValue(0).staticType, typeProvider.intType);
+    expect(functionReturnValue(1).staticType, typeProvider.intType);
+    expect(functionReturnValue(2).staticType, typeProvider.intType);
+    expect(functionReturnValue(3).staticType, typeProvider.dynamicType);
+    expect(functionReturnValue(4).staticType, typeProvider.stringType);
+  }
+
+  test_futureOr_assignFromFuture() async {
+    // Test a Future<T> can be assigned to FutureOr<T>.
+    MethodInvocation invoke = await _testFutureOr(r'''
+    FutureOr<T> mk<T>(Future<T> x) => x;
+    test() => mk(new Future<int>.value(42));
+    ''');
+    _isFutureOrOfInt(invoke.staticType);
+  }
+
+  test_futureOr_assignFromValue() async {
+    // Test a T can be assigned to FutureOr<T>.
+    MethodInvocation invoke = await _testFutureOr(r'''
+    FutureOr<T> mk<T>(T x) => x;
+    test() => mk(42);
+    ''');
+    _isFutureOrOfInt(invoke.staticType);
+  }
+
+  test_futureOr_asyncExpressionBody() async {
+    // A FutureOr<T> can be used as the expression body for an async function
+    MethodInvocation invoke = await _testFutureOr(r'''
+    Future<T> mk<T>(FutureOr<T> x) async => x;
+    test() => mk(42);
+    ''');
+    _isFutureOfInt(invoke.staticType);
+  }
+
+  test_futureOr_asyncReturn() async {
+    // A FutureOr<T> can be used as the return value for an async function
+    MethodInvocation invoke = await _testFutureOr(r'''
+    Future<T> mk<T>(FutureOr<T> x) async { return x; }
+    test() => mk(42);
+    ''');
+    _isFutureOfInt(invoke.staticType);
+  }
+
+  test_futureOr_await() async {
+    // Test a FutureOr<T> can be awaited.
+    MethodInvocation invoke = await _testFutureOr(r'''
+    Future<T> mk<T>(FutureOr<T> x) async => await x;
+    test() => mk(42);
+    ''');
+    _isFutureOfInt(invoke.staticType);
+  }
+
+  test_futureOr_downwards1() async {
+    // Test that downwards inference interacts correctly with FutureOr
+    // parameters.
+    MethodInvocation invoke = await _testFutureOr(r'''
+    Future<T> mk<T>(FutureOr<T> x) => null;
+    Future<int> test() => mk(new Future<int>.value(42));
+    ''');
+    _isFutureOfInt(invoke.staticType);
+  }
+
+  test_futureOr_downwards2() async {
+    // Test that downwards inference interacts correctly with FutureOr
+    // parameters when the downwards context is FutureOr
+    MethodInvocation invoke = await _testFutureOr(r'''
+    Future<T> mk<T>(FutureOr<T> x) => null;
+    FutureOr<int> test() => mk(new Future<int>.value(42));
+    ''');
+    _isFutureOfInt(invoke.staticType);
+  }
+
+  test_futureOr_downwards3() async {
+    // Test that downwards inference correctly propogates into
+    // arguments.
+    MethodInvocation invoke = await _testFutureOr(r'''
+    Future<T> mk<T>(FutureOr<T> x) => null;
+    Future<int> test() => mk(new Future.value(42));
+    ''');
+    _isFutureOfInt(invoke.staticType);
+    _isFutureOfInt(invoke.argumentList.arguments[0].staticType);
+  }
+
+  test_futureOr_downwards4() async {
+    // Test that downwards inference interacts correctly with FutureOr
+    // parameters when the downwards context is FutureOr
+    MethodInvocation invoke = await _testFutureOr(r'''
+    Future<T> mk<T>(FutureOr<T> x) => null;
+    FutureOr<int> test() => mk(new Future.value(42));
+    ''');
+    _isFutureOfInt(invoke.staticType);
+    _isFutureOfInt(invoke.argumentList.arguments[0].staticType);
+  }
+
+  test_futureOr_downwards5() async {
+    // Test that downwards inference correctly pins the type when it
+    // comes from a FutureOr
+    MethodInvocation invoke = await _testFutureOr(r'''
+    Future<T> mk<T>(FutureOr<T> x) => null;
+    FutureOr<num> test() => mk(new Future.value(42));
+    ''');
+    _isFutureOf([_isNum])(invoke.staticType);
+    _isFutureOf([_isNum])(invoke.argumentList.arguments[0].staticType);
+  }
+
+  test_futureOr_downwards6() async {
+    // Test that downwards inference doesn't decompose FutureOr
+    // when instantiating type variables.
+    MethodInvocation invoke = await _testFutureOr(r'''
+    T mk<T>(T x) => null;
+    FutureOr<int> test() => mk(new Future.value(42));
+    ''');
+    _isFutureOrOfInt(invoke.staticType);
+    _isFutureOfInt(invoke.argumentList.arguments[0].staticType);
+  }
+
+  test_futureOr_downwards7() async {
+    // Test that downwards inference incorporates bounds correctly
+    // when instantiating type variables.
+    MethodInvocation invoke = await _testFutureOr(r'''
+      T mk<T extends Future<int>>(T x) => null;
+      FutureOr<int> test() => mk(new Future.value(42));
+    ''');
+    _isFutureOfInt(invoke.staticType);
+    _isFutureOfInt(invoke.argumentList.arguments[0].staticType);
+  }
+
+  test_futureOr_downwards8() async {
+    // Test that downwards inference incorporates bounds correctly
+    // when instantiating type variables.
+    // TODO(leafp): I think this should pass once the inference changes
+    // that jmesserly is adding are landed.
+    MethodInvocation invoke = await _testFutureOr(r'''
+    T mk<T extends Future<Object>>(T x) => null;
+    FutureOr<int> test() => mk(new Future.value(42));
+    ''');
+    _isFutureOfInt(invoke.staticType);
+    _isFutureOfInt(invoke.argumentList.arguments[0].staticType);
+  }
+
+  test_futureOr_downwards9() async {
+    // Test that downwards inference decomposes correctly with
+    // other composite types
+    MethodInvocation invoke = await _testFutureOr(r'''
+    List<T> mk<T>(T x) => null;
+    FutureOr<List<int>> test() => mk(3);
+    ''');
+    _isListOf(_isInt)(invoke.staticType);
+    _isInt(invoke.argumentList.arguments[0].staticType);
+  }
+
+  test_futureOr_methods1() async {
+    // Test that FutureOr has the Object methods
+    MethodInvocation invoke = await _testFutureOr(r'''
+    dynamic test(FutureOr<int> x) => x.toString();
+    ''');
+    _isString(invoke.staticType);
+  }
+
+  test_futureOr_methods2() async {
+    // Test that FutureOr does not have the constituent type methods
+    MethodInvocation invoke = await _testFutureOr(r'''
+    dynamic test(FutureOr<int> x) => x.abs();
+    ''', errors: [StaticTypeWarningCode.UNDEFINED_METHOD]);
+    _isDynamic(invoke.staticType);
+  }
+
+  test_futureOr_methods3() async {
+    // Test that FutureOr does not have the Future type methods
+    MethodInvocation invoke = await _testFutureOr(r'''
+    dynamic test(FutureOr<int> x) => x.then((x) => x);
+    ''', errors: [StaticTypeWarningCode.UNDEFINED_METHOD]);
+    _isDynamic(invoke.staticType);
+  }
+
+  test_futureOr_methods4() async {
+    // Test that FutureOr<dynamic> does not have all methods
+    MethodInvocation invoke = await _testFutureOr(r'''
+    dynamic test(FutureOr<dynamic> x) => x.abs();
+    ''', errors: [StaticTypeWarningCode.UNDEFINED_METHOD]);
+    _isDynamic(invoke.staticType);
+  }
+
+  test_futureOr_no_return() async {
+    MethodInvocation invoke = await _testFutureOr(r'''
+    FutureOr<T> mk<T>(Future<T> x) => x;
+    Future<int> f;
+    test() => f.then((int x) {});
+    ''');
+    _isFunction2Of(_isInt, _isNull)(
+        invoke.argumentList.arguments[0].staticType);
+    _isFutureOfNull(invoke.staticType);
+  }
+
+  test_futureOr_no_return_value() async {
+    MethodInvocation invoke = await _testFutureOr(r'''
+    FutureOr<T> mk<T>(Future<T> x) => x;
+    Future<int> f;
+    test() => f.then((int x) {return;});
+    ''');
+    _isFunction2Of(_isInt, _isNull)(
+        invoke.argumentList.arguments[0].staticType);
+    _isFutureOfNull(invoke.staticType);
+  }
+
+  test_futureOr_return_null() async {
+    MethodInvocation invoke = await _testFutureOr(r'''
+    FutureOr<T> mk<T>(Future<T> x) => x;
+    Future<int> f;
+    test() => f.then((int x) {return null;});
+    ''');
+    _isFunction2Of(_isInt, _isNull)(
+        invoke.argumentList.arguments[0].staticType);
+    _isFutureOfNull(invoke.staticType);
+  }
+
+  test_futureOr_upwards1() async {
+    // Test that upwards inference correctly prefers to instantiate type
+    // variables with the "smaller" solution when both are possible.
+    MethodInvocation invoke = await _testFutureOr(r'''
+    Future<T> mk<T>(FutureOr<T> x) => null;
+    dynamic test() => mk(new Future<int>.value(42));
+    ''');
+    _isFutureOfInt(invoke.staticType);
+  }
+
+  test_futureOr_upwards2() async {
+    // Test that upwards inference fails when the solution doesn't
+    // match the bound.
+    MethodInvocation invoke = await _testFutureOr(r'''
+    Future<T> mk<T extends Future<Object>>(FutureOr<T> x) => null;
+    dynamic test() => mk(new Future<int>.value(42));
+    ''', errors: [StrongModeCode.COULD_NOT_INFER]);
+    _isFutureOfInt(invoke.staticType);
+  }
+
+  test_futureOrNull_no_return() async {
+    MethodInvocation invoke = await _testFutureOr(r'''
+    FutureOr<T> mk<T>(Future<T> x) => x;
+    Future<int> f;
+    test() => f.then<Null>((int x) {});
+    ''');
+    _isFunction2Of(_isInt, _isNull)(
+        invoke.argumentList.arguments[0].staticType);
+    _isFutureOfNull(invoke.staticType);
+  }
+
+  test_futureOrNull_no_return_value() async {
+    MethodInvocation invoke = await _testFutureOr(r'''
+    FutureOr<T> mk<T>(Future<T> x) => x;
+    Future<int> f;
+    test() => f.then<Null>((int x) {return;});
+    ''');
+    _isFunction2Of(_isInt, _isNull)(
+        invoke.argumentList.arguments[0].staticType);
+    _isFutureOfNull(invoke.staticType);
+  }
+
+  test_futureOrNull_return_null() async {
+    MethodInvocation invoke = await _testFutureOr(r'''
+    FutureOr<T> mk<T>(Future<T> x) => x;
+    Future<int> f;
+    test() => f.then<Null>((int x) { return null;});
+    ''');
+    _isFunction2Of(_isInt, _isNull)(
+        invoke.argumentList.arguments[0].staticType);
+    _isFutureOfNull(invoke.staticType);
+  }
+
+  test_generic_partial() async {
+    // Test that upward and downward type inference handles partial
+    // type schemas correctly.  Downwards inference in a partial context
+    // (e.g. Map<String, ?>) should still allow upwards inference to fill
+    // in the missing information.
+    String code = r'''
+class A<T> {
+  A(T x);
+  A.fromA(A<T> a) {}
+  A.fromMap(Map<String, T> m) {}
+  A.fromList(List<T> m) {}
+  A.fromT(T t) {}
+  A.fromB(B<T, String> a) {}
+}
+
+class B<S, T> {
+  B(S s);
+}
+
+void test() {
+    var a0 = new A.fromA(new A(3));
+    var a1 = new A.fromMap({'hello' : 3});
+    var a2 = new A.fromList([3]);
+    var a3 = new A.fromT(3);
+    var a4 = new A.fromB(new B(3));
+}
+   ''';
+    CompilationUnit unit = await resolveSource(code);
+    Element elementA = AstFinder.getClass(unit, "A").declaredElement;
+    List<Statement> statements =
+        AstFinder.getStatementsInTopLevelFunction(unit, "test");
+    void check(int i) {
+      VariableDeclarationStatement stmt = statements[i];
+      VariableDeclaration decl = stmt.variables.variables[0];
+      Expression init = decl.initializer;
+      _isInstantiationOf(_hasElement(elementA))([_isInt])(init.staticType);
+    }
+
+    for (var i = 0; i < 5; i++) check(i);
+  }
+
+  test_inferConstructor_unknownTypeLowerBound() async {
+    Source source = addSource(r'''
+        class C<T> {
+          C(void callback(List<T> a));
+        }
+        test() {
+          // downwards inference pushes List<?> and in parameter position this
+          // becomes inferred as List<Null>.
+          var c = new C((items) {});
+        }
+        ''');
+    CompilationUnit unit = (await computeAnalysisResult(source)).unit;
+    assertNoErrors(source);
+    verify([source]);
+    DartType cType = findLocalVariable(unit, 'c').type;
+    Element elementC = AstFinder.getClass(unit, "C").declaredElement;
+
+    _isInstantiationOf(_hasElement(elementC))([_isDynamic])(cType);
+  }
+
+  test_inference_error_arguments() async {
+    Source source = addSource(r'''
+typedef R F<T, R>(T t);
+
+F<T, T> g<T>(F<T, T> f) => (x) => f(f(x));
+
+test() {
+  var h = g((int x) => 42.0);
+}
+ ''');
+    await computeAnalysisResult(source);
+    _expectInferenceError(source, [
+      StrongModeCode.COULD_NOT_INFER,
+      StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE
+    ], r'''
+Couldn't infer type parameter 'T'.
+
+Tried to infer 'double' for 'T' which doesn't work:
+  Parameter 'f' declared as     '(T) → T'
+                but argument is '(int) → double'.
+
+Consider passing explicit type argument(s) to the generic.
+
+''');
+  }
+
+  test_inference_error_arguments2() async {
+    Source source = addSource(r'''
+typedef R F<T, R>(T t);
+
+F<T, T> g<T>(F<T, T> a, F<T, T> b) => (x) => a(b(x));
+
+test() {
+  var h = g((int x) => 42.0, (double x) => 42);
+}
+ ''');
+    await computeAnalysisResult(source);
+    _expectInferenceError(source, [
+      StrongModeCode.COULD_NOT_INFER,
+      StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE,
+      StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE
+    ], r'''
+Couldn't infer type parameter 'T'.
+
+Tried to infer 'num' for 'T' which doesn't work:
+  Parameter 'a' declared as     '(T) → T'
+                but argument is '(int) → double'.
+  Parameter 'b' declared as     '(T) → T'
+                but argument is '(double) → int'.
+
+Consider passing explicit type argument(s) to the generic.
+
+''');
+  }
+
+  test_inference_error_extendsFromReturn() async {
+    // This is not an inference error because we successfully infer Null.
+    Source source = addSource(r'''
+T max<T extends num>(T x, T y) => x;
+
+test() {
+  String hello = max(1, 2);
+}
+ ''');
+    var analysisResult = await computeAnalysisResult(source);
+    assertErrors(source, [
+      StrongModeCode.INVALID_CAST_LITERAL,
+      StrongModeCode.INVALID_CAST_LITERAL
+    ]);
+    var unit = analysisResult.unit;
+    var h = (AstFinder.getStatementsInTopLevelFunction(unit, "test")[0]
+            as VariableDeclarationStatement)
+        .variables
+        .variables[0];
+    var call = h.initializer as MethodInvocation;
+    expect(call.staticInvokeType.toString(), '(Null, Null) → Null');
+  }
+
+  test_inference_error_extendsFromReturn2() async {
+    Source source = addSource(r'''
+typedef R F<T, R>(T t);
+F<T, T> g<T extends num>() => (y) => y;
+
+test() {
+  F<String, String> hello = g();
+}
+ ''');
+    await computeAnalysisResult(source);
+    _expectInferenceError(source, [
+      StrongModeCode.COULD_NOT_INFER,
+    ], r'''
+Couldn't infer type parameter 'T'.
+
+Tried to infer 'String' for 'T' which doesn't work:
+  Type parameter 'T' declared to extend 'num'.
+The type 'String' was inferred from:
+  Return type declared as '(T) → T'
+              used where  '(String) → String' is required.
+
+Consider passing explicit type argument(s) to the generic.
+
+''');
+  }
+
+  test_inference_error_genericFunction() async {
+    Source source = addSource(r'''
+T max<T extends num>(T x, T y) => x < y ? y : x;
+abstract class Iterable<T> {
+  T get first;
+  S fold<S>(S s, S f(S s, T t));
+}
+test(Iterable values) {
+  num n = values.fold(values.first as num, max);
+}
+ ''');
+    await computeAnalysisResult(source);
+    _expectInferenceError(source, [
+      StrongModeCode.COULD_NOT_INFER,
+      StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE
+    ], r'''
+Couldn't infer type parameter 'T'.
+
+Tried to infer 'dynamic' for 'T' which doesn't work:
+  Function type declared as '<T extends num>(T, T) → T'
+                used where  '(num, dynamic) → num' is required.
+
+Consider passing explicit type argument(s) to the generic.
+
+''');
+  }
+
+  test_inference_error_returnContext() async {
+    Source source = addSource(r'''
+typedef R F<T, R>(T t);
+
+F<T, T> g<T>(T t) => (x) => t;
+
+test() {
+  F<num, int> h = g(42);
+}
+ ''');
+    await computeAnalysisResult(source);
+    _expectInferenceError(source, [StrongModeCode.COULD_NOT_INFER], r'''
+Couldn't infer type parameter 'T'.
+
+Tried to infer 'num' for 'T' which doesn't work:
+  Return type declared as '(T) → T'
+              used where  '(num) → int' is required.
+
+Consider passing explicit type argument(s) to the generic.
+
+''');
+  }
+
+  test_inference_hints() async {
+    Source source = addSource(r'''
+      void main () {
+        var x = 3;
+        List<int> l0 = [];
+     }
+   ''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_inference_simplePolymorphicRecursion_function() async {
+    // Regression test for https://github.com/dart-lang/sdk/issues/30980
+    // Check that inference works properly when inferring the type argument
+    // for a self-recursive call with a function type
+    var source = addSource(r'''
+void _mergeSort<T>(T Function(T) list, int compare(T a, T b), T Function(T) target) {
+  _mergeSort(list, compare, target);
+  _mergeSort(list, compare, list);
+  _mergeSort(target, compare, target);
+  _mergeSort(target, compare, list);
+}
+    ''');
+    var analysisResult = await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+    var unit = analysisResult.unit;
+    var body = (AstFinder.getTopLevelFunction(unit, '_mergeSort')
+        .functionExpression
+        .body as BlockFunctionBody);
+    var stmts = body.block.statements;
+    for (ExpressionStatement stmt in stmts) {
+      MethodInvocation invoke = stmt.expression;
+      ParameterizedType fType = invoke.staticInvokeType;
+      expect(fType.typeArguments[0].toString(), 'T');
+    }
+  }
+
+  test_inference_simplePolymorphicRecursion_interface() async {
+    // Regression test for https://github.com/dart-lang/sdk/issues/30980
+    // Check that inference works properly when inferring the type argument
+    // for a self-recursive call with an interface type
+    var source = addSource(r'''
+void _mergeSort<T>(List<T> list, int compare(T a, T b), List<T> target) {
+  _mergeSort(list, compare, target);
+  _mergeSort(list, compare, list);
+  _mergeSort(target, compare, target);
+  _mergeSort(target, compare, list);
+}
+    ''');
+    var analysisResult = await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+    var unit = analysisResult.unit;
+    var body = (AstFinder.getTopLevelFunction(unit, '_mergeSort')
+        .functionExpression
+        .body as BlockFunctionBody);
+    var stmts = body.block.statements;
+    for (ExpressionStatement stmt in stmts) {
+      MethodInvocation invoke = stmt.expression;
+      ParameterizedType fType = invoke.staticInvokeType;
+      expect(fType.typeArguments[0].toString(), 'T');
+    }
+  }
+
+  test_inference_simplePolymorphicRecursion_simple() async {
+    // Regression test for https://github.com/dart-lang/sdk/issues/30980
+    // Check that inference works properly when inferring the type argument
+    // for a self-recursive call with a simple type parameter
+    var source = addSource(r'''
+void _mergeSort<T>(T list, int compare(T a, T b), T target) {
+  _mergeSort(list, compare, target);
+  _mergeSort(list, compare, list);
+  _mergeSort(target, compare, target);
+  _mergeSort(target, compare, list);
+}
+    ''');
+    var analysisResult = await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+    var unit = analysisResult.unit;
+    var body = (AstFinder.getTopLevelFunction(unit, '_mergeSort')
+        .functionExpression
+        .body as BlockFunctionBody);
+    var stmts = body.block.statements;
+    for (ExpressionStatement stmt in stmts) {
+      MethodInvocation invoke = stmt.expression;
+      ParameterizedType fType = invoke.staticInvokeType;
+      expect(fType.typeArguments[0].toString(), 'T');
+    }
+  }
+
+  test_inferGenericInstantiation() async {
+    // Verify that we don't infer '?` when we instantiate a generic function.
+    var source = addSource(r'''
+T f<T>(T x(T t)) => x(null);
+S g<S>(S s) => s;
+test() {
+ var h = f(g);
+}
+    ''');
+    var analysisResult = await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+    var unit = analysisResult.unit;
+    var h = (AstFinder.getStatementsInTopLevelFunction(unit, "test")[0]
+            as VariableDeclarationStatement)
+        .variables
+        .variables[0];
+    _isDynamic(h.declaredElement.type);
+    var fCall = h.initializer as MethodInvocation;
+    expect(
+        fCall.staticInvokeType.toString(), '((dynamic) → dynamic) → dynamic');
+    var g = fCall.argumentList.arguments[0];
+    expect(g.staticType.toString(), '(dynamic) → dynamic');
+  }
+
+  test_inferGenericInstantiation2() async {
+    // Verify the behavior when we cannot infer an instantiation due to invalid
+    // constraints from an outer generic method.
+    var source = addSource(r'''
+T max<T extends num>(T x, T y) => x < y ? y : x;
+abstract class Iterable<T> {
+  T get first;
+  S fold<S>(S s, S f(S s, T t));
+}
+num test(Iterable values) => values.fold(values.first as num, max);
+    ''');
+    var analysisResult = await computeAnalysisResult(source);
+    assertErrors(source, [
+      StrongModeCode.COULD_NOT_INFER,
+      StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE
+    ]);
+    verify([source]);
+    var unit = analysisResult.unit;
+    var fold = (AstFinder.getTopLevelFunction(unit, 'test')
+            .functionExpression
+            .body as ExpressionFunctionBody)
+        .expression as MethodInvocation;
+    expect(
+        fold.staticInvokeType.toString(), '(num, (num, dynamic) → num) → num');
+    var max = fold.argumentList.arguments[1];
+    // TODO(jmesserly): arguably (num, num) → num is better here.
+    expect(max.staticType.toString(), '(dynamic, dynamic) → dynamic');
+  }
+
+  test_inferredFieldDeclaration_propagation() async {
+    // Regression test for https://github.com/dart-lang/sdk/issues/25546
+    String code = r'''
+      abstract class A {
+        Map<int, List<int>> get map;
+      }
+      class B extends A {
+        var map = { 42: [] };
+      }
+      class C extends A {
+        get map => { 43: [] };
+      }
+   ''';
+    CompilationUnit unit = await resolveSource(code);
+
+    Asserter<InterfaceType> assertListOfInt = _isListOf(_isInt);
+    Asserter<InterfaceType> assertMapOfIntToListOfInt =
+        _isMapOf(_isInt, (DartType type) => assertListOfInt(type));
+
+    VariableDeclaration mapB = AstFinder.getFieldInClass(unit, "B", "map");
+    MethodDeclaration mapC = AstFinder.getMethodInClass(unit, "C", "map");
+    assertMapOfIntToListOfInt(
+        resolutionMap.elementDeclaredByVariableDeclaration(mapB).type);
+    assertMapOfIntToListOfInt(
+        resolutionMap.elementDeclaredByMethodDeclaration(mapC).returnType);
+
+    MapLiteral mapLiteralB = mapB.initializer;
+    MapLiteral mapLiteralC = (mapC.body as ExpressionFunctionBody).expression;
+    assertMapOfIntToListOfInt(mapLiteralB.staticType);
+    assertMapOfIntToListOfInt(mapLiteralC.staticType);
+
+    ListLiteral listLiteralB = mapLiteralB.entries[0].value;
+    ListLiteral listLiteralC = mapLiteralC.entries[0].value;
+    assertListOfInt(listLiteralB.staticType);
+    assertListOfInt(listLiteralC.staticType);
+  }
+
+  test_instanceCreation() async {
+    String code = r'''
+      class A<S, T> {
+        S x;
+        T y;
+        A(this.x, this.y);
+        A.named(this.x, this.y);
+      }
+
+      class B<S, T> extends A<T, S> {
+        B(S y, T x) : super(x, y);
+        B.named(S y, T x) : super.named(x, y);
+      }
+
+      class C<S> extends B<S, S> {
+        C(S a) : super(a, a);
+        C.named(S a) : super.named(a, a);
+      }
+
+      class D<S, T> extends B<T, int> {
+        D(T a) : super(a, 3);
+        D.named(T a) : super.named(a, 3);
+      }
+
+      class E<S, T> extends A<C<S>, T> {
+        E(T a) : super(null, a);
+      }
+
+      class F<S, T> extends A<S, T> {
+        F(S x, T y, {List<S> a, List<T> b}) : super(x, y);
+        F.named(S x, T y, [S a, T b]) : super(a, b);
+      }
+
+      void test0() {
+        A<int, String> a0 = new A(3, "hello");
+        A<int, String> a1 = new A.named(3, "hello");
+        A<int, String> a2 = new A<int, String>(3, "hello");
+        A<int, String> a3 = new A<int, String>.named(3, "hello");
+        A<int, String> a4 = new A<int, dynamic>(3, "hello");
+        A<int, String> a5 = new A<dynamic, dynamic>.named(3, "hello");
+      }
+      void test1()  {
+        A<int, String> a0 = new A("hello", 3);
+        A<int, String> a1 = new A.named("hello", 3);
+      }
+      void test2() {
+        A<int, String> a0 = new B("hello", 3);
+        A<int, String> a1 = new B.named("hello", 3);
+        A<int, String> a2 = new B<String, int>("hello", 3);
+        A<int, String> a3 = new B<String, int>.named("hello", 3);
+        A<int, String> a4 = new B<String, dynamic>("hello", 3);
+        A<int, String> a5 = new B<dynamic, dynamic>.named("hello", 3);
+      }
+      void test3() {
+        A<int, String> a0 = new B(3, "hello");
+        A<int, String> a1 = new B.named(3, "hello");
+      }
+      void test4() {
+        A<int, int> a0 = new C(3);
+        A<int, int> a1 = new C.named(3);
+        A<int, int> a2 = new C<int>(3);
+        A<int, int> a3 = new C<int>.named(3);
+        A<int, int> a4 = new C<dynamic>(3);
+        A<int, int> a5 = new C<dynamic>.named(3);
+      }
+      void test5() {
+        A<int, int> a0 = new C("hello");
+        A<int, int> a1 = new C.named("hello");
+      }
+      void test6()  {
+        A<int, String> a0 = new D("hello");
+        A<int, String> a1 = new D.named("hello");
+        A<int, String> a2 = new D<int, String>("hello");
+        A<int, String> a3 = new D<String, String>.named("hello");
+        A<int, String> a4 = new D<num, dynamic>("hello");
+        A<int, String> a5 = new D<dynamic, dynamic>.named("hello");
+      }
+      void test7() {
+        A<int, String> a0 = new D(3);
+        A<int, String> a1 = new D.named(3);
+      }
+      void test8() {
+        A<C<int>, String> a0 = new E("hello");
+      }
+      void test9() { // Check named and optional arguments
+        A<int, String> a0 = new F(3, "hello", a: [3], b: ["hello"]);
+        A<int, String> a1 = new F(3, "hello", a: ["hello"], b:[3]);
+        A<int, String> a2 = new F.named(3, "hello", 3, "hello");
+        A<int, String> a3 = new F.named(3, "hello");
+        A<int, String> a4 = new F.named(3, "hello", "hello", 3);
+        A<int, String> a5 = new F.named(3, "hello", "hello");
+      }''';
+    CompilationUnit unit = await resolveSource(code);
+
+    Expression rhs(VariableDeclarationStatement stmt) {
+      VariableDeclaration decl = stmt.variables.variables[0];
+      Expression exp = decl.initializer;
+      return exp;
+    }
+
+    void hasType(Asserter<DartType> assertion, Expression exp) =>
+        assertion(exp.staticType);
+
+    Element elementA = AstFinder.getClass(unit, "A").declaredElement;
+    Element elementB = AstFinder.getClass(unit, "B").declaredElement;
+    Element elementC = AstFinder.getClass(unit, "C").declaredElement;
+    Element elementD = AstFinder.getClass(unit, "D").declaredElement;
+    Element elementE = AstFinder.getClass(unit, "E").declaredElement;
+    Element elementF = AstFinder.getClass(unit, "F").declaredElement;
+
+    AsserterBuilder<List<Asserter<DartType>>, DartType> assertAOf =
+        _isInstantiationOf(_hasElement(elementA));
+    AsserterBuilder<List<Asserter<DartType>>, DartType> assertBOf =
+        _isInstantiationOf(_hasElement(elementB));
+    AsserterBuilder<List<Asserter<DartType>>, DartType> assertCOf =
+        _isInstantiationOf(_hasElement(elementC));
+    AsserterBuilder<List<Asserter<DartType>>, DartType> assertDOf =
+        _isInstantiationOf(_hasElement(elementD));
+    AsserterBuilder<List<Asserter<DartType>>, DartType> assertEOf =
+        _isInstantiationOf(_hasElement(elementE));
+    AsserterBuilder<List<Asserter<DartType>>, DartType> assertFOf =
+        _isInstantiationOf(_hasElement(elementF));
+
+    {
+      List<Statement> statements =
+          AstFinder.getStatementsInTopLevelFunction(unit, "test0");
+
+      hasType(assertAOf([_isInt, _isString]), rhs(statements[0]));
+      hasType(assertAOf([_isInt, _isString]), rhs(statements[0]));
+      hasType(assertAOf([_isInt, _isString]), rhs(statements[1]));
+      hasType(assertAOf([_isInt, _isString]), rhs(statements[2]));
+      hasType(assertAOf([_isInt, _isString]), rhs(statements[3]));
+      hasType(assertAOf([_isInt, _isDynamic]), rhs(statements[4]));
+      hasType(assertAOf([_isDynamic, _isDynamic]), rhs(statements[5]));
+    }
+
+    {
+      List<Statement> statements =
+          AstFinder.getStatementsInTopLevelFunction(unit, "test1");
+      hasType(assertAOf([_isInt, _isString]), rhs(statements[0]));
+      hasType(assertAOf([_isInt, _isString]), rhs(statements[1]));
+    }
+
+    {
+      List<Statement> statements =
+          AstFinder.getStatementsInTopLevelFunction(unit, "test2");
+      hasType(assertBOf([_isString, _isInt]), rhs(statements[0]));
+      hasType(assertBOf([_isString, _isInt]), rhs(statements[1]));
+      hasType(assertBOf([_isString, _isInt]), rhs(statements[2]));
+      hasType(assertBOf([_isString, _isInt]), rhs(statements[3]));
+      hasType(assertBOf([_isString, _isDynamic]), rhs(statements[4]));
+      hasType(assertBOf([_isDynamic, _isDynamic]), rhs(statements[5]));
+    }
+
+    {
+      List<Statement> statements =
+          AstFinder.getStatementsInTopLevelFunction(unit, "test3");
+      hasType(assertBOf([_isString, _isInt]), rhs(statements[0]));
+      hasType(assertBOf([_isString, _isInt]), rhs(statements[1]));
+    }
+
+    {
+      List<Statement> statements =
+          AstFinder.getStatementsInTopLevelFunction(unit, "test4");
+      hasType(assertCOf([_isInt]), rhs(statements[0]));
+      hasType(assertCOf([_isInt]), rhs(statements[1]));
+      hasType(assertCOf([_isInt]), rhs(statements[2]));
+      hasType(assertCOf([_isInt]), rhs(statements[3]));
+      hasType(assertCOf([_isDynamic]), rhs(statements[4]));
+      hasType(assertCOf([_isDynamic]), rhs(statements[5]));
+    }
+
+    {
+      List<Statement> statements =
+          AstFinder.getStatementsInTopLevelFunction(unit, "test5");
+      hasType(assertCOf([_isInt]), rhs(statements[0]));
+      hasType(assertCOf([_isInt]), rhs(statements[1]));
+    }
+
+    {
+      // The first type parameter is not constrained by the
+      // context.  We could choose a tighter type, but currently
+      // we just use dynamic.
+      List<Statement> statements =
+          AstFinder.getStatementsInTopLevelFunction(unit, "test6");
+      hasType(assertDOf([_isDynamic, _isString]), rhs(statements[0]));
+      hasType(assertDOf([_isDynamic, _isString]), rhs(statements[1]));
+      hasType(assertDOf([_isInt, _isString]), rhs(statements[2]));
+      hasType(assertDOf([_isString, _isString]), rhs(statements[3]));
+      hasType(assertDOf([_isNum, _isDynamic]), rhs(statements[4]));
+      hasType(assertDOf([_isDynamic, _isDynamic]), rhs(statements[5]));
+    }
+
+    {
+      List<Statement> statements =
+          AstFinder.getStatementsInTopLevelFunction(unit, "test7");
+      hasType(assertDOf([_isDynamic, _isString]), rhs(statements[0]));
+      hasType(assertDOf([_isDynamic, _isString]), rhs(statements[1]));
+    }
+
+    {
+      List<Statement> statements =
+          AstFinder.getStatementsInTopLevelFunction(unit, "test8");
+      hasType(assertEOf([_isInt, _isString]), rhs(statements[0]));
+    }
+
+    {
+      List<Statement> statements =
+          AstFinder.getStatementsInTopLevelFunction(unit, "test9");
+      hasType(assertFOf([_isInt, _isString]), rhs(statements[0]));
+      hasType(assertFOf([_isInt, _isString]), rhs(statements[1]));
+      hasType(assertFOf([_isInt, _isString]), rhs(statements[2]));
+      hasType(assertFOf([_isInt, _isString]), rhs(statements[3]));
+      hasType(assertFOf([_isInt, _isString]), rhs(statements[4]));
+      hasType(assertFOf([_isInt, _isString]), rhs(statements[5]));
+    }
+  }
+
+  test_listLiteral_nested() async {
+    String code = r'''
+      void main () {
+        List<List<int>> l0 = [[]];
+        Iterable<List<int>> l1 = [[3]];
+        Iterable<List<int>> l2 = [[3], [4]];
+        List<List<int>> l3 = [["hello", 3], []];
+     }
+   ''';
+    CompilationUnit unit = await resolveSource(code);
+    List<Statement> statements =
+        AstFinder.getStatementsInTopLevelFunction(unit, "main");
+    ListLiteral literal(int i) {
+      VariableDeclarationStatement stmt = statements[i];
+      VariableDeclaration decl = stmt.variables.variables[0];
+      ListLiteral exp = decl.initializer;
+      return exp;
+    }
+
+    Asserter<InterfaceType> assertListOfInt = _isListOf(_isInt);
+    Asserter<InterfaceType> assertListOfListOfInt =
+        _isListOf((DartType type) => assertListOfInt(type));
+
+    assertListOfListOfInt(literal(0).staticType);
+    assertListOfListOfInt(literal(1).staticType);
+    assertListOfListOfInt(literal(2).staticType);
+    assertListOfListOfInt(literal(3).staticType);
+
+    assertListOfInt(literal(1).elements[0].staticType);
+    assertListOfInt(literal(2).elements[0].staticType);
+    assertListOfInt(literal(3).elements[0].staticType);
+  }
+
+  test_listLiteral_simple() async {
+    String code = r'''
+      void main () {
+        List<int> l0 = [];
+        List<int> l1 = [3];
+        List<int> l2 = ["hello"];
+        List<int> l3 = ["hello", 3];
+     }
+   ''';
+    CompilationUnit unit = await resolveSource(code);
+    List<Statement> statements =
+        AstFinder.getStatementsInTopLevelFunction(unit, "main");
+    DartType literal(int i) {
+      VariableDeclarationStatement stmt = statements[i];
+      VariableDeclaration decl = stmt.variables.variables[0];
+      ListLiteral exp = decl.initializer;
+      return exp.staticType;
+    }
+
+    Asserter<InterfaceType> assertListOfInt = _isListOf(_isInt);
+
+    assertListOfInt(literal(0));
+    assertListOfInt(literal(1));
+    assertListOfInt(literal(2));
+    assertListOfInt(literal(3));
+  }
+
+  test_listLiteral_simple_const() async {
+    String code = r'''
+      void main () {
+        const List<int> c0 = const [];
+        const List<int> c1 = const [3];
+        const List<int> c2 = const ["hello"];
+        const List<int> c3 = const ["hello", 3];
+     }
+   ''';
+    CompilationUnit unit = await resolveSource(code);
+    List<Statement> statements =
+        AstFinder.getStatementsInTopLevelFunction(unit, "main");
+    DartType literal(int i) {
+      VariableDeclarationStatement stmt = statements[i];
+      VariableDeclaration decl = stmt.variables.variables[0];
+      ListLiteral exp = decl.initializer;
+      return exp.staticType;
+    }
+
+    Asserter<InterfaceType> assertListOfInt = _isListOf(_isInt);
+
+    assertListOfInt(literal(0));
+    assertListOfInt(literal(1));
+    assertListOfInt(literal(2));
+    assertListOfInt(literal(3));
+  }
+
+  test_listLiteral_simple_disabled() async {
+    String code = r'''
+      void main () {
+        List<int> l0 = <num>[];
+        List<int> l1 = <num>[3];
+        List<int> l2 = <String>["hello"];
+        List<int> l3 = <dynamic>["hello", 3];
+     }
+   ''';
+    CompilationUnit unit = await resolveSource(code);
+    List<Statement> statements =
+        AstFinder.getStatementsInTopLevelFunction(unit, "main");
+    DartType literal(int i) {
+      VariableDeclarationStatement stmt = statements[i];
+      VariableDeclaration decl = stmt.variables.variables[0];
+      ListLiteral exp = decl.initializer;
+      return exp.staticType;
+    }
+
+    _isListOf(_isNum)(literal(0));
+    _isListOf(_isNum)(literal(1));
+    _isListOf(_isString)(literal(2));
+    _isListOf(_isDynamic)(literal(3));
+  }
+
+  test_listLiteral_simple_subtype() async {
+    String code = r'''
+      void main () {
+        Iterable<int> l0 = [];
+        Iterable<int> l1 = [3];
+        Iterable<int> l2 = ["hello"];
+        Iterable<int> l3 = ["hello", 3];
+     }
+   ''';
+    CompilationUnit unit = await resolveSource(code);
+    List<Statement> statements =
+        AstFinder.getStatementsInTopLevelFunction(unit, "main");
+    DartType literal(int i) {
+      VariableDeclarationStatement stmt = statements[i];
+      VariableDeclaration decl = stmt.variables.variables[0];
+      ListLiteral exp = decl.initializer;
+      return exp.staticType;
+    }
+
+    Asserter<InterfaceType> assertListOfInt = _isListOf(_isInt);
+
+    assertListOfInt(literal(0));
+    assertListOfInt(literal(1));
+    assertListOfInt(literal(2));
+    assertListOfInt(literal(3));
+  }
+
+  test_mapLiteral_nested() async {
+    String code = r'''
+      void main () {
+        Map<int, List<String>> l0 = {};
+        Map<int, List<String>> l1 = {3: ["hello"]};
+        Map<int, List<String>> l2 = {"hello": ["hello"]};
+        Map<int, List<String>> l3 = {3: [3]};
+        Map<int, List<String>> l4 = {3:["hello"], "hello": [3]};
+     }
+   ''';
+    CompilationUnit unit = await resolveSource(code);
+    List<Statement> statements =
+        AstFinder.getStatementsInTopLevelFunction(unit, "main");
+    MapLiteral literal(int i) {
+      VariableDeclarationStatement stmt = statements[i];
+      VariableDeclaration decl = stmt.variables.variables[0];
+      MapLiteral exp = decl.initializer;
+      return exp;
+    }
+
+    Asserter<InterfaceType> assertListOfString = _isListOf(_isString);
+    Asserter<InterfaceType> assertMapOfIntToListOfString =
+        _isMapOf(_isInt, (DartType type) => assertListOfString(type));
+
+    assertMapOfIntToListOfString(literal(0).staticType);
+    assertMapOfIntToListOfString(literal(1).staticType);
+    assertMapOfIntToListOfString(literal(2).staticType);
+    assertMapOfIntToListOfString(literal(3).staticType);
+    assertMapOfIntToListOfString(literal(4).staticType);
+
+    assertListOfString(literal(1).entries[0].value.staticType);
+    assertListOfString(literal(2).entries[0].value.staticType);
+    assertListOfString(literal(3).entries[0].value.staticType);
+    assertListOfString(literal(4).entries[0].value.staticType);
+  }
+
+  test_mapLiteral_simple() async {
+    String code = r'''
+      void main () {
+        Map<int, String> l0 = {};
+        Map<int, String> l1 = {3: "hello"};
+        Map<int, String> l2 = {"hello": "hello"};
+        Map<int, String> l3 = {3: 3};
+        Map<int, String> l4 = {3:"hello", "hello": 3};
+     }
+   ''';
+    CompilationUnit unit = await resolveSource(code);
+    List<Statement> statements =
+        AstFinder.getStatementsInTopLevelFunction(unit, "main");
+    DartType literal(int i) {
+      VariableDeclarationStatement stmt = statements[i];
+      VariableDeclaration decl = stmt.variables.variables[0];
+      MapLiteral exp = decl.initializer;
+      return exp.staticType;
+    }
+
+    Asserter<InterfaceType> assertMapOfIntToString =
+        _isMapOf(_isInt, _isString);
+
+    assertMapOfIntToString(literal(0));
+    assertMapOfIntToString(literal(1));
+    assertMapOfIntToString(literal(2));
+    assertMapOfIntToString(literal(3));
+  }
+
+  test_mapLiteral_simple_disabled() async {
+    String code = r'''
+      void main () {
+        Map<int, String> l0 = <int, dynamic>{};
+        Map<int, String> l1 = <int, dynamic>{3: "hello"};
+        Map<int, String> l2 = <int, dynamic>{"hello": "hello"};
+        Map<int, String> l3 = <int, dynamic>{3: 3};
+     }
+   ''';
+    CompilationUnit unit = await resolveSource(code);
+    List<Statement> statements =
+        AstFinder.getStatementsInTopLevelFunction(unit, "main");
+    DartType literal(int i) {
+      VariableDeclarationStatement stmt = statements[i];
+      VariableDeclaration decl = stmt.variables.variables[0];
+      MapLiteral exp = decl.initializer;
+      return exp.staticType;
+    }
+
+    Asserter<InterfaceType> assertMapOfIntToDynamic =
+        _isMapOf(_isInt, _isDynamic);
+
+    assertMapOfIntToDynamic(literal(0));
+    assertMapOfIntToDynamic(literal(1));
+    assertMapOfIntToDynamic(literal(2));
+    assertMapOfIntToDynamic(literal(3));
+  }
+
+  test_methodDeclaration_body_propagation() async {
+    String code = r'''
+      class A {
+        List<String> m0(int x) => ["hello"];
+        List<String> m1(int x) {return [3];}
+      }
+   ''';
+    CompilationUnit unit = await resolveSource(code);
+    Expression methodReturnValue(String methodName) {
+      MethodDeclaration method =
+          AstFinder.getMethodInClass(unit, "A", methodName);
+      FunctionBody body = method.body;
+      if (body is ExpressionFunctionBody) {
+        return body.expression;
+      } else {
+        Statement stmt = (body as BlockFunctionBody).block.statements[0];
+        return (stmt as ReturnStatement).expression;
+      }
+    }
+
+    Asserter<InterfaceType> assertListOfString = _isListOf(_isString);
+    assertListOfString(methodReturnValue("m0").staticType);
+    assertListOfString(methodReturnValue("m1").staticType);
+  }
+
+  test_partialTypes1() async {
+    // Test that downwards inference with a partial type
+    // correctly uses the partial information to fill in subterm
+    // types
+    String code = r'''
+    typedef To Func1<From, To>(From x);
+    S f<S, T>(Func1<S, T> g) => null;
+    String test() => f((l) => l.length);
+   ''';
+    Source source = addSource(code);
+    TestAnalysisResult analysisResult = await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+    CompilationUnit unit = analysisResult.unit;
+    FunctionDeclaration test = AstFinder.getTopLevelFunction(unit, "test");
+    ExpressionFunctionBody body = test.functionExpression.body;
+    _isString(body.expression.staticType);
+    MethodInvocation invoke = body.expression;
+    FunctionExpression function = invoke.argumentList.arguments[0];
+    ExecutableElement f0 = function.declaredElement;
+    FunctionType type = f0.type;
+    _isFunction2Of(_isString, _isInt)(type);
+  }
+
+  test_pinning_multipleConstraints1() async {
+    // Test that downwards inference with two different downwards covariant
+    // constraints on the same parameter correctly fails to infer when
+    // the types do not share a common subtype
+    String code = r'''
+    class A<S, T> {
+      S s;
+      T t;
+    }
+    class B<S> extends A<S, S> { B(S s); }
+    A<int, String> test() => new B(3);
+   ''';
+    Source source = addSource(code);
+    TestAnalysisResult analysisResult = await computeAnalysisResult(source);
+    assertErrors(source, [StrongModeCode.INVALID_CAST_LITERAL]);
+    verify([source]);
+    CompilationUnit unit = analysisResult.unit;
+    FunctionDeclaration test = AstFinder.getTopLevelFunction(unit, "test");
+    ExpressionFunctionBody body = test.functionExpression.body;
+    DartType type = body.expression.staticType;
+
+    Element elementB = AstFinder.getClass(unit, "B").declaredElement;
+
+    _isInstantiationOf(_hasElement(elementB))([_isNull])(type);
+  }
+
+  test_pinning_multipleConstraints2() async {
+    // Test that downwards inference with two identical downwards covariant
+    // constraints on the same parameter correctly infers and pins the type
+    String code = r'''
+    class A<S, T> {
+      S s;
+      T t;
+    }
+    class B<S> extends A<S, S> { B(S s); }
+    A<num, num> test() => new B(3);
+   ''';
+    Source source = addSource(code);
+    TestAnalysisResult analysisResult = await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+    CompilationUnit unit = analysisResult.unit;
+    FunctionDeclaration test = AstFinder.getTopLevelFunction(unit, "test");
+    ExpressionFunctionBody body = test.functionExpression.body;
+    DartType type = body.expression.staticType;
+
+    Element elementB = AstFinder.getClass(unit, "B").declaredElement;
+
+    _isInstantiationOf(_hasElement(elementB))([_isNum])(type);
+  }
+
+  test_pinning_multipleConstraints3() async {
+    // Test that downwards inference with two different downwards covariant
+    // constraints on the same parameter correctly fails to infer when
+    // the types do not share a common subtype, but do share a common supertype
+    String code = r'''
+    class A<S, T> {
+      S s;
+      T t;
+    }
+    class B<S> extends A<S, S> { B(S s); }
+    A<int, double> test() => new B(3);
+   ''';
+    Source source = addSource(code);
+    TestAnalysisResult analysisResult = await computeAnalysisResult(source);
+    assertErrors(source, [
+      StrongModeCode.INVALID_CAST_LITERAL,
+    ]);
+    verify([source]);
+    CompilationUnit unit = analysisResult.unit;
+    FunctionDeclaration test = AstFinder.getTopLevelFunction(unit, "test");
+    ExpressionFunctionBody body = test.functionExpression.body;
+    DartType type = body.expression.staticType;
+
+    Element elementB = AstFinder.getClass(unit, "B").declaredElement;
+
+    _isInstantiationOf(_hasElement(elementB))([_isNull])(type);
+  }
+
+  test_pinning_multipleConstraints4() async {
+    // Test that downwards inference with two subtype related downwards
+    // covariant constraints on the same parameter correctly infers and pins
+    // the type
+    String code = r'''
+    class A<S, T> {
+      S s;
+      T t;
+    }
+    class B<S> extends A<S, S> {}
+    A<int, num> test() => new B();
+   ''';
+    Source source = addSource(code);
+    TestAnalysisResult analysisResult = await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+    CompilationUnit unit = analysisResult.unit;
+    FunctionDeclaration test = AstFinder.getTopLevelFunction(unit, "test");
+    ExpressionFunctionBody body = test.functionExpression.body;
+    DartType type = body.expression.staticType;
+
+    Element elementB = AstFinder.getClass(unit, "B").declaredElement;
+
+    _isInstantiationOf(_hasElement(elementB))([_isInt])(type);
+  }
+
+  test_pinning_multipleConstraints_contravariant1() async {
+    // Test that downwards inference with two different downwards contravariant
+    // constraints on the same parameter chooses the upper bound
+    // when the only supertype is Object
+    String code = r'''
+    class A<S, T> {
+      S s;
+      T t;
+    }
+    class B<S> extends A<S, S> {}
+    typedef void Contra1<T>(T x);
+    Contra1<A<S, S>> mkA<S>() => (A<S, S> x) {};
+    Contra1<A<int, String>> test() => mkA();
+   ''';
+    Source source = addSource(code);
+    TestAnalysisResult analysisResult = await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+    CompilationUnit unit = analysisResult.unit;
+    FunctionDeclaration test = AstFinder.getTopLevelFunction(unit, "test");
+    ExpressionFunctionBody body = test.functionExpression.body;
+    FunctionType functionType = body.expression.staticType;
+    DartType type = functionType.normalParameterTypes[0];
+
+    Element elementA = AstFinder.getClass(unit, "A").declaredElement;
+
+    _isInstantiationOf(_hasElement(elementA))([_isObject, _isObject])(type);
+  }
+
+  test_pinning_multipleConstraints_contravariant2() async {
+    // Test that downwards inference with two identical downwards contravariant
+    // constraints on the same parameter correctly pins the type
+    String code = r'''
+    class A<S, T> {
+      S s;
+      T t;
+    }
+    class B<S> extends A<S, S> {}
+    typedef void Contra1<T>(T x);
+    Contra1<A<S, S>> mkA<S>() => (A<S, S> x) {};
+    Contra1<A<num, num>> test() => mkA();
+   ''';
+    Source source = addSource(code);
+    TestAnalysisResult analysisResult = await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+    CompilationUnit unit = analysisResult.unit;
+    FunctionDeclaration test = AstFinder.getTopLevelFunction(unit, "test");
+    ExpressionFunctionBody body = test.functionExpression.body;
+    FunctionType functionType = body.expression.staticType;
+    DartType type = functionType.normalParameterTypes[0];
+
+    Element elementA = AstFinder.getClass(unit, "A").declaredElement;
+
+    _isInstantiationOf(_hasElement(elementA))([_isNum, _isNum])(type);
+  }
+
+  test_pinning_multipleConstraints_contravariant3() async {
+    // Test that downwards inference with two different downwards contravariant
+    // constraints on the same parameter correctly choose the least upper bound
+    // when they share a common supertype
+    String code = r'''
+    class A<S, T> {
+      S s;
+      T t;
+    }
+    class B<S> extends A<S, S> {}
+    typedef void Contra1<T>(T x);
+    Contra1<A<S, S>> mkA<S>() => (A<S, S> x) {};
+    Contra1<A<int, double>> test() => mkA();
+   ''';
+    Source source = addSource(code);
+    TestAnalysisResult analysisResult = await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+    CompilationUnit unit = analysisResult.unit;
+    FunctionDeclaration test = AstFinder.getTopLevelFunction(unit, "test");
+    ExpressionFunctionBody body = test.functionExpression.body;
+    FunctionType functionType = body.expression.staticType;
+    DartType type = functionType.normalParameterTypes[0];
+
+    Element elementA = AstFinder.getClass(unit, "A").declaredElement;
+
+    _isInstantiationOf(_hasElement(elementA))([_isNum, _isNum])(type);
+  }
+
+  test_pinning_multipleConstraints_contravariant4() async {
+    // Test that downwards inference with two different downwards contravariant
+    // constraints on the same parameter correctly choose the least upper bound
+    // when one is a subtype of the other
+    String code = r'''
+    class A<S, T> {
+      S s;
+      T t;
+    }
+    class B<S> extends A<S, S> {}
+    typedef void Contra1<T>(T x);
+    Contra1<A<S, S>> mkA<S>() => (A<S, S> x) {};
+    Contra1<A<int, num>> test() => mkA();
+   ''';
+    Source source = addSource(code);
+    TestAnalysisResult analysisResult = await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+    CompilationUnit unit = analysisResult.unit;
+    FunctionDeclaration test = AstFinder.getTopLevelFunction(unit, "test");
+    ExpressionFunctionBody body = test.functionExpression.body;
+    FunctionType functionType = body.expression.staticType;
+    DartType type = functionType.normalParameterTypes[0];
+
+    Element elementA = AstFinder.getClass(unit, "A").declaredElement;
+
+    _isInstantiationOf(_hasElement(elementA))([_isNum, _isNum])(type);
+  }
+
+  test_redirectedConstructor_named() async {
+    Source source = addSource(r'''
+class A<T, U> implements B<T, U> {
+  A.named();
+}
+
+class B<T2, U2> {
+  factory B() = A.named;
+}
+   ''');
+    TestAnalysisResult result = await computeAnalysisResult(source);
+    assertNoErrors(source);
+
+    ClassDeclaration b = result.unit.declarations[1];
+    ConstructorDeclaration bConstructor = b.members[0];
+    ConstructorName redirected = bConstructor.redirectedConstructor;
+
+    TypeName typeName = redirected.type;
+    expect(typeName.type.toString(), 'A<T2, U2>');
+    expect(typeName.type.toString(), 'A<T2, U2>');
+
+    var constructorMember = redirected.staticElement;
+    expect(constructorMember.toString(), 'A.named() → A<T2, U2>');
+    expect(redirected.name.staticElement, constructorMember);
+  }
+
+  test_redirectedConstructor_self() async {
+    Source source = addSource(r'''
+class A<T> {
+  A();
+  factory A.redirected() = A;
+}
+   ''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+  }
+
+  test_redirectedConstructor_unnamed() async {
+    Source source = addSource(r'''
+class A<T, U> implements B<T, U> {
+  A();
+}
+
+class B<T2, U2> {
+  factory B() = A;
+}
+   ''');
+    TestAnalysisResult result = await computeAnalysisResult(source);
+    assertNoErrors(source);
+
+    ClassDeclaration b = result.unit.declarations[1];
+    ConstructorDeclaration bConstructor = b.members[0];
+    ConstructorName redirected = bConstructor.redirectedConstructor;
+
+    TypeName typeName = redirected.type;
+    expect(typeName.type.toString(), 'A<T2, U2>');
+    expect(typeName.type.toString(), 'A<T2, U2>');
+
+    expect(redirected.name, isNull);
+    expect(redirected.staticElement.toString(), 'A() → A<T2, U2>');
+  }
+
+  test_redirectingConstructor_propagation() async {
+    String code = r'''
+      class A {
+        A() : this.named([]);
+        A.named(List<String> x);
+      }
+   ''';
+    CompilationUnit unit = await resolveSource(code);
+
+    ConstructorDeclaration constructor =
+        AstFinder.getConstructorInClass(unit, "A", null);
+    RedirectingConstructorInvocation invocation = constructor.initializers[0];
+    Expression exp = invocation.argumentList.arguments[0];
+    _isListOf(_isString)(exp.staticType);
+  }
+
+  test_returnType_variance1() async {
+    // Check that downwards inference correctly pins a type parameter
+    // when the parameter is constrained in a contravariant position
+    String code = r'''
+    typedef To Func1<From, To>(From x);
+    Func1<T, String> f<T>(T x) => null;
+    Func1<num, String> test() => f(42);
+   ''';
+    Source source = addSource(code);
+    TestAnalysisResult analysisResult = await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+    CompilationUnit unit = analysisResult.unit;
+    FunctionDeclaration test = AstFinder.getTopLevelFunction(unit, "test");
+    ExpressionFunctionBody body = test.functionExpression.body;
+    MethodInvocation invoke = body.expression;
+    _isFunction2Of(_isNum, _isFunction2Of(_isNum, _isString))(
+        invoke.staticInvokeType);
+  }
+
+  test_returnType_variance2() async {
+    // Check that downwards inference correctly pins a type parameter
+    // when the parameter is constrained in a covariant position
+    String code = r'''
+    typedef To Func1<From, To>(From x);
+    Func1<String, T> f<T>(T x) => null;
+    Func1<String, num> test() => f(42);
+   ''';
+    Source source = addSource(code);
+    TestAnalysisResult analysisResult = await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+    CompilationUnit unit = analysisResult.unit;
+    FunctionDeclaration test = AstFinder.getTopLevelFunction(unit, "test");
+    ExpressionFunctionBody body = test.functionExpression.body;
+    MethodInvocation invoke = body.expression;
+    _isFunction2Of(_isNum, _isFunction2Of(_isString, _isNum))(
+        invoke.staticInvokeType);
+  }
+
+  test_returnType_variance3() async {
+    // Check that the variance heuristic chooses the most precise type
+    // when the return type uses the variable in a contravariant position
+    // and there is no downwards constraint.
+    String code = r'''
+    typedef To Func1<From, To>(From x);
+    Func1<T, String> f<T>(T x, g(T x)) => null;
+    dynamic test() => f(42, (num x) => x);
+   ''';
+    Source source = addSource(code);
+    TestAnalysisResult analysisResult = await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+    CompilationUnit unit = analysisResult.unit;
+    FunctionDeclaration test = AstFinder.getTopLevelFunction(unit, "test");
+    ExpressionFunctionBody body = test.functionExpression.body;
+    FunctionType functionType = body.expression.staticType;
+    DartType type = functionType.normalParameterTypes[0];
+    _isInt(type);
+  }
+
+  test_returnType_variance4() async {
+    // Check that the variance heuristic chooses the more precise type
+    // when the return type uses the variable in a covariant position
+    // and there is no downwards constraint
+    String code = r'''
+    typedef To Func1<From, To>(From x);
+    Func1<String, T> f<T>(T x, g(T x)) => null;
+    dynamic test() => f(42, (num x) => x);
+   ''';
+    Source source = addSource(code);
+    TestAnalysisResult analysisResult = await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+    CompilationUnit unit = analysisResult.unit;
+    FunctionDeclaration test = AstFinder.getTopLevelFunction(unit, "test");
+    ExpressionFunctionBody body = test.functionExpression.body;
+    FunctionType functionType = body.expression.staticType;
+    DartType type = functionType.returnType;
+    _isInt(type);
+  }
+
+  test_returnType_variance5() async {
+    // Check that pinning works correctly with a partial type
+    // when the return type uses the variable in a contravariant position
+    String code = r'''
+    typedef To Func1<From, To>(From x);
+    Func1<T, String> f<T>(T x) => null;
+    T g<T, S>(Func1<T, S> f) => null;
+    num test() => g(f(3));
+   ''';
+    Source source = addSource(code);
+    TestAnalysisResult analysisResult = await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+    CompilationUnit unit = analysisResult.unit;
+    FunctionDeclaration test = AstFinder.getTopLevelFunction(unit, "test");
+    ExpressionFunctionBody body = test.functionExpression.body;
+    MethodInvocation call = body.expression;
+    _isNum(call.staticType);
+    _isFunction2Of(_isFunction2Of(_isNum, _isString), _isNum)(
+        call.staticInvokeType);
+  }
+
+  test_returnType_variance6() async {
+    // Check that pinning works correctly with a partial type
+    // when the return type uses the variable in a covariant position
+    String code = r'''
+    typedef To Func1<From, To>(From x);
+    Func1<String, T> f<T>(T x) => null;
+    T g<T, S>(Func1<S, T> f) => null;
+    num test() => g(f(3));
+   ''';
+    Source source = addSource(code);
+    TestAnalysisResult analysisResult = await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+    CompilationUnit unit = analysisResult.unit;
+    FunctionDeclaration test = AstFinder.getTopLevelFunction(unit, "test");
+    ExpressionFunctionBody body = test.functionExpression.body;
+    MethodInvocation call = body.expression;
+    _isNum(call.staticType);
+    _isFunction2Of(_isFunction2Of(_isString, _isNum), _isNum)(
+        call.staticInvokeType);
+  }
+
+  test_superConstructorInvocation_propagation() async {
+    String code = r'''
+      class B {
+        B(List<String> p);
+      }
+      class A extends B {
+        A() : super([]);
+      }
+   ''';
+    CompilationUnit unit = await resolveSource(code);
+
+    ConstructorDeclaration constructor =
+        AstFinder.getConstructorInClass(unit, "A", null);
+    SuperConstructorInvocation invocation = constructor.initializers[0];
+    Expression exp = invocation.argumentList.arguments[0];
+    _isListOf(_isString)(exp.staticType);
+  }
+
+  test_sync_star_method_propagation() async {
+    String code = r'''
+      import "dart:async";
+      class A {
+        Iterable f0() sync* { yield []; }
+        Iterable f1() sync* { yield* new List(); }
+
+        Iterable<List<int>> f2() sync* { yield []; }
+        Iterable<List<int>> f3() sync* { yield* new List(); }
+      }
+   ''';
+    CompilationUnit unit = await resolveSource(code);
+
+    void check(String name, Asserter<InterfaceType> typeTest) {
+      MethodDeclaration test = AstFinder.getMethodInClass(unit, "A", name);
+      BlockFunctionBody body = test.body;
+      YieldStatement stmt = body.block.statements[0];
+      Expression exp = stmt.expression;
+      typeTest(exp.staticType);
+    }
+
+    check("f0", _isListOf(_isDynamic));
+    check("f1", _isListOf(_isDynamic));
+
+    check("f2", _isListOf(_isInt));
+    check("f3", _isListOf((DartType type) => _isListOf(_isInt)(type)));
+  }
+
+  test_sync_star_propagation() async {
+    String code = r'''
+      import "dart:async";
+
+      Iterable f0() sync* { yield []; }
+      Iterable f1() sync* { yield* new List(); }
+
+      Iterable<List<int>> f2() sync* { yield []; }
+      Iterable<List<int>> f3() sync* { yield* new List(); }
+   ''';
+    CompilationUnit unit = await resolveSource(code);
+
+    void check(String name, Asserter<InterfaceType> typeTest) {
+      FunctionDeclaration test = AstFinder.getTopLevelFunction(unit, name);
+      BlockFunctionBody body = test.functionExpression.body;
+      YieldStatement stmt = body.block.statements[0];
+      Expression exp = stmt.expression;
+      typeTest(exp.staticType);
+    }
+
+    check("f0", _isListOf(_isDynamic));
+    check("f1", _isListOf(_isDynamic));
+
+    check("f2", _isListOf(_isInt));
+    check("f3", _isListOf((DartType type) => _isListOf(_isInt)(type)));
+  }
+
+  /// Verifies the source has the expected [errorCodes] as well as the
+  /// expected [errorMessage].
+  void _expectInferenceError(
+      Source source, List<ErrorCode> errorCodes, String errorMessage) {
+    assertErrors(source, errorCodes);
+    var errors = analysisResults[source]
+        .errors
+        .where((e) => e.errorCode == StrongModeCode.COULD_NOT_INFER)
+        .map((e) => e.message)
+        .toList();
+    expect(errors.length, 1);
+    var actual = errors[0];
+    expect(actual,
+        errorMessage, // Print the literal error message for easy copy+paste:
+        reason: 'Actual error did not match expected error:\n$actual');
+  }
+
+  /// Helper method for testing `FutureOr<T>`.
+  ///
+  /// Validates that [code] produces [errors]. It should define a function
+  /// "test", whose body is an expression that invokes a method. Returns that
+  /// invocation.
+  Future<MethodInvocation> _testFutureOr(String code,
+      {List<ErrorCode> errors}) async {
+    Source source = addSource("""
+    import "dart:async";
+    $code""");
+    TestAnalysisResult analysisResult = await computeAnalysisResult(source);
+
+    if (errors == null) {
+      assertNoErrors(source);
+    } else {
+      assertErrors(source, errors);
+    }
+    verify([source]);
+    FunctionDeclaration test =
+        AstFinder.getTopLevelFunction(analysisResult.unit, "test");
+    ExpressionFunctionBody body = test.functionExpression.body;
+    return body.expression;
+  }
+}
+
+/// Test cases for [StrongModeStaticTypeAnalyzer2Test]
+mixin StrongModeStaticTypeAnalyzer2TestCases
+    implements StaticTypeAnalyzer2TestShared {
+  void expectStaticInvokeType(String search, String type) {
+    var invocation = findIdentifier(search).parent as MethodInvocation;
+    expect(invocation.staticInvokeType.toString(), type);
+  }
+
+  test_dynamicObjectGetter_hashCode() async {
+    String code = r'''
+main() {
+  dynamic a = null;
+  var foo = a.hashCode;
+}
+''';
+    await resolveTestUnit(code);
+    expectInitializerType('foo', 'int');
+  }
+
+  test_futureOr_promotion1() async {
+    // Test that promotion from FutureOr<T> to T works for concrete types
+    String code = r'''
+    import "dart:async";
+    dynamic test(FutureOr<int> x) => (x is int) && (x.abs() == 0);
+   ''';
+    await resolveTestUnit(code);
+  }
+
+  test_futureOr_promotion2() async {
+    // Test that promotion from FutureOr<T> to Future<T> works for concrete
+    // types
+    String code = r'''
+    import "dart:async";
+    dynamic test(FutureOr<int> x) => (x is Future<int>) &&
+                                     (x.then((x) => x) == null);
+   ''';
+    await resolveTestUnit(code);
+  }
+
+  test_futureOr_promotion3() async {
+    // Test that promotion from FutureOr<T> to T works for type
+    // parameters T
+    String code = r'''
+    import "dart:async";
+    dynamic test<T extends num>(FutureOr<T> x) => (x is T) &&
+                                                  (x.abs() == 0);
+   ''';
+    await resolveTestUnit(code);
+  }
+
+  test_futureOr_promotion4() async {
+    // Test that promotion from FutureOr<T> to Future<T> works for type
+    // parameters T
+    String code = r'''
+    import "dart:async";
+    dynamic test<T extends num>(FutureOr<T> x) => (x is Future<T>) &&
+                                                  (x.then((x) => x) == null);
+   ''';
+    await resolveTestUnit(code);
+  }
+
+  test_generalizedVoid_assignToVoidOk() async {
+    Source source = addSource(r'''
+void main() {
+  void x;
+  x = 42;
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+  }
+
+  test_genericFunction() async {
+    await resolveTestUnit(r'T f<T>(T x) => null;');
+    expectFunctionType('f', '<T>(T) → T',
+        elementTypeParams: '[T]', typeFormals: '[T]');
+    SimpleIdentifier f = findIdentifier('f');
+    FunctionElementImpl e = f.staticElement;
+    FunctionType ft = e.type.instantiate([typeProvider.stringType]);
+    expect(ft.toString(), '(String) → String');
+  }
+
+  test_genericFunction_bounds() async {
+    await resolveTestUnit(r'T f<T extends num>(T x) => null;');
+    expectFunctionType('f', '<T extends num>(T) → T',
+        elementTypeParams: '[T extends num]', typeFormals: '[T extends num]');
+  }
+
+  test_genericFunction_parameter() async {
+    await resolveTestUnit(r'''
+void g(T f<T>(T x)) {}
+''', noErrors: false // TODO(paulberry): remove when dartbug.com/28515 fixed.
+        );
+    expectFunctionType('f', '<T>(T) → T',
+        elementTypeParams: '[]', typeFormals: '[T]');
+    SimpleIdentifier f = findIdentifier('f');
+    ParameterElementImpl e = f.staticElement;
+    FunctionType type = e.type;
+    FunctionType ft = type.instantiate([typeProvider.stringType]);
+    expect(ft.toString(), '(String) → String');
+  }
+
+  test_genericFunction_static() async {
+    await resolveTestUnit(r'''
+class C<E> {
+  static T f<T>(T x) => null;
+}
+''');
+    expectFunctionType('f', '<T>(T) → T',
+        elementTypeParams: '[T]', typeFormals: '[T]');
+    SimpleIdentifier f = findIdentifier('f');
+    MethodElementImpl e = f.staticElement;
+    FunctionType ft = e.type.instantiate([typeProvider.stringType]);
+    expect(ft.toString(), '(String) → String');
+  }
+
+  test_genericFunction_typedef() async {
+    String code = r'''
+typedef T F<T>(T x);
+F f0;
+
+class C {
+  static F f1;
+  F f2;
+  void g(F f3) {
+    F f4;
+    f0(3);
+    f1(3);
+    f2(3);
+    f3(3);
+    f4(3);
+  }
+}
+
+class D<S> {
+  static F f1;
+  F f2;
+  void g(F f3) {
+    F f4;
+    f0(3);
+    f1(3);
+    f2(3);
+    f3(3);
+    f4(3);
+  }
+}
+''';
+    await resolveTestUnit(code);
+
+    checkBody(String className) {
+      List<Statement> statements =
+          AstFinder.getStatementsInMethod(testUnit, className, "g");
+
+      for (int i = 1; i <= 5; i++) {
+        Expression exp = (statements[i] as ExpressionStatement).expression;
+        expect(exp.staticType, typeProvider.dynamicType);
+      }
+    }
+
+    checkBody("C");
+    checkBody("D");
+  }
+
+  test_genericFunction_upwardsAndDownwards() async {
+    // Regression tests for https://github.com/dart-lang/sdk/issues/27586.
+    await resolveTestUnit(r'List<num> x = [1, 2];');
+    expectInitializerType('x', 'List<num>');
+  }
+
+  test_genericFunction_upwardsAndDownwards_Object() async {
+    // Regression tests for https://github.com/dart-lang/sdk/issues/27625.
+    await resolveTestUnit(r'''
+List<Object> aaa = [];
+List<Object> bbb = [1, 2, 3];
+List<Object> ccc = [null];
+List<Object> ddd = [1 as dynamic];
+List<Object> eee = [new Object()];
+    ''');
+    expectInitializerType('aaa', 'List<Object>');
+    expectInitializerType('bbb', 'List<Object>');
+    expectInitializerType('ccc', 'List<Object>');
+    expectInitializerType('ddd', 'List<Object>');
+    expectInitializerType('eee', 'List<Object>');
+  }
+
+  test_genericMethod() async {
+    await resolveTestUnit(r'''
+class C<E> {
+  List<T> f<T>(E e) => null;
+}
+main() {
+  C<String> cOfString;
+}
+''');
+    expectFunctionType('f', '<T>(E) → List<T>',
+        elementTypeParams: '[T]',
+        typeParams: '[E]',
+        typeArgs: '[E]',
+        typeFormals: '[T]');
+    SimpleIdentifier c = findIdentifier('cOfString');
+    FunctionType ft = (c.staticType as InterfaceType).getMethod('f').type;
+    expect(ft.toString(), '<T>(String) → List<T>');
+    ft = ft.instantiate([typeProvider.intType]);
+    expect(ft.toString(), '(String) → List<int>');
+    expect('${ft.typeArguments}/${ft.typeParameters}', '[String, int]/[E, T]');
+  }
+
+  test_genericMethod_explicitTypeParams() async {
+    await resolveTestUnit(r'''
+class C<E> {
+  List<T> f<T>(E e) => null;
+}
+main() {
+  C<String> cOfString;
+  var x = cOfString.f<int>('hi');
+}
+''');
+    MethodInvocation f = findIdentifier('f<int>').parent;
+    FunctionType ft = f.staticInvokeType;
+    expect(ft.toString(), '(String) → List<int>');
+    expect('${ft.typeArguments}/${ft.typeParameters}', '[String, int]/[E, T]');
+
+    SimpleIdentifier x = findIdentifier('x');
+    expect(x.staticType,
+        typeProvider.listType.instantiate([typeProvider.intType]));
+  }
+
+  test_genericMethod_functionExpressionInvocation_explicit() async {
+    await resolveTestUnit(r'''
+class C<E> {
+  T f<T>(T e) => null;
+  static T g<T>(T e) => null;
+  static T Function<T>(T) h = null;
+}
+
+T topF<T>(T e) => null;
+var topG = topF;
+void test<S>(T Function<T>(T) pf) {
+  var c = new C<int>();
+  T lf<T>(T e) => null;
+
+  var lambdaCall = (<E>(E e) => e)<int>(3);
+  var methodCall = (c.f)<int>(3);
+  var staticCall = (C.g)<int>(3);
+  var staticFieldCall = (C.h)<int>(3);
+  var topFunCall = (topF)<int>(3);
+  var topFieldCall = (topG)<int>(3);
+  var localCall = (lf)<int>(3);
+  var paramCall = (pf)<int>(3);
+}
+''');
+    expectIdentifierType('methodCall', "int");
+    expectIdentifierType('staticCall', "int");
+    expectIdentifierType('staticFieldCall', "int");
+    expectIdentifierType('topFunCall', "int");
+    expectIdentifierType('topFieldCall', "int");
+    expectIdentifierType('localCall', "int");
+    expectIdentifierType('paramCall', "int");
+    expectIdentifierType('lambdaCall', "int");
+  }
+
+  test_genericMethod_functionExpressionInvocation_functionTypedParameter_explicit() async {
+    await resolveTestUnit(r'''
+void test<S>(T pf<T>(T e)) {
+  var paramCall = (pf)<int>(3);
+}
+''', noErrors: false // TODO(paulberry): remove when dartbug.com/28515 fixed.
+        );
+    expectIdentifierType('paramCall', "int");
+  }
+
+  test_genericMethod_functionExpressionInvocation_functionTypedParameter_inferred() async {
+    await resolveTestUnit(r'''
+void test<S>(T pf<T>(T e)) {
+  var paramCall = (pf)(3);
+}
+''', noErrors: false // TODO(paulberry): remove when dartbug.com/28515 fixed.
+        );
+    expectIdentifierType('paramCall', "int");
+  }
+
+  test_genericMethod_functionExpressionInvocation_inferred() async {
+    await resolveTestUnit(r'''
+class C<E> {
+  T f<T>(T e) => null;
+  static T g<T>(T e) => null;
+  static T Function<T>(T) h = null;
+}
+
+T topF<T>(T e) => null;
+var topG = topF;
+void test<S>(T Function<T>(T) pf) {
+  var c = new C<int>();
+  T lf<T>(T e) => null;
+
+  var lambdaCall = (<E>(E e) => e)(3);
+  var methodCall = (c.f)(3);
+  var staticCall = (C.g)(3);
+  var staticFieldCall = (C.h)(3);
+  var topFunCall = (topF)(3);
+  var topFieldCall = (topG)(3);
+  var localCall = (lf)(3);
+  var paramCall = (pf)(3);
+}
+''', noErrors: false // TODO(paulberry): remove when dartbug.com/28515 fixed.
+        );
+    expectIdentifierType('methodCall', "int");
+    expectIdentifierType('staticCall', "int");
+    expectIdentifierType('staticFieldCall', "int");
+    expectIdentifierType('topFunCall', "int");
+    expectIdentifierType('topFieldCall', "int");
+    expectIdentifierType('localCall', "int");
+    expectIdentifierType('paramCall', "int");
+    expectIdentifierType('lambdaCall', "int");
+  }
+
+  test_genericMethod_functionInvocation_explicit() async {
+    await resolveTestUnit(r'''
+class C<E> {
+  T f<T>(T e) => null;
+  static T g<T>(T e) => null;
+  static T Function<T>(T) h = null;
+}
+
+T topF<T>(T e) => null;
+var topG = topF;
+void test<S>(T Function<T>(T) pf) {
+  var c = new C<int>();
+  T lf<T>(T e) => null;
+  var methodCall = c.f<int>(3);
+  var staticCall = C.g<int>(3);
+  var staticFieldCall = C.h<int>(3);
+  var topFunCall = topF<int>(3);
+  var topFieldCall = topG<int>(3);
+  var localCall = lf<int>(3);
+  var paramCall = pf<int>(3);
+}
+''');
+    expectIdentifierType('methodCall', "int");
+    expectIdentifierType('staticCall', "int");
+    expectIdentifierType('staticFieldCall', "int");
+    expectIdentifierType('topFunCall', "int");
+    expectIdentifierType('topFieldCall', "int");
+    expectIdentifierType('localCall', "int");
+    expectIdentifierType('paramCall', "int");
+  }
+
+  test_genericMethod_functionInvocation_functionTypedParameter_explicit() async {
+    await resolveTestUnit(r'''
+void test<S>(T pf<T>(T e)) {
+  var paramCall = pf<int>(3);
+}
+''', noErrors: false // TODO(paulberry): remove when dartbug.com/28515 fixed.
+        );
+    expectIdentifierType('paramCall', "int");
+  }
+
+  test_genericMethod_functionInvocation_functionTypedParameter_inferred() async {
+    await resolveTestUnit(r'''
+void test<S>(T pf<T>(T e)) {
+  var paramCall = pf(3);
+}
+''', noErrors: false // TODO(paulberry): remove when dartbug.com/28515 fixed.
+        );
+    expectIdentifierType('paramCall', "int");
+  }
+
+  test_genericMethod_functionInvocation_inferred() async {
+    await resolveTestUnit(r'''
+class C<E> {
+  T f<T>(T e) => null;
+  static T g<T>(T e) => null;
+  static T Function<T>(T) h = null;
+}
+
+T topF<T>(T e) => null;
+var topG = topF;
+void test<S>(T Function<T>(T) pf) {
+  var c = new C<int>();
+  T lf<T>(T e) => null;
+  var methodCall = c.f(3);
+  var staticCall = C.g(3);
+  var staticFieldCall = C.h(3);
+  var topFunCall = topF(3);
+  var topFieldCall = topG(3);
+  var localCall = lf(3);
+  var paramCall = pf(3);
+}
+''');
+    expectIdentifierType('methodCall', "int");
+    expectIdentifierType('staticCall', "int");
+    expectIdentifierType('staticFieldCall', "int");
+    expectIdentifierType('topFunCall', "int");
+    expectIdentifierType('topFieldCall', "int");
+    expectIdentifierType('localCall', "int");
+    expectIdentifierType('paramCall', "int");
+  }
+
+  test_genericMethod_functionTypedParameter() async {
+    await resolveTestUnit(r'''
+class C<E> {
+  List<T> f<T>(T f(E e)) => null;
+}
+main() {
+  C<String> cOfString;
+}
+''');
+    expectFunctionType('f', '<T>((E) → T) → List<T>',
+        elementTypeParams: '[T]',
+        typeParams: '[E]',
+        typeArgs: '[E]',
+        typeFormals: '[T]');
+
+    SimpleIdentifier c = findIdentifier('cOfString');
+    FunctionType ft = (c.staticType as InterfaceType).getMethod('f').type;
+    expect(ft.toString(), '<T>((String) → T) → List<T>');
+    ft = ft.instantiate([typeProvider.intType]);
+    expect(ft.toString(), '((String) → int) → List<int>');
+  }
+
+  test_genericMethod_functionTypedParameter_tearoff() async {
+    await resolveTestUnit(r'''
+void test<S>(T pf<T>(T e)) {
+  var paramTearOff = pf;
+}
+''', noErrors: false // TODO(paulberry): remove when dartbug.com/28515 fixed.
+        );
+    expectIdentifierType('paramTearOff', "<T>(T) → T");
+  }
+
+  test_genericMethod_implicitDynamic() async {
+    // Regression test for:
+    // https://github.com/dart-lang/sdk/issues/25100#issuecomment-162047588
+    // These should not cause any hints or warnings.
+    await resolveTestUnit(r'''
+class List<E> {
+  T map<T>(T f(E e)) => null;
+}
+void foo() {
+  List list = null;
+  list.map((e) => e);
+  list.map((e) => 3);
+}''');
+    expectIdentifierType('map((e) => e);', '<T>((dynamic) → T) → T');
+    expectIdentifierType('map((e) => 3);', '<T>((dynamic) → T) → T');
+
+    MethodInvocation m1 = findIdentifier('map((e) => e);').parent;
+    expect(m1.staticInvokeType.toString(), '((dynamic) → dynamic) → dynamic');
+    MethodInvocation m2 = findIdentifier('map((e) => 3);').parent;
+    expect(m2.staticInvokeType.toString(), '((dynamic) → int) → int');
+  }
+
+  test_genericMethod_max_doubleDouble() async {
+    String code = r'''
+import 'dart:math';
+main() {
+  var foo = max(1.0, 2.0);
+}
+''';
+    await resolveTestUnit(code);
+    expectInitializerType('foo', 'double');
+  }
+
+  test_genericMethod_max_doubleDouble_prefixed() async {
+    String code = r'''
+import 'dart:math' as math;
+main() {
+  var foo = math.max(1.0, 2.0);
+}
+''';
+    await resolveTestUnit(code);
+    expectInitializerType('foo', 'double');
+  }
+
+  test_genericMethod_max_doubleInt() async {
+    String code = r'''
+import 'dart:math';
+main() {
+  var foo = max(1.0, 2);
+}
+''';
+    await resolveTestUnit(code);
+    expectInitializerType('foo', 'num');
+  }
+
+  test_genericMethod_max_intDouble() async {
+    String code = r'''
+import 'dart:math';
+main() {
+  var foo = max(1, 2.0);
+}
+''';
+    await resolveTestUnit(code);
+    expectInitializerType('foo', 'num');
+  }
+
+  test_genericMethod_max_intInt() async {
+    String code = r'''
+import 'dart:math';
+main() {
+  var foo = max(1, 2);
+}
+''';
+    await resolveTestUnit(code);
+    expectInitializerType('foo', 'int');
+  }
+
+  test_genericMethod_nestedBound() async {
+    String code = r'''
+class Foo<T extends num> {
+  void method<U extends T>(U u) {
+    u.abs();
+  }
+}
+''';
+    // Just validate that there is no warning on the call to `.abs()`.
+    await resolveTestUnit(code);
+  }
+
+  test_genericMethod_nestedCapture() async {
+    await resolveTestUnit(r'''
+class C<T> {
+  T f<S>(S x) {
+    new C<S>().f<int>(3);
+    new C<S>().f; // tear-off
+    return null;
+  }
+}
+''');
+    MethodInvocation f = findIdentifier('f<int>(3);').parent;
+    expect(f.staticInvokeType.toString(), '(int) → S');
+    FunctionType ft = f.staticInvokeType;
+    expect('${ft.typeArguments}/${ft.typeParameters}', '[S, int]/[T, S]');
+
+    expectIdentifierType('f;', '<S₀>(S₀) → S');
+  }
+
+  test_genericMethod_nestedCaptureBounds() async {
+    await resolveTestUnit(r'''
+class C<T> {
+  T f<S extends T>(S x) {
+    new C<S>().f<int>(3);
+    new C<S>().f; // tear-off
+    return null;
+  }
+}
+''');
+    MethodInvocation f = findIdentifier('f<int>(3);').parent;
+    expect(f.staticInvokeType.toString(), '(int) → S');
+    FunctionType ft = f.staticInvokeType;
+    expect('${ft.typeArguments}/${ft.typeParameters}',
+        '[S, int]/[T, S extends T]');
+
+    expectIdentifierType('f;', '<S₀ extends S>(S₀) → S');
+  }
+
+  test_genericMethod_nestedFunctions() async {
+    await resolveTestUnit(r'''
+S f<S>(S x) {
+  g<S>(S x) => f;
+  return null;
+}
+''');
+    expectIdentifierType('f', '<S>(S) → S');
+    expectIdentifierType('g', '<S>(S) → <S>(S) → S');
+  }
+
+  test_genericMethod_override() async {
+    await resolveTestUnit(r'''
+class C {
+  T f<T>(T x) => null;
+}
+class D extends C {
+  T f<T>(T x) => null; // from D
+}
+''');
+    expectFunctionType('f<T>(T x) => null; // from D', '<T>(T) → T',
+        elementTypeParams: '[T]', typeFormals: '[T]');
+    SimpleIdentifier f = findIdentifier('f<T>(T x) => null; // from D');
+    MethodElementImpl e = f.staticElement;
+    FunctionType ft = e.type.instantiate([typeProvider.stringType]);
+    expect(ft.toString(), '(String) → String');
+  }
+
+  test_genericMethod_override_bounds() async {
+    await resolveTestUnit(r'''
+class A {}
+class B {
+  T f<T extends A>(T x) => null;
+}
+// override with the same bound is OK
+class C extends B {
+  T f<T extends A>(T x) => null;
+}
+// override with new name and the same bound is OK
+class D extends B {
+  Q f<Q extends A>(Q x) => null;
+}
+''');
+  }
+
+  test_genericMethod_override_covariant_field() async {
+    Source source = addSource(r'''
+abstract class A {
+  num get x;
+  set x(covariant num _);
+}
+
+class B extends A {
+  int x;
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_genericMethod_override_differentContextsSameBounds() async {
+    Source source = addSource(r'''
+        class GenericMethodBounds<T> {
+  Type get t => T;
+  GenericMethodBounds<E> foo<E extends T>() => new GenericMethodBounds<E>();
+  GenericMethodBounds<E> bar<E extends void Function(T)>() =>
+      new GenericMethodBounds<E>();
+}
+
+class GenericMethodBoundsDerived extends GenericMethodBounds<num> {
+  GenericMethodBounds<E> foo<E extends num>() => new GenericMethodBounds<E>();
+  GenericMethodBounds<E> bar<E extends void Function(num)>() =>
+      new GenericMethodBounds<E>();
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_genericMethod_override_invalidContravariantTypeParamBounds() async {
+    Source source = addSource(r'''
+class A {}
+class B extends A {}
+class C {
+  T f<T extends A>(T x) => null;
+}
+class D extends C {
+  T f<T extends B>(T x) => null;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.INVALID_OVERRIDE]);
+    verify([source]);
+  }
+
+  test_genericMethod_override_invalidCovariantTypeParamBounds() async {
+    Source source = addSource(r'''
+class A {}
+class B extends A {}
+class C {
+  T f<T extends B>(T x) => null;
+}
+class D extends C {
+  T f<T extends A>(T x) => null;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.INVALID_OVERRIDE]);
+    verify([source]);
+  }
+
+  test_genericMethod_override_invalidReturnType() async {
+    Source source = addSource(r'''
+class C {
+  Iterable<T> f<T>(T x) => null;
+}
+class D extends C {
+  String f<S>(S x) => null;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.INVALID_OVERRIDE]);
+    verify([source]);
+  }
+
+  test_genericMethod_override_invalidTypeParamCount() async {
+    Source source = addSource(r'''
+class C {
+  T f<T>(T x) => null;
+}
+class D extends C {
+  S f<T, S>(T x) => null;
+}''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [CompileTimeErrorCode.INVALID_OVERRIDE]);
+    verify([source]);
+  }
+
+  test_genericMethod_propagatedType_promotion() async {
+    // Regression test for:
+    // https://github.com/dart-lang/sdk/issues/25340
+
+    // Note, after https://github.com/dart-lang/sdk/issues/25486 the original
+    // example won't work, as we now compute a static type and therefore discard
+    // the propagated type. So a new test was created that doesn't run under
+    // strong mode.
+    await resolveTestUnit(r'''
+abstract class Iter {
+  List<S> map<S>(S f(x));
+}
+class C {}
+C toSpan(dynamic element) {
+  if (element is Iter) {
+    var y = element.map(toSpan);
+  }
+  return null;
+}''');
+    expectIdentifierType('y = ', 'List<C>');
+  }
+
+  test_genericMethod_tearoff() async {
+    await resolveTestUnit(r'''
+class C<E> {
+  T f<T>(E e) => null;
+  static T g<T>(T e) => null;
+  static T Function<T>(T) h = null;
+}
+
+T topF<T>(T e) => null;
+var topG = topF;
+void test<S>(T Function<T>(T) pf) {
+  var c = new C<int>();
+  T lf<T>(T e) => null;
+  var methodTearOff = c.f;
+  var staticTearOff = C.g;
+  var staticFieldTearOff = C.h;
+  var topFunTearOff = topF;
+  var topFieldTearOff = topG;
+  var localTearOff = lf;
+  var paramTearOff = pf;
+}
+''');
+    expectIdentifierType('methodTearOff', "<T>(int) → T");
+    expectIdentifierType('staticTearOff', "<T>(T) → T");
+    expectIdentifierType('staticFieldTearOff', "<T>(T) → T");
+    expectIdentifierType('topFunTearOff', "<T>(T) → T");
+    expectIdentifierType('topFieldTearOff', "<T>(T) → T");
+    expectIdentifierType('localTearOff', "<T>(T) → T");
+    expectIdentifierType('paramTearOff', "<T>(T) → T");
+  }
+
+  test_genericMethod_tearoff_instantiated() async {
+    await resolveTestUnit(r'''
+class C<E> {
+  T f<T>(E e) => null;
+  static T g<T>(T e) => null;
+  static T Function<T>(T) h = null;
+}
+
+T topF<T>(T e) => null;
+var topG = topF;
+void test<S>(T pf<T>(T e)) {
+  var c = new C<int>();
+  T lf<T>(T e) => null;
+  var methodTearOffInst = c.f<int>;
+  var staticTearOffInst = C.g<int>;
+  var staticFieldTearOffInst = C.h<int>;
+  var topFunTearOffInst = topF<int>;
+  var topFieldTearOffInst = topG<int>;
+  var localTearOffInst = lf<int>;
+  var paramTearOffInst = pf<int>;
+}
+''');
+    expectIdentifierType('methodTearOffInst', "(int) → int");
+    expectIdentifierType('staticTearOffInst', "(int) → int");
+    expectIdentifierType('staticFieldTearOffInst', "(int) → int");
+    expectIdentifierType('topFunTearOffInst', "(int) → int");
+    expectIdentifierType('topFieldTearOffInst', "(int) → int");
+    expectIdentifierType('localTearOffInst', "(int) → int");
+    expectIdentifierType('paramTearOffInst', "(int) → int");
+  }
+
+  test_genericMethod_then() async {
+    String code = r'''
+import 'dart:async';
+String toString(int x) => x.toString();
+main() {
+  Future<int> bar = null;
+  var foo = bar.then(toString);
+}
+''';
+    await resolveTestUnit(code);
+
+    expectInitializerType('foo', 'Future<String>');
+  }
+
+  test_genericMethod_then_prefixed() async {
+    String code = r'''
+import 'dart:async' as async;
+String toString(int x) => x.toString();
+main() {
+  async.Future<int> bar = null;
+  var foo = bar.then(toString);
+}
+''';
+    await resolveTestUnit(code);
+    expectInitializerType('foo', 'Future<String>');
+  }
+
+  test_genericMethod_then_propagatedType() async {
+    // Regression test for https://github.com/dart-lang/sdk/issues/25482.
+    String code = r'''
+import 'dart:async';
+void main() {
+  Future<String> p;
+  var foo = p.then((r) => new Future<String>.value(3));
+}
+''';
+    await resolveTestUnit(code, noErrors: false);
+    // Note: this correctly reports the error
+    // StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE when run with the driver;
+    // when run without the driver, it reports no errors.  So we don't bother
+    // checking whether the correct errors were reported.
+    expectInitializerType('foo', 'Future<String>');
+  }
+
+  test_genericMethod_toplevel_field_staticTearoff() async {
+    await resolveTestUnit(r'''
+class C<E> {
+  static T g<T>(T e) => null;
+  static T Function<T>(T) h = null;
+}
+
+void test() {
+  var fieldRead = C.h;
+}
+''');
+    expectIdentifierType('fieldRead', "<T>(T) → T");
+  }
+
+  test_implicitBounds() async {
+    String code = r'''
+class A<T> {}
+
+class B<T extends num> {}
+
+class C<S extends int, T extends B<S>, U extends A> {}
+
+void test() {
+//
+  A ai;
+  B bi;
+  C ci;
+  var aa = new A();
+  var bb = new B();
+  var cc = new C();
+}
+''';
+    await resolveTestUnit(code);
+    expectIdentifierType('ai', "A<dynamic>");
+    expectIdentifierType('bi', "B<num>");
+    expectIdentifierType('ci', "C<int, B<int>, A<dynamic>>");
+    expectIdentifierType('aa', "A<dynamic>");
+    expectIdentifierType('bb', "B<num>");
+    expectIdentifierType('cc', "C<int, B<int>, A<dynamic>>");
+  }
+
+  test_inferClosureType_parameters() async {
+    Source source = addSource(r'''
+typedef F({bool p});
+foo(callback(F f)) {}
+main() {
+  foo((f) {
+    f(p: false);
+  });
+}
+''');
+    var result = await computeAnalysisResult(source);
+    var main = result.unit.declarations[2] as FunctionDeclaration;
+    var body = main.functionExpression.body as BlockFunctionBody;
+    var statement = body.block.statements[0] as ExpressionStatement;
+    var invocation = statement.expression as MethodInvocation;
+    var closure = invocation.argumentList.arguments[0] as FunctionExpression;
+    var closureType = closure.staticType as FunctionType;
+    var fType = closureType.parameters[0].type as FunctionType;
+    // The inferred type of "f" in "foo()" invocation must own its parameters.
+    ParameterElement p = fType.parameters[0];
+    expect(p.name, 'p');
+    expect(p.enclosingElement, same(fType.element));
+  }
+
+  test_instantiateToBounds_class_error_extension_malbounded() async {
+    // Test that superclasses are strictly checked for malbounded default
+    // types
+    String code = r'''
+class C<T0 extends List<T1>, T1 extends List<T0>> {}
+class D extends C {}
+''';
+    await resolveTestUnit(code, noErrors: false);
+    assertErrors(testSource, [StrongModeCode.NO_DEFAULT_BOUNDS]);
+  }
+
+  test_instantiateToBounds_class_error_instantiation_malbounded() async {
+    // Test that instance creations are strictly checked for malbounded default
+    // types
+    String code = r'''
+class C<T0 extends List<T1>, T1 extends List<T0>> {}
+void test() {
+  var c = new C();
+}
+''';
+    await resolveTestUnit(code, noErrors: false);
+    assertErrors(testSource, [StrongModeCode.NO_DEFAULT_BOUNDS]);
+    expectIdentifierType('c;', 'C<List<dynamic>, List<dynamic>>');
+  }
+
+  test_instantiateToBounds_class_error_recursion() async {
+    String code = r'''
+class C<T0 extends List<T1>, T1 extends List<T0>> {}
+C c;
+''';
+    await resolveTestUnit(code, noErrors: false);
+    assertNoErrors(testSource);
+    expectIdentifierType('c;', 'C<List<dynamic>, List<dynamic>>');
+  }
+
+  test_instantiateToBounds_class_error_recursion_self() async {
+    String code = r'''
+class C<T extends C<T>> {}
+C c;
+''';
+    await resolveTestUnit(code, noErrors: false);
+    assertNoErrors(testSource);
+    expectIdentifierType('c;', 'C<C<dynamic>>');
+  }
+
+  test_instantiateToBounds_class_error_recursion_self2() async {
+    String code = r'''
+class A<E> {}
+class C<T extends A<T>> {}
+C c;
+''';
+    await resolveTestUnit(code, noErrors: false);
+    assertNoErrors(testSource);
+    expectIdentifierType('c;', 'C<A<dynamic>>');
+  }
+
+  test_instantiateToBounds_class_error_typedef() async {
+    String code = r'''
+typedef T F<T>(T x);
+class C<T extends F<T>> {}
+C c;
+''';
+    await resolveTestUnit(code, noErrors: false);
+    assertNoErrors(testSource);
+    expectIdentifierType('c;', 'C<(dynamic) → dynamic>');
+  }
+
+  test_instantiateToBounds_class_ok_implicitDynamic_multi() async {
+    String code = r'''
+class C<T0 extends Map<T1, T2>, T1 extends List, T2 extends int> {}
+C c;
+''';
+    await resolveTestUnit(code);
+    assertNoErrors(testSource);
+    expectIdentifierType(
+        'c;', 'C<Map<List<dynamic>, int>, List<dynamic>, int>');
+  }
+
+  test_instantiateToBounds_class_ok_referenceOther_after() async {
+    String code = r'''
+class C<T0 extends T1, T1 extends int> {}
+C c;
+''';
+    await resolveTestUnit(code);
+    assertNoErrors(testSource);
+    expectIdentifierType('c;', 'C<int, int>');
+  }
+
+  test_instantiateToBounds_class_ok_referenceOther_after2() async {
+    String code = r'''
+class C<T0 extends Map<T1, T1>, T1 extends int> {}
+C c;
+''';
+    await resolveTestUnit(code);
+    assertNoErrors(testSource);
+    expectIdentifierType('c;', 'C<Map<int, int>, int>');
+  }
+
+  test_instantiateToBounds_class_ok_referenceOther_before() async {
+    String code = r'''
+class C<T0 extends int, T1 extends T0> {}
+C c;
+''';
+    await resolveTestUnit(code);
+    assertNoErrors(testSource);
+    expectIdentifierType('c;', 'C<int, int>');
+  }
+
+  test_instantiateToBounds_class_ok_referenceOther_multi() async {
+    String code = r'''
+class C<T0 extends Map<T1, T2>, T1 extends List<T2>, T2 extends int> {}
+C c;
+''';
+    await resolveTestUnit(code);
+    assertNoErrors(testSource);
+    expectIdentifierType('c;', 'C<Map<List<int>, int>, List<int>, int>');
+  }
+
+  test_instantiateToBounds_class_ok_simpleBounds() async {
+    String code = r'''
+class A<T> {}
+class B<T extends num> {}
+class C<T extends List<int>> {}
+class D<T extends A> {}
+void main() {
+  A a;
+  B b;
+  C c;
+  D d;
+}
+''';
+    await resolveTestUnit(code);
+    assertNoErrors(testSource);
+    expectIdentifierType('a;', 'A<dynamic>');
+    expectIdentifierType('b;', 'B<num>');
+    expectIdentifierType('c;', 'C<List<int>>');
+    expectIdentifierType('d;', 'D<A<dynamic>>');
+  }
+
+  test_instantiateToBounds_generic_function_error_malbounded() async {
+    // Test that generic methods are strictly checked for malbounded default
+    // types
+    String code = r'''
+T0 f<T0 extends List<T1>, T1 extends List<T0>>() {}
+void g() {
+  var c = f();
+  return;
+}
+''';
+    await resolveTestUnit(code, noErrors: false);
+    assertErrors(testSource, [StrongModeCode.NO_DEFAULT_BOUNDS]);
+    expectIdentifierType('c;', 'List<dynamic>');
+  }
+
+  test_instantiateToBounds_method_ok_referenceOther_before() async {
+    String code = r'''
+class C<T> {
+  void m<S0 extends T, S1 extends List<S0>>(S0 p0, S1 p1) {}
+
+  void main() {
+    m(null, null);
+  }
+}
+''';
+    await resolveTestUnit(code);
+    assertNoErrors(testSource);
+    expectStaticInvokeType('m(null', '(Null, Null) → void');
+  }
+
+  test_instantiateToBounds_method_ok_referenceOther_before2() async {
+    String code = r'''
+class C<T> {
+  Map<S0, S1> m<S0 extends T, S1 extends List<S0>>() => null;
+
+  void main() {
+    m();
+  }
+}
+''';
+    await resolveTestUnit(code);
+    assertNoErrors(testSource);
+    expectStaticInvokeType('m();', '() → Map<T, List<T>>');
+  }
+
+  test_instantiateToBounds_method_ok_simpleBounds() async {
+    String code = r'''
+class C<T> {
+  void m<S extends T>(S p0) {}
+
+  void main() {
+    m(null);
+  }
+}
+''';
+    await resolveTestUnit(code);
+    assertNoErrors(testSource);
+    expectStaticInvokeType('m(null)', '(Null) → void');
+  }
+
+  test_instantiateToBounds_method_ok_simpleBounds2() async {
+    String code = r'''
+class C<T> {
+  S m<S extends T>() => null;
+
+  void main() {
+    m();
+  }
+}
+''';
+    await resolveTestUnit(code);
+    assertNoErrors(testSource);
+    expectStaticInvokeType('m();', '() → T');
+  }
+
+  test_issue32396() async {
+    await resolveTestUnit(r'''
+class C<E> {
+  static T g<T>(T e) => null;
+  static final h = g;
+}
+''');
+  }
+
+  test_notInstantiatedBound_class_error_recursion() async {
+    String code = r'''
+class A<T extends B> {} // points to a
+class B<T extends A> {} // points to b
+class C<T extends A> {} // points to a cyclical type
+''';
+    await resolveTestUnit(code, noErrors: false);
+    assertErrors(testSource, [
+      StrongModeCode.NOT_INSTANTIATED_BOUND,
+      StrongModeCode.NOT_INSTANTIATED_BOUND,
+      StrongModeCode.NOT_INSTANTIATED_BOUND,
+    ]);
+  }
+
+  test_notInstantiatedBound_class_error_recursion_less_direct() async {
+    String code = r'''
+class A<T extends B<A>> {}
+class B<T extends A<B>> {}
+''';
+    await resolveTestUnit(code, noErrors: false);
+    assertErrors(testSource, [
+      StrongModeCode.NOT_INSTANTIATED_BOUND,
+      StrongModeCode.NOT_INSTANTIATED_BOUND,
+    ]);
+  }
+
+  test_notInstantiatedBound_class_error_recursion_typedef() async {
+    String code = r'''
+typedef F(C value);
+class C<T extends F> {}
+class D<T extends C> {}
+''';
+    await resolveTestUnit(code, noErrors: false);
+    assertErrors(testSource, [
+      StrongModeCode.NOT_INSTANTIATED_BOUND,
+      StrongModeCode.NOT_INSTANTIATED_BOUND,
+      CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF,
+    ]);
+  }
+
+  test_notInstantiatedBound_error_class_argument() async {
+    String code = r'''
+class A<K, V extends List<K>> {}
+class C<T extends A> {}
+''';
+    await resolveTestUnit(code, noErrors: false);
+    assertErrors(testSource, [StrongModeCode.NOT_INSTANTIATED_BOUND]);
+  }
+
+  test_notInstantiatedBound_error_class_argument2() async {
+    String code = r'''
+class A<K, V extends List<List<K>>> {}
+class C<T extends A> {}
+''';
+    await resolveTestUnit(code, noErrors: false);
+    assertErrors(testSource, [StrongModeCode.NOT_INSTANTIATED_BOUND]);
+  }
+
+  test_notInstantiatedBound_error_class_direct() async {
+    String code = r'''
+class A<K, V extends K> {}
+class C<T extends A> {}
+''';
+    await resolveTestUnit(code, noErrors: false);
+    assertErrors(testSource, [StrongModeCode.NOT_INSTANTIATED_BOUND]);
+  }
+
+  test_notInstantiatedBound_error_class_indirect() async {
+    String code = r'''
+class A<K, V extends K> {}
+class C<T extends List<A>> {}
+''';
+    await resolveTestUnit(code, noErrors: false);
+    assertErrors(testSource, [StrongModeCode.NOT_INSTANTIATED_BOUND]);
+  }
+
+  test_notInstantiatedBound_error_functionType() async {
+    await resolveTestUnit(r'''
+class A<T extends Function(T)> {}
+class B<T extends T Function()> {}
+class C<T extends A> {}
+class D<T extends B> {}
+''', noErrors: false);
+    assertErrors(testSource, [
+      StrongModeCode.NOT_INSTANTIATED_BOUND,
+      StrongModeCode.NOT_INSTANTIATED_BOUND
+    ]);
+  }
+
+  test_notInstantiatedBound_error_typedef_argument() async {
+    String code = r'''
+class A<K, V extends List<K>> {}
+typedef void F<T extends A>();
+''';
+    await resolveTestUnit(code, noErrors: false);
+    assertErrors(testSource, [StrongModeCode.NOT_INSTANTIATED_BOUND]);
+  }
+
+  test_notInstantiatedBound_error_typedef_argument2() async {
+    String code = r'''
+class A<K, V extends List<List<K>>> {}
+typedef void F<T extends A>();
+''';
+    await resolveTestUnit(code, noErrors: false);
+    assertErrors(testSource, [StrongModeCode.NOT_INSTANTIATED_BOUND]);
+  }
+
+  test_notInstantiatedBound_error_typedef_direct() async {
+    String code = r'''
+class A<K, V extends K> {}
+typedef void F<T extends A>();
+''';
+    await resolveTestUnit(code, noErrors: false);
+    assertErrors(testSource, [StrongModeCode.NOT_INSTANTIATED_BOUND]);
+  }
+
+  test_notInstantiatedBound_ok_class() async {
+    String code = r'''
+class A<T extends int> {}
+class C1<T extends A> {}
+class C2<T extends List<A>> {}
+''';
+    await resolveTestUnit(code);
+    assertNoErrors(testSource);
+  }
+
+  test_notInstantiatedBound_ok_class_class2() async {
+    String code = r'''
+class A<T> {}
+class C<T extends A<int>> {}
+class D<T extends C> {}
+''';
+    await resolveTestUnit(code);
+    assertNoErrors(testSource);
+  }
+
+  test_notInstantiatedBound_ok_class_class3() async {
+    String code = r'''
+class A<T> {}
+class B<T extends int> {}
+class C<T extends A<B>> {}
+''';
+    await resolveTestUnit(code);
+    assertNoErrors(testSource);
+  }
+
+  test_notInstantiatedBound_ok_class_class4() async {
+    String code = r'''
+class A<K, V> {}
+class B<T extends int> {}
+class C<T extends A<B, B>> {}
+''';
+    await resolveTestUnit(code);
+    assertNoErrors(testSource);
+  }
+
+  test_notInstantiatedBound_ok_class_function() async {
+    String code = r'''
+class A<T extends void Function()> {}
+class B<T extends A> {}
+''';
+    await resolveTestUnit(code);
+    assertNoErrors(testSource);
+  }
+
+  test_notInstantiatedBound_ok_class_typedef() async {
+    String code = r'''
+typedef void F<T extends int>();
+class C<T extends F> {}
+''';
+    await resolveTestUnit(code);
+    assertNoErrors(testSource);
+  }
+
+  test_notInstantiatedBound_ok_typedef_class() async {
+    String code = r'''
+class C<T extends int> {}
+typedef void F<T extends C>();
+''';
+    await resolveTestUnit(code);
+    assertNoErrors(testSource);
+  }
+
+  test_objectMethodOnFunctions_Anonymous() async {
+    String code = r'''
+void main() {
+  var f = (x) => 3;
+  // No errors, correct type
+  var t0 = f.toString();
+  var t1 = f.toString;
+  var t2 = f.hashCode;
+
+  // Expressions, no errors, correct type
+  var t3 = (f).toString();
+  var t4 = (f).toString;
+  var t5 = (f).hashCode;
+
+  // Cascades, no errors
+  f..toString();
+  f..toString;
+  f..hashCode;
+
+  // Expression cascades, no errors
+  (f)..toString();
+  (f)..toString;
+  (f)..hashCode;
+}''';
+    await _objectMethodOnFunctions_helper2(code);
+  }
+
+  test_objectMethodOnFunctions_Function() async {
+    String code = r'''
+void main() {
+  Function f;
+  // No errors, correct type
+  var t0 = f.toString();
+  var t1 = f.toString;
+  var t2 = f.hashCode;
+
+  // Expressions, no errors, correct type
+  var t3 = (f).toString();
+  var t4 = (f).toString;
+  var t5 = (f).hashCode;
+
+  // Cascades, no errors
+  f..toString();
+  f..toString;
+  f..hashCode;
+
+  // Expression cascades, no errors
+  (f)..toString();
+  (f)..toString;
+  (f)..hashCode;
+}''';
+    await _objectMethodOnFunctions_helper2(code);
+  }
+
+  test_objectMethodOnFunctions_Static() async {
+    String code = r'''
+int f(int x) => null;
+void main() {
+  // No errors, correct type
+  var t0 = f.toString();
+  var t1 = f.toString;
+  var t2 = f.hashCode;
+
+  // Expressions, no errors, correct type
+  var t3 = (f).toString();
+  var t4 = (f).toString;
+  var t5 = (f).hashCode;
+
+  // Cascades, no errors
+  f..toString();
+  f..toString;
+  f..hashCode;
+
+  // Expression cascades, no errors
+  (f)..toString();
+  (f)..toString;
+  (f)..hashCode;
+}''';
+    await _objectMethodOnFunctions_helper2(code);
+  }
+
+  test_objectMethodOnFunctions_Typedef() async {
+    String code = r'''
+typedef bool Predicate<T>(T object);
+
+void main() {
+  Predicate<int> f;
+  // No errors, correct type
+  var t0 = f.toString();
+  var t1 = f.toString;
+  var t2 = f.hashCode;
+
+  // Expressions, no errors, correct type
+  var t3 = (f).toString();
+  var t4 = (f).toString;
+  var t5 = (f).hashCode;
+
+  // Cascades, no errors
+  f..toString();
+  f..toString;
+  f..hashCode;
+
+  // Expression cascades, no errors
+  (f)..toString();
+  (f)..toString;
+  (f)..hashCode;
+}''';
+    await _objectMethodOnFunctions_helper2(code);
+  }
+
+  test_returnOfInvalidType_object_void() async {
+    await assertErrorsInCode(
+        "Object f() { void voidFn() => null; return voidFn(); }",
+        [StaticTypeWarningCode.RETURN_OF_INVALID_TYPE]);
+  }
+
+  test_setterWithDynamicTypeIsError() async {
+    Source source = addSource(r'''
+class A {
+  dynamic set f(String s) => null;
+}
+dynamic set g(int x) => null;
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      StaticWarningCode.NON_VOID_RETURN_FOR_SETTER,
+      StaticWarningCode.NON_VOID_RETURN_FOR_SETTER
+    ]);
+    verify([source]);
+  }
+
+  test_setterWithExplicitVoidType_returningVoid() async {
+    Source source = addSource(r'''
+void returnsVoid() {}
+class A {
+  void set f(String s) => returnsVoid();
+}
+void set g(int x) => returnsVoid();
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_setterWithNoVoidType() async {
+    Source source = addSource(r'''
+class A {
+  set f(String s) {
+    return '42';
+  }
+}
+set g(int x) => 42;
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      StaticTypeWarningCode.RETURN_OF_INVALID_TYPE,
+    ]);
+    verify([source]);
+  }
+
+  test_setterWithNoVoidType_returningVoid() async {
+    Source source = addSource(r'''
+void returnsVoid() {}
+class A {
+  set f(String s) => returnsVoid();
+}
+set g(int x) => returnsVoid();
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_setterWithOtherTypeIsError() async {
+    Source source = addSource(r'''
+class A {
+  String set f(String s) => null;
+}
+Object set g(x) => null;
+''');
+    await computeAnalysisResult(source);
+    assertErrors(source, [
+      StaticWarningCode.NON_VOID_RETURN_FOR_SETTER,
+      StaticWarningCode.NON_VOID_RETURN_FOR_SETTER
+    ]);
+    verify([source]);
+  }
+
+  test_ternaryOperator_null_left() async {
+    String code = r'''
+main() {
+  var foo = (true) ? null : 3;
+}
+''';
+    await resolveTestUnit(code);
+    expectInitializerType('foo', 'int');
+  }
+
+  test_ternaryOperator_null_right() async {
+    String code = r'''
+main() {
+  var foo = (true) ? 3 : null;
+}
+''';
+    await resolveTestUnit(code);
+    expectInitializerType('foo', 'int');
+  }
+
+  Future<void> _objectMethodOnFunctions_helper2(String code) async {
+    await resolveTestUnit(code);
+    expectIdentifierType('t0', "String");
+    expectIdentifierType('t1', "() → String");
+    expectIdentifierType('t2', "int");
+    expectIdentifierType('t3', "String");
+    expectIdentifierType('t4', "() → String");
+    expectIdentifierType('t5', "int");
+  }
+}
+
+abstract class StrongModeTypePropagationTest extends ResolverTestCase {
+  @override
+  void setUp() {
+    super.setUp();
+    AnalysisOptionsImpl options = new AnalysisOptionsImpl();
+    resetWith(options: options);
+  }
+
+  test_foreachInference_dynamic_disabled() async {
+    String code = r'''
+main() {
+  var list = <int>[];
+  for (dynamic v in list) {
+    v; // marker
+  }
+}''';
+    CompilationUnit unit = await resolveSource(code);
+    assertPropagatedIterationType(code, unit, typeProvider.dynamicType);
+    assertTypeOfMarkedExpression(code, unit, typeProvider.dynamicType);
+  }
+
+  test_foreachInference_reusedVar_disabled() async {
+    String code = r'''
+main() {
+  var list = <int>[];
+  var v;
+  for (v in list) {
+    v; // marker
+  }
+}''';
+    CompilationUnit unit = await resolveSource(code);
+    assertPropagatedIterationType(code, unit, typeProvider.dynamicType);
+    assertTypeOfMarkedExpression(code, unit, typeProvider.dynamicType);
+  }
+
+  test_foreachInference_var() async {
+    String code = r'''
+main() {
+  var list = <int>[];
+  for (var v in list) {
+    v; // marker
+  }
+}''';
+    CompilationUnit unit = await resolveSource(code);
+    assertPropagatedIterationType(code, unit, typeProvider.intType);
+    assertTypeOfMarkedExpression(code, unit, typeProvider.intType);
+  }
+
+  test_foreachInference_var_iterable() async {
+    String code = r'''
+main() {
+  Iterable<int> list = <int>[];
+  for (var v in list) {
+    v; // marker
+  }
+}''';
+    CompilationUnit unit = await resolveSource(code);
+    assertPropagatedIterationType(code, unit, typeProvider.intType);
+    assertTypeOfMarkedExpression(code, unit, typeProvider.intType);
+  }
+
+  test_foreachInference_var_stream() async {
+    String code = r'''
+import 'dart:async';
+main() async {
+  Stream<int> stream = null;
+  await for (var v in stream) {
+    v; // marker
+  }
+}''';
+    CompilationUnit unit = await resolveSource(code);
+    assertPropagatedIterationType(code, unit, typeProvider.intType);
+    assertTypeOfMarkedExpression(code, unit, typeProvider.intType);
+  }
+
+  test_inconsistentMethodInheritance_inferFunctionTypeFromTypedef() async {
+    Source source = addSource(r'''
+typedef bool F<E>(E argument);
+
+abstract class Base {
+  f<E extends int>(F<int> x);
+}
+
+abstract class BaseCopy extends Base {
+}
+
+abstract class Override implements Base, BaseCopy {
+  f<E extends int>(x) => null;
+}
+
+class C extends Override implements Base {}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_localVariableInference_bottom_disabled() async {
+    String code = r'''
+main() {
+  var v = null;
+  v; // marker
+}''';
+    CompilationUnit unit = await resolveSource(code);
+    assertAssignedType(code, unit, typeProvider.dynamicType);
+    assertTypeOfMarkedExpression(code, unit, typeProvider.dynamicType);
+  }
+
+  test_localVariableInference_constant() async {
+    String code = r'''
+main() {
+  var v = 3;
+  v; // marker
+}''';
+    CompilationUnit unit = await resolveSource(code);
+    assertAssignedType(code, unit, typeProvider.intType);
+    assertTypeOfMarkedExpression(code, unit, typeProvider.intType);
+  }
+
+  test_localVariableInference_declaredType_disabled() async {
+    String code = r'''
+main() {
+  dynamic v = 3;
+  v; // marker
+}''';
+    CompilationUnit unit = await resolveSource(code);
+    assertAssignedType(code, unit, typeProvider.dynamicType);
+    assertTypeOfMarkedExpression(code, unit, typeProvider.dynamicType);
+  }
+
+  test_localVariableInference_noInitializer_disabled() async {
+    String code = r'''
+main() {
+  var v;
+  v = 3;
+  v; // marker
+}''';
+    CompilationUnit unit = await resolveSource(code);
+    assertAssignedType(code, unit, typeProvider.dynamicType);
+    assertTypeOfMarkedExpression(code, unit, typeProvider.dynamicType);
+  }
+
+  test_localVariableInference_transitive_field_inferred_lexical() async {
+    String code = r'''
+class A {
+  final x = 3;
+  f() {
+    var v = x;
+    return v; // marker
+  }
+}
+main() {
+}
+''';
+    CompilationUnit unit = await resolveSource(code);
+    assertAssignedType(code, unit, typeProvider.intType);
+    assertTypeOfMarkedExpression(code, unit, typeProvider.intType);
+  }
+
+  test_localVariableInference_transitive_field_inferred_reversed() async {
+    String code = r'''
+class A {
+  f() {
+    var v = x;
+    return v; // marker
+  }
+  final x = 3;
+}
+main() {
+}
+''';
+    CompilationUnit unit = await resolveSource(code);
+    assertAssignedType(code, unit, typeProvider.intType);
+    assertTypeOfMarkedExpression(code, unit, typeProvider.intType);
+  }
+
+  test_localVariableInference_transitive_field_lexical() async {
+    String code = r'''
+class A {
+  int x = 3;
+  f() {
+    var v = x;
+    return v; // marker
+  }
+}
+main() {
+}
+''';
+    CompilationUnit unit = await resolveSource(code);
+    assertAssignedType(code, unit, typeProvider.intType);
+    assertTypeOfMarkedExpression(code, unit, typeProvider.intType);
+  }
+
+  test_localVariableInference_transitive_field_reversed() async {
+    String code = r'''
+class A {
+  f() {
+    var v = x;
+    return v; // marker
+  }
+  int x = 3;
+}
+main() {
+}
+''';
+    CompilationUnit unit = await resolveSource(code);
+    assertAssignedType(code, unit, typeProvider.intType);
+    assertTypeOfMarkedExpression(code, unit, typeProvider.intType);
+  }
+
+  test_localVariableInference_transitive_list_local() async {
+    String code = r'''
+main() {
+  var x = <int>[3];
+  var v = x[0];
+  v; // marker
+}''';
+    CompilationUnit unit = await resolveSource(code);
+    assertAssignedType(code, unit, typeProvider.intType);
+    assertTypeOfMarkedExpression(code, unit, typeProvider.intType);
+  }
+
+  test_localVariableInference_transitive_local() async {
+    String code = r'''
+main() {
+  var x = 3;
+  var v = x;
+  v; // marker
+}''';
+    CompilationUnit unit = await resolveSource(code);
+    assertAssignedType(code, unit, typeProvider.intType);
+    assertTypeOfMarkedExpression(code, unit, typeProvider.intType);
+  }
+
+  test_localVariableInference_transitive_toplevel_inferred_lexical() async {
+    String code = r'''
+final x = 3;
+main() {
+  var v = x;
+  v; // marker
+}
+''';
+    CompilationUnit unit = await resolveSource(code);
+    assertAssignedType(code, unit, typeProvider.intType);
+    assertTypeOfMarkedExpression(code, unit, typeProvider.intType);
+  }
+
+  test_localVariableInference_transitive_toplevel_inferred_reversed() async {
+    String code = r'''
+main() {
+  var v = x;
+  v; // marker
+}
+final x = 3;
+''';
+    CompilationUnit unit = await resolveSource(code);
+    assertAssignedType(code, unit, typeProvider.intType);
+    assertTypeOfMarkedExpression(code, unit, typeProvider.intType);
+  }
+
+  test_localVariableInference_transitive_toplevel_lexical() async {
+    String code = r'''
+int x = 3;
+main() {
+  var v = x;
+  v; // marker
+}
+''';
+    CompilationUnit unit = await resolveSource(code);
+    assertAssignedType(code, unit, typeProvider.intType);
+    assertTypeOfMarkedExpression(code, unit, typeProvider.intType);
+  }
+
+  test_localVariableInference_transitive_toplevel_reversed() async {
+    String code = r'''
+main() {
+  var v = x;
+  v; // marker
+}
+int x = 3;
+''';
+    CompilationUnit unit = await resolveSource(code);
+    assertAssignedType(code, unit, typeProvider.intType);
+    assertTypeOfMarkedExpression(code, unit, typeProvider.intType);
+  }
+}
diff --git a/pkg/analyzer/test/generated/strong_mode_driver_test.dart b/pkg/analyzer/test/generated/strong_mode_driver_test.dart
index ec98e5b..c6047e6 100644
--- a/pkg/analyzer/test/generated/strong_mode_driver_test.dart
+++ b/pkg/analyzer/test/generated/strong_mode_driver_test.dart
@@ -6,7 +6,7 @@
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 
 import 'resolver_test_case.dart';
-import 'strong_mode_test.dart';
+import 'strong_mode.dart';
 
 main() {
   defineReflectiveSuite(() {
diff --git a/pkg/analyzer/test/generated/strong_mode_test.dart b/pkg/analyzer/test/generated/strong_mode_test.dart
deleted file mode 100644
index 88127b5..0000000
--- a/pkg/analyzer/test/generated/strong_mode_test.dart
+++ /dev/null
@@ -1,4730 +0,0 @@
-// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'dart:async';
-
-import 'package:analyzer/dart/ast/ast.dart';
-import 'package:analyzer/dart/ast/standard_resolution_map.dart';
-import 'package:analyzer/dart/element/element.dart';
-import 'package:analyzer/dart/element/type.dart';
-import 'package:analyzer/src/dart/element/element.dart';
-import 'package:analyzer/src/error/codes.dart';
-import 'package:analyzer/src/generated/engine.dart';
-import 'package:analyzer/src/generated/source_io.dart';
-import 'package:analyzer/src/task/strong/ast_properties.dart';
-import 'package:front_end/src/base/errors.dart';
-import 'package:test/test.dart';
-import 'package:test_reflective_loader/test_reflective_loader.dart';
-
-import '../src/dart/resolution/find_node.dart';
-import '../utils.dart';
-import 'resolver_test_case.dart';
-
-main() {
-  defineReflectiveSuite(() {
-    defineReflectiveTests(StrongModeLocalInferenceTest);
-    defineReflectiveTests(StrongModeStaticTypeAnalyzer2Test);
-    defineReflectiveTests(StrongModeTypePropagationTest);
-  });
-}
-
-/// Strong mode static analyzer local type inference tests
-@reflectiveTest
-class StrongModeLocalInferenceTest extends ResolverTestCase {
-  TypeAssertions _assertions;
-
-  Asserter<DartType> _isDynamic;
-  Asserter<InterfaceType> _isFutureOfDynamic;
-  Asserter<InterfaceType> _isFutureOfInt;
-  Asserter<InterfaceType> _isFutureOfNull;
-  Asserter<InterfaceType> _isFutureOrOfInt;
-  Asserter<DartType> _isInt;
-  Asserter<DartType> _isNull;
-  Asserter<DartType> _isNum;
-  Asserter<DartType> _isObject;
-  Asserter<DartType> _isString;
-
-  AsserterBuilder2<Asserter<DartType>, Asserter<DartType>, DartType>
-      _isFunction2Of;
-  AsserterBuilder<List<Asserter<DartType>>, InterfaceType> _isFutureOf;
-  AsserterBuilder<List<Asserter<DartType>>, InterfaceType> _isFutureOrOf;
-  AsserterBuilderBuilder<Asserter<DartType>, List<Asserter<DartType>>, DartType>
-      _isInstantiationOf;
-  AsserterBuilder<Asserter<DartType>, InterfaceType> _isListOf;
-  AsserterBuilder2<Asserter<DartType>, Asserter<DartType>, InterfaceType>
-      _isMapOf;
-  AsserterBuilder<List<Asserter<DartType>>, InterfaceType> _isStreamOf;
-  AsserterBuilder<DartType, DartType> _isType;
-
-  AsserterBuilder<Element, DartType> _hasElement;
-  AsserterBuilder<DartType, DartType> _hasElementOf;
-
-  @override
-  Future<TestAnalysisResult> computeAnalysisResult(Source source) async {
-    TestAnalysisResult result = await super.computeAnalysisResult(source);
-    if (_assertions == null) {
-      _assertions = new TypeAssertions(typeProvider);
-      _isType = _assertions.isType;
-      _hasElement = _assertions.hasElement;
-      _isInstantiationOf = _assertions.isInstantiationOf;
-      _isInt = _assertions.isInt;
-      _isNull = _assertions.isNull;
-      _isNum = _assertions.isNum;
-      _isObject = _assertions.isObject;
-      _isString = _assertions.isString;
-      _isDynamic = _assertions.isDynamic;
-      _isListOf = _assertions.isListOf;
-      _isMapOf = _assertions.isMapOf;
-      _isFunction2Of = _assertions.isFunction2Of;
-      _hasElementOf = _assertions.hasElementOf;
-      _isFutureOf = _isInstantiationOf(_hasElementOf(typeProvider.futureType));
-      _isFutureOrOf =
-          _isInstantiationOf(_hasElementOf(typeProvider.futureOrType));
-      _isFutureOfDynamic = _isFutureOf([_isDynamic]);
-      _isFutureOfInt = _isFutureOf([_isInt]);
-      _isFutureOfNull = _isFutureOf([_isNull]);
-      _isFutureOrOfInt = _isFutureOrOf([_isInt]);
-      _isStreamOf = _isInstantiationOf(_hasElementOf(typeProvider.streamType));
-    }
-    return result;
-  }
-
-  @override
-  void setUp() {
-    super.setUp();
-    AnalysisOptionsImpl options = new AnalysisOptionsImpl();
-    resetWith(options: options);
-  }
-
-  test_async_method_propagation() async {
-    String code = r'''
-      import "dart:async";
-      class A {
-        Future f0() => new Future.value(3);
-        Future f1() async => new Future.value(3);
-        Future f2() async => await new Future.value(3);
-
-        Future<int> f3() => new Future.value(3);
-        Future<int> f4() async => new Future.value(3);
-        Future<int> f5() async => await new Future.value(3);
-
-        Future g0() { return new Future.value(3); }
-        Future g1() async { return new Future.value(3); }
-        Future g2() async { return await new Future.value(3); }
-
-        Future<int> g3() { return new Future.value(3); }
-        Future<int> g4() async { return new Future.value(3); }
-        Future<int> g5() async { return await new Future.value(3); }
-      }
-   ''';
-    CompilationUnit unit = await resolveSource(code);
-
-    void check(String name, Asserter<InterfaceType> typeTest) {
-      MethodDeclaration test = AstFinder.getMethodInClass(unit, "A", name);
-      FunctionBody body = test.body;
-      Expression returnExp;
-      if (body is ExpressionFunctionBody) {
-        returnExp = body.expression;
-      } else {
-        ReturnStatement stmt = (body as BlockFunctionBody).block.statements[0];
-        returnExp = stmt.expression;
-      }
-      DartType type = returnExp.staticType;
-      if (returnExp is AwaitExpression) {
-        type = returnExp.expression.staticType;
-      }
-      typeTest(type);
-    }
-
-    check("f0", _isFutureOfDynamic);
-    check("f1", _isFutureOfDynamic);
-    check("f2", _isFutureOfDynamic);
-
-    check("f3", _isFutureOfInt);
-    check("f4", _isFutureOfInt);
-    check("f5", _isFutureOfInt);
-
-    check("g0", _isFutureOfDynamic);
-    check("g1", _isFutureOfDynamic);
-    check("g2", _isFutureOfDynamic);
-
-    check("g3", _isFutureOfInt);
-    check("g4", _isFutureOfInt);
-    check("g5", _isFutureOfInt);
-  }
-
-  test_async_propagation() async {
-    String code = r'''
-      import "dart:async";
-
-      Future f0() => new Future.value(3);
-      Future f1() async => new Future.value(3);
-      Future f2() async => await new Future.value(3);
-
-      Future<int> f3() => new Future.value(3);
-      Future<int> f4() async => new Future.value(3);
-      Future<int> f5() async => await new Future.value(3);
-
-      Future g0() { return new Future.value(3); }
-      Future g1() async { return new Future.value(3); }
-      Future g2() async { return await new Future.value(3); }
-
-      Future<int> g3() { return new Future.value(3); }
-      Future<int> g4() async { return new Future.value(3); }
-      Future<int> g5() async { return await new Future.value(3); }
-   ''';
-    CompilationUnit unit = await resolveSource(code);
-
-    void check(String name, Asserter<InterfaceType> typeTest) {
-      FunctionDeclaration test = AstFinder.getTopLevelFunction(unit, name);
-      FunctionBody body = test.functionExpression.body;
-      Expression returnExp;
-      if (body is ExpressionFunctionBody) {
-        returnExp = body.expression;
-      } else {
-        ReturnStatement stmt = (body as BlockFunctionBody).block.statements[0];
-        returnExp = stmt.expression;
-      }
-      DartType type = returnExp.staticType;
-      if (returnExp is AwaitExpression) {
-        type = returnExp.expression.staticType;
-      }
-      typeTest(type);
-    }
-
-    check("f0", _isFutureOfDynamic);
-    check("f1", _isFutureOfDynamic);
-    check("f2", _isFutureOfDynamic);
-
-    check("f3", _isFutureOfInt);
-    check("f4", _isFutureOfInt);
-    check("f5", _isFutureOfInt);
-
-    check("g0", _isFutureOfDynamic);
-    check("g1", _isFutureOfDynamic);
-    check("g2", _isFutureOfDynamic);
-
-    check("g3", _isFutureOfInt);
-    check("g4", _isFutureOfInt);
-    check("g5", _isFutureOfInt);
-  }
-
-  test_async_star_method_propagation() async {
-    String code = r'''
-      import "dart:async";
-      class A {
-        Stream g0() async* { yield []; }
-        Stream g1() async* { yield* new Stream(); }
-
-        Stream<List<int>> g2() async* { yield []; }
-        Stream<List<int>> g3() async* { yield* new Stream(); }
-      }
-    ''';
-    CompilationUnit unit = await resolveSource(code);
-
-    void check(String name, Asserter<InterfaceType> typeTest) {
-      MethodDeclaration test = AstFinder.getMethodInClass(unit, "A", name);
-      BlockFunctionBody body = test.body;
-      YieldStatement stmt = body.block.statements[0];
-      Expression exp = stmt.expression;
-      typeTest(exp.staticType);
-    }
-
-    check("g0", _isListOf(_isDynamic));
-    check("g1", _isStreamOf([_isDynamic]));
-
-    check("g2", _isListOf(_isInt));
-    check("g3", _isStreamOf([(DartType type) => _isListOf(_isInt)(type)]));
-  }
-
-  test_async_star_propagation() async {
-    String code = r'''
-      import "dart:async";
-
-      Stream g0() async* { yield []; }
-      Stream g1() async* { yield* new Stream(); }
-
-      Stream<List<int>> g2() async* { yield []; }
-      Stream<List<int>> g3() async* { yield* new Stream(); }
-   ''';
-    CompilationUnit unit = await resolveSource(code);
-
-    void check(String name, Asserter<InterfaceType> typeTest) {
-      FunctionDeclaration test = AstFinder.getTopLevelFunction(unit, name);
-      BlockFunctionBody body = test.functionExpression.body;
-      YieldStatement stmt = body.block.statements[0];
-      Expression exp = stmt.expression;
-      typeTest(exp.staticType);
-    }
-
-    check("g0", _isListOf(_isDynamic));
-    check("g1", _isStreamOf([_isDynamic]));
-
-    check("g2", _isListOf(_isInt));
-    check("g3", _isStreamOf([(DartType type) => _isListOf(_isInt)(type)]));
-  }
-
-  test_cascadeExpression() async {
-    String code = r'''
-      class A<T> {
-        List<T> map(T a, List<T> mapper(T x)) => mapper(a);
-      }
-
-      void main () {
-        A<int> a = new A()..map(0, (x) => [x]);
-     }
-   ''';
-    CompilationUnit unit = await resolveSource(code);
-    List<Statement> statements =
-        AstFinder.getStatementsInTopLevelFunction(unit, "main");
-    CascadeExpression fetch(int i) {
-      VariableDeclarationStatement stmt = statements[i];
-      VariableDeclaration decl = stmt.variables.variables[0];
-      CascadeExpression exp = decl.initializer;
-      return exp;
-    }
-
-    Element elementA = AstFinder.getClass(unit, "A").declaredElement;
-
-    CascadeExpression cascade = fetch(0);
-    _isInstantiationOf(_hasElement(elementA))([_isInt])(cascade.staticType);
-    MethodInvocation invoke = cascade.cascadeSections[0];
-    FunctionExpression function = invoke.argumentList.arguments[1];
-    ExecutableElement f0 = function.declaredElement;
-    _isListOf(_isInt)(f0.type.returnType);
-    expect(f0.type.normalParameterTypes[0], typeProvider.intType);
-  }
-
-  test_constrainedByBounds1() async {
-    // Test that upwards inference with two type variables correctly
-    // propogates from the constrained variable to the unconstrained
-    // variable if they are ordered left to right.
-    String code = r'''
-    T f<S, T extends S>(S x) => null;
-    void test() { var x = f(3); }
-   ''';
-    Source source = addSource(code);
-    TestAnalysisResult analysisResult = await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-    CompilationUnit unit = analysisResult.unit;
-    List<Statement> statements =
-        AstFinder.getStatementsInTopLevelFunction(unit, "test");
-    VariableDeclarationStatement stmt = statements[0];
-    VariableDeclaration decl = stmt.variables.variables[0];
-    Expression call = decl.initializer;
-    _isInt(call.staticType);
-  }
-
-  test_constrainedByBounds2() async {
-    // Test that upwards inference with two type variables does
-    // propogate from the constrained variable to the unconstrained
-    // variable if they are ordered right to left.
-    String code = r'''
-    T f<T extends S, S>(S x) => null;
-    void test() { var x = f(3); }
-   ''';
-    Source source = addSource(code);
-    TestAnalysisResult analysisResult = await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-    CompilationUnit unit = analysisResult.unit;
-    List<Statement> statements =
-        AstFinder.getStatementsInTopLevelFunction(unit, "test");
-    VariableDeclarationStatement stmt = statements[0];
-    VariableDeclaration decl = stmt.variables.variables[0];
-    Expression call = decl.initializer;
-    _isInt(call.staticType);
-  }
-
-  test_constrainedByBounds3() async {
-    Source source = addSource(r'''
-      T f<T extends S, S extends int>(S x) => null;
-      void test() { var x = f(3); }
-   ''');
-    TestAnalysisResult analysisResult = await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-    CompilationUnit unit = analysisResult.unit;
-    List<Statement> statements =
-        AstFinder.getStatementsInTopLevelFunction(unit, "test");
-    VariableDeclarationStatement stmt = statements[0];
-    VariableDeclaration decl = stmt.variables.variables[0];
-    Expression call = decl.initializer;
-    _isInt(call.staticType);
-  }
-
-  test_constrainedByBounds4() async {
-    // Test that upwards inference with two type variables correctly
-    // propogates from the constrained variable to the unconstrained
-    // variable if they are ordered left to right, when the variable
-    // appears co and contra variantly
-    String code = r'''
-    typedef To Func1<From, To>(From x);
-    T f<S, T extends Func1<S, S>>(S x) => null;
-    void test() { var x = f(3)(4); }
-   ''';
-    Source source = addSource(code);
-    TestAnalysisResult analysisResult = await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-    CompilationUnit unit = analysisResult.unit;
-    List<Statement> statements =
-        AstFinder.getStatementsInTopLevelFunction(unit, "test");
-    VariableDeclarationStatement stmt = statements[0];
-    VariableDeclaration decl = stmt.variables.variables[0];
-    Expression call = decl.initializer;
-    _isInt(call.staticType);
-  }
-
-  test_constrainedByBounds5() async {
-    // Test that upwards inference with two type variables does not
-    // propogate from the constrained variable to the unconstrained
-    // variable if they are ordered right to left, when the variable
-    // appears co and contra variantly, and that an error is issued
-    // for the non-matching bound.
-    String code = r'''
-    typedef To Func1<From, To>(From x);
-    T f<T extends Func1<S, S>, S>(S x) => null;
-    void test() { var x = f(3)(null); }
-   ''';
-    Source source = addSource(code);
-    TestAnalysisResult analysisResult = await computeAnalysisResult(source);
-    assertErrors(source, [StrongModeCode.COULD_NOT_INFER]);
-    verify([source]);
-    CompilationUnit unit = analysisResult.unit;
-    List<Statement> statements =
-        AstFinder.getStatementsInTopLevelFunction(unit, "test");
-    VariableDeclarationStatement stmt = statements[0];
-    VariableDeclaration decl = stmt.variables.variables[0];
-    Expression call = decl.initializer;
-    _isDynamic(call.staticType);
-  }
-
-  test_constructorInitializer_propagation() async {
-    String code = r'''
-      class A {
-        List<String> x;
-        A() : this.x = [];
-      }
-   ''';
-    CompilationUnit unit = await resolveSource(code);
-    ConstructorDeclaration constructor =
-        AstFinder.getConstructorInClass(unit, "A", null);
-    ConstructorFieldInitializer assignment = constructor.initializers[0];
-    Expression exp = assignment.expression;
-    _isListOf(_isString)(exp.staticType);
-  }
-
-  test_covarianceChecks() async {
-    var source = addSource(r'''
-class C<T> {
-  add(T t) {}
-  forEach(void f(T t)) {}
-}
-class D extends C<int> {
-  add(int t) {}
-  forEach(void f(int t)) {}
-}
-class E extends C<int> {
-  add(Object t) {}
-  forEach(void f(Null t)) {}
-}
-''');
-    var unit = (await computeAnalysisResult(source)).unit;
-    assertNoErrors(source);
-    var cAdd = AstFinder.getMethodInClass(unit, "C", "add");
-    var covariantC = getClassCovariantParameters(AstFinder.getClass(unit, "C"));
-    expect(covariantC.toList(), [cAdd.declaredElement.parameters[0]]);
-
-    var dAdd = AstFinder.getMethodInClass(unit, "D", "add");
-    var covariantD = getClassCovariantParameters(AstFinder.getClass(unit, "D"));
-    expect(covariantD.toList(), [dAdd.declaredElement.parameters[0]]);
-
-    var covariantE = getClassCovariantParameters(AstFinder.getClass(unit, "E"));
-    expect(covariantE.toList(), []);
-  }
-
-  test_covarianceChecks2() async {
-    var content = r'''
-class View<T1> {
-  View<T1> create() => this;
-}
-
-class Bar<T2> extends View<Bar<T2>> {}
-
-main() {
-  var b = new Bar<int>();
-  b.create();
-}
-''';
-    var source = addSource(content);
-    var unit = (await computeAnalysisResult(source)).unit;
-    assertNoErrors(source);
-
-    var findNode = FindNode(content, unit);
-    expect(getImplicitCast(findNode.methodInvocation('b.create')), isNull);
-  }
-
-  test_covarianceChecks_genericMethods() async {
-    var source = addSource(r'''
-class C<T> {
-  add<S>(T t) {}
-  forEach<S>(S f(T t)) {}
-}
-class D extends C<int> {
-  add<S>(int t) {}
-  forEach<S>(S f(int t)) {}
-}
-class E extends C<int> {
-  add<S>(Object t) {}
-  forEach<S>(S f(Null t)) {}
-}
-''');
-    var unit = (await computeAnalysisResult(source)).unit;
-    assertNoErrors(source);
-
-    var cAdd = AstFinder.getMethodInClass(unit, "C", "add");
-    var covariantC = getClassCovariantParameters(AstFinder.getClass(unit, "C"));
-    expect(covariantC.toList(), [cAdd.declaredElement.parameters[0]]);
-
-    var dAdd = AstFinder.getMethodInClass(unit, "D", "add");
-    var covariantD = getClassCovariantParameters(AstFinder.getClass(unit, "D"));
-    expect(covariantD.toList(), [dAdd.declaredElement.parameters[0]]);
-
-    var covariantE = getClassCovariantParameters(AstFinder.getClass(unit, "E"));
-    expect(covariantE.toList(), []);
-  }
-
-  test_covarianceChecks_returnFunction() async {
-    var source = addSource(r'''
-typedef F<T>(T t);
-typedef T R<T>();
-class C<T> {
-  F<T> f;
-
-  C();
-  factory C.fact() => new C<Null>();
-
-  F<T> get g => null;
-  F<T> m1() => null;
-  R<F<T>> m2() => null;
-
-  casts(C<T> other, T t) {
-    other.f;
-    other.g(t);
-    other.m1();
-    other.m2;
-
-    new C<T>.fact().f(t);
-    new C<int>.fact().g;
-    new C<int>.fact().m1;
-    new C<T>.fact().m2();
-
-    new C<Object>.fact().f(42);
-    new C<Object>.fact().g;
-    new C<Object>.fact().m1;
-    new C<Object>.fact().m2();
-
-    new C.fact().f(42);
-    new C.fact().g;
-    new C.fact().m1;
-    new C.fact().m2();
-  }
-
-  noCasts(T t) {
-    f;
-    g;
-    m1();
-    m2();
-
-    f(t);
-    g(t);
-    (f)(t);
-    (g)(t);
-    m1;
-    m2;
-
-    this.f;
-    this.g;
-    this.m1();
-    this.m2();
-    this.m1;
-    this.m2;
-    (this.m1)();
-    (this.m2)();
-    this.f(t);
-    this.g(t);
-    (this.f)(t);
-    (this.g)(t);
-
-    new C<int>().f;
-    new C<T>().g;
-    new C<int>().m1();
-    new C().m2();
-
-    new D().f;
-    new D().g;
-    new D().m1();
-    new D().m2();
-  }
-}
-class D extends C<num> {
-  noCasts(t) {
-    f;
-    this.g;
-    this.m1();
-    m2;
-
-    super.f;
-    super.g;
-    super.m1;
-    super.m2();
-  }
-}
-
-D d;
-C<Object> c;
-C cD;
-C<Null> cN;
-F<Object> f;
-F<Null> fN;
-R<F<Object>> rf;
-R<F<Null>> rfN;
-R<R<F<Object>>> rrf;
-R<R<F<Null>>> rrfN;
-Object obj;
-F<int> fi;
-R<F<int>> rfi;
-R<R<F<int>>> rrfi;
-
-casts() {
-  c.f;
-  c.g;
-  c.m1;
-  c.m1();
-  c.m2();
-
-  fN = c.f;
-  fN = c.g;
-  rfN = c.m1;
-  rrfN = c.m2;
-  fN = c.m1();
-  rfN = c.m2();
-
-  f = c.f;
-  f = c.g;
-  rf = c.m1;
-  rrf = c.m2;
-  f = c.m1();
-  rf = c.m2();
-  c.m2()();
-
-  c.f(obj);
-  c.g(obj);
-  (c.f)(obj);
-  (c.g)(obj);
-  (c.m1)();
-  c.m1()(obj);
-  (c.m2)();
-
-  cD.f;
-  cD.g;
-  cD.m1;
-  cD.m1();
-  cD.m2();
-}
-
-noCasts() {
-  fi = d.f;
-  fi = d.g;
-  rfi = d.m1;
-  fi = d.m1();
-  rrfi = d.m2;
-  rfi = d.m2();
-  d.f(42);
-  d.g(42);
-  (d.f)(42);
-  (d.g)(42);
-  d.m1()(42);
-  d.m2()()(42);
-
-  cN.f;
-  cN.g;
-  cN.m1;
-  cN.m1();
-  cN.m2();
-}
-''');
-    var unit = (await computeAnalysisResult(source)).unit;
-    assertNoErrors(source);
-
-    void expectCast(Statement statement, bool hasCast) {
-      var value = (statement as ExpressionStatement).expression;
-      if (value is AssignmentExpression) {
-        value = (value as AssignmentExpression).rightHandSide;
-      }
-      while (value is FunctionExpressionInvocation) {
-        value = (value as FunctionExpressionInvocation).function;
-      }
-      while (value is ParenthesizedExpression) {
-        value = (value as ParenthesizedExpression).expression;
-      }
-      var isCallingGetter =
-          value is MethodInvocation && !value.methodName.name.startsWith('m');
-      var cast = isCallingGetter
-          ? getImplicitOperationCast(value)
-          : getImplicitCast(value);
-      var castKind = isCallingGetter ? 'special cast' : 'cast';
-      expect(cast, hasCast ? isNotNull : isNull,
-          reason: '`$statement` should ' +
-              (hasCast ? '' : 'not ') +
-              'have a $castKind on `$value`.');
-    }
-
-    for (var s in AstFinder.getStatementsInMethod(unit, 'C', 'noCasts')) {
-      expectCast(s, false);
-    }
-    for (var s in AstFinder.getStatementsInMethod(unit, 'C', 'casts')) {
-      expectCast(s, true);
-    }
-    for (var s in AstFinder.getStatementsInMethod(unit, 'D', 'noCasts')) {
-      expectCast(s, false);
-    }
-    for (var s in AstFinder.getStatementsInTopLevelFunction(unit, 'noCasts')) {
-      expectCast(s, false);
-    }
-    for (var s in AstFinder.getStatementsInTopLevelFunction(unit, 'casts')) {
-      expectCast(s, true);
-    }
-  }
-
-  test_covarianceChecks_superclass() async {
-    var source = addSource(r'''
-class C<T> {
-  add(T t) {}
-  forEach(void f(T t)) {}
-}
-class D {
-  add(int t) {}
-  forEach(void f(int t)) {}
-}
-class E extends D implements C<int> {}
-''');
-    var unit = (await computeAnalysisResult(source)).unit;
-    assertNoErrors(source);
-    var cAdd = AstFinder.getMethodInClass(unit, "C", "add");
-    var covariantC = getClassCovariantParameters(AstFinder.getClass(unit, "C"));
-    expect(covariantC.toList(), [cAdd.declaredElement.parameters[0]]);
-
-    var dAdd = AstFinder.getMethodInClass(unit, "D", "add");
-    var covariantD = getClassCovariantParameters(AstFinder.getClass(unit, "D"));
-    expect(covariantD, null);
-
-    var classE = AstFinder.getClass(unit, "E");
-    var covariantE = getClassCovariantParameters(classE);
-    var superCovariantE = getSuperclassCovariantParameters(classE);
-    expect(covariantE.toList(), []);
-    expect(superCovariantE.toList(), [dAdd.declaredElement.parameters[0]]);
-  }
-
-  test_factoryConstructor_propagation() async {
-    String code = r'''
-      class A<T> {
-        factory A() { return new B(); }
-      }
-      class B<S> extends A<S> {}
-   ''';
-    CompilationUnit unit = await resolveSource(code);
-
-    ConstructorDeclaration constructor =
-        AstFinder.getConstructorInClass(unit, "A", null);
-    BlockFunctionBody body = constructor.body;
-    ReturnStatement stmt = body.block.statements[0];
-    InstanceCreationExpression exp = stmt.expression;
-    ClassElement elementB = AstFinder.getClass(unit, "B").declaredElement;
-    ClassElement elementA = AstFinder.getClass(unit, "A").declaredElement;
-    expect(resolutionMap.typeForTypeName(exp.constructorName.type).element,
-        elementB);
-    _isInstantiationOf(_hasElement(elementB))(
-        [_isType(elementA.typeParameters[0].type)])(exp.staticType);
-  }
-
-  test_fieldDeclaration_propagation() async {
-    String code = r'''
-      class A {
-        List<String> f0 = ["hello"];
-      }
-   ''';
-    CompilationUnit unit = await resolveSource(code);
-
-    VariableDeclaration field = AstFinder.getFieldInClass(unit, "A", "f0");
-
-    _isListOf(_isString)(field.initializer.staticType);
-  }
-
-  test_functionDeclaration_body_propagation() async {
-    String code = r'''
-      typedef T Function2<S, T>(S x);
-
-      List<int> test1() => [];
-
-      Function2<int, int> test2 (int x) {
-        Function2<String, int> inner() {
-          return (x) => x.length;
-        }
-        return (x) => x;
-     }
-   ''';
-    CompilationUnit unit = await resolveSource(code);
-
-    Asserter<InterfaceType> assertListOfInt = _isListOf(_isInt);
-
-    FunctionDeclaration test1 = AstFinder.getTopLevelFunction(unit, "test1");
-    ExpressionFunctionBody body = test1.functionExpression.body;
-    assertListOfInt(body.expression.staticType);
-
-    List<Statement> statements =
-        AstFinder.getStatementsInTopLevelFunction(unit, "test2");
-
-    FunctionDeclaration inner =
-        (statements[0] as FunctionDeclarationStatement).functionDeclaration;
-    BlockFunctionBody body0 = inner.functionExpression.body;
-    ReturnStatement return0 = body0.block.statements[0];
-    Expression anon0 = return0.expression;
-    FunctionType type0 = anon0.staticType;
-    expect(type0.returnType, typeProvider.intType);
-    expect(type0.normalParameterTypes[0], typeProvider.stringType);
-
-    FunctionExpression anon1 = (statements[1] as ReturnStatement).expression;
-    FunctionType type1 =
-        resolutionMap.elementDeclaredByFunctionExpression(anon1).type;
-    expect(type1.returnType, typeProvider.intType);
-    expect(type1.normalParameterTypes[0], typeProvider.intType);
-  }
-
-  test_functionLiteral_assignment_typedArguments() async {
-    String code = r'''
-      typedef T Function2<S, T>(S x);
-
-      void main () {
-        Function2<int, String> l0 = (int x) => null;
-        Function2<int, String> l1 = (int x) => "hello";
-        Function2<int, String> l2 = (String x) => "hello";
-        Function2<int, String> l3 = (int x) => 3;
-        Function2<int, String> l4 = (int x) {return 3;};
-     }
-   ''';
-    CompilationUnit unit = await resolveSource(code);
-    List<Statement> statements =
-        AstFinder.getStatementsInTopLevelFunction(unit, "main");
-    DartType literal(int i) {
-      VariableDeclarationStatement stmt = statements[i];
-      VariableDeclaration decl = stmt.variables.variables[0];
-      FunctionExpression exp = decl.initializer;
-      return resolutionMap.elementDeclaredByFunctionExpression(exp).type;
-    }
-
-    _isFunction2Of(_isInt, _isNull)(literal(0));
-    _isFunction2Of(_isInt, _isString)(literal(1));
-    _isFunction2Of(_isString, _isString)(literal(2));
-    _isFunction2Of(_isInt, _isString)(literal(3));
-    _isFunction2Of(_isInt, _isString)(literal(4));
-  }
-
-  test_functionLiteral_assignment_unTypedArguments() async {
-    String code = r'''
-      typedef T Function2<S, T>(S x);
-
-      void main () {
-        Function2<int, String> l0 = (x) => null;
-        Function2<int, String> l1 = (x) => "hello";
-        Function2<int, String> l2 = (x) => "hello";
-        Function2<int, String> l3 = (x) => 3;
-        Function2<int, String> l4 = (x) {return 3;};
-     }
-   ''';
-    CompilationUnit unit = await resolveSource(code);
-    List<Statement> statements =
-        AstFinder.getStatementsInTopLevelFunction(unit, "main");
-    DartType literal(int i) {
-      VariableDeclarationStatement stmt = statements[i];
-      VariableDeclaration decl = stmt.variables.variables[0];
-      FunctionExpression exp = decl.initializer;
-      return resolutionMap.elementDeclaredByFunctionExpression(exp).type;
-    }
-
-    _isFunction2Of(_isInt, _isNull)(literal(0));
-    _isFunction2Of(_isInt, _isString)(literal(1));
-    _isFunction2Of(_isInt, _isString)(literal(2));
-    _isFunction2Of(_isInt, _isString)(literal(3));
-    _isFunction2Of(_isInt, _isString)(literal(4));
-  }
-
-  test_functionLiteral_body_propagation() async {
-    String code = r'''
-      typedef T Function2<S, T>(S x);
-
-      void main () {
-        Function2<int, List<String>> l0 = (int x) => ["hello"];
-        Function2<int, List<String>> l1 = (String x) => ["hello"];
-        Function2<int, List<String>> l2 = (int x) => [3];
-        Function2<int, List<String>> l3 = (int x) {return [3];};
-     }
-   ''';
-    CompilationUnit unit = await resolveSource(code);
-    List<Statement> statements =
-        AstFinder.getStatementsInTopLevelFunction(unit, "main");
-    Expression functionReturnValue(int i) {
-      VariableDeclarationStatement stmt = statements[i];
-      VariableDeclaration decl = stmt.variables.variables[0];
-      FunctionExpression exp = decl.initializer;
-      FunctionBody body = exp.body;
-      if (body is ExpressionFunctionBody) {
-        return body.expression;
-      } else {
-        Statement stmt = (body as BlockFunctionBody).block.statements[0];
-        return (stmt as ReturnStatement).expression;
-      }
-    }
-
-    Asserter<InterfaceType> assertListOfString = _isListOf(_isString);
-    assertListOfString(functionReturnValue(0).staticType);
-    assertListOfString(functionReturnValue(1).staticType);
-    assertListOfString(functionReturnValue(2).staticType);
-    assertListOfString(functionReturnValue(3).staticType);
-  }
-
-  test_functionLiteral_functionExpressionInvocation_typedArguments() async {
-    String code = r'''
-      class Mapper<F, T> {
-        T map(T mapper(F x)) => mapper(null);
-      }
-
-      void main () {
-        (new Mapper<int, String>().map)((int x) => null);
-        (new Mapper<int, String>().map)((int x) => "hello");
-        (new Mapper<int, String>().map)((String x) => "hello");
-        (new Mapper<int, String>().map)((int x) => 3);
-        (new Mapper<int, String>().map)((int x) {return 3;});
-     }
-   ''';
-    CompilationUnit unit = await resolveSource(code);
-    List<Statement> statements =
-        AstFinder.getStatementsInTopLevelFunction(unit, "main");
-    DartType literal(int i) {
-      ExpressionStatement stmt = statements[i];
-      FunctionExpressionInvocation invk = stmt.expression;
-      FunctionExpression exp = invk.argumentList.arguments[0];
-      return resolutionMap.elementDeclaredByFunctionExpression(exp).type;
-    }
-
-    _isFunction2Of(_isInt, _isNull)(literal(0));
-    _isFunction2Of(_isInt, _isString)(literal(1));
-    _isFunction2Of(_isString, _isString)(literal(2));
-    _isFunction2Of(_isInt, _isString)(literal(3));
-    _isFunction2Of(_isInt, _isString)(literal(4));
-  }
-
-  test_functionLiteral_functionExpressionInvocation_unTypedArguments() async {
-    String code = r'''
-      class Mapper<F, T> {
-        T map(T mapper(F x)) => mapper(null);
-      }
-
-      void main () {
-        (new Mapper<int, String>().map)((x) => null);
-        (new Mapper<int, String>().map)((x) => "hello");
-        (new Mapper<int, String>().map)((x) => "hello");
-        (new Mapper<int, String>().map)((x) => 3);
-        (new Mapper<int, String>().map)((x) {return 3;});
-     }
-   ''';
-    CompilationUnit unit = await resolveSource(code);
-    List<Statement> statements =
-        AstFinder.getStatementsInTopLevelFunction(unit, "main");
-    DartType literal(int i) {
-      ExpressionStatement stmt = statements[i];
-      FunctionExpressionInvocation invk = stmt.expression;
-      FunctionExpression exp = invk.argumentList.arguments[0];
-      return resolutionMap.elementDeclaredByFunctionExpression(exp).type;
-    }
-
-    _isFunction2Of(_isInt, _isNull)(literal(0));
-    _isFunction2Of(_isInt, _isString)(literal(1));
-    _isFunction2Of(_isInt, _isString)(literal(2));
-    _isFunction2Of(_isInt, _isString)(literal(3));
-    _isFunction2Of(_isInt, _isString)(literal(4));
-  }
-
-  test_functionLiteral_functionInvocation_typedArguments() async {
-    String code = r'''
-      String map(String mapper(int x)) => mapper(null);
-
-      void main () {
-        map((int x) => null);
-        map((int x) => "hello");
-        map((String x) => "hello");
-        map((int x) => 3);
-        map((int x) {return 3;});
-     }
-   ''';
-    CompilationUnit unit = await resolveSource(code);
-    List<Statement> statements =
-        AstFinder.getStatementsInTopLevelFunction(unit, "main");
-    DartType literal(int i) {
-      ExpressionStatement stmt = statements[i];
-      MethodInvocation invk = stmt.expression;
-      FunctionExpression exp = invk.argumentList.arguments[0];
-      return resolutionMap.elementDeclaredByFunctionExpression(exp).type;
-    }
-
-    _isFunction2Of(_isInt, _isNull)(literal(0));
-    _isFunction2Of(_isInt, _isString)(literal(1));
-    _isFunction2Of(_isString, _isString)(literal(2));
-    _isFunction2Of(_isInt, _isString)(literal(3));
-    _isFunction2Of(_isInt, _isString)(literal(4));
-  }
-
-  test_functionLiteral_functionInvocation_unTypedArguments() async {
-    String code = r'''
-      String map(String mapper(int x)) => mapper(null);
-
-      void main () {
-        map((x) => null);
-        map((x) => "hello");
-        map((x) => "hello");
-        map((x) => 3);
-        map((x) {return 3;});
-     }
-   ''';
-    CompilationUnit unit = await resolveSource(code);
-    List<Statement> statements =
-        AstFinder.getStatementsInTopLevelFunction(unit, "main");
-    DartType literal(int i) {
-      ExpressionStatement stmt = statements[i];
-      MethodInvocation invk = stmt.expression;
-      FunctionExpression exp = invk.argumentList.arguments[0];
-      return resolutionMap.elementDeclaredByFunctionExpression(exp).type;
-    }
-
-    _isFunction2Of(_isInt, _isNull)(literal(0));
-    _isFunction2Of(_isInt, _isString)(literal(1));
-    _isFunction2Of(_isInt, _isString)(literal(2));
-    _isFunction2Of(_isInt, _isString)(literal(3));
-    _isFunction2Of(_isInt, _isString)(literal(4));
-  }
-
-  test_functionLiteral_methodInvocation_typedArguments() async {
-    String code = r'''
-      class Mapper<F, T> {
-        T map(T mapper(F x)) => mapper(null);
-      }
-
-      void main () {
-        new Mapper<int, String>().map((int x) => null);
-        new Mapper<int, String>().map((int x) => "hello");
-        new Mapper<int, String>().map((String x) => "hello");
-        new Mapper<int, String>().map((int x) => 3);
-        new Mapper<int, String>().map((int x) {return 3;});
-     }
-   ''';
-    CompilationUnit unit = await resolveSource(code);
-    List<Statement> statements =
-        AstFinder.getStatementsInTopLevelFunction(unit, "main");
-    DartType literal(int i) {
-      ExpressionStatement stmt = statements[i];
-      MethodInvocation invk = stmt.expression;
-      FunctionExpression exp = invk.argumentList.arguments[0];
-      return resolutionMap.elementDeclaredByFunctionExpression(exp).type;
-    }
-
-    _isFunction2Of(_isInt, _isNull)(literal(0));
-    _isFunction2Of(_isInt, _isString)(literal(1));
-    _isFunction2Of(_isString, _isString)(literal(2));
-    _isFunction2Of(_isInt, _isString)(literal(3));
-    _isFunction2Of(_isInt, _isString)(literal(4));
-  }
-
-  test_functionLiteral_methodInvocation_unTypedArguments() async {
-    String code = r'''
-      class Mapper<F, T> {
-        T map(T mapper(F x)) => mapper(null);
-      }
-
-      void main () {
-        new Mapper<int, String>().map((x) => null);
-        new Mapper<int, String>().map((x) => "hello");
-        new Mapper<int, String>().map((x) => "hello");
-        new Mapper<int, String>().map((x) => 3);
-        new Mapper<int, String>().map((x) {return 3;});
-     }
-   ''';
-    CompilationUnit unit = await resolveSource(code);
-    List<Statement> statements =
-        AstFinder.getStatementsInTopLevelFunction(unit, "main");
-    DartType literal(int i) {
-      ExpressionStatement stmt = statements[i];
-      MethodInvocation invk = stmt.expression;
-      FunctionExpression exp = invk.argumentList.arguments[0];
-      return resolutionMap.elementDeclaredByFunctionExpression(exp).type;
-    }
-
-    _isFunction2Of(_isInt, _isNull)(literal(0));
-    _isFunction2Of(_isInt, _isString)(literal(1));
-    _isFunction2Of(_isInt, _isString)(literal(2));
-    _isFunction2Of(_isInt, _isString)(literal(3));
-    _isFunction2Of(_isInt, _isString)(literal(4));
-  }
-
-  test_functionLiteral_unTypedArgument_propagation() async {
-    String code = r'''
-      typedef T Function2<S, T>(S x);
-
-      void main () {
-        Function2<int, int> l0 = (x) => x;
-        Function2<int, int> l1 = (x) => x+1;
-        Function2<int, String> l2 = (x) => x;
-        Function2<int, String> l3 = (x) => x.toLowerCase();
-        Function2<String, String> l4 = (x) => x.toLowerCase();
-     }
-   ''';
-    CompilationUnit unit = await resolveSource(code);
-    List<Statement> statements =
-        AstFinder.getStatementsInTopLevelFunction(unit, "main");
-    Expression functionReturnValue(int i) {
-      VariableDeclarationStatement stmt = statements[i];
-      VariableDeclaration decl = stmt.variables.variables[0];
-      FunctionExpression exp = decl.initializer;
-      FunctionBody body = exp.body;
-      if (body is ExpressionFunctionBody) {
-        return body.expression;
-      } else {
-        Statement stmt = (body as BlockFunctionBody).block.statements[0];
-        return (stmt as ReturnStatement).expression;
-      }
-    }
-
-    expect(functionReturnValue(0).staticType, typeProvider.intType);
-    expect(functionReturnValue(1).staticType, typeProvider.intType);
-    expect(functionReturnValue(2).staticType, typeProvider.intType);
-    expect(functionReturnValue(3).staticType, typeProvider.dynamicType);
-    expect(functionReturnValue(4).staticType, typeProvider.stringType);
-  }
-
-  test_futureOr_assignFromFuture() async {
-    // Test a Future<T> can be assigned to FutureOr<T>.
-    MethodInvocation invoke = await _testFutureOr(r'''
-    FutureOr<T> mk<T>(Future<T> x) => x;
-    test() => mk(new Future<int>.value(42));
-    ''');
-    _isFutureOrOfInt(invoke.staticType);
-  }
-
-  test_futureOr_assignFromValue() async {
-    // Test a T can be assigned to FutureOr<T>.
-    MethodInvocation invoke = await _testFutureOr(r'''
-    FutureOr<T> mk<T>(T x) => x;
-    test() => mk(42);
-    ''');
-    _isFutureOrOfInt(invoke.staticType);
-  }
-
-  test_futureOr_asyncExpressionBody() async {
-    // A FutureOr<T> can be used as the expression body for an async function
-    MethodInvocation invoke = await _testFutureOr(r'''
-    Future<T> mk<T>(FutureOr<T> x) async => x;
-    test() => mk(42);
-    ''');
-    _isFutureOfInt(invoke.staticType);
-  }
-
-  test_futureOr_asyncReturn() async {
-    // A FutureOr<T> can be used as the return value for an async function
-    MethodInvocation invoke = await _testFutureOr(r'''
-    Future<T> mk<T>(FutureOr<T> x) async { return x; }
-    test() => mk(42);
-    ''');
-    _isFutureOfInt(invoke.staticType);
-  }
-
-  test_futureOr_await() async {
-    // Test a FutureOr<T> can be awaited.
-    MethodInvocation invoke = await _testFutureOr(r'''
-    Future<T> mk<T>(FutureOr<T> x) async => await x;
-    test() => mk(42);
-    ''');
-    _isFutureOfInt(invoke.staticType);
-  }
-
-  test_futureOr_downwards1() async {
-    // Test that downwards inference interacts correctly with FutureOr
-    // parameters.
-    MethodInvocation invoke = await _testFutureOr(r'''
-    Future<T> mk<T>(FutureOr<T> x) => null;
-    Future<int> test() => mk(new Future<int>.value(42));
-    ''');
-    _isFutureOfInt(invoke.staticType);
-  }
-
-  test_futureOr_downwards2() async {
-    // Test that downwards inference interacts correctly with FutureOr
-    // parameters when the downwards context is FutureOr
-    MethodInvocation invoke = await _testFutureOr(r'''
-    Future<T> mk<T>(FutureOr<T> x) => null;
-    FutureOr<int> test() => mk(new Future<int>.value(42));
-    ''');
-    _isFutureOfInt(invoke.staticType);
-  }
-
-  test_futureOr_downwards3() async {
-    // Test that downwards inference correctly propogates into
-    // arguments.
-    MethodInvocation invoke = await _testFutureOr(r'''
-    Future<T> mk<T>(FutureOr<T> x) => null;
-    Future<int> test() => mk(new Future.value(42));
-    ''');
-    _isFutureOfInt(invoke.staticType);
-    _isFutureOfInt(invoke.argumentList.arguments[0].staticType);
-  }
-
-  test_futureOr_downwards4() async {
-    // Test that downwards inference interacts correctly with FutureOr
-    // parameters when the downwards context is FutureOr
-    MethodInvocation invoke = await _testFutureOr(r'''
-    Future<T> mk<T>(FutureOr<T> x) => null;
-    FutureOr<int> test() => mk(new Future.value(42));
-    ''');
-    _isFutureOfInt(invoke.staticType);
-    _isFutureOfInt(invoke.argumentList.arguments[0].staticType);
-  }
-
-  test_futureOr_downwards5() async {
-    // Test that downwards inference correctly pins the type when it
-    // comes from a FutureOr
-    MethodInvocation invoke = await _testFutureOr(r'''
-    Future<T> mk<T>(FutureOr<T> x) => null;
-    FutureOr<num> test() => mk(new Future.value(42));
-    ''');
-    _isFutureOf([_isNum])(invoke.staticType);
-    _isFutureOf([_isNum])(invoke.argumentList.arguments[0].staticType);
-  }
-
-  test_futureOr_downwards6() async {
-    // Test that downwards inference doesn't decompose FutureOr
-    // when instantiating type variables.
-    MethodInvocation invoke = await _testFutureOr(r'''
-    T mk<T>(T x) => null;
-    FutureOr<int> test() => mk(new Future.value(42));
-    ''');
-    _isFutureOrOfInt(invoke.staticType);
-    _isFutureOfInt(invoke.argumentList.arguments[0].staticType);
-  }
-
-  test_futureOr_downwards7() async {
-    // Test that downwards inference incorporates bounds correctly
-    // when instantiating type variables.
-    MethodInvocation invoke = await _testFutureOr(r'''
-      T mk<T extends Future<int>>(T x) => null;
-      FutureOr<int> test() => mk(new Future.value(42));
-    ''');
-    _isFutureOfInt(invoke.staticType);
-    _isFutureOfInt(invoke.argumentList.arguments[0].staticType);
-  }
-
-  test_futureOr_downwards8() async {
-    // Test that downwards inference incorporates bounds correctly
-    // when instantiating type variables.
-    // TODO(leafp): I think this should pass once the inference changes
-    // that jmesserly is adding are landed.
-    MethodInvocation invoke = await _testFutureOr(r'''
-    T mk<T extends Future<Object>>(T x) => null;
-    FutureOr<int> test() => mk(new Future.value(42));
-    ''');
-    _isFutureOfInt(invoke.staticType);
-    _isFutureOfInt(invoke.argumentList.arguments[0].staticType);
-  }
-
-  test_futureOr_downwards9() async {
-    // Test that downwards inference decomposes correctly with
-    // other composite types
-    MethodInvocation invoke = await _testFutureOr(r'''
-    List<T> mk<T>(T x) => null;
-    FutureOr<List<int>> test() => mk(3);
-    ''');
-    _isListOf(_isInt)(invoke.staticType);
-    _isInt(invoke.argumentList.arguments[0].staticType);
-  }
-
-  test_futureOr_methods1() async {
-    // Test that FutureOr has the Object methods
-    MethodInvocation invoke = await _testFutureOr(r'''
-    dynamic test(FutureOr<int> x) => x.toString();
-    ''');
-    _isString(invoke.staticType);
-  }
-
-  test_futureOr_methods2() async {
-    // Test that FutureOr does not have the constituent type methods
-    MethodInvocation invoke = await _testFutureOr(r'''
-    dynamic test(FutureOr<int> x) => x.abs();
-    ''', errors: [StaticTypeWarningCode.UNDEFINED_METHOD]);
-    _isDynamic(invoke.staticType);
-  }
-
-  test_futureOr_methods3() async {
-    // Test that FutureOr does not have the Future type methods
-    MethodInvocation invoke = await _testFutureOr(r'''
-    dynamic test(FutureOr<int> x) => x.then((x) => x);
-    ''', errors: [StaticTypeWarningCode.UNDEFINED_METHOD]);
-    _isDynamic(invoke.staticType);
-  }
-
-  test_futureOr_methods4() async {
-    // Test that FutureOr<dynamic> does not have all methods
-    MethodInvocation invoke = await _testFutureOr(r'''
-    dynamic test(FutureOr<dynamic> x) => x.abs();
-    ''', errors: [StaticTypeWarningCode.UNDEFINED_METHOD]);
-    _isDynamic(invoke.staticType);
-  }
-
-  test_futureOr_no_return() async {
-    MethodInvocation invoke = await _testFutureOr(r'''
-    FutureOr<T> mk<T>(Future<T> x) => x;
-    Future<int> f;
-    test() => f.then((int x) {});
-    ''');
-    _isFunction2Of(_isInt, _isNull)(
-        invoke.argumentList.arguments[0].staticType);
-    _isFutureOfNull(invoke.staticType);
-  }
-
-  test_futureOr_no_return_value() async {
-    MethodInvocation invoke = await _testFutureOr(r'''
-    FutureOr<T> mk<T>(Future<T> x) => x;
-    Future<int> f;
-    test() => f.then((int x) {return;});
-    ''');
-    _isFunction2Of(_isInt, _isNull)(
-        invoke.argumentList.arguments[0].staticType);
-    _isFutureOfNull(invoke.staticType);
-  }
-
-  test_futureOr_return_null() async {
-    MethodInvocation invoke = await _testFutureOr(r'''
-    FutureOr<T> mk<T>(Future<T> x) => x;
-    Future<int> f;
-    test() => f.then((int x) {return null;});
-    ''');
-    _isFunction2Of(_isInt, _isNull)(
-        invoke.argumentList.arguments[0].staticType);
-    _isFutureOfNull(invoke.staticType);
-  }
-
-  test_futureOr_upwards1() async {
-    // Test that upwards inference correctly prefers to instantiate type
-    // variables with the "smaller" solution when both are possible.
-    MethodInvocation invoke = await _testFutureOr(r'''
-    Future<T> mk<T>(FutureOr<T> x) => null;
-    dynamic test() => mk(new Future<int>.value(42));
-    ''');
-    _isFutureOfInt(invoke.staticType);
-  }
-
-  test_futureOr_upwards2() async {
-    // Test that upwards inference fails when the solution doesn't
-    // match the bound.
-    MethodInvocation invoke = await _testFutureOr(r'''
-    Future<T> mk<T extends Future<Object>>(FutureOr<T> x) => null;
-    dynamic test() => mk(new Future<int>.value(42));
-    ''', errors: [StrongModeCode.COULD_NOT_INFER]);
-    _isFutureOfInt(invoke.staticType);
-  }
-
-  test_futureOrNull_no_return() async {
-    MethodInvocation invoke = await _testFutureOr(r'''
-    FutureOr<T> mk<T>(Future<T> x) => x;
-    Future<int> f;
-    test() => f.then<Null>((int x) {});
-    ''');
-    _isFunction2Of(_isInt, _isNull)(
-        invoke.argumentList.arguments[0].staticType);
-    _isFutureOfNull(invoke.staticType);
-  }
-
-  test_futureOrNull_no_return_value() async {
-    MethodInvocation invoke = await _testFutureOr(r'''
-    FutureOr<T> mk<T>(Future<T> x) => x;
-    Future<int> f;
-    test() => f.then<Null>((int x) {return;});
-    ''');
-    _isFunction2Of(_isInt, _isNull)(
-        invoke.argumentList.arguments[0].staticType);
-    _isFutureOfNull(invoke.staticType);
-  }
-
-  test_futureOrNull_return_null() async {
-    MethodInvocation invoke = await _testFutureOr(r'''
-    FutureOr<T> mk<T>(Future<T> x) => x;
-    Future<int> f;
-    test() => f.then<Null>((int x) { return null;});
-    ''');
-    _isFunction2Of(_isInt, _isNull)(
-        invoke.argumentList.arguments[0].staticType);
-    _isFutureOfNull(invoke.staticType);
-  }
-
-  test_generic_partial() async {
-    // Test that upward and downward type inference handles partial
-    // type schemas correctly.  Downwards inference in a partial context
-    // (e.g. Map<String, ?>) should still allow upwards inference to fill
-    // in the missing information.
-    String code = r'''
-class A<T> {
-  A(T x);
-  A.fromA(A<T> a) {}
-  A.fromMap(Map<String, T> m) {}
-  A.fromList(List<T> m) {}
-  A.fromT(T t) {}
-  A.fromB(B<T, String> a) {}
-}
-
-class B<S, T> {
-  B(S s);
-}
-
-void test() {
-    var a0 = new A.fromA(new A(3));
-    var a1 = new A.fromMap({'hello' : 3});
-    var a2 = new A.fromList([3]);
-    var a3 = new A.fromT(3);
-    var a4 = new A.fromB(new B(3));
-}
-   ''';
-    CompilationUnit unit = await resolveSource(code);
-    Element elementA = AstFinder.getClass(unit, "A").declaredElement;
-    List<Statement> statements =
-        AstFinder.getStatementsInTopLevelFunction(unit, "test");
-    void check(int i) {
-      VariableDeclarationStatement stmt = statements[i];
-      VariableDeclaration decl = stmt.variables.variables[0];
-      Expression init = decl.initializer;
-      _isInstantiationOf(_hasElement(elementA))([_isInt])(init.staticType);
-    }
-
-    for (var i = 0; i < 5; i++) check(i);
-  }
-
-  test_inferConstructor_unknownTypeLowerBound() async {
-    Source source = addSource(r'''
-        class C<T> {
-          C(void callback(List<T> a));
-        }
-        test() {
-          // downwards inference pushes List<?> and in parameter position this
-          // becomes inferred as List<Null>.
-          var c = new C((items) {});
-        }
-        ''');
-    CompilationUnit unit = (await computeAnalysisResult(source)).unit;
-    assertNoErrors(source);
-    verify([source]);
-    DartType cType = findLocalVariable(unit, 'c').type;
-    Element elementC = AstFinder.getClass(unit, "C").declaredElement;
-
-    _isInstantiationOf(_hasElement(elementC))([_isDynamic])(cType);
-  }
-
-  test_inference_error_arguments() async {
-    Source source = addSource(r'''
-typedef R F<T, R>(T t);
-
-F<T, T> g<T>(F<T, T> f) => (x) => f(f(x));
-
-test() {
-  var h = g((int x) => 42.0);
-}
- ''');
-    await computeAnalysisResult(source);
-    _expectInferenceError(source, [
-      StrongModeCode.COULD_NOT_INFER,
-      StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE
-    ], r'''
-Couldn't infer type parameter 'T'.
-
-Tried to infer 'double' for 'T' which doesn't work:
-  Parameter 'f' declared as     '(T) → T'
-                but argument is '(int) → double'.
-
-Consider passing explicit type argument(s) to the generic.
-
-''');
-  }
-
-  test_inference_error_arguments2() async {
-    Source source = addSource(r'''
-typedef R F<T, R>(T t);
-
-F<T, T> g<T>(F<T, T> a, F<T, T> b) => (x) => a(b(x));
-
-test() {
-  var h = g((int x) => 42.0, (double x) => 42);
-}
- ''');
-    await computeAnalysisResult(source);
-    _expectInferenceError(source, [
-      StrongModeCode.COULD_NOT_INFER,
-      StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE,
-      StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE
-    ], r'''
-Couldn't infer type parameter 'T'.
-
-Tried to infer 'num' for 'T' which doesn't work:
-  Parameter 'a' declared as     '(T) → T'
-                but argument is '(int) → double'.
-  Parameter 'b' declared as     '(T) → T'
-                but argument is '(double) → int'.
-
-Consider passing explicit type argument(s) to the generic.
-
-''');
-  }
-
-  test_inference_error_extendsFromReturn() async {
-    // This is not an inference error because we successfully infer Null.
-    Source source = addSource(r'''
-T max<T extends num>(T x, T y) => x;
-
-test() {
-  String hello = max(1, 2);
-}
- ''');
-    var analysisResult = await computeAnalysisResult(source);
-    assertErrors(source, [
-      StrongModeCode.INVALID_CAST_LITERAL,
-      StrongModeCode.INVALID_CAST_LITERAL
-    ]);
-    var unit = analysisResult.unit;
-    var h = (AstFinder.getStatementsInTopLevelFunction(unit, "test")[0]
-            as VariableDeclarationStatement)
-        .variables
-        .variables[0];
-    var call = h.initializer as MethodInvocation;
-    expect(call.staticInvokeType.toString(), '(Null, Null) → Null');
-  }
-
-  test_inference_error_extendsFromReturn2() async {
-    Source source = addSource(r'''
-typedef R F<T, R>(T t);
-F<T, T> g<T extends num>() => (y) => y;
-
-test() {
-  F<String, String> hello = g();
-}
- ''');
-    await computeAnalysisResult(source);
-    _expectInferenceError(source, [
-      StrongModeCode.COULD_NOT_INFER,
-    ], r'''
-Couldn't infer type parameter 'T'.
-
-Tried to infer 'String' for 'T' which doesn't work:
-  Type parameter 'T' declared to extend 'num'.
-The type 'String' was inferred from:
-  Return type declared as '(T) → T'
-              used where  '(String) → String' is required.
-
-Consider passing explicit type argument(s) to the generic.
-
-''');
-  }
-
-  test_inference_error_genericFunction() async {
-    Source source = addSource(r'''
-T max<T extends num>(T x, T y) => x < y ? y : x;
-abstract class Iterable<T> {
-  T get first;
-  S fold<S>(S s, S f(S s, T t));
-}
-test(Iterable values) {
-  num n = values.fold(values.first as num, max);
-}
- ''');
-    await computeAnalysisResult(source);
-    _expectInferenceError(source, [
-      StrongModeCode.COULD_NOT_INFER,
-      StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE
-    ], r'''
-Couldn't infer type parameter 'T'.
-
-Tried to infer 'dynamic' for 'T' which doesn't work:
-  Function type declared as '<T extends num>(T, T) → T'
-                used where  '(num, dynamic) → num' is required.
-
-Consider passing explicit type argument(s) to the generic.
-
-''');
-  }
-
-  test_inference_error_returnContext() async {
-    Source source = addSource(r'''
-typedef R F<T, R>(T t);
-
-F<T, T> g<T>(T t) => (x) => t;
-
-test() {
-  F<num, int> h = g(42);
-}
- ''');
-    await computeAnalysisResult(source);
-    _expectInferenceError(source, [StrongModeCode.COULD_NOT_INFER], r'''
-Couldn't infer type parameter 'T'.
-
-Tried to infer 'num' for 'T' which doesn't work:
-  Return type declared as '(T) → T'
-              used where  '(num) → int' is required.
-
-Consider passing explicit type argument(s) to the generic.
-
-''');
-  }
-
-  test_inference_hints() async {
-    Source source = addSource(r'''
-      void main () {
-        var x = 3;
-        List<int> l0 = [];
-     }
-   ''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_inference_simplePolymorphicRecursion_function() async {
-    // Regression test for https://github.com/dart-lang/sdk/issues/30980
-    // Check that inference works properly when inferring the type argument
-    // for a self-recursive call with a function type
-    var source = addSource(r'''
-void _mergeSort<T>(T Function(T) list, int compare(T a, T b), T Function(T) target) {
-  _mergeSort(list, compare, target);
-  _mergeSort(list, compare, list);
-  _mergeSort(target, compare, target);
-  _mergeSort(target, compare, list);
-}
-    ''');
-    var analysisResult = await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-    var unit = analysisResult.unit;
-    var body = (AstFinder.getTopLevelFunction(unit, '_mergeSort')
-        .functionExpression
-        .body as BlockFunctionBody);
-    var stmts = body.block.statements;
-    for (ExpressionStatement stmt in stmts) {
-      MethodInvocation invoke = stmt.expression;
-      ParameterizedType fType = invoke.staticInvokeType;
-      expect(fType.typeArguments[0].toString(), 'T');
-    }
-  }
-
-  test_inference_simplePolymorphicRecursion_interface() async {
-    // Regression test for https://github.com/dart-lang/sdk/issues/30980
-    // Check that inference works properly when inferring the type argument
-    // for a self-recursive call with an interface type
-    var source = addSource(r'''
-void _mergeSort<T>(List<T> list, int compare(T a, T b), List<T> target) {
-  _mergeSort(list, compare, target);
-  _mergeSort(list, compare, list);
-  _mergeSort(target, compare, target);
-  _mergeSort(target, compare, list);
-}
-    ''');
-    var analysisResult = await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-    var unit = analysisResult.unit;
-    var body = (AstFinder.getTopLevelFunction(unit, '_mergeSort')
-        .functionExpression
-        .body as BlockFunctionBody);
-    var stmts = body.block.statements;
-    for (ExpressionStatement stmt in stmts) {
-      MethodInvocation invoke = stmt.expression;
-      ParameterizedType fType = invoke.staticInvokeType;
-      expect(fType.typeArguments[0].toString(), 'T');
-    }
-  }
-
-  test_inference_simplePolymorphicRecursion_simple() async {
-    // Regression test for https://github.com/dart-lang/sdk/issues/30980
-    // Check that inference works properly when inferring the type argument
-    // for a self-recursive call with a simple type parameter
-    var source = addSource(r'''
-void _mergeSort<T>(T list, int compare(T a, T b), T target) {
-  _mergeSort(list, compare, target);
-  _mergeSort(list, compare, list);
-  _mergeSort(target, compare, target);
-  _mergeSort(target, compare, list);
-}
-    ''');
-    var analysisResult = await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-    var unit = analysisResult.unit;
-    var body = (AstFinder.getTopLevelFunction(unit, '_mergeSort')
-        .functionExpression
-        .body as BlockFunctionBody);
-    var stmts = body.block.statements;
-    for (ExpressionStatement stmt in stmts) {
-      MethodInvocation invoke = stmt.expression;
-      ParameterizedType fType = invoke.staticInvokeType;
-      expect(fType.typeArguments[0].toString(), 'T');
-    }
-  }
-
-  test_inferGenericInstantiation() async {
-    // Verify that we don't infer '?` when we instantiate a generic function.
-    var source = addSource(r'''
-T f<T>(T x(T t)) => x(null);
-S g<S>(S s) => s;
-test() {
- var h = f(g);
-}
-    ''');
-    var analysisResult = await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-    var unit = analysisResult.unit;
-    var h = (AstFinder.getStatementsInTopLevelFunction(unit, "test")[0]
-            as VariableDeclarationStatement)
-        .variables
-        .variables[0];
-    _isDynamic(h.declaredElement.type);
-    var fCall = h.initializer as MethodInvocation;
-    expect(
-        fCall.staticInvokeType.toString(), '((dynamic) → dynamic) → dynamic');
-    var g = fCall.argumentList.arguments[0];
-    expect(g.staticType.toString(), '(dynamic) → dynamic');
-  }
-
-  test_inferGenericInstantiation2() async {
-    // Verify the behavior when we cannot infer an instantiation due to invalid
-    // constraints from an outer generic method.
-    var source = addSource(r'''
-T max<T extends num>(T x, T y) => x < y ? y : x;
-abstract class Iterable<T> {
-  T get first;
-  S fold<S>(S s, S f(S s, T t));
-}
-num test(Iterable values) => values.fold(values.first as num, max);
-    ''');
-    var analysisResult = await computeAnalysisResult(source);
-    assertErrors(source, [
-      StrongModeCode.COULD_NOT_INFER,
-      StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE
-    ]);
-    verify([source]);
-    var unit = analysisResult.unit;
-    var fold = (AstFinder.getTopLevelFunction(unit, 'test')
-            .functionExpression
-            .body as ExpressionFunctionBody)
-        .expression as MethodInvocation;
-    expect(
-        fold.staticInvokeType.toString(), '(num, (num, dynamic) → num) → num');
-    var max = fold.argumentList.arguments[1];
-    // TODO(jmesserly): arguably (num, num) → num is better here.
-    expect(max.staticType.toString(), '(dynamic, dynamic) → dynamic');
-  }
-
-  test_inferredFieldDeclaration_propagation() async {
-    // Regression test for https://github.com/dart-lang/sdk/issues/25546
-    String code = r'''
-      abstract class A {
-        Map<int, List<int>> get map;
-      }
-      class B extends A {
-        var map = { 42: [] };
-      }
-      class C extends A {
-        get map => { 43: [] };
-      }
-   ''';
-    CompilationUnit unit = await resolveSource(code);
-
-    Asserter<InterfaceType> assertListOfInt = _isListOf(_isInt);
-    Asserter<InterfaceType> assertMapOfIntToListOfInt =
-        _isMapOf(_isInt, (DartType type) => assertListOfInt(type));
-
-    VariableDeclaration mapB = AstFinder.getFieldInClass(unit, "B", "map");
-    MethodDeclaration mapC = AstFinder.getMethodInClass(unit, "C", "map");
-    assertMapOfIntToListOfInt(
-        resolutionMap.elementDeclaredByVariableDeclaration(mapB).type);
-    assertMapOfIntToListOfInt(
-        resolutionMap.elementDeclaredByMethodDeclaration(mapC).returnType);
-
-    MapLiteral mapLiteralB = mapB.initializer;
-    MapLiteral mapLiteralC = (mapC.body as ExpressionFunctionBody).expression;
-    assertMapOfIntToListOfInt(mapLiteralB.staticType);
-    assertMapOfIntToListOfInt(mapLiteralC.staticType);
-
-    ListLiteral listLiteralB = mapLiteralB.entries[0].value;
-    ListLiteral listLiteralC = mapLiteralC.entries[0].value;
-    assertListOfInt(listLiteralB.staticType);
-    assertListOfInt(listLiteralC.staticType);
-  }
-
-  test_instanceCreation() async {
-    String code = r'''
-      class A<S, T> {
-        S x;
-        T y;
-        A(this.x, this.y);
-        A.named(this.x, this.y);
-      }
-
-      class B<S, T> extends A<T, S> {
-        B(S y, T x) : super(x, y);
-        B.named(S y, T x) : super.named(x, y);
-      }
-
-      class C<S> extends B<S, S> {
-        C(S a) : super(a, a);
-        C.named(S a) : super.named(a, a);
-      }
-
-      class D<S, T> extends B<T, int> {
-        D(T a) : super(a, 3);
-        D.named(T a) : super.named(a, 3);
-      }
-
-      class E<S, T> extends A<C<S>, T> {
-        E(T a) : super(null, a);
-      }
-
-      class F<S, T> extends A<S, T> {
-        F(S x, T y, {List<S> a, List<T> b}) : super(x, y);
-        F.named(S x, T y, [S a, T b]) : super(a, b);
-      }
-
-      void test0() {
-        A<int, String> a0 = new A(3, "hello");
-        A<int, String> a1 = new A.named(3, "hello");
-        A<int, String> a2 = new A<int, String>(3, "hello");
-        A<int, String> a3 = new A<int, String>.named(3, "hello");
-        A<int, String> a4 = new A<int, dynamic>(3, "hello");
-        A<int, String> a5 = new A<dynamic, dynamic>.named(3, "hello");
-      }
-      void test1()  {
-        A<int, String> a0 = new A("hello", 3);
-        A<int, String> a1 = new A.named("hello", 3);
-      }
-      void test2() {
-        A<int, String> a0 = new B("hello", 3);
-        A<int, String> a1 = new B.named("hello", 3);
-        A<int, String> a2 = new B<String, int>("hello", 3);
-        A<int, String> a3 = new B<String, int>.named("hello", 3);
-        A<int, String> a4 = new B<String, dynamic>("hello", 3);
-        A<int, String> a5 = new B<dynamic, dynamic>.named("hello", 3);
-      }
-      void test3() {
-        A<int, String> a0 = new B(3, "hello");
-        A<int, String> a1 = new B.named(3, "hello");
-      }
-      void test4() {
-        A<int, int> a0 = new C(3);
-        A<int, int> a1 = new C.named(3);
-        A<int, int> a2 = new C<int>(3);
-        A<int, int> a3 = new C<int>.named(3);
-        A<int, int> a4 = new C<dynamic>(3);
-        A<int, int> a5 = new C<dynamic>.named(3);
-      }
-      void test5() {
-        A<int, int> a0 = new C("hello");
-        A<int, int> a1 = new C.named("hello");
-      }
-      void test6()  {
-        A<int, String> a0 = new D("hello");
-        A<int, String> a1 = new D.named("hello");
-        A<int, String> a2 = new D<int, String>("hello");
-        A<int, String> a3 = new D<String, String>.named("hello");
-        A<int, String> a4 = new D<num, dynamic>("hello");
-        A<int, String> a5 = new D<dynamic, dynamic>.named("hello");
-      }
-      void test7() {
-        A<int, String> a0 = new D(3);
-        A<int, String> a1 = new D.named(3);
-      }
-      void test8() {
-        A<C<int>, String> a0 = new E("hello");
-      }
-      void test9() { // Check named and optional arguments
-        A<int, String> a0 = new F(3, "hello", a: [3], b: ["hello"]);
-        A<int, String> a1 = new F(3, "hello", a: ["hello"], b:[3]);
-        A<int, String> a2 = new F.named(3, "hello", 3, "hello");
-        A<int, String> a3 = new F.named(3, "hello");
-        A<int, String> a4 = new F.named(3, "hello", "hello", 3);
-        A<int, String> a5 = new F.named(3, "hello", "hello");
-      }''';
-    CompilationUnit unit = await resolveSource(code);
-
-    Expression rhs(VariableDeclarationStatement stmt) {
-      VariableDeclaration decl = stmt.variables.variables[0];
-      Expression exp = decl.initializer;
-      return exp;
-    }
-
-    void hasType(Asserter<DartType> assertion, Expression exp) =>
-        assertion(exp.staticType);
-
-    Element elementA = AstFinder.getClass(unit, "A").declaredElement;
-    Element elementB = AstFinder.getClass(unit, "B").declaredElement;
-    Element elementC = AstFinder.getClass(unit, "C").declaredElement;
-    Element elementD = AstFinder.getClass(unit, "D").declaredElement;
-    Element elementE = AstFinder.getClass(unit, "E").declaredElement;
-    Element elementF = AstFinder.getClass(unit, "F").declaredElement;
-
-    AsserterBuilder<List<Asserter<DartType>>, DartType> assertAOf =
-        _isInstantiationOf(_hasElement(elementA));
-    AsserterBuilder<List<Asserter<DartType>>, DartType> assertBOf =
-        _isInstantiationOf(_hasElement(elementB));
-    AsserterBuilder<List<Asserter<DartType>>, DartType> assertCOf =
-        _isInstantiationOf(_hasElement(elementC));
-    AsserterBuilder<List<Asserter<DartType>>, DartType> assertDOf =
-        _isInstantiationOf(_hasElement(elementD));
-    AsserterBuilder<List<Asserter<DartType>>, DartType> assertEOf =
-        _isInstantiationOf(_hasElement(elementE));
-    AsserterBuilder<List<Asserter<DartType>>, DartType> assertFOf =
-        _isInstantiationOf(_hasElement(elementF));
-
-    {
-      List<Statement> statements =
-          AstFinder.getStatementsInTopLevelFunction(unit, "test0");
-
-      hasType(assertAOf([_isInt, _isString]), rhs(statements[0]));
-      hasType(assertAOf([_isInt, _isString]), rhs(statements[0]));
-      hasType(assertAOf([_isInt, _isString]), rhs(statements[1]));
-      hasType(assertAOf([_isInt, _isString]), rhs(statements[2]));
-      hasType(assertAOf([_isInt, _isString]), rhs(statements[3]));
-      hasType(assertAOf([_isInt, _isDynamic]), rhs(statements[4]));
-      hasType(assertAOf([_isDynamic, _isDynamic]), rhs(statements[5]));
-    }
-
-    {
-      List<Statement> statements =
-          AstFinder.getStatementsInTopLevelFunction(unit, "test1");
-      hasType(assertAOf([_isInt, _isString]), rhs(statements[0]));
-      hasType(assertAOf([_isInt, _isString]), rhs(statements[1]));
-    }
-
-    {
-      List<Statement> statements =
-          AstFinder.getStatementsInTopLevelFunction(unit, "test2");
-      hasType(assertBOf([_isString, _isInt]), rhs(statements[0]));
-      hasType(assertBOf([_isString, _isInt]), rhs(statements[1]));
-      hasType(assertBOf([_isString, _isInt]), rhs(statements[2]));
-      hasType(assertBOf([_isString, _isInt]), rhs(statements[3]));
-      hasType(assertBOf([_isString, _isDynamic]), rhs(statements[4]));
-      hasType(assertBOf([_isDynamic, _isDynamic]), rhs(statements[5]));
-    }
-
-    {
-      List<Statement> statements =
-          AstFinder.getStatementsInTopLevelFunction(unit, "test3");
-      hasType(assertBOf([_isString, _isInt]), rhs(statements[0]));
-      hasType(assertBOf([_isString, _isInt]), rhs(statements[1]));
-    }
-
-    {
-      List<Statement> statements =
-          AstFinder.getStatementsInTopLevelFunction(unit, "test4");
-      hasType(assertCOf([_isInt]), rhs(statements[0]));
-      hasType(assertCOf([_isInt]), rhs(statements[1]));
-      hasType(assertCOf([_isInt]), rhs(statements[2]));
-      hasType(assertCOf([_isInt]), rhs(statements[3]));
-      hasType(assertCOf([_isDynamic]), rhs(statements[4]));
-      hasType(assertCOf([_isDynamic]), rhs(statements[5]));
-    }
-
-    {
-      List<Statement> statements =
-          AstFinder.getStatementsInTopLevelFunction(unit, "test5");
-      hasType(assertCOf([_isInt]), rhs(statements[0]));
-      hasType(assertCOf([_isInt]), rhs(statements[1]));
-    }
-
-    {
-      // The first type parameter is not constrained by the
-      // context.  We could choose a tighter type, but currently
-      // we just use dynamic.
-      List<Statement> statements =
-          AstFinder.getStatementsInTopLevelFunction(unit, "test6");
-      hasType(assertDOf([_isDynamic, _isString]), rhs(statements[0]));
-      hasType(assertDOf([_isDynamic, _isString]), rhs(statements[1]));
-      hasType(assertDOf([_isInt, _isString]), rhs(statements[2]));
-      hasType(assertDOf([_isString, _isString]), rhs(statements[3]));
-      hasType(assertDOf([_isNum, _isDynamic]), rhs(statements[4]));
-      hasType(assertDOf([_isDynamic, _isDynamic]), rhs(statements[5]));
-    }
-
-    {
-      List<Statement> statements =
-          AstFinder.getStatementsInTopLevelFunction(unit, "test7");
-      hasType(assertDOf([_isDynamic, _isString]), rhs(statements[0]));
-      hasType(assertDOf([_isDynamic, _isString]), rhs(statements[1]));
-    }
-
-    {
-      List<Statement> statements =
-          AstFinder.getStatementsInTopLevelFunction(unit, "test8");
-      hasType(assertEOf([_isInt, _isString]), rhs(statements[0]));
-    }
-
-    {
-      List<Statement> statements =
-          AstFinder.getStatementsInTopLevelFunction(unit, "test9");
-      hasType(assertFOf([_isInt, _isString]), rhs(statements[0]));
-      hasType(assertFOf([_isInt, _isString]), rhs(statements[1]));
-      hasType(assertFOf([_isInt, _isString]), rhs(statements[2]));
-      hasType(assertFOf([_isInt, _isString]), rhs(statements[3]));
-      hasType(assertFOf([_isInt, _isString]), rhs(statements[4]));
-      hasType(assertFOf([_isInt, _isString]), rhs(statements[5]));
-    }
-  }
-
-  test_listLiteral_nested() async {
-    String code = r'''
-      void main () {
-        List<List<int>> l0 = [[]];
-        Iterable<List<int>> l1 = [[3]];
-        Iterable<List<int>> l2 = [[3], [4]];
-        List<List<int>> l3 = [["hello", 3], []];
-     }
-   ''';
-    CompilationUnit unit = await resolveSource(code);
-    List<Statement> statements =
-        AstFinder.getStatementsInTopLevelFunction(unit, "main");
-    ListLiteral literal(int i) {
-      VariableDeclarationStatement stmt = statements[i];
-      VariableDeclaration decl = stmt.variables.variables[0];
-      ListLiteral exp = decl.initializer;
-      return exp;
-    }
-
-    Asserter<InterfaceType> assertListOfInt = _isListOf(_isInt);
-    Asserter<InterfaceType> assertListOfListOfInt =
-        _isListOf((DartType type) => assertListOfInt(type));
-
-    assertListOfListOfInt(literal(0).staticType);
-    assertListOfListOfInt(literal(1).staticType);
-    assertListOfListOfInt(literal(2).staticType);
-    assertListOfListOfInt(literal(3).staticType);
-
-    assertListOfInt(literal(1).elements[0].staticType);
-    assertListOfInt(literal(2).elements[0].staticType);
-    assertListOfInt(literal(3).elements[0].staticType);
-  }
-
-  test_listLiteral_simple() async {
-    String code = r'''
-      void main () {
-        List<int> l0 = [];
-        List<int> l1 = [3];
-        List<int> l2 = ["hello"];
-        List<int> l3 = ["hello", 3];
-     }
-   ''';
-    CompilationUnit unit = await resolveSource(code);
-    List<Statement> statements =
-        AstFinder.getStatementsInTopLevelFunction(unit, "main");
-    DartType literal(int i) {
-      VariableDeclarationStatement stmt = statements[i];
-      VariableDeclaration decl = stmt.variables.variables[0];
-      ListLiteral exp = decl.initializer;
-      return exp.staticType;
-    }
-
-    Asserter<InterfaceType> assertListOfInt = _isListOf(_isInt);
-
-    assertListOfInt(literal(0));
-    assertListOfInt(literal(1));
-    assertListOfInt(literal(2));
-    assertListOfInt(literal(3));
-  }
-
-  test_listLiteral_simple_const() async {
-    String code = r'''
-      void main () {
-        const List<int> c0 = const [];
-        const List<int> c1 = const [3];
-        const List<int> c2 = const ["hello"];
-        const List<int> c3 = const ["hello", 3];
-     }
-   ''';
-    CompilationUnit unit = await resolveSource(code);
-    List<Statement> statements =
-        AstFinder.getStatementsInTopLevelFunction(unit, "main");
-    DartType literal(int i) {
-      VariableDeclarationStatement stmt = statements[i];
-      VariableDeclaration decl = stmt.variables.variables[0];
-      ListLiteral exp = decl.initializer;
-      return exp.staticType;
-    }
-
-    Asserter<InterfaceType> assertListOfInt = _isListOf(_isInt);
-
-    assertListOfInt(literal(0));
-    assertListOfInt(literal(1));
-    assertListOfInt(literal(2));
-    assertListOfInt(literal(3));
-  }
-
-  test_listLiteral_simple_disabled() async {
-    String code = r'''
-      void main () {
-        List<int> l0 = <num>[];
-        List<int> l1 = <num>[3];
-        List<int> l2 = <String>["hello"];
-        List<int> l3 = <dynamic>["hello", 3];
-     }
-   ''';
-    CompilationUnit unit = await resolveSource(code);
-    List<Statement> statements =
-        AstFinder.getStatementsInTopLevelFunction(unit, "main");
-    DartType literal(int i) {
-      VariableDeclarationStatement stmt = statements[i];
-      VariableDeclaration decl = stmt.variables.variables[0];
-      ListLiteral exp = decl.initializer;
-      return exp.staticType;
-    }
-
-    _isListOf(_isNum)(literal(0));
-    _isListOf(_isNum)(literal(1));
-    _isListOf(_isString)(literal(2));
-    _isListOf(_isDynamic)(literal(3));
-  }
-
-  test_listLiteral_simple_subtype() async {
-    String code = r'''
-      void main () {
-        Iterable<int> l0 = [];
-        Iterable<int> l1 = [3];
-        Iterable<int> l2 = ["hello"];
-        Iterable<int> l3 = ["hello", 3];
-     }
-   ''';
-    CompilationUnit unit = await resolveSource(code);
-    List<Statement> statements =
-        AstFinder.getStatementsInTopLevelFunction(unit, "main");
-    DartType literal(int i) {
-      VariableDeclarationStatement stmt = statements[i];
-      VariableDeclaration decl = stmt.variables.variables[0];
-      ListLiteral exp = decl.initializer;
-      return exp.staticType;
-    }
-
-    Asserter<InterfaceType> assertListOfInt = _isListOf(_isInt);
-
-    assertListOfInt(literal(0));
-    assertListOfInt(literal(1));
-    assertListOfInt(literal(2));
-    assertListOfInt(literal(3));
-  }
-
-  test_mapLiteral_nested() async {
-    String code = r'''
-      void main () {
-        Map<int, List<String>> l0 = {};
-        Map<int, List<String>> l1 = {3: ["hello"]};
-        Map<int, List<String>> l2 = {"hello": ["hello"]};
-        Map<int, List<String>> l3 = {3: [3]};
-        Map<int, List<String>> l4 = {3:["hello"], "hello": [3]};
-     }
-   ''';
-    CompilationUnit unit = await resolveSource(code);
-    List<Statement> statements =
-        AstFinder.getStatementsInTopLevelFunction(unit, "main");
-    MapLiteral literal(int i) {
-      VariableDeclarationStatement stmt = statements[i];
-      VariableDeclaration decl = stmt.variables.variables[0];
-      MapLiteral exp = decl.initializer;
-      return exp;
-    }
-
-    Asserter<InterfaceType> assertListOfString = _isListOf(_isString);
-    Asserter<InterfaceType> assertMapOfIntToListOfString =
-        _isMapOf(_isInt, (DartType type) => assertListOfString(type));
-
-    assertMapOfIntToListOfString(literal(0).staticType);
-    assertMapOfIntToListOfString(literal(1).staticType);
-    assertMapOfIntToListOfString(literal(2).staticType);
-    assertMapOfIntToListOfString(literal(3).staticType);
-    assertMapOfIntToListOfString(literal(4).staticType);
-
-    assertListOfString(literal(1).entries[0].value.staticType);
-    assertListOfString(literal(2).entries[0].value.staticType);
-    assertListOfString(literal(3).entries[0].value.staticType);
-    assertListOfString(literal(4).entries[0].value.staticType);
-  }
-
-  test_mapLiteral_simple() async {
-    String code = r'''
-      void main () {
-        Map<int, String> l0 = {};
-        Map<int, String> l1 = {3: "hello"};
-        Map<int, String> l2 = {"hello": "hello"};
-        Map<int, String> l3 = {3: 3};
-        Map<int, String> l4 = {3:"hello", "hello": 3};
-     }
-   ''';
-    CompilationUnit unit = await resolveSource(code);
-    List<Statement> statements =
-        AstFinder.getStatementsInTopLevelFunction(unit, "main");
-    DartType literal(int i) {
-      VariableDeclarationStatement stmt = statements[i];
-      VariableDeclaration decl = stmt.variables.variables[0];
-      MapLiteral exp = decl.initializer;
-      return exp.staticType;
-    }
-
-    Asserter<InterfaceType> assertMapOfIntToString =
-        _isMapOf(_isInt, _isString);
-
-    assertMapOfIntToString(literal(0));
-    assertMapOfIntToString(literal(1));
-    assertMapOfIntToString(literal(2));
-    assertMapOfIntToString(literal(3));
-  }
-
-  test_mapLiteral_simple_disabled() async {
-    String code = r'''
-      void main () {
-        Map<int, String> l0 = <int, dynamic>{};
-        Map<int, String> l1 = <int, dynamic>{3: "hello"};
-        Map<int, String> l2 = <int, dynamic>{"hello": "hello"};
-        Map<int, String> l3 = <int, dynamic>{3: 3};
-     }
-   ''';
-    CompilationUnit unit = await resolveSource(code);
-    List<Statement> statements =
-        AstFinder.getStatementsInTopLevelFunction(unit, "main");
-    DartType literal(int i) {
-      VariableDeclarationStatement stmt = statements[i];
-      VariableDeclaration decl = stmt.variables.variables[0];
-      MapLiteral exp = decl.initializer;
-      return exp.staticType;
-    }
-
-    Asserter<InterfaceType> assertMapOfIntToDynamic =
-        _isMapOf(_isInt, _isDynamic);
-
-    assertMapOfIntToDynamic(literal(0));
-    assertMapOfIntToDynamic(literal(1));
-    assertMapOfIntToDynamic(literal(2));
-    assertMapOfIntToDynamic(literal(3));
-  }
-
-  test_methodDeclaration_body_propagation() async {
-    String code = r'''
-      class A {
-        List<String> m0(int x) => ["hello"];
-        List<String> m1(int x) {return [3];}
-      }
-   ''';
-    CompilationUnit unit = await resolveSource(code);
-    Expression methodReturnValue(String methodName) {
-      MethodDeclaration method =
-          AstFinder.getMethodInClass(unit, "A", methodName);
-      FunctionBody body = method.body;
-      if (body is ExpressionFunctionBody) {
-        return body.expression;
-      } else {
-        Statement stmt = (body as BlockFunctionBody).block.statements[0];
-        return (stmt as ReturnStatement).expression;
-      }
-    }
-
-    Asserter<InterfaceType> assertListOfString = _isListOf(_isString);
-    assertListOfString(methodReturnValue("m0").staticType);
-    assertListOfString(methodReturnValue("m1").staticType);
-  }
-
-  test_partialTypes1() async {
-    // Test that downwards inference with a partial type
-    // correctly uses the partial information to fill in subterm
-    // types
-    String code = r'''
-    typedef To Func1<From, To>(From x);
-    S f<S, T>(Func1<S, T> g) => null;
-    String test() => f((l) => l.length);
-   ''';
-    Source source = addSource(code);
-    TestAnalysisResult analysisResult = await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-    CompilationUnit unit = analysisResult.unit;
-    FunctionDeclaration test = AstFinder.getTopLevelFunction(unit, "test");
-    ExpressionFunctionBody body = test.functionExpression.body;
-    _isString(body.expression.staticType);
-    MethodInvocation invoke = body.expression;
-    FunctionExpression function = invoke.argumentList.arguments[0];
-    ExecutableElement f0 = function.declaredElement;
-    FunctionType type = f0.type;
-    _isFunction2Of(_isString, _isInt)(type);
-  }
-
-  test_pinning_multipleConstraints1() async {
-    // Test that downwards inference with two different downwards covariant
-    // constraints on the same parameter correctly fails to infer when
-    // the types do not share a common subtype
-    String code = r'''
-    class A<S, T> {
-      S s;
-      T t;
-    }
-    class B<S> extends A<S, S> { B(S s); }
-    A<int, String> test() => new B(3);
-   ''';
-    Source source = addSource(code);
-    TestAnalysisResult analysisResult = await computeAnalysisResult(source);
-    assertErrors(source, [StrongModeCode.INVALID_CAST_LITERAL]);
-    verify([source]);
-    CompilationUnit unit = analysisResult.unit;
-    FunctionDeclaration test = AstFinder.getTopLevelFunction(unit, "test");
-    ExpressionFunctionBody body = test.functionExpression.body;
-    DartType type = body.expression.staticType;
-
-    Element elementB = AstFinder.getClass(unit, "B").declaredElement;
-
-    _isInstantiationOf(_hasElement(elementB))([_isNull])(type);
-  }
-
-  test_pinning_multipleConstraints2() async {
-    // Test that downwards inference with two identical downwards covariant
-    // constraints on the same parameter correctly infers and pins the type
-    String code = r'''
-    class A<S, T> {
-      S s;
-      T t;
-    }
-    class B<S> extends A<S, S> { B(S s); }
-    A<num, num> test() => new B(3);
-   ''';
-    Source source = addSource(code);
-    TestAnalysisResult analysisResult = await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-    CompilationUnit unit = analysisResult.unit;
-    FunctionDeclaration test = AstFinder.getTopLevelFunction(unit, "test");
-    ExpressionFunctionBody body = test.functionExpression.body;
-    DartType type = body.expression.staticType;
-
-    Element elementB = AstFinder.getClass(unit, "B").declaredElement;
-
-    _isInstantiationOf(_hasElement(elementB))([_isNum])(type);
-  }
-
-  test_pinning_multipleConstraints3() async {
-    // Test that downwards inference with two different downwards covariant
-    // constraints on the same parameter correctly fails to infer when
-    // the types do not share a common subtype, but do share a common supertype
-    String code = r'''
-    class A<S, T> {
-      S s;
-      T t;
-    }
-    class B<S> extends A<S, S> { B(S s); }
-    A<int, double> test() => new B(3);
-   ''';
-    Source source = addSource(code);
-    TestAnalysisResult analysisResult = await computeAnalysisResult(source);
-    assertErrors(source, [
-      StrongModeCode.INVALID_CAST_LITERAL,
-    ]);
-    verify([source]);
-    CompilationUnit unit = analysisResult.unit;
-    FunctionDeclaration test = AstFinder.getTopLevelFunction(unit, "test");
-    ExpressionFunctionBody body = test.functionExpression.body;
-    DartType type = body.expression.staticType;
-
-    Element elementB = AstFinder.getClass(unit, "B").declaredElement;
-
-    _isInstantiationOf(_hasElement(elementB))([_isNull])(type);
-  }
-
-  test_pinning_multipleConstraints4() async {
-    // Test that downwards inference with two subtype related downwards
-    // covariant constraints on the same parameter correctly infers and pins
-    // the type
-    String code = r'''
-    class A<S, T> {
-      S s;
-      T t;
-    }
-    class B<S> extends A<S, S> {}
-    A<int, num> test() => new B();
-   ''';
-    Source source = addSource(code);
-    TestAnalysisResult analysisResult = await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-    CompilationUnit unit = analysisResult.unit;
-    FunctionDeclaration test = AstFinder.getTopLevelFunction(unit, "test");
-    ExpressionFunctionBody body = test.functionExpression.body;
-    DartType type = body.expression.staticType;
-
-    Element elementB = AstFinder.getClass(unit, "B").declaredElement;
-
-    _isInstantiationOf(_hasElement(elementB))([_isInt])(type);
-  }
-
-  test_pinning_multipleConstraints_contravariant1() async {
-    // Test that downwards inference with two different downwards contravariant
-    // constraints on the same parameter chooses the upper bound
-    // when the only supertype is Object
-    String code = r'''
-    class A<S, T> {
-      S s;
-      T t;
-    }
-    class B<S> extends A<S, S> {}
-    typedef void Contra1<T>(T x);
-    Contra1<A<S, S>> mkA<S>() => (A<S, S> x) {};
-    Contra1<A<int, String>> test() => mkA();
-   ''';
-    Source source = addSource(code);
-    TestAnalysisResult analysisResult = await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-    CompilationUnit unit = analysisResult.unit;
-    FunctionDeclaration test = AstFinder.getTopLevelFunction(unit, "test");
-    ExpressionFunctionBody body = test.functionExpression.body;
-    FunctionType functionType = body.expression.staticType;
-    DartType type = functionType.normalParameterTypes[0];
-
-    Element elementA = AstFinder.getClass(unit, "A").declaredElement;
-
-    _isInstantiationOf(_hasElement(elementA))([_isObject, _isObject])(type);
-  }
-
-  test_pinning_multipleConstraints_contravariant2() async {
-    // Test that downwards inference with two identical downwards contravariant
-    // constraints on the same parameter correctly pins the type
-    String code = r'''
-    class A<S, T> {
-      S s;
-      T t;
-    }
-    class B<S> extends A<S, S> {}
-    typedef void Contra1<T>(T x);
-    Contra1<A<S, S>> mkA<S>() => (A<S, S> x) {};
-    Contra1<A<num, num>> test() => mkA();
-   ''';
-    Source source = addSource(code);
-    TestAnalysisResult analysisResult = await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-    CompilationUnit unit = analysisResult.unit;
-    FunctionDeclaration test = AstFinder.getTopLevelFunction(unit, "test");
-    ExpressionFunctionBody body = test.functionExpression.body;
-    FunctionType functionType = body.expression.staticType;
-    DartType type = functionType.normalParameterTypes[0];
-
-    Element elementA = AstFinder.getClass(unit, "A").declaredElement;
-
-    _isInstantiationOf(_hasElement(elementA))([_isNum, _isNum])(type);
-  }
-
-  test_pinning_multipleConstraints_contravariant3() async {
-    // Test that downwards inference with two different downwards contravariant
-    // constraints on the same parameter correctly choose the least upper bound
-    // when they share a common supertype
-    String code = r'''
-    class A<S, T> {
-      S s;
-      T t;
-    }
-    class B<S> extends A<S, S> {}
-    typedef void Contra1<T>(T x);
-    Contra1<A<S, S>> mkA<S>() => (A<S, S> x) {};
-    Contra1<A<int, double>> test() => mkA();
-   ''';
-    Source source = addSource(code);
-    TestAnalysisResult analysisResult = await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-    CompilationUnit unit = analysisResult.unit;
-    FunctionDeclaration test = AstFinder.getTopLevelFunction(unit, "test");
-    ExpressionFunctionBody body = test.functionExpression.body;
-    FunctionType functionType = body.expression.staticType;
-    DartType type = functionType.normalParameterTypes[0];
-
-    Element elementA = AstFinder.getClass(unit, "A").declaredElement;
-
-    _isInstantiationOf(_hasElement(elementA))([_isNum, _isNum])(type);
-  }
-
-  test_pinning_multipleConstraints_contravariant4() async {
-    // Test that downwards inference with two different downwards contravariant
-    // constraints on the same parameter correctly choose the least upper bound
-    // when one is a subtype of the other
-    String code = r'''
-    class A<S, T> {
-      S s;
-      T t;
-    }
-    class B<S> extends A<S, S> {}
-    typedef void Contra1<T>(T x);
-    Contra1<A<S, S>> mkA<S>() => (A<S, S> x) {};
-    Contra1<A<int, num>> test() => mkA();
-   ''';
-    Source source = addSource(code);
-    TestAnalysisResult analysisResult = await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-    CompilationUnit unit = analysisResult.unit;
-    FunctionDeclaration test = AstFinder.getTopLevelFunction(unit, "test");
-    ExpressionFunctionBody body = test.functionExpression.body;
-    FunctionType functionType = body.expression.staticType;
-    DartType type = functionType.normalParameterTypes[0];
-
-    Element elementA = AstFinder.getClass(unit, "A").declaredElement;
-
-    _isInstantiationOf(_hasElement(elementA))([_isNum, _isNum])(type);
-  }
-
-  test_redirectedConstructor_named() async {
-    Source source = addSource(r'''
-class A<T, U> implements B<T, U> {
-  A.named();
-}
-
-class B<T2, U2> {
-  factory B() = A.named;
-}
-   ''');
-    TestAnalysisResult result = await computeAnalysisResult(source);
-    assertNoErrors(source);
-
-    ClassDeclaration b = result.unit.declarations[1];
-    ConstructorDeclaration bConstructor = b.members[0];
-    ConstructorName redirected = bConstructor.redirectedConstructor;
-
-    TypeName typeName = redirected.type;
-    expect(typeName.type.toString(), 'A<T2, U2>');
-    expect(typeName.type.toString(), 'A<T2, U2>');
-
-    var constructorMember = redirected.staticElement;
-    expect(constructorMember.toString(), 'A.named() → A<T2, U2>');
-    expect(redirected.name.staticElement, constructorMember);
-  }
-
-  test_redirectedConstructor_self() async {
-    Source source = addSource(r'''
-class A<T> {
-  A();
-  factory A.redirected() = A;
-}
-   ''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-  }
-
-  test_redirectedConstructor_unnamed() async {
-    Source source = addSource(r'''
-class A<T, U> implements B<T, U> {
-  A();
-}
-
-class B<T2, U2> {
-  factory B() = A;
-}
-   ''');
-    TestAnalysisResult result = await computeAnalysisResult(source);
-    assertNoErrors(source);
-
-    ClassDeclaration b = result.unit.declarations[1];
-    ConstructorDeclaration bConstructor = b.members[0];
-    ConstructorName redirected = bConstructor.redirectedConstructor;
-
-    TypeName typeName = redirected.type;
-    expect(typeName.type.toString(), 'A<T2, U2>');
-    expect(typeName.type.toString(), 'A<T2, U2>');
-
-    expect(redirected.name, isNull);
-    expect(redirected.staticElement.toString(), 'A() → A<T2, U2>');
-  }
-
-  test_redirectingConstructor_propagation() async {
-    String code = r'''
-      class A {
-        A() : this.named([]);
-        A.named(List<String> x);
-      }
-   ''';
-    CompilationUnit unit = await resolveSource(code);
-
-    ConstructorDeclaration constructor =
-        AstFinder.getConstructorInClass(unit, "A", null);
-    RedirectingConstructorInvocation invocation = constructor.initializers[0];
-    Expression exp = invocation.argumentList.arguments[0];
-    _isListOf(_isString)(exp.staticType);
-  }
-
-  test_returnType_variance1() async {
-    // Check that downwards inference correctly pins a type parameter
-    // when the parameter is constrained in a contravariant position
-    String code = r'''
-    typedef To Func1<From, To>(From x);
-    Func1<T, String> f<T>(T x) => null;
-    Func1<num, String> test() => f(42);
-   ''';
-    Source source = addSource(code);
-    TestAnalysisResult analysisResult = await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-    CompilationUnit unit = analysisResult.unit;
-    FunctionDeclaration test = AstFinder.getTopLevelFunction(unit, "test");
-    ExpressionFunctionBody body = test.functionExpression.body;
-    MethodInvocation invoke = body.expression;
-    _isFunction2Of(_isNum, _isFunction2Of(_isNum, _isString))(
-        invoke.staticInvokeType);
-  }
-
-  test_returnType_variance2() async {
-    // Check that downwards inference correctly pins a type parameter
-    // when the parameter is constrained in a covariant position
-    String code = r'''
-    typedef To Func1<From, To>(From x);
-    Func1<String, T> f<T>(T x) => null;
-    Func1<String, num> test() => f(42);
-   ''';
-    Source source = addSource(code);
-    TestAnalysisResult analysisResult = await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-    CompilationUnit unit = analysisResult.unit;
-    FunctionDeclaration test = AstFinder.getTopLevelFunction(unit, "test");
-    ExpressionFunctionBody body = test.functionExpression.body;
-    MethodInvocation invoke = body.expression;
-    _isFunction2Of(_isNum, _isFunction2Of(_isString, _isNum))(
-        invoke.staticInvokeType);
-  }
-
-  test_returnType_variance3() async {
-    // Check that the variance heuristic chooses the most precise type
-    // when the return type uses the variable in a contravariant position
-    // and there is no downwards constraint.
-    String code = r'''
-    typedef To Func1<From, To>(From x);
-    Func1<T, String> f<T>(T x, g(T x)) => null;
-    dynamic test() => f(42, (num x) => x);
-   ''';
-    Source source = addSource(code);
-    TestAnalysisResult analysisResult = await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-    CompilationUnit unit = analysisResult.unit;
-    FunctionDeclaration test = AstFinder.getTopLevelFunction(unit, "test");
-    ExpressionFunctionBody body = test.functionExpression.body;
-    FunctionType functionType = body.expression.staticType;
-    DartType type = functionType.normalParameterTypes[0];
-    _isInt(type);
-  }
-
-  test_returnType_variance4() async {
-    // Check that the variance heuristic chooses the more precise type
-    // when the return type uses the variable in a covariant position
-    // and there is no downwards constraint
-    String code = r'''
-    typedef To Func1<From, To>(From x);
-    Func1<String, T> f<T>(T x, g(T x)) => null;
-    dynamic test() => f(42, (num x) => x);
-   ''';
-    Source source = addSource(code);
-    TestAnalysisResult analysisResult = await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-    CompilationUnit unit = analysisResult.unit;
-    FunctionDeclaration test = AstFinder.getTopLevelFunction(unit, "test");
-    ExpressionFunctionBody body = test.functionExpression.body;
-    FunctionType functionType = body.expression.staticType;
-    DartType type = functionType.returnType;
-    _isInt(type);
-  }
-
-  test_returnType_variance5() async {
-    // Check that pinning works correctly with a partial type
-    // when the return type uses the variable in a contravariant position
-    String code = r'''
-    typedef To Func1<From, To>(From x);
-    Func1<T, String> f<T>(T x) => null;
-    T g<T, S>(Func1<T, S> f) => null;
-    num test() => g(f(3));
-   ''';
-    Source source = addSource(code);
-    TestAnalysisResult analysisResult = await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-    CompilationUnit unit = analysisResult.unit;
-    FunctionDeclaration test = AstFinder.getTopLevelFunction(unit, "test");
-    ExpressionFunctionBody body = test.functionExpression.body;
-    MethodInvocation call = body.expression;
-    _isNum(call.staticType);
-    _isFunction2Of(_isFunction2Of(_isNum, _isString), _isNum)(
-        call.staticInvokeType);
-  }
-
-  test_returnType_variance6() async {
-    // Check that pinning works correctly with a partial type
-    // when the return type uses the variable in a covariant position
-    String code = r'''
-    typedef To Func1<From, To>(From x);
-    Func1<String, T> f<T>(T x) => null;
-    T g<T, S>(Func1<S, T> f) => null;
-    num test() => g(f(3));
-   ''';
-    Source source = addSource(code);
-    TestAnalysisResult analysisResult = await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-    CompilationUnit unit = analysisResult.unit;
-    FunctionDeclaration test = AstFinder.getTopLevelFunction(unit, "test");
-    ExpressionFunctionBody body = test.functionExpression.body;
-    MethodInvocation call = body.expression;
-    _isNum(call.staticType);
-    _isFunction2Of(_isFunction2Of(_isString, _isNum), _isNum)(
-        call.staticInvokeType);
-  }
-
-  test_superConstructorInvocation_propagation() async {
-    String code = r'''
-      class B {
-        B(List<String> p);
-      }
-      class A extends B {
-        A() : super([]);
-      }
-   ''';
-    CompilationUnit unit = await resolveSource(code);
-
-    ConstructorDeclaration constructor =
-        AstFinder.getConstructorInClass(unit, "A", null);
-    SuperConstructorInvocation invocation = constructor.initializers[0];
-    Expression exp = invocation.argumentList.arguments[0];
-    _isListOf(_isString)(exp.staticType);
-  }
-
-  test_sync_star_method_propagation() async {
-    String code = r'''
-      import "dart:async";
-      class A {
-        Iterable f0() sync* { yield []; }
-        Iterable f1() sync* { yield* new List(); }
-
-        Iterable<List<int>> f2() sync* { yield []; }
-        Iterable<List<int>> f3() sync* { yield* new List(); }
-      }
-   ''';
-    CompilationUnit unit = await resolveSource(code);
-
-    void check(String name, Asserter<InterfaceType> typeTest) {
-      MethodDeclaration test = AstFinder.getMethodInClass(unit, "A", name);
-      BlockFunctionBody body = test.body;
-      YieldStatement stmt = body.block.statements[0];
-      Expression exp = stmt.expression;
-      typeTest(exp.staticType);
-    }
-
-    check("f0", _isListOf(_isDynamic));
-    check("f1", _isListOf(_isDynamic));
-
-    check("f2", _isListOf(_isInt));
-    check("f3", _isListOf((DartType type) => _isListOf(_isInt)(type)));
-  }
-
-  test_sync_star_propagation() async {
-    String code = r'''
-      import "dart:async";
-
-      Iterable f0() sync* { yield []; }
-      Iterable f1() sync* { yield* new List(); }
-
-      Iterable<List<int>> f2() sync* { yield []; }
-      Iterable<List<int>> f3() sync* { yield* new List(); }
-   ''';
-    CompilationUnit unit = await resolveSource(code);
-
-    void check(String name, Asserter<InterfaceType> typeTest) {
-      FunctionDeclaration test = AstFinder.getTopLevelFunction(unit, name);
-      BlockFunctionBody body = test.functionExpression.body;
-      YieldStatement stmt = body.block.statements[0];
-      Expression exp = stmt.expression;
-      typeTest(exp.staticType);
-    }
-
-    check("f0", _isListOf(_isDynamic));
-    check("f1", _isListOf(_isDynamic));
-
-    check("f2", _isListOf(_isInt));
-    check("f3", _isListOf((DartType type) => _isListOf(_isInt)(type)));
-  }
-
-  /// Verifies the source has the expected [errorCodes] as well as the
-  /// expected [errorMessage].
-  void _expectInferenceError(
-      Source source, List<ErrorCode> errorCodes, String errorMessage) {
-    assertErrors(source, errorCodes);
-    var errors = analysisResults[source]
-        .errors
-        .where((e) => e.errorCode == StrongModeCode.COULD_NOT_INFER)
-        .map((e) => e.message)
-        .toList();
-    expect(errors.length, 1);
-    var actual = errors[0];
-    expect(actual,
-        errorMessage, // Print the literal error message for easy copy+paste:
-        reason: 'Actual error did not match expected error:\n$actual');
-  }
-
-  /// Helper method for testing `FutureOr<T>`.
-  ///
-  /// Validates that [code] produces [errors]. It should define a function
-  /// "test", whose body is an expression that invokes a method. Returns that
-  /// invocation.
-  Future<MethodInvocation> _testFutureOr(String code,
-      {List<ErrorCode> errors}) async {
-    Source source = addSource("""
-    import "dart:async";
-    $code""");
-    TestAnalysisResult analysisResult = await computeAnalysisResult(source);
-
-    if (errors == null) {
-      assertNoErrors(source);
-    } else {
-      assertErrors(source, errors);
-    }
-    verify([source]);
-    FunctionDeclaration test =
-        AstFinder.getTopLevelFunction(analysisResult.unit, "test");
-    ExpressionFunctionBody body = test.functionExpression.body;
-    return body.expression;
-  }
-}
-
-/// Strong mode static analyzer end to end tests
-@reflectiveTest
-class StrongModeStaticTypeAnalyzer2Test extends StaticTypeAnalyzer2TestShared
-    with StrongModeStaticTypeAnalyzer2TestCases {
-  void setUp() {
-    super.setUp();
-    AnalysisOptionsImpl options = new AnalysisOptionsImpl();
-    resetWith(options: options);
-  }
-
-  @override
-  @failingTest
-  test_genericMethod_nestedCaptureBounds() {
-    // https://github.com/dart-lang/sdk/issues/30236
-    return super.test_genericMethod_nestedCaptureBounds();
-  }
-
-  @override
-  @failingTest
-  test_genericMethod_tearoff_instantiated() {
-    return super.test_genericMethod_tearoff_instantiated();
-  }
-
-  @override
-  @failingTest
-  test_instantiateToBounds_class_error_extension_malbounded() {
-    return super.test_instantiateToBounds_class_error_extension_malbounded();
-  }
-
-  @override
-  @failingTest
-  test_instantiateToBounds_class_error_instantiation_malbounded() {
-    return super
-        .test_instantiateToBounds_class_error_instantiation_malbounded();
-  }
-
-  @override
-  @failingTest
-  test_instantiateToBounds_generic_function_error_malbounded() {
-    return super.test_instantiateToBounds_generic_function_error_malbounded();
-  }
-
-  @override
-  @failingTest
-  test_notInstantiatedBound_class_error_recursion() {
-    return super.test_notInstantiatedBound_class_error_recursion();
-  }
-
-  @override
-  @failingTest
-  test_notInstantiatedBound_class_error_recursion_less_direct() {
-    return super.test_notInstantiatedBound_class_error_recursion_less_direct();
-  }
-
-  @override
-  @failingTest
-  test_notInstantiatedBound_class_error_recursion_typedef() {
-    // Does not work with the task model
-    return super.test_notInstantiatedBound_class_error_recursion_typedef();
-  }
-
-  @override
-  @failingTest
-  test_notInstantiatedBound_error_class_argument() {
-    // Does not work with the task model
-    return super.test_notInstantiatedBound_error_class_argument();
-  }
-
-  @override
-  @failingTest
-  test_notInstantiatedBound_error_class_argument2() {
-    // Does not work with the task model
-    return super.test_notInstantiatedBound_error_class_argument2();
-  }
-
-  @override
-  @failingTest
-  test_notInstantiatedBound_error_class_direct() {
-    // Does not work with the task model
-    return super.test_notInstantiatedBound_error_class_direct();
-  }
-
-  @override
-  @failingTest
-  test_notInstantiatedBound_error_class_indirect() {
-    // Does not work with the task model
-    return super.test_notInstantiatedBound_error_class_indirect();
-  }
-
-  @override
-  @failingTest
-  test_notInstantiatedBound_error_functionType() {
-    // Does not work with the task model
-    return super.test_notInstantiatedBound_error_functionType();
-  }
-
-  @override
-  @failingTest
-  test_notInstantiatedBound_error_typedef_argument() {
-    // Does not work with the task model
-    return super.test_notInstantiatedBound_error_typedef_argument();
-  }
-
-  @override
-  @failingTest
-  test_notInstantiatedBound_error_typedef_argument2() {
-    // Does not work with the task model
-    return super.test_notInstantiatedBound_error_typedef_argument2();
-  }
-
-  @override
-  @failingTest
-  test_notInstantiatedBound_error_typedef_direct() {
-    // Does not work with the task model
-    return super.test_notInstantiatedBound_error_typedef_direct();
-  }
-}
-
-/// Test cases for [StrongModeStaticTypeAnalyzer2Test]
-mixin StrongModeStaticTypeAnalyzer2TestCases
-    implements StaticTypeAnalyzer2TestShared {
-  void expectStaticInvokeType(String search, String type) {
-    var invocation = findIdentifier(search).parent as MethodInvocation;
-    expect(invocation.staticInvokeType.toString(), type);
-  }
-
-  test_dynamicObjectGetter_hashCode() async {
-    String code = r'''
-main() {
-  dynamic a = null;
-  var foo = a.hashCode;
-}
-''';
-    await resolveTestUnit(code);
-    expectInitializerType('foo', 'int');
-  }
-
-  test_futureOr_promotion1() async {
-    // Test that promotion from FutureOr<T> to T works for concrete types
-    String code = r'''
-    import "dart:async";
-    dynamic test(FutureOr<int> x) => (x is int) && (x.abs() == 0);
-   ''';
-    await resolveTestUnit(code);
-  }
-
-  test_futureOr_promotion2() async {
-    // Test that promotion from FutureOr<T> to Future<T> works for concrete
-    // types
-    String code = r'''
-    import "dart:async";
-    dynamic test(FutureOr<int> x) => (x is Future<int>) &&
-                                     (x.then((x) => x) == null);
-   ''';
-    await resolveTestUnit(code);
-  }
-
-  test_futureOr_promotion3() async {
-    // Test that promotion from FutureOr<T> to T works for type
-    // parameters T
-    String code = r'''
-    import "dart:async";
-    dynamic test<T extends num>(FutureOr<T> x) => (x is T) &&
-                                                  (x.abs() == 0);
-   ''';
-    await resolveTestUnit(code);
-  }
-
-  test_futureOr_promotion4() async {
-    // Test that promotion from FutureOr<T> to Future<T> works for type
-    // parameters T
-    String code = r'''
-    import "dart:async";
-    dynamic test<T extends num>(FutureOr<T> x) => (x is Future<T>) &&
-                                                  (x.then((x) => x) == null);
-   ''';
-    await resolveTestUnit(code);
-  }
-
-  test_generalizedVoid_assignToVoidOk() async {
-    Source source = addSource(r'''
-void main() {
-  void x;
-  x = 42;
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-  }
-
-  test_genericFunction() async {
-    await resolveTestUnit(r'T f<T>(T x) => null;');
-    expectFunctionType('f', '<T>(T) → T',
-        elementTypeParams: '[T]', typeFormals: '[T]');
-    SimpleIdentifier f = findIdentifier('f');
-    FunctionElementImpl e = f.staticElement;
-    FunctionType ft = e.type.instantiate([typeProvider.stringType]);
-    expect(ft.toString(), '(String) → String');
-  }
-
-  test_genericFunction_bounds() async {
-    await resolveTestUnit(r'T f<T extends num>(T x) => null;');
-    expectFunctionType('f', '<T extends num>(T) → T',
-        elementTypeParams: '[T extends num]', typeFormals: '[T extends num]');
-  }
-
-  test_genericFunction_parameter() async {
-    await resolveTestUnit(r'''
-void g(T f<T>(T x)) {}
-''', noErrors: false // TODO(paulberry): remove when dartbug.com/28515 fixed.
-        );
-    expectFunctionType('f', '<T>(T) → T',
-        elementTypeParams: '[]', typeFormals: '[T]');
-    SimpleIdentifier f = findIdentifier('f');
-    ParameterElementImpl e = f.staticElement;
-    FunctionType type = e.type;
-    FunctionType ft = type.instantiate([typeProvider.stringType]);
-    expect(ft.toString(), '(String) → String');
-  }
-
-  test_genericFunction_static() async {
-    await resolveTestUnit(r'''
-class C<E> {
-  static T f<T>(T x) => null;
-}
-''');
-    expectFunctionType('f', '<T>(T) → T',
-        elementTypeParams: '[T]', typeFormals: '[T]');
-    SimpleIdentifier f = findIdentifier('f');
-    MethodElementImpl e = f.staticElement;
-    FunctionType ft = e.type.instantiate([typeProvider.stringType]);
-    expect(ft.toString(), '(String) → String');
-  }
-
-  test_genericFunction_typedef() async {
-    String code = r'''
-typedef T F<T>(T x);
-F f0;
-
-class C {
-  static F f1;
-  F f2;
-  void g(F f3) {
-    F f4;
-    f0(3);
-    f1(3);
-    f2(3);
-    f3(3);
-    f4(3);
-  }
-}
-
-class D<S> {
-  static F f1;
-  F f2;
-  void g(F f3) {
-    F f4;
-    f0(3);
-    f1(3);
-    f2(3);
-    f3(3);
-    f4(3);
-  }
-}
-''';
-    await resolveTestUnit(code);
-
-    checkBody(String className) {
-      List<Statement> statements =
-          AstFinder.getStatementsInMethod(testUnit, className, "g");
-
-      for (int i = 1; i <= 5; i++) {
-        Expression exp = (statements[i] as ExpressionStatement).expression;
-        expect(exp.staticType, typeProvider.dynamicType);
-      }
-    }
-
-    checkBody("C");
-    checkBody("D");
-  }
-
-  test_genericFunction_upwardsAndDownwards() async {
-    // Regression tests for https://github.com/dart-lang/sdk/issues/27586.
-    await resolveTestUnit(r'List<num> x = [1, 2];');
-    expectInitializerType('x', 'List<num>');
-  }
-
-  test_genericFunction_upwardsAndDownwards_Object() async {
-    // Regression tests for https://github.com/dart-lang/sdk/issues/27625.
-    await resolveTestUnit(r'''
-List<Object> aaa = [];
-List<Object> bbb = [1, 2, 3];
-List<Object> ccc = [null];
-List<Object> ddd = [1 as dynamic];
-List<Object> eee = [new Object()];
-    ''');
-    expectInitializerType('aaa', 'List<Object>');
-    expectInitializerType('bbb', 'List<Object>');
-    expectInitializerType('ccc', 'List<Object>');
-    expectInitializerType('ddd', 'List<Object>');
-    expectInitializerType('eee', 'List<Object>');
-  }
-
-  test_genericMethod() async {
-    await resolveTestUnit(r'''
-class C<E> {
-  List<T> f<T>(E e) => null;
-}
-main() {
-  C<String> cOfString;
-}
-''');
-    expectFunctionType('f', '<T>(E) → List<T>',
-        elementTypeParams: '[T]',
-        typeParams: '[E]',
-        typeArgs: '[E]',
-        typeFormals: '[T]');
-    SimpleIdentifier c = findIdentifier('cOfString');
-    FunctionType ft = (c.staticType as InterfaceType).getMethod('f').type;
-    expect(ft.toString(), '<T>(String) → List<T>');
-    ft = ft.instantiate([typeProvider.intType]);
-    expect(ft.toString(), '(String) → List<int>');
-    expect('${ft.typeArguments}/${ft.typeParameters}', '[String, int]/[E, T]');
-  }
-
-  test_genericMethod_explicitTypeParams() async {
-    await resolveTestUnit(r'''
-class C<E> {
-  List<T> f<T>(E e) => null;
-}
-main() {
-  C<String> cOfString;
-  var x = cOfString.f<int>('hi');
-}
-''');
-    MethodInvocation f = findIdentifier('f<int>').parent;
-    FunctionType ft = f.staticInvokeType;
-    expect(ft.toString(), '(String) → List<int>');
-    expect('${ft.typeArguments}/${ft.typeParameters}', '[String, int]/[E, T]');
-
-    SimpleIdentifier x = findIdentifier('x');
-    expect(x.staticType,
-        typeProvider.listType.instantiate([typeProvider.intType]));
-  }
-
-  test_genericMethod_functionExpressionInvocation_explicit() async {
-    await resolveTestUnit(r'''
-class C<E> {
-  T f<T>(T e) => null;
-  static T g<T>(T e) => null;
-  static T Function<T>(T) h = null;
-}
-
-T topF<T>(T e) => null;
-var topG = topF;
-void test<S>(T Function<T>(T) pf) {
-  var c = new C<int>();
-  T lf<T>(T e) => null;
-
-  var lambdaCall = (<E>(E e) => e)<int>(3);
-  var methodCall = (c.f)<int>(3);
-  var staticCall = (C.g)<int>(3);
-  var staticFieldCall = (C.h)<int>(3);
-  var topFunCall = (topF)<int>(3);
-  var topFieldCall = (topG)<int>(3);
-  var localCall = (lf)<int>(3);
-  var paramCall = (pf)<int>(3);
-}
-''');
-    expectIdentifierType('methodCall', "int");
-    expectIdentifierType('staticCall', "int");
-    expectIdentifierType('staticFieldCall', "int");
-    expectIdentifierType('topFunCall', "int");
-    expectIdentifierType('topFieldCall', "int");
-    expectIdentifierType('localCall', "int");
-    expectIdentifierType('paramCall', "int");
-    expectIdentifierType('lambdaCall', "int");
-  }
-
-  test_genericMethod_functionExpressionInvocation_functionTypedParameter_explicit() async {
-    await resolveTestUnit(r'''
-void test<S>(T pf<T>(T e)) {
-  var paramCall = (pf)<int>(3);
-}
-''', noErrors: false // TODO(paulberry): remove when dartbug.com/28515 fixed.
-        );
-    expectIdentifierType('paramCall', "int");
-  }
-
-  test_genericMethod_functionExpressionInvocation_functionTypedParameter_inferred() async {
-    await resolveTestUnit(r'''
-void test<S>(T pf<T>(T e)) {
-  var paramCall = (pf)(3);
-}
-''', noErrors: false // TODO(paulberry): remove when dartbug.com/28515 fixed.
-        );
-    expectIdentifierType('paramCall', "int");
-  }
-
-  test_genericMethod_functionExpressionInvocation_inferred() async {
-    await resolveTestUnit(r'''
-class C<E> {
-  T f<T>(T e) => null;
-  static T g<T>(T e) => null;
-  static T Function<T>(T) h = null;
-}
-
-T topF<T>(T e) => null;
-var topG = topF;
-void test<S>(T Function<T>(T) pf) {
-  var c = new C<int>();
-  T lf<T>(T e) => null;
-
-  var lambdaCall = (<E>(E e) => e)(3);
-  var methodCall = (c.f)(3);
-  var staticCall = (C.g)(3);
-  var staticFieldCall = (C.h)(3);
-  var topFunCall = (topF)(3);
-  var topFieldCall = (topG)(3);
-  var localCall = (lf)(3);
-  var paramCall = (pf)(3);
-}
-''', noErrors: false // TODO(paulberry): remove when dartbug.com/28515 fixed.
-        );
-    expectIdentifierType('methodCall', "int");
-    expectIdentifierType('staticCall', "int");
-    expectIdentifierType('staticFieldCall', "int");
-    expectIdentifierType('topFunCall', "int");
-    expectIdentifierType('topFieldCall', "int");
-    expectIdentifierType('localCall', "int");
-    expectIdentifierType('paramCall', "int");
-    expectIdentifierType('lambdaCall', "int");
-  }
-
-  test_genericMethod_functionInvocation_explicit() async {
-    await resolveTestUnit(r'''
-class C<E> {
-  T f<T>(T e) => null;
-  static T g<T>(T e) => null;
-  static T Function<T>(T) h = null;
-}
-
-T topF<T>(T e) => null;
-var topG = topF;
-void test<S>(T Function<T>(T) pf) {
-  var c = new C<int>();
-  T lf<T>(T e) => null;
-  var methodCall = c.f<int>(3);
-  var staticCall = C.g<int>(3);
-  var staticFieldCall = C.h<int>(3);
-  var topFunCall = topF<int>(3);
-  var topFieldCall = topG<int>(3);
-  var localCall = lf<int>(3);
-  var paramCall = pf<int>(3);
-}
-''');
-    expectIdentifierType('methodCall', "int");
-    expectIdentifierType('staticCall', "int");
-    expectIdentifierType('staticFieldCall', "int");
-    expectIdentifierType('topFunCall', "int");
-    expectIdentifierType('topFieldCall', "int");
-    expectIdentifierType('localCall', "int");
-    expectIdentifierType('paramCall', "int");
-  }
-
-  test_genericMethod_functionInvocation_functionTypedParameter_explicit() async {
-    await resolveTestUnit(r'''
-void test<S>(T pf<T>(T e)) {
-  var paramCall = pf<int>(3);
-}
-''', noErrors: false // TODO(paulberry): remove when dartbug.com/28515 fixed.
-        );
-    expectIdentifierType('paramCall', "int");
-  }
-
-  test_genericMethod_functionInvocation_functionTypedParameter_inferred() async {
-    await resolveTestUnit(r'''
-void test<S>(T pf<T>(T e)) {
-  var paramCall = pf(3);
-}
-''', noErrors: false // TODO(paulberry): remove when dartbug.com/28515 fixed.
-        );
-    expectIdentifierType('paramCall', "int");
-  }
-
-  test_genericMethod_functionInvocation_inferred() async {
-    await resolveTestUnit(r'''
-class C<E> {
-  T f<T>(T e) => null;
-  static T g<T>(T e) => null;
-  static T Function<T>(T) h = null;
-}
-
-T topF<T>(T e) => null;
-var topG = topF;
-void test<S>(T Function<T>(T) pf) {
-  var c = new C<int>();
-  T lf<T>(T e) => null;
-  var methodCall = c.f(3);
-  var staticCall = C.g(3);
-  var staticFieldCall = C.h(3);
-  var topFunCall = topF(3);
-  var topFieldCall = topG(3);
-  var localCall = lf(3);
-  var paramCall = pf(3);
-}
-''');
-    expectIdentifierType('methodCall', "int");
-    expectIdentifierType('staticCall', "int");
-    expectIdentifierType('staticFieldCall', "int");
-    expectIdentifierType('topFunCall', "int");
-    expectIdentifierType('topFieldCall', "int");
-    expectIdentifierType('localCall', "int");
-    expectIdentifierType('paramCall', "int");
-  }
-
-  test_genericMethod_functionTypedParameter() async {
-    await resolveTestUnit(r'''
-class C<E> {
-  List<T> f<T>(T f(E e)) => null;
-}
-main() {
-  C<String> cOfString;
-}
-''');
-    expectFunctionType('f', '<T>((E) → T) → List<T>',
-        elementTypeParams: '[T]',
-        typeParams: '[E]',
-        typeArgs: '[E]',
-        typeFormals: '[T]');
-
-    SimpleIdentifier c = findIdentifier('cOfString');
-    FunctionType ft = (c.staticType as InterfaceType).getMethod('f').type;
-    expect(ft.toString(), '<T>((String) → T) → List<T>');
-    ft = ft.instantiate([typeProvider.intType]);
-    expect(ft.toString(), '((String) → int) → List<int>');
-  }
-
-  test_genericMethod_functionTypedParameter_tearoff() async {
-    await resolveTestUnit(r'''
-void test<S>(T pf<T>(T e)) {
-  var paramTearOff = pf;
-}
-''', noErrors: false // TODO(paulberry): remove when dartbug.com/28515 fixed.
-        );
-    expectIdentifierType('paramTearOff', "<T>(T) → T");
-  }
-
-  test_genericMethod_implicitDynamic() async {
-    // Regression test for:
-    // https://github.com/dart-lang/sdk/issues/25100#issuecomment-162047588
-    // These should not cause any hints or warnings.
-    await resolveTestUnit(r'''
-class List<E> {
-  T map<T>(T f(E e)) => null;
-}
-void foo() {
-  List list = null;
-  list.map((e) => e);
-  list.map((e) => 3);
-}''');
-    expectIdentifierType('map((e) => e);', '<T>((dynamic) → T) → T');
-    expectIdentifierType('map((e) => 3);', '<T>((dynamic) → T) → T');
-
-    MethodInvocation m1 = findIdentifier('map((e) => e);').parent;
-    expect(m1.staticInvokeType.toString(), '((dynamic) → dynamic) → dynamic');
-    MethodInvocation m2 = findIdentifier('map((e) => 3);').parent;
-    expect(m2.staticInvokeType.toString(), '((dynamic) → int) → int');
-  }
-
-  test_genericMethod_max_doubleDouble() async {
-    String code = r'''
-import 'dart:math';
-main() {
-  var foo = max(1.0, 2.0);
-}
-''';
-    await resolveTestUnit(code);
-    expectInitializerType('foo', 'double');
-  }
-
-  test_genericMethod_max_doubleDouble_prefixed() async {
-    String code = r'''
-import 'dart:math' as math;
-main() {
-  var foo = math.max(1.0, 2.0);
-}
-''';
-    await resolveTestUnit(code);
-    expectInitializerType('foo', 'double');
-  }
-
-  test_genericMethod_max_doubleInt() async {
-    String code = r'''
-import 'dart:math';
-main() {
-  var foo = max(1.0, 2);
-}
-''';
-    await resolveTestUnit(code);
-    expectInitializerType('foo', 'num');
-  }
-
-  test_genericMethod_max_intDouble() async {
-    String code = r'''
-import 'dart:math';
-main() {
-  var foo = max(1, 2.0);
-}
-''';
-    await resolveTestUnit(code);
-    expectInitializerType('foo', 'num');
-  }
-
-  test_genericMethod_max_intInt() async {
-    String code = r'''
-import 'dart:math';
-main() {
-  var foo = max(1, 2);
-}
-''';
-    await resolveTestUnit(code);
-    expectInitializerType('foo', 'int');
-  }
-
-  test_genericMethod_nestedBound() async {
-    String code = r'''
-class Foo<T extends num> {
-  void method<U extends T>(U u) {
-    u.abs();
-  }
-}
-''';
-    // Just validate that there is no warning on the call to `.abs()`.
-    await resolveTestUnit(code);
-  }
-
-  test_genericMethod_nestedCapture() async {
-    await resolveTestUnit(r'''
-class C<T> {
-  T f<S>(S x) {
-    new C<S>().f<int>(3);
-    new C<S>().f; // tear-off
-    return null;
-  }
-}
-''');
-    MethodInvocation f = findIdentifier('f<int>(3);').parent;
-    expect(f.staticInvokeType.toString(), '(int) → S');
-    FunctionType ft = f.staticInvokeType;
-    expect('${ft.typeArguments}/${ft.typeParameters}', '[S, int]/[T, S]');
-
-    expectIdentifierType('f;', '<S₀>(S₀) → S');
-  }
-
-  test_genericMethod_nestedCaptureBounds() async {
-    await resolveTestUnit(r'''
-class C<T> {
-  T f<S extends T>(S x) {
-    new C<S>().f<int>(3);
-    new C<S>().f; // tear-off
-    return null;
-  }
-}
-''');
-    MethodInvocation f = findIdentifier('f<int>(3);').parent;
-    expect(f.staticInvokeType.toString(), '(int) → S');
-    FunctionType ft = f.staticInvokeType;
-    expect('${ft.typeArguments}/${ft.typeParameters}',
-        '[S, int]/[T, S extends T]');
-
-    expectIdentifierType('f;', '<S₀ extends S>(S₀) → S');
-  }
-
-  test_genericMethod_nestedFunctions() async {
-    await resolveTestUnit(r'''
-S f<S>(S x) {
-  g<S>(S x) => f;
-  return null;
-}
-''');
-    expectIdentifierType('f', '<S>(S) → S');
-    expectIdentifierType('g', '<S>(S) → <S>(S) → S');
-  }
-
-  test_genericMethod_override() async {
-    await resolveTestUnit(r'''
-class C {
-  T f<T>(T x) => null;
-}
-class D extends C {
-  T f<T>(T x) => null; // from D
-}
-''');
-    expectFunctionType('f<T>(T x) => null; // from D', '<T>(T) → T',
-        elementTypeParams: '[T]', typeFormals: '[T]');
-    SimpleIdentifier f = findIdentifier('f<T>(T x) => null; // from D');
-    MethodElementImpl e = f.staticElement;
-    FunctionType ft = e.type.instantiate([typeProvider.stringType]);
-    expect(ft.toString(), '(String) → String');
-  }
-
-  test_genericMethod_override_bounds() async {
-    await resolveTestUnit(r'''
-class A {}
-class B {
-  T f<T extends A>(T x) => null;
-}
-// override with the same bound is OK
-class C extends B {
-  T f<T extends A>(T x) => null;
-}
-// override with new name and the same bound is OK
-class D extends B {
-  Q f<Q extends A>(Q x) => null;
-}
-''');
-  }
-
-  test_genericMethod_override_covariant_field() async {
-    Source source = addSource(r'''
-abstract class A {
-  num get x;
-  set x(covariant num _);
-}
-
-class B extends A {
-  int x;
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_genericMethod_override_differentContextsSameBounds() async {
-    Source source = addSource(r'''
-        class GenericMethodBounds<T> {
-  Type get t => T;
-  GenericMethodBounds<E> foo<E extends T>() => new GenericMethodBounds<E>();
-  GenericMethodBounds<E> bar<E extends void Function(T)>() =>
-      new GenericMethodBounds<E>();
-}
-
-class GenericMethodBoundsDerived extends GenericMethodBounds<num> {
-  GenericMethodBounds<E> foo<E extends num>() => new GenericMethodBounds<E>();
-  GenericMethodBounds<E> bar<E extends void Function(num)>() =>
-      new GenericMethodBounds<E>();
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_genericMethod_override_invalidContravariantTypeParamBounds() async {
-    Source source = addSource(r'''
-class A {}
-class B extends A {}
-class C {
-  T f<T extends A>(T x) => null;
-}
-class D extends C {
-  T f<T extends B>(T x) => null;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.INVALID_OVERRIDE]);
-    verify([source]);
-  }
-
-  test_genericMethod_override_invalidCovariantTypeParamBounds() async {
-    Source source = addSource(r'''
-class A {}
-class B extends A {}
-class C {
-  T f<T extends B>(T x) => null;
-}
-class D extends C {
-  T f<T extends A>(T x) => null;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.INVALID_OVERRIDE]);
-    verify([source]);
-  }
-
-  test_genericMethod_override_invalidReturnType() async {
-    Source source = addSource(r'''
-class C {
-  Iterable<T> f<T>(T x) => null;
-}
-class D extends C {
-  String f<S>(S x) => null;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.INVALID_OVERRIDE]);
-    verify([source]);
-  }
-
-  test_genericMethod_override_invalidTypeParamCount() async {
-    Source source = addSource(r'''
-class C {
-  T f<T>(T x) => null;
-}
-class D extends C {
-  S f<T, S>(T x) => null;
-}''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [CompileTimeErrorCode.INVALID_OVERRIDE]);
-    verify([source]);
-  }
-
-  test_genericMethod_propagatedType_promotion() async {
-    // Regression test for:
-    // https://github.com/dart-lang/sdk/issues/25340
-
-    // Note, after https://github.com/dart-lang/sdk/issues/25486 the original
-    // example won't work, as we now compute a static type and therefore discard
-    // the propagated type. So a new test was created that doesn't run under
-    // strong mode.
-    await resolveTestUnit(r'''
-abstract class Iter {
-  List<S> map<S>(S f(x));
-}
-class C {}
-C toSpan(dynamic element) {
-  if (element is Iter) {
-    var y = element.map(toSpan);
-  }
-  return null;
-}''');
-    expectIdentifierType('y = ', 'List<C>');
-  }
-
-  test_genericMethod_tearoff() async {
-    await resolveTestUnit(r'''
-class C<E> {
-  T f<T>(E e) => null;
-  static T g<T>(T e) => null;
-  static T Function<T>(T) h = null;
-}
-
-T topF<T>(T e) => null;
-var topG = topF;
-void test<S>(T Function<T>(T) pf) {
-  var c = new C<int>();
-  T lf<T>(T e) => null;
-  var methodTearOff = c.f;
-  var staticTearOff = C.g;
-  var staticFieldTearOff = C.h;
-  var topFunTearOff = topF;
-  var topFieldTearOff = topG;
-  var localTearOff = lf;
-  var paramTearOff = pf;
-}
-''');
-    expectIdentifierType('methodTearOff', "<T>(int) → T");
-    expectIdentifierType('staticTearOff', "<T>(T) → T");
-    expectIdentifierType('staticFieldTearOff', "<T>(T) → T");
-    expectIdentifierType('topFunTearOff', "<T>(T) → T");
-    expectIdentifierType('topFieldTearOff', "<T>(T) → T");
-    expectIdentifierType('localTearOff', "<T>(T) → T");
-    expectIdentifierType('paramTearOff', "<T>(T) → T");
-  }
-
-  test_genericMethod_tearoff_instantiated() async {
-    await resolveTestUnit(r'''
-class C<E> {
-  T f<T>(E e) => null;
-  static T g<T>(T e) => null;
-  static T Function<T>(T) h = null;
-}
-
-T topF<T>(T e) => null;
-var topG = topF;
-void test<S>(T pf<T>(T e)) {
-  var c = new C<int>();
-  T lf<T>(T e) => null;
-  var methodTearOffInst = c.f<int>;
-  var staticTearOffInst = C.g<int>;
-  var staticFieldTearOffInst = C.h<int>;
-  var topFunTearOffInst = topF<int>;
-  var topFieldTearOffInst = topG<int>;
-  var localTearOffInst = lf<int>;
-  var paramTearOffInst = pf<int>;
-}
-''');
-    expectIdentifierType('methodTearOffInst', "(int) → int");
-    expectIdentifierType('staticTearOffInst', "(int) → int");
-    expectIdentifierType('staticFieldTearOffInst', "(int) → int");
-    expectIdentifierType('topFunTearOffInst', "(int) → int");
-    expectIdentifierType('topFieldTearOffInst', "(int) → int");
-    expectIdentifierType('localTearOffInst', "(int) → int");
-    expectIdentifierType('paramTearOffInst', "(int) → int");
-  }
-
-  test_genericMethod_then() async {
-    String code = r'''
-import 'dart:async';
-String toString(int x) => x.toString();
-main() {
-  Future<int> bar = null;
-  var foo = bar.then(toString);
-}
-''';
-    await resolveTestUnit(code);
-
-    expectInitializerType('foo', 'Future<String>');
-  }
-
-  test_genericMethod_then_prefixed() async {
-    String code = r'''
-import 'dart:async' as async;
-String toString(int x) => x.toString();
-main() {
-  async.Future<int> bar = null;
-  var foo = bar.then(toString);
-}
-''';
-    await resolveTestUnit(code);
-    expectInitializerType('foo', 'Future<String>');
-  }
-
-  test_genericMethod_then_propagatedType() async {
-    // Regression test for https://github.com/dart-lang/sdk/issues/25482.
-    String code = r'''
-import 'dart:async';
-void main() {
-  Future<String> p;
-  var foo = p.then((r) => new Future<String>.value(3));
-}
-''';
-    await resolveTestUnit(code, noErrors: false);
-    // Note: this correctly reports the error
-    // StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE when run with the driver;
-    // when run without the driver, it reports no errors.  So we don't bother
-    // checking whether the correct errors were reported.
-    expectInitializerType('foo', 'Future<String>');
-  }
-
-  test_genericMethod_toplevel_field_staticTearoff() async {
-    await resolveTestUnit(r'''
-class C<E> {
-  static T g<T>(T e) => null;
-  static T Function<T>(T) h = null;
-}
-
-void test() {
-  var fieldRead = C.h;
-}
-''');
-    expectIdentifierType('fieldRead', "<T>(T) → T");
-  }
-
-  test_implicitBounds() async {
-    String code = r'''
-class A<T> {}
-
-class B<T extends num> {}
-
-class C<S extends int, T extends B<S>, U extends A> {}
-
-void test() {
-//
-  A ai;
-  B bi;
-  C ci;
-  var aa = new A();
-  var bb = new B();
-  var cc = new C();
-}
-''';
-    await resolveTestUnit(code);
-    expectIdentifierType('ai', "A<dynamic>");
-    expectIdentifierType('bi', "B<num>");
-    expectIdentifierType('ci', "C<int, B<int>, A<dynamic>>");
-    expectIdentifierType('aa', "A<dynamic>");
-    expectIdentifierType('bb', "B<num>");
-    expectIdentifierType('cc', "C<int, B<int>, A<dynamic>>");
-  }
-
-  test_inferClosureType_parameters() async {
-    Source source = addSource(r'''
-typedef F({bool p});
-foo(callback(F f)) {}
-main() {
-  foo((f) {
-    f(p: false);
-  });
-}
-''');
-    var result = await computeAnalysisResult(source);
-    var main = result.unit.declarations[2] as FunctionDeclaration;
-    var body = main.functionExpression.body as BlockFunctionBody;
-    var statement = body.block.statements[0] as ExpressionStatement;
-    var invocation = statement.expression as MethodInvocation;
-    var closure = invocation.argumentList.arguments[0] as FunctionExpression;
-    var closureType = closure.staticType as FunctionType;
-    var fType = closureType.parameters[0].type as FunctionType;
-    // The inferred type of "f" in "foo()" invocation must own its parameters.
-    ParameterElement p = fType.parameters[0];
-    expect(p.name, 'p');
-    expect(p.enclosingElement, same(fType.element));
-  }
-
-  test_instantiateToBounds_class_error_extension_malbounded() async {
-    // Test that superclasses are strictly checked for malbounded default
-    // types
-    String code = r'''
-class C<T0 extends List<T1>, T1 extends List<T0>> {}
-class D extends C {}
-''';
-    await resolveTestUnit(code, noErrors: false);
-    assertErrors(testSource, [StrongModeCode.NO_DEFAULT_BOUNDS]);
-  }
-
-  test_instantiateToBounds_class_error_instantiation_malbounded() async {
-    // Test that instance creations are strictly checked for malbounded default
-    // types
-    String code = r'''
-class C<T0 extends List<T1>, T1 extends List<T0>> {}
-void test() {
-  var c = new C();
-}
-''';
-    await resolveTestUnit(code, noErrors: false);
-    assertErrors(testSource, [StrongModeCode.NO_DEFAULT_BOUNDS]);
-    expectIdentifierType('c;', 'C<List<dynamic>, List<dynamic>>');
-  }
-
-  test_instantiateToBounds_class_error_recursion() async {
-    String code = r'''
-class C<T0 extends List<T1>, T1 extends List<T0>> {}
-C c;
-''';
-    await resolveTestUnit(code, noErrors: false);
-    assertNoErrors(testSource);
-    expectIdentifierType('c;', 'C<List<dynamic>, List<dynamic>>');
-  }
-
-  test_instantiateToBounds_class_error_recursion_self() async {
-    String code = r'''
-class C<T extends C<T>> {}
-C c;
-''';
-    await resolveTestUnit(code, noErrors: false);
-    assertNoErrors(testSource);
-    expectIdentifierType('c;', 'C<C<dynamic>>');
-  }
-
-  test_instantiateToBounds_class_error_recursion_self2() async {
-    String code = r'''
-class A<E> {}
-class C<T extends A<T>> {}
-C c;
-''';
-    await resolveTestUnit(code, noErrors: false);
-    assertNoErrors(testSource);
-    expectIdentifierType('c;', 'C<A<dynamic>>');
-  }
-
-  test_instantiateToBounds_class_error_typedef() async {
-    String code = r'''
-typedef T F<T>(T x);
-class C<T extends F<T>> {}
-C c;
-''';
-    await resolveTestUnit(code, noErrors: false);
-    assertNoErrors(testSource);
-    expectIdentifierType('c;', 'C<(dynamic) → dynamic>');
-  }
-
-  test_instantiateToBounds_class_ok_implicitDynamic_multi() async {
-    String code = r'''
-class C<T0 extends Map<T1, T2>, T1 extends List, T2 extends int> {}
-C c;
-''';
-    await resolveTestUnit(code);
-    assertNoErrors(testSource);
-    expectIdentifierType(
-        'c;', 'C<Map<List<dynamic>, int>, List<dynamic>, int>');
-  }
-
-  test_instantiateToBounds_class_ok_referenceOther_after() async {
-    String code = r'''
-class C<T0 extends T1, T1 extends int> {}
-C c;
-''';
-    await resolveTestUnit(code);
-    assertNoErrors(testSource);
-    expectIdentifierType('c;', 'C<int, int>');
-  }
-
-  test_instantiateToBounds_class_ok_referenceOther_after2() async {
-    String code = r'''
-class C<T0 extends Map<T1, T1>, T1 extends int> {}
-C c;
-''';
-    await resolveTestUnit(code);
-    assertNoErrors(testSource);
-    expectIdentifierType('c;', 'C<Map<int, int>, int>');
-  }
-
-  test_instantiateToBounds_class_ok_referenceOther_before() async {
-    String code = r'''
-class C<T0 extends int, T1 extends T0> {}
-C c;
-''';
-    await resolveTestUnit(code);
-    assertNoErrors(testSource);
-    expectIdentifierType('c;', 'C<int, int>');
-  }
-
-  test_instantiateToBounds_class_ok_referenceOther_multi() async {
-    String code = r'''
-class C<T0 extends Map<T1, T2>, T1 extends List<T2>, T2 extends int> {}
-C c;
-''';
-    await resolveTestUnit(code);
-    assertNoErrors(testSource);
-    expectIdentifierType('c;', 'C<Map<List<int>, int>, List<int>, int>');
-  }
-
-  test_instantiateToBounds_class_ok_simpleBounds() async {
-    String code = r'''
-class A<T> {}
-class B<T extends num> {}
-class C<T extends List<int>> {}
-class D<T extends A> {}
-void main() {
-  A a;
-  B b;
-  C c;
-  D d;
-}
-''';
-    await resolveTestUnit(code);
-    assertNoErrors(testSource);
-    expectIdentifierType('a;', 'A<dynamic>');
-    expectIdentifierType('b;', 'B<num>');
-    expectIdentifierType('c;', 'C<List<int>>');
-    expectIdentifierType('d;', 'D<A<dynamic>>');
-  }
-
-  test_instantiateToBounds_generic_function_error_malbounded() async {
-    // Test that generic methods are strictly checked for malbounded default
-    // types
-    String code = r'''
-T0 f<T0 extends List<T1>, T1 extends List<T0>>() {}
-void g() {
-  var c = f();
-  return;
-}
-''';
-    await resolveTestUnit(code, noErrors: false);
-    assertErrors(testSource, [StrongModeCode.NO_DEFAULT_BOUNDS]);
-    expectIdentifierType('c;', 'List<dynamic>');
-  }
-
-  test_instantiateToBounds_method_ok_referenceOther_before() async {
-    String code = r'''
-class C<T> {
-  void m<S0 extends T, S1 extends List<S0>>(S0 p0, S1 p1) {}
-
-  void main() {
-    m(null, null);
-  }
-}
-''';
-    await resolveTestUnit(code);
-    assertNoErrors(testSource);
-    expectStaticInvokeType('m(null', '(Null, Null) → void');
-  }
-
-  test_instantiateToBounds_method_ok_referenceOther_before2() async {
-    String code = r'''
-class C<T> {
-  Map<S0, S1> m<S0 extends T, S1 extends List<S0>>() => null;
-
-  void main() {
-    m();
-  }
-}
-''';
-    await resolveTestUnit(code);
-    assertNoErrors(testSource);
-    expectStaticInvokeType('m();', '() → Map<T, List<T>>');
-  }
-
-  test_instantiateToBounds_method_ok_simpleBounds() async {
-    String code = r'''
-class C<T> {
-  void m<S extends T>(S p0) {}
-
-  void main() {
-    m(null);
-  }
-}
-''';
-    await resolveTestUnit(code);
-    assertNoErrors(testSource);
-    expectStaticInvokeType('m(null)', '(Null) → void');
-  }
-
-  test_instantiateToBounds_method_ok_simpleBounds2() async {
-    String code = r'''
-class C<T> {
-  S m<S extends T>() => null;
-
-  void main() {
-    m();
-  }
-}
-''';
-    await resolveTestUnit(code);
-    assertNoErrors(testSource);
-    expectStaticInvokeType('m();', '() → T');
-  }
-
-  test_issue32396() async {
-    await resolveTestUnit(r'''
-class C<E> {
-  static T g<T>(T e) => null;
-  static final h = g;
-}
-''');
-  }
-
-  test_notInstantiatedBound_class_error_recursion() async {
-    String code = r'''
-class A<T extends B> {} // points to a
-class B<T extends A> {} // points to b
-class C<T extends A> {} // points to a cyclical type
-''';
-    await resolveTestUnit(code, noErrors: false);
-    assertErrors(testSource, [
-      StrongModeCode.NOT_INSTANTIATED_BOUND,
-      StrongModeCode.NOT_INSTANTIATED_BOUND,
-      StrongModeCode.NOT_INSTANTIATED_BOUND,
-    ]);
-  }
-
-  test_notInstantiatedBound_class_error_recursion_less_direct() async {
-    String code = r'''
-class A<T extends B<A>> {}
-class B<T extends A<B>> {}
-''';
-    await resolveTestUnit(code, noErrors: false);
-    assertErrors(testSource, [
-      StrongModeCode.NOT_INSTANTIATED_BOUND,
-      StrongModeCode.NOT_INSTANTIATED_BOUND,
-    ]);
-  }
-
-  test_notInstantiatedBound_class_error_recursion_typedef() async {
-    String code = r'''
-typedef F(C value);
-class C<T extends F> {}
-class D<T extends C> {}
-''';
-    await resolveTestUnit(code, noErrors: false);
-    assertErrors(testSource, [
-      StrongModeCode.NOT_INSTANTIATED_BOUND,
-      StrongModeCode.NOT_INSTANTIATED_BOUND,
-      CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF,
-    ]);
-  }
-
-  test_notInstantiatedBound_error_class_argument() async {
-    String code = r'''
-class A<K, V extends List<K>> {}
-class C<T extends A> {}
-''';
-    await resolveTestUnit(code, noErrors: false);
-    assertErrors(testSource, [StrongModeCode.NOT_INSTANTIATED_BOUND]);
-  }
-
-  test_notInstantiatedBound_error_class_argument2() async {
-    String code = r'''
-class A<K, V extends List<List<K>>> {}
-class C<T extends A> {}
-''';
-    await resolveTestUnit(code, noErrors: false);
-    assertErrors(testSource, [StrongModeCode.NOT_INSTANTIATED_BOUND]);
-  }
-
-  test_notInstantiatedBound_error_class_direct() async {
-    String code = r'''
-class A<K, V extends K> {}
-class C<T extends A> {}
-''';
-    await resolveTestUnit(code, noErrors: false);
-    assertErrors(testSource, [StrongModeCode.NOT_INSTANTIATED_BOUND]);
-  }
-
-  test_notInstantiatedBound_error_class_indirect() async {
-    String code = r'''
-class A<K, V extends K> {}
-class C<T extends List<A>> {}
-''';
-    await resolveTestUnit(code, noErrors: false);
-    assertErrors(testSource, [StrongModeCode.NOT_INSTANTIATED_BOUND]);
-  }
-
-  test_notInstantiatedBound_error_functionType() async {
-    await resolveTestUnit(r'''
-class A<T extends Function(T)> {}
-class B<T extends T Function()> {}
-class C<T extends A> {}
-class D<T extends B> {}
-''', noErrors: false);
-    assertErrors(testSource, [
-      StrongModeCode.NOT_INSTANTIATED_BOUND,
-      StrongModeCode.NOT_INSTANTIATED_BOUND
-    ]);
-  }
-
-  test_notInstantiatedBound_error_typedef_argument() async {
-    String code = r'''
-class A<K, V extends List<K>> {}
-typedef void F<T extends A>();
-''';
-    await resolveTestUnit(code, noErrors: false);
-    assertErrors(testSource, [StrongModeCode.NOT_INSTANTIATED_BOUND]);
-  }
-
-  test_notInstantiatedBound_error_typedef_argument2() async {
-    String code = r'''
-class A<K, V extends List<List<K>>> {}
-typedef void F<T extends A>();
-''';
-    await resolveTestUnit(code, noErrors: false);
-    assertErrors(testSource, [StrongModeCode.NOT_INSTANTIATED_BOUND]);
-  }
-
-  test_notInstantiatedBound_error_typedef_direct() async {
-    String code = r'''
-class A<K, V extends K> {}
-typedef void F<T extends A>();
-''';
-    await resolveTestUnit(code, noErrors: false);
-    assertErrors(testSource, [StrongModeCode.NOT_INSTANTIATED_BOUND]);
-  }
-
-  test_notInstantiatedBound_ok_class() async {
-    String code = r'''
-class A<T extends int> {}
-class C1<T extends A> {}
-class C2<T extends List<A>> {}
-''';
-    await resolveTestUnit(code);
-    assertNoErrors(testSource);
-  }
-
-  test_notInstantiatedBound_ok_class_class2() async {
-    String code = r'''
-class A<T> {}
-class C<T extends A<int>> {}
-class D<T extends C> {}
-''';
-    await resolveTestUnit(code);
-    assertNoErrors(testSource);
-  }
-
-  test_notInstantiatedBound_ok_class_class3() async {
-    String code = r'''
-class A<T> {}
-class B<T extends int> {}
-class C<T extends A<B>> {}
-''';
-    await resolveTestUnit(code);
-    assertNoErrors(testSource);
-  }
-
-  test_notInstantiatedBound_ok_class_class4() async {
-    String code = r'''
-class A<K, V> {}
-class B<T extends int> {}
-class C<T extends A<B, B>> {}
-''';
-    await resolveTestUnit(code);
-    assertNoErrors(testSource);
-  }
-
-  test_notInstantiatedBound_ok_class_function() async {
-    String code = r'''
-class A<T extends void Function()> {}
-class B<T extends A> {}
-''';
-    await resolveTestUnit(code);
-    assertNoErrors(testSource);
-  }
-
-  test_notInstantiatedBound_ok_class_typedef() async {
-    String code = r'''
-typedef void F<T extends int>();
-class C<T extends F> {}
-''';
-    await resolveTestUnit(code);
-    assertNoErrors(testSource);
-  }
-
-  test_notInstantiatedBound_ok_typedef_class() async {
-    String code = r'''
-class C<T extends int> {}
-typedef void F<T extends C>();
-''';
-    await resolveTestUnit(code);
-    assertNoErrors(testSource);
-  }
-
-  test_objectMethodOnFunctions_Anonymous() async {
-    String code = r'''
-void main() {
-  var f = (x) => 3;
-  // No errors, correct type
-  var t0 = f.toString();
-  var t1 = f.toString;
-  var t2 = f.hashCode;
-
-  // Expressions, no errors, correct type
-  var t3 = (f).toString();
-  var t4 = (f).toString;
-  var t5 = (f).hashCode;
-
-  // Cascades, no errors
-  f..toString();
-  f..toString;
-  f..hashCode;
-
-  // Expression cascades, no errors
-  (f)..toString();
-  (f)..toString;
-  (f)..hashCode;
-}''';
-    await _objectMethodOnFunctions_helper2(code);
-  }
-
-  test_objectMethodOnFunctions_Function() async {
-    String code = r'''
-void main() {
-  Function f;
-  // No errors, correct type
-  var t0 = f.toString();
-  var t1 = f.toString;
-  var t2 = f.hashCode;
-
-  // Expressions, no errors, correct type
-  var t3 = (f).toString();
-  var t4 = (f).toString;
-  var t5 = (f).hashCode;
-
-  // Cascades, no errors
-  f..toString();
-  f..toString;
-  f..hashCode;
-
-  // Expression cascades, no errors
-  (f)..toString();
-  (f)..toString;
-  (f)..hashCode;
-}''';
-    await _objectMethodOnFunctions_helper2(code);
-  }
-
-  test_objectMethodOnFunctions_Static() async {
-    String code = r'''
-int f(int x) => null;
-void main() {
-  // No errors, correct type
-  var t0 = f.toString();
-  var t1 = f.toString;
-  var t2 = f.hashCode;
-
-  // Expressions, no errors, correct type
-  var t3 = (f).toString();
-  var t4 = (f).toString;
-  var t5 = (f).hashCode;
-
-  // Cascades, no errors
-  f..toString();
-  f..toString;
-  f..hashCode;
-
-  // Expression cascades, no errors
-  (f)..toString();
-  (f)..toString;
-  (f)..hashCode;
-}''';
-    await _objectMethodOnFunctions_helper2(code);
-  }
-
-  test_objectMethodOnFunctions_Typedef() async {
-    String code = r'''
-typedef bool Predicate<T>(T object);
-
-void main() {
-  Predicate<int> f;
-  // No errors, correct type
-  var t0 = f.toString();
-  var t1 = f.toString;
-  var t2 = f.hashCode;
-
-  // Expressions, no errors, correct type
-  var t3 = (f).toString();
-  var t4 = (f).toString;
-  var t5 = (f).hashCode;
-
-  // Cascades, no errors
-  f..toString();
-  f..toString;
-  f..hashCode;
-
-  // Expression cascades, no errors
-  (f)..toString();
-  (f)..toString;
-  (f)..hashCode;
-}''';
-    await _objectMethodOnFunctions_helper2(code);
-  }
-
-  test_returnOfInvalidType_object_void() async {
-    await assertErrorsInCode(
-        "Object f() { void voidFn() => null; return voidFn(); }",
-        [StaticTypeWarningCode.RETURN_OF_INVALID_TYPE]);
-  }
-
-  test_setterWithDynamicTypeIsError() async {
-    Source source = addSource(r'''
-class A {
-  dynamic set f(String s) => null;
-}
-dynamic set g(int x) => null;
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      StaticWarningCode.NON_VOID_RETURN_FOR_SETTER,
-      StaticWarningCode.NON_VOID_RETURN_FOR_SETTER
-    ]);
-    verify([source]);
-  }
-
-  test_setterWithExplicitVoidType_returningVoid() async {
-    Source source = addSource(r'''
-void returnsVoid() {}
-class A {
-  void set f(String s) => returnsVoid();
-}
-void set g(int x) => returnsVoid();
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_setterWithNoVoidType() async {
-    Source source = addSource(r'''
-class A {
-  set f(String s) {
-    return '42';
-  }
-}
-set g(int x) => 42;
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      StaticTypeWarningCode.RETURN_OF_INVALID_TYPE,
-    ]);
-    verify([source]);
-  }
-
-  test_setterWithNoVoidType_returningVoid() async {
-    Source source = addSource(r'''
-void returnsVoid() {}
-class A {
-  set f(String s) => returnsVoid();
-}
-set g(int x) => returnsVoid();
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_setterWithOtherTypeIsError() async {
-    Source source = addSource(r'''
-class A {
-  String set f(String s) => null;
-}
-Object set g(x) => null;
-''');
-    await computeAnalysisResult(source);
-    assertErrors(source, [
-      StaticWarningCode.NON_VOID_RETURN_FOR_SETTER,
-      StaticWarningCode.NON_VOID_RETURN_FOR_SETTER
-    ]);
-    verify([source]);
-  }
-
-  test_ternaryOperator_null_left() async {
-    String code = r'''
-main() {
-  var foo = (true) ? null : 3;
-}
-''';
-    await resolveTestUnit(code);
-    expectInitializerType('foo', 'int');
-  }
-
-  test_ternaryOperator_null_right() async {
-    String code = r'''
-main() {
-  var foo = (true) ? 3 : null;
-}
-''';
-    await resolveTestUnit(code);
-    expectInitializerType('foo', 'int');
-  }
-
-  Future<void> _objectMethodOnFunctions_helper2(String code) async {
-    await resolveTestUnit(code);
-    expectIdentifierType('t0', "String");
-    expectIdentifierType('t1', "() → String");
-    expectIdentifierType('t2', "int");
-    expectIdentifierType('t3', "String");
-    expectIdentifierType('t4', "() → String");
-    expectIdentifierType('t5', "int");
-  }
-}
-
-@reflectiveTest
-class StrongModeTypePropagationTest extends ResolverTestCase {
-  @override
-  void setUp() {
-    super.setUp();
-    AnalysisOptionsImpl options = new AnalysisOptionsImpl();
-    resetWith(options: options);
-  }
-
-  test_foreachInference_dynamic_disabled() async {
-    String code = r'''
-main() {
-  var list = <int>[];
-  for (dynamic v in list) {
-    v; // marker
-  }
-}''';
-    CompilationUnit unit = await resolveSource(code);
-    assertPropagatedIterationType(code, unit, typeProvider.dynamicType);
-    assertTypeOfMarkedExpression(code, unit, typeProvider.dynamicType);
-  }
-
-  test_foreachInference_reusedVar_disabled() async {
-    String code = r'''
-main() {
-  var list = <int>[];
-  var v;
-  for (v in list) {
-    v; // marker
-  }
-}''';
-    CompilationUnit unit = await resolveSource(code);
-    assertPropagatedIterationType(code, unit, typeProvider.dynamicType);
-    assertTypeOfMarkedExpression(code, unit, typeProvider.dynamicType);
-  }
-
-  test_foreachInference_var() async {
-    String code = r'''
-main() {
-  var list = <int>[];
-  for (var v in list) {
-    v; // marker
-  }
-}''';
-    CompilationUnit unit = await resolveSource(code);
-    assertPropagatedIterationType(code, unit, typeProvider.intType);
-    assertTypeOfMarkedExpression(code, unit, typeProvider.intType);
-  }
-
-  test_foreachInference_var_iterable() async {
-    String code = r'''
-main() {
-  Iterable<int> list = <int>[];
-  for (var v in list) {
-    v; // marker
-  }
-}''';
-    CompilationUnit unit = await resolveSource(code);
-    assertPropagatedIterationType(code, unit, typeProvider.intType);
-    assertTypeOfMarkedExpression(code, unit, typeProvider.intType);
-  }
-
-  test_foreachInference_var_stream() async {
-    String code = r'''
-import 'dart:async';
-main() async {
-  Stream<int> stream = null;
-  await for (var v in stream) {
-    v; // marker
-  }
-}''';
-    CompilationUnit unit = await resolveSource(code);
-    assertPropagatedIterationType(code, unit, typeProvider.intType);
-    assertTypeOfMarkedExpression(code, unit, typeProvider.intType);
-  }
-
-  test_inconsistentMethodInheritance_inferFunctionTypeFromTypedef() async {
-    Source source = addSource(r'''
-typedef bool F<E>(E argument);
-
-abstract class Base {
-  f<E extends int>(F<int> x);
-}
-
-abstract class BaseCopy extends Base {
-}
-
-abstract class Override implements Base, BaseCopy {
-  f<E extends int>(x) => null;
-}
-
-class C extends Override implements Base {}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_localVariableInference_bottom_disabled() async {
-    String code = r'''
-main() {
-  var v = null;
-  v; // marker
-}''';
-    CompilationUnit unit = await resolveSource(code);
-    assertAssignedType(code, unit, typeProvider.dynamicType);
-    assertTypeOfMarkedExpression(code, unit, typeProvider.dynamicType);
-  }
-
-  test_localVariableInference_constant() async {
-    String code = r'''
-main() {
-  var v = 3;
-  v; // marker
-}''';
-    CompilationUnit unit = await resolveSource(code);
-    assertAssignedType(code, unit, typeProvider.intType);
-    assertTypeOfMarkedExpression(code, unit, typeProvider.intType);
-  }
-
-  test_localVariableInference_declaredType_disabled() async {
-    String code = r'''
-main() {
-  dynamic v = 3;
-  v; // marker
-}''';
-    CompilationUnit unit = await resolveSource(code);
-    assertAssignedType(code, unit, typeProvider.dynamicType);
-    assertTypeOfMarkedExpression(code, unit, typeProvider.dynamicType);
-  }
-
-  test_localVariableInference_noInitializer_disabled() async {
-    String code = r'''
-main() {
-  var v;
-  v = 3;
-  v; // marker
-}''';
-    CompilationUnit unit = await resolveSource(code);
-    assertAssignedType(code, unit, typeProvider.dynamicType);
-    assertTypeOfMarkedExpression(code, unit, typeProvider.dynamicType);
-  }
-
-  test_localVariableInference_transitive_field_inferred_lexical() async {
-    String code = r'''
-class A {
-  final x = 3;
-  f() {
-    var v = x;
-    return v; // marker
-  }
-}
-main() {
-}
-''';
-    CompilationUnit unit = await resolveSource(code);
-    assertAssignedType(code, unit, typeProvider.intType);
-    assertTypeOfMarkedExpression(code, unit, typeProvider.intType);
-  }
-
-  test_localVariableInference_transitive_field_inferred_reversed() async {
-    String code = r'''
-class A {
-  f() {
-    var v = x;
-    return v; // marker
-  }
-  final x = 3;
-}
-main() {
-}
-''';
-    CompilationUnit unit = await resolveSource(code);
-    assertAssignedType(code, unit, typeProvider.intType);
-    assertTypeOfMarkedExpression(code, unit, typeProvider.intType);
-  }
-
-  test_localVariableInference_transitive_field_lexical() async {
-    String code = r'''
-class A {
-  int x = 3;
-  f() {
-    var v = x;
-    return v; // marker
-  }
-}
-main() {
-}
-''';
-    CompilationUnit unit = await resolveSource(code);
-    assertAssignedType(code, unit, typeProvider.intType);
-    assertTypeOfMarkedExpression(code, unit, typeProvider.intType);
-  }
-
-  test_localVariableInference_transitive_field_reversed() async {
-    String code = r'''
-class A {
-  f() {
-    var v = x;
-    return v; // marker
-  }
-  int x = 3;
-}
-main() {
-}
-''';
-    CompilationUnit unit = await resolveSource(code);
-    assertAssignedType(code, unit, typeProvider.intType);
-    assertTypeOfMarkedExpression(code, unit, typeProvider.intType);
-  }
-
-  test_localVariableInference_transitive_list_local() async {
-    String code = r'''
-main() {
-  var x = <int>[3];
-  var v = x[0];
-  v; // marker
-}''';
-    CompilationUnit unit = await resolveSource(code);
-    assertAssignedType(code, unit, typeProvider.intType);
-    assertTypeOfMarkedExpression(code, unit, typeProvider.intType);
-  }
-
-  test_localVariableInference_transitive_local() async {
-    String code = r'''
-main() {
-  var x = 3;
-  var v = x;
-  v; // marker
-}''';
-    CompilationUnit unit = await resolveSource(code);
-    assertAssignedType(code, unit, typeProvider.intType);
-    assertTypeOfMarkedExpression(code, unit, typeProvider.intType);
-  }
-
-  test_localVariableInference_transitive_toplevel_inferred_lexical() async {
-    String code = r'''
-final x = 3;
-main() {
-  var v = x;
-  v; // marker
-}
-''';
-    CompilationUnit unit = await resolveSource(code);
-    assertAssignedType(code, unit, typeProvider.intType);
-    assertTypeOfMarkedExpression(code, unit, typeProvider.intType);
-  }
-
-  test_localVariableInference_transitive_toplevel_inferred_reversed() async {
-    String code = r'''
-main() {
-  var v = x;
-  v; // marker
-}
-final x = 3;
-''';
-    CompilationUnit unit = await resolveSource(code);
-    assertAssignedType(code, unit, typeProvider.intType);
-    assertTypeOfMarkedExpression(code, unit, typeProvider.intType);
-  }
-
-  test_localVariableInference_transitive_toplevel_lexical() async {
-    String code = r'''
-int x = 3;
-main() {
-  var v = x;
-  v; // marker
-}
-''';
-    CompilationUnit unit = await resolveSource(code);
-    assertAssignedType(code, unit, typeProvider.intType);
-    assertTypeOfMarkedExpression(code, unit, typeProvider.intType);
-  }
-
-  test_localVariableInference_transitive_toplevel_reversed() async {
-    String code = r'''
-main() {
-  var v = x;
-  v; // marker
-}
-int x = 3;
-''';
-    CompilationUnit unit = await resolveSource(code);
-    assertAssignedType(code, unit, typeProvider.intType);
-    assertTypeOfMarkedExpression(code, unit, typeProvider.intType);
-  }
-}
diff --git a/pkg/analyzer/test/generated/test_all.dart b/pkg/analyzer/test/generated/test_all.dart
index ac07574..5215932 100644
--- a/pkg/analyzer/test/generated/test_all.dart
+++ b/pkg/analyzer/test/generated/test_all.dart
@@ -7,28 +7,22 @@
 import 'all_the_rest_test.dart' as all_the_rest;
 import 'checked_mode_compile_time_error_code_driver_test.dart'
     as checked_mode_compile_time_error_code_driver_test;
-import 'checked_mode_compile_time_error_code_test.dart'
-    as checked_mode_compile_time_error_code_test;
 import 'compile_time_error_code_driver_test.dart'
     as compile_time_error_code_driver_test;
-import 'compile_time_error_code_test.dart' as compile_time_error_code_test;
-import 'constant_test.dart' as constant_test;
+import 'constant_test.dart'
+    as constant_test; // ignore: deprecated_member_use_from_same_package
 import 'declaration_resolver_test.dart' as declaration_resolver_test;
 import 'element_resolver_test.dart' as element_resolver_test;
 import 'engine_test.dart' as engine_test;
 import 'error_suppression_driver_test.dart' as error_suppression_driver_test;
-import 'error_suppression_test.dart' as error_suppression_test;
 import 'hint_code_driver_test.dart' as hint_code_driver_test;
 import 'hint_code_test.dart' as hint_code_test;
 import 'inheritance_manager_test.dart' as inheritance_manager_test;
 import 'invalid_code_driver_test.dart' as invalid_code_driver_test;
-import 'invalid_code_test.dart' as invalid_code_test;
 import 'java_core_test.dart' as java_core_test;
 import 'java_io_test.dart' as java_io_test;
 import 'non_error_resolver_driver_test.dart' as non_error_resolver_driver_test;
-import 'non_error_resolver_test.dart' as non_error_resolver_test;
 import 'non_hint_code_driver_test.dart' as non_hint_code_driver_test;
-import 'non_hint_code_test.dart' as non_hint_code_test;
 import 'parser_fasta_test.dart' as parser_fasta_test;
 import 'parser_test.dart' as parser_test;
 import 'resolver_driver_test.dart' as resolver_driver_test;
@@ -42,12 +36,10 @@
 import 'static_type_analyzer_test.dart' as static_type_analyzer_test;
 import 'static_type_warning_code_driver_test.dart'
     as static_type_warning_code_driver_test;
-import 'static_type_warning_code_test.dart' as static_type_warning_code_test;
 import 'static_warning_code_driver_test.dart'
     as static_warning_code_driver_test;
 import 'static_warning_code_test.dart' as static_warning_code_test;
 import 'strong_mode_driver_test.dart' as strong_mode_driver_test;
-import 'strong_mode_test.dart' as strong_mode_test;
 import 'type_system_test.dart' as type_system_test;
 import 'utilities_dart_test.dart' as utilities_dart_test;
 import 'utilities_test.dart' as utilities_test;
@@ -56,26 +48,20 @@
   defineReflectiveSuite(() {
     all_the_rest.main();
     checked_mode_compile_time_error_code_driver_test.main();
-    checked_mode_compile_time_error_code_test.main();
     compile_time_error_code_driver_test.main();
-    compile_time_error_code_test.main();
     constant_test.main();
     declaration_resolver_test.main();
     element_resolver_test.main();
     engine_test.main();
     error_suppression_driver_test.main();
-    error_suppression_test.main();
     hint_code_driver_test.main();
     hint_code_test.main();
     inheritance_manager_test.main();
     invalid_code_driver_test.main();
-    invalid_code_test.main();
     java_core_test.main();
     java_io_test.main();
     non_error_resolver_driver_test.main();
-    non_error_resolver_test.main();
     non_hint_code_driver_test.main();
-    non_hint_code_test.main();
     parser_fasta_test.main();
     parser_test.main();
     resolver_driver_test.main();
@@ -87,11 +73,9 @@
     static_type_analyzer_driver_test.main();
     static_type_analyzer_test.main();
     static_type_warning_code_driver_test.main();
-    static_type_warning_code_test.main();
     static_warning_code_driver_test.main();
     static_warning_code_test.main();
     strong_mode_driver_test.main();
-    strong_mode_test.main();
     type_system_test.main();
     utilities_dart_test.main();
     utilities_test.main();
diff --git a/pkg/analyzer/test/parse_compilation_unit_test.dart b/pkg/analyzer/test/parse_compilation_unit_test.dart
index 74a0179..899f832 100644
--- a/pkg/analyzer/test/parse_compilation_unit_test.dart
+++ b/pkg/analyzer/test/parse_compilation_unit_test.dart
@@ -2,7 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-// ignore: deprecated_member_use
+// ignore: deprecated_member_use_from_same_package
 import 'package:analyzer/analyzer.dart';
 import 'package:test/test.dart';
 
diff --git a/pkg/analyzer/test/source/error_processor_test.dart b/pkg/analyzer/test/source/error_processor_test.dart
index 247d10f..d55cd52 100644
--- a/pkg/analyzer/test/source/error_processor_test.dart
+++ b/pkg/analyzer/test/source/error_processor_test.dart
@@ -39,11 +39,6 @@
     ['x']
   ]);
 
-  AnalysisError assignment_no_type = new AnalysisError(
-      new TestSource(), 0, 1, StaticWarningCode.ASSIGNMENT_TO_TYPE, [
-    ['x']
-  ]);
-
   // We in-line a lint code here in order to avoid adding a dependency on the
   // linter package.
   AnalysisError annotate_overrides = new AnalysisError(
@@ -68,15 +63,7 @@
       expect(getProcessor(invalid_assignment).severity, ErrorSeverity.ERROR);
       expect(getProcessor(missing_return).severity, isNull);
       expect(getProcessor(unused_local_variable), isNull);
-      expect(getProcessor(use_of_void_result), isNotNull);
-    });
-
-    test('upgrades static warnings to errors in strong mode', () {
-      configureOptions('''
-analyzer:
-  strong-mode: true
-''');
-      expect(getProcessor(assignment_no_type).severity, ErrorSeverity.ERROR);
+      expect(getProcessor(use_of_void_result), isNull);
     });
 
     test('does not upgrade other warnings to errors in strong mode', () {
diff --git a/pkg/analyzer/test/source/test_all.dart b/pkg/analyzer/test/source/test_all.dart
index 643b514..f356dc3 100644
--- a/pkg/analyzer/test/source/test_all.dart
+++ b/pkg/analyzer/test/source/test_all.dart
@@ -5,7 +5,8 @@
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 
 import 'analysis_options_provider_test.dart' as analysis_options_provider_test;
-import 'embedder_test.dart' as embedder_test; // ignore: deprecated_member_use
+import 'embedder_test.dart'
+    as embedder_test; // ignore: deprecated_member_use_from_same_package
 import 'error_processor_test.dart' as error_processor_test;
 import 'package_map_resolver_test.dart' as package_map_resolver_test;
 import 'path_filter_test.dart' as path_filter_test;
diff --git a/pkg/analyzer/test/src/context/builder_test.dart b/pkg/analyzer/test/src/context/builder_test.dart
index 23e564e..5c6cd3c 100644
--- a/pkg/analyzer/test/src/context/builder_test.dart
+++ b/pkg/analyzer/test/src/context/builder_test.dart
@@ -111,26 +111,6 @@
     fail('Incomplete test');
   }
 
-  void test_cmdline_lint_default() {
-    _defineMockLintRules();
-    ArgParser argParser = new ArgParser();
-    defineAnalysisArguments(argParser);
-    ArgResults argResults = argParser.parse(['--$lintsFlag']);
-    var builder = new ContextBuilder(resourceProvider, sdkManager, contentCache,
-        options: createContextBuilderOptions(argResults));
-
-    AnalysisOptionsImpl expected = new AnalysisOptionsImpl();
-    expected.lint = true;
-    expected.lintRules = Registry.ruleRegistry.defaultRules;
-
-    String path = convertPath('/some/directory/path');
-    String filePath = join(path, AnalysisEngine.ANALYSIS_OPTIONS_YAML_FILE);
-    newFile(filePath);
-
-    AnalysisOptions options = builder.getAnalysisOptions(path);
-    _expectEqualOptions(options, expected);
-  }
-
   void test_cmdline_lint_defined() {
     _defineMockLintRules();
     ArgParser argParser = new ArgParser();
@@ -881,44 +861,44 @@
     newFile('/workspace/.packages');
     newFolder('/workspace/.dart_tool/build/generated/project/lib');
     newFileWithBytes('/workspace/pubspec.yaml', 'name: project'.codeUnits);
-    Workspace workspace = ContextBuilder.createWorkspace(
-        resourceProvider, '/workspace/project/lib/lib.dart', builder);
+    Workspace workspace = ContextBuilder.createWorkspace(resourceProvider,
+        convertPath('/workspace/project/lib/lib.dart'), builder);
     expect(workspace, TypeMatcher<PackageBuildWorkspace>());
   }
 
   void test_createWorkspace_hasPackagesFile_hasPubspec() {
     newFile('/workspace/.packages');
     newFileWithBytes('/workspace/pubspec.yaml', 'name: project'.codeUnits);
-    Workspace workspace = ContextBuilder.createWorkspace(
-        resourceProvider, '/workspace/project/lib/lib.dart', builder);
+    Workspace workspace = ContextBuilder.createWorkspace(resourceProvider,
+        convertPath('/workspace/project/lib/lib.dart'), builder);
     expect(workspace, TypeMatcher<PubWorkspace>());
   }
 
   void test_createWorkspace_hasPackagesFile_noMarkerFiles() {
     newFile('/workspace/.packages');
-    Workspace workspace = ContextBuilder.createWorkspace(
-        resourceProvider, '/workspace/project/lib/lib.dart', builder);
+    Workspace workspace = ContextBuilder.createWorkspace(resourceProvider,
+        convertPath('/workspace/project/lib/lib.dart'), builder);
     expect(workspace, TypeMatcher<BasicWorkspace>());
   }
 
   void test_createWorkspace_noPackagesFile_hasDartToolAndPubspec() {
     newFolder('/workspace/.dart_tool/build/generated/project/lib');
     newFileWithBytes('/workspace/pubspec.yaml', 'name: project'.codeUnits);
-    Workspace workspace = ContextBuilder.createWorkspace(
-        resourceProvider, '/workspace/project/lib/lib.dart', builder);
+    Workspace workspace = ContextBuilder.createWorkspace(resourceProvider,
+        convertPath('/workspace/project/lib/lib.dart'), builder);
     expect(workspace, TypeMatcher<PackageBuildWorkspace>());
   }
 
   void test_createWorkspace_noPackagesFile_hasPubspec() {
     newFileWithBytes('/workspace/pubspec.yaml', 'name: project'.codeUnits);
-    Workspace workspace = ContextBuilder.createWorkspace(
-        resourceProvider, '/workspace/project/lib/lib.dart', builder);
+    Workspace workspace = ContextBuilder.createWorkspace(resourceProvider,
+        convertPath('/workspace/project/lib/lib.dart'), builder);
     expect(workspace, TypeMatcher<PubWorkspace>());
   }
 
   void test_createWorkspace_noPackagesFile_noMarkerFiles() {
-    Workspace workspace = ContextBuilder.createWorkspace(
-        resourceProvider, '/workspace/project/lib/lib.dart', builder);
+    Workspace workspace = ContextBuilder.createWorkspace(resourceProvider,
+        convertPath('/workspace/project/lib/lib.dart'), builder);
     expect(workspace, TypeMatcher<BasicWorkspace>());
   }
 
@@ -926,24 +906,24 @@
     newFolder('/workspace/.jiri_root');
     newFile(
         '/workspace/out/debug-x87_128/dartlang/gen/project/lib/lib.packages');
-    Workspace workspace = ContextBuilder.createWorkspace(
-        resourceProvider, '/workspace/project/lib/lib.dart', builder);
+    Workspace workspace = ContextBuilder.createWorkspace(resourceProvider,
+        convertPath('/workspace/project/lib/lib.dart'), builder);
     expect(workspace, TypeMatcher<GnWorkspace>());
   }
 
   void test_createWorkspace_noPackagesFile_hasBazelMarkerFiles() {
     newFile('/workspace/WORKSPACE');
     newFolder('/workspace/bazel-genfiles');
-    Workspace workspace = ContextBuilder.createWorkspace(
-        resourceProvider, '/workspace/project/lib/lib.dart', builder);
+    Workspace workspace = ContextBuilder.createWorkspace(resourceProvider,
+        convertPath('/workspace/project/lib/lib.dart'), builder);
     expect(workspace, TypeMatcher<BazelWorkspace>());
   }
 
   _defineMockLintRules() {
     _mockLintRule = new _MockLintRule('mock_lint_rule');
-    Registry.ruleRegistry.registerDefault(_mockLintRule);
+    Registry.ruleRegistry.register(_mockLintRule);
     _mockLintRule2 = new _MockLintRule('mock_lint_rule2');
-    Registry.ruleRegistry.registerDefault(_mockLintRule2);
+    Registry.ruleRegistry.register(_mockLintRule2);
     _mockLintRule3 = new _MockLintRule('mock_lint_rule3');
     Registry.ruleRegistry.register(_mockLintRule3);
     _mockPublicMemberApiDocs = new _MockLintRule('public_member_api_docs');
diff --git a/pkg/analyzer/test/src/context/context_test.dart b/pkg/analyzer/test/src/context/context_test.dart
deleted file mode 100644
index 5822d82..0000000
--- a/pkg/analyzer/test/src/context/context_test.dart
+++ /dev/null
@@ -1,2984 +0,0 @@
-// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'dart:async';
-import 'dart:collection';
-
-import 'package:analyzer/dart/ast/ast.dart';
-import 'package:analyzer/dart/ast/standard_resolution_map.dart';
-import 'package:analyzer/dart/element/element.dart';
-import 'package:analyzer/dart/element/type.dart';
-import 'package:analyzer/dart/element/visitor.dart';
-import 'package:analyzer/error/error.dart';
-import 'package:analyzer/exception/exception.dart';
-import 'package:analyzer/file_system/file_system.dart';
-import 'package:analyzer/src/cancelable_future.dart';
-import 'package:analyzer/src/context/cache.dart';
-import 'package:analyzer/src/context/context.dart';
-import 'package:analyzer/src/dart/scanner/scanner.dart';
-import 'package:analyzer/src/generated/engine.dart';
-import 'package:analyzer/src/generated/resolver.dart';
-import 'package:analyzer/src/generated/source.dart';
-import 'package:analyzer/src/generated/utilities_collection.dart';
-import 'package:analyzer/src/source/package_map_resolver.dart';
-import 'package:analyzer/src/task/api/dart.dart';
-import 'package:analyzer/src/task/api/model.dart';
-import 'package:analyzer/src/task/dart.dart';
-import 'package:analyzer/src/task/html.dart';
-import 'package:analyzer/src/test_utilities/resource_provider_mixin.dart';
-import 'package:html/dom.dart' show Document;
-import 'package:test/test.dart';
-import 'package:test_reflective_loader/test_reflective_loader.dart';
-
-import '../../generated/engine_test.dart';
-import '../../generated/test_support.dart';
-import '../../util/element_type_matchers.dart';
-import 'abstract_context.dart';
-
-main() {
-  defineReflectiveSuite(() {
-    defineReflectiveTests(AnalysisContextImplTest);
-  });
-}
-
-@reflectiveTest
-class AnalysisContextImplTest extends AbstractContextTest
-    with ResourceProviderMixin {
-  void fail_getErrors_html_some() {
-    Source source = addSource("/test.html", r'''
-<html><head>
-<script type='application/dart' src='test.dart'/>
-</head></html>''');
-    AnalysisErrorInfo errorInfo = context.getErrors(source);
-    expect(errorInfo, isNotNull);
-    List<AnalysisError> errors = errorInfo.errors;
-    expect(errors, hasLength(0));
-    errors = context.computeErrors(source);
-    expect(errors, hasLength(2));
-  }
-
-  Future fail_implicitAnalysisEvents_removed() async {
-    AnalyzedSourcesListener listener = new AnalyzedSourcesListener();
-    context.implicitAnalysisEvents.listen(listener.onData);
-    //
-    // Create a file that references an file that is not explicitly being
-    // analyzed and fully analyze it. Ensure that the listener is told about
-    // the implicitly analyzed file.
-    //
-    Source sourceA = newSource('/a.dart', "library a; import 'b.dart';");
-    Source sourceB = newSource('/b.dart', "library b;");
-    ChangeSet changeSet = new ChangeSet();
-    changeSet.addedSource(sourceA);
-    context.applyChanges(changeSet);
-    context.computeErrors(sourceA);
-    await pumpEventQueue();
-    listener.expectAnalyzed(sourceB);
-    //
-    // Remove the reference and ensure that the listener is told that we're no
-    // longer implicitly analyzing the file.
-    //
-    context.setContents(sourceA, "library a;");
-    context.computeErrors(sourceA);
-    await pumpEventQueue();
-    listener.expectNotAnalyzed(sourceB);
-  }
-
-  void fail_performAnalysisTask_importedLibraryDelete_html() {
-    // NOTE: This was failing before converting to the new task model.
-    Source htmlSource = addSource("/page.html", r'''
-<html><body><script type="application/dart">
-  import 'libB.dart';
-  main() {print('hello dart');}
-</script></body></html>''');
-    Source libBSource = addSource("/libB.dart", "library libB;");
-    _analyzeAll_assertFinished();
-    context.computeErrors(htmlSource);
-    expect(
-        context.getResolvedCompilationUnit2(libBSource, libBSource), isNotNull,
-        reason: "libB resolved 1");
-    expect(!_hasAnalysisErrorWithErrorSeverity(context.getErrors(htmlSource)),
-        isTrue,
-        reason: "htmlSource doesn't have errors");
-    // remove libB.dart content and analyze
-    context.setContents(libBSource, null);
-    _analyzeAll_assertFinished();
-    context.computeErrors(htmlSource);
-    AnalysisErrorInfo errors = context.getErrors(htmlSource);
-    expect(_hasAnalysisErrorWithErrorSeverity(errors), isTrue,
-        reason: "htmlSource has an error");
-  }
-
-  void fail_recordLibraryElements() {
-    fail("Implement this");
-  }
-
-  @override
-  void tearDown() {
-    context = null;
-    sourceFactory = null;
-    super.tearDown();
-  }
-
-  Future test_applyChanges_add() {
-    SourcesChangedListener listener = new SourcesChangedListener();
-    context.onSourcesChanged.listen(listener.onData);
-    expect(context.sourcesNeedingProcessing, isEmpty);
-    Source source = newSource('/test.dart');
-    ChangeSet changeSet = new ChangeSet();
-    changeSet.addedSource(source);
-    context.applyChanges(changeSet);
-    expect(context.sourcesNeedingProcessing, contains(source));
-    return pumpEventQueue().then((_) {
-      listener.assertEvent(wereSourcesAdded: true);
-      listener.assertNoMoreEvents();
-    });
-  }
-
-  void test_applyChanges_add_makesExplicit() {
-    Source source = newSource('/test.dart');
-    // get the entry, it's not explicit
-    CacheEntry entry = context.getCacheEntry(source);
-    expect(entry.explicitlyAdded, isFalse);
-    // add the source
-    ChangeSet changeSet = new ChangeSet();
-    changeSet.addedSource(source);
-    context.applyChanges(changeSet);
-    // now the entry is explicit
-    expect(entry.explicitlyAdded, isTrue);
-  }
-
-  void test_applyChanges_addNewImport_invalidateLibraryCycle() {
-    context.analysisOptions =
-        new AnalysisOptionsImpl.from(context.analysisOptions);
-    Source embedder = addSource('/a.dart', r'''
-library a;
-import 'b.dart';
-//import 'c.dart';
-''');
-    addSource('/b.dart', r'''
-library b;
-import 'a.dart';
-''');
-    addSource('/c.dart', r'''
-library c;
-import 'b.dart';
-''');
-    _performPendingAnalysisTasks();
-    // Add a new import into a.dart, this should invalidate its library cycle.
-    // If it doesn't, we will get a task cycle exception.
-    context.setContents(embedder, r'''
-library a;
-import 'b.dart';
-import 'c.dart';
-''');
-    _performPendingAnalysisTasks();
-    expect(context.getCacheEntry(embedder).exception, isNull);
-  }
-
-  Future test_applyChanges_change() {
-    SourcesChangedListener listener = new SourcesChangedListener();
-    context.onSourcesChanged.listen(listener.onData);
-    expect(context.sourcesNeedingProcessing, isEmpty);
-    Source source = newSource('/test.dart');
-    ChangeSet changeSet1 = new ChangeSet();
-    changeSet1.addedSource(source);
-    context.applyChanges(changeSet1);
-    expect(context.sourcesNeedingProcessing, contains(source));
-    Source source2 = newSource('/test2.dart');
-    ChangeSet changeSet2 = new ChangeSet();
-    changeSet2.addedSource(source2);
-    changeSet2.changedSource(source);
-    context.applyChanges(changeSet2);
-    return pumpEventQueue().then((_) {
-      listener.assertEvent(wereSourcesAdded: true);
-      listener.assertEvent(wereSourcesAdded: true, changedSources: [source]);
-      listener.assertNoMoreEvents();
-    });
-  }
-
-  Future test_applyChanges_change_content() {
-    SourcesChangedListener listener = new SourcesChangedListener();
-    context.onSourcesChanged.listen(listener.onData);
-    expect(context.sourcesNeedingProcessing, isEmpty);
-    Source source = newSource('/test.dart');
-    ChangeSet changeSet1 = new ChangeSet();
-    changeSet1.addedSource(source);
-    context.applyChanges(changeSet1);
-    expect(context.sourcesNeedingProcessing, contains(source));
-    Source source2 = newSource('/test2.dart');
-    ChangeSet changeSet2 = new ChangeSet();
-    changeSet2.addedSource(source2);
-    changeSet2.changedContent(source, 'library test;');
-    context.applyChanges(changeSet2);
-    return pumpEventQueue().then((_) {
-      listener.assertEvent(wereSourcesAdded: true);
-      listener.assertEvent(wereSourcesAdded: true, changedSources: [source]);
-      listener.assertNoMoreEvents();
-    });
-  }
-
-  void test_applyChanges_change_flush_element() {
-    Source librarySource = addSource("/lib.dart", r'''
-library lib;
-int a = 0;''');
-    expect(context.computeLibraryElement(librarySource), isNotNull);
-    context.setContents(librarySource, r'''
-library lib;
-int aa = 0;''');
-    expect(context.getLibraryElement(librarySource), isNull);
-  }
-
-  Future test_applyChanges_change_multiple() {
-    SourcesChangedListener listener = new SourcesChangedListener();
-    context.onSourcesChanged.listen(listener.onData);
-    String libraryContents1 = r'''
-library lib;
-part 'part.dart';
-int a = 0;''';
-    Source librarySource = addSource("/lib.dart", libraryContents1);
-    String partContents1 = r'''
-part of lib;
-int b = a;''';
-    Source partSource = addSource("/part.dart", partContents1);
-    context.computeLibraryElement(librarySource);
-    String libraryContents2 = r'''
-library lib;
-part 'part.dart';
-int aa = 0;''';
-    context.setContents(librarySource, libraryContents2);
-    String partContents2 = r'''
-part of lib;
-int b = aa;''';
-    context.setContents(partSource, partContents2);
-    context.computeLibraryElement(librarySource);
-    CompilationUnit libraryUnit =
-        context.resolveCompilationUnit2(librarySource, librarySource);
-    expect(libraryUnit, isNotNull);
-    CompilationUnit partUnit =
-        context.resolveCompilationUnit2(partSource, librarySource);
-    expect(partUnit, isNotNull);
-    TopLevelVariableDeclaration declaration =
-        libraryUnit.declarations[0] as TopLevelVariableDeclaration;
-    Element declarationElement =
-        declaration.variables.variables[0].declaredElement;
-    TopLevelVariableDeclaration use =
-        partUnit.declarations[0] as TopLevelVariableDeclaration;
-    Element useElement =
-        (use.variables.variables[0].initializer as SimpleIdentifier)
-            .staticElement;
-    expect((useElement as PropertyAccessorElement).variable,
-        same(declarationElement));
-    return pumpEventQueue().then((_) {
-      listener.assertEvent(wereSourcesAdded: true);
-      listener.assertEvent(wereSourcesAdded: true);
-      listener.assertEvent(changedSources: [librarySource]);
-      listener.assertEvent(changedSources: [partSource]);
-      listener.assertNoMoreEvents();
-    });
-  }
-
-  Future test_applyChanges_change_range() {
-    SourcesChangedListener listener = new SourcesChangedListener();
-    context.onSourcesChanged.listen(listener.onData);
-    expect(context.sourcesNeedingProcessing, isEmpty);
-    Source source = newSource('/test.dart');
-    ChangeSet changeSet1 = new ChangeSet();
-    changeSet1.addedSource(source);
-    context.applyChanges(changeSet1);
-    expect(context.sourcesNeedingProcessing, contains(source));
-    Source source2 = newSource('/test2.dart');
-    ChangeSet changeSet2 = new ChangeSet();
-    changeSet2.addedSource(source2);
-    changeSet2.changedRange(source, 'library test;', 0, 0, 13);
-    context.applyChanges(changeSet2);
-    return pumpEventQueue().then((_) {
-      listener.assertEvent(wereSourcesAdded: true);
-      listener.assertEvent(wereSourcesAdded: true, changedSources: [source]);
-      listener.assertNoMoreEvents();
-    });
-  }
-
-  void test_applyChanges_changedSource_updateModificationTime() {
-    File file = newFile('/test.dart', content: 'var V = 1;');
-    Source source = file.createSource();
-    context.applyChanges(new ChangeSet()..addedSource(source));
-    // Analyze all.
-    _analyzeAll_assertFinished();
-    expect(context.analysisCache.getState(source, RESOLVED_UNIT),
-        CacheState.INVALID);
-    // Update the file and notify the context about the change.
-    modifyFile('/test.dart', 'var V = 2;');
-    context.applyChanges(new ChangeSet()..changedSource(source));
-    // The analysis results are invalidated.
-    // We have seen the new contents, so 'modificationTime' is also updated.
-    expect(context.analysisCache.getState(source, RESOLVED_UNIT),
-        CacheState.INVALID);
-    expect(
-        context.getCacheEntry(source).modificationTime, file.modificationStamp);
-  }
-
-  void test_applyChanges_empty() {
-    context.applyChanges(new ChangeSet());
-    expect(context.performAnalysisTask().changeNotices, isNull);
-  }
-
-  void test_applyChanges_incremental_resetDriver() {
-    // AnalysisContext incremental analysis has been removed
-    if (context != null) return;
-    throw 'is this test used by the new analysis driver?';
-
-//    context.analysisOptions = new AnalysisOptionsImpl()..incremental = true;
-//    Source source = addSource(
-//        "/test.dart",
-//        r'''
-//main() {
-//  print(42);
-//}
-//''');
-//    _performPendingAnalysisTasks();
-//    expect(context.getErrors(source).errors, hasLength(0));
-//    // Update the source to have a parse error.
-//    // This is an incremental change, but we always invalidate DART_ERRORS.
-//    context.setContents(
-//        source,
-//        r'''
-//main() {
-//  print(42)
-//}
-//''');
-//    AnalysisCache cache = context.analysisCache;
-//    expect(cache.getValue(source, PARSE_ERRORS), hasLength(1));
-//    expect(cache.getState(source, DART_ERRORS), CacheState.INVALID);
-//    // Perform enough analysis to prepare inputs (is not actually tested) for
-//    // the DART_ERRORS computing task, but don't compute it yet.
-//    context.performAnalysisTask();
-//    context.performAnalysisTask();
-//    expect(cache.getState(source, DART_ERRORS), CacheState.INVALID);
-//    // Update the source so that PARSE_ERRORS is empty.
-//    context.setContents(
-//        source,
-//        r'''
-//main() {
-//  print(42);
-//}
-//''');
-//    expect(cache.getValue(source, PARSE_ERRORS), hasLength(0));
-//    // After full analysis DART_ERRORS should also be empty.
-//    _performPendingAnalysisTasks();
-//    expect(cache.getValue(source, DART_ERRORS), hasLength(0));
-//    expect(context.getErrors(source).errors, hasLength(0));
-  }
-
-  void test_applyChanges_overriddenSource() {
-    String content = "library test;";
-    Source source = addSource("/test.dart", content);
-    context.setContents(source, content);
-    context.computeErrors(source);
-    while (!context.sourcesNeedingProcessing.isEmpty) {
-      context.performAnalysisTask();
-    }
-    // Adding the source as a changedSource should have no effect since
-    // it is already overridden in the content cache.
-    ChangeSet changeSet = new ChangeSet();
-    changeSet.changedSource(source);
-    context.applyChanges(changeSet);
-    expect(context.sourcesNeedingProcessing, hasLength(0));
-  }
-
-  void test_applyChanges_recompute_exportNamespace() {
-    Source libSource = addSource("/lib.dart", r'''
-class A {}
-''');
-    Source exporterSource = addSource("/exporter.dart", r'''
-export 'lib.dart';
-''');
-    _performPendingAnalysisTasks();
-    // initially: A
-    {
-      LibraryElement libraryElement =
-          context.getResult(exporterSource, LIBRARY_ELEMENT1);
-      expect(libraryElement.exportNamespace.definedNames.keys,
-          unorderedEquals(['A']));
-    }
-    // after update: B
-    context.setContents(libSource, r'''
-class B {}''');
-    _performPendingAnalysisTasks();
-    {
-      LibraryElement libraryElement =
-          context.getResult(exporterSource, LIBRARY_ELEMENT1);
-      expect(libraryElement.exportNamespace.definedNames.keys,
-          unorderedEquals(['B']));
-    }
-  }
-
-  Future test_applyChanges_remove() {
-    SourcesChangedListener listener = new SourcesChangedListener();
-    context.onSourcesChanged.listen(listener.onData);
-    String libAContents = r'''
-library libA;
-import 'libB.dart';''';
-    Source libA = addSource("/libA.dart", libAContents);
-    String libBContents = "library libB;";
-    Source libB = addSource("/libB.dart", libBContents);
-    LibraryElement libAElement = context.computeLibraryElement(libA);
-    expect(libAElement, isNotNull);
-    List<LibraryElement> importedLibraries = libAElement.importedLibraries;
-    expect(importedLibraries, hasLength(2));
-    context.computeErrors(libA);
-    context.computeErrors(libB);
-    context.setContents(libB, null);
-    _removeSource(libB);
-    List<Source> sources = context.sourcesNeedingProcessing;
-    expect(sources, hasLength(1));
-    expect(sources[0], same(libA));
-    libAElement = context.computeLibraryElement(libA);
-    importedLibraries = libAElement.importedLibraries;
-    expect(importedLibraries, hasLength(2));
-    return pumpEventQueue().then((_) {
-      listener.assertEvent(wereSourcesAdded: true);
-      listener.assertEvent(wereSourcesAdded: true);
-      listener.assertEvent(wereSourcesRemovedOrDeleted: true);
-      listener.assertNoMoreEvents();
-    });
-  }
-
-  /**
-   * IDEA uses the following scenario:
-   * 1. Add overlay.
-   * 2. Change overlay.
-   * 3. If the contents of the document buffer is the same as the contents
-   *    of the file, remove overlay.
-   * So, we need to try to use incremental resolution for removing overlays too.
-   */
-  void test_applyChanges_remove_incremental() {
-    // AnalysisContext incremental analysis has been removed
-    if (context != null) return;
-    throw 'is this test used by the new analysis driver?';
-
-//    MemoryResourceProvider resourceProvider = new MemoryResourceProvider();
-//    Source source = resourceProvider
-//        .newFile(
-//            '/test.dart',
-//            r'''
-//main() {
-//  print(1);
-//}
-//''')
-//        .createSource();
-//    context.analysisOptions = new AnalysisOptionsImpl()..incremental = true;
-//    context.applyChanges(new ChangeSet()..addedSource(source));
-//    // remember compilation unit
-//    _analyzeAll_assertFinished();
-//    CompilationUnit unit = context.getResolvedCompilationUnit2(source, source);
-//    // add overlay
-//    context.setContents(
-//        source,
-//        r'''
-//main() {
-//  print(12);
-//}
-//''');
-//    _analyzeAll_assertFinished();
-//    expect(context.getResolvedCompilationUnit2(source, source), unit);
-//    // remove overlay
-//    context.setContents(source, null);
-//    _analyzeAll_assertFinished();
-//    expect(context.getResolvedCompilationUnit2(source, source), unit);
-  }
-
-  Future test_applyChanges_removeContainer() {
-    SourcesChangedListener listener = new SourcesChangedListener();
-    context.onSourcesChanged.listen(listener.onData);
-    String libAContents = r'''
-library libA;
-import 'libB.dart';''';
-    Source libA = addSource("/libA.dart", libAContents);
-    String libBContents = "library libB;";
-    Source libB = addSource("/libB.dart", libBContents);
-    context.computeLibraryElement(libA);
-    context.computeErrors(libA);
-    context.computeErrors(libB);
-    ChangeSet changeSet = new ChangeSet();
-    SourceContainer removedContainer =
-        new _AnalysisContextImplTest_test_applyChanges_removeContainer(libB);
-    changeSet.removedContainer(removedContainer);
-    context.applyChanges(changeSet);
-    List<Source> sources = context.sourcesNeedingProcessing;
-    expect(sources, hasLength(1));
-    expect(sources[0], same(libA));
-    return pumpEventQueue().then((_) {
-      listener.assertEvent(wereSourcesAdded: true);
-      listener.assertEvent(wereSourcesAdded: true);
-      listener.assertEvent(wereSourcesRemovedOrDeleted: true);
-      listener.assertNoMoreEvents();
-    });
-  }
-
-  void test_applyChanges_removeUsedLibrary_addAgain() {
-    String codeA = r'''
-import 'b.dart';
-B b = null;
-''';
-    String codeB = r'''
-class B {}
-''';
-    Source a = addSource('/a.dart', codeA);
-    Source b = addSource('/b.dart', codeB);
-    CacheState getErrorsState(Source source) =>
-        context.analysisCache.getState(source, LIBRARY_ERRORS_READY);
-    _performPendingAnalysisTasks();
-    expect(context.getErrors(a).errors, hasLength(0));
-    // Remove b.dart - errors in a.dart are invalidated and recomputed.
-    // Now a.dart has an error.
-    _removeSource(b);
-    expect(getErrorsState(a), CacheState.INVALID);
-    _performPendingAnalysisTasks();
-    expect(getErrorsState(a), CacheState.VALID);
-    expect(context.getErrors(a).errors, hasLength(isPositive));
-    // Add b.dart - errors in a.dart are invalidated and recomputed.
-    // The reason is that a.dart adds dependencies on (not existing) b.dart
-    // results in cache.
-    // Now a.dart does not have errors.
-    addSource('/b.dart', codeB);
-    expect(getErrorsState(a), CacheState.INVALID);
-    _performPendingAnalysisTasks();
-    expect(getErrorsState(a), CacheState.VALID);
-    expect(context.getErrors(a).errors, hasLength(0));
-  }
-
-  void test_cacheConsistencyValidator_computed_deleted() {
-    CacheConsistencyValidator validator = context.cacheConsistencyValidator;
-    var stat = PerformanceStatistics.cacheConsistencyValidationStatistics;
-    stat.reset();
-    // Add sources.
-    String path1 = '/test1.dart';
-    String path2 = '/test2.dart';
-    Source source1 = newFile(path1, content: '// 1-1').createSource();
-    Source source2 = newFile(path2, content: '// 2-1').createSource();
-    context.applyChanges(
-        new ChangeSet()..addedSource(source1)..addedSource(source2));
-    // Same modification times.
-    expect(
-        validator.sourceModificationTimesComputed([source1, source2],
-            [source1.modificationStamp, source2.modificationStamp]),
-        isFalse);
-    expect(stat.numOfChanged, 0);
-    expect(stat.numOfRemoved, 0);
-    // Add overlay
-    context.setContents(source1, '// 1-2');
-    expect(
-        validator.sourceModificationTimesComputed(
-            [source1, source2], [-1, source2.modificationStamp]),
-        isFalse);
-    context.setContents(source1, null);
-    expect(stat.numOfChanged, 0);
-    expect(stat.numOfRemoved, 0);
-    // Different modification times.
-    expect(
-        validator.sourceModificationTimesComputed(
-            [source1, source2], [-1, source2.modificationStamp]),
-        isTrue);
-    expect(stat.numOfChanged, 0);
-    expect(stat.numOfRemoved, 1);
-  }
-
-  void test_cacheConsistencyValidator_computed_modified() {
-    CacheConsistencyValidator validator = context.cacheConsistencyValidator;
-    var stat = PerformanceStatistics.cacheConsistencyValidationStatistics;
-    stat.reset();
-    // Add sources.
-    String path1 = '/test1.dart';
-    String path2 = '/test2.dart';
-    Source source1 = newFile(path1, content: '// 1-1').createSource();
-    Source source2 = newFile(path2, content: '// 2-1').createSource();
-    context.applyChanges(
-        new ChangeSet()..addedSource(source1)..addedSource(source2));
-    // Same modification times.
-    expect(
-        validator.sourceModificationTimesComputed([source1, source2],
-            [source1.modificationStamp, source2.modificationStamp]),
-        isFalse);
-    expect(stat.numOfChanged, 0);
-    expect(stat.numOfRemoved, 0);
-    // Add overlay
-    context.setContents(source1, '// 1-2');
-    expect(
-        validator.sourceModificationTimesComputed([source1, source2],
-            [source1.modificationStamp + 1, source2.modificationStamp]),
-        isFalse);
-    context.setContents(source1, null);
-    expect(stat.numOfChanged, 0);
-    expect(stat.numOfRemoved, 0);
-    // Different modification times.
-    expect(
-        validator.sourceModificationTimesComputed([source1, source2],
-            [source1.modificationStamp + 1, source2.modificationStamp]),
-        isTrue);
-    expect(stat.numOfChanged, 1);
-    expect(stat.numOfRemoved, 0);
-  }
-
-  void test_cacheConsistencyValidator_getSources() {
-    CacheConsistencyValidator validator = context.cacheConsistencyValidator;
-    // Add sources.
-    String path1 = '/test1.dart';
-    String path2 = '/test2.dart';
-    Source source1 = newFile(path1, content: '// 1-1').createSource();
-    Source source2 = newFile(path2, content: '// 2-1').createSource();
-    context.applyChanges(
-        new ChangeSet()..addedSource(source1)..addedSource(source2));
-    // Verify.
-    expect(validator.getSourcesToComputeModificationTimes(),
-        unorderedEquals([source1, source2]));
-  }
-
-  void test_computeDocumentationComment_class_block() {
-    String comment = "/** Comment */";
-    Source source = addSource("/test.dart", """
-$comment
-class A {}""");
-    LibraryElement libraryElement = context.computeLibraryElement(source);
-    expect(libraryElement, isNotNull);
-    ClassElement classElement = libraryElement.definingCompilationUnit.types[0];
-    expect(libraryElement, isNotNull);
-    expect(context.computeDocumentationComment(classElement), comment);
-  }
-
-  void test_computeDocumentationComment_class_none() {
-    Source source = addSource("/test.dart", "class A {}");
-    LibraryElement libraryElement = context.computeLibraryElement(source);
-    expect(libraryElement, isNotNull);
-    ClassElement classElement = libraryElement.definingCompilationUnit.types[0];
-    expect(libraryElement, isNotNull);
-    expect(context.computeDocumentationComment(classElement), isNull);
-  }
-
-  void test_computeDocumentationComment_class_singleLine_multiple_EOL_n() {
-    String comment = "/// line 1\n/// line 2\n/// line 3\n";
-    Source source = addSource("/test.dart", "${comment}class A {}");
-    LibraryElement libraryElement = context.computeLibraryElement(source);
-    expect(libraryElement, isNotNull);
-    ClassElement classElement = libraryElement.definingCompilationUnit.types[0];
-    expect(libraryElement, isNotNull);
-    String actual = context.computeDocumentationComment(classElement);
-    expect(actual, "/// line 1\n/// line 2\n/// line 3");
-  }
-
-  void test_computeDocumentationComment_class_singleLine_multiple_EOL_rn() {
-    String comment = "/// line 1\r\n/// line 2\r\n/// line 3\r\n";
-    Source source = addSource("/test.dart", "${comment}class A {}");
-    LibraryElement libraryElement = context.computeLibraryElement(source);
-    expect(libraryElement, isNotNull);
-    ClassElement classElement = libraryElement.definingCompilationUnit.types[0];
-    expect(libraryElement, isNotNull);
-    String actual = context.computeDocumentationComment(classElement);
-    expect(actual, "/// line 1\n/// line 2\n/// line 3");
-  }
-
-  void test_computeDocumentationComment_exportDirective_block() {
-    String comment = '/** Comment */';
-    Source source = addSource("/test.dart", '''
-$comment
-export 'dart:async';
-''');
-    LibraryElement libraryElement = context.computeLibraryElement(source);
-    expect(libraryElement, isNotNull);
-    ExportElement exportElement = libraryElement.exports[0];
-    expect(context.computeDocumentationComment(exportElement), comment);
-  }
-
-  void test_computeDocumentationComment_importDirective_block() {
-    String comment = '/** Comment */';
-    Source source = addSource("/test.dart", '''
-$comment
-import 'dart:async';
-''');
-    LibraryElement libraryElement = context.computeLibraryElement(source);
-    expect(libraryElement, isNotNull);
-    ImportElement importElement = libraryElement.imports[0];
-    expect(context.computeDocumentationComment(importElement), comment);
-  }
-
-  void test_computeDocumentationComment_libraryDirective_block() {
-    String comment = '/** Comment */';
-    Source source = addSource("/test.dart", '''
-$comment
-library lib;
-''');
-    LibraryElement libraryElement = context.computeLibraryElement(source);
-    expect(libraryElement, isNotNull);
-    expect(context.computeDocumentationComment(libraryElement), comment);
-  }
-
-  void test_computeDocumentationComment_null() {
-    expect(context.computeDocumentationComment(null), isNull);
-  }
-
-  void test_computeErrors_dart_malformedCode() {
-    Source source = addSource("/lib.dart", "final int , = 42;");
-    List<AnalysisError> errors = context.computeErrors(source);
-    expect(errors, isNotNull);
-    expect(errors.length > 0, isTrue);
-  }
-
-  void test_computeErrors_dart_none() {
-    Source source = addSource("/lib.dart", "library lib;");
-    List<AnalysisError> errors = context.computeErrors(source);
-    expect(errors, hasLength(0));
-  }
-
-  @failingTest
-  void test_computeErrors_dart_part() {
-    Source librarySource =
-        addSource("/lib.dart", "library lib; part 'part.dart';");
-    Source partSource = addSource("/part.dart", "part of 'lib';");
-    context.parseCompilationUnit(librarySource);
-    List<AnalysisError> errors = context.computeErrors(partSource);
-    expect(errors, isNotNull);
-    // TODO(28522)
-    fail("Should report that 'lib' isn't the correct URI.");
-  }
-
-  void test_computeErrors_dart_some() {
-    Source source = addSource("/lib.dart", "library 'lib';");
-    List<AnalysisError> errors = context.computeErrors(source);
-    expect(errors, isNotNull);
-    expect(errors.length > 0, isTrue);
-  }
-
-  void test_computeErrors_html_none() {
-    Source source = addSource("/test.html", "<!DOCTYPE html><html></html>");
-    List<AnalysisError> errors = context.computeErrors(source);
-    expect(errors, hasLength(0));
-  }
-
-  void test_computeExportedLibraries_none() {
-    Source source = addSource("/test.dart", "library test;");
-    expect(context.computeExportedLibraries(source), hasLength(0));
-  }
-
-  void test_computeExportedLibraries_some() {
-    //    addSource("/lib1.dart", "library lib1;");
-    //    addSource("/lib2.dart", "library lib2;");
-    Source source = addSource(
-        "/test.dart", "library test; export 'lib1.dart'; export 'lib2.dart';");
-    expect(context.computeExportedLibraries(source), hasLength(2));
-  }
-
-  void test_computeImportedLibraries_none() {
-    Source source = addSource("/test.dart", "library test;");
-    expect(context.computeImportedLibraries(source), hasLength(0));
-  }
-
-  void test_computeImportedLibraries_some() {
-    Source source = addSource(
-        "/test.dart", "library test; import 'lib1.dart'; import 'lib2.dart';");
-    expect(context.computeImportedLibraries(source), hasLength(2));
-  }
-
-  void test_computeKindOf_html() {
-    Source source = addSource("/test.html", "");
-    expect(context.computeKindOf(source), same(SourceKind.HTML));
-  }
-
-  void test_computeKindOf_library() {
-    Source source = addSource("/test.dart", "library lib;");
-    expect(context.computeKindOf(source), same(SourceKind.LIBRARY));
-  }
-
-  void test_computeKindOf_libraryAndPart() {
-    Source source = addSource("/test.dart", "library lib; part of lib;");
-    expect(context.computeKindOf(source), same(SourceKind.LIBRARY));
-  }
-
-  void test_computeKindOf_part() {
-    Source source = addSource("/test.dart", "part of lib;");
-    expect(context.computeKindOf(source), same(SourceKind.PART));
-  }
-
-  void test_computeLibraryElement() {
-    Source source = addSource("/test.dart", "library lib;");
-    LibraryElement element = context.computeLibraryElement(source);
-    expect(element, isNotNull);
-  }
-
-  void test_computeLibraryElement_unresolvedUris() {
-    Source source = addSource("/lib.dart", r'''
-import 'package:foo/bar.dart';
-export 'package:foo/baz.dart';
-''');
-    var libraryElement = context.computeLibraryElement(source);
-    expect(libraryElement.imports, hasLength(2));
-    expect(libraryElement.exports, hasLength(1));
-    expect(libraryElement.imports[0].uri, 'package:foo/bar.dart');
-    expect(libraryElement.imports[0].importedLibrary, isNull);
-    expect(libraryElement.exports[0].uri, 'package:foo/baz.dart');
-    expect(libraryElement.exports[0].exportedLibrary, isNull);
-  }
-
-  void test_computeLineInfo_dart() {
-    Source source = addSource("/test.dart", r'''
-library lib;
-
-main() {}''');
-    LineInfo info = context.computeLineInfo(source);
-    expect(info, isNotNull);
-  }
-
-  void test_computeLineInfo_html() {
-    Source source = addSource("/test.html", r'''
-<html>
-  <body>
-    <h1>A</h1>
-  </body>
-</html>''');
-    LineInfo info = context.computeLineInfo(source);
-    expect(info, isNotNull);
-  }
-
-  Future test_computeResolvedCompilationUnitAsync() {
-    Source source = addSource("/lib.dart", "library lib;");
-    // Complete all pending analysis tasks and flush the AST so that it won't
-    // be available immediately.
-    _performPendingAnalysisTasks();
-    _flushAst(source);
-    bool completed = false;
-    context
-        .computeResolvedCompilationUnitAsync(source, source)
-        .then((CompilationUnit unit) {
-      expect(unit, isNotNull);
-      completed = true;
-    });
-    return pumpEventQueue()
-        .then((_) {
-          expect(completed, isFalse);
-          _performPendingAnalysisTasks();
-        })
-        .then((_) => pumpEventQueue())
-        .then((_) {
-          expect(completed, isTrue);
-        });
-  }
-
-  Future test_computeResolvedCompilationUnitAsync_afterDispose() {
-    Source source = addSource("/lib.dart", "library lib;");
-    // Complete all pending analysis tasks and flush the AST so that it won't
-    // be available immediately.
-    _performPendingAnalysisTasks();
-    _flushAst(source);
-    // Dispose of the context.
-    context.dispose();
-    // Any attempt to start an asynchronous computation should return a future
-    // which completes with error.
-    CancelableFuture<CompilationUnit> future =
-        context.computeResolvedCompilationUnitAsync(source, source);
-    bool completed = false;
-    future.then((CompilationUnit unit) {
-      fail('Future should have completed with error');
-    }, onError: (error) {
-      expect(error, new TypeMatcher<AnalysisNotScheduledError>());
-      completed = true;
-    });
-    return pumpEventQueue().then((_) {
-      expect(completed, isTrue);
-    });
-  }
-
-  Future test_computeResolvedCompilationUnitAsync_cancel() {
-    Source source = addSource("/lib.dart", "library lib;");
-    // Complete all pending analysis tasks and flush the AST so that it won't
-    // be available immediately.
-    _performPendingAnalysisTasks();
-    _flushAst(source);
-    CancelableFuture<CompilationUnit> future =
-        context.computeResolvedCompilationUnitAsync(source, source);
-    bool completed = false;
-    future.then((CompilationUnit unit) {
-      fail('Future should have been canceled');
-    }, onError: (error) {
-      expect(error, new TypeMatcher<FutureCanceledError>());
-      completed = true;
-    });
-    expect(completed, isFalse);
-    expect(context.pendingFutureSources_forTesting, isNotEmpty);
-    future.cancel();
-    expect(context.pendingFutureSources_forTesting, isEmpty);
-    return pumpEventQueue().then((_) {
-      expect(completed, isTrue);
-      expect(context.pendingFutureSources_forTesting, isEmpty);
-    });
-  }
-
-  Future test_computeResolvedCompilationUnitAsync_dispose() {
-    Source source = addSource("/lib.dart", "library lib;");
-    // Complete all pending analysis tasks and flush the AST so that it won't
-    // be available immediately.
-    _performPendingAnalysisTasks();
-    _flushAst(source);
-    bool completed = false;
-    CancelableFuture<CompilationUnit> future =
-        context.computeResolvedCompilationUnitAsync(source, source);
-    future.then((CompilationUnit unit) {
-      fail('Future should have completed with error');
-    }, onError: (error) {
-      expect(error, new TypeMatcher<AnalysisNotScheduledError>());
-      completed = true;
-    });
-    expect(completed, isFalse);
-    expect(context.pendingFutureSources_forTesting, isNotEmpty);
-    // Disposing of the context should cause all pending futures to complete
-    // with AnalysisNotScheduled, so that no clients are left hanging.
-    context.dispose();
-    expect(context.pendingFutureSources_forTesting, isEmpty);
-    return pumpEventQueue().then((_) {
-      expect(completed, isTrue);
-      expect(context.pendingFutureSources_forTesting, isEmpty);
-    });
-  }
-
-  Future test_computeResolvedCompilationUnitAsync_noCacheEntry() {
-    Source librarySource = addSource("/lib.dart", "library lib;");
-    Source partSource = addSource("/part.dart", "part of foo;");
-    bool completed = false;
-    context
-        .computeResolvedCompilationUnitAsync(partSource, librarySource)
-        .then((CompilationUnit unit) {
-      expect(unit, isNotNull);
-      completed = true;
-    });
-    return pumpEventQueue()
-        .then((_) {
-          expect(completed, isFalse);
-          _performPendingAnalysisTasks();
-        })
-        .then((_) => pumpEventQueue())
-        .then((_) {
-          expect(completed, isTrue);
-        });
-  }
-
-  void test_dispose() {
-    expect(context.isDisposed, isFalse);
-    context.dispose();
-    expect(context.isDisposed, isTrue);
-  }
-
-  void test_ensureResolvedDartUnits_definingUnit_hasResolved() {
-    Source source = addSource('/test.dart', '');
-    LibrarySpecificUnit libTarget = new LibrarySpecificUnit(source, source);
-    analysisDriver.computeResult(libTarget, RESOLVED_UNIT);
-    CompilationUnit unit =
-        context.getCacheEntry(libTarget).getValue(RESOLVED_UNIT);
-    List<CompilationUnit> units = context.ensureResolvedDartUnits(source);
-    expect(units, unorderedEquals([unit]));
-  }
-
-  void test_ensureResolvedDartUnits_definingUnit_notResolved() {
-    Source source = addSource('/test.dart', '');
-    LibrarySpecificUnit libTarget = new LibrarySpecificUnit(source, source);
-    analysisDriver.computeResult(libTarget, RESOLVED_UNIT);
-    // flush
-    context
-        .getCacheEntry(libTarget)
-        .setState(RESOLVED_UNIT, CacheState.FLUSHED);
-    // schedule recomputing
-    List<CompilationUnit> units = context.ensureResolvedDartUnits(source);
-    expect(units, isNull);
-    // should be the next result to compute
-    TargetedResult nextResult = context.dartWorkManager.getNextResult();
-    expect(nextResult.target, libTarget);
-    expect(nextResult.result, RESOLVED_UNIT);
-  }
-
-  void test_ensureResolvedDartUnits_partUnit_hasResolved() {
-    Source libSource1 = addSource('/lib1.dart', r'''
-library lib;
-part 'part.dart';
-''');
-    Source libSource2 = addSource('/lib2.dart', r'''
-library lib;
-part 'part.dart';
-''');
-    Source partSource = addSource('/part.dart', r'''
-part of lib;
-''');
-    LibrarySpecificUnit partTarget1 =
-        new LibrarySpecificUnit(libSource1, partSource);
-    LibrarySpecificUnit partTarget2 =
-        new LibrarySpecificUnit(libSource2, partSource);
-    analysisDriver.computeResult(partTarget1, RESOLVED_UNIT);
-    analysisDriver.computeResult(partTarget2, RESOLVED_UNIT);
-    CompilationUnit unit1 =
-        context.getCacheEntry(partTarget1).getValue(RESOLVED_UNIT);
-    CompilationUnit unit2 =
-        context.getCacheEntry(partTarget2).getValue(RESOLVED_UNIT);
-    List<CompilationUnit> units = context.ensureResolvedDartUnits(partSource);
-    expect(units, unorderedEquals([unit1, unit2]));
-  }
-
-  void test_ensureResolvedDartUnits_partUnit_notResolved() {
-    Source libSource1 = addSource('/lib1.dart', r'''
-library lib;
-part 'part.dart';
-''');
-    Source libSource2 = addSource('/lib2.dart', r'''
-library lib;
-part 'part.dart';
-''');
-    Source partSource = addSource('/part.dart', r'''
-part of lib;
-''');
-    LibrarySpecificUnit partTarget1 =
-        new LibrarySpecificUnit(libSource1, partSource);
-    LibrarySpecificUnit partTarget2 =
-        new LibrarySpecificUnit(libSource2, partSource);
-    analysisDriver.computeResult(partTarget1, RESOLVED_UNIT);
-    analysisDriver.computeResult(partTarget2, RESOLVED_UNIT);
-    // flush
-    context
-        .getCacheEntry(partTarget1)
-        .setState(RESOLVED_UNIT, CacheState.FLUSHED);
-    context
-        .getCacheEntry(partTarget2)
-        .setState(RESOLVED_UNIT, CacheState.FLUSHED);
-    // schedule recomputing
-    List<CompilationUnit> units = context.ensureResolvedDartUnits(partSource);
-    expect(units, isNull);
-    // should be the next result to compute
-    TargetedResult nextResult = context.dartWorkManager.getNextResult();
-    expect(nextResult.target, anyOf(partTarget1, partTarget2));
-    expect(nextResult.result, RESOLVED_UNIT);
-  }
-
-  void test_exists_false() {
-    TestSource source = new TestSource();
-    source.exists2 = false;
-    expect(context.exists(source), isFalse);
-  }
-
-  void test_exists_null() {
-    expect(context.exists(null), isFalse);
-  }
-
-  void test_exists_overridden() {
-    Source source = new TestSource();
-    context.setContents(source, "");
-    expect(context.exists(source), isTrue);
-  }
-
-  void test_exists_true() {
-    expect(context.exists(new _AnalysisContextImplTest_Source_exists_true()),
-        isTrue);
-  }
-
-  void test_flushResolvedUnit_updateFile_dontNotify() {
-    String oldCode = '';
-    String newCode = r'''
-import 'dart:async';
-''';
-    Source source = newFile('/test.dart', content: oldCode).createSource();
-    context.applyChanges(new ChangeSet()..addedSource(source));
-    context.resolveCompilationUnit2(source, source);
-    // Flush all results units.
-    context.analysisCache.flush((target, result) {
-      if (target.source == source) {
-        return RESOLVED_UNIT_RESULTS.contains(result);
-      }
-      return false;
-    });
-    // Update the file, but don't notify the context.
-    modifyFile('/test.dart', newCode);
-    // Driver must detect that the file was changed and recover.
-    CompilationUnit unit = context.resolveCompilationUnit2(source, source);
-    expect(unit, isNotNull);
-  }
-
-  void test_flushResolvedUnit_updateFile_dontNotify2() {
-    String oldCode = r'''
-main() {}
-''';
-    String newCode = r'''
-import 'dart:async';
-main() {}
-''';
-    Source source = newFile('/test.dart', content: oldCode).createSource();
-    context.applyChanges(new ChangeSet()..addedSource(source));
-    context.resolveCompilationUnit2(source, source);
-    // Flush all results units.
-    context.analysisCache.flush((target, result) {
-      if (target.source == source) {
-        if (target.source == source) {
-          return RESOLVED_UNIT_RESULTS.contains(result);
-        }
-      }
-      return false;
-    });
-    // Update the file, but don't notify the context.
-    modifyFile('/test.dart', newCode);
-    // Driver must detect that the file was changed and recover.
-    CompilationUnit unit = context.resolveCompilationUnit2(source, source);
-    expect(unit, isNotNull);
-  }
-
-  void test_flushSingleResolvedUnit_instanceField() {
-    _checkFlushSingleResolvedUnit('class C { var x = 0; }',
-        (CompilationUnitElement unitElement, String reason) {
-      expect(unitElement.types, hasLength(1), reason: reason);
-      ClassElement cls = unitElement.types[0];
-      expect(cls.fields, hasLength(1), reason: reason);
-      expect(cls.fields[0].type.toString(), 'int', reason: reason);
-      expect(cls.accessors, hasLength(2), reason: reason);
-      expect(cls.accessors[0].isGetter, isTrue, reason: reason);
-      expect(cls.accessors[0].returnType.toString(), 'int', reason: reason);
-      expect(cls.accessors[1].isSetter, isTrue, reason: reason);
-      expect(cls.accessors[1].returnType.toString(), 'void', reason: reason);
-      expect(cls.accessors[1].parameters, hasLength(1), reason: reason);
-      expect(cls.accessors[1].parameters[0].type.toString(), 'int',
-          reason: reason);
-    });
-  }
-
-  void test_flushSingleResolvedUnit_instanceGetter() {
-    _checkFlushSingleResolvedUnit('''
-abstract class B {
-  int get x;
-}
-class C extends B {
-  get x => null;
-}
-''', (CompilationUnitElement unitElement, String reason) {
-      expect(unitElement.types, hasLength(2), reason: reason);
-      ClassElement cls = unitElement.types[1];
-      expect(cls.name, 'C', reason: reason);
-      expect(cls.accessors, hasLength(1), reason: reason);
-      expect(cls.accessors[0].returnType.toString(), 'int', reason: reason);
-      expect(cls.fields, hasLength(1), reason: reason);
-      expect(cls.fields[0].type.toString(), 'int', reason: reason);
-    });
-  }
-
-  void test_flushSingleResolvedUnit_instanceMethod() {
-    _checkFlushSingleResolvedUnit('''
-abstract class B {
-  int f(String s);
-}
-class C extends B {
-  f(s) => null;
-}
-''', (CompilationUnitElement unitElement, String reason) {
-      expect(unitElement.types, hasLength(2), reason: reason);
-      ClassElement cls = unitElement.types[1];
-      expect(cls.name, 'C', reason: reason);
-      expect(cls.methods, hasLength(1), reason: reason);
-      expect(cls.methods[0].returnType.toString(), 'int', reason: reason);
-      expect(cls.methods[0].parameters, hasLength(1), reason: reason);
-      expect(cls.methods[0].parameters[0].type.toString(), 'String',
-          reason: reason);
-    });
-  }
-
-  void test_flushSingleResolvedUnit_instanceSetter() {
-    _checkFlushSingleResolvedUnit('''
-abstract class B {
-  set x(int value);
-}
-class C extends B {
-  set x(value) {}
-}
-''', (CompilationUnitElement unitElement, String reason) {
-      expect(unitElement.types, hasLength(2), reason: reason);
-      ClassElement cls = unitElement.types[1];
-      expect(cls.name, 'C', reason: reason);
-      expect(cls.accessors, hasLength(1), reason: reason);
-      expect(cls.accessors[0].returnType.toString(), 'void', reason: reason);
-      expect(cls.accessors[0].parameters, hasLength(1), reason: reason);
-      expect(cls.accessors[0].parameters[0].type.toString(), 'int',
-          reason: reason);
-      expect(cls.fields, hasLength(1), reason: reason);
-      expect(cls.fields[0].type.toString(), 'int', reason: reason);
-    });
-  }
-
-  void test_flushSingleResolvedUnit_staticField() {
-    _checkFlushSingleResolvedUnit('class C { static var x = 0; }',
-        (CompilationUnitElement unitElement, String reason) {
-      expect(unitElement.types, hasLength(1), reason: reason);
-      ClassElement cls = unitElement.types[0];
-      expect(cls.fields, hasLength(1), reason: reason);
-      expect(cls.fields[0].type.toString(), 'int', reason: reason);
-      expect(cls.accessors, hasLength(2), reason: reason);
-      expect(cls.accessors[0].isGetter, isTrue, reason: reason);
-      expect(cls.accessors[0].returnType.toString(), 'int', reason: reason);
-      expect(cls.accessors[1].isSetter, isTrue, reason: reason);
-      expect(cls.accessors[1].returnType.toString(), 'void', reason: reason);
-      expect(cls.accessors[1].parameters, hasLength(1), reason: reason);
-      expect(cls.accessors[1].parameters[0].type.toString(), 'int',
-          reason: reason);
-    });
-  }
-
-  void test_flushSingleResolvedUnit_topLevelVariable() {
-    _checkFlushSingleResolvedUnit('var x = 0;',
-        (CompilationUnitElement unitElement, String reason) {
-      expect(unitElement.topLevelVariables, hasLength(1), reason: reason);
-      expect(unitElement.topLevelVariables[0].type.toString(), 'int',
-          reason: reason);
-      expect(unitElement.accessors, hasLength(2), reason: reason);
-      expect(unitElement.accessors[0].isGetter, isTrue, reason: reason);
-      expect(unitElement.accessors[0].returnType.toString(), 'int',
-          reason: reason);
-      expect(unitElement.accessors[1].isSetter, isTrue, reason: reason);
-      expect(unitElement.accessors[1].returnType.toString(), 'void',
-          reason: reason);
-      expect(unitElement.accessors[1].parameters, hasLength(1), reason: reason);
-      expect(unitElement.accessors[1].parameters[0].type.toString(), 'int',
-          reason: reason);
-    });
-  }
-
-  void test_getAnalysisOptions() {
-    expect(context.analysisOptions, isNotNull);
-  }
-
-  void test_getContents_fromSource() {
-    String content = "library lib;";
-    TimestampedData<String> contents =
-        context.getContents(new TestSource('/test.dart', content));
-    expect(contents.data.toString(), content);
-  }
-
-  void test_getContents_notOverridden() {
-    String content = "library lib;";
-    Source source = new TestSource('/test.dart', content);
-    context.setContents(source, "part of lib;");
-    context.setContents(source, null);
-    TimestampedData<String> contents = context.getContents(source);
-    expect(contents.data.toString(), content);
-  }
-
-  void test_getContents_overridden() {
-    String content = "library lib;";
-    Source source = new TestSource();
-    context.setContents(source, content);
-    TimestampedData<String> contents = context.getContents(source);
-    expect(contents.data.toString(), content);
-  }
-
-  void test_getDeclaredVariables() {
-    expect(context.declaredVariables, isNotNull);
-  }
-
-  void test_getElement() {
-    LibraryElement core =
-        context.computeLibraryElement(sourceFactory.forUri("dart:core"));
-    expect(core, isNotNull);
-    ClassElement classObject =
-        _findClass(core.definingCompilationUnit, "Object");
-    expect(classObject, isNotNull);
-    ElementLocation location = classObject.location;
-    Element element = context.getElement(location);
-    expect(element, same(classObject));
-  }
-
-  void test_getElement_constructor_named() {
-    Source source = addSource("/lib.dart", r'''
-class A {
-  A.named() {}
-}''');
-    _analyzeAll_assertFinished();
-    LibraryElement library = context.computeLibraryElement(source);
-    ClassElement classA = _findClass(library.definingCompilationUnit, "A");
-    ConstructorElement constructor = classA.constructors[0];
-    ElementLocation location = constructor.location;
-    Element element = context.getElement(location);
-    expect(element, same(constructor));
-  }
-
-  void test_getElement_constructor_unnamed() {
-    Source source = addSource("/lib.dart", r'''
-class A {
-  A() {}
-}''');
-    _analyzeAll_assertFinished();
-    LibraryElement library = context.computeLibraryElement(source);
-    ClassElement classA = _findClass(library.definingCompilationUnit, "A");
-    ConstructorElement constructor = classA.constructors[0];
-    ElementLocation location = constructor.location;
-    Element element = context.getElement(location);
-    expect(element, same(constructor));
-  }
-
-  void test_getElement_enum() {
-    Source source = addSource('/test.dart', 'enum MyEnum {A, B, C}');
-    _analyzeAll_assertFinished();
-    LibraryElement library = context.computeLibraryElement(source);
-    ClassElement myEnum = library.definingCompilationUnit.getEnum('MyEnum');
-    ElementLocation location = myEnum.location;
-    Element element = context.getElement(location);
-    expect(element, same(myEnum));
-  }
-
-  void test_getErrors_dart_none() {
-    Source source = addSource("/lib.dart", "library lib;");
-    var errorInfo = context.getErrors(source);
-    expect(errorInfo, isNotNull);
-    List<AnalysisError> errors = errorInfo.errors;
-    expect(errors, hasLength(0));
-    context.computeErrors(source);
-    errors = errorInfo.errors;
-    expect(errors, hasLength(0));
-  }
-
-  void test_getErrors_dart_some() {
-    Source source = addSource("/lib.dart", "library 'lib';");
-    var errorInfo = context.getErrors(source);
-    expect(errorInfo, isNotNull);
-    List<AnalysisError> errors = errorInfo.errors;
-    expect(errors, hasLength(0));
-    errors = context.computeErrors(source);
-    expect(errors, hasLength(1));
-  }
-
-  void test_getErrors_html_none() {
-    Source source = addSource("/test.html", "<html></html>");
-    AnalysisErrorInfo errorInfo = context.getErrors(source);
-    expect(errorInfo, isNotNull);
-    List<AnalysisError> errors = errorInfo.errors;
-    expect(errors, hasLength(0));
-    context.computeErrors(source);
-    errors = errorInfo.errors;
-    expect(errors, hasLength(0));
-  }
-
-  void test_getHtmlFilesReferencing_html() {
-    Source htmlSource = addSource("/test.html", r'''
-<html><head>
-<script type='application/dart' src='test.dart'/>
-<script type='application/dart' src='test.js'/>
-</head></html>''');
-    Source librarySource = addSource("/test.dart", "library lib;");
-    Source secondHtmlSource = addSource("/test.html", "<html></html>");
-    context.computeLibraryElement(librarySource);
-    List<Source> result = context.getHtmlFilesReferencing(secondHtmlSource);
-    expect(result, hasLength(0));
-    context.parseHtmlDocument(htmlSource);
-    result = context.getHtmlFilesReferencing(secondHtmlSource);
-    expect(result, hasLength(0));
-  }
-
-  void test_getHtmlFilesReferencing_library() {
-    Source htmlSource = addSource("/test.html", r'''
-<!DOCTYPE html>
-<html><head>
-<script type='application/dart' src='test.dart'/>
-<script type='application/dart' src='test.js'/>
-</head></html>''');
-    Source librarySource = addSource("/test.dart", "library lib;");
-    context.computeLibraryElement(librarySource);
-    List<Source> result = context.getHtmlFilesReferencing(librarySource);
-    expect(result, hasLength(0));
-    // Indirectly force the data to be computed.
-    context.computeErrors(htmlSource);
-    result = context.getHtmlFilesReferencing(librarySource);
-    expect(result, hasLength(1));
-    expect(result[0], htmlSource);
-  }
-
-  void test_getHtmlFilesReferencing_part() {
-    Source htmlSource = addSource("/test.html", r'''
-<!DOCTYPE html>
-<html><head>
-<script type='application/dart' src='test.dart'/>
-<script type='application/dart' src='test.js'/>
-</head></html>''');
-    Source librarySource =
-        addSource("/test.dart", "library lib; part 'part.dart';");
-    Source partSource = addSource("/part.dart", "part of lib;");
-    context.computeLibraryElement(librarySource);
-    List<Source> result = context.getHtmlFilesReferencing(partSource);
-    expect(result, hasLength(0));
-    // Indirectly force the data to be computed.
-    context.computeErrors(htmlSource);
-    result = context.getHtmlFilesReferencing(partSource);
-    expect(result, hasLength(1));
-    expect(result[0], htmlSource);
-  }
-
-  void test_getHtmlSources() {
-    List<Source> sources = context.htmlSources;
-    expect(sources, hasLength(0));
-    Source source = addSource("/test.html", "");
-    sources = context.htmlSources;
-    expect(sources, hasLength(1));
-    expect(sources[0], source);
-  }
-
-  void test_getKindOf_html() {
-    Source source = addSource("/test.html", "");
-    expect(context.getKindOf(source), same(SourceKind.HTML));
-  }
-
-  void test_getKindOf_library() {
-    Source source = addSource("/test.dart", "library lib;");
-    expect(context.getKindOf(source), same(SourceKind.UNKNOWN));
-    context.computeKindOf(source);
-    expect(context.getKindOf(source), same(SourceKind.LIBRARY));
-  }
-
-  void test_getKindOf_part() {
-    Source source = addSource("/test.dart", "part of lib;");
-    expect(context.getKindOf(source), same(SourceKind.UNKNOWN));
-    context.computeKindOf(source);
-    expect(context.getKindOf(source), same(SourceKind.PART));
-  }
-
-  void test_getKindOf_unknown() {
-    Source source = addSource("/test.css", "");
-    expect(context.getKindOf(source), same(SourceKind.UNKNOWN));
-  }
-
-  void test_getLaunchableClientLibrarySources_doesNotImportHtml() {
-    Source source = addSource("/test.dart", r'''
-main() {}''');
-    context.computeLibraryElement(source);
-    List<Source> sources = context.launchableClientLibrarySources;
-    expect(sources, isEmpty);
-  }
-
-  void test_getLaunchableClientLibrarySources_importsHtml_explicitly() {
-    List<Source> sources = context.launchableClientLibrarySources;
-    expect(sources, isEmpty);
-    Source source = addSource("/test.dart", r'''
-import 'dart:html';
-main() {}''');
-    context.computeLibraryElement(source);
-    sources = context.launchableClientLibrarySources;
-    expect(sources, unorderedEquals([source]));
-  }
-
-  void test_getLaunchableClientLibrarySources_importsHtml_implicitly() {
-    List<Source> sources = context.launchableClientLibrarySources;
-    expect(sources, isEmpty);
-    addSource('/a.dart', r'''
-import 'dart:html';
-''');
-    Source source = addSource("/test.dart", r'''
-import 'a.dart';
-main() {}''');
-    _analyzeAll_assertFinished();
-    sources = context.launchableClientLibrarySources;
-    expect(sources, unorderedEquals([source]));
-  }
-
-  void test_getLaunchableClientLibrarySources_importsHtml_implicitly2() {
-    List<Source> sources = context.launchableClientLibrarySources;
-    expect(sources, isEmpty);
-    addSource('/a.dart', r'''
-export 'dart:html';
-''');
-    Source source = addSource("/test.dart", r'''
-import 'a.dart';
-main() {}''');
-    _analyzeAll_assertFinished();
-    sources = context.launchableClientLibrarySources;
-    expect(sources, unorderedEquals([source]));
-  }
-
-  void test_getLaunchableServerLibrarySources() {
-    expect(context.launchableServerLibrarySources, isEmpty);
-    Source source = addSource("/test.dart", "main() {}");
-    context.computeLibraryElement(source);
-    expect(context.launchableServerLibrarySources, unorderedEquals([source]));
-  }
-
-  void test_getLaunchableServerLibrarySources_importsHtml_explicitly() {
-    Source source = addSource("/test.dart", r'''
-import 'dart:html';
-main() {}
-''');
-    context.computeLibraryElement(source);
-    expect(context.launchableServerLibrarySources, isEmpty);
-  }
-
-  void test_getLaunchableServerLibrarySources_importsHtml_implicitly() {
-    addSource("/imports_html.dart", r'''
-import 'dart:html';
-''');
-    addSource("/test.dart", r'''
-import 'imports_html.dart';
-main() {}''');
-    _analyzeAll_assertFinished();
-    expect(context.launchableServerLibrarySources, isEmpty);
-  }
-
-  void test_getLaunchableServerLibrarySources_noMain() {
-    Source source = addSource("/test.dart", '');
-    context.computeLibraryElement(source);
-    expect(context.launchableServerLibrarySources, isEmpty);
-  }
-
-  void test_getLibrariesContaining() {
-    Source librarySource = addSource("/lib.dart", r'''
-library lib;
-part 'part.dart';''');
-    Source partSource = addSource("/part.dart", "part of lib;");
-    context.computeLibraryElement(librarySource);
-    List<Source> result = context.getLibrariesContaining(librarySource);
-    expect(result, hasLength(1));
-    expect(result[0], librarySource);
-    result = context.getLibrariesContaining(partSource);
-    expect(result, hasLength(1));
-    expect(result[0], librarySource);
-  }
-
-  void test_getLibrariesDependingOn() {
-    Source libASource = addSource("/libA.dart", "library libA;");
-    addSource("/libB.dart", "library libB;");
-    Source lib1Source = addSource("/lib1.dart", r'''
-library lib1;
-import 'libA.dart';
-export 'libB.dart';''');
-    Source lib2Source = addSource("/lib2.dart", r'''
-library lib2;
-import 'libB.dart';
-export 'libA.dart';''');
-    context.computeLibraryElement(lib1Source);
-    context.computeLibraryElement(lib2Source);
-    List<Source> result = context.getLibrariesDependingOn(libASource);
-    expect(result, unorderedEquals([lib1Source, lib2Source]));
-  }
-
-  void test_getLibrariesReferencedFromHtml() {
-    Source htmlSource = addSource("/test.html", r'''
-<!DOCTYPE html>
-<html><head>
-<script type='application/dart' src='test.dart'/>
-<script type='application/dart' src='test.js'/>
-</head></html>''');
-    Source librarySource = addSource("/test.dart", "library lib;");
-    context.computeLibraryElement(librarySource);
-    // Indirectly force the data to be computed.
-    context.computeErrors(htmlSource);
-    List<Source> result = context.getLibrariesReferencedFromHtml(htmlSource);
-    expect(result, hasLength(1));
-    expect(result[0], librarySource);
-  }
-
-  void test_getLibrariesReferencedFromHtml_none() {
-    Source htmlSource = addSource("/test.html", r'''
-<html><head>
-<script type='application/dart' src='test.js'/>
-</head></html>''');
-    addSource("/test.dart", "library lib;");
-    context.parseHtmlDocument(htmlSource);
-    List<Source> result = context.getLibrariesReferencedFromHtml(htmlSource);
-    expect(result, hasLength(0));
-  }
-
-  void test_getLibraryElement() {
-    Source source = addSource("/test.dart", "library lib;");
-    LibraryElement element = context.getLibraryElement(source);
-    expect(element, isNull);
-    context.computeLibraryElement(source);
-    element = context.getLibraryElement(source);
-    expect(element, isNotNull);
-  }
-
-  void test_getLibrarySources() {
-    List<Source> sources = context.librarySources;
-    int originalLength = sources.length;
-    Source source = addSource("/test.dart", "library lib;");
-    context.computeKindOf(source);
-    sources = context.librarySources;
-    expect(sources, hasLength(originalLength + 1));
-    for (Source returnedSource in sources) {
-      if (returnedSource == source) {
-        return;
-      }
-    }
-    fail("The added source was not in the list of library sources");
-  }
-
-  void test_getLibrarySources_inSDK() {
-    Source source = addSource('/test.dart', r'''
-import 'dart:async';
-Stream S = null;
-''');
-    LibraryElement testLibrary = context.computeLibraryElement(source);
-    // prepare "Stream" ClassElement
-    ClassElement streamElement;
-    {
-      CompilationUnitElement testUnit = testLibrary.definingCompilationUnit;
-      InterfaceType streamType = testUnit.topLevelVariables[0].type;
-      streamElement = streamType.element;
-    }
-    // must be from SDK context
-    AnalysisContext sdkContext = context.sourceFactory.dartSdk.context;
-    expect(sdkContext, streamElement.context);
-    Source intSource = streamElement.source;
-    // must be in the "async" library - SDK context
-    {
-      List<Source> coreLibraries = sdkContext.getLibrariesContaining(intSource);
-      expect(coreLibraries, hasLength(1));
-      Source coreSource = coreLibraries[0];
-      expect(coreSource.isInSystemLibrary, isTrue);
-      expect(coreSource.shortName, 'async.dart');
-    }
-    // must be in the "async" library - main context
-    {
-      List<Source> coreLibraries = context.getLibrariesContaining(intSource);
-      expect(coreLibraries, hasLength(1));
-      Source coreSource = coreLibraries[0];
-      expect(coreSource.isInSystemLibrary, isTrue);
-      expect(coreSource.shortName, 'async.dart');
-    }
-  }
-
-  void test_getLineInfo() {
-    Source source = addSource("/test.dart", r'''
-library lib;
-
-main() {}''');
-    LineInfo info = context.getLineInfo(source);
-    expect(info, isNull);
-    context.parseCompilationUnit(source);
-    info = context.getLineInfo(source);
-    expect(info, isNotNull);
-  }
-
-  void test_getModificationStamp_fromSource() {
-    int stamp = 42;
-    expect(
-        context.getModificationStamp(
-            new _AnalysisContextImplTest_Source_getModificationStamp_fromSource(
-                stamp)),
-        stamp);
-  }
-
-  void test_getModificationStamp_overridden() {
-    int stamp = 42;
-    Source source =
-        new _AnalysisContextImplTest_Source_getModificationStamp_overridden(
-            stamp);
-    context.setContents(source, "");
-    expect(stamp != context.getModificationStamp(source), isTrue);
-  }
-
-  void test_getPublicNamespace_element() {
-    Source source = addSource("/test.dart", "class A {}");
-    LibraryElement library = context.computeLibraryElement(source);
-    expect(library, isNotNull);
-    Namespace namespace = context.getPublicNamespace(library);
-    expect(namespace, isNotNull);
-    expect(namespace.get("A"), isClassElement);
-  }
-
-  void test_getResolvedCompilationUnit_library() {
-    Source source = addSource("/lib.dart", "library libb;");
-    LibraryElement library = context.computeLibraryElement(source);
-    context.computeErrors(source); // Force the resolved unit to be built.
-    expect(context.getResolvedCompilationUnit(source, library), isNotNull);
-    context.setContents(source, "library lib;");
-    expect(context.getResolvedCompilationUnit(source, library), isNull);
-  }
-
-  void test_getResolvedCompilationUnit_library_null() {
-    Source source = addSource("/lib.dart", "library lib;");
-    expect(context.getResolvedCompilationUnit(source, null), isNull);
-  }
-
-  void test_getResolvedCompilationUnit_source_dart() {
-    Source source = addSource("/lib.dart", "library lib;");
-    expect(context.getResolvedCompilationUnit2(source, source), isNull);
-    context.resolveCompilationUnit2(source, source);
-    expect(context.getResolvedCompilationUnit2(source, source), isNotNull);
-  }
-
-  void test_getSourceFactory() {
-    expect(context.sourceFactory, same(sourceFactory));
-  }
-
-  void test_getSourcesWithFullName() {
-    String filePath = '/foo/lib/file.dart';
-    List<Source> expected = <Source>[];
-    ChangeSet changeSet = new ChangeSet();
-
-    TestSourceWithUri source1 =
-        new TestSourceWithUri(filePath, Uri.parse('file://$filePath'));
-    expected.add(source1);
-    changeSet.addedSource(source1);
-
-    TestSourceWithUri source2 =
-        new TestSourceWithUri(filePath, Uri.parse('package:foo/file.dart'));
-    expected.add(source2);
-    changeSet.addedSource(source2);
-
-    context.applyChanges(changeSet);
-    expect(context.getSourcesWithFullName(filePath), unorderedEquals(expected));
-  }
-
-  void test_handleContentsChanged() {
-    ContentCache contentCache = new ContentCache();
-    context.contentCache = contentCache;
-    String oldContents = 'foo() {}';
-    String newContents = 'bar() {}';
-    // old contents
-    Source source = addSource("/test.dart", oldContents);
-    _analyzeAll_assertFinished();
-    expect(context.getResolvedCompilationUnit2(source, source), isNotNull);
-    // new contents
-    contentCache.setContents(source, newContents);
-    context.handleContentsChanged(source, oldContents, newContents, true);
-    // there is some work to do
-    AnalysisResult analysisResult = context.performAnalysisTask();
-    expect(analysisResult.changeNotices, isNotNull);
-  }
-
-  void test_handleContentsChanged_noOriginal_sameAsFile() {
-    ContentCache contentCache = new ContentCache();
-    context.contentCache = contentCache;
-    // Add the source.
-    String code = 'foo() {}';
-    Source source = addSource("/test.dart", code);
-    _analyzeAll_assertFinished();
-    expect(context.getResolvedCompilationUnit2(source, source), isNotNull);
-    // Update the content cache, and notify that we updated the source.
-    // We pass "null" as "originalContents" because the was no one.
-    contentCache.setContents(source, code);
-    context.handleContentsChanged(source, null, code, true);
-    expect(context.getResolvedCompilationUnit2(source, source), isNotNull);
-  }
-
-  void test_handleContentsChanged_noOriginal_sameAsFile_butFileUpdated() {
-    ContentCache contentCache = new ContentCache();
-    context.contentCache = contentCache;
-    // Add the source.
-    String oldCode = 'foo() {}';
-    String newCode = 'bar() {}';
-    var file = newFile('/test.dart', content: oldCode);
-    Source source = file.createSource();
-    context.applyChanges(new ChangeSet()..addedSource(source));
-    _analyzeAll_assertFinished();
-    expect(context.getResolvedCompilationUnit2(source, source), isNotNull);
-    // Test for the race condition.
-    // 1. Update the file.
-    // 2. Update the content cache.
-    // 3. Notify the context, and because this is the first time when we
-    //    update the content cache, we don't know "originalContents".
-    // The source must be invalidated, because it has different contents now.
-    modifyFile('/test.dart', newCode);
-    contentCache.setContents(source, newCode);
-    context.handleContentsChanged(source, null, newCode, true);
-    expect(context.getResolvedCompilationUnit2(source, source), isNull);
-  }
-
-  Future test_implicitAnalysisEvents_added() async {
-    AnalyzedSourcesListener listener = new AnalyzedSourcesListener();
-    context.implicitAnalysisEvents.listen(listener.onData);
-    //
-    // Create a file that references an file that is not explicitly being
-    // analyzed and fully analyze it. Ensure that the listener is told about
-    // the implicitly analyzed file.
-    //
-    Source sourceA = newSource('/a.dart', "library a; import 'b.dart';");
-    Source sourceB = newSource('/b.dart', "library b;");
-    ChangeSet changeSet = new ChangeSet();
-    changeSet.addedSource(sourceA);
-    context.applyChanges(changeSet);
-    context.computeErrors(sourceA);
-    await pumpEventQueue();
-    listener.expectAnalyzed(sourceB);
-  }
-
-  void test_isClientLibrary_dart() {
-    Source source = addSource("/test.dart", r'''
-import 'dart:html';
-
-main() {}''');
-    expect(context.isClientLibrary(source), isFalse);
-    expect(context.isServerLibrary(source), isFalse);
-    context.computeLibraryElement(source);
-    expect(context.isClientLibrary(source), isTrue);
-    expect(context.isServerLibrary(source), isFalse);
-  }
-
-  void test_isClientLibrary_html() {
-    Source source = addSource("/test.html", "<html></html>");
-    expect(context.isClientLibrary(source), isFalse);
-  }
-
-  void test_isClientLibrary_unknown() {
-    Source source = newSource("/test.dart");
-    expect(context.isClientLibrary(source), isFalse);
-  }
-
-  void test_isServerLibrary_dart() {
-    Source source = addSource("/test.dart", r'''
-library lib;
-
-main() {}''');
-    expect(context.isClientLibrary(source), isFalse);
-    expect(context.isServerLibrary(source), isFalse);
-    context.computeLibraryElement(source);
-    expect(context.isClientLibrary(source), isFalse);
-    expect(context.isServerLibrary(source), isTrue);
-  }
-
-  void test_isServerLibrary_html() {
-    Source source = addSource("/test.html", "<html></html>");
-    expect(context.isServerLibrary(source), isFalse);
-  }
-
-  void test_isServerLibrary_unknown() {
-    Source source = newSource("/test.dart");
-    expect(context.isServerLibrary(source), isFalse);
-  }
-
-  void test_onResultInvalidated_removeSource() {
-    Source source = addSource('/test.dart', 'main() {}');
-    _analyzeAll_assertFinished();
-    // listen for changes
-    bool listenerInvoked = false;
-    context.onResultChanged(RESOLVED_UNIT).listen((ResultChangedEvent event) {
-      Source eventSource = event.target.source;
-      expect(event.wasComputed, isFalse);
-      expect(event.wasInvalidated, isTrue);
-      expect(event.descriptor, RESOLVED_UNIT);
-      expect(eventSource, source);
-      listenerInvoked = true;
-    });
-    // apply changes
-    expect(listenerInvoked, false);
-    context.applyChanges(new ChangeSet()..removedSource(source));
-    // verify
-    expect(listenerInvoked, isTrue);
-  }
-
-  void test_onResultInvalidated_setContents() {
-    Source source = addSource('/test.dart', 'main() {}');
-    _analyzeAll_assertFinished();
-    // listen for changes
-    bool listenerInvoked = false;
-    context.onResultChanged(RESOLVED_UNIT).listen((ResultChangedEvent event) {
-      Source eventSource = event.target.source;
-      expect(event.wasComputed, isFalse);
-      expect(event.wasInvalidated, isTrue);
-      expect(event.descriptor, RESOLVED_UNIT);
-      expect(eventSource, source);
-      listenerInvoked = true;
-    });
-    // apply changes
-    expect(listenerInvoked, false);
-    context.setContents(source, 'class B {}');
-    // verify
-    expect(listenerInvoked, isTrue);
-  }
-
-  void test_parseCompilationUnit_errors() {
-    Source source = addSource("/lib.dart", "library {");
-    CompilationUnit compilationUnit = context.parseCompilationUnit(source);
-    expect(compilationUnit, isNotNull);
-    var errorInfo = context.getErrors(source);
-    expect(errorInfo, isNotNull);
-    List<AnalysisError> errors = errorInfo.errors;
-    expect(errors, isNotNull);
-    expect(errors.length > 0, isTrue);
-  }
-
-  void test_parseCompilationUnit_exception() {
-    Source source = _addSourceWithException("/test.dart");
-    try {
-      context.parseCompilationUnit(source);
-      fail("Expected AnalysisException");
-    } on AnalysisException {
-      // Expected
-    }
-  }
-
-  void test_parseCompilationUnit_html() {
-    Source source = addSource("/test.html", "<html></html>");
-    expect(context.parseCompilationUnit(source), isNull);
-  }
-
-  void test_parseCompilationUnit_noErrors() {
-    Source source = addSource("/lib.dart", "library lib;");
-    CompilationUnit compilationUnit = context.parseCompilationUnit(source);
-    expect(compilationUnit, isNotNull);
-    AnalysisErrorInfo errorInfo = context.getErrors(source);
-    expect(errorInfo, isNotNull);
-    expect(errorInfo.errors, hasLength(0));
-  }
-
-  void test_parseCompilationUnit_nonExistentSource() {
-    Source source = newSource('/test.dart');
-    deleteFile('/test.dart');
-    try {
-      context.parseCompilationUnit(source);
-      fail("Expected AnalysisException because file does not exist");
-    } on AnalysisException {
-      // Expected result
-    }
-  }
-
-  void test_parseHtmlDocument() {
-    Source source = addSource("/lib.html", "<!DOCTYPE html><html></html>");
-    Document document = context.parseHtmlDocument(source);
-    expect(document, isNotNull);
-  }
-
-  void test_parseHtmlUnit_resolveDirectives() {
-    Source libSource = addSource("/lib.dart", r'''
-library lib;
-class ClassA {}''');
-    Source source = addSource("/lib.html", r'''
-<!DOCTYPE html>
-<html>
-<head>
-  <script type='application/dart'>
-    import 'lib.dart';
-    ClassA v = null;
-  </script>
-</head>
-<body>
-</body>
-</html>''');
-    Document document = context.parseHtmlDocument(source);
-    expect(document, isNotNull);
-    List<DartScript> scripts = context.computeResult(source, DART_SCRIPTS);
-    expect(scripts, hasLength(1));
-    CompilationUnit unit = context.computeResult(scripts[0], PARSED_UNIT);
-    ImportDirective importNode = unit.directives[0] as ImportDirective;
-    expect(importNode.uriContent, isNotNull);
-    expect(importNode.uriSource, libSource);
-  }
-
-  void test_performAnalysisTask_addPart() {
-    Source libSource = addSource("/lib.dart", r'''
-library lib;
-part 'part.dart';''');
-    // run all tasks without part
-    _analyzeAll_assertFinished();
-    expect(_hasAnalysisErrorWithErrorSeverity(context.getErrors(libSource)),
-        isTrue,
-        reason: "lib has errors");
-    // add part and run all tasks
-    Source partSource = addSource("/part.dart", r'''
-part of lib;
-''');
-    _analyzeAll_assertFinished();
-    // "libSource" should be here
-    List<Source> librariesWithPart = context.getLibrariesContaining(partSource);
-    expect(librariesWithPart, unorderedEquals([libSource]));
-    expect(_hasAnalysisErrorWithErrorSeverity(context.getErrors(libSource)),
-        isFalse,
-        reason: "lib doesn't have errors");
-    expect(
-        context.getResolvedCompilationUnit2(partSource, libSource), isNotNull,
-        reason: "part resolved");
-  }
-
-  void test_performAnalysisTask_changeLibraryContents() {
-    Source libSource =
-        addSource("/test.dart", "library lib; part 'test-part.dart';");
-    Source partSource = addSource("/test-part.dart", "part of lib;");
-    _analyzeAll_assertFinished();
-    expect(context.getResolvedCompilationUnit2(libSource, libSource), isNotNull,
-        reason: "library resolved 1");
-    expect(
-        context.getResolvedCompilationUnit2(partSource, libSource), isNotNull,
-        reason: "part resolved 1");
-    // update and analyze #1
-    context.setContents(libSource, "library lib;");
-    expect(context.getResolvedCompilationUnit2(libSource, libSource), isNull,
-        reason: "library changed 2");
-    expect(context.getResolvedCompilationUnit2(partSource, libSource), isNull,
-        reason: "part changed 2");
-    _analyzeAll_assertFinished();
-    expect(context.getResolvedCompilationUnit2(libSource, libSource), isNotNull,
-        reason: "library resolved 2");
-    expect(context.getResolvedCompilationUnit2(partSource, libSource), isNull,
-        reason: "part resolved 2");
-    // update and analyze #2
-    context.setContents(libSource, "library lib; part 'test-part.dart';");
-    expect(context.getResolvedCompilationUnit2(libSource, libSource), isNull,
-        reason: "library changed 3");
-    expect(context.getResolvedCompilationUnit2(partSource, libSource), isNull,
-        reason: "part changed 3");
-    _analyzeAll_assertFinished();
-    expect(context.getResolvedCompilationUnit2(libSource, libSource), isNotNull,
-        reason: "library resolved 3");
-    expect(
-        context.getResolvedCompilationUnit2(partSource, libSource), isNotNull,
-        reason: "part resolved 3");
-  }
-
-  void test_performAnalysisTask_changeLibraryThenPartContents() {
-    Source libSource =
-        addSource("/test.dart", "library lib; part 'test-part.dart';");
-    Source partSource = addSource("/test-part.dart", "part of lib;");
-    _analyzeAll_assertFinished();
-    expect(context.getResolvedCompilationUnit2(libSource, libSource), isNotNull,
-        reason: "library resolved 1");
-    expect(
-        context.getResolvedCompilationUnit2(partSource, libSource), isNotNull,
-        reason: "part resolved 1");
-    // update and analyze #1
-    context.setContents(libSource, "library lib;");
-    expect(context.getResolvedCompilationUnit2(libSource, libSource), isNull,
-        reason: "library changed 2");
-    expect(context.getResolvedCompilationUnit2(partSource, libSource), isNull,
-        reason: "part changed 2");
-    _analyzeAll_assertFinished();
-    expect(context.getResolvedCompilationUnit2(libSource, libSource), isNotNull,
-        reason: "library resolved 2");
-    expect(context.getResolvedCompilationUnit2(partSource, libSource), isNull,
-        reason: "part resolved 2");
-    // update and analyze #2
-    context.setContents(partSource, "part of lib; // 1");
-    // Assert that changing the part's content does not effect the library
-    // now that it is no longer part of that library
-    expect(context.getResolvedCompilationUnit2(libSource, libSource), isNotNull,
-        reason: "library changed 3");
-    expect(context.getResolvedCompilationUnit2(partSource, libSource), isNull,
-        reason: "part changed 3");
-    _analyzeAll_assertFinished();
-    expect(context.getResolvedCompilationUnit2(libSource, libSource), isNotNull,
-        reason: "library resolved 3");
-    expect(context.getResolvedCompilationUnit2(partSource, libSource), isNull,
-        reason: "part resolved 3");
-  }
-
-  void test_performAnalysisTask_changePartContents_makeItAPart() {
-    Source libSource = addSource("/lib.dart", r'''
-library lib;
-part 'part.dart';
-void f(x) {}''');
-    Source partSource = addSource("/part.dart", "void g() { f(null); }");
-    _analyzeAll_assertFinished();
-    expect(context.getResolvedCompilationUnit2(libSource, libSource), isNotNull,
-        reason: "library resolved 1");
-    expect(
-        context.getResolvedCompilationUnit2(partSource, partSource), isNotNull,
-        reason: "part resolved 1");
-    // update and analyze
-    context.setContents(partSource, r'''
-part of lib;
-void g() { f(null); }''');
-    expect(context.getResolvedCompilationUnit2(libSource, libSource), isNull,
-        reason: "library changed 2");
-    expect(context.getResolvedCompilationUnit2(partSource, partSource), isNull,
-        reason: "part changed 2");
-    _analyzeAll_assertFinished();
-    expect(context.getResolvedCompilationUnit2(libSource, libSource), isNotNull,
-        reason: "library resolved 2");
-    expect(
-        context.getResolvedCompilationUnit2(partSource, libSource), isNotNull,
-        reason: "part resolved 2");
-    expect(context.getErrors(libSource).errors, hasLength(0));
-    expect(context.getErrors(partSource).errors, hasLength(0));
-  }
-
-  /**
-   * https://code.google.com/p/dart/issues/detail?id=12424
-   */
-  void test_performAnalysisTask_changePartContents_makeItNotPart() {
-    Source libSource = addSource("/lib.dart", r'''
-library lib;
-part 'part.dart';
-void f(x) {}''');
-    Source partSource = addSource("/part.dart", r'''
-part of lib;
-void g() { f(null); }''');
-    _analyzeAll_assertFinished();
-    expect(context.getErrors(libSource).errors, hasLength(0));
-    expect(context.getErrors(partSource).errors, hasLength(0));
-    // Remove 'part' directive, which should make "f(null)" an error.
-    context.setContents(partSource, r'''
-//part of lib;
-void g() { f(null); }''');
-    _analyzeAll_assertFinished();
-    expect(context.getErrors(libSource).errors.length != 0, isTrue);
-  }
-
-  void test_performAnalysisTask_changePartContents_noSemanticChanges() {
-    Source libSource =
-        addSource("/test.dart", "library lib; part 'test-part.dart';");
-    Source partSource = addSource("/test-part.dart", "part of lib;");
-    _analyzeAll_assertFinished();
-    expect(context.getResolvedCompilationUnit2(libSource, libSource), isNotNull,
-        reason: "library resolved 1");
-    expect(
-        context.getResolvedCompilationUnit2(partSource, libSource), isNotNull,
-        reason: "part resolved 1");
-    // update and analyze #1
-    context.setContents(partSource, "part of lib; // 1");
-    expect(context.getResolvedCompilationUnit2(libSource, libSource), isNull,
-        reason: "library changed 2");
-    expect(context.getResolvedCompilationUnit2(partSource, libSource), isNull,
-        reason: "part changed 2");
-    _analyzeAll_assertFinished();
-    expect(context.getResolvedCompilationUnit2(libSource, libSource), isNotNull,
-        reason: "library resolved 2");
-    expect(
-        context.getResolvedCompilationUnit2(partSource, libSource), isNotNull,
-        reason: "part resolved 2");
-    // update and analyze #2
-    context.setContents(partSource, "part of lib; // 12");
-    expect(context.getResolvedCompilationUnit2(libSource, libSource), isNull,
-        reason: "library changed 3");
-    expect(context.getResolvedCompilationUnit2(partSource, libSource), isNull,
-        reason: "part changed 3");
-    _analyzeAll_assertFinished();
-    expect(context.getResolvedCompilationUnit2(libSource, libSource), isNotNull,
-        reason: "library resolved 3");
-    expect(
-        context.getResolvedCompilationUnit2(partSource, libSource), isNotNull,
-        reason: "part resolved 3");
-  }
-
-  void test_performAnalysisTask_getContentException_dart() {
-    Source source = _addSourceWithException('test.dart');
-    // prepare errors
-    _analyzeAll_assertFinished();
-    List<AnalysisError> errors = context.getErrors(source).errors;
-    // validate errors
-    expect(errors, hasLength(1));
-    AnalysisError error = errors[0];
-    expect(error.source, same(source));
-    expect(error.errorCode, ScannerErrorCode.UNABLE_GET_CONTENT);
-  }
-
-  void test_performAnalysisTask_getContentException_html() {
-    Source source = _addSourceWithException('test.html');
-    // prepare errors
-    _analyzeAll_assertFinished();
-    List<AnalysisError> errors = context.getErrors(source).errors;
-    // validate errors
-    expect(errors, hasLength(1));
-    AnalysisError error = errors[0];
-    expect(error.source, same(source));
-    expect(error.errorCode, ScannerErrorCode.UNABLE_GET_CONTENT);
-  }
-
-  void test_performAnalysisTask_importedLibraryAdd() {
-    Source libASource =
-        addSource("/libA.dart", "library libA; import 'libB.dart';");
-    _analyzeAll_assertFinished();
-    expect(
-        context.getResolvedCompilationUnit2(libASource, libASource), isNotNull,
-        reason: "libA resolved 1");
-    expect(_hasAnalysisErrorWithErrorSeverity(context.getErrors(libASource)),
-        isTrue,
-        reason: "libA has an error");
-    // add libB.dart and analyze
-    Source libBSource = addSource("/libB.dart", "library libB;");
-    _analyzeAll_assertFinished();
-    expect(
-        context.getResolvedCompilationUnit2(libASource, libASource), isNotNull,
-        reason: "libA resolved 2");
-    expect(
-        context.getResolvedCompilationUnit2(libBSource, libBSource), isNotNull,
-        reason: "libB resolved 2");
-    expect(_hasAnalysisErrorWithErrorSeverity(context.getErrors(libASource)),
-        isFalse,
-        reason: "libA doesn't have errors");
-  }
-
-  void test_performAnalysisTask_importedLibraryAdd_html() {
-    Source htmlSource = addSource("/page.html", r'''
-<html><body><script type="application/dart">
-  import '/libB.dart';
-  main() {print('hello dart');}
-</script></body></html>''');
-    _analyzeAll_assertFinished();
-    context.computeErrors(htmlSource);
-//    expect(_hasAnalysisErrorWithErrorSeverity(context.getErrors(htmlSource)),
-//        isTrue,
-//        reason: "htmlSource has an error");
-    // add libB.dart and analyze
-    Source libBSource = addSource("/libB.dart", "library libB;");
-    _analyzeAll_assertFinished();
-    expect(
-        context.getResolvedCompilationUnit2(libBSource, libBSource), isNotNull,
-        reason: "libB resolved 2");
-    // TODO (danrubel) commented out to fix red bots
-//    context.computeErrors(htmlSource);
-//    AnalysisErrorInfo errors = _context.getErrors(htmlSource);
-//    expect(
-//        !_hasAnalysisErrorWithErrorSeverity(errors),
-//        isTrue,
-//        reason: "htmlSource doesn't have errors");
-  }
-
-  void test_performAnalysisTask_importedLibraryDelete() {
-    Source libASource =
-        addSource("/libA.dart", "library libA; import 'libB.dart';");
-    Source libBSource = addSource("/libB.dart", "library libB;");
-    _analyzeAll_assertFinished();
-    expect(
-        context.getResolvedCompilationUnit2(libASource, libASource), isNotNull,
-        reason: "libA resolved 1");
-    expect(
-        context.getResolvedCompilationUnit2(libBSource, libBSource), isNotNull,
-        reason: "libB resolved 1");
-    expect(!_hasAnalysisErrorWithErrorSeverity(context.getErrors(libASource)),
-        isTrue,
-        reason: "libA doesn't have errors");
-    // remove libB.dart and analyze
-    _removeSource(libBSource);
-    _analyzeAll_assertFinished();
-    expect(
-        context.getResolvedCompilationUnit2(libASource, libASource), isNotNull,
-        reason: "libA resolved 2");
-    expect(_hasAnalysisErrorWithErrorSeverity(context.getErrors(libASource)),
-        isTrue,
-        reason: "libA has an error");
-  }
-
-  void test_performAnalysisTask_interruptBy_setContents() {
-    Source sourceA = addSource('/a.dart', r'''
-library expectedToFindSemicolon
-''');
-    // Analyze to the point where some of the results stop depending on
-    // the source content.
-    LibrarySpecificUnit unitA = new LibrarySpecificUnit(sourceA, sourceA);
-    for (int i = 0; i < 10000; i++) {
-      context.performAnalysisTask();
-      if (context.getResult(unitA, RESOLVED_UNIT3) != null) {
-        break;
-      }
-    }
-    // Update the source.
-    // This should invalidate all the results and also reset the driver.
-    context.setContents(sourceA, "library semicolonWasAdded;");
-    expect(context.getResult(unitA, RESOLVED_UNIT3), isNull);
-    expect(analysisDriver.currentWorkOrder, isNull);
-    // Continue analysis.
-    _analyzeAll_assertFinished();
-    expect(context.getErrors(sourceA).errors, isEmpty);
-  }
-
-  void test_performAnalysisTask_IOException() {
-    TestSource source = _addSourceWithException2("/test.dart", "library test;");
-    source.generateExceptionOnRead = false;
-    _analyzeAll_assertFinished();
-    expect(source.readCount, 2);
-    _changeSource(source, "");
-    source.generateExceptionOnRead = true;
-    _analyzeAll_assertFinished();
-    expect(source.readCount, 5);
-  }
-
-  void test_performAnalysisTask_missingPart() {
-    Source source =
-        addSource("/test.dart", "library lib; part 'no-such-file.dart';");
-    _analyzeAll_assertFinished();
-    expect(context.getLibraryElement(source), isNotNull,
-        reason: "performAnalysisTask failed to compute an element model");
-  }
-
-  void test_performAnalysisTask_modifiedAfterParse() {
-    // TODO(scheglov) no threads in Dart
-//    Source source = _addSource("/test.dart", "library lib;");
-//    int initialTime = _context.getModificationStamp(source);
-//    List<Source> sources = <Source>[];
-//    sources.add(source);
-//    _context.analysisPriorityOrder = sources;
-//    _context.parseCompilationUnit(source);
-//    while (initialTime == JavaSystem.currentTimeMillis()) {
-//      Thread.sleep(1);
-//      // Force the modification time to be different.
-//    }
-//    _context.setContents(source, "library test;");
-//    JUnitTestCase.assertTrue(initialTime != _context.getModificationStamp(source));
-//    _analyzeAll_assertFinished();
-//    JUnitTestCase.assertNotNullMsg("performAnalysisTask failed to compute an element model", _context.getLibraryElement(source));
-  }
-
-  void test_performAnalysisTask_onResultChanged() {
-    Set<String> libraryElementUris = new Set<String>();
-    Set<String> parsedUnitUris = new Set<String>();
-    Set<String> resolvedUnitUris = new Set<String>();
-    // listen
-    context.onResultChanged(LIBRARY_ELEMENT).listen((event) {
-      expect(event.wasComputed, isTrue);
-      expect(event.wasInvalidated, isFalse);
-      Source librarySource = event.target;
-      libraryElementUris.add(librarySource.uri.toString());
-    });
-    context.onResultChanged(PARSED_UNIT).listen((event) {
-      expect(event.wasComputed, isTrue);
-      expect(event.wasInvalidated, isFalse);
-      Source source = event.target;
-      parsedUnitUris.add(source.uri.toString());
-    });
-    context.onResultChanged(RESOLVED_UNIT).listen((event) {
-      expect(event.wasComputed, isTrue);
-      expect(event.wasInvalidated, isFalse);
-      LibrarySpecificUnit target = event.target;
-      Source librarySource = target.library;
-      resolvedUnitUris.add(librarySource.uri.toString());
-    });
-    // analyze
-    addSource('/test.dart', 'main() {}');
-    _analyzeAll_assertFinished();
-    // verify
-    String testUri = getFile('/test.dart').toUri().toString();
-    expect(libraryElementUris, contains(testUri));
-    expect(parsedUnitUris, contains(testUri));
-    expect(resolvedUnitUris, contains(testUri));
-  }
-
-  void test_performAnalysisTask_switchPackageVersion() {
-    // version 1
-    newFile('/pkgs/crypto-1/lib/crypto.dart', content: r'''
-library crypto;
-part 'src/hash_utils.dart';
-''');
-    newFile('/pkgs/crypto-1/lib/src/hash_utils.dart', content: r'''
-part of crypto;
-const _MASK_8 = 0xff;
-''');
-    // version 2
-    newFile('/pkgs/crypto-2/lib/crypto.dart', content: r'''
-library crypto;
-part 'src/hash_utils.dart';
-''');
-    newFile('/pkgs/crypto-2/lib/src/hash_utils.dart', content: r'''
-part of crypto;
-const _MASK_8 = 0xff;
-''');
-    // use version 1
-    context.sourceFactory = new SourceFactory(<UriResolver>[
-      sdkResolver,
-      resourceResolver,
-      new PackageMapUriResolver(resourceProvider, {
-        'crypto': [getFolder('/pkgs/crypto-1/lib')]
-      })
-    ]);
-    // analyze
-    addSource("/test.dart", r'''
-import 'package:crypto/crypto.dart';
-''');
-    _analyzeAll_assertFinished();
-    // use version 2
-    context.sourceFactory = new SourceFactory(<UriResolver>[
-      sdkResolver,
-      resourceResolver,
-      new PackageMapUriResolver(resourceProvider, {
-        'crypto': [getFolder('/pkgs/crypto-2/lib')]
-      })
-    ]);
-    _analyzeAll_assertFinished();
-    _assertNoExceptions();
-  }
-
-  void test_resolveCompilationUnit_existingElementModel() {
-    prepareAnalysisContext(new AnalysisOptionsImpl());
-    Source source = addSource('/test.dart', r'''
-library test;
-
-String topLevelVariable;
-int get topLevelGetter => 0;
-void set topLevelSetter(int value) {}
-String topLevelFunction(int i) => '';
-
-typedef String FunctionTypeAlias(int i);
-
-enum EnumeratedType {Invalid, Valid}
-
-class A {
-  const A(x);
-}
-
-@A(const [(_) => null])
-class ClassOne {
-  int instanceField;
-  static int staticField;
-
-  ClassOne();
-  ClassOne.named();
-
-  int get instanceGetter => 0;
-  static String get staticGetter => '';
-
-  void set instanceSetter(int value) {}
-  static void set staticSetter(int value) {}
-
-  int instanceMethod(int first, [int second = 0]) {
-    int localVariable;
-    int localFunction(String s) {}
-  }
-  static String staticMethod(int first, {int second: 0}) => '';
-}
-
-class ClassTwo {
-  // Implicit no-argument constructor
-}
-
-void topLevelFunctionWithLocalFunction() {
-  void localFunction({bool b: false}) {}
-}
-
-void functionWithGenericFunctionTypedParam/*<S>*/(/*=T*/ pf/*<T>*/(/*=T*/ e)) {}
-void functionWithClosureAsDefaultParam([x = () => null]) {}
-''');
-    context.resolveCompilationUnit2(source, source);
-    LibraryElement firstElement = context.computeLibraryElement(source);
-    _ElementGatherer gatherer = new _ElementGatherer();
-    firstElement.accept(gatherer);
-
-    CacheEntry entry =
-        context.analysisCache.get(new LibrarySpecificUnit(source, source));
-    entry.setState(RESOLVED_UNIT1, CacheState.FLUSHED);
-    entry.setState(RESOLVED_UNIT2, CacheState.FLUSHED);
-    entry.setState(RESOLVED_UNIT3, CacheState.FLUSHED);
-    entry.setState(RESOLVED_UNIT4, CacheState.FLUSHED);
-    entry.setState(RESOLVED_UNIT5, CacheState.FLUSHED);
-    entry.setState(RESOLVED_UNIT6, CacheState.FLUSHED);
-    entry.setState(RESOLVED_UNIT7, CacheState.FLUSHED);
-    entry.setState(RESOLVED_UNIT8, CacheState.FLUSHED);
-    entry.setState(RESOLVED_UNIT9, CacheState.FLUSHED);
-    entry.setState(RESOLVED_UNIT10, CacheState.FLUSHED);
-    entry.setState(RESOLVED_UNIT11, CacheState.FLUSHED);
-    entry.setState(RESOLVED_UNIT12, CacheState.FLUSHED);
-    entry.setState(RESOLVED_UNIT, CacheState.FLUSHED);
-
-    context.resolveCompilationUnit2(source, source);
-    LibraryElement secondElement = context.computeLibraryElement(source);
-    _ElementComparer comparer = new _ElementComparer(gatherer.elements);
-    secondElement.accept(comparer);
-    comparer.expectNoDifferences();
-  }
-
-  void test_resolveCompilationUnit_import_relative() {
-    Source sourceA =
-        addSource("/libA.dart", "library libA; import 'libB.dart'; class A{}");
-    addSource("/libB.dart", "library libB; class B{}");
-    CompilationUnit compilationUnit =
-        context.resolveCompilationUnit2(sourceA, sourceA);
-    expect(compilationUnit, isNotNull);
-    LibraryElement library =
-        resolutionMap.elementDeclaredByCompilationUnit(compilationUnit).library;
-    List<LibraryElement> importedLibraries = library.importedLibraries;
-    assertNamedElements(importedLibraries, ["dart.core", "libB"]);
-  }
-
-  void test_resolveCompilationUnit_import_relative_cyclic() {
-    Source sourceA =
-        addSource("/libA.dart", "library libA; import 'libB.dart'; class A{}");
-    addSource("/libB.dart", "library libB; import 'libA.dart'; class B{}");
-    CompilationUnit compilationUnit =
-        context.resolveCompilationUnit2(sourceA, sourceA);
-    expect(compilationUnit, isNotNull);
-    LibraryElement library =
-        resolutionMap.elementDeclaredByCompilationUnit(compilationUnit).library;
-    List<LibraryElement> importedLibraries = library.importedLibraries;
-    assertNamedElements(importedLibraries, ["dart.core", "libB"]);
-  }
-
-//  void test_resolveCompilationUnit_sourceChangeDuringResolution() {
-//    _context = new _AnalysisContext_sourceChangeDuringResolution();
-//    AnalysisContextFactory.initContextWithCore(_context);
-//    _sourceFactory = _context.sourceFactory;
-//    Source source = _addSource("/lib.dart", "library lib;");
-//    CompilationUnit compilationUnit =
-//        _context.resolveCompilationUnit2(source, source);
-//    expect(compilationUnit, isNotNull);
-//    expect(_context.getLineInfo(source), isNotNull);
-//  }
-
-  void test_resolveCompilationUnit_library() {
-    Source source = addSource("/lib.dart", "library lib;");
-    LibraryElement library = context.computeLibraryElement(source);
-    CompilationUnit compilationUnit =
-        context.resolveCompilationUnit(source, library);
-    expect(compilationUnit, isNotNull);
-    expect(compilationUnit.declaredElement, isNotNull);
-  }
-
-  void test_resolveCompilationUnit_source() {
-    Source source = addSource("/lib.dart", "library lib;");
-    CompilationUnit compilationUnit =
-        context.resolveCompilationUnit2(source, source);
-    expect(compilationUnit, isNotNull);
-  }
-
-  void test_setAnalysisOptions() {
-    AnalysisOptionsImpl options = new AnalysisOptionsImpl();
-    options.dart2jsHint = false;
-    options.hint = false;
-    context.analysisOptions = options;
-    AnalysisOptions result = context.analysisOptions;
-    expect(result.dart2jsHint, options.dart2jsHint);
-    expect(result.hint, options.hint);
-  }
-
-  void test_setAnalysisPriorityOrder() {
-    int priorityCount = 4;
-    List<Source> sources = <Source>[];
-    for (int index = 0; index < priorityCount; index++) {
-      sources.add(addSource("/lib.dart$index", ""));
-    }
-    context.analysisPriorityOrder = sources;
-    expect(_getPriorityOrder(context).length, priorityCount);
-  }
-
-  void test_setAnalysisPriorityOrder_empty() {
-    context.analysisPriorityOrder = <Source>[];
-  }
-
-  void test_setAnalysisPriorityOrder_nonEmpty() {
-    List<Source> sources = <Source>[];
-    sources.add(addSource("/lib.dart", "library lib;"));
-    context.analysisPriorityOrder = sources;
-  }
-
-  void test_setAnalysisPriorityOrder_resetAnalysisDriver() {
-    Source source = addSource('/lib.dart', 'library lib;');
-    // start analysis
-    context.performAnalysisTask();
-    expect(context.driver.currentWorkOrder, isNotNull);
-    // set priority sources, AnalysisDriver is reset
-    context.analysisPriorityOrder = <Source>[source];
-    expect(context.driver.currentWorkOrder, isNull);
-    // analysis continues
-    context.performAnalysisTask();
-    expect(context.driver.currentWorkOrder, isNotNull);
-  }
-
-  Future test_setChangedContents_libraryWithPart() {
-    AnalysisOptionsImpl options = new AnalysisOptionsImpl();
-    context.analysisOptions = options;
-    SourcesChangedListener listener = new SourcesChangedListener();
-    context.onSourcesChanged.listen(listener.onData);
-    String oldCode = r'''
-library lib;
-part 'part.dart';
-int a = 0;''';
-    Source librarySource = addSource("/lib.dart", oldCode);
-    String partContents = r'''
-part of lib;
-int b = a;''';
-    Source partSource = addSource("/part.dart", partContents);
-    LibraryElement element = context.computeLibraryElement(librarySource);
-    CompilationUnit unit =
-        context.resolveCompilationUnit(librarySource, element);
-    expect(unit, isNotNull);
-    int offset = oldCode.indexOf("int a") + 4;
-    String newCode = r'''
-library lib;
-part 'part.dart';
-int ya = 0;''';
-    context.setChangedContents(librarySource, newCode, offset, 0, 1);
-    expect(context.getContents(librarySource).data, newCode);
-    expect(
-        context.getResolvedCompilationUnit2(partSource, librarySource), isNull);
-    return pumpEventQueue().then((_) {
-      listener.assertEvent(wereSourcesAdded: true);
-      listener.assertEvent(wereSourcesAdded: true);
-      listener.assertEvent(changedSources: [librarySource]);
-      listener.assertNoMoreEvents();
-    });
-  }
-
-  void test_setChangedContents_notResolved() {
-    AnalysisOptionsImpl options =
-        new AnalysisOptionsImpl.from(context.analysisOptions);
-    context.analysisOptions = options;
-    String oldCode = r'''
-library lib;
-int a = 0;''';
-    Source librarySource = addSource("/lib.dart", oldCode);
-    int offset = oldCode.indexOf("int a") + 4;
-    String newCode = r'''
-library lib;
-int ya = 0;''';
-    context.setChangedContents(librarySource, newCode, offset, 0, 1);
-    expect(context.getContents(librarySource).data, newCode);
-  }
-
-  Future test_setContents_libraryWithPart() {
-    SourcesChangedListener listener = new SourcesChangedListener();
-    context.onSourcesChanged.listen(listener.onData);
-    String libraryContents1 = r'''
-library lib;
-part 'part.dart';
-int a = 0;''';
-    Source librarySource = addSource("/lib.dart", libraryContents1);
-    String partContents1 = r'''
-part of lib;
-int b = a;''';
-    Source partSource = addSource("/part.dart", partContents1);
-    context.computeLibraryElement(librarySource);
-    String libraryContents2 = r'''
-library lib;
-part 'part.dart';
-int aa = 0;''';
-    context.setContents(librarySource, libraryContents2);
-    expect(
-        context.getResolvedCompilationUnit2(partSource, librarySource), isNull);
-    return pumpEventQueue().then((_) {
-      listener.assertEvent(wereSourcesAdded: true);
-      listener.assertEvent(wereSourcesAdded: true);
-      listener.assertEvent(changedSources: [librarySource]);
-      listener.assertNoMoreEvents();
-    });
-  }
-
-  void test_setContents_null() {
-    // AnalysisContext incremental analysis has been removed
-    if (context != null) return;
-    throw 'is this test used by the new analysis driver?';
-
-//    Source librarySource = addSource(
-//        "/lib.dart",
-//        r'''
-//library lib;
-//int a = 0;''');
-//    context.setContents(librarySource, '// different');
-//    context.computeLibraryElement(librarySource);
-//    context.setContents(librarySource, null);
-//    expect(context.getResolvedCompilationUnit2(librarySource, librarySource),
-//        isNull);
-  }
-
-  void test_setContents_unchanged_consistentModificationTime() {
-    String contents = "// foo";
-    Source source = addSource("/test.dart", contents);
-    context.setContents(source, contents);
-    // do all, no tasks
-    _analyzeAll_assertFinished();
-    {
-      AnalysisResult result = context.performAnalysisTask();
-      expect(result.changeNotices, isNull);
-    }
-    // set the same contents, still no tasks
-    context.setContents(source, contents);
-    {
-      AnalysisResult result = context.performAnalysisTask();
-      expect(result.changeNotices, isNull);
-    }
-  }
-
-  void test_setSourceFactory() {
-    expect(context.sourceFactory, sourceFactory);
-    SourceFactory factory = new SourceFactory([]);
-    context.sourceFactory = factory;
-    expect(context.sourceFactory, factory);
-  }
-
-  void test_updateAnalysis() {
-    expect(context.sourcesNeedingProcessing, isEmpty);
-    Source source = newSource('/test.dart');
-    AnalysisDelta delta = new AnalysisDelta();
-    delta.setAnalysisLevel(source, AnalysisLevel.ALL);
-    context.applyAnalysisDelta(delta);
-    expect(context.sourcesNeedingProcessing, contains(source));
-    delta = new AnalysisDelta();
-    delta.setAnalysisLevel(source, AnalysisLevel.NONE);
-    context.applyAnalysisDelta(delta);
-    expect(context.sourcesNeedingProcessing.contains(source), isFalse);
-  }
-
-  void test_validateCacheConsistency_deletedFile() {
-    String pathA = '/a.dart';
-    String pathB = '/b.dart';
-    var fileA = newFile(pathA);
-    var fileB = newFile(pathB, content: "import 'a.dart';");
-    Source sourceA = fileA.createSource();
-    Source sourceB = fileB.createSource();
-    context.applyChanges(
-        new ChangeSet()..addedSource(sourceA)..addedSource(sourceB));
-    // analyze everything
-    _analyzeAll_assertFinished();
-    // delete a.dart
-    deleteFile(pathA);
-    // analysis should eventually stop
-    _analyzeAll_assertFinished();
-  }
-
-  void xtest_performAnalysisTask_stress() {
-    int maxCacheSize = 4;
-    AnalysisOptionsImpl options =
-        new AnalysisOptionsImpl.from(context.analysisOptions);
-    context.analysisOptions = options;
-    int sourceCount = maxCacheSize + 2;
-    List<Source> sources = <Source>[];
-    ChangeSet changeSet = new ChangeSet();
-    for (int i = 0; i < sourceCount; i++) {
-      Source source = addSource("/lib$i.dart", "library lib$i;");
-      sources.add(source);
-      changeSet.addedSource(source);
-    }
-    context.applyChanges(changeSet);
-    context.analysisPriorityOrder = sources;
-    for (int i = 0; i < 1000; i++) {
-      List<ChangeNotice> notice = context.performAnalysisTask().changeNotices;
-      if (notice == null) {
-        //System.out.println("test_performAnalysisTask_stress: " + i);
-        break;
-      }
-    }
-    List<ChangeNotice> notice = context.performAnalysisTask().changeNotices;
-    if (notice != null) {
-      fail(
-          "performAnalysisTask failed to terminate after analyzing all sources");
-    }
-  }
-
-  TestSource _addSourceWithException(String fileName) {
-    return _addSourceWithException2(fileName, "");
-  }
-
-  TestSource _addSourceWithException2(String fileName, String contents) {
-    TestSource source = new TestSource(fileName, contents);
-    source.generateExceptionOnRead = true;
-    ChangeSet changeSet = new ChangeSet();
-    changeSet.addedSource(source);
-    context.applyChanges(changeSet);
-    return source;
-  }
-
-  /**
-   * Perform analysis tasks up to 512 times and assert that it was enough.
-   */
-  void _analyzeAll_assertFinished([int maxIterations = 512]) {
-    for (int i = 0; i < maxIterations; i++) {
-      List<ChangeNotice> notice = context.performAnalysisTask().changeNotices;
-      if (notice == null) {
-        return;
-      }
-    }
-    fail("performAnalysisTask failed to terminate after analyzing all sources");
-  }
-
-  void _assertNoExceptions() {
-    MapIterator<AnalysisTarget, CacheEntry> iterator = analysisCache.iterator();
-    String exceptionsStr = '';
-    while (iterator.moveNext()) {
-      CaughtException exception = iterator.value.exception;
-      if (exception != null) {
-        AnalysisTarget target = iterator.key;
-        exceptionsStr +=
-            '============= key: $target   source: ${target.source}\n';
-        exceptionsStr += exception.toString();
-        exceptionsStr += '\n';
-      }
-    }
-    if (exceptionsStr.isNotEmpty) {
-      fail(exceptionsStr);
-    }
-  }
-
-  void _changeSource(TestSource source, String contents) {
-    source.setContents(contents);
-    ChangeSet changeSet = new ChangeSet();
-    changeSet.changedSource(source);
-    context.applyChanges(changeSet);
-  }
-
-  void _checkFlushSingleResolvedUnit(String code,
-      void validate(CompilationUnitElement unitElement, String reason)) {
-    prepareAnalysisContext(new AnalysisOptionsImpl());
-    Source source = newFile('/test.dart', content: code).createSource();
-    context.applyChanges(new ChangeSet()..addedSource(source));
-    CompilationUnitElement unitElement =
-        context.resolveCompilationUnit2(source, source).declaredElement;
-    validate(unitElement, 'initial state');
-    for (ResultDescriptor<CompilationUnit> descriptor
-        in RESOLVED_UNIT_RESULTS) {
-      context.analysisCache.flush(
-          (target, result) => target.source == source && result == descriptor);
-      context.computeResult(
-          new LibrarySpecificUnit(source, source), descriptor);
-      validate(unitElement, 'after flushing $descriptor');
-    }
-  }
-
-  /**
-   * Search the given compilation unit for a class with the given name. Return the class with the
-   * given name, or `null` if the class cannot be found.
-   *
-   * @param unit the compilation unit being searched
-   * @param className the name of the class being searched for
-   * @return the class with the given name
-   */
-  ClassElement _findClass(CompilationUnitElement unit, String className) {
-    for (ClassElement classElement in unit.types) {
-      if (classElement.displayName == className) {
-        return classElement;
-      }
-    }
-    return null;
-  }
-
-  void _flushAst(Source source) {
-    CacheEntry entry =
-        context.getCacheEntry(new LibrarySpecificUnit(source, source));
-    entry.setState(RESOLVED_UNIT, CacheState.FLUSHED);
-  }
-
-  List<Source> _getPriorityOrder(AnalysisContextImpl context) {
-    return context.test_priorityOrder;
-  }
-
-  void _performPendingAnalysisTasks([int maxTasks = 512]) {
-    for (int i = 0; context.performAnalysisTask().hasMoreWork; i++) {
-      if (i > maxTasks) {
-        fail('Analysis did not terminate.');
-      }
-    }
-  }
-
-  void _removeSource(Source source) {
-    deleteFile(source.fullName);
-    ChangeSet changeSet = new ChangeSet();
-    changeSet.removedSource(source);
-    context.applyChanges(changeSet);
-  }
-
-  /**
-   * Returns `true` if there is an [AnalysisError] with [ErrorSeverity.ERROR] in
-   * the given [AnalysisErrorInfo].
-   */
-  static bool _hasAnalysisErrorWithErrorSeverity(AnalysisErrorInfo errorInfo) {
-    List<AnalysisError> errors = errorInfo.errors;
-    for (AnalysisError analysisError in errors) {
-      if (analysisError.errorCode.errorSeverity == ErrorSeverity.ERROR) {
-        return true;
-      }
-    }
-    return false;
-  }
-}
-
-class _AnalysisContextImplTest_Source_exists_true extends TestSource {
-  @override
-  bool exists() => true;
-}
-
-class _AnalysisContextImplTest_Source_getModificationStamp_fromSource
-    extends TestSource {
-  int stamp;
-  _AnalysisContextImplTest_Source_getModificationStamp_fromSource(this.stamp);
-  @override
-  int get modificationStamp => stamp;
-}
-
-class _AnalysisContextImplTest_Source_getModificationStamp_overridden
-    extends TestSource {
-  int stamp;
-  _AnalysisContextImplTest_Source_getModificationStamp_overridden(this.stamp);
-  @override
-  int get modificationStamp => stamp;
-}
-
-class _AnalysisContextImplTest_test_applyChanges_removeContainer
-    implements SourceContainer {
-  Source libB;
-  _AnalysisContextImplTest_test_applyChanges_removeContainer(this.libB);
-  @override
-  bool contains(Source source) => source == libB;
-}
-
-/**
- * A visitor that can be used to compare all of the elements in an element model
- * with a previously created map of elements. The class [ElementGatherer] can be
- * used to create the map of elements.
- */
-class _ElementComparer extends GeneralizingElementVisitor {
-  /**
-   * The previously created map of elements.
-   */
-  final Map<Element, Element> previousElements;
-
-  /**
-   * The number of elements that were found to have been overwritten.
-   */
-  int overwrittenCount = 0;
-
-  /**
-   * A buffer to which a description of the overwritten elements will be written.
-   */
-  final StringBuffer buffer = new StringBuffer();
-
-  /**
-   * Initialize a newly created visitor.
-   */
-  _ElementComparer(this.previousElements);
-
-  /**
-   * Expect that no differences were found, causing the test to fail if that
-   * wasn't the case.
-   */
-  void expectNoDifferences() {
-    if (overwrittenCount > 0) {
-      fail('Found $overwrittenCount overwritten elements.$buffer');
-    }
-  }
-
-  @override
-  void visitElement(Element element) {
-    Element previousElement = previousElements[element];
-    bool ok = _expectedIdentical(element)
-        ? identical(previousElement, element)
-        : previousElement == element;
-    if (!ok) {
-      if (overwrittenCount == 0) {
-        buffer.writeln();
-      }
-      overwrittenCount++;
-      buffer.writeln('Overwritten element:');
-      Element currentElement = element;
-      while (currentElement != null) {
-        buffer.write('  ');
-        buffer.writeln(currentElement.toString());
-        currentElement = currentElement.enclosingElement;
-      }
-    }
-    super.visitElement(element);
-  }
-
-  /**
-   * Return `true` if the given [element] should be the same as the previous
-   * element at the same position in the element model.
-   */
-  static bool _expectedIdentical(Element element) {
-    while (element != null) {
-      if (element is ConstructorElement ||
-          element is MethodElement ||
-          element is FunctionElement &&
-              element.enclosingElement is CompilationUnitElement) {
-        return false;
-      }
-      element = element.enclosingElement;
-    }
-    return true;
-  }
-}
-
-/**
- * A visitor that can be used to collect all of the elements in an element
- * model.
- */
-class _ElementGatherer extends GeneralizingElementVisitor {
-  /**
-   * The map in which the elements are collected. The value of each key is the
-   * key itself.
-   */
-  Map<Element, Element> elements = new HashMap<Element, Element>();
-
-  /**
-   * Initialize the visitor.
-   */
-  _ElementGatherer();
-
-  @override
-  void visitElement(Element element) {
-    elements[element] = element;
-    super.visitElement(element);
-  }
-}
diff --git a/pkg/analyzer/test/src/context/test_all.dart b/pkg/analyzer/test/src/context/test_all.dart
index 26c449b..5f5e2d0 100644
--- a/pkg/analyzer/test/src/context/test_all.dart
+++ b/pkg/analyzer/test/src/context/test_all.dart
@@ -6,7 +6,6 @@
 
 import 'builder_test.dart' as builder_test;
 import 'cache_test.dart' as cache_test;
-import 'context_test.dart' as context_test;
 import 'source_test.dart' as source_test;
 
 /// Utility for manually running all tests.
@@ -14,7 +13,6 @@
   defineReflectiveSuite(() {
     builder_test.main();
     cache_test.main();
-    context_test.main();
     source_test.main();
   }, name: 'context');
 }
diff --git a/pkg/analyzer/test/src/dart/analysis/driver_resolution_test.dart b/pkg/analyzer/test/src/dart/analysis/driver_resolution_test.dart
index e52ece7..4797e9d 100644
--- a/pkg/analyzer/test/src/dart/analysis/driver_resolution_test.dart
+++ b/pkg/analyzer/test/src/dart/analysis/driver_resolution_test.dart
@@ -8797,7 +8797,7 @@
     expect(type, isNotNull);
     expect(element.name, name);
     expect(element.nameOffset, offset);
-    // ignore: deprecated_member_use
+    // ignore: deprecated_member_use_from_same_package
     expect(element.parameterKind, kind);
     expect(element.type, type);
   }
diff --git a/pkg/analyzer/test/src/dart/analysis/driver_test.dart b/pkg/analyzer/test/src/dart/analysis/driver_test.dart
index 0970f26..b1ade98 100644
--- a/pkg/analyzer/test/src/dart/analysis/driver_test.dart
+++ b/pkg/analyzer/test/src/dart/analysis/driver_test.dart
@@ -340,6 +340,8 @@
   }
 }
 
+/// TODO(paulberry): migrate this test away from the task model.
+/// See dartbug.com/35734.
 @reflectiveTest
 class AnalysisDriverTest extends BaseAnalysisDriverTest {
   void configurePreviewDart2() {
diff --git a/pkg/analyzer/test/src/dart/ast/utilities_test.dart b/pkg/analyzer/test/src/dart/ast/utilities_test.dart
index c6d4eab..34e5ffe 100644
--- a/pkg/analyzer/test/src/dart/ast/utilities_test.dart
+++ b/pkg/analyzer/test/src/dart/ast/utilities_test.dart
@@ -27,7 +27,7 @@
     defineReflectiveTests(NodeLocatorTest);
     defineReflectiveTests(NodeLocator2Test);
     defineReflectiveTests(ResolutionCopierTest);
-    // ignore: deprecated_member_use
+    // ignore: deprecated_member_use_from_same_package
     defineReflectiveTests(ToSourceVisitorTest);
     defineReflectiveTests(ToSourceVisitor2Test);
   });
@@ -543,6 +543,45 @@
     expect(toNode.staticType, same(staticType));
   }
 
+  void test_visitCollectionForElement() {
+    CollectionForElement createNode() => astFactory.collectionForElement(
+        forLoopParts: astFactory.forEachPartsWithIdentifier(
+            identifier: AstTestFactory.identifier3('a'),
+            iterable: AstTestFactory.identifier3('b')),
+        body: AstTestFactory.identifier3('c'));
+
+    DartType typeC = ElementFactory.classElement2("C").type;
+
+    CollectionForElement fromNode = createNode();
+    (fromNode.body as SimpleIdentifier).staticType = typeC;
+
+    CollectionForElement toNode = createNode();
+    ResolutionCopier.copyResolutionData(fromNode, toNode);
+    expect((toNode.body as SimpleIdentifier).staticType, same(typeC));
+  }
+
+  void test_visitCollectionIfElement() {
+    CollectionIfElement createNode() => astFactory.collectionIfElement(
+        condition: AstTestFactory.identifier3('a'),
+        thenElement: AstTestFactory.identifier3('b'),
+        elseElement: AstTestFactory.identifier3('c'));
+
+    DartType typeA = ElementFactory.classElement2("A").type;
+    DartType typeB = ElementFactory.classElement2("B").type;
+    DartType typeC = ElementFactory.classElement2("C").type;
+
+    CollectionIfElement fromNode = createNode();
+    (fromNode.condition as SimpleIdentifier).staticType = typeA;
+    (fromNode.thenElement as SimpleIdentifier).staticType = typeB;
+    (fromNode.elseElement as SimpleIdentifier).staticType = typeC;
+
+    CollectionIfElement toNode = createNode();
+    ResolutionCopier.copyResolutionData(fromNode, toNode);
+    expect(toNode.condition.staticType, same(typeA));
+    expect((toNode.thenElement as SimpleIdentifier).staticType, same(typeB));
+    expect((toNode.elseElement as SimpleIdentifier).staticType, same(typeC));
+  }
+
   void test_visitCompilationUnit() {
     CompilationUnit fromNode = AstTestFactory.compilationUnit();
     CompilationUnitElement element = new CompilationUnitElementImpl();
@@ -617,6 +656,115 @@
     expect(toNode.element, same(element));
   }
 
+  void test_visitForEachPartsWithDeclaration() {
+    ForEachPartsWithDeclaration createNode() =>
+        astFactory.forEachPartsWithDeclaration(
+            loopVariable: AstTestFactory.declaredIdentifier3('a'),
+            iterable: AstTestFactory.identifier3('b'));
+
+    DartType typeB = ElementFactory.classElement2("B").type;
+
+    ForEachPartsWithDeclaration fromNode = createNode();
+    (fromNode.iterable as SimpleIdentifier).staticType = typeB;
+
+    ForEachPartsWithDeclaration toNode = createNode();
+    ResolutionCopier.copyResolutionData(fromNode, toNode);
+    expect((toNode.iterable as SimpleIdentifier).staticType, same(typeB));
+  }
+
+  void test_visitForEachPartsWithIdentifier() {
+    ForEachPartsWithIdentifier createNode() =>
+        astFactory.forEachPartsWithIdentifier(
+            identifier: AstTestFactory.identifier3('a'),
+            iterable: AstTestFactory.identifier3('b'));
+
+    DartType typeA = ElementFactory.classElement2("A").type;
+    DartType typeB = ElementFactory.classElement2("B").type;
+
+    ForEachPartsWithIdentifier fromNode = createNode();
+    fromNode.identifier.staticType = typeA;
+    (fromNode.iterable as SimpleIdentifier).staticType = typeB;
+
+    ForEachPartsWithIdentifier toNode = createNode();
+    ResolutionCopier.copyResolutionData(fromNode, toNode);
+    expect(toNode.identifier.staticType, same(typeA));
+    expect((toNode.iterable as SimpleIdentifier).staticType, same(typeB));
+  }
+
+  void test_visitForPartsWithDeclarations() {
+    ForPartsWithDeclarations createNode() =>
+        astFactory.forPartsWithDeclarations(
+            variables: AstTestFactory.variableDeclarationList2(
+                Keyword.VAR, [AstTestFactory.variableDeclaration('a')]),
+            condition: AstTestFactory.identifier3('b'),
+            updaters: [AstTestFactory.identifier3('c')]);
+
+    DartType typeB = ElementFactory.classElement2("B").type;
+    DartType typeC = ElementFactory.classElement2("C").type;
+
+    ForPartsWithDeclarations fromNode = createNode();
+    (fromNode.condition as SimpleIdentifier).staticType = typeB;
+    (fromNode.updaters[0] as SimpleIdentifier).staticType = typeC;
+
+    ForPartsWithDeclarations toNode = createNode();
+    ResolutionCopier.copyResolutionData(fromNode, toNode);
+    expect((toNode.condition as SimpleIdentifier).staticType, same(typeB));
+    expect((toNode.updaters[0] as SimpleIdentifier).staticType, same(typeC));
+  }
+
+  void test_visitForPartsWithExpression() {
+    ForPartsWithExpression createNode() => astFactory.forPartsWithExpression(
+        initialization: AstTestFactory.identifier3('a'),
+        condition: AstTestFactory.identifier3('b'),
+        updaters: [AstTestFactory.identifier3('c')]);
+
+    DartType typeA = ElementFactory.classElement2("A").type;
+    DartType typeB = ElementFactory.classElement2("B").type;
+    DartType typeC = ElementFactory.classElement2("C").type;
+
+    ForPartsWithExpression fromNode = createNode();
+    (fromNode.initialization as SimpleIdentifier).staticType = typeA;
+    (fromNode.condition as SimpleIdentifier).staticType = typeB;
+    (fromNode.updaters[0] as SimpleIdentifier).staticType = typeC;
+
+    ForPartsWithExpression toNode = createNode();
+    ResolutionCopier.copyResolutionData(fromNode, toNode);
+    expect((toNode.initialization as SimpleIdentifier).staticType, same(typeA));
+    expect((toNode.condition as SimpleIdentifier).staticType, same(typeB));
+    expect((toNode.updaters[0] as SimpleIdentifier).staticType, same(typeC));
+  }
+
+  void test_visitForStatement2() {
+    ForStatement2 createNode() => astFactory.forStatement2(
+        forLoopParts: astFactory.forEachPartsWithIdentifier(
+            identifier: AstTestFactory.identifier3('a'),
+            iterable: AstTestFactory.identifier3('b')),
+        body: AstTestFactory.expressionStatement(
+            AstTestFactory.identifier3('c')));
+
+    DartType typeA = ElementFactory.classElement2("A").type;
+    DartType typeB = ElementFactory.classElement2("B").type;
+    DartType typeC = ElementFactory.classElement2("C").type;
+
+    ForStatement2 fromNode = createNode();
+    ForEachPartsWithIdentifier fromForLoopParts = fromNode.forLoopParts;
+    fromForLoopParts.identifier.staticType = typeA;
+    (fromForLoopParts.iterable as SimpleIdentifier).staticType = typeB;
+    ((fromNode.body as ExpressionStatement).expression as SimpleIdentifier)
+        .staticType = typeC;
+
+    ForStatement2 toNode = createNode();
+    ResolutionCopier.copyResolutionData(fromNode, toNode);
+    ForEachPartsWithIdentifier toForLoopParts = fromNode.forLoopParts;
+    expect(toForLoopParts.identifier.staticType, same(typeA));
+    expect(
+        (toForLoopParts.iterable as SimpleIdentifier).staticType, same(typeB));
+    expect(
+        ((toNode.body as ExpressionStatement).expression as SimpleIdentifier)
+            .staticType,
+        same(typeC));
+  }
+
   void test_visitFunctionExpression() {
     FunctionExpressionImpl fromNode = AstTestFactory.functionExpression2(
         AstTestFactory.formalParameterList(),
@@ -741,6 +889,74 @@
     expect(toNode.staticType, same(staticType));
   }
 
+  void test_visitListLiteral2() {
+    ListLiteral2 createNode() => astFactory.listLiteral2(
+        typeArguments:
+            AstTestFactory.typeArgumentList([AstTestFactory.typeName4('A')]),
+        elements: [AstTestFactory.identifier3('b')]);
+
+    DartType typeA = ElementFactory.classElement2("A").type;
+    DartType typeB = ElementFactory.classElement2("B").type;
+
+    ListLiteral2 fromNode = createNode();
+    (fromNode.typeArguments.arguments[0] as TypeName).type = typeA;
+    (fromNode.elements[0] as SimpleIdentifier).staticType = typeB;
+
+    ListLiteral2 toNode = createNode();
+    ResolutionCopier.copyResolutionData(fromNode, toNode);
+    expect((toNode.typeArguments.arguments[0] as TypeName).type, same(typeA));
+    expect((toNode.elements[0] as SimpleIdentifier).staticType, same(typeB));
+  }
+
+  void test_visitMapForElement() {
+    MapForElement createNode() => astFactory.mapForElement(
+        forLoopParts: astFactory.forEachPartsWithIdentifier(
+            identifier: AstTestFactory.identifier3('a'),
+            iterable: AstTestFactory.identifier3('b')),
+        body: AstTestFactory.mapLiteralEntry3('c', 'd'));
+
+    DartType typeC = ElementFactory.classElement2("C").type;
+
+    MapForElement fromNode = createNode();
+    (fromNode.body as MapLiteralEntry).key.staticType = typeC;
+
+    MapForElement toNode = createNode();
+    ResolutionCopier.copyResolutionData(fromNode, toNode);
+    expect((toNode.body as MapLiteralEntry).key.staticType, same(typeC));
+  }
+
+  void test_visitMapIfElement() {
+    MapIfElement createNode() => astFactory.mapIfElement(
+        condition: AstTestFactory.identifier3('a'),
+        thenElement: AstTestFactory.mapLiteralEntry3('b', 'c'),
+        elseElement: AstTestFactory.mapLiteralEntry3('d', 'e'));
+
+    DartType typeA = ElementFactory.classElement2("A").type;
+    DartType typeB = ElementFactory.classElement2("B").type;
+    DartType typeC = ElementFactory.classElement2("C").type;
+    DartType typeD = ElementFactory.classElement2("D").type;
+    DartType typeE = ElementFactory.classElement2("E").type;
+
+    MapIfElement fromNode = createNode();
+    MapLiteralEntry fromThen = fromNode.thenElement as MapLiteralEntry;
+    MapLiteralEntry fromElse = fromNode.elseElement as MapLiteralEntry;
+    (fromNode.condition as SimpleIdentifier).staticType = typeA;
+    (fromThen.key as SimpleStringLiteral).staticType = typeB;
+    (fromThen.value as SimpleStringLiteral).staticType = typeC;
+    (fromElse.key as SimpleStringLiteral).staticType = typeD;
+    (fromElse.value as SimpleStringLiteral).staticType = typeE;
+
+    MapIfElement toNode = createNode();
+    ResolutionCopier.copyResolutionData(fromNode, toNode);
+    MapLiteralEntry toThen = toNode.thenElement as MapLiteralEntry;
+    MapLiteralEntry toElse = toNode.elseElement as MapLiteralEntry;
+    expect(toNode.condition.staticType, same(typeA));
+    expect((toThen.key as SimpleStringLiteral).staticType, same(typeB));
+    expect((toThen.value as SimpleStringLiteral).staticType, same(typeC));
+    expect((toElse.key as SimpleStringLiteral).staticType, same(typeD));
+    expect((toElse.value as SimpleStringLiteral).staticType, same(typeE));
+  }
+
   void test_visitMapLiteral() {
     MapLiteral fromNode = AstTestFactory.mapLiteral2();
     DartType staticType = ElementFactory.classElement2("C").type;
@@ -750,6 +966,33 @@
     expect(toNode.staticType, same(staticType));
   }
 
+  void test_visitMapLiteral2() {
+    MapLiteral2 createNode() => astFactory.mapLiteral2(
+        typeArguments: AstTestFactory.typeArgumentList(
+            [AstTestFactory.typeName4('A'), AstTestFactory.typeName4('B')]),
+        entries: [AstTestFactory.mapLiteralEntry3('c', 'd')]);
+
+    DartType typeA = ElementFactory.classElement2("A").type;
+    DartType typeB = ElementFactory.classElement2("B").type;
+    DartType typeC = ElementFactory.classElement2("C").type;
+    DartType typeD = ElementFactory.classElement2("D").type;
+
+    MapLiteral2 fromNode = createNode();
+    (fromNode.typeArguments.arguments[0] as TypeName).type = typeA;
+    (fromNode.typeArguments.arguments[1] as TypeName).type = typeB;
+    MapLiteralEntry fromEntry = fromNode.entries[0] as MapLiteralEntry;
+    (fromEntry.key as SimpleStringLiteral).staticType = typeC;
+    (fromEntry.value as SimpleStringLiteral).staticType = typeD;
+
+    MapLiteral2 toNode = createNode();
+    ResolutionCopier.copyResolutionData(fromNode, toNode);
+    expect((toNode.typeArguments.arguments[0] as TypeName).type, same(typeA));
+    expect((toNode.typeArguments.arguments[1] as TypeName).type, same(typeB));
+    MapLiteralEntry toEntry = fromNode.entries[0] as MapLiteralEntry;
+    expect((toEntry.key as SimpleStringLiteral).staticType, same(typeC));
+    expect((toEntry.value as SimpleStringLiteral).staticType, same(typeD));
+  }
+
   void test_visitMethodInvocation() {
     MethodInvocation fromNode = AstTestFactory.methodInvocation2("m");
     MethodInvocation toNode = AstTestFactory.methodInvocation2("m");
@@ -886,6 +1129,25 @@
     expect(toNode.staticType, same(staticType));
   }
 
+  void test_visitSetLiteral2() {
+    SetLiteral2 createNode() => astFactory.setLiteral2(
+        typeArguments:
+            AstTestFactory.typeArgumentList([AstTestFactory.typeName4('A')]),
+        elements: [AstTestFactory.identifier3('b')]);
+
+    DartType typeA = ElementFactory.classElement2("A").type;
+    DartType typeB = ElementFactory.classElement2("B").type;
+
+    SetLiteral2 fromNode = createNode();
+    (fromNode.typeArguments.arguments[0] as TypeName).type = typeA;
+    (fromNode.elements[0] as SimpleIdentifier).staticType = typeB;
+
+    SetLiteral2 toNode = createNode();
+    ResolutionCopier.copyResolutionData(fromNode, toNode);
+    expect((toNode.typeArguments.arguments[0] as TypeName).type, same(typeA));
+    expect((toNode.elements[0] as SimpleIdentifier).staticType, same(typeB));
+  }
+
   void test_visitSimpleIdentifier() {
     SimpleIdentifier fromNode = AstTestFactory.identifier3("x");
     MethodElement staticElement = ElementFactory.methodElement(
@@ -912,6 +1174,27 @@
     expect(toNode.staticType, same(staticType));
   }
 
+  void test_visitSpreadElement() {
+    SpreadElement createNode() => astFactory.spreadElement(
+        spreadOperator:
+            TokenFactory.tokenFromType(TokenType.PERIOD_PERIOD_PERIOD),
+        expression: astFactory
+            .listLiteral2(elements: [AstTestFactory.identifier3('a')]));
+
+    DartType typeA = ElementFactory.classElement2("A").type;
+
+    SpreadElement fromNode = createNode();
+    ((fromNode.expression as ListLiteral2).elements[0] as SimpleIdentifier)
+        .staticType = typeA;
+
+    SpreadElement toNode = createNode();
+    ResolutionCopier.copyResolutionData(fromNode, toNode);
+    expect(
+        ((toNode.expression as ListLiteral2).elements[0] as SimpleIdentifier)
+            .staticType,
+        same(typeA));
+  }
+
   void test_visitStringInterpolation() {
     StringInterpolation fromNode =
         AstTestFactory.string([AstTestFactory.interpolationString("a", "'a'")]);
@@ -1449,6 +1732,33 @@
     _assertSource("@deprecated class C = S with M1;", declaration);
   }
 
+  void test_visitCollectionForElement() {
+    _assertSource(
+        'for (e in l) 0',
+        astFactory.collectionForElement(
+            forLoopParts: astFactory.forEachPartsWithIdentifier(
+                identifier: AstTestFactory.identifier3('e'),
+                iterable: AstTestFactory.identifier3('l')),
+            body: AstTestFactory.integer(0)));
+  }
+
+  void test_visitCollectionIfElement_else() {
+    _assertSource(
+        'if (b) 1 else 0',
+        astFactory.collectionIfElement(
+            condition: AstTestFactory.identifier3('b'),
+            thenElement: AstTestFactory.integer(1),
+            elseElement: AstTestFactory.integer(0)));
+  }
+
+  void test_visitCollectionIfElement_then() {
+    _assertSource(
+        'if (b) 1',
+        astFactory.collectionIfElement(
+            condition: AstTestFactory.identifier3('b'),
+            thenElement: AstTestFactory.integer(1)));
+  }
+
   void test_visitComment() {
     _assertSource(
         "",
@@ -1881,6 +2191,22 @@
     _assertSource("covariant A this.a", expected);
   }
 
+  void test_visitForEachPartsWithDeclaration() {
+    _assertSource(
+        'var e in l',
+        astFactory.forEachPartsWithDeclaration(
+            loopVariable: AstTestFactory.declaredIdentifier3('e'),
+            iterable: AstTestFactory.identifier3('l')));
+  }
+
+  void test_visitForEachPartsWithIdentifier() {
+    _assertSource(
+        'e in l',
+        astFactory.forEachPartsWithIdentifier(
+            identifier: AstTestFactory.identifier3('e'),
+            iterable: AstTestFactory.identifier3('l')));
+  }
+
   void test_visitForEachStatement_declared() {
     _assertSource(
         "for (var a in b) {}",
@@ -2086,6 +2412,36 @@
         ]));
   }
 
+  void test_visitForPartsWithDeclarations() {
+    _assertSource(
+        'var v; b; u',
+        astFactory.forPartsWithDeclarations(
+            variables: AstTestFactory.variableDeclarationList2(
+                Keyword.VAR, [AstTestFactory.variableDeclaration('v')]),
+            condition: AstTestFactory.identifier3('b'),
+            updaters: [AstTestFactory.identifier3('u')]));
+  }
+
+  void test_visitForPartsWithExpression() {
+    _assertSource(
+        'v; b; u',
+        astFactory.forPartsWithExpression(
+            initialization: AstTestFactory.identifier3('v'),
+            condition: AstTestFactory.identifier3('b'),
+            updaters: [AstTestFactory.identifier3('u')]));
+  }
+
+  void test_visitForStatement2() {
+    _assertSource(
+        'for (e in l) s;',
+        astFactory.forStatement2(
+            forLoopParts: astFactory.forEachPartsWithIdentifier(
+                identifier: AstTestFactory.identifier3('e'),
+                iterable: AstTestFactory.identifier3('l')),
+            body: AstTestFactory.expressionStatement(
+                AstTestFactory.identifier3('s'))));
+  }
+
   void test_visitForStatement_c() {
     _assertSource(
         "for (; c;) {}",
@@ -2638,6 +2994,62 @@
         AstTestFactory.libraryIdentifier([AstTestFactory.identifier3("a")]));
   }
 
+  void test_visitListLiteral2_complex() {
+    _assertSource(
+        '<int>[0, for (e in l) 0, if (b) 1, ...[0]]',
+        astFactory.listLiteral2(
+            typeArguments: AstTestFactory.typeArgumentList(
+                [AstTestFactory.typeName4('int')]),
+            elements: [
+              AstTestFactory.integer(0),
+              astFactory.collectionForElement(
+                  forLoopParts: astFactory.forEachPartsWithIdentifier(
+                      identifier: AstTestFactory.identifier3('e'),
+                      iterable: AstTestFactory.identifier3('l')),
+                  body: AstTestFactory.integer(0)),
+              astFactory.collectionIfElement(
+                  condition: AstTestFactory.identifier3('b'),
+                  thenElement: AstTestFactory.integer(1)),
+              astFactory.spreadElement(
+                  spreadOperator: TokenFactory.tokenFromType(
+                      TokenType.PERIOD_PERIOD_PERIOD),
+                  expression: astFactory
+                      .listLiteral2(elements: [AstTestFactory.integer(0)]))
+            ]));
+  }
+
+  void test_visitListLiteral2_withConst_withoutTypeArgs() {
+    _assertSource(
+        'const [0]',
+        astFactory.listLiteral2(
+            constKeyword: TokenFactory.tokenFromKeyword(Keyword.CONST),
+            elements: [AstTestFactory.integer(0)]));
+  }
+
+  void test_visitListLiteral2_withConst_withTypeArgs() {
+    _assertSource(
+        'const <int>[0]',
+        astFactory.listLiteral2(
+            constKeyword: TokenFactory.tokenFromKeyword(Keyword.CONST),
+            typeArguments: AstTestFactory.typeArgumentList(
+                [AstTestFactory.typeName4('int')]),
+            elements: [AstTestFactory.integer(0)]));
+  }
+
+  void test_visitListLiteral2_withoutConst_withoutTypeArgs() {
+    _assertSource(
+        '[0]', astFactory.listLiteral2(elements: [AstTestFactory.integer(0)]));
+  }
+
+  void test_visitListLiteral2_withoutConst_withTypeArgs() {
+    _assertSource(
+        '<int>[0]',
+        astFactory.listLiteral2(
+            typeArguments: AstTestFactory.typeArgumentList(
+                [AstTestFactory.typeName4('int')]),
+            elements: [AstTestFactory.integer(0)]));
+  }
+
   void test_visitListLiteral_const() {
     _assertSource("const []", AstTestFactory.listLiteral2(Keyword.CONST, null));
   }
@@ -2656,6 +3068,97 @@
         ]));
   }
 
+  void test_visitMapForElement() {
+    _assertSource(
+        "for (e in l) 'a' : 'b'",
+        astFactory.mapForElement(
+            forLoopParts: astFactory.forEachPartsWithIdentifier(
+                identifier: AstTestFactory.identifier3('e'),
+                iterable: AstTestFactory.identifier3('l')),
+            body: AstTestFactory.mapLiteralEntry3('a', 'b')));
+  }
+
+  void test_visitMapIfElement_else() {
+    _assertSource(
+        "if (b) 'a' : 'b' else 'c' : 'd'",
+        astFactory.mapIfElement(
+            condition: AstTestFactory.identifier3('b'),
+            thenElement: AstTestFactory.mapLiteralEntry3('a', 'b'),
+            elseElement: AstTestFactory.mapLiteralEntry3('c', 'd')));
+  }
+
+  void test_visitMapIfElement_then() {
+    _assertSource(
+        "if (b) 'a' : 'b'",
+        astFactory.mapIfElement(
+            condition: AstTestFactory.identifier3('b'),
+            thenElement: AstTestFactory.mapLiteralEntry3('a', 'b')));
+  }
+
+  void test_visitMapLiteral2_complex() {
+    _assertSource(
+        "<String, String>{'a' : 'b', for (c in d) 'e' : 'f', if (g) 'h' : 'i', ...{'j' : 'k'}}",
+        astFactory.mapLiteral2(
+            typeArguments: AstTestFactory.typeArgumentList([
+              AstTestFactory.typeName4('String'),
+              AstTestFactory.typeName4('String')
+            ]),
+            entries: [
+              AstTestFactory.mapLiteralEntry3('a', 'b'),
+              astFactory.mapForElement(
+                  forLoopParts: astFactory.forEachPartsWithIdentifier(
+                      identifier: AstTestFactory.identifier3('c'),
+                      iterable: AstTestFactory.identifier3('d')),
+                  body: AstTestFactory.mapLiteralEntry3('e', 'f')),
+              astFactory.mapIfElement(
+                  condition: AstTestFactory.identifier3('g'),
+                  thenElement: AstTestFactory.mapLiteralEntry3('h', 'i')),
+              astFactory.spreadElement(
+                  spreadOperator: TokenFactory.tokenFromType(
+                      TokenType.PERIOD_PERIOD_PERIOD),
+                  expression: astFactory.mapLiteral2(
+                      entries: [AstTestFactory.mapLiteralEntry3('j', 'k')]))
+            ]));
+  }
+
+  void test_visitMapLiteral2_withConst_withoutTypeArgs() {
+    _assertSource(
+        "const {'a' : 'b'}",
+        astFactory.mapLiteral2(
+            constKeyword: TokenFactory.tokenFromKeyword(Keyword.CONST),
+            entries: [AstTestFactory.mapLiteralEntry3('a', 'b')]));
+  }
+
+  void test_visitMapLiteral2_withConst_withTypeArgs() {
+    _assertSource(
+        "const <String, String>{'a' : 'b'}",
+        astFactory.mapLiteral2(
+            constKeyword: TokenFactory.tokenFromKeyword(Keyword.CONST),
+            typeArguments: AstTestFactory.typeArgumentList([
+              AstTestFactory.typeName4('String'),
+              AstTestFactory.typeName4('String')
+            ]),
+            entries: [AstTestFactory.mapLiteralEntry3('a', 'b')]));
+  }
+
+  void test_visitMapLiteral2_withoutConst_withoutTypeArgs() {
+    _assertSource(
+        "{'a' : 'b'}",
+        astFactory
+            .mapLiteral2(entries: [AstTestFactory.mapLiteralEntry3('a', 'b')]));
+  }
+
+  void test_visitMapLiteral2_withoutConst_withTypeArgs() {
+    _assertSource(
+        "<String, String>{'a' : 'b'}",
+        astFactory.mapLiteral2(
+            typeArguments: AstTestFactory.typeArgumentList([
+              AstTestFactory.typeName4('String'),
+              AstTestFactory.typeName4('String')
+            ]),
+            entries: [AstTestFactory.mapLiteralEntry3('a', 'b')]));
+  }
+
   void test_visitMapLiteral_const() {
     _assertSource("const {}", AstTestFactory.mapLiteral(Keyword.CONST, null));
   }
@@ -3034,6 +3537,62 @@
     _assertSource(scriptTag, AstTestFactory.scriptTag(scriptTag));
   }
 
+  void test_visitSetLiteral2_complex() {
+    _assertSource(
+        '<int>{0, for (e in l) 0, if (b) 1, ...[0]}',
+        astFactory.setLiteral2(
+            typeArguments: AstTestFactory.typeArgumentList(
+                [AstTestFactory.typeName4('int')]),
+            elements: [
+              AstTestFactory.integer(0),
+              astFactory.collectionForElement(
+                  forLoopParts: astFactory.forEachPartsWithIdentifier(
+                      identifier: AstTestFactory.identifier3('e'),
+                      iterable: AstTestFactory.identifier3('l')),
+                  body: AstTestFactory.integer(0)),
+              astFactory.collectionIfElement(
+                  condition: AstTestFactory.identifier3('b'),
+                  thenElement: AstTestFactory.integer(1)),
+              astFactory.spreadElement(
+                  spreadOperator: TokenFactory.tokenFromType(
+                      TokenType.PERIOD_PERIOD_PERIOD),
+                  expression: astFactory
+                      .listLiteral2(elements: [AstTestFactory.integer(0)]))
+            ]));
+  }
+
+  void test_visitSetLiteral2_withConst_withoutTypeArgs() {
+    _assertSource(
+        'const {0}',
+        astFactory.setLiteral2(
+            constKeyword: TokenFactory.tokenFromKeyword(Keyword.CONST),
+            elements: [AstTestFactory.integer(0)]));
+  }
+
+  void test_visitSetLiteral2_withConst_withTypeArgs() {
+    _assertSource(
+        'const <int>{0}',
+        astFactory.setLiteral2(
+            constKeyword: TokenFactory.tokenFromKeyword(Keyword.CONST),
+            typeArguments: AstTestFactory.typeArgumentList(
+                [AstTestFactory.typeName4('int')]),
+            elements: [AstTestFactory.integer(0)]));
+  }
+
+  void test_visitSetLiteral2_withoutConst_withoutTypeArgs() {
+    _assertSource(
+        '{0}', astFactory.setLiteral2(elements: [AstTestFactory.integer(0)]));
+  }
+
+  void test_visitSetLiteral2_withoutConst_withTypeArgs() {
+    _assertSource(
+        '<int>{0}',
+        astFactory.setLiteral2(
+            typeArguments: AstTestFactory.typeArgumentList(
+                [AstTestFactory.typeName4('int')]),
+            elements: [AstTestFactory.integer(0)]));
+  }
+
   void test_visitSimpleFormalParameter_annotation() {
     SimpleFormalParameter parameter =
         AstTestFactory.simpleFormalParameter3('x');
@@ -3077,6 +3636,29 @@
     _assertSource("'a'", AstTestFactory.string2("a"));
   }
 
+  void test_visitSpreadElement_nonNullable() {
+    _assertSource(
+        '...[0]',
+        astFactory.spreadElement(
+            spreadOperator:
+                TokenFactory.tokenFromType(TokenType.PERIOD_PERIOD_PERIOD),
+            expression: astFactory
+                .listLiteral2(elements: [AstTestFactory.integer(0)])));
+  }
+
+  @failingTest
+  void test_visitSpreadElement_nullable() {
+    // TODO(brianwilkerson) Replace the token type below when there is one for
+    //  '...?'.
+    _assertSource(
+        '...?[0]',
+        astFactory.spreadElement(
+            spreadOperator:
+                TokenFactory.tokenFromType(TokenType.PERIOD_PERIOD_PERIOD),
+            expression: astFactory
+                .listLiteral2(elements: [AstTestFactory.integer(0)])));
+  }
+
   void test_visitStringInterpolation() {
     _assertSource(
         "'a\${e}b'",
@@ -3857,6 +4439,33 @@
     _assertSource("@deprecated class C = S with M1;", declaration);
   }
 
+  void test_visitCollectionForElement() {
+    _assertSource(
+        'for (e in l) 0',
+        astFactory.collectionForElement(
+            forLoopParts: astFactory.forEachPartsWithIdentifier(
+                identifier: AstTestFactory.identifier3('e'),
+                iterable: AstTestFactory.identifier3('l')),
+            body: AstTestFactory.integer(0)));
+  }
+
+  void test_visitCollectionIfElement_else() {
+    _assertSource(
+        'if (b) 1 else 0',
+        astFactory.collectionIfElement(
+            condition: AstTestFactory.identifier3('b'),
+            thenElement: AstTestFactory.integer(1),
+            elseElement: AstTestFactory.integer(0)));
+  }
+
+  void test_visitCollectionIfElement_then() {
+    _assertSource(
+        'if (b) 1',
+        astFactory.collectionIfElement(
+            condition: AstTestFactory.identifier3('b'),
+            thenElement: AstTestFactory.integer(1)));
+  }
+
   void test_visitComment() {
     _assertSource(
         "",
@@ -4289,6 +4898,22 @@
     _assertSource("covariant A this.a", expected);
   }
 
+  void test_visitForEachPartsWithDeclaration() {
+    _assertSource(
+        'var e in l',
+        astFactory.forEachPartsWithDeclaration(
+            loopVariable: AstTestFactory.declaredIdentifier3('e'),
+            iterable: AstTestFactory.identifier3('l')));
+  }
+
+  void test_visitForEachPartsWithIdentifier() {
+    _assertSource(
+        'e in l',
+        astFactory.forEachPartsWithIdentifier(
+            identifier: AstTestFactory.identifier3('e'),
+            iterable: AstTestFactory.identifier3('l')));
+  }
+
   void test_visitForEachStatement_declared() {
     _assertSource(
         "for (var a in b) {}",
@@ -4494,6 +5119,36 @@
         ]));
   }
 
+  void test_visitForPartsWithDeclarations() {
+    _assertSource(
+        'var v; b; u',
+        astFactory.forPartsWithDeclarations(
+            variables: AstTestFactory.variableDeclarationList2(
+                Keyword.VAR, [AstTestFactory.variableDeclaration('v')]),
+            condition: AstTestFactory.identifier3('b'),
+            updaters: [AstTestFactory.identifier3('u')]));
+  }
+
+  void test_visitForPartsWithExpression() {
+    _assertSource(
+        'v; b; u',
+        astFactory.forPartsWithExpression(
+            initialization: AstTestFactory.identifier3('v'),
+            condition: AstTestFactory.identifier3('b'),
+            updaters: [AstTestFactory.identifier3('u')]));
+  }
+
+  void test_visitForStatement2() {
+    _assertSource(
+        'for (e in l) s;',
+        astFactory.forStatement2(
+            forLoopParts: astFactory.forEachPartsWithIdentifier(
+                identifier: AstTestFactory.identifier3('e'),
+                iterable: AstTestFactory.identifier3('l')),
+            body: AstTestFactory.expressionStatement(
+                AstTestFactory.identifier3('s'))));
+  }
+
   void test_visitForStatement_c() {
     _assertSource(
         "for (; c;) {}",
@@ -5046,6 +5701,62 @@
         AstTestFactory.libraryIdentifier([AstTestFactory.identifier3("a")]));
   }
 
+  void test_visitListLiteral2_complex() {
+    _assertSource(
+        '<int>[0, for (e in l) 0, if (b) 1, ...[0]]',
+        astFactory.listLiteral2(
+            typeArguments: AstTestFactory.typeArgumentList(
+                [AstTestFactory.typeName4('int')]),
+            elements: [
+              AstTestFactory.integer(0),
+              astFactory.collectionForElement(
+                  forLoopParts: astFactory.forEachPartsWithIdentifier(
+                      identifier: AstTestFactory.identifier3('e'),
+                      iterable: AstTestFactory.identifier3('l')),
+                  body: AstTestFactory.integer(0)),
+              astFactory.collectionIfElement(
+                  condition: AstTestFactory.identifier3('b'),
+                  thenElement: AstTestFactory.integer(1)),
+              astFactory.spreadElement(
+                  spreadOperator: TokenFactory.tokenFromType(
+                      TokenType.PERIOD_PERIOD_PERIOD),
+                  expression: astFactory
+                      .listLiteral2(elements: [AstTestFactory.integer(0)]))
+            ]));
+  }
+
+  void test_visitListLiteral2_withConst_withoutTypeArgs() {
+    _assertSource(
+        'const [0]',
+        astFactory.listLiteral2(
+            constKeyword: TokenFactory.tokenFromKeyword(Keyword.CONST),
+            elements: [AstTestFactory.integer(0)]));
+  }
+
+  void test_visitListLiteral2_withConst_withTypeArgs() {
+    _assertSource(
+        'const <int>[0]',
+        astFactory.listLiteral2(
+            constKeyword: TokenFactory.tokenFromKeyword(Keyword.CONST),
+            typeArguments: AstTestFactory.typeArgumentList(
+                [AstTestFactory.typeName4('int')]),
+            elements: [AstTestFactory.integer(0)]));
+  }
+
+  void test_visitListLiteral2_withoutConst_withoutTypeArgs() {
+    _assertSource(
+        '[0]', astFactory.listLiteral2(elements: [AstTestFactory.integer(0)]));
+  }
+
+  void test_visitListLiteral2_withoutConst_withTypeArgs() {
+    _assertSource(
+        '<int>[0]',
+        astFactory.listLiteral2(
+            typeArguments: AstTestFactory.typeArgumentList(
+                [AstTestFactory.typeName4('int')]),
+            elements: [AstTestFactory.integer(0)]));
+  }
+
   void test_visitListLiteral_const() {
     _assertSource("const []", AstTestFactory.listLiteral2(Keyword.CONST, null));
   }
@@ -5064,6 +5775,97 @@
         ]));
   }
 
+  void test_visitMapForElement() {
+    _assertSource(
+        "for (e in l) 'a' : 'b'",
+        astFactory.mapForElement(
+            forLoopParts: astFactory.forEachPartsWithIdentifier(
+                identifier: AstTestFactory.identifier3('e'),
+                iterable: AstTestFactory.identifier3('l')),
+            body: AstTestFactory.mapLiteralEntry3('a', 'b')));
+  }
+
+  void test_visitMapIfElement_else() {
+    _assertSource(
+        "if (b) 'a' : 'b' else 'c' : 'd'",
+        astFactory.mapIfElement(
+            condition: AstTestFactory.identifier3('b'),
+            thenElement: AstTestFactory.mapLiteralEntry3('a', 'b'),
+            elseElement: AstTestFactory.mapLiteralEntry3('c', 'd')));
+  }
+
+  void test_visitMapIfElement_then() {
+    _assertSource(
+        "if (b) 'a' : 'b'",
+        astFactory.mapIfElement(
+            condition: AstTestFactory.identifier3('b'),
+            thenElement: AstTestFactory.mapLiteralEntry3('a', 'b')));
+  }
+
+  void test_visitMapLiteral2_complex() {
+    _assertSource(
+        "<String, String>{'a' : 'b', for (c in d) 'e' : 'f', if (g) 'h' : 'i', ...{'j' : 'k'}}",
+        astFactory.mapLiteral2(
+            typeArguments: AstTestFactory.typeArgumentList([
+              AstTestFactory.typeName4('String'),
+              AstTestFactory.typeName4('String')
+            ]),
+            entries: [
+              AstTestFactory.mapLiteralEntry3('a', 'b'),
+              astFactory.mapForElement(
+                  forLoopParts: astFactory.forEachPartsWithIdentifier(
+                      identifier: AstTestFactory.identifier3('c'),
+                      iterable: AstTestFactory.identifier3('d')),
+                  body: AstTestFactory.mapLiteralEntry3('e', 'f')),
+              astFactory.mapIfElement(
+                  condition: AstTestFactory.identifier3('g'),
+                  thenElement: AstTestFactory.mapLiteralEntry3('h', 'i')),
+              astFactory.spreadElement(
+                  spreadOperator: TokenFactory.tokenFromType(
+                      TokenType.PERIOD_PERIOD_PERIOD),
+                  expression: astFactory.mapLiteral2(
+                      entries: [AstTestFactory.mapLiteralEntry3('j', 'k')]))
+            ]));
+  }
+
+  void test_visitMapLiteral2_withConst_withoutTypeArgs() {
+    _assertSource(
+        "const {'a' : 'b'}",
+        astFactory.mapLiteral2(
+            constKeyword: TokenFactory.tokenFromKeyword(Keyword.CONST),
+            entries: [AstTestFactory.mapLiteralEntry3('a', 'b')]));
+  }
+
+  void test_visitMapLiteral2_withConst_withTypeArgs() {
+    _assertSource(
+        "const <String, String>{'a' : 'b'}",
+        astFactory.mapLiteral2(
+            constKeyword: TokenFactory.tokenFromKeyword(Keyword.CONST),
+            typeArguments: AstTestFactory.typeArgumentList([
+              AstTestFactory.typeName4('String'),
+              AstTestFactory.typeName4('String')
+            ]),
+            entries: [AstTestFactory.mapLiteralEntry3('a', 'b')]));
+  }
+
+  void test_visitMapLiteral2_withoutConst_withoutTypeArgs() {
+    _assertSource(
+        "{'a' : 'b'}",
+        astFactory
+            .mapLiteral2(entries: [AstTestFactory.mapLiteralEntry3('a', 'b')]));
+  }
+
+  void test_visitMapLiteral2_withoutConst_withTypeArgs() {
+    _assertSource(
+        "<String, String>{'a' : 'b'}",
+        astFactory.mapLiteral2(
+            typeArguments: AstTestFactory.typeArgumentList([
+              AstTestFactory.typeName4('String'),
+              AstTestFactory.typeName4('String')
+            ]),
+            entries: [AstTestFactory.mapLiteralEntry3('a', 'b')]));
+  }
+
   void test_visitMapLiteral_const() {
     _assertSource("const {}", AstTestFactory.mapLiteral(Keyword.CONST, null));
   }
@@ -5433,6 +6235,62 @@
     _assertSource(scriptTag, AstTestFactory.scriptTag(scriptTag));
   }
 
+  void test_visitSetLiteral2_complex() {
+    _assertSource(
+        '<int>{0, for (e in l) 0, if (b) 1, ...[0]}',
+        astFactory.setLiteral2(
+            typeArguments: AstTestFactory.typeArgumentList(
+                [AstTestFactory.typeName4('int')]),
+            elements: [
+              AstTestFactory.integer(0),
+              astFactory.collectionForElement(
+                  forLoopParts: astFactory.forEachPartsWithIdentifier(
+                      identifier: AstTestFactory.identifier3('e'),
+                      iterable: AstTestFactory.identifier3('l')),
+                  body: AstTestFactory.integer(0)),
+              astFactory.collectionIfElement(
+                  condition: AstTestFactory.identifier3('b'),
+                  thenElement: AstTestFactory.integer(1)),
+              astFactory.spreadElement(
+                  spreadOperator: TokenFactory.tokenFromType(
+                      TokenType.PERIOD_PERIOD_PERIOD),
+                  expression: astFactory
+                      .listLiteral2(elements: [AstTestFactory.integer(0)]))
+            ]));
+  }
+
+  void test_visitSetLiteral2_withConst_withoutTypeArgs() {
+    _assertSource(
+        'const {0}',
+        astFactory.setLiteral2(
+            constKeyword: TokenFactory.tokenFromKeyword(Keyword.CONST),
+            elements: [AstTestFactory.integer(0)]));
+  }
+
+  void test_visitSetLiteral2_withConst_withTypeArgs() {
+    _assertSource(
+        'const <int>{0}',
+        astFactory.setLiteral2(
+            constKeyword: TokenFactory.tokenFromKeyword(Keyword.CONST),
+            typeArguments: AstTestFactory.typeArgumentList(
+                [AstTestFactory.typeName4('int')]),
+            elements: [AstTestFactory.integer(0)]));
+  }
+
+  void test_visitSetLiteral2_withoutConst_withoutTypeArgs() {
+    _assertSource(
+        '{0}', astFactory.setLiteral2(elements: [AstTestFactory.integer(0)]));
+  }
+
+  void test_visitSetLiteral2_withoutConst_withTypeArgs() {
+    _assertSource(
+        '<int>{0}',
+        astFactory.setLiteral2(
+            typeArguments: AstTestFactory.typeArgumentList(
+                [AstTestFactory.typeName4('int')]),
+            elements: [AstTestFactory.integer(0)]));
+  }
+
   void test_visitSimpleFormalParameter_annotation() {
     SimpleFormalParameter parameter =
         AstTestFactory.simpleFormalParameter3('x');
@@ -5476,6 +6334,29 @@
     _assertSource("'a'", AstTestFactory.string2("a"));
   }
 
+  void test_visitSpreadElement_nonNullable() {
+    _assertSource(
+        '...[0]',
+        astFactory.spreadElement(
+            spreadOperator:
+                TokenFactory.tokenFromType(TokenType.PERIOD_PERIOD_PERIOD),
+            expression: astFactory
+                .listLiteral2(elements: [AstTestFactory.integer(0)])));
+  }
+
+  @failingTest
+  void test_visitSpreadElement_nullable() {
+    // TODO(brianwilkerson) Replace the token type below when there is one for
+    //  '...?'.
+    _assertSource(
+        '...?[0]',
+        astFactory.spreadElement(
+            spreadOperator:
+                TokenFactory.tokenFromType(TokenType.PERIOD_PERIOD_PERIOD),
+            expression: astFactory
+                .listLiteral2(elements: [AstTestFactory.integer(0)])));
+  }
+
   void test_visitStringInterpolation() {
     _assertSource(
         "'a\${e}b'",
diff --git a/pkg/analyzer/test/src/dart/constant/evaluation_test.dart b/pkg/analyzer/test/src/dart/constant/evaluation_test.dart
index 94176f6..ca9e41b 100644
--- a/pkg/analyzer/test/src/dart/constant/evaluation_test.dart
+++ b/pkg/analyzer/test/src/dart/constant/evaluation_test.dart
@@ -29,9 +29,13 @@
     defineReflectiveTests(ConstantVisitorTest);
     defineReflectiveTests(ConstantVisitorTest_Driver);
     defineReflectiveTests(ConstantVisitorWithConstantUpdate2018Test);
+    defineReflectiveTests(
+        ConstantVisitorWithFlowControlAndSpreadCollectionsTest);
   });
 }
 
+/// TODO(paulberry): migrate this test away from the task model.
+/// See dartbug.com/35734.
 @reflectiveTest
 class ConstantVisitorTest extends ConstantVisitorTestSupport {
   test_visitAsExpression_instanceOfSameClass() async {
@@ -798,6 +802,9 @@
 }
 
 class ConstantVisitorTestSupport extends ResolverTestCase {
+  @override
+  List<String> get enabledExperiments => [];
+
   DartObjectImpl _evaluateConstant(CompilationUnit compilationUnit, String name,
       {List<ErrorCode> errorCodes,
       List<String> experiments,
@@ -808,9 +815,7 @@
         findTopLevelConstantExpression(compilationUnit, name);
 
     AnalysisOptionsImpl options = new AnalysisOptionsImpl();
-    if (experiments != null) {
-      options..enabledExperiments = experiments;
-    }
+    options.enabledExperiments = experiments ?? enabledExperiments;
 
     GatheringErrorListener errorListener = new GatheringErrorListener();
     ErrorReporter errorReporter = new ErrorReporter(errorListener, source);
@@ -841,8 +846,7 @@
     CompilationUnit compilationUnit = await resolveSource('''
 const c = 0xFFFFFFFF >>> 8;
 ''');
-    DartObjectImpl result = _evaluateConstant(compilationUnit, 'c',
-        experiments: [EnableString.constant_update_2018]);
+    DartObjectImpl result = _evaluateConstant(compilationUnit, 'c');
     expect(result.type, typeProvider.intType);
     expect(result.toIntValue(), 0xFFFFFF);
   }
@@ -851,8 +855,7 @@
     CompilationUnit compilationUnit = await resolveSource('''
 const c = 0xFFFFFFFF >>> 33;
 ''');
-    DartObjectImpl result = _evaluateConstant(compilationUnit, 'c',
-        experiments: [EnableString.constant_update_2018]);
+    DartObjectImpl result = _evaluateConstant(compilationUnit, 'c');
     expect(result.type, typeProvider.intType);
     expect(result.toIntValue(), 0);
   }
@@ -862,27 +865,23 @@
 const c = 0xFFFFFFFF >>> -2;
 ''');
     _evaluateConstant(compilationUnit, 'c',
-        errorCodes: [CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION],
-        experiments: [EnableString.constant_update_2018]);
+        errorCodes: [CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION]);
   }
 
   test_visitBinaryExpression_gtGtGt_negative_zeroBits() async {
     CompilationUnit compilationUnit = await resolveSource('''
 const c = 0xFFFFFFFF >>> 0;
 ''');
-    DartObjectImpl result = _evaluateConstant(compilationUnit, 'c',
-        experiments: [EnableString.constant_update_2018]);
+    DartObjectImpl result = _evaluateConstant(compilationUnit, 'c');
     expect(result.type, typeProvider.intType);
     expect(result.toIntValue(), 0xFFFFFFFF);
   }
 
-//  @soloTest
   test_visitBinaryExpression_gtGtGt_positive_fewerBits() async {
     CompilationUnit compilationUnit = await resolveSource('''
 const c = 0xFF >>> 3;
 ''');
-    DartObjectImpl result = _evaluateConstant(compilationUnit, 'c',
-        experiments: [EnableString.constant_update_2018]);
+    DartObjectImpl result = _evaluateConstant(compilationUnit, 'c');
     expect(result.type, typeProvider.intType);
     expect(result.toIntValue(), 0x1F);
   }
@@ -891,8 +890,7 @@
     CompilationUnit compilationUnit = await resolveSource('''
 const c = 0xFF >>> 9;
 ''');
-    DartObjectImpl result = _evaluateConstant(compilationUnit, 'c',
-        experiments: [EnableString.constant_update_2018]);
+    DartObjectImpl result = _evaluateConstant(compilationUnit, 'c');
     expect(result.type, typeProvider.intType);
     expect(result.toIntValue(), 0);
   }
@@ -902,17 +900,243 @@
 const c = 0xFF >>> -2;
 ''');
     _evaluateConstant(compilationUnit, 'c',
-        errorCodes: [CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION],
-        experiments: [EnableString.constant_update_2018]);
+        errorCodes: [CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION]);
   }
 
   test_visitBinaryExpression_gtGtGt_positive_zeroBits() async {
     CompilationUnit compilationUnit = await resolveSource('''
 const c = 0xFF >>> 0;
 ''');
-    DartObjectImpl result = _evaluateConstant(compilationUnit, 'c',
-        experiments: [EnableString.constant_update_2018]);
+    DartObjectImpl result = _evaluateConstant(compilationUnit, 'c');
     expect(result.type, typeProvider.intType);
     expect(result.toIntValue(), 0xFF);
   }
 }
+
+@reflectiveTest
+class ConstantVisitorWithFlowControlAndSpreadCollectionsTest
+    extends ConstantVisitorTestSupport {
+  @override
+  List<String> get enabledExperiments => [
+        EnableString.control_flow_collections,
+        EnableString.set_literals,
+        EnableString.spread_collections
+      ];
+
+  bool get enableNewAnalysisDriver => true;
+
+  test_listLiteral_nested() async {
+    CompilationUnit compilationUnit = await resolveSource('''
+const c = [1, if (1 > 0) if (2 > 1) 2, 3];
+''');
+    DartObjectImpl result = _evaluateConstant(compilationUnit, 'c');
+    // The expected type ought to be `List<int>`, but type inference isn't yet
+    // implemented.
+    expect(
+        result.type, typeProvider.listType.instantiate([typeProvider.intType]));
+    expect(result.toListValue().map((e) => e.toIntValue()), [1, 2, 3]);
+  }
+
+  test_listLiteral_withIf_false_withElse() async {
+    CompilationUnit compilationUnit = await resolveSource('''
+const c = [1, if (1 < 0) 2 else 3, 4];
+''');
+    DartObjectImpl result = _evaluateConstant(compilationUnit, 'c');
+    expect(
+        result.type, typeProvider.listType.instantiate([typeProvider.intType]));
+    expect(result.toListValue().map((e) => e.toIntValue()), [1, 3, 4]);
+  }
+
+  test_listLiteral_withIf_false_withoutElse() async {
+    CompilationUnit compilationUnit = await resolveSource('''
+const c = [1, if (1 < 0) 2, 3];
+''');
+    DartObjectImpl result = _evaluateConstant(compilationUnit, 'c');
+    expect(
+        result.type, typeProvider.listType.instantiate([typeProvider.intType]));
+    expect(result.toListValue().map((e) => e.toIntValue()), [1, 3]);
+  }
+
+  test_listLiteral_withIf_true_withElse() async {
+    CompilationUnit compilationUnit = await resolveSource('''
+const c = [1, if (1 > 0) 2 else 3, 4];
+''');
+    DartObjectImpl result = _evaluateConstant(compilationUnit, 'c');
+    expect(
+        result.type, typeProvider.listType.instantiate([typeProvider.intType]));
+    expect(result.toListValue().map((e) => e.toIntValue()), [1, 2, 4]);
+  }
+
+  test_listLiteral_withIf_true_withoutElse() async {
+    CompilationUnit compilationUnit = await resolveSource('''
+const c = [1, if (1 > 0) 2, 3];
+''');
+    DartObjectImpl result = _evaluateConstant(compilationUnit, 'c');
+    expect(
+        result.type, typeProvider.listType.instantiate([typeProvider.intType]));
+    expect(result.toListValue().map((e) => e.toIntValue()), [1, 2, 3]);
+  }
+
+  test_listLiteral_withSpread() async {
+    CompilationUnit compilationUnit = await resolveSource('''
+const c = [1, ...[2, 3], 4];
+''');
+    DartObjectImpl result = _evaluateConstant(compilationUnit, 'c');
+    expect(
+        result.type, typeProvider.listType.instantiate([typeProvider.intType]));
+    expect(result.toListValue().map((e) => e.toIntValue()), [1, 2, 3, 4]);
+  }
+
+  @failingTest
+  test_mapLiteral_nested() async {
+    // Fails because we're not yet parsing nested elements.
+    CompilationUnit compilationUnit = await resolveSource('''
+const c = {'a' : 1, if (1 > 0) if (2 > 1) {'b' : 2}, 'c' : 3};
+''');
+    DartObjectImpl result = _evaluateConstant(compilationUnit, 'c');
+    expect(
+        result.type,
+        typeProvider.mapType
+            .instantiate([typeProvider.intType, typeProvider.intType]));
+    Map<DartObject, DartObject> value = result.toMapValue();
+    expect(value.keys.map((e) => e.toStringValue()),
+        unorderedEquals(['a', 'b', 'c']));
+    expect(value.values.map((e) => e.toIntValue()), unorderedEquals([1, 2, 3]));
+  }
+
+  test_mapLiteral_withIf_false_withElse() async {
+    CompilationUnit compilationUnit = await resolveSource('''
+const c = {'a' : 1, if (1 < 0) 'b' : 2 else 'c' : 3, 'd' : 4};
+''');
+    DartObjectImpl result = _evaluateConstant(compilationUnit, 'c');
+    expect(
+        result.type,
+        typeProvider.mapType
+            .instantiate([typeProvider.stringType, typeProvider.intType]));
+    Map<DartObject, DartObject> value = result.toMapValue();
+    expect(value.keys.map((e) => e.toStringValue()),
+        unorderedEquals(['a', 'c', 'd']));
+    expect(value.values.map((e) => e.toIntValue()), unorderedEquals([1, 3, 4]));
+  }
+
+  test_mapLiteral_withIf_false_withoutElse() async {
+    CompilationUnit compilationUnit = await resolveSource('''
+const c = {'a' : 1, if (1 < 0) 'b' : 2, 'c' : 3};
+''');
+    DartObjectImpl result = _evaluateConstant(compilationUnit, 'c');
+    expect(
+        result.type,
+        typeProvider.mapType
+            .instantiate([typeProvider.stringType, typeProvider.intType]));
+    Map<DartObject, DartObject> value = result.toMapValue();
+    expect(
+        value.keys.map((e) => e.toStringValue()), unorderedEquals(['a', 'c']));
+    expect(value.values.map((e) => e.toIntValue()), unorderedEquals([1, 3]));
+  }
+
+  test_mapLiteral_withIf_true_withElse() async {
+    CompilationUnit compilationUnit = await resolveSource('''
+const c = {'a' : 1, if (1 > 0) 'b' : 2 else 'c' : 3, 'd' : 4};
+''');
+    DartObjectImpl result = _evaluateConstant(compilationUnit, 'c');
+    expect(
+        result.type,
+        typeProvider.mapType
+            .instantiate([typeProvider.stringType, typeProvider.intType]));
+    Map<DartObject, DartObject> value = result.toMapValue();
+    expect(value.keys.map((e) => e.toStringValue()),
+        unorderedEquals(['a', 'b', 'd']));
+    expect(value.values.map((e) => e.toIntValue()), unorderedEquals([1, 2, 4]));
+  }
+
+  test_mapLiteral_withIf_true_withoutElse() async {
+    CompilationUnit compilationUnit = await resolveSource('''
+const c = {'a' : 1, if (1 > 0) 'b' : 2, 'c' : 3};
+''');
+    DartObjectImpl result = _evaluateConstant(compilationUnit, 'c');
+    expect(
+        result.type,
+        typeProvider.mapType
+            .instantiate([typeProvider.stringType, typeProvider.intType]));
+    Map<DartObject, DartObject> value = result.toMapValue();
+    expect(value.keys.map((e) => e.toStringValue()),
+        unorderedEquals(['a', 'b', 'c']));
+    expect(value.values.map((e) => e.toIntValue()), unorderedEquals([1, 2, 3]));
+  }
+
+  test_mapLiteral_withSpread() async {
+    CompilationUnit compilationUnit = await resolveSource('''
+const c = {'a' : 1, ...{'b' : 2, 'c' : 3}, 'd' : 4};
+''');
+    DartObjectImpl result = _evaluateConstant(compilationUnit, 'c');
+    expect(
+        result.type,
+        typeProvider.mapType
+            .instantiate([typeProvider.stringType, typeProvider.intType]));
+    Map<DartObject, DartObject> value = result.toMapValue();
+    expect(value.keys.map((e) => e.toStringValue()),
+        unorderedEquals(['a', 'b', 'c', 'd']));
+    expect(
+        value.values.map((e) => e.toIntValue()), unorderedEquals([1, 2, 3, 4]));
+  }
+
+  test_setLiteral_nested() async {
+    CompilationUnit compilationUnit = await resolveSource('''
+const c = {1, if (1 > 0) if (2 > 1) 2, 3};
+''');
+    DartObjectImpl result = _evaluateConstant(compilationUnit, 'c');
+    expect(
+        result.type, typeProvider.setType.instantiate([typeProvider.intType]));
+    expect(result.toSetValue().map((e) => e.toIntValue()), [1, 2, 3]);
+  }
+
+  test_setLiteral_withIf_false_withElse() async {
+    CompilationUnit compilationUnit = await resolveSource('''
+const c = {1, if (1 < 0) 2 else 3, 4};
+''');
+    DartObjectImpl result = _evaluateConstant(compilationUnit, 'c');
+    expect(
+        result.type, typeProvider.setType.instantiate([typeProvider.intType]));
+    expect(result.toSetValue().map((e) => e.toIntValue()), [1, 3, 4]);
+  }
+
+  test_setLiteral_withIf_false_withoutElse() async {
+    CompilationUnit compilationUnit = await resolveSource('''
+const c = {1, if (1 < 0) 2, 3};
+''');
+    DartObjectImpl result = _evaluateConstant(compilationUnit, 'c');
+    expect(
+        result.type, typeProvider.setType.instantiate([typeProvider.intType]));
+    expect(result.toSetValue().map((e) => e.toIntValue()), [1, 3]);
+  }
+
+  test_setLiteral_withIf_true_withElse() async {
+    CompilationUnit compilationUnit = await resolveSource('''
+const c = {1, if (1 > 0) 2 else 3, 4};
+''');
+    DartObjectImpl result = _evaluateConstant(compilationUnit, 'c');
+    expect(
+        result.type, typeProvider.setType.instantiate([typeProvider.intType]));
+    expect(result.toSetValue().map((e) => e.toIntValue()), [1, 2, 4]);
+  }
+
+  test_setLiteral_withIf_true_withoutElse() async {
+    CompilationUnit compilationUnit = await resolveSource('''
+const c = {1, if (1 > 0) 2, 3};
+''');
+    DartObjectImpl result = _evaluateConstant(compilationUnit, 'c');
+    expect(
+        result.type, typeProvider.setType.instantiate([typeProvider.intType]));
+    expect(result.toSetValue().map((e) => e.toIntValue()), [1, 2, 3]);
+  }
+
+  test_setLiteral_withSpread() async {
+    CompilationUnit compilationUnit = await resolveSource('''
+const c = {1, ...{2, 3}, 4};
+''');
+    DartObjectImpl result = _evaluateConstant(compilationUnit, 'c');
+    expect(
+        result.type, typeProvider.setType.instantiate([typeProvider.intType]));
+    expect(result.toSetValue().map((e) => e.toIntValue()), [1, 2, 3, 4]);
+  }
+}
diff --git a/pkg/analyzer/test/src/dart/element/element_test.dart b/pkg/analyzer/test/src/dart/element/element_test.dart
index dbebb31..0ef1e17 100644
--- a/pkg/analyzer/test/src/dart/element/element_test.dart
+++ b/pkg/analyzer/test/src/dart/element/element_test.dart
@@ -45,6 +45,8 @@
   });
 }
 
+/// TODO(paulberry): migrate this test away from the task model.
+/// See dartbug.com/35734.
 @reflectiveTest
 class ClassElementImplTest extends EngineTestCase {
   @deprecated
@@ -1000,6 +1002,8 @@
   }
 }
 
+/// TODO(paulberry): migrate this test away from the task model.
+/// See dartbug.com/35734.
 @reflectiveTest
 class ElementAnnotationImplTest extends ResolverTestCase {
   void test_computeConstantValue() {
@@ -1194,6 +1198,8 @@
   }
 }
 
+/// TODO(paulberry): migrate this test away from the task model.
+/// See dartbug.com/35734.
 @reflectiveTest
 class FieldElementImplTest extends EngineTestCase {
   @deprecated
@@ -3800,6 +3806,8 @@
 @reflectiveTest
 class LocalVariableElementImplTest extends EngineTestCase {}
 
+/// TODO(paulberry): migrate this test away from the task model.
+/// See dartbug.com/35734.
 @reflectiveTest
 class MethodElementImplTest extends EngineTestCase {
   @deprecated
@@ -3867,6 +3875,8 @@
   }
 }
 
+/// TODO(paulberry): migrate this test away from the task model.
+/// See dartbug.com/35734.
 @reflectiveTest
 class MethodMemberTest extends EngineTestCase {
   /**
@@ -3904,13 +3914,15 @@
     MethodElement AfElement = elementB.type
         .lookUpInheritedMethod("f", library: libraryElement, thisType: false);
     expect(
-        // ignore: deprecated_member_use
+        // ignore: deprecated_member_use_from_same_package
         BfElement.getReifiedType(objectType),
-        // ignore: deprecated_member_use
+        // ignore: deprecated_member_use_from_same_package
         equals(AfElement.getReifiedType(objectType)));
   }
 }
 
+/// TODO(paulberry): migrate this test away from the task model.
+/// See dartbug.com/35734.
 @reflectiveTest
 class ParameterElementImplTest extends EngineTestCase {
   @deprecated
@@ -4044,6 +4056,8 @@
   }
 }
 
+/// TODO(paulberry): migrate this test away from the task model.
+/// See dartbug.com/35734.
 @reflectiveTest
 class TopLevelVariableElementImplTest extends ResolverTestCase {
   void test_computeConstantValue() {
diff --git a/pkg/analyzer/test/src/dart/element/inheritance_manager2_test.dart b/pkg/analyzer/test/src/dart/element/inheritance_manager2_test.dart
index 60497d0..07fb0e8 100644
--- a/pkg/analyzer/test/src/dart/element/inheritance_manager2_test.dart
+++ b/pkg/analyzer/test/src/dart/element/inheritance_manager2_test.dart
@@ -417,6 +417,38 @@
     expect(_getSuper('B', 'foo'), isNull);
   }
 
+  test_getMember_super_forMixin_interface() async {
+    addTestFile('''
+abstract class A {
+  void foo();
+}
+
+mixin M implements A {}
+''');
+    await resolveTestFile();
+
+    expect(
+      _getSuperForElement(findElement.mixin('M'), 'foo'),
+      isNull,
+    );
+  }
+
+  test_getMember_super_forMixin_superclassConstraint() async {
+    addTestFile('''
+abstract class A {
+  void foo();
+}
+
+mixin M on A {}
+''');
+    await resolveTestFile();
+
+    expect(
+      _getSuperForElement(findElement.mixin('M'), 'foo'),
+      same(findElement.method('foo', of: 'A')),
+    );
+  }
+
   test_getMember_super_fromMixin() async {
     addTestFile('''
 mixin M {
@@ -496,7 +528,12 @@
   }
 
   ExecutableElement _getSuper(String className, String name) {
-    var type = findElement.class_(className).type;
+    var element = findElement.class_(className);
+    return _getSuperForElement(element, name);
+  }
+
+  ExecutableElement _getSuperForElement(ClassElement element, String name) {
+    var type = element.type;
     return manager
         .getMember(type, new Name(null, name), forSuper: true)
         ?.element;
diff --git a/pkg/analyzer/test/src/dart/resolution/assignment_test.dart b/pkg/analyzer/test/src/dart/resolution/assignment_test.dart
index a2abdd1..8e1a8a1 100644
--- a/pkg/analyzer/test/src/dart/resolution/assignment_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/assignment_test.dart
@@ -9,12 +9,10 @@
 
 import 'driver_resolution.dart';
 import 'resolution.dart';
-import 'task_resolution.dart';
 
 main() {
   defineReflectiveSuite(() {
     defineReflectiveTests(AssignmentDriverResolutionTest);
-    defineReflectiveTests(AssignmentTaskResolutionTest);
   });
 }
 
@@ -1245,7 +1243,3 @@
     assertType(xRef, 'int');
   }
 }
-
-@reflectiveTest
-class AssignmentTaskResolutionTest extends TaskResolutionTest
-    with AssignmentResolutionMixin {}
diff --git a/pkg/analyzer/test/src/dart/resolution/class_alias_test.dart b/pkg/analyzer/test/src/dart/resolution/class_alias_test.dart
index 6a6388a..e97423c 100644
--- a/pkg/analyzer/test/src/dart/resolution/class_alias_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/class_alias_test.dart
@@ -6,12 +6,10 @@
 
 import 'driver_resolution.dart';
 import 'resolution.dart';
-import 'task_resolution.dart';
 
 main() {
   defineReflectiveSuite(() {
     defineReflectiveTests(ClassAliasDriverResolutionTest);
-    defineReflectiveTests(ClassAliasTaskResolutionTest);
   });
 }
 
@@ -130,7 +128,3 @@
     assertConstructors(findElement.class_('B'), ['B(E x, E y) → B<E>']);
   }
 }
-
-@reflectiveTest
-class ClassAliasTaskResolutionTest extends TaskResolutionTest
-    with ClassAliasResolutionMixin {}
diff --git a/pkg/analyzer/test/src/dart/resolution/class_test.dart b/pkg/analyzer/test/src/dart/resolution/class_test.dart
index efcec88..f8ce37a 100644
--- a/pkg/analyzer/test/src/dart/resolution/class_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/class_test.dart
@@ -8,12 +8,10 @@
 
 import 'driver_resolution.dart';
 import 'resolution.dart';
-import 'task_resolution.dart';
 
 main() {
   defineReflectiveSuite(() {
     defineReflectiveTests(ClassDriverResolutionTest);
-    defineReflectiveTests(ClassTaskResolutionTest);
   });
 }
 
@@ -1681,17 +1679,3 @@
     assertTestErrors([StaticTypeWarningCode.UNDEFINED_SUPER_SETTER]);
   }
 }
-
-@reflectiveTest
-class ClassTaskResolutionTest extends TaskResolutionTest
-    with ClassResolutionMixin {
-  @failingTest
-  test_conflictingGenericInterfaces_simple() {
-    return super.test_conflictingGenericInterfaces_simple();
-  }
-
-  @failingTest
-  test_conflictingGenericInterfaces_viaMixin() {
-    return super.test_conflictingGenericInterfaces_viaMixin();
-  }
-}
diff --git a/pkg/analyzer/test/src/dart/resolution/comment_test.dart b/pkg/analyzer/test/src/dart/resolution/comment_test.dart
index 5371eac..8fba266 100644
--- a/pkg/analyzer/test/src/dart/resolution/comment_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/comment_test.dart
@@ -6,12 +6,10 @@
 
 import 'driver_resolution.dart';
 import 'resolution.dart';
-import 'task_resolution.dart';
 
 main() {
   defineReflectiveSuite(() {
     defineReflectiveTests(CommentDriverResolutionTest);
-    defineReflectiveTests(CommentTaskResolutionTest);
   });
 }
 
@@ -255,7 +253,3 @@
     assertElement(findNode.simple('x] in B'), x);
   }
 }
-
-@reflectiveTest
-class CommentTaskResolutionTest extends TaskResolutionTest
-    with ClassAliasResolutionMixin {}
diff --git a/pkg/analyzer/test/src/dart/resolution/constant_test.dart b/pkg/analyzer/test/src/dart/resolution/constant_test.dart
index 4ba17ed..4fde7c2 100644
--- a/pkg/analyzer/test/src/dart/resolution/constant_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/constant_test.dart
@@ -9,12 +9,10 @@
 
 import 'driver_resolution.dart';
 import 'resolution.dart';
-import 'task_resolution.dart';
 
 main() {
   defineReflectiveSuite(() {
     defineReflectiveTests(ConstantDriverTest);
-    defineReflectiveTests(ConstantTaskTest);
   });
 }
 
@@ -151,6 +149,3 @@
     ]);
   }
 }
-
-@reflectiveTest
-class ConstantTaskTest extends TaskResolutionTest with ConstantMixin {}
diff --git a/pkg/analyzer/test/src/dart/resolution/definite_assignment_test.dart b/pkg/analyzer/test/src/dart/resolution/definite_assignment_test.dart
index c9d840d..48a15c7 100644
--- a/pkg/analyzer/test/src/dart/resolution/definite_assignment_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/definite_assignment_test.dart
@@ -1357,6 +1357,42 @@
   }
 
   @override
+  void visitForStatement2(ForStatement2 node) {
+    var parts = node.forLoopParts;
+    VariableDeclarationList variables;
+    Expression initialization;
+    Expression condition;
+    Expression iterable;
+    NodeList<Expression> updaters;
+    if (parts is ForPartsWithDeclarations) {
+      variables = parts.variables;
+      condition = parts.condition;
+      updaters = parts.updaters;
+    } else if (parts is ForPartsWithExpression) {
+      initialization = parts.initialization;
+      condition = parts.condition;
+      updaters = parts.updaters;
+    } else if (parts is ForEachParts) {
+      iterable = parts.iterable;
+    }
+
+    tracker.beginForStatement2(node);
+
+    variables?.accept(this);
+    initialization?.accept(this);
+    condition?.accept(this);
+    iterable?.accept(this);
+
+    tracker.beginForStatementBody();
+    node.body?.accept(this);
+
+    tracker.beginForStatementUpdaters();
+    updaters?.accept(this);
+
+    tracker.endForStatement();
+  }
+
+  @override
   void visitFunctionDeclaration(FunctionDeclaration node) {
     super.visitFunctionDeclaration(node);
     if (node.parent is CompilationUnit) {
diff --git a/pkg/analyzer/test/src/dart/resolution/enum_test.dart b/pkg/analyzer/test/src/dart/resolution/enum_test.dart
index ff350fb..90a59b1 100644
--- a/pkg/analyzer/test/src/dart/resolution/enum_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/enum_test.dart
@@ -8,12 +8,10 @@
 
 import 'driver_resolution.dart';
 import 'resolution.dart';
-import 'task_resolution.dart';
 
 main() {
   defineReflectiveSuite(() {
     defineReflectiveTests(EnumDriverResolutionTest);
-    defineReflectiveTests(EnumTaskResolutionTest);
   });
 }
 
@@ -60,7 +58,3 @@
     expect(findElement.field('values').isConstantEvaluated, isTrue);
   }
 }
-
-@reflectiveTest
-class EnumTaskResolutionTest extends TaskResolutionTest
-    with EnumResolutionMixin {}
diff --git a/pkg/analyzer/test/src/dart/resolution/find_node.dart b/pkg/analyzer/test/src/dart/resolution/find_node.dart
index 08de2f9..574553d 100644
--- a/pkg/analyzer/test/src/dart/resolution/find_node.dart
+++ b/pkg/analyzer/test/src/dart/resolution/find_node.dart
@@ -44,10 +44,18 @@
     return _node(search, (n) => n is ExportDirective);
   }
 
+  Expression expression(String search) {
+    return _node(search, (n) => n is Expression);
+  }
+
   FieldFormalParameter fieldFormalParameter(String search) {
     return _node(search, (n) => n is FieldFormalParameter);
   }
 
+  FunctionBody functionBody(String search) {
+    return _node(search, (n) => n is FunctionBody);
+  }
+
   FunctionExpression functionExpression(String search) {
     return _node(search, (n) => n is FunctionExpression);
   }
@@ -124,6 +132,10 @@
     return _node(search, (n) => n is SimpleFormalParameter);
   }
 
+  Statement statement(String search) {
+    return _node(search, (n) => n is Statement);
+  }
+
   StringLiteral stringLiteral(String search) {
     return _node(search, (n) => n is StringLiteral);
   }
diff --git a/pkg/analyzer/test/src/dart/resolution/flow_analysis_test.dart b/pkg/analyzer/test/src/dart/resolution/flow_analysis_test.dart
new file mode 100644
index 0000000..d0e73a6
--- /dev/null
+++ b/pkg/analyzer/test/src/dart/resolution/flow_analysis_test.dart
@@ -0,0 +1,3200 @@
+// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:analyzer/dart/ast/ast.dart';
+import 'package:analyzer/dart/ast/standard_ast_factory.dart';
+import 'package:analyzer/dart/ast/token.dart';
+import 'package:analyzer/dart/ast/visitor.dart';
+import 'package:analyzer/dart/element/element.dart';
+import 'package:analyzer/dart/element/type.dart';
+import 'package:analyzer/dart/element/type_system.dart';
+import 'package:analyzer/src/dart/resolver/flow_analysis.dart';
+import 'package:test/test.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+
+import 'driver_resolution.dart';
+
+main() {
+  defineReflectiveSuite(() {
+    defineReflectiveTests(DefiniteAssignmentFlowTest);
+    defineReflectiveTests(ReachableFlowTest);
+    defineReflectiveTests(TypePromotionFlowTest);
+  });
+}
+
+@reflectiveTest
+class DefiniteAssignmentFlowTest extends DriverResolutionTest {
+  final List<LocalVariableElement> readBeforeWritten = [];
+
+  /// Assert that only local variables with the given names are marked as read
+  /// before being written.  All the other local variables are implicitly
+  /// considered definitely assigned.
+  void assertReadBeforeWritten(
+      [String name1, String name2, String name3, String name4]) {
+    var expected = [name1, name2, name3, name4]
+        .where((i) => i != null)
+        .map((name) => findElement.localVar(name))
+        .toList();
+    expect(readBeforeWritten, unorderedEquals(expected));
+  }
+
+  test_assignment_leftExpression() async {
+    await trackCode(r'''
+void f() {
+  List<int> v;
+  v[0] = (v = [1, 2])[1];
+  v;
+}
+''');
+    assertReadBeforeWritten('v');
+  }
+
+  test_assignment_leftLocal_compound() async {
+    await trackCode(r'''
+void f() {
+  int v;
+  v += 1;
+}
+''');
+    assertReadBeforeWritten('v');
+  }
+
+  test_assignment_leftLocal_compound_assignInRight() async {
+    await trackCode(r'''
+void f() {
+  int v;
+  v += (v = v);
+}
+''');
+    assertReadBeforeWritten('v');
+  }
+
+  test_assignment_leftLocal_pure_eq() async {
+    await trackCode(r'''
+void f() {
+  int v;
+  v = 0;
+}
+''');
+    assertReadBeforeWritten();
+  }
+
+  test_assignment_leftLocal_pure_eq_self() async {
+    await trackCode(r'''
+void f() {
+  int v;
+  v = v;
+}
+''');
+    assertReadBeforeWritten('v');
+  }
+
+  test_assignment_leftLocal_pure_questionEq() async {
+    await trackCode(r'''
+void f() {
+  int v;
+  v ??= 0;
+}
+''');
+    assertReadBeforeWritten('v');
+  }
+
+  test_assignment_leftLocal_pure_questionEq_self() async {
+    await trackCode(r'''
+void f() {
+  int v;
+  v ??= v;
+}
+''');
+    assertReadBeforeWritten('v');
+  }
+
+  test_binaryExpression_ifNull_left() async {
+    await trackCode(r'''
+void f() {
+  int v;
+  (v = 0) ?? 0;
+  v;
+}
+''');
+    assertReadBeforeWritten();
+  }
+
+  test_binaryExpression_ifNull_right() async {
+    await trackCode(r'''
+void f(int a) {
+  int v;
+  a ?? (v = 0);
+  v;
+}
+''');
+    assertReadBeforeWritten('v');
+  }
+
+  test_binaryExpression_logicalAnd_left() async {
+    await trackCode(r'''
+main(bool c) {
+  int v;
+  ((v = 0) >= 0) && c;
+  v;
+}
+''');
+    assertReadBeforeWritten();
+  }
+
+  test_binaryExpression_logicalAnd_right() async {
+    await trackCode(r'''
+main(bool c) {
+  int v;
+  c && ((v = 0) >= 0);
+  v;
+}
+''');
+    assertReadBeforeWritten('v');
+  }
+
+  test_binaryExpression_logicalOr_left() async {
+    await trackCode(r'''
+main(bool c) {
+  int v;
+  ((v = 0) >= 0) || c;
+  v;
+}
+''');
+    assertReadBeforeWritten();
+  }
+
+  test_binaryExpression_logicalOr_right() async {
+    await trackCode(r'''
+main(bool c) {
+  int v;
+  c || ((v = 0) >= 0);
+  v;
+}
+''');
+    assertReadBeforeWritten('v');
+  }
+
+  test_binaryExpression_plus_left() async {
+    await trackCode(r'''
+main() {
+  int v;
+  (v = 0) + 1;
+  v;
+}
+''');
+    assertReadBeforeWritten();
+  }
+
+  test_binaryExpression_plus_right() async {
+    await trackCode(r'''
+main() {
+  int v;
+  1 + (v = 0);
+  v;
+}
+''');
+    assertReadBeforeWritten();
+  }
+
+  test_conditional_both() async {
+    await trackCode(r'''
+f(bool v) {
+  int v;
+  b ? (v = 1) : (v = 2);
+  v;
+}
+''');
+    assertReadBeforeWritten();
+  }
+
+  test_conditional_else() async {
+    await trackCode(r'''
+f(bool v) {
+  int v;
+  b ? 1 : (v = 2);
+  v;
+}
+''');
+    assertReadBeforeWritten('v');
+  }
+
+  test_conditional_then() async {
+    await trackCode(r'''
+f(bool v) {
+  int v;
+  b ? (v = 1) : 2;
+  v;
+}
+''');
+    assertReadBeforeWritten('v');
+  }
+
+  test_conditionalExpression_condition() async {
+    await trackCode(r'''
+main() {
+  int v;
+  (v = 0) >= 0 ? 1 : 2;
+  v;
+}
+''');
+    assertReadBeforeWritten();
+  }
+
+  test_doWhile_break_afterAssignment() async {
+    await trackCode(r'''
+void f(bool b) {
+  int v;
+  do {
+    v = 0;
+    v;
+    if (b) break;
+  } while (b);
+  v;
+}
+''');
+    assertReadBeforeWritten();
+  }
+
+  test_doWhile_break_beforeAssignment() async {
+    await trackCode(r'''
+void f(bool b) {
+  int v;
+  do {
+    if (b) break;
+    v = 0;
+  } while (b);
+  v;
+}
+''');
+    assertReadBeforeWritten('v');
+  }
+
+  test_doWhile_breakOuterFromInner() async {
+    await trackCode(r'''
+void f(bool b) {
+  int v1, v2, v3;
+  L1: do {
+    do {
+      v1 = 0;
+      if (b) break L1;
+      v2 = 0;
+      v3 = 0;
+    } while (b);
+    v2;
+  } while (b);
+  v1;
+  v3;
+}
+''');
+    assertReadBeforeWritten('v3');
+  }
+
+  test_doWhile_condition() async {
+    await trackCode(r'''
+void f() {
+  int v1, v2;
+  do {
+    v1; // assigned in the condition, but not yet
+  } while ((v1 = 0) + (v2 = 0) >= 0);
+  v2;
+}
+''');
+    assertReadBeforeWritten('v1');
+  }
+
+  test_doWhile_condition_break() async {
+    await trackCode(r'''
+void f(bool b) {
+  int v;
+  do {
+    if (b) break;
+  } while ((v = 0) >= 0);
+  v;
+}
+''');
+    assertReadBeforeWritten('v');
+  }
+
+  test_doWhile_condition_break_continue() async {
+    await trackCode(r'''
+void f(bool b1, b2) {
+  int v1, v2, v3, v4, v5, v6;
+  do {
+    v1 = 0; // visible outside, visible to the condition
+    if (b1) break;
+    v2 = 0; // not visible outside, visible to the condition
+    v3 = 0; // not visible outside, visible to the condition
+    if (b2) continue;
+    v4 = 0; // not visible
+    v5 = 0; // not visible
+  } while ((v6 = v1 + v2 + v4) == 0); // has break => v6 is not visible outside
+  v1;
+  v3;
+  v5;
+  v6;
+}
+''');
+    assertReadBeforeWritten('v3', 'v4', 'v5', 'v6');
+  }
+
+  test_doWhile_condition_continue() async {
+    await trackCode(r'''
+void f(bool b) {
+  int v1, v2, v3, v4;
+  do {
+    v1 = 0; // visible outside, visible to the condition
+    if (b) continue;
+    v2 = 0; // not visible
+    v3 = 0; // not visible
+  } while ((v4 = v1 + v2) == 0); // no break => v4 visible outside
+  v1;
+  v3;
+  v4;
+}
+''');
+    assertReadBeforeWritten('v2', 'v3');
+  }
+
+  test_doWhile_continue_beforeAssignment() async {
+    await trackCode(r'''
+void f(bool b) {
+  int v;
+  do {
+    if (b) continue;
+    v = 0;
+  } while (b);
+  v;
+}
+''');
+    assertReadBeforeWritten('v');
+  }
+
+  test_doWhile_true_assignInBreak() async {
+    await trackCode(r'''
+void f(bool b) {
+  int v;
+  do {
+    if (b) {
+      v = 0;
+      break;
+    }
+  } while (true);
+  v;
+}
+''');
+    assertReadBeforeWritten();
+  }
+
+  test_for_body() async {
+    await trackCode(r'''
+void f(bool b) {
+  int v;
+  for (; b;) {
+    v = 0;
+  }
+  v;
+}
+''');
+    assertReadBeforeWritten('v');
+  }
+
+  test_for_break() async {
+    await trackCode(r'''
+void f(bool b) {
+  int v1, v2;
+  for (; b;) {
+    v1 = 0;
+    if (b) break;
+    v2 = 0;
+  }
+  v1;
+  v2;
+}
+''');
+    assertReadBeforeWritten('v1', 'v2');
+  }
+
+  test_for_break_updaters() async {
+    await trackCode(r'''
+void f(bool b) {
+  int v1, v2;
+  for (; b; v1 + v2) {
+    v1 = 0;
+    if (b) break;
+    v2 = 0;
+  }
+}
+''');
+    assertReadBeforeWritten();
+  }
+
+  test_for_condition() async {
+    await trackCode(r'''
+void f() {
+  int v;
+  for (; (v = 0) >= 0;) {
+    v;
+  }
+  v;
+}
+''');
+    assertReadBeforeWritten();
+  }
+
+  test_for_continue() async {
+    await trackCode(r'''
+void f(bool b) {
+  int v1, v2;
+  for (; b;) {
+    v1 = 0;
+    if (b) continue;
+    v2 = 0;
+  }
+  v1;
+  v2;
+}
+''');
+    assertReadBeforeWritten('v1', 'v2');
+  }
+
+  test_for_continue_updaters() async {
+    await trackCode(r'''
+void f(bool b) {
+  int v1, v2;
+  for (; b; v1 + v2) {
+    v1 = 0;
+    if (b) continue;
+    v2 = 0;
+  }
+}
+''');
+    assertReadBeforeWritten('v2');
+  }
+
+  test_for_initializer_expression() async {
+    await trackCode(r'''
+void f() {
+  int v;
+  for (v = 0;;) {
+    v;
+  }
+  v;
+}
+''');
+    assertReadBeforeWritten();
+  }
+
+  test_for_initializer_variable() async {
+    await trackCode(r'''
+void f() {
+  int v;
+  for (var t = (v = 0);;) {
+    v;
+  }
+  v;
+}
+''');
+    assertReadBeforeWritten();
+  }
+
+  test_for_updaters() async {
+    await trackCode(r'''
+void f(bool b) {
+  int v1, v2, v3, v4;
+  for (; b; v1 = 0, v2 = 0, v3 = 0, v4) {
+    v1;
+  }
+  v2;
+}
+''');
+    assertReadBeforeWritten('v1', 'v2', 'v4');
+  }
+
+  test_for_updaters_afterBody() async {
+    await trackCode(r'''
+void f(bool b) {
+  int v;
+  for (; b; v) {
+    v = 0;
+  }
+}
+''');
+    assertReadBeforeWritten();
+  }
+
+  test_forEach() async {
+    await trackCode(r'''
+void f() {
+  int v1, v2;
+  for (var _ in (v1 = [0, 1, 2])) {
+    v2 = 0;
+  }
+  v1;
+  v2;
+}
+''');
+    assertReadBeforeWritten('v2');
+  }
+
+  test_forEach_break() async {
+    await trackCode(r'''
+void f(bool b) {
+  int v1, v2;
+  for (var _ in [0, 1, 2]) {
+    v1 = 0;
+    if (b) break;
+    v2 = 0;
+  }
+  v1;
+  v2;
+}
+''');
+    assertReadBeforeWritten('v1', 'v2');
+  }
+
+  test_forEach_continue() async {
+    await trackCode(r'''
+void f(bool b) {
+  int v1, v2;
+  for (var _ in [0, 1, 2]) {
+    v1 = 0;
+    if (b) continue;
+    v2 = 0;
+  }
+  v1;
+  v2;
+}
+''');
+    assertReadBeforeWritten('v1', 'v2');
+  }
+
+  test_functionExpression_closure_read() async {
+    await trackCode(r'''
+void f() {
+  int v1, v2;
+  
+  v1 = 0;
+  
+  [0, 1, 2].forEach((t) {
+    v1;
+    v2;
+  });
+}
+''');
+    assertReadBeforeWritten('v2');
+  }
+
+  test_functionExpression_closure_write() async {
+    await trackCode(r'''
+void f() {
+  int v;
+  
+  [0, 1, 2].forEach((t) {
+    v = t;
+  });
+
+  v;
+}
+''');
+    assertReadBeforeWritten('v');
+  }
+
+  test_functionExpression_localFunction_local() async {
+    await trackCode(r'''
+void f() {
+  int v;
+
+  v = 0;
+
+  void f() {
+    int v; // 1
+    v;
+  }
+}
+''');
+    var localV = findNode.simple('v; // 1').staticElement;
+    expect(readBeforeWritten, unorderedEquals([localV]));
+  }
+
+  test_functionExpression_localFunction_local2() async {
+    await trackCode(r'''
+void f() {
+  int v1;
+
+  v1 = 0;
+
+  void f() {
+    int v2, v3;
+    v2 = 0;
+    v1;
+    v2;
+    v3;
+  }
+}
+''');
+    assertReadBeforeWritten('v3');
+  }
+
+  test_functionExpression_localFunction_read() async {
+    await trackCode(r'''
+void f() {
+  int v1, v2, v3;
+
+  v1 = 0;
+
+  void f() {
+    v1;
+    v2;
+  }
+
+  v2 = 0;
+}
+''');
+    assertReadBeforeWritten('v2');
+  }
+
+  test_functionExpression_localFunction_write() async {
+    await trackCode(r'''
+void f() {
+  int v;
+
+  void f() {
+    v = 0;
+  }
+
+  v;
+}
+''');
+    assertReadBeforeWritten('v');
+  }
+
+  test_if_condition() async {
+    await trackCode(r'''
+main() {
+  int v;
+  if ((v = 0) >= 0) {
+    v;
+  } else {
+    v;
+  }
+  v;
+}
+''');
+    assertReadBeforeWritten();
+  }
+
+  test_if_condition_false() async {
+    await trackCode(r'''
+void f() {
+  int v;
+  if (false) {
+    // not assigned
+  } else {
+    v = 0;
+  }
+  v;
+}
+''');
+    assertReadBeforeWritten();
+  }
+
+  test_if_condition_logicalAnd_else() async {
+    await trackCode(r'''
+void f(bool b, int i) {
+  int v;
+  if (b && (v = i) > 0) {
+  } else {
+    v;
+  }
+}
+''');
+    assertReadBeforeWritten('v');
+  }
+
+  test_if_condition_logicalAnd_then() async {
+    await trackCode(r'''
+void f(bool b, int i) {
+  int v;
+  if (b && (v = i) > 0) {
+    v;
+  }
+}
+''');
+    assertReadBeforeWritten();
+  }
+
+  test_if_condition_logicalOr_else() async {
+    await trackCode(r'''
+void f(bool b, int i) {
+  int v;
+  if (b || (v = i) > 0) {
+  } else {
+    v;
+  }
+}
+''');
+    assertReadBeforeWritten();
+  }
+
+  test_if_condition_logicalOr_then() async {
+    await trackCode(r'''
+void f(bool b, int i) {
+  int v;
+  if (b || (v = i) > 0) {
+    v;
+  } else {
+  }
+}
+''');
+    assertReadBeforeWritten('v');
+  }
+
+  test_if_condition_notFalse() async {
+    await trackCode(r'''
+void f() {
+  int v;
+  if (!false) {
+    v = 0;
+  }
+  v;
+}
+''');
+    assertReadBeforeWritten();
+  }
+
+  test_if_condition_notTrue() async {
+    await trackCode(r'''
+void f() {
+  int v;
+  if (!true) {
+    // not assigned
+  } else {
+    v = 0;
+  }
+  v;
+}
+''');
+    assertReadBeforeWritten();
+  }
+
+  test_if_condition_true() async {
+    await trackCode(r'''
+void f() {
+  int v;
+  if (true) {
+    v = 0;
+  }
+  v;
+}
+''');
+    assertReadBeforeWritten();
+  }
+
+  test_if_then() async {
+    await trackCode(r'''
+main(bool c) {
+  int v;
+  if (c) {
+    v = 0;
+  }
+  v;
+}
+''');
+    assertReadBeforeWritten('v');
+  }
+
+  test_if_thenElse_all() async {
+    await trackCode(r'''
+main(bool c) {
+  int v;
+  if (c) {
+    v = 0;
+    v;
+  } else {
+    v = 0;
+    v;
+  }
+  v;
+}
+''');
+    assertReadBeforeWritten();
+  }
+
+  test_if_thenElse_else() async {
+    await trackCode(r'''
+main(bool c) {
+  int v;
+  if (c) {
+    // not assigned
+  } else {
+    v = 0;
+  }
+  v;
+}
+''');
+    assertReadBeforeWritten('v');
+  }
+
+  test_if_thenElse_then() async {
+    await trackCode(r'''
+main(bool c) {
+  int v;
+  if (c) {
+    v = 0;
+  } else {
+    // not assigned
+  }
+  v;
+}
+''');
+    assertReadBeforeWritten('v');
+  }
+
+  test_switch_case1_default() async {
+    await trackCode(r'''
+void f(int e) {
+  int v;
+  switch (e) {
+    case 1:
+      v = 0;
+      break;
+    case 2:
+      // not assigned
+      break;
+    default:
+      v = 0;
+  }
+  v;
+}
+''');
+    assertReadBeforeWritten('v');
+  }
+
+  test_switch_case2_default() async {
+    await trackCode(r'''
+void f(int e) {
+  int v1, v2;
+  switch (e) {
+    case 1:
+      v1 = 0;
+      v2 = 0;
+      v1;
+      break;
+    default:
+      v1 = 0;
+      v1;
+  }
+  v1;
+  v2;
+}
+''');
+    assertReadBeforeWritten('v2');
+  }
+
+  test_switch_case_default_break() async {
+    await trackCode(r'''
+void f(bool b, int e) {
+  int v1, v2;
+  switch (e) {
+    case 1:
+      v1 = 0;
+      if (b) break;
+      v2 = 0;
+      break;
+    default:
+      v1 = 0;
+      if (b) break;
+      v2 = 0;
+  }
+  v1;
+  v2;
+}
+''');
+    assertReadBeforeWritten('v2');
+  }
+
+  test_switch_case_default_continue() async {
+    await trackCode(r'''
+void f(int e) {
+  int v;
+  switch (e) {
+    L: case 1:
+      v = 0;
+      break;
+    case 2:
+      continue L;
+      break;
+    default:
+      v = 0;
+  }
+  v;
+}
+''');
+    // We don't analyze to which `case` we go from `continue L`,
+    // but we don't have to. If all cases assign, then the variable is
+    // removed from the unassigned set in the `breakState`. And if there is a
+    // case when it is not assigned, then the variable will be left unassigned
+    // in the `breakState`.
+    assertReadBeforeWritten();
+  }
+
+  test_switch_case_noDefault() async {
+    await trackCode(r'''
+void f(int e) {
+  int v;
+  switch (e) {
+    case 1:
+      v = 0;
+      break;
+  }
+  v;
+}
+''');
+    assertReadBeforeWritten('v');
+  }
+
+  test_switch_expression() async {
+    await trackCode(r'''
+void f() {
+  int v;
+  switch (v = 0) {}
+  v;
+}
+''');
+    assertReadBeforeWritten();
+  }
+
+  test_tryCatch_body() async {
+    await trackCode(r'''
+void f() {
+  int v;
+  try {
+    v = 0;
+  } catch (_) {
+    // not assigned
+  }
+  v;
+}
+''');
+    assertReadBeforeWritten('v');
+  }
+
+  test_tryCatch_body_catch() async {
+    await trackCode(r'''
+void f() {
+  int v;
+  try {
+    g();
+    v = 0;
+  } catch (_) {
+    v = 0;
+  }
+  v;
+}
+
+void g() {}
+''');
+    assertReadBeforeWritten();
+  }
+
+  test_tryCatch_body_catchRethrow() async {
+    await trackCode(r'''
+void f() {
+  int v;
+  try {
+    v = 0;
+  } catch (_) {
+    rethrow;
+  }
+  v;
+}
+''');
+    assertReadBeforeWritten();
+  }
+
+  test_tryCatch_catch() async {
+    await trackCode(r'''
+void f() {
+  int v;
+  try {
+    // not assigned
+  } catch (_) {
+    v = 0;
+  }
+  v;
+}
+''');
+    assertReadBeforeWritten('v');
+  }
+
+  test_tryCatchFinally_body() async {
+    await trackCode(r'''
+void f() {
+  int v;
+  try {
+    v = 0;
+  } catch (_) {
+    // not assigned
+  } finally {
+    // not assigned
+  }
+  v;
+}
+''');
+    assertReadBeforeWritten('v');
+  }
+
+  test_tryCatchFinally_catch() async {
+    await trackCode(r'''
+void f() {
+  int v;
+  try {
+    // not assigned
+  } catch (_) {
+    v = 0;
+  } finally {
+    // not assigned
+  }
+  v;
+}
+''');
+    assertReadBeforeWritten('v');
+  }
+
+  test_tryCatchFinally_finally() async {
+    await trackCode(r'''
+void f() {
+  int v;
+  try {
+    // not assigned
+  } catch (_) {
+    // not assigned
+  } finally {
+    v = 0;
+  }
+  v;
+}
+''');
+    assertReadBeforeWritten();
+  }
+
+  @failingTest
+  test_tryCatchFinally_useInFinally() async {
+    await trackCode(r'''
+f() {
+  int x;
+  try {
+    g(); // may throw an exception
+    x = 1;
+  } catch (_) {
+    x = 1;
+  } finally {
+    x; // BAD
+  }
+}
+
+void g() {}
+''');
+    assertReadBeforeWritten('x');
+  }
+
+  test_tryFinally_body() async {
+    await trackCode(r'''
+void f() {
+  int v;
+  try {
+    v = 0;
+  } finally {
+    // not assigned
+  }
+  v;
+}
+''');
+    assertReadBeforeWritten();
+  }
+
+  test_tryFinally_finally() async {
+    await trackCode(r'''
+void f() {
+  int v;
+  try {
+    // not assigned
+  } finally {
+    v = 0;
+  }
+  v;
+}
+''');
+    assertReadBeforeWritten();
+  }
+
+  test_while_condition() async {
+    await trackCode(r'''
+void f() {
+  int v;
+  while ((v = 0) >= 0) {
+    v;
+  }
+  v;
+}
+''');
+    assertReadBeforeWritten();
+  }
+
+  test_while_condition_notTrue() async {
+    await trackCode(r'''
+void f(bool b) {
+  int v1, v2;
+  while (b) {
+    v1 = 0;
+    v2 = 0;
+    v1;
+  }
+  v2;
+}
+''');
+    assertReadBeforeWritten('v2');
+  }
+
+  test_while_true_break_afterAssignment() async {
+    await trackCode(r'''
+void f(bool b) {
+  int v1, v2;
+  while (true) {
+    v1 = 0;
+    v1;
+    if (b) break;
+    v1;
+    v2 = 0;
+    v2;
+  }
+  v1;
+}
+''');
+    assertReadBeforeWritten();
+  }
+
+  test_while_true_break_beforeAssignment() async {
+    await trackCode(r'''
+void f(bool b) {
+  int v1, v2;
+  while (true) {
+    if (b) break;
+    v1 = 0;
+    v2 = 0;
+    v2;
+  }
+  v1;
+}
+''');
+    assertReadBeforeWritten('v1');
+  }
+
+  test_while_true_break_if() async {
+    await trackCode(r'''
+void f(bool b) {
+  int v;
+  while (true) {
+    if (b) {
+      v = 0;
+      break;
+    } else {
+      v = 0;
+      break;
+    }
+    v;
+  }
+  v;
+}
+''');
+    assertReadBeforeWritten();
+  }
+
+  test_while_true_break_if2() async {
+    await trackCode(r'''
+void f(bool b) {
+  var v;
+  while (true) {
+    if (b) {
+      break;
+    } else {
+      v = 0;
+    }
+    v;
+  }
+}
+''');
+    assertReadBeforeWritten();
+  }
+
+  test_while_true_break_if3() async {
+    await trackCode(r'''
+void f(bool b) {
+  int v1, v2;
+  while (true) {
+    if (b) {
+      v1 = 0;
+      v2 = 0;
+      if (b) break;
+    } else {
+      if (b) break;
+      v1 = 0;
+      v2 = 0;
+    }
+    v1;
+  }
+  v2;
+}
+''');
+    assertReadBeforeWritten('v2');
+  }
+
+  test_while_true_breakOuterFromInner() async {
+    await trackCode(r'''
+void f(bool b) {
+  int v1, v2, v3;
+  L1: while (true) {
+    L2: while (true) {
+      v1 = 0;
+      if (b) break L1;
+      v2 = 0;
+      v3 = 0;
+      if (b) break L2;
+    }
+    v2;
+  }
+  v1;
+  v3;
+}
+''');
+    assertReadBeforeWritten('v3');
+  }
+
+  test_while_true_continue() async {
+    await trackCode(r'''
+void f(bool b) {
+  int v;
+  while (true) {
+    if (b) continue;
+    v = 0;
+  }
+  v;
+}
+''');
+    assertReadBeforeWritten();
+  }
+
+  test_while_true_noBreak() async {
+    await trackCode(r'''
+void f() {
+  int v;
+  while (true) {
+    // No assignment, but no break.
+    // So, we don't exit the loop.
+    // So, all variables are assigned.
+  }
+  v;
+}
+''');
+    assertReadBeforeWritten();
+  }
+
+  /// Resolve the given [code] and track assignments in the unit.
+  Future<void> trackCode(String code) async {
+    addTestFile(code);
+    await resolveTestFile();
+
+    var unit = result.unit;
+
+    var loopAssignedVariables = LoopAssignedVariables();
+    unit.accept(_LoopAssignedVariablesVisitor(loopAssignedVariables));
+
+    var typeSystem = unit.declaredElement.context.typeSystem;
+    unit.accept(_AstVisitor(
+      typeSystem,
+      loopAssignedVariables,
+      {},
+      readBeforeWritten,
+      [],
+      [],
+    ));
+  }
+}
+
+@reflectiveTest
+class ReachableFlowTest extends DriverResolutionTest {
+  final List<AstNode> unreachableNodes = [];
+  final List<FunctionBody> functionBodiesThatDontComplete = [];
+
+  test_conditional_false() async {
+    await trackCode(r'''
+void f() {
+  false ? 1 : 2;
+}
+''');
+    verify(unreachableExpressions: ['1']);
+  }
+
+  test_conditional_true() async {
+    await trackCode(r'''
+void f() {
+  true ? 1 : 2;
+}
+''');
+    verify(unreachableExpressions: ['2']);
+  }
+
+  test_do_false() async {
+    await trackCode(r'''
+void f() {
+  do (true) {
+    1;
+  } while (false);
+  2;
+}
+''');
+    verify();
+  }
+
+  test_do_true() async {
+    await trackCode(r'''
+void f() { // f
+  do (true) {
+    1;
+  } while (true);
+  2;
+}
+''');
+    verify(
+      unreachableStatements: ['2;'],
+      functionBodiesThatDontComplete: ['{ // f'],
+    );
+  }
+
+  test_exit_beforeSplitStatement() async {
+    await trackCode(r'''
+void f(bool b, int i) { // f
+  return;
+  do {} while (b);
+  for (;;) {}
+  for (_ in []) {}
+  if (b) {}
+  switch (i) {}
+  try {} finally {}
+  while (b) {}
+}
+''');
+    verify(
+      unreachableStatements: [
+        'do {}',
+        'for (;;',
+        'for (_',
+        'if (b)',
+        'try {',
+        'switch (i)',
+        'while (b) {}'
+      ],
+      functionBodiesThatDontComplete: ['{ // f'],
+    );
+  }
+
+  test_for_condition_true() async {
+    await trackCode(r'''
+void f() { // f
+  for (; true;) {
+    1;
+  }
+  2;
+}
+''');
+    verify(
+      unreachableStatements: ['2;'],
+      functionBodiesThatDontComplete: ['{ // f'],
+    );
+  }
+
+  test_for_condition_true_implicit() async {
+    await trackCode(r'''
+void f() { // f
+  for (;;) {
+    1;
+  }
+  2;
+}
+''');
+    verify(
+      unreachableStatements: ['2;'],
+      functionBodiesThatDontComplete: ['{ // f'],
+    );
+  }
+
+  test_forEach() async {
+    await trackCode(r'''
+void f() {
+  for (_ in [0, 1, 2]) {
+    1;
+    return;
+  }
+  2;
+}
+''');
+    verify();
+  }
+
+  test_functionBody_hasReturn() async {
+    await trackCode(r'''
+int f() { // f
+  return 42;
+}
+''');
+    verify(functionBodiesThatDontComplete: ['{ // f']);
+  }
+
+  test_functionBody_noReturn() async {
+    await trackCode(r'''
+void f() {
+  1;
+}
+''');
+    verify();
+  }
+
+  test_if_condition() async {
+    await trackCode(r'''
+void f(bool b) {
+  if (b) {
+    1;
+  } else {
+    2;
+  }
+  3;
+}
+''');
+    verify();
+  }
+
+  test_if_false_then_else() async {
+    await trackCode(r'''
+void f() {
+  if (false) { // 1
+    1;
+  } else { // 2
+  }
+  3;
+}
+''');
+    verify(unreachableStatements: ['{ // 1']);
+  }
+
+  test_if_true_return() async {
+    await trackCode(r'''
+void f() { // f
+  1;
+  if (true) {
+    return;
+  }
+  2;
+}
+''');
+    verify(
+      unreachableStatements: ['2;'],
+      functionBodiesThatDontComplete: ['{ // f'],
+    );
+  }
+
+  test_if_true_then_else() async {
+    await trackCode(r'''
+void f() {
+  if (true) { // 1
+  } else { // 2
+    2;
+  }
+  3;
+}
+''');
+    verify(unreachableStatements: ['{ // 2']);
+  }
+
+  test_logicalAnd_leftFalse() async {
+    await trackCode(r'''
+void f(int x) {
+  false && (x == 1);
+}
+''');
+    verify(unreachableExpressions: ['(x == 1)']);
+  }
+
+  test_logicalOr_leftTrue() async {
+    await trackCode(r'''
+void f(int x) {
+  true || (x == 1);
+}
+''');
+    verify(unreachableExpressions: ['(x == 1)']);
+  }
+
+  test_switch_case_neverCompletes() async {
+    await trackCode(r'''
+void f(bool b, int i) {
+  switch (i) {
+    case 1:
+      1;
+      if (b) {
+        return;
+      } else {
+        return;
+      }
+      2;
+  }
+  3;
+}
+''');
+    verify(unreachableStatements: ['2;']);
+  }
+
+  test_tryCatch() async {
+    await trackCode(r'''
+void f() {
+  try {
+    1;
+  } catch (_) {
+    2;
+  }
+  3;
+}
+''');
+    verify();
+  }
+
+  test_tryCatch_return_body() async {
+    await trackCode(r'''
+void f() {
+  try {
+    1;
+    return;
+    2;
+  } catch (_) {
+    3;
+  }
+  4;
+}
+''');
+    verify(unreachableStatements: ['2;']);
+  }
+
+  test_tryCatch_return_catch() async {
+    await trackCode(r'''
+void f() {
+  try {
+    1;
+  } catch (_) {
+    2;
+    return;
+    3;
+  }
+  4;
+}
+''');
+    verify(unreachableStatements: ['3;']);
+  }
+
+  test_tryCatchFinally_return_body() async {
+    await trackCode(r'''
+void f() {
+  try {
+    1;
+    return;
+  } catch (_) {
+    2;
+  } finally {
+    3;
+  }
+  4;
+}
+''');
+    verify();
+  }
+
+  test_tryCatchFinally_return_bodyCatch() async {
+    await trackCode(r'''
+void f() { // f
+  try {
+    1;
+    return;
+  } catch (_) {
+    2;
+    return;
+  } finally {
+    3;
+  }
+  4;
+}
+''');
+    verify(
+      unreachableStatements: ['4;'],
+      functionBodiesThatDontComplete: ['{ // f'],
+    );
+  }
+
+  test_tryCatchFinally_return_catch() async {
+    await trackCode(r'''
+void f() {
+  try {
+    1;
+  } catch (_) {
+    2;
+    return;
+  } finally {
+    3;
+  }
+  4;
+}
+''');
+    verify();
+  }
+
+  test_tryFinally_return_body() async {
+    await trackCode(r'''
+void f() { // f
+  try {
+    1;
+    return;
+  } finally {
+    2;
+  }
+  3;
+}
+''');
+    verify(
+      unreachableStatements: ['3;'],
+      functionBodiesThatDontComplete: ['{ // f'],
+    );
+  }
+
+  test_while_false() async {
+    await trackCode(r'''
+void f() {
+  while (false) { // 1
+    1;
+  }
+  2;
+}
+''');
+    verify(unreachableStatements: ['{ // 1']);
+  }
+
+  test_while_true() async {
+    await trackCode(r'''
+void f() { // f
+  while (true) {
+    1;
+  }
+  2;
+  3;
+}
+''');
+    verify(
+      unreachableStatements: ['2;', '3;'],
+      functionBodiesThatDontComplete: ['{ // f'],
+    );
+  }
+
+  test_while_true_break() async {
+    await trackCode(r'''
+void f() {
+  while (true) {
+    1;
+    break;
+    2;
+  }
+  3;
+}
+''');
+    verify(unreachableStatements: ['2;']);
+  }
+
+  test_while_true_breakIf() async {
+    await trackCode(r'''
+void f(bool b) {
+  while (true) {
+    1;
+    if (b) break;
+    2;
+  }
+  3;
+}
+''');
+    verify();
+  }
+
+  test_while_true_continue() async {
+    await trackCode(r'''
+void f() { // f
+  while (true) {
+    1;
+    continue;
+    2;
+  }
+  3;
+}
+''');
+    verify(
+      unreachableStatements: ['2;', '3;'],
+      functionBodiesThatDontComplete: ['{ // f'],
+    );
+  }
+
+  /// Resolve the given [code] and track unreachable nodes in the unit.
+  Future<void> trackCode(String code) async {
+    addTestFile(code);
+    await resolveTestFile();
+
+    var unit = result.unit;
+
+    var loopAssignedVariables = LoopAssignedVariables();
+    unit.accept(_LoopAssignedVariablesVisitor(loopAssignedVariables));
+
+    var typeSystem = unit.declaredElement.context.typeSystem;
+    unit.accept(_AstVisitor(
+      typeSystem,
+      loopAssignedVariables,
+      {},
+      [],
+      unreachableNodes,
+      functionBodiesThatDontComplete,
+    ));
+  }
+
+  void verify({
+    List<String> unreachableExpressions = const [],
+    List<String> unreachableStatements = const [],
+    List<String> functionBodiesThatDontComplete = const [],
+  }) {
+    var expectedUnreachableNodes = <AstNode>[];
+    expectedUnreachableNodes.addAll(
+      unreachableStatements.map((search) => findNode.statement(search)),
+    );
+    expectedUnreachableNodes.addAll(
+      unreachableExpressions.map((search) => findNode.expression(search)),
+    );
+
+    expect(
+      this.unreachableNodes,
+      unorderedEquals(expectedUnreachableNodes),
+    );
+    expect(
+      this.functionBodiesThatDontComplete,
+      unorderedEquals(
+        functionBodiesThatDontComplete
+            .map((search) => findNode.functionBody(search))
+            .toList(),
+      ),
+    );
+  }
+}
+
+@reflectiveTest
+class TypePromotionFlowTest extends DriverResolutionTest {
+  final Map<AstNode, DartType> promotedTypes = {};
+
+  void assertNotPromoted(String search) {
+    var node = findNode.simple(search);
+    var actualType = promotedTypes[node];
+    expect(actualType, isNull, reason: search);
+  }
+
+  void assertPromoted(String search, String expectedType) {
+    var node = findNode.simple(search);
+    var actualType = promotedTypes[node];
+    if (actualType == null) {
+      fail('$expectedType expected, but actually not promoted\n$search');
+    }
+    assertElementTypeString(actualType, expectedType);
+  }
+
+  test_assignment() async {
+    await trackCode(r'''
+f(Object x) {
+  if (x is String) {
+    x = 42;
+    x; // 1
+  }
+}
+''');
+    assertNotPromoted('x; // 1');
+  }
+
+  test_binaryExpression_ifNull() async {
+    await trackCode(r'''
+void f(Object x) {
+  ((x is num) || (throw 1)) ?? ((x is int) || (throw 2));
+  x; // 1
+}
+''');
+    assertPromoted('x; // 1', 'num');
+  }
+
+  test_binaryExpression_ifNull_rightUnPromote() async {
+    await trackCode(r'''
+void f(Object x, Object y, Object z) {
+  if (x is int) {
+    x; // 1
+    y ?? (x = z);
+    x; // 2
+  }
+}
+''');
+    assertPromoted('x; // 1', 'int');
+    assertNotPromoted('x; // 2');
+  }
+
+  test_conditional_both() async {
+    await trackCode(r'''
+void f(bool b, Object x) {
+  b ? ((x is num) || (throw 1)) : ((x is int) || (throw 2));
+  x; // 1
+}
+''');
+    assertPromoted('x; // 1', 'num');
+  }
+
+  test_conditional_else() async {
+    await trackCode(r'''
+void f(bool b, Object x) {
+  b ? 0 : ((x is int) || (throw 2));
+  x; // 1
+}
+''');
+    assertNotPromoted('x; // 1');
+  }
+
+  test_conditional_then() async {
+    await trackCode(r'''
+void f(bool b, Object x) {
+  b ? ((x is num) || (throw 1)) : 0;
+  x; // 1
+}
+''');
+    assertNotPromoted('x; // 1');
+  }
+
+  test_do_condition_isNotType() async {
+    await trackCode(r'''
+void f(Object x) {
+  do {
+    x; // 1
+    x = '';
+  } while (x is! String)
+  x; // 2
+}
+''');
+    assertNotPromoted('x; // 1');
+    assertPromoted('x; // 2', 'String');
+  }
+
+  test_do_condition_isType() async {
+    await trackCode(r'''
+void f(Object x) {
+  do {
+    x; // 1
+  } while (x is String)
+  x; // 2
+}
+''');
+    assertNotPromoted('x; // 1');
+    assertNotPromoted('x; // 2');
+  }
+
+  test_do_outerIsType() async {
+    await trackCode(r'''
+void f(bool b, Object x) {
+  if (x is String) {
+    do {
+      x; // 1
+    } while (b);
+    x; // 2
+  }
+}
+''');
+    assertPromoted('x; // 1', 'String');
+    assertPromoted('x; // 2', 'String');
+  }
+
+  test_do_outerIsType_loopAssigned_body() async {
+    await trackCode(r'''
+void f(bool b, Object x) {
+  if (x is String) {
+    do {
+      x; // 1
+      x = x.length;
+    } while (b);
+    x; // 2
+  }
+}
+''');
+    assertNotPromoted('x; // 1');
+    assertNotPromoted('x; // 2');
+  }
+
+  test_do_outerIsType_loopAssigned_condition() async {
+    await trackCode(r'''
+void f(bool b, Object x) {
+  if (x is String) {
+    do {
+      x; // 1
+      x = x.length;
+    } while (x != 0);
+    x; // 2
+  }
+}
+''');
+    assertNotPromoted('x != 0');
+    assertNotPromoted('x; // 1');
+    assertNotPromoted('x; // 2');
+  }
+
+  test_do_outerIsType_loopAssigned_condition2() async {
+    await trackCode(r'''
+void f(bool b, Object x) {
+  if (x is String) {
+    do {
+      x; // 1
+    } while ((x = 1) != 0);
+    x; // 2
+  }
+}
+''');
+    assertNotPromoted('x; // 1');
+    assertNotPromoted('x; // 2');
+  }
+
+  test_for_outerIsType() async {
+    await trackCode(r'''
+void f(bool b, Object x) {
+  if (x is String) {
+    for (; b;) {
+      x; // 1
+    }
+    x; // 2
+  }
+}
+''');
+    assertPromoted('x; // 1', 'String');
+    assertPromoted('x; // 2', 'String');
+  }
+
+  test_for_outerIsType_loopAssigned_body() async {
+    await trackCode(r'''
+void f(bool b, Object x) {
+  if (x is String) {
+    for (; b;) {
+      x; // 1
+      x = 42;
+    }
+    x; // 2
+  }
+}
+''');
+    assertNotPromoted('x; // 1');
+    assertNotPromoted('x; // 2');
+  }
+
+  test_for_outerIsType_loopAssigned_condition() async {
+    await trackCode(r'''
+void f(Object x) {
+  if (x is String) {
+    for (; (x = 42) > 0;) {
+      x; // 1
+    }
+    x; // 2
+  }
+}
+''');
+    assertNotPromoted('x; // 1');
+    assertNotPromoted('x; // 2');
+  }
+
+  test_for_outerIsType_loopAssigned_updaters() async {
+    await trackCode(r'''
+void f(bool b, Object x) {
+  if (x is String) {
+    for (; b; x = 42) {
+      x; // 1
+    }
+    x; // 2
+  }
+}
+''');
+    assertNotPromoted('x; // 1');
+    assertNotPromoted('x; // 2');
+  }
+
+  test_forEach_outerIsType_loopAssigned() async {
+    await trackCode(r'''
+void f(Object x) {
+  if (x is String) {
+    for (var _ in (v1 = [0, 1, 2])) {
+      x; // 1
+      x = 42;
+    }
+    x; // 2
+  }
+}
+''');
+    assertNotPromoted('x; // 1');
+    assertNotPromoted('x; // 2');
+  }
+
+  test_functionExpression_isType() async {
+    await trackCode(r'''
+void f() {
+  void g(Object x) {
+    if (x is String) {
+      x; // 1
+    }
+    x = 42;
+  }
+}
+''');
+    assertPromoted('x; // 1', 'String');
+  }
+
+  test_functionExpression_isType_mutatedInClosure2() async {
+    await trackCode(r'''
+void f() {
+  void g(Object x) {
+    if (x is String) {
+      x; // 1
+    }
+    
+    void h() {
+      x = 42;
+    }
+  }
+}
+''');
+    assertNotPromoted('x; // 1');
+  }
+
+  test_functionExpression_outerIsType_assignedOutside() async {
+    await trackCode(r'''
+void f(Object x) {
+  void Function() g;
+  
+  if (x is String) {
+    x; // 1
+
+    g = () {
+      x; // 2
+    }
+  }
+
+  x = 42;
+  x; // 3
+  g();
+}
+''');
+    assertPromoted('x; // 1', 'String');
+    assertNotPromoted('x; // 2');
+    assertNotPromoted('x; // 3');
+  }
+
+  test_if_combine_empty() async {
+    await trackCode(r'''
+main(bool b, Object v) {
+  if (b) {
+    v is int || (throw 1);
+  } else {
+    v is String || (throw 2);
+  }
+  v; // 3
+}
+''');
+    assertNotPromoted('v; // 3');
+  }
+
+  test_if_conditional_isNotType() async {
+    await trackCode(r'''
+f(bool b, Object v) {
+  if (b ? (v is! int) : (v is! num)) {
+    v; // 1
+  } else {
+    v; // 2
+  }
+  v; // 3
+}
+''');
+    assertNotPromoted('v; // 1');
+    assertPromoted('v; // 2', 'num');
+    assertNotPromoted('v; // 3');
+  }
+
+  test_if_conditional_isType() async {
+    await trackCode(r'''
+f(bool b, Object v) {
+  if (b ? (v is int) : (v is num)) {
+    v; // 1
+  } else {
+    v; // 2
+  }
+  v; // 3
+}
+''');
+    assertPromoted('v; // 1', 'num');
+    assertNotPromoted('v; // 2');
+    assertNotPromoted('v; // 3');
+  }
+
+  test_if_isNotType() async {
+    await trackCode(r'''
+main(v) {
+  if (v is! String) {
+    v; // 1
+  } else {
+    v; // 2
+  }
+  v; // 3
+}
+''');
+    assertNotPromoted('v; // 1');
+    assertPromoted('v; // 2', 'String');
+    assertNotPromoted('v; // 3');
+  }
+
+  test_if_isNotType_return() async {
+    await trackCode(r'''
+main(v) {
+  if (v is! String) return;
+  v; // ref
+}
+''');
+    assertPromoted('v; // ref', 'String');
+  }
+
+  test_if_isNotType_throw() async {
+    await trackCode(r'''
+main(v) {
+  if (v is! String) throw 42;
+  v; // ref
+}
+''');
+    assertPromoted('v; // ref', 'String');
+  }
+
+  test_if_isType() async {
+    await trackCode(r'''
+main(v) {
+  if (v is String) {
+    v; // 1
+  } else {
+    v; // 2
+  }
+  v; // 3
+}
+''');
+    assertPromoted('v; // 1', 'String');
+    assertNotPromoted('v; // 2');
+    assertNotPromoted('v; // 3');
+  }
+
+  test_if_isType_thenNonBoolean() async {
+    await trackCode(r'''
+f(Object x) {
+  if ((x is String) != 3) {
+    x; // 1
+  }
+}
+''');
+    assertNotPromoted('x; // 1');
+  }
+
+  test_if_logicalNot_isType() async {
+    await trackCode(r'''
+main(v) {
+  if (!(v is String)) {
+    v; // 1
+  } else {
+    v; // 2
+  }
+  v; // 3
+}
+''');
+    assertNotPromoted('v; // 1');
+    assertPromoted('v; // 2', 'String');
+    assertNotPromoted('v; // 3');
+  }
+
+  test_if_then_isNotType_return() async {
+    await trackCode(r'''
+void f(bool b, Object x) {
+  if (b) {
+    if (x is! String) return;
+  }
+  x; // 1
+}
+''');
+    assertNotPromoted('x; // 1');
+  }
+
+  test_logicalOr_throw() async {
+    await trackCode(r'''
+main(v) {
+  v is String || (throw 42);
+  v; // ref
+}
+''');
+    assertPromoted('v; // ref', 'String');
+  }
+
+  test_potentiallyMutatedInClosure() async {
+    await trackCode(r'''
+f(Object x) {
+  localFunction() {
+    x = 42;
+  }
+
+  if (x is String) {
+    localFunction();
+    x; // 1
+  }
+}
+''');
+    assertNotPromoted('x; // 1');
+  }
+
+  test_potentiallyMutatedInScope() async {
+    await trackCode(r'''
+f(Object x) {
+  if (x is String) {
+    x; // 1
+  }
+
+  x = 42;
+}
+''');
+    assertPromoted('x; // 1', 'String');
+  }
+
+  test_switch_outerIsType_assignedInCase() async {
+    await trackCode(r'''
+void f(int e, Object x) {
+  if (x is String) {
+    switch (e) {
+      L: case 1:
+        x; // 1
+        break;
+      case 2: // no label
+        x; // 2
+        break;
+      case 3:
+        x = 42;
+        continue L;
+    }
+    x; // 3
+  }
+}
+''');
+    assertNotPromoted('x; // 1');
+    assertPromoted('x; // 2', 'String');
+    assertNotPromoted('x; // 3');
+  }
+
+  test_tryCatch_assigned_body() async {
+    await trackCode(r'''
+void f(Object x) {
+  if (x is! String) return;
+  x; // 1
+  try {
+    x = 42;
+    g(); // might throw
+    if (x is! String) return;
+    x; // 2
+  } catch (_) {}
+  x; // 3
+}
+
+void g() {}
+''');
+    assertPromoted('x; // 1', 'String');
+    assertPromoted('x; // 2', 'String');
+    assertNotPromoted('x; // 3');
+  }
+
+  test_tryCatch_isNotType_exit_body() async {
+    await trackCode(r'''
+void f(Object x) {
+  try {
+    if (x is! String) return;
+    x; // 1
+  } catch (_) {}
+  x; // 2
+}
+
+void g() {}
+''');
+    assertPromoted('x; // 1', 'String');
+    assertNotPromoted('x; // 2');
+  }
+
+  test_tryCatch_isNotType_exit_body_catch() async {
+    await trackCode(r'''
+void f(Object x) {
+  try {
+    if (x is! String) return;
+    x; // 1
+  } catch (_) {
+    if (x is! String) return;
+    x; // 2
+  }
+  x; // 3
+}
+
+void g() {}
+''');
+    assertPromoted('x; // 1', 'String');
+    assertPromoted('x; // 2', 'String');
+    assertPromoted('x; // 3', 'String');
+  }
+
+  test_tryCatch_isNotType_exit_body_catchRethrow() async {
+    await trackCode(r'''
+void f(Object x) {
+  try {
+    if (x is! String) return;
+    x; // 1
+  } catch (_) {
+    x; // 2
+    rethrow;
+  }
+  x; // 3
+}
+
+void g() {}
+''');
+    assertPromoted('x; // 1', 'String');
+    assertNotPromoted('x; // 2');
+    assertPromoted('x; // 3', 'String');
+  }
+
+  test_tryCatch_isNotType_exit_catch() async {
+    await trackCode(r'''
+void f(Object x) {
+  try {
+  } catch (_) {
+    if (x is! String) return;
+    x; // 1
+  }
+  x; // 2
+}
+
+void g() {}
+''');
+    assertPromoted('x; // 1', 'String');
+    assertNotPromoted('x; // 2');
+  }
+
+  test_tryCatchFinally_outerIsType() async {
+    await trackCode(r'''
+void f(Object x) {
+  if (x is String) {
+    try {
+      x; // 1
+    } catch (_) {
+      x; // 2
+    } finally {
+      x; // 3
+    }
+    x; // 4
+  }
+}
+
+void g() {}
+''');
+    assertPromoted('x; // 1', 'String');
+    assertPromoted('x; // 2', 'String');
+    assertPromoted('x; // 3', 'String');
+    assertPromoted('x; // 4', 'String');
+  }
+
+  test_tryCatchFinally_outerIsType_assigned_body() async {
+    await trackCode(r'''
+void f(Object x) {
+  if (x is String) {
+    try {
+      x; // 1
+      x = 42;
+      g();
+    } catch (_) {
+      x; // 2
+    } finally {
+      x; // 3
+    }
+    x; // 4
+  }
+}
+
+void g() {}
+''');
+    assertPromoted('x; // 1', 'String');
+    assertNotPromoted('x; // 2');
+    assertNotPromoted('x; // 3');
+    assertNotPromoted('x; // 4');
+  }
+
+  test_tryCatchFinally_outerIsType_assigned_catch() async {
+    await trackCode(r'''
+void f(Object x) {
+  if (x is String) {
+    try {
+      x; // 1
+    } catch (_) {
+      x; // 2
+      x = 42;
+    } finally {
+      x; // 3
+    }
+    x; // 4
+  }
+}
+''');
+    assertPromoted('x; // 1', 'String');
+    assertPromoted('x; // 2', 'String');
+    assertNotPromoted('x; // 3');
+    assertNotPromoted('x; // 4');
+  }
+
+  test_tryFinally_outerIsType_assigned_body() async {
+    await trackCode(r'''
+void f(Object x) {
+  if (x is String) {
+    try {
+      x; // 1
+      x = 42;
+    } finally {
+      x; // 2
+    }
+    x; // 3
+  }
+}
+''');
+    assertPromoted('x; // 1', 'String');
+    assertNotPromoted('x; // 2');
+    assertNotPromoted('x; // 3');
+  }
+
+  test_tryFinally_outerIsType_assigned_finally() async {
+    await trackCode(r'''
+void f(Object x) {
+  if (x is String) {
+    try {
+      x; // 1
+    } finally {
+      x; // 2
+      x = 42;
+    }
+    x; // 3
+  }
+}
+''');
+    assertPromoted('x; // 1', 'String');
+    assertPromoted('x; // 2', 'String');
+    assertNotPromoted('x; // 3');
+  }
+
+  test_while_condition_false() async {
+    await trackCode(r'''
+void f(Object x) {
+  while (x is! String) {
+    x; // 1
+  }
+  x; // 2
+}
+''');
+    assertNotPromoted('x; // 1');
+    assertPromoted('x; // 2', 'String');
+  }
+
+  test_while_condition_true() async {
+    await trackCode(r'''
+void f(Object x) {
+  while (x is String) {
+    x; // 1
+  }
+  x; // 2
+}
+''');
+    assertPromoted('x; // 1', 'String');
+    assertNotPromoted('x; // 2');
+  }
+
+  test_while_outerIsType() async {
+    await trackCode(r'''
+void f(bool b, Object x) {
+  if (x is String) {
+    while (b) {
+      x; // 1
+    }
+    x; // 2
+  }
+}
+''');
+    assertPromoted('x; // 1', 'String');
+    assertPromoted('x; // 2', 'String');
+  }
+
+  test_while_outerIsType_loopAssigned_body() async {
+    await trackCode(r'''
+void f(bool b, Object x) {
+  if (x is String) {
+    while (b) {
+      x; // 1
+      x = x.length;
+    }
+    x; // 2
+  }
+}
+''');
+    assertNotPromoted('x; // 1');
+    assertNotPromoted('x; // 2');
+  }
+
+  test_while_outerIsType_loopAssigned_condition() async {
+    await trackCode(r'''
+void f(bool b, Object x) {
+  if (x is String) {
+    while (x != 0) {
+      x; // 1
+      x = x.length;
+    }
+    x; // 2
+  }
+}
+''');
+    assertNotPromoted('x != 0');
+    assertNotPromoted('x; // 1');
+    assertNotPromoted('x; // 2');
+  }
+
+  /// Resolve the given [code] and track assignments in the unit.
+  Future<void> trackCode(String code) async {
+    addTestFile(code);
+    await resolveTestFile();
+
+    var unit = result.unit;
+
+    var loopAssignedVariables = LoopAssignedVariables();
+    unit.accept(_LoopAssignedVariablesVisitor(loopAssignedVariables));
+
+    var typeSystem = unit.declaredElement.context.typeSystem;
+    unit.accept(_AstVisitor(
+      typeSystem,
+      loopAssignedVariables,
+      promotedTypes,
+      [],
+      [],
+      [],
+    ));
+  }
+}
+
+/// [AstVisitor] that drives the [flow] in the way we expect the resolver
+/// will do in production.
+class _AstVisitor extends GeneralizingAstVisitor<void> {
+  static final trueLiteral = astFactory.booleanLiteral(null, true);
+
+  final TypeSystem typeSystem;
+  final LoopAssignedVariables loopAssignedVariables;
+  final Map<AstNode, DartType> promotedTypes;
+  final List<LocalVariableElement> readBeforeWritten;
+  final List<AstNode> unreachableNodes;
+  final List<FunctionBody> functionBodiesThatDontComplete;
+
+  FlowAnalysis flow;
+
+  _AstVisitor(
+      this.typeSystem,
+      this.loopAssignedVariables,
+      this.promotedTypes,
+      this.readBeforeWritten,
+      this.unreachableNodes,
+      this.functionBodiesThatDontComplete);
+
+  @override
+  void visitAssignmentExpression(AssignmentExpression node) {
+    var left = node.leftHandSide;
+    var right = node.rightHandSide;
+
+    VariableElement localElement;
+    if (left is SimpleIdentifier) {
+      var element = left.staticElement;
+      if (element is VariableElement) {
+        localElement = element;
+      }
+    }
+
+    if (localElement != null) {
+      var isPure = node.operator.type == TokenType.EQ;
+      if (!isPure) {
+        flow.read(localElement);
+      }
+      right.accept(this);
+      flow.write(localElement);
+    } else {
+      left.accept(this);
+      right.accept(this);
+    }
+  }
+
+  @override
+  void visitBinaryExpression(BinaryExpression node) {
+    var left = node.leftOperand;
+    var right = node.rightOperand;
+
+    var operator = node.operator.type;
+
+    if (operator == TokenType.AMPERSAND_AMPERSAND) {
+      left.accept(this);
+
+      flow.logicalAnd_rightBegin(node);
+      _checkUnreachableNode(node.rightOperand);
+      right.accept(this);
+
+      flow.logicalAnd_end(node);
+    } else if (operator == TokenType.BAR_BAR) {
+      left.accept(this);
+
+      flow.logicalOr_rightBegin(node);
+      _checkUnreachableNode(node.rightOperand);
+      right.accept(this);
+
+      flow.logicalOr_end(node);
+    } else if (operator == TokenType.QUESTION_QUESTION) {
+      left.accept(this);
+
+      flow.ifNullExpression_rightBegin();
+      right.accept(this);
+
+      flow.ifNullExpression_end();
+    } else {
+      left.accept(this);
+      right.accept(this);
+    }
+  }
+
+  @override
+  void visitBlockFunctionBody(BlockFunctionBody node) {
+    var isFlowOwner = flow == null;
+    flow ??= FlowAnalysis(typeSystem, node);
+
+    super.visitBlockFunctionBody(node);
+
+    if (isFlowOwner) {
+      readBeforeWritten.addAll(flow.readBeforeWritten);
+
+      if (!flow.isReachable) {
+        functionBodiesThatDontComplete.add(node);
+      }
+
+      flow.verifyStackEmpty();
+      flow = null;
+    }
+  }
+
+  @override
+  void visitBooleanLiteral(BooleanLiteral node) {
+    super.visitBooleanLiteral(node);
+    if (_isFalseLiteral(node)) {
+      flow.falseLiteral(node);
+    }
+    if (_isTrueLiteral(node)) {
+      flow.trueLiteral(node);
+    }
+  }
+
+  @override
+  void visitBreakStatement(BreakStatement node) {
+    super.visitBreakStatement(node);
+    var target = _getLabelTarget(node, node.label?.staticElement);
+    flow.handleBreak(target);
+  }
+
+  @override
+  void visitConditionalExpression(ConditionalExpression node) {
+    var condition = node.condition;
+    var thenExpression = node.thenExpression;
+    var elseExpression = node.elseExpression;
+
+    condition.accept(this);
+
+    flow.conditional_thenBegin(node);
+    _checkUnreachableNode(node.thenExpression);
+    thenExpression.accept(this);
+    var isBool = thenExpression.staticType.isDartCoreBool;
+
+    flow.conditional_elseBegin(node, isBool);
+    _checkUnreachableNode(node.elseExpression);
+    elseExpression.accept(this);
+
+    flow.conditional_end(node, isBool);
+  }
+
+  @override
+  void visitContinueStatement(ContinueStatement node) {
+    super.visitContinueStatement(node);
+    var target = _getLabelTarget(node, node.label?.staticElement);
+    flow.handleContinue(target);
+  }
+
+  @override
+  void visitDoStatement(DoStatement node) {
+    _checkUnreachableNode(node);
+
+    var body = node.body;
+    var condition = node.condition;
+
+    flow.doStatement_bodyBegin(node, loopAssignedVariables[node]);
+    body.accept(this);
+
+    flow.doStatement_conditionBegin();
+    condition.accept(this);
+
+    flow.doStatement_end(node);
+  }
+
+  @override
+  void visitForEachStatement(ForEachStatement node) {
+    _checkUnreachableNode(node);
+
+    var iterable = node.iterable;
+    var body = node.body;
+
+    iterable.accept(this);
+    flow.forEachStatement_bodyBegin(loopAssignedVariables[node]);
+
+    body.accept(this);
+
+    flow.forEachStatement_end();
+  }
+
+  @override
+  void visitForStatement(ForStatement node) {
+    _checkUnreachableNode(node);
+
+    var condition = node.condition;
+
+    node.initialization?.accept(this);
+    node.variables?.accept(this);
+
+    flow.forStatement_conditionBegin(loopAssignedVariables[node]);
+    if (condition != null) {
+      condition.accept(this);
+    } else {
+      flow.trueLiteral(trueLiteral);
+    }
+
+    flow.forStatement_bodyBegin(node, condition ?? trueLiteral);
+    node.body.accept(this);
+
+    flow.forStatement_updaterBegin();
+    node.updaters?.accept(this);
+
+    flow.forStatement_end();
+  }
+
+  @override
+  void visitForStatement2(ForStatement2 node) {
+    ForLoopParts parts = node.forLoopParts;
+    if (parts is ForEachParts) {
+      parts.iterable?.accept(this);
+
+      flow.forEachStatement_bodyBegin(loopAssignedVariables[node]);
+
+      node.body.accept(this);
+
+      flow.forEachStatement_end();
+      return;
+    }
+    VariableDeclarationList variables;
+    Expression initialization;
+    Expression condition;
+    NodeList<Expression> updaters;
+    if (parts is ForPartsWithDeclarations) {
+      variables = parts.variables;
+      condition = parts.condition;
+      updaters = parts.updaters;
+    } else if (parts is ForPartsWithExpression) {
+      initialization = parts.initialization;
+      condition = parts.condition;
+      updaters = parts.updaters;
+    }
+    initialization?.accept(this);
+    variables?.accept(this);
+
+    flow.forStatement_conditionBegin(loopAssignedVariables[node]);
+    if (condition != null) {
+      condition.accept(this);
+    } else {
+      flow.trueLiteral(trueLiteral);
+    }
+
+    flow.forStatement_bodyBegin(node, condition ?? trueLiteral);
+    node.body.accept(this);
+
+    flow.forStatement_updaterBegin();
+    updaters?.accept(this);
+
+    flow.forStatement_end();
+  }
+
+  @override
+  void visitFunctionExpression(FunctionExpression node) {
+    flow?.functionExpression_begin();
+    super.visitFunctionExpression(node);
+    flow?.functionExpression_end();
+  }
+
+  @override
+  void visitIfStatement(IfStatement node) {
+    _checkUnreachableNode(node);
+
+    var condition = node.condition;
+    var thenStatement = node.thenStatement;
+    var elseStatement = node.elseStatement;
+
+    condition.accept(this);
+
+    flow.ifStatement_thenBegin(node);
+    thenStatement.accept(this);
+
+    if (elseStatement != null) {
+      flow.ifStatement_elseBegin();
+      elseStatement.accept(this);
+    }
+
+    flow.ifStatement_end(elseStatement != null);
+  }
+
+  @override
+  void visitIsExpression(IsExpression node) {
+    super.visitIsExpression(node);
+    var expression = node.expression;
+    var typeAnnotation = node.type;
+
+    if (expression is SimpleIdentifier) {
+      var element = expression.staticElement;
+      if (element is VariableElement) {
+        flow.isExpression_end(node, element, typeAnnotation.type);
+      }
+    }
+  }
+
+  @override
+  void visitPrefixExpression(PrefixExpression node) {
+    var operand = node.operand;
+
+    var operator = node.operator.type;
+    if (operator == TokenType.BANG) {
+      operand.accept(this);
+      flow.logicalNot_end(node);
+    } else {
+      operand.accept(this);
+    }
+  }
+
+  @override
+  void visitRethrowExpression(RethrowExpression node) {
+    super.visitRethrowExpression(node);
+    flow.handleExit();
+  }
+
+  @override
+  void visitReturnStatement(ReturnStatement node) {
+    super.visitReturnStatement(node);
+    flow.handleExit();
+  }
+
+  @override
+  void visitSimpleIdentifier(SimpleIdentifier node) {
+    var element = node.staticElement;
+    var isLocalVariable = element is LocalVariableElement;
+    if (isLocalVariable || element is ParameterElement) {
+      if (node.inGetterContext()) {
+        if (isLocalVariable) {
+          flow.read(element);
+        }
+
+        var promotedType = flow?.promotedType(element);
+        if (promotedType != null) {
+          promotedTypes[node] = promotedType;
+        }
+      }
+    }
+
+    super.visitSimpleIdentifier(node);
+  }
+
+  @override
+  void visitStatement(Statement node) {
+    _checkUnreachableNode(node);
+    super.visitStatement(node);
+  }
+
+  @override
+  void visitSwitchStatement(SwitchStatement node) {
+    _checkUnreachableNode(node);
+
+    node.expression.accept(this);
+    flow.switchStatement_expressionEnd(node);
+
+    var assignedInCases = loopAssignedVariables[node];
+
+    var members = node.members;
+    var membersLength = members.length;
+    var hasDefault = false;
+    for (var i = 0; i < membersLength; i++) {
+      var member = members[i];
+
+      flow.switchStatement_beginCase(
+        member.labels.isNotEmpty
+            ? assignedInCases
+            : LoopAssignedVariables.emptySet,
+      );
+      member.accept(this);
+
+      // Implicit `break` at the end of `default`.
+      if (member is SwitchDefault) {
+        hasDefault = true;
+        flow.handleBreak(node);
+      }
+    }
+
+    flow.switchStatement_end(node, hasDefault);
+  }
+
+  @override
+  void visitThrowExpression(ThrowExpression node) {
+    super.visitThrowExpression(node);
+    flow.handleExit();
+  }
+
+  @override
+  void visitTryStatement(TryStatement node) {
+    _checkUnreachableNode(node);
+
+    var body = node.body;
+    var catchClauses = node.catchClauses;
+
+    flow.tryStatement_bodyBegin();
+    body.accept(this);
+    flow.tryStatement_bodyEnd(loopAssignedVariables[node.body]);
+
+    var catchLength = catchClauses.length;
+    for (var i = 0; i < catchLength; ++i) {
+      var catchClause = catchClauses[i];
+      flow.tryStatement_catchBegin();
+      catchClause.accept(this);
+      flow.tryStatement_catchEnd();
+    }
+
+    flow.tryStatement_finallyBegin();
+    node.finallyBlock?.accept(this);
+
+    flow.tryStatement_end();
+  }
+
+  @override
+  void visitVariableDeclarationStatement(VariableDeclarationStatement node) {
+    var variables = node.variables.variables;
+    for (var i = 0; i < variables.length; ++i) {
+      var variable = variables[i];
+      flow.add(variable.declaredElement,
+          assigned: variable.initializer != null);
+    }
+
+    super.visitVariableDeclarationStatement(node);
+  }
+
+  @override
+  void visitWhileStatement(WhileStatement node) {
+    _checkUnreachableNode(node);
+
+    var condition = node.condition;
+    var body = node.body;
+
+    flow.whileStatement_conditionBegin(loopAssignedVariables[node]);
+    condition.accept(this);
+
+    flow.whileStatement_bodyBegin(node);
+    body.accept(this);
+
+    flow.whileStatement_end();
+  }
+
+  /// Mark the [node] as unreachable if it is not covered by another node that
+  /// is already known to be unreachable.
+  void _checkUnreachableNode(AstNode node) {
+    if (flow.isReachable) return;
+
+    // Ignore the [node] if it is fully covered by the last unreachable.
+    if (unreachableNodes.isNotEmpty) {
+      var last = unreachableNodes.last;
+      if (node.offset >= last.offset && node.end <= last.end) return;
+    }
+
+    unreachableNodes.add(node);
+  }
+
+  /// This code has OK performance for tests, but think if there is something
+  /// better when using in production.
+  AstNode _getLabelTarget(AstNode node, LabelElement element) {
+    for (; node != null; node = node.parent) {
+      if (node is DoStatement ||
+          node is ForEachStatement ||
+          node is ForStatement ||
+          node is SwitchStatement ||
+          node is WhileStatement) {
+        if (element == null) {
+          return node;
+        }
+        var parent = node.parent;
+        if (parent is LabeledStatement) {
+          for (var nodeLabel in parent.labels) {
+            if (identical(nodeLabel.label.staticElement, element)) {
+              return node;
+            }
+          }
+        }
+      }
+      if (element != null && node is SwitchStatement) {
+        for (var member in node.members) {
+          for (var nodeLabel in member.labels) {
+            if (identical(nodeLabel.label.staticElement, element)) {
+              return node;
+            }
+          }
+        }
+      }
+    }
+    return null;
+  }
+
+  static bool _isFalseLiteral(AstNode node) {
+    return node is BooleanLiteral && !node.value;
+  }
+
+  static bool _isTrueLiteral(AstNode node) {
+    return node is BooleanLiteral && node.value;
+  }
+}
+
+class _LoopAssignedVariablesVisitor extends RecursiveAstVisitor<void> {
+  final LoopAssignedVariables loopAssignedVariables;
+
+  _LoopAssignedVariablesVisitor(this.loopAssignedVariables);
+
+  @override
+  void visitAssignmentExpression(AssignmentExpression node) {
+    var left = node.leftHandSide;
+
+    super.visitAssignmentExpression(node);
+
+    if (left is SimpleIdentifier) {
+      var element = left.staticElement;
+      if (element is VariableElement) {
+        loopAssignedVariables.write(element);
+      }
+    }
+  }
+
+  @override
+  void visitDoStatement(DoStatement node) {
+    loopAssignedVariables.beginLoop();
+    super.visitDoStatement(node);
+    loopAssignedVariables.endLoop(node);
+  }
+
+  @override
+  void visitForEachStatement(ForEachStatement node) {
+    var iterable = node.iterable;
+    var body = node.body;
+
+    iterable.accept(this);
+
+    loopAssignedVariables.beginLoop();
+    body.accept(this);
+    loopAssignedVariables.endLoop(node);
+  }
+
+  @override
+  void visitForStatement(ForStatement node) {
+    node.initialization?.accept(this);
+    node.variables?.accept(this);
+
+    loopAssignedVariables.beginLoop();
+    node.condition?.accept(this);
+    node.body.accept(this);
+    node.updaters?.accept(this);
+    loopAssignedVariables.endLoop(node);
+  }
+
+  @override
+  void visitForStatement2(ForStatement2 node) {
+    ForLoopParts parts = node.forLoopParts;
+    Expression initialization;
+    VariableDeclarationList variables;
+    Expression iterable;
+    Expression condition;
+    NodeList<Expression> updaters;
+    if (parts is ForPartsWithDeclarations) {
+      variables = parts.variables;
+      condition = parts.condition;
+      updaters = parts.updaters;
+    } else if (parts is ForPartsWithExpression) {
+      initialization = parts.initialization;
+      condition = parts.condition;
+      updaters = parts.updaters;
+    } else if (parts is ForEachParts) {
+      iterable = parts.iterable;
+    }
+    initialization?.accept(this);
+    variables?.accept(this);
+    iterable?.accept(this);
+
+    loopAssignedVariables.beginLoop();
+    condition?.accept(this);
+    node.body.accept(this);
+    updaters?.accept(this);
+    loopAssignedVariables.endLoop(node);
+  }
+
+  @override
+  void visitSwitchStatement(SwitchStatement node) {
+    var expression = node.expression;
+    var members = node.members;
+
+    expression.accept(this);
+
+    loopAssignedVariables.beginLoop();
+    members.accept(this);
+    loopAssignedVariables.endLoop(node);
+  }
+
+  @override
+  void visitTryStatement(TryStatement node) {
+    loopAssignedVariables.beginLoop();
+    node.body.accept(this);
+    loopAssignedVariables.endLoop(node.body);
+
+    node.catchClauses.accept(this);
+    node.finallyBlock?.accept(this);
+  }
+
+  @override
+  void visitWhileStatement(WhileStatement node) {
+    loopAssignedVariables.beginLoop();
+    super.visitWhileStatement(node);
+    loopAssignedVariables.endLoop(node);
+  }
+}
diff --git a/pkg/analyzer/test/src/dart/resolution/for_in_test.dart b/pkg/analyzer/test/src/dart/resolution/for_in_test.dart
index 7ec1a40..e06e3a7 100644
--- a/pkg/analyzer/test/src/dart/resolution/for_in_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/for_in_test.dart
@@ -7,12 +7,10 @@
 
 import 'driver_resolution.dart';
 import 'resolution.dart';
-import 'task_resolution.dart';
 
 main() {
   defineReflectiveSuite(() {
     defineReflectiveTests(ForInDriverResolutionTest);
-    defineReflectiveTests(ForInTaskResolutionTest);
   });
 }
 
@@ -42,7 +40,3 @@
     assertTypeDynamic(pRef);
   }
 }
-
-@reflectiveTest
-class ForInTaskResolutionTest extends TaskResolutionTest
-    with ForInResolutionMixin {}
diff --git a/pkg/analyzer/test/src/dart/resolution/generic_type_alias_test.dart b/pkg/analyzer/test/src/dart/resolution/generic_type_alias_test.dart
index 2e64644..891c0f7 100644
--- a/pkg/analyzer/test/src/dart/resolution/generic_type_alias_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/generic_type_alias_test.dart
@@ -8,12 +8,10 @@
 
 import 'driver_resolution.dart';
 import 'resolution.dart';
-import 'task_resolution.dart';
 
 main() {
   defineReflectiveSuite(() {
     defineReflectiveTests(GenericTypeAliasDriverResolutionTest);
-    defineReflectiveTests(GenericTypeAliasTaskResolutionTest);
   });
 }
 
@@ -151,7 +149,3 @@
     assertElementTypeString(u.bound, 'B');
   }
 }
-
-@reflectiveTest
-class GenericTypeAliasTaskResolutionTest extends TaskResolutionTest
-    with GenericTypeAliasResolutionMixin {}
diff --git a/pkg/analyzer/test/src/dart/resolution/import_prefix_test.dart b/pkg/analyzer/test/src/dart/resolution/import_prefix_test.dart
index b13db90..647c4c8 100644
--- a/pkg/analyzer/test/src/dart/resolution/import_prefix_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/import_prefix_test.dart
@@ -8,12 +8,10 @@
 
 import 'driver_resolution.dart';
 import 'resolution.dart';
-import 'task_resolution.dart';
 
 main() {
   defineReflectiveSuite(() {
     defineReflectiveTests(ImportPrefixDriverResolutionTest);
-    defineReflectiveTests(ImportPrefixTaskResolutionTest);
   });
 }
 
@@ -113,7 +111,3 @@
     assertTypeNull(pRef);
   }
 }
-
-@reflectiveTest
-class ImportPrefixTaskResolutionTest extends TaskResolutionTest
-    with ImportPrefixResolutionMixin {}
diff --git a/pkg/analyzer/test/src/dart/resolution/instance_creation_test.dart b/pkg/analyzer/test/src/dart/resolution/instance_creation_test.dart
index 302d84b..a4af48e 100644
--- a/pkg/analyzer/test/src/dart/resolution/instance_creation_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/instance_creation_test.dart
@@ -7,12 +7,10 @@
 
 import 'driver_resolution.dart';
 import 'resolution.dart';
-import 'task_resolution.dart';
 
 main() {
   defineReflectiveSuite(() {
     defineReflectiveTests(InstanceCreationDriverResolutionTest);
-    defineReflectiveTests(InstanceCreationTaskResolutionTest);
   });
 }
 
@@ -152,13 +150,3 @@
     );
   }
 }
-
-@reflectiveTest
-class InstanceCreationTaskResolutionTest extends TaskResolutionTest
-    with InstanceCreationResolutionMixin {
-  @FailingTest(reason: 'Does not report the error.')
-  test_error_newWithInvalidTypeParameters_implicitNew_inference_top() {
-    return super
-        .test_error_newWithInvalidTypeParameters_implicitNew_inference_top();
-  }
-}
diff --git a/pkg/analyzer/test/src/dart/resolution/instance_member_inference_class_test.dart b/pkg/analyzer/test/src/dart/resolution/instance_member_inference_class_test.dart
index ad4b765..4c0fd6a 100644
--- a/pkg/analyzer/test/src/dart/resolution/instance_member_inference_class_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/instance_member_inference_class_test.dart
@@ -6,12 +6,10 @@
 
 import 'driver_resolution.dart';
 import 'resolution.dart';
-import 'task_resolution.dart';
 
 main() {
   defineReflectiveSuite(() {
     defineReflectiveTests(InstanceMemberInferenceClassDriverResolutionTest);
-    defineReflectiveTests(InstanceMemberInferenceClassTaskResolutionTest);
   });
 }
 
@@ -290,7 +288,3 @@
     assertElementTypeString(foo.returnType, 'T');
   }
 }
-
-@reflectiveTest
-class InstanceMemberInferenceClassTaskResolutionTest extends TaskResolutionTest
-    with InstanceMemberInferenceClassMixin {}
diff --git a/pkg/analyzer/test/src/dart/resolution/instance_member_inference_mixin_test.dart b/pkg/analyzer/test/src/dart/resolution/instance_member_inference_mixin_test.dart
index 36db4b0..0ab92025 100644
--- a/pkg/analyzer/test/src/dart/resolution/instance_member_inference_mixin_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/instance_member_inference_mixin_test.dart
@@ -6,12 +6,10 @@
 
 import 'driver_resolution.dart';
 import 'resolution.dart';
-import 'task_resolution.dart';
 
 main() {
   defineReflectiveSuite(() {
     defineReflectiveTests(InstanceMemberInferenceMixinDriverResolutionTest);
-    defineReflectiveTests(InstanceMemberInferenceMixinTaskResolutionTest);
   });
 }
 
@@ -290,7 +288,3 @@
     assertElementTypeString(foo.returnType, 'T');
   }
 }
-
-@reflectiveTest
-class InstanceMemberInferenceMixinTaskResolutionTest extends TaskResolutionTest
-    with InstanceMemberInferenceMixinMixin {}
diff --git a/pkg/analyzer/test/src/dart/resolution/method_invocation_test.dart b/pkg/analyzer/test/src/dart/resolution/method_invocation_test.dart
index a10b0e16..f25fe19 100644
--- a/pkg/analyzer/test/src/dart/resolution/method_invocation_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/method_invocation_test.dart
@@ -43,6 +43,30 @@
     assertSuperExpression(invocation.target);
   }
 
+  test_error_abstractSuperMemberReference_mixin_implements() async {
+    addTestFile(r'''
+class A {
+  void foo(int _) {}
+}
+
+mixin M implements A {
+  void bar() {
+    super.foo(0);
+  }
+}
+''');
+    await resolveTestFile();
+    assertTestErrors([CompileTimeErrorCode.ABSTRACT_SUPER_MEMBER_REFERENCE]);
+
+    var invocation = findNode.methodInvocation('foo(0)');
+    assertMethodInvocation(
+      invocation,
+      findElement.method('foo', of: 'A'),
+      '(int) → void',
+    );
+    assertSuperExpression(invocation.target);
+  }
+
   test_error_abstractSuperMemberReference_mixinHasNoSuchMethod() async {
     addTestFile('''
 class A {
diff --git a/pkg/analyzer/test/src/dart/resolution/mixin_test.dart b/pkg/analyzer/test/src/dart/resolution/mixin_test.dart
index 65cb6d7..496f774 100644
--- a/pkg/analyzer/test/src/dart/resolution/mixin_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/mixin_test.dart
@@ -10,12 +10,10 @@
 
 import 'driver_resolution.dart';
 import 'resolution.dart';
-import 'task_resolution.dart';
 
 main() {
   defineReflectiveSuite(() {
     defineReflectiveTests(MixinDriverResolutionTest);
-    defineReflectiveTests(MixinTaskResolutionTest);
   });
 }
 
@@ -1924,12 +1922,3 @@
     assertTypeDynamic(access);
   }
 }
-
-@reflectiveTest
-class MixinTaskResolutionTest extends TaskResolutionTest
-    with MixinResolutionMixin {
-  @failingTest
-  test_conflictingGenericInterfaces() {
-    return super.test_conflictingGenericInterfaces();
-  }
-}
diff --git a/pkg/analyzer/test/src/dart/resolution/test_all.dart b/pkg/analyzer/test/src/dart/resolution/test_all.dart
index 4848102..d8c0076 100644
--- a/pkg/analyzer/test/src/dart/resolution/test_all.dart
+++ b/pkg/analyzer/test/src/dart/resolution/test_all.dart
@@ -9,6 +9,7 @@
 import 'comment_test.dart' as comment_test;
 import 'constant_test.dart' as constant_test;
 import 'enum_test.dart' as enum_test;
+import 'flow_analysis_test.dart' as flow_analysis_test;
 import 'for_in_test.dart' as for_in_test;
 import 'generic_type_alias_test.dart' as generic_type_alias_test;
 import 'import_prefix_test.dart' as import_prefix_test;
@@ -31,6 +32,7 @@
     comment_test.main();
     constant_test.main();
     enum_test.main();
+    flow_analysis_test.main();
     for_in_test.main();
     generic_type_alias_test.main();
     import_prefix_test.main();
diff --git a/pkg/analyzer/test/src/dart/resolution/top_type_inference_test.dart b/pkg/analyzer/test/src/dart/resolution/top_type_inference_test.dart
index 3c3defe..cdb193e 100644
--- a/pkg/analyzer/test/src/dart/resolution/top_type_inference_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/top_type_inference_test.dart
@@ -7,12 +7,10 @@
 
 import 'driver_resolution.dart';
 import 'resolution.dart';
-import 'task_resolution.dart';
 
 main() {
   defineReflectiveSuite(() {
     defineReflectiveTests(TopTypeInferenceDriverResolutionTest);
-    defineReflectiveTests(TopTypeInferenceTaskResolutionTest);
   });
 }
 
@@ -20,10 +18,6 @@
 class TopTypeInferenceDriverResolutionTest extends DriverResolutionTest
     with TopTypeInstanceMixin {}
 
-@reflectiveTest
-class TopTypeInferenceTaskResolutionTest extends TaskResolutionTest
-    with TopTypeInstanceMixin {}
-
 mixin TopTypeInstanceMixin implements ResolutionTest {
   test_referenceInstanceVariable_withDeclaredType() async {
     addTestFile(r'''
diff --git a/pkg/analyzer/test/src/diagnostics/argument_type_not_assignable_test.dart b/pkg/analyzer/test/src/diagnostics/argument_type_not_assignable_test.dart
index 73966e0..4a1e77b 100644
--- a/pkg/analyzer/test/src/diagnostics/argument_type_not_assignable_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/argument_type_not_assignable_test.dart
@@ -9,13 +9,11 @@
 
 main() {
   defineReflectiveSuite(() {
-    defineReflectiveTests(ArgumentTypeNotAssignableTest);
     defineReflectiveTests(ArgumentTypeNotAssignableTest_Driver);
   });
 }
 
-@reflectiveTest
-class ArgumentTypeNotAssignableTest extends ResolverTestCase {
+abstract class ArgumentTypeNotAssignableTest extends ResolverTestCase {
   test_functionType() async {
     await assertErrorsInCode(r'''
 m() {
diff --git a/pkg/analyzer/test/src/diagnostics/can_be_null_after_null_aware_test.dart b/pkg/analyzer/test/src/diagnostics/can_be_null_after_null_aware_test.dart
index 94f9c00..58447f0 100644
--- a/pkg/analyzer/test/src/diagnostics/can_be_null_after_null_aware_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/can_be_null_after_null_aware_test.dart
@@ -9,13 +9,11 @@
 
 main() {
   defineReflectiveSuite(() {
-    defineReflectiveTests(CanBeNullAfterNullAwareTest);
     defineReflectiveTests(CanBeNullAfterNullAwareTest_Driver);
   });
 }
 
-@reflectiveTest
-class CanBeNullAfterNullAwareTest extends ResolverTestCase {
+abstract class CanBeNullAfterNullAwareTest extends ResolverTestCase {
   test_afterCascade() async {
     await assertErrorsInCode(r'''
 m(x) {
diff --git a/pkg/analyzer/test/src/diagnostics/const_constructor_with_mixin_with_field_test.dart b/pkg/analyzer/test/src/diagnostics/const_constructor_with_mixin_with_field_test.dart
index c864b70..90c0e7d 100644
--- a/pkg/analyzer/test/src/diagnostics/const_constructor_with_mixin_with_field_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/const_constructor_with_mixin_with_field_test.dart
@@ -7,12 +7,10 @@
 
 import '../dart/resolution/driver_resolution.dart';
 import '../dart/resolution/resolution.dart';
-import '../dart/resolution/task_resolution.dart';
 
 main() {
   defineReflectiveSuite(() {
     defineReflectiveTests(ConstConstructorWithMixinWithFieldTest_DriverTest);
-    defineReflectiveTests(ConstConstructorWithMixinWithFieldTest_TaskTest);
   });
 }
 
@@ -139,7 +137,3 @@
 @reflectiveTest
 class ConstConstructorWithMixinWithFieldTest_DriverTest
     extends DriverResolutionTest with ConstConstructorWithMixinWithFieldMixin {}
-
-@reflectiveTest
-class ConstConstructorWithMixinWithFieldTest_TaskTest extends TaskResolutionTest
-    with ConstConstructorWithMixinWithFieldMixin {}
diff --git a/pkg/analyzer/test/src/diagnostics/deprecated_member_use_test.dart b/pkg/analyzer/test/src/diagnostics/deprecated_member_use_test.dart
index 1dcc23e..2f91806 100644
--- a/pkg/analyzer/test/src/diagnostics/deprecated_member_use_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/deprecated_member_use_test.dart
@@ -3,7 +3,6 @@
 // BSD-style license that can be found in the LICENSE file.
 
 import 'package:analyzer/src/error/codes.dart';
-import 'package:analyzer/src/generated/source.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 
 import '../../generated/resolver_test_case.dart';
@@ -11,17 +10,18 @@
 main() {
   defineReflectiveSuite(() {
     defineReflectiveTests(DeprecatedMemberUseFromSamePackageTest);
-    defineReflectiveTests(DeprecatedMemberUseFromSamePackageTest_Driver);
     defineReflectiveTests(DeprecatedMemberUseTest);
-    defineReflectiveTests(DeprecatedMemberUseTest_Driver);
   });
 }
 
 @reflectiveTest
 class DeprecatedMemberUseTest extends ResolverTestCase {
+  @override
+  bool get enableNewAnalysisDriver => true;
+
   /// Write a pubspec file at [root], so that BestPracticesVerifier can see that
-  /// [root] is the root of a BasicWorkspace, and a BasicWorkspacePackage.
-  void newBasicPackage(String root) {
+  /// [root] is the root of a PubWorkspace, and a PubWorkspacePackage.
+  void newPubPackage(String root) {
     newFile('$root/pubspec.yaml');
   }
 
@@ -33,7 +33,7 @@
 }
 ''');
 
-    newBasicPackage('/pkg1');
+    newPubPackage('/pkg1');
     assertErrorsInCode(r'''
 import 'package:foo/foo.dart';
 void main() => A().m();
@@ -48,7 +48,7 @@
 }
 ''');
 
-    newBasicPackage('/pkg1');
+    newPubPackage('/pkg1');
     assertErrorsInCode(r'''
 import 'package:foo/foo.dart';
 void main() => A().m();
@@ -68,7 +68,7 @@
 class A {}
 ''');
 
-    newBasicPackage('/pkg1');
+    newPubPackage('/pkg1');
     assertErrorsInCode('''
 export 'package:foo/foo.dart';
 ''', [HintCode.DEPRECATED_MEMBER_USE], sourceName: '/pkg1/lib/lib1.dart');
@@ -81,22 +81,140 @@
 class A {}
 ''');
 
-    newBasicPackage('/pkg1');
+    newPubPackage('/pkg1');
     assertErrorsInCode(r'''
 import 'package:foo/foo.dart';
 f(A a) {}
 ''', [HintCode.DEPRECATED_MEMBER_USE], sourceName: '/pkg1/lib/lib1.dart');
   }
-}
 
-@reflectiveTest
-class DeprecatedMemberUseTest_Driver extends DeprecatedMemberUseTest {
-  @override
-  bool get enableNewAnalysisDriver => true;
+  test_basicWorkspace() async {
+    resetWithFooLibrary(r'''
+@deprecated
+library deprecated_library;
+class A {}
+''');
+
+    assertErrorsInCode(r'''
+import 'package:foo/foo.dart';
+f(A a) {}
+''', // This is a cross-package deprecated member usage.
+        [HintCode.DEPRECATED_MEMBER_USE],
+        sourceName: '/workspace/project/lib/lib1.dart');
+  }
+
+  test_bazelWorkspace() async {
+    resetWithFooLibrary(r'''
+@deprecated
+library deprecated_library;
+class A {}
+''');
+
+    newFile('/workspace/WORKSPACE');
+    newFile('/workspace/project/BUILD');
+    newFolder('/workspace/bazel-genfiles');
+
+    assertErrorsInCode(r'''
+import 'package:foo/foo.dart';
+f(A a) {}
+''', // This is a cross-package deprecated member usage.
+        [HintCode.DEPRECATED_MEMBER_USE],
+        sourceName: '/workspace/project/lib/lib1.dart');
+  }
+
+  test_bazelWorkspace_sameWorkspace() async {
+    newFile('/workspace/WORKSPACE');
+    newFile('/workspace/project_a/BUILD');
+    newFile('/workspace/project_b/BUILD');
+    newFolder('/workspace/bazel-genfiles');
+
+    addNamedSource('/workspace/project_a/lib/deprecated_library.dart', r'''
+@deprecated
+library deprecated_library;
+class A {}
+''');
+
+    assertErrorsInCode(r'''
+import '../../project_a/lib/deprecated_library.dart';
+f(A a) {}
+''', // This is a same-workspace, cross-package deprecated member usage.
+        [HintCode.DEPRECATED_MEMBER_USE],
+        sourceName: '/workspace/project_b/lib/lib1.dart');
+  }
+
+  test_gnWorkspace() async {
+    resetWithFooLibrary(r'''
+@deprecated
+library deprecated_library;
+class A {}
+''');
+
+    newFolder('/workspace/.jiri_root');
+    newFile('/workspace/project/pubspec.yaml');
+    String buildDir = convertPath('out/debug-x87_128');
+    newFile('/workspace/.config',
+        content: 'FOO=foo\n'
+            'FUCHSIA_BUILD_DIR=$buildDir\n'
+            'BAR=bar\n');
+    newFile('/workspace/out/debug-x87_128/dartlang/gen/project/foo.packages');
+
+    assertErrorsInCode(r'''
+import 'package:foo/foo.dart';
+f(A a) {}
+''', // This is a cross-package deprecated member usage.
+        [HintCode.DEPRECATED_MEMBER_USE],
+        sourceName: '/workspace/project/lib/lib1.dart');
+  }
+
+  test_gnWorkspace_sameWorkspace() async {
+    newFolder('/workspace/.jiri_root');
+    newFile('/workspace/project_a/pubspec.yaml');
+    newFile('/workspace/project_b/pubspec.yaml');
+    newFile('/workspace/project_a/BUILD.gn');
+    newFile('/workspace/project_b/BUILD.gn');
+    String buildDir = convertPath('out/debug-x87_128');
+    newFile('/workspace/.config',
+        content: 'FOO=foo\n'
+            'FUCHSIA_BUILD_DIR=$buildDir\n');
+    newFile('/workspace/out/debug-x87_128/dartlang/gen/project_a/foo.packages');
+
+    addNamedSource('/workspace/project_a/lib/deprecated_library.dart', r'''
+@deprecated
+library deprecated_library;
+class A {}
+''');
+
+    assertErrorsInCode(r'''
+import '../../project_a/lib/deprecated_library.dart';
+f(A a) {}
+''', // This is a same-workspace, cross-package deprecated member usage.
+        [HintCode.DEPRECATED_MEMBER_USE],
+        sourceName: '/workspace/project_b/lib/lib1.dart');
+  }
+
+  test_packageBuildWorkspace() async {
+    resetWithFooLibrary(r'''
+@deprecated
+library deprecated_library;
+class A {}
+''');
+
+    newFolder('/workspace/.dart_tool/build/generated/project/lib');
+    newFileWithBytes('/workspace/pubspec.yaml', 'name: project'.codeUnits);
+    assertErrorsInCode(r'''
+import 'package:foo/foo.dart';
+f(A a) {}
+''', // This is a cross-package deprecated member usage.
+        [HintCode.DEPRECATED_MEMBER_USE],
+        sourceName: '/workspace/package/lib/lib1.dart');
+  }
 }
 
 @reflectiveTest
 class DeprecatedMemberUseFromSamePackageTest extends ResolverTestCase {
+  @override
+  bool get enableNewAnalysisDriver => true;
+
   test_methodInvocation_contructor() async {
     assertErrorsInCode(r'''
 class A {
@@ -441,11 +559,77 @@
 }
 ''', [HintCode.DEPRECATED_MEMBER_USE_FROM_SAME_PACKAGE]);
   }
-}
 
-@reflectiveTest
-class DeprecatedMemberUseFromSamePackageTest_Driver
-    extends DeprecatedMemberUseFromSamePackageTest {
-  @override
-  bool get enableNewAnalysisDriver => true;
+  test_basicWorkspace() async {
+    addNamedSource('/workspace/lib/deprecated_library.dart', r'''
+@deprecated
+library deprecated_library;
+class A {}
+''');
+
+    assertErrorsInCode(r'''
+import 'deprecated_library.dart';
+f(A a) {}
+''', [HintCode.DEPRECATED_MEMBER_USE_FROM_SAME_PACKAGE],
+        sourceName: '/workspace/lib/lib1.dart');
+  }
+
+  test_bazelWorkspace() async {
+    newFile('/workspace/WORKSPACE');
+    newFile('/workspace/project/BUILD');
+    newFolder('/workspace/bazel-genfiles');
+
+    addNamedSource('/workspace/project/lib/deprecated_library.dart', r'''
+@deprecated
+library deprecated_library;
+class A {}
+''');
+
+    assertErrorsInCode(r'''
+import 'deprecated_library.dart';
+f(A a) {}
+''', [HintCode.DEPRECATED_MEMBER_USE_FROM_SAME_PACKAGE],
+        sourceName: '/workspace/project/lib/lib1.dart');
+  }
+
+  test_gnWorkspace() async {
+    newFolder('/workspace/.jiri_root');
+    newFile('/workspace/project/pubspec.yaml');
+    newFile('/workspace/project/BUILD.gn');
+    String buildDir = convertPath('out/debug-x87_128');
+    newFile('/workspace/.config',
+        content: 'FOO=foo\n'
+            'FUCHSIA_BUILD_DIR=$buildDir\n');
+    newFile('/workspace/out/debug-x87_128/dartlang/gen/project/foo.packages');
+
+    addNamedSource('/workspace/project/lib/deprecated_library.dart', r'''
+@deprecated
+library deprecated_library;
+class A {}
+''');
+
+    assertErrorsInCode(r'''
+import 'deprecated_library.dart';
+f(A a) {}
+''', [HintCode.DEPRECATED_MEMBER_USE_FROM_SAME_PACKAGE],
+        sourceName: '/workspace/project/lib/lib1.dart');
+  }
+
+  test_packageBuildWorkspace() async {
+    newFolder('/workspace/.dart_tool/build/generated/project/lib');
+    newFileWithBytes('/workspace/pubspec.yaml', 'name: project'.codeUnits);
+    newFileWithBytes('/workspace/.packages', 'project:lib/'.codeUnits);
+
+    addNamedSource('/workspace/lib/deprecated_library.dart', r'''
+@deprecated
+library deprecated_library;
+class A {}
+''');
+
+    assertErrorsInCode(r'''
+import 'deprecated_library.dart';
+f(A a) {}
+''', [HintCode.DEPRECATED_MEMBER_USE_FROM_SAME_PACKAGE],
+        sourceName: '/workspace/lib/lib1.dart');
+  }
 }
diff --git a/pkg/analyzer/test/src/diagnostics/division_optimization_test.dart b/pkg/analyzer/test/src/diagnostics/division_optimization_test.dart
index 6adfcf2..a158007 100644
--- a/pkg/analyzer/test/src/diagnostics/division_optimization_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/division_optimization_test.dart
@@ -9,13 +9,11 @@
 
 main() {
   defineReflectiveSuite(() {
-    defineReflectiveTests(DivisionOptimizationTest);
     defineReflectiveTests(DivisionOptimizationTest_Driver);
   });
 }
 
-@reflectiveTest
-class DivisionOptimizationTest extends ResolverTestCase {
+abstract class DivisionOptimizationTest extends ResolverTestCase {
   test_divisionOptimization() async {
     await assertNoErrorsInCode(r'''
 f(int x, int y) {
diff --git a/pkg/analyzer/test/src/diagnostics/invalid_assignment_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_assignment_test.dart
index 0630617..4692aee 100644
--- a/pkg/analyzer/test/src/diagnostics/invalid_assignment_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/invalid_assignment_test.dart
@@ -9,13 +9,11 @@
 
 main() {
   defineReflectiveSuite(() {
-    defineReflectiveTests(InvalidAssignmentTest);
     defineReflectiveTests(InvalidAssignmentTest_Driver);
   });
 }
 
-@reflectiveTest
-class InvalidAssignmentTest extends ResolverTestCase {
+abstract class InvalidAssignmentTest extends ResolverTestCase {
   test_instanceVariable() async {
     await assertErrorsInCode(r'''
 class A {
diff --git a/pkg/analyzer/test/src/diagnostics/invalid_cast_new_expr_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_cast_new_expr_test.dart
new file mode 100644
index 0000000..125d43d
--- /dev/null
+++ b/pkg/analyzer/test/src/diagnostics/invalid_cast_new_expr_test.dart
@@ -0,0 +1,71 @@
+// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:analyzer/src/error/codes.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+
+import '../../generated/resolver_test_case.dart';
+
+main() {
+  defineReflectiveSuite(() {
+    defineReflectiveTests(InvalidCastNewExprTest);
+  });
+}
+
+@reflectiveTest
+class InvalidCastNewExprTest extends ResolverTestCase {
+  @override
+  List<String> get enabledExperiments => ['set-literals'];
+
+  @override
+  bool get enableNewAnalysisDriver => true;
+
+  test_listLiteral_const() async {
+    await assertErrorsInCode(r'''
+const c = <B>[A()];
+class A {
+  const A();
+}
+class B extends A {
+  const B();
+}
+''', [StrongModeCode.INVALID_CAST_NEW_EXPR]);
+  }
+
+  test_listLiteral_nonConst() async {
+    await assertErrorsInCode(r'''
+var c = <B>[A()];
+class A {
+  const A();
+}
+class B extends A {
+  const B();
+}
+''', [StrongModeCode.INVALID_CAST_NEW_EXPR]);
+  }
+
+  test_setLiteral_const() async {
+    await assertErrorsInCode(r'''
+const c = <B>{A()};
+class A {
+  const A();
+}
+class B extends A {
+  const B();
+}
+''', [StrongModeCode.INVALID_CAST_NEW_EXPR]);
+  }
+
+  test_setLiteral_nonConst() async {
+    await assertErrorsInCode(r'''
+var c = <B>{A()};
+class A {
+  const A();
+}
+class B extends A {
+  const B();
+}
+''', [StrongModeCode.INVALID_CAST_NEW_EXPR]);
+  }
+}
diff --git a/pkg/analyzer/test/src/diagnostics/invalid_required_param_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_required_param_test.dart
index e10b266..3543168 100644
--- a/pkg/analyzer/test/src/diagnostics/invalid_required_param_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/invalid_required_param_test.dart
@@ -10,13 +10,11 @@
 
 main() {
   defineReflectiveSuite(() {
-    defineReflectiveTests(InvalidRequiredParamTest);
     defineReflectiveTests(InvalidRequiredParamTest_Driver);
   });
 }
 
-@reflectiveTest
-class InvalidRequiredParamTest extends ResolverTestCase {
+abstract class InvalidRequiredParamTest extends ResolverTestCase {
   @override
   void reset() {
     super.resetWith(packages: [
diff --git a/pkg/analyzer/test/src/diagnostics/test_all.dart b/pkg/analyzer/test/src/diagnostics/test_all.dart
index 0be860c..20b7c10 100644
--- a/pkg/analyzer/test/src/diagnostics/test_all.dart
+++ b/pkg/analyzer/test/src/diagnostics/test_all.dart
@@ -9,7 +9,9 @@
 import 'deprecated_member_use_test.dart' as deprecated_member_use;
 import 'division_optimization_test.dart' as division_optimization;
 import 'invalid_assignment_test.dart' as invalid_assignment;
+import 'invalid_cast_new_expr_test.dart' as invalid_cast_new_expr;
 import 'invalid_required_param_test.dart' as invalid_required_param;
+import 'undefined_getter.dart' as undefined_getter;
 import 'unnecessary_cast_test.dart' as unnecessary_cast;
 import 'unused_field_test.dart' as unused_field;
 import 'unused_import_test.dart' as unused_import;
@@ -24,7 +26,9 @@
     deprecated_member_use.main();
     division_optimization.main();
     invalid_assignment.main();
+    invalid_cast_new_expr.main();
     invalid_required_param.main();
+    undefined_getter.main();
     unnecessary_cast.main();
     unused_field.main();
     unused_import.main();
diff --git a/pkg/analyzer/test/src/diagnostics/undefined_getter.dart b/pkg/analyzer/test/src/diagnostics/undefined_getter.dart
new file mode 100644
index 0000000..c40128c
--- /dev/null
+++ b/pkg/analyzer/test/src/diagnostics/undefined_getter.dart
@@ -0,0 +1,34 @@
+// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:analyzer/src/error/codes.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+
+import '../../generated/resolver_test_case.dart';
+
+main() {
+  defineReflectiveSuite(() {
+    defineReflectiveTests(UndefinedGetterTest);
+    defineReflectiveTests(UndefinedGetterTest_Driver);
+  });
+}
+
+@reflectiveTest
+class UndefinedGetterTest extends ResolverTestCase {
+  test_promotedTypeParameter_regress35305() async {
+    await assertErrorsInCode(r'''
+void f<X extends num, Y extends X>(Y y) {
+  if (y is int) {
+    y.isEven;
+  }
+}
+''', [StaticTypeWarningCode.UNDEFINED_GETTER], verify: false);
+  }
+}
+
+@reflectiveTest
+class UndefinedGetterTest_Driver extends UndefinedGetterTest {
+  @override
+  bool get enableNewAnalysisDriver => true;
+}
diff --git a/pkg/analyzer/test/src/diagnostics/unnecessary_cast_test.dart b/pkg/analyzer/test/src/diagnostics/unnecessary_cast_test.dart
index 507e656..855d252 100644
--- a/pkg/analyzer/test/src/diagnostics/unnecessary_cast_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/unnecessary_cast_test.dart
@@ -9,13 +9,11 @@
 
 main() {
   defineReflectiveSuite(() {
-    defineReflectiveTests(UnnecessaryCastTest);
     defineReflectiveTests(UnnecessaryCastTest_Driver);
   });
 }
 
-@reflectiveTest
-class UnnecessaryCastTest extends ResolverTestCase {
+abstract class UnnecessaryCastTest extends ResolverTestCase {
   test_conditionalExpression() async {
     await assertNoErrorsInCode(r'''
 abstract class I {}
diff --git a/pkg/analyzer/test/src/diagnostics/unused_field_test.dart b/pkg/analyzer/test/src/diagnostics/unused_field_test.dart
index 6a60a1b..21fad18 100644
--- a/pkg/analyzer/test/src/diagnostics/unused_field_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/unused_field_test.dart
@@ -9,13 +9,11 @@
 
 main() {
   defineReflectiveSuite(() {
-    defineReflectiveTests(UnusedFieldTest);
     defineReflectiveTests(UnusedFieldTest_Driver);
   });
 }
 
-@reflectiveTest
-class UnusedFieldTest extends ResolverTestCase {
+abstract class UnusedFieldTest extends ResolverTestCase {
   @override
   bool get enableUnusedElement => true;
 
diff --git a/pkg/analyzer/test/src/diagnostics/unused_import_test.dart b/pkg/analyzer/test/src/diagnostics/unused_import_test.dart
index e930e3e..55667a1 100644
--- a/pkg/analyzer/test/src/diagnostics/unused_import_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/unused_import_test.dart
@@ -10,13 +10,11 @@
 
 main() {
   defineReflectiveSuite(() {
-    defineReflectiveTests(UnusedImportTest);
     defineReflectiveTests(UnusedImportTest_Driver);
   });
 }
 
-@reflectiveTest
-class UnusedImportTest extends ResolverTestCase {
+abstract class UnusedImportTest extends ResolverTestCase {
   test_annotationOnDirective() async {
     Source source = addSource(r'''
 library L;
diff --git a/pkg/analyzer/test/src/diagnostics/unused_label_test.dart b/pkg/analyzer/test/src/diagnostics/unused_label_test.dart
index 7609554..7a94420 100644
--- a/pkg/analyzer/test/src/diagnostics/unused_label_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/unused_label_test.dart
@@ -9,13 +9,11 @@
 
 main() {
   defineReflectiveSuite(() {
-    defineReflectiveTests(UnusedLabelTest);
     defineReflectiveTests(UnusedLabelTest_Driver);
   });
 }
 
-@reflectiveTest
-class UnusedLabelTest extends ResolverTestCase {
+abstract class UnusedLabelTest extends ResolverTestCase {
   test_unused_inSwitch() async {
     await assertErrorsInCode(r'''
 f(x) {
diff --git a/pkg/analyzer/test/src/diagnostics/unused_shown_name_test.dart b/pkg/analyzer/test/src/diagnostics/unused_shown_name_test.dart
index 8fba003..2535989 100644
--- a/pkg/analyzer/test/src/diagnostics/unused_shown_name_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/unused_shown_name_test.dart
@@ -10,13 +10,11 @@
 
 main() {
   defineReflectiveSuite(() {
-    defineReflectiveTests(UnusedShownNameTest);
     defineReflectiveTests(UnusedShownNameTest_Driver);
   });
 }
 
-@reflectiveTest
-class UnusedShownNameTest extends ResolverTestCase {
+abstract class UnusedShownNameTest extends ResolverTestCase {
   test_unreferenced() async {
     Source source = addSource(r'''
 library L;
diff --git a/pkg/analyzer/test/src/diagnostics/use_of_void_result_test.dart b/pkg/analyzer/test/src/diagnostics/use_of_void_result_test.dart
index f44a502..5f7a014 100644
--- a/pkg/analyzer/test/src/diagnostics/use_of_void_result_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/use_of_void_result_test.dart
@@ -8,13 +8,11 @@
 
 main() {
   defineReflectiveSuite(() {
-    defineReflectiveTests(UseOfVoidResultTest);
     defineReflectiveTests(UseOfVoidResultTest_Driver);
   });
 }
 
-@reflectiveTest
-class UseOfVoidResultTest extends ResolverTestCase {
+abstract class UseOfVoidResultTest extends ResolverTestCase {
   test_implicitReturnValue() async {
     await assertNoErrorsInCode(r'''
 f() {}
diff --git a/pkg/analyzer/test/src/fasta/recovery/partial_code/forEach_statement_test.dart b/pkg/analyzer/test/src/fasta/recovery/partial_code/forEach_statement_test.dart
index 247cc34..2d7ef0f 100644
--- a/pkg/analyzer/test/src/fasta/recovery/partial_code/forEach_statement_test.dart
+++ b/pkg/analyzer/test/src/fasta/recovery/partial_code/forEach_statement_test.dart
@@ -63,6 +63,8 @@
                 ParserErrorCode.MISSING_IDENTIFIER,
                 ParserErrorCode.MISSING_IDENTIFIER,
                 ParserErrorCode.MISSING_IDENTIFIER,
+                // TODO(danrubel): investigate why 4 missing identifier errors
+                ParserErrorCode.MISSING_IDENTIFIER,
                 ParserErrorCode.EXPECTED_TOKEN,
                 ParserErrorCode.EXPECTED_TOKEN
               ],
diff --git a/pkg/analyzer/test/src/services/available_declarations_test.dart b/pkg/analyzer/test/src/services/available_declarations_test.dart
new file mode 100644
index 0000000..8d2834a
--- /dev/null
+++ b/pkg/analyzer/test/src/services/available_declarations_test.dart
@@ -0,0 +1,1336 @@
+// Copyright (c) 2019, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:analyzer/dart/analysis/analysis_context.dart';
+import 'package:analyzer/dart/analysis/analysis_context_collection.dart';
+import 'package:analyzer/src/dart/analysis/analysis_context_collection.dart';
+import 'package:analyzer/src/dart/analysis/byte_store.dart';
+import 'package:analyzer/src/services/available_declarations.dart';
+import 'package:analyzer/src/test_utilities/mock_sdk.dart';
+import 'package:analyzer/src/test_utilities/resource_provider_mixin.dart';
+import 'package:meta/meta.dart';
+import 'package:test/test.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+
+main() {
+  defineReflectiveSuite(() {
+    defineReflectiveTests(AvailableDeclarationsTest);
+  });
+}
+
+class AbstractContextTest with ResourceProviderMixin {
+  final byteStore = MemoryByteStore();
+
+  AnalysisContextCollection analysisContextCollection;
+
+  AnalysisContext testAnalysisContext;
+
+  void addDotPackagesDependency(String path, String name, String rootPath) {
+    var packagesFile = getFile(path);
+
+    String packagesContent;
+    try {
+      packagesContent = packagesFile.readAsStringSync();
+    } catch (_) {
+      packagesContent = '';
+    }
+
+    // Ignore if there is already the same package dependency.
+    if (packagesContent.contains('$name:file://')) {
+      return;
+    }
+
+    rootPath = convertPath(rootPath);
+    packagesContent += '$name:${toUri('$rootPath/lib')}\n';
+
+    packagesFile.writeAsStringSync(packagesContent);
+
+    createAnalysisContexts();
+  }
+
+  void addTestPackageDependency(String name, String rootPath) {
+    addDotPackagesDependency('/home/test/.packages', name, rootPath);
+  }
+
+  /// Create all analysis contexts in `/home`.
+  void createAnalysisContexts() {
+    analysisContextCollection = AnalysisContextCollectionImpl(
+      includedPaths: [convertPath('/home')],
+      resourceProvider: resourceProvider,
+      sdkPath: convertPath('/sdk'),
+    );
+
+    var testPath = convertPath('/home/test');
+    testAnalysisContext = getContext(testPath);
+  }
+
+  /// Return the existing analysis context that should be used to analyze the
+  /// given [path], or throw [StateError] if the [path] is not analyzed in any
+  /// of the created analysis contexts.
+  AnalysisContext getContext(String path) {
+    path = convertPath(path);
+    return analysisContextCollection.contextFor(path);
+  }
+
+  setUp() {
+    new MockSdk(resourceProvider: resourceProvider);
+
+    newFolder('/home/test');
+    newFile('/home/test/.packages', content: '''
+test:${toUri('/home/test/lib')}
+''');
+
+    createAnalysisContexts();
+  }
+}
+
+@reflectiveTest
+class AvailableDeclarationsTest extends AbstractContextTest {
+  DeclarationsTracker tracker;
+
+  final List<LibraryChange> changes = [];
+
+  final Map<int, Library> idToLibrary = {};
+  final Map<String, Library> uriToLibrary = {};
+
+  @override
+  setUp() {
+    super.setUp();
+    _createTracker();
+  }
+
+  test_changeFile_added_exported() async {
+    var a = convertPath('/home/test/lib/a.dart');
+    var b = convertPath('/home/test/lib/b.dart');
+    var c = convertPath('/home/test/lib/c.dart');
+    var d = convertPath('/home/test/lib/d.dart');
+
+    newFile(a, content: r'''
+export 'b.dart';
+class A {}
+''');
+    newFile(b, content: r'''
+export 'c.dart';
+class B {}
+''');
+    newFile(d, content: r'''
+class D {}
+''');
+    tracker.addContext(testAnalysisContext);
+
+    await _doAllTrackerWork();
+    _assertHasLibrary('package:test/a.dart', declarations: [
+      _ExpectedDeclaration('A', DeclarationKind.CLASS),
+      _ExpectedDeclaration('B', DeclarationKind.CLASS),
+    ]);
+    _assertHasLibrary('package:test/b.dart', declarations: [
+      _ExpectedDeclaration('B', DeclarationKind.CLASS),
+    ]);
+    _assertHasNoLibrary('package:test/c.dart');
+    _assertHasLibrary('package:test/d.dart', declarations: [
+      _ExpectedDeclaration('D', DeclarationKind.CLASS),
+    ]);
+
+    newFile(c, content: r'''
+class C {}
+''');
+    tracker.changeFile(c);
+    await _doAllTrackerWork();
+
+    _assertHasLibrary('package:test/a.dart', declarations: [
+      _ExpectedDeclaration('A', DeclarationKind.CLASS),
+      _ExpectedDeclaration('B', DeclarationKind.CLASS),
+      _ExpectedDeclaration('C', DeclarationKind.CLASS),
+    ]);
+    _assertHasLibrary('package:test/b.dart', declarations: [
+      _ExpectedDeclaration('B', DeclarationKind.CLASS),
+      _ExpectedDeclaration('C', DeclarationKind.CLASS),
+    ]);
+    _assertHasLibrary('package:test/c.dart', declarations: [
+      _ExpectedDeclaration('C', DeclarationKind.CLASS),
+    ]);
+    _assertHasLibrary('package:test/d.dart', declarations: [
+      _ExpectedDeclaration('D', DeclarationKind.CLASS),
+    ]);
+  }
+
+  test_changeFile_added_library() async {
+    var a = convertPath('/home/test/lib/a.dart');
+    var b = convertPath('/home/test/lib/b.dart');
+
+    newFile(a, content: r'''
+class A {}
+''');
+    tracker.addContext(testAnalysisContext);
+
+    await _doAllTrackerWork();
+    _assertHasLibrary('package:test/a.dart', declarations: [
+      _ExpectedDeclaration('A', DeclarationKind.CLASS),
+    ]);
+    _assertHasNoLibrary('package:test/b.dart');
+
+    newFile(b, content: r'''
+class B {}
+''');
+    tracker.changeFile(b);
+    await _doAllTrackerWork();
+
+    _assertHasLibrary('package:test/a.dart', declarations: [
+      _ExpectedDeclaration('A', DeclarationKind.CLASS),
+    ]);
+    _assertHasLibrary('package:test/b.dart', declarations: [
+      _ExpectedDeclaration('B', DeclarationKind.CLASS),
+    ]);
+  }
+
+  test_changeFile_added_part() async {
+    var a = convertPath('/home/test/lib/a.dart');
+    var b = convertPath('/home/test/lib/b.dart');
+    var c = convertPath('/home/test/lib/c.dart');
+
+    newFile(a, content: r'''
+part 'b.dart';
+class A {}
+''');
+    newFile(c, content: r'''
+class C {}
+''');
+    tracker.addContext(testAnalysisContext);
+
+    await _doAllTrackerWork();
+    _assertHasLibrary('package:test/a.dart', declarations: [
+      _ExpectedDeclaration('A', DeclarationKind.CLASS),
+    ]);
+    _assertHasNoLibrary('package:test/b.dart');
+    _assertHasLibrary('package:test/c.dart', declarations: [
+      _ExpectedDeclaration('C', DeclarationKind.CLASS),
+    ]);
+
+    newFile(b, content: r'''
+part of 'a.dart';
+class B {}
+''');
+    tracker.changeFile(b);
+    await _doAllTrackerWork();
+
+    _assertHasLibrary('package:test/a.dart', declarations: [
+      _ExpectedDeclaration('A', DeclarationKind.CLASS),
+      _ExpectedDeclaration('B', DeclarationKind.CLASS),
+    ]);
+    _assertHasNoLibrary('package:test/b.dart');
+    _assertHasLibrary('package:test/c.dart', declarations: [
+      _ExpectedDeclaration('C', DeclarationKind.CLASS),
+    ]);
+  }
+
+  test_changeFile_deleted_exported() async {
+    var a = convertPath('/home/test/lib/a.dart');
+    var b = convertPath('/home/test/lib/b.dart');
+    var c = convertPath('/home/test/lib/c.dart');
+    var d = convertPath('/home/test/lib/d.dart');
+
+    newFile(a, content: r'''
+export 'b.dart';
+class A {}
+''');
+    newFile(b, content: r'''
+export 'c.dart';
+class B {}
+''');
+    newFile(c, content: r'''
+class C {}
+''');
+    newFile(d, content: r'''
+class D {}
+''');
+    tracker.addContext(testAnalysisContext);
+
+    await _doAllTrackerWork();
+    _assertHasLibrary('package:test/a.dart', declarations: [
+      _ExpectedDeclaration('A', DeclarationKind.CLASS),
+      _ExpectedDeclaration('B', DeclarationKind.CLASS),
+      _ExpectedDeclaration('C', DeclarationKind.CLASS),
+    ]);
+    _assertHasLibrary('package:test/b.dart', declarations: [
+      _ExpectedDeclaration('B', DeclarationKind.CLASS),
+      _ExpectedDeclaration('C', DeclarationKind.CLASS),
+    ]);
+    _assertHasLibrary('package:test/c.dart', declarations: [
+      _ExpectedDeclaration('C', DeclarationKind.CLASS),
+    ]);
+    _assertHasLibrary('package:test/d.dart', declarations: [
+      _ExpectedDeclaration('D', DeclarationKind.CLASS),
+    ]);
+
+    deleteFile(c);
+    tracker.changeFile(c);
+    await _doAllTrackerWork();
+
+    _assertHasLibrary('package:test/a.dart', declarations: [
+      _ExpectedDeclaration('A', DeclarationKind.CLASS),
+      _ExpectedDeclaration('B', DeclarationKind.CLASS),
+    ]);
+    _assertHasLibrary('package:test/b.dart', declarations: [
+      _ExpectedDeclaration('B', DeclarationKind.CLASS),
+    ]);
+    _assertHasNoLibrary('package:test/c.dart');
+    _assertHasLibrary('package:test/d.dart', declarations: [
+      _ExpectedDeclaration('D', DeclarationKind.CLASS),
+    ]);
+  }
+
+  test_changeFile_deleted_library() async {
+    var a = convertPath('/home/test/lib/a.dart');
+    var b = convertPath('/home/test/lib/b.dart');
+
+    newFile(a, content: '');
+    newFile(b, content: '');
+    tracker.addContext(testAnalysisContext);
+
+    await _doAllTrackerWork();
+    _assertHasLibrary('package:test/a.dart');
+    _assertHasLibrary('package:test/b.dart');
+
+    deleteFile(a);
+    tracker.changeFile(a);
+    await _doAllTrackerWork();
+
+    _assertHasNoLibrary('package:test/a.dart');
+    _assertHasLibrary('package:test/b.dart');
+  }
+
+  test_changeFile_deleted_part() async {
+    var a = convertPath('/home/test/lib/a.dart');
+    var b = convertPath('/home/test/lib/b.dart');
+    var c = convertPath('/home/test/lib/c.dart');
+
+    newFile(a, content: r'''
+part 'b.dart';
+class A {}
+''');
+    newFile(b, content: r'''
+part of 'a.dart';
+class B {}
+''');
+    newFile(c, content: r'''
+class C {}
+''');
+    tracker.addContext(testAnalysisContext);
+
+    await _doAllTrackerWork();
+    _assertHasLibrary('package:test/a.dart', declarations: [
+      _ExpectedDeclaration('A', DeclarationKind.CLASS),
+      _ExpectedDeclaration('B', DeclarationKind.CLASS),
+    ]);
+    _assertHasLibrary('package:test/c.dart', declarations: [
+      _ExpectedDeclaration('C', DeclarationKind.CLASS),
+    ]);
+
+    deleteFile(b);
+    tracker.changeFile(b);
+    await _doAllTrackerWork();
+
+    _assertHasLibrary('package:test/a.dart', declarations: [
+      _ExpectedDeclaration('A', DeclarationKind.CLASS),
+    ]);
+    _assertHasLibrary('package:test/c.dart', declarations: [
+      _ExpectedDeclaration('C', DeclarationKind.CLASS),
+    ]);
+  }
+
+  test_changeFile_updated_exported() async {
+    var a = convertPath('/home/test/lib/a.dart');
+    var b = convertPath('/home/test/lib/b.dart');
+    var c = convertPath('/home/test/lib/c.dart');
+    var d = convertPath('/home/test/lib/d.dart');
+
+    newFile(a, content: r'''
+export 'b.dart';
+class A {}
+''');
+    newFile(b, content: r'''
+export 'c.dart';
+class B {}
+''');
+    newFile(c, content: r'''
+class C {}
+''');
+    newFile(d, content: r'''
+class D {}
+''');
+    tracker.addContext(testAnalysisContext);
+
+    await _doAllTrackerWork();
+    _assertHasLibrary('package:test/a.dart', declarations: [
+      _ExpectedDeclaration('A', DeclarationKind.CLASS),
+      _ExpectedDeclaration('B', DeclarationKind.CLASS),
+      _ExpectedDeclaration('C', DeclarationKind.CLASS),
+    ]);
+    _assertHasLibrary('package:test/b.dart', declarations: [
+      _ExpectedDeclaration('B', DeclarationKind.CLASS),
+      _ExpectedDeclaration('C', DeclarationKind.CLASS),
+    ]);
+    _assertHasLibrary('package:test/c.dart', declarations: [
+      _ExpectedDeclaration('C', DeclarationKind.CLASS),
+    ]);
+    _assertHasLibrary('package:test/d.dart', declarations: [
+      _ExpectedDeclaration('D', DeclarationKind.CLASS),
+    ]);
+
+    newFile(c, content: r'''
+class C2 {}
+''');
+    tracker.changeFile(c);
+    await _doAllTrackerWork();
+
+    _assertHasLibrary('package:test/a.dart', declarations: [
+      _ExpectedDeclaration('A', DeclarationKind.CLASS),
+      _ExpectedDeclaration('B', DeclarationKind.CLASS),
+      _ExpectedDeclaration('C2', DeclarationKind.CLASS),
+    ]);
+    _assertHasLibrary('package:test/b.dart', declarations: [
+      _ExpectedDeclaration('B', DeclarationKind.CLASS),
+      _ExpectedDeclaration('C2', DeclarationKind.CLASS),
+    ]);
+    _assertHasLibrary('package:test/c.dart', declarations: [
+      _ExpectedDeclaration('C2', DeclarationKind.CLASS),
+    ]);
+    _assertHasLibrary('package:test/d.dart', declarations: [
+      _ExpectedDeclaration('D', DeclarationKind.CLASS),
+    ]);
+  }
+
+  test_changeFile_updated_library() async {
+    var a = convertPath('/home/test/lib/a.dart');
+    var b = convertPath('/home/test/lib/b.dart');
+
+    newFile(a, content: r'''
+class A {}
+''');
+    newFile(b, content: r'''
+class B {}
+''');
+    tracker.addContext(testAnalysisContext);
+
+    await _doAllTrackerWork();
+    _assertHasLibrary('package:test/a.dart', declarations: [
+      _ExpectedDeclaration('A', DeclarationKind.CLASS),
+    ]);
+    _assertHasLibrary('package:test/b.dart', declarations: [
+      _ExpectedDeclaration('B', DeclarationKind.CLASS),
+    ]);
+
+    newFile(a, content: r'''
+class A2 {}
+''');
+    tracker.changeFile(a);
+    await _doAllTrackerWork();
+
+    _assertHasLibrary('package:test/a.dart', declarations: [
+      _ExpectedDeclaration('A2', DeclarationKind.CLASS),
+    ]);
+    _assertHasLibrary('package:test/b.dart', declarations: [
+      _ExpectedDeclaration('B', DeclarationKind.CLASS),
+    ]);
+  }
+
+  test_changeFile_updated_part() async {
+    var a = convertPath('/home/test/lib/a.dart');
+    var b = convertPath('/home/test/lib/b.dart');
+    var c = convertPath('/home/test/lib/c.dart');
+
+    newFile(a, content: r'''
+part 'b.dart';
+class A {}
+''');
+    newFile(b, content: r'''
+part of 'a.dart';
+class B {}
+''');
+    newFile(c, content: r'''
+class C {}
+''');
+    tracker.addContext(testAnalysisContext);
+
+    await _doAllTrackerWork();
+    _assertHasLibrary('package:test/a.dart', declarations: [
+      _ExpectedDeclaration('A', DeclarationKind.CLASS),
+      _ExpectedDeclaration('B', DeclarationKind.CLASS),
+    ]);
+    _assertHasLibrary('package:test/c.dart', declarations: [
+      _ExpectedDeclaration('C', DeclarationKind.CLASS),
+    ]);
+
+    newFile(b, content: r'''
+part of 'a.dart';
+class B2 {}
+''');
+    tracker.changeFile(b);
+    await _doAllTrackerWork();
+
+    _assertHasLibrary('package:test/a.dart', declarations: [
+      _ExpectedDeclaration('A', DeclarationKind.CLASS),
+      _ExpectedDeclaration('B2', DeclarationKind.CLASS),
+    ]);
+    _assertHasLibrary('package:test/c.dart', declarations: [
+      _ExpectedDeclaration('C', DeclarationKind.CLASS),
+    ]);
+  }
+
+  test_export() async {
+    newFile('/home/test/lib/a.dart', content: r'''
+class A {}
+class B {}
+''');
+    newFile('/home/test/lib/test.dart', content: r'''
+export 'a.dart';
+class C {}
+''');
+    tracker.addContext(testAnalysisContext);
+
+    await _doAllTrackerWork();
+    _assertHasLibrary('package:test/test.dart', declarations: [
+      _ExpectedDeclaration.class_('A'),
+      _ExpectedDeclaration.class_('B'),
+      _ExpectedDeclaration.class_('C'),
+    ]);
+  }
+
+  test_export_combinators_hide() async {
+    newFile('/home/test/lib/a.dart', content: r'''
+class A {}
+class B {}
+class C {}
+''');
+    newFile('/home/test/lib/test.dart', content: r'''
+export 'a.dart' hide B;
+class D {}
+''');
+    tracker.addContext(testAnalysisContext);
+
+    await _doAllTrackerWork();
+    _assertHasLibrary('package:test/test.dart', declarations: [
+      _ExpectedDeclaration.class_('A'),
+      _ExpectedDeclaration.class_('C'),
+      _ExpectedDeclaration.class_('D'),
+    ]);
+  }
+
+  test_export_combinators_show() async {
+    newFile('/home/test/lib/a.dart', content: r'''
+class A {}
+class B {}
+class C {}
+''');
+    newFile('/home/test/lib/test.dart', content: r'''
+export 'a.dart' show B;
+class D {}
+''');
+    tracker.addContext(testAnalysisContext);
+
+    await _doAllTrackerWork();
+    _assertHasLibrary('package:test/test.dart', declarations: [
+      _ExpectedDeclaration.class_('B'),
+      _ExpectedDeclaration.class_('D'),
+    ]);
+  }
+
+  test_export_cycle() async {
+    newFile('/home/test/lib/a.dart', content: r'''
+export 'b.dart';
+class A {}
+''');
+    newFile('/home/test/lib/b.dart', content: r'''
+export 'a.dart';
+class B {}
+''');
+    newFile('/home/test/lib/test.dart', content: r'''
+export 'b.dart';
+class C {}
+''');
+    tracker.addContext(testAnalysisContext);
+
+    await _doAllTrackerWork();
+
+    _assertHasLibrary('package:test/a.dart', declarations: [
+      _ExpectedDeclaration.class_('A'),
+      _ExpectedDeclaration.class_('B'),
+    ]);
+
+    _assertHasLibrary('package:test/b.dart', declarations: [
+      _ExpectedDeclaration.class_('A'),
+      _ExpectedDeclaration.class_('B'),
+    ]);
+
+    _assertHasLibrary('package:test/test.dart', declarations: [
+      _ExpectedDeclaration.class_('A'),
+      _ExpectedDeclaration.class_('B'),
+      _ExpectedDeclaration.class_('C'),
+    ]);
+  }
+
+  test_export_missing() async {
+    newFile('/home/test/lib/test.dart', content: r'''
+export 'a.dart';
+class C {}
+''');
+    tracker.addContext(testAnalysisContext);
+
+    await _doAllTrackerWork();
+    _assertHasLibrary('package:test/test.dart', declarations: [
+      _ExpectedDeclaration.class_('C'),
+    ]);
+  }
+
+  test_export_sequence() async {
+    newFile('/home/test/lib/a.dart', content: r'''
+class A {}
+''');
+    newFile('/home/test/lib/b.dart', content: r'''
+export 'a.dart';
+class B {}
+''');
+    newFile('/home/test/lib/test.dart', content: r'''
+export 'b.dart';
+class C {}
+''');
+    tracker.addContext(testAnalysisContext);
+
+    await _doAllTrackerWork();
+
+    _assertHasLibrary('package:test/a.dart', declarations: [
+      _ExpectedDeclaration.class_('A'),
+    ]);
+
+