Version 2.0.0-dev.2.0

Merge commit '33671e483acee709c09e79747a247434a71dc12f' into dev
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a484d1c..f927cdf 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -15,7 +15,7 @@
 
 * `dart:async`
   * The `Zone` class was changed to be strong-mode clean. This required
-    some breaking API changes.
+    some breaking API changes. See https://goo.gl/y9mW2x for more information.
 
 * `dart:io`
   * Unified backends for `SecureSocket`, `SecurityContext`, and
@@ -32,6 +32,8 @@
     in 'timeout'.
   * Added `Platform.operatingSystemVersion` that gives a platform-specific
     String describing the version of the operating system.
+  * Added `RawZLibFilter` for low-level access to compression and
+    decompression.
 
 * `dart:core`
   * The `Uri` class now correctly handles paths while running on Node.js on
diff --git a/DEPS b/DEPS
index 2034c9d..3ff76e60 100644
--- a/DEPS
+++ b/DEPS
@@ -45,23 +45,23 @@
 
   # Revisions of /third_party/* dependencies.
   "args_tag": "@0.13.7",
-  "async_tag": "@daf66909019d2aaec1721fc39d94ea648a9fdc1d",
+  "async_tag": "@2.0.0",
   "barback-0.13.0_rev": "@34853",
   "barback-0.14.0_rev": "@36398",
   "barback-0.14.1_rev": "@38525",
-  "barback_tag" : "@0.15.2+11",
+  "barback_tag" : "@0.15.2+12",
   "bazel_worker_tag": "@v0.1.4",
   "boolean_selector_tag" : "@1.0.2",
   "boringssl_gen_rev": "@753224969dbe43dad29343146529727b5066c0f3",
   "boringssl_rev" : "@d519bf6be0b447fb80fbc539d4bff4479b5482a2",
   "charcode_tag": "@v1.1.1",
   "chrome_rev" : "@19997",
-  "cli_util_tag" : "@0.1.0",
+  "cli_util_tag" : "@0.1.2+1",
   "collection_tag": "@1.14.3",
   "convert_tag": "@2.0.1",
-  "crypto_tag" : "@2.0.2",
-  "csslib_tag" : "@0.13.3+1",
-  "dart2js_info_tag" : "@0.5.4+2",
+  "crypto_tag" : "@2.0.2+1",
+  "csslib_tag" : "@0.14.1",
+  "dart2js_info_tag" : "@0.5.5+1",
 
   # Note: updates to dart_style have to be coordinated carefully with
   # the infrastructure-team so that the internal formatter in
@@ -80,50 +80,50 @@
   "dartdoc_tag" : "@v0.13.0+3",
   "fixnum_tag": "@0.10.5",
   "func_tag": "@1.0.0",
-  "glob_tag": "@1.1.3",
-  "html_tag" : "@0.13.1",
-  "http_multi_server_tag" : "@2.0.3",
+  "glob_tag": "@1.1.5",
+  "html_tag" : "@0.13.2",
+  "http_multi_server_tag" : "@2.0.4",
   "http_parser_tag" : "@3.1.1",
   "http_tag" : "@0.11.3+14",
   "http_throttle_tag" : "@1.0.1",
   "idl_parser_rev": "@7fbe68cab90c38147dee4f48c30ad0d496c17915",
-  "intl_tag": "@0.14.0",
-  "isolate_tag": "@1.0.0",
+  "intl_tag": "@0.15.1",
+  "isolate_tag": "@1.1.0",
   "jinja2_rev": "@2222b31554f03e62600cd7e383376a7c187967a1",
   "json_rpc_2_tag": "@2.0.4",
   "linter_tag": "@0.1.35",
   "logging_tag": "@0.11.3+1",
-  "markdown_tag": "@0.11.3",
-  "matcher_tag": "@0.12.1+3",
-  "mime_rev": "@75890811d4af5af080351ba8a2853ad4c8df98dd",
+  "markdown_tag": "@0.11.4",
+  "matcher_tag": "@0.12.1+4",
+  "mime_rev": "@367087506c0a8a746bd75c685487b01ffed7f1c5",
   "mockito_tag": "@2.0.2",
   "mustache4dart_tag" : "@v1.1.0",
-  "oauth2_tag": "@1.0.2",
+  "oauth2_tag": "@1.1.0",
   "observatory_pub_packages_rev": "@a4e392521c720d244cd63e067387195d78584b35",
-  "package_config_tag": "@1.0.1",
+  "package_config_tag": "@1.0.3",
   "package_resolver_tag": "@1.0.2+1",
-  "path_tag": "@1.4.1",
+  "path_tag": "@1.4.2",
   "plugin_tag": "@0.2.0",
   "ply_rev": "@604b32590ffad5cbb82e4afef1d305512d06ae93",
-  "pool_rev": "@3731963107c705e192c255725bbe5956e9e7a794",
+  "pool_tag": "@1.3.3",
   "protobuf_tag": "@0.5.4",
   "pub_rev": "@cde958f157d3662bf968bcbed05580d5c0355e89",
   "pub_semver_tag": "@1.3.2",
-  "quiver_tag": "@0.22.0",
-  "resource_rev":"@a49101ba2deb29c728acba6fb86000a8f730f4b1",
+  "quiver_tag": "@0.25.0",
+  "resource_rev":"@af5a5bf65511943398146cf146e466e5f0b95cb9",
   "root_certificates_rev": "@a4c7c6f23a664a37bc1b6f15a819e3f2a292791a",
-  "scheduled_test_tag": "@0.12.11",
-  "shelf_static_tag": "@0.2.4",
-  "shelf_packages_handler_tag": "@1.0.0",
-  "shelf_tag": "@0.6.7+2",
+  "scheduled_test_tag": "@0.12.11+1",
+  "shelf_static_tag": "@0.2.5",
+  "shelf_packages_handler_tag": "@1.0.3",
+  "shelf_tag": "@0.6.8",
   "shelf_web_socket_tag": "@0.2.1",
   "source_map_stack_trace_tag": "@1.1.4",
   "source_maps-0.9.4_rev": "@38524",
   "source_maps_tag": "@0.10.4",
   "source_span_tag": "@1.4.0",
-  "stack_trace_rev": "@6332f0259b3b39398c5ce7fc924ea4e430496065",
-  "stream_channel_tag": "@1.6.1",
-  "string_scanner_tag": "@1.0.1",
+  "stack_trace_tag": "@1.8.2",
+  "stream_channel_tag": "@1.6.2",
+  "string_scanner_tag": "@1.0.2",
   "sunflower_rev": "@879b704933413414679396b129f5dfa96f7a0b1e",
   "term_glyph_tag": "@1.0.0",
   "test_reflective_loader_tag": "@0.1.0",
@@ -132,8 +132,8 @@
   "typed_data_tag": "@1.1.3",
   "usage_tag": "@3.3.0",
   "utf_tag": "@0.9.0+3",
-  "watcher_tag": "@0.9.7+3",
-  "web_socket_channel_tag": "@1.0.4",
+  "watcher_tag": "@0.9.7+4",
+  "web_socket_channel_tag": "@1.0.6",
   "WebCore_rev": "@3c45690813c112373757bbef53de1602a62af609",
   "yaml_tag": "@2.1.12",
   "zlib_rev": "@c3d0a6190f2f8c924a05ab6cc97b8f975bddd33f",
@@ -268,7 +268,7 @@
   Var("dart_root") + "/third_party/pkg/plugin":
       Var("github_mirror") + "plugin.git" + Var("plugin_tag"),
   Var("dart_root") + "/third_party/pkg/pool":
-      Var("github_mirror") + "pool.git" + Var("pool_rev"),
+      Var("github_mirror") + "pool.git" + Var("pool_tag"),
   Var("dart_root") + "/third_party/pkg/protobuf":
       Var("github_mirror") + "protobuf.git" + Var("protobuf_tag"),
   Var("dart_root") + "/third_party/pkg/pub_semver":
@@ -301,7 +301,7 @@
       Var("github_mirror") + "source_map_stack_trace.git" +
       Var("source_map_stack_trace_tag"),
   Var("dart_root") + "/third_party/pkg/stack_trace":
-      Var("github_mirror") + "stack_trace.git" + Var("stack_trace_rev"),
+      Var("github_mirror") + "stack_trace.git" + Var("stack_trace_tag"),
   Var("dart_root") + "/third_party/pkg/stream_channel":
       Var("github_mirror") + "stream_channel.git" +
       Var("stream_channel_tag"),
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index 744f0b2..804774e 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -102,6 +102,7 @@
       #    Dart 1 tests                DDC tests
       # =================       ==========================
       ("tests/language/",       "tests/language_2/"),
+      ("tests/corelib/",        "tests/corelib_2/"),
       ("tests/lib/",            "tests/lib_2/"),
       ("tests/html/",           "tests/lib_2/html/"),
   ]
diff --git a/docs/language/Dart.g b/docs/language/Dart.g
new file mode 100644
index 0000000..fe59c51
--- /dev/null
+++ b/docs/language/Dart.g
@@ -0,0 +1,1718 @@
+// 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.
+
+// CHANGES:
+//
+// v1.0 First version available in the SDK github repository. Covers the
+// Dart language as specified in the language specification based on the
+// many grammar rule snippets. That grammar was then adjusted to remove
+// known issues (e.g., misplaced metadata) and to resolve ambiguities.
+// HERE!
+
+grammar Dart;
+
+/*
+options {
+  backtrack=true;
+  memoize=true;
+}
+*/
+
+@parser::header{
+import java.util.Stack;
+}
+
+@lexer::header{
+import java.util.Stack;
+}
+
+@parser::members {
+  public static String filePath = null;
+  public static boolean filePathHasBeenPrinted = true;
+
+  // Grammar debugging friendly output, 'The Definitive ANTLR Reference', p247.
+  public String getErrorMessage(RecognitionException e, String[] tokenNames) {
+    List stack = getRuleInvocationStack(e, this.getClass().getName());
+    String msg = null;
+    if ( e instanceof NoViableAltException ) {
+      NoViableAltException nvae = (NoViableAltException)e;
+      msg = "no viable alt; token=" + e.token +
+          " (decision=" + nvae.decisionNumber +
+          " state " + nvae.stateNumber + ")" +
+          " decision=<<" + nvae.grammarDecisionDescription + ">>";
+    }
+    else {
+      msg = super.getErrorMessage(e, tokenNames);
+    }
+    if (!filePathHasBeenPrinted) {
+      filePathHasBeenPrinted = true;
+      System.err.println(">>> Parse error in " + filePath + ":");
+    }
+    return stack + " " + msg;
+  }
+
+  public String getTokenErrorDisplay(Token t) {
+    return t.toString();
+  }
+
+  // Enable the parser to treat ASYNC/AWAIT/YIELD as keywords in the body of an
+  // `async`, `async*`, or `sync*` function. Access via methods below.
+  private Stack<Boolean> asyncEtcAreKeywords = new Stack<Boolean>();
+  { asyncEtcAreKeywords.push(false); }
+
+  // Use this to indicate that we are now entering an `async`, `async*`,
+  // or `sync*` function.
+  void startAsyncFunction() { asyncEtcAreKeywords.push(true); }
+
+  // Use this to indicate that we are now entering a function which is
+  // neither `async`, `async*`, nor `sync*`.
+  void startNonAsyncFunction() { asyncEtcAreKeywords.push(false); }
+
+  // Use this to indicate that we are now leaving any funciton.
+  void endFunction() { asyncEtcAreKeywords.pop(); }
+
+  // Whether we can recognize ASYNC/AWAIT/YIELD as an identifier/typeIdentifier.
+  boolean asyncEtcPredicate(int tokenId) {
+    if (tokenId == ASYNC || tokenId == AWAIT || tokenId == YIELD) {
+      return !asyncEtcAreKeywords.peek();
+    }
+    return false;
+  }
+
+  // Debugging support methods.
+  void dp(int indent, String method, String sep) {
+    for (int i = 0; i < indent; i++) {
+      System.out.print("  ");
+    }
+    System.out.println(method + sep + " " + input.LT(1) + " " + state.failed);
+  }
+
+  void dpBegin(int indent, String method) { dp(indent, method, ":"); }
+  void dpEnd(int indent, String method) { dp(indent, method, " END:"); }
+  void dpCall(int indent, String method) { dp(indent, method, "?"); }
+  void dpCalled(int indent, String method) { dp(indent, method, ".."); }
+  void dpResult(int indent, String method) { dp(indent, method, "!"); }
+}
+
+@lexer::members{
+  public static final int BRACE_NORMAL = 1;
+  public static final int BRACE_SINGLE = 2;
+  public static final int BRACE_DOUBLE = 3;
+  public static final int BRACE_THREE_SINGLE = 4;
+  public static final int BRACE_THREE_DOUBLE = 5;
+
+  // Enable the parser to handle string interpolations via brace matching.
+  // The top of the `braceLevels` stack describes the most recent unmatched
+  // '{'. This is needed in order to enable/disable certain lexer rules.
+  //
+  //   NORMAL: Most recent unmatched '{' was not string literal related.
+  //   SINGLE: Most recent unmatched '{' was `'...${`.
+  //   DOUBLE: Most recent unmatched '{' was `"...${`.
+  //   THREE_SINGLE: Most recent unmatched '{' was `'''...${`.
+  //   THREE_DOUBLE: Most recent unmatched '{' was `"""...${`.
+  //
+  // Access via functions below.
+  private Stack<Integer> braceLevels = new Stack<Integer>();
+
+  // Whether we are currently in a string literal context, and which one.
+  boolean currentBraceLevel(int braceLevel) {
+    if (braceLevels.empty()) return false;
+    return braceLevels.peek() == braceLevel;
+  }
+
+  // Use this to indicate that we are now entering a specific '{...}'.
+  // Call it after accepting the '{'.
+  void enterBrace() {
+    braceLevels.push(BRACE_NORMAL);
+  }
+  void enterBraceSingleQuote() {
+    braceLevels.push(BRACE_SINGLE);
+  }
+  void enterBraceDoubleQuote() {
+    braceLevels.push(BRACE_DOUBLE);
+  }
+  void enterBraceThreeSingleQuotes() {
+    braceLevels.push(BRACE_THREE_SINGLE);
+  }
+  void enterBraceThreeDoubleQuotes() {
+    braceLevels.push(BRACE_THREE_DOUBLE);
+  }
+
+  // Use this to indicate that we are now exiting a specific '{...}',
+  // no matter which kind. Call it before accepting the '}'.
+  void exitBrace() {
+      // We might raise a parse error here if the stack is empty, but the
+      // parsing rules should ensure that we get a parse error anyway, and
+      // it is not a big problem for the spec parser even if it misinterprets
+      // the brace structure of some programs with syntax errors.
+      if (!braceLevels.empty()) braceLevels.pop();
+  }
+}
+
+// ---------------------------------------- Grammar rules.
+
+libraryDefinition
+    :    FEFF? SCRIPT_TAG?
+         ((metadata LIBRARY) => libraryName)?
+         ((metadata (IMPORT | EXPORT)) => importOrExport)*
+         ((metadata PART) => partDirective)*
+         (metadata topLevelDefinition)*
+         EOF
+    ;
+
+topLevelDefinition
+    :    classDefinition
+    |    enumType
+    |    (TYPEDEF typeIdentifier typeParameters? '=') => typeAlias
+    |    (TYPEDEF functionPrefix ('<' | '(')) => typeAlias
+    |    (EXTERNAL functionSignature ';') => EXTERNAL functionSignature ';'
+    |    (EXTERNAL getterSignature) => EXTERNAL getterSignature ';'
+    |    (EXTERNAL type? SET identifier '(') =>
+         EXTERNAL setterSignature ';'
+    |    (getterSignature functionBodyPrefix) => getterSignature functionBody
+    |    (type? SET identifier '(') => setterSignature functionBody
+    |    (type? identifierNotFunction typeParameters? '(') =>
+         functionSignature functionBody
+    |    ((FINAL | CONST) type? identifier '=') =>
+         (FINAL | CONST) type? staticFinalDeclarationList ';'
+    |    initializedVariableDeclaration ';'
+    ;
+
+declaredIdentifier
+    :    COVARIANT? finalConstVarOrType identifier
+    ;
+
+finalConstVarOrType
+    :    FINAL type?
+    |    CONST type?
+    |    varOrType
+    ;
+
+varOrType
+    :    VAR
+    |    type
+    ;
+
+initializedVariableDeclaration
+    :    declaredIdentifier ('=' expression)? (',' initializedIdentifier)*
+    ;
+
+initializedIdentifier
+    :    identifier ('=' expression)?
+    ;
+
+initializedIdentifierList
+    :    initializedIdentifier (',' initializedIdentifier)*
+    ;
+
+functionSignature
+    :    type? identifierNotFunction formalParameterPart
+    ;
+
+functionBodyPrefix
+    :    ASYNC? '=>'
+    |    (ASYNC | ASYNC '*' | SYNC '*')? LBRACE
+    ;
+
+functionBody
+    :    '=>' { startNonAsyncFunction(); } expression { endFunction(); } ';'
+    |    { startNonAsyncFunction(); } block { endFunction(); }
+    |    ASYNC '=>'
+         { startAsyncFunction(); } expression { endFunction(); } ';'
+    |    (ASYNC | ASYNC '*' | SYNC '*')
+         { startAsyncFunction(); } block { endFunction(); }
+    ;
+
+block
+    :    LBRACE statements RBRACE
+    ;
+
+formalParameterPart
+    :    typeParameters? formalParameterList
+    ;
+
+formalParameterList
+    :    '(' ')'
+    |    '(' normalFormalParameters (','? | ',' optionalFormalParameters) ')'
+    |    '(' optionalFormalParameters ')'
+    ;
+
+normalFormalParameters
+    :    normalFormalParameter (',' normalFormalParameter)*
+    ;
+
+optionalFormalParameters
+    :    optionalPositionalFormalParameters
+    |    namedFormalParameters
+    ;
+
+optionalPositionalFormalParameters
+    :    '[' defaultFormalParameter (',' defaultFormalParameter)* ','? ']'
+    ;
+
+namedFormalParameters
+    :    LBRACE defaultNamedParameter (',' defaultNamedParameter)* ','? RBRACE
+    ;
+
+normalFormalParameter
+    :    metadata normalFormalParameterNoMetadata
+    ;
+
+normalFormalParameterNoMetadata
+    :    (COVARIANT? type? identifierNotFunction formalParameterPart) =>
+         functionFormalParameter
+    |    (finalConstVarOrType? THIS) => fieldFormalParameter
+    |    simpleFormalParameter
+    ;
+
+functionFormalParameter
+    :    COVARIANT? type? identifierNotFunction formalParameterPart
+    ;
+
+simpleFormalParameter
+    :    declaredIdentifier
+    |    COVARIANT? identifier
+    ;
+
+fieldFormalParameter
+    :    finalConstVarOrType? THIS '.' identifier formalParameterPart?
+    ;
+
+defaultFormalParameter
+    :    normalFormalParameter ('=' expression)?
+    ;
+
+defaultNamedParameter
+    :    normalFormalParameter ((':' | '=') expression)?
+    ;
+
+typeApplication
+    :    typeIdentifier typeParameters?
+    ;
+
+classDefinition
+    :    (ABSTRACT? CLASS typeApplication (EXTENDS|IMPLEMENTS|LBRACE)) =>
+         ABSTRACT? CLASS typeApplication (superclass mixins?)? interfaces?
+         LBRACE (metadata classMemberDefinition)* RBRACE
+    |    (ABSTRACT? CLASS typeApplication '=') =>
+         ABSTRACT? CLASS mixinApplicationClass
+    ;
+
+mixins
+    :    WITH typeNotVoidNotFunctionList
+    ;
+
+classMemberDefinition
+    :    (methodSignature functionBodyPrefix) => methodSignature functionBody
+    |    declaration ';'
+    ;
+
+methodSignature
+    :    (constructorSignature ':') => constructorSignature initializers
+    |    (FACTORY constructorName '(') => factoryConstructorSignature
+    |    (STATIC? type? identifierNotFunction typeParameters? '(') =>
+         STATIC? functionSignature
+    |    (STATIC? type? GET) => STATIC? getterSignature
+    |    (STATIC? type? SET) => STATIC? setterSignature
+    |    (type? OPERATOR operator '(') => operatorSignature
+    |    constructorSignature
+    ;
+
+// https://github.com/dart-lang/sdk/issues/29501 reports on the problem which
+// was solved by adding a case for redirectingFactoryConstructorSignature.
+// TODO(eernst): Close that issue when this is integrated into the spec.
+
+// https://github.com/dart-lang/sdk/issues/29502 reports on the problem that
+// than external const factory constructor declaration cannot be derived by
+// the spec grammar (and also not by this grammar). The following fixes were
+// introduced for that: Added the 'factoryConstructorSignature' case below in
+// 'declaration'; also added 'CONST?' in the 'factoryConstructorSignature'
+// rule, such that const factories in general are allowed.
+// TODO(eernst): Close that issue when this is integrated into the spec.
+
+declaration
+    :    (EXTERNAL CONST? FACTORY constructorName '(') =>
+         EXTERNAL factoryConstructorSignature
+    |    EXTERNAL constantConstructorSignature
+    |    (EXTERNAL constructorName '(') => EXTERNAL constructorSignature
+    |    ((EXTERNAL STATIC?)? type? GET) => (EXTERNAL STATIC?)? getterSignature
+    |    ((EXTERNAL STATIC?)? type? SET) => (EXTERNAL STATIC?)? setterSignature
+    |    (EXTERNAL? type? OPERATOR) => EXTERNAL? operatorSignature
+    |    (STATIC (FINAL | CONST)) =>
+         STATIC (FINAL | CONST) type? staticFinalDeclarationList
+    |    FINAL type? initializedIdentifierList
+    |    ((STATIC | COVARIANT)? (VAR | type) identifier ('=' | ',' | ';')) =>
+         (STATIC | COVARIANT)? (VAR | type) initializedIdentifierList
+    |    (EXTERNAL? STATIC? functionSignature ';') =>
+         EXTERNAL? STATIC? functionSignature
+    |    (CONST? FACTORY constructorName formalParameterList '=') =>
+         redirectingFactoryConstructorSignature
+    |    constantConstructorSignature (redirection | initializers)?
+    |    constructorSignature (redirection | initializers)?
+    ;
+
+staticFinalDeclarationList
+    :    staticFinalDeclaration (',' staticFinalDeclaration)*
+    ;
+
+staticFinalDeclaration
+    :    identifier '=' expression
+    ;
+
+operatorSignature
+    :    type? OPERATOR operator formalParameterList
+    ;
+
+operator
+    :    '~'
+    |    binaryOperator
+    |    '[' ']'
+    |    '[' ']' '='
+    ;
+
+binaryOperator
+    :    multiplicativeOperator
+    |    additiveOperator
+    |    (shiftOperator) => shiftOperator
+    |    relationalOperator
+    |    '=='
+    |    bitwiseOperator
+    ;
+
+getterSignature
+    :    type? GET identifier
+    ;
+
+setterSignature
+    :    type? SET identifier formalParameterList
+    ;
+
+constructorSignature
+    :    constructorName formalParameterList
+    ;
+
+constructorName
+    :    typeIdentifier ('.' identifier)?
+    ;
+
+redirection
+    :    ':' THIS ('.' identifier)? arguments
+    ;
+
+initializers
+    :    ':' superCallOrFieldInitializer (',' superCallOrFieldInitializer)*
+    ;
+
+superCallOrFieldInitializer
+    :    SUPER arguments
+    |    SUPER '.' identifier arguments
+    |    fieldInitializer
+    |    assertClause
+    ;
+
+fieldInitializer
+    :    (THIS '.')? identifier '=' conditionalExpression cascadeSection*
+    ;
+
+factoryConstructorSignature
+    :    CONST? FACTORY constructorName formalParameterList
+    ;
+
+redirectingFactoryConstructorSignature
+    :    CONST? FACTORY constructorName formalParameterList '='
+         constructorDesignation
+    ;
+
+constantConstructorSignature
+    :    CONST constructorName formalParameterList
+    ;
+
+superclass
+    :    EXTENDS typeNotVoidNotFunction
+    ;
+
+interfaces
+    :    IMPLEMENTS typeNotVoidNotFunctionList
+    ;
+
+mixinApplicationClass
+    :    typeApplication '=' mixinApplication ';'
+    ;
+
+mixinApplication
+    :    typeNotVoidNotFunction mixins interfaces?
+    ;
+
+enumType
+    :    ENUM typeIdentifier LBRACE identifier (',' identifier)* (',')? RBRACE
+    ;
+
+typeParameter
+    :    metadata typeIdentifier (EXTENDS typeNotVoid)?
+    ;
+
+typeParameters
+    :    '<' typeParameter (',' typeParameter)* '>'
+    ;
+
+metadata
+    :    ('@' metadatum)*
+    ;
+
+metadatum
+    :    constructorDesignation arguments
+    |    qualified
+    ;
+
+expression
+    :    (formalParameterPart functionExpressionBodyPrefix) =>
+         functionExpression
+    |    throwExpression
+    |    (assignableExpression assignmentOperator) =>
+         assignableExpression assignmentOperator expression
+    |    conditionalExpression cascadeSection*
+    ;
+
+expressionWithoutCascade
+    :    (formalParameterPart functionExpressionBodyPrefix) =>
+         functionExpressionWithoutCascade
+    |    throwExpressionWithoutCascade
+    |    (assignableExpression assignmentOperator) =>
+         assignableExpression assignmentOperator expressionWithoutCascade
+    |    conditionalExpression
+    ;
+
+expressionList
+    :    expression (',' expression)*
+    ;
+
+primary
+    :    thisExpression
+    |    SUPER unconditionalAssignableSelector
+    |    (CONST constructorDesignation) => constObjectExpression
+    |    newExpression
+    |    (formalParameterPart functionPrimaryBodyPrefix) => functionPrimary
+    |    '(' expression ')'
+    |    literal
+    |    identifier
+    ;
+
+literal
+    :    nullLiteral
+    |    booleanLiteral
+    |    numericLiteral
+    |    stringLiteral
+    |    symbolLiteral
+    |    (CONST? typeArguments? LBRACE) => mapLiteral
+    |    listLiteral
+    ;
+
+nullLiteral
+    :    NULL
+    ;
+
+numericLiteral
+    :    NUMBER
+    |    HEX_NUMBER
+    ;
+
+booleanLiteral
+    :    TRUE
+    |    FALSE
+    ;
+
+stringLiteral
+    :    (multiLineString | singleLineString)+
+    ;
+
+stringLiteralWithoutInterpolation
+    :    singleLineStringWithoutInterpolation+
+    ;
+
+listLiteral
+    :    CONST? typeArguments? '[' (expressionList ','?)? ']'
+    ;
+
+mapLiteral
+    :    CONST? typeArguments?
+         LBRACE (mapLiteralEntry (',' mapLiteralEntry)* ','?)? RBRACE
+    ;
+
+mapLiteralEntry
+    :    expression ':' expression
+    ;
+
+throwExpression
+    :    THROW expression
+    ;
+
+throwExpressionWithoutCascade
+    :    THROW expressionWithoutCascade
+    ;
+
+functionExpression
+    :    formalParameterPart functionExpressionBody
+    ;
+
+functionExpressionBody
+    :    '=>' { startNonAsyncFunction(); } expression { endFunction(); }
+    |    ASYNC '=>' { startAsyncFunction(); } expression { endFunction(); }
+    ;
+
+functionExpressionBodyPrefix
+    :    ASYNC? '=>'
+    ;
+
+functionExpressionWithoutCascade
+    :    formalParameterPart functionExpressionWithoutCascadeBody
+    ;
+
+functionExpressionWithoutCascadeBody
+    :    '=>' { startNonAsyncFunction(); }
+         expressionWithoutCascade { endFunction(); }
+    |    ASYNC '=>' { startAsyncFunction(); }
+         expressionWithoutCascade { endFunction(); }
+    ;
+
+functionPrimary
+    :    formalParameterPart functionPrimaryBody
+    ;
+
+functionPrimaryBody
+    :    { startNonAsyncFunction(); } block { endFunction(); }
+    |    (ASYNC | ASYNC '*' | SYNC '*')
+         { startAsyncFunction(); } block { endFunction(); }
+    ;
+
+functionPrimaryBodyPrefix
+    : (ASYNC | ASYNC '*' | SYNC '*')? LBRACE
+    ;
+
+thisExpression
+    :    THIS
+    ;
+
+newExpression
+    :    NEW constructorDesignation arguments
+    ;
+
+constObjectExpression
+    :    CONST constructorDesignation arguments
+    ;
+
+arguments
+    :    '(' (argumentList ','?)? ')'
+    ;
+
+argumentList
+    :    namedArgument (',' namedArgument)*
+    |    expressionList (',' namedArgument)*
+    ;
+
+namedArgument
+    :    label expression
+    ;
+
+cascadeSection
+    :    '..'
+         (cascadeSelector argumentPart*)
+         (assignableSelector argumentPart*)*
+         (assignmentOperator expressionWithoutCascade)?
+    ;
+
+cascadeSelector
+    :    '[' expression ']'
+    |    identifier
+    ;
+
+assignmentOperator
+    :    '='
+    |    compoundAssignmentOperator
+    ;
+
+compoundAssignmentOperator
+    :    '*='
+    |    '/='
+    |    '~/='
+    |    '%='
+    |    '+='
+    |    '-='
+    |    '<<='
+    |    '>' '>' '='
+    |    '&='
+    |    '^='
+    |    '|='
+    |    '??='
+    ;
+
+conditionalExpression
+    :    ifNullExpression
+         ('?' expressionWithoutCascade ':' expressionWithoutCascade)?
+    ;
+
+ifNullExpression
+    :    logicalOrExpression ('??' logicalOrExpression)*
+    ;
+
+logicalOrExpression
+    :    logicalAndExpression ('||' logicalAndExpression)*
+    ;
+
+logicalAndExpression
+    :    equalityExpression ('&&' equalityExpression)*
+    ;
+
+equalityExpression
+    :    relationalExpression (equalityOperator relationalExpression)?
+    |    SUPER equalityOperator relationalExpression
+    ;
+
+equalityOperator
+    :    '=='
+    |    '!='
+    ;
+
+relationalExpression
+    :    bitwiseOrExpression
+         (typeTest | typeCast | relationalOperator bitwiseOrExpression)?
+    |    SUPER relationalOperator bitwiseOrExpression
+    ;
+
+relationalOperator
+    :    '>' '='
+    |    '>'
+    |    '<='
+    |    '<'
+    ;
+
+bitwiseOrExpression
+    :    bitwiseXorExpression ('|' bitwiseXorExpression)*
+    |    SUPER ('|' bitwiseXorExpression)+
+    ;
+
+bitwiseXorExpression
+    :    bitwiseAndExpression ('^' bitwiseAndExpression)*
+    |    SUPER ('^' bitwiseAndExpression)+
+    ;
+
+bitwiseAndExpression
+    :    shiftExpression ('&' shiftExpression)*
+    |    SUPER ('&' shiftExpression)+
+    ;
+
+bitwiseOperator
+    :    '&'
+    |    '^'
+    |    '|'
+    ;
+
+shiftExpression
+    :    additiveExpression (shiftOperator additiveExpression)*
+    |    SUPER (shiftOperator additiveExpression)+
+    ;
+
+shiftOperator
+    :    '<<'
+    |    '>' '>'
+    ;
+
+additiveExpression
+    :    multiplicativeExpression (additiveOperator multiplicativeExpression)*
+    |    SUPER (additiveOperator multiplicativeExpression)+
+    ;
+
+additiveOperator
+    :    '+'
+    |    '-'
+    ;
+
+multiplicativeExpression
+    :    unaryExpression (multiplicativeOperator unaryExpression)*
+    |    SUPER (multiplicativeOperator unaryExpression)+
+    ;
+
+multiplicativeOperator
+    :    '*'
+    |    '/'
+    |    '%'
+    |    '~/'
+    ;
+
+unaryExpression
+    :    (prefixOperator ~SUPER) => prefixOperator unaryExpression
+    |    (awaitExpression) => awaitExpression
+    |    postfixExpression
+    |    (minusOperator | tildeOperator) SUPER
+    |    incrementOperator assignableExpression
+    ;
+
+prefixOperator
+    :    minusOperator
+    |    negationOperator
+    |    tildeOperator
+    ;
+
+minusOperator
+    :    '-'
+    ;
+
+negationOperator
+    :    '!'
+    ;
+
+tildeOperator
+    :    '~'
+    ;
+
+awaitExpression
+    :    AWAIT unaryExpression
+    ;
+
+// The `(selector)` predicate ensures that the parser commits to the longest
+// possible chain of selectors, e.g., `a<b,c>(d)` as a call rather than as a
+// sequence of two relational expressions.
+
+postfixExpression
+    :    (assignableExpression postfixOperator) =>
+         assignableExpression postfixOperator
+    |    primary ((selector) => selector)*
+    ;
+
+postfixOperator
+    :    incrementOperator
+    ;
+
+selector
+    :    assignableSelector
+    |    argumentPart
+    ;
+
+argumentPart
+    :    typeArguments? arguments
+    ;
+
+incrementOperator
+    :    '++'
+    |    '--'
+    ;
+
+// The `(assignableSelectorPart)` predicate ensures that the parser
+// commits to the longest possible chain, e.g., `a<b,c>(d).e` as one rather
+// than two expressions. The first `identifier` alternative handles all
+// the simple cases; the final `identifier` alternative at the end catches
+// the case where we have `identifier '<'` and the '<' is used as a
+// relationalOperator, not the beginning of typeArguments.
+
+assignableExpression
+    :    (SUPER unconditionalAssignableSelector
+            ~('<' | '(' | '[' | '.' | '?.')) =>
+         SUPER unconditionalAssignableSelector
+    |    (identifier ~('<' | '(' | '[' | '.' | '?.')) => identifier
+    |    (primary argumentPart* assignableSelector) =>
+         primary ((assignableSelectorPart) => assignableSelectorPart)+
+    |    identifier
+    ;
+
+assignableSelectorPart
+    :    argumentPart* assignableSelector
+    ;
+
+unconditionalAssignableSelector
+    :    '[' expression ']'
+    |    '.' identifier
+    ;
+
+assignableSelector
+    :    unconditionalAssignableSelector
+    |    '?.' identifier
+    ;
+
+identifierNotFunction
+    :    IDENTIFIER
+    |    ABSTRACT
+    |    AS
+    |    COVARIANT
+    |    DEFERRED
+    |    DYNAMIC
+    |    EXPORT
+    |    EXTERNAL
+    |    FACTORY
+    |    GET
+    |    IMPLEMENTS
+    |    IMPORT
+    |    LIBRARY
+    |    OPERATOR
+    |    PART
+    |    SET
+    |    STATIC
+    |    TYPEDEF
+    |    HIDE // Not a built-in identifier.
+    |    OF // Not a built-in identifier.
+    |    ON // Not a built-in identifier.
+    |    SHOW // Not a built-in identifier.
+    |    SYNC // Not a built-in identifier.
+    |    { asyncEtcPredicate(input.LA(1)) }? (ASYNC|AWAIT|YIELD)
+    ;
+
+identifier
+    :    identifierNotFunction
+    |    FUNCTION // Not a built-in identifier.
+    ;
+
+qualified
+    :    identifier ('.' identifier)?
+    ;
+
+typeIdentifier
+    :    IDENTIFIER
+    |    DYNAMIC // The only built-in identifier that can be used as a type.
+    |    HIDE // Not a built-in identifier.
+    |    OF // Not a built-in identifier.
+    |    ON // Not a built-in identifier.
+    |    SHOW // Not a built-in identifier.
+    |    SYNC // Not a built-in identifier.
+    |    FUNCTION // Not a built-in identifier.
+    |    { asyncEtcPredicate(input.LA(1)) }? (ASYNC|AWAIT|YIELD)
+    ;
+
+typeTest
+    :    isOperator typeNotVoid
+    ;
+
+isOperator
+    :    IS '!'?
+    ;
+
+typeCast
+    :    asOperator typeNotVoid
+    ;
+
+asOperator
+    :    AS
+    ;
+
+statements
+    :    statement*
+    ;
+
+statement
+    :    label* nonLabelledStatement
+    ;
+
+// Exception in the language specification: An expressionStatement cannot
+// start with LBRACE. We force anything that starts with LBRACE to be a block,
+// which will prevent an expressionStatement from starting with LBRACE, and
+// which will not interfere with the recognition of any other case. If we
+// add another statement which can start with LBRACE we must adjust this
+// check.
+nonLabelledStatement
+    :    (LBRACE) => block
+    |    (declaredIdentifier ('='|','|';')) => localVariableDeclaration
+    |    (AWAIT? FOR) => forStatement
+    |    whileStatement
+    |    doStatement
+    |    switchStatement
+    |    ifStatement
+    |    rethrowStatement
+    |    tryStatement
+    |    breakStatement
+    |    continueStatement
+    |    returnStatement
+    |    (functionSignature functionBodyPrefix) => localFunctionDeclaration
+    |    assertStatement
+    |    (YIELD ~'*') => yieldStatement
+    |    yieldEachStatement
+    |    expressionStatement
+    ;
+
+expressionStatement
+    :    expression? ';'
+    ;
+
+localVariableDeclaration
+    :    initializedVariableDeclaration ';'
+    ;
+
+localFunctionDeclaration
+    :    functionSignature functionBody
+    ;
+
+ifStatement
+    :    IF '(' expression ')' statement ((ELSE) => ELSE statement | ())
+    ;
+
+forStatement
+    :    AWAIT? FOR '(' forLoopParts ')' statement
+    ;
+
+forLoopParts
+    :    (declaredIdentifier IN) => declaredIdentifier IN expression
+    |    (identifier IN) => identifier IN expression
+    |    forInitializerStatement expression? ';' expressionList?
+    ;
+
+// The localVariableDeclaration cannot be CONST, but that can
+// be enforced in a later phase, and the grammar allows it.
+forInitializerStatement
+    :    (localVariableDeclaration) => localVariableDeclaration
+    |    expression? ';'
+    ;
+
+whileStatement
+    :    WHILE '(' expression ')' statement
+    ;
+
+doStatement
+    :    DO statement WHILE '(' expression ')' ';'
+    ;
+
+switchStatement
+    :    SWITCH '(' expression ')' LBRACE switchCase* defaultCase? RBRACE
+    ;
+
+switchCase
+    :    label* CASE expression ':' statements
+    ;
+
+defaultCase
+    :    label* DEFAULT ':' statements
+    ;
+
+rethrowStatement
+    :    RETHROW ';'
+    ;
+
+tryStatement
+    :    TRY block (onParts finallyPart? | finallyPart)
+    ;
+
+onPart
+    :    catchPart block
+    |    ON typeNotVoid catchPart? block
+    ;
+
+onParts
+    :    (onPart (ON|CATCH)) => onPart onParts
+    |    onPart
+    ;
+
+catchPart
+    :    CATCH '(' identifier (',' identifier)? ')'
+    ;
+
+finallyPart
+    :    FINALLY block
+    ;
+
+returnStatement
+    :    RETURN expression? ';'
+    ;
+
+label
+    :    identifier ':'
+    ;
+
+breakStatement
+    :    BREAK identifier? ';'
+    ;
+
+continueStatement
+    :    CONTINUE identifier? ';'
+    ;
+
+yieldStatement
+    :    YIELD expression ';'
+    ;
+
+yieldEachStatement
+    :    YIELD '*' expression ';'
+    ;
+
+assertStatement
+    :    assertClause ';'
+    ;
+
+assertClause
+    :    ASSERT '(' expression (',' expression)? ')'
+    ;
+
+libraryName
+    :    metadata LIBRARY identifier ('.' identifier)* ';'
+    ;
+
+importOrExport
+    :    (metadata IMPORT) => libraryImport
+    |    (metadata EXPORT) => libraryExport
+    ;
+
+libraryImport
+    :    metadata importSpecification
+    ;
+
+importSpecification
+    :    IMPORT uri (AS identifier)? combinator* ';'
+    |    IMPORT uri DEFERRED AS identifier combinator* ';'
+    ;
+
+combinator
+    :    SHOW identifierList
+    |    HIDE identifierList
+    ;
+
+identifierList
+    :    identifier (',' identifier)*
+    ;
+
+libraryExport
+    :    metadata EXPORT uri combinator* ';'
+    ;
+
+partDirective
+    :    metadata PART uri ';'
+    ;
+
+partHeader
+    :    metadata PART OF identifier ('.' identifier)* ';'
+    ;
+
+partDeclaration
+    :    partHeader topLevelDefinition* EOF
+    ;
+
+uri
+    :    stringLiteralWithoutInterpolation
+    ;
+
+type
+    :    (FUNCTION ('('|'<')) => functionTypeTails
+    |    (typeNotFunction FUNCTION ('('|'<')) =>
+         typeNotFunction functionTypeTails
+    |    typeNotFunction
+    ;
+
+typeNotFunction
+    :    typeNotVoidNotFunction
+    |    VOID
+    ;
+
+typeNotVoid
+    :    (typeNotFunction? FUNCTION ('('|'<')) => functionType
+    |    typeNotVoidNotFunction
+    ;
+
+typeNotVoidNotFunction
+    :    typeName typeArguments?
+    ;
+
+typeName
+    :    typeIdentifier ('.' typeIdentifier)?
+    ;
+
+typeArguments
+    :    '<' typeList '>'
+    ;
+
+typeList
+    :    type (',' type)*
+    ;
+
+typeNotVoidNotFunctionList
+    :    typeNotVoidNotFunction (',' typeNotVoidNotFunction)*
+    ;
+
+typeAlias
+    :    (TYPEDEF typeIdentifier typeParameters? '=') =>
+         TYPEDEF typeIdentifier typeParameters? '=' functionType ';'
+    |    TYPEDEF functionTypeAlias
+    ;
+
+functionTypeAlias
+    :    functionPrefix formalParameterPart ';'
+    ;
+
+functionPrefix
+    :    (type identifier) => type identifier
+    |    identifier
+    ;
+
+functionTypeTail
+    :    FUNCTION typeParameters? parameterTypeList
+    ;
+
+functionTypeTails
+    :    (functionTypeTail FUNCTION ('<'|'(')) =>
+         functionTypeTail functionTypeTails
+    |    functionTypeTail
+    ;
+
+functionType
+    :    (FUNCTION ('<'|'(')) => functionTypeTails
+    |    typeNotFunction functionTypeTails
+    ;
+
+parameterTypeList
+    :    ('(' ')') => '(' ')'
+    |    ('(' normalParameterTypes ',' ('['|'{')) =>
+         '(' normalParameterTypes ',' optionalParameterTypes ')'
+    |    ('(' normalParameterTypes ','? ')') =>
+         '(' normalParameterTypes ','? ')'
+    |    '(' optionalParameterTypes ')'
+    ;
+
+normalParameterTypes
+    :    normalParameterType (',' normalParameterType)*
+    ;
+
+normalParameterType
+    :    (typedIdentifier) => typedIdentifier
+    |    type
+    ;
+
+optionalParameterTypes
+    :    optionalPositionalParameterTypes
+    |    namedParameterTypes
+    ;
+
+optionalPositionalParameterTypes
+    :    '[' normalParameterTypes ','? ']'
+    ;
+
+namedParameterTypes
+    :    '{' typedIdentifier (',' typedIdentifier)* ','? '}'
+    ;
+
+typedIdentifier
+    :    type identifier
+    ;
+
+constructorDesignation
+    :    typeIdentifier
+    |    identifier '.' identifier
+    |    identifier '.' typeIdentifier '.' identifier
+    |    typeName typeArguments ('.' identifier)?
+    ;
+
+// Predicate: Force resolution as composite symbolLiteral as far as possible.
+symbolLiteral
+    :    '#' (operator | (identifier (('.' identifier) => '.' identifier)*))
+    ;
+
+singleLineStringWithoutInterpolation
+    :    RAW_SINGLE_LINE_STRING
+    |    SINGLE_LINE_STRING_DQ_BEGIN_END
+    |    SINGLE_LINE_STRING_SQ_BEGIN_END
+    ;
+
+singleLineString
+    :    RAW_SINGLE_LINE_STRING
+    |    SINGLE_LINE_STRING_SQ_BEGIN_END
+    |    SINGLE_LINE_STRING_SQ_BEGIN_MID expression
+         (SINGLE_LINE_STRING_SQ_MID_MID expression)*
+         SINGLE_LINE_STRING_SQ_MID_END
+    |    SINGLE_LINE_STRING_DQ_BEGIN_END
+    |    SINGLE_LINE_STRING_DQ_BEGIN_MID expression
+         (SINGLE_LINE_STRING_DQ_MID_MID expression)*
+         SINGLE_LINE_STRING_DQ_MID_END
+    ;
+
+multiLineString
+    :    RAW_MULTI_LINE_STRING
+    |    MULTI_LINE_STRING_SQ_BEGIN_END
+    |    MULTI_LINE_STRING_SQ_BEGIN_MID expression
+         (MULTI_LINE_STRING_SQ_MID_MID expression)*
+         MULTI_LINE_STRING_SQ_MID_END
+    |    MULTI_LINE_STRING_DQ_BEGIN_END
+    |    MULTI_LINE_STRING_DQ_BEGIN_MID expression
+         (MULTI_LINE_STRING_DQ_MID_MID expression)*
+         MULTI_LINE_STRING_DQ_MID_END
+    ;
+
+// ---------------------------------------- Lexer rules.
+
+fragment
+LETTER
+    :    'a' .. 'z'
+    |    'A' .. 'Z'
+    ;
+
+fragment
+DIGIT
+    :    '0' .. '9'
+    ;
+
+fragment
+EXPONENT
+    :    ('e' | 'E') ('+' | '-')? DIGIT+
+    ;
+
+fragment
+HEX_DIGIT
+    :    ('a' | 'b' | 'c' | 'd' | 'e' | 'f')
+    |    ('A' | 'B' | 'C' | 'D' | 'E' | 'F')
+    |    DIGIT
+    ;
+
+FINAL
+    :    'final'
+    ;
+
+CONST
+    :    'const'
+    ;
+
+VAR
+    :    'var'
+    ;
+
+VOID
+    :    'void'
+    ;
+
+ASYNC
+    :    'async'
+    ;
+
+THIS
+    :    'this'
+    ;
+
+ABSTRACT
+    :    'abstract'
+    ;
+
+AS
+    :    'as'
+    ;
+
+SYNC
+    :    'sync'
+    ;
+
+CLASS
+    :    'class'
+    ;
+
+WITH
+    :    'with'
+    ;
+
+STATIC
+    :    'static'
+    ;
+
+DYNAMIC
+    :    'dynamic'
+    ;
+
+EXTERNAL
+    :    'external'
+    ;
+
+GET
+    :    'get'
+    ;
+
+SET
+    :    'set'
+    ;
+
+OPERATOR
+    :    'operator'
+    ;
+
+SUPER
+    :    'super'
+    ;
+
+FACTORY
+    :    'factory'
+    ;
+
+EXTENDS
+    :    'extends'
+    ;
+
+IMPLEMENTS
+    :    'implements'
+    ;
+
+ENUM
+    :    'enum'
+    ;
+
+NULL
+    :    'null'
+    ;
+
+TRUE
+    :    'true'
+    ;
+
+FALSE
+    :    'false'
+    ;
+
+THROW
+    :    'throw'
+    ;
+
+NEW
+    :    'new'
+    ;
+
+AWAIT
+    :    'await'
+    ;
+
+DEFERRED
+    :    'deferred'
+    ;
+
+EXPORT
+    :    'export'
+    ;
+
+IMPORT
+    :    'import'
+    ;
+
+LIBRARY
+    :    'library'
+    ;
+
+PART
+    :    'part'
+    ;
+
+TYPEDEF
+    :    'typedef'
+    ;
+
+IS
+    :    'is'
+    ;
+
+IF
+    :    'if'
+    ;
+
+ELSE
+    :    'else'
+    ;
+
+WHILE
+    :    'while'
+    ;
+
+FOR
+    :    'for'
+    ;
+
+IN
+    :    'in'
+    ;
+
+DO
+    :    'do'
+    ;
+
+SWITCH
+    :    'switch'
+    ;
+
+CASE
+    :    'case'
+    ;
+
+DEFAULT
+    :    'default'
+    ;
+
+RETHROW
+    :    'rethrow'
+    ;
+
+TRY
+    :    'try'
+    ;
+
+ON
+    :    'on'
+    ;
+
+CATCH
+    :    'catch'
+    ;
+
+FINALLY
+    :    'finally'
+    ;
+
+RETURN
+    :    'return'
+    ;
+
+BREAK
+    :    'break'
+    ;
+
+CONTINUE
+    :    'continue'
+    ;
+
+YIELD
+    :    'yield'
+    ;
+
+SHOW
+    :    'show'
+    ;
+
+HIDE
+    :    'hide'
+    ;
+
+OF
+    :    'of'
+    ;
+
+ASSERT
+    :    'assert'
+    ;
+
+COVARIANT
+    :    'covariant'
+    ;
+
+FUNCTION
+    :    'Function'
+    ;
+
+NUMBER
+    :    (DIGIT+ '.' DIGIT) => DIGIT+ '.' DIGIT+ EXPONENT?
+    |    DIGIT+ EXPONENT?
+    |    '.' DIGIT+ EXPONENT?
+    ;
+
+HEX_NUMBER
+    :    '0x' HEX_DIGIT+
+    |    '0X' HEX_DIGIT+
+    ;
+
+RAW_SINGLE_LINE_STRING
+    :    'r' '\'' (~('\'' | '\r' | '\n'))* '\''
+    |    'r' '"' (~('"' | '\r' | '\n'))* '"'
+    ;
+
+RAW_MULTI_LINE_STRING
+    :    'r' '"""' (options {greedy=false;} : .)* '"""'
+    |    'r' '\'\'\'' (options {greedy=false;} : .)* '\'\'\''
+    ;
+
+fragment
+SIMPLE_STRING_INTERPOLATION
+    :    '$' IDENTIFIER_NO_DOLLAR
+    ;
+
+fragment
+STRING_CONTENT_SQ
+    :    ~('\\' | '\'' | '$' |  '\r' | '\n')
+    |    '\\' ~( '\r' | '\n')
+    |    SIMPLE_STRING_INTERPOLATION
+    ;
+
+SINGLE_LINE_STRING_SQ_BEGIN_END
+    :    '\'' STRING_CONTENT_SQ* '\''
+    ;
+
+SINGLE_LINE_STRING_SQ_BEGIN_MID
+    :    '\'' STRING_CONTENT_SQ* '${' { enterBraceSingleQuote(); }
+    ;
+
+SINGLE_LINE_STRING_SQ_MID_MID
+    :    { currentBraceLevel(BRACE_SINGLE) }? =>
+         ('}' STRING_CONTENT_SQ* '${') =>
+         { exitBrace(); } '}' STRING_CONTENT_SQ* '${'
+         { enterBraceSingleQuote(); }
+    ;
+
+SINGLE_LINE_STRING_SQ_MID_END
+    :    { currentBraceLevel(BRACE_SINGLE) }? =>
+         ('}' STRING_CONTENT_SQ* '\'') =>
+         { exitBrace(); } '}' STRING_CONTENT_SQ* '\''
+    ;
+
+fragment
+STRING_CONTENT_DQ
+    :    ~('\\' | '"' | '$' | '\r' | '\n')
+    |    '\\' ~('\r' | '\n')
+    |    SIMPLE_STRING_INTERPOLATION
+    ;
+
+SINGLE_LINE_STRING_DQ_BEGIN_END
+    :    '"' STRING_CONTENT_DQ* '"'
+    ;
+
+SINGLE_LINE_STRING_DQ_BEGIN_MID
+    :    '"' STRING_CONTENT_DQ* '${' { enterBraceDoubleQuote(); }
+    ;
+
+SINGLE_LINE_STRING_DQ_MID_MID
+    :    { currentBraceLevel(BRACE_DOUBLE) }? =>
+         ('}' STRING_CONTENT_DQ* '${') =>
+         { exitBrace(); } '}' STRING_CONTENT_DQ* '${'
+         { enterBraceDoubleQuote(); }
+    ;
+
+SINGLE_LINE_STRING_DQ_MID_END
+    :    { currentBraceLevel(BRACE_DOUBLE) }? =>
+         ('}' STRING_CONTENT_DQ* '"') =>
+         { exitBrace(); } '}' STRING_CONTENT_DQ* '"'
+    ;
+
+fragment
+QUOTES_SQ
+    :
+    |    '\''
+    |    '\'\''
+    ;
+
+// Read string contents, which may be almost anything, but stop when seeing
+// '\'\'\'' and when seeing '${'. We do this by allowing all other
+// possibilities including escapes, simple interpolation, and fewer than
+// three '\''.
+fragment
+STRING_CONTENT_TSQ
+    :    QUOTES_SQ
+         (~('\\' | '$' | '\'') | '\\' . | SIMPLE_STRING_INTERPOLATION)
+    ;
+
+MULTI_LINE_STRING_SQ_BEGIN_END
+    :    '\'\'\'' STRING_CONTENT_TSQ* '\'\'\''
+    ;
+
+MULTI_LINE_STRING_SQ_BEGIN_MID
+    :    '\'\'\'' STRING_CONTENT_TSQ* QUOTES_SQ '${'
+         { enterBraceThreeSingleQuotes(); }
+    ;
+
+MULTI_LINE_STRING_SQ_MID_MID
+    :    { currentBraceLevel(BRACE_THREE_SINGLE) }? =>
+         ('}' STRING_CONTENT_TSQ* QUOTES_SQ '${') =>
+         { exitBrace(); } '}' STRING_CONTENT_TSQ* QUOTES_SQ '${'
+         { enterBraceThreeSingleQuotes(); }
+    ;
+
+MULTI_LINE_STRING_SQ_MID_END
+    :    { currentBraceLevel(BRACE_THREE_SINGLE) }? =>
+         ('}' STRING_CONTENT_TSQ* '\'\'\'') =>
+         { exitBrace(); } '}' STRING_CONTENT_TSQ* '\'\'\''
+    ;
+
+fragment
+QUOTES_DQ
+    :
+    |    '"'
+    |    '""'
+    ;
+
+// Read string contents, which may be almost anything, but stop when seeing
+// '"""' and when seeing '${'. We do this by allowing all other possibilities
+// including escapes, simple interpolation, and fewer-than-three '"'.
+fragment
+STRING_CONTENT_TDQ
+    :    QUOTES_DQ
+         (~('\\' | '$' | '"') | '\\' . | SIMPLE_STRING_INTERPOLATION)
+    ;
+
+MULTI_LINE_STRING_DQ_BEGIN_END
+    :    '"""' STRING_CONTENT_TDQ* '"""'
+    ;
+
+MULTI_LINE_STRING_DQ_BEGIN_MID
+    :    '"""' STRING_CONTENT_TDQ* QUOTES_DQ '${'
+         { enterBraceThreeDoubleQuotes(); }
+    ;
+
+MULTI_LINE_STRING_DQ_MID_MID
+    :    { currentBraceLevel(BRACE_THREE_DOUBLE) }? =>
+         ('}' STRING_CONTENT_TDQ* QUOTES_DQ '${') =>
+         { exitBrace(); } '}' STRING_CONTENT_TDQ* QUOTES_DQ '${'
+         { enterBraceThreeDoubleQuotes(); }
+    ;
+
+MULTI_LINE_STRING_DQ_MID_END
+    :    { currentBraceLevel(BRACE_THREE_DOUBLE) }? =>
+         ('}' STRING_CONTENT_TDQ* '"""') =>
+         { exitBrace(); } '}' STRING_CONTENT_TDQ* '"""'
+    ;
+
+LBRACE
+    :    '{' { enterBrace(); }
+    ;
+
+RBRACE
+    :    { currentBraceLevel(BRACE_NORMAL) }? => ('}') => { exitBrace(); } '}'
+    ;
+
+fragment
+IDENTIFIER_START_NO_DOLLAR
+    :    LETTER
+    |    '_'
+    ;
+
+fragment
+IDENTIFIER_PART_NO_DOLLAR
+    :    IDENTIFIER_START_NO_DOLLAR
+    |    DIGIT
+    ;
+
+fragment
+IDENTIFIER_NO_DOLLAR
+    :    IDENTIFIER_START_NO_DOLLAR IDENTIFIER_PART_NO_DOLLAR*
+    ;
+
+fragment
+IDENTIFIER_START
+    :    IDENTIFIER_START_NO_DOLLAR
+    |    '$'
+    ;
+
+fragment
+IDENTIFIER_PART
+    :    IDENTIFIER_START
+    |    DIGIT
+    ;
+
+SCRIPT_TAG
+    :    '#!' (~('\r' | '\n'))* NEWLINE
+    ;
+
+IDENTIFIER
+    :    IDENTIFIER_START IDENTIFIER_PART*
+    ;
+
+SINGLE_LINE_COMMENT
+    :    '//' (~('\r' | '\n'))* NEWLINE?
+         { skip(); }
+    ;
+
+MULTI_LINE_COMMENT
+    :    '/*' (options {greedy=false;} : (MULTI_LINE_COMMENT | .))* '*/'
+         { skip(); }
+    ;
+
+fragment
+NEWLINE
+    :    ('\r' | '\n' | '\r\n')
+    ;
+
+FEFF
+    :    '\uFEFF'
+    ;
+
+WS
+    :    (' ' | '\t' | '\r' | '\n')+
+         { skip(); }
+    ;
diff --git a/docs/newsletter/20170915.md b/docs/newsletter/20170915.md
index a425c60..b4baa8c 100644
--- a/docs/newsletter/20170915.md
+++ b/docs/newsletter/20170915.md
@@ -296,9 +296,9 @@
 
 In this example, some other function is testing for the value of the `isDoingRequest`. If that field is set to false, it invokes `doRequest`, which, in the first line, sets the value to `true`. However, because of the asynchronous start, the field is not set immediately, but only in the next microtask. This means that other calls to foo might still see the `isDoingRequest` as `false` and initiate more requests.
 
-This mistake can happen easily when switching from synchronous functions to `async` functions. The code is much easier to read, but the additional delay could introduce substle bugs.
+This mistake can happen easily when switching from synchronous functions to `async` functions. The code is much easier to read, but the additional delay could introduce subtle bugs.
 
-Running synchronously also brings Dart in line with other languages, like Ecmascript. `<footnote>`C# also executes the body of async functions synchronously. However, C# doesn't guarantee, that `await` always yields. If a `Task` (the equivalent class for `Future`) is already completed, C# code may immediately continue running at the `await` point.`</footnote>
+Running synchronously also brings Dart in line with other languages, like Ecmascript. `<footnote>`C# also executes the body of async functions synchronously. However, C# doesn't guarantee, that `await` always yields. If a `Task` (the equivalent class for `Future`) is already completed, C# code may immediately continue running at the `await` point.`</footnote>`
 
 ### Required Changes
 Switching to synchronous starts of `async` functions requires changes in the specification and in our tools.
diff --git a/docs/newsletter/20170922.md b/docs/newsletter/20170922.md
new file mode 100644
index 0000000..63f15298
--- /dev/null
+++ b/docs/newsletter/20170922.md
@@ -0,0 +1,293 @@
+# Dart Language and Library Newsletter
+2017-09-22
+@floitschG
+
+Welcome to the Dart Language and Library Newsletter.
+
+# Did You Know?
+## Literal Strings
+Dart has multiple ways to write literal strings. This section shows each of them and discusses when they are useful.
+
+### Quoted Strings
+For the lack of a better word I call the standard strings "quoted strings". These are normal strings delimited by single or double quotes. There is no difference between those two delimiters.
+
+``` dart
+var x = "this is a string";
+var y = "this is another string";
+```
+
+Quoted strings can contain escape sequences (see below) and string-interpolations. A dollar followed by an identifier inserts the `toString()` of the referenced value:
+
+``` dart
+var hello = "Hello";
+var readers = "readers";
+print("$hello $readers");
+```
+
+It is common to have no space between two spliced values. For this reason, the specification actually doesn't allow any identifier after the dollar, but requires the identifier to be without any dollar.
+
+``` dart
+var str1 = "without";
+var str2 = "space";
+print("$str1$str2");  // => withoutspace.
+
+var dollar$variable = "needs more work";
+print("$dollar$variable");  // Error. This won't work.
+```
+
+For identifiers that contain dollars, or for more complex expressions, one can use curly braces to delimit the expression that should be spliced in.
+
+``` dart
+var dollar$variable = "now works";
+print("${dollar$variable}");  // => now works.
+
+var x = 1;
+var y = 2;
+print("${x + y}");  // => 3.
+```
+
+Quoted strings are single line strings that may not contain a verbatim newline character.
+
+``` dart
+// ERROR: missing closing ".
+var notOk = "Not possible
+  to write strings over
+  multiple lines.";
+```
+This is a safety feature: if all strings can contain newlines, it's too easy for a missing end-quote to trip up the user and the compiler. In the worst case the program might even still be valid but just do something completely different.
+
+```
+var someString = 'some string";
+var secondString = 'another one";
+```
+
+Dart has requires developers to *opt-in* to multiline strings (see below), or to use escape sequences to insert newline characters without actually breaking the code line.
+
+#### Escapes
+Dart features the following common escape sequences:
+* `\n`: a newline. (0x0A in the ASCII table).
+* `\r`: carriage return (0x0D).
+* `\f`: form feed (0x0C).
+* `\b`: backspace (0x08).
+* `\t`: tab (0x09).
+* `\v`: vertical tab (0x0B).
+* `\x D0 D1`, where `D0` and `D1` are hex digits: the codeunit designated by the hexadecimal value.
+
+For Unicode Dart furthermore supports the following sequences:
+* `\u{hex-digits}: the unicode scalar value represented by the given hexadecimal value.
+* `\u D0 D1 D2 D3` where `D0` to `D3` are hex digits: equivalent to `\u{D0 D1 D2 D3}`.
+
+Every other `\` escape represents the escaped character. It can removed in all cases, except for `\\` and the delimiters of the string.
+
+``` dart
+var escaping = "One can escape with \"\\\".";
+print(escaping);  // => One can escape with "\".
+```
+
+### Raw Strings
+A raw string is a string that ignores escape sequences. It is written by prefixing the string literal with a `'r'`.
+
+``` dart
+var raw = r'\no\escape\';
+print(raw);  // => \no\escape\
+```
+
+Raw strings don't feature string interpolations either. In fact, a raw string is a convenient way to write the dollar string: `r"$"`.
+
+Raw strings are particularly useful for regular expressions.
+
+### Multiline Strings
+A string that is delimited by three single or double quotes is a multiline string. Unlike to the other strings, it may span multiple lines:
+
+``` dart
+var multi = """this string
+spans multiple lines""";
+```
+
+To make it easier to align the contents of multiline strings, an immediate newline after the starting delimiters is ignored:
+
+``` dart
+var multi = """
+this string
+spans multiple lines""";
+
+print(multi.startsWith("t"));  // => true.
+```
+Contrary to Ceylon (https://ceylon-lang.org/documentation/1.3/reference/literal/string/) Dart does not remove leading indentation. In fact, Dart currently has no builtin way to remove indentation of multiline strings at all. We plan to add this functionality in the future: https://github.com/dart-lang/sdk/issues/30864.
+
+Multiline strings can contain escape sequences and string interpolations. They can also be raw.
+
+``` dart
+var interpolation = "Interpolation";
+var multiEscapeInter = """
+  $interpolation works.
+  escape sequences as well: \u{1F44D}""";
+
+var raw = r"""
+  a raw string doesn't
+  use $ for interpolation.
+""";
+```
+
+Multiline strings are not just useful for strings that span multiple lines, but also when both kind of quotes happen to be in the text. This is especially the case for raw strings since they can't escape the delimiters.
+
+```
+var singleLine = '''The book's title was "in quotes"''';
+var rawSingleLine = r"""contains "everything" $and and the 'kitchen \sink'""";
+```
+
+### Concatenated Strings
+Whenever two string literals are written next to each other, they are concatenated. This is most often used when a string exceeds the recommended line length, or when different parts of a string literal are more easy to write with different literals.
+
+``` dart
+var interpolation = "interpolation";
+var combi = "a string "
+   'that goes over multiple lines '
+   "and uses $interpolation "
+   r"and \raw strings"
+```
+
+# Void as a Type
+As mentioned in earlier newsletters, we want to make `void` more useful in Dart. In Dart 1.24 we made the first small improvements, but the big one is to allow `void` as a type annotation and generic type argument (as in `Future<void>`).
+
+The following text should be considered informative and sometimes ignores minor nuances when it simplifies the discussion.
+
+## Motivation
+Dart currently allows `void` only as a return type. This covers the most common use-case, but, more and more, we find that `void` would be very useful in other places. In particular, in asynchronous programming and as the result of a type-inference, allowing `void` in more locations would make a lot of code simpler. In both cases, a return type directly feeds into a generic type.
+
+In asynchronous programming, most often with `async`/`await`, the result of a computation is wrapped in a `Future`. When the computation has a return-type `void`, then we would like to see `void` as the generic type of `Future`. Since that's not yet allowed, many developers use `Null`, which comes with other problems (already highlighted in previous newsletters).
+
+The type inference already uses the return types of methods to infer generic arguments to functions. The `void` type, as a generic argument, thus already exists in strong mode. Users just don't have a way to write it.
+
+``` dart
+void bar() {}
+
+main() {
+  var f = new Future.value(bar());
+  print(f.runtimeType);  // => _Future<void>.
+```
+
+## History
+Historically, `void` was (and still is) very restricted in Dart. The Dart 1.x specification makes `void` a reserved word that can only appear as a return type for functions. This means that implementations don't ever need to reify the `void` type itself, and, indeed, the dart2js implementation simply implemented `void` as a boolean bit on function types.
+
+Conceptually, `void` serves as a way to distinguish procedures (no return value) and functions (return value). The `void` type is not part of the type hierarchy as can best be seen when looking at Dart's function-type rules. Dart 1.x has *very* relaxed function-subtyping rules, that is (roughly speaking) bivariant on the return type and the parameter types. For example, `Object Function(int)` is a subtype of `int Function(Object)`. Despite these liberties, a `void Function()` is not an `int Function()`.
+
+Example:
+``` dart
+// In Dart 1.x
+Object foo(int x) => x;
+void bar() {}
+
+main() {
+  print(foo is int Function(Object)); // true
+  print(bar is Object Function()); // false
+}
+```
+
+At the same time, `void` functions are not really procedures, either. Like every function, `void` functions do return a value (usually `null`), and void methods can be overridden with non-`void` methods.
+
+``` dart
+class A {
+  void foo() {};
+  void bar() => foo();
+}
+
+class B extends A {
+  int foo() => 499;
+}
+```
+
+Given these properties, a better interpretation of `void` is to think of them as values that simply shouldn't be used. Having the return type `void` is another way of saying: "I return something of type `Object`, but the value is useless and should not be relied upon". It doesn't say anything about subclasses which might have a more interesting value and are free to change `void` to something else.
+
+With this interpretation, making `void` a full-fledged type becomes straight-forward: treat `void` similarly to `Object` (subtype-wise), but disallow using values of *static* type `void`.
+
+## The `void` Type
+Now that the meaning of `void` is clear, it's just a matter of adding it to the language.
+
+Over long discussions we came up with a plan to land this feature in two steps:
+
+1. generalize the `void` type and disallow obvious misuses,
+2. add more checks to disallow less obvious accesses to `void`.
+
+### Step 1
+We start by syntactically allowing `void` everywhere that other types are allowed. Until now, Dart prohibited uses of `void` except as return types of functions.
+
+When `void` is used as a type, the subtyping rules treat it similar to `Object`. This means that `Future<void>` can be used everywhere, where `Future<Object>` is allowed. The only exception is function types, where the current restrictions are kept: a `void Function()` is still not an `Object Function()`.
+
+A simple restriction disallows obvious misuses of `void`: expressions of static type `void` are only allowed in specific productions. Among many other locations, they are *not* allowed as right-hand sides of assignments or as arguments to function calls:
+
+``` dart
+int foo(void x) {  // `foo` receives a `void`-typed argument.
+  var y = x;  // Disallowed.
+  bar(x);  // Disallowed.
+}
+
+Future<void> f = new Future(() { /* do something. */ });
+f.then((x) {  // Type inference infers `x` of type `void`.
+  print(x);  // Disallowed.
+});
+
+var list = Future.await([f]);  // `f` from above. `list` is of type `List<void>`.
+print(list[0]);  // Disallowed.
+```
+
+Together with a type-inference that recognizes (and infers) `void`, these changes make `void` a full type in Dart. As discussed in the next section there are static checks that we want to add, but even in this form, `void` brings lots of benefits.
+
+A common pattern is to use `Null` for generic types that would have been `void` if it was allowed. This might seem intuitive, since `void` functions effectively return `null` when there is no `return` statement, but it also prevents us from providing users with some useful warnings. `Future<Null>` is a subtype of *every* other `Future`. There is no static or dynamic error when a `Future<Null>` is assigned to `Future<int>`. With `Future<void>` there would be a dynamic error when it is assigned to `Future<int>`.
+
+Furthermore, using a `void` value (more concretely an expression of static type `void`) would be forbidden in most syntactic locations. Examples:
+``` dart
+voidFuture.then((x) { ... use(x) ... });  // x is inferred as `void`, and the use is an error.
+var x = await voidFuture;  // Error.
+
+var y = print("foo");  // Error. void expression in RHS of an assignment.
+
+foo(void x) {}
+// Note that the check is syntactic and doesn't look at the target type:
+foo(print("bar"));  // Error. void expression in argument position.
+```
+These errors are only checked statically (since, at runtime, no value can be of type `void`).
+
+### Step 2
+In step 1 we are restricting obvious uses of `void`. There remain many holes how a `void` value can leak. The easiest is to use the `void`-`Object` equivalence when `void` is used as a generic type:
+
+``` dart
+Future<void> f1 = new Future(() { /* do something */ });
+Future<Object> f2 = f1;  // Legal, since Object is treated like void.
+f2.then(print);  // Uses the value.
+```
+
+In step 2 these non-obvious `void` uses are clamped down. It's important to note that none of our proposals makes it impossible to leak `void`. _Voidness preservation_ is intended to provide reasonable warnings and errors while not getting too much in the way.
+
+Take, for example, the following class that uses generic types:
+``` dart
+class A<T> {
+  final T x;
+  A(T Function() f) : this.x = f();
+  toString() => "A($x)";
+}
+```
+
+Since it uses `x.toString()` in the `toString` method, it uses `x` as an `Object`. That means that `new A(voidFun).toString()` ends up using `x` which was marked as `void`.
+
+In the remainder of this document we use the term "`void` value" to refer to variables like `A.x`. That is, values that users should not access, because they are or were typed as `void` (directly or indirectly).
+
+One could easily argue that this is a limitation of the type system. Either `A` should opt into supporting `T` being equal to `void`, or, inversely, it should require `T` to extend `Object`.
+
+``` dart
+class A<T extends void> { ... }
+// or
+class A<T extends Object> { ... }
+```
+
+In practice, this would be too painful. A surprising number of classes actually need to support `void` values. For example `List<void>` is very useful for `Future.wait` which may take a `List<Future<void>>` and returns the result of the futures.
+
+At the same time, `List` also demonstrates that restricting access to its generic values gets in the way. `List` has a `join` method that combines the strings of all entries, by invoking `toString()` on all of its entries. This means, that the generic type of `List` must both support `void` and yet be usable as `Object`.
+
+For all these reasons, Dart doesn't guarantee that `void` values can never be accessed. In step 2, Dart just gets *static* rules that disallow assignments that obviously leak `void` values and that could be avoided. The easiest example is `List<Object> x = List<void>`. A rule will forbid such assignments. This fits the developers intentions: "a list of values that shouldn't be used, can't be assigned to a list that wants to use the values".
+
+The exact rules for voidness preservations are complicated and haven't been finalized yet. They are surprisingly difficult to specify, especially because we want to match them with user's intuitions. We will add them at a later point. Initially, they will be warnings, and eventually, we will make them part of the language and make them errors.
+
+It makes sense to have step 1 separately, even though it is only checking direct usage of void values: The execution of a Dart program will proceed just fine even in the case where a "void value" is passed on and used. It is going to be a regular Dart object, no fundamental invariants of the runtime are violated, and it is purely an expression of programmer _intent_ that this particular value should be ignored. This makes it possible to get started using `void` to indicate that certain values should be ignored when used in simple and direct ways. Later, with step 2 checks in place, some indirect usages can be flagged as well.
+
+Note that we do not intend to ever add runtime checking of voidness preservation, `void` will always work like `Object` at runtime; at least, once `void` function return types aren't treated specially anymore. As mentioned earlier, Dart treats `void` functions as separate from non-`void` functions (the "procedure" / "function" distinction). Once voidness preservation rules are in place, we intent to remove that special treatment. Static checks will prevent the use of a `void` function in a context where a non-`void` function is expected. This means that the static checks will catch almost all misuses of `void` functions. The special handling of functions in the dynamic typing system would then become unnecessary.
diff --git a/pkg/analysis_server/lib/src/server/http_server.dart b/pkg/analysis_server/lib/src/server/http_server.dart
index 6541df5..131d00a 100644
--- a/pkg/analysis_server/lib/src/server/http_server.dart
+++ b/pkg/analysis_server/lib/src/server/http_server.dart
@@ -81,7 +81,7 @@
   Future<int> get boundPort async => (await _serverFuture)?.port;
 
   void close() {
-    _serverFuture.then((HttpServer server) {
+    _serverFuture?.then((HttpServer server) {
       server.close();
     });
   }
diff --git a/pkg/analyzer/lib/error/error.dart b/pkg/analyzer/lib/error/error.dart
index 0787c5d..74fcded 100644
--- a/pkg/analyzer/lib/error/error.dart
+++ b/pkg/analyzer/lib/error/error.dart
@@ -334,6 +334,7 @@
   ParserErrorCode.DIRECTIVE_AFTER_DECLARATION,
   ParserErrorCode.DUPLICATED_MODIFIER,
   ParserErrorCode.DUPLICATE_LABEL_IN_SWITCH_STATEMENT,
+  ParserErrorCode.DUPLICATE_PREFIX,
   ParserErrorCode.EMPTY_ENUM_BODY,
   ParserErrorCode.ENUM_IN_CLASS,
   ParserErrorCode.EQUALITY_CANNOT_BE_EQUALITY_OPERAND,
@@ -444,6 +445,7 @@
   ParserErrorCode.NULLABLE_TYPE_PARAMETER,
   ParserErrorCode.POSITIONAL_AFTER_NAMED_ARGUMENT,
   ParserErrorCode.POSITIONAL_PARAMETER_OUTSIDE_GROUP,
+  ParserErrorCode.PREFIX_AFTER_COMBINATOR,
   ParserErrorCode.REDIRECTING_CONSTRUCTOR_WITH_BODY,
   ParserErrorCode.REDIRECTION_IN_NON_FACTORY_CONSTRUCTOR,
   ParserErrorCode.SETTER_IN_FUNCTION,
diff --git a/pkg/analyzer/lib/file_system/physical_file_system.dart b/pkg/analyzer/lib/file_system/physical_file_system.dart
index 42e85b7..1812123 100644
--- a/pkg/analyzer/lib/file_system/physical_file_system.dart
+++ b/pkg/analyzer/lib/file_system/physical_file_system.dart
@@ -72,8 +72,7 @@
    */
   final String _stateLocation;
 
-  static _SingleIsolateRunnerProvider pathsToTimesIsolateProvider =
-      new _SingleIsolateRunnerProvider();
+  static Future<IsolateRunner> pathsToTimesIsolate = IsolateRunner.spawn();
 
   @override
   final AbsolutePathContext absolutePathContext =
@@ -104,7 +103,7 @@
   @override
   Future<List<int>> getModificationTimes(List<Source> sources) async {
     List<String> paths = sources.map((source) => source.fullName).toList();
-    IsolateRunner runner = await pathsToTimesIsolateProvider.get();
+    IsolateRunner runner = await pathsToTimesIsolate;
     return runner.run(_pathsToTimes, paths);
   }
 
@@ -426,33 +425,3 @@
     }
   }
 }
-
-/**
- * This class encapsulates logic for creating a single [IsolateRunner].
- */
-class _SingleIsolateRunnerProvider {
-  bool _isSpawning = false;
-  IsolateRunner _runner;
-
-  /**
-   * Complete with the only [IsolateRunner] instance.
-   */
-  Future<IsolateRunner> get() async {
-    if (_runner != null) {
-      return _runner;
-    }
-    if (_isSpawning) {
-      Completer<IsolateRunner> completer = new Completer<IsolateRunner>();
-      new Timer.periodic(new Duration(milliseconds: 10), (Timer timer) {
-        if (_runner != null) {
-          completer.complete(_runner);
-          timer.cancel();
-        }
-      });
-      return completer.future;
-    }
-    _isSpawning = true;
-    _runner = await IsolateRunner.spawn();
-    return _runner;
-  }
-}
diff --git a/pkg/analyzer/lib/src/dart/analysis/driver.dart b/pkg/analyzer/lib/src/dart/analysis/driver.dart
index 3a7baaf..d9e8e6e 100644
--- a/pkg/analyzer/lib/src/dart/analysis/driver.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/driver.dart
@@ -93,7 +93,7 @@
   /**
    * The version of data format, should be incremented on every format change.
    */
-  static const int DATA_VERSION = 43;
+  static const int DATA_VERSION = 44;
 
   /**
    * The number of exception contexts allowed to write. Once this field is
@@ -489,6 +489,7 @@
 
   @override
   void addFile(String path) {
+    _throwIfNotAbsolutePath(path);
     if (!_fsState.hasUri(path)) {
       return;
     }
@@ -523,6 +524,7 @@
    * [changeFile] invocation.
    */
   void changeFile(String path) {
+    _throwIfNotAbsolutePath(path);
     _throwIfChangesAreNotAllowed();
     _changeFile(path);
   }
@@ -562,6 +564,7 @@
    * The [path] can be any file - explicitly or implicitly analyzed, or neither.
    */
   AnalysisResult getCachedResult(String path) {
+    _throwIfNotAbsolutePath(path);
     AnalysisResult result = _priorityResults[path];
     if (disableChangesAndCacheAllResults) {
       result ??= _allCachedResults[path];
@@ -580,6 +583,8 @@
    * interactive analysis, such as Analysis Server or its plugins.
    */
   Future<ErrorsResult> getErrors(String path) async {
+    _throwIfNotAbsolutePath(path);
+
     // Ask the analysis result without unit, so return cached errors.
     // If no cached analysis result, it will be computed.
     AnalysisResult analysisResult = await _computeAnalysisResult(path);
@@ -629,6 +634,7 @@
    * analyzed.
    */
   Future<AnalysisDriverUnitIndex> getIndex(String path) {
+    _throwIfNotAbsolutePath(path);
     if (!_fsState.hasUri(path)) {
       return new Future.value();
     }
@@ -656,6 +662,7 @@
   }
 
   ApiSignature getResolvedUnitKeyByPath(String path) {
+    _throwIfNotAbsolutePath(path);
     ApiSignature signature = getUnitKeyByPath(path);
     var file = fsState.getFileForPath(path);
     signature.addString(file.contentHash);
@@ -700,6 +707,7 @@
    */
   Future<AnalysisResult> getResult(String path,
       {bool sendCachedToStream: false}) {
+    _throwIfNotAbsolutePath(path);
     if (!_fsState.hasUri(path)) {
       return new Future.value();
     }
@@ -732,6 +740,7 @@
    * The [path] must be absolute and normalized.
    */
   Future<SourceKind> getSourceKind(String path) async {
+    _throwIfNotAbsolutePath(path);
     if (AnalysisEngine.isDartFileName(path)) {
       FileState file = _fsState.getFileForPath(path);
       return file.isPart ? SourceKind.PART : SourceKind.LIBRARY;
@@ -756,6 +765,7 @@
    * file with the given [path], or with `null` if the file cannot be analyzed.
    */
   Future<UnitElementResult> getUnitElement(String path) {
+    _throwIfNotAbsolutePath(path);
     if (!_fsState.hasUri(path)) {
       return new Future.value();
     }
@@ -777,6 +787,7 @@
    * imported and exported by the library.
    */
   Future<String> getUnitElementSignature(String path) {
+    _throwIfNotAbsolutePath(path);
     if (!_fsState.hasUri(path)) {
       return new Future.value();
     }
@@ -789,6 +800,7 @@
   }
 
   ApiSignature getUnitKeyByPath(String path) {
+    _throwIfNotAbsolutePath(path);
     var file = fsState.getFileForPath(path);
     ApiSignature signature = new ApiSignature();
     signature.addUint32List(_salt);
@@ -809,6 +821,7 @@
    * resolved unit).
    */
   Future<ParseResult> parseFile(String path) async {
+    _throwIfNotAbsolutePath(path);
     FileState file = _fileTracker.verifyApiSignature(path);
     RecordingErrorListener listener = new RecordingErrorListener();
     CompilationUnit unit = file.parse(listener);
@@ -1016,6 +1029,7 @@
    * but does not guarantee this.
    */
   void removeFile(String path) {
+    _throwIfNotAbsolutePath(path);
     _throwIfChangesAreNotAllowed();
     _fileTracker.removeFile(path);
     _priorityResults.clear();
@@ -1447,6 +1461,16 @@
   }
 
   /**
+   * The driver supports only absolute paths, this method is used to validate
+   * any input paths to prevent errors later.
+   */
+  void _throwIfNotAbsolutePath(String path) {
+    if (!_resourceProvider.pathContext.isAbsolute(path)) {
+      throw new ArgumentError('Only absolute paths are supported: $path');
+    }
+  }
+
+  /**
    * Given the list of [errors] for the [file], update the [file]'s
    * [FileState.hasErrorOrWarning] flag.
    */
diff --git a/pkg/analyzer/lib/src/dart/analysis/kernel_context.dart b/pkg/analyzer/lib/src/dart/analysis/kernel_context.dart
index 3c2ff5c..a79175e 100644
--- a/pkg/analyzer/lib/src/dart/analysis/kernel_context.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/kernel_context.dart
@@ -17,7 +17,6 @@
 import 'package:analyzer/src/generated/sdk.dart';
 import 'package:analyzer/src/generated/source.dart';
 import 'package:analyzer/src/kernel/resynthesize.dart';
-import 'package:analyzer/src/summary/summary_sdk.dart';
 import 'package:front_end/byte_store.dart';
 import 'package:front_end/compiler_options.dart';
 import 'package:front_end/file_system.dart';
@@ -27,10 +26,10 @@
 import 'package:front_end/src/fasta/uri_translator_impl.dart';
 import 'package:front_end/src/incremental/kernel_driver.dart';
 import 'package:kernel/ast.dart' as kernel;
-import 'package:path/path.dart' as pathos;
 import 'package:kernel/target/targets.dart';
 import 'package:package_config/packages.dart';
 import 'package:package_config/src/packages_impl.dart';
+import 'package:path/path.dart' as pathos;
 
 /**
  * Support for resynthesizing element model from Kernel.
@@ -120,11 +119,11 @@
       var uriTranslator = new UriTranslatorImpl(
           new TargetLibrariesSpecification('none', dartLibraries), packages);
       var options = new ProcessedOptions(new CompilerOptions()
-        ..target = new NoneTarget(
+        ..target = new _AnalysisTarget(
             new TargetFlags(strongMode: analysisOptions.strongMode))
         ..reportMessages = false
         ..logger = logger
-        ..fileSystem = new _FileSystemAdaptor(fsState)
+        ..fileSystem = new _FileSystemAdaptor(fsState, pathContext)
         ..byteStore = byteStore);
       var driver = new KernelDriver(options, uriTranslator);
 
@@ -152,31 +151,35 @@
       var resynthesizer = new KernelResynthesizer(
           analysisContext, kernelResult.types, libraryMap);
 
-      analysisContext.typeProvider = _buildTypeProvider(resynthesizer);
       return new KernelContext._(analysisContext, resynthesizer);
     });
   }
+}
 
-  static SummaryTypeProvider _buildTypeProvider(
-      KernelResynthesizer resynthesizer) {
-    var coreLibrary = resynthesizer.getLibrary('dart:core');
-    var asyncLibrary = resynthesizer.getLibrary('dart:async');
-    SummaryTypeProvider summaryTypeProvider = new SummaryTypeProvider();
-    summaryTypeProvider.initializeCore(coreLibrary);
-    summaryTypeProvider.initializeAsync(asyncLibrary);
-    return summaryTypeProvider;
-  }
+/**
+ * [Target] for static analysis, with all features enabled.
+ */
+class _AnalysisTarget extends NoneTarget {
+  _AnalysisTarget(TargetFlags flags) : super(flags);
+
+  @override
+  List<String> get extraRequiredLibraries => const <String>['dart:_internal'];
+
+  @override
+  bool enableNative(Uri uri) => true;
 }
 
 class _FileSystemAdaptor implements FileSystem {
   final FileSystemState fsState;
+  final pathos.Context pathContext;
 
-  _FileSystemAdaptor(this.fsState);
+  _FileSystemAdaptor(this.fsState, this.pathContext);
 
   @override
   FileSystemEntity entityForUri(Uri uri) {
     if (uri.isScheme('file')) {
-      var file = fsState.getFileForPath(uri.path);
+      var path = pathContext.fromUri(uri);
+      var file = fsState.getFileForPath(path);
       return new _FileSystemEntityAdaptor(uri, file);
     } else {
       throw new ArgumentError(
diff --git a/pkg/analyzer/lib/src/dart/element/element.dart b/pkg/analyzer/lib/src/dart/element/element.dart
index 1ad5e15..ae539e8 100644
--- a/pkg/analyzer/lib/src/dart/element/element.dart
+++ b/pkg/analyzer/lib/src/dart/element/element.dart
@@ -574,24 +574,15 @@
       return _computeMixinAppConstructors();
     }
     if (_kernel != null && _constructors == null) {
-      var constructorsAndProcedures = <kernel.Member>[];
-      constructorsAndProcedures.addAll(_kernel.constructors);
-      for (var procedure in _kernel.procedures) {
-        if (procedure.isFactory) {
-          constructorsAndProcedures.add(procedure);
-        }
-      }
-      constructorsAndProcedures.sort((a, b) => a.fileOffset - b.fileOffset);
-      _constructors = <ConstructorElement>[];
-      for (var constructorKernel in constructorsAndProcedures) {
-        if (constructorKernel is kernel.Constructor) {
-          _constructors.add(new ConstructorElementImpl.forKernel(
-              this, constructorKernel, null));
-        } else if (constructorKernel is kernel.Procedure) {
-          _constructors.add(new ConstructorElementImpl.forKernel(
-              this, null, constructorKernel));
-        }
-      }
+      var constructors = _kernel.constructors
+          .map((k) => new ConstructorElementImpl.forKernel(this, k, null));
+      var factories = _kernel.procedures
+          .where((k) => k.isFactory)
+          .map((k) => new ConstructorElementImpl.forKernel(this, null, k));
+      _constructors = <ConstructorElement>[]
+        ..addAll(constructors)
+        ..addAll(factories);
+      _constructors.sort((a, b) => a.nameOffset - b.nameOffset);
     }
     if (_unlinkedClass != null && _constructors == null) {
       _constructors = _unlinkedClass.executables
@@ -2405,17 +2396,6 @@
   }
 
   @override
-  int get nameOffset {
-    if (_kernelConstructor != null) {
-      return _kernelConstructor.nameOffset;
-    }
-    if (_kernelFactory != null) {
-      return _kernelFactory.nameOffset;
-    }
-    return super.nameOffset;
-  }
-
-  @override
   int get periodOffset {
     if (serializedExecutable != null) {
       if (serializedExecutable.name.isNotEmpty) {
@@ -4223,6 +4203,9 @@
   @override
   int get nameOffset {
     int offset = super.nameOffset;
+    if (_kernel != null) {
+      return _kernel.fileOffset;
+    }
     if (offset == 0 && serializedExecutable != null) {
       return serializedExecutable.nameOffset;
     }
@@ -6206,11 +6189,27 @@
   kernel.Library get coreLibrary;
 
   /**
+   * Return `true` if the library has an import directive whose URI uses the
+   * "dart-ext" scheme.
+   */
+  bool get hasExtUri;
+
+  /**
    * The Kernel library being resynthesized.
    */
   kernel.Library get library;
 
   /**
+   * Return the export namespace of the library.
+   */
+  Namespace buildExportNamespace();
+
+  /**
+   * Return the public namespace of the library.
+   */
+  Namespace buildPublicNamespace();
+
+  /**
    * Return the [LibraryElement] for the given absolute [uriStr].
    */
   LibraryElement getLibrary(String uriStr);
@@ -6571,6 +6570,9 @@
 
   @override
   Namespace get exportNamespace {
+    if (_kernelContext != null) {
+      _exportNamespace ??= _kernelContext.buildExportNamespace();
+    }
     if (resynthesizerContext != null) {
       _exportNamespace ??= resynthesizerContext.buildExportNamespace();
     }
@@ -6633,6 +6635,9 @@
 
   @override
   bool get hasExtUri {
+    if (_kernelContext != null) {
+      return _kernelContext.hasExtUri;
+    }
     if (_unlinkedDefiningUnit != null) {
       List<UnlinkedImport> unlinkedImports = _unlinkedDefiningUnit.imports;
       for (UnlinkedImport import in unlinkedImports) {
@@ -6937,6 +6942,9 @@
 
   @override
   Namespace get publicNamespace {
+    if (_kernelContext != null) {
+      _publicNamespace ??= _kernelContext.buildPublicNamespace();
+    }
     if (resynthesizerContext != null) {
       _publicNamespace ??= resynthesizerContext.buildPublicNamespace();
     }
diff --git a/pkg/analyzer/lib/src/dart/error/syntactic_errors.dart b/pkg/analyzer/lib/src/dart/error/syntactic_errors.dart
index 2c1c729..dc175d8 100644
--- a/pkg/analyzer/lib/src/dart/error/syntactic_errors.dart
+++ b/pkg/analyzer/lib/src/dart/error/syntactic_errors.dart
@@ -630,7 +630,7 @@
   static const ParserErrorCode MISSING_PREFIX_IN_DEFERRED_IMPORT =
       const ParserErrorCode(
           'MISSING_PREFIX_IN_DEFERRED_IMPORT',
-          "Deferred imports must have a prefix.",
+          "Deferred imports should have a prefix.",
           "Try adding a prefix to the import.");
 
   static const ParserErrorCode MISSING_STAR_AFTER_SYNC = const ParserErrorCode(
@@ -827,6 +827,16 @@
           "Positional parameters must be enclosed in square brackets ('[' and ']').",
           "Try surrounding the positional parameters in square brackets.");
 
+  static const PREFIX_AFTER_COMBINATOR = const ParserErrorCode(
+      'PREFIX_AFTER_COMBINATOR',
+      "The 'as prefix' should come before any show/hide combinators.",
+      "Try moving the prefix before the combinators.");
+
+  static const DUPLICATE_PREFIX = const ParserErrorCode(
+      'DUPLICATE_PREFIX',
+      "An import directive can only have one prefix ('as' clause).",
+      "Try removing all but one prefix.");
+
   static const ParserErrorCode REDIRECTING_CONSTRUCTOR_WITH_BODY =
       const ParserErrorCode(
           'REDIRECTING_CONSTRUCTOR_WITH_BODY',
diff --git a/pkg/analyzer/lib/src/fasta/ast_builder.dart b/pkg/analyzer/lib/src/fasta/ast_builder.dart
index 12a4563..83a1444 100644
--- a/pkg/analyzer/lib/src/fasta/ast_builder.dart
+++ b/pkg/analyzer/lib/src/fasta/ast_builder.dart
@@ -9,7 +9,13 @@
 import 'package:analyzer/dart/ast/standard_ast_factory.dart' as standard;
 import 'package:analyzer/dart/ast/token.dart' show Token, TokenType;
 import 'package:front_end/src/fasta/parser.dart'
-    show Assert, FormalParameterKind, IdentifierContext, MemberKind, Parser;
+    show
+        Assert,
+        FormalParameterKind,
+        IdentifierContext,
+        MemberKind,
+        optional,
+        Parser;
 import 'package:front_end/src/fasta/scanner/string_scanner.dart';
 import 'package:front_end/src/fasta/scanner/token.dart' show CommentToken;
 
@@ -689,7 +695,7 @@
 
   @override
   void endAssert(Token assertKeyword, Assert kind, Token leftParenthesis,
-      Token comma, Token rightParenthesis, Token semicolon) {
+      Token comma, Token semicolon) {
     debugEvent("Assert");
     Expression message = popIfNotNull(comma);
     Expression condition = pop();
@@ -700,11 +706,11 @@
         break;
       case Assert.Initializer:
         push(ast.assertInitializer(assertKeyword, leftParenthesis, condition,
-            comma, message, rightParenthesis));
+            comma, message, leftParenthesis?.endGroup));
         break;
       case Assert.Statement:
         push(ast.assertStatement(assertKeyword, leftParenthesis, condition,
-            comma, message, rightParenthesis, semicolon));
+            comma, message, leftParenthesis?.endGroup, semicolon));
         break;
     }
   }
@@ -806,7 +812,7 @@
 
   @override
   void endForIn(Token awaitToken, Token forToken, Token leftParenthesis,
-      Token inKeyword, Token rightParenthesis, Token endToken) {
+      Token inKeyword, Token endToken) {
     debugEvent("ForInExpression");
     Statement body = pop();
     Expression iterator = pop();
@@ -822,7 +828,7 @@
           variableOrDeclaration,
           inKeyword,
           iterator,
-          rightParenthesis,
+          leftParenthesis?.endGroup,
           body));
     } else {
       var statement = variableOrDeclaration as VariableDeclarationStatement;
@@ -839,7 +845,7 @@
               variableList.variables.single.name),
           inKeyword,
           iterator,
-          rightParenthesis,
+          leftParenthesis?.endGroup,
           body));
     }
   }
@@ -1152,18 +1158,20 @@
     FormalParameterList parameters = pop();
     TypeParameterList typeParameters = pop();
     SimpleIdentifier name = pop();
-    Token propertyKeyword = getOrSet;
     TypeAnnotation returnType = pop();
     _Modifiers modifiers = pop();
     Token externalKeyword = modifiers?.externalKeyword;
     List<Annotation> metadata = pop();
     Comment comment = pop();
+    if (getOrSet != null && optional('get', getOrSet)) {
+      parameters = null;
+    }
     declarations.add(ast.functionDeclaration(
         comment,
         metadata,
         externalKeyword,
         returnType,
-        propertyKeyword,
+        getOrSet,
         name,
         ast.functionExpression(typeParameters, parameters, body)));
   }
@@ -1177,6 +1185,7 @@
   void handleInvalidTopLevelDeclaration(Token endToken) {
     debugEvent("InvalidTopLevelDeclaration");
     pop(); // metadata star
+    pop(); // comments
     // TODO(danrubel): consider creating a AST node
     // representing the invalid declaration to better support code completion,
     // quick fixes, etc, rather than discarding the metadata and token
@@ -1197,6 +1206,7 @@
         beginToken, scriptTag, directives, declarations, endToken));
   }
 
+  @override
   void endImport(Token importKeyword, Token deferredKeyword, Token asKeyword,
       Token semicolon) {
     debugEvent("Import");
@@ -1207,6 +1217,7 @@
     List<Annotation> metadata = pop();
     assert(metadata == null); // TODO(paulberry): fix.
     Comment comment = pop();
+
     directives.add(ast.importDirective(
         comment,
         metadata,
@@ -1220,6 +1231,29 @@
         semicolon));
   }
 
+  @override
+  void handleRecoverImport(
+      Token deferredKeyword, Token asKeyword, Token semicolon) {
+    debugEvent("RecoverImport");
+    List<Combinator> combinators = pop();
+    SimpleIdentifier prefix = popIfNotNull(asKeyword);
+    List<Configuration> configurations = pop();
+
+    ImportDirective directive = directives.last;
+    if (combinators != null) {
+      directive.combinators.addAll(combinators);
+    }
+    directive.deferredKeyword ??= deferredKeyword;
+    if (directive.asKeyword == null && asKeyword != null) {
+      directive.asKeyword = asKeyword;
+      directive.prefix = prefix;
+    }
+    if (configurations != null) {
+      directive.configurations.addAll(configurations);
+    }
+    directive.semicolon = semicolon;
+  }
+
   void endExport(Token exportKeyword, Token semicolon) {
     debugEvent("Export");
     List<Combinator> combinators = pop();
@@ -1257,14 +1291,13 @@
         semicolon));
   }
 
-  void endConditionalUri(
-      Token ifKeyword, Token leftParen, Token equalSign, Token rightParen) {
+  void endConditionalUri(Token ifKeyword, Token leftParen, Token equalSign) {
     debugEvent("ConditionalUri");
     StringLiteral libraryUri = pop();
     StringLiteral value = popIfNotNull(equalSign);
     DottedName name = pop();
-    push(ast.configuration(
-        ifKeyword, leftParen, name, equalSign, value, rightParen, libraryUri));
+    push(ast.configuration(ifKeyword, leftParen, name, equalSign, value,
+        leftParen?.endGroup, libraryUri));
   }
 
   @override
@@ -1952,10 +1985,26 @@
         errorReporter?.reportErrorForOffset(
             ParserErrorCode.ABSTRACT_CLASS_MEMBER, charOffset, 1);
         return;
+      case "COLON_IN_PLACE_OF_IN":
+        errorReporter?.reportErrorForOffset(
+            ParserErrorCode.COLON_IN_PLACE_OF_IN, charOffset, 1);
+        return;
       case "CONST_CLASS":
         errorReporter?.reportErrorForOffset(
             ParserErrorCode.CONST_CLASS, charOffset, 1);
         return;
+      case "DIRECTIVE_AFTER_DECLARATION":
+        errorReporter?.reportErrorForOffset(
+            ParserErrorCode.DIRECTIVE_AFTER_DECLARATION, charOffset, 1);
+        return;
+      case "DUPLICATE_PREFIX":
+        errorReporter?.reportErrorForOffset(
+            ParserErrorCode.DUPLICATE_PREFIX, charOffset, 1);
+        return;
+      case "EXPECTED_EXECUTABLE":
+        errorReporter?.reportErrorForOffset(
+            ParserErrorCode.EXPECTED_EXECUTABLE, charOffset, 1);
+        return;
       case "EXPECTED_STRING_LITERAL":
         errorReporter?.reportErrorForOffset(
             ParserErrorCode.EXPECTED_STRING_LITERAL, charOffset, 1);
@@ -1964,19 +2013,83 @@
         errorReporter?.reportErrorForOffset(
             ParserErrorCode.EXPECTED_TYPE_NAME, charOffset, 1);
         return;
+      case "EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE":
+        errorReporter?.reportErrorForOffset(
+            ParserErrorCode.EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE,
+            charOffset,
+            1);
+        return;
+      case "EXTERNAL_CLASS":
+        errorReporter?.reportErrorForOffset(
+            ParserErrorCode.EXTERNAL_CLASS, charOffset, 1);
+        return;
+      case "EXTERNAL_ENUM":
+        errorReporter?.reportErrorForOffset(
+            ParserErrorCode.EXTERNAL_ENUM, charOffset, 1);
+        return;
       case "EXTERNAL_METHOD_WITH_BODY":
         errorReporter?.reportErrorForOffset(
             ParserErrorCode.EXTERNAL_METHOD_WITH_BODY, charOffset, 1);
         return;
+      case "EXTERNAL_TYPEDEF":
+        errorReporter?.reportErrorForOffset(
+            ParserErrorCode.EXTERNAL_TYPEDEF, charOffset, 1);
+        return;
       case "EXTRANEOUS_MODIFIER":
         String text = stringOrTokenLexeme();
         errorReporter?.reportErrorForOffset(ParserErrorCode.EXTRANEOUS_MODIFIER,
             charOffset, text.length, [text]);
         return;
+      case "GETTER_WITH_PARAMETERS":
+        // TODO(brianwilkerson) This should highlight either the parameter list
+        // or the name of the getter, but I don't know how to compute the length
+        // of the region.
+        errorReporter?.reportErrorForOffset(
+            ParserErrorCode.GETTER_WITH_PARAMETERS, charOffset, 1);
+        return;
+      case "IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE":
+        errorReporter?.reportErrorForOffset(
+            ParserErrorCode.IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE,
+            charOffset,
+            1);
+        return;
+      case "LIBRARY_DIRECTIVE_NOT_FIRST":
+        errorReporter?.reportErrorForOffset(
+            ParserErrorCode.LIBRARY_DIRECTIVE_NOT_FIRST, charOffset, 1);
+        return;
+      case "MISSING_IDENTIFIER":
+        errorReporter?.reportErrorForOffset(
+            ParserErrorCode.MISSING_IDENTIFIER, charOffset, 1);
+        return;
+      case "MISSING_PREFIX_IN_DEFERRED_IMPORT":
+        errorReporter?.reportErrorForOffset(
+            ParserErrorCode.MISSING_PREFIX_IN_DEFERRED_IMPORT, charOffset, 1);
+        return;
+      case "MULTIPLE_PART_OF_DIRECTIVES":
+        errorReporter?.reportErrorForOffset(
+            ParserErrorCode.MULTIPLE_PART_OF_DIRECTIVES, charOffset, 1);
+        return;
       case "NATIVE_CLAUSE_SHOULD_BE_ANNOTATION":
         errorReporter?.reportErrorForOffset(
             ParserErrorCode.NATIVE_CLAUSE_SHOULD_BE_ANNOTATION, charOffset, 1);
         return;
+      case "NON_PART_OF_DIRECTIVE_IN_PART":
+        if (directives.isEmpty) {
+          errorReporter?.reportErrorForOffset(
+              ParserErrorCode.DIRECTIVE_AFTER_DECLARATION, charOffset, 1);
+        } else {
+          errorReporter?.reportErrorForOffset(
+              ParserErrorCode.NON_PART_OF_DIRECTIVE_IN_PART, charOffset, 1);
+        }
+        return;
+      case "PART_OUT_OF_ORDER":
+        errorReporter?.reportErrorForOffset(
+            ParserErrorCode.DIRECTIVE_AFTER_DECLARATION, charOffset, 1);
+        return;
+      case "PREFIX_AFTER_COMBINATOR":
+        errorReporter?.reportErrorForOffset(
+            ParserErrorCode.PREFIX_AFTER_COMBINATOR, charOffset, 1);
+        return;
       case "UNEXPECTED_TOKEN":
         String text = stringOrTokenLexeme();
         if (text == ';') {
diff --git a/pkg/analyzer/lib/src/generated/source_io.dart b/pkg/analyzer/lib/src/generated/source_io.dart
index 43dfb42..ca8ec1c 100644
--- a/pkg/analyzer/lib/src/generated/source_io.dart
+++ b/pkg/analyzer/lib/src/generated/source_io.dart
@@ -15,74 +15,6 @@
 export 'package:analyzer/src/generated/source.dart';
 
 /**
- * Instances of the class [DirectoryBasedSourceContainer] represent a source container that
- * contains all sources within a given directory.
- */
-@deprecated
-class DirectoryBasedSourceContainer implements SourceContainer {
-  /**
-   * The container's path (not `null`).
-   */
-  String _path;
-
-  /**
-   * Construct a container representing the specified directory and containing any sources whose
-   * [Source.fullName] starts with the directory's path. This is a convenience method,
-   * fully equivalent to [DirectoryBasedSourceContainer.con2].
-   *
-   * @param directory the directory (not `null`)
-   */
-  DirectoryBasedSourceContainer.con1(JavaFile directory)
-      : this.con2(directory.getPath());
-
-  /**
-   * Construct a container representing the specified path and containing any sources whose
-   * [Source.fullName] starts with the specified path.
-   *
-   * @param path the path (not `null` and not empty)
-   */
-  DirectoryBasedSourceContainer.con2(String path) {
-    this._path = _appendFileSeparator(path);
-  }
-
-  @override
-  int get hashCode => _path.hashCode;
-
-  /**
-   * Answer the receiver's path, used to determine if a source is contained in the receiver.
-   *
-   * @return the path (not `null`, not empty)
-   */
-  String get path => _path;
-
-  @override
-  bool operator ==(Object obj) =>
-      (obj is DirectoryBasedSourceContainer) && obj.path == path;
-
-  @override
-  bool contains(Source source) => source.fullName.startsWith(_path);
-
-  @override
-  String toString() => "SourceContainer[$_path]";
-
-  /**
-   * Append the system file separator to the given path unless the path already ends with a
-   * separator.
-   *
-   * @param path the path to which the file separator is to be added
-   * @return a path that ends with the system file separator
-   */
-  static String _appendFileSeparator(String path) {
-    if (path == null ||
-        path.length <= 0 ||
-        path.codeUnitAt(path.length - 1) == JavaFile.separatorChar) {
-      return path;
-    }
-    return "$path${JavaFile.separator}";
-  }
-}
-
-/**
  * Instances of the class [ExplicitSourceResolver] map URIs to files on disk
  * using a fixed mapping provided at construction time.
  */
diff --git a/pkg/analyzer/lib/src/generated/type_system.dart b/pkg/analyzer/lib/src/generated/type_system.dart
index 1ed098d..1e1b95b 100644
--- a/pkg/analyzer/lib/src/generated/type_system.dart
+++ b/pkg/analyzer/lib/src/generated/type_system.dart
@@ -841,7 +841,8 @@
       return true;
     }
 
-    if (i2.isDartCoreFunction && i1.element.getMethod("call") != null) {
+    if (i2.isDartCoreFunction &&
+        i1.element.getMethod("call")?.isStatic == false) {
       return true;
     }
 
@@ -2044,7 +2045,8 @@
       }
       return;
     }
-    if (i2.isDartCoreFunction && i1.element.getMethod("call") != null) {
+    if (i2.isDartCoreFunction &&
+        i1.element.getMethod("call")?.isStatic == false) {
       return;
     }
     if (i1.isObject) {
diff --git a/pkg/analyzer/lib/src/kernel/resynthesize.dart b/pkg/analyzer/lib/src/kernel/resynthesize.dart
index 52bbf31..6509e62 100644
--- a/pkg/analyzer/lib/src/kernel/resynthesize.dart
+++ b/pkg/analyzer/lib/src/kernel/resynthesize.dart
@@ -7,12 +7,16 @@
 import 'package:analyzer/dart/ast/token.dart';
 import 'package:analyzer/dart/element/element.dart';
 import 'package:analyzer/dart/element/type.dart';
+import 'package:analyzer/src/context/context.dart' show AnalysisContextImpl;
 import 'package:analyzer/src/dart/element/element.dart';
 import 'package:analyzer/src/dart/element/handle.dart';
 import 'package:analyzer/src/dart/element/type.dart';
+import 'package:analyzer/src/dart/resolver/scope.dart';
 import 'package:analyzer/src/generated/engine.dart' show AnalysisContext;
 import 'package:analyzer/src/generated/testing/ast_test_factory.dart';
+import 'package:analyzer/src/summary/summary_sdk.dart';
 import 'package:front_end/src/base/source.dart';
+import 'package:front_end/src/fasta/kernel/kernel_shadow_ast.dart' as kernel;
 import 'package:front_end/src/fasta/kernel/redirecting_factory_body.dart';
 import 'package:kernel/kernel.dart' as kernel;
 import 'package:kernel/type_environment.dart' as kernel;
@@ -21,7 +25,7 @@
  * Object that can resynthesize analyzer [LibraryElement] from Kernel.
  */
 class KernelResynthesizer implements ElementResynthesizer {
-  final AnalysisContext _analysisContext;
+  final AnalysisContextImpl _analysisContext;
   final kernel.TypeEnvironment _types;
   final Map<String, kernel.Library> _kernelMap;
   final Map<String, LibraryElementImpl> _libraryMap = {};
@@ -31,7 +35,13 @@
    */
   final Map<String, Source> _sources = <String, Source>{};
 
-  KernelResynthesizer(this._analysisContext, this._types, this._kernelMap);
+  /// The type provider for this resynthesizer.
+  SummaryTypeProvider _typeProvider;
+
+  KernelResynthesizer(this._analysisContext, this._types, this._kernelMap) {
+    _buildTypeProvider();
+    _analysisContext.typeProvider = _typeProvider;
+  }
 
   @override
   AnalysisContext get context => _analysisContext;
@@ -66,7 +76,10 @@
 
       var libraryContext =
           new _KernelLibraryResynthesizerContextImpl(this, kernel);
+
+      // Build the library.
       LibraryElementImpl libraryElement = libraryContext._buildLibrary(uriStr);
+      if (libraryElement == null) return null;
 
       // Build the defining unit.
       var definingUnit = libraryContext._buildUnit(null).unit;
@@ -81,10 +94,26 @@
       }
       libraryElement.parts = parts;
 
+      // Create the required `loadLibrary` function.
+      if (uriStr != 'dart:core' && uriStr != 'dart:async') {
+        libraryElement.createLoadLibraryFunction(_typeProvider);
+      }
+
       return libraryElement;
     });
   }
 
+  void _buildTypeProvider() {
+    var coreLibrary = getLibrary('dart:core');
+    var asyncLibrary = getLibrary('dart:async');
+    _typeProvider = new SummaryTypeProvider();
+    _typeProvider.initializeCore(coreLibrary);
+    _typeProvider.initializeAsync(asyncLibrary);
+    // Now, when TypeProvider is ready, we can finalize core/async.
+    coreLibrary.createLoadLibraryFunction(_typeProvider);
+    asyncLibrary.createLoadLibraryFunction(_typeProvider);
+  }
+
   /**
    * Return the [ElementImpl] that corresponds to the given [name], or `null`
    * if the corresponding element cannot be found.
@@ -142,6 +171,9 @@
     }
     if (classElement == null) return null;
 
+    // If no more component, the class is the element.
+    if (componentPtr == 0) return classElement;
+
     String kind = components[--componentPtr];
     String elementName = takeElementName();
     if (kind == '@methods') {
@@ -172,6 +204,14 @@
 }
 
 /**
+ * This exception is thrown when we detect that the Kernel has a compilation
+ * error, so we cannot resynthesize the constant expression.
+ */
+class _CompilationErrorFound {
+  const _CompilationErrorFound();
+}
+
+/**
  * Builder of [Expression]s from [kernel.Expression]s.
  */
 class _ExprBuilder {
@@ -181,189 +221,16 @@
   _ExprBuilder(this._context, this._contextElement);
 
   Expression build(kernel.Expression expr) {
-    if (expr is kernel.NullLiteral) {
-      return AstTestFactory.nullLiteral();
+    try {
+      return _build(expr);
+    } on _CompilationErrorFound {
+      return AstTestFactory.identifier3('#invalidConst');
     }
-    if (expr is kernel.BoolLiteral) {
-      return AstTestFactory.booleanLiteral(expr.value);
-    }
-    if (expr is kernel.IntLiteral) {
-      return AstTestFactory.integer(expr.value);
-    }
-    if (expr is kernel.DoubleLiteral) {
-      return AstTestFactory.doubleLiteral(expr.value);
-    }
-    if (expr is kernel.StringLiteral) {
-      return AstTestFactory.string2(expr.value);
-    }
-    if (expr is kernel.StringConcatenation) {
-      List<InterpolationElement> elements = expr.expressions
-          .map(build)
-          .map(_newInterpolationElement)
-          .toList(growable: false);
-      return AstTestFactory.string(elements);
-    }
-    if (expr is kernel.SymbolLiteral) {
-      List<String> components = expr.value.split('.').toList();
-      return AstTestFactory.symbolLiteral(components);
-    }
-
-    if (expr is kernel.ListLiteral) {
-      Keyword keyword = expr.isConst ? Keyword.CONST : null;
-      var typeArguments = _buildTypeArgumentList([expr.typeArgument]);
-      var elements = expr.expressions.map(build).toList();
-      return AstTestFactory.listLiteral2(keyword, typeArguments, elements);
-    }
-
-    if (expr is kernel.MapLiteral) {
-      Keyword keyword = expr.isConst ? Keyword.CONST : null;
-      var typeArguments =
-          _buildTypeArgumentList([expr.keyType, expr.valueType]);
-
-      int numberOfEntries = expr.entries.length;
-      var entries = new List<MapLiteralEntry>(numberOfEntries);
-      for (int i = 0; i < numberOfEntries; i++) {
-        var entry = expr.entries[i];
-        Expression key = build(entry.key);
-        Expression value = build(entry.value);
-        entries[i] = AstTestFactory.mapLiteralEntry2(key, value);
-      }
-
-      return AstTestFactory.mapLiteral(keyword, typeArguments, entries);
-    }
-
-    if (expr is kernel.StaticGet) {
-      return _buildIdentifier(expr.targetReference, isGet: true);
-    }
-
-    if (expr is kernel.PropertyGet) {
-      Expression target = build(expr.receiver);
-      kernel.Reference reference = expr.interfaceTargetReference;
-      SimpleIdentifier identifier = _buildSimpleIdentifier(reference);
-      return AstTestFactory.propertyAccess(target, identifier);
-    }
-
-    if (expr is kernel.VariableGet) {
-      String name = expr.variable.name;
-      Element contextConstructor = _contextElement;
-      if (contextConstructor is ConstructorElement) {
-        SimpleIdentifier identifier = AstTestFactory.identifier3(name);
-        ParameterElement parameter = contextConstructor.parameters.firstWhere(
-            (parameter) => parameter.name == name,
-            orElse: () => null);
-        identifier.staticElement = parameter;
-        return identifier;
-      }
-    }
-
-    if (expr is kernel.ConditionalExpression) {
-      var condition = build(expr.condition);
-      var then = build(expr.then);
-      var otherwise = build(expr.otherwise);
-      return AstTestFactory.conditionalExpression(condition, then, otherwise);
-    }
-
-    if (expr is kernel.Not) {
-      kernel.Expression kernelOperand = expr.operand;
-      var operand = build(kernelOperand);
-      return AstTestFactory.prefixExpression(TokenType.BANG, operand);
-    }
-
-    if (expr is kernel.LogicalExpression) {
-      var operator = _toBinaryOperatorTokenType(expr.operator);
-      var left = build(expr.left);
-      var right = build(expr.right);
-      return AstTestFactory.binaryExpression(left, operator, right);
-    }
-
-    if (expr is kernel.Let) {
-      var body = expr.body;
-      if (body is kernel.ConditionalExpression) {
-        var condition = body.condition;
-        var otherwiseExpr = body.otherwise;
-        if (condition is kernel.MethodInvocation) {
-          var equalsReceiver = condition.receiver;
-          if (equalsReceiver is kernel.VariableGet &&
-              condition.name.name == '==' &&
-              condition.arguments.positional.length == 1 &&
-              condition.arguments.positional[0] is kernel.NullLiteral &&
-              otherwiseExpr is kernel.VariableGet &&
-              otherwiseExpr.variable == equalsReceiver.variable) {
-            var left = build(expr.variable.initializer);
-            var right = build(body.then);
-            return AstTestFactory.binaryExpression(
-                left, TokenType.QUESTION_QUESTION, right);
-          }
-        }
-      }
-    }
-
-    if (expr is kernel.MethodInvocation) {
-      kernel.Member member = expr.interfaceTarget;
-      if (member is kernel.Procedure) {
-        if (member.kind == kernel.ProcedureKind.Operator) {
-          var left = build(expr.receiver);
-          String operatorName = expr.name.name;
-          List<kernel.Expression> args = expr.arguments.positional;
-          if (args.isEmpty) {
-            if (operatorName == 'unary-') {
-              return AstTestFactory.prefixExpression(TokenType.MINUS, left);
-            }
-            if (operatorName == '~') {
-              return AstTestFactory.prefixExpression(TokenType.TILDE, left);
-            }
-          } else if (args.length == 1) {
-            var operator = _toBinaryOperatorTokenType(operatorName);
-            var right = build(args.single);
-            return AstTestFactory.binaryExpression(left, operator, right);
-          }
-        }
-      }
-    }
-
-    if (expr is kernel.StaticInvocation) {
-      kernel.Procedure target = expr.target;
-      String name = target.name.name;
-      List<Expression> arguments = _toArguments(expr.arguments);
-      MethodInvocation invocation =
-          AstTestFactory.methodInvocation3(null, name, null, arguments);
-      invocation.methodName.staticElement = _getElement(target.reference);
-      return invocation;
-    }
-
-    if (expr is kernel.ConstructorInvocation) {
-      var element = _getElement(expr.targetReference);
-
-      var kernelType =
-          expr.getStaticType(_context.libraryContext.resynthesizer._types);
-      var type = _context.getType(_contextElement, kernelType);
-      TypeName typeName = _buildType(type);
-
-      var constructorName = AstTestFactory.constructorName(
-          typeName, element.name.isNotEmpty ? element.name : null);
-      constructorName?.name?.staticElement = element;
-
-      var keyword = expr.isConst ? Keyword.CONST : Keyword.NEW;
-      var arguments = _toArguments(expr.arguments);
-      return AstTestFactory.instanceCreationExpression(
-          keyword, constructorName, arguments);
-    }
-
-    if (expr is kernel.TypeLiteral) {
-      var type = _context.getType(_contextElement, expr.type);
-      var identifier = AstTestFactory.identifier3(type.element.name);
-      identifier.staticElement = type.element;
-      identifier.staticType = _context.libraryContext.resynthesizer.typeType;
-      return identifier;
-    }
-
-    // TODO(scheglov): complete getExpression
-    throw new UnimplementedError('kernel: (${expr.runtimeType}) $expr');
   }
 
   ConstructorInitializer buildInitializer(kernel.Initializer k) {
     if (k is kernel.FieldInitializer) {
-      Expression value = build(k.value);
+      Expression value = _build(k.value);
       ConstructorFieldInitializer initializer = AstTestFactory
           .constructorFieldInitializer(false, k.field.name.name, value);
       initializer.fieldName.staticElement = _getElement(k.fieldReference);
@@ -378,8 +245,8 @@
             invocation.name.name == 'call') {
           var body = receiver.function.body;
           if (body is kernel.AssertStatement) {
-            var condition = build(body.condition);
-            var message = body.message != null ? build(body.message) : null;
+            var condition = _build(body.condition);
+            var message = body.message != null ? _build(body.message) : null;
             return AstTestFactory.assertInitializer(condition, message);
           }
         }
@@ -425,7 +292,209 @@
     throw new UnimplementedError('For ${k.runtimeType}');
   }
 
-  Expression _buildIdentifier(kernel.Reference reference, {bool isGet: false}) {
+  Expression _build(kernel.Expression expr) {
+    if (expr is kernel.NullLiteral) {
+      return AstTestFactory.nullLiteral();
+    }
+    if (expr is kernel.BoolLiteral) {
+      return AstTestFactory.booleanLiteral(expr.value);
+    }
+    if (expr is kernel.IntLiteral) {
+      return AstTestFactory.integer(expr.value);
+    }
+    if (expr is kernel.DoubleLiteral) {
+      return AstTestFactory.doubleLiteral(expr.value);
+    }
+    if (expr is kernel.StringLiteral) {
+      return AstTestFactory.string2(expr.value);
+    }
+    if (expr is kernel.StringConcatenation) {
+      List<InterpolationElement> elements = expr.expressions
+          .map(_build)
+          .map(_newInterpolationElement)
+          .toList(growable: false);
+      return AstTestFactory.string(elements);
+    }
+    if (expr is kernel.SymbolLiteral) {
+      List<String> components = expr.value.split('.').toList();
+      return AstTestFactory.symbolLiteral(components);
+    }
+
+    if (expr is kernel.ListLiteral) {
+      Keyword keyword = expr.isConst ? Keyword.CONST : null;
+      var typeArguments = _buildTypeArgumentList([expr.typeArgument]);
+      var elements = expr.expressions.map(_build).toList();
+      return AstTestFactory.listLiteral2(keyword, typeArguments, elements);
+    }
+
+    if (expr is kernel.MapLiteral) {
+      Keyword keyword = expr.isConst ? Keyword.CONST : null;
+      var typeArguments =
+          _buildTypeArgumentList([expr.keyType, expr.valueType]);
+
+      int numberOfEntries = expr.entries.length;
+      var entries = new List<MapLiteralEntry>(numberOfEntries);
+      for (int i = 0; i < numberOfEntries; i++) {
+        var entry = expr.entries[i];
+        Expression key = _build(entry.key);
+        Expression value = _build(entry.value);
+        entries[i] = AstTestFactory.mapLiteralEntry2(key, value);
+      }
+
+      return AstTestFactory.mapLiteral(keyword, typeArguments, entries);
+    }
+
+    if (expr is kernel.StaticGet) {
+      return _buildIdentifier(expr.targetReference, isGet: true);
+    }
+
+    if (expr is kernel.PropertyGet) {
+      Expression target = _build(expr.receiver);
+      kernel.Reference reference = expr.interfaceTargetReference;
+      SimpleIdentifier identifier = _buildSimpleIdentifier(reference);
+      return AstTestFactory.propertyAccess(target, identifier);
+    }
+
+    if (expr is kernel.VariableGet) {
+      String name = expr.variable.name;
+      Element contextConstructor = _contextElement;
+      if (contextConstructor is ConstructorElement) {
+        SimpleIdentifier identifier = AstTestFactory.identifier3(name);
+        ParameterElement parameter = contextConstructor.parameters.firstWhere(
+            (parameter) => parameter.name == name,
+            orElse: () => null);
+        identifier.staticElement = parameter;
+        return identifier;
+      }
+    }
+
+    if (expr is kernel.ConditionalExpression) {
+      var condition = _build(expr.condition);
+      var then = _build(expr.then);
+      var otherwise = _build(expr.otherwise);
+      return AstTestFactory.conditionalExpression(condition, then, otherwise);
+    }
+
+    if (expr is kernel.Not) {
+      kernel.Expression kernelOperand = expr.operand;
+      var operand = _build(kernelOperand);
+      return AstTestFactory.prefixExpression(TokenType.BANG, operand);
+    }
+
+    if (expr is kernel.LogicalExpression) {
+      var operator = _toBinaryOperatorTokenType(expr.operator);
+      var left = _build(expr.left);
+      var right = _build(expr.right);
+      return AstTestFactory.binaryExpression(left, operator, right);
+    }
+
+    if (expr is kernel.Let) {
+      var body = expr.body;
+      if (body is kernel.ConditionalExpression) {
+        var condition = body.condition;
+        var otherwiseExpr = body.otherwise;
+        if (condition is kernel.MethodInvocation) {
+          var equalsReceiver = condition.receiver;
+          if (equalsReceiver is kernel.VariableGet &&
+              condition.name.name == '==' &&
+              condition.arguments.positional.length == 1 &&
+              condition.arguments.positional[0] is kernel.NullLiteral &&
+              otherwiseExpr is kernel.VariableGet &&
+              otherwiseExpr.variable == equalsReceiver.variable) {
+            var left = _build(expr.variable.initializer);
+            var right = _build(body.then);
+            return AstTestFactory.binaryExpression(
+                left, TokenType.QUESTION_QUESTION, right);
+          }
+        }
+      }
+    }
+
+    if (expr is kernel.MethodInvocation) {
+      kernel.Member member = expr.interfaceTarget;
+      if (member is kernel.Procedure) {
+        if (member.kind == kernel.ProcedureKind.Operator) {
+          var left = _build(expr.receiver);
+          String operatorName = expr.name.name;
+          List<kernel.Expression> args = expr.arguments.positional;
+          if (args.isEmpty) {
+            if (operatorName == 'unary-') {
+              return AstTestFactory.prefixExpression(TokenType.MINUS, left);
+            }
+            if (operatorName == '~') {
+              return AstTestFactory.prefixExpression(TokenType.TILDE, left);
+            }
+          } else if (args.length == 1) {
+            var operator = _toBinaryOperatorTokenType(operatorName);
+            var right = _build(args.single);
+            return AstTestFactory.binaryExpression(left, operator, right);
+          }
+        }
+      }
+    }
+
+    if (expr is kernel.StaticInvocation) {
+      kernel.Procedure target = expr.target;
+      String name = target.name.name;
+      List<Expression> arguments = _toArguments(expr.arguments);
+      MethodInvocation invocation =
+          AstTestFactory.methodInvocation3(null, name, null, arguments);
+      invocation.methodName.staticElement = _getElement(target.reference);
+      return invocation;
+    }
+
+    if (expr is kernel.ConstructorInvocation) {
+      var element = _getElement(expr.targetReference);
+
+      var kernelType =
+          expr.getStaticType(_context.libraryContext.resynthesizer._types);
+      var type = _context.getType(_contextElement, kernelType);
+      TypeName typeName = _buildType(type);
+
+      var constructorName = AstTestFactory.constructorName(
+          typeName, element.name.isNotEmpty ? element.name : null);
+      constructorName?.name?.staticElement = element;
+
+      var keyword = expr.isConst ? Keyword.CONST : Keyword.NEW;
+      var arguments = _toArguments(expr.arguments);
+      return AstTestFactory.instanceCreationExpression(
+          keyword, constructorName, arguments);
+    }
+
+    if (expr is kernel.TypeLiteral) {
+      var type = _context.getType(_contextElement, expr.type);
+      var identifier = AstTestFactory.identifier3(type.element.name);
+      identifier.staticElement = type.element;
+      identifier.staticType = _context.libraryContext.resynthesizer.typeType;
+      return identifier;
+    }
+
+    // Invalid annotations are represented as Let.
+    if (expr is kernel.Let &&
+        expr.variable.initializer is kernel.ShadowSyntheticExpression) {
+      expr = (expr as kernel.Let).variable.initializer;
+    }
+
+    // Synthetic expression representing a constant error.
+    if (expr is kernel.ShadowSyntheticExpression) {
+      var desugared = expr.desugared;
+      if (desugared is kernel.MethodInvocation) {
+        if (desugared.name.name == '_throw') {
+          var receiver = desugared.receiver;
+          if (receiver is kernel.ConstructorInvocation &&
+              receiver.target.enclosingClass.name ==
+                  '_ConstantExpressionError') {
+            throw const _CompilationErrorFound();
+          }
+        }
+      }
+    }
+
+    // TODO(scheglov): complete getExpression
+    throw new UnimplementedError('kernel: (${expr.runtimeType}) $expr');
+  }
+
+  Identifier _buildIdentifier(kernel.Reference reference, {bool isGet: false}) {
     Element element = _getElement(reference);
     if (isGet && element is PropertyInducingElement) {
       element = (element as PropertyInducingElement).getter;
@@ -437,7 +506,7 @@
       SimpleIdentifier classRef = AstTestFactory
           .identifier3(enclosingElement.name)
             ..staticElement = enclosingElement;
-      return AstTestFactory.propertyAccess(classRef, property);
+      return AstTestFactory.identifier(classRef, property);
     } else {
       return property;
     }
@@ -506,11 +575,11 @@
 
     int i = 0;
     for (kernel.Expression k in kernelArguments.positional) {
-      arguments[i++] = build(k);
+      arguments[i++] = _build(k);
     }
 
     for (kernel.NamedExpression k in kernelArguments.named) {
-      var value = build(k.value);
+      var value = _build(k.value);
       arguments[i++] = AstTestFactory.namedExpression2(k.name, value);
     }
 
@@ -561,12 +630,48 @@
   kernel.Library get coreLibrary => resynthesizer._kernelMap['dart:core'];
 
   @override
+  bool get hasExtUri {
+    for (var dependency in library.dependencies) {
+      if (dependency.isImport &&
+          dependency.targetLibrary.importUri.isScheme('dart-ext')) {
+        return true;
+      }
+    }
+    return false;
+  }
+
+  @override
+  Namespace buildExportNamespace() {
+    Namespace publicNamespace = buildPublicNamespace();
+    if (library.additionalExports.isEmpty) {
+      return publicNamespace;
+    }
+
+    Map<String, Element> definedNames = publicNamespace.definedNames;
+    for (kernel.Reference additionalExport in library.additionalExports) {
+      var element = resynthesizer._getElement(additionalExport.canonicalName);
+      if (element != null) {
+        definedNames[element.name] = element;
+      }
+    }
+
+    return new Namespace(definedNames);
+  }
+
+  @override
+  Namespace buildPublicNamespace() {
+    return new NamespaceBuilder()
+        .createPublicNamespaceForLibrary(libraryElement);
+  }
+
+  @override
   LibraryElementImpl getLibrary(String uriStr) {
     return resynthesizer.getLibrary(uriStr);
   }
 
   LibraryElementImpl _buildLibrary(String uriStr) {
     librarySource = resynthesizer._getSource(uriStr);
+    if (librarySource == null) return null;
     return libraryElement =
         new LibraryElementImpl.forKernel(resynthesizer._analysisContext, this);
   }
@@ -628,6 +733,8 @@
  */
 class _KernelUnitResynthesizerContextImpl
     implements KernelUnitResynthesizerContext {
+  static final Uri dartInternalUri = Uri.parse('dart:_internal');
+
   final _KernelLibraryResynthesizerContextImpl libraryContext;
   final String fileUri;
 
@@ -643,9 +750,11 @@
       List<kernel.Expression> expressions) {
     int length = expressions.length;
     if (length != 0) {
-      var annotations = new List<ElementAnnotation>(length);
-      for (int i = 0; i < length; i++) {
-        annotations[i] = _buildAnnotation(unit, expressions[i]);
+      var annotations = <ElementAnnotation>[];
+      for (var expression in expressions) {
+        if (_isSyntheticExternalNameAnnotation(expression)) continue;
+        var annotation = _buildAnnotation(unit, expression);
+        annotations.add(annotation);
       }
       return annotations;
     } else {
@@ -808,6 +917,7 @@
   DartType getType(ElementImpl context, kernel.DartType kernelType) {
     if (kernelType is kernel.DynamicType) return DynamicTypeImpl.instance;
     if (kernelType is kernel.InvalidType) return DynamicTypeImpl.instance;
+    if (kernelType is kernel.BottomType) return BottomTypeImpl.instance;
     if (kernelType is kernel.VoidType) return VoidTypeImpl.instance;
 
     if (kernelType is kernel.InterfaceType) {
@@ -917,4 +1027,17 @@
     }
     throw new StateError('Not found $kernelTypeParameter in $context');
   }
+
+  /// Fasta converts `native 'name'` clauses to `@ExternalName('name')`
+  /// annotations. But we don't actually have these annotations in code. So,
+  /// we need to skip them to avoid mismatch with AST.
+  static bool _isSyntheticExternalNameAnnotation(kernel.Expression expr) {
+    if (expr is kernel.ConstructorInvocation) {
+      kernel.Constructor target = expr.target;
+      return target != null &&
+          target.enclosingClass.name == 'ExternalName' &&
+          target.enclosingLibrary.importUri == dartInternalUri;
+    }
+    return false;
+  }
 }
diff --git a/pkg/analyzer/lib/src/summary/resynthesize.dart b/pkg/analyzer/lib/src/summary/resynthesize.dart
index 11b74c3..ca34fdc 100644
--- a/pkg/analyzer/lib/src/summary/resynthesize.dart
+++ b/pkg/analyzer/lib/src/summary/resynthesize.dart
@@ -332,201 +332,202 @@
     if (!uc.isValidConst) {
       return null;
     }
-    for (UnlinkedExprOperation operation in uc.operations) {
-      switch (operation) {
-        case UnlinkedExprOperation.pushNull:
-          _push(AstTestFactory.nullLiteral());
-          break;
-        // bool
-        case UnlinkedExprOperation.pushFalse:
-          _push(AstTestFactory.booleanLiteral(false));
-          break;
-        case UnlinkedExprOperation.pushTrue:
-          _push(AstTestFactory.booleanLiteral(true));
-          break;
-        // literals
-        case UnlinkedExprOperation.pushInt:
-          int value = uc.ints[intPtr++];
-          _push(AstTestFactory.integer(value));
-          break;
-        case UnlinkedExprOperation.pushLongInt:
-          int value = 0;
-          int count = uc.ints[intPtr++];
-          for (int i = 0; i < count; i++) {
-            int next = uc.ints[intPtr++];
-            value = value << 32 | next;
-          }
-          _push(AstTestFactory.integer(value));
-          break;
-        case UnlinkedExprOperation.pushDouble:
-          double value = uc.doubles[doublePtr++];
-          _push(AstTestFactory.doubleLiteral(value));
-          break;
-        case UnlinkedExprOperation.makeSymbol:
-          String component = uc.strings[stringPtr++];
-          _push(AstTestFactory.symbolLiteral([component]));
-          break;
-        // String
-        case UnlinkedExprOperation.pushString:
-          String value = uc.strings[stringPtr++];
-          _push(AstTestFactory.string2(value));
-          break;
-        case UnlinkedExprOperation.concatenate:
-          int count = uc.ints[intPtr++];
-          List<InterpolationElement> elements = <InterpolationElement>[];
-          for (int i = 0; i < count; i++) {
-            Expression expr = _pop();
-            InterpolationElement element = _newInterpolationElement(expr);
-            elements.insert(0, element);
-          }
-          _push(AstTestFactory.string(elements));
-          break;
-        // binary
-        case UnlinkedExprOperation.equal:
-          _pushBinary(TokenType.EQ_EQ);
-          break;
-        case UnlinkedExprOperation.notEqual:
-          _pushBinary(TokenType.BANG_EQ);
-          break;
-        case UnlinkedExprOperation.and:
-          _pushBinary(TokenType.AMPERSAND_AMPERSAND);
-          break;
-        case UnlinkedExprOperation.or:
-          _pushBinary(TokenType.BAR_BAR);
-          break;
-        case UnlinkedExprOperation.bitXor:
-          _pushBinary(TokenType.CARET);
-          break;
-        case UnlinkedExprOperation.bitAnd:
-          _pushBinary(TokenType.AMPERSAND);
-          break;
-        case UnlinkedExprOperation.bitOr:
-          _pushBinary(TokenType.BAR);
-          break;
-        case UnlinkedExprOperation.bitShiftLeft:
-          _pushBinary(TokenType.LT_LT);
-          break;
-        case UnlinkedExprOperation.bitShiftRight:
-          _pushBinary(TokenType.GT_GT);
-          break;
-        case UnlinkedExprOperation.add:
-          _pushBinary(TokenType.PLUS);
-          break;
-        case UnlinkedExprOperation.subtract:
-          _pushBinary(TokenType.MINUS);
-          break;
-        case UnlinkedExprOperation.multiply:
-          _pushBinary(TokenType.STAR);
-          break;
-        case UnlinkedExprOperation.divide:
-          _pushBinary(TokenType.SLASH);
-          break;
-        case UnlinkedExprOperation.floorDivide:
-          _pushBinary(TokenType.TILDE_SLASH);
-          break;
-        case UnlinkedExprOperation.modulo:
-          _pushBinary(TokenType.PERCENT);
-          break;
-        case UnlinkedExprOperation.greater:
-          _pushBinary(TokenType.GT);
-          break;
-        case UnlinkedExprOperation.greaterEqual:
-          _pushBinary(TokenType.GT_EQ);
-          break;
-        case UnlinkedExprOperation.less:
-          _pushBinary(TokenType.LT);
-          break;
-        case UnlinkedExprOperation.lessEqual:
-          _pushBinary(TokenType.LT_EQ);
-          break;
-        // prefix
-        case UnlinkedExprOperation.complement:
-          _pushPrefix(TokenType.TILDE);
-          break;
-        case UnlinkedExprOperation.negate:
-          _pushPrefix(TokenType.MINUS);
-          break;
-        case UnlinkedExprOperation.not:
-          _pushPrefix(TokenType.BANG);
-          break;
-        // conditional
-        case UnlinkedExprOperation.conditional:
-          Expression elseExpr = _pop();
-          Expression thenExpr = _pop();
-          Expression condition = _pop();
-          _push(AstTestFactory.conditionalExpression(
-              condition, thenExpr, elseExpr));
-          break;
-        // invokeMethodRef
-        case UnlinkedExprOperation.invokeMethodRef:
-          _pushInvokeMethodRef();
-          break;
-        // containers
-        case UnlinkedExprOperation.makeUntypedList:
-          _pushList(null);
-          break;
-        case UnlinkedExprOperation.makeTypedList:
-          TypeAnnotation itemType = _newTypeName();
-          _pushList(
-              AstTestFactory.typeArgumentList(<TypeAnnotation>[itemType]));
-          break;
-        case UnlinkedExprOperation.makeUntypedMap:
-          _pushMap(null);
-          break;
-        case UnlinkedExprOperation.makeTypedMap:
-          TypeAnnotation keyType = _newTypeName();
-          TypeAnnotation valueType = _newTypeName();
-          _pushMap(AstTestFactory
-              .typeArgumentList(<TypeAnnotation>[keyType, valueType]));
-          break;
-        case UnlinkedExprOperation.pushReference:
-          _pushReference();
-          break;
-        case UnlinkedExprOperation.extractProperty:
-          _pushExtractProperty();
-          break;
-        case UnlinkedExprOperation.invokeConstructor:
-          _pushInstanceCreation();
-          break;
-        case UnlinkedExprOperation.pushParameter:
-          String name = uc.strings[stringPtr++];
-          SimpleIdentifier identifier = AstTestFactory.identifier3(name);
-          identifier.staticElement = _enclosingConstructor.parameters
-              .firstWhere((parameter) => parameter.name == name,
-                  orElse: () => throw new StateError(
-                      'Unable to resolve constructor parameter: $name'));
-          _push(identifier);
-          break;
-        case UnlinkedExprOperation.ifNull:
-          _pushBinary(TokenType.QUESTION_QUESTION);
-          break;
-        case UnlinkedExprOperation.await:
-          Expression expression = _pop();
-          _push(AstTestFactory.awaitExpression(expression));
-          break;
-        case UnlinkedExprOperation.pushSuper:
-          _push(AstTestFactory.superExpression());
-          break;
-        case UnlinkedExprOperation.pushThis:
-          _push(AstTestFactory.thisExpression());
-          break;
-        case UnlinkedExprOperation.assignToRef:
-        case UnlinkedExprOperation.assignToProperty:
-        case UnlinkedExprOperation.assignToIndex:
-        case UnlinkedExprOperation.extractIndex:
-        case UnlinkedExprOperation.invokeMethod:
-        case UnlinkedExprOperation.cascadeSectionBegin:
-        case UnlinkedExprOperation.cascadeSectionEnd:
-        case UnlinkedExprOperation.typeCast:
-        case UnlinkedExprOperation.typeCheck:
-        case UnlinkedExprOperation.throwException:
-        case UnlinkedExprOperation.pushLocalFunctionReference:
-        case UnlinkedExprOperation.pushError:
-        case UnlinkedExprOperation.pushTypedAbstract:
-        case UnlinkedExprOperation.pushUntypedAbstract:
-          throw new UnimplementedError(
-              'Unexpected $operation in a constant expression.');
+    try {
+      for (UnlinkedExprOperation operation in uc.operations) {
+        switch (operation) {
+          case UnlinkedExprOperation.pushNull:
+            _push(AstTestFactory.nullLiteral());
+            break;
+          // bool
+          case UnlinkedExprOperation.pushFalse:
+            _push(AstTestFactory.booleanLiteral(false));
+            break;
+          case UnlinkedExprOperation.pushTrue:
+            _push(AstTestFactory.booleanLiteral(true));
+            break;
+          // literals
+          case UnlinkedExprOperation.pushInt:
+            int value = uc.ints[intPtr++];
+            _push(AstTestFactory.integer(value));
+            break;
+          case UnlinkedExprOperation.pushLongInt:
+            int value = 0;
+            int count = uc.ints[intPtr++];
+            for (int i = 0; i < count; i++) {
+              int next = uc.ints[intPtr++];
+              value = value << 32 | next;
+            }
+            _push(AstTestFactory.integer(value));
+            break;
+          case UnlinkedExprOperation.pushDouble:
+            double value = uc.doubles[doublePtr++];
+            _push(AstTestFactory.doubleLiteral(value));
+            break;
+          case UnlinkedExprOperation.makeSymbol:
+            String component = uc.strings[stringPtr++];
+            _push(AstTestFactory.symbolLiteral([component]));
+            break;
+          // String
+          case UnlinkedExprOperation.pushString:
+            String value = uc.strings[stringPtr++];
+            _push(AstTestFactory.string2(value));
+            break;
+          case UnlinkedExprOperation.concatenate:
+            int count = uc.ints[intPtr++];
+            List<InterpolationElement> elements = <InterpolationElement>[];
+            for (int i = 0; i < count; i++) {
+              Expression expr = _pop();
+              InterpolationElement element = _newInterpolationElement(expr);
+              elements.insert(0, element);
+            }
+            _push(AstTestFactory.string(elements));
+            break;
+          // binary
+          case UnlinkedExprOperation.equal:
+            _pushBinary(TokenType.EQ_EQ);
+            break;
+          case UnlinkedExprOperation.notEqual:
+            _pushBinary(TokenType.BANG_EQ);
+            break;
+          case UnlinkedExprOperation.and:
+            _pushBinary(TokenType.AMPERSAND_AMPERSAND);
+            break;
+          case UnlinkedExprOperation.or:
+            _pushBinary(TokenType.BAR_BAR);
+            break;
+          case UnlinkedExprOperation.bitXor:
+            _pushBinary(TokenType.CARET);
+            break;
+          case UnlinkedExprOperation.bitAnd:
+            _pushBinary(TokenType.AMPERSAND);
+            break;
+          case UnlinkedExprOperation.bitOr:
+            _pushBinary(TokenType.BAR);
+            break;
+          case UnlinkedExprOperation.bitShiftLeft:
+            _pushBinary(TokenType.LT_LT);
+            break;
+          case UnlinkedExprOperation.bitShiftRight:
+            _pushBinary(TokenType.GT_GT);
+            break;
+          case UnlinkedExprOperation.add:
+            _pushBinary(TokenType.PLUS);
+            break;
+          case UnlinkedExprOperation.subtract:
+            _pushBinary(TokenType.MINUS);
+            break;
+          case UnlinkedExprOperation.multiply:
+            _pushBinary(TokenType.STAR);
+            break;
+          case UnlinkedExprOperation.divide:
+            _pushBinary(TokenType.SLASH);
+            break;
+          case UnlinkedExprOperation.floorDivide:
+            _pushBinary(TokenType.TILDE_SLASH);
+            break;
+          case UnlinkedExprOperation.modulo:
+            _pushBinary(TokenType.PERCENT);
+            break;
+          case UnlinkedExprOperation.greater:
+            _pushBinary(TokenType.GT);
+            break;
+          case UnlinkedExprOperation.greaterEqual:
+            _pushBinary(TokenType.GT_EQ);
+            break;
+          case UnlinkedExprOperation.less:
+            _pushBinary(TokenType.LT);
+            break;
+          case UnlinkedExprOperation.lessEqual:
+            _pushBinary(TokenType.LT_EQ);
+            break;
+          // prefix
+          case UnlinkedExprOperation.complement:
+            _pushPrefix(TokenType.TILDE);
+            break;
+          case UnlinkedExprOperation.negate:
+            _pushPrefix(TokenType.MINUS);
+            break;
+          case UnlinkedExprOperation.not:
+            _pushPrefix(TokenType.BANG);
+            break;
+          // conditional
+          case UnlinkedExprOperation.conditional:
+            Expression elseExpr = _pop();
+            Expression thenExpr = _pop();
+            Expression condition = _pop();
+            _push(AstTestFactory.conditionalExpression(
+                condition, thenExpr, elseExpr));
+            break;
+          // invokeMethodRef
+          case UnlinkedExprOperation.invokeMethodRef:
+            _pushInvokeMethodRef();
+            break;
+          // containers
+          case UnlinkedExprOperation.makeUntypedList:
+            _pushList(null);
+            break;
+          case UnlinkedExprOperation.makeTypedList:
+            TypeAnnotation itemType = _newTypeName();
+            _pushList(
+                AstTestFactory.typeArgumentList(<TypeAnnotation>[itemType]));
+            break;
+          case UnlinkedExprOperation.makeUntypedMap:
+            _pushMap(null);
+            break;
+          case UnlinkedExprOperation.makeTypedMap:
+            TypeAnnotation keyType = _newTypeName();
+            TypeAnnotation valueType = _newTypeName();
+            _pushMap(AstTestFactory
+                .typeArgumentList(<TypeAnnotation>[keyType, valueType]));
+            break;
+          case UnlinkedExprOperation.pushReference:
+            _pushReference();
+            break;
+          case UnlinkedExprOperation.extractProperty:
+            _pushExtractProperty();
+            break;
+          case UnlinkedExprOperation.invokeConstructor:
+            _pushInstanceCreation();
+            break;
+          case UnlinkedExprOperation.pushParameter:
+            String name = uc.strings[stringPtr++];
+            SimpleIdentifier identifier = AstTestFactory.identifier3(name);
+            identifier.staticElement = _enclosingConstructor.parameters
+                .firstWhere((parameter) => parameter.name == name,
+                    orElse: () => throw new StateError(
+                        'Unable to resolve constructor parameter: $name'));
+            _push(identifier);
+            break;
+          case UnlinkedExprOperation.ifNull:
+            _pushBinary(TokenType.QUESTION_QUESTION);
+            break;
+          case UnlinkedExprOperation.await:
+            Expression expression = _pop();
+            _push(AstTestFactory.awaitExpression(expression));
+            break;
+          case UnlinkedExprOperation.pushSuper:
+          case UnlinkedExprOperation.pushThis:
+            throw const _UnresolvedReferenceException();
+          case UnlinkedExprOperation.assignToRef:
+          case UnlinkedExprOperation.assignToProperty:
+          case UnlinkedExprOperation.assignToIndex:
+          case UnlinkedExprOperation.extractIndex:
+          case UnlinkedExprOperation.invokeMethod:
+          case UnlinkedExprOperation.cascadeSectionBegin:
+          case UnlinkedExprOperation.cascadeSectionEnd:
+          case UnlinkedExprOperation.typeCast:
+          case UnlinkedExprOperation.typeCheck:
+          case UnlinkedExprOperation.throwException:
+          case UnlinkedExprOperation.pushLocalFunctionReference:
+          case UnlinkedExprOperation.pushError:
+          case UnlinkedExprOperation.pushTypedAbstract:
+          case UnlinkedExprOperation.pushUntypedAbstract:
+            throw new UnimplementedError(
+                'Unexpected $operation in a constant expression.');
+        }
       }
+    } on _UnresolvedReferenceException {
+      return AstTestFactory.identifier3(r'#invalidConst');
     }
     return stack.single;
   }
@@ -570,6 +571,9 @@
         ..staticElement = element;
       return AstTestFactory.identifier(enclosing, identifier);
     }
+    if (element == null) {
+      throw const _UnresolvedReferenceException();
+    }
     SimpleIdentifier property = AstTestFactory.identifier3(info.name)
       ..staticElement = element;
     return AstTestFactory.propertyAccess(enclosing, property);
@@ -704,6 +708,9 @@
       constructorNode = AstTestFactory.constructorName(typeNode, null);
     }
     constructorNode.staticElement = constructorElement;
+    if (constructorElement == null) {
+      throw const _UnresolvedReferenceException();
+    }
     // create InstanceCreationExpression
     InstanceCreationExpression instanceCreation = AstTestFactory
         .instanceCreationExpression(Keyword.CONST, constructorNode, arguments);
@@ -767,6 +774,9 @@
     EntityRef ref = uc.references[refPtr++];
     _ReferenceInfo info = resynthesizer.getReferenceInfo(ref.reference);
     Expression node = _buildIdentifierSequence(info);
+    if (node is Identifier && node.staticElement == null) {
+      throw const _UnresolvedReferenceException();
+    }
     _push(node);
   }
 
@@ -1998,3 +2008,12 @@
     return name;
   }
 }
+
+/**
+ * This exception is thrown when we detect that the constant expression
+ * being resynthesized cannot be fully resolved, so is not a valid constant
+ * expression.
+ */
+class _UnresolvedReferenceException {
+  const _UnresolvedReferenceException();
+}
diff --git a/pkg/analyzer/test/file_system/physical_resource_provider_test.dart b/pkg/analyzer/test/file_system/physical_resource_provider_test.dart
index 71c30b9..913bb27 100644
--- a/pkg/analyzer/test/file_system/physical_resource_provider_test.dart
+++ b/pkg/analyzer/test/file_system/physical_resource_provider_test.dart
@@ -168,8 +168,9 @@
   }
 
   void test_renameSync_newDoesNotExist() {
-    String oldPath = '$tempPath/file.txt';
-    String newPath = '$tempPath/new-file.txt';
+    pathos.Context pathContext = PhysicalResourceProvider.INSTANCE.pathContext;
+    String oldPath = pathContext.join(tempPath, 'file.txt');
+    String newPath = pathContext.join(tempPath, 'new-file.txt');
     new io.File(oldPath).writeAsStringSync('text');
     File file = PhysicalResourceProvider.INSTANCE.getResource(oldPath);
     File newFile = file.renameSync(newPath);
@@ -181,8 +182,9 @@
   }
 
   test_renameSync_newExists_file() async {
-    String oldPath = '$tempPath/file.txt';
-    String newPath = '$tempPath/new-file.txt';
+    pathos.Context pathContext = PhysicalResourceProvider.INSTANCE.pathContext;
+    String oldPath = pathContext.join(tempPath, 'file.txt');
+    String newPath = pathContext.join(tempPath, 'new-file.txt');
     new io.File(oldPath).writeAsStringSync('text');
     new io.File(newPath).writeAsStringSync('new text');
     File file = PhysicalResourceProvider.INSTANCE.getResource(oldPath);
@@ -195,8 +197,9 @@
   }
 
   void test_renameSync_newExists_folder() {
-    String oldPath = '$tempPath/file.txt';
-    String newPath = '$tempPath/foo';
+    pathos.Context pathContext = PhysicalResourceProvider.INSTANCE.pathContext;
+    String oldPath = pathContext.join(tempPath, 'file.txt');
+    String newPath = pathContext.join(tempPath, 'foo');
     new io.File(oldPath).writeAsStringSync('text');
     new io.Directory(newPath).createSync();
     File file = PhysicalResourceProvider.INSTANCE.getResource(oldPath);
@@ -253,7 +256,7 @@
   }
 
   void test_toUri() {
-    String path = '/foo/file.txt';
+    String path = io.Platform.isWindows ? r'C:\foo\file.txt' : '/foo/file.txt';
     File file = PhysicalResourceProvider.INSTANCE.getFile(path);
     expect(file.toUri(), new Uri.file(path));
   }
@@ -473,7 +476,8 @@
   }
 
   void test_toUri() {
-    String path = '/foo/directory';
+    String path =
+        io.Platform.isWindows ? r'C:\foo\directory' : '/foo/directory';
     Folder folder = PhysicalResourceProvider.INSTANCE.getFolder(path);
     expect(folder.toUri(), new Uri.directory(path));
   }
diff --git a/pkg/analyzer/test/generated/all_the_rest_test.dart b/pkg/analyzer/test/generated/all_the_rest_test.dart
index c344f2e..b9d6422 100644
--- a/pkg/analyzer/test/generated/all_the_rest_test.dart
+++ b/pkg/analyzer/test/generated/all_the_rest_test.dart
@@ -33,7 +33,6 @@
 import 'package:analyzer/src/generated/testing/test_type_provider.dart';
 import 'package:analyzer/src/generated/testing/token_factory.dart';
 import 'package:analyzer/src/generated/utilities_dart.dart';
-import 'package:analyzer/src/source/source_resource.dart';
 import 'package:mockito/mockito.dart' show Mock, when;
 import 'package:path/path.dart' as path;
 import 'package:source_span/source_span.dart';
@@ -52,8 +51,6 @@
     defineReflectiveTests(DartUriResolverTest);
     // ignore: deprecated_member_use
     defineReflectiveTests(DirectoryBasedDartSdkTest);
-    // ignore: deprecated_member_use
-    defineReflectiveTests(DirectoryBasedSourceContainerTest);
     defineReflectiveTests(ElementLocatorTest);
     defineReflectiveTests(EnumMemberBuilderTest);
     defineReflectiveTests(ErrorReporterTest);
@@ -329,25 +326,6 @@
   }
 }
 
-@deprecated
-@reflectiveTest
-class DirectoryBasedSourceContainerTest {
-  void test_contains() {
-    MemoryResourceProvider resourceProvider = new MemoryResourceProvider();
-    File file1 = resourceProvider.getFile('/does/not/exist/some.dart');
-    File file2 = resourceProvider.getFile('/does/not/exist/folder/some2.dart');
-    File file3 = resourceProvider.getFile('/does/not/exist3/some3.dart');
-    Source source1 = new FileSource(file1);
-    Source source2 = new FileSource(file2);
-    Source source3 = new FileSource(file3);
-    DirectoryBasedSourceContainer container =
-        new DirectoryBasedSourceContainer.con2('/does/not/exist');
-    expect(container.contains(source1), isTrue);
-    expect(container.contains(source2), isTrue);
-    expect(container.contains(source3), isFalse);
-  }
-}
-
 @reflectiveTest
 class ElementLocatorTest extends ResolverTestCase {
   void fail_locate_Identifier_partOfDirective() {
diff --git a/pkg/analyzer/test/generated/checked_mode_compile_time_error_code_kernel_test.dart b/pkg/analyzer/test/generated/checked_mode_compile_time_error_code_kernel_test.dart
new file mode 100644
index 0000000..e90099e
--- /dev/null
+++ b/pkg/analyzer/test/generated/checked_mode_compile_time_error_code_kernel_test.dart
@@ -0,0 +1,51 @@
+// 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 'package:test_reflective_loader/test_reflective_loader.dart';
+
+import 'checked_mode_compile_time_error_code_driver_test.dart';
+
+main() {
+  defineReflectiveSuite(() {
+    defineReflectiveTests(CheckedModeCompileTimeErrorCodeTest_Kernel);
+  });
+}
+
+@reflectiveTest
+class CheckedModeCompileTimeErrorCodeTest_Kernel
+    extends CheckedModeCompileTimeErrorCodeTest_Driver {
+  @override
+  bool get enableKernelDriver => true;
+
+  @override
+  @failingTest
+  test_fieldFormalParameterNotAssignableToField_fieldType_unresolved() async {
+    return super
+        .test_fieldFormalParameterNotAssignableToField_fieldType_unresolved();
+  }
+
+  @override
+  @failingTest
+  test_fieldTypeMismatch_unresolved() async {
+    return super.test_fieldTypeMismatch_unresolved();
+  }
+
+  @override
+  @failingTest
+  test_parameterNotAssignable_undefined() async {
+    return super.test_parameterNotAssignable_undefined();
+  }
+
+  @override
+  @failingTest
+  test_redirectingConstructor_paramTypeMismatch() async {
+    return super.test_redirectingConstructor_paramTypeMismatch();
+  }
+
+  @override
+  @failingTest
+  test_topLevelVarNotAssignable_undefined() async {
+    return super.test_topLevelVarNotAssignable_undefined();
+  }
+}
diff --git a/pkg/analyzer/test/generated/compile_time_error_code_kernel_test.dart b/pkg/analyzer/test/generated/compile_time_error_code_kernel_test.dart
new file mode 100644
index 0000000..1de4195
--- /dev/null
+++ b/pkg/analyzer/test/generated/compile_time_error_code_kernel_test.dart
@@ -0,0 +1,703 @@
+// 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 'package:test_reflective_loader/test_reflective_loader.dart';
+
+import 'compile_time_error_code_driver_test.dart';
+
+main() {
+  defineReflectiveSuite(() {
+    defineReflectiveTests(CompileTimeErrorCodeTest_Kernel);
+  });
+}
+
+@reflectiveTest
+class CompileTimeErrorCodeTest_Kernel extends CompileTimeErrorCodeTest_Driver {
+  @override
+  bool get enableKernelDriver => true;
+
+  @override
+  @failingTest
+  test_async_used_as_identifier_in_for_statement() async {
+    return super.test_async_used_as_identifier_in_for_statement();
+  }
+
+  @override
+  @failingTest
+  test_async_used_as_identifier_in_getter_name() async {
+    return super.test_async_used_as_identifier_in_getter_name();
+  }
+
+  @override
+  @failingTest
+  test_async_used_as_identifier_in_invocation() async {
+    return super.test_async_used_as_identifier_in_invocation();
+  }
+
+  @override
+  @failingTest
+  test_async_used_as_identifier_in_setter_name() async {
+    return super.test_async_used_as_identifier_in_setter_name();
+  }
+
+  @override
+  @failingTest
+  test_async_used_as_identifier_in_string_interpolation() async {
+    return super.test_async_used_as_identifier_in_string_interpolation();
+  }
+
+  @override
+  @failingTest
+  test_async_used_as_identifier_in_suffix() async {
+    return super.test_async_used_as_identifier_in_suffix();
+  }
+
+  @override
+  @failingTest
+  test_bug_23176() async {
+    return super.test_bug_23176();
+  }
+
+  @override
+  @failingTest
+  test_builtInIdentifierAsType_variableDeclaration() async {
+    return super.test_builtInIdentifierAsType_variableDeclaration();
+  }
+
+  @override
+  @failingTest
+  test_conflictingConstructorNameAndMember_field() async {
+    return super.test_conflictingConstructorNameAndMember_field();
+  }
+
+  @override
+  @failingTest
+  test_conflictingConstructorNameAndMember_getter() async {
+    return super.test_conflictingConstructorNameAndMember_getter();
+  }
+
+  @override
+  @failingTest
+  test_conflictingConstructorNameAndMember_method() async {
+    return super.test_conflictingConstructorNameAndMember_method();
+  }
+
+  @override
+  @failingTest
+  test_const_invalid_constructorFieldInitializer_fromLibrary() async {
+    return super.test_const_invalid_constructorFieldInitializer_fromLibrary();
+  }
+
+  @override
+  @failingTest
+  test_constConstructor_redirect_generic() async {
+    return super.test_constConstructor_redirect_generic();
+  }
+
+  @override
+  @failingTest
+  test_constDeferredClass_namedConstructor() async {
+    return super.test_constDeferredClass_namedConstructor();
+  }
+
+  @override
+  @failingTest
+  test_constEval_newInstance_externalFactoryConstConstructor() async {
+    return super.test_constEval_newInstance_externalFactoryConstConstructor();
+  }
+
+  @override
+  @failingTest
+  test_constEvalThrowsException_finalAlreadySet_initializer() async {
+    return super.test_constEvalThrowsException_finalAlreadySet_initializer();
+  }
+
+  @override
+  @failingTest
+  test_constEvalThrowsException_finalAlreadySet_initializing_formal() async {
+    return super
+        .test_constEvalThrowsException_finalAlreadySet_initializing_formal();
+  }
+
+  @override
+  @failingTest
+  test_constInitializedWithNonConstValue_finalField() async {
+    return super.test_constInitializedWithNonConstValue_finalField();
+  }
+
+  @override
+  @failingTest
+  test_constWithUndefinedConstructorDefault() async {
+    return super.test_constWithUndefinedConstructorDefault();
+  }
+
+  @override
+  @failingTest
+  test_defaultValueInFunctionTypeAlias() async {
+    return super.test_defaultValueInFunctionTypeAlias();
+  }
+
+  @override
+  @failingTest
+  test_defaultValueInFunctionTypedParameter_named() async {
+    return super.test_defaultValueInFunctionTypedParameter_named();
+  }
+
+  @override
+  @failingTest
+  test_defaultValueInFunctionTypedParameter_optional() async {
+    return super.test_defaultValueInFunctionTypedParameter_optional();
+  }
+
+  @override
+  @failingTest
+  test_defaultValueInRedirectingFactoryConstructor() async {
+    return super.test_defaultValueInRedirectingFactoryConstructor();
+  }
+
+  @override
+  @failingTest
+  test_deferredImportWithInvalidUri() async {
+    return super.test_deferredImportWithInvalidUri();
+  }
+
+  @override
+  @failingTest
+  test_duplicateConstructorName_named() async {
+    return super.test_duplicateConstructorName_named();
+  }
+
+  @override
+  @failingTest
+  test_duplicateConstructorName_unnamed() async {
+    return super.test_duplicateConstructorName_unnamed();
+  }
+
+  @override
+  @failingTest
+  test_duplicateDefinition_acrossLibraries() async {
+    return super.test_duplicateDefinition_acrossLibraries();
+  }
+
+  @override
+  @failingTest
+  test_duplicateDefinition_classMembers_fields() async {
+    return super.test_duplicateDefinition_classMembers_fields();
+  }
+
+  @override
+  @failingTest
+  test_duplicateDefinition_classMembers_fields_oneStatic() async {
+    return super.test_duplicateDefinition_classMembers_fields_oneStatic();
+  }
+
+  @override
+  @failingTest
+  test_duplicateDefinition_classMembers_methods() async {
+    return super.test_duplicateDefinition_classMembers_methods();
+  }
+
+  @override
+  @failingTest
+  test_duplicateDefinition_inPart() async {
+    return super.test_duplicateDefinition_inPart();
+  }
+
+  @override
+  @failingTest
+  test_exportOfNonLibrary() async {
+    return super.test_exportOfNonLibrary();
+  }
+
+  @override
+  @failingTest
+  test_fieldInitializerRedirectingConstructor_afterRedirection() async {
+    return super.test_fieldInitializerRedirectingConstructor_afterRedirection();
+  }
+
+  @override
+  @failingTest
+  test_fieldInitializerRedirectingConstructor_beforeRedirection() async {
+    return super
+        .test_fieldInitializerRedirectingConstructor_beforeRedirection();
+  }
+
+  @override
+  @failingTest
+  test_fieldInitializingFormalRedirectingConstructor() async {
+    return super.test_fieldInitializingFormalRedirectingConstructor();
+  }
+
+  @override
+  @failingTest
+  test_genericFunctionTypedParameter() async {
+    return super.test_genericFunctionTypedParameter();
+  }
+
+  @override
+  @failingTest
+  test_getterAndMethodWithSameName() async {
+    return super.test_getterAndMethodWithSameName();
+  }
+
+  @override
+  @failingTest
+  test_implicitThisReferenceInInitializer_redirectingConstructorInvocation() async {
+    return super
+        .test_implicitThisReferenceInInitializer_redirectingConstructorInvocation();
+  }
+
+  @override
+  @failingTest
+  test_importOfNonLibrary() async {
+    return super.test_importOfNonLibrary();
+  }
+
+  @override
+  @failingTest
+  test_instanceMemberAccessFromFactory_named() async {
+    return super.test_instanceMemberAccessFromFactory_named();
+  }
+
+  @override
+  @failingTest
+  test_instanceMemberAccessFromFactory_unnamed() async {
+    return super.test_instanceMemberAccessFromFactory_unnamed();
+  }
+
+  @override
+  @failingTest
+  test_invalidAnnotation_importWithPrefix_notVariableOrConstructorInvocation() async {
+    return super
+        .test_invalidAnnotation_importWithPrefix_notVariableOrConstructorInvocation();
+  }
+
+  @override
+  @failingTest
+  test_invalidAnnotation_notVariableOrConstructorInvocation() async {
+    return super.test_invalidAnnotation_notVariableOrConstructorInvocation();
+  }
+
+  @override
+  @failingTest
+  test_invalidAnnotationFromDeferredLibrary_namedConstructor() async {
+    return super.test_invalidAnnotationFromDeferredLibrary_namedConstructor();
+  }
+
+  @override
+  @failingTest
+  test_invalidConstructorName_notEnclosingClassName_defined() async {
+    return super.test_invalidConstructorName_notEnclosingClassName_defined();
+  }
+
+  @override
+  @failingTest
+  test_invalidConstructorName_notEnclosingClassName_undefined() async {
+    return super.test_invalidConstructorName_notEnclosingClassName_undefined();
+  }
+
+  @override
+  @failingTest
+  test_invalidFactoryNameNotAClass_notClassName() async {
+    return super.test_invalidFactoryNameNotAClass_notClassName();
+  }
+
+  @override
+  @failingTest
+  test_invalidFactoryNameNotAClass_notEnclosingClassName() async {
+    return super.test_invalidFactoryNameNotAClass_notEnclosingClassName();
+  }
+
+  @override
+  @failingTest
+  test_invalidUri_part() async {
+    return super.test_invalidUri_part();
+  }
+
+  @override
+  @failingTest
+  test_isInInstanceVariableInitializer_restored() async {
+    return super.test_isInInstanceVariableInitializer_restored();
+  }
+
+  @override
+  @failingTest
+  test_memberWithClassName_getter() async {
+    return super.test_memberWithClassName_getter();
+  }
+
+  @override
+  @failingTest
+  test_methodAndGetterWithSameName() async {
+    return super.test_methodAndGetterWithSameName();
+  }
+
+  @override
+  @failingTest
+  test_mixinHasNoConstructors_mixinClass_namedSuperCall() async {
+    return super.test_mixinHasNoConstructors_mixinClass_namedSuperCall();
+  }
+
+  @override
+  @failingTest
+  test_mixinOfNonClass_typeAlias() async {
+    return super.test_mixinOfNonClass_typeAlias();
+  }
+
+  @override
+  @failingTest
+  test_multipleRedirectingConstructorInvocations() async {
+    return super.test_multipleRedirectingConstructorInvocations();
+  }
+
+  @override
+  @failingTest
+  test_multipleSuperInitializers() async {
+    return super.test_multipleSuperInitializers();
+  }
+
+  @override
+  @failingTest
+  test_noAnnotationConstructorArguments() async {
+    return super.test_noAnnotationConstructorArguments();
+  }
+
+  @override
+  @failingTest
+  test_noDefaultSuperConstructorExplicit_MixinAppWithDirectSuperCall() async {
+    return super
+        .test_noDefaultSuperConstructorExplicit_MixinAppWithDirectSuperCall();
+  }
+
+  @override
+  @failingTest
+  test_noDefaultSuperConstructorExplicit_mixinAppWithNamedParam() async {
+    return super
+        .test_noDefaultSuperConstructorExplicit_mixinAppWithNamedParam();
+  }
+
+  @override
+  @failingTest
+  test_noDefaultSuperConstructorExplicit_MixinAppWithNamedSuperCall() async {
+    return super
+        .test_noDefaultSuperConstructorExplicit_MixinAppWithNamedSuperCall();
+  }
+
+  @override
+  @failingTest
+  test_noDefaultSuperConstructorExplicit_mixinAppWithOptionalParam() async {
+    return super
+        .test_noDefaultSuperConstructorExplicit_mixinAppWithOptionalParam();
+  }
+
+  @override
+  @failingTest
+  test_noDefaultSuperConstructorExplicit_MixinWithDirectSuperCall() async {
+    return super
+        .test_noDefaultSuperConstructorExplicit_MixinWithDirectSuperCall();
+  }
+
+  @override
+  @failingTest
+  test_noDefaultSuperConstructorExplicit_mixinWithNamedParam() async {
+    return super.test_noDefaultSuperConstructorExplicit_mixinWithNamedParam();
+  }
+
+  @override
+  @failingTest
+  test_noDefaultSuperConstructorExplicit_MixinWithNamedSuperCall() async {
+    return super
+        .test_noDefaultSuperConstructorExplicit_MixinWithNamedSuperCall();
+  }
+
+  @override
+  @failingTest
+  test_noDefaultSuperConstructorExplicit_mixinWithOptionalParam() async {
+    return super
+        .test_noDefaultSuperConstructorExplicit_mixinWithOptionalParam();
+  }
+
+  @override
+  @failingTest
+  test_noDefaultSuperConstructorImplicit_mixinAppWithNamedParam() async {
+    return super
+        .test_noDefaultSuperConstructorImplicit_mixinAppWithNamedParam();
+  }
+
+  @override
+  @failingTest
+  test_noDefaultSuperConstructorImplicit_mixinAppWithOptionalParam() async {
+    return super
+        .test_noDefaultSuperConstructorImplicit_mixinAppWithOptionalParam();
+  }
+
+  @override
+  @failingTest
+  test_noDefaultSuperConstructorImplicit_mixinWithNamedParam() async {
+    return super.test_noDefaultSuperConstructorImplicit_mixinWithNamedParam();
+  }
+
+  @override
+  @failingTest
+  test_noDefaultSuperConstructorImplicit_mixinWithOptionalParam() async {
+    return super
+        .test_noDefaultSuperConstructorImplicit_mixinWithOptionalParam();
+  }
+
+  @override
+  @failingTest
+  test_noDefaultSuperConstructorImplicit_superOnlyNamed() async {
+    return super.test_noDefaultSuperConstructorImplicit_superOnlyNamed();
+  }
+
+  @override
+  @failingTest
+  test_nonConstantAnnotationConstructor_named() async {
+    return super.test_nonConstantAnnotationConstructor_named();
+  }
+
+  @override
+  @failingTest
+  test_nonConstantDefaultValue_method_named() async {
+    return super.test_nonConstantDefaultValue_method_named();
+  }
+
+  @override
+  @failingTest
+  test_nonConstantDefaultValue_method_positional() async {
+    return super.test_nonConstantDefaultValue_method_positional();
+  }
+
+  @override
+  @failingTest
+  test_nonConstantDefaultValueFromDeferredLibrary_nested() async {
+    return super.test_nonConstantDefaultValueFromDeferredLibrary_nested();
+  }
+
+  @override
+  @failingTest
+  test_nonConstMapAsExpressionStatement_begin() async {
+    return super.test_nonConstMapAsExpressionStatement_begin();
+  }
+
+  @override
+  @failingTest
+  test_nonConstMapAsExpressionStatement_only() async {
+    return super.test_nonConstMapAsExpressionStatement_only();
+  }
+
+  @override
+  @failingTest
+  test_nonConstValueInInitializer_instanceCreation_inDifferentFile() async {
+    return super
+        .test_nonConstValueInInitializer_instanceCreation_inDifferentFile();
+  }
+
+  @override
+  @failingTest
+  test_nonConstValueInInitializer_redirecting() async {
+    return super.test_nonConstValueInInitializer_redirecting();
+  }
+
+  @override
+  @failingTest
+  test_nonConstValueInInitializerFromDeferredLibrary_redirecting() async {
+    return super
+        .test_nonConstValueInInitializerFromDeferredLibrary_redirecting();
+  }
+
+  @override
+  @failingTest
+  test_nonGenerativeConstructor_explicit() async {
+    return super.test_nonGenerativeConstructor_explicit();
+  }
+
+  @override
+  @failingTest
+  test_partOfNonPart() async {
+    return super.test_partOfNonPart();
+  }
+
+  @override
+  @failingTest
+  test_prefixCollidesWithTopLevelMembers_functionTypeAlias() async {
+    return super.test_prefixCollidesWithTopLevelMembers_functionTypeAlias();
+  }
+
+  @override
+  @failingTest
+  test_prefixCollidesWithTopLevelMembers_topLevelFunction() async {
+    return super.test_prefixCollidesWithTopLevelMembers_topLevelFunction();
+  }
+
+  @override
+  @failingTest
+  test_prefixCollidesWithTopLevelMembers_topLevelVariable() async {
+    return super.test_prefixCollidesWithTopLevelMembers_topLevelVariable();
+  }
+
+  @override
+  @failingTest
+  test_prefixCollidesWithTopLevelMembers_type() async {
+    return super.test_prefixCollidesWithTopLevelMembers_type();
+  }
+
+  @override
+  @failingTest
+  test_recursiveCompileTimeConstant_initializer_after_toplevel_var() async {
+    return super
+        .test_recursiveCompileTimeConstant_initializer_after_toplevel_var();
+  }
+
+  @override
+  @failingTest
+  test_recursiveConstructorRedirect() async {
+    return super.test_recursiveConstructorRedirect();
+  }
+
+  @override
+  @failingTest
+  test_recursiveFactoryRedirect_diverging() async {
+    return super.test_recursiveFactoryRedirect_diverging();
+  }
+
+  @override
+  @failingTest
+  test_recursiveFactoryRedirect_generic() async {
+    return super.test_recursiveFactoryRedirect_generic();
+  }
+
+  @override
+  @failingTest
+  test_recursiveFactoryRedirect_named() async {
+    return super.test_recursiveFactoryRedirect_named();
+  }
+
+  @override
+  @failingTest
+  test_recursiveInterfaceInheritance_mixin() async {
+    return super.test_recursiveInterfaceInheritance_mixin();
+  }
+
+  @override
+  @failingTest
+  test_recursiveInterfaceInheritanceBaseCaseWith() async {
+    return super.test_recursiveInterfaceInheritanceBaseCaseWith();
+  }
+
+  @override
+  @failingTest
+  test_redirectGenerativeToNonGenerativeConstructor() async {
+    return super.test_redirectGenerativeToNonGenerativeConstructor();
+  }
+
+  @override
+  @failingTest
+  test_redirectToMissingConstructor_unnamed() async {
+    return super.test_redirectToMissingConstructor_unnamed();
+  }
+
+  @override
+  @failingTest
+  test_redirectToNonConstConstructor() async {
+    return super.test_redirectToNonConstConstructor();
+  }
+
+  @override
+  @failingTest
+  test_superInRedirectingConstructor_redirectionSuper() async {
+    return super.test_superInRedirectingConstructor_redirectionSuper();
+  }
+
+  @override
+  @failingTest
+  test_superInRedirectingConstructor_superRedirection() async {
+    return super.test_superInRedirectingConstructor_superRedirection();
+  }
+
+  @override
+  @failingTest
+  test_typeAliasCannotReferenceItself_11987() async {
+    return super.test_typeAliasCannotReferenceItself_11987();
+  }
+
+  @override
+  @failingTest
+  test_typeAliasCannotReferenceItself_parameterType_named() async {
+    return super.test_typeAliasCannotReferenceItself_parameterType_named();
+  }
+
+  @override
+  @failingTest
+  test_typeAliasCannotReferenceItself_parameterType_positional() async {
+    return super.test_typeAliasCannotReferenceItself_parameterType_positional();
+  }
+
+  @override
+  @failingTest
+  test_typeAliasCannotReferenceItself_parameterType_required() async {
+    return super.test_typeAliasCannotReferenceItself_parameterType_required();
+  }
+
+  @override
+  @failingTest
+  test_typeAliasCannotReferenceItself_parameterType_typeArgument() async {
+    return super
+        .test_typeAliasCannotReferenceItself_parameterType_typeArgument();
+  }
+
+  @override
+  @failingTest
+  test_typeAliasCannotReferenceItself_typeVariableBounds() async {
+    return super.test_typeAliasCannotReferenceItself_typeVariableBounds();
+  }
+
+  @override
+  @failingTest
+  test_undefinedConstructorInInitializer_explicit_unnamed() async {
+    return super.test_undefinedConstructorInInitializer_explicit_unnamed();
+  }
+
+  @override
+  @failingTest
+  test_undefinedConstructorInInitializer_implicit() async {
+    return super.test_undefinedConstructorInInitializer_implicit();
+  }
+
+  @override
+  @failingTest
+  test_uriDoesNotExist_import() async {
+    return super.test_uriDoesNotExist_import();
+  }
+
+  @override
+  @failingTest
+  test_uriDoesNotExist_import_appears_after_deleting_target() async {
+    return super.test_uriDoesNotExist_import_appears_after_deleting_target();
+  }
+
+  @override
+  @failingTest
+  test_uriDoesNotExist_import_disappears_when_fixed() async {
+    return super.test_uriDoesNotExist_import_disappears_when_fixed();
+  }
+
+  @override
+  @failingTest
+  test_uriDoesNotExist_part() async {
+    return super.test_uriDoesNotExist_part();
+  }
+
+  @override
+  @failingTest
+  test_uriWithInterpolation_constant() async {
+    return super.test_uriWithInterpolation_constant();
+  }
+
+  @override
+  @failingTest
+  test_uriWithInterpolation_nonConstant() async {
+    return super.test_uriWithInterpolation_nonConstant();
+  }
+}
diff --git a/pkg/analyzer/test/generated/error_suppression_kernel_test.dart b/pkg/analyzer/test/generated/error_suppression_kernel_test.dart
new file mode 100644
index 0000000..7babab5
--- /dev/null
+++ b/pkg/analyzer/test/generated/error_suppression_kernel_test.dart
@@ -0,0 +1,19 @@
+// 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 'package:test_reflective_loader/test_reflective_loader.dart';
+
+import 'error_suppression_driver_test.dart';
+
+main() {
+  defineReflectiveSuite(() {
+    defineReflectiveTests(ErrorSuppressionTest_Kernel);
+  });
+}
+
+@reflectiveTest
+class ErrorSuppressionTest_Kernel extends ErrorSuppressionTest_Driver {
+  @override
+  bool get enableKernelDriver => true;
+}
diff --git a/pkg/analyzer/test/generated/non_error_resolver_kernel_test.dart b/pkg/analyzer/test/generated/non_error_resolver_kernel_test.dart
index f55fab0..2b15854 100644
--- a/pkg/analyzer/test/generated/non_error_resolver_kernel_test.dart
+++ b/pkg/analyzer/test/generated/non_error_resolver_kernel_test.dart
@@ -13,6 +13,11 @@
   });
 }
 
+/// Tests marked with this annotation fail because of a Fasta problem.
+class FastaProblem {
+  const FastaProblem(String issueUri);
+}
+
 @reflectiveTest
 class NonErrorResolverTest_Kernel extends NonErrorResolverTest_Driver {
   @override
@@ -20,14 +25,57 @@
 
   @override
   @failingTest
+  test_async_future_int_with_return_future_int() async {
+    return super.test_async_future_int_with_return_future_int();
+  }
+
+  @override
+  @failingTest
+  test_conflictingConstructorNameAndMember_setter() async {
+    return super.test_conflictingConstructorNameAndMember_setter();
+  }
+
+  @override
+  @failingTest
+  test_constConstructorWithNonConstSuper_unresolved() async {
+    return super.test_constConstructorWithNonConstSuper_unresolved();
+  }
+
+  @override
+  @failingTest
+  test_constDeferredClass_new() async {
+    return super.test_constDeferredClass_new();
+  }
+
+  @override
+  @failingTest
+  test_constEvalTypeBoolNumString_equal() async {
+    return super.test_constEvalTypeBoolNumString_equal();
+  }
+
+  @override
+  @failingTest
+  test_constEvalTypeBoolNumString_notEqual() async {
+    return super.test_constEvalTypeBoolNumString_notEqual();
+  }
+
+  @override
+  @failingTest
+  test_constRedirectSkipsSupertype() async {
+    return super.test_constRedirectSkipsSupertype();
+  }
+
+  @override
+  @failingTest
+  @FastaProblem('https://github.com/dart-lang/sdk/issues/30035')
   test_constructorDeclaration_scope_signature() async {
     return super.test_constructorDeclaration_scope_signature();
   }
 
   @override
   @failingTest
-  test_constWithNonConstantArgument_constField() async {
-    return super.test_constWithNonConstantArgument_constField();
+  test_constWithUndefinedConstructor() async {
+    return super.test_constWithUndefinedConstructor();
   }
 
   @override
@@ -37,13 +85,15 @@
   }
 
   @override
-  @failingTest
+  @assertFailingTest
+  @FastaProblem('https://github.com/dart-lang/sdk/issues/30836')
   test_finalNotInitialized_hasNativeClause_hasConstructor() async {
     return super.test_finalNotInitialized_hasNativeClause_hasConstructor();
   }
 
   @override
   @failingTest
+  @FastaProblem('https://github.com/dart-lang/sdk/issues/30836')
   test_finalNotInitialized_hasNativeClause_noConstructor() async {
     fail('This test fails only in checked mode.');
     return super.test_finalNotInitialized_hasNativeClause_noConstructor();
@@ -51,36 +101,48 @@
 
   @override
   @failingTest
+  test_finalNotInitialized_redirectingConstructor() async {
+    return super.test_finalNotInitialized_redirectingConstructor();
+  }
+
+  @override
+  @failingTest
+  @FastaProblem('https://github.com/dart-lang/sdk/issues/30035')
   test_functionDeclaration_scope_signature() async {
     return super.test_functionDeclaration_scope_signature();
   }
 
   @override
   @failingTest
+  @FastaProblem('https://github.com/dart-lang/sdk/issues/30035')
   test_functionTypeAlias_scope_signature() async {
     return super.test_functionTypeAlias_scope_signature();
   }
 
   @override
   @failingTest
+  @FastaProblem('https://github.com/dart-lang/sdk/issues/30208')
   test_genericTypeAlias_castsAndTypeChecks_hasTypeParameters() async {
     return super.test_genericTypeAlias_castsAndTypeChecks_hasTypeParameters();
   }
 
   @override
   @failingTest
+  @FastaProblem('https://github.com/dart-lang/sdk/issues/30208')
   test_genericTypeAlias_castsAndTypeChecks_noTypeParameters() async {
     return super.test_genericTypeAlias_castsAndTypeChecks_noTypeParameters();
   }
 
   @override
   @failingTest
+  @FastaProblem('https://github.com/dart-lang/sdk/issues/30208')
   test_genericTypeAlias_fieldAndReturnType_noTypeParameters() async {
     return super.test_genericTypeAlias_fieldAndReturnType_noTypeParameters();
   }
 
   @override
   @failingTest
+  @FastaProblem('https://github.com/dart-lang/sdk/issues/30838')
   test_genericTypeAlias_fieldAndReturnType_typeParameters_arguments() async {
     return super
         .test_genericTypeAlias_fieldAndReturnType_typeParameters_arguments();
@@ -88,6 +150,7 @@
 
   @override
   @failingTest
+  @FastaProblem('https://github.com/dart-lang/sdk/issues/30838')
   test_genericTypeAlias_fieldAndReturnType_typeParameters_noArguments() async {
     return super
         .test_genericTypeAlias_fieldAndReturnType_typeParameters_noArguments();
@@ -113,135 +176,140 @@
 
   @override
   @failingTest
-  test_invalidAnnotation_constantVariable_field() async {
-    return super.test_invalidAnnotation_constantVariable_field();
+  test_implicitThisReferenceInInitializer_constructorName() async {
+    return super.test_implicitThisReferenceInInitializer_constructorName();
   }
 
   @override
   @failingTest
-  test_invalidAnnotation_constantVariable_field_importWithPrefix() async {
-    return super
-        .test_invalidAnnotation_constantVariable_field_importWithPrefix();
-  }
-
-  @override
-  @failingTest
-  test_loadLibraryDefined() async {
-    fail('This test fails only in checked mode.');
-    return super.test_loadLibraryDefined();
-  }
-
-  @override
-  @failingTest
+  @FastaProblem('https://github.com/dart-lang/sdk/issues/30834')
   test_memberWithClassName_setter() async {
     return super.test_memberWithClassName_setter();
   }
 
   @override
   @failingTest
+  @FastaProblem('https://github.com/dart-lang/sdk/issues/30035')
   test_methodDeclaration_scope_signature() async {
     return super.test_methodDeclaration_scope_signature();
   }
 
   @override
   @failingTest
+  @FastaProblem('https://github.com/dart-lang/sdk/issues/30835')
   test_nativeConstConstructor() async {
     return super.test_nativeConstConstructor();
   }
 
   @override
   @failingTest
-  test_nativeFunctionBodyInNonSDKCode_function() async {
-    return super.test_nativeFunctionBodyInNonSDKCode_function();
+  test_newWithUndefinedConstructor() async {
+    return super.test_newWithUndefinedConstructor();
   }
 
   @override
   @failingTest
-  test_nonConstantDefaultValue_constField() async {
-    return super.test_nonConstantDefaultValue_constField();
+  test_nonConstValueInInitializer_binary_bool() async {
+    return super.test_nonConstValueInInitializer_binary_bool();
   }
 
   @override
   @failingTest
-  test_nonConstantDefaultValue_function_named() async {
-    return super.test_nonConstantDefaultValue_function_named();
+  test_nonConstValueInInitializer_binary_dynamic() async {
+    return super.test_nonConstValueInInitializer_binary_dynamic();
   }
 
   @override
   @failingTest
-  test_nonConstantDefaultValue_function_positional() async {
-    return super.test_nonConstantDefaultValue_function_positional();
+  test_nonConstValueInInitializer_binary_int() async {
+    return super.test_nonConstValueInInitializer_binary_int();
   }
 
   @override
   @failingTest
-  test_nonConstantDefaultValue_method_named() async {
-    return super.test_nonConstantDefaultValue_method_named();
+  test_nonConstValueInInitializer_binary_num() async {
+    return super.test_nonConstValueInInitializer_binary_num();
   }
 
   @override
   @failingTest
-  test_nonConstantDefaultValue_method_positional() async {
-    return super.test_nonConstantDefaultValue_method_positional();
+  test_nonConstValueInInitializer_redirecting() async {
+    return super.test_nonConstValueInInitializer_redirecting();
   }
 
   @override
   @failingTest
-  test_nonConstCaseExpression_constField() async {
-    return super.test_nonConstCaseExpression_constField();
+  test_nonConstValueInInitializer_unary() async {
+    return super.test_nonConstValueInInitializer_unary();
   }
 
   @override
   @failingTest
-  test_nonConstListElement_constField() async {
-    return super.test_nonConstListElement_constField();
+  test_nonGenerativeConstructor() async {
+    return super.test_nonGenerativeConstructor();
   }
 
   @override
   @failingTest
-  test_nonConstMapKey_constField() async {
-    return super.test_nonConstMapKey_constField();
+  test_propagateTypeArgs_intoSupertype() async {
+    return super.test_propagateTypeArgs_intoSupertype();
   }
 
   @override
   @failingTest
-  test_nonConstMapValue_constField() async {
-    return super.test_nonConstMapValue_constField();
+  test_recursiveConstructorRedirect() async {
+    return super.test_recursiveConstructorRedirect();
   }
 
   @override
   @failingTest
-  test_returnOfInvalidType_dynamicAsTypeArgument() async {
-    return super.test_returnOfInvalidType_dynamicAsTypeArgument();
+  test_redirectToNonConstConstructor() async {
+    return super.test_redirectToNonConstConstructor();
   }
 
   @override
   @failingTest
+  test_referenceToDeclaredVariableInInitializer_constructorName() async {
+    return super
+        .test_referenceToDeclaredVariableInInitializer_constructorName();
+  }
+
+  @override
+  @failingTest
+  test_staticAccessToInstanceMember_annotation() async {
+    return super.test_staticAccessToInstanceMember_annotation();
+  }
+
+  @override
+  @failingTest
+  test_undefinedConstructorInInitializer_explicit_named() async {
+    return super.test_undefinedConstructorInInitializer_explicit_named();
+  }
+
+  @override
+  @failingTest
+  test_undefinedConstructorInInitializer_redirecting() async {
+    return super.test_undefinedConstructorInInitializer_redirecting();
+  }
+
+  @override
+  @failingTest
+  @FastaProblem('https://github.com/dart-lang/sdk/issues/30840')
   test_undefinedIdentifier_synthetic_whenExpression() async {
     return super.test_undefinedIdentifier_synthetic_whenExpression();
   }
 
   @override
   @failingTest
+  @FastaProblem('https://github.com/dart-lang/sdk/issues/30840')
   test_undefinedIdentifier_synthetic_whenMethodName() async {
     return super.test_undefinedIdentifier_synthetic_whenMethodName();
   }
 
   @override
   @failingTest
-  test_uriDoesNotExist_dll() async {
-    return super.test_uriDoesNotExist_dll();
-  }
-
-  @override
-  @failingTest
-  test_uriDoesNotExist_dylib() async {
-    return super.test_uriDoesNotExist_dylib();
-  }
-
-  @override
-  @failingTest
-  test_uriDoesNotExist_so() async {
-    return super.test_uriDoesNotExist_so();
+  test_unqualifiedReferenceToNonLocalStaticMember_fromComment_new() async {
+    return super
+        .test_unqualifiedReferenceToNonLocalStaticMember_fromComment_new();
   }
 }
diff --git a/pkg/analyzer/test/generated/non_error_resolver_test.dart b/pkg/analyzer/test/generated/non_error_resolver_test.dart
index 4b2b19e..20c1e7c 100644
--- a/pkg/analyzer/test/generated/non_error_resolver_test.dart
+++ b/pkg/analyzer/test/generated/non_error_resolver_test.dart
@@ -27,7 +27,316 @@
 }
 
 @reflectiveTest
+class NonErrorResolverSpecTest extends ResolverTestCase {
+  test_inconsistentMethodInheritance_overrideTrumpsInherits_getter() async {
+    // 16134
+    Source source = addSource(r'''
+class B<S> {
+  S get g => null;
+}
+abstract class I<U> {
+  U get g => null;
+}
+class C extends B<double> implements I<int> {
+  num get g => null;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_inconsistentMethodInheritance_overrideTrumpsInherits_method() async {
+    // 16134
+    Source source = addSource(r'''
+class B<S> {
+  m(S s) => null;
+}
+abstract class I<U> {
+  m(U u) => null;
+}
+class C extends B<double> implements I<int> {
+  m(num n) => null;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_inconsistentMethodInheritance_overrideTrumpsInherits_setter() async {
+    // 16134
+    Source source = addSource(r'''
+class B<S> {
+  set t(S s) {}
+}
+abstract class I<U> {
+  set t(U u) {}
+}
+class C extends B<double> implements I<int> {
+  set t(num n) {}
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_invocationOfNonFunction_localVariable_dynamic2() async {
+    Source source = addSource(r'''
+f() {}
+main() {
+  var v = f;
+  v = 1;
+  v();
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_invocationOfNonFunction_proxyOnFunctionClass() async {
+    // 16078
+    Source source = addSource(r'''
+@proxy
+class Functor implements Function {
+  noSuchMethod(inv) {
+    return 42;
+  }
+}
+main() {
+  Functor f = new Functor();
+  f();
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_parameterDefaultDoesNotReferToParameterName() async {
+    // The final "f" should refer to the top-level function "f", not to the
+    // parameter called "f".  See dartbug.com/13179.
+    Source source = addSource('void f([void f([x]) = f]) {}');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_proxy_annotation_prefixed() async {
+    Source source = addSource(r'''
+library L;
+@proxy
+class A {}
+f(A 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(A 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(A 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_proxy_annotation_proxyHasPrefixedIdentifier() async {
+    Source source = addSource(r'''
+library L;
+import 'dart:core' as core;
+@core.proxy class PrefixProxy {}
+main() {
+  new PrefixProxy().foo;
+  new PrefixProxy().foo();
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+  }
+
+  test_proxy_annotation_simple() async {
+    Source source = addSource(r'''
+library L;
+@proxy
+class B {
+  m() {
+    n();
+    var x = g;
+    s = 1;
+    var y = this + this;
+  }
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+  }
+
+  test_proxy_annotation_superclass() async {
+    Source source = addSource(r'''
+library L;
+class B extends A {
+  m() {
+    n();
+    var x = g;
+    s = 1;
+    var y = this + this;
+  }
+}
+@proxy
+class A {}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+  }
+
+  test_proxy_annotation_superclass_mixin() async {
+    Source source = addSource(r'''
+library L;
+class B extends Object with A {
+  m() {
+    n();
+    var x = g;
+    s = 1;
+    var y = this + this;
+  }
+}
+@proxy
+class A {}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+  }
+
+  test_proxy_annotation_superinterface() async {
+    Source source = addSource(r'''
+library L;
+class B implements A {
+  m() {
+    n();
+    var x = g;
+    s = 1;
+    var y = this + this;
+  }
+}
+@proxy
+class A {}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+  }
+
+  test_proxy_annotation_superinterface_infiniteLoop() async {
+    addSource(r'''
+library L;
+class C implements A {
+  m() {
+    n();
+    var x = g;
+    s = 1;
+    var y = this + this;
+  }
+}
+class B implements A{}
+class A implements B{}''');
+    // Test is that a stack overflow isn't reached in resolution
+    // (previous line), no need to assert error set.
+  }
+
+  test_redirectToInvalidReturnType() async {
+    Source source = addSource(r'''
+class A {
+  A() {}
+}
+class B extends A {
+  factory B() = A;
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_returnOfInvalidType_async_future_int_mismatches_future_null() async {
+    Source source = addSource(r'''
+import 'dart:async';
+Future<Null> f() async {
+  return 5;
+}
+''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_returnOfInvalidType_dynamicAsTypeArgument() async {
+    Source source = addSource(r'''
+class I<T> {
+  factory I() => new A<T>();
+}
+class A<T> implements I {
+}''');
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_typeArgumentNotMatchingBounds_typeArgumentList_0() async {
+    Source source = addSource("abstract class A<T extends A>{}");
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_typeArgumentNotMatchingBounds_typeArgumentList_1() async {
+    Source source = addSource("abstract class A<T extends A<A>>{}");
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  test_typeArgumentNotMatchingBounds_typeArgumentList_20() async {
+    Source source = addSource(
+        "abstract class A<T extends A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A>>>>>>>>>>>>>>>>>>>>>{}");
+    await computeAnalysisResult(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+}
+
+@reflectiveTest
 class NonErrorResolverTest extends ResolverTestCase {
+  @override
+  AnalysisOptions get defaultAnalysisOptions =>
+      new AnalysisOptionsImpl()..strongMode = true;
+
   fail_undefinedEnumConstant() async {
     Source source = addSource(r'''
 enum E { ONE }
@@ -2636,57 +2945,6 @@
     verify([source]);
   }
 
-  test_inconsistentMethodInheritance_overrideTrumpsInherits_getter() async {
-    // 16134
-    Source source = addSource(r'''
-class B<S> {
-  S get g => null;
-}
-abstract class I<U> {
-  U get g => null;
-}
-class C extends B<double> implements I<int> {
-  num get g => null;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_inconsistentMethodInheritance_overrideTrumpsInherits_method() async {
-    // 16134
-    Source source = addSource(r'''
-class B<S> {
-  m(S s) => null;
-}
-abstract class I<U> {
-  m(U u) => null;
-}
-class C extends B<double> implements I<int> {
-  m(num n) => null;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_inconsistentMethodInheritance_overrideTrumpsInherits_setter() async {
-    // 16134
-    Source source = addSource(r'''
-class B<S> {
-  set t(S s) {}
-}
-abstract class I<U> {
-  set t(U u) {}
-}
-class C extends B<double> implements I<int> {
-  set t(num n) {}
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
   test_inconsistentMethodInheritance_simple() async {
     Source source = addSource(r'''
 abstract class A {
@@ -3433,19 +3691,6 @@
     verify([source]);
   }
 
-  test_invocationOfNonFunction_localVariable_dynamic2() async {
-    Source source = addSource(r'''
-f() {}
-main() {
-  var v = f;
-  v = 1;
-  v();
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
   test_invocationOfNonFunction_Object() async {
     Source source = addSource(r'''
 main() {
@@ -3457,24 +3702,6 @@
     verify([source]);
   }
 
-  test_invocationOfNonFunction_proxyOnFunctionClass() async {
-    // 16078
-    Source source = addSource(r'''
-@proxy
-class Functor implements Function {
-  noSuchMethod(inv) {
-    return 42;
-  }
-}
-main() {
-  Functor f = new Functor();
-  f();
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
   test_issue_24191() async {
     Source source = addSource('''
 import 'dart:async';
@@ -4659,15 +4886,6 @@
     verify([source]);
   }
 
-  test_parameterDefaultDoesNotReferToParameterName() async {
-    // The final "f" should refer to the toplevel function "f", not to the
-    // parameter called "f".  See dartbug.com/13179.
-    Source source = addSource('void f([void f([x]) = f]) {}');
-    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.
@@ -4700,7 +4918,7 @@
     verify([source]);
   }
 
-  test_parameterScope_toplevel() async {
+  test_parameterScope_topLevel() async {
     // Parameter names shouldn't conflict with the name of the function they
     // are enclosed in.
     Source source = addSource(r'''
@@ -4756,158 +4974,6 @@
     verify([source]);
   }
 
-  test_proxy_annotation_prefixed() async {
-    Source source = addSource(r'''
-library L;
-@proxy
-class A {}
-f(A 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(A 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(A 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_proxy_annotation_proxyHasPrefixedIdentifier() async {
-    Source source = addSource(r'''
-library L;
-import 'dart:core' as core;
-@core.proxy class PrefixProxy {}
-main() {
-  new PrefixProxy().foo;
-  new PrefixProxy().foo();
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-  }
-
-  test_proxy_annotation_simple() async {
-    Source source = addSource(r'''
-library L;
-@proxy
-class B {
-  m() {
-    n();
-    var x = g;
-    s = 1;
-    var y = this + this;
-  }
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-  }
-
-  test_proxy_annotation_superclass() async {
-    Source source = addSource(r'''
-library L;
-class B extends A {
-  m() {
-    n();
-    var x = g;
-    s = 1;
-    var y = this + this;
-  }
-}
-@proxy
-class A {}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-  }
-
-  test_proxy_annotation_superclass_mixin() async {
-    Source source = addSource(r'''
-library L;
-class B extends Object with A {
-  m() {
-    n();
-    var x = g;
-    s = 1;
-    var y = this + this;
-  }
-}
-@proxy
-class A {}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-  }
-
-  test_proxy_annotation_superinterface() async {
-    Source source = addSource(r'''
-library L;
-class B implements A {
-  m() {
-    n();
-    var x = g;
-    s = 1;
-    var y = this + this;
-  }
-}
-@proxy
-class A {}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-  }
-
-  test_proxy_annotation_superinterface_infiniteLoop() async {
-    addSource(r'''
-library L;
-class C implements A {
-  m() {
-    n();
-    var x = g;
-    s = 1;
-    var y = this + this;
-  }
-}
-class B implements A{}
-class A implements B{}''');
-    // Test is that a stack overflow isn't reached in resolution
-    // (previous line), no need to assert error set.
-  }
-
   test_recursiveConstructorRedirect() async {
     Source source = addSource(r'''
 class A {
@@ -4949,19 +5015,6 @@
     verify([source]);
   }
 
-  test_redirectToInvalidReturnType() async {
-    Source source = addSource(r'''
-class A {
-  A() {}
-}
-class B extends A {
-  factory B() = A;
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
   test_redirectToNonConstConstructor() async {
     Source source = addSource(r'''
 class A {
@@ -5106,18 +5159,6 @@
     verify([source]);
   }
 
-  test_returnOfInvalidType_async_future_int_mismatches_future_null() async {
-    Source source = addSource(r'''
-import 'dart:async';
-Future<Null> f() async {
-  return 5;
-}
-''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
   test_returnOfInvalidType_dynamic() async {
     Source source = addSource(r'''
 class TypeError {}
@@ -5137,18 +5178,6 @@
     verify([source]);
   }
 
-  test_returnOfInvalidType_dynamicAsTypeArgument() async {
-    Source source = addSource(r'''
-class I<T> {
-  factory I() => new A<T>();
-}
-class A<T> implements I {
-}''');
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
   test_returnOfInvalidType_subtype() async {
     Source source = addSource(r'''
 class A {}
@@ -5398,28 +5427,6 @@
     verify([source]);
   }
 
-  test_typeArgumentNotMatchingBounds_typeArgumentList_0() async {
-    Source source = addSource("abstract class A<T extends A>{}");
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_typeArgumentNotMatchingBounds_typeArgumentList_1() async {
-    Source source = addSource("abstract class A<T extends A<A>>{}");
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
-  test_typeArgumentNotMatchingBounds_typeArgumentList_20() async {
-    Source source = addSource(
-        "abstract class A<T extends A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A>>>>>>>>>>>>>>>>>>>>>{}");
-    await computeAnalysisResult(source);
-    assertNoErrors(source);
-    verify([source]);
-  }
-
   test_typePromotion_booleanAnd_useInRight() async {
     Source source = addSource(r'''
 main(Object p) {
diff --git a/pkg/analyzer/test/generated/non_hint_code_kernel_test.dart b/pkg/analyzer/test/generated/non_hint_code_kernel_test.dart
new file mode 100644
index 0000000..8e58a18
--- /dev/null
+++ b/pkg/analyzer/test/generated/non_hint_code_kernel_test.dart
@@ -0,0 +1,37 @@
+// 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 'package:test_reflective_loader/test_reflective_loader.dart';
+
+import 'non_hint_code_driver_test.dart';
+
+main() {
+  defineReflectiveSuite(() {
+    defineReflectiveTests(NonHintCodeTest_Kernel);
+  });
+}
+
+@reflectiveTest
+class NonHintCodeTest_Kernel extends NonHintCodeTest_Driver {
+  @override
+  bool get enableKernelDriver => true;
+
+  @override
+  @failingTest
+  test_deprecatedMemberUse_inDeprecatedLibrary() async {
+    return super.test_deprecatedMemberUse_inDeprecatedLibrary();
+  }
+
+  @override
+  @failingTest
+  test_unusedImport_annotationOnDirective() async {
+    return super.test_unusedImport_annotationOnDirective();
+  }
+
+  @override
+  @failingTest
+  test_unusedImport_metadata() async {
+    return super.test_unusedImport_metadata();
+  }
+}
diff --git a/pkg/analyzer/test/generated/parser_fasta_listener.dart b/pkg/analyzer/test/generated/parser_fasta_listener.dart
index 61b13bf..e0088cd 100644
--- a/pkg/analyzer/test/generated/parser_fasta_listener.dart
+++ b/pkg/analyzer/test/generated/parser_fasta_listener.dart
@@ -7,7 +7,6 @@
     show IdentifierContext;
 import 'package:front_end/src/fasta/parser.dart' as fasta;
 import 'package:front_end/src/fasta/scanner/token.dart' as fasta;
-import 'package:front_end/src/fasta/util/link.dart';
 import 'package:front_end/src/scanner/token.dart';
 import 'package:test/test.dart';
 
@@ -574,10 +573,10 @@
 
   @override
   void endAssert(Token assertKeyword, fasta.Assert kind, Token leftParenthesis,
-      Token commaToken, Token rightParenthesis, Token semicolonToken) {
+      Token commaToken, Token semicolonToken) {
     end('Assert');
-    listener.endAssert(assertKeyword, kind, leftParenthesis, commaToken,
-        rightParenthesis, semicolonToken);
+    listener.endAssert(
+        assertKeyword, kind, leftParenthesis, commaToken, semicolonToken);
   }
 
   @override
@@ -651,10 +650,9 @@
   }
 
   @override
-  void endConditionalUri(
-      Token ifKeyword, Token leftParen, Token equalSign, Token rightParen) {
+  void endConditionalUri(Token ifKeyword, Token leftParen, Token equalSign) {
     end('ConditionalUri');
-    listener.endConditionalUri(ifKeyword, leftParen, equalSign, rightParen);
+    listener.endConditionalUri(ifKeyword, leftParen, equalSign);
   }
 
   @override
@@ -746,11 +744,10 @@
   }
 
   @override
-  void endForIn(Token awaitToken, Token forToken, Token leftParenthesis,
-      Token inKeyword, Token rightParenthesis, Token endToken) {
+  void endForIn(Token awaitToken, Token forToken, Token leftParen,
+      Token inKeyword, Token endToken) {
     end('ForStatement');
-    listener.endForIn(awaitToken, forToken, leftParenthesis, inKeyword,
-        rightParenthesis, endToken);
+    listener.endForIn(awaitToken, forToken, leftParen, inKeyword, endToken);
   }
 
   @override
@@ -1217,6 +1214,13 @@
   }
 
   @override
+  void handleRecoverImport(
+      Token deferredKeyword, Token asKeyword, Token semicolon) {
+    expectIn('CompilationUnit');
+    listener.handleRecoverImport(deferredKeyword, asKeyword, semicolon);
+  }
+
+  @override
   void handleIndexedExpression(
       Token openSquareBracket, Token closeSquareBracket) {
     listener.handleIndexedExpression(openSquareBracket, closeSquareBracket);
@@ -1298,12 +1302,6 @@
   }
 
   @override
-  Link<Token> handleMemberName(Link<Token> identifiers) {
-    return listener.handleMemberName(identifiers);
-    // TODO(danrubel): implement handleMemberName
-  }
-
-  @override
   void handleModifier(Token token) {
     listener.handleModifier(token);
     // TODO(danrubel): implement handleModifier
diff --git a/pkg/analyzer/test/generated/parser_fasta_test.dart b/pkg/analyzer/test/generated/parser_fasta_test.dart
index 24ace2c..2c4f169 100644
--- a/pkg/analyzer/test/generated/parser_fasta_test.dart
+++ b/pkg/analyzer/test/generated/parser_fasta_test.dart
@@ -158,13 +158,6 @@
 
   @override
   @failingTest
-  void test_colonInPlaceOfIn() {
-    // TODO(brianwilkerson) Does not recover.
-    super.test_colonInPlaceOfIn();
-  }
-
-  @override
-  @failingTest
   void test_constAndCovariant() {
     // TODO(brianwilkerson) Does not recover.
     super.test_constAndCovariant();
@@ -356,22 +349,6 @@
 
   @override
   @failingTest
-  void test_directiveAfterDeclaration_classBeforeDirective() {
-    // TODO(brianwilkerson) Wrong errors:
-    // Expected 1 errors of type ParserErrorCode.DIRECTIVE_AFTER_DECLARATION, found 0
-    super.test_directiveAfterDeclaration_classBeforeDirective();
-  }
-
-  @override
-  @failingTest
-  void test_directiveAfterDeclaration_classBetweenDirectives() {
-    // TODO(brianwilkerson) Wrong errors:
-    // Expected 1 errors of type ParserErrorCode.DIRECTIVE_AFTER_DECLARATION, found 0
-    super.test_directiveAfterDeclaration_classBetweenDirectives();
-  }
-
-  @override
-  @failingTest
   void test_duplicatedModifier_const() {
     // TODO(brianwilkerson) Does not recover.
     //   UnimplementedError: Failed to map ConstFieldWithoutInitializer at 12
@@ -595,14 +572,6 @@
 
   @override
   @failingTest
-  void test_expectedExecutable_afterAnnotation_atEOF() {
-    // TODO(danrubel): Exception rather than error:
-    // Expected 1 errors of type ParserErrorCode.EXPECTED_EXECUTABLE, found 0
-    super.test_expectedExecutable_afterAnnotation_atEOF();
-  }
-
-  @override
-  @failingTest
   void test_expectedInterpolationIdentifier() {
     // TODO(brianwilkerson) Does not recover.
     //   RangeError: Value not in range: -1
@@ -691,14 +660,6 @@
 
   @override
   @failingTest
-  void test_expectedToken_semicolonMissingAfterImport() {
-    // TODO(brianwilkerson) Wrong errors:
-    // Expected 1 errors of type ParserErrorCode.EXPECTED_TOKEN, found 0
-    super.test_expectedToken_semicolonMissingAfterImport();
-  }
-
-  @override
-  @failingTest
   void test_expectedToken_whileMissingInDoStatement() {
     // TODO(brianwilkerson) Does not recover.
     //   NoSuchMethodError: Class 'SimpleToken' has no instance getter 'endGroup'.
@@ -740,14 +701,6 @@
 
   @override
   @failingTest
-  void test_exportDirectiveAfterPartDirective() {
-    // TODO(brianwilkerson) Wrong errors:
-    // Expected 1 errors of type ParserErrorCode.EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE, found 0
-    super.test_exportDirectiveAfterPartDirective();
-  }
-
-  @override
-  @failingTest
   void test_externalAfterConst() {
     // TODO(brianwilkerson) Wrong errors:
     // Expected 1 errors of type ParserErrorCode.EXTERNAL_AFTER_CONST, found 0;
@@ -774,15 +727,6 @@
 
   @override
   @failingTest
-  void test_externalClass() {
-    // TODO(brianwilkerson) Wrong errors:
-    // Expected 1 errors of type ParserErrorCode.EXTERNAL_CLASS, found 0;
-    // 0 errors of type ParserErrorCode.EXTRANEOUS_MODIFIER, found 1 (10)
-    super.test_externalClass();
-  }
-
-  @override
-  @failingTest
   void test_externalConstructorWithBody_factory() {
     // TODO(brianwilkerson) Wrong errors:
     // Expected 1 errors of type ParserErrorCode.EXTERNAL_CONSTRUCTOR_WITH_BODY, found 0
@@ -799,15 +743,6 @@
 
   @override
   @failingTest
-  void test_externalEnum() {
-    // TODO(brianwilkerson) Wrong errors:
-    // Expected 1 errors of type ParserErrorCode.EXTERNAL_ENUM, found 0;
-    // 0 errors of type ParserErrorCode.EXTRANEOUS_MODIFIER, found 1 (10)
-    super.test_externalEnum();
-  }
-
-  @override
-  @failingTest
   void test_externalField_const() {
     // TODO(brianwilkerson) Wrong errors:
     // Expected 1 errors of type ParserErrorCode.EXTERNAL_FIELD, found 0;
@@ -877,15 +812,6 @@
 
   @override
   @failingTest
-  void test_externalTypedef() {
-    // TODO(brianwilkerson) Wrong errors:
-    // Expected 1 errors of type ParserErrorCode.EXTERNAL_TYPEDEF, found 0;
-    // 0 errors of type ParserErrorCode.EXTRANEOUS_MODIFIER, found 1 (10)
-    super.test_externalTypedef();
-  }
-
-  @override
-  @failingTest
   void test_extraCommaInParameterList() {
     // TODO(brianwilkerson) Wrong errors:
     // Expected 1 errors of type ParserErrorCode.MISSING_IDENTIFIER, found 0;
@@ -1102,7 +1028,6 @@
     super.test_getterInFunction_expression_returnType();
   }
 
-  @failingTest
   void test_getterNativeWithBody() {
     createParser('String get m native "str" => 0;');
     parser.parseClassMember('C') as MethodDeclaration;
@@ -1120,14 +1045,6 @@
 
   @override
   @failingTest
-  void test_getterWithParameters() {
-    // TODO(brianwilkerson) Wrong errors:
-    // Expected 1 errors of type ParserErrorCode.GETTER_WITH_PARAMETERS, found 0
-    super.test_getterWithParameters();
-  }
-
-  @override
-  @failingTest
   void test_illegalAssignmentToNonAssignable_postfix_minusMinus_literal() {
     // TODO(brianwilkerson) Wrong errors:
     // Expected 1 errors of type ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE, found 0
@@ -1201,14 +1118,6 @@
 
   @override
   @failingTest
-  void test_importDirectiveAfterPartDirective() {
-    // TODO(brianwilkerson) Wrong errors:
-    // Expected 1 errors of type ParserErrorCode.IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE, found 0
-    super.test_importDirectiveAfterPartDirective();
-  }
-
-  @override
-  @failingTest
   void test_initializedVariableInForEach() {
     // TODO(brianwilkerson) Wrong errors:
     // Expected 1 errors of type ParserErrorCode.INITIALIZED_VARIABLE_IN_FOR_EACH, found 0
@@ -1609,22 +1518,6 @@
 
   @override
   @failingTest
-  void test_libraryDirectiveNotFirst() {
-    // TODO(brianwilkerson) Wrong errors:
-    // Expected 1 errors of type ParserErrorCode.LIBRARY_DIRECTIVE_NOT_FIRST, found 0
-    super.test_libraryDirectiveNotFirst();
-  }
-
-  @override
-  @failingTest
-  void test_libraryDirectiveNotFirst_afterPart() {
-    // TODO(brianwilkerson) Wrong errors:
-    // Expected 1 errors of type ParserErrorCode.LIBRARY_DIRECTIVE_NOT_FIRST, found 0
-    super.test_libraryDirectiveNotFirst_afterPart();
-  }
-
-  @override
-  @failingTest
   void test_localFunctionDeclarationModifier_abstract() {
     // TODO(brianwilkerson) Wrong errors:
     // Expected 1 errors of type ParserErrorCode.LOCAL_FUNCTION_DECLARATION_MODIFIER, found 0
@@ -2119,14 +2012,6 @@
 
   @override
   @failingTest
-  void test_missingPrefixInDeferredImport() {
-    // TODO(brianwilkerson) Wrong errors:
-    // Expected 1 errors of type ParserErrorCode.MISSING_PREFIX_IN_DEFERRED_IMPORT, found 0
-    super.test_missingPrefixInDeferredImport();
-  }
-
-  @override
-  @failingTest
   void test_missingStartAfterSync() {
     // TODO(brianwilkerson) Does not recover.
     //   Expected: an object with length of <1>
@@ -2280,14 +2165,6 @@
 
   @override
   @failingTest
-  void test_multiplePartOfDirectives() {
-    // TODO(brianwilkerson) Wrong errors:
-    // Expected 1 errors of type ParserErrorCode.MULTIPLE_PART_OF_DIRECTIVES, found 0
-    super.test_multiplePartOfDirectives();
-  }
-
-  @override
-  @failingTest
   void test_multiplePositionalParameterGroups() {
     // TODO(brianwilkerson) Wrong errors:
     // Expected 1 errors of type ParserErrorCode.MULTIPLE_POSITIONAL_PARAMETER_GROUPS, found 0
@@ -2404,22 +2281,6 @@
 
   @override
   @failingTest
-  void test_nonPartOfDirectiveInPart_after() {
-    // TODO(brianwilkerson) Wrong errors:
-    // Expected 1 errors of type ParserErrorCode.NON_PART_OF_DIRECTIVE_IN_PART, found 0
-    super.test_nonPartOfDirectiveInPart_after();
-  }
-
-  @override
-  @failingTest
-  void test_nonPartOfDirectiveInPart_before() {
-    // TODO(brianwilkerson) Wrong errors:
-    // Expected 1 errors of type ParserErrorCode.NON_PART_OF_DIRECTIVE_IN_PART, found 0
-    super.test_nonPartOfDirectiveInPart_before();
-  }
-
-  @override
-  @failingTest
   void test_nonUserDefinableOperator() {
     // TODO(brianwilkerson) Does not recover.
     //   type 'SimpleIdentifierImpl' is not a subtype of type 'TypeAnnotation' of 'returnType' where
@@ -4213,14 +4074,6 @@
 
   @override
   @failingTest
-  void test_declarationBeforeDirective() {
-    // TODO(brianwilkerson) Wrong errors:
-    // Expected 1 errors of type ParserErrorCode.DIRECTIVE_AFTER_DECLARATION, found 0
-    super.test_declarationBeforeDirective();
-  }
-
-  @override
-  @failingTest
   void test_equalityExpression_missing_LHS() {
     // TODO(brianwilkerson) reportUnrecoverableErrorWithToken
     super.test_equalityExpression_missing_LHS();
@@ -4307,27 +4160,6 @@
 
   @override
   @failingTest
-  void test_importDirectivePartial_as() {
-    // TODO(brianwilkerson) reportUnrecoverableErrorWithToken
-    super.test_importDirectivePartial_as();
-  }
-
-  @override
-  @failingTest
-  void test_importDirectivePartial_hide() {
-    // TODO(brianwilkerson) reportUnrecoverableErrorWithToken
-    super.test_importDirectivePartial_hide();
-  }
-
-  @override
-  @failingTest
-  void test_importDirectivePartial_show() {
-    // TODO(brianwilkerson) reportUnrecoverableErrorWithToken
-    super.test_importDirectivePartial_show();
-  }
-
-  @override
-  @failingTest
   void test_incomplete_conditionalExpression() {
     // TODO(brianwilkerson) reportUnrecoverableErrorWithToken
     super.test_incomplete_conditionalExpression();
diff --git a/pkg/analyzer/test/generated/parser_test.dart b/pkg/analyzer/test/generated/parser_test.dart
index 59ae905..4cac612 100644
--- a/pkg/analyzer/test/generated/parser_test.dart
+++ b/pkg/analyzer/test/generated/parser_test.dart
@@ -2550,8 +2550,11 @@
   }
 
   void test_directiveAfterDeclaration_classBeforeDirective() {
-    CompilationUnit unit = parseCompilationUnit("class Foo{} library l;",
-        [ParserErrorCode.DIRECTIVE_AFTER_DECLARATION]);
+    CompilationUnit unit = parseCompilationUnit(
+        "class Foo{} library l;",
+        usingFastaParser
+            ? [ParserErrorCode.LIBRARY_DIRECTIVE_NOT_FIRST]
+            : [ParserErrorCode.DIRECTIVE_AFTER_DECLARATION]);
     expect(unit, isNotNull);
   }
 
diff --git a/pkg/analyzer/test/generated/resolver_kernel_test.dart b/pkg/analyzer/test/generated/resolver_kernel_test.dart
new file mode 100644
index 0000000..7708e36
--- /dev/null
+++ b/pkg/analyzer/test/generated/resolver_kernel_test.dart
@@ -0,0 +1,56 @@
+// Copyright (c) 2
+// 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_reflective_loader/test_reflective_loader.dart';
+
+import 'resolver_driver_test.dart';
+
+main() {
+  defineReflectiveSuite(() {
+    defineReflectiveTests(StrictModeTest_Kernel);
+    defineReflectiveTests(TypePropagationTest_Kernel);
+  });
+}
+
+@reflectiveTest
+class StrictModeTest_Kernel extends StrictModeTest_Driver {
+  @override
+  bool get enableKernelDriver => true;
+}
+
+@reflectiveTest
+class TypePropagationTest_Kernel extends TypePropagationTest_Driver {
+  @override
+  bool get enableKernelDriver => true;
+
+  @override
+  @failingTest
+  test_assignment_throwExpression() async {
+    return super.test_assignment_throwExpression();
+  }
+
+  @override
+  @failingTest
+  test_CanvasElement_getContext() async {
+    return super.test_CanvasElement_getContext();
+  }
+
+  @override
+  @failingTest
+  test_initializer_dereference() async {
+    return super.test_initializer_dereference();
+  }
+
+  @override
+  @failingTest
+  test_objectMethodInference_disabled_for_library_prefix() async {
+    return super.test_objectMethodInference_disabled_for_library_prefix();
+  }
+
+  @override
+  @failingTest
+  test_query() async {
+    return super.test_query();
+  }
+}
diff --git a/pkg/analyzer/test/generated/resolver_test_case.dart b/pkg/analyzer/test/generated/resolver_test_case.dart
index a45894a..1ab670c 100644
--- a/pkg/analyzer/test/generated/resolver_test_case.dart
+++ b/pkg/analyzer/test/generated/resolver_test_case.dart
@@ -341,10 +341,15 @@
 
   AnalysisContext get analysisContext => analysisContext2;
 
-  bool get enableNewAnalysisDriver => false;
+  /**
+   * The default [AnalysisOptions] that should be used by [reset].
+   */
+  AnalysisOptions get defaultAnalysisOptions => new AnalysisOptionsImpl();
 
   bool get enableKernelDriver => false;
 
+  bool get enableNewAnalysisDriver => false;
+
   /**
    * Return a type provider that can be used to test the results of resolution.
    *
@@ -626,6 +631,7 @@
   Expression findTopLevelConstantExpression(
           CompilationUnit compilationUnit, String name) =>
       findTopLevelDeclaration(compilationUnit, name).initializer;
+
   VariableDeclaration findTopLevelDeclaration(
       CompilationUnit compilationUnit, String name) {
     for (CompilationUnitMember member in compilationUnit.declarations) {
@@ -657,7 +663,7 @@
       fail('Only packages or options can be specified.');
     }
     if (enableNewAnalysisDriver) {
-      options ??= new AnalysisOptionsImpl();
+      options ??= defaultAnalysisOptions;
       DartSdk sdk = new MockSdk(resourceProvider: resourceProvider)
         ..context.analysisOptions = options;
 
diff --git a/pkg/analyzer/test/generated/source_factory_test.dart b/pkg/analyzer/test/generated/source_factory_test.dart
index 3fb5f2a..78c9c9d 100644
--- a/pkg/analyzer/test/generated/source_factory_test.dart
+++ b/pkg/analyzer/test/generated/source_factory_test.dart
@@ -10,7 +10,6 @@
 import 'package:analyzer/file_system/memory_file_system.dart';
 import 'package:analyzer/source/package_map_resolver.dart';
 import 'package:analyzer/src/generated/engine.dart' show AnalysisEngine, Logger;
-import 'package:analyzer/src/generated/java_engine_io.dart';
 import 'package:analyzer/src/generated/source.dart';
 import 'package:analyzer/src/generated/source_io.dart';
 import 'package:analyzer/src/generated/utilities_dart.dart' as utils;
@@ -91,43 +90,37 @@
     return factory.restoreUri(source);
   }
 
+  String _p(String path) => resourceProvider.convertPath(path);
+
+  Uri _u(String path) => resourceProvider.pathContext.toUri(_p(path));
+
   group('SourceFactoryTest', () {
     group('package mapping', () {
       group('resolveUri', () {
         test('URI in mapping', () {
           String uri = resolvePackageUri(config: '''
-unittest:file:///home/somebody/.pub/cache/unittest-0.9.9/lib/
-async:file:///home/somebody/.pub/cache/async-1.1.0/lib/
-quiver:file:///home/somebody/.pub/cache/quiver-1.2.1/lib
+unittest:${_u('/home/somebody/.pub/cache/unittest-0.9.9/lib/')}
+async:${_u('/home/somebody/.pub/cache/async-1.1.0/lib/')}
+quiver:${_u('/home/somebody/.pub/cache/quiver-1.2.1/lib')}
 ''', uri: 'package:unittest/unittest.dart');
           expect(
               uri,
-              equals(
-                  '/home/somebody/.pub/cache/unittest-0.9.9/lib/unittest.dart'));
-        });
-        test('URI in mapping (no scheme)', () {
-          String uri = resolvePackageUri(config: '''
-unittest:/home/somebody/.pub/cache/unittest-0.9.9/lib/
-async:/home/somebody/.pub/cache/async-1.1.0/lib/
-quiver:/home/somebody/.pub/cache/quiver-1.2.1/lib
-''', uri: 'package:unittest/unittest.dart');
-          expect(
-              uri,
-              equals(
-                  '/home/somebody/.pub/cache/unittest-0.9.9/lib/unittest.dart'));
+              equals(_p(
+                  '/home/somebody/.pub/cache/unittest-0.9.9/lib/unittest.dart')));
         });
         test('URI not in mapping', () {
-          String uri = resolvePackageUri(
-              config: 'unittest:/home/somebody/.pub/cache/unittest-0.9.9/lib/',
-              uri: 'package:foo/foo.dart');
+          String uri = resolvePackageUri(config: '''
+unittest:${_u('/home/somebody/.pub/cache/unittest-0.9.9/lib/')}
+async:${_u('/home/somebody/.pub/cache/async-1.1.0/lib/')}
+quiver:${_u('/home/somebody/.pub/cache/quiver-1.2.1/lib')}
+''', uri: 'package:foo/foo.dart');
           expect(uri, isNull);
         });
         test('Non-package URI', () {
           var testResolver = new CustomUriResolver(uriPath: 'test_uri');
-          String uri = resolvePackageUri(
-              config: 'unittest:/home/somebody/.pub/cache/unittest-0.9.9/lib/',
-              uri: 'custom:custom.dart',
-              customResolver: testResolver);
+          String uri = resolvePackageUri(config: '''
+unittest:${_u('/home/somebody/.pub/cache/unittest-0.9.9/lib/')}
+''', uri: 'custom:custom.dart', customResolver: testResolver);
           expect(uri, testResolver.uriPath);
         });
         test('Bad package URI', () {
@@ -150,22 +143,22 @@
         });
         test('Relative URIs', () {
           Source containingSource = createSource(
-              path: '/foo/bar/baz/foo.dart', uri: 'package:foo/foo.dart');
+              path: _p('/foo/bar/baz/foo.dart'), uri: 'package:foo/foo.dart');
           String uri = resolvePackageUri(
-              config: 'foo:/foo/bar/baz',
+              config: 'foo:${_u('/foo/bar/baz')}',
               uri: 'bar.dart',
               containingSource: containingSource);
           expect(uri, isNotNull);
-          expect(uri, equals('/foo/bar/baz/bar.dart'));
+          expect(uri, equals(_p('/foo/bar/baz/bar.dart')));
         });
       });
       group('restoreUri', () {
         test('URI in mapping', () {
           Uri uri = restorePackageUri(
               config: '''
-unittest:/home/somebody/.pub/cache/unittest-0.9.9/lib/
-async:/home/somebody/.pub/cache/async-1.1.0/lib/
-quiver:/home/somebody/.pub/cache/quiver-1.2.1/lib
+unittest:${_u('/home/somebody/.pub/cache/unittest-0.9.9/lib/')}
+async:${_u('/home/somebody/.pub/cache/async-1.1.0/lib/')}
+quiver:${_u('/home/somebody/.pub/cache/quiver-1.2.1/lib')}
 ''',
               source: new FileSource(resourceProvider.getFile(
                   '/home/somebody/.pub/cache/unittest-0.9.9/lib/unittest.dart')));
@@ -176,7 +169,7 @@
       group('packageMap', () {
         test('non-file URIs filtered', () {
           Map<String, List<Folder>> map = getPackageMap('''
-quiver:/home/somebody/.pub/cache/quiver-1.2.1/lib
+quiver:${_u('/home/somebody/.pub/cache/quiver-1.2.1/lib')}
 foo:http://www.google.com
 ''');
           expect(map.keys, unorderedEquals(['quiver']));
@@ -260,22 +253,23 @@
   void test_resolveUri_nonAbsolute_absolute() {
     SourceFactory factory =
         new SourceFactory([new AbsoluteUriResolver(resourceProvider)]);
-    String absolutePath = "/does/not/matter.dart";
-    Source containingSource =
-        new FileSource(resourceProvider.getFile("/does/not/exist.dart"));
-    Source result = factory.resolveUri(containingSource, absolutePath);
-    expect(result.fullName,
-        FileUtilities2.createFile(absolutePath).getAbsolutePath());
+    String sourcePath = resourceProvider.convertPath('/does/not/exist.dart');
+    String targetRawPath = '/does/not/matter.dart';
+    String targetPath = resourceProvider.convertPath(targetRawPath);
+    String targetUri =
+        resourceProvider.pathContext.toUri(targetRawPath).toString();
+    Source sourceSource = new FileSource(resourceProvider.getFile(sourcePath));
+    Source result = factory.resolveUri(sourceSource, targetUri);
+    expect(result.fullName, targetPath);
   }
 
   void test_resolveUri_nonAbsolute_relative() {
     SourceFactory factory =
         new SourceFactory([new AbsoluteUriResolver(resourceProvider)]);
-    Source containingSource =
-        new FileSource(resourceProvider.getFile("/does/not/have.dart"));
-    Source result = factory.resolveUri(containingSource, "exist.dart");
-    expect(result.fullName,
-        FileUtilities2.createFile("/does/not/exist.dart").getAbsolutePath());
+    String path = _p('/does/not/have.dart');
+    Source containingSource = new FileSource(resourceProvider.getFile(path));
+    Source result = factory.resolveUri(containingSource, 'exist.dart');
+    expect(result.fullName, _p('/does/not/exist.dart'));
   }
 
   void test_resolveUri_nonAbsolute_relative_package() {
@@ -318,6 +312,11 @@
     expect(factory.restoreUri(source1), same(expected1));
     expect(factory.restoreUri(source2), same(null));
   }
+
+  /**
+   * Return the [resourceProvider] specific path for the given Posix [path].
+   */
+  String _p(String path) => resourceProvider.convertPath(path);
 }
 
 class UriResolver_absolute extends UriResolver {
diff --git a/pkg/analyzer/test/generated/static_type_analyzer_kernel_test.dart b/pkg/analyzer/test/generated/static_type_analyzer_kernel_test.dart
new file mode 100644
index 0000000..08a3bc0
--- /dev/null
+++ b/pkg/analyzer/test/generated/static_type_analyzer_kernel_test.dart
@@ -0,0 +1,19 @@
+// 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 'package:test_reflective_loader/test_reflective_loader.dart';
+
+import 'static_type_analyzer_driver_test.dart';
+
+main() {
+  defineReflectiveSuite(() {
+    defineReflectiveTests(StaticTypeAnalyzer2Test_Kernel);
+  });
+}
+
+@reflectiveTest
+class StaticTypeAnalyzer2Test_Kernel extends StaticTypeAnalyzer2Test_Driver {
+  @override
+  bool get enableKernelDriver => true;
+}
diff --git a/pkg/analyzer/test/generated/static_type_warning_code_kernel_test.dart b/pkg/analyzer/test/generated/static_type_warning_code_kernel_test.dart
new file mode 100644
index 0000000..a0b3282
--- /dev/null
+++ b/pkg/analyzer/test/generated/static_type_warning_code_kernel_test.dart
@@ -0,0 +1,52 @@
+// 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 'package:test_reflective_loader/test_reflective_loader.dart';
+
+import 'static_type_warning_code_driver_test.dart';
+
+main() {
+  defineReflectiveSuite(() {
+    defineReflectiveTests(StaticTypeWarningCodeTest_Kernel);
+    defineReflectiveTests(StrongModeStaticTypeWarningCodeTest_Kernel);
+  });
+}
+
+@reflectiveTest
+class StaticTypeWarningCodeTest_Kernel
+    extends StaticTypeWarningCodeTest_Driver {
+  @override
+  bool get enableKernelDriver => true;
+
+  @override
+  @failingTest
+  test_typeArgumentNotMatchingBounds_redirectingConstructor() async {
+    return super.test_typeArgumentNotMatchingBounds_redirectingConstructor();
+  }
+
+  @override
+  @failingTest
+  test_undefinedGetter_wrongNumberOfTypeArguments_tooLittle() async {
+    return super.test_undefinedGetter_wrongNumberOfTypeArguments_tooLittle();
+  }
+
+  @override
+  @failingTest
+  test_undefinedGetter_wrongNumberOfTypeArguments_tooMany() async {
+    return super.test_undefinedGetter_wrongNumberOfTypeArguments_tooMany();
+  }
+
+  @override
+  @failingTest
+  test_undefinedMethodWithConstructor() async {
+    return super.test_undefinedMethodWithConstructor();
+  }
+}
+
+@reflectiveTest
+class StrongModeStaticTypeWarningCodeTest_Kernel
+    extends StrongModeStaticTypeWarningCodeTest_Driver {
+  @override
+  bool get enableKernelDriver => true;
+}
diff --git a/pkg/analyzer/test/generated/static_warning_code_kernel_test.dart b/pkg/analyzer/test/generated/static_warning_code_kernel_test.dart
new file mode 100644
index 0000000..d9c2f4d
--- /dev/null
+++ b/pkg/analyzer/test/generated/static_warning_code_kernel_test.dart
@@ -0,0 +1,123 @@
+// 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 'package:test_reflective_loader/test_reflective_loader.dart';
+
+import 'static_warning_code_driver_test.dart';
+
+main() {
+  defineReflectiveSuite(() {
+    defineReflectiveTests(StaticWarningCodeTest_Kernel);
+  });
+}
+
+@reflectiveTest
+class StaticWarningCodeTest_Kernel extends StaticWarningCodeTest_Driver {
+  @override
+  bool get enableKernelDriver => true;
+
+  @override
+  @failingTest
+  test_ambiguousImport_inPart() async {
+    return super.test_ambiguousImport_inPart();
+  }
+
+  @override
+  @failingTest
+  test_argumentTypeNotAssignable_annotation_namedConstructor() async {
+    return super.test_argumentTypeNotAssignable_annotation_namedConstructor();
+  }
+
+  @override
+  @failingTest
+  test_caseBlockNotTerminated() async {
+    return super.test_caseBlockNotTerminated();
+  }
+
+  @override
+  @failingTest
+  test_constWithAbstractClass() async {
+    return super.test_constWithAbstractClass();
+  }
+
+  @override
+  @failingTest
+  test_fieldInitializedInInitializerAndDeclaration_final() async {
+    return super.test_fieldInitializedInInitializerAndDeclaration_final();
+  }
+
+  @override
+  @failingTest
+  test_finalInitializedInDeclarationAndConstructor_initializers() async {
+    return super
+        .test_finalInitializedInDeclarationAndConstructor_initializers();
+  }
+
+  @override
+  @failingTest
+  test_finalInitializedInDeclarationAndConstructor_initializingFormal() async {
+    return super
+        .test_finalInitializedInDeclarationAndConstructor_initializingFormal();
+  }
+
+  @override
+  @failingTest
+  test_finalNotInitialized_inConstructor_1() async {
+    return super.test_finalNotInitialized_inConstructor_1();
+  }
+
+  @override
+  @failingTest
+  test_finalNotInitialized_inConstructor_2() async {
+    return super.test_finalNotInitialized_inConstructor_2();
+  }
+
+  @override
+  @failingTest
+  test_finalNotInitialized_inConstructor_3() async {
+    return super.test_finalNotInitialized_inConstructor_3();
+  }
+
+  @override
+  @failingTest
+  test_importOfNonLibrary() async {
+    return super.test_importOfNonLibrary();
+  }
+
+  @override
+  @failingTest
+  test_invalidOverride_nonDefaultOverridesDefault() async {
+    return super.test_invalidOverride_nonDefaultOverridesDefault();
+  }
+
+  @override
+  @failingTest
+  test_invalidOverride_nonDefaultOverridesDefault_named() async {
+    return super.test_invalidOverride_nonDefaultOverridesDefault_named();
+  }
+
+  @override
+  @failingTest
+  test_newWithAbstractClass() async {
+    return super.test_newWithAbstractClass();
+  }
+
+  @override
+  @failingTest
+  test_newWithUndefinedConstructorDefault() async {
+    return super.test_newWithUndefinedConstructorDefault();
+  }
+
+  @override
+  @failingTest
+  test_notEnoughRequiredArguments_getterReturningFunction() async {
+    return super.test_notEnoughRequiredArguments_getterReturningFunction();
+  }
+
+  @override
+  @failingTest
+  test_redirectToMissingConstructor_unnamed() async {
+    return super.test_redirectToMissingConstructor_unnamed();
+  }
+}
diff --git a/pkg/analyzer/test/generated/strong_mode_kernel_test.dart b/pkg/analyzer/test/generated/strong_mode_kernel_test.dart
new file mode 100644
index 0000000..81496d1
--- /dev/null
+++ b/pkg/analyzer/test/generated/strong_mode_kernel_test.dart
@@ -0,0 +1,204 @@
+// 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 'package:test_reflective_loader/test_reflective_loader.dart';
+
+import 'strong_mode_driver_test.dart';
+
+main() {
+  defineReflectiveSuite(() {
+    defineReflectiveTests(StrongModeLocalInferenceTest_Kernel);
+    defineReflectiveTests(StrongModeStaticTypeAnalyzer2Test_Kernel);
+    defineReflectiveTests(StrongModeTypePropagationTest_Kernel);
+  });
+}
+
+@reflectiveTest
+class StrongModeLocalInferenceTest_Kernel
+    extends StrongModeLocalInferenceTest_Driver {
+  @override
+  bool get enableKernelDriver => true;
+
+  @override
+  @failingTest
+  test_async_star_method_propagation() async {
+    return super.test_async_star_method_propagation();
+  }
+
+  @override
+  @failingTest
+  test_async_star_propagation() async {
+    return super.test_async_star_propagation();
+  }
+
+  @override
+  @failingTest
+  test_covarianceChecks_returnFunction() async {
+    return super.test_covarianceChecks_returnFunction();
+  }
+
+  @override
+  @failingTest
+  test_factoryConstructor_propagation() async {
+    return super.test_factoryConstructor_propagation();
+  }
+
+  @override
+  @failingTest
+  test_futureOr_assignFromFuture() async {
+    return super.test_futureOr_assignFromFuture();
+  }
+
+  @override
+  @failingTest
+  test_futureOr_downwards1() async {
+    return super.test_futureOr_downwards1();
+  }
+
+  @override
+  @failingTest
+  test_futureOr_downwards2() async {
+    return super.test_futureOr_downwards2();
+  }
+
+  @override
+  @failingTest
+  test_futureOr_downwards3() async {
+    return super.test_futureOr_downwards3();
+  }
+
+  @override
+  @failingTest
+  test_futureOr_downwards4() async {
+    return super.test_futureOr_downwards4();
+  }
+
+  @override
+  @failingTest
+  test_futureOr_downwards5() async {
+    return super.test_futureOr_downwards5();
+  }
+
+  @override
+  @failingTest
+  test_futureOr_downwards6() async {
+    return super.test_futureOr_downwards6();
+  }
+
+  @override
+  @failingTest
+  test_futureOr_downwards7() async {
+    return super.test_futureOr_downwards7();
+  }
+
+  @override
+  @failingTest
+  test_futureOr_downwards8() async {
+    return super.test_futureOr_downwards8();
+  }
+
+  @override
+  @failingTest
+  test_futureOr_upwards1() async {
+    return super.test_futureOr_upwards1();
+  }
+
+  @override
+  @failingTest
+  test_futureOr_upwards2() async {
+    return super.test_futureOr_upwards2();
+  }
+
+  @override
+  @failingTest
+  test_generic_partial() async {
+    return super.test_generic_partial();
+  }
+
+  @override
+  @failingTest
+  test_instanceCreation() async {
+    return super.test_instanceCreation();
+  }
+
+  @override
+  @failingTest
+  test_redirectingConstructor_propagation() async {
+    return super.test_redirectingConstructor_propagation();
+  }
+}
+
+@reflectiveTest
+class StrongModeStaticTypeAnalyzer2Test_Kernel
+    extends StrongModeStaticTypeAnalyzer2Test_Driver {
+  @override
+  bool get enableKernelDriver => true;
+
+  @override
+  @failingTest
+  test_instantiateToBounds_class_error_recursion() async {
+    return super.test_instantiateToBounds_class_error_recursion();
+  }
+
+  @override
+  @failingTest
+  test_instantiateToBounds_class_error_recursion_self() async {
+    return super.test_instantiateToBounds_class_error_recursion_self();
+  }
+
+  @override
+  @failingTest
+  test_instantiateToBounds_class_error_recursion_self2() async {
+    return super.test_instantiateToBounds_class_error_recursion_self2();
+  }
+
+  @override
+  @failingTest
+  test_instantiateToBounds_class_error_typedef() async {
+    return super.test_instantiateToBounds_class_error_typedef();
+  }
+
+  @override
+  @failingTest
+  test_instantiateToBounds_class_ok_implicitDynamic_multi() async {
+    return super.test_instantiateToBounds_class_ok_implicitDynamic_multi();
+  }
+
+  @override
+  @failingTest
+  test_instantiateToBounds_class_ok_referenceOther_after() async {
+    return super.test_instantiateToBounds_class_ok_referenceOther_after();
+  }
+
+  @override
+  @failingTest
+  test_instantiateToBounds_class_ok_referenceOther_after2() async {
+    return super.test_instantiateToBounds_class_ok_referenceOther_after2();
+  }
+
+  @override
+  @failingTest
+  test_instantiateToBounds_class_ok_referenceOther_before() async {
+    return super.test_instantiateToBounds_class_ok_referenceOther_before();
+  }
+
+  @override
+  @failingTest
+  test_instantiateToBounds_class_ok_referenceOther_multi() async {
+    return super.test_instantiateToBounds_class_ok_referenceOther_multi();
+  }
+
+  @override
+  @failingTest
+  test_notInstantiatedBound_functionType() async {
+    return super.test_notInstantiatedBound_functionType();
+  }
+}
+
+@reflectiveTest
+class StrongModeTypePropagationTest_Kernel
+    extends StrongModeTypePropagationTest_Driver {
+  @override
+  bool get enableKernelDriver => true;
+}
diff --git a/pkg/analyzer/test/generated/test_all.dart b/pkg/analyzer/test/generated/test_all.dart
index 99c2991..280c550 100644
--- a/pkg/analyzer/test/generated/test_all.dart
+++ b/pkg/analyzer/test/generated/test_all.dart
@@ -8,16 +8,21 @@
 import 'bazel_test.dart' as bazel_test;
 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_kernel_test.dart'
+    as checked_mode_compile_time_error_code_kernel_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_kernel_test.dart'
+    as compile_time_error_code_kernel_test;
 import 'compile_time_error_code_test.dart' as compile_time_error_code_test;
 import 'constant_test.dart' as constant_test;
 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_kernel_test.dart' as error_suppression_kernel_test;
 import 'error_suppression_test.dart' as error_suppression_test;
 import 'gn_test.dart' as gn_test;
 import 'hint_code_driver_test.dart' as hint_code_driver_test;
@@ -29,11 +34,13 @@
 import 'non_error_resolver_kernel_test.dart' as non_error_resolver_kernel_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_kernel_test.dart' as non_hint_code_kernel_test;
 import 'non_hint_code_test.dart' as non_hint_code_test;
 import 'package_test.dart' as package_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;
+import 'resolver_kernel_test.dart' as resolver_kernel_test;
 import 'resolver_test.dart' as resolver_test;
 import 'scanner_test.dart' as scanner_test;
 import 'sdk_test.dart' as sdk_test;
@@ -41,14 +48,21 @@
 import 'source_factory_test.dart' as source_factory_test;
 import 'static_type_analyzer_driver_test.dart'
     as static_type_analyzer_driver_test;
+import 'static_type_analyzer_kernel_test.dart'
+    as static_type_analyzer_kernel_test;
 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_kernel_test.dart'
+    as static_type_warning_code_kernel_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_kernel_test.dart'
+    as static_warning_code_kernel_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_kernel_test.dart' as strong_mode_kernel_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;
@@ -59,14 +73,17 @@
     all_the_rest.main();
     bazel_test.main();
     checked_mode_compile_time_error_code_driver_test.main();
+    checked_mode_compile_time_error_code_kernel_test.main();
     checked_mode_compile_time_error_code_test.main();
     compile_time_error_code_driver_test.main();
+    compile_time_error_code_kernel_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_kernel_test.main();
     error_suppression_test.main();
     gn_test.main();
     hint_code_driver_test.main();
@@ -78,23 +95,29 @@
     non_error_resolver_kernel_test.main();
     non_error_resolver_test.main();
     non_hint_code_driver_test.main();
+    non_hint_code_kernel_test.main();
     non_hint_code_test.main();
     package_test.main();
     parser_fasta_test.main();
     parser_test.main();
     resolver_driver_test.main();
+    resolver_kernel_test.main();
     resolver_test.main();
     scanner_test.main();
     sdk_test.main();
     simple_resolver_test.main();
     source_factory_test.main();
     static_type_analyzer_driver_test.main();
+    static_type_analyzer_kernel_test.main();
     static_type_analyzer_test.main();
     static_type_warning_code_driver_test.main();
+    static_type_warning_code_kernel_test.main();
     static_type_warning_code_test.main();
     static_warning_code_driver_test.main();
+    static_warning_code_kernel_test.main();
     static_warning_code_test.main();
     strong_mode_driver_test.main();
+    strong_mode_kernel_test.main();
     strong_mode_test.main();
     type_system_test.main();
     utilities_dart_test.main();
diff --git a/pkg/analyzer/test/src/context/mock_sdk.dart b/pkg/analyzer/test/src/context/mock_sdk.dart
index 79514ad..43ff846 100644
--- a/pkg/analyzer/test/src/context/mock_sdk.dart
+++ b/pkg/analyzer/test/src/context/mock_sdk.dart
@@ -43,9 +43,9 @@
   factory Future.delayed(Duration duration, [T computation()]) => null;
   factory Future.value([FutureOr<T> result]) => null;
 
-  static Future<List/*<T>*/> wait/*<T>*/(
-      Iterable<Future/*<T>*/> futures) => null;
-  Future/*<R>*/ then/*<R>*/(FutureOr/*<R>*/ onValue(T value)) => null;
+  static Future<List<T>> wait<T>(
+      Iterable<Future<T>> futures) => null;
+  Future<R> then<R>(FutureOr<R> onValue(T value)) => null;
 
   Future<T> whenComplete(action());
 }
@@ -70,7 +70,7 @@
                                  void onDone(),
                                  bool cancelOnError});
   Stream();
-  factory Stream.fromIterable(Iterable<T> data);
+  factory Stream.fromIterable(Iterable<T> data) => null;
 }
 
 abstract class StreamSubscription<T> {
@@ -124,9 +124,11 @@
 class StackTrace {}
 
 class Symbol {
-  const factory Symbol(String name) {
-    return null;
-  }
+  const factory Symbol(String name) = _SymbolImpl;
+}
+
+class _SymbolImpl {
+  const _SymbolImpl(String name);
 }
 
 class Type {}
@@ -256,15 +258,15 @@
   bool get isEmpty;
   E get first;
 
-  Iterable/*<R>*/ map/*<R>*/(/*=R*/ f(E e));
+  Iterable<R> map<R>(R f(E e));
 
-  /*=R*/ fold/*<R>*/(/*=R*/ initialValue,
-      /*=R*/ combine(/*=R*/ previousValue, E element)) => null;
+  R fold<R>(R initialValue,
+      R combine(R previousValue, E element)) => null;
 
-  Iterable/*<T>*/ expand/*<T>*/(Iterable/*<T>*/ f(E element));
+  Iterable<T> expand<T>(Iterable<T> f(E element));
 
   Iterable<E> where(bool test(E element));
-  
+
   void forEach(void f(E element));
 
   List<E> toList();
@@ -369,6 +371,16 @@
 library dart._interceptors;
 ''');
 
+const _MockSdkLibrary _LIB_INTERNAL = const _MockSdkLibrary(
+    'dart:_internal', '$sdkRoot/lib/_internal/internal.dart', '''
+library dart._internal;
+class Symbol {}
+class ExternalName {
+  final String name;
+  const ExternalName(this.name);
+}
+''');
+
 const _MockSdkLibrary _LIB_MATH =
     const _MockSdkLibrary('dart:math', '$sdkRoot/lib/math/math.dart', '''
 library dart.math;
@@ -400,6 +412,7 @@
   _LIB_HTML_DART2JS,
   _LIB_HTML_DARTIUM,
   _LIB_INTERCEPTORS,
+  _LIB_INTERNAL,
 ];
 
 class MockSdk implements DartSdk {
@@ -413,6 +426,7 @@
     "dart:_foreign_helper": "$sdkRoot/lib/_foreign_helper/_foreign_helper.dart",
     "dart:_interceptors":
         "$sdkRoot/lib/_internal/js_runtime/lib/interceptors.dart",
+    "dart:_internal": "$sdkRoot/lib/_internal/internal.dart",
     "dart:math": "$sdkRoot/lib/math/math.dart"
   };
 
diff --git a/pkg/analyzer/test/src/dart/analysis/driver_test.dart b/pkg/analyzer/test/src/dart/analysis/driver_test.dart
index fb5e28c..8129dd2 100644
--- a/pkg/analyzer/test/src/dart/analysis/driver_test.dart
+++ b/pkg/analyzer/test/src/dart/analysis/driver_test.dart
@@ -358,6 +358,13 @@
     expect(driver.addedFiles, isNot(contains(b)));
   }
 
+  test_addFile_notAbsolutePath() async {
+    try {
+      driver.addFile('not_absolute.dart');
+      fail('ArgumentError expected.');
+    } on ArgumentError {}
+  }
+
   test_addFile_shouldRefresh() async {
     var a = _p('/test/lib/a.dart');
     var b = _p('/test/lib/b.dart');
@@ -796,6 +803,13 @@
     }
   }
 
+  test_changeFile_notAbsolutePath() async {
+    try {
+      driver.changeFile('not_absolute.dart');
+      fail('ArgumentError expected.');
+    } on ArgumentError {}
+  }
+
   test_changeFile_notUsed() async {
     var a = _p('/test/lib/a.dart');
     var b = _p('/other/b.dart');
@@ -1177,6 +1191,13 @@
     expect(result.errors, hasLength(1));
   }
 
+  test_getErrors_notAbsolutePath() async {
+    try {
+      await driver.getErrors('not_absolute.dart');
+      fail('ArgumentError expected.');
+    } on ArgumentError {}
+  }
+
   test_getFilesDefiningClassMemberName() async {
     var a = _p('/test/bin/a.dart');
     var b = _p('/test/bin/b.dart');
@@ -1251,6 +1272,13 @@
     expect(fooId, isNonNegative);
   }
 
+  test_getIndex_notAbsolutePath() async {
+    try {
+      await driver.getIndex('not_absolute.dart');
+      fail('ArgumentError expected.');
+    } on ArgumentError {}
+  }
+
   test_getLibraryByUri_external_resynthesize() async {
     provider.newFile(testFile, r'''
 class Test {}
@@ -1653,6 +1681,13 @@
     await driver.getResult(testFile);
   }
 
+  test_getResult_notAbsolutePath() async {
+    try {
+      await driver.getResult('not_absolute.dart');
+      fail('ArgumentError expected.');
+    } on ArgumentError {}
+  }
+
   test_getResult_notDartFile() async {
     var path = _p('/test/lib/test.txt');
     provider.newFile(path, 'class A {}');
@@ -1782,6 +1817,13 @@
     expect(await driver.getSourceKind(path), SourceKind.LIBRARY);
   }
 
+  test_getSourceKind_notAbsolutePath() async {
+    try {
+      await driver.getSourceKind('not_absolute.dart');
+      fail('ArgumentError expected.');
+    } on ArgumentError {}
+  }
+
   test_getSourceKind_notDartFile() async {
     var path = _p('/test/lib/test.txt');
     provider.newFile(path, 'class A {}');
@@ -1874,6 +1916,13 @@
         unorderedEquals(['foo', 'main']));
   }
 
+  test_getUnitElement_notAbsolutePath() async {
+    try {
+      await driver.getUnitElement('not_absolute.dart');
+      fail('ArgumentError expected.');
+    } on ArgumentError {}
+  }
+
   test_getUnitElement_notDart() async {
     var path = _p('/test.txt');
     provider.newFile(path, 'class A {}');
@@ -2038,6 +2087,13 @@
     expect(driver.knownFiles, isNot(contains(b)));
   }
 
+  test_parseFile_notAbsolutePath() async {
+    try {
+      await driver.parseFile('not_absolute.dart');
+      fail('ArgumentError expected.');
+    } on ArgumentError {}
+  }
+
   test_parseFile_notDart() async {
     var p = _p('/test/bin/a.txt');
     provider.newFile(p, 'class A {}');
@@ -2441,6 +2497,13 @@
     allResults.clear();
   }
 
+  test_removeFile_notAbsolutePath() async {
+    try {
+      driver.removeFile('not_absolute.dart');
+      fail('ArgumentError expected.');
+    } on ArgumentError {}
+  }
+
   test_results_order() async {
     var a = _p('/test/lib/a.dart');
     var b = _p('/test/lib/b.dart');
diff --git a/pkg/analyzer/test/src/fasta/recovery/code_order_test.dart b/pkg/analyzer/test/src/fasta/recovery/code_order_test.dart
index 1142ac0..ed80a57 100644
--- a/pkg/analyzer/test/src/fasta/recovery/code_order_test.dart
+++ b/pkg/analyzer/test/src/fasta/recovery/code_order_test.dart
@@ -98,9 +98,17 @@
  */
 @reflectiveTest
 class CompilationUnitMemberTest extends AbstractRecoveryTest {
-  @failingTest
-  void test_declarationBeforeDirective() {
-    // Expected 1 errors of type ParserErrorCode.DIRECTIVE_AFTER_DECLARATION, found 0
+  void test_declarationBeforeDirective_export() {
+    testRecovery('''
+class C { }
+export 'bar.dart';
+''', [ParserErrorCode.DIRECTIVE_AFTER_DECLARATION], '''
+export 'bar.dart';
+class C { }
+''');
+  }
+
+  void test_declarationBeforeDirective_import() {
     testRecovery('''
 class C { }
 import 'bar.dart';
@@ -110,9 +118,27 @@
 ''');
   }
 
-  @failingTest
+  void test_declarationBeforeDirective_part() {
+    testRecovery('''
+class C { }
+part 'bar.dart';
+''', [ParserErrorCode.DIRECTIVE_AFTER_DECLARATION], '''
+part 'bar.dart';
+class C { }
+''');
+  }
+
+  void test_declarationBeforeDirective_part_of() {
+    testRecovery('''
+class C { }
+part of foo;
+''', [ParserErrorCode.DIRECTIVE_AFTER_DECLARATION], '''
+part of foo;
+class C { }
+''');
+  }
+
   void test_exportBeforeLibrary() {
-    // Expected 1 errors of type ParserErrorCode.LIBRARY_DIRECTIVE_NOT_FIRST, found 0
     testRecovery('''
 export 'bar.dart';
 library l;
@@ -122,9 +148,7 @@
 ''');
   }
 
-  @failingTest
   void test_importBeforeLibrary() {
-    // Expected 1 errors of type ParserErrorCode.LIBRARY_DIRECTIVE_NOT_FIRST, found 0
     testRecovery('''
 import 'bar.dart';
 library l;
@@ -134,9 +158,7 @@
 ''');
   }
 
-  @failingTest
   void test_partBeforeExport() {
-    // Expected 1 errors of type ParserErrorCode.EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE, found 0
     testRecovery('''
 part 'foo.dart';
 export 'bar.dart';
@@ -146,9 +168,7 @@
 ''');
   }
 
-  @failingTest
   void test_partBeforeImport() {
-    // Expected 1 errors of type ParserErrorCode.IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE, found 0
     testRecovery('''
 part 'foo.dart';
 import 'bar.dart';
@@ -158,9 +178,7 @@
 ''');
   }
 
-  @failingTest
   void test_partBeforeLibrary() {
-    // Expected 1 errors of type ParserErrorCode.LIBRARY_DIRECTIVE_NOT_FIRST, found 0
     testRecovery('''
 part 'foo.dart';
 library l;
@@ -177,23 +195,75 @@
  */
 @reflectiveTest
 class ImportDirectiveTest extends AbstractRecoveryTest {
-  @failingTest
   void test_combinatorsBeforeAndAfterPrefix() {
-    // Parser crashes
     testRecovery('''
 import 'bar.dart' show A as p show B;
-''', [/*ParserErrorCode.PREFIX_AFTER_COMBINATOR*/], '''
+''', [ParserErrorCode.PREFIX_AFTER_COMBINATOR], '''
 import 'bar.dart' as p show A show B;
 ''');
   }
 
-  @failingTest
   void test_combinatorsBeforePrefix() {
-    // Parser crashes
     testRecovery('''
 import 'bar.dart' show A as p;
-''', [/*ParserErrorCode.PREFIX_AFTER_COMBINATOR*/], '''
+''', [ParserErrorCode.PREFIX_AFTER_COMBINATOR], '''
 import 'bar.dart' as p show A;
 ''');
   }
+
+  void test_combinatorsBeforePrefixAfterDeferred() {
+    testRecovery('''
+import 'bar.dart' deferred show A as p;
+''', [ParserErrorCode.PREFIX_AFTER_COMBINATOR], '''
+import 'bar.dart' deferred as p show A;
+''');
+  }
+
+  void test_deferredAfterPrefix() {
+    // TODO(danrubel): Add a new error messages for this situation
+    // indicating that `deferred` should be moved before `as`.
+    testRecovery('''
+import 'bar.dart' as p deferred;
+''', [ParserErrorCode.MISSING_PREFIX_IN_DEFERRED_IMPORT], '''
+import 'bar.dart' deferred as p;
+''');
+  }
+
+  void test_duplicatePrefix() {
+    testRecovery('''
+import 'bar.dart' as p as q;
+''', [ParserErrorCode.DUPLICATE_PREFIX], '''
+import 'bar.dart' as p;
+''');
+  }
+
+  void test_unknownTokenBeforePrefix() {
+    testRecovery('''
+import 'bar.dart' d as p;
+''', [ParserErrorCode.UNEXPECTED_TOKEN], '''
+import 'bar.dart' as p;
+''');
+  }
+
+  void test_unknownTokenBeforePrefixAfterDeferred() {
+    testRecovery('''
+import 'bar.dart' deferred s as p;
+''', [ParserErrorCode.UNEXPECTED_TOKEN], '''
+import 'bar.dart' deferred as p;
+''');
+  }
+
+  void test_unknownTokenBeforePrefixAfterCombinatorMissingSemicolon() {
+    testRecovery('''
+import 'bar.dart' d show A as p
+import 'b.dart';
+''', [
+      ParserErrorCode.UNEXPECTED_TOKEN,
+      ParserErrorCode.PREFIX_AFTER_COMBINATOR,
+      ParserErrorCode.EXPECTED_TOKEN
+    ], '''
+import 'bar.dart' as p show A;
+import 'b.dart';
+''');
+  }
 }
diff --git a/pkg/analyzer/test/src/fasta/recovery/extra_code_test.dart b/pkg/analyzer/test/src/fasta/recovery/extra_code_test.dart
index 19cff05..ac6d3fd 100644
--- a/pkg/analyzer/test/src/fasta/recovery/extra_code_test.dart
+++ b/pkg/analyzer/test/src/fasta/recovery/extra_code_test.dart
@@ -28,6 +28,14 @@
 class B = Object with A;
 ''');
   }
+
+  void test_getter_parameters() {
+    testRecovery('''
+int get g() => 0;
+''', [ParserErrorCode.GETTER_WITH_PARAMETERS], '''
+int get g => 0;
+''');
+  }
 }
 
 /**
diff --git a/pkg/analyzer/test/src/fasta/recovery/missing_code_test.dart b/pkg/analyzer/test/src/fasta/recovery/missing_code_test.dart
index 0ca2a9f..6f55537 100644
--- a/pkg/analyzer/test/src/fasta/recovery/missing_code_test.dart
+++ b/pkg/analyzer/test/src/fasta/recovery/missing_code_test.dart
@@ -10,6 +10,7 @@
 main() {
   defineReflectiveSuite(() {
     defineReflectiveTests(MissingCodeTest);
+    defineReflectiveTests(ParameterListTest);
   });
 }
 
@@ -296,3 +297,267 @@
 ''');
   }
 }
+
+/**
+ * Test how well the parser recovers when tokens are missing in a parameter
+ * list.
+ */
+@reflectiveTest
+class ParameterListTest extends AbstractRecoveryTest {
+  @failingTest
+  void test_extraComma_named_last() {
+    testRecovery('''
+f({a, }) {}
+''', [ParserErrorCode.MISSING_IDENTIFIER], '''
+f({a, _s_}) {}
+''');
+  }
+
+  @failingTest
+  void test_extraComma_named_noLast() {
+    testRecovery('''
+f({a, , b}) {}
+''', [ParserErrorCode.MISSING_IDENTIFIER], '''
+f({a, _s_, b}) {}
+''');
+  }
+
+  @failingTest
+  void test_extraComma_positional_last() {
+    testRecovery('''
+f([a, ]) {}
+''', [ParserErrorCode.MISSING_IDENTIFIER], '''
+f([a, _s_]) {}
+''');
+  }
+
+  @failingTest
+  void test_extraComma_positional_noLast() {
+    testRecovery('''
+f([a, , b]) {}
+''', [ParserErrorCode.MISSING_IDENTIFIER], '''
+f([a, _s_, b]) {}
+''');
+  }
+
+  @failingTest
+  void test_extraComma_required_last() {
+    testRecovery('''
+f(a, ) {}
+''', [ParserErrorCode.MISSING_IDENTIFIER], '''
+f(a, _s_) {}
+''');
+  }
+
+  @failingTest
+  void test_extraComma_required_noLast() {
+    testRecovery('''
+f(a, , b) {}
+''', [ParserErrorCode.MISSING_IDENTIFIER], '''
+f(a, _s_, b) {}
+''');
+  }
+
+  void test_fieldFormalParameter_noPeriod_last() {
+    testRecovery('''
+class C {
+  int f;
+  C(this);
+}
+''', [ParserErrorCode.UNEXPECTED_TOKEN, ParserErrorCode.MISSING_IDENTIFIER], '''
+class C {
+  int f;
+  C(this._s_);
+}
+''');
+  }
+
+  void test_fieldFormalParameter_noPeriod_notLast() {
+    testRecovery('''
+class C {
+  int f;
+  C(this, p);
+}
+''', [ParserErrorCode.UNEXPECTED_TOKEN, ParserErrorCode.MISSING_IDENTIFIER], '''
+class C {
+  int f;
+  C(this._s_, p);
+}
+''');
+  }
+
+  void test_fieldFormalParameter_period_last() {
+    testRecovery('''
+class C {
+  int f;
+  C(this.);
+}
+''', [ParserErrorCode.MISSING_IDENTIFIER], '''
+class C {
+  int f;
+  C(this._s_);
+}
+''');
+  }
+
+  void test_fieldFormalParameter_period_notLast() {
+    testRecovery('''
+class C {
+  int f;
+  C(this., p);
+}
+''', [ParserErrorCode.MISSING_IDENTIFIER], '''
+class C {
+  int f;
+  C(this._s_, p);
+}
+''');
+  }
+
+  @failingTest
+  void test_incorrectlyTerminatedGroup_named_none() {
+    testRecovery('''
+f({a: 0) {}
+''', [ParserErrorCode.MISSING_TERMINATOR_FOR_PARAMETER_GROUP], '''
+f({a: 0}) {}
+''');
+  }
+
+  @failingTest
+  void test_incorrectlyTerminatedGroup_named_positional() {
+    testRecovery('''
+f({a: 0]) {}
+''', [ParserErrorCode.WRONG_TERMINATOR_FOR_PARAMETER_GROUP], '''
+f({a: 0}) {}
+''');
+  }
+
+  @failingTest
+  void test_incorrectlyTerminatedGroup_none_named() {
+    testRecovery('''
+f(a}) {}
+''', [ParserErrorCode.UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP], '''
+f(a) {}
+''');
+  }
+
+  @failingTest
+  void test_incorrectlyTerminatedGroup_none_positional() {
+    testRecovery('''
+f(a]) {}
+''', [ParserErrorCode.UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP], '''
+f(a) {}
+''');
+  }
+
+  @failingTest
+  void test_incorrectlyTerminatedGroup_positional_named() {
+    testRecovery('''
+f([a = 0}) {}
+''', [ParserErrorCode.WRONG_TERMINATOR_FOR_PARAMETER_GROUP], '''
+f([a = 0]) {}
+''');
+  }
+
+  @failingTest
+  void test_incorrectlyTerminatedGroup_positional_none() {
+    // Maybe put in paired_tokens_test.dart.
+    testRecovery('''
+f([a = 0) {}
+''', [ParserErrorCode.MISSING_TERMINATOR_FOR_PARAMETER_GROUP], '''
+f([a = 0]) {}
+''');
+  }
+
+  @failingTest
+  void test_missingDefault_named_last() {
+    testRecovery('''
+f({a: }) {}
+''', [ParserErrorCode.MISSING_IDENTIFIER], '''
+f({a: _s_}) {}
+''');
+  }
+
+  @failingTest
+  void test_missingDefault_named_notLast() {
+    testRecovery('''
+f({a, b: }) {}
+''', [ParserErrorCode.MISSING_IDENTIFIER], '''
+f({a, b: _s_}) {}
+''');
+  }
+
+  @failingTest
+  void test_missingDefault_positional_last() {
+    testRecovery('''
+f([a = ]) {}
+''', [ParserErrorCode.MISSING_IDENTIFIER], '''
+f([a = _s_]) {}
+''');
+  }
+
+  @failingTest
+  void test_missingDefault_positional_notLast() {
+    testRecovery('''
+f([a, b = ]) {}
+''', [ParserErrorCode.MISSING_IDENTIFIER], '''
+f([a, b = _s_]) {}
+''');
+  }
+
+  @failingTest
+  void test_multipleGroups_mixed() {
+    // TODO(brianwilkerson) Figure out the best way to recover from this.
+    testRecovery('''
+f([a = 0], {b: 1}) {}
+''', [ParserErrorCode.MIXED_PARAMETER_GROUPS], '''
+f([a = 0]) {}
+''');
+  }
+
+  @failingTest
+  void test_multipleGroups_mixedAndMultiple() {
+    // TODO(brianwilkerson) Figure out the best way to recover from this.
+    testRecovery('''
+f([a = 0], {b: 1}, [c = 2]) {}
+''', [ParserErrorCode.MIXED_PARAMETER_GROUPS], '''
+f([a = 0, c = 2]) {}
+''');
+  }
+
+  @failingTest
+  void test_multipleGroups_named() {
+    testRecovery('''
+f({a: 0}, {b: 1}) {}
+''', [ParserErrorCode.MULTIPLE_NAMED_PARAMETER_GROUPS], '''
+f({a: 0, b: 1}) {}
+''');
+  }
+
+  @failingTest
+  void test_multipleGroups_positional() {
+    testRecovery('''
+f([a = 0], [b = 1]) {}
+''', [ParserErrorCode.MULTIPLE_POSITIONAL_PARAMETER_GROUPS], '''
+f([a = 0, b = 1]) {}
+''');
+  }
+
+  @failingTest
+  void test_namedOutsideGroup() {
+    testRecovery('''
+f(a: 0) {}
+''', [ParserErrorCode.NAMED_PARAMETER_OUTSIDE_GROUP], '''
+f({a: 0}) {}
+''');
+  }
+
+  @failingTest
+  void test_positionalOutsideGroup() {
+    testRecovery('''
+f(a = 0) {}
+''', [ParserErrorCode.POSITIONAL_PARAMETER_OUTSIDE_GROUP], '''
+f([a = 0]) {}
+''');
+  }
+}
diff --git a/pkg/analyzer/test/src/summary/element_text.dart b/pkg/analyzer/test/src/summary/element_text.dart
index eee6836..46cf716 100644
--- a/pkg/analyzer/test/src/summary/element_text.dart
+++ b/pkg/analyzer/test/src/summary/element_text.dart
@@ -280,6 +280,8 @@
 
     if (e == null) {
       buffer.write('<null>');
+    } else if (e is SimpleIdentifier && e.name == '#invalidConst') {
+      buffer.write('#invalidConst');
     } else if (e is Annotation) {
       buffer.write('@');
       writeExpression(e.name);
diff --git a/pkg/analyzer/test/src/summary/resynthesize_common.dart b/pkg/analyzer/test/src/summary/resynthesize_common.dart
index 0abaeb3..a253ff0 100644
--- a/pkg/analyzer/test/src/summary/resynthesize_common.dart
+++ b/pkg/analyzer/test/src/summary/resynthesize_common.dart
@@ -2471,7 +2471,16 @@
 }
 int foo() => 42;
 ''', allowErrors: true);
-    if (isStrongMode) {
+    if (isSharedFrontEnd) {
+      // It is OK to keep non-constant initializers.
+      checkElementText(library, r'''
+class C {
+  static const int f = 1 +
+        foo/*location: test.dart;foo*/();
+}
+int foo() {}
+''');
+    } else if (isStrongMode) {
       checkElementText(library, r'''
 class C {
   static const int f;
@@ -2528,7 +2537,14 @@
 const v = 1 + foo();
 int foo() => 42;
 ''', allowErrors: true);
-    if (isStrongMode) {
+    if (isSharedFrontEnd) {
+      // It is OK to keep non-constant initializers.
+      checkElementText(library, r'''
+const int v = 1 +
+        foo/*location: test.dart;foo*/();
+int foo() {}
+''');
+    } else if (isStrongMode) {
       checkElementText(library, r'''
 const int v;
 int foo() {}
@@ -2836,41 +2852,44 @@
   }
 
   test_const_invokeConstructor_named_unresolved() async {
+    shouldCompareLibraryElements = false;
     var library = await checkLibrary(r'''
 class C {}
 const V = const C.named();
 ''', allowErrors: true);
-    if (isStrongMode) {
+    if (isSharedFrontEnd) {
       checkElementText(library, r'''
 class C {
 }
-const C V = const
-        C/*location: test.dart;C*/.
-        named/*location: null*/();
+const dynamic V = #invalidConst;
+''');
+    } else if (isStrongMode) {
+      checkElementText(library, r'''
+class C {
+}
+const C V = #invalidConst;
 ''');
     } else {
       checkElementText(library, r'''
 class C {
 }
-const dynamic V = const
-        C/*location: test.dart;C*/.
-        named/*location: null*/();
+const dynamic V = #invalidConst;
 ''');
     }
   }
 
   test_const_invokeConstructor_named_unresolved2() async {
+    shouldCompareLibraryElements = false;
     var library = await checkLibrary(r'''
 const V = const C.named();
 ''', allowErrors: true);
     checkElementText(library, r'''
-const dynamic V = const
-        C/*location: null*/.
-        named/*location: null*/();
+const dynamic V = #invalidConst;
 ''');
   }
 
   test_const_invokeConstructor_named_unresolved3() async {
+    shouldCompareLibraryElements = false;
     addLibrarySource('/a.dart', r'''
 class C {
 }
@@ -2879,26 +2898,26 @@
 import 'a.dart' as p;
 const V = const p.C.named();
 ''', allowErrors: true);
-    if (isStrongMode) {
+    if (isSharedFrontEnd) {
       checkElementText(library, r'''
 import 'a.dart' as p;
-const C V = const
-        p/*location: test.dart;p*/.
-        C/*location: a.dart;C*/.
-        named/*location: null*/();
+const dynamic V = #invalidConst;
+''');
+    } else if (isStrongMode) {
+      checkElementText(library, r'''
+import 'a.dart' as p;
+const C V = #invalidConst;
 ''');
     } else {
       checkElementText(library, r'''
 import 'a.dart' as p;
-const dynamic V = const
-        p/*location: test.dart;p*/.
-        C/*location: a.dart;C*/.
-        named/*location: null*/();
+const dynamic V = #invalidConst;
 ''');
     }
   }
 
   test_const_invokeConstructor_named_unresolved4() async {
+    shouldCompareLibraryElements = false;
     addLibrarySource('/a.dart', '');
     var library = await checkLibrary(r'''
 import 'a.dart' as p;
@@ -2906,45 +2925,43 @@
 ''', allowErrors: true);
     checkElementText(library, r'''
 import 'a.dart' as p;
-const dynamic V = const
-        p/*location: test.dart;p*/.
-        C/*location: null*/.
-        named/*location: null*/();
+const dynamic V = #invalidConst;
 ''');
   }
 
   test_const_invokeConstructor_named_unresolved5() async {
+    shouldCompareLibraryElements = false;
     var library = await checkLibrary(r'''
 const V = const p.C.named();
 ''', allowErrors: true);
     checkElementText(library, r'''
-const dynamic V = const
-        p/*location: null*/.
-        C/*location: null*/.
-        named/*location: null*/();
+const dynamic V = #invalidConst;
 ''');
   }
 
   test_const_invokeConstructor_named_unresolved6() async {
+    shouldCompareLibraryElements = false;
     var library = await checkLibrary(r'''
 class C<T> {}
 const V = const C.named();
 ''', allowErrors: true);
-    if (isStrongMode) {
+    if (isSharedFrontEnd) {
       checkElementText(library, r'''
 class C<T> {
 }
-const C<dynamic> V = const
-        C/*location: test.dart;C*/.
-        named/*location: null*/();
+const dynamic V = #invalidConst;
+''');
+    } else if (isStrongMode) {
+      checkElementText(library, r'''
+class C<T> {
+}
+const C<dynamic> V = #invalidConst;
 ''');
     } else {
       checkElementText(library, r'''
 class C<T> {
 }
-const dynamic V = const
-        C/*location: test.dart;C*/.
-        named/*location: null*/();
+const dynamic V = #invalidConst;
 ''');
     }
   }
@@ -3026,12 +3043,12 @@
   }
 
   test_const_invokeConstructor_unnamed_unresolved() async {
+    shouldCompareLibraryElements = false;
     var library = await checkLibrary(r'''
 const V = const C();
 ''', allowErrors: true);
     checkElementText(library, r'''
-const dynamic V = const
-        C/*location: null*/();
+const dynamic V = #invalidConst;
 ''');
   }
 
@@ -3044,20 +3061,17 @@
 ''', allowErrors: true);
     checkElementText(library, r'''
 import 'a.dart' as p;
-const dynamic V = const
-        p/*location: test.dart;p*/.
-        C/*location: null*/();
+const dynamic V = #invalidConst;
 ''');
   }
 
   test_const_invokeConstructor_unnamed_unresolved3() async {
+    shouldCompareLibraryElements = false;
     var library = await checkLibrary(r'''
 const V = const p.C();
 ''', allowErrors: true);
     checkElementText(library, r'''
-const dynamic V = const
-        p/*location: null*/.
-        C/*location: null*/();
+const dynamic V = #invalidConst;
 ''');
   }
 
@@ -3133,17 +3147,10 @@
 const v = 'abc'.length;
 ''');
     if (isStrongMode) {
-      if (isSharedFrontEnd) {
-        checkElementText(library, r'''
+      checkElementText(library, r'''
 const int v = 'abc'.
         length/*location: dart:core;String;length?*/;
 ''');
-      } else {
-        checkElementText(library, r'''
-const int v = 'abc'.
-        length/*location: dart:core;String;length?*/;
-''');
-      }
     } else {
       checkElementText(library, r'''
 const dynamic v = 'abc'.
@@ -3158,21 +3165,12 @@
 const v = S.length;
 ''');
     if (isStrongMode) {
-      if (isSharedFrontEnd) {
-        checkElementText(library, r'''
+      checkElementText(library, r'''
 const String S = 'abc';
 const int v =
         S/*location: test.dart;S?*/.
         length/*location: dart:core;String;length?*/;
 ''');
-      } else {
-        checkElementText(library, r'''
-const String S = 'abc';
-const int v =
-        S/*location: test.dart;S?*/.
-        length/*location: dart:core;String;length?*/;
-''');
-      }
     } else {
       checkElementText(library, r'''
 const String S = 'abc';
@@ -3910,43 +3908,40 @@
   }
 
   test_const_reference_unresolved_prefix0() async {
+    shouldCompareLibraryElements = false;
     var library = await checkLibrary(r'''
 const V = foo;
 ''', allowErrors: true);
     checkElementText(library, r'''
-const dynamic V =
-        foo/*location: null*/;
+const dynamic V = #invalidConst;
 ''');
   }
 
   test_const_reference_unresolved_prefix1() async {
+    shouldCompareLibraryElements = false;
     var library = await checkLibrary(r'''
 class C {}
-const v = C.foo;
+const V = C.foo;
 ''', allowErrors: true);
     checkElementText(library, r'''
 class C {
 }
-const dynamic v =
-        C/*location: test.dart;C*/.
-        foo/*location: null*/;
+const dynamic V = #invalidConst;
 ''');
   }
 
   test_const_reference_unresolved_prefix2() async {
+    shouldCompareLibraryElements = false;
     addLibrarySource('/foo.dart', '''
 class C {}
 ''');
     var library = await checkLibrary(r'''
 import 'foo.dart' as p;
-const v = p.C.foo;
+const V = p.C.foo;
 ''', allowErrors: true);
     checkElementText(library, r'''
 import 'foo.dart' as p;
-const dynamic v =
-        p/*location: test.dart;p*/.
-        C/*location: foo.dart;C*/.
-        foo/*location: null*/;
+const dynamic V = #invalidConst;
 ''');
   }
 
@@ -4151,20 +4146,22 @@
   }
 
   test_const_topLevel_super() async {
+    shouldCompareLibraryElements = false;
     var library = await checkLibrary(r'''
 const vSuper = super;
 ''');
     checkElementText(library, r'''
-const dynamic vSuper = super;
+const dynamic vSuper = #invalidConst;
 ''');
   }
 
   test_const_topLevel_this() async {
+    shouldCompareLibraryElements = false;
     var library = await checkLibrary(r'''
 const vThis = this;
 ''');
     checkElementText(library, r'''
-const dynamic vThis = this;
+const dynamic vThis = #invalidConst;
 ''');
   }
 
@@ -4525,7 +4522,19 @@
 }
 int foo() => 42;
 ''', allowErrors: true);
-    checkElementText(library, r'''
+    if (isSharedFrontEnd) {
+      // It is OK to keep non-constant initializers.
+      checkElementText(library, r'''
+class C {
+  final dynamic x;
+  const C() :
+        x/*location: test.dart;C;x*/ =
+        foo/*location: test.dart;foo*/();
+}
+int foo() {}
+''');
+    } else {
+      checkElementText(library, r'''
 class C {
   final dynamic x;
   const C() :
@@ -4533,6 +4542,7 @@
 }
 int foo() {}
 ''');
+    }
   }
 
   test_constructor_initializers_field_withParameter() async {
@@ -6432,8 +6442,7 @@
 import '';
 ''');
     checkElementText(library, r'''
-@
-        foo/*location: null*/
+@#invalidConst
 import '<unresolved>';
 ''');
   }
@@ -7229,6 +7238,7 @@
   }
 
   test_invalid_nameConflict_imported() async {
+    shouldCompareLibraryElements = false;
     namesThatCannotBeResolved.add('V');
     addLibrarySource('/a.dart', 'V() {}');
     addLibrarySource('/b.dart', 'V() {}');
@@ -7240,12 +7250,12 @@
     checkElementText(library, r'''
 import 'a.dart';
 import 'b.dart';
-dynamic foo([dynamic p =
-        V/*location: null*/]) {}
+dynamic foo([dynamic p = #invalidConst]) {}
 ''');
   }
 
   test_invalid_nameConflict_imported_exported() async {
+    shouldCompareLibraryElements = false;
     namesThatCannotBeResolved.add('V');
     addLibrarySource('/a.dart', 'V() {}');
     addLibrarySource('/b.dart', 'V() {}');
@@ -7259,12 +7269,12 @@
 ''');
     checkElementText(library, r'''
 import 'c.dart';
-dynamic foo([dynamic p =
-        V/*location: null*/]) {}
+dynamic foo([dynamic p = #invalidConst]) {}
 ''');
   }
 
   test_invalid_nameConflict_local() async {
+    shouldCompareLibraryElements = false;
     namesThatCannotBeResolved.add('V');
     var library = await checkLibrary('''
 foo([p = V]) {}
@@ -7273,8 +7283,7 @@
 ''');
     checkElementText(library, r'''
 dynamic V;
-dynamic foo([dynamic p =
-        V/*location: null*/]) {}
+dynamic foo([dynamic p = #invalidConst]) {}
 dynamic V() {}
 ''');
   }
@@ -8858,45 +8867,30 @@
 
   test_syntheticFunctionType_genericClosure() async {
     if (!isStrongMode) {
-      // The test below uses generic comment syntax because proper generic
-      // method syntax doesn't support generic closures.  So it can only run in
-      // strong mode.
-      // TODO(paulberry): once proper generic method syntax supports generic
-      // closures, rewrite the test below without using generic comment syntax,
-      // and remove this hack.  See dartbug.com/25819
       return;
     }
     var library = await checkLibrary('''
-final v = f() ? /*<T>*/(T t) => 0 : /*<T>*/(T t) => 1;
+final v = f() ? <T>(T t) => 0 : <T>(T t) => 1;
 bool f() => true;
 ''');
     checkElementText(library, r'''
+final (<bottom>) → int v;
+bool f() {}
 ''');
   }
 
   test_syntheticFunctionType_genericClosure_inGenericFunction() async {
     if (!isStrongMode) {
-      // The test below uses generic comment syntax because proper generic
-      // method syntax doesn't support generic closures.  So it can only run in
-      // strong mode.
-      // TODO(paulberry): once proper generic method syntax supports generic
-      // closures, rewrite the test below without using generic comment syntax,
-      // and remove this hack.  See dartbug.com/25819
       return;
     }
     var library = await checkLibrary('''
 void f<T, U>(bool b) {
-  final v = b ? /*<V>*/(T t, U u, V v) => 0 : /*<V>*/(T t, U u, V v) => 1;
+  final v = b ? <V>(T t, U u, V v) => 0 : <V>(T t, U u, V v) => 1;
 }
 ''');
-    if (isStrongMode) {
-      checkElementText(library, r'''
+    checkElementText(library, r'''
 void f<T, U>(bool b) {}
 ''');
-    } else {
-      checkElementText(library, r'''
-''');
-    }
   }
 
   test_syntheticFunctionType_inGenericClass() async {
@@ -8908,9 +8902,10 @@
 ''');
     if (isStrongMode) {
       checkElementText(library, r'''
-class C {
-  synthetic C();
+class C<T, U> {
+  (T, U) → int v;
 }
+bool f() {}
 ''');
     } else {
       checkElementText(library, r'''
@@ -8940,6 +8935,8 @@
 ''');
     if (isStrongMode) {
       checkElementText(library, r'''
+final () → int v;
+bool f() {}
 ''');
     } else {
       checkElementText(library, r'''
@@ -8956,6 +8953,8 @@
 ''');
     if (isStrongMode) {
       checkElementText(library, r'''
+final (int, String) → int v;
+bool f() {}
 ''');
     } else {
       checkElementText(library, r'''
@@ -9575,6 +9574,7 @@
   }
 
   test_unresolved_annotation_instanceCreation_argument_this() async {
+    shouldCompareLibraryElements = false;
     var library = await checkLibrary('''
 class A {
   const A(_);
@@ -9587,146 +9587,133 @@
 class A {
   const A(dynamic _);
 }
-@
-        A/*location: test.dart;A*/(this)
+@#invalidConst
 class C {
 }
 ''');
   }
 
   test_unresolved_annotation_namedConstructorCall_noClass() async {
+    shouldCompareLibraryElements = false;
     var library =
         await checkLibrary('@foo.bar() class C {}', allowErrors: true);
     checkElementText(library, r'''
-@
-        foo/*location: null*/.
-        bar/*location: null*/()
+@#invalidConst
 class C {
 }
 ''');
   }
 
   test_unresolved_annotation_namedConstructorCall_noConstructor() async {
+    shouldCompareLibraryElements = false;
     var library =
         await checkLibrary('@String.foo() class C {}', allowErrors: true);
     checkElementText(library, r'''
-@
-        String/*location: dart:core;String*/.
-        foo/*location: null*/()
+@#invalidConst
 class C {
 }
 ''');
   }
 
   test_unresolved_annotation_prefixedIdentifier_badPrefix() async {
+    shouldCompareLibraryElements = false;
     var library = await checkLibrary('@foo.bar class C {}', allowErrors: true);
     checkElementText(library, r'''
-@
-        foo/*location: null*/.
-        bar/*location: null*/
+@#invalidConst
 class C {
 }
 ''');
   }
 
   test_unresolved_annotation_prefixedIdentifier_noDeclaration() async {
+    shouldCompareLibraryElements = false;
     var library = await checkLibrary(
         'import "dart:async" as foo; @foo.bar class C {}',
         allowErrors: true);
     checkElementText(library, r'''
 import 'dart:async' as foo;
-@
-        foo/*location: test.dart;foo*/.
-        bar/*location: null*/
+@#invalidConst
 class C {
 }
 ''');
   }
 
   test_unresolved_annotation_prefixedNamedConstructorCall_badPrefix() async {
+    shouldCompareLibraryElements = false;
     var library =
         await checkLibrary('@foo.bar.baz() class C {}', allowErrors: true);
     checkElementText(library, r'''
-@
-        foo/*location: null*/.
-        bar/*location: null*/.
-        baz/*location: null*/()
+@#invalidConst
 class C {
 }
 ''');
   }
 
   test_unresolved_annotation_prefixedNamedConstructorCall_noClass() async {
+    shouldCompareLibraryElements = false;
     var library = await checkLibrary(
         'import "dart:async" as foo; @foo.bar.baz() class C {}',
         allowErrors: true);
     checkElementText(library, r'''
 import 'dart:async' as foo;
-@
-        foo/*location: test.dart;foo*/.
-        bar/*location: null*/.
-        baz/*location: null*/()
+@#invalidConst
 class C {
 }
 ''');
   }
 
   test_unresolved_annotation_prefixedNamedConstructorCall_noConstructor() async {
+    shouldCompareLibraryElements = false;
     var library = await checkLibrary(
         'import "dart:async" as foo; @foo.Future.bar() class C {}',
         allowErrors: true);
     checkElementText(library, r'''
 import 'dart:async' as foo;
-@
-        foo/*location: test.dart;foo*/.
-        Future/*location: dart:async;Future*/.
-        bar/*location: null*/()
+@#invalidConst
 class C {
 }
 ''');
   }
 
   test_unresolved_annotation_prefixedUnnamedConstructorCall_badPrefix() async {
+    shouldCompareLibraryElements = false;
     var library =
         await checkLibrary('@foo.bar() class C {}', allowErrors: true);
     checkElementText(library, r'''
-@
-        foo/*location: null*/.
-        bar/*location: null*/()
+@#invalidConst
 class C {
 }
 ''');
   }
 
   test_unresolved_annotation_prefixedUnnamedConstructorCall_noClass() async {
+    shouldCompareLibraryElements = false;
     var library = await checkLibrary(
         'import "dart:async" as foo; @foo.bar() class C {}',
         allowErrors: true);
     checkElementText(library, r'''
 import 'dart:async' as foo;
-@
-        foo/*location: test.dart;foo*/.
-        bar/*location: null*/()
+@#invalidConst
 class C {
 }
 ''');
   }
 
   test_unresolved_annotation_simpleIdentifier() async {
+    shouldCompareLibraryElements = false;
     var library = await checkLibrary('@foo class C {}', allowErrors: true);
     checkElementText(library, r'''
-@
-        foo/*location: null*/
+@#invalidConst
 class C {
 }
 ''');
   }
 
   test_unresolved_annotation_unnamedConstructorCall_noClass() async {
+    shouldCompareLibraryElements = false;
     var library = await checkLibrary('@foo() class C {}', allowErrors: true);
     checkElementText(library, r'''
-@
-        foo/*location: null*/()
+@#invalidConst
 class C {
 }
 ''');
diff --git a/pkg/analyzer/test/src/summary/resynthesize_kernel_test.dart b/pkg/analyzer/test/src/summary/resynthesize_kernel_test.dart
index e29522c..9c07850 100644
--- a/pkg/analyzer/test/src/summary/resynthesize_kernel_test.dart
+++ b/pkg/analyzer/test/src/summary/resynthesize_kernel_test.dart
@@ -37,14 +37,20 @@
   });
 }
 
-/// Tests marked with this annotation fail because of a Fasta problem.
-const fastaProblem = const Object();
-
 /// Tests marked with this annotation fail because they test features that
 /// were implemented in Analyzer, but are intentionally not included into
 /// the Dart 2.0 plan, so will not be implemented by Fasta.
 const notForDart2 = const Object();
 
+/// Tests marked with this annotations fail because we either have not triaged
+/// them, or know that this is an analyzer problem.
+const potentialAnalyzerProblem = const Object();
+
+/// Tests marked with this annotation fail because of a Fasta problem.
+class FastaProblem {
+  const FastaProblem(String issueUri);
+}
+
 @reflectiveTest
 class ResynthesizeKernelStrongTest extends ResynthesizeTest {
   static const DEBUG = false;
@@ -123,185 +129,57 @@
       super.createOptions()..strongMode = true;
 
   @failingTest
-  @fastaProblem
+  @FastaProblem('https://github.com/dart-lang/sdk/issues/30857')
   test_class_constructor_field_formal_multiple_matching_fields() async {
-    // Fasta does not generate the class.
-    // main() with a fatal error is generated instead.
     await super.test_class_constructor_field_formal_multiple_matching_fields();
   }
 
   @failingTest
-  @fastaProblem
+  @potentialAnalyzerProblem
   test_class_type_parameters_bound() async {
     // Fasta does not provide a flag for explicit vs. implicit Object bound.
     await super.test_class_type_parameters_bound();
   }
 
   @failingTest
-  @fastaProblem
-  test_const_invalid_field_const() async {
-    // Fasta generates additional `#errors` top-level variable.
-    await super.test_const_invalid_field_const();
-  }
-
-  @failingTest
-  @fastaProblem
+  @FastaProblem('https://github.com/dart-lang/sdk/issues/30266')
   test_const_invalid_intLiteral() async {
-    // https://github.com/dart-lang/sdk/issues/30266
     await super.test_const_invalid_intLiteral();
   }
 
   @failingTest
-  @fastaProblem
-  test_const_invalid_topLevel() async {
-    // Fasta generates additional `#errors` top-level variable.
-    await super.test_const_invalid_topLevel();
-  }
-
-  @failingTest
-  @fastaProblem
-  test_const_invokeConstructor_named_unresolved() async {
-    // https://github.com/dart-lang/sdk/issues/30267
-    await super.test_const_invokeConstructor_named_unresolved();
-  }
-
-  @failingTest
-  @fastaProblem
-  test_const_invokeConstructor_named_unresolved2() async {
-    // https://github.com/dart-lang/sdk/issues/30267
-    await super.test_const_invokeConstructor_named_unresolved2();
-  }
-
-  @failingTest
-  @fastaProblem
-  test_const_invokeConstructor_named_unresolved3() async {
-    // https://github.com/dart-lang/sdk/issues/30267
-    await super.test_const_invokeConstructor_named_unresolved3();
-  }
-
-  @failingTest
-  @fastaProblem
-  test_const_invokeConstructor_named_unresolved4() async {
-    // https://github.com/dart-lang/sdk/issues/30267
-    await super.test_const_invokeConstructor_named_unresolved4();
-  }
-
-  @failingTest
-  @fastaProblem
-  test_const_invokeConstructor_named_unresolved5() async {
-    // https://github.com/dart-lang/sdk/issues/30267
-    await super.test_const_invokeConstructor_named_unresolved5();
-  }
-
-  @failingTest
-  @fastaProblem
-  test_const_invokeConstructor_named_unresolved6() async {
-    // https://github.com/dart-lang/sdk/issues/30267
-    await super.test_const_invokeConstructor_named_unresolved6();
-  }
-
-  @failingTest
-  @fastaProblem
-  test_const_invokeConstructor_unnamed_unresolved() async {
-    // https://github.com/dart-lang/sdk/issues/30267
-    await super.test_const_invokeConstructor_unnamed_unresolved();
-  }
-
-  @failingTest
-  @fastaProblem
-  test_const_invokeConstructor_unnamed_unresolved2() async {
-    // https://github.com/dart-lang/sdk/issues/30267
-    await super.test_const_invokeConstructor_unnamed_unresolved2();
-  }
-
-  @failingTest
-  @fastaProblem
-  test_const_invokeConstructor_unnamed_unresolved3() async {
-    // https://github.com/dart-lang/sdk/issues/30267
-    await super.test_const_invokeConstructor_unnamed_unresolved3();
-  }
-
-  @failingTest
-  @fastaProblem
-  test_const_reference_unresolved_prefix0() async {
-    // https://github.com/dart-lang/sdk/issues/30267
-    await super.test_const_reference_unresolved_prefix0();
-  }
-
-  @failingTest
-  @fastaProblem
-  test_const_reference_unresolved_prefix1() async {
-    // https://github.com/dart-lang/sdk/issues/30267
-    await super.test_const_reference_unresolved_prefix1();
-  }
-
-  @failingTest
-  @fastaProblem
-  test_const_reference_unresolved_prefix2() async {
-    // https://github.com/dart-lang/sdk/issues/30267
-    await super.test_const_reference_unresolved_prefix2();
-  }
-
-  @failingTest
-  @fastaProblem
-  test_const_topLevel_super() async {
-    // https://github.com/dart-lang/sdk/issues/30267
-    await super.test_const_topLevel_super();
-  }
-
-  @failingTest
-  @fastaProblem
-  test_const_topLevel_this() async {
-    // https://github.com/dart-lang/sdk/issues/30267
-    await super.test_const_topLevel_this();
-  }
-
-  @failingTest
-  @fastaProblem
-  test_constructor_initializers_field_notConst() async {
-    // Fasta generates additional `#errors` top-level variable.
-    await super.test_constructor_initializers_field_notConst();
-  }
-
-  @failingTest
-  @fastaProblem
+  @FastaProblem('https://github.com/dart-lang/sdk/issues/30258')
   test_constructor_redirected_factory_named_generic() async {
-    // https://github.com/dart-lang/sdk/issues/30258
     await super.test_constructor_redirected_factory_named_generic();
   }
 
   @failingTest
-  @fastaProblem
+  @FastaProblem('https://github.com/dart-lang/sdk/issues/30258')
   test_constructor_redirected_factory_named_imported_generic() async {
-    // https://github.com/dart-lang/sdk/issues/30258
     await super.test_constructor_redirected_factory_named_imported_generic();
   }
 
   @failingTest
-  @fastaProblem
+  @FastaProblem('https://github.com/dart-lang/sdk/issues/30258')
   test_constructor_redirected_factory_named_prefixed_generic() async {
-    // https://github.com/dart-lang/sdk/issues/30258
     await super.test_constructor_redirected_factory_named_prefixed_generic();
   }
 
   @failingTest
-  @fastaProblem
+  @FastaProblem('https://github.com/dart-lang/sdk/issues/30258')
   test_constructor_redirected_factory_unnamed_generic() async {
-    // https://github.com/dart-lang/sdk/issues/30258
     await super.test_constructor_redirected_factory_unnamed_generic();
   }
 
   @failingTest
-  @fastaProblem
+  @FastaProblem('https://github.com/dart-lang/sdk/issues/30258')
   test_constructor_redirected_factory_unnamed_imported_generic() async {
-    // https://github.com/dart-lang/sdk/issues/30258
     await super.test_constructor_redirected_factory_unnamed_imported_generic();
   }
 
   @failingTest
-  @fastaProblem
+  @FastaProblem('https://github.com/dart-lang/sdk/issues/30258')
   test_constructor_redirected_factory_unnamed_prefixed_generic() async {
-    // https://github.com/dart-lang/sdk/issues/30258
     await super.test_constructor_redirected_factory_unnamed_prefixed_generic();
   }
 
@@ -390,8 +268,8 @@
   }
 
   @failingTest
+  @potentialAnalyzerProblem
   test_genericFunction_asGenericFunctionReturnType() async {
-    // TODO(scheglov): triage
     await super.test_genericFunction_asGenericFunctionReturnType();
   }
 
@@ -408,363 +286,227 @@
   }
 
   @failingTest
-  @fastaProblem
+  @FastaProblem('https://github.com/dart-lang/sdk/issues/30725')
   test_import_invalidUri_metadata() async {
-    // https://github.com/dart-lang/sdk/issues/30725
     await super.test_import_invalidUri_metadata();
   }
 
   @failingTest
-  @fastaProblem
+  @FastaProblem('https://github.com/dart-lang/sdk/issues/30724')
   test_instantiateToBounds_boundRefersToEarlierTypeArgument() async {
-    // https://github.com/dart-lang/sdk/issues/30724
     await super.test_instantiateToBounds_boundRefersToEarlierTypeArgument();
   }
 
   @failingTest
-  @fastaProblem
+  @FastaProblem('https://github.com/dart-lang/sdk/issues/30724')
   test_instantiateToBounds_boundRefersToItself() async {
-    // https://github.com/dart-lang/sdk/issues/30724
     await super.test_instantiateToBounds_boundRefersToItself();
   }
 
   @failingTest
-  @fastaProblem
+  @FastaProblem('https://github.com/dart-lang/sdk/issues/30724')
   test_instantiateToBounds_boundRefersToLaterTypeArgument() async {
-    // https://github.com/dart-lang/sdk/issues/30724
     await super.test_instantiateToBounds_boundRefersToLaterTypeArgument();
   }
 
   @failingTest
-  @fastaProblem
+  @FastaProblem('https://github.com/dart-lang/sdk/issues/30724')
   test_instantiateToBounds_functionTypeAlias_simple() async {
-    // https://github.com/dart-lang/sdk/issues/30724
     await super.test_instantiateToBounds_functionTypeAlias_simple();
   }
 
   @failingTest
-  @fastaProblem
+  @FastaProblem('https://github.com/dart-lang/sdk/issues/30724')
   test_instantiateToBounds_simple() async {
-    // https://github.com/dart-lang/sdk/issues/30724
     await super.test_instantiateToBounds_simple();
   }
 
   @failingTest
-  @fastaProblem
+  @FastaProblem('https://github.com/dart-lang/sdk/issues/30267')
   test_invalid_annotation_prefixed_constructor() async {
-    // https://github.com/dart-lang/sdk/issues/30267
     await super.test_invalid_annotation_prefixed_constructor();
   }
 
   @failingTest
-  @fastaProblem
+  @FastaProblem('https://github.com/dart-lang/sdk/issues/30267')
   test_invalid_annotation_unprefixed_constructor() async {
-    // https://github.com/dart-lang/sdk/issues/30267
     await super.test_invalid_annotation_unprefixed_constructor();
   }
 
   @failingTest
-  @fastaProblem
+  @FastaProblem('https://github.com/dart-lang/sdk/issues/30267')
   test_invalid_nameConflict_imported() async {
-    // https://github.com/dart-lang/sdk/issues/30267
     await super.test_invalid_nameConflict_imported();
   }
 
   @failingTest
-  @fastaProblem
+  @FastaProblem('https://github.com/dart-lang/sdk/issues/30267')
   test_invalid_nameConflict_imported_exported() async {
-    // https://github.com/dart-lang/sdk/issues/30267
     await super.test_invalid_nameConflict_imported_exported();
   }
 
   @failingTest
-  @fastaProblem
+  @FastaProblem('https://github.com/dart-lang/sdk/issues/30267')
   test_invalid_nameConflict_local() async {
-    // https://github.com/dart-lang/sdk/issues/30267
     await super.test_invalid_nameConflict_local();
   }
 
   @failingTest
-  @fastaProblem
+  @FastaProblem('https://github.com/dart-lang/sdk/issues/30267')
   test_invalid_setterParameter_fieldFormalParameter() async {
-    // https://github.com/dart-lang/sdk/issues/30267
     await super.test_invalid_setterParameter_fieldFormalParameter();
   }
 
   @failingTest
-  @fastaProblem
+  @FastaProblem('https://github.com/dart-lang/sdk/issues/30725')
   test_invalidUri_part_emptyUri() async {
-    // https://github.com/dart-lang/sdk/issues/30725
     await super.test_invalidUri_part_emptyUri();
   }
 
   @failingTest
-  @fastaProblem
+  @FastaProblem('https://github.com/dart-lang/sdk/issues/30725')
   test_invalidUris() async {
-    // https://github.com/dart-lang/sdk/issues/30725
     await super.test_invalidUris();
   }
 
   @failingTest
-  @fastaProblem
+  @FastaProblem('https://github.com/dart-lang/sdk/issues/30284')
   test_metadata_exportDirective() async {
-    // https://github.com/dart-lang/sdk/issues/30284
     await super.test_metadata_exportDirective();
   }
 
   @failingTest
-  @fastaProblem
+  @FastaProblem('https://github.com/dart-lang/sdk/issues/30035')
   test_metadata_fieldFormalParameter() async {
-    // https://github.com/dart-lang/sdk/issues/30035
     await super.test_metadata_fieldFormalParameter();
   }
 
   @failingTest
-  @fastaProblem
+  @FastaProblem('https://github.com/dart-lang/sdk/issues/30035')
   test_metadata_fieldFormalParameter_withDefault() async {
-    // https://github.com/dart-lang/sdk/issues/30035
     await super.test_metadata_fieldFormalParameter_withDefault();
   }
 
   @failingTest
-  @fastaProblem
+  @FastaProblem('https://github.com/dart-lang/sdk/issues/30035')
   test_metadata_functionTypedFormalParameter() async {
-    // https://github.com/dart-lang/sdk/issues/30035
     await super.test_metadata_functionTypedFormalParameter();
   }
 
   @failingTest
-  @fastaProblem
+  @FastaProblem('https://github.com/dart-lang/sdk/issues/30035')
   test_metadata_functionTypedFormalParameter_withDefault() async {
-    // https://github.com/dart-lang/sdk/issues/30035
     await super.test_metadata_functionTypedFormalParameter_withDefault();
   }
 
   @failingTest
-  @fastaProblem
+  @FastaProblem('https://github.com/dart-lang/sdk/issues/30284')
   test_metadata_importDirective() async {
-    // https://github.com/dart-lang/sdk/issues/30284
     await super.test_metadata_importDirective();
   }
 
   @failingTest
-  @fastaProblem
+  @FastaProblem('https://github.com/dart-lang/sdk/issues/30267')
   test_metadata_invalid_classDeclaration() async {
-    // https://github.com/dart-lang/sdk/issues/30267
     await super.test_metadata_invalid_classDeclaration();
   }
 
   @failingTest
-  @fastaProblem
+  @FastaProblem('https://github.com/dart-lang/sdk/issues/30284')
   test_metadata_libraryDirective() async {
-    // https://github.com/dart-lang/sdk/issues/30284
     await super.test_metadata_libraryDirective();
   }
 
   @failingTest
+  @FastaProblem('https://github.com/dart-lang/sdk/issues/30284')
   test_metadata_partDirective() async {
-    // https://github.com/dart-lang/sdk/issues/30284
     await super.test_metadata_partDirective();
   }
 
   @failingTest
+  @FastaProblem('https://github.com/dart-lang/sdk/issues/30035')
   test_metadata_simpleFormalParameter() async {
-    // https://github.com/dart-lang/sdk/issues/30035
     await super.test_metadata_simpleFormalParameter();
   }
 
   @failingTest
+  @FastaProblem('https://github.com/dart-lang/sdk/issues/30035')
   test_metadata_simpleFormalParameter_withDefault() async {
-    // https://github.com/dart-lang/sdk/issues/30035
     await super.test_metadata_simpleFormalParameter_withDefault();
   }
 
   @failingTest
+  @potentialAnalyzerProblem
   test_parameter_checked() async {
-    // TODO(scheglov): triage
     await super.test_parameter_checked();
   }
 
   @failingTest
+  @potentialAnalyzerProblem
   test_parameter_checked_inherited() async {
-    // TODO(scheglov): triage
     await super.test_parameter_checked_inherited();
   }
 
   @failingTest
-  @fastaProblem
+  @FastaProblem('https://github.com/dart-lang/sdk/issues/30725')
   test_parts_invalidUri() async {
-    // https://github.com/dart-lang/sdk/issues/30725
     await super.test_parts_invalidUri();
   }
 
   @failingTest
-  @fastaProblem
+  @FastaProblem('https://github.com/dart-lang/sdk/issues/30725')
   test_parts_invalidUri_nullStringValue() async {
-    // https://github.com/dart-lang/sdk/issues/30725
     await super.test_parts_invalidUri_nullStringValue();
   }
 
   @failingTest
-  test_syntheticFunctionType_genericClosure() async {
-    // TODO(scheglov): this does not work even in Analyzer
-    await super.test_syntheticFunctionType_genericClosure();
-  }
-
-  @failingTest
-  test_syntheticFunctionType_inGenericClass() async {
-    // TODO(scheglov): this does not work even in Analyzer
-    await super.test_syntheticFunctionType_inGenericClass();
-  }
-
-  @failingTest
-  test_syntheticFunctionType_noArguments() async {
-    // TODO(scheglov): this does not work even in Analyzer
-    await super.test_syntheticFunctionType_noArguments();
-  }
-
-  @failingTest
-  test_syntheticFunctionType_withArguments() async {
-    // TODO(scheglov): this does not work even in Analyzer
-    await super.test_syntheticFunctionType_withArguments();
-  }
-
-  @failingTest
+  @potentialAnalyzerProblem
   test_type_reference_to_typedef_with_type_arguments() async {
     // TODO(scheglov): triage
     await super.test_type_reference_to_typedef_with_type_arguments();
   }
 
   @failingTest
+  @potentialAnalyzerProblem
   test_type_reference_to_typedef_with_type_arguments_implicit() async {
     // TODO(scheglov): triage
     await super.test_type_reference_to_typedef_with_type_arguments_implicit();
   }
 
   @failingTest
+  @potentialAnalyzerProblem
   test_typedef_documented() async {
     // TODO(scheglov): implement
     await super.test_typedef_documented();
   }
 
   @failingTest
+  @potentialAnalyzerProblem
   test_typedef_generic() async {
     // TODO(scheglov): triage
     await super.test_typedef_generic();
   }
 
   @failingTest
+  @potentialAnalyzerProblem
   test_typedef_generic_asFieldType() async {
     // TODO(scheglov): triage
     await super.test_typedef_generic_asFieldType();
   }
 
   @failingTest
+  @potentialAnalyzerProblem
   test_typedef_type_parameters_bound() async {
     // TODO(scheglov): triage
     await super.test_typedef_type_parameters_bound();
   }
 
   @failingTest
-  @fastaProblem
+  @FastaProblem('https://github.com/dart-lang/sdk/issues/30267')
   test_unresolved_annotation_instanceCreation_argument_super() async {
-    // https://github.com/dart-lang/sdk/issues/30267
     await super.test_unresolved_annotation_instanceCreation_argument_super();
   }
 
-  @failingTest
-  @fastaProblem
-  test_unresolved_annotation_instanceCreation_argument_this() async {
-    // https://github.com/dart-lang/sdk/issues/30267
-    await super.test_unresolved_annotation_instanceCreation_argument_this();
-  }
-
-  @failingTest
-  @fastaProblem
-  test_unresolved_annotation_namedConstructorCall_noClass() async {
-    // https://github.com/dart-lang/sdk/issues/30267
-    await super.test_unresolved_annotation_namedConstructorCall_noClass();
-  }
-
-  @failingTest
-  @fastaProblem
-  test_unresolved_annotation_namedConstructorCall_noConstructor() async {
-    // https://github.com/dart-lang/sdk/issues/30267
-    await super.test_unresolved_annotation_namedConstructorCall_noConstructor();
-  }
-
-  @failingTest
-  @fastaProblem
-  test_unresolved_annotation_prefixedIdentifier_badPrefix() async {
-    // https://github.com/dart-lang/sdk/issues/30267
-    await super.test_unresolved_annotation_prefixedIdentifier_badPrefix();
-  }
-
-  @failingTest
-  @fastaProblem
-  test_unresolved_annotation_prefixedIdentifier_noDeclaration() async {
-    // https://github.com/dart-lang/sdk/issues/30267
-    await super.test_unresolved_annotation_prefixedIdentifier_noDeclaration();
-  }
-
-  @failingTest
-  @fastaProblem
-  test_unresolved_annotation_prefixedNamedConstructorCall_badPrefix() async {
-    // https://github.com/dart-lang/sdk/issues/30267
-    await super
-        .test_unresolved_annotation_prefixedNamedConstructorCall_badPrefix();
-  }
-
-  @failingTest
-  @fastaProblem
-  test_unresolved_annotation_prefixedNamedConstructorCall_noClass() async {
-    // https://github.com/dart-lang/sdk/issues/30267
-    await super
-        .test_unresolved_annotation_prefixedNamedConstructorCall_noClass();
-  }
-
-  @failingTest
-  @fastaProblem
-  test_unresolved_annotation_prefixedNamedConstructorCall_noConstructor() async {
-    await super
-        .test_unresolved_annotation_prefixedNamedConstructorCall_noConstructor();
-  }
-
-  @failingTest
-  @fastaProblem
-  test_unresolved_annotation_prefixedUnnamedConstructorCall_badPrefix() async {
-    // https://github.com/dart-lang/sdk/issues/30267
-    await super
-        .test_unresolved_annotation_prefixedUnnamedConstructorCall_badPrefix();
-  }
-
-  @failingTest
-  @fastaProblem
-  test_unresolved_annotation_prefixedUnnamedConstructorCall_noClass() async {
-    // https://github.com/dart-lang/sdk/issues/30267
-    await super
-        .test_unresolved_annotation_prefixedUnnamedConstructorCall_noClass();
-  }
-
-  @failingTest
-  @fastaProblem
-  test_unresolved_annotation_simpleIdentifier() async {
-    // https://github.com/dart-lang/sdk/issues/30267
-    await super.test_unresolved_annotation_simpleIdentifier();
-  }
-
-  @failingTest
-  @fastaProblem
-  test_unresolved_annotation_unnamedConstructorCall_noClass() async {
-    // https://github.com/dart-lang/sdk/issues/30267
-    await super.test_unresolved_annotation_unnamedConstructorCall_noClass();
-  }
-
-  @failingTest
-  test_unresolved_import() async {
-    await super.test_unresolved_import();
-  }
-
   String _getLibraryText(kernel.Library library) {
     StringBuffer buffer = new StringBuffer();
     new kernel.Printer(buffer, syntheticNames: new kernel.NameSystem())
diff --git a/pkg/analyzer/test/src/task/strong_mode_kernel_test.dart b/pkg/analyzer/test/src/task/strong_mode_kernel_test.dart
new file mode 100644
index 0000000..c27119d1
--- /dev/null
+++ b/pkg/analyzer/test/src/task/strong_mode_kernel_test.dart
@@ -0,0 +1,72 @@
+// 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 'package:test_reflective_loader/test_reflective_loader.dart';
+
+import 'strong_mode_driver_test.dart';
+
+main() {
+  defineReflectiveSuite(() {
+    defineReflectiveTests(InstanceMemberInferrerTest_Driver2);
+  });
+}
+
+@reflectiveTest
+class InstanceMemberInferrerTest_Driver2
+    extends InstanceMemberInferrerTest_Driver {
+  @override
+  bool get enableKernelDriver => true;
+
+  @override
+  @failingTest
+  test_inferCompilationUnit_method_parameter_multiple_named_same() async {
+    return super
+        .test_inferCompilationUnit_method_parameter_multiple_named_same();
+  }
+
+  @override
+  @failingTest
+  test_inferCompilationUnit_method_parameter_multiple_optionalAndRequired() async {
+    return super
+        .test_inferCompilationUnit_method_parameter_multiple_optionalAndRequired();
+  }
+
+  @override
+  @failingTest
+  test_inferCompilationUnit_method_parameter_single_generic() async {
+    return super.test_inferCompilationUnit_method_parameter_single_generic();
+  }
+
+  @override
+  @failingTest
+  test_inferCompilationUnit_method_return_multiple_same_generic() async {
+    return super
+        .test_inferCompilationUnit_method_return_multiple_same_generic();
+  }
+
+  @override
+  @failingTest
+  test_inferCompilationUnit_method_return_multiple_same_nonVoid() async {
+    return super
+        .test_inferCompilationUnit_method_return_multiple_same_nonVoid();
+  }
+
+  @override
+  @failingTest
+  test_inferCompilationUnit_method_return_multiple_same_void() async {
+    return super.test_inferCompilationUnit_method_return_multiple_same_void();
+  }
+
+  @override
+  @failingTest
+  test_inferCompilationUnit_method_return_single() async {
+    return super.test_inferCompilationUnit_method_return_single();
+  }
+
+  @override
+  @failingTest
+  test_inferCompilationUnit_method_return_single_generic() async {
+    return super.test_inferCompilationUnit_method_return_single_generic();
+  }
+}
diff --git a/pkg/analyzer/test/src/task/test_all.dart b/pkg/analyzer/test/src/task/test_all.dart
index 92e46d2..cb3e70b 100644
--- a/pkg/analyzer/test/src/task/test_all.dart
+++ b/pkg/analyzer/test/src/task/test_all.dart
@@ -19,6 +19,7 @@
 import 'options_work_manager_test.dart' as options_work_manager_test;
 import 'strong/test_all.dart' as strong_mode_test_all;
 import 'strong_mode_driver_test.dart' as strong_mode_driver_test;
+import 'strong_mode_kernel_test.dart' as strong_mode_kernel_test;
 import 'strong_mode_test.dart' as strong_mode_test;
 import 'yaml_test.dart' as yaml_test;
 
@@ -38,6 +39,7 @@
     options_work_manager_test.main();
     strong_mode_test_all.main();
     strong_mode_driver_test.main();
+    strong_mode_kernel_test.main();
     strong_mode_test.main();
     yaml_test.main();
   }, name: 'task');
diff --git a/pkg/analyzer/tool/summary/mini_ast.dart b/pkg/analyzer/tool/summary/mini_ast.dart
index 9d4f9d0..f086b88 100644
--- a/pkg/analyzer/tool/summary/mini_ast.dart
+++ b/pkg/analyzer/tool/summary/mini_ast.dart
@@ -289,6 +289,13 @@
   }
 
   @override
+  void handleRecoverImport(
+      Token deferredKeyword, Token asKeyword, Token semicolon) {
+    debugEvent("RecoverImport");
+    popIfNotNull(asKeyword); // Prefix identifier
+  }
+
+  @override
   void endLibraryName(Token libraryKeyword, Token semicolon) {
     debugEvent("LibraryName");
     pop(); // Library name
diff --git a/pkg/analyzer_plugin/lib/plugin/plugin.dart b/pkg/analyzer_plugin/lib/plugin/plugin.dart
index da7b7e9..faf50d2 100644
--- a/pkg/analyzer_plugin/lib/plugin/plugin.dart
+++ b/pkg/analyzer_plugin/lib/plugin/plugin.dart
@@ -449,8 +449,11 @@
     String sdkPath = parameters.sdkPath;
     String versionString = parameters.version;
     Version serverVersion = new Version.parse(versionString);
-    _byteStore =
-        new MemoryCachingByteStore(new FileByteStore(byteStorePath), 64 * M);
+    _byteStore = new MemoryCachingByteStore(
+        new FileByteStore(byteStorePath,
+            tempNameSuffix:
+                new DateTime.now().millisecondsSinceEpoch.toString()),
+        64 * M);
     _sdkManager = new DartSdkManager(sdkPath, true);
     return new PluginVersionCheckResult(
         isCompatibleWith(serverVersion), name, version, fileGlobsToAnalyze,
diff --git a/pkg/compiler/lib/src/compile_time_constants.dart b/pkg/compiler/lib/src/compile_time_constants.dart
index 392431b..47db1cc 100644
--- a/pkg/compiler/lib/src/compile_time_constants.dart
+++ b/pkg/compiler/lib/src/compile_time_constants.dart
@@ -179,7 +179,7 @@
   void evaluate(ConstantExpression constant) {
     constantValueMap.putIfAbsent(constant, () {
       return constant.evaluate(
-          new _CompilerEnvironment(compiler), constantSystem);
+          new AstEvaluationEnvironment(compiler), constantSystem);
     });
   }
 
@@ -975,7 +975,7 @@
           node,
           expression,
           expression.evaluate(
-              new _CompilerEnvironment(compiler), constantSystem));
+              new AstEvaluationEnvironment(compiler), constantSystem));
     } else {
       return makeConstructedConstant(
           compiler,
@@ -1264,12 +1264,12 @@
           new ConstructedConstantExpression(
               type, targetConstructor, callStructure, arguments);
 
-      Map<FieldEntity, ConstantExpression> fields =
-          expression.computeInstanceFields(new _CompilerEnvironment(compiler));
+      Map<FieldEntity, ConstantExpression> fields = expression
+          .computeInstanceFields(new AstEvaluationEnvironment(compiler));
       fields.forEach((_field, ConstantExpression expression) {
         FieldElement field = _field;
         ConstantValue value = expression.evaluate(
-            new _CompilerEnvironment(compiler), constantSystem);
+            new AstEvaluationEnvironment(compiler), constantSystem);
         fieldValues[field] = new AstConstant(context, null, expression, value);
       });
     } else {
@@ -1446,10 +1446,11 @@
             new NullConstantValue());
 }
 
-class _CompilerEnvironment implements EvaluationEnvironment {
+class AstEvaluationEnvironment extends EvaluationEnvironmentBase {
   final Compiler _compiler;
 
-  _CompilerEnvironment(this._compiler);
+  AstEvaluationEnvironment(this._compiler, {bool constantRequired: true})
+      : super(CURRENT_ELEMENT_SPANNABLE, constantRequired: constantRequired);
 
   @override
   CommonElements get commonElements => _compiler.resolution.commonElements;
@@ -1479,4 +1480,7 @@
   ConstantExpression getLocalConstant(LocalVariableElement local) {
     return local.constant;
   }
+
+  @override
+  DiagnosticReporter get reporter => _compiler.reporter;
 }
diff --git a/pkg/compiler/lib/src/compiler.dart b/pkg/compiler/lib/src/compiler.dart
index 7c64a31..bb877cb 100644
--- a/pkg/compiler/lib/src/compiler.dart
+++ b/pkg/compiler/lib/src/compiler.dart
@@ -895,11 +895,11 @@
   ///
   /// If [assumeInUserCode] is `true`, [element] is assumed to be in user code
   /// if no entrypoints have been set.
-  bool inUserCode(Element element, {bool assumeInUserCode: false}) {
-    if (element == null) return false;
+  bool inUserCode(Entity element, {bool assumeInUserCode: false}) {
+    Uri libraryUri = _uriFromElement(element);
+    if (libraryUri == null) return false;
     Iterable<CodeLocation> userCodeLocations =
         computeUserCodeLocations(assumeInUserCode: assumeInUserCode);
-    Uri libraryUri = element.library.canonicalUri;
     return userCodeLocations.any(
         (CodeLocation codeLocation) => codeLocation.inSameLocation(libraryUri));
   }
@@ -926,9 +926,9 @@
   /// For a package library with canonical URI 'package:foo/bar/baz.dart' the
   /// return URI is 'package:foo'. For non-package libraries the returned URI is
   /// the canonical URI of the library itself.
-  Uri getCanonicalUri(Element element) {
-    if (element == null) return null;
-    Uri libraryUri = element.library.canonicalUri;
+  Uri getCanonicalUri(Entity element) {
+    Uri libraryUri = _uriFromElement(element);
+    if (libraryUri == null) return null;
     if (libraryUri.scheme == 'package') {
       int slashPos = libraryUri.path.indexOf('/');
       if (slashPos != -1) {
@@ -939,6 +939,19 @@
     return libraryUri;
   }
 
+  Uri _uriFromElement(Entity element) {
+    if (element is LibraryEntity) {
+      return element.canonicalUri;
+    } else if (element is ClassEntity) {
+      return element.library.canonicalUri;
+    } else if (element is MemberEntity) {
+      return element.library.canonicalUri;
+    } else if (element is Element) {
+      return element.library.canonicalUri;
+    }
+    return null;
+  }
+
   /// Returns [true] if a compile-time error has been reported for element.
   bool elementHasCompileTimeError(Entity element) {
     return elementsWithCompileTimeErrors.containsKey(element);
@@ -1046,7 +1059,7 @@
       switch (kind) {
         case api.Diagnostic.WARNING:
         case api.Diagnostic.HINT:
-          Element element = elementFromSpannable(message.spannable);
+          Entity element = elementFromSpannable(message.spannable);
           if (!compiler.inUserCode(element, assumeInUserCode: true)) {
             Uri uri = compiler.getCanonicalUri(element);
             if (options.showPackageWarningsFor(uri)) {
@@ -1213,9 +1226,9 @@
 
   /// Finds the approximate [Element] for [node]. [currentElement] is used as
   /// the default value.
-  Element elementFromSpannable(Spannable node) {
-    Element element;
-    if (node is Element) {
+  Entity elementFromSpannable(Spannable node) {
+    Entity element;
+    if (node is Entity) {
       element = node;
     } else if (node is HInstruction) {
       element = _elementFromHInstruction(node);
diff --git a/pkg/compiler/lib/src/constants/evaluation.dart b/pkg/compiler/lib/src/constants/evaluation.dart
index cc49c0f..24ce810 100644
--- a/pkg/compiler/lib/src/constants/evaluation.dart
+++ b/pkg/compiler/lib/src/constants/evaluation.dart
@@ -9,8 +9,10 @@
 import '../elements/entities.dart';
 import '../elements/types.dart';
 import '../universe/call_structure.dart' show CallStructure;
+import '../util/util.dart' show Link;
 import 'constructors.dart';
 import 'expressions.dart';
+import 'values.dart';
 
 /// Environment used for evaluating constant expressions.
 abstract class EvaluationEnvironment {
@@ -34,6 +36,81 @@
   /// corresponding type variables in [type].
   InterfaceType substByContext(
       covariant InterfaceType base, covariant InterfaceType target);
+
+  void reportWarning(
+      ConstantExpression expression, MessageKind kind, Map arguments);
+
+  void reportError(
+      ConstantExpression expression, MessageKind kind, Map arguments);
+
+  ConstantValue evaluateConstructor(
+      ConstructorEntity constructor, ConstantValue evaluate());
+
+  ConstantValue evaluateField(FieldEntity field, ConstantValue evaluate());
+}
+
+abstract class EvaluationEnvironmentBase implements EvaluationEnvironment {
+  Link<Spannable> _spannableStack = const Link<Spannable>();
+  final Set<FieldEntity> _currentlyEvaluatedFields = new Set<FieldEntity>();
+  final Set<ConstructorEntity> _currentlyEvaluatedConstructors =
+      new Set<ConstructorEntity>();
+  final bool constantRequired;
+
+  EvaluationEnvironmentBase(Spannable spannable, {this.constantRequired}) {
+    _spannableStack = _spannableStack.prepend(spannable);
+  }
+
+  DiagnosticReporter get reporter;
+
+  @override
+  ConstantValue evaluateField(FieldEntity field, ConstantValue evaluate()) {
+    if (_currentlyEvaluatedFields.add(field)) {
+      _spannableStack = _spannableStack.prepend(field);
+      ConstantValue result = evaluate();
+      _currentlyEvaluatedFields.remove(field);
+      _spannableStack = _spannableStack.tail;
+      return result;
+    }
+    if (constantRequired) {
+      reporter.reportErrorMessage(
+          field, MessageKind.CYCLIC_COMPILE_TIME_CONSTANTS);
+    }
+    return new NonConstantValue();
+  }
+
+  @override
+  ConstantValue evaluateConstructor(
+      ConstructorEntity constructor, ConstantValue evaluate()) {
+    if (_currentlyEvaluatedConstructors.add(constructor)) {
+      _spannableStack = _spannableStack.prepend(constructor);
+      ConstantValue result = evaluate();
+      _currentlyEvaluatedConstructors.remove(constructor);
+      _spannableStack = _spannableStack.tail;
+      return result;
+    }
+    if (constantRequired) {
+      reporter.reportErrorMessage(
+          constructor, MessageKind.CYCLIC_COMPILE_TIME_CONSTANTS);
+    }
+    return new NonConstantValue();
+  }
+
+  @override
+  void reportError(
+      ConstantExpression expression, MessageKind kind, Map arguments) {
+    if (constantRequired) {
+      // TODO(johnniwinther): Should [ConstantExpression] have a location?
+      reporter.reportErrorMessage(_spannableStack.head, kind, arguments);
+    }
+  }
+
+  @override
+  void reportWarning(
+      ConstantExpression expression, MessageKind kind, Map arguments) {
+    if (constantRequired) {
+      reporter.reportWarningMessage(_spannableStack.head, kind, arguments);
+    }
+  }
 }
 
 /// The normalized arguments passed to a const constructor computed from the
diff --git a/pkg/compiler/lib/src/constants/expressions.dart b/pkg/compiler/lib/src/constants/expressions.dart
index e029d2e..6bfe658 100644
--- a/pkg/compiler/lib/src/constants/expressions.dart
+++ b/pkg/compiler/lib/src/constants/expressions.dart
@@ -474,15 +474,23 @@
   @override
   ConstantValue evaluate(
       EvaluationEnvironment environment, ConstantSystem constantSystem) {
-    Map<ConstantValue, ConstantValue> valueMap =
-        <ConstantValue, ConstantValue>{};
-    for (int index = 0; index < keys.length; index++) {
-      ConstantValue key = keys[index].evaluate(environment, constantSystem);
-      ConstantValue value = values[index].evaluate(environment, constantSystem);
-      valueMap[key] = value;
+    Map<ConstantValue, ConstantValue> map = <ConstantValue, ConstantValue>{};
+    for (int i = 0; i < keys.length; i++) {
+      ConstantValue key = keys[i].evaluate(environment, constantSystem);
+      if (!key.isConstant) {
+        return new NonConstantValue();
+      }
+      ConstantValue value = values[i].evaluate(environment, constantSystem);
+      if (!value.isConstant) {
+        return new NonConstantValue();
+      }
+      if (map.containsKey(key)) {
+        environment.reportWarning(keys[i], MessageKind.EQUAL_MAP_ENTRY_KEY, {});
+      }
+      map[key] = value;
     }
     return constantSystem.createMap(environment.commonElements, type,
-        valueMap.keys.toList(), valueMap.values.toList());
+        map.keys.toList(), map.values.toList());
   }
 
   ConstantExpression apply(NormalizedArguments arguments) {
@@ -580,14 +588,35 @@
   @override
   ConstantValue evaluate(
       EvaluationEnvironment environment, ConstantSystem constantSystem) {
-    Map<FieldEntity, ConstantValue> fieldValues =
-        <FieldEntity, ConstantValue>{};
-    computeInstanceFields(environment)
-        .forEach((FieldEntity field, ConstantExpression constant) {
-      fieldValues[field] = constant.evaluate(environment, constantSystem);
+    return environment.evaluateConstructor(target, () {
+      Map<FieldEntity, ConstantExpression> fieldMap =
+          computeInstanceFields(environment);
+      if (fieldMap == null) {
+        // An erroneous constant constructor was encountered in the super-chain.
+        return new NonConstantValue();
+      }
+      bool isValidAsConstant = true;
+      Map<FieldEntity, ConstantValue> fieldValues =
+          <FieldEntity, ConstantValue>{};
+      fieldMap.forEach((FieldEntity field, ConstantExpression constant) {
+        ConstantValue value = constant.evaluate(environment, constantSystem);
+        assert(
+            value != null,
+            failedAt(CURRENT_ELEMENT_SPANNABLE,
+                "No value computed for ${constant.toStructuredText()}."));
+        if (value.isConstant) {
+          fieldValues[field] = value;
+        } else {
+          isValidAsConstant = false;
+        }
+      });
+      if (isValidAsConstant) {
+        return new ConstructedConstantValue(
+            computeInstanceType(environment), fieldValues);
+      } else {
+        return new NonConstantValue();
+      }
     });
-    return new ConstructedConstantValue(
-        computeInstanceType(environment), fieldValues);
   }
 
   @override
@@ -652,19 +681,35 @@
   @override
   ConstantValue evaluate(
       EvaluationEnvironment environment, ConstantSystem constantSystem) {
+    bool isValid = true;
     StringBuffer sb = new StringBuffer();
     for (ConstantExpression expression in expressions) {
       ConstantValue value = expression.evaluate(environment, constantSystem);
+      if (!value.isConstant) {
+        isValid = false;
+        // Use `continue` instead of `return` here to report all errors in the
+        // expression and not just the first.
+        continue;
+      }
       if (value.isPrimitive) {
         PrimitiveConstantValue primitive = value;
         sb.write(primitive.primitiveValue);
       } else {
-        // TODO(johnniwinther): Specialize message to indicated that the problem
-        // is not constness but the types of the const expressions.
-        return new NonConstantValue();
+        environment.reportError(
+            expression, MessageKind.INVALID_CONSTANT_INTERPOLATION_TYPE, {
+          'constant': expression,
+          'type': value.getType(environment.commonElements)
+        });
+        isValid = false;
+        // Use `continue` instead of `return` here to report all errors in the
+        // expression and not just the first.
+        continue;
       }
     }
-    return constantSystem.createString(sb.toString());
+    if (isValid) {
+      return constantSystem.createString(sb.toString());
+    }
+    return new NonConstantValue();
   }
 
   @override
@@ -798,8 +843,10 @@
   @override
   ConstantValue evaluate(
       EvaluationEnvironment environment, ConstantSystem constantSystem) {
-    ConstantExpression constant = environment.getFieldConstant(element);
-    return constant.evaluate(environment, constantSystem);
+    return environment.evaluateField(element, () {
+      ConstantExpression constant = environment.getFieldConstant(element);
+      return constant.evaluate(environment, constantSystem);
+    });
   }
 
   @override
@@ -888,7 +935,8 @@
   final ConstantExpression right;
 
   BinaryConstantExpression(this.left, this.operator, this.right) {
-    assert(PRECEDENCE_MAP[operator.kind] != null);
+    assert(PRECEDENCE_MAP[operator.kind] != null,
+        "Missing precendence for binary operator: '$operator'.");
   }
 
   static bool potentialOperator(BinaryOperator operator) =>
@@ -914,16 +962,195 @@
       EvaluationEnvironment environment, ConstantSystem constantSystem) {
     ConstantValue leftValue = left.evaluate(environment, constantSystem);
     ConstantValue rightValue = right.evaluate(environment, constantSystem);
-    switch (operator.kind) {
-      case BinaryOperatorKind.NOT_EQ:
-        BoolConstantValue equals =
-            constantSystem.equal.fold(leftValue, rightValue);
-        return equals.negate();
-      default:
-        return constantSystem
-            .lookupBinary(operator)
-            .fold(leftValue, rightValue);
+    if (!leftValue.isConstant || !rightValue.isConstant) {
+      return new NonConstantValue();
     }
+    bool isValid = true;
+    switch (operator.kind) {
+      case BinaryOperatorKind.EQ:
+      case BinaryOperatorKind.NOT_EQ:
+        if (!leftValue.isPrimitive) {
+          environment.reportError(
+              left, MessageKind.INVALID_CONSTANT_BINARY_PRIMITIVE_TYPE, {
+            'constant': left,
+            'type': leftValue.getType(environment.commonElements),
+            'operator': operator
+          });
+          isValid = false;
+        }
+        if (!rightValue.isPrimitive) {
+          environment.reportError(
+              right, MessageKind.INVALID_CONSTANT_BINARY_PRIMITIVE_TYPE, {
+            'constant': right,
+            'type': rightValue.getType(environment.commonElements),
+            'operator': operator
+          });
+          isValid = false;
+        }
+        break;
+      case BinaryOperatorKind.ADD:
+        if (leftValue.isString) {
+          if (!rightValue.isString) {
+            environment.reportError(
+                right, MessageKind.INVALID_CONSTANT_STRING_ADD_TYPE, {
+              'constant': right,
+              'type': rightValue.getType(environment.commonElements)
+            });
+            isValid = false;
+          }
+        } else if (leftValue.isNum) {
+          if (!rightValue.isNum) {
+            environment.reportError(
+                right, MessageKind.INVALID_CONSTANT_NUM_ADD_TYPE, {
+              'constant': right,
+              'type': rightValue.getType(environment.commonElements)
+            });
+            isValid = false;
+          }
+        } else if (rightValue.isString) {
+          if (!leftValue.isString) {
+            environment.reportError(
+                left, MessageKind.INVALID_CONSTANT_STRING_ADD_TYPE, {
+              'constant': left,
+              'type': leftValue.getType(environment.commonElements)
+            });
+            isValid = false;
+          }
+        } else if (rightValue.isNum) {
+          if (!leftValue.isNum) {
+            environment.reportError(
+                left, MessageKind.INVALID_CONSTANT_NUM_ADD_TYPE, {
+              'constant': left,
+              'type': leftValue.getType(environment.commonElements)
+            });
+            isValid = false;
+          }
+        } else {
+          environment
+              .reportError(this, MessageKind.INVALID_CONSTANT_ADD_TYPES, {
+            'leftConstant': left,
+            'leftType': leftValue.getType(environment.commonElements),
+            'rightConstant': right,
+            'rightType': rightValue.getType(environment.commonElements)
+          });
+          isValid = false;
+        }
+        break;
+      case BinaryOperatorKind.SUB:
+      case BinaryOperatorKind.MUL:
+      case BinaryOperatorKind.DIV:
+      case BinaryOperatorKind.IDIV:
+      case BinaryOperatorKind.MOD:
+      case BinaryOperatorKind.GTEQ:
+      case BinaryOperatorKind.GT:
+      case BinaryOperatorKind.LTEQ:
+      case BinaryOperatorKind.LT:
+        if (!leftValue.isNum) {
+          environment
+              .reportError(left, MessageKind.INVALID_CONSTANT_BINARY_NUM_TYPE, {
+            'constant': left,
+            'type': leftValue.getType(environment.commonElements),
+            'operator': operator
+          });
+          isValid = false;
+        }
+        if (!rightValue.isNum) {
+          environment.reportError(
+              right, MessageKind.INVALID_CONSTANT_BINARY_NUM_TYPE, {
+            'constant': right,
+            'type': rightValue.getType(environment.commonElements),
+            'operator': operator
+          });
+          isValid = false;
+        }
+        break;
+      case BinaryOperatorKind.SHL:
+      case BinaryOperatorKind.SHR:
+      case BinaryOperatorKind.AND:
+      case BinaryOperatorKind.OR:
+      case BinaryOperatorKind.XOR:
+        if (!leftValue.isInt) {
+          environment
+              .reportError(left, MessageKind.INVALID_CONSTANT_BINARY_INT_TYPE, {
+            'constant': left,
+            'type': leftValue.getType(environment.commonElements),
+            'operator': operator
+          });
+          isValid = false;
+        }
+        if (!rightValue.isInt) {
+          environment.reportError(
+              right, MessageKind.INVALID_CONSTANT_BINARY_INT_TYPE, {
+            'constant': right,
+            'type': rightValue.getType(environment.commonElements),
+            'operator': operator
+          });
+          isValid = false;
+        }
+        break;
+      case BinaryOperatorKind.LOGICAL_AND:
+        if (!leftValue.isBool) {
+          environment
+              .reportError(left, MessageKind.INVALID_LOGICAL_AND_OPERAND_TYPE, {
+            'constant': left,
+            'type': leftValue.getType(environment.commonElements),
+            'operator': operator
+          });
+          isValid = false;
+        }
+        if (!rightValue.isBool) {
+          environment.reportError(
+              right, MessageKind.INVALID_LOGICAL_AND_OPERAND_TYPE, {
+            'constant': right,
+            'type': rightValue.getType(environment.commonElements),
+            'operator': operator
+          });
+          isValid = false;
+        }
+        break;
+      case BinaryOperatorKind.LOGICAL_OR:
+        if (!leftValue.isBool) {
+          environment
+              .reportError(left, MessageKind.INVALID_LOGICAL_OR_OPERAND_TYPE, {
+            'constant': left,
+            'type': leftValue.getType(environment.commonElements),
+            'operator': operator
+          });
+          isValid = false;
+        }
+        if (!rightValue.isBool) {
+          environment
+              .reportError(right, MessageKind.INVALID_LOGICAL_OR_OPERAND_TYPE, {
+            'constant': right,
+            'type': rightValue.getType(environment.commonElements),
+            'operator': operator
+          });
+          isValid = false;
+        }
+        break;
+      case BinaryOperatorKind.INDEX:
+        environment.reportError(this, MessageKind.INVALID_CONSTANT_INDEX, {});
+        isValid = false;
+        break;
+      case BinaryOperatorKind.IF_NULL:
+        // Valid since [leftValue] and [rightValue] are constants.
+        break;
+    }
+    if (isValid) {
+      switch (operator.kind) {
+        case BinaryOperatorKind.NOT_EQ:
+          BoolConstantValue equals =
+              constantSystem.equal.fold(leftValue, rightValue);
+          return equals.negate();
+        default:
+          ConstantValue value =
+              constantSystem.lookupBinary(operator).fold(leftValue, rightValue);
+          if (value != null) {
+            return value;
+          }
+      }
+    }
+    return new NonConstantValue();
   }
 
   ConstantExpression apply(NormalizedArguments arguments) {
@@ -1023,6 +1250,7 @@
     BinaryOperatorKind.LTEQ: 7,
     BinaryOperatorKind.MOD: 13,
     BinaryOperatorKind.IF_NULL: 3,
+    BinaryOperatorKind.INDEX: 3,
   };
 }
 
@@ -1051,9 +1279,12 @@
   @override
   ConstantValue evaluate(
       EvaluationEnvironment environment, ConstantSystem constantSystem) {
-    return constantSystem.identity.fold(
-        left.evaluate(environment, constantSystem),
-        right.evaluate(environment, constantSystem));
+    ConstantValue leftValue = left.evaluate(environment, constantSystem);
+    ConstantValue rightValue = right.evaluate(environment, constantSystem);
+    if (leftValue.isConstant && rightValue.isConstant) {
+      return constantSystem.identity.fold(leftValue, rightValue);
+    }
+    return new NonConstantValue();
   }
 
   ConstantExpression apply(NormalizedArguments arguments) {
@@ -1108,9 +1339,52 @@
   @override
   ConstantValue evaluate(
       EvaluationEnvironment environment, ConstantSystem constantSystem) {
-    return constantSystem
-        .lookupUnary(operator)
-        .fold(expression.evaluate(environment, constantSystem));
+    ConstantValue expressionValue =
+        expression.evaluate(environment, constantSystem);
+    bool isValid = true;
+    switch (operator.kind) {
+      case UnaryOperatorKind.NOT:
+        if (!expressionValue.isBool) {
+          environment
+              .reportError(expression, MessageKind.INVALID_CONSTANT_NOT_TYPE, {
+            'constant': expression,
+            'type': expressionValue.getType(environment.commonElements),
+            'operator': operator
+          });
+          isValid = false;
+        }
+        break;
+      case UnaryOperatorKind.NEGATE:
+        if (!expressionValue.isNum) {
+          environment.reportError(
+              expression, MessageKind.INVALID_CONSTANT_NEGATE_TYPE, {
+            'constant': expression,
+            'type': expressionValue.getType(environment.commonElements),
+            'operator': operator
+          });
+          isValid = false;
+        }
+        break;
+      case UnaryOperatorKind.COMPLEMENT:
+        if (!expressionValue.isInt) {
+          environment.reportError(
+              expression, MessageKind.INVALID_CONSTANT_COMPLEMENT_TYPE, {
+            'constant': expression,
+            'type': expressionValue.getType(environment.commonElements),
+            'operator': operator
+          });
+          isValid = false;
+        }
+        break;
+    }
+    if (isValid) {
+      ConstantValue value =
+          constantSystem.lookupUnary(operator).fold(expressionValue);
+      if (value != null) {
+        return value;
+      }
+    }
+    return new NonConstantValue();
   }
 
   ConstantExpression apply(NormalizedArguments arguments) {
@@ -1169,11 +1443,17 @@
   ConstantValue evaluate(
       EvaluationEnvironment environment, ConstantSystem constantSystem) {
     ConstantValue value = expression.evaluate(environment, constantSystem);
-    if (value.isString) {
+    if (!value.isString) {
+      environment.reportError(
+          expression, MessageKind.INVALID_CONSTANT_STRING_LENGTH_TYPE, {
+        'constant': expression,
+        'type': value.getType(environment.commonElements)
+      });
+      return new NonConstantValue();
+    } else {
       StringConstantValue stringValue = value;
       return constantSystem.createInt(stringValue.primitiveValue.length);
     }
-    return new NonConstantValue();
   }
 
   ConstantExpression apply(NormalizedArguments arguments) {
@@ -1255,13 +1535,23 @@
         condition.evaluate(environment, constantSystem);
     ConstantValue trueValue = trueExp.evaluate(environment, constantSystem);
     ConstantValue falseValue = falseExp.evaluate(environment, constantSystem);
-    if (conditionValue.isTrue) {
-      return trueValue;
-    } else if (conditionValue.isFalse) {
-      return falseValue;
-    } else {
-      return new NonConstantValue();
+    bool isValid = true;
+    if (!conditionValue.isBool) {
+      environment.reportError(
+          condition, MessageKind.INVALID_CONSTANT_CONDITIONAL_TYPE, {
+        'constant': condition,
+        'type': conditionValue.getType(environment.commonElements)
+      });
+      isValid = false;
     }
+    if (isValid) {
+      if (conditionValue.isTrue) {
+        return trueValue;
+      } else if (conditionValue.isFalse) {
+        return falseValue;
+      }
+    }
+    return new NonConstantValue();
   }
 
   @override
@@ -1364,6 +1654,19 @@
 
   FromEnvironmentConstantExpression(this.name, this.defaultValue);
 
+  bool _checkNameFromEnvironment(EvaluationEnvironment environment,
+      ConstantExpression name, ConstantValue nameValue) {
+    if (!nameValue.isString) {
+      environment.reportError(
+          name, MessageKind.INVALID_FROM_ENVIRONMENT_NAME_TYPE, {
+        'constant': name,
+        'type': nameValue.getType(environment.commonElements)
+      });
+      return false;
+    }
+    return true;
+  }
+
   @override
   int _computeHashCode() {
     return 13 * name.hashCode + 17 * defaultValue.hashCode;
@@ -1425,19 +1728,34 @@
     } else {
       defaultConstantValue = constantSystem.createBool(false);
     }
-    if (!nameConstantValue.isString) {
+    if (!nameConstantValue.isConstant || !defaultConstantValue.isConstant) {
       return new NonConstantValue();
     }
-    StringConstantValue nameStringConstantValue = nameConstantValue;
-    String text =
-        environment.readFromEnvironment(nameStringConstantValue.primitiveValue);
-    if (text == 'true') {
-      return constantSystem.createBool(true);
-    } else if (text == 'false') {
-      return constantSystem.createBool(false);
-    } else {
-      return defaultConstantValue;
+    bool isValid =
+        _checkNameFromEnvironment(environment, name, nameConstantValue);
+    if (defaultValue != null) {
+      if (!defaultConstantValue.isBool && !defaultConstantValue.isNull) {
+        environment.reportError(defaultValue,
+            MessageKind.INVALID_BOOL_FROM_ENVIRONMENT_DEFAULT_VALUE_TYPE, {
+          'constant': defaultValue,
+          'type': defaultConstantValue.getType(environment.commonElements)
+        });
+        isValid = false;
+      }
     }
+    if (isValid) {
+      StringConstantValue nameStringConstantValue = nameConstantValue;
+      String text = environment
+          .readFromEnvironment(nameStringConstantValue.primitiveValue);
+      if (text == 'true') {
+        return constantSystem.createBool(true);
+      } else if (text == 'false') {
+        return constantSystem.createBool(false);
+      } else {
+        return defaultConstantValue;
+      }
+    }
+    return new NonConstantValue();
   }
 
   ConstantExpression apply(NormalizedArguments arguments) {
@@ -1489,21 +1807,36 @@
     } else {
       defaultConstantValue = constantSystem.createNull();
     }
-    if (!nameConstantValue.isString) {
+    if (!nameConstantValue.isConstant || !defaultConstantValue.isConstant) {
       return new NonConstantValue();
     }
-    StringConstantValue nameStringConstantValue = nameConstantValue;
-    String text =
-        environment.readFromEnvironment(nameStringConstantValue.primitiveValue);
-    int value;
-    if (text != null) {
-      value = int.parse(text, onError: (_) => null);
+    bool isValid =
+        _checkNameFromEnvironment(environment, name, nameConstantValue);
+    if (defaultValue != null) {
+      if (!defaultConstantValue.isInt && !defaultConstantValue.isNull) {
+        environment.reportError(defaultValue,
+            MessageKind.INVALID_INT_FROM_ENVIRONMENT_DEFAULT_VALUE_TYPE, {
+          'constant': defaultValue,
+          'type': defaultConstantValue.getType(environment.commonElements)
+        });
+        isValid = false;
+      }
     }
-    if (value == null) {
-      return defaultConstantValue;
-    } else {
-      return constantSystem.createInt(value);
+    if (isValid) {
+      StringConstantValue nameStringConstantValue = nameConstantValue;
+      String text = environment
+          .readFromEnvironment(nameStringConstantValue.primitiveValue);
+      int value;
+      if (text != null) {
+        value = int.parse(text, onError: (_) => null);
+      }
+      if (value == null) {
+        return defaultConstantValue;
+      } else {
+        return constantSystem.createInt(value);
+      }
     }
+    return new NonConstantValue();
   }
 
   ConstantExpression apply(NormalizedArguments arguments) {
@@ -1555,17 +1888,32 @@
     } else {
       defaultConstantValue = constantSystem.createNull();
     }
-    if (!nameConstantValue.isString) {
+    if (!nameConstantValue.isConstant || !defaultConstantValue.isConstant) {
       return new NonConstantValue();
     }
-    StringConstantValue nameStringConstantValue = nameConstantValue;
-    String text =
-        environment.readFromEnvironment(nameStringConstantValue.primitiveValue);
-    if (text == null) {
-      return defaultConstantValue;
-    } else {
-      return constantSystem.createString(text);
+    bool isValid =
+        _checkNameFromEnvironment(environment, name, nameConstantValue);
+    if (defaultValue != null) {
+      if (!defaultConstantValue.isString && !defaultConstantValue.isNull) {
+        environment.reportError(defaultValue,
+            MessageKind.INVALID_STRING_FROM_ENVIRONMENT_DEFAULT_VALUE_TYPE, {
+          'constant': defaultValue,
+          'type': defaultConstantValue.getType(environment.commonElements)
+        });
+        isValid = false;
+      }
     }
+    if (isValid) {
+      StringConstantValue nameStringConstantValue = nameConstantValue;
+      String text = environment
+          .readFromEnvironment(nameStringConstantValue.primitiveValue);
+      if (text == null) {
+        return defaultConstantValue;
+      } else {
+        return constantSystem.createString(text);
+      }
+    }
+    return new NonConstantValue();
   }
 
   ConstantExpression apply(NormalizedArguments arguments) {
diff --git a/pkg/compiler/lib/src/constants/values.dart b/pkg/compiler/lib/src/constants/values.dart
index 73e39c1..5fbe60f 100644
--- a/pkg/compiler/lib/src/constants/values.dart
+++ b/pkg/compiler/lib/src/constants/values.dart
@@ -710,19 +710,24 @@
 
   ConstantValueKind get kind => ConstantValueKind.CONSTRUCTED;
 
+  Iterable<FieldEntity> get _fieldsSortedByName {
+    return fields.keys.toList()..sort((a, b) => a.name.compareTo(b.name));
+  }
+
   String toDartText() {
     StringBuffer sb = new StringBuffer();
     sb.write(type.element.name);
     _unparseTypeArguments(sb);
     sb.write('(');
     int i = 0;
-    fields.forEach((FieldEntity field, ConstantValue value) {
+    for (FieldEntity field in _fieldsSortedByName) {
+      ConstantValue value = fields[field];
       if (i > 0) sb.write(',');
       sb.write(field.name);
       sb.write('=');
       sb.write(value.toDartText());
       i++;
-    });
+    }
     sb.write(')');
     return sb.toString();
   }
@@ -733,13 +738,14 @@
     sb.write(type);
     sb.write('(');
     int i = 0;
-    fields.forEach((FieldEntity field, ConstantValue value) {
+    for (FieldEntity field in _fieldsSortedByName) {
+      ConstantValue value = fields[field];
       if (i > 0) sb.write(',');
       sb.write(field.name);
       sb.write('=');
       sb.write(value.toStructuredText());
       i++;
-    });
+    }
     sb.write('))');
     return sb.toString();
   }
diff --git a/pkg/compiler/lib/src/dart2js.dart b/pkg/compiler/lib/src/dart2js.dart
index afdb303..61b5013 100644
--- a/pkg/compiler/lib/src/dart2js.dart
+++ b/pkg/compiler/lib/src/dart2js.dart
@@ -579,7 +579,7 @@
   }
 
   Uri script = currentDirectory.resolve(arguments[0]);
-  if (useKernel && script.path.endsWith('.dill')) {
+  if (useKernel) {
     diagnosticHandler.autoReadFileUri = true;
   }
   CompilerOptions compilerOptions = new CompilerOptions.parse(
diff --git a/pkg/compiler/lib/src/diagnostics/messages.dart b/pkg/compiler/lib/src/diagnostics/messages.dart
index ac290bf..9a26d9a 100644
--- a/pkg/compiler/lib/src/diagnostics/messages.dart
+++ b/pkg/compiler/lib/src/diagnostics/messages.dart
@@ -16,6 +16,7 @@
 
 import 'package:front_end/src/fasta/scanner.dart' show ErrorToken, Token;
 import 'generated/shared_messages.dart' as shared_messages;
+import '../constants/expressions.dart' show ConstantExpression;
 import 'invariant.dart' show failedAt;
 import 'spannable.dart' show CURRENT_ELEMENT_SPANNABLE;
 
@@ -201,13 +202,31 @@
   INVALID_AWAIT,
   INVALID_AWAIT_FOR,
   INVALID_AWAIT_FOR_IN,
+  INVALID_BOOL_FROM_ENVIRONMENT_DEFAULT_VALUE_TYPE,
   INVALID_BREAK,
   INVALID_CASE_DEFAULT,
+  INVALID_CONSTANT_ADD_TYPES,
+  INVALID_CONSTANT_BINARY_INT_TYPE,
+  INVALID_CONSTANT_BINARY_NUM_TYPE,
+  INVALID_CONSTANT_BINARY_PRIMITIVE_TYPE,
+  INVALID_CONSTANT_COMPLEMENT_TYPE,
+  INVALID_CONSTANT_CONDITIONAL_TYPE,
+  INVALID_CONSTANT_INDEX,
+  INVALID_CONSTANT_INTERPOLATION_TYPE,
+  INVALID_CONSTANT_NEGATE_TYPE,
+  INVALID_CONSTANT_NOT_TYPE,
+  INVALID_CONSTANT_NUM_ADD_TYPE,
+  INVALID_CONSTANT_STRING_ADD_TYPE,
+  INVALID_CONSTANT_STRING_LENGTH_TYPE,
   INVALID_CONSTRUCTOR_ARGUMENTS,
   INVALID_CONSTRUCTOR_NAME,
   INVALID_CONTINUE,
   INVALID_FOR_IN,
+  INVALID_FROM_ENVIRONMENT_NAME_TYPE,
   INVALID_INITIALIZER,
+  INVALID_INT_FROM_ENVIRONMENT_DEFAULT_VALUE_TYPE,
+  INVALID_LOGICAL_AND_OPERAND_TYPE,
+  INVALID_LOGICAL_OR_OPERAND_TYPE,
   INVALID_METADATA,
   INVALID_METADATA_GENERIC,
   INVALID_OVERRIDDEN_FIELD,
@@ -227,6 +246,7 @@
   INVALID_PARAMETER,
   INVALID_RECEIVER_IN_INITIALIZER,
   INVALID_SOURCE_FILE_LOCATION,
+  INVALID_STRING_FROM_ENVIRONMENT_DEFAULT_VALUE_TYPE,
   INVALID_SYMBOL,
   INVALID_INLINE_FUNCTION_TYPE,
   INVALID_SYNC_MODIFIER,
@@ -3505,6 +3525,116 @@
 """,
             }
           ]),
+      MessageKind.INVALID_CONSTANT_CONDITIONAL_TYPE: const MessageTemplate(
+          MessageKind.INVALID_CONSTANT_CONDITIONAL_TYPE,
+          "`#{constant}` of type '#{type}' is not a valid constant condition. "
+          "Must be a value of type 'bool'."),
+
+      MessageKind.INVALID_CONSTANT_INTERPOLATION_TYPE: const MessageTemplate(
+          MessageKind.INVALID_CONSTANT_INTERPOLATION_TYPE,
+          "`#{constant}` of type '#{type}' is not valid in constant string "
+          "interpolation. Must be a value of type 'bool', 'int', 'double', "
+          "or 'String'."),
+
+      MessageKind.INVALID_CONSTANT_BINARY_PRIMITIVE_TYPE: const MessageTemplate(
+          MessageKind.INVALID_CONSTANT_BINARY_PRIMITIVE_TYPE,
+          "`#{constant}` of type '#{type}' is not a valid operand of a "
+          "constant binary #{operator} expression. Must be a value of type "
+          "'bool', 'int', 'double', 'String', or 'Null'."),
+
+      MessageKind.INVALID_CONSTANT_STRING_ADD_TYPE: const MessageTemplate(
+          MessageKind.INVALID_CONSTANT_STRING_ADD_TYPE,
+          "`#{constant}` of type '#{type}' is not a valid operand of a "
+          "constant binary + expression on 'String'. Must be a value of type "
+          "'String'."),
+
+      MessageKind.INVALID_CONSTANT_STRING_LENGTH_TYPE: const MessageTemplate(
+          MessageKind.INVALID_CONSTANT_STRING_LENGTH_TYPE,
+          "`#{constant}` of type '#{type}' is not a valid operand for a "
+          ".length expression. Must be a value of type 'String'."),
+
+      MessageKind.INVALID_CONSTANT_NUM_ADD_TYPE: const MessageTemplate(
+          MessageKind.INVALID_CONSTANT_NUM_ADD_TYPE,
+          "`#{constant}` of type '#{type}' is not a valid operand of a "
+          "constant binary + expression on 'num'. Must be a value of type "
+          "'int' or 'double'."),
+
+      MessageKind.INVALID_CONSTANT_ADD_TYPES: const MessageTemplate(
+          MessageKind.INVALID_CONSTANT_ADD_TYPES,
+          "`#{leftConstant}` of type '#{leftType}' and "
+          "`#{rightConstant}` of type '#{rightType}' are not valid operands "
+          "of a constant binary + expression. Must both be either of "
+          "type 'String', or of types 'int' or 'double'."),
+
+      MessageKind.INVALID_CONSTANT_BINARY_NUM_TYPE: const MessageTemplate(
+          MessageKind.INVALID_CONSTANT_BINARY_NUM_TYPE,
+          "`#{constant}` of type '#{type}' is not a valid operand of a "
+          "constant binary #{operator} expression. Must be a value of type "
+          "'int' or 'double'."),
+
+      MessageKind.INVALID_CONSTANT_BINARY_INT_TYPE: const MessageTemplate(
+          MessageKind.INVALID_CONSTANT_BINARY_INT_TYPE,
+          "`#{constant}` of type '#{type}' is not a valid operand of a "
+          "constant binary #{operator} expression. Must be a value of type "
+          "'int'."),
+
+      MessageKind.INVALID_CONSTANT_NOT_TYPE: const MessageTemplate(
+          MessageKind.INVALID_CONSTANT_NOT_TYPE,
+          "`#{constant}` of type '#{type}' is not a valid operand of a "
+          "constant unary #{operator} expression. Must be a value of type "
+          "'bool'."),
+
+      MessageKind.INVALID_CONSTANT_NEGATE_TYPE: const MessageTemplate(
+          MessageKind.INVALID_CONSTANT_NEGATE_TYPE,
+          "`#{constant}` of type '#{type}' is not a valid operand of a "
+          "constant unary #{operator} expression. Must be a value of type "
+          "'int' or 'double'."),
+
+      MessageKind.INVALID_CONSTANT_COMPLEMENT_TYPE: const MessageTemplate(
+          MessageKind.INVALID_CONSTANT_COMPLEMENT_TYPE,
+          "`#{constant}` of type '#{type}' is not a valid operand of a "
+          "constant unary #{operator} expression. Must be a value of type "
+          "'int'."),
+
+      MessageKind.INVALID_CONSTANT_INDEX: const MessageTemplate(
+          MessageKind.INVALID_CONSTANT_INDEX,
+          "Index expressions are not allowed in constant expressions."),
+
+      MessageKind.INVALID_FROM_ENVIRONMENT_NAME_TYPE: const MessageTemplate(
+          MessageKind.INVALID_FROM_ENVIRONMENT_NAME_TYPE,
+          "`#{constant}` of type '#{type}' is not a valid environment name "
+          "constant. Must be a value of type 'String'."),
+
+      MessageKind.INVALID_BOOL_FROM_ENVIRONMENT_DEFAULT_VALUE_TYPE:
+          const MessageTemplate(
+              MessageKind.INVALID_BOOL_FROM_ENVIRONMENT_DEFAULT_VALUE_TYPE,
+              "`#{constant}` of type '#{type}' is not a valid "
+              "`bool.fromEnvironment` default value constant. "
+              "Must be a value of type 'bool' or `null`."),
+
+      MessageKind.INVALID_INT_FROM_ENVIRONMENT_DEFAULT_VALUE_TYPE:
+          const MessageTemplate(
+              MessageKind.INVALID_INT_FROM_ENVIRONMENT_DEFAULT_VALUE_TYPE,
+              "`#{constant}` of type '#{type}' is not a valid "
+              "`int.fromEnvironment` default value constant. "
+              "Must be a value of type 'int' or `null`."),
+
+      MessageKind.INVALID_STRING_FROM_ENVIRONMENT_DEFAULT_VALUE_TYPE:
+          const MessageTemplate(
+              MessageKind.INVALID_STRING_FROM_ENVIRONMENT_DEFAULT_VALUE_TYPE,
+              "`#{constant}` of type '#{type}' is not a valid "
+              "`String.fromEnvironment` default value constant. "
+              "Must be a value of type 'String' or `null`."),
+
+      MessageKind.INVALID_LOGICAL_AND_OPERAND_TYPE: const MessageTemplate(
+          MessageKind.INVALID_LOGICAL_AND_OPERAND_TYPE,
+          "`#{constant}` of type '#{type}' is not a valid logical and operand. "
+          "Must be a value of type 'bool'."),
+
+      MessageKind.INVALID_LOGICAL_OR_OPERAND_TYPE: const MessageTemplate(
+          MessageKind.INVALID_LOGICAL_OR_OPERAND_TYPE,
+          "`#{constant}` of type '#{type}' is not a valid logical and operand. "
+          "Must be a value of type 'bool'."),
 
       //////////////////////////////////////////////////////////////////////////////
       // Patch errors start.
@@ -3795,6 +3925,8 @@
       return value.assertionMessage;
     } else if (value is Token) {
       value = value.lexeme;
+    } else if (value is ConstantExpression) {
+      value = value.toDartText();
     }
     return '$value';
   }
diff --git a/pkg/compiler/lib/src/inferrer/ast_inferrer_engine.dart b/pkg/compiler/lib/src/inferrer/ast_inferrer_engine.dart
index a84cc67..e691238 100644
--- a/pkg/compiler/lib/src/inferrer/ast_inferrer_engine.dart
+++ b/pkg/compiler/lib/src/inferrer/ast_inferrer_engine.dart
@@ -46,6 +46,12 @@
     ast.Node body;
     if (resolvedAst.kind == ResolvedAstKind.PARSED) {
       body = resolvedAst.body;
+      if (member.isField &&
+          member.isInstanceMember &&
+          !member.isFinal &&
+          body is ast.LiteralNull) {
+        return null;
+      }
     }
     return body;
   }
diff --git a/pkg/compiler/lib/src/inferrer/builder.dart b/pkg/compiler/lib/src/inferrer/builder.dart
index c5df0f7..eccc765 100644
--- a/pkg/compiler/lib/src/inferrer/builder.dart
+++ b/pkg/compiler/lib/src/inferrer/builder.dart
@@ -1036,12 +1036,14 @@
       }
       if (!isConstructorRedirect) {
         // Iterate over all instance fields, and give a null type to
-        // fields that we haven'TypeInformation initialized for sure.
+        // fields that we haven't initialized for sure.
         cls.forEachInstanceField((_, FieldElement field) {
           if (field.isFinal) return;
           TypeInformation type = locals.fieldScope.readField(field);
           ResolvedAst resolvedAst = field.resolvedAst;
-          if (type == null && resolvedAst.body == null) {
+          if (type == null &&
+              (resolvedAst.body == null ||
+                  resolvedAst.body is ast.LiteralNull)) {
             inferrer.recordTypeOfField(field, types.nullType);
           }
         });
@@ -1072,7 +1074,7 @@
                 ? types.nonNullEmpty() // Body always throws.
                 : types.nullType;
           } else if (!locals.seenReturnOrThrow) {
-            // We haven'TypeInformation seen returns on all branches. So the method may
+            // We haven't seen returns on all branches. So the method may
             // also return null.
             recordReturnType(types.nullType);
           }
@@ -1108,7 +1110,7 @@
     // TODO(herhut): Analyze whether closure exposes this.
     isThisExposed = true;
     LocalFunctionElement element = elements.getFunctionDefinition(node);
-    // We don'TypeInformation put the closure in the work queue of the
+    // We don't put the closure in the work queue of the
     // inferrer, because it will share information with its enclosing
     // method, like for example the types of local variables.
     LocalsHandler closureLocals =
@@ -1167,7 +1169,7 @@
   }
 
   TypeInformation visitLiteralList(ast.LiteralList node) {
-    // We only set the type once. We don'TypeInformation need to re-visit the children
+    // We only set the type once. We don't need to re-visit the children
     // when re-analyzing the node.
     return inferrer.concreteTypes.putIfAbsent(node, () {
       TypeInformation elementType;
@@ -2351,7 +2353,7 @@
     TypeMask mask = memberData.typeOfSend(node);
     // In erroneous code the number of arguments in the selector might not
     // match the function element.
-    // TODO(polux): return nonNullEmpty and check it doesn'TypeInformation break anything
+    // TODO(polux): return nonNullEmpty and check it doesn't break anything
     if (target.isMalformed ||
         !callStructure.signatureApplies(target.parameterStructure)) {
       return types.dynamicType;
@@ -2894,7 +2896,7 @@
     if (Elements.isMalformed(element)) {
       recordReturnType(types.dynamicType);
     } else {
-      // We don'TypeInformation create a selector for redirecting factories, and
+      // We don't create a selector for redirecting factories, and
       // the send is just a property access. Therefore we must
       // manually create the [ArgumentsTypes] of the call, and
       // manually register [analyzedElement] as a caller of [element].
diff --git a/pkg/compiler/lib/src/inferrer/builder_kernel.dart b/pkg/compiler/lib/src/inferrer/builder_kernel.dart
index 4062371..28194d1 100644
--- a/pkg/compiler/lib/src/inferrer/builder_kernel.dart
+++ b/pkg/compiler/lib/src/inferrer/builder_kernel.dart
@@ -40,6 +40,7 @@
   final KernelToElementMapForBuilding _elementMap;
   final KernelToLocalsMap _localsMap;
   final GlobalTypeInferenceElementData<ir.Node> _memberData;
+  final bool _inGenerativeConstructor;
 
   LocalsHandler _locals;
   SideEffects _sideEffects = new SideEffects.empty();
@@ -49,6 +50,16 @@
       <JumpTarget, List<LocalsHandler>>{};
   TypeInformation _returnType;
 
+  /// Whether we currently collect [IsCheck]s.
+  bool _accumulateIsChecks = false;
+  bool _conditionIsSimple = false;
+
+  /// The [IsCheck]s that show us what types locals currently _are_.
+  List<IsCheck> _positiveIsChecks;
+
+  /// The [IsCheck]s that show us what types locals currently are _not_.
+  List<IsCheck> _negativeIsChecks;
+
   KernelTypeGraphBuilder(
       this._options,
       this._closedWorld,
@@ -60,13 +71,12 @@
       this._localsMap,
       [this._locals])
       : this._types = _inferrer.types,
-        this._memberData = _inferrer.dataOfMember(_analyzedMember) {
+        this._memberData = _inferrer.dataOfMember(_analyzedMember),
+        this._inGenerativeConstructor = _analyzedNode is ir.Constructor {
     if (_locals != null) return;
 
     FieldInitializationScope<ir.Node> fieldScope =
-        _analyzedNode is ir.Constructor
-            ? new FieldInitializationScope(_types)
-            : null;
+        _inGenerativeConstructor ? new FieldInitializationScope(_types) : null;
     _locals = new LocalsHandler(
         _inferrer, _types, _options, _analyzedNode, fieldScope);
   }
@@ -107,12 +117,22 @@
   }
 
   void initializationIsIndefinite() {
-    MemberEntity member = _analyzedMember;
-    if (member is ConstructorEntity && member.isGenerativeConstructor) {
+    if (_inGenerativeConstructor) {
       _locals.fieldScope.isIndefinite = true;
     }
   }
 
+  TypeInformation _thisType;
+  TypeInformation get thisType {
+    if (_thisType != null) return _thisType;
+    ClassEntity cls = _elementMap.getMemberThisType(_analyzedMember)?.element;
+    if (_closedWorld.isUsedAsMixin(cls)) {
+      return _thisType = _types.nonNullSubtype(cls);
+    } else {
+      return _thisType = _types.nonNullSubclass(cls);
+    }
+  }
+
   TypeInformation visit(ir.Node node) {
     return node == null ? null : node.accept(this);
   }
@@ -134,9 +154,56 @@
   }
 
   @override
-  TypeInformation visitFunctionNode(ir.FunctionNode node) {
-    // TODO(redemption): Handle native methods.
+  TypeInformation visitConstructor(ir.Constructor node) {
+    handleParameters(node.function);
+    node.initializers.forEach(visit);
+    visit(node.function.body);
 
+    ClassEntity cls = _analyzedMember.enclosingClass;
+    if (!(node.initializers.isNotEmpty &&
+        node.initializers.first is ir.RedirectingInitializer)) {
+      // Iterate over all instance fields, and give a null type to
+      // fields that we haven't initialized for sure.
+      _elementMap.elementEnvironment.forEachClassMember(cls,
+          (ClassEntity declarer, MemberEntity member) {
+        if (declarer != cls) return;
+        if (member.isField && member.isInstanceMember && member.isAssignable) {
+          TypeInformation type = _locals.fieldScope.readField(member);
+          MemberDefinition definition = _elementMap.getMemberDefinition(member);
+          assert(definition.kind == MemberKind.regular);
+          ir.Field node = definition.node;
+          if (type == null &&
+              (node.initializer == null ||
+                  node.initializer is ir.NullLiteral)) {
+            _inferrer.recordTypeOfField(member, _types.nullType);
+          }
+        }
+      });
+    }
+
+    if (cls.isAbstract) {
+      if (_closedWorld.isInstantiated(cls)) {
+        _returnType = _types.nonNullSubclass(cls);
+      } else {
+        // TODO(johnniwinther): Avoid analyzing [_analyzedMember] in this
+        // case; it's never called.
+        _returnType = _types.nonNullEmpty();
+      }
+    } else {
+      _returnType = _types.nonNullExact(cls);
+    }
+    return _returnType;
+  }
+
+  @override
+  visitFieldInitializer(ir.FieldInitializer node) {
+    TypeInformation rhsType = visit(node.value);
+    FieldEntity field = _elementMap.getField(node.field);
+    _locals.updateField(field, rhsType);
+    _inferrer.recordTypeOfField(field, rhsType);
+  }
+
+  void handleParameters(ir.FunctionNode node) {
     int position = 0;
     for (ir.VariableDeclaration parameter in node.positionalParameters) {
       handleParameter(parameter,
@@ -146,56 +213,44 @@
     for (ir.VariableDeclaration parameter in node.namedParameters) {
       handleParameter(parameter, isOptional: true);
     }
+  }
+
+  @override
+  TypeInformation visitFunctionNode(ir.FunctionNode node) {
+    // TODO(redemption): Handle native methods.
+    handleParameters(node);
     visit(node.body);
-    MemberEntity analyzedMember = _analyzedMember;
-    if (analyzedMember is ConstructorEntity &&
-        analyzedMember.isGenerativeConstructor) {
-      // TODO(redemption): Handle initializers.
-      ClassEntity cls = analyzedMember.enclosingClass;
-      if (cls.isAbstract) {
-        if (_closedWorld.isInstantiated(cls)) {
-          _returnType = _types.nonNullSubclass(cls);
-        } else {
-          // TODO(johnniwinther): Avoid analyzing [_analyzedMember] in this
-          // case; it's never called.
-          _returnType = _types.nonNullEmpty();
+    switch (node.asyncMarker) {
+      case ir.AsyncMarker.Sync:
+        if (_returnType == null) {
+          // No return in the body.
+          _returnType = _locals.seenReturnOrThrow
+              ? _types.nonNullEmpty() // Body always throws.
+              : _types.nullType;
+        } else if (!_locals.seenReturnOrThrow) {
+          // We haven'TypeInformation seen returns on all branches. So the
+          // method may also return null.
+          recordReturnType(_types.nullType);
         }
-      } else {
-        _returnType = _types.nonNullExact(cls);
-      }
-    } else {
-      switch (node.asyncMarker) {
-        case ir.AsyncMarker.Sync:
-          if (_returnType == null) {
-            // No return in the body.
-            _returnType = _locals.seenReturnOrThrow
-                ? _types.nonNullEmpty() // Body always throws.
-                : _types.nullType;
-          } else if (!_locals.seenReturnOrThrow) {
-            // We haven'TypeInformation seen returns on all branches. So the
-            // method may also return null.
-            recordReturnType(_types.nullType);
-          }
-          break;
+        break;
 
-        case ir.AsyncMarker.SyncStar:
-          // TODO(asgerf): Maybe make a ContainerTypeMask for these? The type
-          //               contained is the method body's return type.
-          recordReturnType(_types.syncStarIterableType);
-          break;
+      case ir.AsyncMarker.SyncStar:
+        // TODO(asgerf): Maybe make a ContainerTypeMask for these? The type
+        //               contained is the method body's return type.
+        recordReturnType(_types.syncStarIterableType);
+        break;
 
-        case ir.AsyncMarker.Async:
-          recordReturnType(_types.asyncFutureType);
-          break;
+      case ir.AsyncMarker.Async:
+        recordReturnType(_types.asyncFutureType);
+        break;
 
-        case ir.AsyncMarker.AsyncStar:
-          recordReturnType(_types.asyncStarStreamType);
-          break;
-        case ir.AsyncMarker.SyncYielding:
-          failedAt(
-              _analyzedMember, "Unexpected async marker: ${node.asyncMarker}");
-          break;
-      }
+      case ir.AsyncMarker.AsyncStar:
+        recordReturnType(_types.asyncStarStreamType);
+        break;
+      case ir.AsyncMarker.SyncYielding:
+        failedAt(
+            _analyzedMember, "Unexpected async marker: ${node.asyncMarker}");
+        break;
     }
     return _returnType;
   }
@@ -254,6 +309,24 @@
   }
 
   @override
+  TypeInformation visitMapLiteral(ir.MapLiteral node) {
+    return _inferrer.concreteTypes.putIfAbsent(node, () {
+      List keyTypes = [];
+      List valueTypes = [];
+
+      for (ir.MapEntry entry in node.entries) {
+        keyTypes.add(visit(entry.key));
+        valueTypes.add(visit(entry.value));
+      }
+
+      TypeInformation type =
+          node.isConst ? _types.constMapType : _types.mapType;
+      return _types.allocateMap(
+          type, node, _analyzedMember, keyTypes, valueTypes);
+    });
+  }
+
+  @override
   TypeInformation visitReturnStatement(ir.ReturnStatement node) {
     ir.Node expression = node.expression;
     recordReturnType(
@@ -264,6 +337,11 @@
   }
 
   @override
+  TypeInformation visitBoolLiteral(ir.BoolLiteral node) {
+    return _types.boolLiteralType(node.value);
+  }
+
+  @override
   TypeInformation visitIntLiteral(ir.IntLiteral node) {
     ConstantSystem constantSystem = _closedWorld.constantSystem;
     // The JavaScript backend may turn this literal into a double at
@@ -282,6 +360,17 @@
   }
 
   @override
+  TypeInformation visitStringLiteral(ir.StringLiteral node) {
+    return _types.stringLiteralType(node.value);
+  }
+
+  @override
+  TypeInformation visitStringConcatenation(ir.StringConcatenation node) {
+    node.visitChildren(this);
+    return _types.stringType;
+  }
+
+  @override
   TypeInformation visitVariableDeclaration(ir.VariableDeclaration node) {
     assert(
         node.parent is! ir.FunctionNode, "Unexpected parameter declaration.");
@@ -331,12 +420,14 @@
     TypeMask mask = _memberData.typeOfSend(node);
 
     ArgumentsTypes arguments = analyzeArguments(node.arguments);
-    if (selector.name == '==' || selector.name == '!=') {
+    if (selector.name == '==') {
       if (_types.isNull(receiverType)) {
-        // TODO(johnniwinther): Add null check.
+        // null == o
+        _potentiallyAddNullCheck(node, node.arguments.positional.first);
         return _types.boolType;
       } else if (_types.isNull(arguments.positional[0])) {
-        // TODO(johnniwinther): Add null check.
+        // o == null
+        _potentiallyAddNullCheck(node, node.receiver);
         return _types.boolType;
       }
     }
@@ -344,7 +435,7 @@
         CallType.access, node, selector, mask, receiverType, arguments);
   }
 
-  TypeInformation handleDynamicInvoke(
+  TypeInformation _handleDynamic(
       CallType callType,
       ir.Node node,
       Selector selector,
@@ -367,6 +458,30 @@
         inLoop: inLoop, isConditional: false);
   }
 
+  TypeInformation handleDynamicGet(ir.Node node, Selector selector,
+      TypeMask mask, TypeInformation receiverType) {
+    return _handleDynamic(
+        CallType.access, node, selector, mask, receiverType, null);
+  }
+
+  TypeInformation handleDynamicSet(ir.Node node, Selector selector,
+      TypeMask mask, TypeInformation receiverType, TypeInformation rhsType) {
+    ArgumentsTypes arguments = new ArgumentsTypes([rhsType], null);
+    return _handleDynamic(
+        CallType.access, node, selector, mask, receiverType, arguments);
+  }
+
+  TypeInformation handleDynamicInvoke(
+      CallType callType,
+      ir.Node node,
+      Selector selector,
+      TypeMask mask,
+      TypeInformation receiverType,
+      ArgumentsTypes arguments) {
+    return _handleDynamic(
+        callType, node, selector, mask, receiverType, arguments);
+  }
+
   @override
   TypeInformation visitLet(ir.Let node) {
     visit(node.variable);
@@ -503,4 +618,212 @@
           inLoop);
     }
   }
+
+  @override
+  TypeInformation visitPropertyGet(ir.PropertyGet node) {
+    TypeInformation receiverType = visit(node.receiver);
+    Selector selector = _elementMap.getSelector(node);
+    TypeMask mask = _memberData.typeOfSend(node);
+    // TODO(redemption): Use `node.interfaceTarget` to narrow the receiver type
+    // for --trust-type-annotations/strong-mode.
+    return handleDynamicGet(node, selector, mask, receiverType);
+  }
+
+  @override
+  TypeInformation visitPropertySet(ir.PropertySet node) {
+    TypeInformation rhsType = visit(node.value);
+    TypeInformation receiverType = visit(node.receiver);
+    Selector selector = _elementMap.getSelector(node);
+    TypeMask mask = _memberData.typeOfSend(node);
+    if (_inGenerativeConstructor && node.receiver is ir.ThisExpression) {
+      Iterable<MemberEntity> targets = _closedWorld.locateMembers(
+          selector, _types.newTypedSelector(receiverType, mask));
+      // We just recognized a field initialization of the form:
+      // `this.foo = 42`. If there is only one target, we can update
+      // its type.
+      if (targets.length == 1) {
+        MemberEntity single = targets.first;
+        if (single.isField) {
+          FieldEntity field = single;
+          _locals.updateField(field, rhsType);
+        }
+      }
+    }
+    handleDynamicSet(node, selector, mask, receiverType, rhsType);
+    return rhsType;
+  }
+
+  @override
+  TypeInformation visitThisExpression(ir.ThisExpression node) {
+    return thisType;
+  }
+
+  bool handleCondition(
+      ir.Node node, List<IsCheck> positiveTests, List<IsCheck> negativeTests) {
+    bool oldConditionIsSimple = _conditionIsSimple;
+    bool oldAccumulateIsChecks = _accumulateIsChecks;
+    List<IsCheck> oldPositiveIsChecks = _positiveIsChecks;
+    List<IsCheck> oldNegativeIsChecks = _negativeIsChecks;
+    _accumulateIsChecks = true;
+    _conditionIsSimple = true;
+    _positiveIsChecks = positiveTests;
+    _negativeIsChecks = negativeTests;
+    visit(node);
+    bool simpleCondition = _conditionIsSimple;
+    _accumulateIsChecks = oldAccumulateIsChecks;
+    _positiveIsChecks = oldPositiveIsChecks;
+    _negativeIsChecks = oldNegativeIsChecks;
+    _conditionIsSimple = oldConditionIsSimple;
+    return simpleCondition;
+  }
+
+  void _potentiallyAddIsCheck(ir.IsExpression node) {
+    if (!_accumulateIsChecks) return;
+    ir.Expression operand = node.operand;
+    if (operand is ir.VariableGet) {
+      _positiveIsChecks.add(new IsCheck(
+          node,
+          _localsMap.getLocalVariable(operand.variable),
+          _elementMap.getDartType(node.type)));
+    }
+  }
+
+  void _potentiallyAddNullCheck(
+      ir.MethodInvocation node, ir.Expression receiver) {
+    if (!_accumulateIsChecks) return;
+    if (receiver is ir.VariableGet) {
+      _positiveIsChecks.add(new IsCheck(
+          node, _localsMap.getLocalVariable(receiver.variable), null));
+    }
+  }
+
+  void _updateIsChecks(
+      List<IsCheck> positiveTests, List<IsCheck> negativeTests) {
+    for (IsCheck check in positiveTests) {
+      if (check.type != null) {
+        _locals.narrow(check.local, check.type, check.node);
+      } else {
+        DartType localType = _localsMap.getLocalType(_elementMap, check.local);
+        _locals.update(check.local, _types.nullType, check.node, localType);
+      }
+    }
+    for (IsCheck check in negativeTests) {
+      if (check.type != null) {
+        // TODO(johnniwinther): Use negative type knowledge.
+      } else {
+        _locals.narrow(
+            check.local, _closedWorld.commonElements.objectType, check.node);
+      }
+    }
+  }
+
+  @override
+  TypeInformation visitIfStatement(ir.IfStatement node) {
+    List<IsCheck> positiveTests = <IsCheck>[];
+    List<IsCheck> negativeTests = <IsCheck>[];
+    bool simpleCondition =
+        handleCondition(node.condition, positiveTests, negativeTests);
+    LocalsHandler saved = _locals;
+    _locals = new LocalsHandler.from(_locals, node);
+    _updateIsChecks(positiveTests, negativeTests);
+    visit(node.then);
+    LocalsHandler thenLocals = _locals;
+    _locals = new LocalsHandler.from(saved, node);
+    if (simpleCondition) {
+      _updateIsChecks(negativeTests, positiveTests);
+    }
+    visit(node.otherwise);
+    saved.mergeDiamondFlow(thenLocals, _locals);
+    _locals = saved;
+    return null;
+  }
+
+  @override
+  TypeInformation visitIsExpression(ir.IsExpression node) {
+    _potentiallyAddIsCheck(node);
+    visit(node.operand);
+    return _types.boolType;
+  }
+
+  @override
+  TypeInformation visitNot(ir.Not node) {
+    List<IsCheck> temp = _positiveIsChecks;
+    _positiveIsChecks = _negativeIsChecks;
+    _negativeIsChecks = temp;
+    visit(node.operand);
+    temp = _positiveIsChecks;
+    _positiveIsChecks = _negativeIsChecks;
+    _negativeIsChecks = temp;
+    return _types.boolType;
+  }
+
+  @override
+  TypeInformation visitLogicalExpression(ir.LogicalExpression node) {
+    if (node.operator == '&&') {
+      _conditionIsSimple = false;
+      bool oldAccumulateIsChecks = _accumulateIsChecks;
+      List<IsCheck> oldPositiveIsChecks = _positiveIsChecks;
+      List<IsCheck> oldNegativeIsChecks = _negativeIsChecks;
+      if (!_accumulateIsChecks) {
+        _accumulateIsChecks = true;
+        _positiveIsChecks = <IsCheck>[];
+        _negativeIsChecks = <IsCheck>[];
+      }
+      visit(node.left);
+      LocalsHandler saved = _locals;
+      _locals = new LocalsHandler.from(_locals, node);
+      _updateIsChecks(_positiveIsChecks, _negativeIsChecks);
+      LocalsHandler narrowed;
+      if (oldAccumulateIsChecks) {
+        narrowed = new LocalsHandler.topLevelCopyOf(_locals);
+      } else {
+        _accumulateIsChecks = false;
+        _positiveIsChecks = oldPositiveIsChecks;
+        _negativeIsChecks = oldNegativeIsChecks;
+      }
+      visit(node.right);
+      if (oldAccumulateIsChecks) {
+        bool invalidatedInRightHandSide(IsCheck check) {
+          return narrowed.locals[check.local] != _locals.locals[check.local];
+        }
+
+        _positiveIsChecks.removeWhere(invalidatedInRightHandSide);
+        _negativeIsChecks.removeWhere(invalidatedInRightHandSide);
+      }
+      saved.mergeDiamondFlow(_locals, null);
+      _locals = saved;
+      return _types.boolType;
+    } else if (node.operator == '||') {
+      _conditionIsSimple = false;
+      List<IsCheck> positiveIsChecks = <IsCheck>[];
+      List<IsCheck> negativeIsChecks = <IsCheck>[];
+      bool isSimple =
+          handleCondition(node.left, positiveIsChecks, negativeIsChecks);
+      LocalsHandler saved = _locals;
+      _locals = new LocalsHandler.from(_locals, node);
+      if (isSimple) {
+        _updateIsChecks(negativeIsChecks, positiveIsChecks);
+      }
+      bool oldAccumulateIsChecks = _accumulateIsChecks;
+      _accumulateIsChecks = false;
+      visit(node.right);
+      _accumulateIsChecks = oldAccumulateIsChecks;
+      saved.mergeDiamondFlow(_locals, null);
+      _locals = saved;
+      return _types.boolType;
+    }
+    failedAt(CURRENT_ELEMENT_SPANNABLE,
+        "Unexpected logical operator '${node.operator}'.");
+    return null;
+  }
+}
+
+class IsCheck {
+  final ir.Expression node;
+  final Local local;
+  final DartType type;
+
+  IsCheck(this.node, this.local, this.type);
+
+  String toString() => 'IsCheck($local,$type)';
 }
diff --git a/pkg/compiler/lib/src/inferrer/kernel_inferrer_engine.dart b/pkg/compiler/lib/src/inferrer/kernel_inferrer_engine.dart
index b2b1da2..896d285 100644
--- a/pkg/compiler/lib/src/inferrer/kernel_inferrer_engine.dart
+++ b/pkg/compiler/lib/src/inferrer/kernel_inferrer_engine.dart
@@ -167,12 +167,18 @@
       case MemberKind.regular:
         ir.Member node = definition.node;
         if (node is ir.Field) {
+          if (node.isInstanceMember &&
+              !node.isFinal &&
+              node.initializer is ir.NullLiteral) {
+            return null;
+          }
           return node.initializer;
         } else if (node is ir.Procedure) {
           return node.function;
         }
         break;
       case MemberKind.constructor:
+        return definition.node;
       case MemberKind.constructorBody:
         ir.Member node = definition.node;
         if (node is ir.Constructor) {
@@ -428,7 +434,7 @@
 
   @override
   TypeMask typeOfGetter(ir.Node node) {
-    throw new UnsupportedError(
-        'KernelGlobalTypeInferenceElementData.typeOfGetter');
+    if (_sendMap == null) return null;
+    return _sendMap[node];
   }
 }
diff --git a/pkg/compiler/lib/src/inferrer/type_system.dart b/pkg/compiler/lib/src/inferrer/type_system.dart
index 8888801..98115f3 100644
--- a/pkg/compiler/lib/src/inferrer/type_system.dart
+++ b/pkg/compiler/lib/src/inferrer/type_system.dart
@@ -440,7 +440,7 @@
     int inferredLength = isFixed ? length : null;
     TypeMask elementTypeMask =
         isElementInferred ? elementType.type : dynamicType.type;
-    ContainerTypeMask mask = new ContainerTypeMask(
+    ContainerTypeMask<T> mask = new ContainerTypeMask<T>(
         type.type, node, enclosing, elementTypeMask, inferredLength);
     ElementInContainerTypeInformation element =
         new ElementInContainerTypeInformation(currentMember, elementType);
diff --git a/pkg/compiler/lib/src/js_backend/backend.dart b/pkg/compiler/lib/src/js_backend/backend.dart
index ab7bcc6..3792cff 100644
--- a/pkg/compiler/lib/src/js_backend/backend.dart
+++ b/pkg/compiler/lib/src/js_backend/backend.dart
@@ -447,7 +447,7 @@
     _target = new JavaScriptBackendTarget(this);
     _mirrorsData = compiler.frontendStrategy.createMirrorsDataBuilder();
     _backendUsageBuilder = new BackendUsageBuilderImpl(commonElements);
-    _checkedModeHelpers = new CheckedModeHelpers(commonElements);
+    _checkedModeHelpers = new CheckedModeHelpers();
     emitter =
         new CodeEmitterTask(compiler, generateSourceMap, useStartupEmitter);
     jsInteropAnalysis = new JsInteropAnalysis(this);
diff --git a/pkg/compiler/lib/src/js_backend/checked_mode_helpers.dart b/pkg/compiler/lib/src/js_backend/checked_mode_helpers.dart
index 00df407..cd59725 100644
--- a/pkg/compiler/lib/src/js_backend/checked_mode_helpers.dart
+++ b/pkg/compiler/lib/src/js_backend/checked_mode_helpers.dart
@@ -110,9 +110,7 @@
 }
 
 class CheckedModeHelpers {
-  final CommonElements _commonElements;
-
-  CheckedModeHelpers(this._commonElements);
+  CheckedModeHelpers();
 
   /// All the checked mode helpers.
   static const List<CheckedModeHelper> helpers = const <CheckedModeHelper>[
@@ -164,8 +162,10 @@
    * the resolver with interface types (int, String, ...), and by the SSA
    * backend with implementation types (JSInt, JSString, ...).
    */
-  CheckedModeHelper getCheckedModeHelper(DartType type, {bool typeCast}) {
-    return getCheckedModeHelperInternal(type,
+  CheckedModeHelper getCheckedModeHelper(
+      DartType type, CommonElements commonElements,
+      {bool typeCast}) {
+    return getCheckedModeHelperInternal(type, commonElements,
         typeCast: typeCast, nativeCheckOnly: false);
   }
 
@@ -174,8 +174,10 @@
    * check/type cast on [type] at runtime. If no native helper exists for
    * [type], [:null:] is returned.
    */
-  CheckedModeHelper getNativeCheckedModeHelper(DartType type, {bool typeCast}) {
-    return getCheckedModeHelperInternal(type,
+  CheckedModeHelper getNativeCheckedModeHelper(
+      DartType type, CommonElements commonElements,
+      {bool typeCast}) {
+    return getCheckedModeHelperInternal(type, commonElements,
         typeCast: typeCast, nativeCheckOnly: true);
   }
 
@@ -183,9 +185,10 @@
    * Returns the checked mode helper for the type check/type cast for [type]. If
    * [nativeCheckOnly] is [:true:], only names for native helpers are returned.
    */
-  CheckedModeHelper getCheckedModeHelperInternal(DartType type,
+  CheckedModeHelper getCheckedModeHelperInternal(
+      DartType type, CommonElements commonElements,
       {bool typeCast, bool nativeCheckOnly}) {
-    String name = getCheckedModeHelperNameInternal(type,
+    String name = getCheckedModeHelperNameInternal(type, commonElements,
         typeCast: typeCast, nativeCheckOnly: nativeCheckOnly);
     if (name == null) return null;
     CheckedModeHelper helper = checkedModeHelperByName[name];
@@ -193,7 +196,8 @@
     return helper;
   }
 
-  String getCheckedModeHelperNameInternal(DartType type,
+  String getCheckedModeHelperNameInternal(
+      DartType type, CommonElements commonElements,
       {bool typeCast, bool nativeCheckOnly}) {
     assert(!type.isTypedef);
     if (type.isMalformed) {
@@ -223,57 +227,57 @@
     //  nativeCheckOnly || emitter.nativeEmitter.requiresNativeIsCheck(element);
 
     var suffix = typeCast ? 'TypeCast' : 'TypeCheck';
-    if (element == _commonElements.jsStringClass ||
-        element == _commonElements.stringClass) {
+    if (element == commonElements.jsStringClass ||
+        element == commonElements.stringClass) {
       if (nativeCheckOnly) return null;
       return 'string$suffix';
     }
 
-    if (element == _commonElements.jsDoubleClass ||
-        element == _commonElements.doubleClass) {
+    if (element == commonElements.jsDoubleClass ||
+        element == commonElements.doubleClass) {
       if (nativeCheckOnly) return null;
       return 'double$suffix';
     }
 
-    if (element == _commonElements.jsNumberClass ||
-        element == _commonElements.numClass) {
+    if (element == commonElements.jsNumberClass ||
+        element == commonElements.numClass) {
       if (nativeCheckOnly) return null;
       return 'num$suffix';
     }
 
-    if (element == _commonElements.jsBoolClass ||
-        element == _commonElements.boolClass) {
+    if (element == commonElements.jsBoolClass ||
+        element == commonElements.boolClass) {
       if (nativeCheckOnly) return null;
       return 'bool$suffix';
     }
 
-    if (element == _commonElements.jsIntClass ||
-        element == _commonElements.intClass ||
-        element == _commonElements.jsUInt32Class ||
-        element == _commonElements.jsUInt31Class ||
-        element == _commonElements.jsPositiveIntClass) {
+    if (element == commonElements.jsIntClass ||
+        element == commonElements.intClass ||
+        element == commonElements.jsUInt32Class ||
+        element == commonElements.jsUInt31Class ||
+        element == commonElements.jsPositiveIntClass) {
       if (nativeCheckOnly) return null;
       return 'int$suffix';
     }
 
-    if (_commonElements.isNumberOrStringSupertype(element)) {
+    if (commonElements.isNumberOrStringSupertype(element)) {
       return nativeCheck
           ? 'numberOrStringSuperNative$suffix'
           : 'numberOrStringSuper$suffix';
     }
 
-    if (_commonElements.isStringOnlySupertype(element)) {
+    if (commonElements.isStringOnlySupertype(element)) {
       return nativeCheck ? 'stringSuperNative$suffix' : 'stringSuper$suffix';
     }
 
-    if ((element == _commonElements.listClass ||
-            element == _commonElements.jsArrayClass) &&
+    if ((element == commonElements.listClass ||
+            element == commonElements.jsArrayClass) &&
         type.treatAsRaw) {
       if (nativeCheckOnly) return null;
       return 'list$suffix';
     }
 
-    if (_commonElements.isListSupertype(element)) {
+    if (commonElements.isListSupertype(element)) {
       return nativeCheck ? 'listSuperNative$suffix' : 'listSuper$suffix';
     }
 
diff --git a/pkg/compiler/lib/src/js_backend/impact_transformer.dart b/pkg/compiler/lib/src/js_backend/impact_transformer.dart
index 73d7b97..df96032 100644
--- a/pkg/compiler/lib/src/js_backend/impact_transformer.dart
+++ b/pkg/compiler/lib/src/js_backend/impact_transformer.dart
@@ -376,15 +376,15 @@
       // calls to [enqueue] with the resolution enqueuer serve as assertions
       // that the helper was in fact added.
       // TODO(13155): Find a way to enqueue helpers lazily.
-      CheckedModeHelper helper =
-          _checkedModeHelpers.getCheckedModeHelper(type, typeCast: false);
+      CheckedModeHelper helper = _checkedModeHelpers
+          .getCheckedModeHelper(type, _commonElements, typeCast: false);
       if (helper != null) {
         StaticUse staticUse = helper.getStaticUse(_commonElements);
         transformed.registerStaticUse(staticUse);
       }
       // We also need the native variant of the check (for DOM types).
-      helper =
-          _checkedModeHelpers.getNativeCheckedModeHelper(type, typeCast: false);
+      helper = _checkedModeHelpers
+          .getNativeCheckedModeHelper(type, _commonElements, typeCast: false);
       if (helper != null) {
         StaticUse staticUse = helper.getStaticUse(_commonElements);
         transformed.registerStaticUse(staticUse);
diff --git a/pkg/compiler/lib/src/js_emitter/code_emitter_task.dart b/pkg/compiler/lib/src/js_emitter/code_emitter_task.dart
index fcaa585..3249119 100644
--- a/pkg/compiler/lib/src/js_emitter/code_emitter_task.dart
+++ b/pkg/compiler/lib/src/js_emitter/code_emitter_task.dart
@@ -178,7 +178,8 @@
           backend.constants,
           backend.typeVariableCodegenAnalysis,
           backend.mirrorsData,
-          backend.rtiEncoder);
+          backend.rtiEncoder,
+          codegenWorldBuilder);
       typeTestRegistry = new TypeTestRegistry(
           codegenWorldBuilder, closedWorld, closedWorld.elementEnvironment);
     });
diff --git a/pkg/compiler/lib/src/js_emitter/full_emitter/container_builder.dart b/pkg/compiler/lib/src/js_emitter/full_emitter/container_builder.dart
index 4b71b45..e004058 100644
--- a/pkg/compiler/lib/src/js_emitter/full_emitter/container_builder.dart
+++ b/pkg/compiler/lib/src/js_emitter/full_emitter/container_builder.dart
@@ -148,21 +148,27 @@
     if (canBeReflected || canBeApplied) {
       expressions.addAll(task.metadataCollector.reifyDefaultArguments(member));
 
-      // TODO(redemption): Support entities.
-      MethodElement method = member;
-      method.functionSignature.forEachParameter((Element parameter) {
-        expressions.add(task.metadataCollector.reifyName(parameter.name));
-        if (backend.mirrorsData.mustRetainMetadata) {
-          Iterable<jsAst.Expression> metadataIndices =
-              parameter.metadata.map((MetadataAnnotation annotation) {
-            ConstantValue constant =
-                backend.constants.getConstantValueForMetadata(annotation);
-            codegenWorldBuilder.addCompileTimeConstantForEmission(constant);
-            return task.metadataCollector.reifyMetadata(annotation);
-          });
-          expressions.add(new jsAst.ArrayInitializer(metadataIndices.toList()));
-        }
-      });
+      if (member is MethodElement) {
+        member.functionSignature.forEachParameter((Element parameter) {
+          expressions.add(task.metadataCollector.reifyName(parameter.name));
+          if (backend.mirrorsData.mustRetainMetadata) {
+            Iterable<jsAst.Expression> metadataIndices =
+                parameter.metadata.map((MetadataAnnotation annotation) {
+              ConstantValue constant =
+                  backend.constants.getConstantValueForMetadata(annotation);
+              codegenWorldBuilder.addCompileTimeConstantForEmission(constant);
+              return task.metadataCollector.reifyMetadata(annotation);
+            });
+            expressions
+                .add(new jsAst.ArrayInitializer(metadataIndices.toList()));
+          }
+        });
+      } else {
+        codegenWorldBuilder.forEachParameter(member, (_, String name, _2) {
+          expressions.add(task.metadataCollector.reifyName(name));
+        });
+        // TODO(redemption): Support retaining mirrors metadata.
+      }
     }
     Name memberName = member.memberName;
     if (canBeReflected) {
diff --git a/pkg/compiler/lib/src/js_emitter/metadata_collector.dart b/pkg/compiler/lib/src/js_emitter/metadata_collector.dart
index fcddb20..c3db208 100644
--- a/pkg/compiler/lib/src/js_emitter/metadata_collector.dart
+++ b/pkg/compiler/lib/src/js_emitter/metadata_collector.dart
@@ -21,6 +21,8 @@
         MethodElement,
         MetadataAnnotation,
         ParameterElement;
+import '../elements/entities.dart' show FunctionEntity;
+
 import '../elements/entities.dart';
 import '../elements/resolution_types.dart' show ResolutionTypedefType;
 import '../elements/types.dart';
@@ -32,6 +34,7 @@
 import '../js_backend/type_variable_handler.dart'
     show TypeVariableCodegenAnalysis;
 import '../options.dart';
+import '../universe/world_builder.dart' show CodegenWorldBuilder;
 
 import 'code_emitter_task.dart' show Emitter;
 
@@ -146,6 +149,7 @@
   final TypeVariableCodegenAnalysis _typeVariableCodegenAnalysis;
   final MirrorsData _mirrorsData;
   final RuntimeTypesEncoder _rtiEncoder;
+  final CodegenWorldBuilder _codegenWorldBuilder;
 
   /// A token for a list of expressions that represent metadata, parameter names
   /// and type variable types.
@@ -177,7 +181,8 @@
       this._constants,
       this._typeVariableCodegenAnalysis,
       this._mirrorsData,
-      this._rtiEncoder) {
+      this._rtiEncoder,
+      this._codegenWorldBuilder) {
     _globalMetadataMap = new Map<String, _BoundMetadataEntry>();
   }
 
@@ -239,7 +244,21 @@
     });
   }
 
-  List<jsAst.DeferredNumber> reifyDefaultArguments(MethodElement function) {
+  List<jsAst.DeferredNumber> reifyDefaultArguments(FunctionEntity function) {
+    // TODO(sra): These are stored on the InstanceMethod or StaticDartMethod.
+    if (function is MethodElement) return reifyDefaultArgumentsAst(function);
+
+    List<jsAst.DeferredNumber> defaultValues = <jsAst.DeferredNumber>[];
+    _codegenWorldBuilder.forEachParameter(function,
+        (_, String name, ConstantValue constant) {
+      if (constant == null) return;
+      jsAst.Expression expression = _emitter.constantReference(constant);
+      defaultValues.add(_addGlobalMetadata(expression));
+    });
+    return defaultValues;
+  }
+
+  List<jsAst.DeferredNumber> reifyDefaultArgumentsAst(MethodElement function) {
     function = function.implementation;
     FunctionSignature signature = function.functionSignature;
     if (signature.optionalParameterCount == 0) return const [];
diff --git a/pkg/compiler/lib/src/js_model/closure.dart b/pkg/compiler/lib/src/js_model/closure.dart
index 72bcaaf..b260a40 100644
--- a/pkg/compiler/lib/src/js_model/closure.dart
+++ b/pkg/compiler/lib/src/js_model/closure.dart
@@ -32,9 +32,16 @@
       if (field.initializer == null) return null;
     }
 
+    bool hasThisLocal = false;
+    if (entity.isInstanceMember) {
+      hasThisLocal = true;
+    } else if (entity.isConstructor) {
+      ConstructorEntity constructor = entity;
+      hasThisLocal = !constructor.isFactoryConstructor;
+    }
     ScopeModel model = new ScopeModel();
-    CapturedScopeBuilder translator = new CapturedScopeBuilder(model,
-        hasThisLocal: entity.isInstanceMember || entity.isConstructor);
+    CapturedScopeBuilder translator =
+        new CapturedScopeBuilder(model, hasThisLocal: hasThisLocal);
     if (entity.isField) {
       if (node is ir.Field && node.initializer != null) {
         node.accept(translator);
@@ -589,7 +596,7 @@
 
     for (int i = 0; i < functionNode.positionalParameters.length; i++) {
       handleParameter(functionNode.positionalParameters[i],
-          isOptional: i < functionNode.requiredParameterCount);
+          isOptional: i >= functionNode.requiredParameterCount);
     }
     functionNode.namedParameters.toList()
       ..sort(namedOrdering)
diff --git a/pkg/compiler/lib/src/js_model/locals.dart b/pkg/compiler/lib/src/js_model/locals.dart
index e4b65ba..9e3d043 100644
--- a/pkg/compiler/lib/src/js_model/locals.dart
+++ b/pkg/compiler/lib/src/js_model/locals.dart
@@ -217,7 +217,7 @@
   @override
   defaultNode(ir.Node node) => node.visitChildren(this);
 
-  bool _canBeBreakTarget(ir.TreeNode node) {
+  static bool canBeBreakTarget(ir.TreeNode node) {
     return node is ir.ForStatement ||
         node is ir.ForInStatement ||
         node is ir.WhileStatement ||
@@ -225,8 +225,7 @@
         node is ir.SwitchStatement;
   }
 
-  bool _canBeContinueTarget(ir.TreeNode node) {
-    // TODO(johnniwinther): Add more.
+  static bool canBeContinueTarget(ir.TreeNode node) {
     return node is ir.ForStatement ||
         node is ir.ForInStatement ||
         node is ir.WhileStatement ||
@@ -238,7 +237,7 @@
     JJumpTarget target;
     ir.TreeNode body = node.target.body;
     ir.TreeNode parent = node.target.parent;
-    if (_canBeBreakTarget(body)) {
+    if (canBeBreakTarget(body)) {
       // We have code like
       //
       //     l1: for (int i = 0; i < 10; i++) {
@@ -251,7 +250,7 @@
       ir.TreeNode search = node;
       bool needsLabel = false;
       while (search != node.target) {
-        if (_canBeBreakTarget(search)) {
+        if (canBeBreakTarget(search)) {
           needsLabel = search != body;
           break;
         }
@@ -261,7 +260,7 @@
         JLabelDefinition label = _getOrCreateLabel(target, node.target);
         label.isBreakTarget = true;
       }
-    } else if (_canBeContinueTarget(parent)) {
+    } else if (canBeContinueTarget(parent)) {
       // We have code like
       //
       //     for (int i = 0; i < 10; i++) l1: {
@@ -275,7 +274,7 @@
       ir.TreeNode search = node;
       bool needsLabel = false;
       while (search != node.target) {
-        if (_canBeContinueTarget(search)) {
+        if (canBeContinueTarget(search)) {
           needsLabel = search != body;
           break;
         }
diff --git a/pkg/compiler/lib/src/kernel/dart2js_target.dart b/pkg/compiler/lib/src/kernel/dart2js_target.dart
index a12fd0c..e11bf46 100644
--- a/pkg/compiler/lib/src/kernel/dart2js_target.dart
+++ b/pkg/compiler/lib/src/kernel/dart2js_target.dart
@@ -37,6 +37,7 @@
         'dart:html',
         'dart:html_common',
         'dart:indexed_db',
+        'dart:io',
         'dart:js',
         'dart:js_util',
         'dart:mirrors',
diff --git a/pkg/compiler/lib/src/kernel/element_map_impl.dart b/pkg/compiler/lib/src/kernel/element_map_impl.dart
index 64e007f..8ca8fa6 100644
--- a/pkg/compiler/lib/src/kernel/element_map_impl.dart
+++ b/pkg/compiler/lib/src/kernel/element_map_impl.dart
@@ -440,9 +440,11 @@
   }
 
   @override
-  ConstantValue computeConstantValue(ConstantExpression constant,
+  ConstantValue computeConstantValue(
+      Spannable spannable, ConstantExpression constant,
       {bool requireConstant: true}) {
-    return _constantEnvironment.getConstantValue(constant);
+    return _constantEnvironment._getConstantValue(spannable, constant,
+        constantRequired: requireConstant);
   }
 
   DartType _substByContext(DartType type, InterfaceType context) {
@@ -1455,6 +1457,8 @@
 /// Visitor that converts kernel dart types into [DartType].
 class DartTypeConverter extends ir.DartTypeVisitor<DartType> {
   final KernelToElementMapBase elementMap;
+  final Set<ir.TypeParameter> currentFunctionTypeParameters =
+      new Set<ir.TypeParameter>();
   bool topLevel = true;
 
   DartTypeConverter(this.elementMap);
@@ -1483,12 +1487,18 @@
 
   @override
   DartType visitTypeParameterType(ir.TypeParameterType node) {
+    if (currentFunctionTypeParameters.contains(node.parameter)) {
+      // TODO(johnniwinther): Map function type parameters to a new
+      // [FunctionTypeParameter] type.
+      return const DynamicType();
+    }
     return new TypeVariableType(elementMap.getTypeVariable(node.parameter));
   }
 
   @override
   DartType visitFunctionType(ir.FunctionType node) {
-    return new FunctionType(
+    currentFunctionTypeParameters.addAll(node.typeParameters);
+    FunctionType type = new FunctionType(
         visitType(node.returnType),
         visitTypes(node.positionalParameters
             .take(node.requiredParameterCount)
@@ -1498,6 +1508,8 @@
             .toList()),
         node.namedParameters.map((n) => n.name).toList(),
         node.namedParameters.map((n) => visitType(n.type)).toList());
+    currentFunctionTypeParameters.removeAll(node.typeParameters);
+    return type;
   }
 
   @override
@@ -1562,9 +1574,17 @@
 
   @override
   ConstantValue getConstantValue(ConstantExpression expression) {
+    return _getConstantValue(CURRENT_ELEMENT_SPANNABLE, expression,
+        constantRequired: true);
+  }
+
+  ConstantValue _getConstantValue(
+      Spannable spannable, ConstantExpression expression,
+      {bool constantRequired}) {
     return _valueMap.putIfAbsent(expression, () {
       return expression.evaluate(
-          new _EvaluationEnvironment(_elementMap, _environment),
+          new KernelEvaluationEnvironment(_elementMap, _environment, spannable,
+              constantRequired: constantRequired),
           constantSystem);
     });
   }
@@ -1577,11 +1597,14 @@
 
 /// Evaluation environment used for computing [ConstantValue]s for
 /// kernel based [ConstantExpression]s.
-class _EvaluationEnvironment implements EvaluationEnvironment {
+class KernelEvaluationEnvironment extends EvaluationEnvironmentBase {
   final KernelToElementMapBase _elementMap;
   final Environment _environment;
 
-  _EvaluationEnvironment(this._elementMap, this._environment);
+  KernelEvaluationEnvironment(
+      this._elementMap, this._environment, Spannable spannable,
+      {bool constantRequired})
+      : super(spannable, constantRequired: constantRequired);
 
   @override
   CommonElements get commonElements => _elementMap.commonElements;
@@ -1610,6 +1633,9 @@
   String readFromEnvironment(String name) {
     return _environment.valueOf(name);
   }
+
+  @override
+  DiagnosticReporter get reporter => _elementMap.reporter;
 }
 
 class KernelResolutionWorldBuilder extends KernelResolutionWorldBuilderBase {
diff --git a/pkg/compiler/lib/src/kernel/element_map_mixins.dart b/pkg/compiler/lib/src/kernel/element_map_mixins.dart
index d997a6a..6a44dc6 100644
--- a/pkg/compiler/lib/src/kernel/element_map_mixins.dart
+++ b/pkg/compiler/lib/src/kernel/element_map_mixins.dart
@@ -30,7 +30,8 @@
   ElementEnvironment get elementEnvironment;
   LibraryEntity getLibrary(ir.Library node);
 
-  ConstantValue computeConstantValue(ConstantExpression constant,
+  ConstantValue computeConstantValue(
+      Spannable spannable, ConstantExpression constant,
       {bool requireConstant: true});
 
   @override
@@ -319,7 +320,13 @@
       }
       return null;
     }
-    return computeConstantValue(constant, requireConstant: requireConstant);
+    ConstantValue value = computeConstantValue(
+        computeSourceSpanFromTreeNode(node), constant,
+        requireConstant: requireConstant);
+    if (!value.isConstant && !requireConstant) {
+      return null;
+    }
+    return value;
   }
 
   /// Converts [annotations] into a list of [ConstantValue]s.
@@ -491,7 +498,7 @@
       elementMap.reporter.reportErrorMessage(
           computeSourceSpanFromTreeNode(failNode ?? node),
           MessageKind.NOT_A_COMPILE_TIME_CONSTANT);
-      return new NullConstantExpression();
+      return new ErroneousConstantExpression();
     }
     return constant;
   }
diff --git a/pkg/compiler/lib/src/kernel/env.dart b/pkg/compiler/lib/src/kernel/env.dart
index 26d8f27..771448b 100644
--- a/pkg/compiler/lib/src/kernel/env.dart
+++ b/pkg/compiler/lib/src/kernel/env.dart
@@ -685,8 +685,10 @@
     ConstantValue value = getFieldConstantValue(elementMap);
     assert(
         value != null,
-        failedAt(definition.member,
-            "Field ${definition.member} doesn't have a constant initial value."));
+        failedAt(
+            definition.member,
+            "Field ${definition.member} doesn't have a "
+            "constant initial value."));
     return value;
   }
 
diff --git a/pkg/compiler/lib/src/kernel/native_basic_data.dart b/pkg/compiler/lib/src/kernel/native_basic_data.dart
index ec07f7a..1af9b3d 100644
--- a/pkg/compiler/lib/src/kernel/native_basic_data.dart
+++ b/pkg/compiler/lib/src/kernel/native_basic_data.dart
@@ -99,12 +99,18 @@
         // For now, assume the library is a js-interop library.
         isJsLibrary = true;
 
-        ClassEntity superclass = elementEnvironment.getSuperClass(cls);
-        if (superclass != commonElements.jsJavaScriptObjectClass) {
+        bool implementsJsJavaScriptObjectClass = false;
+        elementEnvironment.forEachSupertype(cls, (InterfaceType supertype) {
+          if (supertype.element == commonElements.jsJavaScriptObjectClass) {
+            implementsJsJavaScriptObjectClass = true;
+          }
+        });
+        if (!implementsJsJavaScriptObjectClass) {
           reporter.reportErrorMessage(
-              cls,
-              MessageKind.JS_INTEROP_CLASS_CANNOT_EXTEND_DART_CLASS,
-              {'cls': cls.name, 'superclass': superclass.name});
+              cls, MessageKind.JS_INTEROP_CLASS_CANNOT_EXTEND_DART_CLASS, {
+            'cls': cls.name,
+            'superclass': elementEnvironment.getSuperClass(cls).name
+          });
         }
 
         elementEnvironment.forEachClassMember(cls,
@@ -140,12 +146,6 @@
                 constructor, memberName);
           }
 
-          if (!constructor.isExternal) {
-            reporter.reportErrorMessage(
-                constructor,
-                MessageKind.JS_INTEROP_CLASS_NON_EXTERNAL_MEMBER,
-                {'cls': cls.name, 'member': constructor.name});
-          }
           if (constructor.isFactoryConstructor && isAnonymous) {
             if (constructor.parameterStructure.requiredParameters > 0) {
               reporter.reportErrorMessage(
diff --git a/pkg/compiler/lib/src/parser/element_listener.dart b/pkg/compiler/lib/src/parser/element_listener.dart
index 592095a..638eec5 100644
--- a/pkg/compiler/lib/src/parser/element_listener.dart
+++ b/pkg/compiler/lib/src/parser/element_listener.dart
@@ -165,6 +165,17 @@
   }
 
   @override
+  void handleRecoverImport(
+      Token deferredKeyword, Token asKeyword, Token semicolon) {
+    popNode(); // combinators
+    if (asKeyword != null) {
+      popNode(); // prefix
+    }
+    popNode(); // conditionalUris
+    // TODO(danrubel): recover
+  }
+
+  @override
   void endDottedName(int count, Token token) {
     NodeList identifiers = makeNodeList(count, null, null, '.');
     pushNode(new DottedName(token, identifiers));
@@ -180,8 +191,7 @@
   }
 
   @override
-  void endConditionalUri(
-      Token ifToken, Token leftParen, Token equalSign, Token rightParen) {
+  void endConditionalUri(Token ifToken, Token leftParen, Token equalSign) {
     StringNode uri = popNode();
     LiteralString conditionValue = (equalSign != null) ? popNode() : null;
     DottedName identifier = popNode();
diff --git a/pkg/compiler/lib/src/parser/node_listener.dart b/pkg/compiler/lib/src/parser/node_listener.dart
index ecbf92c..90a58c6 100644
--- a/pkg/compiler/lib/src/parser/node_listener.dart
+++ b/pkg/compiler/lib/src/parser/node_listener.dart
@@ -65,6 +65,17 @@
   }
 
   @override
+  void handleRecoverImport(
+      Token deferredKeyword, Token asKeyword, Token semicolon) {
+    popNode(); // combinators
+    if (asKeyword != null) {
+      popNode(); // prefix
+    }
+    popNode(); // conditionalUris
+    // TODO(danrubel): recover
+  }
+
+  @override
   void endExport(Token exportKeyword, Token semicolon) {
     NodeList combinators = popNode();
     NodeList conditionalUris = popNode();
@@ -962,7 +973,7 @@
 
   @override
   void endForIn(Token awaitToken, Token forToken, Token leftParenthesis,
-      Token inKeyword, Token rightParenthesis, Token endToken) {
+      Token inKeyword, Token endToken) {
     Statement body = popNode();
     Expression expression = popNode();
     Node declaredIdentifier = popNode();
@@ -1023,7 +1034,7 @@
 
   @override
   void endAssert(Token assertKeyword, fasta.Assert kind, Token leftParenthesis,
-      Token commaToken, Token rightParenthesis, Token semicolonToken) {
+      Token commaToken, Token semicolonToken) {
     Node message;
     Node condition;
     if (commaToken != null) {
diff --git a/pkg/compiler/lib/src/resolution/class_hierarchy.dart b/pkg/compiler/lib/src/resolution/class_hierarchy.dart
index 7eec9b8..6233855 100644
--- a/pkg/compiler/lib/src/resolution/class_hierarchy.dart
+++ b/pkg/compiler/lib/src/resolution/class_hierarchy.dart
@@ -30,6 +30,7 @@
 import 'registry.dart' show ResolutionRegistry;
 import 'resolution_common.dart' show CommonResolverVisitor, MappingVisitor;
 import 'scope.dart' show Scope, TypeDeclarationScope;
+import 'type_resolver.dart' show FunctionTypeParameterScope;
 
 /// If `true` compatible mixin applications are shared within a library. This
 /// matches the mixins generated by fasta.
@@ -73,8 +74,9 @@
 
       TypeVariableElementX variableElement = typeVariable.element;
       if (typeNode.bound != null) {
-        ResolutionDartType boundType = typeResolver
-            .resolveNominalTypeAnnotation(this, typeNode.bound, const []);
+        ResolutionDartType boundType =
+            typeResolver.resolveNominalTypeAnnotation(
+                this, typeNode.bound, const FunctionTypeParameterScope());
         variableElement.boundCache = boundType;
 
         void checkTypeVariableBound() {
@@ -667,7 +669,8 @@
   }
 
   ResolutionDartType resolveNominalType(NominalTypeAnnotation node) {
-    return typeResolver.resolveNominalTypeAnnotation(this, node, const []);
+    return typeResolver.resolveNominalTypeAnnotation(
+        this, node, const FunctionTypeParameterScope());
   }
 
   ResolutionDartType resolveSupertype(
diff --git a/pkg/compiler/lib/src/resolution/members.dart b/pkg/compiler/lib/src/resolution/members.dart
index e6dff35..3a90000 100644
--- a/pkg/compiler/lib/src/resolution/members.dart
+++ b/pkg/compiler/lib/src/resolution/members.dart
@@ -52,6 +52,7 @@
 import 'scope.dart' show BlockScope, MethodScope, Scope;
 import 'send_structure.dart';
 import 'signatures.dart' show SignatureResolver;
+import 'type_resolver.dart' show FunctionTypeParameterScope;
 import 'variables.dart' show VariableDefinitionsVisitor;
 
 /// The state of constants in resolutions.
@@ -580,6 +581,7 @@
     function.functionSignature = SignatureResolver.analyze(
         resolution,
         scope,
+        const FunctionTypeParameterScope(),
         node.typeVariables,
         node.parameters,
         node.returnType,
@@ -4132,10 +4134,13 @@
   }
 
   ResolutionDartType resolveTypeAnnotation(TypeAnnotation node,
-      {bool malformedIsError: false,
+      {FunctionTypeParameterScope functionTypeParameters:
+          const FunctionTypeParameterScope(),
+      bool malformedIsError: false,
       bool deferredIsMalformed: true,
       bool registerCheckedModeCheck: true}) {
-    ResolutionDartType type = typeResolver.resolveTypeAnnotation(this, node,
+    ResolutionDartType type = typeResolver.resolveTypeAnnotation(
+        this, node, functionTypeParameters,
         malformedIsError: malformedIsError,
         deferredIsMalformed: deferredIsMalformed);
     if (registerCheckedModeCheck) {
diff --git a/pkg/compiler/lib/src/resolution/resolution.dart b/pkg/compiler/lib/src/resolution/resolution.dart
index 3267764..aabe838 100644
--- a/pkg/compiler/lib/src/resolution/resolution.dart
+++ b/pkg/compiler/lib/src/resolution/resolution.dart
@@ -61,6 +61,7 @@
 import 'signatures.dart';
 import 'tree_elements.dart';
 import 'typedefs.dart';
+import 'type_resolver.dart' show FunctionTypeParameterScope;
 
 class ResolverTask extends CompilerTask {
   final ConstantCompiler constantCompiler;
@@ -1042,6 +1043,7 @@
       return measure(() => SignatureResolver.analyze(
           resolution,
           element.enclosingElement.buildScope(),
+          const FunctionTypeParameterScope(),
           node.typeVariables,
           node.parameters,
           node.returnType,
diff --git a/pkg/compiler/lib/src/resolution/signatures.dart b/pkg/compiler/lib/src/resolution/signatures.dart
index ddc3528..36890b2 100644
--- a/pkg/compiler/lib/src/resolution/signatures.dart
+++ b/pkg/compiler/lib/src/resolution/signatures.dart
@@ -25,6 +25,7 @@
 import 'registry.dart' show ResolutionRegistry;
 import 'resolution_common.dart' show MappingVisitor;
 import 'scope.dart' show Scope, TypeVariablesScope;
+import 'type_resolver.dart' show FunctionTypeParameterScope;
 
 /**
  * [SignatureResolver] resolves function signatures.
@@ -35,22 +36,17 @@
   final Scope scope;
   final MessageKind defaultValuesError;
   final bool createRealParameters;
+  final FunctionTypeParameterScope functionTypeParameters;
   List<FormalElement> optionalParameters = const <FormalElement>[];
   int optionalParameterCount = 0;
   bool isOptionalParameter = false;
   bool optionalParametersAreNamed = false;
   VariableDefinitions currentDefinitions;
 
-  SignatureResolver(
-      Resolution resolution,
-      FunctionTypedElement enclosingElement,
-      Scope scope,
-      ResolutionRegistry registry,
-      {this.defaultValuesError,
-      this.createRealParameters})
-      : this.scope = scope,
-        this.enclosingElement = enclosingElement,
-        this.resolver = new ResolverVisitor(
+  SignatureResolver(Resolution resolution, this.enclosingElement, this.scope,
+      this.functionTypeParameters, ResolutionRegistry registry,
+      {this.defaultValuesError, this.createRealParameters})
+      : this.resolver = new ResolverVisitor(
             resolution, enclosingElement, registry,
             scope: scope),
         super(resolution, registry);
@@ -121,7 +117,8 @@
       FunctionSignature functionSignature = SignatureResolver.analyze(
           resolution,
           scope,
-          functionExpression.typeVariables,
+          functionTypeParameters.expand(functionExpression.typeVariables),
+          null, // Don't create type variable types for the type parameters.
           functionExpression.parameters,
           functionExpression.returnType,
           element,
@@ -310,6 +307,7 @@
   static FunctionSignature analyze(
       Resolution resolution,
       Scope scope,
+      FunctionTypeParameterScope functionTypeParameters,
       NodeList typeVariables,
       NodeList formalParameters,
       Node returnNode,
@@ -353,7 +351,7 @@
         createTypeVariables(typeVariables);
     scope = new FunctionSignatureBuildingScope(scope, typeVariableTypes);
     SignatureResolver visitor = new SignatureResolver(
-        resolution, element, scope, registry,
+        resolution, element, scope, functionTypeParameters, registry,
         defaultValuesError: defaultValuesError,
         createRealParameters: createRealParameters);
     List<FormalElement> parameters = const <FormalElement>[];
@@ -493,7 +491,8 @@
 
   ResolutionDartType resolveReturnType(TypeAnnotation annotation) {
     if (annotation == null) return const ResolutionDynamicType();
-    ResolutionDartType result = resolver.resolveTypeAnnotation(annotation);
+    ResolutionDartType result = resolver.resolveTypeAnnotation(annotation,
+        functionTypeParameters: functionTypeParameters);
     if (result == null) {
       return const ResolutionDynamicType();
     }
diff --git a/pkg/compiler/lib/src/resolution/type_resolver.dart b/pkg/compiler/lib/src/resolution/type_resolver.dart
index 3d45c9d..40d5dd9 100644
--- a/pkg/compiler/lib/src/resolution/type_resolver.dart
+++ b/pkg/compiler/lib/src/resolution/type_resolver.dart
@@ -74,34 +74,24 @@
     return element;
   }
 
-  ResolutionDartType resolveTypeAnnotation(
-      MappingVisitor visitor, TypeAnnotation node,
+  ResolutionDartType resolveTypeAnnotation(MappingVisitor visitor,
+      TypeAnnotation node, FunctionTypeParameterScope functionTypeParameters,
       {bool malformedIsError: false, bool deferredIsMalformed: true}) {
-    return _resolveTypeAnnotation(visitor, node, const [],
+    return _resolveTypeAnnotation(visitor, node, functionTypeParameters,
         malformedIsError: malformedIsError,
         deferredIsMalformed: deferredIsMalformed);
   }
 
-  // TODO(floitsch): the [visibleTypeParameterNames] is a hack to put
-  // type parameters in scope for the nested types.
-  //
-  // For example, in the following example, the generic type "A" would be stored
-  // in `visibleTypeParameterNames`.
-  // `typedef F = Function(List<A> Function<A>(A x))`.
-  //
-  // They are resolved to `dynamic` until dart2js supports generic methods.
   ResolutionDartType _resolveTypeAnnotation(MappingVisitor visitor,
-      TypeAnnotation node, List<List<String>> visibleTypeParameterNames,
+      TypeAnnotation node, FunctionTypeParameterScope functionTypeParameters,
       {bool malformedIsError: false, bool deferredIsMalformed: true}) {
     if (node.asNominalTypeAnnotation() != null) {
-      return resolveNominalTypeAnnotation(
-          visitor, node, visibleTypeParameterNames,
+      return resolveNominalTypeAnnotation(visitor, node, functionTypeParameters,
           malformedIsError: malformedIsError,
           deferredIsMalformed: deferredIsMalformed);
     }
     assert(node.asFunctionTypeAnnotation() != null);
-    return _resolveFunctionTypeAnnotation(
-        visitor, node, visibleTypeParameterNames,
+    return _resolveFunctionTypeAnnotation(visitor, node, functionTypeParameters,
         malformedIsError: malformedIsError,
         deferredIsMalformed: deferredIsMalformed);
   }
@@ -114,10 +104,9 @@
   /// However, it does work with nested generalized function types:
   ///   `foo(int Function(String) x)`.
   _FormalsTypeResolutionResult _resolveFormalTypes(MappingVisitor visitor,
-      NodeList formals, List<List<String>> visibleTypeParameterNames) {
+      NodeList formals, FunctionTypeParameterScope functionTypeParameters) {
     ResolutionDartType resolvePositionalType(VariableDefinitions node) {
-      return _resolveTypeAnnotation(
-          visitor, node.type, visibleTypeParameterNames);
+      return _resolveTypeAnnotation(visitor, node.type, functionTypeParameters);
     }
 
     void fillNamedTypes(NodeList namedFormals, List<String> names,
@@ -141,7 +130,7 @@
         ResolutionDartType type = node.type == null
             ? const ResolutionDynamicType()
             : _resolveTypeAnnotation(
-                visitor, node.type, visibleTypeParameterNames);
+                visitor, node.type, functionTypeParameters);
         names.add(name);
         types.add(type);
       }
@@ -186,26 +175,22 @@
         requiredTypes, orderedTypes, names, namedTypes);
   }
 
-  ResolutionFunctionType _resolveFunctionTypeAnnotation(MappingVisitor visitor,
-      FunctionTypeAnnotation node, List<List<String>> visibleTypeParameterNames,
-      {bool malformedIsError: false, bool deferredIsMalformed: true}) {
-    assert(visibleTypeParameterNames != null);
+  ResolutionFunctionType _resolveFunctionTypeAnnotation(
+      MappingVisitor visitor,
+      FunctionTypeAnnotation node,
+      FunctionTypeParameterScope functionTypeParameters,
+      {bool malformedIsError: false,
+      bool deferredIsMalformed: true}) {
+    assert(functionTypeParameters != null);
 
-    if (node.typeParameters != null) {
-      List<String> newTypeNames = node.typeParameters.map((_node) {
-        TypeVariable node = _node;
-        return node.name.asIdentifier().source;
-      }).toList();
-      visibleTypeParameterNames = visibleTypeParameterNames.toList()
-        ..add(newTypeNames);
-    }
+    functionTypeParameters = functionTypeParameters.expand(node.typeParameters);
 
     ResolutionDartType returnType = node.returnType == null
         ? const ResolutionDynamicType()
         : _resolveTypeAnnotation(
-            visitor, node.returnType, visibleTypeParameterNames);
+            visitor, node.returnType, functionTypeParameters);
     var formalTypes =
-        _resolveFormalTypes(visitor, node.formals, visibleTypeParameterNames);
+        _resolveFormalTypes(visitor, node.formals, functionTypeParameters);
     var result = new ResolutionFunctionType.generalized(
         returnType,
         formalTypes.requiredTypes,
@@ -213,12 +198,18 @@
         formalTypes.names,
         formalTypes.nameTypes);
     visitor.registry.useType(node, result);
+
+    functionTypeParameters = functionTypeParameters.parent;
+
     return result;
   }
 
-  ResolutionDartType resolveNominalTypeAnnotation(MappingVisitor visitor,
-      NominalTypeAnnotation node, List<List<String>> visibleTypeParameterNames,
-      {bool malformedIsError: false, bool deferredIsMalformed: true}) {
+  ResolutionDartType resolveNominalTypeAnnotation(
+      MappingVisitor visitor,
+      NominalTypeAnnotation node,
+      FunctionTypeParameterScope functionTypeParameters,
+      {bool malformedIsError: false,
+      bool deferredIsMalformed: true}) {
     ResolutionRegistry registry = visitor.registry;
 
     Identifier typeName;
@@ -227,7 +218,7 @@
     ResolutionDartType checkNoTypeArguments(ResolutionDartType type) {
       List<ResolutionDartType> arguments = new List<ResolutionDartType>();
       bool hasTypeArgumentMismatch = resolveTypeArguments(visitor, node,
-          const <ResolutionDartType>[], arguments, visibleTypeParameterNames);
+          const <ResolutionDartType>[], arguments, functionTypeParameters);
       if (hasTypeArgumentMismatch) {
         return new MalformedType(
             new ErroneousElementX(MessageKind.TYPE_ARGUMENT_COUNT_MISMATCH,
@@ -279,19 +270,16 @@
       }
       List<ResolutionDartType> arguments = <ResolutionDartType>[];
       resolveTypeArguments(visitor, node, const <ResolutionDartType>[],
-          arguments, visibleTypeParameterNames);
+          arguments, functionTypeParameters);
       return new MalformedType(
           erroneousElement, userProvidedBadType, arguments);
     }
 
     Element element;
-    // Resolve references to type names as dynamic.
-    // TODO(floitsch): this hackishly resolves generic function type arguments
-    // to dynamic.
-    if (prefixName == null &&
-        visibleTypeParameterNames.any((n) => n.contains(typeName.source))) {
-      type = const ResolutionDynamicType();
-    } else {
+    if (prefixName == null) {
+      type = functionTypeParameters.lookup(typeName.source);
+    }
+    if (type == null) {
       element = resolveTypeName(prefixName, typeName, visitor.scope,
           deferredIsMalformed: deferredIsMalformed);
     }
@@ -340,7 +328,7 @@
         cls.computeType(resolution);
         List<ResolutionDartType> arguments = <ResolutionDartType>[];
         bool hasTypeArgumentMismatch = resolveTypeArguments(visitor, node,
-            cls.typeVariables, arguments, visibleTypeParameterNames);
+            cls.typeVariables, arguments, functionTypeParameters);
         if (hasTypeArgumentMismatch) {
           type = new BadInterfaceType(
               cls.declaration,
@@ -363,7 +351,7 @@
         typdef.computeType(resolution);
         List<ResolutionDartType> arguments = <ResolutionDartType>[];
         bool hasTypeArgumentMismatch = resolveTypeArguments(visitor, node,
-            typdef.typeVariables, arguments, visibleTypeParameterNames);
+            typdef.typeVariables, arguments, functionTypeParameters);
         if (hasTypeArgumentMismatch) {
           type = new BadTypedefType(
               typdef,
@@ -441,7 +429,7 @@
       NominalTypeAnnotation node,
       List<ResolutionDartType> typeVariables,
       List<ResolutionDartType> arguments,
-      List<List<String>> visibleTypeParameterNames) {
+      FunctionTypeParameterScope functionTypeParameters) {
     if (node.typeArguments == null) {
       return false;
     }
@@ -457,7 +445,7 @@
         typeArgumentCountMismatch = true;
       }
       ResolutionDartType argType = _resolveTypeAnnotation(
-          visitor, typeArguments.head, visibleTypeParameterNames);
+          visitor, typeArguments.head, functionTypeParameters);
       // TODO(karlklose): rewrite to not modify [arguments].
       arguments.add(argType);
     }
@@ -469,3 +457,40 @@
     return typeArgumentCountMismatch;
   }
 }
+
+/// [FunctionTypeParameterScope] put type parameters in scope for the nested
+/// types.
+///
+/// For example, in the following examples, the generic types `A` would be stored
+/// in a [FunctionTypeParameterScope].
+///
+///     typedef F = List<A> Function<A>(A x)
+///     typedef F = Function(List<A> Function<A>(A x))
+///
+/// They are resolved to `dynamic` until dart2js supports generic methods.
+class FunctionTypeParameterScope {
+  final FunctionTypeParameterScope parent;
+  final Map<String, ResolutionDartType> _map;
+
+  const FunctionTypeParameterScope()
+      : parent = null,
+        _map = const {};
+
+  FunctionTypeParameterScope._(this.parent, this._map);
+
+  FunctionTypeParameterScope expand(NodeList typeParameters) {
+    if (typeParameters == null)
+      return new FunctionTypeParameterScope._(this, const {});
+    Map<String, ResolutionDartType> map = <String, ResolutionDartType>{};
+    for (TypeVariable node in typeParameters) {
+      /// TODO(johnniwinther): Create a special [FunctionTypeVariableType]
+      /// instead of [ResolutionDynamicType].
+      map[node.name.source] = const ResolutionDynamicType();
+    }
+    return new FunctionTypeParameterScope._(this, map);
+  }
+
+  ResolutionDartType lookup(String name) {
+    return _map[name] ?? parent?.lookup(name);
+  }
+}
diff --git a/pkg/compiler/lib/src/resolution/typedefs.dart b/pkg/compiler/lib/src/resolution/typedefs.dart
index 16823a0..e3e58ec 100644
--- a/pkg/compiler/lib/src/resolution/typedefs.dart
+++ b/pkg/compiler/lib/src/resolution/typedefs.dart
@@ -16,6 +16,7 @@
 import 'registry.dart' show ResolutionRegistry;
 import 'scope.dart' show MethodScope, TypeDeclarationScope;
 import 'signatures.dart' show SignatureResolver;
+import 'type_resolver.dart' show FunctionTypeParameterScope;
 
 class TypedefResolverVisitor extends TypeDefinitionVisitor {
   TypedefElementX get element => enclosingElement;
@@ -29,8 +30,18 @@
     scope = new TypeDeclarationScope(scope, element);
     resolveTypeVariableBounds(node.templateParameters);
 
-    FunctionSignature signature = SignatureResolver.analyze(resolution, scope,
-        node.typeParameters, node.formals, node.returnType, element, registry,
+    FunctionTypeParameterScope functionTypeParameters =
+        const FunctionTypeParameterScope().expand(node.typeParameters);
+
+    FunctionSignature signature = SignatureResolver.analyze(
+        resolution,
+        scope,
+        functionTypeParameters,
+        null, // Don't create type variable types for the type parameters.
+        node.formals,
+        node.returnType,
+        element,
+        registry,
         defaultValuesError: MessageKind.TYPEDEF_FORMAL_WITH_DEFAULT);
     element.functionSignature = signature;
 
diff --git a/pkg/compiler/lib/src/source_file_provider.dart b/pkg/compiler/lib/src/source_file_provider.dart
index f09b4d6..240044e 100644
--- a/pkg/compiler/lib/src/source_file_provider.dart
+++ b/pkg/compiler/lib/src/source_file_provider.dart
@@ -275,11 +275,15 @@
       api.Input file = provider.getUtf8SourceFile(uri);
       if (file == null &&
           autoReadFileUri &&
-          uri.scheme == 'file' &&
+          (uri.scheme == 'file' || !uri.isAbsolute) &&
           uri.path.endsWith('.dart')) {
+        if (!uri.isAbsolute) {
+          uri = provider.cwd.resolveUri(uri);
+        }
         // When reading from .dill files, the original source files haven't been
         // loaded. Load the file if possible to provide a better error message.
         file = provider.autoReadFromFile(uri);
+        print(' file=$file');
       }
       if (file is SourceFile) {
         print(file.getLocationMessage(color(message), begin, end,
diff --git a/pkg/compiler/lib/src/ssa/builder_kernel.dart b/pkg/compiler/lib/src/ssa/builder_kernel.dart
index 637e7b4..1189c45 100644
--- a/pkg/compiler/lib/src/ssa/builder_kernel.dart
+++ b/pkg/compiler/lib/src/ssa/builder_kernel.dart
@@ -1511,7 +1511,6 @@
 
     if (asExpression.type is ir.InvalidType) {
       generateTypeError(asExpression, 'invalid type');
-      stack.add(expressionInstruction);
       return;
     }
 
diff --git a/pkg/compiler/lib/src/ssa/codegen.dart b/pkg/compiler/lib/src/ssa/codegen.dart
index 13c8cb3..a4204e6 100644
--- a/pkg/compiler/lib/src/ssa/codegen.dart
+++ b/pkg/compiler/lib/src/ssa/codegen.dart
@@ -2937,11 +2937,12 @@
     if (node.isBooleanConversionCheck) {
       helper = const CheckedModeHelper('boolConversionCheck');
     } else {
-      helper = _checkedModeHelpers.getCheckedModeHelper(type,
+      helper = _checkedModeHelpers.getCheckedModeHelper(
+          type, _closedWorld.commonElements,
           typeCast: node.isCastTypeCheck);
     }
 
-    StaticUse staticUse = helper.getStaticUse(_commonElements);
+    StaticUse staticUse = helper.getStaticUse(_closedWorld.commonElements);
     _registry.registerStaticUse(staticUse);
     List<js.Expression> arguments = <js.Expression>[];
     use(node.checkedInput);
diff --git a/pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart b/pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart
index 27dde49..8d2e088 100644
--- a/pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart
+++ b/pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart
@@ -99,7 +99,8 @@
   }
 
   @override
-  ConstantValue computeConstantValue(ConstantExpression constant,
+  ConstantValue computeConstantValue(
+      Spannable spannable, ConstantExpression constant,
       {bool requireConstant: true}) {
     _compiler.backend.constants.evaluate(constant);
     ConstantValue value =
@@ -114,7 +115,7 @@
   @override
   ConstantValue getFieldConstantValue(covariant FieldElement element) {
     if (element.constant != null) {
-      return computeConstantValue(element.constant);
+      return computeConstantValue(element, element.constant);
     }
     return null;
   }
diff --git a/pkg/compiler/lib/src/types/container_type_mask.dart b/pkg/compiler/lib/src/types/container_type_mask.dart
index 2bda889..f16375f 100644
--- a/pkg/compiler/lib/src/types/container_type_mask.dart
+++ b/pkg/compiler/lib/src/types/container_type_mask.dart
@@ -28,13 +28,13 @@
   TypeMask nullable() {
     return isNullable
         ? this
-        : new ContainerTypeMask(forwardTo.nullable(), allocationNode,
+        : new ContainerTypeMask<T>(forwardTo.nullable(), allocationNode,
             allocationElement, elementType, length);
   }
 
   TypeMask nonNullable() {
     return isNullable
-        ? new ContainerTypeMask(forwardTo.nonNullable(), allocationNode,
+        ? new ContainerTypeMask<T>(forwardTo.nonNullable(), allocationNode,
             allocationElement, elementType, length)
         : this;
   }
@@ -70,7 +70,7 @@
           elementType.union(other.elementType, closedWorld);
       int newLength = (length == other.length) ? length : null;
       TypeMask newForwardTo = forwardTo.union(other.forwardTo, closedWorld);
-      return new ContainerTypeMask(
+      return new ContainerTypeMask<T>(
           newForwardTo,
           allocationNode == other.allocationNode ? allocationNode : null,
           allocationElement == other.allocationElement
diff --git a/pkg/compiler/lib/src/types/dictionary_type_mask.dart b/pkg/compiler/lib/src/types/dictionary_type_mask.dart
index 7784fe1..587fba5 100644
--- a/pkg/compiler/lib/src/types/dictionary_type_mask.dart
+++ b/pkg/compiler/lib/src/types/dictionary_type_mask.dart
@@ -12,13 +12,13 @@
  * [TypeGraphInferrer] has successfully identified such a usage. Otherwise,
  * the more general [MapTypeMask] is used.
  */
-class DictionaryTypeMask extends MapTypeMask {
+class DictionaryTypeMask<T> extends MapTypeMask<T> {
   // The underlying key/value map of this dictionary.
   final Map<String, TypeMask> typeMap;
 
   DictionaryTypeMask(
       TypeMask forwardTo,
-      Node allocationNode,
+      T allocationNode,
       MemberEntity allocationElement,
       TypeMask keyType,
       TypeMask valueType,
@@ -28,13 +28,13 @@
   TypeMask nullable() {
     return isNullable
         ? this
-        : new DictionaryTypeMask(forwardTo.nullable(), allocationNode,
+        : new DictionaryTypeMask<T>(forwardTo.nullable(), allocationNode,
             allocationElement, keyType, valueType, typeMap);
   }
 
   TypeMask nonNullable() {
     return isNullable
-        ? new DictionaryTypeMask(forwardTo.nonNullable(), allocationNode,
+        ? new DictionaryTypeMask<T>(forwardTo.nonNullable(), allocationNode,
             allocationElement, keyType, valueType, typeMap)
         : this;
   }
@@ -82,7 +82,7 @@
           mappings[k] = v.nullable();
         }
       });
-      return new DictionaryTypeMask(
+      return new DictionaryTypeMask<T>(
           newForwardTo, null, null, newKeyType, newValueType, mappings);
     } else if (other.isMap &&
         (other.keyType != null) &&
diff --git a/pkg/compiler/lib/src/types/masks.dart b/pkg/compiler/lib/src/types/masks.dart
index 15d17c8..4960ebc 100644
--- a/pkg/compiler/lib/src/types/masks.dart
+++ b/pkg/compiler/lib/src/types/masks.dart
@@ -9,7 +9,6 @@
 import '../constants/values.dart' show PrimitiveConstantValue;
 import '../elements/entities.dart';
 import '../inferrer/type_graph_inferrer.dart' show TypeGraphInferrer;
-import '../tree/tree.dart';
 import '../universe/selector.dart' show Selector;
 import '../universe/world_builder.dart'
     show
diff --git a/pkg/compiler/lib/src/world.dart b/pkg/compiler/lib/src/world.dart
index 4109631..9b43bf7 100644
--- a/pkg/compiler/lib/src/world.dart
+++ b/pkg/compiler/lib/src/world.dart
@@ -1159,12 +1159,23 @@
   }
 
   bool getMightBePassedToApply(FunctionEntity element) {
+    // We assume all functions reach Function.apply if no functions are
+    // registered so.  We get an empty set in two circumstances (1) a trivial
+    // program and (2) when compiling without type inference
+    // (i.e. --disable-type-inference). Returning `true` has consequences (extra
+    // metadata for Function.apply) only when Function.apply is also part of the
+    // program. It is an unusual trivial program that includes Function.apply
+    // but does not call it on a function.
+    //
+    // TODO(sra): We should reverse the sense of this set and register functions
+    // that we have proven do not reach Function.apply.
+    if (_functionsThatMightBePassedToApply.isEmpty) return true;
     return _functionsThatMightBePassedToApply.contains(element);
   }
 
   @override
   bool getCurrentlyKnownMightBePassedToApply(FunctionEntity element) {
-    return getMightBePassedToApply(element);
+    return _functionsThatMightBePassedToApply.contains(element);
   }
 
   @override
diff --git a/pkg/compiler/tool/status_files/update_all.sh b/pkg/compiler/tool/status_files/update_all.sh
index f982bd9..8bbaa36 100755
--- a/pkg/compiler/tool/status_files/update_all.sh
+++ b/pkg/compiler/tool/status_files/update_all.sh
@@ -10,7 +10,7 @@
 
 for arg in "$@"; do
   case $arg in
-    dart2js_native|dart2js_extra|language|language_2|corelib_2)
+    dart2js_native|dart2js_extra|language|language_2|corelib|corelib_2|html)
       suites="$suites $arg"
       ;;
     -*)
@@ -25,7 +25,7 @@
 done
 
 if [ -z "$suites" ]; then
-  suites="dart2js_native dart2js_extra language language_2 corelib_2"
+  suites="dart2js_native dart2js_extra language language_2 corelib corelib_2 html"
 fi
 
 repodir=$(cd $(dirname ${BASH_SOURCE[0]})/../../../../; pwd)
@@ -37,15 +37,19 @@
 
 function update_suite {
   local suite=$1
+  local runtime="d8"
+  if [ "$suite" == "html" ]; then
+    runtime="drt"
+  fi
   echo -e "\nupdate suite: $suite"
   echo "  - minified tests"
-  ./tools/test.py -m release -c dart2js -r d8 --dart2js-batch \
+  ./tools/test.py -m release -c dart2js -r $runtime --dart2js-batch \
       --use-sdk --minified --dart2js-with-kernel \
       $suite > $tmp/$suite-minified.txt
   $dart $update_script minified $tmp/$suite-minified.txt
 
   echo "  - host-checked tests"
-  ./tools/test.py -m release -c dart2js -r d8 --dart2js-batch --host-checked \
+  ./tools/test.py -m release -c dart2js -r $runtime --dart2js-batch --host-checked \
     --dart2js-options="--library-root=$sdk" --dart2js-with-kernel \
     $suite > $tmp/$suite-checked.txt
   $dart $update_script checked $tmp/$suite-checked.txt
diff --git a/pkg/compiler/tool/status_files/update_from_log.dart b/pkg/compiler/tool/status_files/update_from_log.dart
index 08a119d..8dacd5a 100644
--- a/pkg/compiler/tool/status_files/update_from_log.dart
+++ b/pkg/compiler/tool/status_files/update_from_log.dart
@@ -36,11 +36,12 @@
   'corelib_2': 'tests/corelib_2/corelib_2.status',
   'dart2js_extra': 'tests/compiler/dart2js_extra/dart2js_extra.status',
   'dart2js_native': 'tests/compiler/dart2js_native/dart2js_native.status',
+  'html': 'tests/html/html.status',
 };
 
 main(args) {
   if (args.length < 2) {
-    print('usage: udpate_from_log.dart <mode> log.txt');
+    print('usage: update_from_log.dart <mode> log.txt');
     print('  where mode is one of these values: ${configurations.keys}');
     exit(1);
   }
diff --git a/pkg/dev_compiler/lib/js/amd/dart_sdk.js b/pkg/dev_compiler/lib/js/amd/dart_sdk.js
index 93be236..0b676fb 100644
--- a/pkg/dev_compiler/lib/js/amd/dart_sdk.js
+++ b/pkg/dev_compiler/lib/js/amd/dart_sdk.js
@@ -32,7 +32,7 @@
   const web_audio = Object.create(null);
   const web_gl = Object.create(null);
   const web_sql = Object.create(null);
-  const nativewrappers = Object.create(null);
+  const _http = Object.create(null);
   const $hashCode = dartx.hashCode = Symbol("dartx.hashCode");
   const $_equals = dartx._equals = Symbol("dartx._equals");
   const $toString = dartx.toString = Symbol("dartx.toString");
@@ -2669,7 +2669,6 @@
   let JSIndexableOfString = () => (JSIndexableOfString = dart.constFn(_interceptors.JSIndexable$(core.String)))();
   let MatchToString = () => (MatchToString = dart.constFn(dart.fnTypeFuzzy(core.String, [core.Match])))();
   let StringToString = () => (StringToString = dart.constFn(dart.fnTypeFuzzy(core.String, [core.String])))();
-  let dynamicTobool = () => (dynamicTobool = dart.constFn(dart.fnTypeFuzzy(core.bool, [dart.dynamic])))();
   let ListMixin = () => (ListMixin = dart.constFn(collection.ListMixin$()))();
   let ListBase = () => (ListBase = dart.constFn(collection.ListBase$()))();
   let UnmodifiableListMixin = () => (UnmodifiableListMixin = dart.constFn(_internal.UnmodifiableListMixin$()))();
@@ -2732,7 +2731,7 @@
   let _FutureOfString = () => (_FutureOfString = dart.constFn(async._Future$(core.String)))();
   let _FutureOfbool = () => (_FutureOfbool = dart.constFn(async._Future$(core.bool)))();
   let _FutureOfint = () => (_FutureOfint = dart.constFn(async._Future$(core.int)))();
-  let dynamicTobool$ = () => (dynamicTobool$ = dart.constFn(dart.fnTypeFuzzy(core.bool, [dart.dynamic])))();
+  let dynamicTobool = () => (dynamicTobool = dart.constFn(dart.fnTypeFuzzy(core.bool, [dart.dynamic])))();
   let VoidToObject = () => (VoidToObject = dart.constFn(dart.fnTypeFuzzy(core.Object, [])))();
   let Stream = () => (Stream = dart.constFn(async.Stream$()))();
   let VoidTovoid = () => (VoidTovoid = dart.constFn(dart.fnTypeFuzzy(dart.void, [])))();
@@ -2796,7 +2795,7 @@
   let _AsyncCompleter = () => (_AsyncCompleter = dart.constFn(async._AsyncCompleter$()))();
   let _SyncCompleter = () => (_SyncCompleter = dart.constFn(async._SyncCompleter$()))();
   let _FutureListener = () => (_FutureListener = dart.constFn(async._FutureListener$()))();
-  let dynamicTobool$0 = () => (dynamicTobool$0 = dart.constFn(dart.fnTypeFuzzy(core.bool, [dart.dynamic])))();
+  let dynamicTobool$ = () => (dynamicTobool$ = dart.constFn(dart.fnTypeFuzzy(core.bool, [dart.dynamic])))();
   let VoidTodynamic$ = () => (VoidTodynamic$ = dart.constFn(dart.fnTypeFuzzy(dart.dynamic, [])))();
   let _Future = () => (_Future = dart.constFn(async._Future$()))();
   let StreamSubscription = () => (StreamSubscription = dart.constFn(async.StreamSubscription$()))();
@@ -3036,63 +3035,19 @@
   let FutureOrOfFile = () => (FutureOrOfFile = dart.constFn(async.FutureOr$(io.File)))();
   let FutureOfFile = () => (FutureOfFile = dart.constFn(async.Future$(io.File)))();
   let FutureOfint = () => (FutureOfint = dart.constFn(async.Future$(core.int)))();
-  let StreamOfHttpRequest = () => (StreamOfHttpRequest = dart.constFn(async.Stream$(io.HttpRequest)))();
-  let ListOfRedirectInfo = () => (ListOfRedirectInfo = dart.constFn(core.List$(io.RedirectInfo)))();
-  let HashMapOfString$ListOfString = () => (HashMapOfString$ListOfString = dart.constFn(collection.HashMap$(core.String, ListOfString())))();
-  let ListOfCookie = () => (ListOfCookie = dart.constFn(core.List$(io.Cookie)))();
-  let StringAndListOfStringTovoid = () => (StringAndListOfStringTovoid = dart.constFn(dart.fnTypeFuzzy(dart.void, [core.String, ListOfString()])))();
-  let FutureOfHttpClientResponse = () => (FutureOfHttpClientResponse = dart.constFn(async.Future$(io.HttpClientResponse)))();
-  let FutureOrOfHttpClientResponse = () => (FutureOrOfHttpClientResponse = dart.constFn(async.FutureOr$(io.HttpClientResponse)))();
-  let _StreamSinkImpl = () => (_StreamSinkImpl = dart.constFn(io._StreamSinkImpl$()))();
-  let _HttpOutboundMessage = () => (_HttpOutboundMessage = dart.constFn(io._HttpOutboundMessage$()))();
-  let CompleterOfHttpClientResponse = () => (CompleterOfHttpClientResponse = dart.constFn(async.Completer$(io.HttpClientResponse)))();
-  let JSArrayOfRedirectInfo = () => (JSArrayOfRedirectInfo = dart.constFn(_interceptors.JSArray$(io.RedirectInfo)))();
-  let JSArrayOfFuture = () => (JSArrayOfFuture = dart.constFn(_interceptors.JSArray$(async.Future)))();
-  let CompleterOfSocket = () => (CompleterOfSocket = dart.constFn(async.Completer$(io.Socket)))();
-  let StreamConsumerOfListOfint = () => (StreamConsumerOfListOfint = dart.constFn(async.StreamConsumer$(ListOfint())))();
-  let CompleterOf_HttpIncoming = () => (CompleterOf_HttpIncoming = dart.constFn(async.Completer$(io._HttpIncoming)))();
-  let FutureOfSecureSocket = () => (FutureOfSecureSocket = dart.constFn(async.Future$(io.SecureSocket)))();
-  let X509CertificateTobool = () => (X509CertificateTobool = dart.constFn(dart.fnTypeFuzzy(core.bool, [io.X509Certificate])))();
-  let FutureOfSocket = () => (FutureOfSocket = dart.constFn(async.Future$(io.Socket)))();
-  let HashSetOf_HttpClientConnection = () => (HashSetOf_HttpClientConnection = dart.constFn(collection.HashSet$(io._HttpClientConnection)))();
-  let FutureOf_ConnectionInfo = () => (FutureOf_ConnectionInfo = dart.constFn(async.Future$(io._ConnectionInfo)))();
-  let CompleterOf_ConnectionInfo = () => (CompleterOf_ConnectionInfo = dart.constFn(async.Completer$(io._ConnectionInfo)))();
-  let FutureOrOf_ConnectionInfo = () => (FutureOrOf_ConnectionInfo = dart.constFn(async.FutureOr$(io._ConnectionInfo)))();
-  let SetOf_HttpClientConnection = () => (SetOf_HttpClientConnection = dart.constFn(core.Set$(io._HttpClientConnection)))();
-  let HashMapOfString$_ConnectionTarget = () => (HashMapOfString$_ConnectionTarget = dart.constFn(collection.HashMap$(core.String, io._ConnectionTarget)))();
-  let JSArrayOf_Credentials = () => (JSArrayOf_Credentials = dart.constFn(_interceptors.JSArray$(io._Credentials)))();
-  let JSArrayOf_ProxyCredentials = () => (JSArrayOf_ProxyCredentials = dart.constFn(_interceptors.JSArray$(io._ProxyCredentials)))();
-  let FutureOf_HttpClientRequest = () => (FutureOf_HttpClientRequest = dart.constFn(async.Future$(io._HttpClientRequest)))();
-  let FutureOrOf_HttpClientRequest = () => (FutureOrOf_HttpClientRequest = dart.constFn(async.FutureOr$(io._HttpClientRequest)))();
-  let X509CertificateAndStringAndintTobool = () => (X509CertificateAndStringAndintTobool = dart.constFn(dart.fnTypeFuzzy(core.bool, [io.X509Certificate, core.String, core.int])))();
-  let UriAndStringAndStringToFutureOfbool = () => (UriAndStringAndStringToFutureOfbool = dart.constFn(dart.fnTypeFuzzy(FutureOfbool(), [core.Uri, core.String, core.String])))();
-  let StringAndintAndString__ToFutureOfbool = () => (StringAndintAndString__ToFutureOfbool = dart.constFn(dart.fnTypeFuzzy(FutureOfbool(), [core.String, core.int, core.String, core.String])))();
-  let UriToString = () => (UriToString = dart.constFn(dart.fnTypeFuzzy(core.String, [core.Uri])))();
-  let MapOfString$_ConnectionTarget = () => (MapOfString$_ConnectionTarget = dart.constFn(core.Map$(core.String, io._ConnectionTarget)))();
-  let ListOf_Credentials = () => (ListOf_Credentials = dart.constFn(core.List$(io._Credentials)))();
-  let ListOf_ProxyCredentials = () => (ListOf_ProxyCredentials = dart.constFn(core.List$(io._ProxyCredentials)))();
-  let HashMapOfint$_HttpConnection = () => (HashMapOfint$_HttpConnection = dart.constFn(collection.HashMap$(core.int, io._HttpConnection)))();
-  let LinkedListOf_HttpConnection = () => (LinkedListOf_HttpConnection = dart.constFn(_internal.LinkedList$(io._HttpConnection)))();
-  let StreamControllerOfHttpRequest = () => (StreamControllerOfHttpRequest = dart.constFn(async.StreamController$(io.HttpRequest)))();
-  let HttpRequestTovoid = () => (HttpRequestTovoid = dart.constFn(dart.fnTypeFuzzy(dart.void, [io.HttpRequest])))();
-  let MapOfint$_HttpServer = () => (MapOfint$_HttpServer = dart.constFn(core.Map$(core.int, io._HttpServer)))();
-  let ListOf_Proxy = () => (ListOf_Proxy = dart.constFn(core.List$(io._Proxy)))();
-  let StreamSubscriptionOfListOfint = () => (StreamSubscriptionOfListOfint = dart.constFn(async.StreamSubscription$(ListOfint())))();
-  let StreamControllerOf_HttpIncoming = () => (StreamControllerOf_HttpIncoming = dart.constFn(async.StreamController$(io._HttpIncoming)))();
-  let _HttpIncomingTovoid = () => (_HttpIncomingTovoid = dart.constFn(dart.fnTypeFuzzy(dart.void, [io._HttpIncoming])))();
-  let VoidTodynamic$0 = () => (VoidTodynamic$0 = dart.constFn(dart.fnTypeFuzzy(dart.dynamic, [])))();
-  let MapOfString$_HttpSession = () => (MapOfString$_HttpSession = dart.constFn(core.Map$(core.String, io._HttpSession)))();
   let ListOfMapOfString$String = () => (ListOfMapOfString$String = dart.constFn(core.List$(MapOfString$String())))();
   let FutureOfServiceExtensionResponse = () => (FutureOfServiceExtensionResponse = dart.constFn(async.Future$(developer.ServiceExtensionResponse)))();
   let MapOfint$_FileResourceInfo = () => (MapOfint$_FileResourceInfo = dart.constFn(core.Map$(core.int, io._FileResourceInfo)))();
   let MapOfint$_ProcessResourceInfo = () => (MapOfint$_ProcessResourceInfo = dart.constFn(core.Map$(core.int, io._ProcessResourceInfo)))();
   let MapOfint$_SocketResourceInfo = () => (MapOfint$_SocketResourceInfo = dart.constFn(core.Map$(core.int, io._SocketResourceInfo)))();
   let StreamSinkOfListOfint = () => (StreamSinkOfListOfint = dart.constFn(async.StreamSink$(ListOfint())))();
+  let _StreamSinkImpl = () => (_StreamSinkImpl = dart.constFn(io._StreamSinkImpl$()))();
   let FutureOfLink = () => (FutureOfLink = dart.constFn(async.Future$(io.Link)))();
   let _CaseInsensitiveStringMapOfString = () => (_CaseInsensitiveStringMapOfString = dart.constFn(io._CaseInsensitiveStringMap$(core.String)))();
   let _CaseInsensitiveStringMap = () => (_CaseInsensitiveStringMap = dart.constFn(io._CaseInsensitiveStringMap$()))();
   let StreamSubscriptionOfRawSocketEvent = () => (StreamSubscriptionOfRawSocketEvent = dart.constFn(async.StreamSubscription$(io.RawSocketEvent)))();
   let FutureOfRawSecureSocket = () => (FutureOfRawSecureSocket = dart.constFn(async.Future$(io.RawSecureSocket)))();
+  let X509CertificateTobool = () => (X509CertificateTobool = dart.constFn(dart.fnTypeFuzzy(core.bool, [io.X509Certificate])))();
   let SecureSocketTovoid = () => (SecureSocketTovoid = dart.constFn(dart.fnTypeFuzzy(dart.void, [io.SecureSocket])))();
   let StreamControllerOfRawSecureSocket = () => (StreamControllerOfRawSecureSocket = dart.constFn(async.StreamController$(io.RawSecureSocket)))();
   let RawSecureSocketTovoid = () => (RawSecureSocketTovoid = dart.constFn(dart.fnTypeFuzzy(dart.void, [io.RawSecureSocket])))();
@@ -3105,15 +3060,7 @@
   let intToListOfint = () => (intToListOfint = dart.constFn(dart.fnTypeFuzzy(ListOfint(), [core.int])))();
   let StreamOfRawSocket = () => (StreamOfRawSocket = dart.constFn(async.Stream$(io.RawSocket)))();
   let StreamOfSocket = () => (StreamOfSocket = dart.constFn(async.Stream$(io.Socket)))();
-  let StreamTransformerOfHttpRequest$WebSocket = () => (StreamTransformerOfHttpRequest$WebSocket = dart.constFn(async.StreamTransformer$(io.HttpRequest, io.WebSocket)))();
-  let ListOfStringTodynamic = () => (ListOfStringTodynamic = dart.constFn(dart.fnTypeFuzzy(dart.dynamic, [ListOfString()])))();
-  let EventSinkOfListOfint = () => (EventSinkOfListOfint = dart.constFn(async.EventSink$(ListOfint())))();
-  let StreamTransformerOfListOfint$dynamic = () => (StreamTransformerOfListOfint$dynamic = dart.constFn(async.StreamTransformer$(ListOfint(), dart.dynamic)))();
-  let StreamControllerOfWebSocket = () => (StreamControllerOfWebSocket = dart.constFn(async.StreamController$(io.WebSocket)))();
-  let FutureOfWebSocket = () => (FutureOfWebSocket = dart.constFn(async.Future$(io.WebSocket)))();
-  let FutureOfString = () => (FutureOfString = dart.constFn(async.Future$(core.String)))();
-  let StreamTransformerOfdynamic$ListOfint = () => (StreamTransformerOfdynamic$ListOfint = dart.constFn(async.StreamTransformer$(dart.dynamic, ListOfint())))();
-  let MapOfint$_WebSocketImpl = () => (MapOfint$_WebSocketImpl = dart.constFn(core.Map$(core.int, io._WebSocketImpl)))();
+  let StreamConsumerOfListOfint = () => (StreamConsumerOfListOfint = dart.constFn(async.StreamConsumer$(ListOfint())))();
   let FutureOfIsolate = () => (FutureOfIsolate = dart.constFn(async.Future$(isolate$.Isolate)))();
   let JsArray = () => (JsArray = dart.constFn(js.JsArray$()))();
   let ExpandoOfFunction = () => (ExpandoOfFunction = dart.constFn(core.Expando$(core.Function)))();
@@ -3290,6 +3237,59 @@
   let CompleterOfAudioBuffer = () => (CompleterOfAudioBuffer = dart.constFn(async.Completer$(web_audio.AudioBuffer)))();
   let FutureOrOfAudioBuffer = () => (FutureOrOfAudioBuffer = dart.constFn(async.FutureOr$(web_audio.AudioBuffer)))();
   let EventStreamProviderOfAudioProcessingEvent = () => (EventStreamProviderOfAudioProcessingEvent = dart.constFn(html$.EventStreamProvider$(web_audio.AudioProcessingEvent)))();
+  let StreamOfHttpRequest = () => (StreamOfHttpRequest = dart.constFn(async.Stream$(_http.HttpRequest)))();
+  let ListOfRedirectInfo = () => (ListOfRedirectInfo = dart.constFn(core.List$(_http.RedirectInfo)))();
+  let HashMapOfString$ListOfString = () => (HashMapOfString$ListOfString = dart.constFn(collection.HashMap$(core.String, ListOfString())))();
+  let ListOfCookie = () => (ListOfCookie = dart.constFn(core.List$(_http.Cookie)))();
+  let StringAndListOfStringTovoid = () => (StringAndListOfStringTovoid = dart.constFn(dart.fnTypeFuzzy(dart.void, [core.String, ListOfString()])))();
+  let FutureOfHttpClientResponse = () => (FutureOfHttpClientResponse = dart.constFn(async.Future$(_http.HttpClientResponse)))();
+  let FutureOrOfHttpClientResponse = () => (FutureOrOfHttpClientResponse = dart.constFn(async.FutureOr$(_http.HttpClientResponse)))();
+  let _StreamSinkImpl$ = () => (_StreamSinkImpl$ = dart.constFn(_http._StreamSinkImpl$()))();
+  let _HttpOutboundMessage = () => (_HttpOutboundMessage = dart.constFn(_http._HttpOutboundMessage$()))();
+  let CompleterOfHttpClientResponse = () => (CompleterOfHttpClientResponse = dart.constFn(async.Completer$(_http.HttpClientResponse)))();
+  let JSArrayOfRedirectInfo = () => (JSArrayOfRedirectInfo = dart.constFn(_interceptors.JSArray$(_http.RedirectInfo)))();
+  let JSArrayOfFuture = () => (JSArrayOfFuture = dart.constFn(_interceptors.JSArray$(async.Future)))();
+  let CompleterOfSocket = () => (CompleterOfSocket = dart.constFn(async.Completer$(io.Socket)))();
+  let CompleterOf_HttpIncoming = () => (CompleterOf_HttpIncoming = dart.constFn(async.Completer$(_http._HttpIncoming)))();
+  let FutureOfSecureSocket = () => (FutureOfSecureSocket = dart.constFn(async.Future$(io.SecureSocket)))();
+  let FutureOfSocket = () => (FutureOfSocket = dart.constFn(async.Future$(io.Socket)))();
+  let HashSetOf_HttpClientConnection = () => (HashSetOf_HttpClientConnection = dart.constFn(collection.HashSet$(_http._HttpClientConnection)))();
+  let FutureOf_ConnectionInfo = () => (FutureOf_ConnectionInfo = dart.constFn(async.Future$(_http._ConnectionInfo)))();
+  let CompleterOf_ConnectionInfo = () => (CompleterOf_ConnectionInfo = dart.constFn(async.Completer$(_http._ConnectionInfo)))();
+  let FutureOrOf_ConnectionInfo = () => (FutureOrOf_ConnectionInfo = dart.constFn(async.FutureOr$(_http._ConnectionInfo)))();
+  let SetOf_HttpClientConnection = () => (SetOf_HttpClientConnection = dart.constFn(core.Set$(_http._HttpClientConnection)))();
+  let HashMapOfString$_ConnectionTarget = () => (HashMapOfString$_ConnectionTarget = dart.constFn(collection.HashMap$(core.String, _http._ConnectionTarget)))();
+  let JSArrayOf_Credentials = () => (JSArrayOf_Credentials = dart.constFn(_interceptors.JSArray$(_http._Credentials)))();
+  let JSArrayOf_ProxyCredentials = () => (JSArrayOf_ProxyCredentials = dart.constFn(_interceptors.JSArray$(_http._ProxyCredentials)))();
+  let FutureOf_HttpClientRequest = () => (FutureOf_HttpClientRequest = dart.constFn(async.Future$(_http._HttpClientRequest)))();
+  let FutureOrOf_HttpClientRequest = () => (FutureOrOf_HttpClientRequest = dart.constFn(async.FutureOr$(_http._HttpClientRequest)))();
+  let X509CertificateAndStringAndintTobool = () => (X509CertificateAndStringAndintTobool = dart.constFn(dart.fnTypeFuzzy(core.bool, [io.X509Certificate, core.String, core.int])))();
+  let UriAndStringAndStringToFutureOfbool = () => (UriAndStringAndStringToFutureOfbool = dart.constFn(dart.fnTypeFuzzy(FutureOfbool(), [core.Uri, core.String, core.String])))();
+  let StringAndintAndString__ToFutureOfbool = () => (StringAndintAndString__ToFutureOfbool = dart.constFn(dart.fnTypeFuzzy(FutureOfbool(), [core.String, core.int, core.String, core.String])))();
+  let UriToString = () => (UriToString = dart.constFn(dart.fnTypeFuzzy(core.String, [core.Uri])))();
+  let MapOfString$_ConnectionTarget = () => (MapOfString$_ConnectionTarget = dart.constFn(core.Map$(core.String, _http._ConnectionTarget)))();
+  let ListOf_Credentials = () => (ListOf_Credentials = dart.constFn(core.List$(_http._Credentials)))();
+  let ListOf_ProxyCredentials = () => (ListOf_ProxyCredentials = dart.constFn(core.List$(_http._ProxyCredentials)))();
+  let HashMapOfint$_HttpConnection = () => (HashMapOfint$_HttpConnection = dart.constFn(collection.HashMap$(core.int, _http._HttpConnection)))();
+  let LinkedListOf_HttpConnection = () => (LinkedListOf_HttpConnection = dart.constFn(collection.LinkedList$(_http._HttpConnection)))();
+  let StreamControllerOfHttpRequest = () => (StreamControllerOfHttpRequest = dart.constFn(async.StreamController$(_http.HttpRequest)))();
+  let HttpRequestTovoid = () => (HttpRequestTovoid = dart.constFn(dart.fnTypeFuzzy(dart.void, [_http.HttpRequest])))();
+  let MapOfint$_HttpServer = () => (MapOfint$_HttpServer = dart.constFn(core.Map$(core.int, _http._HttpServer)))();
+  let ListOf_Proxy = () => (ListOf_Proxy = dart.constFn(core.List$(_http._Proxy)))();
+  let StreamSubscriptionOfListOfint = () => (StreamSubscriptionOfListOfint = dart.constFn(async.StreamSubscription$(ListOfint())))();
+  let StreamControllerOf_HttpIncoming = () => (StreamControllerOf_HttpIncoming = dart.constFn(async.StreamController$(_http._HttpIncoming)))();
+  let _HttpIncomingTovoid = () => (_HttpIncomingTovoid = dart.constFn(dart.fnTypeFuzzy(dart.void, [_http._HttpIncoming])))();
+  let VoidTodynamic$0 = () => (VoidTodynamic$0 = dart.constFn(dart.fnTypeFuzzy(dart.dynamic, [])))();
+  let MapOfString$_HttpSession = () => (MapOfString$_HttpSession = dart.constFn(core.Map$(core.String, _http._HttpSession)))();
+  let StreamTransformerOfHttpRequest$WebSocket = () => (StreamTransformerOfHttpRequest$WebSocket = dart.constFn(async.StreamTransformer$(_http.HttpRequest, _http.WebSocket)))();
+  let ListOfStringTodynamic = () => (ListOfStringTodynamic = dart.constFn(dart.fnTypeFuzzy(dart.dynamic, [ListOfString()])))();
+  let EventSinkOfListOfint = () => (EventSinkOfListOfint = dart.constFn(async.EventSink$(ListOfint())))();
+  let StreamTransformerOfListOfint$dynamic = () => (StreamTransformerOfListOfint$dynamic = dart.constFn(async.StreamTransformer$(ListOfint(), dart.dynamic)))();
+  let StreamControllerOfWebSocket = () => (StreamControllerOfWebSocket = dart.constFn(async.StreamController$(_http.WebSocket)))();
+  let FutureOfWebSocket = () => (FutureOfWebSocket = dart.constFn(async.Future$(_http.WebSocket)))();
+  let FutureOfString = () => (FutureOfString = dart.constFn(async.Future$(core.String)))();
+  let StreamTransformerOfdynamic$ListOfint = () => (StreamTransformerOfdynamic$ListOfint = dart.constFn(async.StreamTransformer$(dart.dynamic, ListOfint())))();
+  let MapOfint$_WebSocketImpl = () => (MapOfint$_WebSocketImpl = dart.constFn(core.Map$(core.int, _http._WebSocketImpl)))();
   let VoidToFunctionType = () => (VoidToFunctionType = dart.constFn(dart.fnType(dart.FunctionType, [])))();
   let StringToTypeVariable = () => (StringToTypeVariable = dart.constFn(dart.fnType(dart.TypeVariable, [core.String])))();
   let ObjectTobool = () => (ObjectTobool = dart.constFn(dart.fnType(core.bool, [core.Object])))();
@@ -3310,7 +3310,7 @@
   let ObjectAndObjectToObject = () => (ObjectAndObjectToObject = dart.constFn(dart.fnType(core.Object, [core.Object, core.Object])))();
   let StringTobool$ = () => (StringTobool$ = dart.constFn(dart.fnType(core.bool, [core.String])))();
   let dynamicToObject = () => (dynamicToObject = dart.constFn(dart.fnType(core.Object, [dart.dynamic])))();
-  let dynamicTobool$1 = () => (dynamicTobool$1 = dart.constFn(dart.fnType(core.bool, [dart.dynamic])))();
+  let dynamicTobool$0 = () => (dynamicTobool$0 = dart.constFn(dart.fnType(core.bool, [dart.dynamic])))();
   let dynamicAnddynamicToNull = () => (dynamicAnddynamicToNull = dart.constFn(dart.fnType(core.Null, [dart.dynamic, dart.dynamic])))();
   let StringToNameValuePair = () => (StringToNameValuePair = dart.constFn(dart.fnType(_debugger.NameValuePair, [core.String])))();
   let VoidTodynamic$1 = () => (VoidTodynamic$1 = dart.constFn(dart.fnType(dart.dynamic, [])))();
@@ -3465,10 +3465,10 @@
   let dynamicAnddynamicToNull$5 = () => (dynamicAnddynamicToNull$5 = dart.constFn(dart.fnType(core.Null, [dart.dynamic, dart.dynamic])))();
   let dynamicAnddynamicToint$ = () => (dynamicAnddynamicToint$ = dart.constFn(dart.fnType(core.int, [dart.dynamic, dart.dynamic])))();
   let VoidToComparatorOfK = () => (VoidToComparatorOfK = dart.constFn(dart.gFnType(K => [core.Comparator$(K), []])))();
-  let dynamicTobool$2 = () => (dynamicTobool$2 = dart.constFn(dart.fnType(core.bool, [dart.dynamic])))();
+  let dynamicTobool$1 = () => (dynamicTobool$1 = dart.constFn(dart.fnType(core.bool, [dart.dynamic])))();
   let dynamicAnddynamicToNull$6 = () => (dynamicAnddynamicToNull$6 = dart.constFn(dart.fnType(core.Null, [dart.dynamic, dart.dynamic])))();
   let _SplayTreeMapNodeTobool = () => (_SplayTreeMapNodeTobool = dart.constFn(dart.fnType(core.bool, [collection._SplayTreeMapNode])))();
-  let dynamicTobool$3 = () => (dynamicTobool$3 = dart.constFn(dart.fnType(core.bool, [dart.dynamic])))();
+  let dynamicTobool$2 = () => (dynamicTobool$2 = dart.constFn(dart.fnType(core.bool, [dart.dynamic])))();
   let dynamicAndFnTodynamic = () => (dynamicAndFnTodynamic = dart.constFn(dart.fnType(dart.dynamic, [dart.dynamic, dynamicAnddynamicTodynamic()])))();
   let StringAnddynamicToNull = () => (StringAnddynamicToNull = dart.constFn(dart.fnType(core.Null, [core.String, dart.dynamic])))();
   let EventSinkTo_ConverterStreamEventSink = () => (EventSinkTo_ConverterStreamEventSink = dart.constFn(dart.fnType(convert._ConverterStreamEventSink, [async.EventSink])))();
@@ -3541,59 +3541,14 @@
   let RandomAccessFileToFutureOfFile = () => (RandomAccessFileToFutureOfFile = dart.constFn(dart.fnType(FutureOfFile(), [io.RandomAccessFile])))();
   let dynamicToListOfint = () => (dynamicToListOfint = dart.constFn(dart.fnType(ListOfint(), [dart.dynamic])))();
   let dynamicToFileStat = () => (dynamicToFileStat = dart.constFn(dart.fnType(io.FileStat, [dart.dynamic])))();
-  let StringAndListOfStringToListOfString = () => (StringAndListOfStringToListOfString = dart.constFn(dart.fnType(ListOfString(), [core.String, ListOfString()])))();
-  let StringAndListOfStringToNull = () => (StringAndListOfStringToNull = dart.constFn(dart.fnType(core.Null, [core.String, ListOfString()])))();
-  let CookieToString = () => (CookieToString = dart.constFn(dart.fnType(core.String, [io.Cookie])))();
-  let CookieTobool = () => (CookieTobool = dart.constFn(dart.fnType(core.bool, [io.Cookie])))();
-  let _HttpClientRequestToFutureOfHttpClientResponse = () => (_HttpClientRequestToFutureOfHttpClientResponse = dart.constFn(dart.fnType(FutureOfHttpClientResponse(), [io._HttpClientRequest])))();
-  let dynamicToFutureOfHttpClientResponse = () => (dynamicToFutureOfHttpClientResponse = dart.constFn(dart.fnType(FutureOfHttpClientResponse(), [dart.dynamic])))();
-  let VoidToFutureOfHttpClientResponse = () => (VoidToFutureOfHttpClientResponse = dart.constFn(dart.fnType(FutureOfHttpClientResponse(), [])))();
-  let VoidToListOfString = () => (VoidToListOfString = dart.constFn(dart.fnType(ListOfString(), [])))();
-  let _AuthenticationSchemeTo_Credentials = () => (_AuthenticationSchemeTo_Credentials = dart.constFn(dart.fnType(io._Credentials, [io._AuthenticationScheme])))();
-  let _CredentialsTovoid = () => (_CredentialsTovoid = dart.constFn(dart.fnType(dart.void, [io._Credentials])))();
-  let _AuthenticationSchemeAndStringToFuture = () => (_AuthenticationSchemeAndStringToFuture = dart.constFn(dart.fnType(async.Future, [io._AuthenticationScheme, core.String])))();
-  let dynamicToFutureOrOfHttpClientResponse = () => (dynamicToFutureOrOfHttpClientResponse = dart.constFn(dart.fnType(FutureOrOfHttpClientResponse(), [dart.dynamic])))();
+  let _FileResourceInfoToMapOfString$dynamic = () => (_FileResourceInfoToMapOfString$dynamic = dart.constFn(dart.fnType(MapOfString$dynamic(), [io._FileResourceInfo])))();
+  let _ProcessResourceInfoToMapOfString$dynamic = () => (_ProcessResourceInfoToMapOfString$dynamic = dart.constFn(dart.fnType(MapOfString$dynamic(), [io._ProcessResourceInfo])))();
+  let _SocketResourceInfoToMapOfString$dynamic = () => (_SocketResourceInfoToMapOfString$dynamic = dart.constFn(dart.fnType(MapOfString$dynamic(), [io._SocketResourceInfo])))();
   let VoidToNull$11 = () => (VoidToNull$11 = dart.constFn(dart.fnType(core.Null, [])))();
   let VoidToFuture$2 = () => (VoidToFuture$2 = dart.constFn(dart.fnType(async.Future, [])))();
   let dynamicToFuture$ = () => (dynamicToFuture$ = dart.constFn(dart.fnType(async.Future, [dart.dynamic])))();
   let dynamicToNull$1 = () => (dynamicToNull$1 = dart.constFn(dart.fnType(core.Null, [dart.dynamic])))();
   let dynamicAnddynamicToNull$7 = () => (dynamicAnddynamicToNull$7 = dart.constFn(dart.fnType(core.Null, [dart.dynamic, dart.dynamic])))();
-  let CookieToNull = () => (CookieToNull = dart.constFn(dart.fnType(core.Null, [io.Cookie])))();
-  let ListToFutureOrOfHttpClientResponse = () => (ListToFutureOrOfHttpClientResponse = dart.constFn(dart.fnType(FutureOrOfHttpClientResponse(), [core.List])))();
-  let HttpClientResponseTovoid = () => (HttpClientResponseTovoid = dart.constFn(dart.fnType(dart.void, [io.HttpClientResponse])))();
-  let dynamicToIterable = () => (dynamicToIterable = dart.constFn(dart.fnType(core.Iterable, [dart.dynamic])))();
-  let dynamicToFuture$0 = () => (dynamicToFuture$0 = dart.constFn(dart.fnType(async.Future, [dart.dynamic])))();
-  let ListOfintTovoid$ = () => (ListOfintTovoid$ = dart.constFn(dart.fnType(dart.void, [ListOfint()])))();
-  let dynamicTo_HttpOutboundMessage = () => (dynamicTo_HttpOutboundMessage = dart.constFn(dart.fnType(io._HttpOutboundMessage, [dart.dynamic])))();
-  let dynamicAnddynamicTo_HttpOutboundMessage = () => (dynamicAnddynamicTo_HttpOutboundMessage = dart.constFn(dart.fnType(io._HttpOutboundMessage, [dart.dynamic, dart.dynamic])))();
-  let dynamic__ToNull$ = () => (dynamic__ToNull$ = dart.constFn(dart.fnType(core.Null, [dart.dynamic], [core.StackTrace])))();
-  let _HttpIncomingToNull = () => (_HttpIncomingToNull = dart.constFn(dart.fnType(core.Null, [io._HttpIncoming])))();
-  let SocketToSocket = () => (SocketToSocket = dart.constFn(dart.fnType(io.Socket, [io.Socket])))();
-  let SocketTo_DetachedSocket = () => (SocketTo_DetachedSocket = dart.constFn(dart.fnType(io._DetachedSocket, [io.Socket])))();
-  let SocketTovoid = () => (SocketTovoid = dart.constFn(dart.fnType(dart.void, [io.Socket])))();
-  let SecureSocketTo_HttpClientConnection = () => (SecureSocketTo_HttpClientConnection = dart.constFn(dart.fnType(io._HttpClientConnection, [io.SecureSocket])))();
-  let HttpClientResponseToFutureOfSecureSocket = () => (HttpClientResponseToFutureOfSecureSocket = dart.constFn(dart.fnType(FutureOfSecureSocket(), [io.HttpClientResponse])))();
-  let X509CertificateTobool$ = () => (X509CertificateTobool$ = dart.constFn(dart.fnType(core.bool, [io.X509Certificate])))();
-  let _HttpClientConnectionTo_ConnectionInfo = () => (_HttpClientConnectionTo_ConnectionInfo = dart.constFn(dart.fnType(io._ConnectionInfo, [io._HttpClientConnection])))();
-  let dynamicToFutureOrOf_ConnectionInfo = () => (dynamicToFutureOrOf_ConnectionInfo = dart.constFn(dart.fnType(FutureOrOf_ConnectionInfo(), [dart.dynamic])))();
-  let _ConnectionTargetTobool = () => (_ConnectionTargetTobool = dart.constFn(dart.fnType(core.bool, [io._ConnectionTarget])))();
-  let _ConnectionInfoTo_HttpClientRequest = () => (_ConnectionInfoTo_HttpClientRequest = dart.constFn(dart.fnType(io._HttpClientRequest, [io._ConnectionInfo])))();
-  let _ConnectionInfoToFutureOrOf_HttpClientRequest = () => (_ConnectionInfoToFutureOrOf_HttpClientRequest = dart.constFn(dart.fnType(FutureOrOf_HttpClientRequest(), [io._ConnectionInfo])))();
-  let _HttpClientRequestTo_HttpClientRequest = () => (_HttpClientRequestTo_HttpClientRequest = dart.constFn(dart.fnType(io._HttpClientRequest, [io._HttpClientRequest])))();
-  let VoidTo_ConnectionTarget = () => (VoidTo_ConnectionTarget = dart.constFn(dart.fnType(io._ConnectionTarget, [])))();
-  let dynamicToFutureOf_ConnectionInfo = () => (dynamicToFutureOf_ConnectionInfo = dart.constFn(dart.fnType(FutureOf_ConnectionInfo(), [dart.dynamic])))();
-  let VoidToFutureOf_ConnectionInfo = () => (VoidToFutureOf_ConnectionInfo = dart.constFn(dart.fnType(FutureOf_ConnectionInfo(), [])))();
-  let _SiteCredentialsAnd_CredentialsTo_SiteCredentials = () => (_SiteCredentialsAnd_CredentialsTo_SiteCredentials = dart.constFn(dart.fnType(io._SiteCredentials, [io._SiteCredentials, io._Credentials])))();
-  let SocketToNull = () => (SocketToNull = dart.constFn(dart.fnType(core.Null, [io.Socket])))();
-  let dynamicTo_DetachedSocket = () => (dynamicTo_DetachedSocket = dart.constFn(dart.fnType(io._DetachedSocket, [dart.dynamic])))();
-  let ServerSocketTo_HttpServer = () => (ServerSocketTo_HttpServer = dart.constFn(dart.fnType(io._HttpServer, [io.ServerSocket])))();
-  let SecureServerSocketTo_HttpServer = () => (SecureServerSocketTo_HttpServer = dart.constFn(dart.fnType(io._HttpServer, [io.SecureServerSocket])))();
-  let TimerToNull$ = () => (TimerToNull$ = dart.constFn(dart.fnType(core.Null, [async.Timer])))();
-  let _HttpConnectionToNull = () => (_HttpConnectionToNull = dart.constFn(dart.fnType(core.Null, [io._HttpConnection])))();
-  let _HttpConnectionToMap = () => (_HttpConnectionToMap = dart.constFn(dart.fnType(core.Map, [io._HttpConnection])))();
-  let _FileResourceInfoToMapOfString$dynamic = () => (_FileResourceInfoToMapOfString$dynamic = dart.constFn(dart.fnType(MapOfString$dynamic(), [io._FileResourceInfo])))();
-  let _ProcessResourceInfoToMapOfString$dynamic = () => (_ProcessResourceInfoToMapOfString$dynamic = dart.constFn(dart.fnType(MapOfString$dynamic(), [io._ProcessResourceInfo])))();
-  let _SocketResourceInfoToMapOfString$dynamic = () => (_SocketResourceInfoToMapOfString$dynamic = dart.constFn(dart.fnType(MapOfString$dynamic(), [io._SocketResourceInfo])))();
   let dynamicTo_Link = () => (dynamicTo_Link = dart.constFn(dart.fnType(io._Link, [dart.dynamic])))();
   let FileSystemEntityToFutureOfLink = () => (FileSystemEntityToFutureOfLink = dart.constFn(dart.fnType(FutureOfLink(), [io.FileSystemEntity])))();
   let FileSystemEntityTo_Link = () => (FileSystemEntityTo_Link = dart.constFn(dart.fnType(io._Link, [io.FileSystemEntity])))();
@@ -3609,17 +3564,6 @@
   let dynamicTo_FilterStatus = () => (dynamicTo_FilterStatus = dart.constFn(dart.fnType(io._FilterStatus, [dart.dynamic])))();
   let ListOfintAndStringTovoid = () => (ListOfintAndStringTovoid = dart.constFn(dart.fnType(dart.void, [ListOfint(), core.String])))();
   let dynamicToStdioType = () => (dynamicToStdioType = dart.constFn(dart.fnType(io.StdioType, [dart.dynamic])))();
-  let EventSinkTo_WebSocketProtocolTransformer = () => (EventSinkTo_WebSocketProtocolTransformer = dart.constFn(dart.fnType(io._WebSocketProtocolTransformer, [async.EventSink])))();
-  let WebSocketTovoid = () => (WebSocketTovoid = dart.constFn(dart.fnType(dart.void, [io.WebSocket])))();
-  let HttpRequestToNull = () => (HttpRequestToNull = dart.constFn(dart.fnType(core.Null, [io.HttpRequest])))();
-  let SocketTo_WebSocketImpl = () => (SocketTo_WebSocketImpl = dart.constFn(dart.fnType(io._WebSocketImpl, [io.Socket])))();
-  let StringToFutureOfWebSocket = () => (StringToFutureOfWebSocket = dart.constFn(dart.fnType(FutureOfWebSocket(), [core.String])))();
-  let VoidToFutureOrOfString = () => (VoidToFutureOrOfString = dart.constFn(dart.fnType(FutureOrOfString(), [])))();
-  let EventSinkOfListOfintTo_WebSocketOutgoingTransformer = () => (EventSinkOfListOfintTo_WebSocketOutgoingTransformer = dart.constFn(dart.fnType(io._WebSocketOutgoingTransformer, [EventSinkOfListOfint()])))();
-  let HttpClientResponseToFutureOfWebSocket = () => (HttpClientResponseToFutureOfWebSocket = dart.constFn(dart.fnType(FutureOfWebSocket(), [io.HttpClientResponse])))();
-  let StringAnddynamicTovoid$ = () => (StringAnddynamicTovoid$ = dart.constFn(dart.fnType(dart.void, [core.String, dart.dynamic])))();
-  let HttpClientRequestToFutureOfHttpClientResponse = () => (HttpClientRequestToFutureOfHttpClientResponse = dart.constFn(dart.fnType(FutureOfHttpClientResponse(), [io.HttpClientRequest])))();
-  let dynamicToMap = () => (dynamicToMap = dart.constFn(dart.fnType(core.Map, [dart.dynamic])))();
   let ListToIsolate = () => (ListToIsolate = dart.constFn(dart.fnType(isolate$.Isolate, [core.List])))();
   let dynamicTo_DartObject = () => (dynamicTo_DartObject = dart.constFn(dart.fnType(js._DartObject, [dart.dynamic])))();
   let dynamicAnddynamicAndFnToObject = () => (dynamicAnddynamicAndFnToObject = dart.constFn(dart.fnType(core.Object, [dart.dynamic, dart.dynamic, dynamicTodynamic$()])))();
@@ -3695,11 +3639,72 @@
   let NodeAndNodeTovoid = () => (NodeAndNodeTovoid = dart.constFn(dart.fnType(dart.void, [html$.Node, html$.Node])))();
   let dynamicToImageData = () => (dynamicToImageData = dart.constFn(dart.fnType(html$.ImageData, [dart.dynamic])))();
   let ImageDataTodynamic = () => (ImageDataTodynamic = dart.constFn(dart.fnType(dart.dynamic, [html$.ImageData])))();
-  let Map__Todynamic = () => (Map__Todynamic = dart.constFn(dart.fnType(dart.dynamic, [core.Map], [dynamicTovoid()])))();
+  let dynamicToMap = () => (dynamicToMap = dart.constFn(dart.fnType(core.Map, [dart.dynamic])))();
+  let Map__Todynamic = () => (Map__Todynamic = dart.constFn(dart.fnType(dart.dynamic, [core.Map], [ObjectTovoid$()])))();
   let ListOfStringToList = () => (ListOfStringToList = dart.constFn(dart.fnType(core.List, [ListOfString()])))();
   let DateTimeTodynamic = () => (DateTimeTodynamic = dart.constFn(dart.fnType(dart.dynamic, [core.DateTime])))();
   let dynamic__Todynamic = () => (dynamic__Todynamic = dart.constFn(dart.fnType(dart.dynamic, [dart.dynamic], {mustCopy: dart.dynamic})))();
+  let dynamicToFuture$0 = () => (dynamicToFuture$0 = dart.constFn(dart.fnType(async.Future, [dart.dynamic])))();
   let NodeToElement = () => (NodeToElement = dart.constFn(dart.fnType(html$.Element, [html$.Node])))();
+  let StringAndListOfStringToListOfString = () => (StringAndListOfStringToListOfString = dart.constFn(dart.fnType(ListOfString(), [core.String, ListOfString()])))();
+  let StringAndListOfStringToNull = () => (StringAndListOfStringToNull = dart.constFn(dart.fnType(core.Null, [core.String, ListOfString()])))();
+  let CookieToString = () => (CookieToString = dart.constFn(dart.fnType(core.String, [_http.Cookie])))();
+  let CookieTobool = () => (CookieTobool = dart.constFn(dart.fnType(core.bool, [_http.Cookie])))();
+  let _HttpClientRequestToFutureOfHttpClientResponse = () => (_HttpClientRequestToFutureOfHttpClientResponse = dart.constFn(dart.fnType(FutureOfHttpClientResponse(), [_http._HttpClientRequest])))();
+  let dynamicToFutureOfHttpClientResponse = () => (dynamicToFutureOfHttpClientResponse = dart.constFn(dart.fnType(FutureOfHttpClientResponse(), [dart.dynamic])))();
+  let VoidToFutureOfHttpClientResponse = () => (VoidToFutureOfHttpClientResponse = dart.constFn(dart.fnType(FutureOfHttpClientResponse(), [])))();
+  let VoidToListOfString = () => (VoidToListOfString = dart.constFn(dart.fnType(ListOfString(), [])))();
+  let _AuthenticationSchemeTo_Credentials = () => (_AuthenticationSchemeTo_Credentials = dart.constFn(dart.fnType(_http._Credentials, [_http._AuthenticationScheme])))();
+  let _CredentialsTovoid = () => (_CredentialsTovoid = dart.constFn(dart.fnType(dart.void, [_http._Credentials])))();
+  let _AuthenticationSchemeAndStringToFuture = () => (_AuthenticationSchemeAndStringToFuture = dart.constFn(dart.fnType(async.Future, [_http._AuthenticationScheme, core.String])))();
+  let dynamicToFutureOrOfHttpClientResponse = () => (dynamicToFutureOrOfHttpClientResponse = dart.constFn(dart.fnType(FutureOrOfHttpClientResponse(), [dart.dynamic])))();
+  let VoidToNull$12 = () => (VoidToNull$12 = dart.constFn(dart.fnType(core.Null, [])))();
+  let VoidToFuture$3 = () => (VoidToFuture$3 = dart.constFn(dart.fnType(async.Future, [])))();
+  let dynamicToFuture$1 = () => (dynamicToFuture$1 = dart.constFn(dart.fnType(async.Future, [dart.dynamic])))();
+  let dynamicToNull$2 = () => (dynamicToNull$2 = dart.constFn(dart.fnType(core.Null, [dart.dynamic])))();
+  let dynamicAnddynamicToNull$8 = () => (dynamicAnddynamicToNull$8 = dart.constFn(dart.fnType(core.Null, [dart.dynamic, dart.dynamic])))();
+  let CookieToNull = () => (CookieToNull = dart.constFn(dart.fnType(core.Null, [_http.Cookie])))();
+  let ListToFutureOrOfHttpClientResponse = () => (ListToFutureOrOfHttpClientResponse = dart.constFn(dart.fnType(FutureOrOfHttpClientResponse(), [core.List])))();
+  let HttpClientResponseTovoid = () => (HttpClientResponseTovoid = dart.constFn(dart.fnType(dart.void, [_http.HttpClientResponse])))();
+  let dynamicToIterable = () => (dynamicToIterable = dart.constFn(dart.fnType(core.Iterable, [dart.dynamic])))();
+  let ListOfintTovoid$ = () => (ListOfintTovoid$ = dart.constFn(dart.fnType(dart.void, [ListOfint()])))();
+  let dynamicTo_HttpOutboundMessage = () => (dynamicTo_HttpOutboundMessage = dart.constFn(dart.fnType(_http._HttpOutboundMessage, [dart.dynamic])))();
+  let dynamicAnddynamicTo_HttpOutboundMessage = () => (dynamicAnddynamicTo_HttpOutboundMessage = dart.constFn(dart.fnType(_http._HttpOutboundMessage, [dart.dynamic, dart.dynamic])))();
+  let dynamic__ToNull$ = () => (dynamic__ToNull$ = dart.constFn(dart.fnType(core.Null, [dart.dynamic], [core.StackTrace])))();
+  let _HttpIncomingToNull = () => (_HttpIncomingToNull = dart.constFn(dart.fnType(core.Null, [_http._HttpIncoming])))();
+  let SocketToSocket = () => (SocketToSocket = dart.constFn(dart.fnType(io.Socket, [io.Socket])))();
+  let SocketTo_DetachedSocket = () => (SocketTo_DetachedSocket = dart.constFn(dart.fnType(_http._DetachedSocket, [io.Socket])))();
+  let SocketTovoid = () => (SocketTovoid = dart.constFn(dart.fnType(dart.void, [io.Socket])))();
+  let SecureSocketTo_HttpClientConnection = () => (SecureSocketTo_HttpClientConnection = dart.constFn(dart.fnType(_http._HttpClientConnection, [io.SecureSocket])))();
+  let HttpClientResponseToFutureOfSecureSocket = () => (HttpClientResponseToFutureOfSecureSocket = dart.constFn(dart.fnType(FutureOfSecureSocket(), [_http.HttpClientResponse])))();
+  let X509CertificateTobool$ = () => (X509CertificateTobool$ = dart.constFn(dart.fnType(core.bool, [io.X509Certificate])))();
+  let _HttpClientConnectionTo_ConnectionInfo = () => (_HttpClientConnectionTo_ConnectionInfo = dart.constFn(dart.fnType(_http._ConnectionInfo, [_http._HttpClientConnection])))();
+  let dynamicToFutureOrOf_ConnectionInfo = () => (dynamicToFutureOrOf_ConnectionInfo = dart.constFn(dart.fnType(FutureOrOf_ConnectionInfo(), [dart.dynamic])))();
+  let _ConnectionTargetTobool = () => (_ConnectionTargetTobool = dart.constFn(dart.fnType(core.bool, [_http._ConnectionTarget])))();
+  let _ConnectionInfoTo_HttpClientRequest = () => (_ConnectionInfoTo_HttpClientRequest = dart.constFn(dart.fnType(_http._HttpClientRequest, [_http._ConnectionInfo])))();
+  let _ConnectionInfoToFutureOrOf_HttpClientRequest = () => (_ConnectionInfoToFutureOrOf_HttpClientRequest = dart.constFn(dart.fnType(FutureOrOf_HttpClientRequest(), [_http._ConnectionInfo])))();
+  let _HttpClientRequestTo_HttpClientRequest = () => (_HttpClientRequestTo_HttpClientRequest = dart.constFn(dart.fnType(_http._HttpClientRequest, [_http._HttpClientRequest])))();
+  let VoidTo_ConnectionTarget = () => (VoidTo_ConnectionTarget = dart.constFn(dart.fnType(_http._ConnectionTarget, [])))();
+  let dynamicToFutureOf_ConnectionInfo = () => (dynamicToFutureOf_ConnectionInfo = dart.constFn(dart.fnType(FutureOf_ConnectionInfo(), [dart.dynamic])))();
+  let VoidToFutureOf_ConnectionInfo = () => (VoidToFutureOf_ConnectionInfo = dart.constFn(dart.fnType(FutureOf_ConnectionInfo(), [])))();
+  let _SiteCredentialsAnd_CredentialsTo_SiteCredentials = () => (_SiteCredentialsAnd_CredentialsTo_SiteCredentials = dart.constFn(dart.fnType(_http._SiteCredentials, [_http._SiteCredentials, _http._Credentials])))();
+  let SocketToNull = () => (SocketToNull = dart.constFn(dart.fnType(core.Null, [io.Socket])))();
+  let dynamicTo_DetachedSocket = () => (dynamicTo_DetachedSocket = dart.constFn(dart.fnType(_http._DetachedSocket, [dart.dynamic])))();
+  let ServerSocketTo_HttpServer = () => (ServerSocketTo_HttpServer = dart.constFn(dart.fnType(_http._HttpServer, [io.ServerSocket])))();
+  let SecureServerSocketTo_HttpServer = () => (SecureServerSocketTo_HttpServer = dart.constFn(dart.fnType(_http._HttpServer, [io.SecureServerSocket])))();
+  let TimerToNull$ = () => (TimerToNull$ = dart.constFn(dart.fnType(core.Null, [async.Timer])))();
+  let _HttpConnectionToNull = () => (_HttpConnectionToNull = dart.constFn(dart.fnType(core.Null, [_http._HttpConnection])))();
+  let _HttpConnectionToMap = () => (_HttpConnectionToMap = dart.constFn(dart.fnType(core.Map, [_http._HttpConnection])))();
+  let EventSinkTo_WebSocketProtocolTransformer = () => (EventSinkTo_WebSocketProtocolTransformer = dart.constFn(dart.fnType(_http._WebSocketProtocolTransformer, [async.EventSink])))();
+  let WebSocketTovoid = () => (WebSocketTovoid = dart.constFn(dart.fnType(dart.void, [_http.WebSocket])))();
+  let HttpRequestToNull = () => (HttpRequestToNull = dart.constFn(dart.fnType(core.Null, [_http.HttpRequest])))();
+  let SocketTo_WebSocketImpl = () => (SocketTo_WebSocketImpl = dart.constFn(dart.fnType(_http._WebSocketImpl, [io.Socket])))();
+  let StringToFutureOfWebSocket = () => (StringToFutureOfWebSocket = dart.constFn(dart.fnType(FutureOfWebSocket(), [core.String])))();
+  let VoidToFutureOrOfString = () => (VoidToFutureOrOfString = dart.constFn(dart.fnType(FutureOrOfString(), [])))();
+  let EventSinkOfListOfintTo_WebSocketOutgoingTransformer = () => (EventSinkOfListOfintTo_WebSocketOutgoingTransformer = dart.constFn(dart.fnType(_http._WebSocketOutgoingTransformer, [EventSinkOfListOfint()])))();
+  let HttpClientResponseToFutureOfWebSocket = () => (HttpClientResponseToFutureOfWebSocket = dart.constFn(dart.fnType(FutureOfWebSocket(), [_http.HttpClientResponse])))();
+  let StringAnddynamicTovoid$ = () => (StringAnddynamicTovoid$ = dart.constFn(dart.fnType(dart.void, [core.String, dart.dynamic])))();
+  let HttpClientRequestToFutureOfHttpClientResponse = () => (HttpClientRequestToFutureOfHttpClientResponse = dart.constFn(dart.fnType(FutureOfHttpClientResponse(), [_http.HttpClientRequest])))();
   dart.polyfill = function(window) {
     if (window[dart._polyfilled]) return false;
     window[dart._polyfilled] = true;
@@ -5304,7 +5309,10 @@
   };
   dart._polyfilled = Symbol("_polyfilled");
   dart.global = (function() {
-    var globalState = typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : {};
+    var globalState = typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : null;
+    if (!globalState) {
+      globalState = new Function('return this;')();
+    }
     dart.polyfill(globalState);
     if (globalState.Error) {
       globalState.Error.stackTraceLimit = Infinity;
@@ -6525,7 +6533,7 @@
     }
     return html$.Node.is(object);
   };
-  dart.lazyFn(_debugger.isNativeJavaScriptObject, () => dynamicTobool$1());
+  dart.lazyFn(_debugger.isNativeJavaScriptObject, () => dynamicTobool$0());
   _debugger.JsonMLFormatter = class JsonMLFormatter extends core.Object {
     setMaxSpanLengthForTestingOnly(spanLength) {
       _debugger._maxSpanLength = spanLength;
@@ -9378,7 +9386,7 @@
         let length = this[$length];
         for (let i = 0; i < dart.notNull(length); i++) {
           let element = this[$_get](i);
-          if (dart.dcall(test, element) == retainMatching) {
+          if (test(element) == retainMatching) {
             retained[$add](element);
           }
           if (length != this[$length]) {
@@ -9636,7 +9644,7 @@
         [_closeGap]: dart.fnType(dart.void, [core.int, core.int]),
         removeWhere: dart.fnType(dart.void, [ETobool()]),
         retainWhere: dart.fnType(dart.void, [ETobool()]),
-        [_filter]: dart.fnType(dart.void, [dynamicTobool(), core.bool]),
+        [_filter]: dart.fnType(dart.void, [ETobool(), core.bool]),
         clear: dart.fnType(dart.void, []),
         removeLast: dart.fnType(E, []),
         sort: dart.fnType(dart.void, [], [EAndEToint()]),
@@ -13033,7 +13041,7 @@
   });
   dart.defineLazy(_isolate_helper, {
     get global() {
-      return typeof global == 'undefined' ? self : global;
+      return dart.global;
     }
   });
   _isolate_helper._MainManagerStub = class _MainManagerStub extends core.Object {
@@ -13078,7 +13086,7 @@
       return _isolate_helper.global.defaultPackagesBase || "packages/";
     }
     static computeThisScript() {
-      let currentScript = document.currentScript;
+      let currentScript = _isolate_helper.global.document ? _isolate_helper.global.document.currentScript : null;
       if (currentScript != null) {
         return String(currentScript.src);
       }
@@ -14229,7 +14237,7 @@
         map: dart.gFnType(S => [async.Stream$(S), [dart.fnTypeFuzzy(S, [T])]]),
         asyncMap: dart.gFnType(E => [async.Stream$(E), [dart.fnTypeFuzzy(async.FutureOr$(E), [T])]]),
         asyncExpand: dart.gFnType(E => [async.Stream$(E), [dart.fnTypeFuzzy(async.Stream$(E), [T])]]),
-        handleError: dart.fnType(async.Stream$(T), [core.Function], {test: dynamicTobool$()}),
+        handleError: dart.fnType(async.Stream$(T), [core.Function], {test: dynamicTobool()}),
         expand: dart.gFnType(S => [async.Stream$(S), [dart.fnTypeFuzzy(core.Iterable$(S), [T])]]),
         pipe: dart.fnType(async.Future, [core.Object]),
         transform: dart.gFnType(S => [async.Stream$(S), [core.Object]]),
@@ -16886,7 +16894,7 @@
   _js_helper.isJsArray = function(value) {
     return _interceptors.JSArray.is(value);
   };
-  dart.lazyFn(_js_helper.isJsArray, () => dynamicTobool$1());
+  dart.lazyFn(_js_helper.isJsArray, () => dynamicTobool$0());
   _js_mirrors.getName = function(symbol) {
     if (_internal.PrivateSymbol.is(symbol)) {
       return _internal.PrivateSymbol.getName(symbol);
@@ -23112,11 +23120,11 @@
       }
       handleError(asyncError) {
         if (!(dart.test(this.handlesError) && dart.test(this.hasErrorCallback))) dart.assertFailed();
-        if (ZoneBinaryCallbackOfdynamic$Null$Null().is(this.errorCallback)) {
-          let typedErrorCallback = ZoneBinaryCallbackOfFutureOrOfT$Object$StackTrace().as(this.errorCallback);
-          return this[_zone].runBinary(FutureOrOfT(), core.Object, core.StackTrace, typedErrorCallback, asyncError.error, asyncError.stackTrace);
+        let errorCallback = this.errorCallback;
+        if (ZoneBinaryCallbackOfFutureOrOfT$Object$StackTrace().is(errorCallback)) {
+          return this[_zone].runBinary(FutureOrOfT(), core.Object, core.StackTrace, errorCallback, asyncError.error, asyncError.stackTrace);
         } else {
-          return this[_zone].runUnary(FutureOrOfT(), core.Object, ObjectToFutureOrOfT()._check(this.errorCallback), asyncError.error);
+          return this[_zone].runUnary(FutureOrOfT(), core.Object, ObjectToFutureOrOfT()._check(errorCallback), asyncError.error);
         }
       }
       handleWhenComplete() {
@@ -23722,7 +23730,7 @@
         [_setChained]: dart.fnType(dart.void, [async._Future]),
         then: dart.gFnType(E => [async.Future$(E), [dart.fnTypeFuzzy(async.FutureOr$(E), [T])], {onError: core.Function}]),
         [_thenNoZoneRegistration]: dart.gFnType(E => [async.Future$(E), [dart.fnTypeFuzzy(async.FutureOr$(E), [T]), core.Function]]),
-        catchError: dart.fnType(async.Future$(T), [core.Function], {test: dynamicTobool$0()}),
+        catchError: dart.fnType(async.Future$(T), [core.Function], {test: dynamicTobool$()}),
         whenComplete: dart.fnType(async.Future$(T), [VoidTodynamic$()]),
         asStream: dart.fnType(async.Stream$(T), []),
         [_setPendingComplete]: dart.fnType(dart.void, []),
@@ -24691,10 +24699,11 @@
   dart.addTypeTests(async._AddStreamState, _is__AddStreamState_default);
   const _is__StreamControllerAddStreamState_default = Symbol('_is__StreamControllerAddStreamState_default');
   async._StreamControllerAddStreamState$ = dart.generic(T => {
+    let StreamOfT = () => (StreamOfT = dart.constFn(async.Stream$(T)))();
     class _StreamControllerAddStreamState extends async._AddStreamState$(T) {}
     (_StreamControllerAddStreamState.new = function(controller, varData, source, cancelOnError) {
       this.varData = varData;
-      _StreamControllerAddStreamState.__proto__.new.call(this, controller, source, cancelOnError);
+      _StreamControllerAddStreamState.__proto__.new.call(this, controller, StreamOfT()._check(source), cancelOnError);
       if (dart.test(controller.isPaused)) {
         this.addSubscription.pause();
       }
@@ -32551,7 +32560,7 @@
       let l = compare;
       this[_comparator] = l != null ? l : collection._defaultCompare(K);
       let l$ = isValidKey;
-      this[_validKey] = l$ != null ? l$ : dart.fn(v => K.is(v), dynamicTobool$2());
+      this[_validKey] = l$ != null ? l$ : dart.fn(v => K.is(v), dynamicTobool$1());
       this[_root] = null;
       SplayTreeMap.__proto__.new.call(this);
     }).prototype = SplayTreeMap.prototype;
@@ -33017,7 +33026,7 @@
       let l = compare;
       this[_comparator] = l != null ? l : collection._defaultCompare(E);
       let l$ = isValidKey;
-      this[_validKey] = l$ != null ? l$ : dart.fn(v => E.is(v), dynamicTobool$3());
+      this[_validKey] = l$ != null ? l$ : dart.fn(v => E.is(v), dynamicTobool$2());
       this[_root$] = null;
       SplayTreeSet.__proto__.new.call(this);
     }).prototype = SplayTreeSet.prototype;
@@ -43320,7 +43329,7 @@
   io._isErrorResponse = function(response) {
     return core.List.is(response) && !dart.equals(response[$_get](0), io._SUCCESS_RESPONSE);
   };
-  dart.fn(io._isErrorResponse, dynamicTobool$1());
+  dart.fn(io._isErrorResponse, dynamicTobool$0());
   io._exceptionFromResponse = function(response, message, path) {
     if (!dart.test(io._isErrorResponse(response))) dart.assertFailed();
     switch (dart.dindex(response, io._ERROR_RESPONSE_ERROR_TYPE)) {
@@ -44290,6 +44299,40 @@
       startChunkedConversion: dart.fnType(convert.ByteConversionSink, [core.Object])
     })
   });
+  io.RawZLibFilter = class RawZLibFilter extends core.Object {
+    static deflateFilter(opts) {
+      let gzip = opts && 'gzip' in opts ? opts.gzip : false;
+      let level = opts && 'level' in opts ? opts.level : io.ZLibOption.DEFAULT_LEVEL;
+      let windowBits = opts && 'windowBits' in opts ? opts.windowBits : io.ZLibOption.DEFAULT_WINDOW_BITS;
+      let memLevel = opts && 'memLevel' in opts ? opts.memLevel : io.ZLibOption.DEFAULT_MEM_LEVEL;
+      let strategy = opts && 'strategy' in opts ? opts.strategy : io.ZLibOption.STRATEGY_DEFAULT;
+      let dictionary = opts && 'dictionary' in opts ? opts.dictionary : null;
+      let raw = opts && 'raw' in opts ? opts.raw : false;
+      return io.RawZLibFilter._makeZLibDeflateFilter(gzip, level, windowBits, memLevel, strategy, dictionary, raw);
+    }
+    static inflateFilter(opts) {
+      let windowBits = opts && 'windowBits' in opts ? opts.windowBits : io.ZLibOption.DEFAULT_WINDOW_BITS;
+      let dictionary = opts && 'dictionary' in opts ? opts.dictionary : null;
+      let raw = opts && 'raw' in opts ? opts.raw : false;
+      return io.RawZLibFilter._makeZLibInflateFilter(windowBits, dictionary, raw);
+    }
+    static _makeZLibDeflateFilter(gzip, level, windowBits, memLevel, strategy, dictionary, raw) {
+      dart.throw(new core.UnsupportedError.new("_newZLibDeflateFilter"));
+    }
+    static _makeZLibInflateFilter(windowBits, dictionary, raw) {
+      dart.throw(new core.UnsupportedError.new("_newZLibInflateFilter"));
+    }
+  };
+  (io.RawZLibFilter[dart.mixinNew] = function() {
+  }).prototype = io.RawZLibFilter.prototype;
+  dart.addTypeTests(io.RawZLibFilter);
+  dart.setSignature(io.RawZLibFilter, {
+    statics: () => ({
+      _makeZLibDeflateFilter: dart.fnType(io.RawZLibFilter, [core.bool, core.int, core.int, core.int, core.int, ListOfint(), core.bool]),
+      _makeZLibInflateFilter: dart.fnType(io.RawZLibFilter, [core.int, ListOfint(), core.bool])
+    }),
+    names: ['_makeZLibDeflateFilter', '_makeZLibInflateFilter']
+  });
   io._BufferSink = class _BufferSink extends convert.ByteConversionSink {
     add(chunk) {
       ListOfint()._check(chunk);
@@ -44374,7 +44417,7 @@
   dart.addTypeTests(io._FilterSink);
   dart.setSignature(io._FilterSink, {
     fields: () => ({
-      [_filter$]: dart.finalFieldType(io._Filter),
+      [_filter$]: dart.finalFieldType(io.RawZLibFilter),
       [_sink$0]: dart.finalFieldType(convert.ByteConversionSink),
       [_closed]: dart.fieldType(core.bool),
       [_empty]: dart.fieldType(core.bool)
@@ -44387,32 +44430,14 @@
   });
   io._ZLibEncoderSink = class _ZLibEncoderSink extends io._FilterSink {};
   (io._ZLibEncoderSink.new = function(sink, gzip, level, windowBits, memLevel, strategy, dictionary, raw) {
-    io._ZLibEncoderSink.__proto__.new.call(this, sink, io._Filter._newZLibDeflateFilter(gzip, level, windowBits, memLevel, strategy, dictionary, raw));
+    io._ZLibEncoderSink.__proto__.new.call(this, sink, io.RawZLibFilter._makeZLibDeflateFilter(gzip, level, windowBits, memLevel, strategy, dictionary, raw));
   }).prototype = io._ZLibEncoderSink.prototype;
   dart.addTypeTests(io._ZLibEncoderSink);
   io._ZLibDecoderSink = class _ZLibDecoderSink extends io._FilterSink {};
   (io._ZLibDecoderSink.new = function(sink, windowBits, dictionary, raw) {
-    io._ZLibDecoderSink.__proto__.new.call(this, sink, io._Filter._newZLibInflateFilter(windowBits, dictionary, raw));
+    io._ZLibDecoderSink.__proto__.new.call(this, sink, io.RawZLibFilter._makeZLibInflateFilter(windowBits, dictionary, raw));
   }).prototype = io._ZLibDecoderSink.prototype;
   dart.addTypeTests(io._ZLibDecoderSink);
-  io._Filter = class _Filter extends core.Object {
-    static _newZLibDeflateFilter(gzip, level, windowBits, memLevel, strategy, dictionary, raw) {
-      dart.throw(new core.UnsupportedError.new("_newZLibDeflateFilter"));
-    }
-    static _newZLibInflateFilter(windowBits, dictionary, raw) {
-      dart.throw(new core.UnsupportedError.new("_newZLibInflateFilter"));
-    }
-  };
-  (io._Filter.new = function() {
-  }).prototype = io._Filter.prototype;
-  dart.addTypeTests(io._Filter);
-  dart.setSignature(io._Filter, {
-    statics: () => ({
-      _newZLibDeflateFilter: dart.fnType(io._Filter, [core.bool, core.int, core.int, core.int, core.int, ListOfint(), core.bool]),
-      _newZLibInflateFilter: dart.fnType(io._Filter, [core.int, ListOfint(), core.bool])
-    }),
-    names: ['_newZLibDeflateFilter', '_newZLibInflateFilter']
-  });
   io._validateZLibWindowBits = function(windowBits) {
     if (io.ZLibOption.MIN_WINDOW_BITS > dart.notNull(windowBits) || io.ZLibOption.MAX_WINDOW_BITS < dart.notNull(windowBits)) {
       dart.throw(new core.RangeError.range(windowBits, io.ZLibOption.MIN_WINDOW_BITS, io.ZLibOption.MAX_WINDOW_BITS));
@@ -44758,7 +44783,7 @@
           dart.throw(this[_exceptionOrErrorFromResponse](response, "Exists failed"));
         }
         return dart.equals(response, 1);
-      }, dynamicTobool$1()));
+      }, dynamicTobool$0()));
     }
     existsSync() {
       let result = io._Directory._exists(io._Namespace._namespace, this.path);
@@ -46835,7081 +46860,6 @@
     statics: () => ({_watch: dart.fnType(async.Stream$(io.FileSystemEvent), [core.String, core.int, core.bool])}),
     names: ['_watch']
   });
-  io.HttpStatus = class HttpStatus extends core.Object {};
-  (io.HttpStatus.new = function() {
-  }).prototype = io.HttpStatus.prototype;
-  dart.addTypeTests(io.HttpStatus);
-  dart.defineLazy(io.HttpStatus, {
-    get CONTINUE() {
-      return 100;
-    },
-    get SWITCHING_PROTOCOLS() {
-      return 101;
-    },
-    get OK() {
-      return 200;
-    },
-    get CREATED() {
-      return 201;
-    },
-    get ACCEPTED() {
-      return 202;
-    },
-    get NON_AUTHORITATIVE_INFORMATION() {
-      return 203;
-    },
-    get NO_CONTENT() {
-      return 204;
-    },
-    get RESET_CONTENT() {
-      return 205;
-    },
-    get PARTIAL_CONTENT() {
-      return 206;
-    },
-    get MULTIPLE_CHOICES() {
-      return 300;
-    },
-    get MOVED_PERMANENTLY() {
-      return 301;
-    },
-    get FOUND() {
-      return 302;
-    },
-    get MOVED_TEMPORARILY() {
-      return 302;
-    },
-    get SEE_OTHER() {
-      return 303;
-    },
-    get NOT_MODIFIED() {
-      return 304;
-    },
-    get USE_PROXY() {
-      return 305;
-    },
-    get TEMPORARY_REDIRECT() {
-      return 307;
-    },
-    get BAD_REQUEST() {
-      return 400;
-    },
-    get UNAUTHORIZED() {
-      return 401;
-    },
-    get PAYMENT_REQUIRED() {
-      return 402;
-    },
-    get FORBIDDEN() {
-      return 403;
-    },
-    get NOT_FOUND() {
-      return 404;
-    },
-    get METHOD_NOT_ALLOWED() {
-      return 405;
-    },
-    get NOT_ACCEPTABLE() {
-      return 406;
-    },
-    get PROXY_AUTHENTICATION_REQUIRED() {
-      return 407;
-    },
-    get REQUEST_TIMEOUT() {
-      return 408;
-    },
-    get CONFLICT() {
-      return 409;
-    },
-    get GONE() {
-      return 410;
-    },
-    get LENGTH_REQUIRED() {
-      return 411;
-    },
-    get PRECONDITION_FAILED() {
-      return 412;
-    },
-    get REQUEST_ENTITY_TOO_LARGE() {
-      return 413;
-    },
-    get REQUEST_URI_TOO_LONG() {
-      return 414;
-    },
-    get UNSUPPORTED_MEDIA_TYPE() {
-      return 415;
-    },
-    get REQUESTED_RANGE_NOT_SATISFIABLE() {
-      return 416;
-    },
-    get EXPECTATION_FAILED() {
-      return 417;
-    },
-    get UPGRADE_REQUIRED() {
-      return 426;
-    },
-    get INTERNAL_SERVER_ERROR() {
-      return 500;
-    },
-    get NOT_IMPLEMENTED() {
-      return 501;
-    },
-    get BAD_GATEWAY() {
-      return 502;
-    },
-    get SERVICE_UNAVAILABLE() {
-      return 503;
-    },
-    get GATEWAY_TIMEOUT() {
-      return 504;
-    },
-    get HTTP_VERSION_NOT_SUPPORTED() {
-      return 505;
-    },
-    get NETWORK_CONNECT_TIMEOUT_ERROR() {
-      return 599;
-    }
-  });
-  io.HttpServer = class HttpServer extends core.Object {
-    get serverHeader() {
-      return this[serverHeader];
-    }
-    set serverHeader(value) {
-      this[serverHeader] = value;
-    }
-    get autoCompress() {
-      return this[autoCompress];
-    }
-    set autoCompress(value) {
-      this[autoCompress] = value;
-    }
-    get idleTimeout() {
-      return this[idleTimeout];
-    }
-    set idleTimeout(value) {
-      this[idleTimeout] = value;
-    }
-    static bind(address, port, opts) {
-      let backlog = opts && 'backlog' in opts ? opts.backlog : 0;
-      let v6Only = opts && 'v6Only' in opts ? opts.v6Only : false;
-      let shared = opts && 'shared' in opts ? opts.shared : false;
-      return io._HttpServer.bind(address, port, backlog, v6Only, shared);
-    }
-    static bindSecure(address, port, context, opts) {
-      let backlog = opts && 'backlog' in opts ? opts.backlog : 0;
-      let v6Only = opts && 'v6Only' in opts ? opts.v6Only : false;
-      let requestClientCertificate = opts && 'requestClientCertificate' in opts ? opts.requestClientCertificate : false;
-      let shared = opts && 'shared' in opts ? opts.shared : false;
-      return io._HttpServer.bindSecure(address, port, context, backlog, v6Only, requestClientCertificate, shared);
-    }
-    static listenOn(serverSocket) {
-      return new io._HttpServer.listenOn(serverSocket);
-    }
-  };
-  (io.HttpServer[dart.mixinNew] = function() {
-    this[serverHeader] = null;
-    this[autoCompress] = null;
-    this[idleTimeout] = null;
-  }).prototype = io.HttpServer.prototype;
-  io.HttpServer.prototype[dart.isStream] = true;
-  dart.addTypeTests(io.HttpServer);
-  const serverHeader = Symbol("HttpServer.serverHeader");
-  const autoCompress = Symbol("HttpServer.autoCompress");
-  const idleTimeout = Symbol("HttpServer.idleTimeout");
-  io.HttpServer[dart.implements] = () => [StreamOfHttpRequest()];
-  dart.setSignature(io.HttpServer, {
-    fields: () => ({
-      serverHeader: dart.fieldType(core.String),
-      autoCompress: dart.fieldType(core.bool),
-      idleTimeout: dart.fieldType(core.Duration)
-    }),
-    statics: () => ({
-      bind: dart.fnType(async.Future$(io.HttpServer), [dart.dynamic, core.int], {backlog: core.int, v6Only: core.bool, shared: core.bool}),
-      bindSecure: dart.fnType(async.Future$(io.HttpServer), [dart.dynamic, core.int, io.SecurityContext], {backlog: core.int, v6Only: core.bool, requestClientCertificate: core.bool, shared: core.bool})
-    }),
-    names: ['bind', 'bindSecure']
-  });
-  io.HttpConnectionsInfo = class HttpConnectionsInfo extends core.Object {
-    get total() {
-      return this[total];
-    }
-    set total(value) {
-      this[total] = value;
-    }
-    get active() {
-      return this[active];
-    }
-    set active(value) {
-      this[active] = value;
-    }
-    get idle() {
-      return this[idle];
-    }
-    set idle(value) {
-      this[idle] = value;
-    }
-    get closing() {
-      return this[closing];
-    }
-    set closing(value) {
-      this[closing] = value;
-    }
-  };
-  (io.HttpConnectionsInfo.new = function() {
-    this[total] = 0;
-    this[active] = 0;
-    this[idle] = 0;
-    this[closing] = 0;
-  }).prototype = io.HttpConnectionsInfo.prototype;
-  dart.addTypeTests(io.HttpConnectionsInfo);
-  const total = Symbol("HttpConnectionsInfo.total");
-  const active = Symbol("HttpConnectionsInfo.active");
-  const idle = Symbol("HttpConnectionsInfo.idle");
-  const closing = Symbol("HttpConnectionsInfo.closing");
-  dart.setSignature(io.HttpConnectionsInfo, {
-    fields: () => ({
-      total: dart.fieldType(core.int),
-      active: dart.fieldType(core.int),
-      idle: dart.fieldType(core.int),
-      closing: dart.fieldType(core.int)
-    })
-  });
-  io.HttpHeaders = class HttpHeaders extends core.Object {
-    get date() {
-      return this[date];
-    }
-    set date(value) {
-      this[date] = value;
-    }
-    get expires() {
-      return this[expires];
-    }
-    set expires(value) {
-      this[expires] = value;
-    }
-    get ifModifiedSince() {
-      return this[ifModifiedSince];
-    }
-    set ifModifiedSince(value) {
-      this[ifModifiedSince] = value;
-    }
-    get host() {
-      return this[host];
-    }
-    set host(value) {
-      this[host] = value;
-    }
-    get port() {
-      return this[port];
-    }
-    set port(value) {
-      this[port] = value;
-    }
-    get contentType() {
-      return this[contentType];
-    }
-    set contentType(value) {
-      this[contentType] = value;
-    }
-    get contentLength() {
-      return this[contentLength];
-    }
-    set contentLength(value) {
-      this[contentLength] = value;
-    }
-    get persistentConnection() {
-      return this[persistentConnection];
-    }
-    set persistentConnection(value) {
-      this[persistentConnection] = value;
-    }
-    get chunkedTransferEncoding() {
-      return this[chunkedTransferEncoding];
-    }
-    set chunkedTransferEncoding(value) {
-      this[chunkedTransferEncoding] = value;
-    }
-  };
-  (io.HttpHeaders.new = function() {
-    this[date] = null;
-    this[expires] = null;
-    this[ifModifiedSince] = null;
-    this[host] = null;
-    this[port] = null;
-    this[contentType] = null;
-    this[contentLength] = null;
-    this[persistentConnection] = null;
-    this[chunkedTransferEncoding] = null;
-  }).prototype = io.HttpHeaders.prototype;
-  dart.addTypeTests(io.HttpHeaders);
-  const date = Symbol("HttpHeaders.date");
-  const expires = Symbol("HttpHeaders.expires");
-  const ifModifiedSince = Symbol("HttpHeaders.ifModifiedSince");
-  const host = Symbol("HttpHeaders.host");
-  const port = Symbol("HttpHeaders.port");
-  const contentType = Symbol("HttpHeaders.contentType");
-  const contentLength = Symbol("HttpHeaders.contentLength");
-  const persistentConnection = Symbol("HttpHeaders.persistentConnection");
-  const chunkedTransferEncoding = Symbol("HttpHeaders.chunkedTransferEncoding");
-  dart.setSignature(io.HttpHeaders, {
-    fields: () => ({
-      date: dart.fieldType(core.DateTime),
-      expires: dart.fieldType(core.DateTime),
-      ifModifiedSince: dart.fieldType(core.DateTime),
-      host: dart.fieldType(core.String),
-      port: dart.fieldType(core.int),
-      contentType: dart.fieldType(io.ContentType),
-      contentLength: dart.fieldType(core.int),
-      persistentConnection: dart.fieldType(core.bool),
-      chunkedTransferEncoding: dart.fieldType(core.bool)
-    })
-  });
-  dart.defineLazy(io.HttpHeaders, {
-    get ACCEPT() {
-      return "accept";
-    },
-    get ACCEPT_CHARSET() {
-      return "accept-charset";
-    },
-    get ACCEPT_ENCODING() {
-      return "accept-encoding";
-    },
-    get ACCEPT_LANGUAGE() {
-      return "accept-language";
-    },
-    get ACCEPT_RANGES() {
-      return "accept-ranges";
-    },
-    get AGE() {
-      return "age";
-    },
-    get ALLOW() {
-      return "allow";
-    },
-    get AUTHORIZATION() {
-      return "authorization";
-    },
-    get CACHE_CONTROL() {
-      return "cache-control";
-    },
-    get CONNECTION() {
-      return "connection";
-    },
-    get CONTENT_ENCODING() {
-      return "content-encoding";
-    },
-    get CONTENT_LANGUAGE() {
-      return "content-language";
-    },
-    get CONTENT_LENGTH() {
-      return "content-length";
-    },
-    get CONTENT_LOCATION() {
-      return "content-location";
-    },
-    get CONTENT_MD5() {
-      return "content-md5";
-    },
-    get CONTENT_RANGE() {
-      return "content-range";
-    },
-    get CONTENT_TYPE() {
-      return "content-type";
-    },
-    get DATE() {
-      return "date";
-    },
-    get ETAG() {
-      return "etag";
-    },
-    get EXPECT() {
-      return "expect";
-    },
-    get EXPIRES() {
-      return "expires";
-    },
-    get FROM() {
-      return "from";
-    },
-    get HOST() {
-      return "host";
-    },
-    get IF_MATCH() {
-      return "if-match";
-    },
-    get IF_MODIFIED_SINCE() {
-      return "if-modified-since";
-    },
-    get IF_NONE_MATCH() {
-      return "if-none-match";
-    },
-    get IF_RANGE() {
-      return "if-range";
-    },
-    get IF_UNMODIFIED_SINCE() {
-      return "if-unmodified-since";
-    },
-    get LAST_MODIFIED() {
-      return "last-modified";
-    },
-    get LOCATION() {
-      return "location";
-    },
-    get MAX_FORWARDS() {
-      return "max-forwards";
-    },
-    get PRAGMA() {
-      return "pragma";
-    },
-    get PROXY_AUTHENTICATE() {
-      return "proxy-authenticate";
-    },
-    get PROXY_AUTHORIZATION() {
-      return "proxy-authorization";
-    },
-    get RANGE() {
-      return "range";
-    },
-    get REFERER() {
-      return "referer";
-    },
-    get RETRY_AFTER() {
-      return "retry-after";
-    },
-    get SERVER() {
-      return "server";
-    },
-    get TE() {
-      return "te";
-    },
-    get TRAILER() {
-      return "trailer";
-    },
-    get TRANSFER_ENCODING() {
-      return "transfer-encoding";
-    },
-    get UPGRADE() {
-      return "upgrade";
-    },
-    get USER_AGENT() {
-      return "user-agent";
-    },
-    get VARY() {
-      return "vary";
-    },
-    get VIA() {
-      return "via";
-    },
-    get WARNING() {
-      return "warning";
-    },
-    get WWW_AUTHENTICATE() {
-      return "www-authenticate";
-    },
-    get COOKIE() {
-      return "cookie";
-    },
-    get SET_COOKIE() {
-      return "set-cookie";
-    },
-    get GENERAL_HEADERS() {
-      return dart.constList([io.HttpHeaders.CACHE_CONTROL, io.HttpHeaders.CONNECTION, io.HttpHeaders.DATE, io.HttpHeaders.PRAGMA, io.HttpHeaders.TRAILER, io.HttpHeaders.TRANSFER_ENCODING, io.HttpHeaders.UPGRADE, io.HttpHeaders.VIA, io.HttpHeaders.WARNING], core.String);
-    },
-    get ENTITY_HEADERS() {
-      return dart.constList([io.HttpHeaders.ALLOW, io.HttpHeaders.CONTENT_ENCODING, io.HttpHeaders.CONTENT_LANGUAGE, io.HttpHeaders.CONTENT_LENGTH, io.HttpHeaders.CONTENT_LOCATION, io.HttpHeaders.CONTENT_MD5, io.HttpHeaders.CONTENT_RANGE, io.HttpHeaders.CONTENT_TYPE, io.HttpHeaders.EXPIRES, io.HttpHeaders.LAST_MODIFIED], core.String);
-    },
-    get RESPONSE_HEADERS() {
-      return dart.constList([io.HttpHeaders.ACCEPT_RANGES, io.HttpHeaders.AGE, io.HttpHeaders.ETAG, io.HttpHeaders.LOCATION, io.HttpHeaders.PROXY_AUTHENTICATE, io.HttpHeaders.RETRY_AFTER, io.HttpHeaders.SERVER, io.HttpHeaders.VARY, io.HttpHeaders.WWW_AUTHENTICATE], core.String);
-    },
-    get REQUEST_HEADERS() {
-      return dart.constList([io.HttpHeaders.ACCEPT, io.HttpHeaders.ACCEPT_CHARSET, io.HttpHeaders.ACCEPT_ENCODING, io.HttpHeaders.ACCEPT_LANGUAGE, io.HttpHeaders.AUTHORIZATION, io.HttpHeaders.EXPECT, io.HttpHeaders.FROM, io.HttpHeaders.HOST, io.HttpHeaders.IF_MATCH, io.HttpHeaders.IF_MODIFIED_SINCE, io.HttpHeaders.IF_NONE_MATCH, io.HttpHeaders.IF_RANGE, io.HttpHeaders.IF_UNMODIFIED_SINCE, io.HttpHeaders.MAX_FORWARDS, io.HttpHeaders.PROXY_AUTHORIZATION, io.HttpHeaders.RANGE, io.HttpHeaders.REFERER, io.HttpHeaders.TE, io.HttpHeaders.USER_AGENT], core.String);
-    }
-  });
-  io.HeaderValue = class HeaderValue extends core.Object {
-    static new(value, parameters) {
-      if (value === void 0) value = "";
-      if (parameters === void 0) parameters = null;
-      return new io._HeaderValue.new(value, parameters);
-    }
-    static parse(value, opts) {
-      let parameterSeparator = opts && 'parameterSeparator' in opts ? opts.parameterSeparator : ";";
-      let valueSeparator = opts && 'valueSeparator' in opts ? opts.valueSeparator : null;
-      let preserveBackslash = opts && 'preserveBackslash' in opts ? opts.preserveBackslash : false;
-      return io._HeaderValue.parse(value, {parameterSeparator: parameterSeparator, valueSeparator: valueSeparator, preserveBackslash: preserveBackslash});
-    }
-  };
-  (io.HeaderValue[dart.mixinNew] = function() {
-  }).prototype = io.HeaderValue.prototype;
-  dart.addTypeTests(io.HeaderValue);
-  dart.setSignature(io.HeaderValue, {
-    statics: () => ({parse: dart.fnType(io.HeaderValue, [core.String], {parameterSeparator: core.String, valueSeparator: core.String, preserveBackslash: core.bool})}),
-    names: ['parse']
-  });
-  io.HttpSession = class HttpSession extends core.Object {};
-  (io.HttpSession.new = function() {
-  }).prototype = io.HttpSession.prototype;
-  io.HttpSession.prototype[dart.isMap] = true;
-  dart.addTypeTests(io.HttpSession);
-  io.HttpSession[dart.implements] = () => [core.Map];
-  io.ContentType = class ContentType extends core.Object {
-    static new(primaryType, subType, opts) {
-      let charset = opts && 'charset' in opts ? opts.charset : null;
-      let parameters = opts && 'parameters' in opts ? opts.parameters : null;
-      return new io._ContentType.new(primaryType, subType, charset, parameters);
-    }
-    static parse(value) {
-      return io._ContentType.parse(value);
-    }
-  };
-  (io.ContentType[dart.mixinNew] = function() {
-  }).prototype = io.ContentType.prototype;
-  dart.addTypeTests(io.ContentType);
-  io.ContentType[dart.implements] = () => [io.HeaderValue];
-  dart.setSignature(io.ContentType, {
-    statics: () => ({parse: dart.fnType(io.ContentType, [core.String])}),
-    names: ['parse']
-  });
-  dart.defineLazy(io.ContentType, {
-    get TEXT() {
-      return io.ContentType.new("text", "plain", {charset: "utf-8"});
-    },
-    get HTML() {
-      return io.ContentType.new("text", "html", {charset: "utf-8"});
-    },
-    get JSON() {
-      return io.ContentType.new("application", "json", {charset: "utf-8"});
-    },
-    get BINARY() {
-      return io.ContentType.new("application", "octet-stream");
-    }
-  });
-  io.Cookie = class Cookie extends core.Object {
-    get name() {
-      return this[name];
-    }
-    set name(value) {
-      this[name] = value;
-    }
-    get value() {
-      return this[value$];
-    }
-    set value(value) {
-      this[value$] = value;
-    }
-    get expires() {
-      return this[expires$0];
-    }
-    set expires(value) {
-      this[expires$0] = value;
-    }
-    get maxAge() {
-      return this[maxAge];
-    }
-    set maxAge(value) {
-      this[maxAge] = value;
-    }
-    get domain() {
-      return this[domain];
-    }
-    set domain(value) {
-      this[domain] = value;
-    }
-    get path() {
-      return this[path$1];
-    }
-    set path(value) {
-      this[path$1] = value;
-    }
-    get secure() {
-      return this[secure];
-    }
-    set secure(value) {
-      this[secure] = value;
-    }
-    get httpOnly() {
-      return this[httpOnly];
-    }
-    set httpOnly(value) {
-      this[httpOnly] = value;
-    }
-    static new(name, value) {
-      if (name === void 0) name = null;
-      if (value === void 0) value = null;
-      return new io._Cookie.new(name, value);
-    }
-    static fromSetCookieValue(value) {
-      return new io._Cookie.fromSetCookieValue(value);
-    }
-  };
-  (io.Cookie[dart.mixinNew] = function() {
-    this[name] = null;
-    this[value$] = null;
-    this[expires$0] = null;
-    this[maxAge] = null;
-    this[domain] = null;
-    this[path$1] = null;
-    this[secure] = null;
-    this[httpOnly] = null;
-  }).prototype = io.Cookie.prototype;
-  dart.addTypeTests(io.Cookie);
-  const name = Symbol("Cookie.name");
-  const value$ = Symbol("Cookie.value");
-  const expires$0 = Symbol("Cookie.expires");
-  const maxAge = Symbol("Cookie.maxAge");
-  const domain = Symbol("Cookie.domain");
-  const path$1 = Symbol("Cookie.path");
-  const secure = Symbol("Cookie.secure");
-  const httpOnly = Symbol("Cookie.httpOnly");
-  dart.setSignature(io.Cookie, {
-    fields: () => ({
-      name: dart.fieldType(core.String),
-      value: dart.fieldType(core.String),
-      expires: dart.fieldType(core.DateTime),
-      maxAge: dart.fieldType(core.int),
-      domain: dart.fieldType(core.String),
-      path: dart.fieldType(core.String),
-      secure: dart.fieldType(core.bool),
-      httpOnly: dart.fieldType(core.bool)
-    })
-  });
-  io.HttpRequest = class HttpRequest extends core.Object {};
-  (io.HttpRequest.new = function() {
-  }).prototype = io.HttpRequest.prototype;
-  io.HttpRequest.prototype[dart.isStream] = true;
-  dart.addTypeTests(io.HttpRequest);
-  io.HttpRequest[dart.implements] = () => [StreamOfListOfint()];
-  io.HttpResponse = class HttpResponse extends core.Object {
-    get contentLength() {
-      return this[contentLength$];
-    }
-    set contentLength(value) {
-      this[contentLength$] = value;
-    }
-    get statusCode() {
-      return this[statusCode];
-    }
-    set statusCode(value) {
-      this[statusCode] = value;
-    }
-    get reasonPhrase() {
-      return this[reasonPhrase];
-    }
-    set reasonPhrase(value) {
-      this[reasonPhrase] = value;
-    }
-    get persistentConnection() {
-      return this[persistentConnection$];
-    }
-    set persistentConnection(value) {
-      this[persistentConnection$] = value;
-    }
-    get deadline() {
-      return this[deadline];
-    }
-    set deadline(value) {
-      this[deadline] = value;
-    }
-    get bufferOutput() {
-      return this[bufferOutput];
-    }
-    set bufferOutput(value) {
-      this[bufferOutput] = value;
-    }
-  };
-  (io.HttpResponse.new = function() {
-    this[contentLength$] = null;
-    this[statusCode] = null;
-    this[reasonPhrase] = null;
-    this[persistentConnection$] = null;
-    this[deadline] = null;
-    this[bufferOutput] = null;
-  }).prototype = io.HttpResponse.prototype;
-  dart.addTypeTests(io.HttpResponse);
-  const contentLength$ = Symbol("HttpResponse.contentLength");
-  const statusCode = Symbol("HttpResponse.statusCode");
-  const reasonPhrase = Symbol("HttpResponse.reasonPhrase");
-  const persistentConnection$ = Symbol("HttpResponse.persistentConnection");
-  const deadline = Symbol("HttpResponse.deadline");
-  const bufferOutput = Symbol("HttpResponse.bufferOutput");
-  io.HttpResponse[dart.implements] = () => [io.IOSink];
-  dart.setSignature(io.HttpResponse, {
-    fields: () => ({
-      contentLength: dart.fieldType(core.int),
-      statusCode: dart.fieldType(core.int),
-      reasonPhrase: dart.fieldType(core.String),
-      persistentConnection: dart.fieldType(core.bool),
-      deadline: dart.fieldType(core.Duration),
-      bufferOutput: dart.fieldType(core.bool)
-    })
-  });
-  io.HttpClient = class HttpClient extends core.Object {
-    get idleTimeout() {
-      return this[idleTimeout$];
-    }
-    set idleTimeout(value) {
-      this[idleTimeout$] = value;
-    }
-    get maxConnectionsPerHost() {
-      return this[maxConnectionsPerHost];
-    }
-    set maxConnectionsPerHost(value) {
-      this[maxConnectionsPerHost] = value;
-    }
-    get autoUncompress() {
-      return this[autoUncompress];
-    }
-    set autoUncompress(value) {
-      this[autoUncompress] = value;
-    }
-    get userAgent() {
-      return this[userAgent];
-    }
-    set userAgent(value) {
-      this[userAgent] = value;
-    }
-    static new(opts) {
-      let context = opts && 'context' in opts ? opts.context : null;
-      return new io._HttpClient.new(context);
-    }
-    static findProxyFromEnvironment(url, opts) {
-      let environment = opts && 'environment' in opts ? opts.environment : null;
-      return io._HttpClient._findProxyFromEnvironment(url, environment);
-    }
-  };
-  (io.HttpClient[dart.mixinNew] = function() {
-    this[idleTimeout$] = null;
-    this[maxConnectionsPerHost] = null;
-    this[autoUncompress] = null;
-    this[userAgent] = null;
-  }).prototype = io.HttpClient.prototype;
-  dart.addTypeTests(io.HttpClient);
-  const idleTimeout$ = Symbol("HttpClient.idleTimeout");
-  const maxConnectionsPerHost = Symbol("HttpClient.maxConnectionsPerHost");
-  const autoUncompress = Symbol("HttpClient.autoUncompress");
-  const userAgent = Symbol("HttpClient.userAgent");
-  dart.setSignature(io.HttpClient, {
-    fields: () => ({
-      idleTimeout: dart.fieldType(core.Duration),
-      maxConnectionsPerHost: dart.fieldType(core.int),
-      autoUncompress: dart.fieldType(core.bool),
-      userAgent: dart.fieldType(core.String)
-    }),
-    statics: () => ({findProxyFromEnvironment: dart.fnType(core.String, [core.Uri], {environment: MapOfString$String()})}),
-    names: ['findProxyFromEnvironment']
-  });
-  dart.defineLazy(io.HttpClient, {
-    get DEFAULT_HTTP_PORT() {
-      return 80;
-    },
-    get DEFAULT_HTTPS_PORT() {
-      return 443;
-    }
-  });
-  io.HttpClientRequest = class HttpClientRequest extends core.Object {
-    get persistentConnection() {
-      return this[persistentConnection$0];
-    }
-    set persistentConnection(value) {
-      this[persistentConnection$0] = value;
-    }
-    get followRedirects() {
-      return this[followRedirects];
-    }
-    set followRedirects(value) {
-      this[followRedirects] = value;
-    }
-    get maxRedirects() {
-      return this[maxRedirects];
-    }
-    set maxRedirects(value) {
-      this[maxRedirects] = value;
-    }
-    get contentLength() {
-      return this[contentLength$0];
-    }
-    set contentLength(value) {
-      this[contentLength$0] = value;
-    }
-    get bufferOutput() {
-      return this[bufferOutput$];
-    }
-    set bufferOutput(value) {
-      this[bufferOutput$] = value;
-    }
-  };
-  (io.HttpClientRequest.new = function() {
-    this[persistentConnection$0] = null;
-    this[followRedirects] = null;
-    this[maxRedirects] = null;
-    this[contentLength$0] = null;
-    this[bufferOutput$] = null;
-  }).prototype = io.HttpClientRequest.prototype;
-  dart.addTypeTests(io.HttpClientRequest);
-  const persistentConnection$0 = Symbol("HttpClientRequest.persistentConnection");
-  const followRedirects = Symbol("HttpClientRequest.followRedirects");
-  const maxRedirects = Symbol("HttpClientRequest.maxRedirects");
-  const contentLength$0 = Symbol("HttpClientRequest.contentLength");
-  const bufferOutput$ = Symbol("HttpClientRequest.bufferOutput");
-  io.HttpClientRequest[dart.implements] = () => [io.IOSink];
-  dart.setSignature(io.HttpClientRequest, {
-    fields: () => ({
-      persistentConnection: dart.fieldType(core.bool),
-      followRedirects: dart.fieldType(core.bool),
-      maxRedirects: dart.fieldType(core.int),
-      contentLength: dart.fieldType(core.int),
-      bufferOutput: dart.fieldType(core.bool)
-    })
-  });
-  io.HttpClientResponse = class HttpClientResponse extends core.Object {};
-  (io.HttpClientResponse.new = function() {
-  }).prototype = io.HttpClientResponse.prototype;
-  io.HttpClientResponse.prototype[dart.isStream] = true;
-  dart.addTypeTests(io.HttpClientResponse);
-  io.HttpClientResponse[dart.implements] = () => [StreamOfListOfint()];
-  io.HttpClientCredentials = class HttpClientCredentials extends core.Object {};
-  (io.HttpClientCredentials.new = function() {
-  }).prototype = io.HttpClientCredentials.prototype;
-  dart.addTypeTests(io.HttpClientCredentials);
-  io.HttpClientBasicCredentials = class HttpClientBasicCredentials extends io.HttpClientCredentials {
-    static new(username, password) {
-      return new io._HttpClientBasicCredentials.new(username, password);
-    }
-  };
-  dart.addTypeTests(io.HttpClientBasicCredentials);
-  io.HttpClientDigestCredentials = class HttpClientDigestCredentials extends io.HttpClientCredentials {
-    static new(username, password) {
-      return new io._HttpClientDigestCredentials.new(username, password);
-    }
-  };
-  dart.addTypeTests(io.HttpClientDigestCredentials);
-  io.HttpConnectionInfo = class HttpConnectionInfo extends core.Object {};
-  (io.HttpConnectionInfo.new = function() {
-  }).prototype = io.HttpConnectionInfo.prototype;
-  dart.addTypeTests(io.HttpConnectionInfo);
-  io.RedirectInfo = class RedirectInfo extends core.Object {};
-  (io.RedirectInfo.new = function() {
-  }).prototype = io.RedirectInfo.prototype;
-  dart.addTypeTests(io.RedirectInfo);
-  io.DetachedSocket = class DetachedSocket extends core.Object {};
-  (io.DetachedSocket.new = function() {
-  }).prototype = io.DetachedSocket.prototype;
-  dart.addTypeTests(io.DetachedSocket);
-  io.HttpException = class HttpException extends core.Object {
-    get message() {
-      return this[message$8];
-    }
-    set message(value) {
-      super.message = value;
-    }
-    get uri() {
-      return this[uri$0];
-    }
-    set uri(value) {
-      super.uri = value;
-    }
-    toString() {
-      let b = new core.StringBuffer.new();
-      b.write('HttpException: ');
-      b.write(this.message);
-      if (this.uri != null) {
-        b.write(dart.str`, uri = ${this.uri}`);
-      }
-      return b.toString();
-    }
-  };
-  (io.HttpException.new = function(message, opts) {
-    let uri = opts && 'uri' in opts ? opts.uri : null;
-    this[message$8] = message;
-    this[uri$0] = uri;
-  }).prototype = io.HttpException.prototype;
-  dart.addTypeTests(io.HttpException);
-  const message$8 = Symbol("HttpException.message");
-  const uri$0 = Symbol("HttpException.uri");
-  io.HttpException[dart.implements] = () => [io.IOException];
-  dart.setSignature(io.HttpException, {
-    fields: () => ({
-      message: dart.finalFieldType(core.String),
-      uri: dart.finalFieldType(core.Uri)
-    })
-  });
-  dart.defineExtensionMembers(io.HttpException, ['toString']);
-  io.RedirectException = class RedirectException extends core.Object {
-    get message() {
-      return this[message$9];
-    }
-    set message(value) {
-      super.message = value;
-    }
-    get redirects() {
-      return this[redirects$];
-    }
-    set redirects(value) {
-      super.redirects = value;
-    }
-    toString() {
-      return dart.str`RedirectException: ${this.message}`;
-    }
-    get uri() {
-      return this.redirects[$last].location;
-    }
-  };
-  (io.RedirectException.new = function(message, redirects) {
-    this[message$9] = message;
-    this[redirects$] = redirects;
-  }).prototype = io.RedirectException.prototype;
-  dart.addTypeTests(io.RedirectException);
-  const message$9 = Symbol("RedirectException.message");
-  const redirects$ = Symbol("RedirectException.redirects");
-  io.RedirectException[dart.implements] = () => [io.HttpException];
-  dart.setSignature(io.RedirectException, {
-    fields: () => ({
-      message: dart.finalFieldType(core.String),
-      redirects: dart.finalFieldType(ListOfRedirectInfo())
-    }),
-    getters: () => ({uri: dart.fnType(core.Uri, [])})
-  });
-  dart.defineExtensionMembers(io.RedirectException, ['toString']);
-  let const$54;
-  let const$55;
-  let const$56;
-  let const$57;
-  let const$58;
-  let const$59;
-  let const$60;
-  let const$61;
-  let const$62;
-  io.HttpDate = class HttpDate extends core.Object {
-    static format(date) {
-      let wkday = const$54 || (const$54 = dart.constList(["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], dart.dynamic));
-      let month = const$55 || (const$55 = dart.constList(["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], dart.dynamic));
-      let d = date.toUtc();
-      let sb = new core.StringBuffer.new();
-      sb.write(wkday[$_get](dart.notNull(d.weekday) - 1));
-      sb.write(", ");
-      sb.write(dart.notNull(d.day) <= 9 ? "0" : "");
-      sb.write(dart.toString(d.day));
-      sb.write(" ");
-      sb.write(month[$_get](dart.notNull(d.month) - 1));
-      sb.write(" ");
-      sb.write(dart.toString(d.year));
-      sb.write(dart.notNull(d.hour) <= 9 ? " 0" : " ");
-      sb.write(dart.toString(d.hour));
-      sb.write(dart.notNull(d.minute) <= 9 ? ":0" : ":");
-      sb.write(dart.toString(d.minute));
-      sb.write(dart.notNull(d.second) <= 9 ? ":0" : ":");
-      sb.write(dart.toString(d.second));
-      sb.write(" GMT");
-      return sb.toString();
-    }
-    static parse(date) {
-      let SP = 32;
-      let wkdays = const$56 || (const$56 = dart.constList(["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], dart.dynamic));
-      let weekdays = const$57 || (const$57 = dart.constList(["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"], dart.dynamic));
-      let months = const$58 || (const$58 = dart.constList(["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], dart.dynamic));
-      let wkdaysLowerCase = const$59 || (const$59 = dart.constList(["mon", "tue", "wed", "thu", "fri", "sat", "sun"], dart.dynamic));
-      let weekdaysLowerCase = const$60 || (const$60 = dart.constList(["monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"], dart.dynamic));
-      let monthsLowerCase = const$61 || (const$61 = dart.constList(["jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec"], dart.dynamic));
-      let formatRfc1123 = 0;
-      let formatRfc850 = 1;
-      let formatAsctime = 2;
-      let index = 0;
-      let tmp = null;
-      let format = null;
-      function expect(s) {
-        if (date[$length] - index < s[$length]) {
-          dart.throw(new io.HttpException.new(dart.str`Invalid HTTP date ${date}`));
-        }
-        let tmp = date[$substring](index, index + s[$length]);
-        if (tmp !== s) {
-          dart.throw(new io.HttpException.new(dart.str`Invalid HTTP date ${date}`));
-        }
-        index = index + s[$length];
-      }
-      dart.fn(expect, StringTovoid$());
-      function expectWeekday() {
-        let weekday = null;
-        let pos = date[$indexOf](",", index);
-        if (pos === -1) {
-          let pos = date[$indexOf](" ", index);
-          if (pos === -1) dart.throw(new io.HttpException.new(dart.str`Invalid HTTP date ${date}`));
-          tmp = date[$substring](index, pos);
-          index = pos + 1;
-          weekday = wkdays[$indexOf](tmp);
-          if (weekday !== -1) {
-            format = formatAsctime;
-            return weekday;
-          }
-        } else {
-          tmp = date[$substring](index, pos);
-          index = pos + 1;
-          weekday = wkdays[$indexOf](tmp);
-          if (weekday !== -1) {
-            format = formatRfc1123;
-            return weekday;
-          }
-          weekday = weekdays[$indexOf](tmp);
-          if (weekday !== -1) {
-            format = formatRfc850;
-            return weekday;
-          }
-        }
-        dart.throw(new io.HttpException.new(dart.str`Invalid HTTP date ${date}`));
-      }
-      dart.fn(expectWeekday, VoidToint());
-      function expectMonth(separator) {
-        let pos = date[$indexOf](separator, index);
-        if (pos - index !== 3) dart.throw(new io.HttpException.new(dart.str`Invalid HTTP date ${date}`));
-        tmp = date[$substring](index, pos);
-        index = pos + 1;
-        let month = months[$indexOf](tmp);
-        if (month !== -1) return month;
-        dart.throw(new io.HttpException.new(dart.str`Invalid HTTP date ${date}`));
-      }
-      dart.fn(expectMonth, StringToint$());
-      function expectNum(separator) {
-        let pos = null;
-        if (separator[$length] > 0) {
-          pos = date[$indexOf](separator, index);
-        } else {
-          pos = date[$length];
-        }
-        let tmp = date[$substring](index, pos);
-        index = dart.notNull(pos) + separator[$length];
-        try {
-          let value = core.int.parse(tmp);
-          return value;
-        } catch (e) {
-          if (core.FormatException.is(e)) {
-            dart.throw(new io.HttpException.new(dart.str`Invalid HTTP date ${date}`));
-          } else
-            throw e;
-        }
-
-      }
-      dart.fn(expectNum, StringToint$());
-      function expectEnd() {
-        if (index !== date[$length]) {
-          dart.throw(new io.HttpException.new(dart.str`Invalid HTTP date ${date}`));
-        }
-      }
-      dart.fn(expectEnd, VoidTovoid$21());
-      let weekday = expectWeekday();
-      let day = null;
-      let month = null;
-      let year = null;
-      let hours = null;
-      let minutes = null;
-      let seconds = null;
-      if (format === formatAsctime) {
-        month = expectMonth(" ");
-        if (date[$codeUnitAt](index) === SP) index++;
-        day = expectNum(" ");
-        hours = expectNum(":");
-        minutes = expectNum(":");
-        seconds = expectNum(" ");
-        year = expectNum("");
-      } else {
-        expect(" ");
-        day = expectNum(format === formatRfc1123 ? " " : "-");
-        month = expectMonth(format === formatRfc1123 ? " " : "-");
-        year = expectNum(" ");
-        hours = expectNum(":");
-        minutes = expectNum(":");
-        seconds = expectNum(" ");
-        expect("GMT");
-      }
-      expectEnd();
-      return new core.DateTime.utc(year, dart.notNull(month) + 1, day, hours, minutes, seconds, 0);
-    }
-    static _parseCookieDate(date) {
-      let monthsLowerCase = const$62 || (const$62 = dart.constList(["jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec"], dart.dynamic));
-      let position = 0;
-      function error() {
-        dart.throw(new io.HttpException.new(dart.str`Invalid cookie date ${date}`));
-      }
-      dart.fn(error, VoidTovoid$21());
-      function isEnd() {
-        return position === date[$length];
-      }
-      dart.fn(isEnd, VoidTobool());
-      function isDelimiter(s) {
-        let char = s[$codeUnitAt](0);
-        if (char === 9) return true;
-        if (char >= 32 && char <= 47) return true;
-        if (char >= 59 && char <= 64) return true;
-        if (char >= 91 && char <= 96) return true;
-        if (char >= 123 && char <= 126) return true;
-        return false;
-      }
-      dart.fn(isDelimiter, StringTobool$());
-      function isNonDelimiter(s) {
-        let char = s[$codeUnitAt](0);
-        if (char >= 0 && char <= 8) return true;
-        if (char >= 10 && char <= 31) return true;
-        if (char >= 48 && char <= 57) return true;
-        if (char === 58) return true;
-        if (char >= 65 && char <= 90) return true;
-        if (char >= 97 && char <= 122) return true;
-        if (char >= 127 && char <= 255) return true;
-        return false;
-      }
-      dart.fn(isNonDelimiter, StringTobool$());
-      function isDigit(s) {
-        let char = s[$codeUnitAt](0);
-        if (char > 47 && char < 58) return true;
-        return false;
-      }
-      dart.fn(isDigit, StringTobool$());
-      function getMonth(month) {
-        if (month[$length] < 3) return -1;
-        return monthsLowerCase[$indexOf](month[$substring](0, 3));
-      }
-      dart.fn(getMonth, StringToint$());
-      function toInt(s) {
-        let index = 0;
-        for (; index < s[$length] && dart.test(isDigit(s[$_get](index))); index++)
-          ;
-        return core.int.parse(s[$substring](0, index));
-      }
-      dart.fn(toInt, StringToint$());
-      let tokens = [];
-      while (!dart.test(isEnd())) {
-        while (!dart.test(isEnd()) && dart.test(isDelimiter(date[$_get](position))))
-          position++;
-        let start = position;
-        while (!dart.test(isEnd()) && dart.test(isNonDelimiter(date[$_get](position))))
-          position++;
-        tokens[$add](date[$substring](start, position)[$toLowerCase]());
-        while (!dart.test(isEnd()) && dart.test(isDelimiter(date[$_get](position))))
-          position++;
-      }
-      let timeStr = null;
-      let dayOfMonthStr = null;
-      let monthStr = null;
-      let yearStr = null;
-      for (let token of tokens) {
-        if (dart.dtest(dart.dsend(dart.dload(token, 'length'), '<', 1))) continue;
-        if (timeStr == null && dart.dtest(dart.dsend(dart.dload(token, 'length'), '>=', 5)) && dart.test(isDigit(core.String._check(dart.dindex(token, 0)))) && (dart.equals(dart.dindex(token, 1), ":") || dart.test(isDigit(core.String._check(dart.dindex(token, 1)))) && dart.equals(dart.dindex(token, 2), ":"))) {
-          timeStr = core.String._check(token);
-        } else if (dayOfMonthStr == null && dart.test(isDigit(core.String._check(dart.dindex(token, 0))))) {
-          dayOfMonthStr = core.String._check(token);
-        } else if (monthStr == null && dart.notNull(getMonth(core.String._check(token))) >= 0) {
-          monthStr = core.String._check(token);
-        } else if (yearStr == null && dart.dtest(dart.dsend(dart.dload(token, 'length'), '>=', 2)) && dart.test(isDigit(core.String._check(dart.dindex(token, 0)))) && dart.test(isDigit(core.String._check(dart.dindex(token, 1))))) {
-          yearStr = core.String._check(token);
-        }
-      }
-      if (timeStr == null || dayOfMonthStr == null || monthStr == null || yearStr == null) {
-        error();
-      }
-      let year = toInt(yearStr);
-      if (dart.notNull(year) >= 70 && dart.notNull(year) <= 99) {
-        year = dart.notNull(year) + 1900;
-      } else if (dart.notNull(year) >= 0 && dart.notNull(year) <= 69) {
-        year = dart.notNull(year) + 2000;
-      }
-      if (dart.notNull(year) < 1601) error();
-      let dayOfMonth = toInt(dayOfMonthStr);
-      if (dart.notNull(dayOfMonth) < 1 || dart.notNull(dayOfMonth) > 31) error();
-      let month = dart.notNull(getMonth(monthStr)) + 1;
-      let timeList = timeStr[$split](":");
-      if (timeList[$length] !== 3) error();
-      let hour = toInt(timeList[$_get](0));
-      let minute = toInt(timeList[$_get](1));
-      let second = toInt(timeList[$_get](2));
-      if (dart.notNull(hour) > 23) error();
-      if (dart.notNull(minute) > 59) error();
-      if (dart.notNull(second) > 59) error();
-      return new core.DateTime.utc(year, month, dayOfMonth, hour, minute, second, 0);
-    }
-  };
-  (io.HttpDate.new = function() {
-  }).prototype = io.HttpDate.prototype;
-  dart.addTypeTests(io.HttpDate);
-  dart.setSignature(io.HttpDate, {
-    statics: () => ({
-      format: dart.fnType(core.String, [core.DateTime]),
-      parse: dart.fnType(core.DateTime, [core.String]),
-      _parseCookieDate: dart.fnType(core.DateTime, [core.String])
-    }),
-    names: ['format', 'parse', '_parseCookieDate']
-  });
-  const _headers = Symbol('_headers');
-  const _defaultPortForScheme = Symbol('_defaultPortForScheme');
-  const _mutable = Symbol('_mutable');
-  const _noFoldingHeaders = Symbol('_noFoldingHeaders');
-  const _contentLength = Symbol('_contentLength');
-  const _persistentConnection = Symbol('_persistentConnection');
-  const _chunkedTransferEncoding = Symbol('_chunkedTransferEncoding');
-  const _host$ = Symbol('_host');
-  const _port$ = Symbol('_port');
-  const _checkMutable = Symbol('_checkMutable');
-  const _addAll = Symbol('_addAll');
-  const _add$2 = Symbol('_add');
-  const _set$ = Symbol('_set');
-  const _addValue = Symbol('_addValue');
-  const _updateHostHeader = Symbol('_updateHostHeader');
-  const _addDate = Symbol('_addDate');
-  const _addHost = Symbol('_addHost');
-  const _addExpires = Symbol('_addExpires');
-  const _addConnection = Symbol('_addConnection');
-  const _addContentType = Symbol('_addContentType');
-  const _addContentLength = Symbol('_addContentLength');
-  const _addTransferEncoding = Symbol('_addTransferEncoding');
-  const _addIfModifiedSince = Symbol('_addIfModifiedSince');
-  const _foldHeader = Symbol('_foldHeader');
-  const _finalize = Symbol('_finalize');
-  const _build = Symbol('_build');
-  const _parseCookies = Symbol('_parseCookies');
-  io._HttpHeaders = class _HttpHeaders extends core.Object {
-    _get(name) {
-      return this[_headers][$_get](name[$toLowerCase]());
-    }
-    value(name) {
-      name = name[$toLowerCase]();
-      let values = this[_headers][$_get](name);
-      if (values == null) return null;
-      if (dart.notNull(values[$length]) > 1) {
-        dart.throw(new io.HttpException.new(dart.str`More than one value for header ${name}`));
-      }
-      return values[$_get](0);
-    }
-    add(name, value) {
-      this[_checkMutable]();
-      this[_addAll](io._HttpHeaders._validateField(name), value);
-    }
-    [_addAll](name, value) {
-      if (!(name == io._HttpHeaders._validateField(name))) dart.assertFailed();
-      if (core.Iterable.is(value)) {
-        for (let v of value) {
-          this[_add$2](name, io._HttpHeaders._validateValue(v));
-        }
-      } else {
-        this[_add$2](name, io._HttpHeaders._validateValue(value));
-      }
-    }
-    set(name, value) {
-      this[_checkMutable]();
-      name = io._HttpHeaders._validateField(name);
-      this[_headers][$remove](name);
-      if (name === io.HttpHeaders.TRANSFER_ENCODING) {
-        this[_chunkedTransferEncoding] = false;
-      }
-      this[_addAll](name, value);
-    }
-    remove(name, value) {
-      this[_checkMutable]();
-      name = io._HttpHeaders._validateField(name);
-      value = io._HttpHeaders._validateValue(value);
-      let values = this[_headers][$_get](name);
-      if (values != null) {
-        let index = values[$indexOf](core.String._check(value));
-        if (index !== -1) {
-          values[$removeRange](index, dart.notNull(index) + 1);
-        }
-        if (values[$length] === 0) this[_headers][$remove](name);
-      }
-      if (name === io.HttpHeaders.TRANSFER_ENCODING && dart.equals(value, "chunked")) {
-        this[_chunkedTransferEncoding] = false;
-      }
-    }
-    removeAll(name) {
-      this[_checkMutable]();
-      name = io._HttpHeaders._validateField(name);
-      this[_headers][$remove](name);
-    }
-    forEach(f) {
-      this[_headers][$forEach](f);
-    }
-    noFolding(name) {
-      if (this[_noFoldingHeaders] == null) this[_noFoldingHeaders] = ListOfString().new();
-      this[_noFoldingHeaders][$add](name);
-    }
-    get persistentConnection() {
-      return this[_persistentConnection];
-    }
-    set persistentConnection(persistentConnection) {
-      this[_checkMutable]();
-      if (persistentConnection == this[_persistentConnection]) return;
-      if (dart.test(persistentConnection)) {
-        if (this.protocolVersion === "1.1") {
-          this.remove(io.HttpHeaders.CONNECTION, "close");
-        } else {
-          if (this[_contentLength] === -1) {
-            dart.throw(new io.HttpException.new("Trying to set 'Connection: Keep-Alive' on HTTP 1.0 headers with " + "no ContentLength"));
-          }
-          this.add(io.HttpHeaders.CONNECTION, "keep-alive");
-        }
-      } else {
-        if (this.protocolVersion === "1.1") {
-          this.add(io.HttpHeaders.CONNECTION, "close");
-        } else {
-          this.remove(io.HttpHeaders.CONNECTION, "keep-alive");
-        }
-      }
-      this[_persistentConnection] = persistentConnection;
-    }
-    get contentLength() {
-      return this[_contentLength];
-    }
-    set contentLength(contentLength) {
-      this[_checkMutable]();
-      if (this.protocolVersion === "1.0" && dart.test(this.persistentConnection) && contentLength === -1) {
-        dart.throw(new io.HttpException.new("Trying to clear ContentLength on HTTP 1.0 headers with " + "'Connection: Keep-Alive' set"));
-      }
-      if (this[_contentLength] == contentLength) return;
-      this[_contentLength] = contentLength;
-      if (dart.notNull(this[_contentLength]) >= 0) {
-        if (dart.test(this.chunkedTransferEncoding)) this.chunkedTransferEncoding = false;
-        this[_set$](io.HttpHeaders.CONTENT_LENGTH, dart.toString(contentLength));
-      } else {
-        this.removeAll(io.HttpHeaders.CONTENT_LENGTH);
-        if (this.protocolVersion === "1.1") {
-          this.chunkedTransferEncoding = true;
-        }
-      }
-    }
-    get chunkedTransferEncoding() {
-      return this[_chunkedTransferEncoding];
-    }
-    set chunkedTransferEncoding(chunkedTransferEncoding) {
-      this[_checkMutable]();
-      if (dart.test(chunkedTransferEncoding) && this.protocolVersion === "1.0") {
-        dart.throw(new io.HttpException.new("Trying to set 'Transfer-Encoding: Chunked' on HTTP 1.0 headers"));
-      }
-      if (chunkedTransferEncoding == this[_chunkedTransferEncoding]) return;
-      if (dart.test(chunkedTransferEncoding)) {
-        let values = this[_headers][$_get](io.HttpHeaders.TRANSFER_ENCODING);
-        if (values == null || values[$last] !== "chunked") {
-          this[_addValue](io.HttpHeaders.TRANSFER_ENCODING, "chunked");
-        }
-        this.contentLength = -1;
-      } else {
-        this.remove(io.HttpHeaders.TRANSFER_ENCODING, "chunked");
-      }
-      this[_chunkedTransferEncoding] = chunkedTransferEncoding;
-    }
-    get host() {
-      return this[_host$];
-    }
-    set host(host) {
-      this[_checkMutable]();
-      this[_host$] = host;
-      this[_updateHostHeader]();
-    }
-    get port() {
-      return this[_port$];
-    }
-    set port(port) {
-      this[_checkMutable]();
-      this[_port$] = port;
-      this[_updateHostHeader]();
-    }
-    get ifModifiedSince() {
-      let values = this[_headers][$_get](io.HttpHeaders.IF_MODIFIED_SINCE);
-      if (values != null) {
-        try {
-          return io.HttpDate.parse(values[$_get](0));
-        } catch (e) {
-          if (core.Exception.is(e)) {
-            return null;
-          } else
-            throw e;
-        }
-
-      }
-      return null;
-    }
-    set ifModifiedSince(ifModifiedSince) {
-      this[_checkMutable]();
-      let formatted = io.HttpDate.format(ifModifiedSince.toUtc());
-      this[_set$](io.HttpHeaders.IF_MODIFIED_SINCE, formatted);
-    }
-    get date() {
-      let values = this[_headers][$_get](io.HttpHeaders.DATE);
-      if (values != null) {
-        try {
-          return io.HttpDate.parse(values[$_get](0));
-        } catch (e) {
-          if (core.Exception.is(e)) {
-            return null;
-          } else
-            throw e;
-        }
-
-      }
-      return null;
-    }
-    set date(date) {
-      this[_checkMutable]();
-      let formatted = io.HttpDate.format(date.toUtc());
-      this[_set$]("date", formatted);
-    }
-    get expires() {
-      let values = this[_headers][$_get](io.HttpHeaders.EXPIRES);
-      if (values != null) {
-        try {
-          return io.HttpDate.parse(values[$_get](0));
-        } catch (e) {
-          if (core.Exception.is(e)) {
-            return null;
-          } else
-            throw e;
-        }
-
-      }
-      return null;
-    }
-    set expires(expires) {
-      this[_checkMutable]();
-      let formatted = io.HttpDate.format(expires.toUtc());
-      this[_set$](io.HttpHeaders.EXPIRES, formatted);
-    }
-    get contentType() {
-      let values = this[_headers][$_get]("content-type");
-      if (values != null) {
-        return io.ContentType.parse(values[$_get](0));
-      } else {
-        return null;
-      }
-    }
-    set contentType(contentType) {
-      this[_checkMutable]();
-      this[_set$](io.HttpHeaders.CONTENT_TYPE, dart.toString(contentType));
-    }
-    clear() {
-      this[_checkMutable]();
-      this[_headers][$clear]();
-      this[_contentLength] = -1;
-      this[_persistentConnection] = true;
-      this[_chunkedTransferEncoding] = false;
-      this[_host$] = null;
-      this[_port$] = null;
-    }
-    [_add$2](name, value) {
-      if (!(name == io._HttpHeaders._validateField(name))) dart.assertFailed();
-      switch (name[$length]) {
-        case 4:
-        {
-          if (io.HttpHeaders.DATE === name) {
-            this[_addDate](name, value);
-            return;
-          }
-          if (io.HttpHeaders.HOST === name) {
-            this[_addHost](name, value);
-            return;
-          }
-          break;
-        }
-        case 7:
-        {
-          if (io.HttpHeaders.EXPIRES === name) {
-            this[_addExpires](name, value);
-            return;
-          }
-          break;
-        }
-        case 10:
-        {
-          if (io.HttpHeaders.CONNECTION === name) {
-            this[_addConnection](name, value);
-            return;
-          }
-          break;
-        }
-        case 12:
-        {
-          if (io.HttpHeaders.CONTENT_TYPE === name) {
-            this[_addContentType](name, value);
-            return;
-          }
-          break;
-        }
-        case 14:
-        {
-          if (io.HttpHeaders.CONTENT_LENGTH === name) {
-            this[_addContentLength](name, value);
-            return;
-          }
-          break;
-        }
-        case 17:
-        {
-          if (io.HttpHeaders.TRANSFER_ENCODING === name) {
-            this[_addTransferEncoding](name, value);
-            return;
-          }
-          if (io.HttpHeaders.IF_MODIFIED_SINCE === name) {
-            this[_addIfModifiedSince](name, value);
-            return;
-          }
-        }
-      }
-      this[_addValue](name, value);
-    }
-    [_addContentLength](name, value) {
-      if (core.int.is(value)) {
-        this.contentLength = value;
-      } else if (typeof value == 'string') {
-        this.contentLength = core.int.parse(value);
-      } else {
-        dart.throw(new io.HttpException.new(dart.str`Unexpected type for header named ${name}`));
-      }
-    }
-    [_addTransferEncoding](name, value) {
-      if (dart.equals(value, "chunked")) {
-        this.chunkedTransferEncoding = true;
-      } else {
-        this[_addValue](io.HttpHeaders.TRANSFER_ENCODING, value);
-      }
-    }
-    [_addDate](name, value) {
-      if (core.DateTime.is(value)) {
-        this.date = value;
-      } else if (typeof value == 'string') {
-        this[_set$](io.HttpHeaders.DATE, value);
-      } else {
-        dart.throw(new io.HttpException.new(dart.str`Unexpected type for header named ${name}`));
-      }
-    }
-    [_addExpires](name, value) {
-      if (core.DateTime.is(value)) {
-        this.expires = value;
-      } else if (typeof value == 'string') {
-        this[_set$](io.HttpHeaders.EXPIRES, value);
-      } else {
-        dart.throw(new io.HttpException.new(dart.str`Unexpected type for header named ${name}`));
-      }
-    }
-    [_addIfModifiedSince](name, value) {
-      if (core.DateTime.is(value)) {
-        this.ifModifiedSince = value;
-      } else if (typeof value == 'string') {
-        this[_set$](io.HttpHeaders.IF_MODIFIED_SINCE, value);
-      } else {
-        dart.throw(new io.HttpException.new(dart.str`Unexpected type for header named ${name}`));
-      }
-    }
-    [_addHost](name, value) {
-      if (typeof value == 'string') {
-        let pos = value[$indexOf](":");
-        if (pos === -1) {
-          this[_host$] = value;
-          this[_port$] = io.HttpClient.DEFAULT_HTTP_PORT;
-        } else {
-          if (pos > 0) {
-            this[_host$] = value[$substring](0, pos);
-          } else {
-            this[_host$] = null;
-          }
-          if (pos + 1 === value[$length]) {
-            this[_port$] = io.HttpClient.DEFAULT_HTTP_PORT;
-          } else {
-            try {
-              this[_port$] = core.int.parse(value[$substring](pos + 1));
-            } catch (e) {
-              if (core.FormatException.is(e)) {
-                this[_port$] = null;
-              } else
-                throw e;
-            }
-
-          }
-        }