Version 1.8.0-dev.4.0

 svn merge -r 41500:41683 https://dart.googlecode.com/svn/branches/bleeding_edge trunk

git-svn-id: http://dart.googlecode.com/svn/trunk@41684 260f80e4-7a28-3924-810f-c04153c831b5
diff --git a/dart.gyp b/dart.gyp
index 41f90c3..93d2214 100644
--- a/dart.gyp
+++ b/dart.gyp
@@ -128,7 +128,7 @@
       'target_name': 'api_docs',
       'type': 'none',
       'dependencies': [
-        'utils/apidoc/docgen.gyp:docgen',
+        'utils/apidoc/docgen.gyp:dartdocgen',
       ],
     },
     {
diff --git a/docs/language/dartLangSpec.tex b/docs/language/dartLangSpec.tex
index 1b22fd8..fd3073c 100644
--- a/docs/language/dartLangSpec.tex
+++ b/docs/language/dartLangSpec.tex
@@ -1,19 +1,12 @@
 \documentclass{article}
 \usepackage{epsfig}
-\usepackage{color}
 \usepackage{dart}
 \usepackage{bnf}
 \usepackage{hyperref}
-\usepackage{lmodern}
 \newcommand{\code}[1]{{\sf #1}}
 \title{Dart Programming Language  Specification \\
 {\large Version 1.6}}
 %\author{The Dart Team}
-
-% For information about Location Markers (and in particular the
-% commands \LMHash and \LMLabel), see the long comment at the
-% end of this file.
-
 \begin{document}
 \maketitle
 \tableofcontents
@@ -26,26 +19,22 @@
 
 % begin Ecma boilerplate
 \section{Scope}
-\LMLabel{ecmaScope}
+\label{ecmaScope}
 
-\LMHash{}
 This Ecma standard specifies the syntax and semantics of the Dart programming language.  It does not specify the APIs of the Dart libraries except where those library elements are essential to the correct functioning of the language itself (e.g., the existence of class \cd{Object} with methods such as \cd{noSuchMethod}, \cd{runtimeType}).
 
 \section{Conformance}
-\LMLabel{ecmaConformance}
+\label{ecmaConformance}
 
-\LMHash{}
 A conforming  implementation of the Dart programming language must provide and support all the  APIs (libraries, types, functions, getters, setters, whether top-level, static, instance or local) mandated in this specification. 
 
-\LMHash{}
 A conforming implementation is permitted to provide additional APIs, but not additional syntax.
 
 % A claim of conformance with this Ecma Standard shall specify?
 
 \section{Normative References}
-\LMLabel{ecmaNormativeReferences}
+\label{ecmaNormativeReferences}
 
-\LMHash{}
 The following referenced documents are indispensable for the application of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.
 
 \begin{enumerate}
@@ -57,17 +46,15 @@
 
 
 \section{Terms and Definitions}
-\LMLabel{ecmaTermsAndDefinitions}
+\label{ecmaTermsAndDefinitions}
 
-\LMHash{}
 Terms and definitions used in this specification are given in the body of the specification proper. Such terms are highlighted in italics when they are introduced, e.g., `we use the term {\em verbosity} to refer to the property of excess verbiage'.
 % End Ecma Boilerplate
 
   
 \section{Notation}
-\LMLabel{notation}
+\label{notation}
 
-\LMHash{}
 We distinguish between normative and non-normative text. Normative text defines the rules of Dart. It is given in this font. At this time, non-normative text includes:
 \begin{itemize}
 \item[Rationale] Discussion of the motivation for language design decisions appears in italics. \rationale{Distinguishing normative from non-normative helps clarify what part of the text is binding and what part is merely expository.}
@@ -75,7 +62,6 @@
 \item[Open questions] (\Q{in this font}). Open questions are points that are unsettled in the mind of the author(s) of the specification; expect them (the questions, not the authors; precision is important in a specification) to be eliminated in the final specification. \Q{Should the text at the end of the previous bullet be rationale or commentary?}
 \end{itemize}
 
-\LMHash{}
 Reserved words and built-in identifiers  (\ref{identifierReference}) appear in {\bf bold}.
 
 \commentary{
@@ -83,7 +69,6 @@
 }
 
 
-\LMHash{}
 Grammar productions are given in a common variant of EBNF.  The left hand side of a production ends with a colon.  On the right hand side, alternation is represented by vertical bars, and sequencing by spacing.  As in PEGs, alternation gives priority to the left. Optional elements of a production are suffixed by a question mark like so: \code{anElephant?}.  Appending a star to an element of a production means it may be repeated zero or more times.  Appending a plus sign to a production means it occurs one or more times. Parentheses are used for grouping. Negation  is represented by prefixing an element of a production with a tilde. Negation is similar to the not combinator of PEGs, but it consumes input if it matches. In the context of a lexical production it consumes a single character if there is one;  otherwise, a single token if there is one.
 
 \commentary{ An example would be:}
@@ -110,23 +95,17 @@
 % The alternative is to define ~X as anything but X, or to introduce an anthingBut(X) 
 % combinator, such as !X
 
-\LMHash{}
 Both syntactic and lexical productions are represented this way. Lexical productions are distinguished by their names. The names of lexical productions consist exclusively of upper case characters and underscores.  As always, within grammatical productions, whitespace and comments between elements of the production are implicitly ignored unless stated otherwise. 
 Punctuation tokens appear in quotes. 
 
-\LMHash{}
 Productions are embedded, as much as possible, in the discussion of the constructs they represent. 
 
-\LMHash{}
 A list $x_1, \ldots, x_n$ denotes any list of $n$ elements of the form $x_i, 1 \le i \le n$. Note that $n$ may be zero, in which case the list is empty. We use such lists extensively throughout this specification.
 
-\LMHash{}
 The notation $[x_1, \ldots, x_n/y_1, \ldots, y_n]E$ denotes a copy of $E$ in which all occurrences of $y_i, 1 \le i \le n$ have been replaced with $x_i$.
 
-\LMHash{}
 We sometimes abuse list or map literal syntax, writing $[o_1, \ldots, o_n]$  (respectively $\{k_1: o_1, \ldots, k_n: o_n\}$) where the $o_i$ and $k_i$ may be objects rather than expressions. The intent is to denote a list (respectively map) object whose elements are the $o_i$ (respectively, whose keys are the $k_i$ and values are the $o_i$).
 
-\LMHash{}
 The specifications of operators often involve statements such as $x$ $op$ $y$ is equivalent to the method invocation $x.op(y)$. Such specifications should be understood as a shorthand for:
 \begin{itemize}
 \item
@@ -136,10 +115,8 @@
  \rationale{This circumlocution is required because x.op(y), where op is an operator, is not legal syntax. However, it is painfully verbose, and we prefer to state this rule once here, and use a concise and clear notation across the specification.
  }
 
-\LMHash{}
 When the specification refers to the order given in the program, it means the order of the program source code text, scanning left-to-right and top-to-bottom.
 
-\LMHash{}
 References to otherwise unspecified names of program entities (such as classes or functions) are interpreted as the names of members of the Dart core library.
 
 \commentary{
@@ -147,15 +124,12 @@
 }
 
 \section{Overview}
-\LMLabel{overview}
+\label{overview}
 
-\LMHash{}
 Dart is a class-based, single-inheritance, pure object-oriented programming language. Dart is optionally typed (\ref{types}) and supports reified generics. The run-time type of every object is represented as an instance of class \code{Type}  which can be obtained by calling the getter  \code{runtimeType} declared in class \code{Object}, the root of the Dart class hierarchy.
 
-\LMHash{}
 Dart programs may be statically checked. The static checker will report some violations of the type rules, but such violations do not abort compilation or preclude execution. 
 
-\LMHash{}
 Dart programs may be executed in one of two modes: production mode or checked mode. In production mode, static type annotations (\ref{staticTypes}) have absolutely no effect on execution with the exception of reflection and structural type tests. 
 
 \commentary{
@@ -164,7 +138,6 @@
 Type tests also examine the types in a program explicitly. Nevertheless, in most cases, these will not depend on type annotations. The exceptions to this rule are type tests involving function types. Function types are structural, and so depend on the types declared for their parameters and on their return types. 
 }
 
-\LMHash{}
 In checked mode, assignments are dynamically checked, and certain violations of the type system raise exceptions at run time.
 
 \commentary{
@@ -177,36 +150,30 @@
 \end{enumerate}
 }
 
-\LMHash{}
 Dart programs are organized in a modular fashion into units called {\em libraries} (\ref{librariesAndScripts}). Libraries are units of encapsulation and may be mutually recursive. 
 
 \commentary{However they are not first class.  To get multiple copies of a library running simultaneously, one needs to spawn an isolate. 
 }
 
 \subsection{Scoping}
-\LMLabel{scoping}
+\label{scoping}
 
-\LMHash{}
 A {\em namespace} is a mapping of names denoting declarations to actual declarations.  Let $NS$ be a namespace. We say that a name $n$ {\em is in }$NS$ if $n$ is a key of $NS$. We say a declaration $d$ {\em is in }$NS$ if a key of $NS$ maps to $d$.
 
-\LMHash{}
 A scope $S_0$ induces a namespace $NS_0$ that maps the simple name of each variable, type or function declaration $d$ declared in $S_0$ to $d$. Labels are not included in the induced namespace of a scope; instead they have their own dedicated namespace.
 
 \commentary{It is therefore impossible, e.g.,  to define a class that declares a method and a field with the same name in Dart. Similarly one cannot declare a top-level function with the same name as a library variable or class.
   }
   
-\LMHash{}
 It is a compile-time error if there is more than one entity with the same name declared in the same scope.
 
 \commentary{
 In some cases, the name of the declaration differs from the identifier used to declare it.  Setters have names that are distinct from the corresponding getters because they always have an = automatically added at the end, and unary minus has the special name unary-.
 }
 
-\LMHash{}
 Dart is lexically scoped.    Scopes may nest.  A name or declaration $d$ is {\em available in scope} $S$ if $d$ is in the namespace induced by $S$ or if $d$ is available in the lexically enclosing scope of $S$. We  say that a name or declaration $d$ is {\em in scope} if $d$ is available in the current scope. 
 
 
-\LMHash{}
 If a  declaration $d$ named $n$ is in the namespace induced by a scope $S$, then $d$ {\em hides} any declaration named $n$ that is available in the lexically enclosing scope of $S$. 
 
 \commentary {
@@ -220,7 +187,6 @@
 \}
 \end{dartCode}
 
-\LMHash{}
 Names may be introduced into a scope by  declarations within the scope or  by other mechanisms such as imports or inheritance.
 
 \rationale{
@@ -261,20 +227,17 @@
 
 
 \subsection{Privacy}
-\LMLabel{privacy}
+\label{privacy}
 
-\LMHash{}
 Dart supports two levels of privacy: {\em public} and {\em private}.  A declaration is {\em private} iff its name is private, otherwise it is {\em public.}  A  name $q$ is private iff any one of the identifiers that comprise $q$ is private,  otherwise it is {\em public.}  An identifier is private iff it
 begins with an underscore (the \_ character) otherwise it is {\em public.} 
 
-\LMHash{}
 A declaration $m$ is {\em accessible to library $L$}  if $m$ is declared in $L$ or if $m$ is public.
 
 \commentary{
 This means private declarations may only be accessed within the library in which they are declared.
 }
 
-\LMHash{}
 Privacy applies only to declarations within a library, not to library declarations themselves. 
 
 \rationale{Libraries do not reference each other by name and so the idea of a private library is meaningless.
@@ -287,20 +250,16 @@
 
 \subsection{Concurrency}
 
-\LMHash{}
 Dart code is always single threaded. There is no shared-state concurrency in Dart. Concurrency is supported via actor-like entities called {\em isolates}.
 
-\LMHash{}
 An isolate is a unit of concurrency. It has its own memory and its own thread of control. Isolates communicate by message passing (\ref{sendingMessages}). No state is ever shared between isolates. Isolates are created by spawning (\ref{spawningAnIsolate}). 
 
 
 \section{Errors and Warnings}
-\LMLabel{errorsAndWarnings}
+\label{errorsAndWarnings}
 
-\LMHash{}
 This specification distinguishes between several kinds of errors.
 
-\LMHash{}
 {\em Compile-time errors} are errors that preclude execution. A compile-time error must be reported by a Dart compiler before the erroneous code is executed. 
 
 \rationale{A Dart implementation has considerable freedom as to when compilation takes place. Modern programming language implementations often interleave compilation and execution, so that compilation of a method may be delayed, e.g.,  until it is first invoked. Consequently, compile-time errors in a method $m$ may be reported as late as the time of $m$'s first invocation.
@@ -310,7 +269,6 @@
 In a development environment a compiler should of course report compilation errors eagerly so as to  best serve the programmer.
 }
 
-\LMHash{}
 If an uncaught compile-time error occurs within the code of a running isolate $A$, $A$ is immediately suspended.  The only circumstance where a compile-time error could be caught would be via code run reflectively, where the mirror system can catch it.
 
 \rationale{Typically, once a compile-time error is thrown and $A$ is suspended, $A$ will then be terminated. However, this depends on the overall environment. 
@@ -318,23 +276,18 @@
 a program that interfaces between the engine and the surrounding computing environment. The embedder will often be a web browser, but need not be; it may be a C++ program on the server for example. When an isolate fails with a compile-time error as described above, control returns to the embedder, along with an exception describing the problem.  This is necessary so that the embedder can clean up resources etc. It is then the embedder's decision whether to terminate the isolate or not.
 }
 
-\LMHash{}
 {\em Static  warnings} are those errors reported by the static checker. They have no effect on execution. Many, but not all, static warnings relate to types, in which case they are known as {\em static type warnings.} Static warnings must be provided by Dart compilers used during development such as those incorporated in IDEs or otherwise intended to be used by developers for developing code. Compilers that are part of runtime execution environments such as virtual machines should not issue static warnings.
 
-\LMHash{}
 {\em Dynamic type errors} are type errors reported in checked mode.
 
-\LMHash{}
 {\em Run-time errors} are exceptions raised during execution. Whenever we say that an exception $ex$ is {\em raised} or {\em thrown}, we mean that a throw expression  (\ref{throw}) of the form: \code{\THROW{} $ex$;} was implicitly evaluated or that a rethrow statement (\ref{rethrow}) of the form \code{\RETHROW} was executed. When we say that {\em a} $C$ {\em is thrown}, where $C$ is a class, we mean that an instance of class $C$ is thrown.
 
-\LMHash{}
 If an uncaught exception is thrown by a running isolate $A$, $A$ is immediately suspended. 
 
 
 \section{Variables}
-\LMLabel{variables}
+\label{variables}
 
-\LMHash{}
 Variables are storage locations in memory.  
 
 \begin{grammar}
@@ -372,25 +325,19 @@
 
   \end{grammar}
 
-\LMHash{}
 A variable that has not been initialized has the initial value \NULL{} (\ref{null}).
 
-\LMHash{}
 A variable declared at the top-level of a library is referred to as either a {\em library variable} or simply a top-level variable. 
 
-\LMHash{}
 A {\em static variable} is a variable that is not associated with a particular instance, but rather with an entire library or class.  Static variables include library variables and class variables. Class variables are variables whose declaration is immediately nested inside a class declaration and includes the modifier \STATIC{}. A library variable is implicitly static. It is a compile-time error to preface a top-level variable declaration with the built-in identifier  (\ref{identifierReference}) \STATIC{}.  
 
-\LMHash{}
 Static variable declarations are initialized lazily. When a static variable $v$ is read, iff it has not yet been assigned,  it is set to the result of evaluating its initializer. The precise rules are given in section \ref{evaluationOfImplicitVariableGetters}. 
 
 \rationale{The lazy semantics are given because we do not want a language where one tends to define expensive initialization computations, causing long application startup times. This is especially crucial for Dart, which must support the coding of  client applications.
 }
 
-\LMHash{}
 A {\em final variable} is a variable whose binding is fixed upon initialization; a final variable $v$ will always refer to the same object after $v$ has been initialized. The declaration of a final variable must  include the modifier \FINAL{}. 
 
-\LMHash{}
 It is a static warning if a final instance variable that has been initialized at its point of declaration  is  also initialized in a constructor. 
 % It is a static warning if a final instance variable that has been initialized by means of an initializing formal of a constructor is  also initialized elsewhere in the same constructor.
 It is a compile-time error if a local variable $v$ is final and $v$ is not initialized at its point of declaration.
@@ -404,27 +351,20 @@
 Taken as a whole, the rules ensure that any attempt to execute multiple assignments to a final variable will yield static warnings and repeated assignments will fail dynamically.
 }
 
-\LMHash{}
 A {\em constant variable} is a variable whose declaration includes the modifier \CONST{}. A constant variable is always implicitly final. A constant variable must be initialized to a compile-time constant (\ref{constants}) or a compile-time error occurs.
 
-\LMHash{}
 We say that a variable $v$ is {\em potentially mutated} in some scope $s$ if $v$ is not final or constant and an assignment to $v$ occurs in $s$.
 
-\LMHash{}
 If a variable declaration does not explicitly specify a type, the type of the declared variable(s) is  \DYNAMIC{}, the unknown type (\ref{typeDynamic}). 
 
-\LMHash{}
 A variable is {\em mutable} if it is not final.
 Static and instance variable declarations always induce implicit getters. If the variable is mutable it also introduces an implicit setter.
 The scope into which the implicit getters and setters are introduced depends on the kind of variable declaration involved. 
 
-\LMHash{}
 A library variable introduces a getter into the top level scope of the enclosing library. A static class variable introduces a static getter into the immediately enclosing class. An instance variable introduces an instance getter into the immediately enclosing class. 
 
-\LMHash{}
 A mutable library variable introduces a setter into the top level scope of the enclosing library. A mutable static class variable introduces a static setter into the immediately enclosing class. A mutable instance variable introduces an instance setter into the immediately enclosing class. 
 
-\LMHash{}
 Local variables are added to the innermost enclosing scope.  They do not induce getters and setters.  A local variable may only be referenced at a source code location that is after its initializer, if any, is complete, or a compile-time error occurs.  The error may be reported either at the point where the premature reference occurs, or at the variable declaration.
 
 \rationale {
@@ -482,10 +422,8 @@
 
 % the grammar does not support local getters and setters. The local var discussion does not seem to mention getters and setters based semantics. It simply discusses the creation of the variable, not its access. Access is either assignment or identifiers. Identifiers ignore the getter story. 
 
-\LMHash{}
 The following rules apply to all static and instance variables.
 
-\LMHash{}
 A  variable declaration  of one of the forms \code{$T$ $v$;},  \code{$T$ $v$ = $e$;} ,  \code{\CONST{} $T$ $v$ = $e$;}, \code{\FINAL{} $T$ $v$;}  or \code{\FINAL{} $T$ $v$ = $e$;} always induces an implicit  getter function (\ref{getters}) with signature 
 
 $T$ \GET{} $v$
@@ -493,21 +431,18 @@
 whose invocation evaluates as described below (\ref{evaluationOfImplicitVariableGetters}).
 
 
-\LMHash{}
 A  variable declaration  of one of the forms \code{\VAR{} $v$;},  \code{\VAR{} $v$ = $e$;} ,  \code{\CONST{} $v$ = $e$;}, \code{\FINAL{} $v$;} or \code{\FINAL{}  $v$ = $e$;}  always induces an implicit  getter function with signature 
 
  \GET{} $v$
 
 whose  invocation evaluates as described below (\ref{evaluationOfImplicitVariableGetters}).
 
-\LMHash{}
 A non-final  variable declaration  of the form \code{{} $T$ $v$;} or the form  \code{$T$ $v$ = $e$;}   always induces an implicit  setter function (\ref{setters}) with signature 
 
  \VOID{} \SET{} $v=(T$ $x)$
 
 whose execution sets the value of $v$ to the incoming argument $x$.
 
-\LMHash{}
 A  non-final variable declaration  of the form \code{\VAR{} $v$;} or the form  \code{\VAR{} $v$ = $e$;}   always induces an implicit  setter function with signature 
 
 \SET{} $v=(x)$
@@ -516,9 +451,8 @@
 
 
 \subsection{Evaluation of Implicit  Variable Getters}
-\LMLabel{evaluationOfImplicitVariableGetters}
+\label{evaluationOfImplicitVariableGetters}
 
-\LMHash{}
 Let $d$ be the declaration of a static or instance variable $v$.  If $d$ is an instance variable, then the invocation of the implicit getter  of $v$ evaluates to the value stored in $v$.
 If $d$ is a static or library variable then the implicit getter method of $v$ executes as follows: 
 \begin{itemize}
@@ -533,9 +467,8 @@
 
 
 \section{Functions}
-\LMLabel{functions}
+\label{functions}
 
-\LMHash{}
 Functions abstract over executable actions.
 
 \begin{grammar}
@@ -558,10 +491,8 @@
 
 \end{grammar}
 
-\LMHash{}
 Functions include  function declarations (\ref{functionDeclarations}), methods (\ref{instanceMethods},  \ref{staticMethods}), getters  (\ref{getters}), setters  (\ref{setters}), constructors  (\ref{constructors}) and function literals  (\ref{functionExpressions}).  
 
-\LMHash{}
 All functions have a signature and a body. The signature describes the formal parameters of the function, and possibly its name and return type.  A function body is either:
 \begin{itemize}
 \item A block statement  (\ref{blocks}) containing the statements  (\ref{statements}) executed by the function, optionally marked with one of the modifiers: \ASYNC, \ASYNC* or \SYNC*. In this case, if the last statement of a function is not a return statement (\ref{return}), the statement \code{\RETURN{};} is implicitly appended to the function body.
@@ -575,14 +506,12 @@
 
 \end{itemize}
 
-\LMHash{}
 A function is {\em asynchronous} if its body is marked with the \ASYNC{} or \ASYNC* modifier. Otherwise the function is {\em synchronous}. A function is a {\em generator} if its body is marked with the \SYNC* or \ASYNC* modifier.  
 
 \commentary{
 Whether a function is synchronous or asynchronous is orthogonal to whether it is a generator or not. Generator functions are a sugar for functions that produce collections in a systematic way, by lazily applying a function that {\em generates} individual elements of a collection. Dart provides such a sugar in both the synchronous case, where one returns an iterable, and in the asynchronous case, where one returns a stream. Dart also allows both synchronous and asynchronous functions that produce a single value. 
 }
 
-\LMHash{}
 It is a compile-time error if an \ASYNC, \ASYNC* or \SYNC* modifier is attached to the body of a setter or constructor.
 
 \rationale{
@@ -595,17 +524,14 @@
 
 
 \subsection{Function Declarations}
-\LMLabel{functionDeclarations}
+\label{functionDeclarations}
 
-\LMHash{}
 A {\em function declaration} is a function that is neither a member of a class nor a function literal. Function declarations include {\em library functions}, which are function declarations 
 %(including getters and setters) 
 at the top level of a library, and {\em local functions}, which are function declarations declared inside other functions. Library functions are often referred to simply as top-level functions.
 
-\LMHash{}
 A function declaration consists of an identifier indicating the function's name, possibly prefaced by a return type. The function name is followed by a signature and body. For getters, the signature  is empty. The body is empty for functions that are external.
 
-\LMHash{}
 The scope of a library function is the scope of the enclosing library. The scope of a local function is  described in section \ref{localFunctionDeclaration}. In both cases, the name of the function is in scope in its formal parameter scope (\ref{formalParameters}).
 
 %A function declaration of the form  $T_0$ $id(T_1$ $a_1, \ldots, T_n$ $a_n, [T_{n+1}$ $x_{n+1} = d_1, \ldots, T_{n+k}$ $x_{n+k} = d_k])\{s\}$ is equivalent to a variable declaration of the form \code{\FINAL{} $F$ $id$ = $(T_1$ $a_1, \ldots, T_n$ $a_n, [T_{n+1}$ $x_{n+1} = d_1, \ldots, T_{n+k}$ $x_{n+k}= d_k])\{s\}$}, where $F$ is the function type alias (\ref{typedef}) \code{\TYPEDEF{} $T_0$ $F(T_1$ $a_1, \ldots, T_n$ $a_n, [T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}])$}.  Likewise,  a function declaration of the form  $id(T_1$ $a_1, \ldots, T_n$ $a_n, [T_{n+1}$ $x_{n+1} = d_1, \ldots, T_{n+k}$ $x_{n+k} = d_k])\{s\}$ is equivalent to a variable declaration of the form \code{\FINAL{} $F$ $id$ = $(T_1$ $a_1, \ldots, T_n$ $a_n, [T_{n+1}$ $x_{n+1} = d_1, \ldots, T_{n+k}$ $x_{n+k} = d_k])\{s\}$}, where $F$ is the function type alias \code{\TYPEDEF{}  $F(T_1$ $a_1, \ldots, T_n$ $a_n, [T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}])$}. 
@@ -626,23 +552,18 @@
 
 %A function declaration of the form  $T_0$ $id(T_1$ $a_1, \ldots, T_n$ $a_n, \{T_{n+1}$ $x_{n+1} : d_1, \ldots, T_{n+k}$ $x_{n+k} : d_k\})\{s\}$ is equivalent to a variable declaration of the form \code{\FINAL{} $F$ $id$ = $(T_1$ $a_1, \ldots, T_n$ $a_n, \{T_{n+1}$ $x_{n+1} : d_1, \ldots, T_{n+k}$ $x_{n+k} : d_k\})\{s\}$}, where $F$ is the function type alias (\ref{typedef}) \code{\TYPEDEF{} $T_0$ $F(T_1$ $a_1, \ldots, T_n$ $a_n, \{T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}]\}$}.  Likewise,  a function declaration of the form  $id(T_1$ $a_1, \ldots, T_n$ $a_n, \{T_{n+1}$ $x_{n+1} : d_1, \ldots, T_{n+k}$ $x_{n+k} : d_k\})\{s\}$ is equivalent to a variable declaration of the form \code{\FINAL{} $F$ $id$ = $(T_1$ $a_1, \ldots, T_n$ $a_n, \{T_{n+1}$ $x_{n+1} : d_1, \ldots, T_{n+k}$ $x_{n+k} : d_k\})\{s\}$}, where $F$ is the function type alias \code{\TYPEDEF{}  $F(T_1$ $a_1, \ldots, T_n$ $a_n, \{T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}\})$}.
 
-\LMHash{}
 It is a compile-time error to preface a function declaration with the built-in identifier \STATIC{}.
 
-\LMHash{}
 When we say that a function $f_1$ {\em forwards} to another function $f_2$, we mean that  invoking $f_1$ causes $f_2$ to  be executed with the same arguments and/or receiver as $f_1$, and returns the result of executing $f_2$ to the caller of $f_1$, unless $f_2$ throws an exception, in which case $f_1$ throws the same exception. Furthermore, we only use the term for synthetic functions introduced by the specification.
 
 
 \subsection{Formal Parameters}
-\LMLabel{formalParameters}
+\label{formalParameters}
 
-\LMHash{}
 Every function includes a {\em formal parameter list}, which consists of a list of required positional parameters (\ref{requiredFormals}), followed by any optional parameters (\ref{optionalFormals}). The optional parameters may be specified either as a set of named parameters or as a list of positional parameters, but not both.
 
-\LMHash{}
 The formal parameter list of a function introduces a new scope known as the function's {\em formal parameter scope}. The formal parameter scope of a function $f$  is enclosed in the scope where $f$ is declared.   Every formal parameter introduces a local variable into the formal parameter scope. However, the scope of a function's signature is the function's enclosing scope, not the formal parameter scope.
 
-\LMHash{}
 The body of a function introduces a new scope known as the function's {\em  body scope}. The body scope of a function $f$  is enclosed  in the scope introduced by the formal parameter scope of $f$.
 
 
@@ -651,7 +572,6 @@
 % The formal parameters of a function are processed in the enclosing scope of the function. 
 % \commentary{this means that the parameters themselves may not be referenced within the formal parameter list.}
 
-\LMHash{}
 It is a compile-time error if a formal parameter is declared as a constant variable (\ref{variables}).
 
 \begin{grammar}
@@ -691,9 +611,8 @@
 
 
 \subsubsection{Required Formals} 
-\LMLabel{requiredFormals}
+\label{requiredFormals}
 
-\LMHash{}
 A {\em required formal parameter} may be specified in one of three ways:
 \begin{itemize}
 \item By means of a function signature that names the parameter and describes its type as a function type (\ref{functionTypes}).  It is a compile-time error if any default values are specified in the signature of such a function type.% explain what the type is in this case? Where is this described in general?
@@ -726,9 +645,8 @@
  %\end{grammar}
 
 \subsubsection{Optional Formals}
-\LMLabel{optionalFormals}
+\label{optionalFormals}
 
-\LMHash{}
 Optional parameters may be specified and provided with default values.
 
 \begin{grammar}
@@ -741,10 +659,8 @@
     .   
 \end{grammar}
 
-\LMHash{}
 It is a compile-time error if the default value of an optional parameter is not a compile-time constant (\ref{constants}). If no default is explicitly specified for an optional parameter an implicit default of \NULL{} is provided.
 
-\LMHash{}
 It is a compile-time error if the name of a named optional parameter begins with an `\_' character.
 
 \rationale{
@@ -753,21 +669,16 @@
 }
 
 \subsection{Type of a Function}
-\LMLabel{typeOfAFunction}
+\label{typeOfAFunction}
 
-\LMHash{}
 If a function does not declare a return type explicitly, its return type is \DYNAMIC{} (\ref{typeDynamic}).
 
-\LMHash{}
 Let $F$ be a function with required formal parameters $T_1$ $p_1 \ldots, T_n$ $p_n$, return type $T_0$ and no optional parameters. Then the type of $F$ is $(T_1 ,\ldots, T_n) \rightarrow T_0$.
 
-\LMHash{}
 Let $F$ be a function with required formal parameters $T_1$ $p_1 \ldots, T_n$ $p_n$, return type $T_0$ and positional optional parameters $T_{n+1}$ $p_{n+1}, \ldots, T_{n+k}$ $ p_{n+k}$. Then the type of $F$ is $(T_1 ,\ldots, T_n, [T_{n+1}$ $p_{n+1}, \ldots, T_{n+k}$  $p_{n+k}]) \rightarrow T_0$.
 
-\LMHash{}
 Let $F$ be a function with required formal parameters $T_1$ $p_1 \ldots, T_n$ $p_n$, return type $T_0$ and named optional parameters $T_{n+1}$ $p_{n+1}, \ldots, T_{n+k}$ $ p_{n+k}$. Then the type of $F$ is $(T_1 ,\ldots, T_n, \{T_{n+1}$ $p_{n+1}, \ldots, T_{n+k}$  $p_{n+k}\}) \rightarrow T_0$.
 
-\LMHash{}
 The run time type of a function object always implements the class \cd{Function}. 
 
 \commentary{
@@ -781,9 +692,8 @@
 }
 
 \subsection{External Functions}
-\LMLabel{externalFunctions}
+\label{externalFunctions}
 
-\LMHash{}
 An {\em external function} is a function whose body is provided separately from its declaration. An external function may be a top-level function (\ref{librariesAndScripts}), a method (\ref{instanceMethods}, \ref{staticMethods}), a getter (\ref{getters}), a setter (\ref{setters}) or a non-redirecting constructor (\ref{generativeConstructors}, \ref{factories}). External functions are introduced via the built-in identifier \EXTERNAL{}  (\ref{identifierReference}) followed by the function signature.  
 
 \rationale{
@@ -794,16 +704,13 @@
 Examples of external functions might be foreign functions (defined in C, or Javascript etc.), primitives of the implementation (as defined by the Dart runtime), or code that was dynamically generated but whose interface is statically known. However, an abstract method is different from an external function, as it has {\em no} body.
 }
 
-\LMHash{}
 An external function is connected to its body by an implementation specific mechanism. Attempting to invoke an external function that has not been connected to its body will raise a \code{NoSuchMethodError} or some subclass thereof.
 
-\LMHash{}
 The actual syntax is given in sections \ref{classes} and \ref{librariesAndScripts} below.
 
 \section{Classes}
-\LMLabel{classes}
+\label{classes}
 
-\LMHash{}
 A {\em class} defines the form and behavior of a set of objects which are its {\em instances}.  Classes may be defined by class declarations as described below, or via mixin applications (\ref{mixinApplication}).
 
 \begin{grammar}
@@ -854,7 +761,6 @@
 
 \end{grammar}
 
-\LMHash{}
 A class has constructors,  instance members and static members. The instance members of a class are its instance methods, getters, setters and instance variables. The static members of a class are its static methods, getters, setters and static variables. The members of a class are its static and instance members.
 
 % A class has a static scope and an instance scope. The enclosing scope of the static scope of a non-generic class is the enclosing scope of the class declaration. The enclosing scope of the static scope of a generic class is the type parameter scope (\ref{}) of the generic class declaration.
@@ -865,14 +771,12 @@
 %The enclosing scope of a static member declaration is the static scope of the class in which it is declared.
 
 
-\LMHash{}
 Every class has a single superclass  except class \code{Object} which has no superclass. A class may implement a number of interfaces
 %, either 
 by declaring them in its implements clause  (\ref{superinterfaces}).
 % or via interface injection declarations (\ref{interfaceInjection}) outside the class declaration
 
 
-\LMHash{}
 An {\em abstract class} is 
 %either 
 a class that is explicitly declared with the  \ABSTRACT{}  modifier, either by means of a class declaration or via a type alias (\ref{typedef}) for a mixin application (\ref{mixinApplication}). A {\em concrete class} is a class that is not abstract.
@@ -883,7 +787,6 @@
 We want different behavior for concrete classes and abstract classes. If $A$ is intended to be abstract, we want the static checker to warn about any attempt to instantiate $A$, and we do not want the checker to complain about unimplemented methods in $A$. In contrast, if $A$ is intended to be concrete, the checker should warn about all unimplemented methods, but allow clients to instantiate it freely.
 }
 
-\LMHash{}
 The {\em interface of class $C$} is an implicit interface that declares instance members that correspond to the instance members declared by $C$, and whose direct superinterfaces are the direct superinterfaces of $C$ (\ref{superinterfaces}). When a class name appears as a type, that name denotes the interface of the class.
 
 % making an exception for the setters generated for final fields is tempting but problematic.
@@ -891,7 +794,6 @@
 % Maybe the final field hides the setter in scope?
 % I think the original rules were best.
 
-\LMHash{}
  It is a compile-time error if a class declares two members of the same name.
  %, except that a getter and a setter may be declared with the same name provided both are instance members or both are static members.
 It is a compile-time error if a class has an instance member and a static member  with the same name. 
@@ -917,32 +819,27 @@
 \}
 \end{dartCode}
 
-\LMHash{}
 It is a compile time error if a class $C$ declares a member with the same name as $C$. It is a compile time error if a generic class declares a type variable with the same name as the class or any of its members or constructors.
 
 \subsection{Instance Methods}
-\LMLabel{instanceMethods}
+\label{instanceMethods}
 
-\LMHash{}
 Instance methods are functions (\ref{functions}) whose declarations are immediately contained within a class declaration and that are not declared \STATIC{}. The instance methods of a class $C$ are those instance methods declared by $C$ and the instance methods inherited by $C$ from its superclass.
 
 %make these warnings if possible
 
-\LMHash{}
 It is a static warning if an instance method $m_1$ overrides  (\ref{inheritanceAndOverriding}) an instance member $m_2$ and  $m_1$ has a greater number of required parameters than $m_2$. It is a static warning if an instance method $m_1$ overrides  an instance member $m_2$ and  $m_1$ has fewer positional parameters than $m_2$.  It is a static warning if an instance method $m_1$ overrides  an instance member $m_2$ and  $m_1$ does not declare all the named parameters declared by $m_2$. 
 
 % not quite right. It should be ok to override a method that requires N parameters with one that requires M < N but accepts the others as optional.
 
-\LMHash{}
 It is a static warning if an instance method $m_1$ overrides an instance member $m_2$ and the type of $m_1$ is not a subtype of the type of $m_2$. It is a static warning if an instance method $m_1$ overrides an instance member $m_2$,  the signature of $m_2$ explicitly specifies a default value for a formal parameter $p$ and the signature of $m_1$ implies a different default value for $p$. It is a static warning if a class $C$ declares an instance method named $n$ and has a setter named $n=$. It is a static warning if a class $C$ declares an instance method named $n$ and an accessible static member named $n$ is declared in a superclass of $C$.
 
 % Works. If the name is public, no issue. If it's private, if a subclass has a conflicting inst var, it either is in the same lib and will be flagged, or is in another and is not an issue.
 
 
 \subsubsection{Operators}
-\LMLabel{operators}
+\label{operators}
 
-\LMHash{}
 {\em Operators} are instance methods with special names. 
 
 \begin{grammar}
@@ -965,41 +862,33 @@
     .
  \end{grammar}
 
-\LMHash{}
 An operator declaration is identified using the built-in identifier (\ref{identifierReference}) \OPERATOR{}.
 
-\LMHash{}
 The following names are allowed for user-defined operators: \code{$<$, $>$, $<$=, $>$=, ==,  -, +, /, \~{}/, *, \%, $|$, \^{}, \&, $<<$, $>>$,  []=, [], \~{}.}
 
 
-\LMHash{}
 It is a compile-time error if the arity of the user-declared operator \code{[]=} is not 2. It is a compile-time error if the arity of a user-declared operator with one of the names:  \code{ $<$, $>$, $<$=, $>$=, ==, -, +,  \~{}/, /, *, \%, $|$, \^{}, \&, $<<$, $>>$, []} is not 1. It is a compile-time error if the arity of the user-declared operator  \code{-} is not 0 or 1. 
 
 \commentary{
 The \code{-} operator is unique in that two overloaded versions are permitted. If the operator has no arguments, it denotes unary minus. If it has an argument, it denotes binary subtraction. 
 }
 
-\LMHash{}
 The name of the unary operator \code{-} is \code{unary-}.
 
 \rationale{
 This device allows the two methods to be distinguished for purposes of method lookup, override and reflection.
 }
 
-\LMHash{}
 It is a compile-time error if the arity of the user-declared operator  \code{ \~{}} is not 0. 
 
-\LMHash{}
 It is a compile-time error to declare an optional parameter in an operator.
 
-\LMHash{}
 It is a static warning if the return type of the user-declared operator \code{[]=} is explicitly declared and not \VOID{}.
 
 
 \subsection{Getters} 
-\LMLabel{getters}
+\label{getters}
 
-\LMHash{}
 Getters are functions (\ref{functions})  that are used to retrieve the values of object properties.
 
 \begin{grammar}
@@ -1010,36 +899,29 @@
 
 %\Q{Why does a getter have a formal parameter list at all?}
 
-\LMHash{}
 If no return type is specified, the return type of the getter is  \DYNAMIC{}.
 
-\LMHash{}
 A getter definition that is prefixed with the \STATIC{} modifier defines a static getter. Otherwise, it defines an instance getter. The name of the getter is given by the identifier in the definition. The effect of a static getter declaration in class $C$ is to add an instance getter with the same name and signature to the \code{Type} object for class $C$ that forwards (\ref{functionDeclarations})  to the static getter.
 
 %It is a compile-time error if a getter`s formal parameter list is not empty.
 
-\LMHash{}
 The instance getters of a class $C$ are those instance getters declared by $C$, either implicitly or explicitly, and the instance getters inherited by $C$ from its superclass. The static getters of a class $C$ are those static getters declared by $C$.
 
-\LMHash{}
 It is a compile-time error if a class has both a getter and a method with the same name. This restriction holds regardless of whether the getter is defined explicitly or implicitly, or whether the getter or the method are inherited or not.
 
 \commentary{
 This implies that a getter can never override a method, and a method can never override a getter or field. 
 }
 
-\LMHash{}
 It is a static warning if the return type of a getter is \VOID.
 It is a static warning if a getter $m_1$ overrides  (\ref{inheritanceAndOverriding}) a getter 
 $m_2$ and the type of $m_1$ is not a subtype of the type of $m_2$.   
 
-\LMHash{}
 It is a static warning if a class  declares a static getter named $v$ and also has a non-static setter named $v=$. It is a static warning if a class $C$ declares an instance getter named $v$ and an accessible static member named $v$ or $v=$ is declared in a superclass of $C$. These warnings must be issued regardless of whether the getters or setters are declared explicitly or implicitly.
 
 \subsection{Setters}
-\LMLabel{setters}
+\label{setters}
 
-\LMHash{}
 Setters are functions (\ref{functions}) that are used to set the values of object properties.
 
 % what about top level ones? Same for getters
@@ -1050,36 +932,28 @@
 .
 \end{grammar}
 
-\LMHash{}
 If no return type is specified, the return type of the setter is  \DYNAMIC{}.
 
-\LMHash{}
 A setter definition that is prefixed with the \STATIC{} modifier defines a static setter. Otherwise, it defines an instance setter. The name of a setter is  obtained by appending the  string `='  to the identifier given in its signature. The effect of a static setter declaration in class $C$ is to add an instance setter with the same name and signature to the \code{Type} object for class $C$ that forwards (\ref{functionDeclarations})  to the static setter.
 
 \commentary{Hence, a setter name can never conflict with, override or be overridden by a getter or method.}
 
-\LMHash{}
 The instance setters of a class $C$ are those instance setters declared by $C$ either implicitly or explicitly, and the instance setters inherited by $C$ from its superclass. The static setters of a class $C$ are those static setters declared by $C$.
 
-\LMHash{}
 It is a compile-time error if a setter's formal parameter list does not consist of exactly one required formal parameter $p$.  \rationale{We could enforce this via the grammar, but we'd have to specify the evaluation rules in that case.}
 
 %It is a compile-time error if a class has both a setter and a method with the same name. This restriction holds regardless of whether the setter is defined explicitly or implicitly, or whether the setter or the method are inherited or not.
 
-\LMHash{}
 It is a static warning if a setter declares a return type other than \VOID{}.
 It is a static warning if a setter $m_1$ overrides  (\ref{inheritanceAndOverriding}) a setter $m_2$ and the type of $m_1$ is not a subtype of the type of $m_2$. It is a static warning if a class has a setter named $v=$ with argument type $T$ and a getter named $v$ with return type $S$, and $T$ may not be assigned to $S$. 
 
-\LMHash{}
 It is a static warning if a class  declares a static setter named $v=$ and also has a non-static member named $v$. It is a static warning if a class $C$ declares an instance setter named $v=$ and an accessible static member named $v=$ or $v$ is declared in a superclass of $C$.
 
-\LMHash{}
 These warnings must be issued regardless of whether the getters or setters are declared explicitly or implicitly.
 
 \subsection{Abstract Instance Members}
-\LMLabel{abstractInstanceMembers}
+\label{abstractInstanceMembers}
 
-\LMHash{}
 An {\em abstract method} (respectively, {\em abstract getter} or {\em abstract setter)} is an instance method, getter or setter that is not declared \EXTERNAL{} and does not  provide an implementation. A {\em concrete method} (respectively, {\em concrete getter} or {\em concrete setter)} is an instance method, getter or setter that is not abstract.
 %The declaration of an abstract method is prefixed by the built-in identifier (\ref{identifierReference}) \ABSTRACT{}.
 
@@ -1103,7 +977,6 @@
 }
 %always results in a run-time error. This must be \code{NoSuchMethodError} or an instance of a subclass of \code{NoSuchMethodError}, such as \code{AbstractMethodError}.
 
-\LMHash{}
 It is a static warning if an abstract member is declared or inherited in a concrete class unless that member overrides a concrete one.
 
 \rationale {
@@ -1128,12 +1001,10 @@
 \rationale{At run time, the concrete method \cd{one} declared in \cd{Base} will be executed, and no problem should arise. Therefore no warning should be issued and so we suppress warnings if a corresponding concrete member exists in the hierarchy. }
 
 \subsection{Instance Variables}
-\LMLabel{instanceVariables}
+\label{instanceVariables}
 
-\LMHash{}
 Instance variables are variables whose declarations are immediately contained within a class declaration and that are not declared \STATIC{}. The instance variables of a class $C$ are those instance variables declared by $C$ and the instance variables inherited by $C$ from its superclass.
 
-\LMHash{}
 It is a compile-time error if an instance variable is declared to be constant.
 
 \rationale{
@@ -1177,12 +1048,10 @@
 
 
 \subsection{Constructors}
-\LMLabel{constructors}
+\label{constructors}
 
-\LMHash{}
 A {\em constructor} is a special function that is used in instance creation expressions (\ref{instanceCreation}) to produce objects. Constructors may be generative (\ref{generativeConstructors}) or they may be factories (\ref{factories}). 
 
-\LMHash{}
 A {\em constructor name} always begins with the name of its immediately enclosing class, and may optionally be followed by a dot and an identifier $id$. It is a compile-time error if $id$ is the name of a member  declared in the immediately enclosing class. It is a compile-time error if the name of a  constructor is not a constructor name. 
 
 
@@ -1190,13 +1059,11 @@
 
 % The enclosing scope of a generative constructor is the instance scope of the class in which it is declared (but what about redirecting?) 
 
-\LMHash{}
 Iff no constructor is specified for a class $C$, it implicitly has a default constructor \code{C() : \SUPER{}() \{\}}, unless $C$ is class \code{Object}.
 
 \subsubsection{Generative Constructors}
-\LMLabel{generativeConstructors}
+\label{generativeConstructors}
 
-\LMHash{}
 A {\em generative constructor} consists of a constructor name, a constructor parameter list, and either a redirect clause or an  initializer list and an optional body.
 
 \begin{grammar}
@@ -1205,16 +1072,12 @@
     .
  \end{grammar}
 
-\LMHash{}
 A {\em constructor parameter list} is a parenthesized, comma-separated list of formal constructor parameters. A {\em formal constructor parameter} is either a formal parameter (\ref{formalParameters}) or an initializing formal. An {\em initializing formal} has the form \code{\THIS{}.id}, where \code{id} is the name of an instance variable of the immediately enclosing class.  It is a compile-time error if \code{id} is not an instance variable of the immediately enclosing class. It is a compile-time error if an initializing formal is used by a function other than a non-redirecting generative constructor. 
 
-\LMHash{}
 If an explicit type is attached to the initializing formal, that is its static type. Otherwise, the type of an initializing formal named \code{id} is $T_{id}$, where $T_{id}$ is the type of the field named \code{id} in the immediately enclosing class. It is a static warning if the static type of \code{id} is not assignable to $T_{id}$.
 
-\LMHash{}
 Using an initializing formal \code{\THIS{}.id} in a formal parameter list does not introduce a formal parameter name into the scope of the constructor. However, the initializing formal does effect the type of the constructor function exactly as if a formal parameter  named \code{id}  of the same type were introduced in the same position.
 
-\LMHash{}
 Initializing formals are executed during the execution of generative constructors detailed below. Executing an initializing formal  \code{\THIS{}.id} causes the field \code{id} of the immediately surrounding class to be assigned the value of the corresponding actual parameter, unless $id$ is a final variable that has already been initialized, in which case a runtime error occurs.
 
 
@@ -1238,21 +1101,18 @@
 \}
 \end{dartCode}
 
-\LMHash{}
 A {\em fresh instance} is an instance whose identity  is distinct from any previously allocated instance of its class. A generative constructor always operates on a fresh instance of its immediately enclosing class. 
 
 \commentary{
 The above holds if the constructor is actually run, as it is by \NEW{}. If a constructor $c$ is referenced by \CONST{}, $c$ may not be run; instead, a canonical object may be looked up. See the section on instance creation (\ref{instanceCreation}).
 }
 
-\LMHash{}
 If a generative constructor $c$  is not a redirecting constructor and no body is provided, then $c$ implicitly has an empty body \code{\{\}}.
 
 
 \paragraph{Redirecting Constructors}
-\LMLabel{redirectingConstructors}
+\label{redirectingConstructors}
 
-\LMHash{}
 A generative constructor may be {\em redirecting}, in which case its only action is to invoke another generative constructor.  A redirecting constructor has no body; instead, it has a redirect clause that specifies which constructor the invocation is redirected to, and with what arguments.
 
 \begin{grammar}
@@ -1268,7 +1128,6 @@
 
 \paragraph{Initializer Lists}
 
-\LMHash{}
 An initializer list begins with a colon, and consists of a comma-separated list of individual {\em initializers}. There are two kinds of initializers.
 \begin{itemize}
 \item A {\em superinitializer} identifies a {\em superconstructor} - that is, a specific  constructor of the superclass.  Execution of the superinitializer causes the initializer list of the superconstructor to be executed.
@@ -1293,10 +1152,8 @@
 
 \end{grammar}
 
-\LMHash{}
 Let $k$ be a generative constructor.  Then $k$ may include at most one  superinitializer in its initializer list or a compile-time error occurs. If no superinitializer is provided, an implicit superinitializer of the form \SUPER{}() is added at the end of $k$'s initializer list, unless the enclosing class is class \code{Object}. It is a compile-time error if more than one initializer corresponding to a given instance variable appears in $k$'s initializer list. It is a compile-time error if $k$'s initializer list contains an initializer for a variable that is initialized by means of an initializing formal of $k$. % It is a compile-time error if  $k$'s initializer list contains an initializer for a final variable $f$ whose declaration includes an initialization expression.
  
-\LMHash{}
 Each final instance variable $f$ declared in the immediately enclosing class must have an initializer in $k$'s initializer list unless it has already been initialized by one of the following means:
  \begin{itemize}
  \item Initialization at the declaration of $f$.
@@ -1309,26 +1166,21 @@
 \commentary{The  initializer list may of course contain an initializer for any  instance variable declared by the immediately surrounding class, even if it is not final. 
 }
 
-\LMHash{}
  It is a compile-time error if a  generative constructor of class \code{Object} includes a superinitializer. 
 
-\LMHash{}
 Execution of a generative constructor $k$ is always done with respect to a set of bindings for its formal parameters and with  \THIS{} bound to a fresh instance $i$ and the type parameters of the immediately enclosing class bound to a set of actual type arguments $V_1, \ldots , V_m$. 
 
 \commentary{These bindings are usually determined by the instance creation expression that invoked the constructor (directly or indirectly). However, they may also be determined by a reflective call,.
 }
 
-\LMHash{}
 If $k$ is redirecting then its redirect clause has the form 
 
 \THIS{}$.g(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$ 
 
 where $g$ identifies another  generative constructor of the immediately surrounding class. Then execution of $k$ proceeds by evaluating the argument list $(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$, and then executing $g$ with respect to the bindings resulting from the evaluation of $(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$ and with  \THIS{} bound to $i$ and the type parameters of the immediately enclosing class bound to $V_1, \ldots , V_m$. 
 
-\LMHash{}
 Otherwise, execution  proceeds as follows:
 
-\LMHash{}
 %First, a fresh instance (\ref{generativeConstructors}) $i$ of the immediately enclosing class is allocated.  Next, the instance variable declarations of the immediately enclosing class are visited in the order they appear in the program text. For each such declaration $d$, if $d$ has the form  \code{$finalConstVarOrType$ $v$ = $e$; } then the instance variable $v$ of $i$ is bound to the value of $e$ (which is necessarily a compile-time constant).
 %Next, a
 Any initializing formals declared in $k$'s parameter list are executed in the order they appear in the program text.  
@@ -1338,23 +1190,18 @@
 
 \rationale {We could observe the order by side  effecting external routines called. So we need to specify the order.}
 
-\LMHash{}
 After all the initializers  have completed, the body of $k$ is executed  in a scope where \THIS{} is bound to $i$. Execution of the body begins with execution of the body of the superconstructor  with \THIS{} bound to $i$, the type parameters of the immediately enclosing class bound to a set of actual type arguments $V_1, \ldots , V_m$ and the formal parameters bindings determined by the argument list of the superinitializer of $k$.
 
 \rationale{
 This process ensures that no uninitialized final field is ever seen by code. Note that \THIS{} is not in scope on the right hand side of an initializer (see \ref{this}) so no instance method can execute during initialization: an instance method cannot be directly invoked, nor can  \THIS{} be passed into any other code being invoked in the initializer. 
 }
 
-\LMHash{}
 Execution of an initializer of the form \code{\THIS{}.$v$ = $e$} proceeds as follows:
 
-\LMHash{}
 First, the expression $e$ is evaluated to an object $o$. Then, the instance variable $v$ of the object denoted by \THIS{} is bound to $o$, unless $v$ is a final variable that has already been initialized, in which case a runtime error occurs. In checked mode, it is a dynamic type error if $o$ is not \NULL{} and the interface of the class of $o$ is not a subtype of the actual type of the field $v$.
 
-\LMHash{}
 An initializer of the form \code{$v$ = $e$} is equivalent to an initializer of the form  \code{\THIS{}.$v$ = $e$}. 
 
-\LMHash{}
 Execution of a superinitializer of the form 
 
 \SUPER{}$(a_1, \ldots, a_n,  x_{n+1}: a_{n+1}, \ldots, x_{n+k}: a_{n+k})$ 
@@ -1363,22 +1210,17 @@
 
 proceeds as follows:
 
-\LMHash{}
 First, the argument list $(a_1, \ldots, a_n, x_{n+1}: a_{n+1}, \ldots, x_{n+k}: a_{n+k})$ is evaluated.
 
-\LMHash{}
 Let $C$ be the class in which the superinitializer appears and let $S$ be the superclass of $C$.  If $S$ is generic (\ref{generics}), let $U_1, , \ldots, U_m$ be the actual type arguments passed to $S$ in the superclass clause of $C$.
 
-\LMHash{}
 Then, the initializer list of the constructor $S$ (respectively $S.id$) is executed with respect to the bindings that resulted from the evaluation of the argument list,  with \THIS{} bound to the current binding of \THIS{}, and  the type parameters (if any) of class $S$ bound to the current bindings of $U_1, , \ldots, U_m$.
 
-\LMHash{}
 It is a compile-time error if class $S$ does not declare a generative constructor named $S$ (respectively $S.id$).
 
 \subsubsection{Factories}
-\LMLabel{factories}
+\label{factories}
 
-\LMHash{}
 A {\em factory} is a constructor prefaced by the built-in identifier  (\ref{identifierReference})   \FACTORY{}. 
 
 \begin{grammar}
@@ -1390,13 +1232,10 @@
 
 %The enclosing scope of a factory constructor is the static scope \ref{} of the class in which it is declared.
 
-\LMHash{}
 The {\em return type} of a factory whose signature is of the form \FACTORY{} $M$ or the form \FACTORY{} $M.id$ is $M$ if $M$ is not a generic type; otherwise the return type is  $M <T_1, \ldots, T_n>$ where $T_1, \ldots, T_n$ are the type parameters of the enclosing class
 
-\LMHash{}
 It is a compile-time error if $M$ is not the name of the immediately enclosing class. 
 
-\LMHash{}
 In checked mode, it is a dynamic type error if a factory returns a non-null object whose type is not a subtype of its actual (\ref{actualTypeOfADeclaration}) return type.
 
 \rationale{It seems useless to allow a factory to return null. But it is more uniform to allow it, as the rules currently do.}
@@ -1407,9 +1246,8 @@
 }
 
 \paragraph{Redirecting Factory Constructors}
-\LMLabel{redirectingFactoryConstructors}
+\label{redirectingFactoryConstructors}
 
-\LMHash{}
 A {\em redirecting factory constructor} specifies a call to a constructor of another class that is to be used whenever the redirecting constructor is called.
 
 \begin{grammar}
@@ -1418,19 +1256,16 @@
     .
 \end{grammar}
 
-\LMHash{}
 Calling a redirecting factory constructor $k$ causes the constructor $k^\prime$ denoted by $type$ (respectively, $type.identifier$) to be called with the actual arguments passed to $k$, and returns the result of $k^\prime$ as the result of $k$.  The resulting constructor call is governed by the same rules as an instance creation expression using \NEW{} (\ref{instanceCreation}). 
 
 \commentary{
 It follows that if $type$ or $type.id$ are not defined, or do not refer to a class or constructor, a dynamic error occurs, as with any other undefined constructor call. The same holds if $k$ is called with fewer required parameters or more positional parameters than $k^\prime$ expects, or if $k$  is called with a named parameter that is not declared by $k^\prime$.
 }
 
-\LMHash{}
 It is a compile-time error if $k$ explicitly specifies a default value for an optional parameter.\commentary{
 Default values specified in $k$ would be ignored, since it is the {\em actual} parameters that are passed to $k^\prime$. Hence, default values are disallowed.
 }
 
-\LMHash{}
 It is a run-time error if a redirecting factory constructor redirects to itself, either directly or indirectly via a sequence of redirections. %does not redirect to a non-redirecting factory constructor or to a generative constructor in a finite number of steps.
 
 % Make this a runtime error so deferred loading works
@@ -1440,7 +1275,6 @@
 } 
 
 
-\LMHash{}
 It is a static warning if $type$ does not denote a class accessible in the current scope; if $type$ does denote such a class $C$ it is a static warning if the referenced constructor (be it $type$ or $type.id$) is not a constructor of $C$.
 
 \commentary{
@@ -1482,24 +1316,20 @@
 }
 %\end{dartCode}
 
-\LMHash{}
 It is a compile-time error if $k$ is prefixed with the \CONST{} modifier but $k^\prime$ is not a constant constructor (\ref{constantConstructors}).
 
-\LMHash{}
 It is a static warning if the function type of $k^\prime$ is not a subtype of the type of $k$.
 
 \commentary{
 This implies that the  resulting object conforms to the interface of the immediately enclosing class of $k$.
 }
 
-\LMHash{}
 It is a static type warning if any of the type arguments to $k^\prime$ are not subtypes of the bounds of the corresponding formal type parameters of $type$.
 
 
 \subsubsection{Constant Constructors}
-\LMLabel{constantConstructors}
+\label{constantConstructors}
 
-\LMHash{}
 A {\em constant constructor} may be used to create compile-time constant  (\ref{constants}) objects. A constant constructor is prefixed by the reserved word \CONST{}. 
 
 \begin{grammar}
@@ -1515,27 +1345,22 @@
 
 \commentary{All the work of a constant constructor must be handled via its initializers.}
 
-\LMHash{}
 It is a compile-time error if a constant constructor is declared by a class that has a non-final instance variable.  
 
 \commentary{
 The above refers to both locally declared and inherited instance variables.
 }
 
-\LMHash{}
 It is a compile-time error if a constant constructor is declared by a class $C$ if any instance variable declared in $C$ is initialized with an expression that is not a constant expression.
 
 \commentary {
 A superclass of $C$ cannot declare such an initializer either, because it must necessarily declare constant constructor as well (unless it is \code{Object}, which declares no instance variables).
 }
 
-\LMHash{}
 The superinitializer that appears, explicitly or implicitly, in the initializer list of a constant constructor must specify a constant constructor of the superclass of the immediately enclosing class or a compile-time error occurs.
 
-\LMHash{}
 Any expression that appears within the initializer list of a constant constructor must be a potentially constant expression, or a compile-time error occurs. 
 
-\LMHash{}
 A {\em potentially constant expression} is an expression $e$ that would be a valid constant expression if all formal parameters of $e$'s immediately enclosing constant constructor were treated as compile-time constants that were guaranteed to evaluate to an integer, boolean or string value as required by their immediately enclosing superexpression.
 
 \commentary{
@@ -1599,18 +1424,15 @@
 Careful readers will of course worry about cases where the actual arguments to \code{C()} are constants, but are not numeric. This is precluded by the following rule, combined with the rules for evaluating constant objects (\ref{const}).
 }
 
-\LMHash{}
 When invoked from a constant object expression, a constant constructor must throw an exception if any of its actual parameters is a value that would prevent one of the potentially constant expressions within it from being a valid compile-time constant.
 
 %Discuss External Constructors in ne subsubsection here
 
 \subsection{Static Methods}
-\LMLabel{staticMethods}
+\label{staticMethods}
 
-\LMHash{}
 {\em Static methods} are functions, other than getters or setters, whose declarations are immediately contained within a class declaration and that are declared \STATIC{}. The static methods of a class $C$ are those static methods declared by $C$.
 
-\LMHash{}
 The effect of a static method declaration in class $C$ is to add an instance method with the same name and signature to the \code{Type} object for class $C$ that forwards (\ref{functionDeclarations})  to the static method.
 
 \rationale{
@@ -1619,7 +1441,6 @@
 Of course, the entire notion of static methods is debatable, but it is retained here because so many programmers are familiar with it. Dart static methods may be seen as functions of the enclosing library. 
 }
 
-\LMHash{}
 It is a static warning if a class $C$ declares a static method named $n$ and has a setter named $n=$. 
 %It is a static warning if a class has a static method with the same name as a static member of one of its superclasses.
 
@@ -1632,9 +1453,8 @@
 
 
 \subsection{Static Variables}
-\LMLabel{staticVariables}
+\label{staticVariables}
 
-\LMHash{}
 {\em Static variables} are variables whose declarations are immediately contained within a class declaration and that are declared \STATIC{}. The static variables of a class $C$ are those static variables declared by $C$.
 
 %A static variable declaration  of one of the forms \code{\STATIC{} $T$ $v$;},  \code{\STATIC{} $T$ $v$ = $e$;} ,  \code{\STATIC{} \CONST{} $T$ $v$ = $e$;}  or \code{\STATIC{} \FINAL{} $T$ $v$ = $e$;} always induces an implicit static getter function (\ref{getters}) with signature 
@@ -1665,7 +1485,7 @@
 %Extrernal static functions, getters, setters
 
 %\subsubsection{Evaluation of Implicit Static Variable Getters}
-%\LMLabel{evaluationOfStaticVariableGetters}
+%\label{evaluationOfStaticVariableGetters}
 
 %Let $d$ be the declaration of a static variable $v$. The implicit getter method of $v$ executes as follows: 
 %\begin{itemize}
@@ -1678,16 +1498,14 @@
 
 
 \subsection{Superclasses}
-\LMLabel{superclasses}
+\label{superclasses}
 
-\LMHash{}
 The superclass of a class $C$ that has a with clause \code{\WITH{} $M_1, \ldots, M_k$} and an extends clause \code{\EXTENDS{} S} is the application of mixin (\ref{mixins}) $M_k* \cdots * M_1$  to S.  If no \WITH{} clause is specified then  the \EXTENDS{} clause of a class $C$ specifies its superclass. If no \EXTENDS{} clause is specified, then either:
 \begin{itemize}
 \item $C$ is \code{Object}, which has no superclass. OR
 \item Class $C$ is  deemed to have an \EXTENDS{} clause of the form \code{\EXTENDS{} Object}, and the rules above apply. 
 \end{itemize}
 
-\LMHash{}
 It is a compile-time error to specify an \EXTENDS{} clause for class \code{Object}.
 
 \begin{grammar}
@@ -1701,7 +1519,6 @@
 %This means that in a generic class, the type parameters of the generic are available in the superclass clause.
 %} 
 
-\LMHash{}
 %It is a compile-time error if  the \EXTENDS{} clause of a class $C$ includes a type expression that does not denote a class available in the lexical scope of $C$. 
 It is a compile-time error if  the \EXTENDS{} clause of a class $C$ specifies an enumerated type (\ref{enums}), a malformed  type or a deferred type (\ref{staticTypes}) as a superclass.
 % too strict? Do we e want extends List<Undeclared> to work as List<dynamic>? 
@@ -1718,26 +1535,23 @@
 \end{dartCode}
 
 
-\LMHash{}
 A class $S$ is {\em a superclass} of a class $C$ iff either:
 \begin{itemize}
 \item $S$ is the superclass of $C$, or 
 \item $S$ is a superclass of a class $S^{\prime}$ and $S^{\prime}$ is a superclass of $C$. 
 \end{itemize}
 
-\LMHash{}
 It is a compile-time error if a class $C$ is a superclass of itself.
 
 
     
  
  \subsubsection{Inheritance and Overriding}
- \LMLabel{inheritanceAndOverriding}
+ \label{inheritanceAndOverriding}
 
 
 %A class $C$  {\em inherits} any accessible instance members of its superclass that are not overridden by members declared in $C$. 
 
-\LMHash{}
 Let $C$ be a class,  let $A$ be a superclass of $C$, and let  $S_1 \ldots S_k$ be superclasses of $C$ that are also subclasses of $A$. $C$ {\em inherits} all accessible instance  members of  $A$ that have not been overridden by a declaration in $C$ or in at least one of $S_1 \ldots S_k$.
 
 \rationale {
@@ -1746,10 +1560,8 @@
 the superclass chain of $S$ includes a class declared in $L_1$.
 }
 
-\LMHash{}
 A class may override instance members that would otherwise have been inherited from its superclass. 
 
-\LMHash{}
 Let $C = S_0$ be a class declared in library $L$, and let $\{S_1 \ldots S_k\}$ be the set of all superclasses of $C$, where $S_i$ is the superclass of $S_{i-1}$ for $i \in 1 .. k$. Let $C$ declare a member $m$, and let  $m^\prime$ be a member of $S_j, j  \in 1 .. k$,  that has the same name as $m$, such that $m^\prime$ is accessible to $L$.  Then $m$ overrides $m^\prime$ if $m^\prime$ is not already overridden by a member of at least one of $S_1 \ldots S_{j-1}$ and neither $m$ nor $m^\prime$ are fields.
 
 %Let $C$ be a class declared in library $L$, with superclass $S$ and let $C$ declare an instance member $m$, and  assume $S$ declares an instance member $m^\prime$ with the same name as $m$. Then $m$ {\em overrides} $m^\prime$ iff $m^\prime$ is accessible (\ref{privacy}) to $L$, $m$ has the same name as  $m^\prime$  and neither $m$ nor $m^\prime$ are fields.
@@ -1759,7 +1571,6 @@
 \rationale{Again, a local definition of overriding would be preferable, but fails to account for library privacy.
 }
 
-\LMHash{}
 Whether an override is legal or not is described elsewhere in this specification (see \ref{instanceMethods}, \ref{getters} and \ref{setters}). 
 
 \commentary{For example getters may not legally override methods and vice versa. Setters never override methods or getters, and vice versa, because their names always differ.
@@ -1773,7 +1584,6 @@
 Note that instance variables do not participate in the override relation, but the getters and setters they induce do. Also, getters don't override setters and vice versa.  Finally, static members never override anything.
 }
 
-\LMHash{}
 It is a static warning if a non-abstract class inherits an abstract method.
 
 \commentary {
@@ -1821,10 +1631,9 @@
 %Can we have abstract getters and setters?
 
 \subsection{ Superinterfaces}
-\LMLabel{superinterfaces}
+\label{superinterfaces}
 % what about rules about classes that fail to implement their interfaces?
 
-\LMHash{}
 A class has a set of direct superinterfaces. This set includes the interface of its superclass and the interfaces specified in the the \IMPLEMENTS{}  clause of the class.
 % and any superinterfaces specified by interface injection (\ref{interfaceInjection}).  \Q{The latter needs to be worded carefully - when do interface injection clauses execute and in what scope?}
 
@@ -1834,7 +1643,6 @@
     .
 \end{grammar}
 
-\LMHash{}
 It is a compile-time error if  the \IMPLEMENTS{}  clause of a class $C$ specifies a type variable as a superinterface. It is a compile-time error if  the  \IMPLEMENTS{} clause of a class $C$ specifies an enumerated type (\ref{enums}),  a malformed type or deferred type (\ref{staticTypes}) as a superinterface  It is a compile-time error if the \IMPLEMENTS{} clause of a class $C$ specifies type \DYNAMIC{} as a superinterface. It is a compile-time error if  the  \IMPLEMENTS{} clause of a class $C$ specifies  a type $T$ as a superinterface more than once.
 It is a compile-time error if the superclass of a class $C$ is specified as a superinterface of $C$.
 
@@ -1842,10 +1650,8 @@
 One might argue that it is harmless to repeat a type in the superinterface list, so why make it an error? The issue is not so much that the situation described in program source is erroneous, but that it is pointless. As such, it is an indication that the programmer may very well have meant to say something else - and that is a mistake that should be called to her or his attention.  Nevertheless, we could simply issue a warning; and perhaps we should and will. That said, problems like these are local and easily corrected on the spot, so we feel justified in taking a harder line. 
 }
 
-\LMHash{}
 It is a compile-time error if the interface of a class $C$ is a superinterface of itself.
 
-\LMHash{}
 Let $C$ be a concrete class that does not declare its own \code{noSuchMethod()} method.
 It is a static warning if the implicit interface of  $C$ includes an instance member $m$ of type $F$ and $C$ does not declare or inherit a corresponding non-abstract instance member $m$ of type $F'$ such that $F' <: F$. 
 
@@ -1864,7 +1670,6 @@
 noSuchMethod(inv) =$>$ \SUPER.noSuchMethod(inv);
 \end{dartCode}
 
-\LMHash{}
 It is a static warning if the implicit interface of  a class $C$ includes an instance member $m$ of type $F$ and $C$ declares or inherits a corresponding instance member $m$ of type $F'$ if  $F'$ is not a subtype of $F$. 
 
 \rationale{
@@ -1899,27 +1704,23 @@
 
 
 \section{Interfaces}
-\LMLabel{interfaces}
+\label{interfaces}
 
-\LMHash{}
 An {\em interface} defines how one may interact with an object. An interface has methods, getters and setters and a set of superinterfaces.
 
 \subsection{Superinterfaces}
-\LMLabel{interfaceSuperinterfaces}
+\label{interfaceSuperinterfaces}
 
-\LMHash{}
 An interface has a set of direct superinterfaces. 
 
-\LMHash{}
 An interface $J$ is a superinterface of an interface $I$ iff either $J$ is a direct superinterface of $I$ or $J$ is a superinterface of a direct superinterface of $I$.
 
 
 
 
 \subsubsection{Inheritance and Overriding}
-\LMLabel{interfaceInheritanceAndOverriding}
+\label{interfaceInheritanceAndOverriding}
 
-\LMHash{}
 Let $J$ be an interface and $K$ be a library. We define $inherited(J, K)$  to be the set of members $m$ such that   all of the following hold:
 \begin{itemize}
 \item $m$ is accessible to $K$ and 
@@ -1931,7 +1732,6 @@
 \item $m$ is not overridden by $J$.
 \end{itemize}
 
-\LMHash{}
 Furthermore, we define $overrides(J, K)$  to be the set of members $m^\prime$ such that  all of the following hold:
 \begin{itemize}
 \item $J$ is the implicit interface of a class $C$.
@@ -1946,13 +1746,10 @@
 \end{itemize}
 
 
-\LMHash{}
 Let $I$ be the implicit interface of a class $C$ declared in library $L$.  $I$ {\em inherits} all members of $inherited(I, L)$ and $I$ {\em overrides} $m^\prime$ if  $m^\prime \in overrides(I, L)$. 
 
-\LMHash{}
 All the static warnings pertaining to the overriding of instance members given in section \ref{classes} above hold for overriding between interfaces as well.
 
-\LMHash{}
 It is a static warning if $m$ is a method and $m^\prime$ is a getter, or if $m$ is a getter and $m^\prime$ is a method.
 
 
@@ -1963,13 +1760,10 @@
 
 % tighten definition? do we need chain as for classes?  Definition for interface override?
 
-\LMHash{}
 However, if the above rules would cause multiple members $m_1, \ldots,  m_k$ with the same name $n$ to be inherited (because identically named members existed in several superinterfaces) then at most one member is inherited. 
 
-\LMHash{}
 If some but not all of the $m_i, 1 \le i \le k$ are getters none of the $m_i$ are inherited, and a static warning is issued.
 
-\LMHash{}
 Otherwise, if the static types $T_1, \ldots,  T_k$ of the members $m_1, \ldots,  m_k$  are not identical, then there must be a member $m_x$ such that $T_x <: T_i, 1 \le x \le k$ for all  $i  \in 1..k$, or a static type warning occurs. The member that is inherited  is $m_x$, if it exists; otherwise:
  let $numberOfPositionals(f)$ denote the number of positional parameters of a function $f$, and let $numberOfRequiredParams(f)$ denote the number of required parameters of a function $f$. Furthermore, let $s$ denote the set of all named parameters of the $m_1, \ldots,  m_k$.  Then let 
 
@@ -1977,7 +1771,6 @@
 
 $r = min(numberOfRequiredParams(m_i)), i \in 1..k$. 
 
-\LMHash{}
 Then $I$ has a method named $n$, with $r$ required parameters of type \DYNAMIC{}, $h$  positional parameters of type \DYNAMIC{}, named parameters $s$ of type  \DYNAMIC{} and  return type  \DYNAMIC{}.  
 
 
@@ -1994,13 +1787,11 @@
 % Need warnings if overrider conflicts with overriddee either because signatures are incompatible or because done is a method and one is a getter or setter.
 
 \section{Mixins}
-\LMLabel{mixins} 
+\label{mixins} 
 
 
-\LMHash{}
 A mixin describes the difference between a class and its superclass. A mixin is always derived from an existing class declaration. 
 
-\LMHash{}
 It is a compile-time error if a declared or derived mixin refers to \SUPER{}. It is a compile-time error if a declared or derived mixin explicitly declares a constructor. It is a compile-time error if a mixin is derived from a class whose superclass is not \code{Object}.
 
 \rationale{
@@ -2016,9 +1807,8 @@
 }
 
 \subsection{Mixin Application}
-\LMLabel{mixinApplication}
+\label{mixinApplication}
 
-\LMHash{}
 A mixin may be applied to a superclass, yielding a new class. Mixin application occurs when a mixin is mixed into a class declaration via its \WITH{} clause.  The mixin application may be used to extend a class per section (\ref{classes}); alternately, a class may be defined as a mixin application as described in this section.   It is a compile-time error if the \WITH{} clause of a mixin application $C$ includes a deferred type expression.
 
 
@@ -2031,28 +1821,23 @@
     .
 \end{grammar}
 
-\LMHash{}
 A  mixin application of the form  \code{$S$ \WITH{} $M$;} defines a class  $C$ with superclass  $S$. 
 
-\LMHash{}
 A  mixin application of the form  \code{$S$ \WITH{} $M_1, \ldots, M_k$;} defines a class  $C$ whose superclass is the application of the mixin composition (\ref{mixinComposition}) $M_{k-1} * \ldots * M_1$ to $S$. 
 
-\LMHash{}
 In both cases above, $C$ declares the same instance members as $M$ (respectively, $M_k$). If any of the instance fields of $M$ (respectively, $M_k$) have initializers, they are executed in the scope of $M$ (respectively, $M_k$) to initialize the corresponding fields of $C$. 
 
-\LMHash{}
 For each generative constructor named $q_i(T_{i1}$ $ a_{i1}, \ldots , T_{ik_i}$ $ a_{ik_i}), i \in 1..n$ of $S$, $C$ has an implicitly declared constructor named
 $q'_i = [C/S]q_i$ of the form 
 
 $q'_i(a_{i1}, \ldots , a_{ik_i}):\SUPER(a_{i1}, \ldots , a_{ik_i});$.
 
-\LMHash{}
+%super.id
+
 If the mixin application declares support for interfaces, the resulting class implements those interfaces.
 
-\LMHash{}
 It is a compile-time error if $S$ is an enumerated type (\ref{enums}) or a malformed type. It is a compile-time error if $M$ (respectively, any of $M_1, \ldots, M_k$) is an enumerated type (\ref{enums}) or a malformed type. It is a compile time error if a well formed mixin cannot be derived from $M$ (respectively, from each of $M_1, \ldots, M_k$). 
 
-\LMHash{}
 Let $K$ be a class declaration  with the same constructors, superclass and interfaces as $C$,  and the instance members declared by $M$ (respectively $M_1, \ldots, M_k$). It is a static warning if the declaration of $K$ would cause a static warning.  It is a compile-time error if the declaration of $K$ would cause a compile-time error.
 
 \commentary{
@@ -2060,19 +1845,17 @@
 
 }
 
-\LMHash{}
 The effect of a class definition of the form \code{\CLASS{} $C$ = $M$; } or the form 
  \code{\CLASS{} $C<T_1, \ldots, T_n>$ = $M$; } in library $L$  is to introduce the name $C$ into the scope of $L$, bound to the class (\ref{classes}) defined by the mixin application $M$. The name of the class is also set to $C$. Iff the  class is prefixed by the built-in identifier \ABSTRACT{}, the class being defined is an abstract class.
  
 
 \subsection{Mixin Composition}
-\LMLabel{mixinComposition}
+\label{mixinComposition}
 
 \rationale{
 Dart does not directly support mixin composition, but the concept is useful when defining how the superclass of a class with a mixin clause is created.
 }
 
-\LMHash{}
 The {\em composition of two mixins}, $M_1<T_1 \ldots T_{k_{M_1}}>$ and $M_2<U_1  \ldots U_{k_{M_2}}>$, written $M_1<T_1 \ldots T_{k_{M_1}}> * M_2<U_1  \ldots U_{k_{M_2}}>$ defines an anonymous mixin such that for any class $S<V_1 \ldots V_{k_S}>$, the application of 
 
 $M_1<T_1 \ldots T_{k_{M_1}}> * M_2<U_1  \ldots U_{k_{M_2}}>$  
@@ -2097,7 +1880,6 @@
 The classes produced by mixin composition are regarded as abstract because they cannot be instantiated independently. They are only introduced as anonymous superclasses of ordinary class declarations and mixin applications. Consequently, no warning is given if a mixin composition includes abstract members, or incompletely implements an interface.
 }
 
-\LMHash{}
 Mixin composition is associative.
 
 
@@ -2107,9 +1889,8 @@
 
 
 \section{Enums}
-\LMLabel{enums}
+\label{enums}
 
-\LMHash{}
 An {\em enumerated type}, or {\em enum}, is used to represent a fixed number of constant values.
 
 \begin{grammar}
@@ -2118,7 +1899,6 @@
     .
 \end{grammar}
 
-\LMHash{}
 The declaration of an enum of the form \code{metadata \ENUM{} E \{ id$_0$, \ldots id$_{n-1}$\};}
 has the same effect as a class declaration
 
@@ -2139,9 +1919,8 @@
 }
 
 \section{Generics}
-\LMLabel{generics}
+\label{generics}
 
-\LMHash{}
 A class declaration (\ref{classes}) or type alias (\ref{typedef}) 
 $G$ may be {\em generic}, that is, $G$ may have formal type parameters declared. A generic declaration induces a family of declarations, one for each set of actual type parameters provided in the program. 
 
@@ -2154,10 +1933,8 @@
     .
 \end{grammar}
 
-\LMHash{}
 A type parameter $T$ may be suffixed with an \EXTENDS{} clause that specifies the {\em upper bound} for $T$. If no  \EXTENDS{} clause is present, the upper bound is \code{Object}.  It is a static type warning if a type parameter is a supertype of its upper bound. The bounds of type variables are a form of type annotation and have no effect on execution in production mode.
 
-\LMHash{}
 The type parameters of a generic $G$ are in scope in the bounds of all of the type parameters of $G$. The type parameters of a generic class declaration $G$ are also in scope in the \EXTENDS{} and \IMPLEMENTS{} clauses of $G$ (if these exist) and in the body of $G$.   However, a type parameter is considered to be a malformed type when referenced by a static member.
 
 \rationale{
@@ -2233,7 +2010,7 @@
 
 
 %\subsection{Interface Injection}
-%\LMLabel{interfaceInjection}
+%\label{interfaceInjection}
 
 %An {\em interface injection declaration} causes a pre-existing class $S$ to be considered a subinterface of another interface $I$. It is a static type warning if $S$ is not a structural subtype of $I$. However, the subinterface relations implied by the interface injection declaration are considered to hold by both the typechecker and the runtime, regardless.
 
@@ -2263,9 +2040,8 @@
 
 
 \section{Metadata}
-\LMLabel{metadata}
+\label{metadata}
 
-\LMHash{}
 Dart supports metadata which is used to attach user defined annotations to program structures.  
 
 \begin{grammar}
@@ -2274,14 +2050,12 @@
     .
 \end{grammar}
 
-\LMHash{}
 Metadata consists of a series of annotations, each of which begin with the character @, followed by  a constant expression that starts with an identifier. It is a compile time error if the expression is not one of the following:
 \begin{itemize}
 \item A reference to a compile-time constant variable.
 \item A call to a constant constructor.
 \end{itemize}
 
-\LMHash{}
 Metadata is associated with the abstract syntax tree of the program construct $p$ that immediately follows the metadata, assuming $p$ is not itself metadata or a comment. Metadata can be retrieved at runtime via a reflective call, provided the annotated program construct $p$ is accessible via reflection.
 
 \commentary{
@@ -2296,17 +2070,14 @@
 It is possible to associate metadata with constructs that may not be accessible via reflection, such as local variables (though it is conceivable that in the future, richer reflective libraries might provide access to these as well).  This is not as useless as it might seem. As noted above, the data can be retrieved statically if source code is available.
 }
 
-\LMHash{}
 Metadata can appear before a library, part header, class, typedef, type parameter, constructor, factory, function, field, parameter, or variable declaration and before an import, export or part directive.
 
-\LMHash{}
 The constant expression given in an annotation  is type checked and evaluated in the scope surrounding the declaration being annotated.  
 
 
 \section{Expressions}
-\LMLabel{expressions}
+\label{expressions}
 
-\LMHash{}
 An {\em expression} is a fragment of Dart code that can be evaluated at run time to yield a {\em value}, which is always an object. Every expression has an associated static type (\ref{staticTypes}). Every value has an associated dynamic type (\ref{dynamicTypeSystem}).
 
 
@@ -2341,7 +2112,6 @@
     
 \end{grammar}   
 
-\LMHash{}
 An expression $e$ may always be enclosed in parentheses, but this never has any semantic effect on $e$.
 
 \commentary{
@@ -2349,9 +2119,8 @@
 }
 
  \subsubsection{Object Identity}
- \LMLabel{objectIdentity}
+ \label{objectIdentity}
  
-\LMHash{}
 The predefined Dart function \cd{identical()} is defined such that \code{identical($c_1$, $c_2$)} iff:
  \begin{itemize}
  \item $c_1$  evaluates to either \NULL{} or  an instance of \code{bool} and \code{$c_1$ == $c_2$}, OR
@@ -2385,12 +2154,10 @@
     
     
 \subsection{Constants}
-\LMLabel{constants}
+\label{constants}
 
-\LMHash{}
 A {\em constant expression} is an expression whose value can never change, and that can be evaluated entirely at compile time. 
 
-\LMHash{}
 A constant expression is one of the following:
 \begin{itemize}
 \item A literal number (\ref{numbers}).
@@ -2403,8 +2170,8 @@
 \commentary {For example, If class C declares a constant static variable v, C.v is a constant. The same is true if C is accessed via a prefix p; p.C.v is a constant  unless p is a deferred prefix.
 }
 \item An identifier expression that denotes a constant variable. 
-\item A qualified reference to a static constant variable (\ref{variables}) that is not qualified by a deferred prefix. 
-\commentary {For example, If class C declares a constant static variable v, C.v is a constant. The same is true if C is accessed via a prefix p; p.C.v is a constant  unless p is a deferred prefix.
+\item A simple or qualified identifier denoting a class or type alias that is not qualified by a deferred prefix. 
+\commentary {For example, If C is a class or typedef, C is a constant, and if C is imported with a prefix p, p.C is a constant unless p is a deferred prefix.
 }
 \item A constant constructor invocation (\ref{const}) that is not qualified by a deferred prefix.  
 \item A constant list literal (\ref{lists}).
@@ -2425,7 +2192,6 @@
 
 % designed so constants do not depend on check diode being on or not.
 
-\LMHash{}
 It is a compile-time error if an expression is required to be a constant expression but its evaluation  would raise an exception. 
 
 % so, checked mode? analyzers? editor/development compilers?
@@ -2468,7 +2234,6 @@
 \end{enumerate}
 }
 
-\LMHash{}
 It is a compile-time error if the value of a compile-time constant expression depends on itself.
 
 \commentary{
@@ -2498,9 +2263,8 @@
 
 
 \subsection{Null}
-\LMLabel{null}
+\label{null}
 
-\LMHash{}
 The reserved word \NULL{} denotes the {\em null object}.
 %\Q{Any methods, such as \code{isNull}?}
 
@@ -2510,11 +2274,9 @@
 .
 \end{grammar}
 
-\LMHash{}
 The null object is the sole instance of the built-in class \code{Null}. Attempting to instantiate \code{Null} causes a run-time error. It is a compile-time error for a class to attempt to extend or implement \code{Null}. 
 Invoking a method on \NULL{}  yields a \code{NoSuchMethodError} unless the method is explicitly implemented by class \code{Null}.
 
-\LMHash{}
 The static type of \NULL{} is $\bot$.
 
 \rationale{The decision to use $\bot$ instead of \code{Null} allows \NULL{} to be be assigned everywhere without complaint by the static checker. 
@@ -2522,9 +2284,8 @@
 
 
 \subsection{Numbers}
-\LMLabel{numbers}
+\label{numbers}
 
-\LMHash{}
 A {\em numeric literal} is either a decimal or hexadecimal integer of arbitrary size, or a decimal double.
 
 \begin{grammar}
@@ -2550,30 +2311,24 @@
     .
  \end{grammar}
  
-\LMHash{}
 If a numeric literal begins with the prefix `0x' or `0X', it denotes the hexadecimal integer represented by the part of the literal following `0x' (respectively `0X'). Otherwise, if the numeric literal does not include a decimal point  it denotes a decimal integer.  Otherwise, the numeric literal  denotes a 64 bit double precision floating point number as specified by the IEEE 754 standard. 
 
-\LMHash{}
 In principle, the range of integers supported by a Dart implementations is unlimited. In practice, it is limited by available memory. Implementations may also be limited by other considerations.
 
 \commentary{
 For example, implementations may choose to limit the range to facilitate efficient compilation to Javascript. These limitations should be relaxed as soon as technologically feasible.
 }
 
-\LMHash{}
 It is a compile-time error for a class to attempt to extend or implement \code{int}. It is a compile-time error for a class to attempt to extend or implement \code{double}. It is a compile-time error for any type other than the types \code{int} and \code{double} to attempt to extend or implement \code{num}.
 
-\LMHash{}
 An {\em integer literal} is either a hexadecimal integer literal or a  decimal integer literal. Invoking the getter \code{runtimeType} on an integer literal returns the \code{Type} object that is the value of the expression \code{int}. The static type of an integer literal is \code{int}. 
 
-\LMHash{}
 A {\em literal double} is a numeric literal that is not an integer literal. Invoking the getter \code{runtimeType} on a literal double returns the \code{Type} object that is the value of the expression \code{double}.
 The static type of a literal double is \code{double}.
     
 \subsection{Booleans}
-\LMLabel{booleans}
+\label{booleans}
 
-\LMHash{}
 The reserved words \TRUE{} and \FALSE{} denote objects that represent the boolean values true and false respectively. They are the {\em boolean literals}.
 
 \begin{grammar}
@@ -2582,20 +2337,17 @@
     .
 \end{grammar}
 
-\LMHash{}
 Both  \TRUE{} and \FALSE{} implement the built-in class \code{bool}.  It is a compile-time error for a class to attempt to extend or implement\code{ bool}. 
 
 \commentary{
 It follows that the two boolean literals are the only two instances of \code{bool}. 
 }
 
-\LMHash{}
 Invoking the getter \code{runtimeType} on a boolean literal returns the \code{Type} object that is the value of the expression \code{bool}. The static type of a boolean literal is \code{bool}.
 
 \subsubsection{Boolean Conversion}
-\LMLabel{booleanConversion}
+\label{booleanConversion}
 
-\LMHash{}
 {\em Boolean conversion} maps any object $o$ into a boolean. Boolean conversion is  defined by the function application
 
 \begin{dartCode}
@@ -2618,9 +2370,8 @@
  }
     
 \subsection{Strings}
-\LMLabel{strings}
+\label{strings}
 
-\LMHash{}
 A {\em string} is a sequence of UTF-16 code units. 
 
 \rationale{
@@ -2632,7 +2383,6 @@
     .
 \end{grammar}
 
-\LMHash{}
 A string can be either a sequence of single line strings or a multiline string. 
 
 \begin{grammar}
@@ -2643,7 +2393,6 @@
     .
 \end{grammar}
 
-\LMHash{}
 A single line string is delimited by either matching single quotes or matching double quotes.  
 
 \commentary{
@@ -2653,7 +2402,6 @@
 \commentary{The grammar ensures that a single line string cannot span more than one line of source code, unless it includes an interpolated expression that spans multiple lines.
 }
 
-\LMHash{}
 Adjacent 
 %single line 
 strings are implicitly concatenated to form a single string literal.
@@ -2726,7 +2474,6 @@
    
 \end{grammar}
 
-\LMHash{}
 Multiline strings are delimited by either matching triples of single quotes or matching triples of double quotes. If the first line of a multiline string consists solely of the whitespace characters defined by the production {\em WHITESPACE}  \ref{lexicalRules}), possibly prefixed by $\backslash$, then that line is ignored, including the new line at its end.
 
  
@@ -2734,7 +2481,6 @@
  The idea is to ignore whitespace, where whitespace is defined as tabs, spaces and newlines. These can be represented directly, but since for most characters prefixing by backslash is an identity, we allow those forms as well.
  }
 
-\LMHash{}
 Strings support escape sequences for special characters. The escapes are:
 \begin{itemize}
 \item  $\backslash$n for newline, equivalent to $\backslash$x0A.
@@ -2752,10 +2498,8 @@
 \item Otherwise, $\backslash k$ indicates the character $k$ for any $k$ not in $\{n, r, f, b, t, v, x, u\}$.
  \end{itemize}
 
-\LMHash{}
 Any string may be prefixed with the character `r', indicating that it is a {\em raw string}, in which case no escapes or interpolations are recognized.
 
-\LMHash{}
 It is a compile-time error if a non-raw string literal contains a character sequence of the form $\backslash$x that is not followed by a sequence of two hexadecimal digits. It is a compile-time error if a non-raw string literal  contains a character sequence of the form $\backslash$u that is not followed by either a sequence of four hexadecimal digits, or by curly brace delimited sequence of hexadecimal digits.
 
 
@@ -2786,13 +2530,11 @@
 
  \end{grammar}
  
-\LMHash{}
 All string literals implement the built-in class \code{String}. It is a compile-time error for a class to attempt to extend or implement \code{String}. Invoking the getter \code{runtimeType} on a string literal returns the \code{Type} object that is the value of the expression \code{String}. The static type of a string literal is \code{String}.
 
 \subsubsection{String Interpolation}
-\LMLabel{stringInterpolation}
+\label{stringInterpolation}
 
-\LMHash{}
 It is possible to embed expressions within non-raw string literals, such that the these expressions are evaluated, and the resulting values are converted into strings and concatenated with the enclosing string. This process is known as {\em string interpolation}.
 
  \begin{grammar}
@@ -2804,20 +2546,17 @@
 \commentary{The reader will note that the expression inside the interpolation could itself include strings, which could again be interpolated recursively. 
 }
 
-\LMHash{}
 An unescaped \$ character in a string signifies the beginning of an interpolated expression.  The \$ sign may be followed by either:
 \begin{itemize}
 \item A single identifier $id$ that must not contain the \$ character. 
 \item An expression $e$ delimited by curly braces.
 \end{itemize}
 
-\LMHash{}
 The form \code{\$id} is equivalent to the form \code{\$\{id\}}.  An interpolated string \code{`$s_1$\$\{$e$\}$s_2$'}  is equivalent to the concatenation of the  strings \code{`$s_1$'},  \code{$e$.toString()} and  \code{$`s_2$'}. Likewise an interpolated string \code{``$s_1$\$\{e\}$s_2$''} is equivalent to the concatenation of the strings \code{``$s_1$''}, \code{$e$.toString()} and  \code{``$s_2$''}.
 
 \subsection{Symbols}
-\LMLabel{symbols}
+\label{symbols}
 
-\LMHash{}
 A {\em symbol literal} denotes the name of a declaration in a Dart program. 
 
 \begin{grammar}
@@ -2825,25 +2564,21 @@
       `\#'  (operator $|$ (identifier (`{\escapegrammar .}' identifier)*))  .
 \end{grammar}
 
-\LMHash{}
 A symbol literal \code{\#id} where \code{id} does not begin with an underscore ('\code{\_}')  is equivalent to the expression \code{\CONST{} Symbol('id')}.  
 
-\LMHash{}
-A symbol literal \code{\#\_id} evaluates to the object that would be returned by the call \code{mirror.getPrivateSymbol('id')} where mirror is an instance of the class \code{LibraryMirror} defined in the library \code{dart:mirrors}, reflecting the current library.
+A symbol literal \code{\#\_id} evaluates to the object that would be returned by the call \code{mirror.getPrivateSymbol('id')} where mirror is an instance of the class \code{LibraryMirror} defined in the library \code{dart:mirrors}, reflecting the current library. 
 
 \rationale{
 One may well ask what is the motivation for introducing literal symbols? In some languages, symbols are canonicalized whereas strings are not. However literal strings are already canonicalized in Dart.  Symbols are slightly easier to type compared to strings and their use can become strangely addictive, but this is not nearly sufficient justification for adding a literal form to the language. The primary motivation is related to the use of reflection and a web specific practice known as minification. 
 
-Minification compresses identifiers consistently throughout a program in order to reduce download size.  This practice poses difficulties for reflective programs that refer to program declarations via strings. A string will refer to an identifier in the source, but the identifier will no longer be used in the minified code, and reflective code using these truing would fail.  Therefore, Dart reflection uses  objects of type \code{Symbol} rather than strings. Instances of \code{Symbol} are guaranteed to be stable with repeat to minification. Providing a literal form for symbols makes reflective code easier to read and write. The fact that symbols are easy to type and can often act as convenient substitutes for enums are secondary benefits.
+Minification compresses identifiers consistently throughout a program in order to reduce download size.  This practice poses difficulties for reflective programs that refer to program declarations via strings. A string will refer to an identifier in the source, but the identifier will no longer be used in the minified code, and reflective code using these would fail.  Therefore, Dart reflection uses  objects of type \code{Symbol} rather than strings. Instances of \code{Symbol} are guaranteed to be stable with repeat to minification. Providing a literal form for symbols makes reflective code easier to read and write. The fact that symbols are easy to type and can often act as convenient substitutes for enums are secondary benefits.
 }
 
-\LMHash{}
 The static type of a symbol literal is \code{Symbol}.
 
 \subsection{Lists}
-\LMLabel{lists}
+\label{lists}
 
-\LMHash{}
 A {\em list literal} denotes a list, which is an integer indexed collection of objects. 
 
 \begin{grammar}
@@ -2852,33 +2587,28 @@
     .
 \end{grammar}
 
-\LMHash{}
 A list may contain zero or more objects. The number of elements in a list is its size. A list has an associated set of indices.  An empty list has an empty set of indices. A non-empty list has the index set $\{0 \ldots n -1\}$ where $n$ is the size of the list. It is a runtime error to attempt to access a list using an index that is not a member of its set of indices.
 
 
-\LMHash{}
 If a list literal begins with the reserved word \CONST{}, it is a {\em constant list literal} which is a compile-time constant (\ref{constants}) and therefore evaluated at compile-time. Otherwise, it is a {\em run-time list literal} and it is evaluated at run-time. Only run-time list literals can be mutated
 after they are created. Attempting to mutate a constant list literal will result in a dynamic error.
 
-\LMHash{}
 It is a compile-time error if an element of a constant list literal is not a compile-time constant. It is a compile-time error if the type argument of a constant list literal includes a type parameter.
 \rationale{The binding of a type parameter is not known at compile-time, so we cannot use type parameters inside compile-time constants.}
 
-\LMHash{}
 The value of a constant list literal  \CONST{} $<E>[e_1\ldots e_n]$ is an object $a$ whose class implements the built-in class $List<E>$. The $i$th element of $a$ is $v_{i+1}$, where $v_i$ is the value of the compile-time expression $e_i$.  The value of a constant list literal  \CONST{} $[e_1 \ldots e_n]$ is defined as the value of the constant list literal \CONST{}$ < \DYNAMIC{}>[e_1\ldots e_n]$.
 
-\LMHash{}
 Let $list_1 =$ \CONST{} $<V>[e_{11} \ldots e_{1n}]$ and $list_2 =$  \CONST{} $<U>[e_{21} \ldots e_{2n}]$ be two constant list literals and let the  elements of $list_1$ and $list_2$  evaluate to  $o_{11} \ldots o_{1n}$ and $o_{21} \ldots o_{2n}$ respectively. Iff \code{identical($o_{1i}$, $o_{2i}$)} for $i \in 1.. n$ and $V = U$ then \code{identical($list_1$, $list_2$)}. 
 
 \commentary{In other words, constant list literals are canonicalized.}
 
-\LMHash{}
 A run-time list literal $<E>[e_1 \ldots e_n]$  is evaluated as follows:
 \begin{itemize}
 \item
 First, the expressions $e_1 \ldots e_n$ are evaluated in order they appear in the program, yielding objects $o_1 \ldots o_n$.
 \item A fresh instance  (\ref{generativeConstructors}) $a$, of size $n$,  whose class implements the built-in class $List<E>$ is allocated. 
 \item
+
 The operator \code{[]=} is invoked on $a$ with  first  argument $i$ and second argument
 %The $i$th element of $a$ is set to 
 $o_{i+1}, 0 \le i < n$.
@@ -2891,7 +2621,6 @@
 Note that this document does not specify an order in which the elements are set. This allows for parallel assignments into the list if an implementation so desires.  The order can only be observed in checked mode (and may not be relied upon): if element $i$ is not a subtype of the element type of the list, a dynamic type error will occur when $a[i]$ is assigned $o_{i-1}$. 
 }
 
-\LMHash{}
 A runtime list literal  $[e_1 \ldots e_n]$ is evaluated as  $< \DYNAMIC{}>[e_1\ldots e_n]$.
 
 
@@ -2900,7 +2629,6 @@
 $<List<int>>[[1, 2, 3], [4, 5, 6]]$ is a list with type parameter $List<int>$, containing two lists with type parameter  \DYNAMIC{}. 
 }
 
-\LMHash{}
 The static type of a list literal of the form  \CONST{}$ <E>[e_1\ldots e_n]$  or the form $<E>[e_1 \ldots e_n]$ is $List<E>$. The static type a list literal of the form  \CONST{} $[e_1 \ldots e_n$]  or the form $[e_1\ldots e_n$] is $List< \DYNAMIC{}>$.
 
 \rationale{
@@ -2911,9 +2639,8 @@
 % what about generics?
     
 \subsection{Maps}
-\LMLabel{maps}
+\label{maps}
 
-\LMHash{}
 A {\em map literal} denotes a map object. 
 
 \begin{grammar}
@@ -2927,28 +2654,22 @@
     .
 \end{grammar}
 
-\LMHash{}
 A {\em map literal} consists of zero or more entries. Each entry has a {\em key} and a {\em value}.  Each key and each value is denoted by an expression. 
  
-\LMHash{}
 If a map literal begins with the reserved word \CONST{}, it is a {\em constant map literal} which is a compile-time constant (\ref{constants}) and therefore evaluated at compile-time. Otherwise, it is a {\em run-time map literal} and it is evaluated at run-time. Only run-time map literals can be mutated
 after they are created. Attempting to mutate a constant map literal will result in a dynamic error.
 
-\LMHash{}
 It is a compile-time error if either a key or a value of an entry in a constant map literal is not a compile-time constant. It is a compile-time error if the key of an entry in a constant map literal is an instance of a class that implements the operator $==$ unless the key is a 
 %symbol, 
 string, an integer, a literal symbol or the result of invoking a constant constructor of class \cd{Symbol}. 
 It is a compile-time error if the type arguments of a constant map literal include a type parameter. 
 
-\LMHash{}
 The value of a constant map literal  \CONST{}$ <K, V>\{k_1:e_1\ldots k_n :e_n\}$ is an object $m$ whose class implements the built-in class $Map<K, V>$. The entries of $m$ are $u_i:v_i, i \in 1 .. n$, where $u_i$ is the value of the compile-time expression $k_i$ and $v_i$ is the value of the compile-time expression $e_i$.  The value of a constant map literal  \CONST{} $\{k_1:e_1\ldots k_n :e_n\}$ is defined as the value of a constant map literal \CONST{} $<\DYNAMIC{}, \DYNAMIC{}>\{k_1:e_1\ldots k_n :e_n\}$.
 
-\LMHash{}
 Let $map_1 =$ \CONST{}$ <K, V>\{k_{11}:e_{11} \ldots k_{1n} :e_{1n}\}$ and  $map_2 =$  \CONST{}$ <J, U>\{k_{21}:e_{21} \ldots k_{2n} :e_{2n}\}$ be two constant map literals. Let the keys of $map_1$ and $map_2$ evaluate to  $s_{11} \ldots  s_{1n}$  and   $s_{21} \ldots  s_{2n}$ respectively, and let the elements of $map_1$ and $map_2$ evaluate to $o_{11} \ldots  o_{1n}$ and $o_{21} \ldots  o_{2n}$ respectively. Iff \code{identical($o_{1i}$, $o_{2i}$)}  and \code{identical($s_{1i}$, $s_{2i}$)} for $i \in 1.. n$, and $K = J, V = U$ then \code{identical($map_1$, $map_2$)}. 
 
 \commentary{In other words, constant map literals are canonicalized.}
 
-\LMHash{}
 A runtime map literal $<K, V>\{k_1:e_1\ldots k_n :e_n\}$  is evaluated as follows:
 \begin{itemize}
 \item
@@ -2963,15 +2684,12 @@
 \end{itemize}
 
 
-\LMHash{}
 A runtime map literal  $\{k_1:e_1\ldots k_n :e_n\}$ is evaluated as  
 
 $<\DYNAMIC{},  \DYNAMIC{}>\{k_1:e_1\ldots k_n :e_n\}$.
 
-\LMHash{}
 Iff all the keys in a map literal are compile-time constants, it is a static warning if the values of any two keys in a map literal are equal.
 
-\LMHash{}
 A map literal is ordered: iterating over the keys and/or values of the maps always happens in the 
  order the keys appeared in the source code.
 
@@ -2979,14 +2697,12 @@
 Of course, if a key repeats, the order is defined by first occurrence, but the value is defined by the last.
 } 
 
-\LMHash{}
 The static type of a map literal of the form  \CONST{}$ <K, V>\{k_1:e_1\ldots k_n :e_n\}$ or the form $<K, V>\{k_1:e_1\ldots k_n :e_n\}$ is $Map<K, V>$. The static type a map literal of the form  \CONST{}$\{k_1:e_1\ldots k_n :e_n\}$ or the form $\{k_1:e_1\ldots k_n :e_n\}$ is $Map<\DYNAMIC{},  \DYNAMIC{}>$. 
 
 
 \subsection{Throw}
-\LMLabel{throw}
+\label{throw}
 
-\LMHash{}
 The {\em throw expression}  is used to raise an exception.
 
  \begin{grammar}
@@ -3000,53 +2716,43 @@
  
  \end{grammar}
  
-\LMHash{}
  The {\em current exception} is the last exception raised and not subsequently caught at a given moment during runtime. 
 
-\LMHash{}
  Evaluation of a throw expression of the form  \code{\THROW{} $e$;} proceeds as follows:
  
-\LMHash{}
 The expression $e$ is evaluated yielding a value $v$. 
 
 \commentary{
 There is no requirement that the expression $e$ evaluate to a special kind of exception or error object.
 }
 
-\LMHash{}
 If $e$ evaluates to \NULL{} (\ref{null}), then a \code{NullThrownError} is thrown. Otherwise the current exception is set to $v$ and the current return value (\ref{return}) becomes undefined.
 
 \rationale{The current exception and the current return value must never be simultaneously defined, as they represent mutually exclusive options for exiting the current function. 
 }
 
-\LMHash{}
 Let $f$ be the immediately enclosing function. 
 
-\LMHash{}
 If $f$ is synchronous (\ref{functions}), control is transferred to the nearest dynamically enclosing exception handler.
 
 \commentary{
 If $f$ is marked \SYNC* then a dynamically enclosing exception handler encloses the call to \code{moveNext()} that initiated the evaluation of the throw expression.
 }
 
-\LMHash{}
 If $f$ is asynchronous  then if there is a dynamically enclosing exception handler $h$  (\ref{try}) introduced by the current activation, control is transferred to $h$, otherwise $f$  terminates.
 
 \rationale{
 The rules for where a thrown exception will be handled must necessarily differ between the synchronous and asynchronous cases. Asynchronous functions cannot transfer control to an exception handler defined outside themselves.  Asynchronous generators post exceptions to their stream. Other asynchronous functions report exceptions via their future.
 }
 
-\LMHash{}
 If the object being thrown is an instance of class \code{Error} or a subclass thereof, its \code{stackTrace} getter will return the stack trace current at the point where the the object was first thrown.
 
-\LMHash{}
 The static type of a throw expression is $\bot$.
 
 
 \subsection{ Function Expressions}
-\LMLabel{functionExpressions}
+\label{functionExpressions}
 
-\LMHash{}
 A {\em function literal} is an object that encapsulates an executable unit of code. 
 
 \begin{grammar}
@@ -3055,7 +2761,6 @@
     .
  \end{grammar}   
  
-\LMHash{}
 The class of a function literal implements the built-in class \code{Function}.   
 %Invoking the getter \code{runtimeType} on a function literal returns the \code{Type} object that is the value of the expression \code{Function}.
 % not necessarily
@@ -3063,7 +2768,6 @@
 
 %Q{Can anyone implement it? Then we should define things via call}
 
-\LMHash{}
 The static type of a function literal of the form 
 
 $(T_1$ $a_1, \ldots, T_n$ $a_n, [T_{n+1}$ $x_{n+1} = d_1, \ldots,  T_{n+k}$ $x_{n+k} = d_k]) => e$ 
@@ -3071,13 +2775,11 @@
 
 $(T_1 \ldots, T_n, [T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}]) \rightarrow T_0$, where $T_0$ is the static type of $e$. 
 
-\LMHash{}
 The static type of a function literal of the form 
 
 $(T_1$ $a_1, \ldots, T_n$ $a_n, [T_{n+1}$ $x_{n+1} = d_1, \ldots,  T_{n+k}$ $x_{n+k} = d_k])$ \ASYNC{} $=> e$
 is $(T_1 \ldots, T_n, [T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}]) \rightarrow Future<T_0>$, where $T_0$ is the static type of $e$. 
 
-\LMHash{}
 The static type of a function literal of the form 
 
 $(T_1$ $a_1, \ldots, T_n$ $a_n, \{T_{n+1}$ $x_{n+1} : d_1, \ldots,  T_{n+k}$ $x_{n+k} : d_k\}) => e$ 
@@ -3085,40 +2787,34 @@
 
 $(T_1 \ldots, T_n, \{T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}\}) \rightarrow T_0$, where $T_0$ is the static type of $e$. 
 
-\LMHash{}
 The static type of a function literal of the form 
 
 $(T_1$ $a_1, \ldots, T_n$ $a_n, \{T_{n+1}$ $x_{n+1} : d_1, \ldots,  T_{n+k}$ $x_{n+k} : d_k\})$ \ASYNC{}  $=> e$
 
 is $(T_1 \ldots, T_n, \{T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}\}) \rightarrow Future<T_0>$, where $T_0$ is the static type of $e$. 
 
-\LMHash{}
 The static type of a function literal of the form  
 
 $(T_1$ $a_1, \ldots, T_n$ $a_n, [T_{n+1}$ $x_{n+1} = d_1, \ldots,  T_{n+k}$ $x_{n+k}= d_k])\{s\}$ 
 
 is $(T_1 \ldots, T_n, [T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}]) \rightarrow  \DYNAMIC{}$.
 
-\LMHash{}
 The static type of a function literal of the form  
 
 $(T_1$ $a_1, \ldots, T_n$ $a_n, [T_{n+1}$ $x_{n+1} = d_1, \ldots,  T_{n+k}$ $x_{n+k}= d_k])$ $ \ASYNC{}$ $\{s\}$ 
 is $(T_1 \ldots, T_n, [T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}]) \rightarrow Future$. 
 
-\LMHash{}
 The static type of a function literal of the form  
 
 $(T_1$ $a_1, \ldots, T_n$ $a_n, [T_{n+1}$ $x_{n+1} = d_1, \ldots,  T_{n+k}$ $x_{n+k}= d_k])$ $ \ASYNC*{}$ $\{s\}$ 
 is $(T_1 \ldots, T_n, [T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}]) \rightarrow Stream$. 
 
-\LMHash{}
 The static type of a function literal of the form  
 
 $(T_1$ $a_1, \ldots, T_n$ $a_n, [T_{n+1}$ $x_{n+1} = d_1, \ldots,  T_{n+k}$ $x_{n+k}= d_k])$ $ \SYNC*{}$ $\{s\}$ 
 is $(T_1 \ldots, T_n, [T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}]) \rightarrow Iterable$. 
 
 
-\LMHash{}
 The static type of a function literal of the form  
 
 $(T_1$ $a_1, \ldots, T_n$ $a_n, [T_{n+1}$ $x_{n+1} = d_1, \ldots,  T_{n+k}$ $x_{n+k}= d_k])\{s\}$ 
@@ -3126,35 +2822,30 @@
 is $(T_1 \ldots, T_n, [T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}]) \rightarrow  \DYNAMIC{}$. 
 
 
-\LMHash{}
 The static type of a function literal of the form  
 
 $(T_1$ $a_1, \ldots, T_n$ $a_n, \{T_{n+1}$ $x_{n+1} : d_1, \ldots,  T_{n+k}$ $x_{n+k} : d_k\})$ $\ASYNC{}$ $\{s\}$
  
 is $(T_1 \ldots, T_n, \{T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}\}) \rightarrow  Future{}$.
 
-\LMHash{}
 The static type of a function literal of the form  
 
 $(T_1$ $a_1, \ldots, T_n$ $a_n, \{T_{n+1}$ $x_{n+1} : d_1, \ldots,  T_{n+k}$ $x_{n+k} : d_k\})$ $\ASYNC*{}$ $\{s\}$
  
 is $(T_1 \ldots, T_n, \{T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}\}) \rightarrow  Stream{}$.
 
-\LMHash{}
 The static type of a function literal of the form  
 
 $(T_1$ $a_1, \ldots, T_n$ $a_n, \{T_{n+1}$ $x_{n+1} : d_1, \ldots,  T_{n+k}$ $x_{n+k} : d_k\})$ $\SYNC*{}$ $\{s\}$
  
 is $(T_1 \ldots, T_n, \{T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}\}) \rightarrow  Iterable{}$.
 
-\LMHash{}
 In all of the above cases, whenever $T_i, 1 \le i \le n+k$, is not specified, it is considered to have been specified as  \DYNAMIC{}.
 
 
 \subsection{ This}
-\LMLabel{this}
+\label{this}
 
-\LMHash{}
 The reserved word \THIS{} denotes the target of the current instance member invocation.
 
 \begin{grammar}
@@ -3163,27 +2854,23 @@
      .
 \end{grammar}
 
-\LMHash{}
 The static type of \THIS{} is the interface of the immediately enclosing class.
 
 \commentary{
 We do not support self-types at this point. 
 }
 
-\LMHash{}
 It is a compile-time error if \THIS{} appears, implicitly or explicitly,  in a top-level function or variable initializer,  in a factory constructor, or in a static method or variable initializer, or in the initializer of an instance variable. 
 
 \subsection{ Instance Creation}
-\LMLabel{instanceCreation}
+\label{instanceCreation}
 
-\LMHash{}
 Instance creation expressions invoke constructors to produce instances. 
 
 %It is a compile-time error if any of the type arguments to a constructor of a generic type invoked by a new expression or a constant object expression do not denote types in the enclosing lexical scope. 
 
 %It is a compile-time error if a constructor of a non-generic type invoked by a new expression or a constant object expression is passed any type arguments. It is a compile-time error if a constructor of a generic type with $n$ type parameters invoked by a new expression or a constant object expression is passed $m$ type arguments where $m \ne n$, or if any of its type arguments is  misconstructed (\ref{parameterizedTypes}).
 
-\LMHash{}
 It is a static type warning if
 the type $T$ in an instance creation expression of one of  the forms 
 
@@ -3195,7 +2882,6 @@
 
 \CONST{} $T(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$ is malformed (\ref{dynamicTypeSystem}) or malbounded (\ref{parameterizedTypes}).
 
-\LMHash{}
 It is a compile-time error if the type $T$ in an instance creation expression of one of the forms 
 
 \NEW{} $T.id(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$,  
@@ -3211,9 +2897,8 @@
 
 
 \subsubsection{ New}
-\LMLabel{new}
+\label{new}
 
-\LMHash{}
 The {\em new expression} invokes a constructor (\ref{constructors}).
 
 \begin{grammar}
@@ -3222,7 +2907,6 @@
 .
 \end{grammar}
 
-\LMHash{}
 Let $e$ be a new expression of the form  
 
 \NEW{} $T.id(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$ or the form  
@@ -3235,14 +2919,12 @@
 
 %not a class accessible in the current scope,  optionally followed by type arguments. 
 
-\LMHash{}
 If $T$ is  a class or parameterized type accessible in the current scope then:
 \begin{itemize}
 \item
 If $e$ is of the form \NEW{} $T.id(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$ it is a static warning if $T.id$ is not the name of a constructor declared by the type $T$. If $e$ is of the form  \NEW{} $T(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$ it is a static warning if the type $T$ does not declare a constructor with the same name as the declaration of $T$. 
 \end{itemize}
 
-\LMHash{}
 If $T$ is a parameterized type (\ref{parameterizedTypes}) $S<U_1,  \ldots, U_m>$, let $R = S$.  
 %It is a 
 %compile-time CHANGED
@@ -3251,60 +2933,46 @@
 If $T$ is not a parameterized type, let $R = T$.
 Furthermore, if $e$ is of the form \NEW{} $T.id(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$ then let  $q$ be the constructor  $T.id$, otherwise let $q$ be the constructor $T$. 
 
-\LMHash{}
 If $R$ is a generic with $l = m$ type parameters then
 \begin{itemize}
 \item  If $T$ is not a parameterized type, then for $ i \in 1 .. l$, let $V_i =  \DYNAMIC{}$.
 \item  If $T$ is  a parameterized type then let $V_i = U_i$ for $ i \in 1 .. m$.  
 \end{itemize}
 
-\LMHash{}
 If $R$ is a generic with $l \ne m$ type parameters then for $ i \in 1 .. l$, let $V_i =  \DYNAMIC{}$. In any other case, let $V_i = U_i$ for $ i \in 1 .. m$.  
 
-\LMHash{}
 Evaluation of $e$ proceeds as follows:
 
-\LMHash{}
 First, the argument list $(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$ is evaluated. 
 
-\LMHash{}
 If $T$ is a deferred type with prefix $p$, then if $p$ has not been successfully loaded, a dynamic error occurs.
 
-\LMHash{}
 Then, if $q$ is a non-factory constructor of an abstract class then an \code{AbstractClassInstantiationError} is thrown.
 
-\LMHash{}
 If $T$  is malformed or if $T$ is a type variable a dynamic error occurs. In checked mode, if $T$ or any of its superclasses is malbounded a dynamic error occurs.
  Otherwise, if $q$ is not defined or not accessible, a \code{NoSuchMethodError} is thrown.  If $q$ has  less than $n$ positional parameters or more than $n$ required parameters, or if $q$ lacks any of the keyword parameters $\{ x_{n+1}, \ldots, x_{n+k}\}$ a \code{NoSuchMethodError} is thrown.
 
-\LMHash{}
 Otherwise, if $q$ is a generative constructor (\ref{generativeConstructors}), then:
 
 \commentary{Note that it this point we are assured that the number of actual type arguments match the number of formal type parameters.}
 
-\LMHash{}
 A fresh instance (\ref{generativeConstructors}), $i$,  of class $R$ is allocated. For each instance variable $f$ of $i$,  if the variable declaration of $f$ has an initializer expression $e_f$, then $e_f$ is evaluated to an object $o_f$ and $f$ is bound to $o_f$. Otherwise $f$ is bound to \NULL{}.
 
 \commentary{
 Observe that \THIS{} is not in scope in $e_f$. Hence, the initialization cannot depend on other properties of the object being instantiated.
 }
 
-\LMHash{}
 Next,  $q$ is executed  with \THIS{} bound to $i$,  the type parameters (if any) of $R$ bound to the actual type arguments $V_1, \ldots, V_l$ and the formal parameter bindings that resulted from the evaluation of the argument list. The result of the evaluation of $e$ is $i$.
 
-\LMHash{}
 Otherwise, $q$ is a factory constructor (\ref{factories}). Then:
 
-\LMHash{}
 If $q$ is a redirecting factory constructor of the form $T(p_1, \ldots, p_{n+k}) = c;$ or of the form  $T.id(p_1, \ldots, p_{n+k}) = c;$ then the result of the evaluation of $e$ is equivalent to evaluating the expression 
 
 $[V_1,  \ldots, V_m/T_1,  \ldots, T_m]($\code{\NEW{} $c(a_1, \ldots, a_n, x_{n+1}: a_{n+1}, \ldots, x_{n+k}: a_{n+k}))$}.  If evaluation of $q$ causes $q$ to be re-evaluated cyclically, a runtime error occurs.
 
 
-\LMHash{}
 Otherwise, the body of $q$ is executed with respect to the bindings that resulted from the evaluation of the argument list and the type parameters (if any) of $q$ bound to the actual type arguments $V_1, \ldots, V_l$ resulting in an object $i$. The result of the evaluation of $e$ is $i$.
 
-\LMHash{}
 It is a static warning if $q$ is a constructor of an abstract class and $q$ is not a factory constructor.
 
 \commentary{The above gives precise meaning to the idea that instantiating an abstract class leads to a warning. 
@@ -3314,7 +2982,6 @@
 \rationale{In particular, a factory constructor can be declared in an abstract class and used safely, as it will either produce a valid instance or lead to a warning inside its own declaration.
 }
 
-\LMHash{}
 The static type of an instance creation expression of either the form 
 
 \NEW{} $T.id(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$ 
@@ -3329,9 +2996,8 @@
 
 
 \subsubsection{ Const}
-\LMLabel{const}
+\label{const}
 
-\LMHash{}
 A {\em constant object expression} invokes a constant constructor (\ref{constantConstructors}). 
 
 \begin{grammar}
@@ -3340,7 +3006,6 @@
 .
 \end{grammar}
 
-\LMHash{}
 Let $e$ be a constant object expression of the form  
 
 \CONST{} $T.id(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$ 
@@ -3349,23 +3014,18 @@
 
 \commentary{In particular, $T$ may not be a type variable.}
 
-\LMHash{}
 If $T$ is a parameterized type, it is a compile-time error if $T$ includes a type variable among its type arguments.
 
-\LMHash{}
 If $e$ is of the form \CONST{} $T.id(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$ it is a compile-time error if $T.id$ is not the name of a constant constructor declared by the type $T$. If $e$ is of the form  \CONST{} $T(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$ it is a compile-time error if the type $T$ does not declare a constant constructor with the same name as the declaration of $T$. 
 
-\LMHash{}
 In all of the above cases, it is a compile-time error if $a_i,  i\in 1 .. n + k$, is not a compile-time constant expression.
 
 %If $T$ is a parameterized type (\ref{parameterizedTypes}) $S<U_1,  \ldots, U_m>$, let $R = S$.  It is a compile-time error if $T$ is is malformed. If $T$ is not a parameterized type, let $R = T$.
  %Finally, 
 % If $T$ is a generic with $l$ retype parameters, then for all $ i \in 1 .. l$, let $V_i =  \DYNAMIC{}$.  
 
-\LMHash{}
 Evaluation of $e$ proceeds as follows:
 
-\LMHash{}
 First, if $e$ is of the form 
 
 \CONST{} $T.id(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$ 
@@ -3374,7 +3034,6 @@
 
 \NEW{} $T.id(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$. 
 
-\LMHash{}
 Otherwise, $e$ must be of the form  
 
 \CONST{} $T(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$, 
@@ -3383,7 +3042,6 @@
 
 \NEW{} $T(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$. 
 
-\LMHash{}
 Then:
 \begin{itemize}
 \item If during execution of the program, a constant object expression has already evaluated to an instance $j$ of class $R$ with type arguments $V_i, 1 \le i \le m$, then: 
@@ -3397,7 +3055,6 @@
 In other words, constant objects are canonicalized.  In order to determine if an object is actually new, one has to compute it; then it can be compared to any cached instances. If an equivalent object exists in the cache, we throw away the newly created object and use the cached one. Objects are equivalent if they have identical fields and identical type arguments. Since the constructor cannot induce any side effects, the execution of the constructor is unobservable.  The constructor need only be executed once per call site, at compile-time.
 }
 
-\LMHash{}
 The static type of a constant object expression of either the form 
 
 \CONST{} $T.id(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$ 
@@ -3408,7 +3065,6 @@
 
 is $T$. It is a static warning if the static type of $a_i, 1 \le i \le n+ k$ may not be assigned to the type of the corresponding formal parameter of the constructor $T.id$ (respectively $T$).
 
-\LMHash{}
 It is a compile-time error if evaluation of a constant object results in an uncaught exception being thrown.
 
 \commentary{
@@ -3440,17 +3096,14 @@
 }
 
 
-\LMHash{}
 Given an instance creation expression of the form \CONST{} $q(a_1, \ldots , a_n)$ it is a static warning if $q$ is a constructor of an abstract class  (\ref{abstractInstanceMembers}) but $q$ is not a factory constructor.  
 
 
 \subsection{ Spawning an Isolate}
-\LMLabel{spawningAnIsolate}
+\label{spawningAnIsolate}
 
-\LMHash{}
 Spawning an isolate is accomplished via what is syntactically an ordinary library call, invoking one of the functions \code{spawnUri()} or \code{spawnFunction()}defined in the \code{dart:isolate} library. However, such calls  have the  semantic effect of creating a new isolate with its own memory and thread of control.
 
-\LMHash{}
 An isolate's memory is finite, as is the space available to its thread's call stack. It is possible for a running isolate to exhaust its memory or stack, resulting in a run-time error that cannot be effectively caught, which will force the isolate to be suspended.
 
 \commentary{
@@ -3460,15 +3113,12 @@
 
 
 \subsection{ Function Invocation}
-\LMLabel{functionInvocation}
+\label{functionInvocation}
  
-\LMHash{}
 Function invocation occurs in the following cases: when a function expression  (\ref{functionExpressions}) is invoked (\ref{functionExpressionInvocation}), when a method (\ref{methodInvocation}), getter (\ref{topLevelGetterInvocation}, \ref{propertyExtraction}) or setter (\ref{assignment}) is invoked or when a constructor is invoked (either via instance creation (\ref{instanceCreation}), constructor redirection (\ref{redirectingConstructors}) or super initialization). The various kinds of function invocation differ as to how the function to be invoked, $f$,  is determined, as well as whether \THIS{} (\ref{this}) is bound. Once $f$ has been determined, the formal parameters of $f$ are bound to corresponding actual arguments. When the body of $f$ is executed it will be executed with the aforementioned bindings. 
 
-\LMHash{}
 If $f$ is marked \ASYNC{} (\ref{functions}), then a fresh instance (\ref{generativeConstructors}) $o$ implementing the built-in class \code{Future} is associated with the invocation and immediately returned to the caller. The body of $f$ is scheduled for execution at some future time. The future $o$ will complete when $f$ terminates. The value used to complete $o$ is the current return value (\ref{return}), if it is defined, and the current exception (\ref{throw}) otherwise. 
 
-\LMHash{}
 If $f$ is marked \ASYNC* (\ref{functions}), then a fresh instance $s$ implementing the built-in class \code{Stream} is associated with the invocation and immediately returned. When $s$ is listened to, execution of the body of $f$ will begin.  When $f$ terminates:
 \begin{itemize}
 \item If the current return value is defined then, if $s$ has been canceled then its cancellation future is completed with \NULL{} (\ref{null}). 
@@ -3484,20 +3134,16 @@
 When an asynchronous generator's stream has been canceled, cleanup will occur in the \FINALLY{} clauses (\ref{try}) inside the generator. We choose to direct any exceptions that occur at this time to the cancellation future rather than have them be lost. 
 }
 
-\LMHash{}
 If $f$ is asynchronous then, when $f$ terminates, any open stream subscriptions associated with any asynchronous for loops  (\ref{asynchronousFor-in}) or yield-each statements  (\ref{yieldEach}) executing within $f$ are canceled.
 
 \rationale{Such streams may be left open by for loops that were escaped when an exception was thrown within them for example.
 }
 
-\LMHash{}
 If $f$ is marked \SYNC* (\ref{functions}), then a fresh instance $i$ implementing the built-in class \code{Iterable} is associated with the invocation and immediately returned. When iteration over the iterable is started, by getting an iterator $j$ from the iterable and calling \code{moveNext()} on it, execution of the body of $f$ will begin. When $f$ terminates, $j$ is positioned after its last element, so that its current value is \NULL{} and the current call to \code{moveNext()} on $j$ returns false, as will all further calls.
 
-\LMHash{}
 If $f$ is synchronous and is not a generator (\ref{functions}) then execution of the body of $f$ begins immediately.  When $f$ terminates the current return value is returned to the caller.
 
 
-\LMHash{}
 Execution of $f$ terminates when the first of the following occurs:
 \begin{itemize}
 \item An exception is thrown and not caught within the current function activation. 
@@ -3509,9 +3155,8 @@
 
 
 \subsubsection{ Actual Argument List Evaluation}
-\LMLabel{actualArguments}
+\label{actualArguments}
 
-\LMHash{}
 Function invocation involves evaluation of the list of actual arguments to the function and binding of the results to the function's formal parameters.
 
 \begin{grammar}
@@ -3530,14 +3175,12 @@
     .
  \end{grammar}
 
-\LMHash{}
 Evaluation of an actual argument list of the form 
 
 $(a_1, \ldots, a_m, q_1: a_{m+1}, \ldots, q_l: a_{m+l})$ 
 
 proceeds as follows:
 
-\LMHash{}
 The arguments $a_1, \ldots, a_{m+l}$ are evaluated in the order they appear in the program, yielding objects $o_1, \ldots, o_{m+l}$.
 
 \commentary{Simply stated, an argument list consisting of $m$ positional arguments and $l$ named arguments is evaluated from left to right.
@@ -3545,12 +3188,10 @@
 
 
 \subsubsection{ Binding Actuals to Formals}
-\LMLabel{bindingActualsToFormals}
+\label{bindingActualsToFormals}
 
-\LMHash{}
 Let $f$ be a function with $h$ required parameters,  let $p_1 \ldots p_n$ be the positional parameters of $f$ and let $p_{h+1}, \ldots, p_{h+k}$ be the optional parameters declared by $f$.
 
-\LMHash{}
 An evaluated actual argument list $o_1 \ldots o_{m+l}$ derived from an actual argument list of the form $(a_1, \ldots, a_m, q_1: a_{m+1}, \ldots, q_l: a_{m+l})$ is bound to the formal parameters of $f$ as follows:
 
 \commentary{
@@ -3562,31 +3203,25 @@
 }
 
 
-\LMHash{}
 If  $m < h$, or $m > n$, a \cd{NoSuchMethodError} is thrown. Furthermore, each $q_i, 1 \le i \le l$,  must have a corresponding named parameter in the set $\{p_{n+1}, \ldots, p_{n +k}\}$ or a \cd{NoSuchMethodError} is thrown. Then $p_i$ is bound to $o_i, i \in 1.. m$, and $q_j$  is bound to $o_{m+j}, j \in 1.. l$.  All remaining formal parameters of $f$  are bound to their default values. 
 
 \commentary{All of these remaining parameters are necessarily optional and thus have default values.}
 
-\LMHash{}
 In checked mode, it is a dynamic type error if  $o_i$ is not \NULL{} and the actual type  (\ref{actualTypeOfADeclaration}) of $p_i$ is not a supertype of the type of $o_i, i \in 1.. m$. In checked mode, it is a dynamic type error if  $o_{m+j}$ is not \NULL{} and the actual type  (\ref{actualTypeOfADeclaration}) of $q_j$ is not a supertype of the type of $o_{m+j}, j \in 1.. l$.
 
-\LMHash{}
 It is a compile-time error if $q_i = q_j$ for any $i \ne j$.
 
-\LMHash{}
 Let $T_i$ be the static type of $a_i$, let $S_i$ be the type of $p_i, i \in 1 .. h+k$ and let $S_q$ be the type of the named parameter $q$ of $f$.  It is a static warning if $T_j$ may not be assigned to $S_j, j \in 1..m$.  It is a static warning if $m < h$ or if $m > n$. Furthermore, each $q_i, 1 \le i \le l$,  must have a corresponding named parameter in the set $\{p_{n+1}, \ldots, p_{n +k}\}$ or a static warning occurs.  It is a static warning if $T_{m+j}$ may not be assigned to $S_{q_j}, j \in 1 .. l$.
 
 \subsubsection{ Unqualified Invocation}
-\LMLabel{unqualifiedInvocation}
+\label{unqualifiedInvocation}
 
-\LMHash{}
 An unqualified function invocation $i$ has the form 
 
 $id(a_1, \ldots, a_n, x_{n+1}: a_{n+1}, \ldots, x_{n+k}: a_{n+k})$, 
 
 where $id$ is an identifier. 
 
-\LMHash{}
 If there exists a lexically visible declaration named $id$, let $f_{id}$ be the innermost such declaration. Then:
 \begin{itemize}
 \item
@@ -3602,10 +3237,8 @@
 %Unqualified access to static methods of superclasses is inconsistent with the idea that static methods are not inherited. It is not particularly necessary and  may be restricted in future versions.
 %}
 
-\LMHash{}
 Otherwise, if $i$ occurs inside a top level or static function (be it function, method, getter,  or setter) or variable initializer, evaluation of $i$ causes a \cd{NoSuchMethodError} to be thrown.
 
-\LMHash{}
 If $i$ does not occur inside a top level or static function, $i$ is equivalent to $\THIS{}.id(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$.
 
 % Should also say:
@@ -3616,9 +3249,8 @@
 
 
 \subsubsection{ Function Expression Invocation}
-\LMLabel{functionExpressionInvocation}
+\label{functionExpressionInvocation}
 
-\LMHash{}
 A function expression invocation $i$ has the form 
 
 $e_f(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$, 
@@ -3629,7 +3261,6 @@
 \code{$a.b(x)$} is parsed as a method invocation of method \code{$b()$} on object \code{$a$}, not as an invocation of getter \code{$b$} on \code{$a$} followed by a function call \code{$(a.b)(x)$}.  If a method or getter \code{$b$} exists, the two will be equivalent. However, if \code{$b$} is not defined on \code{$a$}, the resulting invocation of \code{noSuchMethod()} would differ.  The \code{Invocation} passed to \code{noSuchMethod()} would describe a call to a method \code{$b$} with argument \code{$x$} in the former case, and a call to a getter \code{$b$} (with no arguments) in the latter.
 }
 
-\LMHash{}
 Otherwise:
 
 A function expression invocation $e_f(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$ is equivalent to $e_f.call(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$.
@@ -3638,7 +3269,6 @@
 The implication of this definition, and the other definitions involving the method \code{call()}, is that user defined types can be used as function values provided they define a \CALL{} method. The method \CALL{} is special in this regard. The signature of the \CALL{} method determines the signature used when using the object via the built-in invocation syntax.
 }
 
-\LMHash{}
 It is a static warning if the static type $F$ of $e_f$ may not be assigned to a function type.  If $F$ is not a function type, the static type of $i$ is \DYNAMIC{}. Otherwise 
 the static type of $i$ is the declared return type of  $F$.  
 %\item Let $T_i$ be the static type of $a_i, i \in 1 .. n+k$. It is a static warning if $F$ is not a supertype of  $(T_1, \ldots, T_n, [T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}]) \to \bot$.
@@ -3647,12 +3277,10 @@
 \subsection{ Lookup}
 
 \subsubsection{Method Lookup}
-\LMLabel{methodLookup}
+\label{methodLookup}
 
-\LMHash{}
 The result of a lookup of a method $m$ in object $o$ with respect to library $L$ is the result of  a lookup of method $m$ in class $C$ with respect to library $L$, where $C$ is the class of $o$.
 
-\LMHash{}
 The result of  a lookup of method $m$ in class $C$ with respect to library $L$ is:
 If $C$ declares a concrete instance method named $m$ that is accessible to $L$,  then that method is the result of the lookup. Otherwise, if $C$ has a superclass $S$, then the result of the lookup is the result of looking up $m$  in $S$ with respect to $L$. Otherwise, we say that the method lookup has failed.
 
@@ -3662,12 +3290,10 @@
 
 
 \subsubsection{ Getter and Setter Lookup}
-\LMLabel{getterAndSetterLookup}
+\label{getterAndSetterLookup}
 
-\LMHash{}
 The result of a lookup of a getter (respectively setter) $m$ in object $o$  with respect  to  library $L$ is the result of looking up getter (respectively setter) $m$ in class $C$ with respect to $L$, where $C$ is the class of $o$.
 
-\LMHash{}
 The result of a lookup of a getter (respectively setter) $m$ in class $C$  with respect to library $L$ is:
 If $C$ declares a concrete instance getter (respectively setter) named $m$  that is accessible to $L$,  then that getter (respectively setter) is the result of the lookup. Otherwise, if $C$ has a superclass $S$, then the result of the lookup is the result of looking up getter (respectively setter) $m$ in $S$ with respect to $L$. Otherwise, we say that the lookup has failed.
 
@@ -3677,64 +3303,52 @@
 
 
 \subsection{ Top level Getter Invocation}
-\LMLabel{topLevelGetterInvocation}
+\label{topLevelGetterInvocation}
 
-\LMHash{}
 Evaluation of a top-level getter invocation $i$ of the form $m$, where $m$ is an identifier, proceeds as follows:
 
-\LMHash{}
 The getter function $m$ is invoked. The value of $i$ is the result returned by the call to the getter function.
 \commentary{
 Note that the invocation is always defined. Per the rules for identifier references, an identifier will not be treated as a top-level getter invocation unless the getter $i$ is defined. 
 }
 
-\LMHash{}
 The static type of $i$ is the declared return type of $m$.
 
 \subsection{ Method Invocation}
-\LMLabel{methodInvocation}
+\label{methodInvocation}
 
-\LMHash{}
 Method invocation can take several forms as specified below. 
 
 \subsubsection{Ordinary Invocation}
-\LMLabel{ordinaryInvocation}
+\label{ordinaryInvocation}
 
-\LMHash{}
 An ordinary method invocation $i$ has the form 
 
 $o.m(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$.
 
-\LMHash{}
 Evaluation of an ordinary method invocation $i$ of the form 
 
 $o.m(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$ 
 
 proceeds as follows:
 
-\LMHash{}
 First, the expression $o$ is evaluated to a value $v_o$. Next, the argument list $(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$ is evaluated yielding actual argument objects $o_1, \ldots , o_{n+k}$. Let $f$ be the result of looking up (\ref{methodLookup}) method $m$  in $v_o$ with respect to the current library $L$. 
 
-\LMHash{}
 Let $p_1 \ldots p_h$ be the required parameters of $f$,  let $p_1 \ldots p_m$ be the positional parameters of $f$ and let $p_{h+1}, \ldots, p_{h+l}$ be the optional parameters declared by $f$.
 
 \commentary{
 We have an argument list consisting of $n$ positional arguments and $k$ named arguments. We have a function with $h$ required parameters and $l$ optional parameters. The number of positional arguments must be at least as large as the number of required parameters, and no larger than the number of positional parameters. All named arguments must have a corresponding named parameter. 
 }
 
-\LMHash{}
 If  $n < h$, or $n > m$, the method lookup has failed. Furthermore, each $x_i, n+1 \le i \le n+k$,  must have a corresponding named parameter in the set $\{p_{m+1}, \ldots, p_{h+l}\}$ or the method lookup also fails.  If $v_o$ is an instance of \code{Type} but $o$ is not a constant type literal, then if $m$ is a method that forwards (\ref{functionDeclarations}) to a static method, method lookup fails. Otherwise method lookup has succeeded.
 
-\LMHash{}
 If the method lookup succeeded, the body of $f$ is executed with respect to the bindings that resulted from the evaluation of the argument list, and with \THIS{} bound to $v_o$. The value of $i$ is the value returned after $f$ is executed.
 
-\LMHash{}
 If the method lookup has failed, then let $g$ be the result of looking up getter (\ref{getterAndSetterLookup}) $m$ in $v_o$ with respect to $L$. 
 f $v_o$ is an instance of \code{Type} but $o$ is not a constant type literal, then if $g$ is a getter that forwards to a static getter, getter lookup fails.
 If the getter lookup succeeded, let $v_g$ be the value of the getter invocation $o.m$. Then the value of $i$ is the result of invoking 
 the static method \code{Function.apply()} with arguments $v.g, [o_1, \ldots , o_n], \{x_{n+1}: o_{n+1}, \ldots , x_{n+k}: o_{n+k}\}$.
 
-\LMHash{}
 If  getter lookup has also failed, then a new instance $im$  of the predefined class  \code{Invocation}  is created, such that :
 \begin{itemize}
 \item  \code{im.isMethod} evaluates to \code{\TRUE{}}.
@@ -3743,7 +3357,6 @@
 \item \code{im.namedArguments} evaluates to an immutable map with the same keys and values as \code{\{$x_{n+1}: o_{n+1}, \ldots, x_{n+k} : o_{n+k}$\}}.
 \end{itemize}
 
-\LMHash{}
 Then the method \code{noSuchMethod()} is looked up in $v_o$ and invoked with argument $im$, and the result of this invocation is the result of evaluating $i$. However, if the implementation found cannot be invoked with a single positional argument, the implementation  of \code{noSuchMethod()} in class \code{Object} is invoked on $v_o$ with argument $im'$, where $im'$ is an instance of \code{Invocation} such that :
 \begin{itemize}
 \item  \code{im.isMethod} evaluates to \code{\TRUE{}}.
@@ -3767,7 +3380,6 @@
 
 \commentary{Notice that the wording carefully avoids re-evaluating the receiver $o$ and the arguments $a_i$. }
 
-\LMHash{}
 Let $T$ be the  static type of $o$. It is a static type warning if $T$ does not have an accessible  (\ref{privacy}) instance member named $m$ unless  either:
 \begin{itemize}
 \item
@@ -3775,17 +3387,14 @@
 \item  $T$ is \code{Type}, $e$ is a constant type literal and the class corresponding to $e$ has a static getter named $m$.
 \end{itemize}
 
-\LMHash{}
 If $T.m$ exists, it  is a static type warning if the type $F$ of $T.m$ may not be assigned to a function type. If $T.m$ does not exist, or if $F$ is not a function type, the static type of $i$ is \DYNAMIC{}; otherwise the static type of $i$ is the declared return type of  $F$.  
 
-\LMHash{}
 It is a compile-time error to invoke any of the methods of class \cd{Object} on a prefix object (\ref{imports}) or on a constant type literal that is  immediately followed by the token `.'.
 
 
 \subsubsection{Cascaded Invocations}
-\LMLabel{cascadedInvocations}
+\label{cascadedInvocations}
 
-\LMHash{}
 A {\em cascaded method invocation} has the form {\em e..suffix}
 where $e$ is an expression and {\em suffix} is a sequence of operator, method, getter or setter invocations.
 
@@ -3799,35 +3408,27 @@
       .
 \end{grammar}
 
-\LMHash{}
 A cascaded method invocation expression of the form {\em e..suffix} is equivalent to the expression \code{(t)\{t.{\em suffix}; \RETURN{} t;\}($e$)}.
 
 \subsubsection{Super Invocation}
-\LMLabel{superInvocation}
+\label{superInvocation}
 
-\LMHash{}
 A super method invocation $i$ has the form 
 
 $\SUPER{}.m(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$.
 
-\LMHash{}
 Evaluation of $i$ proceeds as follows:
 
-\LMHash{}
 First, the argument list $(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$ is evaluated  yielding actual argument objects $o_1, \ldots , o_{n+k}$. Let $S$ be the superclass of the immediately enclosing class, and let $f$ be the result of looking up method (\ref{ordinaryInvocation})  $m$ in $S$  with respect to the current library $L$. 
 Let $p_1 \ldots p_h$ be the required parameters of $f$,  let $p_1 \ldots p_m$ be the positional parameters of $f$ and let $p_{h+1}, \ldots, p_{h+l}$ be the optional parameters declared by $f$.
 
-\LMHash{}
 If  $n < h$, or $n > m$, the method lookup has failed. Furthermore, each $x_i, n+1 \le i \le n+k$,  must have a corresponding named parameter in the set $\{p_{m+1}, \ldots, p_{h+l}\}$ or the method lookup also fails.  Otherwise method lookup has succeeded.
 
-\LMHash{}
 If the method lookup succeeded, the body of $f$ is executed with respect to the bindings that resulted from the evaluation of the argument list, and with \THIS{} bound to the current value of \THIS{}. The value of $i$ is the value returned after $f$ is executed.
 
-\LMHash{}
 If the method lookup has failed, then let $g$ be the result of looking up getter (\ref{getterAndSetterLookup}) $m$ in $S$ with respect to $L$. If the getter lookup succeeded, let $v_g$ be the value of the getter invocation $\SUPER{}.m$. Then the value of $i$ is the result of invoking 
 the static method \code{Function.apply()} with arguments $v.g, [o_1, \ldots , o_n], \{x_{n+1}: o_{n+1}, \ldots , x_{n+k}: o_{n+k}\}$.
  
-\LMHash{}
 If  getter lookup has also failed, then a new instance $im$  of the predefined class  \code{Invocation}  is created, such that :
 \begin{itemize}
 \item  \code{im.isMethod} evaluates to \code{\TRUE{}}.
@@ -3846,10 +3447,8 @@
 and the result of this latter invocation is the result of evaluating $i$.
 
 
-\LMHash{}
 It is a compile-time error if a super method invocation occurs in a top-level function or variable initializer, in an instance variable initializer or initializer list, in class \code{Object}, in a factory constructor or in a static method or variable initializer.
 
-\LMHash{}
 It is a static type warning if $S$ does not have an accessible (\ref{privacy}) instance member named $m$ unless $S$ or a superinterface of $S$ is annotated with an annotation denoting a constant identical to the constant \code{@proxy} defined in \code{dart:core}. If $S.m$ exists, it  is a static type warning if the type $F$ of $S.m$ may not be assigned to a function type. If $S.m$ does not exist, or if $F$ is not a function type, the static type of $i$ is \DYNAMIC{}; otherwise the static type of $i$ is the declared return type of  $F$.  
 % The following is not needed because it is specified in 'Binding Actuals to Formals"
 %Let $T_i$ be the static type of $a_i, i \in 1 .. n+k$. It is a static warning if $F$ is not a supertype of  $(T_1, \ldots, t_n, \{T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}\}) \to \bot$.
@@ -3858,9 +3457,9 @@
 
 
 \subsubsection{Sending Messages}
-\LMLabel{sendingMessages}
 
-\LMHash{}
+\label{sendingMessages}
+
 Messages are the sole means of communication among isolates. Messages are sent by invoking specific  methods in the Dart libraries; there is no specific syntax for sending a message. 
 
 \commentary{In other words, the methods supporting sending messages embody primitives of Dart that are not accessible to ordinary code, much like the methods that spawn isolates.
@@ -3869,9 +3468,8 @@
 
 
 \subsection{ Property Extraction}
-\LMLabel{propertyExtraction}
+\label{propertyExtraction}
 
-\LMHash{}
 {\em Property extraction} allows for a member of an object to be concisely extracted from the object.
 A property extraction can be either:
 \begin{enumerate}
@@ -3879,16 +3477,12 @@
 \item A {\em getter invocation} which returns the result of invoking of a getter method.
 \end{enumerate}
 
-\LMHash{}
 Evaluation of a property extraction $i$ of the form $e.m$ proceeds as follows:
 
-\LMHash{}
 First, the expression $e$ is evaluated to an object $o$. Let $f$ be the result of looking up (\ref{methodLookup}) method  (\ref{instanceMethods}) $m$ in $o$ with respect to the current library $L$.  If $o$ is an instance of \code{Type} but $e$ is not a constant type literal, then if $m$ is a method that forwards (\ref{functionDeclarations}) to a static method,  method lookup fails. If method lookup succeeds and $f$ is a concrete method then $i$ evaluates to the closurization of $o.m$.  
 
-\LMHash{}
 Otherwise, $i$ is a getter invocation, and the getter function (\ref{getters}) $m$ is looked up (\ref{getterAndSetterLookup}) in $o$  with respect to $L$. If $o$ is an instance of \code{Type} but $e$ is not a constant type literal, then if $m$ is a getter that forwards  to a static getter,  getter lookup fails. Otherwise, the body of $m$ is executed with \THIS{} bound to $o$.  The value of $i$ is the result returned by the call to the getter function. 
 
-\LMHash{}
 If the getter lookup has failed, then a new instance $im$  of the predefined class  \code{Invocation}  is created, such that :
 \begin{itemize}
 \item  \code{im.isGetter} evaluates to \code{\TRUE{}}.
@@ -3906,14 +3500,12 @@
 
 and the result of this latter invocation is the result of evaluating $i$.
 
-\LMHash{}
 It is a compile-time error if $m$ is a member of class \cd{Object} and $e$ is either a prefix object (\ref{imports}) or a constant type literal.
 
 \commentary {
 This precludes \code{int.toString} but not \code{(int).toString} because in the latter case, $e$ is a parenthesized expression.
 }
 
-\LMHash{}
 Let $T$ be the  static type of $e$. It is a static type warning if $T$ does not have a method or getter named $m$ unless either:
 \begin{itemize}
 \item
@@ -3921,7 +3513,6 @@
 \item  $T$ is \code{Type}, $e$ is a constant type literal and the class corresponding to $e$ has a static method or getter named $m$.
 \end{itemize}
 
-\LMHash{}
 If $i$ is a getter invocation, the static type of $i$ is:
 \begin{itemize}
 \item The declared return type of $T.m$, if $T.m$ exists.
@@ -3929,19 +3520,14 @@
 \item  The type \DYNAMIC{} otherwise.  
 \end{itemize}
 
-\LMHash{}
 If $i$ is a closurization, its static type is as described in section \ref{closurization}.
 
-\LMHash{}
 Evaluation of a property extraction $i$ of the form $\SUPER.m$ proceeds as follows:
 
-\LMHash{}
  Let $S$ be the superclass of the immediately enclosing class. Let $f$ be the result of looking up method $m$ in $S$ with respect to the current library $L$.  If $f$ is a concrete method then $i$ evaluates to the closurization of $\SUPER.m$ with respect to superclass $S$(\ref{closurization}).  
  
-\LMHash{}
  Otherwise, $i$ is a getter invocation and the getter function $m$ is looked up in $S$  with respect to $L$, and its body is executed with \THIS{} bound to the current value of  \THIS{}.  The value of $i$ is the result returned by the call to the getter function. 
 
-\LMHash{}
 If the getter lookup has failed, then a new instance $im$  of the predefined class  \code{Invocation}  is created, such that :
 \begin{itemize}
 \item  \code{im.isGetter} evaluates to \code{\TRUE{}}.
@@ -3959,14 +3545,12 @@
 
 and the result of this latter invocation is the result of evaluating $i$.
 
-\LMHash{}
 It is a static type warning if $S$ does not have a method or getter named $m$.  If $i$ is a getter invocation, the static type of $i$ is the declared return type of $S.m$, if $S.m$ exists and  \DYNAMIC{} otherwise. If $i$ is a closurization, its static type is as described in section \ref{closurization}.
 
 
 \subsubsection{Closurization}
-\LMLabel{closurization}
+\label{closurization}
 
-\LMHash{}
 The {\em closurization of $o.m$} is defined to be equivalent to:
 
 \begin{itemize}
@@ -4016,7 +3600,6 @@
 
 
  
-\LMHash{}
 The closurization of $\SUPER{}.m$ with respect to superclass $S$ is defined to be equivalent to:
 
 \begin{itemize}
@@ -4041,7 +3624,6 @@
 if $m$ has required parameters $r_1, \ldots, r_n$, and optional positional parameters $p_1, \ldots, p_k$ with defaults $d_1, \ldots, d_k$.
 \end{itemize}
 
-\LMHash{}
 Except that:
 \begin{enumerate}
 \item  iff  \code{identical($o_1, o_2$)}  then \cd{$o_1.m$ == $o_2.m$}.
@@ -4051,9 +3633,8 @@
 
 
 \subsection{ Assignment}
-\LMLabel{assignment}
+\label{assignment}
 
-\LMHash{}
 An assignment changes the value associated with a mutable variable or property.
 
 \begin{grammar}
@@ -4062,7 +3643,6 @@
     .
 \end{grammar}
 
-\LMHash{}
 Evaluation of an assignment $a$ of the form $v$ \code{=} $e$ proceeds as follows:
 
 
@@ -4074,38 +3654,27 @@
  
 %Otherwise,  
 
-\LMHash{}
 Let $d$ be the innermost declaration whose name is $v$ or $v=$, if it exists.
 
-\LMHash{}
 If $d$ is the declaration of a local variable, the expression $e$ is evaluated to an object $o$. Then, the variable $v$ is bound to $o$ unless $v$ is \FINAL{} or \CONST{}, in which case a dynamic error occurs.
 If no error occurs, the value of the assignment expression is $o$.  
 
-\LMHash{}
 If $d$ is the declaration of a library variable, top level getter or top level setter, the expression $e$ is evaluated to an object $o$. Then the setter $v=$ is invoked with its formal parameter bound to $o$. The value of the assignment expression is $o$.  
 
-\LMHash{}
 Otherwise, if $d$ is the declaration of a static variable, static getter or static setter in class $C$, then the assignment is equivalent to the assignment \code{$C.v$ = $e$}.
 
-\LMHash{}
 Otherwise, If  $a$ occurs inside a top level or static function (be it function, method, getter,  or setter) or variable initializer, evaluation of $a$ causes $e$ to be evaluated, after which a \code{NoSuchMethodError} is thrown. 
 
-\LMHash{}
 Otherwise, the assignment is equivalent to the assignment \code{ \THIS{}.$v$ = $e$}. 
 
-\LMHash{}
 In checked mode, it is a dynamic type error if $o$ is not \NULL{} and the interface of the class of $o$ is not a subtype of the actual type (\ref{actualTypeOfADeclaration}) of $v$.
 
-\LMHash{}
 It is a static type warning if the static type of $e$ may not be assigned to the static type of $v$. The static type of the expression $v$ \code{=} $e$ is the static type of $e$.
 
-\LMHash{}
 Evaluation of an assignment of the form $e_1.v$ \code{=} $e_2$ proceeds as follows:
 
-\LMHash{}
 The expression $e_1$ is evaluated to an object $o_1$. Then, the expression $e_2$  is evaluated to an object $o_2$. Then, the setter $v=$ is looked up (\ref{getterAndSetterLookup}) in $o_1$ with respect to the current library.  If $o_1$ is an instance of \code{Type} but $e_1$ is not a constant type literal, then if $v=$ is a setter that forwards (\ref{functionDeclarations}) to a static setter, setter lookup fails. Otherwise, the body  of $v=$ is executed with its formal parameter bound to $o_2$ and \THIS{} bound to $o_1$. 
 
-\LMHash{}
 If the setter lookup has failed, then a new instance $im$  of the predefined class  \code{Invocation}  is created, such that :
 \begin{itemize}
 \item  \code{im.isSetter} evaluates to \code{\TRUE{}}.
@@ -4114,7 +3683,6 @@
 \item \code{im.namedArguments} evaluates to the value of \code{\CONST{} \{\}}.
 \end{itemize}
 
-\LMHash{}
 Then the method \code{noSuchMethod()} is looked up in $o_1$ and invoked  with argument $im$. 
 However, if the implementation found cannot be invoked with a single positional argument, the implementation  of \code{noSuchMethod()} in class \code{Object} is invoked on $o_1$ with argument $im'$, where $im'$ is an instance of \code{Invocation} such that :
 \begin{itemize}
@@ -4124,13 +3692,10 @@
 \item \code{im.namedArguments} evaluates to the value of \code{\CONST{} \{\}}.
 \end{itemize}
 
-\LMHash{}
 The value of the assignment expression is $o_2$ irrespective of whether setter lookup has failed or succeeded.
 
-\LMHash{}
 In checked mode, it is a dynamic type error if $o_2$ is not \NULL{} and the interface of the class of $o_2$ is not a subtype of the actual type of $e_1.v$.
 
-\LMHash{}
 Let $T$ be the static type of $e_1$. It is a static type warning if $T$ does not have an accessible instance setter named $v=$ unless either:
 \begin{itemize}
 \item $T$ or a superinterface of $T$ is annotated with an annotation denoting a constant identical to the constant \code{@proxy} defined in \code{dart:core}. Or
@@ -4139,26 +3704,21 @@
 
 
 
-\LMHash{}
 It is a static type warning if the static type of $e_2$ may not be assigned to the static type of the formal parameter of the setter $v=$.   The static type of the expression $e_1.v$ \code{=} $e_2$ is the static type of $e_2$.
 
-\LMHash{}
 Evaluation of an assignment of the form $e_1[e_2]$ \code{=} $e_3$ is equivalent to the evaluation of the expression \code{(a, i, e)\{a.[]=(i, e); \RETURN{} e; \} ($e_1, e_2, e_3$)}.  The static type of the expression $e_1[e_2]$ \code{=} $e_3$ is the static type of $e_3$.
 
 % Should we add: It is a dynamic error if $e_1$ evaluates to an  constant list or map.
 
-\LMHash{}
 It is a static warning if an assignment of the form $v = e$ occurs inside a top level or static function (be it function, method, getter, or setter) or variable initializer and there is neither a local variable declaration with name $v$  nor setter declaration with name $v=$ in the lexical scope enclosing the assignment.
 
-\LMHash{}
 It is a compile-time error to invoke any of the setters of class \cd{Object} on a prefix object (\ref{imports}) or on a constant type literal that is  immediately followed by the token `.'.
 
 
 
 \subsubsection{Compound Assignment}
-\LMLabel{compoundAssignment}
+\label{compoundAssignment}
 
-\LMHash{}
 A compound assignment of the form $v$ $op\code{=} e$ is equivalent to $v \code{=} v$ $op$ $e$. A compound assignment of the form $C.v$ $op \code{=} e$ is equivalent to $C.v \code{=} C.v$ $op$ $e$. A compound assignment of the form $e_1.v$ $op = e_2$ is equivalent to \code{((x) $=>$ x.v = x.v $op$ $e_2$)($e_1$)} where $x$ is a variable that is not used in $e_2$. A compound assignment of the form  $e_1[e_2]$ $op\code{=} e_3$ is equivalent to 
 \code{((a, i) $=>$ a[i] = a[i] $op$ $e_3$)($e_1, e_2$)} where $a$ and $i$ are a variables that are not used in $e_3$. 
 
@@ -4180,9 +3740,8 @@
 
     
 \subsection{ Conditional}
-\LMLabel{conditional}
+\label{conditional}
 
-\LMHash{}
 A {\em conditional expression} evaluates one of two expressions based on a boolean condition.
 
 \begin{grammar}
@@ -4191,13 +3750,10 @@
     . % the first  branches could  top level expressions, it seems, but certainly NOT the second
 \end{grammar}
 
-\LMHash{}
 Evaluation of a conditional expression $c$ of the form $e_1 ? e_2 : e_3$ proceeds as follows:
 
-\LMHash{}
 First, $e_1$ is evaluated to an object $o_1$.  Then, $o_1$ is  subjected to boolean conversion (\ref{booleanConversion}) producing an object $r$.  If $r$ is \TRUE, then the value of $c$ is the result of evaluating the expression $e_2$. Otherwise the value of $c$ is the result of evaluating the expression $e_3$. 
 
-\LMHash{}
 If all of the following hold:
 \begin{itemize}
 \item $e_1$ shows that a variable $v$ has type $T$.
@@ -4208,14 +3764,12 @@
 then the type of $v$ is known to be $T$ in $e_2$.
 
 
-\LMHash{}
  It is a static type warning if the static type of $e_1$ may not be assigned to \code{bool}.  The static type of $c$ is the least upper bound (\ref{leastUpperBounds}) of the static type of $e_2$ and the static type of $e_3$.
   
 
 \subsection{ Logical Boolean Expressions}
-\LMLabel{logicalBooleanExpressions}
+\label{logicalBooleanExpressions}
 
-\LMHash{}
 The logical boolean expressions combine boolean objects using the boolean conjunction and disjunction operators.
 
 \begin{grammar}
@@ -4230,16 +3784,12 @@
     .
  \end{grammar}
  
-\LMHash{}
 A {\em logical boolean expression} is either an equality expression (\ref{equality}), or an invocation of a logical boolean operator on an expression $e_1$ with argument $e_2$.
  
-\LMHash{}
 Evaluation of a logical boolean expression $b$ of the form $e_1 || e_2$ causes the evaluation of $e_1$ which is then  subjected to boolean conversion, yielding an object $o_1$; if $o_1$ is \TRUE, the result of evaluating $b$ is \TRUE, otherwise $e_2$ is evaluated to an object $o_2$, which is then subjected to boolean conversion (\ref{booleanConversion}) producing an object $r$, which is the value of $b$. 
 
-\LMHash{}
 Evaluation of a logical boolean expression $b$ of the form $e_1 \&\& e_2$ causes the evaluation of $e_1$ which is then subjected to boolean conversion, yielding an object $o_1$; if $o_1$ is not  \TRUE, the result of evaluating $b$ is \FALSE, otherwise $e_2$ is evaluated to an object $o_2$, which is then subjected to boolean conversion producing an object $r$, which is the value of $b$. 
 
-\LMHash{}
 A logical boolean expression $b$ of the form $e_1 \&\& e_2$ shows that a variable $v$ has type 
 $T$ if all of the following conditions hold:
 \begin{itemize}
@@ -4248,7 +3798,6 @@
 \item The variable $v$ is not mutated in $e_2$ or within a closure.
 \end{itemize}
 
-\LMHash{}
 Furthermore, if all of the following hold:
 \begin{itemize}
 \item $e_1$ shows that $v$ has type $T$.
@@ -4257,14 +3806,12 @@
 \end{itemize}
 then the type of $v$ is known to be $T$ in $e_2$.
 
-\LMHash{}
 It is a static warning if the static type of $e_1$ may not be assigned to \cd{bool} or if the static type of $e_2$ may not be assigned to \cd{bool}. The static type of a logical boolean expression is \code{bool}.
 
      
  \subsection{ Equality}
- \LMLabel{equality}
+ \label{equality}
  
-\LMHash{}
 Equality expressions test objects for equality.
 
  \begin{grammar}
@@ -4277,11 +3824,9 @@
     .
  \end{grammar}
  
-\LMHash{}
 An {\em equality expression} is either a relational expression (\ref{relationalExpressions}), or an invocation of an equality operator on either \SUPER{} or an expression $e_1$, with argument $e_2$.
 
 
-\LMHash{}
 Evaluation of an equality expression $ee$ of the form \code{$e_1$ == $e_2$} proceeds as follows:
 \begin{itemize}
 \item The expression $e_1$ is evaluated to an object $o_1$.
@@ -4291,7 +3836,6 @@
 \end{itemize}
 
 
-\LMHash{}
 Evaluation of an equality expression $ee$ of the form \code{\SUPER{} == $e$} proceeds as follows:
 \begin{itemize}
 \item The expression $e$ is evaluated to an object $o$.
@@ -4306,7 +3850,6 @@
 Another implication is that there is never a need to use \code{identical()} to test against \NULL{}, nor should anyone ever worry about whether to write \NULL{} == $e$ or $e$ == \NULL{}. 
 }
 
-\LMHash{}
 An equality expression of the form \code{$e_1$ != $e_2$}  is equivalent to the expression \code{!($e_1$ == $e_2$)}. An equality expression of the form \code{\SUPER{} != $e$} is equivalent to the expression \code{!(\SUPER{} == $e$)}.
 
 
@@ -4314,14 +3857,12 @@
  %The expression $e_1$ is evaluated to an object $o_1$; then the expression $e_2$ is evaluated to an object $o_2$.  Next, if $o_1$ and $o_2$ are the same object, then $ee$ evaluates to \TRUE{}, otherwise $ee$ evaluates to \FALSE{}. 
  
 
-\LMHash{}
  The static type of an equality expression is \code{bool}.
  
  
 \subsection{ Relational Expressions}
-\LMLabel{relationalExpressions}
+\label{relationalExpressions}
 
-\LMHash{}
 Relational expressions invoke the relational operators on objects.
 
  \begin{grammar}
@@ -4337,16 +3878,13 @@
     .
  \end{grammar}
  
-\LMHash{}
 A {\em relational expression} is either a bitwise expression (\ref{bitwiseExpressions}), or an invocation of a relational operator on either \SUPER{} or an expression $e_1$, with argument $e_2$.
  
-\LMHash{}
 A relational expression of the form  $e_1$ $op$ $e_2$ is equivalent to the method invocation \code{$e_1$.$op$($e_2$)}. A relational expression of the form  \SUPER{} $op$ $e_2$ is equivalent to the method invocation \code{\SUPER{}.$op$($e_2$)}. 
 
 \subsection{ Bitwise Expressions}
-\LMLabel{bitwiseExpressions}
+\label{bitwiseExpressions}
 
-\LMHash{}
 Bitwise expressions invoke the bitwise operators on objects.
 
  \begin{grammar}
@@ -4368,10 +3906,8 @@
     .
  \end{grammar}
  
-\LMHash{}
 A {\em bitwise expression} is either a shift expression (\ref{shift}), or an invocation of a bitwise operator on either \SUPER{} or an expression $e_1$, with argument $e_2$.
  
-\LMHash{}
  A bitwise expression of the form  $e_1$ $op$ $e_2$ is equivalent to the method invocation $e_1.op(e_2)$.
 A bitwise expression of the form  \code{\SUPER{} $op$ $e_2$} is equivalent to the method invocation \code{\SUPER{}.op($e_2$)}.
 
@@ -4381,9 +3917,8 @@
 
  
 \subsection{ Shift}
-\LMLabel{shift}
+\label{shift}
 
-\LMHash{}
 Shift expressions invoke the shift operators on objects.
 
  \begin{grammar}
@@ -4396,10 +3931,8 @@
     .
  \end{grammar}
  
-\LMHash{}
 A {\em shift expression} is either an additive expression (\ref{additiveExpressions}), or an invocation of a shift operator on either \SUPER{} or an expression $e_1$, with argument $e_2$.
  
-\LMHash{}
  A shift expression of the form  $e_1$ $op$ $e_2$ is equivalent to the method invocation \code{$e_1$.$op$($e_2$)}. A shift expression of the form  \SUPER{} $op$ $e_2$ is equivalent to the method invocation \code{\SUPER{}.$op$($e_2$)}. 
 
 \commentary{
@@ -4412,9 +3945,8 @@
 }
      
  \subsection{ Additive Expressions}
-\LMLabel{additiveExpressions}
+\label{additiveExpressions}
 
-\LMHash{}
 Additive expressions invoke the addition operators on objects.
 
  \begin{grammar}
@@ -4427,20 +3959,16 @@
     .
  \end{grammar}
  
-\LMHash{}
 An {\em additive expression} is either a multiplicative expression (\ref{multiplicativeExpressions}), or an invocation of an additive operator on either \SUPER{} or an expression $e_1$, with argument $e_2$.
 
-\LMHash{}
 An additive expression of the form  $e_1$ $op$ $e_2$ is equivalent to the method invocation \code{$e_1$.$op$($e_2$)}. An additive expression of the form  \SUPER{} $op$ $e_2$ is equivalent to the method invocation \code{\SUPER{}.$op$($e_2$)}. 
 
-\LMHash{}
 The static type of an additive expression is usually determined by the signature given in the declaration of the operator used. However, invocations of the operators \cd{+}  and \cd{-} of class \cd{int} are treated specially by the typechecker. The static type of an expression $e_1 + e_2$ where $e_1$ has static type \cd{int} is \cd{int} if the static type of $e_2$ is \cd{int}, and \cd{double} if the static type of $e_2$ is \cd{double}. The static type of an expression $e_1 - e_2$ where $e_1$ has static type \cd{int} is \cd{int} if the static type of $e_2$ is \cd{int}, and \cd{double} if the static type of $e_2$ is \cd{double}.
  
  
 \subsection{ Multiplicative Expressions}
-\LMLabel{multiplicativeExpressions}
+\label{multiplicativeExpressions}
 
-\LMHash{}
 Multiplicative expressions invoke the multiplication operators on objects.
 
  \begin{grammar}
@@ -4456,19 +3984,15 @@
     
  \end{grammar}
     
-\LMHash{}
  A {\em multiplicative expression} is either a unary expression (\ref{unaryExpressions}), or an invocation of a multiplicative operator on either \SUPER{} or an expression $e_1$, with argument $e_2$.
  
-\LMHash{}
  A multiplicative expression of the form  $e_1$ $op$ $e_2$ is equivalent to the method invocation \code{$e_1$.$op$($e_2$)}. A multiplicative expression of the form  \SUPER{} $op$ $e_2$ is equivalent to the method invocation \code{\SUPER{}.$op$($e_2$)}.   
  
-\LMHash{}
 The static type of an multiplicative expression is usually determined by the signature given in the declaration of the operator used. However, invocations of the operators \cd{*}, \cd{\%}  and \cd{\~{}/} of class \cd{int} are treated specially by the typechecker. The static type of an expression $e_1 * e_2$ where $e_1$ has static type \cd{int} is \cd{int} if the static type of $e_2$ is \cd{int}, and \cd{double} if the static type of $e_2$ is \cd{double}. The static type of an expression $e_1 \% e_2$ where $e_1$ has static type \cd{int} is \cd{int} if the static type of $e_2$ is \cd{int}, and \cd{double} if the static type of $e_2$ is \cd{double}.  The static type of an expression \cd{$e_1$ \~{}/ $e_2$} where $e_1$ has static type \cd{int} is \cd{int} if the static type of $e_2$ is \cd{int}.
  
 \subsection{ Unary Expressions}
-\LMLabel{unaryExpressions}
+\label{unaryExpressions}
 
-\LMHash{}
 Unary expressions invoke unary operators on objects.
 
 \begin{grammar}
@@ -4497,24 +4021,19 @@
     
 \end{grammar}
 
-\LMHash{}
 A {\em unary expression} is either a postfix expression  (\ref{postfixExpressions}), an await expression (\ref{awaitExpressions}) or an invocation of a prefix operator on an expression or an invocation of a unary operator on either \SUPER{} or an expression $e$.
 
-\LMHash{}
 The expression $!e$ is equivalent to the expression $e?$ $ \FALSE{} :\TRUE{}$. 
 
-\LMHash{}
 Evaluation of an expression of the form \code{++$e$} is equivalent to \code{$e$ += 1}.  Evaluation of an expression of the form \code{-{}-$e$} is equivalent to \code{$e$ -= 1}. 
 
 %The expression $-e$ is equivalent to the method invocation \code{$e$.-()}.  The expression \code{-\SUPER{}} is equivalent  to the method invocation \code{\SUPER{}.-()}.
 
-\LMHash{}
 An expression of the form \code{$op$ $e$} is equivalent to the method invocation \code{$e.op()$}. An expression of the form \code{$op$ \SUPER{}} is equivalent to the method invocation  (\ref{superInvocation}) \code{\SUPER{}.$op()$}.
 
 \subsection{ Await Expressions}
-\LMLabel{awaitExpressions}
+\label{awaitExpressions}
 
-\LMHash{}
 An {\em await expression} allows code to yield control until an asynchronous operation (\ref{functions}) completes. 
 
  \begin{grammar}
@@ -4522,14 +4041,11 @@
       \AWAIT{} unaryExpression
  \end{grammar}
 
-\LMHash{}
 Evaluation of an await expression $a$ of the form \AWAIT{} $e$ proceeds as follows:
 First, the expression $e$ is evaluated. Next:
 
-\LMHash{}
 If $e$ raises an exception $x$, then an instance $f$ of class \code{Future} is allocated and later completed with $x$. Otherwise, if $e$ evaluates to an object $o$ that is not an instance of \code{Future}, then let $f$ be the result of calling \code{Future.value()} with $o$ as its argument; otherwise let $f$ be the result of evaluating $e$. 
 
-\LMHash{}
 Next,  execution of the function $m$ immediately enclosing $a$ is suspended until after $f$ completes. The stream associated with the innermost enclosing asynchronous for loop (\ref{asynchronousFor-in}), if any, is paused. At some time after $f$ is completed, control returns to the current invocation. The stream associated with the innermost enclosing asynchronous for loop  (\ref{asynchronousFor-in}), if any, is resumed. If $f$ has completed with an exception $x$, $a$ raises $x$. If $f$ completes with a value $v$, $a$ evaluates to $v$.
 
 %Otherwise, the value of $a$ is the value of $e$. If evaluation of $e$ raises an exception $x$, $a$ raises $x$.
@@ -4546,7 +4062,6 @@
 It is not a static warning if the type of $e$ is not a subtype of \code{Future}. Tools may choose to give a hint in such cases.
 }
 
-\LMHash{}
 Let $flatten(T) = flatten(S)$ if $T = Future<S>$, and $T$ otherwise. The static type of $a$ is $flatten(T)$ where $T$ is the static type of $e$.
 
 \rationale{
@@ -4557,9 +4072,8 @@
 
      
 \subsection{ Postfix Expressions}
-\LMLabel{postfixExpressions}
+\label{postfixExpressions}
 
-\LMHash{}
 Postfix expressions invoke the postfix operators on objects.
 
  \begin{grammar}
@@ -4581,55 +4095,45 @@
         
  \end{grammar}
  
-\LMHash{}
  A {\em postfix expression} is either a primary expression, a function, method or getter invocation, or an invocation of a postfix operator on an expression $e$.
 
-\LMHash{}
 A postfix expression of the form \code{$v$++}, where $v$ is an identifier, is equivalent to \code{()\{var r = $v$; $v$ = r + 1; return r\}()}.
 
 \rationale{The above ensures that if $v$ is a field, the getter gets called exactly once. Likewise in the cases below. 
 }
 
-\LMHash{}
 A postfix expression of the form \code{$C.v$ ++} is equivalent to 
 
 \code{()\{var r = $C.v$; $C.v$ = r + 1; return r\}()}.
 
-\LMHash{}
 A postfix expression of the form \code{$e_1.v$++} is equivalent to 
 
 \code{(x)\{var r = x.v; x.v = r + 1; \RETURN{} r\}($e_1$)}.
 
-\LMHash{}
 A postfix expression of the form \code{$e_1[e_2]$++},  is equivalent to 
 
 \code{(a, i)\{var r = a[i]; a[i] = r + 1; return r\}($e_1$, $e_2$)}.
 
-\LMHash{}
 A postfix expression of the form \code{$v$-{}-}, where $v$ is an identifier, is equivalent to 
 
 \code{()\{var r = $v$; $v$ = r - 1; return r\}()}.
 
-\LMHash{}
 A postfix expression of the form \code{$C.v$-{}-} is equivalent to 
 
 \code{()\{var r = $C.v$; $C.v$ = r - 1; return r\}()}.
 
-\LMHash{}
 A postfix expression of the form \code{$e_1.v$-{}-} is equivalent to 
 
 \code{(x)\{var r = x.v; x.v = r - 1; \RETURN{} r\}($e_1$)}.
 
-\LMHash{}
 A postfix expression of the form \code{$e_1[e_2]$-{}-},  is equivalent to 
 
 \code{(a, i)\{var r = a[i]; a[i] = r - 1; return r\}($e_1$, $e_2$)}.
  
 
 \subsection{ Assignable Expressions}
-\LMLabel{assignableExpressions}
+\label{assignableExpressions}
 
-\LMHash{}
 Assignable expressions are expressions that can appear on the left hand side of an assignment.
 This section describes how to evaluate these expressions when they do not constitute the complete left hand side of an assignment.
 
@@ -4652,7 +4156,6 @@
 
 \end{grammar}
 
-\LMHash{}
 An {\em assignable expression} is either:
 \begin{itemize}
  \item An identifier. 
@@ -4661,27 +4164,21 @@
 \end{itemize}
 
 
-\LMHash{}
 An assignable expression of the form $id$ is evaluated as an identifier expression (\ref{identifierReference}).
 
 %An assignable expression of the form $e.id(a_1, \ldots, a_n)$ is evaluated as a method invocation (\ref{methodInvocation}).
 
-\LMHash{}
 An assignable expression of the form $e.id$ is evaluated as a property extraction  (\ref{propertyExtraction}).
 
-\LMHash{}
 An assignable expression of the form \code{$e_1$[$e_2$]} is evaluated as a method invocation of the operator method \code{[]} on $e_1$ with argument $e_2$.
 
-\LMHash{}
 An assignable expression of the form \code{\SUPER{}.id}  is evaluated as a property extraction.
 
-\LMHash{}
 An assignable expression of the form \code{\SUPER{}[$e_2$]} is equivalent to the method invocation  \code{\SUPER{}.[]($e_2$)}.
 
 \subsection{ Identifier Reference}
-\LMLabel{identifierReference}
+\label{identifierReference}
 
-\LMHash{}
 An {\em identifier expression} consists of a single identifier; it provides access to an object via an unqualified name.
 
 \begin{grammar}
@@ -4740,25 +4237,21 @@
       . 
 \end{grammar}
 
-\LMHash{}
 A built-in identifier is one of the identifiers produced by the production {\em BUILT\_IN\_IDENTIFIER}. It is a compile-time error if a built-in identifier is used as the declared name of a prefix, class, type parameter or type alias. It is a compile-time error to use a built-in identifier other than \DYNAMIC{} as a type annotation or type parameter.
 
 \rationale{
 Built-in identifiers are identifiers that are used as keywords in Dart, but are not reserved words in Javascript. To minimize incompatibilities when porting Javascript code to Dart, we do not make these into reserved words. A built-in identifier may not be used to name a class or type. In other words, they are treated as reserved words when used as types.  This eliminates many confusing situations without causing compatibility problems. After all, a Javascript program has no type declarations or annotations so no clash can occur.  Furthermore, types should begin with an uppercase letter (see the appendix) and so no clash should occur in any Dart user program anyway.
 }
 
-\LMHash{}
 It is a compile-time error if any of the identifiers \ASYNC, \AWAIT{} or \YIELD{} is used as an identifier in a function body marked with either \ASYNC{}, \ASYNC* or \SYNC*.
 
 \rationale{
 For compatibility reasons, new constructs cannot  rely upon new reserved words or even built-in identifiers. However, the constructs above are only usable in contexts that require special markers introduced concurrently with these constructs, so no old code could use them. Hence the restriction, which treats these names as reserved words in a limited context.
 }
 
-\LMHash{}
 Evaluation of an identifier expression $e$ of the form $id$ proceeds as follows:
 
 
-\LMHash{}
 Let $d$ be the innermost declaration in the enclosing lexical scope whose name is $id$ or $id=$.  If no such declaration exists in the lexical scope, let $d$ be the declaration of the inherited member named $id$ if it exists. 
 %If no such member exists, let $d$ be the declaration of the static member name $id$ declared in a superclass of the current class, if it exists.
 
@@ -4785,7 +4278,6 @@
 % This implies that referring to an undefined static getter by simple name is an error, whereas doing so by qualified name is only a warning. Same with assignments.  Revise?
 \end{itemize}
 
-\LMHash{}
 The static type of $e$ is determined as follows:
 
 \begin{itemize}
@@ -4804,13 +4296,11 @@
  This prevents situations where one uses uncorrelated setters and getters. The intent is to prevent errors when a  getter in a surrounding scope is used accidentally.
  }
  
-\LMHash{}
 It is a static warning if an identifier expression $id$ occurs inside a top level or static function (be it function, method, getter, or setter) or variable initializer and there is no declaration $d$ with name $id$ in the lexical scope enclosing the expression.
 
 \subsection{ Type Test}
-\LMLabel{typeTest}
+\label{typeTest}
 
-\LMHash{}
 The {\em is-expression} tests if an object is a member of a type.
 
  \begin{grammar}
@@ -4824,10 +4314,8 @@
     .
  \end{grammar}
  
-\LMHash{}
  Evaluation of the is-expression \code{$e$ \IS{} $T$} proceeds as follows:
 
-\LMHash{}
 The expression $e$ is evaluated to a value $v$. Then, if $T$ is a malformed or deferred type (\ref{staticTypes}), a dynamic error occurs. Otherwise, if the interface of the class of $v$ is a subtype of $T$, the is-expression evaluates to \TRUE. Otherwise it evaluates to \FALSE.
 
 \commentary{It follows that \code{$e$ \IS{} Object} is always true. This makes sense in a language where everything is an object. 
@@ -4835,13 +4323,11 @@
 Also note that \code{\NULL{} \IS{} $T$} is false unless $T = \code{Object}$, $T = \code{\DYNAMIC{}}$ or $T = \code{Null}$.  The former two are useless, as is anything of the form \code{$e$ \IS{} Object} or \code{$e$ \IS{} \DYNAMIC{}}.  Users should test for a null value directly rather than via type tests.
 }
 
-\LMHash{}
 The is-expression \code{$e$ \IS{}! $T$} is equivalent to \code{!($e$ \IS{} $T$)}.
 
 % Add flow dependent types
 
 
-\LMHash{}
 Let $v$  be a local variable or a formal parameter. An is-expression of the form \code{$v$ \IS{} $T$} shows that $v$  has type $T$ iff $T$ is more specific than the type $S$ of the expression $v$ and  both $T \ne \DYNAMIC{}$ and $S \ne \DYNAMIC{}$.
 
 \rationale{
@@ -4854,14 +4340,12 @@
 We do not want to refine the type of a variable of type \DYNAMIC{}, as this could lead to more warnings rather than less.  The opposite requirement, that $T \ne \DYNAMIC{}$ is a safeguard lest $S$ ever be $\bot$.
 }
 
-\LMHash{}
 The static type of an is-expression is \code{bool}. 
 
 
 \subsection{ Type Cast}
-\LMLabel{typeCast}
+\label{typeCast}
 
-\LMHash{}
 The {\em cast expression} ensures that an object is a member of a type.
 
  \begin{grammar}
@@ -4875,19 +4359,16 @@
     .
  \end{grammar}
  
-\LMHash{}
  Evaluation of the cast expression \code{$e$ \AS{} $T$} proceeds as follows:
 
-\LMHash{}
 The expression $e$ is evaluated to a value $v$. Then, if $T$ is a malformed or deferred type (\ref{staticTypes}), a dynamic error occurs. Otherwise, if the interface of the class of $v$ is a subtype of $T$, the cast expression evaluates to $v$. Otherwise, if $v$ is \NULL{}, the cast expression evaluates to $v$. 
 In all other cases,  a \code{CastError} is thrown.
  
-\LMHash{}
 The static type of a cast expression  \code{$e$ \AS{} $T$}  is $T$. 
 
 
 \section{Statements}
-\LMLabel{statements}
+\label{statements}
 
  \begin{grammar}
 {\bf statements:}
@@ -4920,26 +4401,21 @@
  \end{grammar}
  
  \subsection{Blocks}
- \LMLabel{blocks}
+ \label{blocks}
  
-\LMHash{}
  A {\em block statement} supports sequencing of code.
 
-\LMHash{}
 Execution of a block statement $\{s_1, \ldots,  s_n\}$ proceeds as follows:
 
-\LMHash{}
 For $i \in 1 .. n, s_i$ is executed.
 
-\LMHash{}
 A block statement introduces a new scope, which is nested in the lexically enclosing scope in which the block statement appears.
 
 
 
  \subsection{Expression Statements}
- \LMLabel{expressionStatements}
+ \label{expressionStatements}
  
-\LMHash{}
 An {\em expression statement} consists of an expression other than a non-constant map literal (\ref{maps}) that has no explicit type arguments. 
 
 \rationale{
@@ -4952,17 +4428,14 @@
   .
  \end{grammar}
  
-\LMHash{}
 Execution of an expression statement \code{$e$;} proceeds by evaluating $e$. 
 
-\LMHash{}
 It is a compile-time error if a non-constant map literal that has no explicit type arguments appears in a place where a statement is expected.
 
 \subsection{Local Variable Declaration}
-\LMLabel{localVariableDeclaration}
+\label{localVariableDeclaration}
 
 
-\LMHash{}
 A {\em variable declaration statement }declares a new local variable.
 
  \begin{grammar}
@@ -4971,13 +4444,10 @@
   .
  \end{grammar}
  
-\LMHash{}
  Executing a variable declaration statement of one of the forms  \VAR{} $v = e;$, $T$ $v = e; $, \CONST{}  $v = e;$, \CONST{} $T$ $v = e;$, \FINAL{}  $v = e;$ or \FINAL{} $T$ $v = e;$ proceeds as follows:
  
-\LMHash{}
  The expression $e$ is evaluated to an object $o$. Then, the variable $v$ is set to $o$.
  
-\LMHash{}
  A variable declaration statement of the form \VAR{} $v;$ is equivalent to \VAR{} $v = \NULL{};$. A variable declaration statement of the form $T$ $v;$ is equivalent to $T$ $v = \NULL{};$. 
 
 \commentary{
@@ -5002,9 +4472,9 @@
 
 
 \subsection{Local Function Declaration}
-\LMLabel{localFunctionDeclaration}
 
-\LMHash{}
+\label{localFunctionDeclaration}
+
 A function declaration statement declares a new local function (\ref{functionDeclarations}). 
 
  \begin{grammar}
@@ -5013,7 +4483,6 @@
   .
  \end{grammar}
  
-\LMHash{}
 A function declaration statement of one of the forms $id$ $signature$ $\{ statements \}$ or $T$ $id$ $signature$ $\{ statements \}$ causes a new function named $id$ to be added to the innermost enclosing scope. It is a compile-time error to reference a local function before its declaration. 
 
 
@@ -5057,9 +4526,8 @@
 % elaborate on function identity and equality, runtime type. Likewsie in function expressions (closures) and declarations
 
 \subsection{If}
-\LMLabel{if}
+\label{if}
 
-\LMHash{}
 The {\em if statement} allows for conditional execution of statements.
 
 \begin{grammar}
@@ -5070,7 +4538,6 @@
  
 Execution of an if statement of the form  \code {\IF{} (}$b$\code{)}$s_1$ \code{\ELSE{} } $s_2$ proceeds as follows:
  
-\LMHash{}
  First, the expression $b$ is evaluated to an object $o$. Then, $o$ is  subjected to boolean conversion (\ref{booleanConversion}), producing an object $r$. If $r$ is \TRUE{}, then the statement $\{s_1\}$ is executed, otherwise statement $\{s_2\}$ is executed.
 
  
@@ -5094,10 +4561,8 @@
 Under reasonable scope rules  such code is problematic. If we assume that \code{v} is declared in the scope of the method \code{main()}, then when \code{somePredicate} is false, \code{v} will be uninitialized when accessed.  The cleanest approach would be to require a block following the test, rather than an arbitrary statement. However, this goes against long standing custom, undermining Dart's goal of familiarity.  Instead, we choose to insert a block, introducing a scope,  around the statement following the predicate (and similarly for \ELSE{} and loops). This will cause both a warning and a runtime error in the case above.  Of course, if there is a declaration of \code{v} in the surrounding scope, programmers might still be surprised. We expect tools to highlight cases of shadowing to help avoid such situations.
  }
  
-\LMHash{}
   It is a static type warning if the type of the expression $b$ may not be assigned to \code{bool}.  
   
-\LMHash{}
 If:
 \begin{itemize}
 \item  $b$ shows that a variable $v$ has type $T$.
@@ -5106,7 +4571,6 @@
 \end{itemize}
 then the type of $v$ is known to be $T$ in $s_1$.  
 
-\LMHash{}
  An if statement of the form  \code {\IF{} (}$b$\code{)}$s_1$ is equivalent to the if statement  
  
  \code {\IF{} (}$b$\code{)}$s_1$ \code{\ELSE{} \{\}}.
@@ -5114,9 +4578,8 @@
 
     
 \subsection{For}
-\LMLabel{for}
+\label{for}
 
-\LMHash{}
 The {\em for statement} supports iteration.
 
 \begin{grammar}
@@ -5134,20 +4597,16 @@
     .
  \end{grammar}
  
-\LMHash{}
  The for statement has three forms - the traditional for loop and two forms of the for-in statement - synchronous and asynchronous.
 
 \subsubsection{For Loop}
-\LMLabel{forLoop}
+\label{forLoop}
 
 
-\LMHash{}
 Execution of a for statement of the form   \code{ \FOR{} (\VAR{} $v = e_0$ ; $c$; $e$) $s$} proceeds as follows:
 
-\LMHash{}
 If $c$ is empty then let $c^\prime$ be \TRUE{} otherwise let  $c^\prime$ be $c$.
 
-\LMHash{}
 First the variable declaration statement \VAR{} $v = e_0$ is executed. Then:
 \begin{enumerate}
 \item
@@ -5173,7 +4632,6 @@
 Instead, each iteration has its own distinct variable.  The first iteration uses the variable created by the initial declaration. The expression executed at the end of each iteration uses a fresh variable $v^{\prime\prime}$, bound to the value of the current iteration variable, and then modifies $v^{\prime\prime}$ as required for the next iteration.
 }
 
-\LMHash{}
 It is a static warning if the static type of $c$ may not be assigned to \cd{bool}.
 
 %A for statement of the form \code{ \FOR{} ($d$ ; $c$; $e$) $s$} is equivalent to the the following code:
@@ -5189,9 +4647,8 @@
 %If $c$ is empty, it is interpreted as \TRUE{}.
 
 \subsubsection{For-in}
-\LMLabel{for-in}
+\label{for-in}
 
-\LMHash{}
 A for statement of the form \code{ \FOR{} ($finalConstVarOrType?$ id \IN{} $e$) $s$} is equivalent to the following code: 
 
 \begin{dartCode}
@@ -5208,37 +4665,30 @@
 }
  
 \subsubsection{Asynchronous For-in}
-\LMLabel{asynchronousFor-in}
+\label{asynchronousFor-in}
 
-\LMHash{}
 A for-in statement may be asynchronous. The asynchronous form is designed to iterate over streams. An asynchronous for loop is distinguished by the keyword \AWAIT{} immediately preceding the keyword \FOR.
 
-\LMHash{}
 Execution of a for-in statement of the form  \code{\AWAIT{} \FOR{} (finalConstVarOrType? id \IN{} $e$) $s$} proceeds as follows:
 
-\LMHash{}
 The expression $e$ is evaluated to an object $o$. It is a dynamic error if $o$ is not an instance of a class that implements \code{Stream}. Otherwise, the expression \code{\AWAIT{} $v_f$}  (\ref{awaitExpressions}) is evaluated, where $v_f$ is a fresh variable whose value is a fresh instance (\ref{generativeConstructors}) $f$ implementing the built-in class \code{Future}.
 
-\LMHash{}
 The stream $o$ is listened to,  and on each data event in $o$ the statement $s$ is executed with \code{id} bound to the value of the current element of the stream. If $s$ raises an exception, or if $o$ raises an exception, then $f$ is completed with that exception. Otherwise, when all events in the stream $o$ have been processed, $f$ is completed with \NULL{}  (\ref{null}).
 
-\LMHash{}
 Let $u$ be the stream associated with the immediately enclosing asynchronous for loop or generator function (\ref{functions}), if any. If another event $e_u$ of $u$ occurs before execution of $s$ is complete, handling of $e_u$ must wait until $s$ is complete.
 
 \rationale{
 The future $f$ and the corresponding \AWAIT{} expression ensure that execution suspends as an asynchronous for loop begins and resumes after the \FOR{} statement when it ends. They also ensure that the stream of any enclosing asynchronous \FOR{} loop is paused for the duration of this loop.
 }
 
-\LMHash{}
 It is a compile-time error if an asynchronous for-in statement appears inside a synchronous function (\ref{functions}). It is a compile-time error if a traditional for loop  (\ref{forLoop}) is prefixed by the \AWAIT{}  keyword.
 
 \rationale{An asynchronous loop would make no sense within a synchronous function, for the same reasons that an await expression makes no sense in a synchronous function.}
 
  
 \subsection{While}
-\LMLabel{while}
+\label{while}
 
-\LMHash{}
 The while statement supports conditional iteration, where the condition is evaluated prior to the loop.
 
 \begin{grammar}
@@ -5247,20 +4697,16 @@
 .
  \end{grammar}
  
-\LMHash{}
  Execution of a while statement of the form \code{\WHILE{} ($e$) $s$;} proceeds as follows: 
 
-\LMHash{}
 The expression $e$ is evaluated to an object $o$. Then, $o$ is  subjected to boolean conversion (\ref{booleanConversion}), producing an object $r$.  If $r$ is \TRUE{}, then the statement $\{s\}$ is executed and then the while statement is re-executed recursively. If $r$ is \FALSE{}, execution of the while statement is complete.
 
-\LMHash{}
 It is a static type warning if the static type of $e$ may not be assigned to \code{bool}.
     
 
 \subsection{Do}
-\LMLabel{do}
+\label{do}
 
-\LMHash{}
 The do statement supports conditional iteration, where the condition is evaluated after the loop.
 
 \begin{grammar}
@@ -5270,19 +4716,15 @@
  \end{grammar}
 
     
-\LMHash{}
 Execution of a do statement of the form \code{\DO{} $s$ \WHILE{} ($e$);} proceeds as follows: 
 
-\LMHash{}
 The statement $\{s\}$ is executed. Then, the expression $e$ is evaluated to an object $o$. Then, $o$ is  subjected to boolean conversion (\ref{booleanConversion}), producing an object $r$. If $r$ is \FALSE{}, execution of the do statement is complete. If $r$ is \TRUE{}, then the do statement is re-executed recursively. 
 
-\LMHash{}
 It is a static type warning if the static type of $e$ may not be assigned to \code{bool}. 
 
 \subsection{Switch}
-\LMLabel{switch}
+\label{switch}
 
-\LMHash{}
 The {\em switch statement} supports dispatching control among a large number of cases.
 
  \begin{grammar}
@@ -5300,7 +4742,6 @@
     .
  \end{grammar}
  
-\LMHash{}
  Given a switch statement of the form 
  
 \begin{dartCode}
@@ -5332,7 +4773,6 @@
 \commentary{In other words,  all the expressions in the cases evaluate to constants of the exact same user defined class or are of certain known types.  Note that the values of the expressions are known at compile-time, and are independent of any static type annotations.
 }
 
-\LMHash{}
 It is a compile-time error if the class $C$ has an implementation of the operator $==$ other than the one inherited from \code{Object} unless the value of the expression is a string, an integer, literal symbol or the result of invoking a constant constructor of class \cd{Symbol}.
  
  \rationale{
@@ -5344,7 +4784,6 @@
 The \SWITCH{}  statement should only be used in very limited situations (e.g., interpreters or scanners).  
 }
 
-\LMHash{}
 Execution of a switch statement of the form
 
 \begin{dartCode}
@@ -5368,18 +4807,14 @@
 
 proceeds as follows:
 
-\LMHash{}
 The statement \code{\VAR{} id = $e$;} is evaluated, where \code{id} is a variable whose name is distinct from any other variable in the program. In checked mode, it is a run time error if the value of $e$ is not an instance of the same class as the constants $e_1 \ldots e_n$. 
 
 \commentary{Note that if there are no case clauses ($n = 0$), the type of $e$ does not matter.}
 
-\LMHash{}
 Next, the case clause \CASE{} $e_{1}: s_{1}$ is executed if it exists. If \CASE{} $e_{1}: s_{1}$ does not exist, then if there is a  \DEFAULT{} clause it is executed by executing $s_{n+1}$.
 
-\LMHash{}
 A case clause introduces a new scope, nested in the lexically surrounding scope. The scope of a case clause ends immediately after the case clause's statement list.
 
-\LMHash{}
 Execution of a \CASE{} clause \CASE{} $e_{k}: s_{k}$ of a  switch statement  
 
 \begin{dartCode}
@@ -5393,13 +4828,11 @@
 
 proceeds as follows:
 
-\LMHash{}
 The expression \code{$e_k$ == id} is evaluated to an object $o$ which is then subjected to boolean conversion yielding a value $v$. 
 If $v$ is not  \TRUE{} the following case,  \CASE{} $e_{k+1}: s_{k+1}$ is executed if it exists. If  \CASE{} $e_{k+1}: s_{k+1}$ does not exist, then the \DEFAULT{} clause is executed by executing $s_{n+1}$.
 If $v$ is \TRUE{},   let $h$ be the smallest number such that $h \ge k$ and $s_h$ is non-empty. If no such $h$ exists, let $h = n + 1$. The  sequence of statements $s_h$ is then executed.
 If execution reaches the point after $s_h$  then  a runtime error occurs, unless $h = n+1$.
 
-\LMHash{}
 Execution of a \CASE{} clause \CASE{} $e_{k}: s_{k}$ of a  switch statement  
 
 \begin{dartCode}
@@ -5412,7 +4845,6 @@
 
 proceeds as follows:
 
-\LMHash{}
 The expression \code{$e_k$ == id} is evaluated to an object $o$ which is then subjected to boolean conversion yielding a value $v$. 
 If $v$ is not  \TRUE{} the following case,  \CASE{} $e_{k+1}: s_{k+1}$ is executed if it exists. 
 If $v$ is \TRUE{},   let $h$ be the smallest integer such that $h \ge k$ and $s_h$ is non-empty. The  sequence of statements $s_h$ is  executed if it exists.
@@ -5423,7 +4855,6 @@
 In other words, there is no implicit fall-through between cases. The last case in a switch (default or otherwise) can `fall-through' to the end of the statement.
 }
 
-\LMHash{}
 It is a static warning if the type of $e$ may not be assigned to the type of $e_k$. It is a static warning if the last statement of the statement sequence $s_k$ is not a \BREAK{}, \CONTINUE{}, \RETURN{} or \THROW{} statement.
 
 \rationale{
@@ -5442,7 +4873,6 @@
   Very elaborate code in a case clause is probably bad style in any case, and such code can always be refactored.
 }
  
-\LMHash{}
  It is a static warning if all of the following conditions hold:
  \begin{itemize}
 \item  The switch statement does not have a default clause.
@@ -5456,10 +4886,9 @@
 
  
 \subsection{ Rethrow}
-\LMLabel{rethrow}
+\label{rethrow}
 
 
-\LMHash{}
 The {\em rethrow statement}  is used to re-raise an exception.
 
  \begin{grammar}
@@ -5468,40 +4897,33 @@
     .
  \end{grammar}
  
-\LMHash{}
 Execution of a \code{\RETHROW{}} statement proceeds as follows:
 
-\LMHash{}
 Let $f$ be the immediately enclosing function, and let \code{\ON{} $T$ \CATCH{} ($p_1$, $p_2$)}  be the immediately enclosing catch clause (\ref{try}).
 
 \rationale{
 A \RETHROW{} statement always appears inside a \CATCH{} clause, and any \CATCH{} clause is semantically equivalent to some \CATCH{} clause of the form \code{\ON{} $T$ \CATCH{} (p1, p2)}.  So we can assume that the \RETHROW{} is enclosed in a \CATCH{} clause of that form.
 }
 
-\LMHash{}
 The current exception (\ref{throw}) is set to $p_1$, the current return value (\ref{return}) becomes undefined, and the active stack trace (\ref{try}) is set to $p_2$.
 
-\LMHash{}
 If $f$ is marked \ASYNC{} or \ASYNC* (\ref{functions}) and there is a dynamically enclosing exception handler (\ref{try}) $h$ introduced by the current activation, control is transferred to $h$, otherwise $f$  terminates.
 
 \rationale{
 In the case of an asynchronous function, the dynamically enclosing exception handler is only relevant within the function. If an exception is not caught within the function, the exception value is channelled through a future or stream rather than propagating via exception handlers.
 }
 
-\LMHash{}
 Otherwise, control is transferred to the  innermost enclosing exception handler.
 
 \commentary{The change in control may result in multiple functions terminating if these functions do not catch the exception via a \CATCH{} or \FINALLY{} clause, both of which introduce a dynamically enclosing exception handler.}
 
-\LMHash{}
 It is a compile-time error if a  \code{\RETHROW{}} statement is not enclosed within an \ON-\CATCH{} clause. 
 
 
 
 \subsection{ Try}
-\LMLabel{try}
+\label{try}
 
-\LMHash{}
 The try statement supports the definition of exception handling code in a structured way.
 
 \begin{grammar}
@@ -5522,7 +4944,6 @@
     .
  \end{grammar}
  
-\LMHash{}
  A try statement consists of a block statement, followed by at least one of:
  \begin{enumerate}
  \item
@@ -5535,28 +4956,23 @@
 The syntax is designed to be upward compatible with existing Javascript programs. The \ON{} clause can be omitted, leaving what looks like a Javascript catch clause.
 }
 
-\LMHash{}
 An \ON{}-\CATCH{} clause of the form   \code{\ON{} $T$ \CATCH{} ($p_1, p_2$) $s$}  {\em matches} an object $o$  if the type of $o$ is a subtype of $T$.  If $T$ is a malformed or deferred type  (\ref{staticTypes}), then performing a match causes a run time error.
 
 \commentary {
 It is of course a static warning if $T$ is a deferred or malformed type.
 }
 
-\LMHash{}
 An \ON{}-\CATCH{} clause of the form   \code{\ON{} $T$ \CATCH{} ($p_1, p_2$) $s$} introduces a new scope $CS$ in which final local variables specified by $p_1$ and $p_2$ are defined. The statement $s$ is enclosed within $CS$. The static type of $p_1$ is $T$ and the static type of $p_2$ is \code{StackTrace}.
 
 
-\LMHash{}
 An \ON{}-\CATCH{} clause of the form  \code{\ON{} $T$ \CATCH{} ($p_1$) $s$} is equivalent to an \ON{}-\CATCH{} clause  \code{\ON{} $T$ \CATCH{} ($p_1, p_2$) $s$} where $p_2$ is an identifier that does not occur anywhere else in the program. 
 
 
-\LMHash{}
 An \ON{}-\CATCH{} clause of the form  \code{\CATCH{} ($p$) $s$} is equivalent to an \ON{}-\CATCH{} clause  \code{\ON{} \DYNAMIC{} \CATCH{} ($p$) $s$}. An \ON{}-\CATCH{} clause of the form  \code{\CATCH{} ($p_1, p_2$) $s$} is equivalent to an \ON{}-\CATCH{} clause  \code{\ON{} \DYNAMIC{} \CATCH{} ($p_1, p_2$) $s$}.
 
 
 %If an explicit type is associated with of $p_2$, it is a static warning if that type is not \code{Object} or \DYNAMIC{}.
 
-\LMHash{}
 The {\em active stack trace} is an object whose \code{toString()} method produces a string that is a record of exactly those function activations within the current isolate that had not completed execution at the point where the current exception (\ref{throw}) was thrown.
 %\begin{enumerate}
 %\item Started execution after the currently executing function.
@@ -5587,24 +5003,19 @@
  
  % A position can be represented via a Token. If we make that part of the core reflection facility, we can state this here.
 
-\LMHash{}
 A try statement \TRY{} $s_1$ $on-catch_1 \ldots  on-catch_n$ \FINALLY{} $s_f$  defines an exception handler $h$ that executes as follows:
 
-\LMHash{}
 The \ON{}-\CATCH{} clauses are examined in order, starting with $catch_1$, until either an \ON{}-\CATCH{} clause that matches the current exception (\ref{throw}) is found, or the list of \ON{}-\CATCH{} clauses has been exhausted. If an \ON{}-\CATCH{} clause $on-catch_k$ is found, then $p_{k1}$ is bound to the current exception,  $p_{k2}$, if declared,  is bound to the active stack trace, and then $catch_k$ is executed. If no \ON{}-\CATCH{} clause is found, the \FINALLY{} clause is executed. Then, execution resumes at the end of the try statement.
 
 
-\LMHash{}
 A finally clause \FINALLY{} $s$ defines an exception handler $h$ that executes as follows:
 
-\LMHash{}
 Let $r$ be the current return value (\ref{return}). Then the current return value becomes undefined. Any open streams associated with any asynchronous for loops (\ref{asynchronousFor-in}) and yield-each (\ref{yieldEach}) statements executing within the dynamic scope of $h$ are canceled. 
 
 \rationale{
 Streams left open by for loops that were escaped for whatever reason would be canceled at function termination, but it is best to cancel them as soon as possible.
 }
 
-\LMHash{}
 Then the \FINALLY{} clause is executed. Let $m$ be the immediately enclosing function. If $r$ is defined then the current return value is set to $r$ and then:
 \begin{itemize}
 \item
@@ -5615,20 +5026,15 @@
 
 Otherwise, execution resumes at the end of the try statement.
 
-\LMHash{}
 Execution of an \ON{}-\CATCH{} clause \code{\ON{} $T$ \CATCH{} ($p_1$, $p_2$)} $s$ of a try statement $t$ proceeds as follows: The statement $s$ is executed in the dynamic scope of the exception handler defined by the finally clause of $t$. Then, the current exception and active stack trace both become undefined.
 
-\LMHash{}
 Execution of a \FINALLY{} clause \FINALLY{} $s$ of a try statement proceeds as follows: 
 
-\LMHash{}
 Let $x$ be the current exception and let $t$ be the active stack trace. Then the current exception and the active stack trace both become undefined. The statement $s$ is executed. Then, if $x$ is defined,  it is rethrown as if by a rethrow statement (\ref{rethrow}) enclosed in a \CATCH{} clause of the form \code{\CATCH{} ($v_x$, $v_t$)} where $v_x$ and $v_t$ are fresh variables bound to $x$ and $t$ respectively.
 
 
-\LMHash{}
 Execution of a try statement of the form \code{\TRY{} $s_1$ $on-catch_1 \ldots on-catch_n$ \FINALLY{} $s_f$;}  proceeds as follows:
 
-\LMHash{}
 The statement $s_1$ is executed in the dynamic scope of the exception handler defined by the try statement. Then, the \FINALLY{} clause is executed.
 
 \commentary{
@@ -5643,14 +5049,12 @@
 If no exception was raised, the \FINALLY{} clause is also executed. Execution of the \FINALLY{} clause could also raise an exception, which will cause transfer of control to the next enclosing handler. 
 }
 
-\LMHash{}
 A try statement of the form \code{\TRY{} $s_1$ $on-catch_1 \ldots on-catch_n$;} is equivalent to the statement \code{\TRY{} $s_1$ $on-catch_1 \ldots on-catch_n$ \FINALLY{} $\{\}$}.
  
 
 \subsection{ Return}
-\LMLabel{return}
+\label{return}
 
-\LMHash{}
 The {\em return statement} returns a result to the caller of a synchronous function,  completes the future associated with an asynchronous function or terminates the stream or iterable associated with a generator (\ref{functions}).
 
 
@@ -5664,13 +5068,10 @@
  Due to \FINALLY{} clauses, the precise behavior of \RETURN{} is a little more involved. Whether the value a return statement is supposed to return is actually returned depends on the behavior of any \FINALLY{} clauses in effect when executing the return. A \FINALLY{} clause may choose to return another value, or throw an exception, or even redirect control flow leading to other returns or throws. All a return statement really does is set a value that is intended to be returned when the function terminates. 
  }
 
-\LMHash{}
 The {\em current return value} is a unique value specific to a given function activation. It is undefined unless explicitly set in this specification.
     
-\LMHash{}
 Executing a return statement \code{\RETURN{} $e$;} proceeds as follows:
 
-\LMHash{}
 First the expression $e$ is evaluated, producing an object $o$. Next:
 \begin{itemize}
 \item  
@@ -5686,34 +5087,28 @@
 The enclosing function cannot be marked as generator (i.e, \ASYNC* or \SYNC*), since generators are not allowed to contain a statement of the form \code{\RETURN{} $e$;} as discussed below.
 }
 
-\LMHash{}
 Let $T$ be the static type of $e$ and let $f$ be the immediately enclosing function.  
 
-\LMHash{}
 It is a static type warning if the body of $f$ is marked \ASYNC{} and the type \code{Future$<$flatten(T)$>$} (\ref{awaitExpressions}) may not be assigned to the declared return type of $f$.   Otherwise, it is a static type warning if $T$ may not be assigned to the declared return type of $f$. 
 
-\LMHash{}
 Let $S$ be the runtime type of $o$. In checked mode:
 \begin{itemize}
 \item  If the body of $f$ is marked \ASYNC{} (\ref{functions}) it is a dynamic type error if $o$ is not \NULL{} (\ref{null}) and \code{Future$<$S$>$} is not a subtype of the actual return type  (\ref{actualTypeOfADeclaration}) of $f$.
 \item Otherwise, it is a dynamic type error if $o$ is not \NULL{} and the runtime type of $o$ is not a subtype of the actual return type of $f$.
 \end{itemize}
 
-\LMHash{}
 It is a compile-time error if a return statement of the form \code{\RETURN{} $e$;} appears in a generative constructor (\ref{generativeConstructors}).
 
 \rationale{
 It is quite easy to forget to add the factory prefix for a constructor, accidentally converting a factory into a generative constructor. The static checker may detect a type mismatch in some, but not all, of these cases. The rule above helps catch such errors, which can otherwise be very hard to recognize. There is no real downside to it, as returning a value from a generative constructor is meaningless.
 }
 
-\LMHash{}
 It is a compile-time error if a return statement of the form \code{\RETURN{} $e$;} appears in a generator function.
 
 \rationale{
 In the case of a generator function, the value returned by the function is the iterable or stream associated with it, and individual elements are added to that iterable using yield statements, and so returning a value makes no sense. 
 }
 
-\LMHash{}
 Let $f$ be the function immediately enclosing a return statement of the form \RETURN{}; It is a static warning  $f$ is neither a generator nor a generative constructor and either:
 \begin{itemize}
 \item  $f$ is synchronous and the return type of $f$ may not be assigned to \VOID{} (\ref{typeVoid}) or, 
@@ -5727,10 +5122,8 @@
 
 \rationale{ An asynchronous non-generator always returns a future of some sort. If no expression is given, the future will be completed with \NULL{} and this motivates the requirement above.} \commentary{Leaving the return type of a function marked \ASYNC{}  blank will be interpreted as \DYNAMIC{} as always, and cause no type error. Using \code{Future} or \code{Future$<$Object$>$} is acceptable as well, but any other type will cause a warning, since \NULL{} has no subtypes.}
 
-\LMHash{}
 A return statement with no expression, \code{\RETURN;} is executed as follows:
 
-\LMHash{}
 If the immediately enclosing function $f$ is a generator, then:
 \begin{itemize}
 \item
@@ -5741,7 +5134,6 @@
 Otherwise, execution of the current method terminates. 
 \end{itemize}
 
-\LMHash{}
 Otherwise the return statement is executed by executing the statement  \code{\RETURN{} \NULL{};} if it occurs inside a method, getter, setter or factory; otherwise, the return statement necessarily occurs inside a generative constructor, in which case it is executed by executing  \code{\RETURN{} \THIS{};}.
 
 \commentary{Despite the fact that \code{\RETURN{};} is executed as if by a \code{\RETURN{} $e$;}, it is important to understand that it is not a static warning to include a statement of the form \code{\RETURN{};} 
@@ -5756,16 +5148,14 @@
 The question then becomes, what value should a return statement return when no return expression is given. In a generative constructor, it is obviously the object being constructed (\THIS{}). A void function is not expected to participate in an expression, which is why it is marked \VOID{} in the first place. Hence, this situation is a mistake which should be detected as soon as possible. The static rules help here, but if the code is executed, using \NULL{} leads to fast failure, which is desirable in this case. The same rationale applies for function bodies that do not contain a return statement at all.
 }
 
-\LMHash{}
 It is a static warning if a  function contains both one or more explicit return statements of the form \code{\RETURN;} and one or more return statements of the form \code{\RETURN{} $e$;}.
 
 
 
 
 \subsection{ Labels}
-\LMLabel{labels}
+\label{labels}
 
-\LMHash{}
 A {\em label} is an identifier followed by a colon. A {\em labeled statement} is a statement prefixed by a label $L$.  A {\em labeled case clause} is a case clause within a switch statement (\ref{switch}) prefixed by a label $L$.
 
 \rationale{The sole role of labels is to provide targets for the break (\ref{break}) and continue (\ref{continue}) statements.}
@@ -5778,10 +5168,8 @@
     .
  \end{grammar}
  
-\LMHash{}
  The semantics of a labeled statement $L: s$ are identical to those of the statement $s$. The namespace of labels is distinct from the one used for types, functions and variables.
 
-\LMHash{}
 The scope of a label that labels a statement $s$ is $s$. The scope of a label that labels a case clause of a switch statement $s$ is $s$.
 
 \rationale{Labels should be avoided by programmers at all costs. The motivation for including labels in the language is primarily making Dart a better target for code generation.
@@ -5789,9 +5177,8 @@
 
  
 \subsection{ Break}
-\LMLabel{break}
+\label{break}
 
-\LMHash{}
 The {\em break statement} consists of the reserved word \BREAK{} and an optional label (\ref{labels}). 
 
 \begin{grammar}
@@ -5800,18 +5187,15 @@
     .
  \end{grammar}
  
-\LMHash{}
 Let $s_b$ be a \BREAK{} statement. If $s_b$ is of the form  \code{\BREAK{} $L$;}, then let $s_E$ be the the innermost labeled statement with label $L$ enclosing $s_b$. If $s_b$ is of the form \code{\BREAK{};},  then let $s_E$ be the the innermost  \DO{} (\ref{do}), \FOR{} (\ref{for}), \SWITCH{} (\ref{switch}) or \WHILE{} (\ref{while}) statement enclosing  $s_b$. It is a compile-time error if no such statement $s_E$ exists within the innermost function in which  $s_b$ occurs.  Furthermore, let $s_1, \ldots, s_n$ be those \TRY{} statements that are both enclosed in $s_E$ and that enclose  $s_b$, and that have a \FINALLY{} clause. Lastly, let $f_j$ be the \FINALLY{} clause of $s_j, 1 \le j \le n$.   Executing  $s_b$ first executes $f_1, \ldots,  f_n$ in innermost-clause-first  order and then terminates $s_E$. 
 
-\LMHash{}
 If $s_E$ is an asynchronous for loop (\ref{asynchronousFor-in}), its associated stream subscription is canceled. Furthermore, let $a_k$ be the set of asynchronous for loops  and yield-each statements (\ref{yieldEach}) enclosing $s_b$ that are enclosed in $s_E , 1 \le k \le m$.   The stream subscriptions associated with $a_j$ are canceled, $1 \le j \le m$. 
 
 
 
 \subsection{ Continue}
-\LMLabel{continue}
+\label{continue}
 
-\LMHash{}
 The {\em continue statement} consists of the reserved word \CONTINUE{} and an optional label (\ref{labels}). 
 
 \begin{grammar}
@@ -5820,23 +5204,20 @@
         .
  \end{grammar}      
  
-\LMHash{}
  Let $s_c$ be a \CONTINUE{} statement. If $s_c$ is of the form  \code{\CONTINUE{} $L$;}, then let $s_E$ be the the innermost labeled \DO{} (\ref{do}), \FOR{} (\ref{for}) or \WHILE{} (\ref{while}) statement or case clause with label $L$ enclosing $s_c$. If $s_c$ is of the form \code{\CONTINUE{};}  then let $s_E$ be the the innermost  \DO{} (\ref{do}), \FOR{} (\ref{for}) or \WHILE{} (\ref{while}) statement enclosing  $s_c$. It is a compile-time error if no such statement or case clause $s_E$ exists within the innermost function in which  $s_c$ occurs.  Furthermore, let $s_1, \ldots, s_n$ be those \TRY{} statements that are both enclosed in $s_E$ and that enclose  $s_c$, and that have a \FINALLY{} clause. Lastly, let $f_j$ be the \FINALLY{} clause of $s_j, 1 \le j \le n$.   Executing  $s_c$ first executes $f_1, \ldots,  f_n$ in innermost-clause-first  order. Then, if $s_E$ is a case clause, control is transferred to the case clause. Otherwise, $s_E$ is necessarily a loop and execution resumes after the last statement in the loop body.
  
  \commentary{
  In a while loop, that would be the boolean expression before the body. In a do loop, it would be the boolean expression after the body. In a for loop, it would be the increment clause.  In other words, execution continues to the next iteration of the loop.
  }
  
-\LMHash{}
  If $s_E$ is an asynchronous for loop (\ref{asynchronousFor-in}), let $a_k$ be the set of asynchronous for loops and yield-each statements (\ref{yieldEach}) enclosing $s_c$ that are enclosed in $s_E , 1 \le k \le m$.   The stream subscriptions associated with $a_j$ are canceled, $1 \le j \le m$. 
  
  \subsection{ Yield and Yield-Each}
- \LMLabel{yieldAndYieldEach}
+ \label{yieldAndYieldEach}
  
  \subsubsection{ Yield}
- \LMLabel{yield}
+ \label{yield}
  
-\LMHash{}
  The {\em yield statement} adds an element to the result of a generator function (\ref{functions}).
 
  \begin{grammar}
@@ -5845,23 +5226,18 @@
       .
 \end{grammar}
 
-\LMHash{}
 Execution of a statement $s$ of the form \code{\YIELD{} $e$;}  proceeds as follows:
 
-\LMHash{}
 First, the expression $e$ is evaluated to an object $o$. If the enclosing function $m$ is marked \ASYNC* (\ref{functions}) and the stream $u$ associated with $m$ has been paused,  then execution of $m$ is suspended until $u$ is resumed or canceled.
 
-\LMHash{}
 Next, $o$ is added to the iterable or stream associated with the immediately enclosing function. 
 
-\LMHash{}
 If the enclosing function $m$ is marked \ASYNC* and the stream $u$ associated with $m$ has been canceled, then let $c$ be the \FINALLY{} clause (\ref{try}) of the innermost enclosing try-finally statement, if any. If $c$ is defined, let $h$ be the handler induced by $c$. If $h$ is defined, control is transferred to $h$. If $h$ is undefined, the immediately enclosing function terminates.
 
 \rationale{
 The stream associated with an asynchronous generator could be canceled by any code with a reference to that stream at any point where the generator was passivated.  Such a cancellation constitutes an irretrievable error for the generator. At this point, the only plausible action for the generator is to clean up after itself via its \FINALLY{} clauses.
 }
 
-\LMHash{}
 If the enclosing function $m$ is marked \SYNC* (\ref{functions}) then:
 \begin{itemize}
 \item
@@ -5870,10 +5246,8 @@
 The current call to \code{moveNext()} returns \TRUE.
 \end{itemize}
 
-\LMHash{}
 It is a compile-time error if a yield statement appears in a function that is not a generator function.
 
-\LMHash{}
 Let $T$ be the static type of $e$ and let $f$ be the immediately enclosing function.  It is a static type warning if either:
 \begin{itemize}
 \item
@@ -5884,9 +5258,8 @@
 
  
  \subsubsection{ Yield-Each}
- \LMLabel{yieldEach}
+ \label{yieldEach}
  
-\LMHash{}
  The {\em yield-each statement} adds a series of values to the result of a generator function (\ref{functions}).
  
  \begin{grammar}
@@ -5895,10 +5268,8 @@
       .
 \end{grammar}
 
-\LMHash{}
 Execution of a statement s of the form \code{\YIELD* $e$;}  proceeds as follows:
 
-\LMHash{}
 First, the expression $e$ is evaluated to an object $o$. If the immediately enclosing function $m$ is synchronous, then it is a dynamic error if the class of $o$ does not implement \code{Iterable}.  If $m$ asynchronous, then it is a dynamic error if the class of $o$ does not implement \code{Stream}. Next, for each element $x$ of $o$:
 \begin{itemize}
 \item
@@ -5909,7 +5280,6 @@
 If $m$ is marked \ASYNC* and the stream $u$ associated with $m$ has been canceled, then let $c$ be the \FINALLY{} clause (\ref{try}) of the innermost enclosing try-finally statement, if any. If $c$ is defined,  let $h$ be the handler induced by $c$. If $h$ is defined, control is transferred to $h$. If $h$ is undefined, the immediately enclosing function terminates.
 \end{itemize}
 
-\LMHash{}
 If the enclosing function is marked \SYNC* (\ref{functions}) then:
 \begin{itemize}
 \item
@@ -5918,17 +5288,14 @@
 The current call to \code{moveNext()} returns \TRUE.
 \end{itemize}
 
-\LMHash{}
 It is a compile-time error if a yield-each statement appears in a function that is not a generator function.
 
-\LMHash{}
 Let $T$ be the static type of $e$ and let $f$ be the immediately enclosing function.  It is a static type warning if $T$ may not be assigned to the declared return type of $f$. 
 
 
 \subsection{ Assert}
-\LMLabel{assert}
+\label{assert}
 
-\LMHash{}
 An {\em assert statement} is used to disrupt normal execution if a given boolean condition does not hold.
 
 \begin{grammar}
@@ -5937,17 +5304,14 @@
       .
 \end{grammar}
       
-\LMHash{}
 The assert statement has no effect in production mode. In checked mode, execution of an assert statement \code{\ASSERT{}($e$);} proceeds as follows:
 
-\LMHash{}
 The conditional expression $e$ is evaluated to an object $o$. If the class of $o$ is a subtype of \code{Function} then let $r$ be the result of invoking $o$ with no arguments. Otherwise, let $r$ be $o$. 
 It is a dynamic type error if $o$ is not of type \code{bool} or of type \code{Function}, or if $r$ is not of type \code{bool}.  If $r$ is \FALSE{}, we say that the assertion failed. If $r$ is \TRUE{}, we say that the assertion succeeded. If the assertion succeeded, execution of the assert statement is complete. If the assertion failed, an \code{AssertionError} is thrown.
 
 %\Q{Might be cleaner to define it as \code{if (!$e$) \{\THROW{} \NEW{} AssertionError();\}} (in checked mode only).
 %What about an error message as part of the assert?}
 
-\LMHash{}
  It is a static type warning if the type of $e$ may not be assigned to either  \code{bool} or $() \rightarrow$ \code{bool}.  
 
 \rationale{Why is this a statement, not a built in function call? Because it is handled magically so it has no effect and no overhead in production mode. Also, in the absence of final methods. one could not prevent it being overridden (though there is no real harm in that).  It cannot be viewed as a function call that is being optimized away because the argument might have side effects.
@@ -5977,12 +5341,10 @@
 %\rationale{therefore, we opt for the second option. Alternately, one could insist that assert be a reserved word, which may have an undesirable effect with respect to compatibility of Javascript code ported to Dart.}
 
 \section{Libraries and Scripts}
-\LMLabel{librariesAndScripts}
+\label{librariesAndScripts}
 
-\LMHash{}
 A Dart program consists of one or more libraries, and may be built out of one or more {\em compilation units}. A compilation unit may be a library or a part (\ref{parts}). 
 
-\LMHash{}
 A library consists of (a possibly empty) set of imports, a set of exports,  and a set of top-level declarations. A top-level declaration is either a class (\ref{classes}), a type alias declaration (\ref{typedef}), a function (\ref{functions}) or a variable declaration (\ref{variables}). The members of a library $L$ are those top level declarations given within $L$.
 
  \begin{grammar}
@@ -6033,14 +5395,12 @@
   libraryExport   
  \end{grammar}
  
-\LMHash{}
  Libraries may be {\em explicitly named} or {\em implicitly named}. An explicitly named library begins with  the  word \LIBRARY{} (possibly prefaced with any applicable metadata annotations), followed by a qualified identifier that gives the name of the library.
  
  \commentary{
  Technically, each dot and identifier is a separate token and so spaces between them are acceptable. However, the actual library name is the concatenation of the simple identifiers and dots and contains no spaces.
  }
  
-\LMHash{}
 An implicitly named library has the empty string as its name. 
 
  \rationale{
@@ -6051,23 +5411,19 @@
 Libraries intended for widespread use should avoid name collisions.  Dart's \code{pub} package management system provides a mechanism for doing so.  Each pub package is guaranteed a unique name, effectively enforcing a global namespace.
  }
  
-\LMHash{}
  A library may optionally begin with a {\em script tag}. Script tags are intended for use with scripts (\ref{scripts}).  A script tag can be used to identify the interpreter of the script to whatever computing environment the script is embedded in. The script tag must appear before any whitespace or comments.  A script  tag begins with the characters \#! and ends at the end of the line. Any characters that follow \#!  in the script tag are ignored by the Dart implementation.
  
-\LMHash{}
 Libraries are units of privacy. A private declaration declared within a library $L$ can only be accessed by code within $L$. Any attempt to access a private member declaration from outside $L$ will cause a method, getter or setter lookup failure.
 
 \commentary{Since top level privates are not imported, using the top level privates of another library is never possible. }
 
-\LMHash{}
 The {\em public namespace} of library $L$ is the mapping that maps the simple name of each public top-level member $m$ of $L$ to $m$. 
 The scope of a library $L$ consists of the names introduced by all top-level declarations declared in $L$, and the names added by $L$'s imports (\ref{imports}).
 
 
 \subsection{Imports}
-\LMLabel{imports}
+\label{imports}
 
-\LMHash{}
 An {\em import} specifies a library to be used in the scope of another library. 
 \begin{grammar}
 {\bf libraryImport:}
@@ -6088,16 +5444,12 @@
  \end{grammar}
  
 
-\LMHash{}
 An import specifies a URI $x$ where the declaration of an imported library is to be found. 
 
-\LMHash{}
 Imports may be {\em deferred} or {\em immediate}. A deferred import is distinguished by the appearance of the built-in identifier \DEFERRED{} after the URI. Any import that is not deferred is immediate.
 
-\LMHash{}
 It is a compile-time error if  the specified URI of an immediate import does not refer to a library declaration.  The interpretation of URIs is described in section \ref{uris} below.
 
-\LMHash{}
 It is a static warning if the specified URI of a deferred import does not refer to a library declaration.
 
 \rationale{
@@ -6105,20 +5457,15 @@
  }
 
  
-\LMHash{}
 The {\em current library} is the library currently being compiled. The import modifies the  namespace of the current library in a manner that is determined by the imported library and by the optional elements of  the import.
      
-\LMHash{}
 An immediate import directive $I$ may optionally include a prefix clause of the form \AS{} \code{Id} used to prefix names imported by $I$. A deferred import must include a prefix clause or a compile time error occurs. It is a compile-time error if a prefix used in a deferred import is used in another import clause.
 
-\LMHash{}
 An import directive $I$ may optionally include a namespace combinator clauses used to restrict the set of names imported by $I$. Currently, two namespace combinators are supported: \HIDE{} and \SHOW{}.
 
-\LMHash{}
 Let $I$ be an import directive that refers to a URI via the string $s_1$. Evaluation of $I$  proceeds as follows:
 
-\LMHash{}
-If $I$ is a deferred import, no evaluation takes place. Instead, an mapping the name of the prefix, $p$ to a {\em deferred prefix object} is added to the scope of $L$.
+If $I$ is a deferred import, no evaluation takes place. Instead, a mapping of the name of the prefix, $p$ to a {\em deferred prefix object} is added to the scope of $L$.
 The deferred prefix object has the following methods:
 
 \begin{itemize}
@@ -6129,10 +5476,8 @@
 \item For every type $T$ named $id$ in $L$, a corresponding getter named $id$ with return type \code{Type}.  Calling the method results in a runtime error.
 \end{itemize}
 
-\LMHash{}
 After a call succeeds, the name $p$ is mapped to a non-deferred prefix object as described below. In addition, the prefix object also supports the \code{loadLibrary} method, and so it is possible to call \code{loadLibrary} again. If a call fails, nothing happens, and one again has the option to call \code{loadLibrary} again. Whether a repeated call to \code{loadLibrary} succeeds will vary as described below.
 
-\LMHash{}
 The effect of a repeated call to \code{$p$.loadLibrary} is as follows:
 \begin{itemize}
 \item
@@ -6154,7 +5499,6 @@
 We do not specify what value the future returned resolves to.
 }
 
-\LMHash{}
 If $I$ is an immediate import then, first
 
  \begin{itemize}
@@ -6165,7 +5509,6 @@
 \end{itemize}
 
 
-\LMHash{}
 Let $NS_0$ be the exported namespace (\ref{exports}) of $B$. Then, for each combinator clause $C_i, i \in 1..n$ in $I$:
 \begin{itemize}
 \item If $C_i$ is of the form 
@@ -6185,7 +5528,6 @@
 where $hide(l, n)$ takes a list of identfiers $l$ and a namespace $n$, and produces a namespace that is identical to $n$ except that for each name $k$ in $l$, $k$ and $k=$ are undefined. 
 \end{itemize}
  
-\LMHash{}
 Next, if $I$ includes a prefix clause of the form \AS{} $p$, let $NS =  NS_n \cup \{p: prefixObject(NS_n)\}$ where $prefixObject(NS_n)$ is a {\em prefix object} for the namespace $NS_n$, which is an object that has the following members:
 
 \begin{itemize}
@@ -6195,14 +5537,12 @@
 \item For every type $T$ named $id$ in $NS_n$, a corresponding getter named $id$ with return type \code{Type}, that, when invoked, returns the type object for $T$.
 \end{itemize}
 
-\LMHash{}
 Otherwise, let $NS = NS_n$.
 It is a compile-time error if the current library declares a top-level member named $p$.
 
 % This is problematic, because it implies that p.T would be available even in a scope that declared p. We really need to think of p as a single object with properties p.T etc., except it isn't really that
 % either. After all, p isn't actually available as a stand alone name.
 
-\LMHash{}
 Then, for each entry mapping key $k$ to declaration $d$ in $NS$,  $d$ is made available in the top level scope of $L$ under the name $k$ unless either:
 \begin{itemize}
 \item
@@ -6212,7 +5552,6 @@
 
 \rationale{The greatly increases the chance that a member can be added to a library without breaking its importers.}
 
-\LMHash{}
 A {\em system library} is a library that is part of the Dart implementation. Any other library is a {\em non-system library}. If a name $N$ is referenced by a library $L$ and $N$ would be introduced into the top level scope of $L$ by 
 imports of two libraries, $L_1$ and $L_2$, and the exported namespace of $L_1$ binds $N$ to a declaration originating in a system library:
 
@@ -6228,7 +5567,6 @@
 It is recommended that tools that deploy Dart code produce output in which all imports use show clauses to ensure that additions to the namespace of a library never impact deployed code.
 }
 
-\LMHash{}
 If a name $N$ is referenced by a library $L$ and $N$ is  introduced into  the top level scope of $L$ by more than one import, and not all the imports denote the same declaration, then:
 \begin{itemize}
 \item A static warning occurs.
@@ -6237,7 +5575,6 @@
 
 \end{itemize}
 
-\LMHash{}
 We say that the namespace $NS$ {\em has been imported into} $L$.
 
 \commentary{
@@ -6254,7 +5591,6 @@
 %On a related note, the provenance of the conflicting elements is not considered. An  element that is imported via distinct paths may conflict with itself. This avoids variants of the well known "diamond" problem.
 }
 
-\LMHash{}
 It is a static warning to import two different libraries with the same name.
 
 \commentary{
@@ -6266,7 +5602,6 @@
 This prevents situations where removing a name from a library would cause breakage of a client library.
 }
 
-\LMHash{}
 The dart core library \code{dart:core} is implicitly imported into every dart library other than itself via an  import clause of the form
 
 \code{\IMPORT{}  `dart:core';} 
@@ -6282,9 +5617,8 @@
 }
 
 \subsection{Exports}
-\LMLabel{exports}
+\label{exports}
 
-\LMHash{}
 A library $L$ exports a namespace (\ref{scoping}), meaning that the declarations in the namespace are made available to other libraries if they choose to import $L$ (\ref{imports}).  The namespace that $L$ exports is known as its {\em exported namespace}.
 
 \begin{grammar}
@@ -6293,19 +5627,14 @@
     .
  \end{grammar}
  
-\LMHash{}
  An export specifies a URI $x$ where the declaration of an exported library is to be found.  It is a compile-time error if  the specified URI does not refer to a library declaration.  
 
-\LMHash{}
 We say that a name {\em is exported by a library} (or equivalently, that a library {\em exports a name}) if the name is in the library's exported namespace. We say that a declaration {\em is exported by a library} (or equivalently, that a library {\em exports a declaration}) if the declaration is in the library's exported namespace.
 
-\LMHash{}
 A library always exports all names and all declarations in its public namespace. In addition, a library may choose to re-export additional libraries via {\em export directives}, often referred to simply as {\em exports}.
 
-\LMHash{}
 Let $E$ be an export directive that refers to a URI via the string $s_1$. Evaluation of $E$  proceeds as follows:
 
-\LMHash{}
 First,
 
  \begin{itemize}
@@ -6315,7 +5644,6 @@
 \end{itemize}
 
 
-\LMHash{}
 Let $NS_0$ be the exported namespace of $B$. Then, for each combinator clause $C_i, i \in 1..n$ in $E$:
 \begin{itemize}
 \item If $C_i$ is of the form \code{\SHOW{} $id_1, \ldots, id_k$} then let 
@@ -6326,11 +5654,9 @@
 then let $NS_i = \HIDE{}([id_1, \ldots, id_k], NS_{i-1}$). 
 \end{itemize}
 
-\LMHash{}
 For each
 entry mapping key $k$ to declaration $d$ in $NS_n$ an entry mapping $k$ to $d$ is added to the exported namespace of $L$ unless a  top-level declaration with the name $k$ exists in $L$.  
 
-\LMHash{}
 If a name $N$ is referenced by a library $L$ and $N$ would be introduced into the exported namespace of $L$ by exports of two libraries, $L_1$ and $L_2$, and the exported namespace of $L_1$ binds $N$ to a declaration originating in a system library:
 %an export of a system library and an export of a non-system library:
 \begin{itemize}
@@ -6342,26 +5668,22 @@
 See the discussion in section \ref{imports} for the reasoning behind this rule.
 }
 
-\LMHash{}
 We say that $L$ {\em re-exports library } $B$, and also that $L$ {\em re-exports namespace } $NS_n$. When no confusion can arise, we may simply state that $L$ {\em re-exports }$B$, or that $L$ {\em re-exports }$NS_n$.
 
-\LMHash{}
 It is a compile-time error if a name $N$ is re-exported by a library $L$ and $N$ is  introduced into the export namespace of $L$ by more than one export, unless all  exports refer to same declaration for the name $N$.  It is a static warning to export two different libraries with the same name.
 
 
 
 \subsection{Parts}
-\LMLabel{parts}
+\label{parts}
 
-\LMHash{}
 A library may be divided into {\em parts}, each of which can be stored in a separate location. A library identifies its parts by listing them via \PART{} directives. 
 
-\LMHash{}
 A {\em part directive} specifies a URI where a Dart compilation unit that should be incorporated into the current library may be found.
 
 \begin{grammar}
 {\bf partDirective:}
-   metadata \PART{}   uri '{\escapegrammar ;}' 
+   metadata \PART{}   uri `{\escapegrammar ;}' 
     .
 
 {\bf partHeader:}
@@ -6372,27 +5694,22 @@
     .
 \end{grammar}
 
-\LMHash{}
 A {\em part header} begins with  \PART{} \OF{}  followed by the name of the library the part belongs to.  A part declaration consists of a part header followed by a sequence of top-level declarations.
 
-\LMHash{}
 Compiling a part directive of the form \code{\PART{} $s$;} causes the Dart system to attempt to compile the contents of the URI that is the value of $s$. The top-level declarations at that URI are then compiled by the Dart compiler in the scope of the current library. It is a compile-time error if the contents of the URI are not a valid part declaration. It is a static warning if the referenced part declaration $p$ names a library other than the current library as the library to which $p$ belongs.
 
 \subsection{Scripts}
-\LMLabel{scripts}
+\label{scripts}
 
-\LMHash{}
 A {\em script} is a library whose exported namespace  (\ref{exports}) includes a top-level function \code{main}. 
 A script $S$ may be executed as follows:
 
-\LMHash{}
 First, $S$ is compiled as a library as specified above. Then, the top-level function \code{main} that is in the exported namespace of $S$ is invoked. If \code{main} has no positional parameters, it is invoked with no arguments. Otherwise if \code{main} has exactly one positional parameter, it is invoked with a single actual argument whose runtime type implements \code{List$<$String$>$}.  Otherwise \code{main} is invoked with the following two actual arguments:
 \begin{enumerate}
 \item An object whose runtime type implements \code{List$<$String$>$}.
 \item The initial message of the current isolate $i$ as determined by the invocation of \code{Isolate.spawnUri} that spawned $i$. 
 \end{enumerate}
 
-\LMHash{}
 It is a run time error if $S$ does not declare or import a top-level function \code{main}. It is a static warning if \code{main} has more than two required parameters.
 
 \commentary {
@@ -6408,9 +5725,8 @@
 }
 
 \subsection{URIs}
-\LMLabel{uris}
+\label{uris}
 
-\LMHash{}
 URIs are specified by means of string literals:
 
 \begin{grammar}
@@ -6419,20 +5735,16 @@
     .
 \end{grammar}
 
-\LMHash{}
 It is a compile-time error if  the string literal $x$ that describes a URI is not a compile-time constant, or if $x$ involves string interpolation.
  
-\LMHash{}
 This specification does not discuss the interpretation of URIs, with the following exceptions. 
  
  \rationale{
  The interpretation of URIs is mostly left to the surrounding computing environment. For example, if Dart is running in a web browser, that browser will likely interpret some URIs. While it might seem attractive to specify, say, that URIs are interpreted with respect to a standard such as IETF RFC 3986, in practice this will usually depend on the browser and cannot be relied upon.
  }
  
-\LMHash{}
 A URI of the form \code{dart:$s$} is interpreted as a reference to a system library (\ref{imports}) $s$. 
  
-\LMHash{}
 A URI of the form \code{package:$s$} is interpreted as a URI of the form \code{packages/s} relative to an implementation specified location.
 
 \commentary{ 
@@ -6443,25 +5755,22 @@
 The intent is that, during development, Dart programmers can rely on a package manager to find elements of their program. Such package managers may provide a directory structure starting at a local directory \code{packages} where they place the required dart code (or links thereto).
 }
 
-\LMHash{}
 Otherwise, any relative URI is interpreted as relative to the the location of the current library. All further interpretation of URIs is implementation dependent. 
 
 \commentary{This means it is dependent on the embedder.}
 
 
 \section{Types}
-\LMLabel{types}
+\label{types}
 
-\LMHash{}
 Dart supports optional typing based on interface types.
 
 \rationale{The type system is unsound, due to the covariance of generic types. This is a deliberate choice (and undoubtedly controversial).  Experience has shown that sound type rules for generics fly in the face of programmer intuition. It is easy for tools to provide a sound type analysis if they choose, which may be useful for tasks like refactoring.
 }
 
 \subsection{Static Types}
-\LMLabel{staticTypes}
+\label{staticTypes}
 
-\LMHash{}
 Static type annotations are used in variable declarations (\ref{variables}) (including formal parameters (\ref{formalParameters})), in the return types of functions (\ref{functions}) and in the bounds of type variables.  Static type annotations are used during static  checking and when running programs in checked mode. They have no effect whatsoever in production mode.
 
  \begin{grammar}
@@ -6482,7 +5791,6 @@
     .
  \end{grammar}
 
-\LMHash{}
 A Dart implementation must provide a static checker that detects and reports exactly those situations this specification identifies as static warnings and only those situations. However:
 \begin{itemize}
 \item Running  the static checker on a program $P$ is not required for compiling and running $P$.  
@@ -6494,7 +5802,6 @@
 
 %\Q{Should we do something with respect to non-nullable types?}
 
-\LMHash{}
 A type $T$ is {\em malformed} iff:
 \begin{itemize}
 \item $T$ has the form $id$ or the form $prefix.id$, and in the enclosing lexical scope, the name $id$ (respectively $prefix.id$) does not denote a type.
@@ -6507,35 +5814,29 @@
 %  \end{itemize}
 \end{itemize}
 
-\LMHash{}
  Any use of a malformed  type gives rise to a static warning. A malformed type is then interpreted as \DYNAMIC{} by the static type checker and the runtime unless explicitly specified otherwise.
   
  \rationale{
 This ensures that the developer is spared a series of cascading warnings as the malformed type interacts with other types.
 }
 
-\LMHash{}
 A type $T$ is {\em deferred} iff it is of the form $p.T$ where $p$ is a deferred prefix.
 It is a static warning to use a deferred type in a type annotation, type test, type cast or as a type parameter. However, all other static warnings must be issued under the assumption that all deferred libraries have successfully been loaded.
 
 
 \subsubsection{Type Promotion}   
-\LMLabel{typePromotion}
+\label{typePromotion}
 
-\LMHash{}
 The static type system ascribes a static type to every expression.  In some cases, the types of local variables and formal parameters may be promoted from their declared types based on control flow. 
 
-\LMHash{}
 We say that a variable $v$ is known to have type $T$ whenever we allow the type of $v$ to be promoted. The exact circumstances when type promotion is allowed are given in the relevant sections of the specification (\ref{logicalBooleanExpressions}, \ref{conditional} and \ref{if}).
 
-\LMHash{}
 Type promotion for a variable $v$ is allowed only when we can deduce that such promotion is valid based on an analysis of certain boolean expressions. In such cases, we say that the boolean expression $b$ shows that $v$ has type $T$. As a rule, for all variables $v$ and types $T$, a boolean expression does not show that $v$ has type $T$. Those situations where an expression does show that a variable has a type are mentioned explicitly in the relevant sections of this specification (\ref{typeTest} and \ref{logicalBooleanExpressions}).
 
 
 \subsection{Dynamic Type System}
-\LMLabel{dynamicTypeSystem}
+\label{dynamicTypeSystem}
 
-\LMHash{}
 A Dart implementation must support execution in both {\em production mode} and {\em checked mode}.  Those dynamic checks specified as occurring specifically in checked mode must be performed iff the code is executed in checked mode.
 
 \commentary{
@@ -6549,7 +5850,6 @@
 
 %It is a run-time type error to access an undeclared type outside .
 
-\LMHash{}
 %It is a dynamic type error if a malformed type is used in a subtype test.  
 In checked mode, it is a dynamic type error if a deferred, malformed or malbounded (\ref{parameterizedTypes}) 
 type is used in a subtype test.  
@@ -6631,12 +5931,11 @@
 
 
 \subsection{Type Declarations}
-\LMLabel{typeDeclarations}
+\label{typeDeclarations}
 
 \subsubsection{Typedef}
-\LMLabel{typedef}
+\label{typedef}
 
-\LMHash{}
 A {\em type alias} declares a name for a type expression.
 
 
@@ -6660,10 +5959,8 @@
     
  \end{grammar}
  
-\LMHash{}
  The effect of a type alias of the form  \code{\TYPEDEF{} $T$ $id (T_1$ $p_1, \ldots, T_n$ $p_n, [T_{n+1}$ $p_{n+1}, \ldots, T_{n+k}$ $p_{n+k}])$} declared in a library $L$ is is to introduce the name $id$ into the scope of $L$, bound to the function type $(T_1, \ldots, T_n, [T_{n+1}$ $p_{n+1}, \ldots, T_{n+k}$ $p_{n+k}])  \rightarrow T$.  The effect of a type alias of the form   \code{\TYPEDEF{} $T$ $id (T_1$ $p_1, \ldots, T_n$ $p_n, \{T_{n+1}$ $p_{n+1}, \ldots, T_{n+k}$ $p_{n+k}\})$} declared in a library $L$ is is to introduce the name $id$ into the scope of $L$, bound to the function type $(T_1, \ldots, T_n, \{T_{n+1}$ $p_{n+1}, \ldots, T_{n+k}$ $p_{n+k}\})  \rightarrow T$. . In either case, iff no return type is specified, it is taken to be \DYNAMIC{}. Likewise, if a type annotation is omitted on a formal parameter, it is taken to be \DYNAMIC{}.
  
-\LMHash{}
 It is a compile-time error if any default values are specified in the signature of a function type alias. 
 %A typedef may only refer to itself  via the bounds of its generic parameters. 
 Any  self reference in a typedef, either directly, or recursively via another typedef, is a compile time error.
@@ -6672,9 +5969,8 @@
 
 
 \subsection{Interface Types}
-\LMLabel{interfaceTypes}
+\label{interfaceTypes}
 
-\LMHash{}
 The implicit interface of class $I$ is a direct supertype of the implicit interface of class  $J$ iff:
 \begin{itemize}
 \item
@@ -6697,7 +5993,6 @@
 %\Q{Can wacky stuff happen with interface injection, e.g., a direct superinterface becomes indirect? What about side effects - loading order can affect type relationships.
 %}
 
-\LMHash{}
 A type $T$ is more specific than a type $S$, written $T << S$,  if one of the following conditions is met:
 \begin{itemize}
 \item $T$ is $S$.
@@ -6713,7 +6008,6 @@
 \item $T << U$ and $U << S$.
 \end{itemize}
 
-\LMHash{}
 $<<$ is a partial order on types.
 $T$ is a subtype of $S$, written $T <: S$, iff $[\bot/\DYNAMIC{}]T << S$.
 
@@ -6723,12 +6017,10 @@
 Although $<:$ is not a partial order on types, it does contain a partial order, namely $<<$. This means that, barring raw types, intuition about classical subtype rules does apply.
 }
 
-\LMHash{}
 $S$ is a supertype of $T$, written $S :> T$, iff $T$ is a subtype of $S$.
 
 \commentary{The supertypes of an interface are its direct supertypes and their supertypes. }
 
-\LMHash{}
 An interface type $T$ may be assigned to a type $S$, written  $T \Longleftrightarrow S$, iff either $T <: S$ or $S <: T$. 
 
 \rationale{This rule may surprise readers accustomed to conventional typechecking. The intent of the $\Longleftrightarrow$ relation is not to ensure that an assignment is correct. Instead, it aims to only flag assignments that are almost certain to be erroneous, without precluding assignments that may work. 
@@ -6737,9 +6029,8 @@
 }
 
 \subsection{Function Types}
-\LMLabel{functionTypes}
+\label{functionTypes}
 
-\LMHash{}
 Function types come in two variants: 
 \begin{enumerate}
 \item
@@ -6758,7 +6049,6 @@
 %\item$ \forall i \in 1 .. n, T_i \Longleftrightarrow S_i$.
 %\end{enumerate}
 
-\LMHash{}
 %A function type $(T_1, \ldots T_n, [T_{n+1}  \ldots, T_{n+k}]) \rightarrow T$ is a subtype of the 
 % the line below revises the rule to be more liberal
 A function type $(T_1, \ldots T_{k}, [T_{k+1}  \ldots, T_{n+m}]) \rightarrow T$ is a subtype of the
@@ -6773,7 +6063,6 @@
 \end{enumerate}
 
 
-\LMHash{}
 A function type $(T_1, \ldots T_n, \{T_{x_1}$ $x_1, \ldots, T_{x_k}$ $x_k\}) \rightarrow T$ is a subtype of the function type $(S_1, \ldots, S_n, \{S_{y_1}$ $y_1, \ldots, S_{y_m}$ $y_m\}) \rightarrow S$, if all of the following conditions are met:
 \begin{enumerate}
 \item Either
@@ -6796,7 +6085,6 @@
 %The rules above need to be sanity checked, but the intent is that we view functions with rest parameters as having type $(T_1, ..., T_n, [\_{Tn+1}[] \_]) \rightarrow T$, where \_ is some magical identifier. Then the rules above may cover everything.
 % This is wrong - from the outside, the type takes an unbounded sequence of types, not a list. This can be modeled as $(T_1, \ldots, T_n, [T_{n+1}, \_ \ldots, T_{n+k} \_]) \rightarrow T$ for some finite $k$. 
 
-\LMHash{}
 In addition, the following subtype rules apply:
 
 
@@ -6812,10 +6100,8 @@
 The naive reader might conclude that, since it is not legal to declare a function with an empty optional parameter list, these rules are pointless. However, they induce  useful relationships between function types that declare no optional parameters and those that do.
 }
 
-\LMHash{}
 A function type $T$ may be assigned to a function type $S$, written  $T \Longleftrightarrow S$, iff  $T <: S$. 
 
-\LMHash{}
 % ensure that Object  and dynamic may be assign dot a function type
 A function is always an instance of some class that implements the class \code{Function} and implements a \CALL{} method with the same signature as the function. All function types are subtypes of \code{Function}.
 If a type $I$ includes an instance method named \CALL{}, and the type of \CALL{} is the function type $F$, then $I$ is considered to be more specific than $F$.  It is a static warning if a concrete class implements \cd{Function} and does not have a concrete method named \CALL{} unless that class declares its own implementation of \cd{noSuchMethod()}.
@@ -6825,7 +6111,6 @@
 
 %\commentary{Need to specify how a function values dynamic type is derived from its static signature.}
 
-\LMHash{}
 A function type $(T_1, \ldots T_{k}, [T_{k+1}  \ldots, T_{n+m}]) \rightarrow T$ is a more specific than the
 function type $(S_1, \ldots, S_{k+j}, [S_{k+j+1} \ldots, S_{n}]) \rightarrow S$, if all of the following conditions are met:
 \begin{enumerate}
@@ -6838,7 +6123,6 @@
 \end{enumerate}
 
 
-\LMHash{}
 A function type $(T_1, \ldots T_n, \{T_{x_1}$ $x_1, \ldots, T_{x_k}$ $x_k\}) \rightarrow T$ is more specific than the function type $(S_1, \ldots, S_n, \{S_{y_1}$ $y_1, \ldots, S_{y_m}$ $y_m\}) \rightarrow S$, if all of the following conditions are met:
 \begin{enumerate}
 \item Either
@@ -6852,23 +6136,19 @@
 \item For all $y_i \in \{y_1,  \ldots, y_m\}, y_i = x_j \Rightarrow T_j << S_i$
 \end{enumerate}
 
-\LMHash{}
 Furthermore, if $F$ is a function type, $F << \code{Function}$.
 
 
 \subsection{Type \DYNAMIC{}}
-\LMLabel{typeDynamic}
+\label{typeDynamic}
 
-\LMHash{}
 The type  \DYNAMIC{}  denotes the unknown type. 
 
-\LMHash{}
 If no static type annotation has been provided the type system assumes the declaration has the unknown type. If a generic type is used but type arguments are not provided, then the  type arguments default to the unknown type.
 
 \commentary{This means that given a generic declaration $G<T_1, \ldots, T_n>$, the type $G$ is equivalent to $G< \DYNAMIC{},  \ldots,  \DYNAMIC{}>$.
 }
 
-\LMHash{}
 Type  \DYNAMIC{} has methods for every possible identifier and arity, with every possible combination of named parameters. These methods all have  \DYNAMIC{} as their return type, and their formal parameters all have type  \DYNAMIC{}.
 Type  \DYNAMIC{} has properties for every possible identifier. These properties all have type  \DYNAMIC{}.
 
@@ -6891,7 +6171,6 @@
 What of static checking? Surely we would want to flag (2) when users have explicitly asked for static typechecking? Yes, but the reality is that the Dart static checker is likely to be running in the background by default. Engineering teams typically desire a ``clean build'' free of warnings and so the checker is designed to be extremely charitable. Other tools can interpret the type information more aggressively and warn about violations of conventional (and sound) static type discipline.
 }
 
-\LMHash{}
 The name \DYNAMIC{} denotes a \cd{Type} object even though \DYNAMIC{} is not a class.
 
 %\rationale {
@@ -6899,9 +6178,8 @@
 %}
 
 \subsection{Type Void}
-\LMLabel{typeVoid}
+\label{typeVoid}
 
-\LMHash{}
 The special type \VOID{} may only be used as the return type of a function: it is a compile-time error to use \VOID{} in any other context. 
 
 \commentary{
@@ -6936,18 +6214,15 @@
 
 
 \subsection{Parameterized Types}
-\LMLabel{parameterizedTypes} 
+\label{parameterizedTypes} 
 
-\LMHash{}
 A {\em parameterized type} is an invocation of a generic type declaration.
 
-\LMHash{}
 Let $T$ be a parameterized type  $G<S_1,  \ldots, S_n>$. If $G$ is not a generic type, the type arguments $S_i$, $1 \le i \le n$ are discarded. If $G$ has $m \ne n$ type parameters, $T$ is treated as as a parameterized type with $m$ arguments, all of which are \DYNAMIC{}. 
 
 \commentary{In short, any arity mismatch results in all type arguments being dropped, and replaced with the correct number of type arguments, all set to \DYNAMIC{}. Of course, a static warning will be issued. 
 }
 
-\LMHash{}
 Otherwise, let
  $T_i$ be the type parameters of $G$ and let $B_i$ be the bound of $T_i,  i \in 1.. n$,. $T$ is {\em malbounded} iff either $S_i$ is malbounded  or $S_i$ is not a subtype of $[S_1,  \ldots, S_n/T_1, \ldots, T_n]B_i,   i \in 1.. n$. 
  
@@ -6955,10 +6230,8 @@
 Note, that, in checked mode, it is a dynamic type error if a malbounded type is used in a type test as specified in \ref{dynamicTypeSystem}.
 }
  
-\LMHash{}
 Any use of a malbounded type gives rise to a static warning.
 
-\LMHash{}
 If $S$ is the static type of a member $m$ of $G$, then the static type of the member $m$ of  $G<A_1, \ldots, A_n>$  is $[A_1,  \ldots, A_n/T_1,  \ldots, T_n]S$ where $T_1,  \ldots, T_n$ are the formal type parameters of $G$.   Let $B_i$, be the bounds of $T_i, 1 \le i \le n$. It is a static type warning if $A_i$ is not a subtype of  $[A_1,  \ldots, A_n/T_1,  \ldots, T_n]B_i, i \in 1..n$. It is a static type warning if $G$ is not a generic type with exactly $n$ type parameters.
 
 
@@ -6966,16 +6239,14 @@
 
 
 \subsubsection{Actual Type of Declaration}
-\LMLabel{actualTypeOfADeclaration}
+\label{actualTypeOfADeclaration}
 
-\LMHash{}
 A type $T$ {\em depends on a type parameter} $U$ iff:
 \begin{itemize}
 \item $T$ is $U$.
 \item $T$ is a parameterized type, and one of the type arguments of $T$ depends on $U$.
 \end{itemize}
 
-\LMHash{}
 Let $T$ be the declared type of a declaration $d$, as it appears in the program source. The {\em actual type} of $d$ is
 
 \begin{itemize}
@@ -6984,24 +6255,20 @@
 \end{itemize}
 
 \subsubsection{Least Upper Bounds}
-\LMLabel{leastUpperBounds}
+\label{leastUpperBounds}
 
-\LMHash{}
 % does this diverge in some cases?
 Given two interfaces $I$ and $J$, let $S_I$ be the set of superinterfaces of $I$,  let $S_J$ be the set of superinterfaces of $J$ and let $S =  (I \cup S_I) \cap (J \cup S_J)$.  Furthermore, we define $S_n = \{T | T \in S  \wedge depth(T) =n\}$ for any finite $n$ %, and $k=max(depth(T_1), \ldots, depth(T_m)), T_i \in S, i \in 1..m$, 
 where $depth(T)$ is the number of steps in the longest inheritance path from $T$ to \code{Object}. Let $q$ be the largest number such that $S_q$ has cardinality one. The least upper bound of $I$ and $J$ is the sole element of  $S_q$.
 
-\LMHash{}
 The least upper bound of \DYNAMIC{} and any type $T$ is \DYNAMIC{}.
 The least upper bound of \VOID{} and any type $T \ne \DYNAMIC{}$ is \VOID{}.
 Let $U$ be a type variable with upper bound $B$. The least upper bound of $U$ and a type $T$ is the least upper bound of $B$ and $T$. 
 
-\LMHash{}
 The least upper bound relation is symmetric and reflexive.
 
 % Function types
 
-\LMHash{}
 The least upper bound of a function type and an interface type $T$ is the least upper bound of \cd{Function} and $T$.
 Let $F$ and $G$ be function types. If $F$ and $G$ differ in their number of required parameters, then the least upper bound of $F$ and $G$ is \cd{Function}.  Otherwise:
 \begin{itemize}
@@ -7044,18 +6311,16 @@
 
 
 \section{Reference}
-\LMLabel{reference}
+\label{reference}
 
 \subsection{Lexical Rules}
-\LMLabel{lexicalRules}
+\label{lexicalRules}
 
-\LMHash{}
 Dart source text is represented as a sequence of Unicode code points.  This sequence is first converted into a sequence of tokens according to the lexical rules given in this specification.  At any point in the tokenization process, the longest possible token is recognized.
 
 \subsubsection{Reserved Words} 
-\LMLabel{reservedWords}
+\label{reservedWords}
 
-\LMHash{}
 A {\em reserved word} may not be used as an identifier; it is a compile-time error if a reserved word is used where an identifier is expected.
 
 \ASSERT{}, \BREAK{}, \CASE{}, \CATCH{}, \CLASS{}, \CONST{}, \CONTINUE{}, \DEFAULT{}, \DO{}, \ELSE{}, \ENUM{}, \EXTENDS{}, \FALSE{}, \FINAL{}, \FINALLY{}, \FOR{}, \IF{}, \IN{}, \IS{}, \NEW{}, \NULL{}, \RETHROW, \RETURN{}, \SUPER{}, \SWITCH{}, \THIS{}, \THROW{}, \TRUE{}, \TRY{}, \VAR{}, \VOID{}, \WHILE{}, \WITH{}.
@@ -7079,9 +6344,8 @@
 \end{grammar}
 
 \subsubsection{Comments}
-\LMLabel{comments}
+\label{comments}
 
-\LMHash{}
 {\em Comments} are sections of program text that are used for documentation.
 
 \begin{grammar}{\bf SINGLE\_LINE\_COMMENT:}
@@ -7093,22 +6357,16 @@
     .
  \end{grammar}
   
-\LMHash{}
 Dart supports both single-line and multi-line comments. A {\em single line comment} begins with the token \code{//}. Everything between \code{//} and the end of line must be ignored by the Dart compiler unless the comment is a documentation comment. . 
 
-\LMHash{}
 A {\em multi-line comment} begins with the token \code{/*} and ends with the token \code{*/}.  Everything between \code{/}* and \code{*}/ must be ignored by the Dart compiler unless the comment is a documentation comment. Comments may nest. 
 
-\LMHash{}
 {\em Documentation comments} are comments that begin with the tokens  \code{///} or  \code{/**}. Documentation comments are intended to be processed by a tool that produces human readable documentation. 
 
-\LMHash{}
 The scope of a documentation comment  always excludes the imported namespace of the enclosing library. Only names declared in the enclosing library are considered in scope within a documentation comment.
 
-\LMHash{}
 The scope of a documentation comment immediately preceding the declaration of a class $C$ is the instance scope of $C$, excluding any names introduced via the import namespace of the enclosing library.
 
-\LMHash{}
 The scope of a documentation comment immediately preceding the declaration of a function $f$  is the  scope in force at the very beginning of the body of $f$,  excluding any names introduced via the import namespace of the enclosing library.
 
 
@@ -7117,9 +6375,8 @@
 
 %\subsection{Grammar}
 \subsection{Operator Precedence}
-\LMLabel{operatorPrecedence}
+\label{operatorPrecedence}
 
-\LMHash{}
 Operator precedence is given implicitly by the grammar.
 
 \commentary{The following non-normative table may be helpful
@@ -7180,156 +6437,3 @@
 
 
 \end{document}
-
-[Text after \end{document} is ignored, hence we do not need "%"]
-----------------------------------------------------------------------
-
-* On Location Markers
-
-This is a description of location markers, giving some information
-about the underlying motivation and rationale, the actual
-implementation, and the relevant tool support.
-
-** What is a Location Marker?
-
-In order to support more fine-grained update propagation from this
-language specification to artifacts that depend on it, location
-markers have been added.  The idea is that each logical unit (section,
-subsection, etc) and each paragraph containing normative text should
-be addressable using these markers, such that source code (compilers
-and other tools, tests, etc.) can contain location markers, and the
-corresponding location in the spec may be looked up using standard
-document viewer search features.
-
-An SHA1 hash value of the text is associated with each location
-marker, such that changes in the text will incur changes in this hash
-value.  Consequently, source code in tools/tests that depend on
-specific parts of the spec may be flagged for revision by checking
-whether these hash values have changed:  If a given test T depends on
-a paragraph with hash value V in the spec, and the search for V fails
-in a new version of the spec, then that paragraph has changed and T
-should be revisited and possible revised.
-
-As a result, the search for parts of source code and similar artifacts
-in likely need of updates because of spec changes can be performed
-mechanically, which should help ensure that the conformance of all
-artifacts depending on this spec is maintained more easily, and hence
-more consistently.  Note that it makes no difference whether the need
-for an update has arisen in a very recent version of the spec or it
-has existed for a long time, because the hash value just remains
-different as long as the text is different from what it was when the
-location marker was harvested from the spec.
-
-** LaTeX Commands Supporting Location Markers
-
-Concretely, this is based on the commands \LMHash and \LMLabel.
-\LMHash{V} is used to add the text V in the margin, intended to mark
-a paragraph of normative text with the SHA1 hash value of the text, V.
-\LMLabel{L} has the effect of \label{L}, and moreover it shows the
-text sec:L in the margin.  In order to indicate a dependency on a
-section or subsection an \LMLabel location marker is used, and in
-order to indicate a dependency on a specific paragraph, the hash value
-of that paragraph is used.
-
-In this file, each normative paragraph has had the command \LMHash{}
-added at the beginning, such that each of these paragraphs can be
-decorated with their hash value.  Similarly, all \section{}s,
-\subsection{}s, \subsubsection{}s, and \paragraph{}s have had
-their \label commands changed to \LMLabel, such that they are
-decorated with logical names.
-
-** Rationale
-
-The design of location markers was proposed by Erik Ernst and
-developed through discussions with several others, in particular Gilad
-Bracha and Lars Bak.  Some discussions along the way that gave rise to
-the given design are outlined below.
-
-The basic idea is that a hash value based on the actual text will
-serve well to identify a piece of text, because it will change
-whenever the text changes, and it remains the same if the text is
-moved to a different location; in other words, it characterizes the
-text itself, independently of the rest of the document.  Hence:
-
-  - references to specific paragraphs in the spec are easy to create:
-    copy the marker and paste it into the source code (but see below
-    why this uses an extra indirection as far as possible)
-
-  - such references would be robust in the sense that they depend on
-    the actual text alone, i.e., they would not be invalidated by
-    updates to section numbers, relocation of the paragraph, or
-    updates to text in different paragraphs; as Lars mentioned, we
-    should use a "stripped" version of the text, removing comments,
-    normalizing white space, etc., which would make the refs even more
-    robust in case of "inessential" changes
-
-  - artifacts depending on a given part of the spec that was
-    changed could easily be pointed out: After an update to a
-    part of the spec, that artifact would hold a marker associated
-    with a hash value which does not any more occur in the spec,
-    maintainers of the artifact would then receive a notification
-    ("test1773 depends on a part of the spec that was updated").
-    Nice tool support would show them the paragraph in the most recent
-    version of the spec as well as the old version that the artifact
-    used to depend on, and a comparison of the two would help
-    clarifying what needs fixing because of this change, if anything.
-
-However, there is a conflict in this scenario:  Lars pointed out that
-it is very inconvenient to have to create a lot of revision control
-commits (e.g., new versions of tests), just because a large number of
-artifacts depend on a specific hash value that changed, if that change
-has no real impact on each of those artifacts.  The obvious solution
-to this problem would be to use symbolic names and keep the actual
-hash values out of the primary artifacts.
-
-This approach has been used for \section{}s, \subsection{}s, etc., by
-using their labels as location markers.  For instance, dependency on
-\subsubsection{New} would be marked as a dependency on 'sec:new',
-which will (most likely) exist with the same label in the spec for a
-long time.  To detect a need for updates, the hash value associated
-with \subsubsection{New} from the date of the latest check of this
-kind to the dependent artifact should be compared with the current
-hash value for the same \subsubsection{}:  The artifact should be
-revisited iff those hash values differ.  As an easy approximation to
-this scheme, the hash values for all location markers would be
-computed for each spec update, and the location markers that have new
-hash values should cause revisits to all artifacts depending on that
-location marker.
-
-The symbolic location markers on larger units like \section{}
-etc. enable location marking in a hierarchical fashion: Dependencies
-on a \subsubsection{} or on a \section{} can be chosen according to
-the actual needs with each dependent artifact.  In general, fine
-granularity helps avoiding false positives, where an update somewhere
-in a large unit will flag too many dependent artifacts for revisits.
-In contrast, coarse granularity enables other artifacts to declare the
-actual dependencies when small units would be impractical because the
-artifact depends on so many of them.  But there is a problem at the
-bottom of this hierarchy, namely with paragraphs.
-
-It would be very inconvenient to have to invent a logical name for
-every paragraph.  Similarly, using a simple paragraph numbering would
-be unstable (add one new paragraph in the beginning of a section, and
-all the rest have new numbers, creating a massive flood of false
-update alerts, or, even worse, corrupting the declared dependencies in
-artifacts because they point to the wrong paragraphs).
-
-Hence, paragraphs have no other label than their actual hash value.
-Artifacts that depend on very specific elements in the spec may
-declare so by using an actual hash value for a given paragraph, and in
-return they pay in terms of potential updates to the marker when that
-paragraph changes, even in cases where the actual change makes no
-difference for that particular artifact.  This choice of granularity
-vs. stability is up to the creator of each artifact.
-
-** Maintenance of this document
-
-The invariant that each normative paragraph is associated with a line
-containing the text \LMHash{} should be maintained.  Extra occurrences
-of \LMHash{} can be added if needed, e.g., in order to make
-individual \item{}s in itemized lists addressable.  Each \LM.. command
-must occur on a separate line.  \LMHash{} must occur immediately
-before the associated paragraph, and \LMLabel must occur immediately
-after the associated \section{}, \subsection{} etc.
-
-----------------------------------------------------------------------
diff --git a/pkg/analysis_server/doc/api.html b/pkg/analysis_server/doc/api.html
index d029594..a1372da 100644
--- a/pkg/analysis_server/doc/api.html
+++ b/pkg/analysis_server/doc/api.html
@@ -2106,7 +2106,15 @@
           in a completion suggestion.
         </p>
         
-      <dl><dt class="value">ARGUMENT_LIST</dt><dt class="value">IMPORT</dt><dt class="value">IDENTIFIER</dt><dd>
+      <dl><dt class="value">ARGUMENT_LIST</dt><dd>
+          
+            <p>
+              A list of arguments for the method or function that is being invoked.
+              For this suggestion kind, the completion field is a textual representation
+              of the invocation and the parameterNames, parameterTypes, and requiredParameterCount
+              attributes are defined.
+            </p>
+          </dd><dt class="value">IMPORT</dt><dt class="value">IDENTIFIER</dt><dd>
             
             <p>
               The element identifier should be inserted at the completion location.
diff --git a/pkg/analysis_server/lib/src/computer/computer_hover.dart b/pkg/analysis_server/lib/src/computer/computer_hover.dart
index bab5770..213f16e 100644
--- a/pkg/analysis_server/lib/src/computer/computer_hover.dart
+++ b/pkg/analysis_server/lib/src/computer/computer_hover.dart
@@ -68,10 +68,21 @@
    */
   HoverInformation compute() {
     AstNode node = new NodeLocator.con1(_offset).searchWithin(_unit);
+    if (node.parent is TypeName &&
+        node.parent.parent is ConstructorName &&
+        node.parent.parent.parent is InstanceCreationExpression) {
+      node = node.parent.parent.parent;
+    }
+    if (node.parent is ConstructorName &&
+        node.parent.parent is InstanceCreationExpression) {
+      node = node.parent.parent;
+    }
     if (node is Expression) {
-      HoverInformation hover = new HoverInformation(node.offset, node.length);
+      Expression expression = node;
+      HoverInformation hover =
+          new HoverInformation(expression.offset, expression.length);
       // element
-      Element element = ElementLocator.locateWithOffset(node, _offset);
+      Element element = ElementLocator.locateWithOffset(expression, _offset);
       if (element != null) {
         // variable, if synthetic accessor
         if (element is PropertyAccessorElement) {
@@ -95,10 +106,10 @@
         hover.dartdoc = dartDoc;
       }
       // parameter
-      hover.parameter = _safeToString(node.bestParameterElement);
+      hover.parameter = _safeToString(expression.bestParameterElement);
       // types
-      hover.staticType = _safeToString(node.staticType);
-      hover.propagatedType = _safeToString(node.propagatedType);
+      hover.staticType = _safeToString(expression.staticType);
+      hover.propagatedType = _safeToString(expression.propagatedType);
       // done
       return hover;
     }
diff --git a/pkg/analysis_server/lib/src/computer/computer_navigation.dart b/pkg/analysis_server/lib/src/computer/computer_navigation.dart
index faf949d..5f87bcc 100644
--- a/pkg/analysis_server/lib/src/computer/computer_navigation.dart
+++ b/pkg/analysis_server/lib/src/computer/computer_navigation.dart
@@ -168,20 +168,22 @@
         ClassElement classElement = element.enclosingElement;
         element = classElement;
       }
-      // "new ", excluding last character
-      computer._addRegion_nodeStart_nodeStart(
-          node,
-          constructorName.type,
-          element,
-          excludeLastChar: true);
-      // "ClassName<TypeA, TypeB>"
-      _safelyVisit(constructorName.type);
-      // optional ".name"
-      if (constructorName.period != null) {
-        computer._addRegion_tokenStart_nodeEnd(
-            constructorName.period,
-            constructorName,
-            element);
+      // add regions
+      TypeName typeName = constructorName.type;
+      TypeArgumentList typeArguments = typeName.typeArguments;
+      if (typeArguments == null) {
+        computer._addRegion_nodeStart_nodeEnd(node, constructorName, element);
+      } else {
+        computer._addRegion_nodeStart_nodeEnd(node, typeName.name, element);
+        // <TypeA, TypeB>
+        typeArguments.accept(this);
+        // optional ".name"
+        if (constructorName.period != null) {
+          computer._addRegion_tokenStart_nodeEnd(
+              constructorName.period,
+              constructorName,
+              element);
+        }
       }
     }
     _safelyVisit(node.argumentList);
diff --git a/pkg/analysis_server/lib/src/domain_completion.dart b/pkg/analysis_server/lib/src/domain_completion.dart
index f70a1e9..cdda8f2 100644
--- a/pkg/analysis_server/lib/src/domain_completion.dart
+++ b/pkg/analysis_server/lib/src/domain_completion.dart
@@ -25,6 +25,11 @@
   int _nextCompletionId = 0;
 
   /**
+   * Code completion peformance for the last completion operation.
+   */
+  CompletionPerformance performance;
+
+  /**
    * Initialize a new request handler for the given [server].
    */
   CompletionDomainHandler(this.server);
@@ -46,25 +51,31 @@
    * Process a `completion.getSuggestions` request.
    */
   Response processRequest(Request request) {
+    performance = new CompletionPerformance();
     // extract params
-    var params = new CompletionGetSuggestionsParams.fromRequest(request);
+    CompletionGetSuggestionsParams params =
+        new CompletionGetSuggestionsParams.fromRequest(request);
     // schedule completion analysis
     String completionId = (_nextCompletionId++).toString();
     CompletionManager.create(
         server.getAnalysisContext(params.file),
         server.getSource(params.file),
         params.offset,
-        server.searchEngine).results().listen((CompletionResult result) {
+        server.searchEngine,
+        performance).results().listen((CompletionResult result) {
       sendCompletionNotification(
           completionId,
           result.replacementOffset,
           result.replacementLength,
           result.suggestions,
           result.last);
+      if (result.last) {
+        performance.complete();
+      }
     });
     // initial response without results
-    return new CompletionGetSuggestionsResult(completionId).toResponse(
-        request.id);
+    return new CompletionGetSuggestionsResult(
+        completionId).toResponse(request.id);
   }
 
   /**
@@ -72,7 +83,12 @@
    */
   void sendCompletionNotification(String completionId, int replacementOffset,
       int replacementLength, Iterable<CompletionSuggestion> results, bool isLast) {
-    server.sendNotification(new CompletionResultsParams(completionId,
-        replacementOffset, replacementLength, results, isLast).toNotification());
+    server.sendNotification(
+        new CompletionResultsParams(
+            completionId,
+            replacementOffset,
+            replacementLength,
+            results,
+            isLast).toNotification());
   }
 }
diff --git a/pkg/analysis_server/lib/src/domain_execution.dart b/pkg/analysis_server/lib/src/domain_execution.dart
index d4c371a..f176c08 100644
--- a/pkg/analysis_server/lib/src/domain_execution.dart
+++ b/pkg/analysis_server/lib/src/domain_execution.dart
@@ -177,8 +177,6 @@
       => server.contextDirectoryManager.isInAnalysisRoot(filePath);
 
   void _reportCurrentFileStatus() {
-    Map<String, List<String>> dartToHtml = new HashMap<String, List<String>>();
-    Map<String, List<String>> htmlToDart = new HashMap<String, List<String>>();
     for (AnalysisContext context in server.getAnalysisContexts()) {
       List<Source> librarySources = context.librarySources;
       List<Source> clientSources = context.launchableClientLibrarySources;
diff --git a/pkg/analysis_server/lib/src/edit/edit_domain.dart b/pkg/analysis_server/lib/src/edit/edit_domain.dart
index a918b57..693200e 100644
--- a/pkg/analysis_server/lib/src/edit/edit_domain.dart
+++ b/pkg/analysis_server/lib/src/edit/edit_domain.dart
@@ -294,7 +294,6 @@
    */
   Future<RefactoringStatus> _init(RefactoringKind kind, String file, int offset,
       int length) {
-    List<RefactoringProblem> problems = <RefactoringProblem>[];
     // check if we can continue with the existing Refactoring instance
     if (this.kind == kind &&
         this.file == file &&
@@ -373,6 +372,15 @@
       if (nodes.isNotEmpty && elements.isNotEmpty) {
         AstNode node = nodes[0];
         Element element = elements[0];
+        // climb from "Class" in "new Class()" to "new Class()"
+        if (node.parent is TypeName &&
+            node.parent.parent is ConstructorName &&
+            node.parent.parent.parent is InstanceCreationExpression) {
+          InstanceCreationExpression creation = node.parent.parent.parent;
+          node = creation;
+          element = creation.staticElement;
+        }
+        // do create the refactoring
         refactoring = new RenameRefactoring(searchEngine, element);
         feedback =
             new RenameFeedback(node.offset, node.length, 'kind', 'oldName');
diff --git a/pkg/analysis_server/lib/src/generated_protocol.dart b/pkg/analysis_server/lib/src/generated_protocol.dart
index 87020a8..0df308f 100644
--- a/pkg/analysis_server/lib/src/generated_protocol.dart
+++ b/pkg/analysis_server/lib/src/generated_protocol.dart
@@ -5571,6 +5571,12 @@
  * }
  */
 class CompletionSuggestionKind implements Enum {
+  /**
+   * A list of arguments for the method or function that is being invoked. For
+   * this suggestion kind, the completion field is a textual representation of
+   * the invocation and the parameterNames, parameterTypes, and
+   * requiredParameterCount attributes are defined.
+   */
   static const ARGUMENT_LIST = const CompletionSuggestionKind._("ARGUMENT_LIST");
 
   static const IMPORT = const CompletionSuggestionKind._("IMPORT");
diff --git a/pkg/analysis_server/lib/src/get_handler.dart b/pkg/analysis_server/lib/src/get_handler.dart
index f9b26b1..a13bcf6 100644
--- a/pkg/analysis_server/lib/src/get_handler.dart
+++ b/pkg/analysis_server/lib/src/get_handler.dart
@@ -9,11 +9,14 @@
 import 'dart:math';
 
 import 'package:analysis_server/src/analysis_server.dart';
+import 'package:analysis_server/src/domain_completion.dart';
+import 'package:analysis_server/src/services/completion/completion_manager.dart';
 import 'package:analysis_server/src/socket_server.dart';
 import 'package:analyzer/file_system/file_system.dart';
-import 'package:analyzer/src/generated/source.dart';
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/java_engine.dart';
+import 'package:analyzer/src/generated/source.dart';
+
 import 'analysis_server.dart';
 
 /**
@@ -26,6 +29,11 @@
   static const String STATUS_PATH = '/status';
 
   /**
+   * The path used to request code completion information.
+   */
+  static const String COMPLETION_PATH = '/completion';
+
+  /**
    * The path used to request the list of source files in a certain cache
    * state.
    */
@@ -73,6 +81,8 @@
       _returnServerStatus(request);
     } else if (path == CACHE_STATE_PATH) {
       _returnCacheState(request);
+    } else if (path == COMPLETION_PATH) {
+      _returnCompletionInfo(request);
     } else {
       _returnUnknownRequest(request);
     }
@@ -95,7 +105,8 @@
     // Figure out what CacheState is being searched for.
     String stateQueryParam = request.uri.queryParameters[STATE_QUERY_PARAM];
     if (stateQueryParam == null) {
-      return _returnFailure(request,
+      return _returnFailure(
+          request,
           'Query parameter $STATE_QUERY_PARAM required');
     }
     CacheState stateFilter = null;
@@ -105,14 +116,16 @@
       }
     }
     if (stateFilter == null) {
-      return _returnFailure(request,
+      return _returnFailure(
+          request,
           'Query parameter $STATE_QUERY_PARAM is invalid');
     }
 
     // Figure out which context is being searched for.
     String contextFilter = request.uri.queryParameters[CONTEXT_QUERY_PARAM];
     if (contextFilter == null) {
-      return _returnFailure(request,
+      return _returnFailure(
+          request,
           'Query parameter $CONTEXT_QUERY_PARAM required');
     }
 
@@ -120,7 +133,8 @@
     String descriptorFilter =
         request.uri.queryParameters[DESCRIPTOR_QUERY_PARAM];
     if (descriptorFilter == null) {
-      return _returnFailure(request,
+      return _returnFailure(
+          request,
           'Query parameter $DESCRIPTOR_QUERY_PARAM required');
     }
 
@@ -143,13 +157,14 @@
     response.write('</h1>');
     response.write('<ul>');
     int count = 0;
-    analysisServer.folderMap.forEach((Folder folder,
-                                      AnalysisContextImpl context) {
+    analysisServer.folderMap.forEach(
+        (Folder folder, AnalysisContextImpl context) {
       if (folder.path != contextFilter) {
         return;
       }
-      context.visitCacheItems((Source source, SourceEntry dartEntry,
-                               DataDescriptor rowDesc, CacheState state) {
+      context.visitCacheItems(
+          (Source source, SourceEntry dartEntry, DataDescriptor rowDesc, CacheState state)
+              {
         if (state != stateFilter || rowDesc.toString() != descriptorFilter) {
           return;
         }
@@ -165,6 +180,52 @@
   }
 
   /**
+   * Return a response displaying code completion information.
+   */
+  void _returnCompletionInfo(HttpRequest request) {
+    var refresh = request.requestedUri.queryParameters['refresh'];
+    HttpResponse response = request.response;
+    response.statusCode = HttpStatus.OK;
+    response.headers.add(HttpHeaders.CONTENT_TYPE, "text/html");
+    response.write('<html>');
+    response.write('<head>');
+    response.write('<title>Dart Analysis Server - Completion Stats</title>');
+    response.write('<style>');
+    response.write('td.right {text-align: right;}');
+    response.write('</style>');
+    if (refresh is String) {
+      int seconds = int.parse(refresh, onError: (_) => 5);
+      response.write('<meta http-equiv="refresh" content="$seconds">');
+    }
+    response.write('</head>');
+    response.write('<body>');
+    _writeCompletionInfo(response);
+    response.write('<form>');
+    response.write(
+        '<input type="button" onClick="history.go(0)" value="Refresh">');
+    response.write('</form>');
+    response.write('<p>Append "?refresh=5" to refresh every 5 seconds</p>');
+    response.write('</body>');
+    response.write('</html>');
+    response.close();
+  }
+
+  void _returnFailure(HttpRequest request, String message) {
+    HttpResponse response = request.response;
+    response.statusCode = HttpStatus.OK;
+    response.headers.add(HttpHeaders.CONTENT_TYPE, "text/html");
+    response.write('<html>');
+    response.write('<head>');
+    response.write('<title>Dart Analysis Server - Failure</title>');
+    response.write('</head>');
+    response.write('<body>');
+    response.write(HTML_ESCAPE.convert(message));
+    response.write('</body>');
+    response.write('</html>');
+    response.close();
+  }
+
+  /**
    * Return a response indicating the status of the analysis server.
    */
   void _returnServerStatus(HttpRequest request) {
@@ -197,8 +258,8 @@
       _writeRow(response, headerRowText, header: true);
       Map<Folder, AnalysisContext> folderMap = analysisServer.folderMap;
       List<Folder> folders = folderMap.keys.toList();
-      folders.sort((Folder first, Folder second)
-          => first.shortName.compareTo(second.shortName));
+      folders.sort(
+          (Folder first, Folder second) => first.shortName.compareTo(second.shortName));
       folders.forEach((Folder folder) {
         AnalysisContextImpl context = folderMap[folder];
         String key = folder.shortName;
@@ -212,7 +273,8 @@
             totals[state] += row.getCount(state);
           }
         });
-        List rowText = ['<a href="#context_${HTML_ESCAPE.convert(key)}">$key</a>'];
+        List rowText = [
+            '<a href="#context_${HTML_ESCAPE.convert(key)}">$key</a>'];
         for (CacheState state in CacheState.values) {
           rowText.add(totals[state]);
         }
@@ -222,7 +284,8 @@
       folders.forEach((Folder folder) {
         AnalysisContextImpl context = folderMap[folder];
         String key = folder.shortName;
-        response.write('<h2><a name="context_${HTML_ESCAPE.convert(key)}">Analysis Context: $key</a></h2>');
+        response.write(
+            '<h2><a name="context_${HTML_ESCAPE.convert(key)}">Analysis Context: $key</a></h2>');
         AnalysisContextStatistics statistics = context.statistics;
         response.write('<table>');
         _writeRow(response, headerRowText, header: true);
@@ -265,33 +328,62 @@
   void _returnUnknownRequest(HttpRequest request) {
     HttpResponse response = request.response;
     response.statusCode = HttpStatus.NOT_FOUND;
-    response.headers.add(HttpHeaders.CONTENT_TYPE, "text/plain");
-    response.write('Not found');
-    response.close();
-  }
-
-  void _returnFailure(HttpRequest request, String message) {
-    HttpResponse response = request.response;
-    response.statusCode = HttpStatus.OK;
     response.headers.add(HttpHeaders.CONTENT_TYPE, "text/html");
     response.write('<html>');
     response.write('<head>');
-    response.write('<title>Dart Analysis Server - Failure</title>');
+    response.write('<title>Dart Analysis Server - Page Not Found</title>');
     response.write('</head>');
     response.write('<body>');
-    response.write(HTML_ESCAPE.convert(message));
+    response.write('<h1>Page Not Found</h1>');
+    response.write('<p>Try one of these links instead:</p>');
+    response.write('<ul>');
+    response.write('<li><a href="$STATUS_PATH">Server Status</a></li>');
+    response.write('<li><a href="$COMPLETION_PATH">Completion Stats</a></li>');
+    response.write('<ul>');
     response.write('</body>');
     response.write('</html>');
     response.close();
   }
 
   /**
+   * Append code completion information.
+   */
+  void _writeCompletionInfo(HttpResponse response) {
+    response.write('<h1>Code Completion</h1>');
+    AnalysisServer analysisServer = _server.analysisServer;
+    if (analysisServer == null) {
+      response.write('<p>Not running</p>');
+      return;
+    }
+    CompletionDomainHandler handler = analysisServer.handlers.firstWhere(
+        (h) => h is CompletionDomainHandler,
+        orElse: () => null);
+    if (handler == null) {
+      response.write('<p>No code completion</p>');
+      return;
+    }
+    CompletionPerformance performance = handler.performance;
+    if (performance == null) {
+      response.write('<p>No performance stats yet</p>');
+      return;
+    }
+    response.write('<h2>Performance</h2>');
+    response.write('<table>');
+    _writeRow(response, ['Elapsed', '', 'Operation'], header: true);
+    performance.operations.forEach((OperationPerformance op) {
+      String elapsed = op.elapsed != null ? op.elapsed.toString() : '???';
+      _writeRow(response, [elapsed, '&nbsp;&nbsp;', op.name]);
+    });
+    response.write('</table>');
+  }
+
+  /**
    * Write a single row within a table to the given [response] object. The row
    * will have one cell for each of the [columns], and will be a header row if
    * [header] is `true`.
    */
-  void _writeRow(HttpResponse response, List<Object> columns,
-        {bool header : false, List<String> classes}) {
+  void _writeRow(HttpResponse response, List<Object> columns, {bool header:
+      false, List<String> classes}) {
     response.write('<tr>');
     int count = columns.length;
     int maxClassIndex = classes == null ? 0 : classes.length - 1;
@@ -314,7 +406,8 @@
       } else {
         response.write('</td>');
       }
-    };
+    }
+    ;
     response.write('</tr>');
   }
-}
\ No newline at end of file
+}
diff --git a/pkg/analysis_server/lib/src/services/completion/arglist_computer.dart b/pkg/analysis_server/lib/src/services/completion/arglist_computer.dart
new file mode 100644
index 0000000..6c0eaeb
--- /dev/null
+++ b/pkg/analysis_server/lib/src/services/completion/arglist_computer.dart
@@ -0,0 +1,216 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library services.completion.computer.dart.arglist;
+
+import 'dart:async';
+
+import 'package:analysis_server/src/protocol_server.dart' hide Element,
+    ElementKind;
+import 'package:analysis_server/src/services/completion/dart_completion_manager.dart';
+import 'package:analysis_server/src/services/completion/local_declaration_visitor.dart';
+import 'package:analyzer/src/generated/ast.dart';
+import 'package:analyzer/src/generated/scanner.dart';
+
+/**
+ * A computer for calculating `completion.getSuggestions` request results
+ * for the import combinators show and hide.
+ */
+class ArgListComputer extends DartCompletionComputer {
+  _ArgListSuggestionBuilder builder;
+
+  @override
+  bool computeFast(DartCompletionRequest request) {
+    builder = request.node.accept(new _ArgListAstVisitor(request));
+    return builder == null;
+  }
+
+  @override
+  Future<bool> computeFull(DartCompletionRequest request) {
+    if (builder != null) {
+      return builder.compute(request.node);
+    }
+    return new Future.value(false);
+  }
+}
+
+/**
+ * A visitor for determining whether an argument list suggestion is needed
+ * and instantiating the builder to create the suggestion.
+ */
+class _ArgListAstVisitor extends
+    GeneralizingAstVisitor<_ArgListSuggestionBuilder> {
+  final DartCompletionRequest request;
+
+  _ArgListAstVisitor(this.request);
+
+  @override
+  _ArgListSuggestionBuilder visitArgumentList(ArgumentList node) {
+    Token leftParen = node.leftParenthesis;
+    if (leftParen != null && request.offset > leftParen.offset) {
+      AstNode parent = node.parent;
+      if (parent is MethodInvocation) {
+        SimpleIdentifier selector = parent.methodName;
+        if (selector != null) {
+          String name = selector.name;
+          if (name != null && name.length > 0) {
+            if (parent.period == null) {
+              /*
+               * If a local declaration is found, then return null
+               * indicating that suggestions were added
+               * and no further action is necessary
+               */
+              if (node.accept(
+                  new _LocalDeclarationFinder(request, request.offset, name))) {
+                return null;
+              }
+            } else {
+              // determine target
+            }
+          }
+        }
+      }
+      return new _ArgListSuggestionBuilder(request);
+    }
+    return null;
+  }
+
+  @override
+  _ArgListSuggestionBuilder visitNode(AstNode node) {
+    return null;
+  }
+}
+
+/**
+ * A `_ArgListSuggestionBuilder` determines which method or function is being
+ * invoked, then builds the argument list suggestion.
+ * This operation is instantiated during `computeFast`
+ * and calculates the suggestions during `computeFull`.
+ */
+class _ArgListSuggestionBuilder {
+  final DartCompletionRequest request;
+
+  _ArgListSuggestionBuilder(this.request);
+
+  Future<bool> compute(ArgumentList node) {
+    return new Future.value(false);
+  }
+}
+
+/**
+ * `_LocalDeclarationFinder` visits an [AstNode] and its parent recursively
+ * looking for a matching declaration. If found, it adds the appropriate
+ * suggestions and sets finished to `true`.
+ */
+class _LocalDeclarationFinder extends LocalDeclarationVisitor {
+
+  final DartCompletionRequest request;
+  final String name;
+
+  _LocalDeclarationFinder(this.request, int offset, this.name) : super(offset);
+
+  @override
+  void declaredClass(ClassDeclaration declaration) {
+  }
+
+  @override
+  void declaredClassTypeAlias(ClassTypeAlias declaration) {
+  }
+
+  @override
+  void declaredField(FieldDeclaration fieldDecl,
+      VariableDeclaration varDecl) {
+  }
+
+  @override
+  void declaredFunction(FunctionDeclaration declaration) {
+    SimpleIdentifier selector = declaration.name;
+    if (selector != null && name == selector.name) {
+      finished = true;
+      _addArgListSuggestion(declaration.functionExpression.parameters);
+    }
+  }
+
+  @override
+  void declaredFunctionTypeAlias(FunctionTypeAlias declaration) {
+  }
+
+  @override
+  void declaredLabel(Label label) {
+  }
+
+  @override
+  void declaredLocalVar(SimpleIdentifier name, TypeName type) {
+  }
+
+  @override
+  void declaredMethod(MethodDeclaration declaration) {
+    SimpleIdentifier selector = declaration.name;
+    if (selector != null && name == selector.name) {
+      finished = true;
+      _addArgListSuggestion(declaration.parameters);
+    }
+  }
+
+  @override
+  void declaredParam(SimpleIdentifier name, TypeName type) {
+  }
+
+  @override
+  void declaredTopLevelVar(VariableDeclarationList varList,
+      VariableDeclaration varDecl) {
+  }
+
+  void _addArgListSuggestion(FormalParameterList parameters) {
+    if (parameters.parameters.length == 0) {
+      return;
+    }
+    StringBuffer completion = new StringBuffer('(');
+    List<String> paramNames = new List<String>();
+    List<String> paramTypes = new List<String>();
+    for (FormalParameter param in parameters.parameters) {
+      SimpleIdentifier paramId = param.identifier;
+      if (paramId != null) {
+        String name = paramId.name;
+        if (name != null && name.length > 0) {
+          if (completion.length > 1) {
+            completion.write(', ');
+          }
+          completion.write(name);
+          paramNames.add(name);
+          paramTypes.add(_getParamType(param));
+        }
+      }
+    }
+    completion.write(')');
+    CompletionSuggestion suggestion = new CompletionSuggestion(
+        CompletionSuggestionKind.ARGUMENT_LIST,
+        CompletionRelevance.HIGH,
+        completion.toString(),
+        completion.length,
+        0,
+        false,
+        false);
+    suggestion.parameterNames = paramNames;
+    suggestion.parameterTypes = paramTypes;
+    request.suggestions.add(suggestion);
+  }
+
+  String _getParamType(FormalParameter param) {
+    TypeName type;
+    if (param is SimpleFormalParameter) {
+      type = param.type;
+    }
+    if (type != null) {
+      Identifier id = type.name;
+      if (id != null) {
+        String name = id.name;
+        if (name != null && name.length > 0) {
+          return name;
+        }
+      }
+    }
+    return 'dynamic';
+  }
+}
diff --git a/pkg/analysis_server/lib/src/services/completion/combinator_computer.dart b/pkg/analysis_server/lib/src/services/completion/combinator_computer.dart
index d2ae886..3a4dca4 100644
--- a/pkg/analysis_server/lib/src/services/completion/combinator_computer.dart
+++ b/pkg/analysis_server/lib/src/services/completion/combinator_computer.dart
@@ -17,17 +17,21 @@
  * A computer for calculating `completion.getSuggestions` request results
  * for the import combinators show and hide.
  */
-
 class CombinatorComputer extends DartCompletionComputer {
+  _CombinatorSuggestionBuilder builder;
 
   @override
   bool computeFast(DartCompletionRequest request) {
-    return false;
+    builder = request.node.accept(new _CombinatorAstVisitor(request));
+    return builder == null;
   }
 
   @override
   Future<bool> computeFull(DartCompletionRequest request) {
-    return request.node.accept(new _CombinatorAstVisitor(request));
+    if (builder != null) {
+      return builder.execute(request.node);
+    }
+    return new Future.value(false);
   }
 }
 
@@ -35,36 +39,50 @@
  * A visitor for determining which imported classes and top level variables
  * should be suggested and building those suggestions.
  */
-class _CombinatorAstVisitor extends GeneralizingAstVisitor<Future<bool>> {
+class _CombinatorAstVisitor extends
+    GeneralizingAstVisitor<_CombinatorSuggestionBuilder> {
   final DartCompletionRequest request;
 
   _CombinatorAstVisitor(this.request);
 
   @override
-  Future<bool> visitCombinator(Combinator node) {
-    return _addCombinatorSuggestions(node);
+  _CombinatorSuggestionBuilder visitCombinator(Combinator node) {
+    return new _CombinatorSuggestionBuilder(
+        request,
+        CompletionSuggestionKind.IDENTIFIER);
   }
 
   @override
-  Future<bool> visitNode(AstNode node) {
-    return new Future.value(false);
+  _CombinatorSuggestionBuilder visitNode(AstNode node) {
+    return null;
   }
 
   @override
-  Future<bool> visitSimpleIdentifier(SimpleIdentifier node) {
+  _CombinatorSuggestionBuilder visitSimpleIdentifier(SimpleIdentifier node) {
     return node.parent.accept(this);
   }
+}
 
-  Future _addCombinatorSuggestions(Combinator node) {
+/**
+ * A `_CombinatorSuggestionBuilder` determines which imported classes
+ * and top level variables should be suggested and builds those suggestions.
+ * This operation is instantiated during `computeFast`
+ * and calculates the suggestions during `computeFull`.
+ */
+class _CombinatorSuggestionBuilder extends LibraryElementSuggestionBuilder {
+
+  _CombinatorSuggestionBuilder(DartCompletionRequest request,
+      CompletionSuggestionKind kind)
+      : super(request, kind);
+
+  Future<bool> execute(AstNode node) {
     var directive = node.getAncestor((parent) => parent is NamespaceDirective);
     if (directive is NamespaceDirective) {
       LibraryElement library = directive.uriElement;
-      LibraryElementSuggestionBuilder.suggestionsFor(
-          request,
-          CompletionSuggestionKind.IDENTIFIER,
-          library);
-      return new Future.value(true);
+      if (library != null) {
+        library.visitChildren(this);
+      }
     }
     return new Future.value(false);
   }
-}
\ No newline at end of file
+}
diff --git a/pkg/analysis_server/lib/src/services/completion/completion_manager.dart b/pkg/analysis_server/lib/src/services/completion/completion_manager.dart
index c58e308..2253056 100644
--- a/pkg/analysis_server/lib/src/services/completion/completion_manager.dart
+++ b/pkg/analysis_server/lib/src/services/completion/completion_manager.dart
@@ -7,8 +7,8 @@
 import 'dart:async';
 
 import 'package:analysis_server/src/protocol.dart';
-import 'package:analysis_server/src/services/search/search_engine.dart';
 import 'package:analysis_server/src/services/completion/dart_completion_manager.dart';
+import 'package:analysis_server/src/services/search/search_engine.dart';
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/source.dart';
 
@@ -42,10 +42,15 @@
    * Create a manager for the given request.
    */
   static CompletionManager create(AnalysisContext context, Source source,
-      int offset, SearchEngine searchEngine) {
+      int offset, SearchEngine searchEngine, CompletionPerformance performance) {
     if (context != null) {
       if (AnalysisEngine.isDartFileName(source.shortName)) {
-        return new DartCompletionManager(context, searchEngine, source, offset);
+        return new DartCompletionManager(
+            context,
+            searchEngine,
+            source,
+            offset,
+            performance);
       }
       if (AnalysisEngine.isHtmlFileName(source.shortName)) {
         //TODO (danrubel) implement
@@ -57,6 +62,51 @@
 }
 
 /**
+ * Overall performance of a code completion operation.
+ */
+class CompletionPerformance {
+  final Map<String, Duration> _startTimes = new Map<String, Duration>();
+  final Stopwatch _stopwatch = new Stopwatch();
+  final List<OperationPerformance> operations = [];
+
+  CompletionPerformance() {
+    _stopwatch.start();
+  }
+
+  void complete() {
+    _stopwatch.stop();
+    _logDuration('total time', _stopwatch.elapsed);
+  }
+
+  logElapseTime(String tag, [f() = null]) {
+    Duration start;
+    Duration end = _stopwatch.elapsed;
+    var result;
+    if (f == null) {
+      start = _startTimes[tag];
+      if (start == null) {
+        _logDuration(tag, null);
+        return null;
+      }
+    } else {
+      result = f();
+      start = end;
+      end = _stopwatch.elapsed;
+    }
+    _logDuration(tag, end - start);
+    return result;
+  }
+
+  void logStartTime(String tag) {
+    _startTimes[tag] = _stopwatch.elapsed;
+  }
+
+  void _logDuration(String tag, Duration elapsed) {
+    operations.add(new OperationPerformance(tag, elapsed));
+  }
+}
+
+/**
  * Code completion result generated by an [CompletionManager].
  */
 class CompletionResult {
@@ -102,3 +152,21 @@
     controller.add(new CompletionResult(offset, 0, [], true));
   }
 }
+
+/**
+ * The performance of an operation when computing code completion.
+ */
+class OperationPerformance {
+
+  /**
+   * The name of the operation
+   */
+  final String name;
+
+  /**
+   * The elapse time or `null` if undefined.
+   */
+  final Duration elapsed;
+
+  OperationPerformance(this.name, this.elapsed);
+}
diff --git a/pkg/analysis_server/lib/src/services/completion/dart_completion_manager.dart b/pkg/analysis_server/lib/src/services/completion/dart_completion_manager.dart
index d30a83a..bc742d4 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart_completion_manager.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart_completion_manager.dart
@@ -7,6 +7,7 @@
 import 'dart:async';
 
 import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/src/services/completion/arglist_computer.dart';
 import 'package:analysis_server/src/services/completion/combinator_computer.dart';
 import 'package:analysis_server/src/services/completion/completion_manager.dart';
 import 'package:analysis_server/src/services/completion/imported_computer.dart';
@@ -49,21 +50,24 @@
   final AnalysisContext context;
   final Source source;
   final int offset;
+  final CompletionPerformance performance;
   DartCompletionRequest request;
   List<DartCompletionComputer> computers;
 
   DartCompletionManager(this.context, SearchEngine searchEngine, this.source,
-      this.offset) {
+      this.offset, this.performance) {
     request = new DartCompletionRequest(context, searchEngine, source, offset);
   }
 
   @override
   void compute() {
-    initComputers();
-    computeFast();
-    if (!computers.isEmpty) {
-      computeFull();
-    }
+    performance.logElapseTime('compute', () {
+      initComputers();
+      computeFast();
+      if (!computers.isEmpty) {
+        computeFull();
+      }
+    });
   }
 
   /**
@@ -71,12 +75,18 @@
    * then send an initial response to the client.
    */
   void computeFast() {
-    CompilationUnit unit = context.parseCompilationUnit(source);
-    request.unit = unit;
-    request.node = new NodeLocator.con1(offset).searchWithin(unit);
-    request.node.accept(new _ReplacementOffsetBuilder(request));
-    computers.removeWhere((DartCompletionComputer c) => c.computeFast(request));
-    sendResults(computers.isEmpty);
+    performance.logElapseTime('computeFast', () {
+      CompilationUnit unit = context.parseCompilationUnit(source);
+      request.unit = unit;
+      request.node = new NodeLocator.con1(offset).searchWithin(unit);
+      request.node.accept(new _ReplacementOffsetBuilder(request));
+      computers.removeWhere((DartCompletionComputer c) {
+        return performance.logElapseTime('computeFast ${c.runtimeType}', () {
+          return c.computeFast(request);
+        });
+      });
+      sendResults(computers.isEmpty);
+    });
   }
 
   /**
@@ -84,20 +94,30 @@
    * resolved and request that each remaining computer finish their work.
    */
   void computeFull() {
+    performance.logStartTime('waitForAnalysis');
     waitForAnalysis().then((CompilationUnit unit) {
+      performance.logElapseTime('waitForAnalysis');
       if (unit == null) {
         sendResults(true);
         return;
       }
-      request.unit = unit;
-      request.node = new NodeLocator.con1(offset).searchWithin(unit);
-      int count = computers.length;
-      computers.forEach((c) {
-        c.computeFull(request).then((bool changed) {
-          bool last = --count == 0;
-          if (changed || last) {
-            sendResults(last);
-          }
+      performance.logElapseTime('computeFull', () {
+        request.unit = unit;
+        request.node = new NodeLocator.con1(offset).searchWithin(unit);
+        int count = computers.length;
+        computers.forEach((DartCompletionComputer c) {
+          String name = c.runtimeType.toString();
+          String completeTag = 'computeFull $name complete';
+          performance.logStartTime(completeTag);
+          performance.logElapseTime('computeFull $name', () {
+            c.computeFull(request).then((bool changed) {
+              performance.logElapseTime(completeTag);
+              bool last = --count == 0;
+              if (changed || last) {
+                sendResults(last);
+              }
+            });
+          });
         });
       });
     });
@@ -111,6 +131,7 @@
       computers = [
           new KeywordComputer(),
           new LocalComputer(),
+          new ArgListComputer(),
           new CombinatorComputer(),
           new ImportedComputer(),
           new InvocationComputer()];
diff --git a/pkg/analysis_server/lib/src/services/completion/local_computer.dart b/pkg/analysis_server/lib/src/services/completion/local_computer.dart
index 82d34ff..90a5908 100644
--- a/pkg/analysis_server/lib/src/services/completion/local_computer.dart
+++ b/pkg/analysis_server/lib/src/services/completion/local_computer.dart
@@ -10,7 +10,7 @@
     ElementKind;
 import 'package:analysis_server/src/protocol.dart' hide Element, ElementKind;
 import 'package:analysis_server/src/services/completion/dart_completion_manager.dart';
-import 'package:analysis_server/src/services/completion/suggestion_builder.dart';
+import 'package:analysis_server/src/services/completion/local_declaration_visitor.dart';
 import 'package:analyzer/src/generated/ast.dart';
 import 'package:analyzer/src/generated/scanner.dart';
 
@@ -23,9 +23,9 @@
   @override
   bool computeFast(DartCompletionRequest request) {
 
-    // Find the specific child [AstNode] that contains the completion offset
-    // and collect suggestions starting with that node
-    request.node.accept(new _LocalVisitor(request));
+    // Collect suggestions from the specific child [AstNode] that contains
+    // the completion offset and all of its parents recursively.
+    request.node.accept(new _LocalVisitor(request, request.offset));
 
     // If the unit is not a part and does not reference any parts
     // then work is complete
@@ -46,265 +46,23 @@
  * A visitor for collecting suggestions from the most specific child [AstNode]
  * that contains the completion offset to the [CompilationUnit].
  */
-class _LocalVisitor extends GeneralizingAstVisitor<dynamic> {
+class _LocalVisitor extends LocalDeclarationVisitor {
   static const DYNAMIC = 'dynamic';
 
   static final TypeName NO_RETURN_TYPE = new TypeName(
       new SimpleIdentifier(new StringToken(TokenType.IDENTIFIER, '', 0)),
       null);
 
-  static final TypeName STACKTRACE_TYPE = new TypeName(
-      new SimpleIdentifier(new StringToken(TokenType.IDENTIFIER, 'StackTrace', 0)),
-      null);
-
   final DartCompletionRequest request;
   bool typesOnly = false;
   bool excludeVoidReturn;
 
-  _LocalVisitor(this.request) {
+  _LocalVisitor(this.request, int offset) : super(offset) {
     excludeVoidReturn = _computeExcludeVoidReturn(request.node);
   }
 
   @override
-  visitBlock(Block node) {
-    node.statements.forEach((Statement stmt) {
-      if (stmt.offset < request.offset) {
-        if (stmt is LabeledStatement) {
-          stmt.labels.forEach((Label label) {
-//            _addSuggestion(label.label, CompletionSuggestionKind.LABEL);
-          });
-        } else if (stmt is VariableDeclarationStatement) {
-          var varList = stmt.variables;
-          if (varList != null) {
-            varList.variables.forEach((VariableDeclaration varDecl) {
-              if (varDecl.end < request.offset) {
-                _addLocalVarSuggestion(varDecl.name, varList.type);
-              }
-            });
-          }
-        }
-      }
-    });
-    visitNode(node);
-  }
-
-  @override
-  visitCascadeExpression(CascadeExpression node) {
-    Expression target = node.target;
-    // This computer handles the expression
-    // while InvocationComputer handles the cascade selector
-    if (target != null && request.offset <= target.end) {
-      visitNode(node);
-    }
-  }
-
-  @override
-  visitCatchClause(CatchClause node) {
-    _addParamSuggestion(node.exceptionParameter, node.exceptionType);
-    _addParamSuggestion(node.stackTraceParameter, STACKTRACE_TYPE);
-    visitNode(node);
-  }
-
-  @override
-  visitClassDeclaration(ClassDeclaration node) {
-    _addClassDeclarationMembers(node);
-    visitInheritedTypes(node, (ClassDeclaration classNode) {
-      _addClassDeclarationMembers(classNode);
-    }, (String typeName) {
-      // ignored
-    });
-    visitNode(node);
-  }
-
-  @override
-  visitCombinator(Combinator node) {
-    // Handled by ImportedComputer
-  }
-
-  @override
-  visitCompilationUnit(CompilationUnit node) {
-    node.declarations.forEach((Declaration declaration) {
-      if (declaration is ClassDeclaration) {
-        _addClassSuggestion(declaration);
-      } else if (declaration is EnumDeclaration) {
-//        _addSuggestion(d.name, CompletionSuggestionKind.ENUM);
-      } else if (declaration is FunctionDeclaration) {
-        _addFunctionSuggestion(declaration);
-      } else if (declaration is TopLevelVariableDeclaration) {
-        _addTopLevelVarSuggestions(declaration.variables);
-      } else if (declaration is ClassTypeAlias) {
-        bool isDeprecated = _isDeprecated(declaration);
-        CompletionSuggestion suggestion =
-            _addSuggestion(declaration.name, null, null, isDeprecated);
-        if (suggestion != null) {
-          suggestion.element = _createElement(
-              protocol.ElementKind.CLASS_TYPE_ALIAS,
-              declaration.name,
-              null,
-              NO_RETURN_TYPE,
-              true,
-              isDeprecated);
-        }
-      } else if (declaration is FunctionTypeAlias) {
-        bool isDeprecated = _isDeprecated(declaration);
-        CompletionSuggestion suggestion =
-            _addSuggestion(declaration.name, declaration.returnType, null, isDeprecated);
-        if (suggestion != null) {
-          // TODO (danrubel) determine parameters and return type
-          suggestion.element = _createElement(
-              protocol.ElementKind.FUNCTION_TYPE_ALIAS,
-              declaration.name,
-              null,
-              NO_RETURN_TYPE,
-              true,
-              isDeprecated);
-        }
-      }
-    });
-  }
-
-  @override
-  visitExpressionStatement(ExpressionStatement node) {
-    Expression expression = node.expression;
-    if (expression is SimpleIdentifier) {
-      if (expression.end < request.offset) {
-        // TODO (danrubel) suggest possible names for variable declaration
-        // based upon variable type
-        return;
-      }
-    }
-    visitNode(node);
-  }
-
-  @override
-  visitForEachStatement(ForEachStatement node) {
-    SimpleIdentifier id;
-    TypeName type;
-    DeclaredIdentifier loopVar = node.loopVariable;
-    if (loopVar != null) {
-      id = loopVar.identifier;
-      type = loopVar.type;
-    } else {
-      id = node.identifier;
-      type = null;
-    }
-    _addLocalVarSuggestion(id, type);
-    visitNode(node);
-  }
-
-  @override
-  visitForStatement(ForStatement node) {
-    var varList = node.variables;
-    if (varList != null) {
-      varList.variables.forEach((VariableDeclaration varDecl) {
-        _addLocalVarSuggestion(varDecl.name, varList.type);
-      });
-    }
-    visitNode(node);
-  }
-
-  @override
-  visitFunctionDeclaration(FunctionDeclaration node) {
-    // This is added by the compilation unit containing it
-    //_addSuggestion(node.name, CompletionSuggestionKind.FUNCTION);
-    visitNode(node);
-  }
-
-  @override
-  visitFunctionExpression(FunctionExpression node) {
-    _addParamListSuggestions(node.parameters);
-    visitNode(node);
-  }
-
-  @override
-  visitInterpolationExpression(InterpolationExpression node) {
-    visitNode(node);
-  }
-
-  @override
-  visitMethodDeclaration(MethodDeclaration node) {
-    _addParamListSuggestions(node.parameters);
-    visitNode(node);
-  }
-
-  @override
-  visitMethodInvocation(MethodInvocation node) {
-    // InvocationComputer adds suggestions for method selector
-    Token period = node.period;
-    if (period != null && period.offset < request.offset) {
-      ArgumentList argumentList = node.argumentList;
-      if (argumentList == null || request.offset <= argumentList.offset) {
-        return;
-      }
-    }
-    visitNode(node);
-  }
-
-  @override
-  visitNamespaceDirective(NamespaceDirective node) {
-    // No suggestions
-  }
-
-  @override
-  visitNode(AstNode node) {
-    node.parent.accept(this);
-  }
-
-  @override
-  visitPrefixedIdentifier(PrefixedIdentifier node) {
-    // InvocationComputer adds suggestions for prefixed elements
-    // but this computer adds suggestions for the prefix itself
-    SimpleIdentifier prefix = node.prefix;
-    if (prefix == null || request.offset <= prefix.end) {
-      visitNode(node);
-    }
-  }
-
-  @override
-  visitPropertyAccess(PropertyAccess node) {
-    // InvocationComputer adds suggestions for property access selector
-  }
-
-  @override
-  visitStringInterpolation(StringInterpolation node) {
-    visitNode(node);
-  }
-
-  @override
-  visitStringLiteral(StringLiteral node) {
-    // ignore
-  }
-
-  @override
-  visitTypeName(TypeName node) {
-    // If suggesting completions within a TypeName node
-    // then limit suggestions to only types
-    typesOnly = true;
-    return visitNode(node);
-  }
-
-  @override
-  visitVariableDeclaration(VariableDeclaration node) {
-    // Do not add suggestions if editing the name in a var declaration
-    SimpleIdentifier name = node.name;
-    if (name == null ||
-        name.offset < request.offset ||
-        request.offset > name.end) {
-      visitNode(node);
-    }
-  }
-
-  void _addClassDeclarationMembers(ClassDeclaration node) {
-    node.members.forEach((ClassMember classMbr) {
-      if (classMbr is FieldDeclaration) {
-        _addFieldSuggestions(node, classMbr);
-      } else if (classMbr is MethodDeclaration) {
-        _addMethodSuggestion(node, classMbr);
-      }
-    });
-  }
-
-  void _addClassSuggestion(ClassDeclaration declaration) {
+  void declaredClass(ClassDeclaration declaration) {
     bool isDeprecated = _isDeprecated(declaration);
     CompletionSuggestion suggestion =
         _addSuggestion(declaration.name, null, null, isDeprecated);
@@ -313,37 +71,87 @@
           protocol.ElementKind.CLASS,
           declaration.name,
           null,
-          NO_RETURN_TYPE,
+          _LocalVisitor.NO_RETURN_TYPE,
           declaration.isAbstract,
           isDeprecated);
     }
   }
 
-  void _addFieldSuggestions(ClassDeclaration node, FieldDeclaration fieldDecl) {
+  @override
+  void declaredClassTypeAlias(ClassTypeAlias declaration) {
+    bool isDeprecated = _isDeprecated(declaration);
+    CompletionSuggestion suggestion =
+        _addSuggestion(declaration.name, null, null, isDeprecated);
+    if (suggestion != null) {
+      suggestion.element = _createElement(
+          protocol.ElementKind.CLASS_TYPE_ALIAS,
+          declaration.name,
+          null,
+          NO_RETURN_TYPE,
+          true,
+          isDeprecated);
+    }
+  }
+
+  @override
+  void declaredField(FieldDeclaration fieldDecl, VariableDeclaration varDecl) {
     if (typesOnly) {
       return;
     }
-    bool isDeprecated = _isDeprecated(fieldDecl);
-    fieldDecl.fields.variables.forEach((VariableDeclaration varDecl) {
-      bool isSingleFieldDeprecated = isDeprecated || _isDeprecated(varDecl);
-      CompletionSuggestion suggestion = _addSuggestion(
+    bool isDeprecated = _isDeprecated(fieldDecl) || _isDeprecated(varDecl);
+    CompletionSuggestion suggestion = _addSuggestion(
+        varDecl.name,
+        fieldDecl.fields.type,
+        fieldDecl.parent,
+        isDeprecated);
+    if (suggestion != null) {
+      suggestion.element = _createElement(
+          protocol.ElementKind.GETTER,
           varDecl.name,
+          '()',
           fieldDecl.fields.type,
-          node,
-          isSingleFieldDeprecated);
-      if (suggestion != null) {
-        suggestion.element = _createElement(
-            protocol.ElementKind.GETTER,
-            varDecl.name,
-            '()',
-            fieldDecl.fields.type,
-            false,
-            isSingleFieldDeprecated);
-      }
-    });
+          false,
+          isDeprecated);
+    }
   }
 
-  void _addFunctionSuggestion(FunctionDeclaration declaration) {
+  @override
+  bool visitCascadeExpression(CascadeExpression node) {
+    Expression target = node.target;
+    // This computer handles the expression
+    // while InvocationComputer handles the cascade selector
+    if (target != null && offset <= target.end) {
+      return visitNode(node);
+    } else {
+      return finished;
+    }
+  }
+
+  @override
+  bool visitNamespaceDirective(NamespaceDirective node) {
+    // No suggestions
+    return finished;
+  }
+
+  @override
+  bool visitStringLiteral(StringLiteral node) {
+    // ignore
+    return finished;
+  }
+
+  @override
+  bool visitVariableDeclaration(VariableDeclaration node) {
+    // Do not add suggestions if editing the name in a var declaration
+    SimpleIdentifier name = node.name;
+    if (name == null || name.offset < offset || offset > name.end) {
+      return visitNode(node);
+    } else {
+      return finished;
+    }
+  }
+
+  @override
+  void declaredFunction(FunctionDeclaration declaration) {
     if (typesOnly) {
       return;
     }
@@ -364,94 +172,38 @@
     }
   }
 
-  void _addLocalVarSuggestion(SimpleIdentifier id, TypeName returnType) {
-    if (typesOnly) {
-      return;
-    }
+  @override
+  void declaredFunctionTypeAlias(FunctionTypeAlias declaration) {
+    bool isDeprecated = _isDeprecated(declaration);
     CompletionSuggestion suggestion =
-        _addSuggestion(id, returnType, null, false);
+        _addSuggestion(declaration.name, declaration.returnType, null, isDeprecated);
     if (suggestion != null) {
+      // TODO (danrubel) determine parameters and return type
       suggestion.element = _createElement(
-          protocol.ElementKind.LOCAL_VARIABLE,
-          id,
+          protocol.ElementKind.FUNCTION_TYPE_ALIAS,
+          declaration.name,
           null,
-          returnType,
-          false,
-          false);
-    }
-  }
-
-  void _addMethodSuggestion(ClassDeclaration node, MethodDeclaration classMbr) {
-    if (typesOnly) {
-      return;
-    }
-    protocol.ElementKind kind;
-    String parameters;
-    if (classMbr.isGetter) {
-      kind = protocol.ElementKind.GETTER;
-      parameters = '()';
-    } else if (classMbr.isSetter) {
-      if (excludeVoidReturn) {
-        return;
-      }
-      kind = protocol.ElementKind.SETTER;
-      parameters = '(${classMbr.returnType.toSource()} value)';
-    } else {
-      if (excludeVoidReturn && _isVoid(classMbr.returnType)) {
-        return;
-      }
-      kind = protocol.ElementKind.METHOD;
-      parameters = classMbr.parameters.toSource();
-    }
-    bool isDeprecated = _isDeprecated(classMbr);
-    CompletionSuggestion suggestion =
-        _addSuggestion(classMbr.name, classMbr.returnType, node, isDeprecated);
-    if (suggestion != null) {
-      suggestion.element = _createElement(
-          kind,
-          classMbr.name,
-          parameters,
-          classMbr.returnType,
-          classMbr.isAbstract,
+          NO_RETURN_TYPE,
+          true,
           isDeprecated);
     }
   }
 
-  void _addParamListSuggestions(FormalParameterList paramList) {
-    if (typesOnly) {
-      return;
-    }
-    if (paramList != null) {
-      paramList.parameters.forEach((FormalParameter param) {
-        NormalFormalParameter normalParam;
-        if (param is DefaultFormalParameter) {
-          normalParam = param.parameter;
-        } else if (param is NormalFormalParameter) {
-          normalParam = param;
-        }
-        TypeName type = null;
-        if (normalParam is FieldFormalParameter) {
-          type = normalParam.type;
-        } else if (normalParam is FunctionTypedFormalParameter) {
-          type = normalParam.returnType;
-        } else if (normalParam is SimpleFormalParameter) {
-          type = normalParam.type;
-        }
-        _addParamSuggestion(param.identifier, type);
-      });
-    }
+  @override
+  void declaredLabel(Label label) {
+    // ignored
   }
 
-  void _addParamSuggestion(SimpleIdentifier identifier, TypeName type) {
+  @override
+  void declaredLocalVar(SimpleIdentifier name, TypeName type) {
     if (typesOnly) {
       return;
     }
-    CompletionSuggestion suggestion =
-        _addSuggestion(identifier, type, null, false);
+    CompletionSuggestion suggestion = _addSuggestion(name, type, null, false);
     if (suggestion != null) {
       suggestion.element = _createElement(
-          protocol.ElementKind.PARAMETER,
-          identifier,
+          protocol.ElementKind.LOCAL_VARIABLE,
+          name,
           null,
           type,
           false,
@@ -459,6 +211,119 @@
     }
   }
 
+  @override
+  void declaredMethod(MethodDeclaration declaration) {
+    if (typesOnly) {
+      return;
+    }
+    protocol.ElementKind kind;
+    String parameters;
+    if (declaration.isGetter) {
+      kind = protocol.ElementKind.GETTER;
+      parameters = '()';
+    } else if (declaration.isSetter) {
+      if (excludeVoidReturn) {
+        return;
+      }
+      kind = protocol.ElementKind.SETTER;
+      parameters = '(${declaration.returnType.toSource()} value)';
+    } else {
+      if (excludeVoidReturn && _isVoid(declaration.returnType)) {
+        return;
+      }
+      kind = protocol.ElementKind.METHOD;
+      parameters = declaration.parameters.toSource();
+    }
+    bool isDeprecated = _isDeprecated(declaration);
+    CompletionSuggestion suggestion = _addSuggestion(
+        declaration.name,
+        declaration.returnType,
+        declaration.parent,
+        isDeprecated);
+    if (suggestion != null) {
+      suggestion.element = _createElement(
+          kind,
+          declaration.name,
+          parameters,
+          declaration.returnType,
+          declaration.isAbstract,
+          isDeprecated);
+    }
+  }
+
+  @override
+  void declaredParam(SimpleIdentifier name, TypeName type) {
+    if (typesOnly) {
+      return;
+    }
+    CompletionSuggestion suggestion = _addSuggestion(name, type, null, false);
+    if (suggestion != null) {
+      suggestion.element =
+          _createElement(protocol.ElementKind.PARAMETER, name, null, type, false, false);
+    }
+  }
+
+  @override
+  void declaredTopLevelVar(VariableDeclarationList varList,
+      VariableDeclaration varDecl) {
+    if (typesOnly) {
+      return;
+    }
+    bool isDeprecated = _isDeprecated(varList) || _isDeprecated(varDecl);
+    CompletionSuggestion suggestion =
+        _addSuggestion(varDecl.name, varList.type, null, isDeprecated);
+    if (suggestion != null) {
+      suggestion.element = _createElement(
+          protocol.ElementKind.TOP_LEVEL_VARIABLE,
+          varDecl.name,
+          null,
+          varList.type,
+          false,
+          isDeprecated);
+    }
+  }
+
+  @override
+  visitCombinator(Combinator node) {
+    // Handled by CombinatorComputer
+  }
+
+  @override
+  visitMethodInvocation(MethodInvocation node) {
+    // InvocationComputer adds suggestions for method selector
+    Token period = node.period;
+    if (period != null && period.offset < request.offset) {
+      ArgumentList argumentList = node.argumentList;
+      if (argumentList == null || request.offset <= argumentList.offset) {
+        return;
+      }
+    }
+    visitNode(node);
+  }
+
+  @override
+  visitPrefixedIdentifier(PrefixedIdentifier node) {
+    // InvocationComputer adds suggestions for prefixed elements
+    // but this computer adds suggestions for the prefix itself
+    SimpleIdentifier prefix = node.prefix;
+    if (prefix == null || request.offset <= prefix.end) {
+      visitNode(node);
+    }
+  }
+
+  @override
+  visitPropertyAccess(PropertyAccess node) {
+    // InvocationComputer adds suggestions for property access selector
+  }
+
+  @override
+  visitTypeName(TypeName node) {
+    // If suggesting completions within a TypeName node
+    // then limit suggestions to only types
+    typesOnly = true;
+    return visitNode(node);
+  }
+
   CompletionSuggestion _addSuggestion(SimpleIdentifier id, TypeName typeName,
       ClassDeclaration classDecl, bool isDeprecated) {
     if (id != null) {
@@ -497,29 +362,6 @@
     return null;
   }
 
-  void _addTopLevelVarSuggestions(VariableDeclarationList varList) {
-    if (typesOnly) {
-      return;
-    }
-    if (varList != null) {
-      bool isDeprecated = _isDeprecated(varList);
-      varList.variables.forEach((VariableDeclaration varDecl) {
-        bool isSingleVarDeprecated = isDeprecated || _isDeprecated(varDecl);
-        CompletionSuggestion suggestion =
-            _addSuggestion(varDecl.name, varList.type, null, isSingleVarDeprecated);
-        if (suggestion != null) {
-          suggestion.element = _createElement(
-              protocol.ElementKind.TOP_LEVEL_VARIABLE,
-              varDecl.name,
-              null,
-              varList.type,
-              false,
-              isSingleVarDeprecated);
-        }
-      });
-    }
-  }
-
   bool _computeExcludeVoidReturn(AstNode node) {
     if (node is Block) {
       return false;
@@ -530,6 +372,7 @@
     }
   }
 
+
   /**
    * Create a new protocol Element for inclusion in a completion suggestion.
    */
@@ -549,7 +392,6 @@
         returnType: _nameForType(returnType));
   }
 
-
   /**
    * Return `true` if the @deprecated annotation is present
    */
diff --git a/pkg/analysis_server/lib/src/services/completion/local_declaration_visitor.dart b/pkg/analysis_server/lib/src/services/completion/local_declaration_visitor.dart
new file mode 100644
index 0000000..09ed9e3
--- /dev/null
+++ b/pkg/analysis_server/lib/src/services/completion/local_declaration_visitor.dart
@@ -0,0 +1,229 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library services.completion.computer.dart.local.Declaration.visitor;
+
+import 'package:analysis_server/src/services/completion/suggestion_builder.dart';
+import 'package:analyzer/src/generated/ast.dart';
+import 'package:analyzer/src/generated/scanner.dart';
+
+/**
+ * `LocalDeclarationCollector` visits an [AstNode] and its parent recursively
+ * along with any declarations in those nodes. Setting the [finished] flag
+ * `true` will prevent further recursion.
+ */
+abstract class LocalDeclarationVisitor extends GeneralizingAstVisitor<bool> {
+
+  static final TypeName STACKTRACE_TYPE = new TypeName(
+      new SimpleIdentifier(new StringToken(TokenType.IDENTIFIER, 'StackTrace', 0)),
+      null);
+
+  final int offset;
+  bool finished = false;
+
+  LocalDeclarationVisitor(this.offset);
+
+  void declaredClass(ClassDeclaration declaration);
+
+  void declaredClassTypeAlias(ClassTypeAlias declaration);
+
+  void declaredField(FieldDeclaration fieldDecl, VariableDeclaration varDecl);
+
+  void declaredFunction(FunctionDeclaration declaration);
+
+  void declaredFunctionTypeAlias(FunctionTypeAlias declaration);
+
+  void declaredLabel(Label label);
+
+  void declaredLocalVar(SimpleIdentifier name, TypeName type);
+
+  void declaredMethod(MethodDeclaration declaration);
+
+  void declaredParam(SimpleIdentifier name, TypeName type);
+
+  void declaredTopLevelVar(VariableDeclarationList varList,
+      VariableDeclaration varDecl);
+
+  @override
+  bool visitBlock(Block node) {
+    node.statements.forEach((Statement stmt) {
+      if (stmt.offset < offset) {
+        if (stmt is LabeledStatement) {
+          stmt.labels.forEach((Label label) {
+            declaredLabel(label);
+          });
+        } else if (stmt is VariableDeclarationStatement) {
+          VariableDeclarationList varList = stmt.variables;
+          if (varList != null) {
+            varList.variables.forEach((VariableDeclaration varDecl) {
+              if (varDecl.end < offset) {
+                declaredLocalVar(varDecl.name, varList.type);
+              }
+            });
+          }
+        }
+      }
+    });
+    return visitNode(node);
+  }
+
+  @override
+  bool visitCatchClause(CatchClause node) {
+    SimpleIdentifier param = node.exceptionParameter;
+    if (param != null) {
+      declaredParam(param, node.exceptionType);
+    }
+    param = node.stackTraceParameter;
+    if (param != null) {
+      declaredParam(param, STACKTRACE_TYPE);
+    }
+    return visitNode(node);
+  }
+
+  @override
+  bool visitClassDeclaration(ClassDeclaration node) {
+    _visitClassDeclarationMembers(node);
+    visitInheritedTypes(node, (ClassDeclaration classNode) {
+      _visitClassDeclarationMembers(classNode);
+    }, (String typeName) {
+      // ignored
+    });
+    return visitNode(node);
+  }
+
+  @override
+  bool visitCompilationUnit(CompilationUnit node) {
+    node.declarations.forEach((Declaration declaration) {
+      if (declaration is ClassDeclaration) {
+        declaredClass(declaration);
+      } else if (declaration is EnumDeclaration) {
+        // TODO (danrubel) enum support
+//        declaredEnum(........)
+      } else if (declaration is FunctionDeclaration) {
+        declaredFunction(declaration);
+      } else if (declaration is TopLevelVariableDeclaration) {
+        var varList = declaration.variables;
+        if (varList != null) {
+          varList.variables.forEach((VariableDeclaration varDecl) {
+            declaredTopLevelVar(varList, varDecl);
+          });
+        }
+      } else if (declaration is ClassTypeAlias) {
+        declaredClassTypeAlias(declaration);
+      } else if (declaration is FunctionTypeAlias) {
+        declaredFunctionTypeAlias(declaration);
+      }
+    });
+    return finished;
+  }
+
+  @override
+  bool visitExpressionStatement(ExpressionStatement node) {
+    Expression expression = node.expression;
+    if (expression is SimpleIdentifier) {
+      if (expression.end < offset) {
+        return finished;
+      }
+    }
+    return visitNode(node);
+  }
+
+  @override
+  bool visitForEachStatement(ForEachStatement node) {
+    SimpleIdentifier id;
+    TypeName type;
+    DeclaredIdentifier loopVar = node.loopVariable;
+    if (loopVar != null) {
+      id = loopVar.identifier;
+      type = loopVar.type;
+    } else {
+      id = node.identifier;
+      type = null;
+    }
+    declaredLocalVar(id, type);
+    return visitNode(node);
+  }
+
+  @override
+  bool visitForStatement(ForStatement node) {
+    VariableDeclarationList varList = node.variables;
+    if (varList != null) {
+      varList.variables.forEach((VariableDeclaration varDecl) {
+        declaredLocalVar(varDecl.name, varList.type);
+      });
+    }
+    return visitNode(node);
+  }
+
+  @override
+  bool visitFunctionDeclaration(FunctionDeclaration node) {
+    // declaredFunction is called by the compilation unit containing it
+    return visitNode(node);
+  }
+
+  @override
+  bool visitFunctionExpression(FunctionExpression node) {
+    _visitParamList(node.parameters);
+    return visitNode(node);
+  }
+
+  @override
+  bool visitInterpolationExpression(InterpolationExpression node) {
+    return visitNode(node);
+  }
+
+  @override
+  bool visitMethodDeclaration(MethodDeclaration node) {
+    _visitParamList(node.parameters);
+    return visitNode(node);
+  }
+
+  @override
+  bool visitNode(AstNode node) {
+    if (finished) {
+      return true;
+    }
+    return node.parent.accept(this);
+  }
+
+  @override
+  bool visitStringInterpolation(StringInterpolation node) {
+    return visitNode(node);
+  }
+
+  void _visitClassDeclarationMembers(ClassDeclaration node) {
+    node.members.forEach((ClassMember member) {
+      if (member is FieldDeclaration) {
+        member.fields.variables.forEach((VariableDeclaration varDecl) {
+          declaredField(member, varDecl);
+        });
+      } else if (member is MethodDeclaration) {
+        declaredMethod(member);
+      }
+    });
+  }
+
+  void _visitParamList(FormalParameterList paramList) {
+    if (paramList != null) {
+      paramList.parameters.forEach((FormalParameter param) {
+        NormalFormalParameter normalParam;
+        if (param is DefaultFormalParameter) {
+          normalParam = param.parameter;
+        } else if (param is NormalFormalParameter) {
+          normalParam = param;
+        }
+        TypeName type = null;
+        if (normalParam is FieldFormalParameter) {
+          type = normalParam.type;
+        } else if (normalParam is FunctionTypedFormalParameter) {
+          type = normalParam.returnType;
+        } else if (normalParam is SimpleFormalParameter) {
+          type = normalParam.type;
+        }
+        SimpleIdentifier name = param.identifier;
+        declaredParam(name, type);
+      });
+    }
+  }
+}
diff --git a/pkg/analysis_server/lib/src/services/correction/assist_internal.dart b/pkg/analysis_server/lib/src/services/correction/assist_internal.dart
index 4358dd3..1837024 100644
--- a/pkg/analysis_server/lib/src/services/correction/assist_internal.dart
+++ b/pkg/analysis_server/lib/src/services/correction/assist_internal.dart
@@ -6,7 +6,7 @@
 
 import 'dart:collection';
 
-import 'package:analysis_server/src/protocol.dart' hide Element;
+import 'package:analysis_server/src/protocol_server.dart' hide Element;
 import 'package:analysis_server/src/services/correction/assist.dart';
 import 'package:analysis_server/src/services/correction/name_suggestion.dart';
 import 'package:analysis_server/src/services/correction/source_buffer.dart';
@@ -17,6 +17,7 @@
 import 'package:analysis_server/src/services/search/search_engine.dart';
 import 'package:analyzer/src/generated/ast.dart';
 import 'package:analyzer/src/generated/element.dart';
+import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/java_core.dart';
 import 'package:analyzer/src/generated/scanner.dart';
 import 'package:analyzer/src/generated/source.dart';
@@ -38,24 +39,27 @@
   final CompilationUnit unit;
   final int selectionOffset;
   final int selectionLength;
+  AnalysisContext context;
   CompilationUnitElement unitElement;
   LibraryElement unitLibraryElement;
   String unitLibraryFile;
   String unitLibraryFolder;
 
-  final List<SourceEdit> edits = <SourceEdit>[];
+  final List<Assist> assists = <Assist>[];
   final Map<String, LinkedEditGroup> linkedPositionGroups = <String,
       LinkedEditGroup>{};
   Position exitPosition = null;
-  final List<Assist> assists = <Assist>[];
 
   int selectionEnd;
   CorrectionUtils utils;
   AstNode node;
 
+  SourceChange change = new SourceChange('<message>');
+
   AssistProcessor(this.searchEngine, this.source, this.file, this.unit,
       this.selectionOffset, this.selectionLength) {
     unitElement = unit.element;
+    context = unitElement.context;
     unitLibraryElement = unitElement.library;
     unitLibraryFile = unitLibraryElement.source.fullName;
     unitLibraryFolder = dirname(unitLibraryFile);
@@ -136,17 +140,12 @@
       assistFile = file;
     }
     // check is there are any edits
-    if (edits.isEmpty) {
+    if (change.edits.isEmpty) {
       _coverageMarker();
       return;
     }
-    // prepare file edit
-    SourceFileEdit fileEdit = new SourceFileEdit(file, fileStamp);
-    fileEdit.addAll(edits);
     // prepare Change
-    String message = formatList(kind.message, args);
-    SourceChange change = new SourceChange(message);
-    change.addFileEdit(fileEdit);
+    change.message = formatList(kind.message, args);
     linkedPositionGroups.values.forEach(
         (group) => change.addLinkedEditGroup(group));
     change.selection = exitPosition;
@@ -154,17 +153,62 @@
     Assist assist = new Assist(kind, change);
     assists.add(assist);
     // clear
-    edits.clear();
+    change = new SourceChange('<message>');
     linkedPositionGroups.clear();
     exitPosition = null;
   }
 
+  void _addIndentEdit(SourceRange range, String oldIndent, String newIndent) {
+    SourceEdit edit = utils.createIndentEdit(range, oldIndent, newIndent);
+    doSourceChange_addElementEdit(change, unitElement, edit);
+  }
+
   /**
    * Adds a new [Edit] to [edits].
    */
   void _addInsertEdit(int offset, String text) {
     SourceEdit edit = new SourceEdit(offset, 0, text);
-    edits.add(edit);
+    doSourceChange_addElementEdit(change, unitElement, edit);
+  }
+
+  void _addLibraryImports(Set<LibraryElement> libraries) {
+    LibraryElement libElement = unitLibraryElement;
+    CompilationUnitElement libUnitElement = libElement.definingCompilationUnit;
+    CompilationUnit libUnit = libUnitElement.node;
+    // prepare new import location
+    int offset = 0;
+    String prefix;
+    String suffix;
+    {
+      // if no directives
+      prefix = '';
+      suffix = eol;
+      CorrectionUtils libraryUtils = new CorrectionUtils(libUnit);
+      // after last directive in library
+      for (Directive directive in libUnit.directives) {
+        if (directive is LibraryDirective || directive is ImportDirective) {
+          offset = directive.end;
+          prefix = eol;
+          suffix = '';
+        }
+      }
+      // if still at the beginning of the file, skip shebang and line comments
+      if (offset == 0) {
+        CorrectionUtils_InsertDesc desc = libraryUtils.getInsertDescTop();
+        offset = desc.offset;
+        prefix = desc.prefix;
+        suffix = desc.suffix + eol;
+      }
+    }
+    // insert imports
+    for (LibraryElement library in libraries) {
+      String importPath = getLibrarySourceUri(libElement, library.source);
+      String importCode = "${prefix}import '$importPath';$suffix";
+      doSourceChange_addElementEdit(
+          change,
+          unitLibraryElement,
+          new SourceEdit(offset, 0, importCode));
+    }
   }
 
   void _addProposal_addTypeAnnotation_DeclaredIdentifier() {
@@ -192,7 +236,9 @@
     String typeSource;
     DartType type = declaredIdentifier.identifier.bestType;
     if (type is InterfaceType || type is FunctionType) {
-      typeSource = utils.getTypeSource(type);
+      Set<LibraryElement> librariesToImport = new Set<LibraryElement>();
+      typeSource = utils.getTypeSource(type, librariesToImport);
+      _addLibraryImports(librariesToImport);
     } else {
       _coverageMarker();
       return;
@@ -244,7 +290,9 @@
     // prepare type source
     String typeSource;
     if (type is InterfaceType || type is FunctionType) {
-      typeSource = utils.getTypeSource(type);
+      Set<LibraryElement> librariesToImport = new Set<LibraryElement>();
+      typeSource = utils.getTypeSource(type, librariesToImport);
+      _addLibraryImports(librariesToImport);
     } else {
       _coverageMarker();
       return;
@@ -1264,8 +1312,7 @@
         SourceRange elseLinesRange = utils.getLinesRange(elseRange);
         String elseIndentOld = prefix;
         String elseIndentNew = "${elseIndentOld}${indent}";
-        edits.add(
-            utils.createIndentEdit(elseLinesRange, elseIndentOld, elseIndentNew));
+        _addIndentEdit(elseLinesRange, elseIndentOld, elseIndentNew);
       }
     }
     // indent "then" statements to correspond inner "if"
@@ -1274,8 +1321,7 @@
       SourceRange linesRange = utils.getLinesRangeStatements(thenStatements);
       String thenIndentOld = "${prefix}${indent}";
       String thenIndentNew = "${thenIndentOld}${indent}";
-      edits.add(
-          utils.createIndentEdit(linesRange, thenIndentOld, thenIndentNew));
+      _addIndentEdit(linesRange, thenIndentOld, thenIndentNew);
     }
     // add proposal
     _addAssist(AssistKind.SPLIT_AND_CONDITION, []);
@@ -1349,11 +1395,7 @@
     // "block"
     {
       _addInsertEdit(statementsRange.offset, "${indentOld}{${eol}");
-      {
-        SourceEdit edit =
-            utils.createIndentEdit(statementsRange, indentOld, indentNew);
-        edits.add(edit);
-      }
+      _addIndentEdit(statementsRange, indentOld, indentNew);
       _addInsertEdit(statementsRange.end, "${indentOld}}${eol}");
       exitPosition = _newPosition(lastStatement.end);
       // add proposal
@@ -1375,11 +1417,7 @@
         sb.append(eol);
         _insertBuilder(sb);
       }
-      {
-        SourceEdit edit =
-            utils.createIndentEdit(statementsRange, indentOld, indentNew);
-        edits.add(edit);
-      }
+      _addIndentEdit(statementsRange, indentOld, indentNew);
       _addInsertEdit(statementsRange.end, "${indentOld}}${eol}");
       exitPosition = _newPosition(lastStatement.end);
       // add proposal
@@ -1401,11 +1439,7 @@
         sb.append(eol);
         _insertBuilder(sb);
       }
-      {
-        SourceEdit edit =
-            utils.createIndentEdit(statementsRange, indentOld, indentNew);
-        edits.add(edit);
-      }
+      _addIndentEdit(statementsRange, indentOld, indentNew);
       _addInsertEdit(statementsRange.end, "${indentOld}}${eol}");
       exitPosition = _newPosition(lastStatement.end);
       // add proposal
@@ -1433,11 +1467,7 @@
         sb.append(eol);
         _insertBuilder(sb);
       }
-      {
-        SourceEdit edit =
-            utils.createIndentEdit(statementsRange, indentOld, indentNew);
-        edits.add(edit);
-      }
+      _addIndentEdit(statementsRange, indentOld, indentNew);
       _addInsertEdit(statementsRange.end, "${indentOld}}${eol}");
       exitPosition = _newPosition(lastStatement.end);
       // add proposal
@@ -1477,11 +1507,7 @@
         sb.append(eol);
         _insertBuilder(sb);
       }
-      {
-        SourceEdit edit =
-            utils.createIndentEdit(statementsRange, indentOld, indentNew);
-        edits.add(edit);
-      }
+      _addIndentEdit(statementsRange, indentOld, indentNew);
       _addInsertEdit(statementsRange.end, "${indentOld}}${eol}");
       exitPosition = _newPosition(lastStatement.end);
       // add proposal
@@ -1490,11 +1516,7 @@
     // "do-while"
     {
       _addInsertEdit(statementsRange.offset, "${indentOld}do {${eol}");
-      {
-        SourceEdit edit =
-            utils.createIndentEdit(statementsRange, indentOld, indentNew);
-        edits.add(edit);
-      }
+      _addIndentEdit(statementsRange, indentOld, indentNew);
       {
         int offset = statementsRange.end;
         SourceBuilder sb = new SourceBuilder(file, offset);
@@ -1516,11 +1538,7 @@
     // "try-catch"
     {
       _addInsertEdit(statementsRange.offset, "${indentOld}try {${eol}");
-      {
-        SourceEdit edit =
-            utils.createIndentEdit(statementsRange, indentOld, indentNew);
-        edits.add(edit);
-      }
+      _addIndentEdit(statementsRange, indentOld, indentNew);
       {
         int offset = statementsRange.end;
         SourceBuilder sb = new SourceBuilder(file, offset);
@@ -1562,11 +1580,7 @@
     // "try-finally"
     {
       _addInsertEdit(statementsRange.offset, "${indentOld}try {${eol}");
-      {
-        SourceEdit edit =
-            utils.createIndentEdit(statementsRange, indentOld, indentNew);
-        edits.add(edit);
-      }
+      _addIndentEdit(statementsRange, indentOld, indentNew);
       {
         int offset = statementsRange.end;
         SourceBuilder sb = new SourceBuilder(file, offset);
@@ -1608,7 +1622,7 @@
    */
   void _addReplaceEdit(SourceRange range, String text) {
     SourceEdit edit = new SourceEdit(range.offset, range.length, text);
-    edits.add(edit);
+    doSourceChange_addElementEdit(change, unitElement, edit);
   }
 
   /**
diff --git a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
index 84c5890..086ed81f 100644
--- a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
+++ b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
@@ -1057,7 +1057,7 @@
         String libraryFile = librarySource.fullName;
         // may be "package:" URI
         {
-          String libraryPackageUri = _findPackageUri(context, libraryFile);
+          String libraryPackageUri = findAbsoluteUri(context, libraryFile);
           if (libraryPackageUri != null) {
             _addFix_importLibrary(
                 FixKind.IMPORT_LIBRARY_PROJECT,
@@ -1191,7 +1191,7 @@
         if (substringAfterLast(libFile, '/') == uriName) {
           String fixedUri;
           // may be "package:" URI
-          String libPackageUri = _findPackageUri(context, libFile);
+          String libPackageUri = findAbsoluteUri(context, libFile);
           if (libPackageUri != null) {
             fixedUri = libPackageUri;
           } else {
@@ -1420,7 +1420,9 @@
       }
       // append type name
       DartType type = argument.bestType;
-      String typeSource = utils.getTypeSource(type);
+      Set<LibraryElement> librariesToImport = new Set<LibraryElement>();
+      // TODO(scheglov) use librariesToImport
+      String typeSource = utils.getTypeSource(type, librariesToImport);
       {
         sb.startPosition("TYPE${i}");
         sb.append(typeSource);
@@ -1504,7 +1506,10 @@
       MethodInvocation invocation = node.parent as MethodInvocation;
       if (invocation.methodName == node) {
         Expression target = invocation.target;
-        String targetType = utils.getExpressionTypeSource(target);
+        Set<LibraryElement> librariesToImport = new Set<LibraryElement>();
+        // TODO(scheglov) use librariesToImport
+        String targetType =
+            utils.getExpressionTypeSource(target, librariesToImport);
         // replace "target" with class name
         SourceRange range = rf.rangeNode(target);
         _addReplaceEdit(range, targetType);
@@ -1520,7 +1525,10 @@
         PrefixedIdentifier prefixed = node.parent as PrefixedIdentifier;
         if (prefixed.identifier == node) {
           Expression target = prefixed.prefix;
-          String targetType = utils.getExpressionTypeSource(target);
+          Set<LibraryElement> librariesToImport = new Set<LibraryElement>();
+          // TODO(scheglov) use librariesToImport
+          String targetType =
+              utils.getExpressionTypeSource(target, librariesToImport);
           // replace "target" with class name
           SourceRange range = rf.rangeNode(target);
           _addReplaceEdit(range, targetType);
@@ -1596,7 +1604,9 @@
         // append type name
         DartType type = parameter.type;
         if (!type.isDynamic) {
-          String typeSource = utils.getTypeSource(type);
+          Set<LibraryElement> librariesToImport = new Set<LibraryElement>();
+          // TODO(scheglov) use librariesToImport
+          String typeSource = utils.getTypeSource(type, librariesToImport);
           {
             sb.startPosition("TYPE${i}");
             sb.append(typeSource);
@@ -1659,7 +1669,6 @@
     String name = (node as SimpleIdentifier).name;
     // prepare environment
     Source targetSource = targetClassElement.source;
-    String targetFile = targetSource.fullName;
     // prepare insert offset
     ClassDeclaration targetClassNode = targetClassElement.node;
     int insertOffset = targetClassNode.end - 1;
@@ -1701,7 +1710,10 @@
   }
 
   void _appendParameterSource(SourceBuilder sb, DartType type, String name) {
-    String parameterSource = utils.getParameterSource(type, name);
+    Set<LibraryElement> librariesToImport = new Set<LibraryElement>();
+    // TODO(scheglov) use librariesToImport
+    String parameterSource =
+        utils.getParameterSource(type, name, librariesToImport);
     sb.append(parameterSource);
   }
 
@@ -1755,7 +1767,9 @@
 
   void _appendType(SourceBuilder sb, DartType type, [String groupId]) {
     if (type != null && !type.isDynamic) {
-      String typeSource = utils.getTypeSource(type);
+      Set<LibraryElement> librariesToImport = new Set<LibraryElement>();
+      // TODO(scheglov) use librariesToImport
+      String typeSource = utils.getTypeSource(type, librariesToImport);
       if (groupId != null) {
         sb.startPosition(groupId);
         sb.append(typeSource);
@@ -2073,23 +2087,6 @@
   }
 
   /**
-   * Attempts to convert the given absolute path into a "package" URI.
-   *
-   * [context] - the [AnalysisContext] to work in.
-   * [path] - the absolute path, not `null`.
-   *
-   * Returns the "package" URI, may be `null`.
-   */
-  static String _findPackageUri(AnalysisContext context, String path) {
-    Source fileSource = new NonExistingSource(path, UriKind.FILE_URI);
-    Uri uri = context.sourceFactory.restoreUri(fileSource);
-    if (uri == null) {
-      return null;
-    }
-    return uri.toString();
-  }
-
-  /**
    * @return the suggestions for given [Type] and [DartExpression], not empty.
    */
   static List<String> _getArgumentNameSuggestions(Set<String> excluded,
diff --git a/pkg/analysis_server/lib/src/services/correction/util.dart b/pkg/analysis_server/lib/src/services/correction/util.dart
index 767e399..1e9579b 100644
--- a/pkg/analysis_server/lib/src/services/correction/util.dart
+++ b/pkg/analysis_server/lib/src/services/correction/util.dart
@@ -16,6 +16,7 @@
 import 'package:analyzer/src/generated/resolver.dart';
 import 'package:analyzer/src/generated/scanner.dart';
 import 'package:analyzer/src/generated/source.dart';
+import 'package:path/path.dart';
 
 
 /**
@@ -52,7 +53,26 @@
 
 
 /**
- * TODO(scheglov) replace with nodes once there will be [CompilationUnit#getComments].
+ * Attempts to convert the given absolute path into an absolute URI, such as
+ * "dart" or "package" URI.
+ *
+ * [context] - the [AnalysisContext] to work in.
+ * [path] - the absolute path, not `null`.
+ *
+ * Returns the absolute (non-file) URI or `null`.
+ */
+String findAbsoluteUri(AnalysisContext context, String path) {
+  Source fileSource = new NonExistingSource(path, UriKind.FILE_URI);
+  Uri uri = context.sourceFactory.restoreUri(fileSource);
+  if (uri == null) {
+    return null;
+  }
+  return uri.toString();
+}
+
+
+/**
+ * TODO(scheglov) replace with nodes once there will be [CompilationUnit.getComments].
  *
  * Returns [SourceRange]s of all comments in [unit].
  */
@@ -222,6 +242,23 @@
 }
 
 /**
+ * Computes the best URI to import [what] into [from].
+ */
+String getLibrarySourceUri(LibraryElement from, Source what) {
+  String whatFile = what.fullName;
+  // check if an absolute URI (such as 'dart:' or 'package:')
+  Uri whatUri = what.uri;
+  String whatUriScheme = whatUri.scheme;
+  if (whatUriScheme != '' && whatUriScheme != 'file') {
+    return whatUri.toString();
+  }
+  // compute a relative URI
+  String fromFolder = dirname(from.source.fullName);
+  String relativeFile = relative(whatFile, from: fromFolder);
+  return split(relativeFile).join('/');
+}
+
+/**
  * Returns the line prefix from the given source, i.e. basically just a
  * whitespace prefix of the given [String].
  */
@@ -237,6 +274,7 @@
   return line.substring(0, index);
 }
 
+
 /**
  * @return the [LocalVariableElement] or [ParameterElement] if given
  *         [SimpleIdentifier] is the reference to local variable or parameter, or
@@ -390,7 +428,6 @@
   return null;
 }
 
-
 /**
  * Returns the given [Statement] if not a [Block], or the first child
  * [Statement] if a [Block], or `null` if more than one child.
@@ -406,6 +443,7 @@
   return statement;
 }
 
+
 /**
  * Returns the [String] content of the given [Source].
  */
@@ -541,7 +579,8 @@
    * Returns the actual type source of the given [Expression], may be `null`
    * if can not be resolved, should be treated as the `dynamic` type.
    */
-  String getExpressionTypeSource(Expression expression) {
+  String getExpressionTypeSource(Expression expression,
+      Set<LibraryElement> librariesToImport) {
     if (expression == null) {
       return null;
     }
@@ -549,7 +588,7 @@
     if (type.isDynamic) {
       return null;
     }
-    return getTypeSource(type);
+    return getTypeSource(type, librariesToImport);
   }
 
   /**
@@ -825,7 +864,8 @@
   /**
    * @return the source for the parameter with the given type and name.
    */
-  String getParameterSource(DartType type, String name) {
+  String getParameterSource(DartType type, String name,
+      Set<LibraryElement> librariesToImport) {
     // no type
     if (type == null || type.isDynamic) {
       return name;
@@ -837,7 +877,7 @@
       // return type
       DartType returnType = functionType.returnType;
       if (returnType != null && !returnType.isDynamic) {
-        sb.write(getTypeSource(returnType));
+        sb.write(getTypeSource(returnType, librariesToImport));
         sb.write(' ');
       }
       // parameter name
@@ -850,14 +890,16 @@
         if (i != 0) {
           sb.write(", ");
         }
-        sb.write(getParameterSource(fParameter.type, fParameter.name));
+        sb.write(
+            getParameterSource(fParameter.type, fParameter.name, librariesToImport));
       }
       sb.write(')');
       // done
       return sb.toString();
     }
     // simple type
-    return "${getTypeSource(type)} ${name}";
+    String typeSource = getTypeSource(type, librariesToImport);
+    return '$typeSource $name';
   }
 
   /**
@@ -885,8 +927,11 @@
 
   /**
    * Returns the source to reference [type] in this [CompilationUnit].
+   *
+   * Fills [librariesToImport] with [LibraryElement]s whose elements are
+   * used by the generated source, but not imported.
    */
-  String getTypeSource(DartType type) {
+  String getTypeSource(DartType type, Set<LibraryElement> librariesToImport) {
     StringBuffer sb = new StringBuffer();
     // just a Function, not FunctionTypeAliasElement
     if (type is FunctionType && type.element is! FunctionTypeAliasElement) {
@@ -900,12 +945,16 @@
       source = source.replaceAll('<dynamic, dynamic>', '');
       return source;
     }
-    // append prefix
+    // check if imported
     {
-      ImportElement imp = _getImportElement(element);
-      if (imp != null && imp.prefix != null) {
-        sb.write(imp.prefix.displayName);
-        sb.write(".");
+      ImportElement importElement = _getImportElement(element);
+      if (importElement != null) {
+        if (importElement.prefix != null) {
+          sb.write(importElement.prefix.displayName);
+          sb.write(".");
+        }
+      } else {
+        librariesToImport.add(element.library);
       }
     }
     // append simple name
@@ -930,7 +979,8 @@
           if (i != 0) {
             sb.write(", ");
           }
-          sb.write(getTypeSource(argument));
+          String argumentSrc = getTypeSource(argument, librariesToImport);
+          sb.write(argumentSrc);
         }
         sb.write(">");
       }
diff --git a/pkg/analysis_server/lib/src/services/generated/util.dart b/pkg/analysis_server/lib/src/services/generated/util.dart
index 2c89137..ebd034b 100644
--- a/pkg/analysis_server/lib/src/services/generated/util.dart
+++ b/pkg/analysis_server/lib/src/services/generated/util.dart
@@ -289,8 +289,9 @@
   }
 
   /**
-   * @return the precedence of the given node - result of [Expression#getPrecedence] if an
-   *         [Expression], negative otherwise.
+   * Return the precedence of the given [node]: the result of invoking
+   * [Expression.precedence] if the node is an [Expression], or a negative value
+   * otherwise.
    */
   static int getExpressionPrecedence(AstNode node) {
     if (node is Expression) {
@@ -425,8 +426,10 @@
   }
 
   /**
-   * @return the precedence of the given [Expression] parent. May be `-1` no operator.
-   * @see #getPrecedence(Expression)
+   * Return the precedence of the given [expression]'s parent. May be `-1` no
+   * operator.
+   *
+   * See [getPrecedence].
    */
   static int getParentPrecedence(Expression expression) {
     AstNode parent = expression.parent;
@@ -665,7 +668,8 @@
   }
 
   /**
-   * @return `true` if the given [Element#getDisplayName] equals to the given name.
+   * Return `true` if the given [element]'s display name ([Element.displayName])
+   * is equal to the given [name].
    */
   static bool hasDisplayName(Element element, String name) {
     if (element == null) {
@@ -676,7 +680,8 @@
   }
 
   /**
-   * @return `true` if the given [Element#getName] equals to the given name.
+   * Return `true` if the given [element]'s name ([Element.name]) is equal to
+   * the given [name].
    */
   static bool hasName(Element element, String name) {
     if (element == null) {
@@ -909,7 +914,7 @@
   AstNode findNode(int offset) => new NodeLocator.con1(offset).searchWithin(unit);
 
   /**
-   * TODO(scheglov) replace with nodes once there will be [CompilationUnit#getComments].
+   * TODO(scheglov) replace with nodes once there will be [CompilationUnit.comments].
    *
    * @return the [SourceRange]s of all comments in [CompilationUnit].
    */
diff --git a/pkg/analysis_server/lib/src/services/index/store/codec.dart b/pkg/analysis_server/lib/src/services/index/store/codec.dart
index 6030134..ec2bb94 100644
--- a/pkg/analysis_server/lib/src/services/index/store/codec.dart
+++ b/pkg/analysis_server/lib/src/services/index/store/codec.dart
@@ -10,6 +10,7 @@
 import 'package:analysis_server/src/services/index/store/collection.dart';
 import 'package:analyzer/src/generated/element.dart';
 import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/generated/source.dart';
 
 
 /**
@@ -98,9 +99,12 @@
 
   /**
    * Returns a unique integer that corresponds to the given [Element].
+   *
+   * If [forKey] is `true` then [element] is a part of a key, so it should use
+   * file paths instead of [Element] location URIs.
    */
-  int encode(Element element) {
-    List<int> path = _getLocationPath(element);
+  int encode(Element element, bool forKey) {
+    List<int> path = _getLocationPath(element, forKey);
     int index = _pathToIndex[path];
     if (index == null) {
       index = _indexToPath.length;
@@ -111,7 +115,7 @@
   }
 
   /**
-   * Returns an integer that corresponds to an approximated location of the given {@link Element}.
+   * Returns an integer that corresponds to an approximated location of [element].
    */
   int encodeHash(Element element) {
     List<int> path = _getLocationPathLimited(element);
@@ -139,8 +143,22 @@
     return components;
   }
 
-  List<int> _getLocationPath(Element element) {
+  /**
+   * If [usePath] is `true` then [Source] path should be used instead of URI.
+   */
+  List<int> _getLocationPath(Element element, bool usePath) {
+    // prepare the location components
     List<String> components = element.location.components;
+    if (usePath) {
+      LibraryElement library = element.library;
+      if (library != null) {
+        components[0] = library.source.fullName;
+        if (element.enclosingElement is CompilationUnitElement) {
+          components[1] = library.definingCompilationUnit.source.fullName;
+        }
+      }
+    }
+    // encode the location
     int length = components.length;
     if (_hasLocalOffset(components)) {
       List<int> path = new List<int>();
@@ -167,20 +185,33 @@
   }
 
   /**
-   * Returns an approximation of the given {@link Element}'s location.
+   * Returns an approximation of the [element]'s location.
    */
   List<int> _getLocationPathLimited(Element element) {
-    List<String> components = element.location.components;
-    int length = components.length;
-    String firstComponent = components[0];
-    String lastComponent = components[length - 1];
-    lastComponent = _substringBeforeAt(lastComponent);
+    String firstComponent;
+    {
+      LibraryElement libraryElement = element.library;
+      if (libraryElement != null) {
+        firstComponent = libraryElement.source.fullName;
+      } else {
+        firstComponent = 'null';
+      }
+    }
+    String lastComponent = element.displayName;
     int firstId = _stringCodec.encode(firstComponent);
     int lastId = _stringCodec.encode(lastComponent);
     return <int>[firstId, lastId];
   }
 
-  bool _hasLocalOffset(List<String> components) {
+  static String _getComponentUnit(Element element) {
+    LibraryElement libraryElement = element.library;
+    if (libraryElement == null) {
+      return 'null';
+    }
+    return libraryElement.definingCompilationUnit.source.fullName;
+  }
+
+  static bool _hasLocalOffset(List<String> components) {
     for (String component in components) {
       if (component.indexOf('@') != -1) {
         return true;
@@ -189,7 +220,7 @@
     return false;
   }
 
-  String _substringBeforeAt(String str) {
+  static String _substringBeforeAt(String str) {
     int atOffset = str.indexOf('@');
     if (atOffset != -1) {
       str = str.substring(0, atOffset);
diff --git a/pkg/analysis_server/lib/src/services/index/store/split_store.dart b/pkg/analysis_server/lib/src/services/index/store/split_store.dart
index 6f2e190..b0b3169 100644
--- a/pkg/analysis_server/lib/src/services/index/store/split_store.dart
+++ b/pkg/analysis_server/lib/src/services/index/store/split_store.dart
@@ -320,7 +320,7 @@
   LocationData.forData(this.elementId, this.offset, this.length, this.flags);
 
   LocationData.forObject(ElementCodec elementCodec, Location location)
-      : elementId = elementCodec.encode(location.element),
+      : elementId = elementCodec.encode(location.element, false),
         offset = location.offset,
         length = location.length,
         flags = (location.isQualified ? _FLAG_QUALIFIED : 0) |
@@ -425,7 +425,7 @@
 
   RelationKeyData.forObject(ElementCodec elementCodec,
       RelationshipCodec relationshipCodec, Element element, Relationship relationship)
-      : elementId = elementCodec.encode(element),
+      : elementId = elementCodec.encode(element, true),
         relationshipId = relationshipCodec.encode(relationship);
 
   @override
diff --git a/pkg/analysis_server/lib/src/services/refactoring/extract_method.dart b/pkg/analysis_server/lib/src/services/refactoring/extract_method.dart
index f093266..15b4ab6a 100644
--- a/pkg/analysis_server/lib/src/services/refactoring/extract_method.dart
+++ b/pkg/analysis_server/lib/src/services/refactoring/extract_method.dart
@@ -305,8 +305,10 @@
         // expression
         if (_selectionExpression != null) {
           // add return type
+          Set<LibraryElement> librariesToImport = new Set<LibraryElement>();
+          // TODO(scheglov) use librariesToImport
           String returnTypeName =
-              utils.getExpressionTypeSource(_selectionExpression);
+              utils.getExpressionTypeSource(_selectionExpression, librariesToImport);
           if (returnTypeName != null && returnTypeName != 'dynamic') {
             annotations += '${returnTypeName} ';
           }
@@ -618,7 +620,9 @@
     if (_returnType == null) {
       returnType = 'void';
     } else {
-      returnType = utils.getTypeSource(_returnType);
+      Set<LibraryElement> librariesToImport = new Set<LibraryElement>();
+      // TODO(scheglov) use librariesToImport
+      returnType = utils.getTypeSource(_returnType, librariesToImport);
     }
     if (returnType == 'dynamic') {
       returnType = '';
@@ -939,7 +943,8 @@
           new _Occurrence(nodeRange, ref.selectionRange.intersects(nodeRange));
       ref._occurrences.add(occurrence);
       // prepare mapping of parameter names to the occurrence variables
-      nodePattern.originalToPatternNames.forEach((String originalName, String patternName) {
+      nodePattern.originalToPatternNames.forEach(
+          (String originalName, String patternName) {
         String selectionName = patternToSelectionName[patternName];
         occurrence._parameterOldToOccurrenceName[selectionName] = originalName;
       });
@@ -999,7 +1004,10 @@
               ref._parametersMap[variableName];
           if (parameter == null) {
             DartType parameterType = node.bestType;
-            String parameterTypeName = ref.utils.getTypeSource(parameterType);
+            Set<LibraryElement> librariesToImport = new Set<LibraryElement>();
+            // TODO(scheglov) use librariesToImport
+            String parameterTypeName =
+                ref.utils.getTypeSource(parameterType, librariesToImport);
             parameter = new RefactoringMethodParameter(
                 RefactoringMethodParameterKind.REQUIRED,
                 parameterTypeName,
diff --git a/pkg/analysis_server/lib/src/services/search/hierarchy.dart b/pkg/analysis_server/lib/src/services/search/hierarchy.dart
index bcc8092..b2c99a1 100644
--- a/pkg/analysis_server/lib/src/services/search/hierarchy.dart
+++ b/pkg/analysis_server/lib/src/services/search/hierarchy.dart
@@ -64,9 +64,7 @@
     Set<ClassElement> subClasses = new HashSet<ClassElement>();
     for (SearchMatch match in matches) {
       ClassElement subClass = match.element;
-      if (subClass.context == seed.context) {
-        subClasses.add(subClass);
-      }
+      subClasses.add(subClass);
     }
     return subClasses;
   });
diff --git a/pkg/analysis_server/test/analysis/get_hover_test.dart b/pkg/analysis_server/test/analysis/get_hover_test.dart
index 1fe91f1..43a9313 100644
--- a/pkg/analysis_server/test/analysis/get_hover_test.dart
+++ b/pkg/analysis_server/test/analysis/get_hover_test.dart
@@ -138,7 +138,7 @@
     });
   }
 
-  test_expression_method_nvocation() {
+  test_expression_method_invocation() {
     addTestFile('''
 library my.library;
 class A {
@@ -212,6 +212,92 @@
     });
   }
 
+  test_instanceCreation_implicit() {
+    addTestFile('''
+library my.library;
+class A {
+}
+main() {
+  new A();
+}
+''');
+    return prepareHover('new A').then((HoverInformation hover) {
+      // range
+      expect(hover.offset, findOffset('new A'));
+      expect(hover.length, 'new A()'.length);
+      // element
+      expect(hover.containingLibraryName, 'my.library');
+      expect(hover.containingLibraryPath, testFile);
+      expect(hover.dartdoc, isNull);
+      expect(hover.elementDescription, 'A() → A');
+      expect(hover.elementKind, 'constructor');
+      // types
+      expect(hover.staticType, 'A');
+      expect(hover.propagatedType, isNull);
+      // no parameter
+      expect(hover.parameter, isNull);
+    });
+  }
+
+  test_instanceCreation_implicit_withTypeArgument() {
+    addTestFile('''
+library my.library;
+class A<T> {}
+main() {
+  new A<String>();
+}
+''');
+    Function onConstructor = (HoverInformation hover) {
+      // range
+      expect(hover.offset, findOffset('new A<String>'));
+      expect(hover.length, 'new A<String>()'.length);
+      // element
+      expect(hover.containingLibraryName, 'my.library');
+      expect(hover.containingLibraryPath, testFile);
+      expect(hover.dartdoc, isNull);
+      expect(hover.elementDescription, 'A() → A<String>');
+      expect(hover.elementKind, 'constructor');
+      // types
+      expect(hover.staticType, 'A<String>');
+      expect(hover.propagatedType, isNull);
+      // no parameter
+      expect(hover.parameter, isNull);
+    };
+    var futureNewA = prepareHover('new A').then(onConstructor);
+    var futureA = prepareHover('A<String>()').then(onConstructor);
+    var futureString = prepareHover('String>').then((HoverInformation hover) {
+      expect(hover.offset, findOffset('String>'));
+      expect(hover.length, 'String'.length);
+      expect(hover.elementKind, 'class');
+    });
+    return Future.wait([futureNewA, futureA, futureString]);
+  }
+
+  test_instanceCreation_named() {
+    addTestFile('''
+library my.library;
+class A {
+  /// my doc
+  A.named() {}
+}
+main() {
+  new A.named();
+}
+''');
+    var onConstructor = (HoverInformation hover) {
+      // range
+      expect(hover.offset, findOffset('new A'));
+      expect(hover.length, 'new A.named()'.length);
+      // element
+      expect(hover.dartdoc, 'my doc');
+      expect(hover.elementDescription, 'A.named() → A');
+      expect(hover.elementKind, 'constructor');
+    };
+    var futureCreation = prepareHover('new A').then(onConstructor);
+    var futureName = prepareHover('named();').then(onConstructor);
+    return Future.wait([futureCreation, futureName]);
+  }
+
   test_noHoverInfo() {
     addTestFile('''
 library my.library;
diff --git a/pkg/analysis_server/test/analysis/notification_navigation_test.dart b/pkg/analysis_server/test/analysis/notification_navigation_test.dart
index fc40264..8fea4f5 100644
--- a/pkg/analysis_server/test/analysis/notification_navigation_test.dart
+++ b/pkg/analysis_server/test/analysis/notification_navigation_test.dart
@@ -67,11 +67,13 @@
 
   /**
    * Validates that there is a region at the offset of [search] in [testFile]
-   * with the length of [search].
+   * with the given [length] or the length of [search].
    */
-  void assertHasRegionString(String search) {
+  void assertHasRegionString(String search, [int length = -1]) {
     int offset = findOffset(search);
-    int length = search.length;
+    if (length == -1) {
+      length = search.length;
+    }
     findRegion(offset, length, true);
   }
 
@@ -144,7 +146,7 @@
    *
    * If [exists] is `false`, then fails if such region exists.
    */
-  void findRegion(int offset, int length, [bool exists]) {
+  void findRegion(int offset, int length, bool exists) {
     for (NavigationRegion region in regions) {
       if (region.offset == offset &&
           (length == -1 || region.length == length)) {
@@ -318,33 +320,26 @@
 }
 ''');
     return prepareNavigation().then((_) {
-      {
-        findRegion(findOffset('new A'), 'new'.length, true);
-        assertHasTarget('A {');
-      }
-      {
-        findRegion(findOffset('A()'), 'A'.length, true);
-        assertHasTarget('A {');
-      }
+      assertHasRegionString('new A');
+      assertHasTarget('A {');
     });
   }
 
   test_instanceCreation_implicit_withTypeArgument() {
     addTestFile('''
 class A {}
-class B<T> {
-}
+class B<T> {}
 main() {
   new B<A>();
 }
 ''');
     return prepareNavigation().then((_) {
       {
-        findRegion(findOffset('new B'), 'new'.length, true);
+        assertHasRegion('new B<A>', 'new B'.length);
         assertHasTarget('B<T> {');
       }
       {
-        findRegion(findOffset('A>();'), 'A'.length, true);
+        assertHasRegion('A>();', 'A'.length);
         assertHasTarget('A {');
       }
     });
@@ -360,18 +355,8 @@
 }
 ''');
     return prepareNavigation().then((_) {
-      {
-        findRegion(findOffset('new '), 'new'.length, true);
-        assertHasTarget('named() {}');
-      }
-      {
-        findRegion(findOffset('A.named();'), 'A'.length, true);
-        assertHasTarget('A {');
-      }
-      {
-        findRegion(findOffset('.named();'), '.named'.length, true);
-        assertHasTarget('named() {}');
-      }
+      assertHasRegionString('new A.named');
+      assertHasTarget('named() {}');
     });
   }
 
@@ -387,21 +372,17 @@
 ''');
     return prepareNavigation().then((_) {
       {
-        findRegion(findOffset('new '), 'new'.length, true);
+        assertHasRegionString('new B');
         assertHasTarget('named() {}');
       }
       {
-        findRegion(findOffset('B<A>.named();'), 'B'.length, true);
-        assertHasTarget('B<T> {');
-      }
-      {
-        findRegion(findOffset('.named();'), '.named'.length, true);
-        assertHasTarget('named() {}');
-      }
-      {
-        findRegion(findOffset('A>.named();'), 'A'.length, true);
+        assertHasRegion('A>.named');
         assertHasTarget('A {');
       }
+      {
+        assertHasRegion('.named();', '.named'.length);
+        assertHasTarget('named() {}');
+      }
     });
   }
 
@@ -415,14 +396,8 @@
 }
 ''');
     return prepareNavigation().then((_) {
-      {
-        findRegion(findOffset('new '), 'new'.length, true);
-        assertHasTarget('A() {}', 0);
-      }
-      {
-        findRegion(findOffset('A();'), 'A'.length, true);
-        assertHasTarget('A {');
-      }
+      assertHasRegionString('new A');
+      assertHasTarget('A() {}', 0);
     });
   }
 
@@ -438,15 +413,11 @@
 ''');
     return prepareNavigation().then((_) {
       {
-        findRegion(findOffset('new '), 'new'.length, true);
+        assertHasRegionString('new B');
         assertHasTarget('B() {}', 0);
       }
       {
-        findRegion(findOffset('B<A>();'), 'B'.length, true);
-        assertHasTarget('B<T> {');
-      }
-      {
-        findRegion(findOffset('A>();'), 'A'.length, true);
+        assertHasRegion('A>();');
         assertHasTarget('A {');
       }
     });
diff --git a/pkg/analysis_server/test/analysis/notification_outline_test.dart b/pkg/analysis_server/test/analysis/notification_outline_test.dart
index 23567cb..225950d 100644
--- a/pkg/analysis_server/test/analysis/notification_outline_test.dart
+++ b/pkg/analysis_server/test/analysis/notification_outline_test.dart
@@ -738,8 +738,8 @@
         expect(element.name, "propA");
         {
           Location location = element.location;
-          expect(element.location.offset, testCode.indexOf("propA => null;"));
-          expect(element.location.length, "propA".length);
+          expect(location.offset, testCode.indexOf("propA => null;"));
+          expect(location.length, "propA".length);
         }
         expect(element.parameters, "");
         expect(element.returnType, "String");
diff --git a/pkg/analysis_server/test/domain_completion_test.dart b/pkg/analysis_server/test/domain_completion_test.dart
index 8eb8136..7b0ae4b 100644
--- a/pkg/analysis_server/test/domain_completion_test.dart
+++ b/pkg/analysis_server/test/domain_completion_test.dart
@@ -87,7 +87,6 @@
       Request request =
           new CompletionGetSuggestionsParams(testFile, completionOffset).toRequest('0');
       Response response = handleSuccessfulRequest(request);
-      var result = new CompletionGetSuggestionsResult.fromResponse(response);
       completionId = response.id;
       assertValidId(completionId);
       return pumpEventQueue().then((_) {
diff --git a/pkg/analysis_server/test/domain_execution_test.dart b/pkg/analysis_server/test/domain_execution_test.dart
index 24aea8d..447a736 100644
--- a/pkg/analysis_server/test/domain_execution_test.dart
+++ b/pkg/analysis_server/test/domain_execution_test.dart
@@ -219,7 +219,7 @@
       ExecutionDomainHandler handler = new ExecutionDomainHandler(server);
       Request request = new ExecutionSetSubscriptionsParams(
           [ExecutionService.LAUNCH_DATA]).toRequest('0');
-      Response response = handler.handleRequest(request);
+      handler.handleRequest(request);
 
 //      controller.add(null);
       expect(unsentNotifications, isEmpty);
@@ -267,7 +267,6 @@
     if (item is! ExecutableFile) {
       return false;
     }
-    ExecutableFile file = item;
     return item.file == expectedFile && item.kind == expectedKind;
   }
 }
diff --git a/pkg/analysis_server/test/edit/refactoring_test.dart b/pkg/analysis_server/test/edit/refactoring_test.dart
index b910a65..76350be 100644
--- a/pkg/analysis_server/test/edit/refactoring_test.dart
+++ b/pkg/analysis_server/test/edit/refactoring_test.dart
@@ -300,6 +300,25 @@
 ''');
   }
 
+  test_names() {
+    addTestFile('''
+class TreeItem {}
+TreeItem getSelectedItem() => null;
+main() {
+  var a = getSelectedItem();
+}
+''');
+    return getRefactoringResult(() {
+      return sendStringSuffixRequest('getSelectedItem()', ';', null, true);
+    }).then((result) {
+      ExtractLocalVariableFeedback feedback = result.feedback;
+      expect(
+          feedback.names,
+          unorderedEquals(['treeItem', 'item', 'selectedItem']));
+      expect(result.change, isNull);
+    });
+  }
+
   test_nameWarning() {
     addTestFile('''
 main() {
@@ -322,25 +341,6 @@
     });
   }
 
-  test_names() {
-    addTestFile('''
-class TreeItem {}
-TreeItem getSelectedItem() => null;
-main() {
-  var a = getSelectedItem();
-}
-''');
-    return getRefactoringResult(() {
-      return sendStringSuffixRequest('getSelectedItem()', ';', null, true);
-    }).then((result) {
-      ExtractLocalVariableFeedback feedback = result.feedback;
-      expect(
-          feedback.names,
-          unorderedEquals(['treeItem', 'item', 'selectedItem']));
-      expect(result.change, isNull);
-    });
-  }
-
   test_offsetsLengths() {
     addTestFile('''
 main() {
@@ -733,24 +733,6 @@
 
 @ReflectiveTestCase()
 class InlineLocalTest extends _AbstractGetRefactoring_Test {
-  test_OK() {
-    addTestFile('''
-main() {
-  int test = 42;
-  int a = test + 2;
-  print(test);
-}
-''');
-    return assertSuccessfulRefactoring(() {
-      return _sendInlineRequest('test + 2');
-    }, '''
-main() {
-  int a = 42 + 2;
-  print(42);
-}
-''');
-  }
-
   test_feedback() {
     addTestFile('''
 main() {
@@ -781,6 +763,24 @@
     });
   }
 
+  test_OK() {
+    addTestFile('''
+main() {
+  int test = 42;
+  int a = test + 2;
+  print(test);
+}
+''');
+    return assertSuccessfulRefactoring(() {
+      return _sendInlineRequest('test + 2');
+    }, '''
+main() {
+  int a = 42 + 2;
+  print(42);
+}
+''');
+  }
+
   Future<Response> _sendInlineRequest(String search) {
     Request request = new EditGetRefactoringParams(
         RefactoringKind.INLINE_LOCAL_VARIABLE,
@@ -969,19 +969,102 @@
 
   test_class() {
     addTestFile('''
+class Test {
+  Test() {}
+  Test.named() {}
+}
+main() {
+  Test v;
+  new Test();
+  new Test.named();
+}
+''');
+    return assertSuccessfulRefactoring(() {
+      return sendRenameRequest('Test {', 'NewName');
+    }, '''
+class NewName {
+  NewName() {}
+  NewName.named() {}
+}
+main() {
+  NewName v;
+  new NewName();
+  new NewName.named();
+}
+''');
+  }
+
+  test_class_options_fatalError() {
+    addTestFile('''
 class Test {}
 main() {
   Test v;
 }
 ''');
-    return assertSuccessfulRefactoring(() {
-      return sendRenameRequest('Test {}', 'NewName');
-    }, '''
+    return getRefactoringResult(() {
+      return sendRenameRequest('Test {}', '');
+    }).then((result) {
+      assertResultProblemsFatal(
+          result.optionsProblems,
+          'Class name must not be empty.');
+      // ...there is no any change
+      expect(result.change, isNull);
+    });
+  }
+
+  test_class_validateOnly() {
+    addTestFile('''
+class Test {}
+main() {
+  Test v;
+}
+''');
+    return getRefactoringResult(() {
+      return sendRenameRequest('Test {}', 'NewName', true);
+    }).then((result) {
+      RenameFeedback feedback = result.feedback;
+      assertResultProblemsOK(result);
+      expect(feedback.elementKindName, 'class');
+      expect(feedback.oldName, 'Test');
+      expect(result.change, isNull);
+    });
+  }
+
+  test_class_warning() {
+    addTestFile('''
+class Test {}
+main() {
+  Test v;
+}
+''');
+    return getRefactoringResult(() {
+      return sendRenameRequest('Test {}', 'newName');
+    }).then((result) {
+      assertResultProblemsWarning(
+          result.optionsProblems,
+          'Class name should start with an uppercase letter.');
+      // ...but there is still a change
+      assertTestRefactoringResult(result, '''
+class newName {}
+main() {
+  newName v;
+}
+''');
+    }).then((_) {
+      // "NewName" is a perfectly valid name
+      return getRefactoringResult(() {
+        return sendRenameRequest('Test {}', 'NewName');
+      }).then((result) {
+        assertResultProblemsOK(result);
+        // ...and there is a new change
+        assertTestRefactoringResult(result, '''
 class NewName {}
 main() {
   NewName v;
 }
 ''');
+      });
+    });
   }
 
   test_classMember_field() {
@@ -1101,104 +1184,6 @@
 ''');
   }
 
-  test_class_fromInstanceCreation() {
-    addTestFile('''
-class Test {
-  Test() {}
-  Test.named() {}
-}
-main() {
-  new Test();
-  new Test.named();
-}
-''');
-    return assertSuccessfulRefactoring(() {
-      return sendRenameRequest('Test();', 'NewName');
-    }, '''
-class NewName {
-  NewName() {}
-  NewName.named() {}
-}
-main() {
-  new NewName();
-  new NewName.named();
-}
-''');
-  }
-
-  test_class_options_fatalError() {
-    addTestFile('''
-class Test {}
-main() {
-  Test v;
-}
-''');
-    return getRefactoringResult(() {
-      return sendRenameRequest('Test {}', '');
-    }).then((result) {
-      assertResultProblemsFatal(
-          result.optionsProblems,
-          'Class name must not be empty.');
-      // ...there is no any change
-      expect(result.change, isNull);
-    });
-  }
-
-  test_class_validateOnly() {
-    addTestFile('''
-class Test {}
-main() {
-  Test v;
-}
-''');
-    return getRefactoringResult(() {
-      return sendRenameRequest('Test {}', 'NewName', true);
-    }).then((result) {
-      RenameFeedback feedback = result.feedback;
-      assertResultProblemsOK(result);
-      expect(feedback.elementKindName, 'class');
-      expect(feedback.oldName, 'Test');
-      expect(result.change, isNull);
-    });
-  }
-
-  test_class_warning() {
-    addTestFile('''
-class Test {}
-main() {
-  Test v;
-}
-''');
-    return getRefactoringResult(() {
-      return sendRenameRequest('Test {}', 'newName');
-    }).then((result) {
-      assertResultProblemsWarning(
-          result.optionsProblems,
-          'Class name should start with an uppercase letter.');
-      // ...but there is still a change
-      assertTestRefactoringResult(result, '''
-class newName {}
-main() {
-  newName v;
-}
-''');
-    }).then((_) {
-      // "NewName" is a perfectly valid name
-      return getRefactoringResult(() {
-        return sendRenameRequest('Test {}', 'NewName');
-      }).then((result) {
-        assertResultProblemsOK(result);
-        // ...and there is a new change
-        assertTestRefactoringResult(result, '''
-class NewName {}
-main() {
-  NewName v;
-}
-''');
-      });
-    });
-  }
-
   test_constructor_fromInstanceCreation() {
     addTestFile('''
 class A {
@@ -1208,8 +1193,6 @@
   new A.test();
 }
 ''');
-    String search = 'test();';
-    String newName = 'newName';
     return assertSuccessfulRefactoring(() {
       return sendRenameRequest('test();', 'newName');
     }, '''
@@ -1222,6 +1205,48 @@
 ''');
   }
 
+  test_constructor_fromInstanceCreation_default_onClassName() {
+    addTestFile('''
+class A {
+  A() {}
+}
+main() {
+  new A();
+}
+''');
+    return assertSuccessfulRefactoring(() {
+      return sendRenameRequest('A();', 'newName');
+    }, '''
+class A {
+  A.newName() {}
+}
+main() {
+  new A.newName();
+}
+''');
+  }
+
+  test_constructor_fromInstanceCreation_default_onNew() {
+    addTestFile('''
+class A {
+  A() {}
+}
+main() {
+  new A();
+}
+''');
+    return assertSuccessfulRefactoring(() {
+      return sendRenameRequest('new A();', 'newName');
+    }, '''
+class A {
+  A.newName() {}
+}
+main() {
+  new A.newName();
+}
+''');
+  }
+
   test_feedback() {
     addTestFile('''
 class Test {}
diff --git a/pkg/analysis_server/test/integration/analysis/error_test.dart b/pkg/analysis_server/test/integration/analysis/error_test.dart
index bb7078d..21330d7 100644
--- a/pkg/analysis_server/test/integration/analysis/error_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/error_test.dart
@@ -18,7 +18,7 @@
     writeFile(pathname,
         '''
 main() {
-  var x // parse error: missing ';'
+  print(null) // parse error: missing ';'
 }''');
     standardAnalysisSetup();
     return analysisFinished.then((_) {
diff --git a/pkg/analysis_server/test/integration/integration_tests.dart b/pkg/analysis_server/test/integration/integration_tests.dart
index 4436253..b6ea93e 100644
--- a/pkg/analysis_server/test/integration/integration_tests.dart
+++ b/pkg/analysis_server/test/integration/integration_tests.dart
@@ -185,7 +185,6 @@
     }
     // Give the server a short time to comply with the shutdown request; if it
     // doesn't exit, then forcibly terminate it.
-    Completer processExited = new Completer();
     sendServerShutdown();
     return server.exitCode.timeout(SHUTDOWN_TIMEOUT, onTimeout: () {
       return server.kill();
diff --git a/pkg/analysis_server/test/integration/test_all.dart b/pkg/analysis_server/test/integration/test_all.dart
index be609ce..54d3fb2 100644
--- a/pkg/analysis_server/test/integration/test_all.dart
+++ b/pkg/analysis_server/test/integration/test_all.dart
@@ -12,10 +12,6 @@
 import 'search/test_all.dart' as search_test_all;
 import 'server/test_all.dart' as server_test_all;
 
-// Disable asynchrony test for now.
-// TODO(paulberry): re-enable when issue 21252 is fixed.
-const bool _ENABLE_ASYNCHRONY_TEST = false;
-
 /**
  * Utility for manually running all integration tests.
  */
@@ -23,9 +19,7 @@
   groupSep = ' | ';
   group('analysis_server_integration', () {
     analysis_test_all.main();
-    if (_ENABLE_ASYNCHRONY_TEST) {
-      asynchrony_test.main();
-    }
+    asynchrony_test.main();
     completion_test_all.main();
     search_test_all.main();
     server_test_all.main();
diff --git a/pkg/analysis_server/test/mock_sdk.dart b/pkg/analysis_server/test/mock_sdk.dart
index 8673177..c539226 100644
--- a/pkg/analysis_server/test/mock_sdk.dart
+++ b/pkg/analysis_server/test/mock_sdk.dart
@@ -89,7 +89,7 @@
 
 import 'dart:math';
 
-class Future {
+class Future<T> {
   static Future wait(List<Future> futures) => null;
 }
 
diff --git a/pkg/analysis_server/test/search/type_hierarchy_test.dart b/pkg/analysis_server/test/search/type_hierarchy_test.dart
index 74152b4..d598a01 100644
--- a/pkg/analysis_server/test/search/type_hierarchy_test.dart
+++ b/pkg/analysis_server/test/search/type_hierarchy_test.dart
@@ -10,10 +10,10 @@
 import 'package:analysis_server/src/search/search_domain.dart';
 import 'package:analysis_server/src/services/index/index.dart';
 import 'package:analysis_server/src/services/index/local_memory_index.dart';
-import '../reflective_tests.dart';
 import 'package:unittest/unittest.dart';
 
 import '../analysis_abstract.dart';
+import '../reflective_tests.dart';
 
 
 main() {
@@ -104,6 +104,37 @@
     });
   }
 
+  test_class_extends_fileAndPackageUris() {
+    // prepare packages
+    String pkgFile = '/packages/pkgA/libA.dart';
+    resourceProvider.newFile(pkgFile, '''
+library lib_a;
+class A {}
+class B extends A {}
+''');
+    packageMapProvider.packageMap['pkgA'] =
+        [resourceProvider.getResource('/packages/pkgA')];
+    // reference the package from a project
+    addTestFile('''
+import 'package:pkgA/libA.dart';
+class C extends A {}
+''');
+    // configure roots
+    Request request = new AnalysisSetAnalysisRootsParams(
+        [projectPath, '/packages/pkgA'],
+        []).toRequest('0');
+    handleSuccessfulRequest(request);
+    // test A type hierarchy
+    return waitForTasksFinished().then((_) {
+      return _getTypeHierarchy('A {}').then((items) {
+        Set<String> names = _toClassNames(items);
+        expect(names, contains('A'));
+        expect(names, contains('B'));
+        expect(names, contains('C'));
+      });
+    });
+  }
+
   test_class_extendsTypeA() {
     addTestFile('''
 class A {}
@@ -567,4 +598,10 @@
   List _toJson(List<TypeHierarchyItem> items) {
     return items.map((item) => item.toJson()).toList();
   }
+
+  static Set<String> _toClassNames(List<TypeHierarchyItem> items) {
+    return items.map((TypeHierarchyItem item) {
+      return item.classElement.name;
+    }).toSet();
+  }
 }
diff --git a/pkg/analysis_server/test/services/completion/arglist_computer_test.dart b/pkg/analysis_server/test/services/completion/arglist_computer_test.dart
new file mode 100644
index 0000000..beb66ea
--- /dev/null
+++ b/pkg/analysis_server/test/services/completion/arglist_computer_test.dart
@@ -0,0 +1,117 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library test.services.completion.dart.arglist;
+
+import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/src/services/completion/arglist_computer.dart';
+import 'package:unittest/unittest.dart';
+
+import '../../reflective_tests.dart';
+import 'completion_test_util.dart';
+
+main() {
+  groupSep = ' | ';
+  runReflectiveTests(ArgListComputerTest);
+}
+
+@ReflectiveTestCase()
+class ArgListComputerTest extends AbstractCompletionTest {
+
+  @override
+  void setUp() {
+    super.setUp();
+    computer = new ArgListComputer();
+  }
+
+  test_ArgumentList_imported_function_0() {
+    // ArgumentList  MethodInvocation  ExpressionStatement  Block
+    addSource('/libA.dart', '''
+      library A;
+      bool hasLength(int expected) { }
+      expect() { }
+      void baz() { }''');
+    addTestSource('''
+      import '/libA.dart'
+      class B { }
+      String bar() => true;
+      void main() {expect(^)}''');
+    computeFast();
+    return computeFull(true).then((_) {
+      assertNoSuggestions(kind: CompletionSuggestionKind.ARGUMENT_LIST);
+    });
+  }
+
+//  test_ArgumentList_imported_function_1() {
+//    // ArgumentList  MethodInvocation  ExpressionStatement  Block
+//    addSource('/libA.dart', '''
+//      library A;
+//      bool hasLength(int expected) { }
+//      expect(String arg) { }
+//      void baz() { }''');
+//    addTestSource('''
+//      import '/libA.dart'
+//      class B { }
+//      String bar() => true;
+//      void main() {expect(^)}''');
+//    computeFast();
+//    return computeFull(true).then((_) {
+//      assertSuggestArgumentList(['arg'], ['String']);
+//    });
+//  }
+
+  test_ArgumentList_local_function_1() {
+    // ArgumentList  MethodInvocation  ExpressionStatement  Block
+    addSource('/libA.dart', '''
+      library A;
+      bool hasLength(int expected) { }
+      void baz() { }''');
+    addTestSource('''
+      import '/libA.dart'
+      expect(arg) { }
+      class B { }
+      String bar() => true;
+      void main() {expect(^)}''');
+    computeFast();
+    return computeFull(true).then((_) {
+      assertSuggestArgumentList(['arg'], ['dynamic']);
+    });
+  }
+
+  test_ArgumentList_local_method_0() {
+    // ArgumentList  MethodInvocation  ExpressionStatement  Block
+    addSource('/libA.dart', '''
+      library A;
+      bool hasLength(int expected) { }
+      void baz() { }''');
+    addTestSource('''
+      import '/libA.dart'
+      class B {
+        expect() { }
+        void foo() {expect(^)}}
+      String bar() => true;''');
+    computeFast();
+    return computeFull(true).then((_) {
+      assertNoSuggestions(kind: CompletionSuggestionKind.ARGUMENT_LIST);
+    });
+  }
+
+  test_ArgumentList_local_method_2() {
+    // ArgumentList  MethodInvocation  ExpressionStatement  Block
+    addSource('/libA.dart', '''
+      library A;
+      bool hasLength(int expected) { }
+      void baz() { }''');
+    addTestSource('''
+      import '/libA.dart'
+      class B {
+        expect(arg, int blat) { }
+        void foo() {expect(^)}}
+      String bar() => true;''');
+    computeFast();
+    return computeFull(true).then((_) {
+      assertSuggestArgumentList(['arg', 'blat'], ['dynamic', 'int']);
+    });
+  }
+}
\ No newline at end of file
diff --git a/pkg/analysis_server/test/services/completion/completion_computer_test.dart b/pkg/analysis_server/test/services/completion/completion_computer_test.dart
index 4448236..b230d49 100644
--- a/pkg/analysis_server/test/services/completion/completion_computer_test.dart
+++ b/pkg/analysis_server/test/services/completion/completion_computer_test.dart
@@ -44,6 +44,7 @@
   Index index;
   SearchEngineImpl searchEngine;
   Source source;
+  CompletionPerformance perf;
   DartCompletionManager manager;
   MockCompletionComputer computer1;
   MockCompletionComputer computer2;
@@ -62,7 +63,8 @@
     index = createLocalMemoryIndex();
     searchEngine = new SearchEngineImpl(index);
     source = addSource('/does/not/exist.dart', '');
-    manager = new DartCompletionManager(context, searchEngine, source, 0);
+    perf = new CompletionPerformance();
+    manager = new DartCompletionManager(context, searchEngine, source, 0, perf);
     suggestion1 = new CompletionSuggestion(
         CompletionSuggestionKind.INVOCATION,
         CompletionRelevance.DEFAULT,
diff --git a/pkg/analysis_server/test/services/completion/completion_manager_test.dart b/pkg/analysis_server/test/services/completion/completion_manager_test.dart
index 24eec40..f114e33 100644
--- a/pkg/analysis_server/test/services/completion/completion_manager_test.dart
+++ b/pkg/analysis_server/test/services/completion/completion_manager_test.dart
@@ -18,28 +18,29 @@
 
 @ReflectiveTestCase()
 class CompletionManagerTest extends AbstractContextTest {
+  var perf = new CompletionPerformance();
 
   test_dart() {
     Source source = addSource('/does/not/exist.dart', '');
-    var manager = CompletionManager.create(context, source, 0, null);
+    var manager = CompletionManager.create(context, source, 0, null, perf);
     expect(manager.runtimeType, DartCompletionManager);
   }
 
   test_html() {
     Source source = addSource('/does/not/exist.html', '');
-    var manager = CompletionManager.create(context, source, 0, null);
+    var manager = CompletionManager.create(context, source, 0, null, perf);
     expect(manager.runtimeType, NoOpCompletionManager);
   }
 
   test_null_context() {
     Source source = addSource('/does/not/exist.dart', '');
-    var manager = CompletionManager.create(null, source, 0, null);
+    var manager = CompletionManager.create(null, source, 0, null, perf);
     expect(manager.runtimeType, NoOpCompletionManager);
   }
 
   test_other() {
     Source source = addSource('/does/not/exist.foo', '');
-    var manager = CompletionManager.create(context, source, 0, null);
+    var manager = CompletionManager.create(context, source, 0, null, perf);
     expect(manager.runtimeType, NoOpCompletionManager);
   }
 }
diff --git a/pkg/analysis_server/test/services/completion/completion_test_util.dart b/pkg/analysis_server/test/services/completion/completion_test_util.dart
index 941b3b7..002c58d 100644
--- a/pkg/analysis_server/test/services/completion/completion_test_util.dart
+++ b/pkg/analysis_server/test/services/completion/completion_test_util.dart
@@ -55,19 +55,27 @@
         new DartCompletionRequest(context, searchEngine, testSource, completionOffset);
   }
 
-  void assertNoSuggestions() {
-    if (request.suggestions.length > 0) {
-      _failedCompletion('Expected no suggestions', request.suggestions);
+  void assertNoSuggestions({CompletionSuggestionKind kind: null}) {
+    if (kind == null) {
+      if (request.suggestions.length > 0) {
+        failedCompletion('Expected no suggestions', request.suggestions);
+      }
+      return;
+    }
+    CompletionSuggestion suggestion = request.suggestions.firstWhere(
+        (CompletionSuggestion cs) => cs.kind == kind,
+        orElse: () => null);
+    if (suggestion != null) {
+      failedCompletion('did not expect completion: $completion\n  $suggestion');
     }
   }
 
   CompletionSuggestion assertNotSuggested(String completion) {
     CompletionSuggestion suggestion = request.suggestions.firstWhere(
-        (cs) => cs.completion == completion,
+        (CompletionSuggestion cs) => cs.completion == completion,
         orElse: () => null);
     if (suggestion != null) {
-      _failedCompletion(
-          'did not expect completion: $completion\n  $suggestion');
+      failedCompletion('did not expect completion: $completion\n  $suggestion');
     }
     return null;
   }
@@ -77,23 +85,10 @@
       CompletionRelevance relevance: CompletionRelevance.DEFAULT,
       protocol.ElementKind elemKind: null, bool isDeprecated: false, bool isPotential:
       false}) {
-    CompletionSuggestion cs;
-    request.suggestions.forEach((s) {
-      if (s.completion == completion && s.kind == csKind) {
-        protocol.Element element = s.element;
-        if (elemKind == null || (element != null && elemKind == element.kind)) {
-          if (cs == null) {
-            cs = s;
-          } else {
-            _failedCompletion(
-                'expected exactly one $completion',
-                request.suggestions.where((s) => s.completion == completion));
-          }
-        }
-      }
-    });
+    CompletionSuggestion cs =
+        getSuggest(completion: completion, csKind: csKind, elemKind: elemKind);
     if (cs == null) {
-      _failedCompletion('expected $completion $csKind', request.suggestions);
+      failedCompletion('expected $completion $csKind', request.suggestions);
     }
     expect(cs.kind, equals(csKind));
     if (isDeprecated) {
@@ -108,6 +103,48 @@
     return cs;
   }
 
+  void assertSuggestArgumentList(List<String> paramNames, List<String> paramTypes) {
+    CompletionSuggestionKind csKind = CompletionSuggestionKind.ARGUMENT_LIST;
+    CompletionSuggestion cs = getSuggest(csKind: csKind);
+    if (cs == null) {
+      failedCompletion('expected completion $csKind', request.suggestions);
+    }
+    assertSuggestArgumentList_params(
+        paramNames,
+        paramTypes,
+        cs.parameterNames,
+        cs.parameterTypes);
+    expect(cs.relevance, CompletionRelevance.HIGH);
+  }
+
+  void assertSuggestArgumentList_params(List<String> expectedNames,
+      List<String> expectedTypes, List<String> actualNames,
+      List<String> actualTypes) {
+    if (actualNames != null &&
+        actualNames.length == expectedNames.length &&
+        actualTypes != null &&
+        actualTypes.length == expectedTypes.length) {
+      int index = 0;
+      while (index < expectedNames.length) {
+        if (actualNames[index] != expectedNames[index] ||
+            actualTypes[index] != expectedTypes[index]) {
+          break;
+        }
+        ++index;
+      }
+      if (index == expectedNames.length) {
+        return;
+      }
+    }
+    StringBuffer msg = new StringBuffer();
+    msg.writeln('Argument list not the same');
+    msg.writeln('  Expected names: $expectedNames');
+    msg.writeln('           found: $actualNames');
+    msg.writeln('  Expected types: $expectedTypes');
+    msg.writeln('           found: $actualTypes');
+    fail(msg.toString());
+  }
+
   CompletionSuggestion assertSuggestClass(String name,
       [CompletionRelevance relevance = CompletionRelevance.DEFAULT,
       CompletionSuggestionKind kind = CompletionSuggestionKind.INVOCATION]) {
@@ -421,14 +458,7 @@
     return computer.computeFull(request);
   }
 
-  @override
-  void setUp() {
-    super.setUp();
-    index = createLocalMemoryIndex();
-    searchEngine = new SearchEngineImpl(index);
-  }
-
-  void _failedCompletion(String message,
+  void failedCompletion(String message,
       [Iterable<CompletionSuggestion> completions]) {
     StringBuffer sb = new StringBuffer(message);
     if (completions != null) {
@@ -453,6 +483,40 @@
     }
     fail(sb.toString());
   }
+
+  CompletionSuggestion getSuggest({String completion: null,
+      CompletionSuggestionKind csKind: null, protocol.ElementKind elemKind: null}) {
+    CompletionSuggestion cs;
+    request.suggestions.forEach((CompletionSuggestion s) {
+      if (completion != null && completion != s.completion) {
+        return;
+      }
+      if (csKind != null && csKind != s.kind) {
+        return;
+      }
+      if (elemKind != null) {
+        protocol.Element element = s.element;
+        if (element == null || elemKind != element.kind) {
+          return;
+        }
+      }
+      if (cs == null) {
+        cs = s;
+      } else {
+        failedCompletion(
+            'expected exactly one $cs',
+            request.suggestions.where((s) => s.completion == completion));
+      }
+    });
+    return cs;
+  }
+
+  @override
+  void setUp() {
+    super.setUp();
+    index = createLocalMemoryIndex();
+    searchEngine = new SearchEngineImpl(index);
+  }
 }
 
 /**
@@ -679,6 +743,85 @@
       void main() {expect(^)}''');
     computeFast();
     return computeFull(true).then((_) {
+      assertNoSuggestions(kind: CompletionSuggestionKind.ARGUMENT_LIST);
+      assertSuggestLocalFunction('bar', 'String');
+      assertSuggestImportedFunction('hasLength', 'bool');
+      assertSuggestImportedFunction('identical', 'bool');
+      assertSuggestLocalClass('B');
+      assertSuggestImportedClass('Object');
+      assertNotSuggested('main');
+      assertNotSuggested('baz');
+      assertNotSuggested('print');
+    });
+  }
+
+  test_ArgumentList_imported_function() {
+    // ArgumentList  MethodInvocation  ExpressionStatement  Block
+    addSource('/libA.dart', '''
+      library A;
+      bool hasLength(int expected) { }
+      expect(arg) { }
+      void baz() { }''');
+    addTestSource('''
+      import '/libA.dart'
+      class B { }
+      String bar() => true;
+      void main() {expect(^)}''');
+    computeFast();
+    return computeFull(true).then((_) {
+      assertNoSuggestions(kind: CompletionSuggestionKind.ARGUMENT_LIST);
+      assertSuggestLocalFunction('bar', 'String');
+      assertSuggestImportedFunction('hasLength', 'bool');
+      assertSuggestImportedFunction('identical', 'bool');
+      assertSuggestLocalClass('B');
+      assertSuggestImportedClass('Object');
+      assertNotSuggested('main');
+      assertNotSuggested('baz');
+      assertNotSuggested('print');
+    });
+  }
+
+  test_ArgumentList_local_function() {
+    // ArgumentList  MethodInvocation  ExpressionStatement  Block
+    addSource('/libA.dart', '''
+      library A;
+      bool hasLength(int expected) { }
+      void baz() { }''');
+    addTestSource('''
+      import '/libA.dart'
+      expect(arg) { }
+      class B { }
+      String bar() => true;
+      void main() {expect(^)}''');
+    computeFast();
+    return computeFull(true).then((_) {
+      assertNoSuggestions(kind: CompletionSuggestionKind.ARGUMENT_LIST);
+      assertSuggestLocalFunction('bar', 'String');
+      assertSuggestImportedFunction('hasLength', 'bool');
+      assertSuggestImportedFunction('identical', 'bool');
+      assertSuggestLocalClass('B');
+      assertSuggestImportedClass('Object');
+      assertNotSuggested('main');
+      assertNotSuggested('baz');
+      assertNotSuggested('print');
+    });
+  }
+
+  test_ArgumentList_local_method() {
+    // ArgumentList  MethodInvocation  ExpressionStatement  Block
+    addSource('/libA.dart', '''
+      library A;
+      bool hasLength(int expected) { }
+      void baz() { }''');
+    addTestSource('''
+      import '/libA.dart'
+      class B {
+        expect(arg) { }
+        void foo() {expect(^)}}
+      String bar() => true;''');
+    computeFast();
+    return computeFull(true).then((_) {
+      assertNoSuggestions(kind: CompletionSuggestionKind.ARGUMENT_LIST);
       assertSuggestLocalFunction('bar', 'String');
       assertSuggestImportedFunction('hasLength', 'bool');
       assertSuggestImportedFunction('identical', 'bool');
diff --git a/pkg/analysis_server/test/services/completion/test_all.dart b/pkg/analysis_server/test/services/completion/test_all.dart
index 7efd76a..5770bb4 100644
--- a/pkg/analysis_server/test/services/completion/test_all.dart
+++ b/pkg/analysis_server/test/services/completion/test_all.dart
@@ -6,6 +6,7 @@
 
 import 'package:unittest/unittest.dart';
 
+import 'arglist_computer_test.dart' as arglist_test;
 import 'combinator_computer_test.dart' as combinator_test;
 import 'completion_computer_test.dart' as completion_computer_test;
 import 'completion_manager_test.dart' as completion_manager_test;
@@ -18,6 +19,7 @@
 main() {
   groupSep = ' | ';
   group('completion', () {
+    arglist_test.main();
     combinator_test.main();
     completion_computer_test.main();
     completion_manager_test.main();
diff --git a/pkg/analysis_server/test/services/correction/assist_test.dart b/pkg/analysis_server/test/services/correction/assist_test.dart
index 65c8cd1..c344e0b 100644
--- a/pkg/analysis_server/test/services/correction/assist_test.dart
+++ b/pkg/analysis_server/test/services/correction/assist_test.dart
@@ -9,6 +9,7 @@
 import 'package:analysis_server/src/services/index/index.dart';
 import 'package:analysis_server/src/services/index/local_memory_index.dart';
 import 'package:analysis_server/src/services/search/search_engine_internal.dart';
+import 'package:analyzer/src/generated/source.dart';
 import 'package:unittest/unittest.dart';
 
 import '../../abstract_single_unit.dart';
@@ -188,6 +189,28 @@
 ''');
   }
 
+  void test_addTypeAnnotation_declaredIdentifier_OK_addImport_dartUri() {
+    addSource('/my_lib.dart', r'''
+import 'dart:async';
+List<Future<int>> getFutures() => null;
+''');
+    _indexTestUnit('''
+import 'my_lib.dart';
+main() {
+  for (var future in getFutures()) {
+  }
+}
+''');
+    assertHasAssistAt('future in', AssistKind.ADD_TYPE_ANNOTATION, '''
+import 'my_lib.dart';
+import 'dart:async';
+main() {
+  for (Future<int> future in getFutures()) {
+  }
+}
+''');
+  }
+
   void test_addTypeAnnotation_declaredIdentifier_OK_final() {
     _indexTestUnit('''
 main(List<String> items) {
@@ -203,6 +226,103 @@
 ''');
   }
 
+  void test_addTypeAnnotation_local_OK_addImport_dartUri() {
+    addSource('/my_lib.dart', r'''
+import 'dart:async';
+Future<int> getFutureInt() => null;
+''');
+    _indexTestUnit('''
+import 'my_lib.dart';
+main() {
+  var v = getFutureInt();
+}
+''');
+    assertHasAssistAt('v =', AssistKind.ADD_TYPE_ANNOTATION, '''
+import 'my_lib.dart';
+import 'dart:async';
+main() {
+  Future<int> v = getFutureInt();
+}
+''');
+  }
+
+  void test_addTypeAnnotation_local_OK_addImport_notLibraryUnit() {
+    // prepare library
+    addSource('/my_lib.dart', r'''
+import 'dart:async';
+Future<int> getFutureInt() => null;
+''');
+    // prepare code
+    String appCode = r'''
+library my_app;
+import 'my_lib.dart';
+part 'test.dart';
+''';
+    testCode = r'''
+part of my_app;
+main() {
+  var v = getFutureInt();
+}
+''';
+    // add sources
+    Source appSource = addSource('/app.dart', appCode);
+    testSource = addSource('/test.dart', testCode);
+    // resolve
+    context.resolveCompilationUnit2(appSource, appSource);
+    testUnit = context.resolveCompilationUnit2(testSource, appSource);
+    assertNoErrorsInSource(testSource);
+    testUnitElement = testUnit.element;
+    testLibraryElement = testUnitElement.library;
+    // prepare the assist
+    offset = findOffset('v = ');
+    assist = _assertHasAssist(AssistKind.ADD_TYPE_ANNOTATION);
+    change = assist.change;
+    // verify
+    {
+      var testFileEdit = change.getFileEdit('/app.dart');
+      var resultCode = SourceEdit.applySequence(appCode, testFileEdit.edits);
+      expect(resultCode, '''
+library my_app;
+import 'my_lib.dart';
+import 'dart:async';
+part 'test.dart';
+''');
+    }
+    {
+      var testFileEdit = change.getFileEdit('/test.dart');
+      var resultCode = SourceEdit.applySequence(testCode, testFileEdit.edits);
+      expect(resultCode, '''
+part of my_app;
+main() {
+  Future<int> v = getFutureInt();
+}
+''');
+    }
+  }
+
+  void test_addTypeAnnotation_local_OK_addImport_relUri() {
+    addSource('/aa/bbb/lib_a.dart', r'''
+class MyClass {}
+''');
+    addSource('/ccc/lib_b.dart', r'''
+import '../aa/bbb/lib_a.dart';
+MyClass newMyClass() => null;
+''');
+    _indexTestUnit('''
+import 'ccc/lib_b.dart';
+main() {
+  var v = newMyClass();
+}
+''');
+    assertHasAssistAt('v =', AssistKind.ADD_TYPE_ANNOTATION, '''
+import 'ccc/lib_b.dart';
+import 'aa/bbb/lib_a.dart';
+main() {
+  MyClass v = newMyClass();
+}
+''');
+  }
+
   void test_addTypeAnnotation_local_OK_Function() {
     _indexTestUnit('''
 main() {
diff --git a/pkg/analysis_server/test/services/correction/change_test.dart b/pkg/analysis_server/test/services/correction/change_test.dart
index 840fafc..6326f11 100644
--- a/pkg/analysis_server/test/services/correction/change_test.dart
+++ b/pkg/analysis_server/test/services/correction/change_test.dart
@@ -161,8 +161,6 @@
 
   void test_eqEq() {
     SourceEdit a = new SourceEdit(1, 2, 'aaa');
-    SourceEdit a2 = new SourceEdit(1, 2, 'aaa');
-    SourceEdit b = new SourceEdit(1, 2, 'aaa');
     expect(a == a, isTrue);
     expect(a == new SourceEdit(1, 2, 'aaa'), isTrue);
     expect(a == this, isFalse);
diff --git a/pkg/analysis_server/test/services/correction/fix_test.dart b/pkg/analysis_server/test/services/correction/fix_test.dart
index 6060c94..e6d1604 100644
--- a/pkg/analysis_server/test/services/correction/fix_test.dart
+++ b/pkg/analysis_server/test/services/correction/fix_test.dart
@@ -79,7 +79,6 @@
 
   Position expectedPosition(String search) {
     int offset = resultCode.indexOf(search);
-    int length = getLeadingIdentifierLength(search);
     return new Position(testFile, offset);
   }
 
@@ -2304,6 +2303,9 @@
 
   AnalysisError _findErrorToFix() {
     List<AnalysisError> errors = context.computeErrors(testSource);
+    errors.removeWhere((error) {
+      return error.errorCode == HintCode.UNUSED_LOCAL_VARIABLE;
+    });
     if (checkHasSingleError) {
       expect(errors, hasLength(1));
     }
@@ -2314,7 +2316,6 @@
     List<Position> positions = <Position>[];
     for (String search in searchStrings) {
       int offset = resultCode.indexOf(search);
-      int length = getLeadingIdentifierLength(search);
       positions.add(new Position(testFile, offset));
     }
     return positions;
diff --git a/pkg/analysis_server/test/services/correction/source_range_test.dart b/pkg/analysis_server/test/services/correction/source_range_test.dart
index f52da77..2e5bad1 100644
--- a/pkg/analysis_server/test/services/correction/source_range_test.dart
+++ b/pkg/analysis_server/test/services/correction/source_range_test.dart
@@ -68,9 +68,6 @@
 
   void test_rangeNodes_empty() {
     resolveTestUnit('main() {}');
-    FunctionDeclaration mainFunction = testUnit.declarations[0];
-    SimpleIdentifier mainName = mainFunction.name;
-    FunctionBody mainBody = mainFunction.functionExpression.body;
     expect(rangeNodes([]), new SourceRange(0, 0));
   }
 
diff --git a/pkg/analysis_server/test/services/index/dart_index_contributor_test.dart b/pkg/analysis_server/test/services/index/dart_index_contributor_test.dart
index 0f7d336..0d1970a 100644
--- a/pkg/analysis_server/test/services/index/dart_index_contributor_test.dart
+++ b/pkg/analysis_server/test/services/index/dart_index_contributor_test.dart
@@ -132,7 +132,6 @@
 }
 ''');
     // prepare elements
-    Element mainElement = findElement('main');
     LocalVariableElement testElement = findElement('test');
     Element nameElement = new NameElement('test');
     // verify
diff --git a/pkg/analysis_server/test/services/index/store/codec_test.dart b/pkg/analysis_server/test/services/index/store/codec_test.dart
index dd445a0..50da075 100644
--- a/pkg/analysis_server/test/services/index/store/codec_test.dart
+++ b/pkg/analysis_server/test/services/index/store/codec_test.dart
@@ -107,15 +107,15 @@
     PropertyAccessorElement getter = field.getter;
     PropertyAccessorElement setter = field.setter;
     {
-      int id = codec.encode(getter);
+      int id = codec.encode(getter, false);
       expect(codec.decode(context, id), getter);
     }
     {
-      int id = codec.encode(setter);
+      int id = codec.encode(setter, false);
       expect(codec.decode(context, id), setter);
     }
     {
-      int id = codec.encode(field);
+      int id = codec.encode(field, false);
       expect(codec.decode(context, id), field);
     }
   }
@@ -137,12 +137,12 @@
 ''');
     {
       LocalVariableElement element = findNodeElementAtString('bar; // A', null);
-      int id = codec.encode(element);
+      int id = codec.encode(element, false);
       expect(codec.decode(context, id), element);
     }
     {
       LocalVariableElement element = findNodeElementAtString('bar; // B', null);
-      int id = codec.encode(element);
+      int id = codec.encode(element, false);
       expect(codec.decode(context, id), element);
     }
     // check strings, "foo" as a single string, no "foo@17" or "bar@35"
@@ -166,12 +166,12 @@
 ''');
     {
       LocalVariableElement element = findNodeElementAtString('foo; // A', null);
-      int id = codec.encode(element);
+      int id = codec.encode(element, false);
       expect(codec.decode(context, id), element);
     }
     {
       LocalVariableElement element = findNodeElementAtString('foo; // B', null);
-      int id = codec.encode(element);
+      int id = codec.encode(element, false);
       expect(codec.decode(context, id), element);
     }
     // check strings, "foo" as a single string, no "foo@21" or "foo@47"
@@ -188,8 +188,8 @@
 }
 ''');
     LocalVariableElement element = findElement('foo');
-    int id = codec.encode(element);
-    expect(codec.encode(element), id);
+    int id = codec.encode(element, false);
+    expect(codec.encode(element, false), id);
     expect(codec.decode(context, id), element);
     // check strings
     expect(stringCodec.nameToIndex, hasLength(3));
diff --git a/pkg/analysis_server/test/services/index/store/split_store_test.dart b/pkg/analysis_server/test/services/index/store/split_store_test.dart
index 35372e0..68b7eb3 100644
--- a/pkg/analysis_server/test/services/index/store/split_store_test.dart
+++ b/pkg/analysis_server/test/services/index/store/split_store_test.dart
@@ -249,7 +249,7 @@
   Element _mockElement() {
     int elementId = nextElementId++;
     Element element = new MockElement();
-    when(elementCodec.encode(element)).thenReturn(elementId);
+    when(elementCodec.encode(element, anyBool)).thenReturn(elementId);
     when(elementCodec.decode(context, elementId)).thenReturn(element);
     return element;
   }
@@ -335,7 +335,7 @@
   Element _mockElement() {
     int elementId = nextElementId++;
     Element element = new MockElement();
-    when(elementCodec.encode(element)).thenReturn(elementId);
+    when(elementCodec.encode(element, anyBool)).thenReturn(elementId);
     when(elementCodec.decode(context, elementId)).thenReturn(element);
     return element;
   }
@@ -363,7 +363,7 @@
   void test_newForObject() {
     // prepare Element
     Element element = new MockElement();
-    when(elementCodec.encode(element)).thenReturn(42);
+    when(elementCodec.encode(element, anyBool)).thenReturn(42);
     when(elementCodec.decode(context, 42)).thenReturn(element);
     // create
     Location location = new Location(element, 1, 2);
@@ -376,9 +376,9 @@
     // getLocation()
     {
       Location newLocation = locationData.getLocation(context, elementCodec);
-      expect(location.element, element);
-      expect(location.offset, 1);
-      expect(location.length, 2);
+      expect(newLocation.element, element);
+      expect(newLocation.offset, 1);
+      expect(newLocation.length, 2);
     }
     // no Element - no Location
     {
@@ -452,7 +452,7 @@
       ElementLocation location = new ElementLocationImpl.con3(['foo', 'bar']);
       when(element.location).thenReturn(location);
       when(context.getElement(location)).thenReturn(element);
-      when(elementCodec.encode(element)).thenReturn(elementId);
+      when(elementCodec.encode(element, anyBool)).thenReturn(elementId);
     }
     // prepare relationship
     Relationship relationship = Relationship.getRelationship('my-relationship');
@@ -526,6 +526,7 @@
     when(contextA.getElement(elementLocationB)).thenReturn(elementB);
     when(contextA.getElement(elementLocationC)).thenReturn(elementC);
     when(contextA.getElement(elementLocationD)).thenReturn(elementD);
+    when(librarySource.fullName).thenReturn('/home/user/librarySource.dart');
     when(sourceA.fullName).thenReturn('/home/user/sourceA.dart');
     when(sourceB.fullName).thenReturn('/home/user/sourceB.dart');
     when(sourceC.fullName).thenReturn('/home/user/sourceC.dart');
diff --git a/pkg/analysis_server/test/services/refactoring/extract_local_test.dart b/pkg/analysis_server/test/services/refactoring/extract_local_test.dart
index 7ba1124..6cdb90c 100644
--- a/pkg/analysis_server/test/services/refactoring/extract_local_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/extract_local_test.dart
@@ -288,16 +288,16 @@
 
   test_const_inList_inConditionalExpression() {
     indexTestUnit('''
-main(bool b) {
-  const [b ? 1 : 2, 3];
+main() {
+  const [true ? 1 : 2, 3];
 }
 ''');
     _createRefactoringForString('1');
     // apply refactoring
     return _assertSuccessfulRefactoring('''
-main(bool b) {
+main() {
   const res = 1;
-  const [b ? res : 2, 3];
+  const [true ? res : 2, 3];
 }
 ''');
   }
diff --git a/pkg/analysis_server/test/services/refactoring/move_file_test.dart b/pkg/analysis_server/test/services/refactoring/move_file_test.dart
index e07b85e..6c6d53b 100644
--- a/pkg/analysis_server/test/services/refactoring/move_file_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/move_file_test.dart
@@ -105,7 +105,7 @@
   test_importedLibrary_package() {
     // configure packages
     testFile = '/packages/my_pkg/aaa/test.dart';
-    File testFileRes = provider.newFile(testFile, '');
+    provider.newFile(testFile, '');
     Map<String, List<Folder>> packageMap = {
       'my_pkg': [provider.getResource('/packages/my_pkg')]
     };
diff --git a/pkg/analysis_server/test/services/search/hierarchy_test.dart b/pkg/analysis_server/test/services/search/hierarchy_test.dart
index 65820bf..3c17d86 100644
--- a/pkg/analysis_server/test/services/search/hierarchy_test.dart
+++ b/pkg/analysis_server/test/services/search/hierarchy_test.dart
@@ -100,7 +100,6 @@
     ClassElement classB = findElement("B");
     ClassElement classC = findElement("C");
     ClassElement classD = findElement("D");
-    ClassElement classE = findElement("E");
     ClassMemberElement memberA = classA.fields[0];
     ClassMemberElement memberB = classB.fields[0];
     ClassMemberElement memberC = classC.fields[0];
@@ -185,9 +184,7 @@
 ''');
     ClassElement classA = findElement("A");
     ClassElement classB = findElement("B");
-    ClassElement classC = findElement("C");
     ClassElement classD = findElement("D");
-    ClassElement classE = findElement("E");
     ClassMemberElement memberA = classA.methods[0];
     ClassMemberElement memberB = classB.methods[0];
     ClassMemberElement memberD = classD.methods[0];
diff --git a/pkg/analysis_server/test/services/search/search_engine_test.dart b/pkg/analysis_server/test/services/search/search_engine_test.dart
index 293e0af..ce4e6fa 100644
--- a/pkg/analysis_server/test/services/search/search_engine_test.dart
+++ b/pkg/analysis_server/test/services/search/search_engine_test.dart
@@ -169,8 +169,6 @@
   print(p.test); // p-read-ur-q
 }
 ''');
-    ClassElement elementA = findElement('A');
-    ClassElement elementB = findElement('B');
     Element mainA = findElement('mainA');
     Element main = findElement('main');
     var expected = [
@@ -372,8 +370,8 @@
   Future test_searchReferences_LibraryElement() {
     var codeA = 'part of lib; // A';
     var codeB = 'part of lib; // B';
-    var sourceA = addSource('/unitA.dart', codeA);
-    var sourceB = addSource('/unitB.dart', codeB);
+    addSource('/unitA.dart', codeA);
+    addSource('/unitB.dart', codeB);
     _indexTestUnit('''
 library lib;
 part 'unitA.dart';
@@ -384,7 +382,6 @@
     CompilationUnitElement elementB = element.parts[1];
     index.indexUnit(context, elementA.node);
     index.indexUnit(context, elementB.node);
-    Element mainElement = findElement('main');
     var expected = [
         new ExpectedMatch(
             elementA,
@@ -631,13 +628,11 @@
 var E = null;
 class NoMatchABCDE {}
 ''');
-    NameElement element = new NameElement('test');
     Element topA = findElement('A');
     Element topB = findElement('B');
     Element topC = findElement('C');
     Element topD = findElement('D');
     Element topE = findElement('E');
-    Element topNoMatch = new MockElement('NoMatchABCDE');
     var expected = [
         _expectId(topA, MatchKind.DECLARATION, 'A {} // A'),
         _expectId(topB, MatchKind.DECLARATION, 'B ='),
diff --git a/pkg/analysis_server/test/timing/timing_framework.dart b/pkg/analysis_server/test/timing/timing_framework.dart
index 273bef8..d79b6bd 100644
--- a/pkg/analysis_server/test/timing/timing_framework.dart
+++ b/pkg/analysis_server/test/timing/timing_framework.dart
@@ -205,7 +205,6 @@
     }
     // Give the server a short time to comply with the shutdown request; if it
     // doesn't exit, then forcibly terminate it.
-    Completer processExited = new Completer();
     sendServerShutdown();
     return server.exitCode.timeout(SHUTDOWN_TIMEOUT, onTimeout: () {
       return server.kill();
diff --git a/pkg/analysis_server/tool/spec/codegen_java_types.dart b/pkg/analysis_server/tool/spec/codegen_java_types.dart
index b28fab3..ea003cb 100644
--- a/pkg/analysis_server/tool/spec/codegen_java_types.dart
+++ b/pkg/analysis_server/tool/spec/codegen_java_types.dart
@@ -664,7 +664,6 @@
   Map<String, FileContentsComputer> map =
       new Map<String, FileContentsComputer>();
   for (ImpliedType impliedType in impliedTypes.values) {
-    TypeDecl type = impliedType.type;
     String typeNameInSpec = capitalize(impliedType.camelName);
     bool isRefactoringFeedback = impliedType.kind == 'refactoringFeedback';
     bool isRefactoringOption = impliedType.kind == 'refactoringOptions';
diff --git a/pkg/analysis_server/tool/spec/spec_input.html b/pkg/analysis_server/tool/spec/spec_input.html
index 70ee2b2..1d8e68d 100644
--- a/pkg/analysis_server/tool/spec/spec_input.html
+++ b/pkg/analysis_server/tool/spec/spec_input.html
@@ -1878,7 +1878,15 @@
           in a completion suggestion.
         </p>
         <enum>
-          <value><code>ARGUMENT_LIST</code></value>
+          <value>
+          <code>ARGUMENT_LIST</code>
+            <p>
+              A list of arguments for the method or function that is being invoked.
+              For this suggestion kind, the completion field is a textual representation
+              of the invocation and the parameterNames, parameterTypes, and requiredParameterCount
+              attributes are defined.
+            </p>
+          </value>
           <value><code>IMPORT</code></value>
           <value>
             <code>IDENTIFIER</code>
diff --git a/pkg/analyzer/bin/analyzer.dart b/pkg/analyzer/bin/analyzer.dart
index c7efb78..bf1ce78 100644
--- a/pkg/analyzer/bin/analyzer.dart
+++ b/pkg/analyzer/bin/analyzer.dart
@@ -107,7 +107,7 @@
     Stream cmdLine = stdin
         .transform(UTF8.decoder)
         .transform(new LineSplitter());
-    var subscription = cmdLine.listen((String line) {
+    cmdLine.listen((String line) {
       // may be finish
       if (line.isEmpty) {
         var time = stopwatch.elapsedMilliseconds;
diff --git a/pkg/analyzer/bin/formatter.dart b/pkg/analyzer/bin/formatter.dart
index 28436f6..bfb03b5 100755
--- a/pkg/analyzer/bin/formatter.dart
+++ b/pkg/analyzer/bin/formatter.dart
@@ -154,7 +154,6 @@
       return;
     }
     try {
-      var buffer = new StringBuffer();
       var rawSource = file.readAsStringSync();
       var formatted = _format(rawSource, CodeKind.COMPILATION_UNIT);
       if (overwriteFileContents) {
diff --git a/pkg/analyzer/lib/src/error_formatter.dart b/pkg/analyzer/lib/src/error_formatter.dart
index 206a168..d9e6a28 100644
--- a/pkg/analyzer/lib/src/error_formatter.dart
+++ b/pkg/analyzer/lib/src/error_formatter.dart
@@ -135,7 +135,7 @@
       out.write('|');
       out.write(error.errorCode.type);
       out.write('|');
-      out.write(error.errorCode);
+      out.write(error.errorCode.name);
       out.write('|');
       out.write(escapePipe(source.fullName));
       out.write('|');
diff --git a/pkg/analyzer/lib/src/generated/ast.dart b/pkg/analyzer/lib/src/generated/ast.dart
index ddc9a1b..790a9dc 100644
--- a/pkg/analyzer/lib/src/generated/ast.dart
+++ b/pkg/analyzer/lib/src/generated/ast.dart
@@ -530,7 +530,7 @@
    * element representing the parameter to which the value of the given expression will be bound.
    * Otherwise, return `null`.
    *
-   * This method is only intended to be used by [Expression#getPropagatedParameterElement].
+   * This method is only intended to be used by [Expression.propagatedParameterElement].
    *
    * @param expression the expression corresponding to the parameter to be returned
    * @return the parameter element representing the parameter to which the value of the expression
@@ -557,7 +557,7 @@
    * element representing the parameter to which the value of the given expression will be bound.
    * Otherwise, return `null`.
    *
-   * This method is only intended to be used by [Expression#getStaticParameterElement].
+   * This method is only intended to be used by [Expression.staticParameterElement].
    *
    * @param expression the expression corresponding to the parameter to be returned
    * @return the parameter element representing the parameter to which the value of the expression
@@ -920,7 +920,7 @@
    * propagated type information, then return the parameter element representing the parameter to
    * which the value of the right operand will be bound. Otherwise, return `null`.
    *
-   * This method is only intended to be used by [Expression#getPropagatedParameterElement].
+   * This method is only intended to be used by [Expression.propagatedParameterElement].
    *
    * @return the parameter element representing the parameter to which the value of the right
    *         operand will be bound
@@ -960,7 +960,7 @@
    * type information, then return the parameter element representing the parameter to which the
    * value of the right operand will be bound. Otherwise, return `null`.
    *
-   * This method is only intended to be used by [Expression#getStaticParameterElement].
+   * This method is only intended to be used by [Expression.staticParameterElement].
    *
    * @return the parameter element representing the parameter to which the value of the right
    *         operand will be bound
@@ -3330,7 +3330,7 @@
    * propagated type information, then return the parameter element representing the parameter to
    * which the value of the right operand will be bound. Otherwise, return `null`.
    *
-   * This method is only intended to be used by [Expression#getPropagatedParameterElement].
+   * This method is only intended to be used by [Expression.propagatedParameterElement].
    *
    * @return the parameter element representing the parameter to which the value of the right
    *         operand will be bound
@@ -3351,7 +3351,7 @@
    * type information, then return the parameter element representing the parameter to which the
    * value of the right operand will be bound. Otherwise, return `null`.
    *
-   * This method is only intended to be used by [Expression#getStaticParameterElement].
+   * This method is only intended to be used by [Expression.staticParameterElement].
    *
    * @return the parameter element representing the parameter to which the value of the right
    *         operand will be bound
@@ -6198,17 +6198,14 @@
  * This recursive Ast visitor is used to run over [Expression]s to determine if the expression
  * is composed by at least one deferred [PrefixedIdentifier].
  *
- * @see PrefixedIdentifier#isDeferred()
+ * See [PrefixedIdentifier.isDeferred].
  */
 class DeferredLibraryReferenceDetector extends RecursiveAstVisitor<Object> {
   bool _result = false;
 
   /**
-   * Return the result, `true` if the visitor found a [PrefixedIdentifier] that returned
-   * `true` to the [PrefixedIdentifier#isDeferred] query.
-   *
-   * @return `true` if the visitor found a [PrefixedIdentifier] that returned
-   *         `true` to the [PrefixedIdentifier#isDeferred] query
+   * Return `true` if the visitor found a [PrefixedIdentifier] that returned
+   * `true` to the [PrefixedIdentifier.isDeferred] query.
    */
   bool get result => _result;
 
@@ -6911,9 +6908,9 @@
  */
 abstract class Expression extends AstNode {
   /**
-   * An empty array of expressions.
+   * An empty list of expressions.
    */
-  static List<Expression> EMPTY_ARRAY = new List<Expression>(0);
+  static const List<Expression> EMPTY_ARRAY = const <Expression>[];
 
   /**
    * The static type of this expression, or `null` if the AST structure has not been resolved.
@@ -7842,7 +7839,6 @@
  * formalParameter ::=
  *     [NormalFormalParameter]
  *   | [DefaultFormalParameter]
- *   | [DefaultFormalParameter]
  * </pre>
  */
 abstract class FormalParameter extends AstNode {
@@ -10444,7 +10440,7 @@
    * expression is returned.
    *
    * @return the expression used to compute the object being indexed
-   * @see #getTarget()
+   * See [target].
    */
   Expression get realTarget {
     if (isCascaded) {
@@ -10482,7 +10478,7 @@
    * expression is part of a cascade expression.
    *
    * @return the expression used to compute the object being indexed
-   * @see #getRealTarget()
+   * See [realTarget].
    */
   Expression get target => _target;
 
@@ -10607,7 +10603,7 @@
    * propagated type information, then return the parameter element representing the parameter to
    * which the value of the index expression will be bound. Otherwise, return `null`.
    *
-   * This method is only intended to be used by [Expression#getPropagatedParameterElement].
+   * This method is only intended to be used by [Expression.propagatedParameterElement].
    *
    * @return the parameter element representing the parameter to which the value of the index
    *         expression will be bound
@@ -10628,7 +10624,7 @@
    * type information, then return the parameter element representing the parameter to which the
    * value of the index expression will be bound. Otherwise, return `null`.
    *
-   * This method is only intended to be used by [Expression#getStaticParameterElement].
+   * This method is only intended to be used by [Expression.staticParameterElement].
    *
    * @return the parameter element representing the parameter to which the value of the index
    *         expression will be bound
@@ -12024,7 +12020,7 @@
    * returned.
    *
    * @return the expression used to compute the receiver of the invocation
-   * @see #getTarget()
+   * See [target].
    */
   Expression get realTarget {
     if (isCascaded) {
@@ -12046,7 +12042,7 @@
    * invocation is part of a cascade expression.
    *
    * @return the expression producing the object on which the method is defined
-   * @see #getRealTarget()
+   * See [realTarget].
    */
   Expression get target => _target;
 
@@ -14184,7 +14180,7 @@
    * propagated type information, then return the parameter element representing the parameter to
    * which the value of the operand will be bound. Otherwise, return `null`.
    *
-   * This method is only intended to be used by [Expression#getPropagatedParameterElement].
+   * This method is only intended to be used by [Expression.propagatedParameterElement].
    *
    * @return the parameter element representing the parameter to which the value of the right
    *         operand will be bound
@@ -14205,7 +14201,7 @@
    * type information, then return the parameter element representing the parameter to which the
    * value of the operand will be bound. Otherwise, return `null`.
    *
-   * This method is only intended to be used by [Expression#getStaticParameterElement].
+   * This method is only intended to be used by [Expression.staticParameterElement].
    *
    * @return the parameter element representing the parameter to which the value of the right
    *         operand will be bound
@@ -14359,7 +14355,7 @@
    * propagated type information, then return the parameter element representing the parameter to
    * which the value of the operand will be bound. Otherwise, return `null`.
    *
-   * This method is only intended to be used by [Expression#getPropagatedParameterElement].
+   * This method is only intended to be used by [Expression.propagatedParameterElement].
    *
    * @return the parameter element representing the parameter to which the value of the right
    *         operand will be bound
@@ -14380,7 +14376,7 @@
    * type information, then return the parameter element representing the parameter to which the
    * value of the operand will be bound. Otherwise, return `null`.
    *
-   * This method is only intended to be used by [Expression#getStaticParameterElement].
+   * This method is only intended to be used by [Expression.staticParameterElement].
    *
    * @return the parameter element representing the parameter to which the value of the right
    *         operand will be bound
@@ -14606,7 +14602,7 @@
    * returned.
    *
    * @return the expression used to compute the receiver of the invocation
-   * @see #getTarget()
+   * See [target].
    */
   Expression get realTarget {
     if (isCascaded) {
@@ -14627,7 +14623,7 @@
    * `null` if this property access is part of a cascade expression.
    *
    * @return the expression computing the object defining the property being accessed
-   * @see #getRealTarget()
+   * See [realTarget].
    */
   Expression get target => _target;
 
@@ -19573,7 +19569,7 @@
 }
 
 /**
- * Validation codes returned by [UriBasedDirective#validate].
+ * Validation codes returned by [UriBasedDirective.validate].
  */
 class UriValidationCode extends Enum<UriValidationCode> {
   static const UriValidationCode INVALID_URI = const UriValidationCode('INVALID_URI', 0);
@@ -20165,7 +20161,7 @@
   /**
    * The elements contained in the list.
    */
-  List<E> _elements = <E> [];
+  List<E> _elements = <E>[];
 
   /**
    * Initialize a newly created list of nodes to be empty.
@@ -20261,7 +20257,7 @@
     _elements[index] = node;
   }
   void clear() {
-    _elements = <E> [];
+    _elements = <E>[];
   }
   int get length => _elements.length;
   void set length(int value) {
diff --git a/pkg/analyzer/lib/src/generated/constant.dart b/pkg/analyzer/lib/src/generated/constant.dart
index 21f12f6..a361ede 100644
--- a/pkg/analyzer/lib/src/generated/constant.dart
+++ b/pkg/analyzer/lib/src/generated/constant.dart
@@ -656,7 +656,7 @@
       // const factory constructor that we can emulate.
       if (constructor.name == "fromEnvironment") {
         if (!_checkFromEnvironmentArguments(arguments, argumentValues, namedArgumentValues, definingClass)) {
-          errorReporter.reportErrorForNode(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, node, []);
+          errorReporter.reportErrorForNode(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, node);
           return null;
         }
         String variableName = argumentCount < 1 ? null : argumentValues[0].stringValue;
@@ -675,7 +675,7 @@
         }
       } else if (constructor.name == "" && identical(definingClass, typeProvider.symbolType) && argumentCount == 1) {
         if (!_checkSymbolArguments(arguments, argumentValues, namedArgumentValues)) {
-          errorReporter.reportErrorForNode(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, node, []);
+          errorReporter.reportErrorForNode(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, node);
           return null;
         }
         String argumentValue = argumentValues[0].stringValue;
@@ -1120,7 +1120,7 @@
     if (conditionResult == null) {
       return conditionResult;
     } else if (!conditionResult.isBool) {
-      _errorReporter.reportErrorForNode(CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL, condition, []);
+      _errorReporter.reportErrorForNode(CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL, condition);
       return null;
     } else if (thenResult == null) {
       return thenResult;
@@ -1180,7 +1180,7 @@
   @override
   DartObjectImpl visitListLiteral(ListLiteral node) {
     if (node.constKeyword == null) {
-      _errorReporter.reportErrorForNode(CompileTimeErrorCode.MISSING_CONST_IN_LIST_LITERAL, node, []);
+      _errorReporter.reportErrorForNode(CompileTimeErrorCode.MISSING_CONST_IN_LIST_LITERAL, node);
       return null;
     }
     bool errorOccurred = false;
@@ -1210,7 +1210,7 @@
   @override
   DartObjectImpl visitMapLiteral(MapLiteral node) {
     if (node.constKeyword == null) {
-      _errorReporter.reportErrorForNode(CompileTimeErrorCode.MISSING_CONST_IN_MAP_LITERAL, node, []);
+      _errorReporter.reportErrorForNode(CompileTimeErrorCode.MISSING_CONST_IN_MAP_LITERAL, node);
       return null;
     }
     bool errorOccurred = false;
@@ -1437,7 +1437,7 @@
    * @param code the error code indicating the nature of the error
    */
   void _error(AstNode node, ErrorCode code) {
-    _errorReporter.reportErrorForNode(code == null ? CompileTimeErrorCode.INVALID_CONSTANT : code, node, []);
+    _errorReporter.reportErrorForNode(code == null ? CompileTimeErrorCode.INVALID_CONSTANT : code, node);
   }
 
   /**
@@ -1599,7 +1599,7 @@
       try {
         return leftOperand.add(_typeProvider, rightOperand);
       } on EvaluationException catch (exception) {
-        _errorReporter.reportErrorForNode(exception.errorCode, node, []);
+        _errorReporter.reportErrorForNode(exception.errorCode, node);
         return null;
       }
     }
@@ -1617,7 +1617,7 @@
       try {
         return evaluationResult.convertToBool(_typeProvider);
       } on EvaluationException catch (exception) {
-        _errorReporter.reportErrorForNode(exception.errorCode, node, []);
+        _errorReporter.reportErrorForNode(exception.errorCode, node);
       }
     }
     return null;
@@ -1628,7 +1628,7 @@
       try {
         return leftOperand.bitAnd(_typeProvider, rightOperand);
       } on EvaluationException catch (exception) {
-        _errorReporter.reportErrorForNode(exception.errorCode, node, []);
+        _errorReporter.reportErrorForNode(exception.errorCode, node);
       }
     }
     return null;
@@ -1639,7 +1639,7 @@
       try {
         return evaluationResult.bitNot(_typeProvider);
       } on EvaluationException catch (exception) {
-        _errorReporter.reportErrorForNode(exception.errorCode, node, []);
+        _errorReporter.reportErrorForNode(exception.errorCode, node);
       }
     }
     return null;
@@ -1650,7 +1650,7 @@
       try {
         return leftOperand.bitOr(_typeProvider, rightOperand);
       } on EvaluationException catch (exception) {
-        _errorReporter.reportErrorForNode(exception.errorCode, node, []);
+        _errorReporter.reportErrorForNode(exception.errorCode, node);
       }
     }
     return null;
@@ -1661,7 +1661,7 @@
       try {
         return leftOperand.bitXor(_typeProvider, rightOperand);
       } on EvaluationException catch (exception) {
-        _errorReporter.reportErrorForNode(exception.errorCode, node, []);
+        _errorReporter.reportErrorForNode(exception.errorCode, node);
       }
     }
     return null;
@@ -1672,7 +1672,7 @@
       try {
         return leftOperand.concatenate(_typeProvider, rightOperand);
       } on EvaluationException catch (exception) {
-        _errorReporter.reportErrorForNode(exception.errorCode, node, []);
+        _errorReporter.reportErrorForNode(exception.errorCode, node);
       }
     }
     return null;
@@ -1683,7 +1683,7 @@
       try {
         return leftOperand.divide(_typeProvider, rightOperand);
       } on EvaluationException catch (exception) {
-        _errorReporter.reportErrorForNode(exception.errorCode, node, []);
+        _errorReporter.reportErrorForNode(exception.errorCode, node);
       }
     }
     return null;
@@ -1694,7 +1694,7 @@
       try {
         return leftOperand.equalEqual(_typeProvider, rightOperand);
       } on EvaluationException catch (exception) {
-        _errorReporter.reportErrorForNode(exception.errorCode, node, []);
+        _errorReporter.reportErrorForNode(exception.errorCode, node);
       }
     }
     return null;
@@ -1705,7 +1705,7 @@
       try {
         return leftOperand.greaterThan(_typeProvider, rightOperand);
       } on EvaluationException catch (exception) {
-        _errorReporter.reportErrorForNode(exception.errorCode, node, []);
+        _errorReporter.reportErrorForNode(exception.errorCode, node);
       }
     }
     return null;
@@ -1716,7 +1716,7 @@
       try {
         return leftOperand.greaterThanOrEqual(_typeProvider, rightOperand);
       } on EvaluationException catch (exception) {
-        _errorReporter.reportErrorForNode(exception.errorCode, node, []);
+        _errorReporter.reportErrorForNode(exception.errorCode, node);
       }
     }
     return null;
@@ -1727,7 +1727,7 @@
       try {
         return leftOperand.integerDivide(_typeProvider, rightOperand);
       } on EvaluationException catch (exception) {
-        _errorReporter.reportErrorForNode(exception.errorCode, node, []);
+        _errorReporter.reportErrorForNode(exception.errorCode, node);
       }
     }
     return null;
@@ -1739,7 +1739,7 @@
       try {
         return leftOperand.isIdentical(_typeProvider, rightOperand);
       } on EvaluationException catch (exception) {
-        _errorReporter.reportErrorForNode(exception.errorCode, node, []);
+        _errorReporter.reportErrorForNode(exception.errorCode, node);
       }
     }
     return null;
@@ -1750,7 +1750,7 @@
       try {
         return leftOperand.lessThan(_typeProvider, rightOperand);
       } on EvaluationException catch (exception) {
-        _errorReporter.reportErrorForNode(exception.errorCode, node, []);
+        _errorReporter.reportErrorForNode(exception.errorCode, node);
       }
     }
     return null;
@@ -1761,7 +1761,7 @@
       try {
         return leftOperand.lessThanOrEqual(_typeProvider, rightOperand);
       } on EvaluationException catch (exception) {
-        _errorReporter.reportErrorForNode(exception.errorCode, node, []);
+        _errorReporter.reportErrorForNode(exception.errorCode, node);
       }
     }
     return null;
@@ -1772,7 +1772,7 @@
       try {
         return leftOperand.logicalAnd(_typeProvider, rightOperand);
       } on EvaluationException catch (exception) {
-        _errorReporter.reportErrorForNode(exception.errorCode, node, []);
+        _errorReporter.reportErrorForNode(exception.errorCode, node);
       }
     }
     return null;
@@ -1783,7 +1783,7 @@
       try {
         return evaluationResult.logicalNot(_typeProvider);
       } on EvaluationException catch (exception) {
-        _errorReporter.reportErrorForNode(exception.errorCode, node, []);
+        _errorReporter.reportErrorForNode(exception.errorCode, node);
       }
     }
     return null;
@@ -1794,7 +1794,7 @@
       try {
         return leftOperand.logicalOr(_typeProvider, rightOperand);
       } on EvaluationException catch (exception) {
-        _errorReporter.reportErrorForNode(exception.errorCode, node, []);
+        _errorReporter.reportErrorForNode(exception.errorCode, node);
       }
     }
     return null;
@@ -1805,7 +1805,7 @@
       try {
         return leftOperand.minus(_typeProvider, rightOperand);
       } on EvaluationException catch (exception) {
-        _errorReporter.reportErrorForNode(exception.errorCode, node, []);
+        _errorReporter.reportErrorForNode(exception.errorCode, node);
       }
     }
     return null;
@@ -1816,7 +1816,7 @@
       try {
         return evaluationResult.negated(_typeProvider);
       } on EvaluationException catch (exception) {
-        _errorReporter.reportErrorForNode(exception.errorCode, node, []);
+        _errorReporter.reportErrorForNode(exception.errorCode, node);
       }
     }
     return null;
@@ -1827,7 +1827,7 @@
       try {
         return leftOperand.notEqual(_typeProvider, rightOperand);
       } on EvaluationException catch (exception) {
-        _errorReporter.reportErrorForNode(exception.errorCode, node, []);
+        _errorReporter.reportErrorForNode(exception.errorCode, node);
       }
     }
     return null;
@@ -1838,7 +1838,7 @@
       try {
         return evaluationResult.performToString(_typeProvider);
       } on EvaluationException catch (exception) {
-        _errorReporter.reportErrorForNode(exception.errorCode, node, []);
+        _errorReporter.reportErrorForNode(exception.errorCode, node);
       }
     }
     return null;
@@ -1849,7 +1849,7 @@
       try {
         return leftOperand.remainder(_typeProvider, rightOperand);
       } on EvaluationException catch (exception) {
-        _errorReporter.reportErrorForNode(exception.errorCode, node, []);
+        _errorReporter.reportErrorForNode(exception.errorCode, node);
       }
     }
     return null;
@@ -1860,7 +1860,7 @@
       try {
         return leftOperand.shiftLeft(_typeProvider, rightOperand);
       } on EvaluationException catch (exception) {
-        _errorReporter.reportErrorForNode(exception.errorCode, node, []);
+        _errorReporter.reportErrorForNode(exception.errorCode, node);
       }
     }
     return null;
@@ -1871,7 +1871,7 @@
       try {
         return leftOperand.shiftRight(_typeProvider, rightOperand);
       } on EvaluationException catch (exception) {
-        _errorReporter.reportErrorForNode(exception.errorCode, node, []);
+        _errorReporter.reportErrorForNode(exception.errorCode, node);
       }
     }
     return null;
@@ -1888,7 +1888,7 @@
       try {
         return new EvaluationResultImpl.con1(evaluationResult.value.stringLength(_typeProvider));
       } on EvaluationException catch (exception) {
-        _errorReporter.reportErrorForNode(exception.errorCode, node, []);
+        _errorReporter.reportErrorForNode(exception.errorCode, node);
       }
     }
     return new EvaluationResultImpl.con1(null);
@@ -1899,7 +1899,7 @@
       try {
         return leftOperand.times(_typeProvider, rightOperand);
       } on EvaluationException catch (exception) {
-        _errorReporter.reportErrorForNode(exception.errorCode, node, []);
+        _errorReporter.reportErrorForNode(exception.errorCode, node);
       }
     }
     return null;
@@ -1921,6 +1921,11 @@
   final InstanceState _state;
 
   /**
+   * An empty list of objects.
+   */
+  static const List<DartObjectImpl> EMPTY_LIST = const <DartObjectImpl>[];
+
+  /**
    * Initialize a newly created object to have the given type and state.
    *
    * @param type the run-time type of this object
diff --git a/pkg/analyzer/lib/src/generated/element.dart b/pkg/analyzer/lib/src/generated/element.dart
index 6025f07..755b8c6 100644
--- a/pkg/analyzer/lib/src/generated/element.dart
+++ b/pkg/analyzer/lib/src/generated/element.dart
@@ -472,7 +472,7 @@
   /**
    * An empty array of property elements.
    */
-  static final List<AngularPropertyElement> EMPTY_ARRAY = [];
+  static final List<AngularPropertyElement> EMPTY_ARRAY = <AngularPropertyElement>[];
 
   /**
    * Returns the field this property is mapped to.
@@ -596,7 +596,7 @@
   /**
    * An empty array of scope property elements.
    */
-  static final List<AngularScopePropertyElement> EMPTY_ARRAY = [];
+  static final List<AngularScopePropertyElement> EMPTY_ARRAY = <AngularScopePropertyElement>[];
 
   /**
    * Returns the type of this property, not `null`, maybe <code>dynamic</code>.
@@ -1031,6 +1031,12 @@
   bool get isProxy;
 
   /**
+   * Determine whether the given [constructor], which exists in the superclass
+   * of this class, is accessible to constructors in this class.
+   */
+  bool isSuperConstructorAccessible(ConstructorElement constructor);
+
+  /**
    * Return `true` if this class is defined by a typedef construct.
    *
    * @return `true` if this class is defined by a typedef construct
@@ -1501,6 +1507,23 @@
   }
 
   @override
+  bool isSuperConstructorAccessible(ConstructorElement constructor) {
+    // If this class has no mixins, then all superclass constructors are
+    // accessible.
+    if (mixins.isEmpty) {
+      return true;
+    }
+    // Otherwise only constructors that lack optional parameters are
+    // accessible (see dartbug.com/19576).
+    for (ParameterElement parameter in constructor.parameters) {
+      if (parameter.parameterKind != ParameterKind.REQUIRED) {
+        return false;
+      }
+    }
+    return true;
+  }
+
+  @override
   bool get isTypedef => hasModifier(Modifier.TYPEDEF);
 
   @override
@@ -2625,134 +2648,107 @@
 }
 
 /**
- * The interface `Type` defines the behavior of objects representing the declared type of
- * elements in the element model.
+ * The interface `DartType` defines the behavior of objects representing the
+ * declared type of elements in the element model.
  */
 abstract class DartType {
   /**
-   * Return the name of this type as it should appear when presented to users in contexts such as
-   * error messages.
-   *
-   * @return the name of this type
+   * Return the name of this type as it should appear when presented to users in
+   * contexts such as error messages.
    */
   String get displayName;
 
   /**
-   * Return the element representing the declaration of this type, or `null` if the type has
-   * not, or cannot, be associated with an element. The former case will occur if the element model
-   * is not yet complete; the latter case will occur if this object represents an undefined type.
-   *
-   * @return the element representing the declaration of this type
+   * Return the element representing the declaration of this type, or `null` if
+   * the type has not, or cannot, be associated with an element. The former case
+   * will occur if the element model is not yet complete; the latter case will
+   * occur if this object represents an undefined type.
    */
   Element get element;
 
   /**
-   * Return the least upper bound of this type and the given type, or `null` if there is no
-   * least upper bound.
-   *
-   * @param type the other type used to compute the least upper bound
-   * @return the least upper bound of this type and the given type
+   * Return the least upper bound of this type and the given [type], or `null`
+   * if there is no least upper bound.
    */
   DartType getLeastUpperBound(DartType type);
 
   /**
-   * Return the name of this type, or `null` if the type does not have a name, such as when
-   * the type represents the type of an unnamed function.
-   *
-   * @return the name of this type
+   * Return the name of this type, or `null` if the type does not have a name,
+   * such as when the type represents the type of an unnamed function.
    */
   String get name;
 
   /**
-   * Return `true` if this type is assignable to the given type. A type <i>T</i> may be
-   * assigned to a type <i>S</i>, written <i>T</i> &hArr; <i>S</i>, iff either <i>T</i> <: <i>S</i>
-   * or <i>S</i> <: <i>T</i>.
-   *
-   * @param type the type being compared with this type
-   * @return `true` if this type is assignable to the given type
+   * Return `true` if this type is assignable to the given [type]. A type
+   * <i>T</i> may be assigned to a type <i>S</i>, written <i>T</i> &hArr;
+   * <i>S</i>, iff either <i>T</i> <: <i>S</i> or <i>S</i> <: <i>T</i>.
    */
   bool isAssignableTo(DartType type);
 
   /**
    * Return `true` if this type represents the bottom type.
-   *
-   * @return `true` if this type represents the bottom type
    */
   bool get isBottom;
 
   /**
-   * Return `true` if this type represents the type 'Function' defined in the dart:core
-   * library.
-   *
-   * @return `true` if this type represents the type 'Function' defined in the dart:core
-   *         library
+   * Return `true` if this type represents the type 'Function' defined in the
+   * dart:core library.
    */
   bool get isDartCoreFunction;
 
   /**
    * Return `true` if this type represents the type 'dynamic'.
-   *
-   * @return `true` if this type represents the type 'dynamic'
    */
   bool get isDynamic;
 
   /**
-   * Return `true` if this type is more specific than the given type.
-   *
-   * @param type the type being compared with this type
-   * @return `true` if this type is more specific than the given type
+   * Return `true` if this type is more specific than the given [type].
    */
   bool isMoreSpecificThan(DartType type);
 
   /**
    * Return `true` if this type represents the type 'Object'.
-   *
-   * @return `true` if this type represents the type 'Object'
    */
   bool get isObject;
 
   /**
-   * Return `true` if this type is a subtype of the given type.
-   *
-   * @param type the type being compared with this type
-   * @return `true` if this type is a subtype of the given type
+   * Return `true` if this type is a subtype of the given [type].
    */
   bool isSubtypeOf(DartType type);
 
   /**
-   * Return `true` if this type is a supertype of the given type. A type <i>S</i> is a
-   * supertype of <i>T</i>, written <i>S</i> :> <i>T</i>, iff <i>T</i> is a subtype of <i>S</i>.
-   *
-   * @param type the type being compared with this type
-   * @return `true` if this type is a supertype of the given type
+   * Return `true` if this type is a supertype of the given [type]. A type
+   * <i>S</i> is a supertype of <i>T</i>, written <i>S</i> :> <i>T</i>, iff
+   * <i>T</i> is a subtype of <i>S</i>.
    */
   bool isSupertypeOf(DartType type);
 
   /**
-   * Return `true` if this type represents a typename that couldn't be
-   * resolved.
+   * Return `true` if this type represents a typename that couldn't be resolved.
    */
   bool get isUndefined;
 
   /**
    * Return `true` if this type represents the type 'void'.
-   *
-   * @return `true` if this type represents the type 'void'
    */
   bool get isVoid;
 
   /**
-   * Return the type resulting from substituting the given arguments for the given parameters in
-   * this type. The specification defines this operation in section 2: <blockquote> The notation
-   * <i>[x<sub>1</sub>, ..., x<sub>n</sub>/y<sub>1</sub>, ..., y<sub>n</sub>]E</i> denotes a copy of
-   * <i>E</i> in which all occurrences of <i>y<sub>i</sub>, 1 <= i <= n</i> have been replaced with
-   * <i>x<sub>i</sub></i>.</blockquote> Note that, contrary to the specification, this method will
-   * not create a copy of this type if no substitutions were required, but will return this type
-   * directly.
+   * Return the type resulting from substituting the given [argumentTypes] for
+   * the given [parameterTypes] in this type. The specification defines this
+   * operation in section 2:
+   * <blockquote>
+   * The notation <i>[x<sub>1</sub>, ..., x<sub>n</sub>/y<sub>1</sub>, ...,
+   * y<sub>n</sub>]E</i> denotes a copy of <i>E</i> in which all occurrences of
+   * <i>y<sub>i</sub>, 1 <= i <= n</i> have been replaced with
+   * <i>x<sub>i</sub></i>.
+   * </blockquote>
+   * Note that, contrary to the specification, this method will not create a
+   * copy of this type if no substitutions were required, but will return this
+   * type directly.
    *
-   * @param argumentTypes the actual type arguments being substituted for the parameters
-   * @param parameterTypes the parameters to be replaced
-   * @return the result of performing the substitution
+   * Note too that the current implementation of this method is only guaranteed
+   * to work when the argument types are type variables.
    */
   DartType substitute2(List<DartType> argumentTypes, List<DartType> parameterTypes);
 }
@@ -3388,6 +3384,26 @@
     return shortName;
   }
 
+  /**
+   * Return `true` if this element is used or potentially can be used.
+   *
+   * For a top-level element: it is public, or it is private and used in the
+   * defining library.
+   *
+   * For a local variable: its value is used (i.e. purely read or invoked)
+   * somewhere in its scope.
+   *
+   * This information is only available for local variables (including
+   * parameters) and only after the compilation unit containing the element
+   * has been resolved.
+   */
+  bool get isUsed {
+    if (isPublic) {
+      return true;
+    }
+    return hasModifier(Modifier.IS_USED_IN_LIBRARY);
+  }
+
   @override
   LibraryElement get library => getAncestor((element) => element is LibraryElement);
 
@@ -3555,6 +3571,13 @@
   bool hasModifier(Modifier modifier) => BooleanArray.getEnum(_modifiers, modifier);
 
   /**
+   * Specifies that the element is used.
+   */
+  void markUsed() {
+    setModifier(Modifier.IS_USED_IN_LIBRARY, true);
+  }
+
+  /**
    * If the given child is not `null`, use the given visitor to visit it.
    *
    * @param child the child to be visited
@@ -3903,8 +3926,8 @@
 }
 
 /**
- * The class `ElementPair` is a pair of [Element]s. [Object#equals] and
- * [Object#hashCode] so this class can be used in hashed data structures.
+ * The class `ElementPair` is a pair of [Element]s. [Object.==] and
+ * [Object.hashCode] so this class can be used in hashed data structures.
  */
 class ElementPair {
   /**
@@ -6268,8 +6291,7 @@
  * The interface `HtmlScriptElement` defines the behavior of elements representing a script
  * tag in an HTML file.
  *
- * @see EmbeddedHtmlScriptElement
- * @see ExternalHtmlScriptElement
+ * See [EmbeddedHtmlScriptElement], and [ExternalHtmlScriptElement],
  */
 abstract class HtmlScriptElement implements Element {
 }
@@ -6693,11 +6715,9 @@
   PropertyAccessorElement lookUpSetterInSuperclass(String setterName, LibraryElement library);
 
   /**
-   * Return the type resulting from substituting the given arguments for this type's parameters.
-   * This is fully equivalent to `substitute(argumentTypes, getTypeArguments())`.
-   *
-   * @param argumentTypes the actual type arguments being substituted for the type parameters
-   * @return the result of performing the substitution
+   * Return the type resulting from substituting the given arguments for this
+   * type's parameters. This is fully equivalent to `substitute2(argumentTypes,
+   * getTypeArguments())`.
    */
   InterfaceType substitute4(List<DartType> argumentTypes);
 
@@ -6717,7 +6737,7 @@
    * @param type the [Type] to compute the longest inheritance path of from the passed
    *          [Type] to Object
    * @return the computed longest inheritance path to Object
-   * @see InterfaceType#getLeastUpperBound(Type)
+   * See [InterfaceType.getLeastUpperBound].
    */
   static int computeLongestInheritancePathToObject(InterfaceType type) => _computeLongestInheritancePathToObject(type, 0, new HashSet<ClassElement>());
 
@@ -6726,7 +6746,7 @@
    *
    * @param type the [Type] to compute the set of superinterfaces of
    * @return the [Set] of superinterfaces of the passed [Type]
-   * @see #getLeastUpperBound(Type)
+   * See [getLeastUpperBound].
    */
   static Set<InterfaceType> computeSuperinterfaceSet(InterfaceType type) => _computeSuperinterfaceSet(type, new HashSet<InterfaceType>());
 
@@ -6740,8 +6760,7 @@
    * @param depth a field used recursively
    * @param visitedClasses the classes that have already been visited
    * @return the computed longest inheritance path to Object
-   * @see #computeLongestInheritancePathToObject(Type)
-   * @see #getLeastUpperBound(Type)
+   * See [computeLongestInheritancePathToObject], and [getLeastUpperBound].
    */
   static int _computeLongestInheritancePathToObject(InterfaceType type, int depth, HashSet<ClassElement> visitedClasses) {
     ClassElement classElement = type.element;
@@ -6784,8 +6803,7 @@
    * @param type the [Type] to compute the set of superinterfaces of
    * @param set a [HashSet] used recursively by this method
    * @return the [Set] of superinterfaces of the passed [Type]
-   * @see #computeSuperinterfaceSet(Type)
-   * @see #getLeastUpperBound(Type)
+   * See [computeSuperinterfaceSet], and [getLeastUpperBound].
    */
   static Set<InterfaceType> _computeSuperinterfaceSet(InterfaceType type, HashSet<InterfaceType> set) {
     Element element = type.element;
@@ -8279,6 +8297,11 @@
   accept(ElementVisitor visitor) => visitor.visitLocalVariableElement(this);
 
   @override
+  bool get isUsed {
+    return hasModifier(Modifier.IS_USED_IN_LIBRARY);
+  }
+
+  @override
   ElementKind get kind => ElementKind.LOCAL_VARIABLE;
 
   @override
@@ -8779,47 +8802,59 @@
   static const Modifier HAS_EXT_URI = const Modifier('HAS_EXT_URI', 9);
 
   /**
+   * Indicates that the element is used in the declaring library.
+   *
+   *
+   * For a top-level element: it is public, or it is private and used in the
+   * defining library.
+   *
+   * For a local variable: its value is used (i.e. purely read or invoked)
+   * somewhere in its scope.
+   */
+  static const Modifier IS_USED_IN_LIBRARY = const Modifier('IS_USED_IN_LIBRARY', 10);
+
+  /**
    * Indicates that a class can validly be used as a mixin.
    */
-  static const Modifier MIXIN = const Modifier('MIXIN', 10);
+  static const Modifier MIXIN = const Modifier('MIXIN', 11);
 
   /**
    * Indicates that the value of a parameter or local variable might be mutated within the context.
    */
-  static const Modifier POTENTIALLY_MUTATED_IN_CONTEXT = const Modifier('POTENTIALLY_MUTATED_IN_CONTEXT', 11);
+  static const Modifier POTENTIALLY_MUTATED_IN_CONTEXT = const Modifier('POTENTIALLY_MUTATED_IN_CONTEXT', 12);
 
   /**
    * Indicates that the value of a parameter or local variable might be mutated within the scope.
    */
-  static const Modifier POTENTIALLY_MUTATED_IN_SCOPE = const Modifier('POTENTIALLY_MUTATED_IN_SCOPE', 12);
+  static const Modifier POTENTIALLY_MUTATED_IN_SCOPE = const Modifier('POTENTIALLY_MUTATED_IN_SCOPE', 13);
 
   /**
    * Indicates that a class contains an explicit reference to 'super'.
    */
-  static const Modifier REFERENCES_SUPER = const Modifier('REFERENCES_SUPER', 13);
+  static const Modifier REFERENCES_SUPER = const Modifier('REFERENCES_SUPER', 14);
 
   /**
    * Indicates that the pseudo-modifier 'set' was applied to the element.
    */
-  static const Modifier SETTER = const Modifier('SETTER', 14);
+  static const Modifier SETTER = const Modifier('SETTER', 15);
 
   /**
    * Indicates that the modifier 'static' was applied to the element.
    */
-  static const Modifier STATIC = const Modifier('STATIC', 15);
+  static const Modifier STATIC = const Modifier('STATIC', 16);
 
   /**
    * Indicates that the element does not appear in the source code but was implicitly created. For
    * example, if a class does not define any constructors, an implicit zero-argument constructor
    * will be created and it will be marked as being synthetic.
    */
-  static const Modifier SYNTHETIC = const Modifier('SYNTHETIC', 16);
+  static const Modifier SYNTHETIC = const Modifier('SYNTHETIC', 17);
 
   /**
    * Indicates that a class was defined using an alias. TODO(brianwilkerson) This should be renamed
    * to 'ALIAS'.
    */
-  static const Modifier TYPEDEF = const Modifier('TYPEDEF', 17);
+  static const Modifier TYPEDEF = const Modifier('TYPEDEF', 18);
 
   static const List<Modifier> values = const [
       ABSTRACT,
@@ -8832,6 +8867,7 @@
       GENERATOR,
       GETTER,
       HAS_EXT_URI,
+      IS_USED_IN_LIBRARY,
       MIXIN,
       POTENTIALLY_MUTATED_IN_CONTEXT,
       POTENTIALLY_MUTATED_IN_SCOPE,
@@ -9123,7 +9159,7 @@
   /**
    * An empty array of namespace combinators.
    */
-  static final List<NamespaceCombinator> EMPTY_ARRAY = new List<NamespaceCombinator>(0);
+  static const List<NamespaceCombinator> EMPTY_ARRAY = const <NamespaceCombinator>[];
 }
 
 /**
diff --git a/pkg/analyzer/lib/src/generated/element_handle.dart b/pkg/analyzer/lib/src/generated/element_handle.dart
index 328a37b..8f582bb 100644
--- a/pkg/analyzer/lib/src/generated/element_handle.dart
+++ b/pkg/analyzer/lib/src/generated/element_handle.dart
@@ -105,6 +105,10 @@
   bool get isProxy => actualElement.isProxy;
 
   @override
+  bool isSuperConstructorAccessible(ConstructorElement constructor) =>
+      actualElement.isSuperConstructorAccessible(constructor);
+
+  @override
   bool get isTypedef => actualElement.isTypedef;
 
   @override
diff --git a/pkg/analyzer/lib/src/generated/element_resolver.dart b/pkg/analyzer/lib/src/generated/element_resolver.dart
index 04d3684..886da2a 100644
--- a/pkg/analyzer/lib/src/generated/element_resolver.dart
+++ b/pkg/analyzer/lib/src/generated/element_resolver.dart
@@ -868,14 +868,16 @@
     if (prefixElement is PrefixElement) {
       Element element = _resolver.nameScope.lookup(node, _definingLibrary);
       if (element == null && identifier.inSetterContext()) {
-        element = _resolver.nameScope.lookup(new ElementResolver_SyntheticIdentifier("${node.name}="), _definingLibrary);
+        element = _resolver.nameScope.lookup(new SyntheticIdentifier(
+            "${node.name}=", node),
+            _definingLibrary);
       }
       if (element == null) {
         if (identifier.inSetterContext()) {
           _resolver.reportErrorForNode(StaticWarningCode.UNDEFINED_SETTER, identifier, [identifier.name, prefixElement.name]);
         } else if (node.parent is Annotation) {
           Annotation annotation = node.parent as Annotation;
-          _resolver.reportErrorForNode(CompileTimeErrorCode.INVALID_ANNOTATION, annotation, []);
+          _resolver.reportErrorForNode(CompileTimeErrorCode.INVALID_ANNOTATION, annotation);
           return null;
         } else {
           _resolver.reportErrorForNode(StaticWarningCode.UNDEFINED_GETTER, identifier, [identifier.name, prefixElement.name]);
@@ -1013,22 +1015,23 @@
     Element element = _resolveSimpleIdentifier(node);
     ClassElement enclosingClass = _resolver.enclosingClass;
     if (_isFactoryConstructorReturnType(node) && !identical(element, enclosingClass)) {
-      _resolver.reportErrorForNode(CompileTimeErrorCode.INVALID_FACTORY_NAME_NOT_A_CLASS, node, []);
+      _resolver.reportErrorForNode(CompileTimeErrorCode.INVALID_FACTORY_NAME_NOT_A_CLASS, node);
     } else if (_isConstructorReturnType(node) && !identical(element, enclosingClass)) {
-      _resolver.reportErrorForNode(CompileTimeErrorCode.INVALID_CONSTRUCTOR_NAME, node, []);
+      _resolver.reportErrorForNode(CompileTimeErrorCode.INVALID_CONSTRUCTOR_NAME, node);
       element = null;
     } else if (element == null || (element is PrefixElement && !_isValidAsPrefix(node))) {
       // TODO(brianwilkerson) Recover from this error.
       if (_isConstructorReturnType(node)) {
-        _resolver.reportErrorForNode(CompileTimeErrorCode.INVALID_CONSTRUCTOR_NAME, node, []);
+        _resolver.reportErrorForNode(CompileTimeErrorCode.INVALID_CONSTRUCTOR_NAME, node);
       } else if (node.parent is Annotation) {
         Annotation annotation = node.parent as Annotation;
-        _resolver.reportErrorForNode(CompileTimeErrorCode.INVALID_ANNOTATION, annotation, []);
+        _resolver.reportErrorForNode(CompileTimeErrorCode.INVALID_ANNOTATION, annotation);
       } else {
         _recordUndefinedNode(_resolver.enclosingClass, StaticWarningCode.UNDEFINED_IDENTIFIER, node, [node.name]);
       }
     }
     node.staticElement = element;
+    _markElementUsed(element);
     if (node.inSetterContext() && node.inGetterContext() && enclosingClass != null) {
       InterfaceType enclosingType = enclosingClass.type;
       AuxiliaryElements auxiliaryElements = new AuxiliaryElements(_lookUpGetter(null, enclosingType, node.name), null);
@@ -1059,7 +1062,8 @@
     SimpleIdentifier name = node.constructorName;
     String superName = name != null ? name.name : null;
     ConstructorElement element = superType.lookUpConstructor(superName, _definingLibrary);
-    if (element == null) {
+    if (element == null ||
+        !enclosingClass.isSuperConstructorAccessible(element)) {
       if (name != null) {
         _resolver.reportErrorForNode(CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER, node, [superType.displayName, name]);
       } else {
@@ -1086,7 +1090,7 @@
   @override
   Object visitSuperExpression(SuperExpression node) {
     if (!_isSuperInValidContext(node)) {
-      _resolver.reportErrorForNode(CompileTimeErrorCode.SUPER_IN_INVALID_CONTEXT, node, []);
+      _resolver.reportErrorForNode(CompileTimeErrorCode.SUPER_IN_INVALID_CONTEXT, node);
     }
     return super.visitSuperExpression(node);
   }
@@ -1212,7 +1216,7 @@
 
   /**
    * Check that the for some index expression that the method element was resolved, otherwise a
-   * [StaticWarningCode#UNDEFINED_OPERATOR] is generated.
+   * [StaticTypeWarningCode.UNDEFINED_OPERATOR] is generated.
    *
    * @param node the index expression to resolve
    * @param target the target of the expression
@@ -1312,7 +1316,7 @@
    * @param element the enclosing element. If null, `true` will be returned.
    * @return `false` iff the passed [Element] is a [ClassElement] that is a proxy
    *         or inherits proxy
-   * @see ClassElement#isOrInheritsProxy()
+   * See [ClassElement.isOrInheritsProxy].
    */
   bool _doesntHaveProxy(Element element) => !(element is ClassElement && element.isOrInheritsProxy);
 
@@ -1329,7 +1333,9 @@
     for (ImportElement importElement in _definingLibrary.imports) {
       PrefixElement prefixElement = importElement.prefix;
       if (prefixElement != null) {
-        Identifier prefixedIdentifier = new ElementResolver_SyntheticIdentifier("${prefixElement.name}.${identifier.name}");
+        Identifier prefixedIdentifier = new SyntheticIdentifier(
+            "${prefixElement.name}.${identifier.name}",
+            identifier);
         Element importedElement = nameScope.lookup(prefixedIdentifier, _definingLibrary);
         if (importedElement != null) {
           if (element == null) {
@@ -1897,6 +1903,29 @@
   }
 
   /**
+   * Marks [element] as used in its defining library.
+   */
+  void _markElementUsed(Element element) {
+    // only locally defined elements
+    if (element == null) {
+      return;
+    }
+    if (!identical(element.library, _definingLibrary)) {
+      return;
+    }
+    // convert members to base elements
+    if (element is Member) {
+      element = (element as Member).baseElement;
+    }
+    // ignore references to an element from itself
+    if (identical(element, _resolver.enclosingClass)) {
+      return;
+    }
+    // OK, the element is used
+    (element as ElementImpl).markUsed();
+  }
+
+  /**
    * Given some class element, this method uses [subtypeManager] to find the set of all
    * subtypes; the subtypes are then searched for a member (method, getter, or setter), that matches
    * a passed
@@ -2114,7 +2143,7 @@
     }
     // we need constructor
     if (constructor == null) {
-      _resolver.reportErrorForNode(CompileTimeErrorCode.INVALID_ANNOTATION, annotation, []);
+      _resolver.reportErrorForNode(CompileTimeErrorCode.INVALID_ANNOTATION, annotation);
       return;
     }
     // record element
@@ -2126,13 +2155,13 @@
   void _resolveAnnotationElementGetter(Annotation annotation, PropertyAccessorElement accessorElement) {
     // accessor should be synthetic
     if (!accessorElement.isSynthetic) {
-      _resolver.reportErrorForNode(CompileTimeErrorCode.INVALID_ANNOTATION, annotation, []);
+      _resolver.reportErrorForNode(CompileTimeErrorCode.INVALID_ANNOTATION, annotation);
       return;
     }
     // variable should be constant
     VariableElement variableElement = accessorElement.variable;
     if (!variableElement.isConst) {
-      _resolver.reportErrorForNode(CompileTimeErrorCode.INVALID_ANNOTATION, annotation, []);
+      _resolver.reportErrorForNode(CompileTimeErrorCode.INVALID_ANNOTATION, annotation);
     }
     // OK
     return;
@@ -2355,7 +2384,7 @@
         // imported top-level function or top-level getter that returns a function.
         //
         String name = "${target.name}.$methodName";
-        Identifier functionName = new ElementResolver_SyntheticIdentifier(name);
+        Identifier functionName = new SyntheticIdentifier(name, methodName);
         Element element = _resolver.nameScope.lookup(functionName, _definingLibrary);
         if (element != null) {
           // TODO(brianwilkerson) This isn't a method invocation, it's a function invocation where
@@ -2487,8 +2516,11 @@
           element = setter;
         }
       }
-    } else if (element == null && (node.inSetterContext() || node.parent is CommentReference)) {
-      element = _resolver.nameScope.lookup(new ElementResolver_SyntheticIdentifier("${node.name}="), _definingLibrary);
+    } else if (element == null
+        && (node.inSetterContext() || node.parent is CommentReference)) {
+      element = _resolver.nameScope.lookup(
+          new SyntheticIdentifier("${node.name}=", node),
+          _definingLibrary);
     }
     ClassElement enclosingClass = _resolver.enclosingClass;
     if (element == null && enclosingClass != null) {
@@ -2591,23 +2623,28 @@
 }
 
 /**
- * Instances of the class `SyntheticIdentifier` implement an identifier that can be used to
- * look up names in the lexical scope when there is no identifier in the AST structure. There is
- * no identifier in the AST when the parser could not distinguish between a method invocation and
- * an invocation of a top-level function imported with a prefix.
+ * A `SyntheticIdentifier` is an identifier that can be used to look up names in
+ * the lexical scope when there is no identifier in the AST structure. There is
+ * no identifier in the AST when the parser could not distinguish between a
+ * method invocation and an invocation of a top-level function imported with a
+ * prefix.
  */
-class ElementResolver_SyntheticIdentifier extends Identifier {
+class SyntheticIdentifier extends Identifier {
   /**
    * The name of the synthetic identifier.
    */
   final String name;
 
   /**
-   * Initialize a newly created synthetic identifier to have the given name.
-   *
-   * @param name the name of the synthetic identifier
+   * The identifier to be highlighted in case of an error
    */
-  ElementResolver_SyntheticIdentifier(this.name);
+  final Identifier targetIdentifier;
+
+  /**
+   * Initialize a newly created synthetic identifier to have the given [name]
+   * and [targetIdentifier].
+   */
+  SyntheticIdentifier(this.name, this.targetIdentifier);
 
   @override
   accept(AstVisitor visitor) => null;
@@ -2622,6 +2659,12 @@
   sc.Token get endToken => null;
 
   @override
+  int get length => targetIdentifier.length;
+
+  @override
+  int get offset => targetIdentifier.offset;
+
+  @override
   int get precedence => 16;
 
   @override
@@ -2634,4 +2677,3 @@
   void visitChildren(AstVisitor visitor) {
   }
 }
-
diff --git a/pkg/analyzer/lib/src/generated/engine.dart b/pkg/analyzer/lib/src/generated/engine.dart
index 3404ad8..9164e8e 100644
--- a/pkg/analyzer/lib/src/generated/engine.dart
+++ b/pkg/analyzer/lib/src/generated/engine.dart
@@ -336,7 +336,7 @@
    * @return all of the errors associated with the given source
    * @throws AnalysisException if the errors could not be determined because the analysis could not
    *           be performed
-   * @see #getErrors(Source)
+   * See [getErrors].
    */
   List<AnalysisError> computeErrors(Source source);
 
@@ -353,7 +353,7 @@
    * @return the element model corresponding to the HTML file defined by the given source
    * @throws AnalysisException if the element model could not be determined because the analysis
    *           could not be performed
-   * @see #getHtmlElement(Source)
+   * See [getHtmlElement].
    */
   HtmlElement computeHtmlElement(Source source);
 
@@ -365,7 +365,7 @@
    *
    * @param source the source whose kind is to be returned
    * @return the kind of the given source
-   * @see #getKindOf(Source)
+   * See [getKindOf].
    */
   SourceKind computeKindOf(Source source);
 
@@ -381,7 +381,7 @@
    * @return the element model corresponding to the library defined by the given source
    * @throws AnalysisException if the element model could not be determined because the analysis
    *           could not be performed
-   * @see #getLibraryElement(Source)
+   * See [getLibraryElement].
    */
   LibraryElement computeLibraryElement(Source source);
 
@@ -397,7 +397,7 @@
    * @return the line information for the given source
    * @throws AnalysisException if the line information could not be determined because the analysis
    *           could not be performed
-   * @see #getLineInfo(Source)
+   * See [getLineInfo].
    */
   LineInfo computeLineInfo(Source source);
 
@@ -488,7 +488,7 @@
    *
    * @param source the source whose errors are to be returned
    * @return all of the errors associated with the given source and the line info
-   * @see #computeErrors(Source)
+   * See [computeErrors].
    */
   AnalysisErrorInfo getErrors(Source source);
 
@@ -499,7 +499,7 @@
    *
    * @param source the source defining the HTML file whose element model is to be returned
    * @return the element model corresponding to the HTML file defined by the given source
-   * @see #computeHtmlElement(Source)
+   * See [computeHtmlElement].
    */
   HtmlElement getHtmlElement(Source source);
 
@@ -526,7 +526,7 @@
    *
    * @param source the source whose kind is to be returned
    * @return the kind of the given source
-   * @see #computeKindOf(Source)
+   * See [computeKindOf].
    */
   SourceKind getKindOf(Source source);
 
@@ -611,7 +611,7 @@
    *
    * @param source the source whose line information is to be returned
    * @return the line information for the given source
-   * @see #computeLineInfo(Source)
+   * See [computeLineInfo].
    */
   LineInfo getLineInfo(Source source);
 
@@ -646,7 +646,7 @@
    * @param unitSource the source of the compilation unit
    * @param library the library containing the compilation unit
    * @return a fully resolved AST for the compilation unit
-   * @see #resolveCompilationUnit(Source, LibraryElement)
+   * See [resolveCompilationUnit].
    */
   CompilationUnit getResolvedCompilationUnit(Source unitSource, LibraryElement library);
 
@@ -658,7 +658,7 @@
    * @param librarySource the source of the defining compilation unit of the library containing the
    *          compilation unit
    * @return a fully resolved AST for the compilation unit
-   * @see #resolveCompilationUnit(Source, Source)
+   * See [resolveCompilationUnit].
    */
   CompilationUnit getResolvedCompilationUnit2(Source unitSource, Source librarySource);
 
@@ -668,7 +668,7 @@
    *
    * @param htmlSource the source of the HTML unit
    * @return a fully resolved HTML unit
-   * @see #resolveHtmlUnit(Source)
+   * See [resolveHtmlUnit].
    */
   ht.HtmlUnit getResolvedHtmlUnit(Source htmlSource);
 
@@ -766,7 +766,7 @@
    * @return the result of resolving the AST structure representing the content of the source in the
    *         context of the given library
    * @throws AnalysisException if the analysis could not be performed
-   * @see #getResolvedCompilationUnit(Source, LibraryElement)
+   * See [getResolvedCompilationUnit].
    */
   CompilationUnit resolveCompilationUnit(Source unitSource, LibraryElement library);
 
@@ -783,7 +783,7 @@
    * @return the result of resolving the AST structure representing the content of the source in the
    *         context of the given library
    * @throws AnalysisException if the analysis could not be performed
-   * @see #getResolvedCompilationUnit(Source, Source)
+   * See [getResolvedCompilationUnit].
    */
   CompilationUnit resolveCompilationUnit2(Source unitSource, Source librarySource);
 
@@ -2199,7 +2199,7 @@
   /**
    * Given a source for a Dart file and the library that contains it, return a cache entry in which
    * the state of the data represented by the given descriptor is either [CacheState.VALID] or
-   * [CacheState#ERROR]. This method assumes that the data can be produced by generating hints
+   * [CacheStateERROR]. This method assumes that the data can be produced by generating hints
    * for the library if the data is not already cached.
    *
    * <b>Note:</b> This method cannot be used in an async environment.
@@ -6597,7 +6597,7 @@
       // parse name
       Expression nameExpression = _parseDartExpressionInToken(formatterToken);
       if (nameExpression is! SimpleIdentifier) {
-        _reportErrorForNode(AngularCode.INVALID_FORMATTER_NAME, nameExpression, []);
+        _reportErrorForNode(AngularCode.INVALID_FORMATTER_NAME, nameExpression);
         continue;
       }
       SimpleIdentifier name = nameExpression as SimpleIdentifier;
@@ -6610,7 +6610,8 @@
         if (colonToken.type == TokenType.COLON) {
           formatterToken = formatterToken.next;
         } else {
-          _reportErrorForToken(AngularCode.MISSING_FORMATTER_COLON, colonToken, []);
+          _reportErrorForToken(AngularCode.MISSING_FORMATTER_COLON, colonToken);
+          break;
         }
         // parse argument
         Expression argument = _parseDartExpressionInToken(formatterToken);
@@ -6648,21 +6649,21 @@
   /**
    * Reports given [ErrorCode] at the given [AstNode].
    */
-  void _reportErrorForNode(ErrorCode errorCode, AstNode node, List<Object> arguments) {
+  void _reportErrorForNode(ErrorCode errorCode, AstNode node, [List<Object> arguments]) {
     _reportErrorForOffset(errorCode, node.offset, node.length, arguments);
   }
 
   /**
    * Reports given [ErrorCode] at the given position.
    */
-  void _reportErrorForOffset(ErrorCode errorCode, int offset, int length, List<Object> arguments) {
+  void _reportErrorForOffset(ErrorCode errorCode, int offset, int length, [List<Object> arguments]) {
     _errorListener.onError(new AnalysisError.con2(_source, offset, length, errorCode, arguments));
   }
 
   /**
    * Reports given [ErrorCode] at the given [Token].
    */
-  void _reportErrorForToken(ErrorCode errorCode, Token token, List<Object> arguments) {
+  void _reportErrorForToken(ErrorCode errorCode, Token token, [List<Object> arguments]) {
     _reportErrorForOffset(errorCode, token.offset, token.length, arguments);
   }
 
@@ -8811,8 +8812,12 @@
       // Use the ConstantVerifier to verify the use of constants. This needs to happen before using
       // the ErrorVerifier because some error codes need the computed constant values.
       //
-      ConstantVerifier constantVerifier = new ConstantVerifier(errorReporter, libraryElement, typeProvider);
-      _unit.accept(constantVerifier);
+      // TODO(paulberry): as a temporary workaround for issue 21572,
+      // ConstantVerifier is being run right after ConstantValueComputer, so we
+      // don't need to run it here.  Once issue 21572 is fixed, re-enable the
+      // call to ConstantVerifier.
+      // ConstantVerifier constantVerifier = new ConstantVerifier(errorReporter, libraryElement, typeProvider);
+      // _unit.accept(constantVerifier);
       //
       // Use the ErrorVerifier to compute the rest of the errors.
       //
@@ -9254,7 +9259,7 @@
  * Instances of the class `IncrementalAnalysisCache` hold information used to perform
  * incremental analysis.
  *
- * @see AnalysisContextImpl.setChangedContents(Source, String, int, int, int)
+ * See [AnalysisContextImpl.setChangedContents].
  */
 class IncrementalAnalysisCache {
   /**
@@ -10753,7 +10758,7 @@
       return null;
     }
     if (code == UriValidationCode.URI_WITH_INTERPOLATION) {
-      errorListener.onError(new AnalysisError.con2(librarySource, uriLiteral.offset, uriLiteral.length, CompileTimeErrorCode.URI_WITH_INTERPOLATION, []));
+      errorListener.onError(new AnalysisError.con2(librarySource, uriLiteral.offset, uriLiteral.length, CompileTimeErrorCode.URI_WITH_INTERPOLATION));
       return null;
     }
     if (code == UriValidationCode.INVALID_URI) {
@@ -11377,7 +11382,7 @@
     // prepare value of the "attributes" attribute
     String attributesText = attributesAttribute.text;
     if (attributesText.trim().isEmpty) {
-      _reportErrorForAttribute(attributesAttribute, PolymerCode.EMPTY_ATTRIBUTES, []);
+      _reportErrorForAttribute(attributesAttribute, PolymerCode.EMPTY_ATTRIBUTES);
       return;
     }
     // prepare attribute name tokens
@@ -11448,7 +11453,7 @@
     // prepare 'name' attribute
     ht.XmlAttributeNode nameAttribute = node.getAttribute("name");
     if (nameAttribute == null) {
-      _reportErrorForToken(node.tagToken, PolymerCode.MISSING_TAG_NAME, []);
+      _reportErrorForToken(node.tagToken, PolymerCode.MISSING_TAG_NAME);
       return;
     }
     // prepare name
@@ -11540,14 +11545,14 @@
   /**
    * Reports an error on the attribute's value, or (if absent) on the attribute's name.
    */
-  void _reportErrorForAttribute(ht.XmlAttributeNode node, ErrorCode errorCode, List<Object> arguments) {
+  void _reportErrorForAttribute(ht.XmlAttributeNode node, ErrorCode errorCode, [List<Object> arguments]) {
     _reportErrorForOffset(node.offset, node.length, errorCode, arguments);
   }
 
   /**
    * Reports an error on the attribute's value, or (if absent) on the attribute's name.
    */
-  void _reportErrorForAttributeValue(ht.XmlAttributeNode node, ErrorCode errorCode, List<Object> arguments) {
+  void _reportErrorForAttributeValue(ht.XmlAttributeNode node, ErrorCode errorCode, [List<Object> arguments]) {
     ht.Token valueToken = node.valueToken;
     if (valueToken == null || valueToken.isSynthetic) {
       _reportErrorForAttribute(node, errorCode, arguments);
@@ -11556,17 +11561,17 @@
     }
   }
 
-  void _reportErrorForNameToken(PolymerHtmlUnitBuilder_NameToken token, ErrorCode errorCode, List<Object> arguments) {
+  void _reportErrorForNameToken(PolymerHtmlUnitBuilder_NameToken token, ErrorCode errorCode, [List<Object> arguments]) {
     int offset = token._offset;
     int length = token._value.length;
     _reportErrorForOffset(offset, length, errorCode, arguments);
   }
 
-  void _reportErrorForOffset(int offset, int length, ErrorCode errorCode, List<Object> arguments) {
+  void _reportErrorForOffset(int offset, int length, ErrorCode errorCode, [List<Object> arguments]) {
     _errorListener.onError(new AnalysisError.con2(_source, offset, length, errorCode, arguments));
   }
 
-  void _reportErrorForToken(ht.Token token, ErrorCode errorCode, List<Object> arguments) {
+  void _reportErrorForToken(ht.Token token, ErrorCode errorCode, [List<Object> arguments]) {
     int offset = token.offset;
     int length = token.length;
     _reportErrorForOffset(offset, length, errorCode, arguments);
@@ -12631,8 +12636,12 @@
       ErrorReporter errorReporter = new ErrorReporter(errorListener, source);
       ErrorVerifier errorVerifier = new ErrorVerifier(errorReporter, _libraryElement, typeProvider, inheritanceManager);
       unit.accept(errorVerifier);
-      ConstantVerifier constantVerifier = new ConstantVerifier(errorReporter, _libraryElement, typeProvider);
-      unit.accept(constantVerifier);
+      // TODO(paulberry): as a temporary workaround for issue 21572,
+      // ConstantVerifier is being run right after ConstantValueComputer, so we
+      // don't need to run it here.  Once issue 21572 is fixed, re-enable the
+      // call to ConstantVerifier.
+      // ConstantVerifier constantVerifier = new ConstantVerifier(errorReporter, _libraryElement, typeProvider);
+      // unit.accept(constantVerifier);
     } finally {
       counterHandleErrors.stop();
     }
diff --git a/pkg/analyzer/lib/src/generated/error.dart b/pkg/analyzer/lib/src/generated/error.dart
index a197646..86f83ad 100644
--- a/pkg/analyzer/lib/src/generated/error.dart
+++ b/pkg/analyzer/lib/src/generated/error.dart
@@ -2,9 +2,6 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-// This code was auto-generated, is not intended to be edited, and is subject to
-// significant change. Please see the README file for more information.
-
 library engine.error;
 
 import 'dart:collection';
@@ -18,13 +15,13 @@
  * Instances of the class `AnalysisError` represent an error discovered during the analysis of
  * some Dart code.
  *
- * @see AnalysisErrorListener
+ * See [AnalysisErrorListener].
  */
 class AnalysisError {
   /**
    * An empty array of errors used when no errors are expected.
    */
-  static List<AnalysisError> NO_ERRORS = new List<AnalysisError>(0);
+  static const List<AnalysisError> NO_ERRORS = const <AnalysisError>[];
 
   /**
    * A [Comparator] that sorts by the name of the file that the [AnalysisError] was
@@ -96,7 +93,7 @@
    * @param errorCode the error code to be associated with this error
    * @param arguments the arguments used to build the error message
    */
-  AnalysisError.con1(this.source, this.errorCode, List<Object> arguments) {
+  AnalysisError.con1(this.source, this.errorCode, [List<Object> arguments]) {
     this._message = formatList(errorCode.message, arguments);
   }
 
@@ -109,7 +106,7 @@
    * @param errorCode the error code to be associated with this error
    * @param arguments the arguments used to build the error message
    */
-  AnalysisError.con2(this.source, int offset, int length, this.errorCode, List<Object> arguments) {
+  AnalysisError.con2(this.source, int offset, int length, this.errorCode, [List<Object> arguments]) {
     this._offset = offset;
     this._length = length;
     this._message = formatList(errorCode.message, arguments);
@@ -287,77 +284,96 @@
 /**
  * The enumeration `AngularCode` defines Angular specific problems.
  */
-class AngularCode extends Enum<AngularCode> implements ErrorCode {
-  static const AngularCode CANNOT_PARSE_SELECTOR = const AngularCode('CANNOT_PARSE_SELECTOR', 0, "The selector '{0}' cannot be parsed");
+class AngularCode extends ErrorCode {
+  static const AngularCode CANNOT_PARSE_SELECTOR
+      = const AngularCode(
+          'CANNOT_PARSE_SELECTOR',
+          "The selector '{0}' cannot be parsed");
 
-  static const AngularCode INVALID_FORMATTER_NAME = const AngularCode('INVALID_FORMATTER_NAME', 1, "Formatter name must be a simple identifier");
+  static const AngularCode INVALID_FORMATTER_NAME
+      = const AngularCode(
+          'INVALID_FORMATTER_NAME',
+          "Formatter name must be a simple identifier");
 
-  static const AngularCode INVALID_PROPERTY_KIND = const AngularCode('INVALID_PROPERTY_KIND', 2, "Unknown property binding kind '{0}', use one of the '@', '=>', '=>!' or '<=>'");
+  static const AngularCode INVALID_PROPERTY_KIND
+      = const AngularCode(
+          'INVALID_PROPERTY_KIND',
+          "Unknown property binding kind '{0}', use one of the '@', '=>', '=>!' or '<=>'");
 
-  static const AngularCode INVALID_PROPERTY_FIELD = const AngularCode('INVALID_PROPERTY_FIELD', 3, "Unknown property field '{0}'");
+  static const AngularCode INVALID_PROPERTY_FIELD
+      = const AngularCode(
+          'INVALID_PROPERTY_FIELD',
+          "Unknown property field '{0}'");
 
-  static const AngularCode INVALID_PROPERTY_MAP = const AngularCode('INVALID_PROPERTY_MAP', 4, "Argument 'map' must be a constant map literal");
+  static const AngularCode INVALID_PROPERTY_MAP
+      = const AngularCode(
+          'INVALID_PROPERTY_MAP',
+          "Argument 'map' must be a constant map literal");
 
-  static const AngularCode INVALID_PROPERTY_NAME = const AngularCode('INVALID_PROPERTY_NAME', 5, "Property name must be a string literal");
+  static const AngularCode INVALID_PROPERTY_NAME
+      = const AngularCode(
+          'INVALID_PROPERTY_NAME',
+          "Property name must be a string literal");
 
-  static const AngularCode INVALID_PROPERTY_SPEC = const AngularCode('INVALID_PROPERTY_SPEC', 6, "Property binding specification must be a string literal");
+  static const AngularCode INVALID_PROPERTY_SPEC
+      = const AngularCode(
+          'INVALID_PROPERTY_SPEC',
+          "Property binding specification must be a string literal");
 
-  static const AngularCode INVALID_REPEAT_SYNTAX = const AngularCode('INVALID_REPEAT_SYNTAX', 7, "Expected statement in form '_item_ in _collection_ [tracked by _id_]'");
+  static const AngularCode INVALID_REPEAT_SYNTAX
+      = const AngularCode(
+          'INVALID_REPEAT_SYNTAX',
+          "Expected statement in form '_item_ in _collection_ [tracked by _id_]'");
 
-  static const AngularCode INVALID_REPEAT_ITEM_SYNTAX = const AngularCode('INVALID_REPEAT_ITEM_SYNTAX', 8, "Item must by identifier or in '(_key_, _value_)' pair.");
+  static const AngularCode INVALID_REPEAT_ITEM_SYNTAX
+      = const AngularCode(
+          'INVALID_REPEAT_ITEM_SYNTAX',
+          "Item must by identifier or in '(_key_, _value_)' pair.");
 
-  static const AngularCode INVALID_URI = const AngularCode('INVALID_URI', 9, "Invalid URI syntax: '{0}'");
+  static const AngularCode INVALID_URI
+      = const AngularCode(
+          'INVALID_URI',
+          "Invalid URI syntax: '{0}'");
 
-  static const AngularCode MISSING_FORMATTER_COLON = const AngularCode('MISSING_FORMATTER_COLON', 10, "Missing ':' before formatter argument");
+  static const AngularCode MISSING_FORMATTER_COLON
+      = const AngularCode(
+          'MISSING_FORMATTER_COLON',
+          "Missing ':' before formatter argument");
 
-  static const AngularCode MISSING_NAME = const AngularCode('MISSING_NAME', 11, "Argument 'name' must be provided");
+  static const AngularCode MISSING_NAME
+      = const AngularCode(
+          'MISSING_NAME',
+          "Argument 'name' must be provided");
 
-  static const AngularCode MISSING_PUBLISH_AS = const AngularCode('MISSING_PUBLISH_AS', 12, "Argument 'publishAs' must be provided");
+  static const AngularCode MISSING_PUBLISH_AS
+      = const AngularCode(
+          'MISSING_PUBLISH_AS',
+          "Argument 'publishAs' must be provided");
 
-  static const AngularCode MISSING_SELECTOR = const AngularCode('MISSING_SELECTOR', 13, "Argument 'selector' must be provided");
+  static const AngularCode MISSING_SELECTOR
+      = const AngularCode(
+          'MISSING_SELECTOR',
+          "Argument 'selector' must be provided");
 
-  static const AngularCode URI_DOES_NOT_EXIST = const AngularCode('URI_DOES_NOT_EXIST', 14, "Target of URI does not exist: '{0}'");
-
-  static const List<AngularCode> values = const [
-      CANNOT_PARSE_SELECTOR,
-      INVALID_FORMATTER_NAME,
-      INVALID_PROPERTY_KIND,
-      INVALID_PROPERTY_FIELD,
-      INVALID_PROPERTY_MAP,
-      INVALID_PROPERTY_NAME,
-      INVALID_PROPERTY_SPEC,
-      INVALID_REPEAT_SYNTAX,
-      INVALID_REPEAT_ITEM_SYNTAX,
-      INVALID_URI,
-      MISSING_FORMATTER_COLON,
-      MISSING_NAME,
-      MISSING_PUBLISH_AS,
-      MISSING_SELECTOR,
-      URI_DOES_NOT_EXIST];
+  static const AngularCode URI_DOES_NOT_EXIST
+      = const AngularCode(
+          'URI_DOES_NOT_EXIST',
+          "Target of URI does not exist: '{0}'");
 
   /**
-   * The template used to create the message to be displayed for this error.
+   * Initialize a newly created error code to have the given [name]. The message
+   * associated with the error will be created from the given [message]
+   * template. The correction associated with the error will be created from the
+   * given [correction] template.
    */
-  final String message;
-
-  /**
-   * Initialize a newly created error code to have the given message.
-   *
-   * @param message the message template used to create the message to be displayed for the error
-   */
-  const AngularCode(String name, int ordinal, this.message) : super(name, ordinal);
-
-  @override
-  String get correction => null;
+  const AngularCode(String name, String message, [String correction])
+      : super(name, message, correction);
 
   @override
   ErrorSeverity get errorSeverity => ErrorSeverity.INFO;
 
   @override
   ErrorType get type => ErrorType.ANGULAR;
-
-  @override
-  String get uniqueName => "$runtimeType.$name";
 }
 
 /**
@@ -384,13 +400,14 @@
 }
 
 /**
- * The enumeration `CompileTimeErrorCode` defines the error codes used for compile time errors
- * caused by constant evaluation that would throw an exception when run in checked mode. The client
- * of the analysis engine is responsible for determining how these errors should be presented to the
- * user (for example, a command-line compiler might elect to treat these errors differently
- * depending whether it is compiling it "checked" mode).
+ * The enumeration `CompileTimeErrorCode` defines the error codes used for
+ * compile time errors caused by constant evaluation that would throw an
+ * exception when run in checked mode. The client of the analysis engine is
+ * responsible for determining how these errors should be presented to the user
+ * (for example, a command-line compiler might elect to treat these errors
+ * differently depending whether it is compiling it "checked" mode).
  */
-class CheckedModeCompileTimeErrorCode extends Enum<CheckedModeCompileTimeErrorCode> implements ErrorCode {
+class CheckedModeCompileTimeErrorCode extends ErrorCode {
   // TODO(paulberry): improve the text of these error messages so that it's
   // clear to the user that the error is coming from constant evaluation (and
   // hence the constant needs to be a subtype of the annotated type) as opposed
@@ -399,1745 +416,1672 @@
   // errors.
 
   /**
-   * 12.11.2 Const: It is a compile-time error if evaluation of a constant object results in an
-   * uncaught exception being thrown.
+   * 12.11.2 Const: It is a compile-time error if evaluation of a constant
+   * object results in an uncaught exception being thrown.
    */
-  static const CheckedModeCompileTimeErrorCode CONST_CONSTRUCTOR_FIELD_TYPE_MISMATCH =
-      const CheckedModeCompileTimeErrorCode.con1(
+  static const CheckedModeCompileTimeErrorCode CONST_CONSTRUCTOR_FIELD_TYPE_MISMATCH
+      = const CheckedModeCompileTimeErrorCode(
           'CONST_CONSTRUCTOR_FIELD_TYPE_MISMATCH',
-          0,
           "The object type '{0}' cannot be assigned to the field '{1}', which has type '{2}'");
 
   /**
-   * 12.11.2 Const: It is a compile-time error if evaluation of a constant object results in an
-   * uncaught exception being thrown.
+   * 12.11.2 Const: It is a compile-time error if evaluation of a constant
+   * object results in an uncaught exception being thrown.
    */
-  static const CheckedModeCompileTimeErrorCode CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH =
-      const CheckedModeCompileTimeErrorCode.con1(
+  static const CheckedModeCompileTimeErrorCode CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH
+      = const CheckedModeCompileTimeErrorCode(
           'CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH',
-          1,
           "The object type '{0}' cannot be assigned to a parameter of type '{1}'");
 
   /**
-   * 7.6.1 Generative Constructors: In checked mode, it is a dynamic type error if o is not
-   * <b>null</b> and the interface of the class of <i>o</i> is not a subtype of the static type of
-   * the field <i>v</i>.
+   * 7.6.1 Generative Constructors: In checked mode, it is a dynamic type error
+   * if o is not <b>null</b> and the interface of the class of <i>o</i> is not a
+   * subtype of the static type of the field <i>v</i>.
    *
-   * 12.11.2 Const: It is a compile-time error if evaluation of a constant object results in an
-   * uncaught exception being thrown.
+   * 12.11.2 Const: It is a compile-time error if evaluation of a constant
+   * object results in an uncaught exception being thrown.
    *
    * @param initializerType the name of the type of the initializer expression
    * @param fieldType the name of the type of the field
    */
-  static const CheckedModeCompileTimeErrorCode CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE = const CheckedModeCompileTimeErrorCode.con1('CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE', 2, "The initializer type '{0}' cannot be assigned to the field type '{1}'");
+  static const CheckedModeCompileTimeErrorCode CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE
+      = const CheckedModeCompileTimeErrorCode(
+          'CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE',
+          "The initializer type '{0}' cannot be assigned to the field type '{1}'");
 
   /**
-   * 12.6 Lists: A run-time list literal &lt;<i>E</i>&gt; [<i>e<sub>1</sub></i> ...
+   * 12.6 Lists: A run-time list literal &lt;<i>E</i>&gt; [<i>e<sub>1</sub></i>
+   * ... <i>e<sub>n</sub></i>] is evaluated as follows:
+   * * The operator []= is invoked on <i>a</i> with first argument <i>i</i> and
+   *   second argument <i>o<sub>i+1</sub></i><i>, 1 &lt;= i &lt;= n</i>
+   *
+   * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static
+   * type of <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of
+   * <i>p<sub>i</sub>, 1 &lt;= i &lt;= n+k</i> and let <i>S<sub>q</sub></i> be
+   * the type of the named parameter <i>q</i> of <i>f</i>. It is a static
+   * warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<sub>j</sub>,
+   * 1 &lt;= j &lt;= m</i>.
+   */
+  static const CheckedModeCompileTimeErrorCode LIST_ELEMENT_TYPE_NOT_ASSIGNABLE
+      = const CheckedModeCompileTimeErrorCode(
+          'LIST_ELEMENT_TYPE_NOT_ASSIGNABLE',
+          "The element type '{0}' cannot be assigned to the list type '{1}'");
+
+  /**
+   * 12.7 Map: A run-time map literal &lt;<i>K</i>, <i>V</i>&gt;
+   * [<i>k<sub>1</sub></i> : <i>e<sub>1</sub></i> ... <i>k<sub>n</sub></i> :
    * <i>e<sub>n</sub></i>] is evaluated as follows:
-   * * The operator []= is invoked on <i>a</i> with first argument <i>i</i> and second argument
-   * <i>o<sub>i+1</sub></i><i>, 1 &lt;= i &lt;= n</i>
+   * * The operator []= is invoked on <i>m</i> with first argument
+   *   <i>k<sub>i</sub></i> and second argument <i>e<sub>i</sub></i><i>, 1 &lt;=
+   *   i &lt;= n</i>
    *
-   * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of
-   * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</sub>, 1 &lt;= i &lt;=
-   * n+k</i> and let <i>S<sub>q</sub></i> be the type of the named parameter <i>q</i> of <i>f</i>.
-   * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<sub>j</sub>, 1 &lt;=
-   * j &lt;= m</i>.
+   * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static
+   * type of <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of
+   * <i>p<sub>i</sub>, 1 &lt;= i &lt;= n+k</i> and let <i>S<sub>q</sub></i> be
+   * the type of the named parameter <i>q</i> of <i>f</i>. It is a static
+   * warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<sub>j</sub>, 1
+   * &lt;= j &lt;= m</i>.
    */
-  static const CheckedModeCompileTimeErrorCode LIST_ELEMENT_TYPE_NOT_ASSIGNABLE = const CheckedModeCompileTimeErrorCode.con1('LIST_ELEMENT_TYPE_NOT_ASSIGNABLE', 3, "The element type '{0}' cannot be assigned to the list type '{1}'");
+  static const CheckedModeCompileTimeErrorCode MAP_KEY_TYPE_NOT_ASSIGNABLE
+      = const CheckedModeCompileTimeErrorCode(
+          'MAP_KEY_TYPE_NOT_ASSIGNABLE',
+          "The element type '{0}' cannot be assigned to the map key type '{1}'");
 
   /**
-   * 12.7 Map: A run-time map literal &lt;<i>K</i>, <i>V</i>&gt; [<i>k<sub>1</sub></i> :
-   * <i>e<sub>1</sub></i> ... <i>k<sub>n</sub></i> : <i>e<sub>n</sub></i>] is evaluated as follows:
-   * * The operator []= is invoked on <i>m</i> with first argument <i>k<sub>i</sub></i> and second
-   * argument <i>e<sub>i</sub></i><i>, 1 &lt;= i &lt;= n</i>
+   * 12.7 Map: A run-time map literal &lt;<i>K</i>, <i>V</i>&gt;
+   * [<i>k<sub>1</sub></i> : <i>e<sub>1</sub></i> ... <i>k<sub>n</sub></i> :
+   * <i>e<sub>n</sub></i>] is evaluated as follows:
+   * * The operator []= is invoked on <i>m</i> with first argument
+   *   <i>k<sub>i</sub></i> and second argument <i>e<sub>i</sub></i><i>, 1 &lt;=
+   *   i &lt;= n</i>
    *
-   * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of
-   * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</sub>, 1 &lt;= i &lt;=
-   * n+k</i> and let <i>S<sub>q</sub></i> be the type of the named parameter <i>q</i> of <i>f</i>.
-   * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<sub>j</sub>, 1 &lt;=
-   * j &lt;= m</i>.
+   * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static
+   * type of <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of
+   * <i>p<sub>i</sub>, 1 &lt;= i &lt;= n+k</i> and let <i>S<sub>q</sub></i> be
+   * the type of the named parameter <i>q</i> of <i>f</i>. It is a static
+   * warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<sub>j</sub>, 1
+   * &lt;= j &lt;= m</i>.
    */
-  static const CheckedModeCompileTimeErrorCode MAP_KEY_TYPE_NOT_ASSIGNABLE = const CheckedModeCompileTimeErrorCode.con1('MAP_KEY_TYPE_NOT_ASSIGNABLE', 4, "The element type '{0}' cannot be assigned to the map key type '{1}'");
+  static const CheckedModeCompileTimeErrorCode MAP_VALUE_TYPE_NOT_ASSIGNABLE
+      = const CheckedModeCompileTimeErrorCode(
+          'MAP_VALUE_TYPE_NOT_ASSIGNABLE',
+          "The element type '{0}' cannot be assigned to the map value type '{1}'");
 
   /**
-   * 12.7 Map: A run-time map literal &lt;<i>K</i>, <i>V</i>&gt; [<i>k<sub>1</sub></i> :
-   * <i>e<sub>1</sub></i> ... <i>k<sub>n</sub></i> : <i>e<sub>n</sub></i>] is evaluated as follows:
-   * * The operator []= is invoked on <i>m</i> with first argument <i>k<sub>i</sub></i> and second
-   * argument <i>e<sub>i</sub></i><i>, 1 &lt;= i &lt;= n</i>
-   *
-   * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of
-   * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</sub>, 1 &lt;= i &lt;=
-   * n+k</i> and let <i>S<sub>q</sub></i> be the type of the named parameter <i>q</i> of <i>f</i>.
-   * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<sub>j</sub>, 1 &lt;=
-   * j &lt;= m</i>.
+   * 12.11.2 Const: It is a compile-time error if evaluation of a constant
+   * object results in an uncaught exception being thrown.
    */
-  static const CheckedModeCompileTimeErrorCode MAP_VALUE_TYPE_NOT_ASSIGNABLE = const CheckedModeCompileTimeErrorCode.con1('MAP_VALUE_TYPE_NOT_ASSIGNABLE', 5, "The element type '{0}' cannot be assigned to the map value type '{1}'");
-
-  /**
-   * 12.11.2 Const: It is a compile-time error if evaluation of a constant object results in an
-   * uncaught exception being thrown.
-   */
-  static const CheckedModeCompileTimeErrorCode VARIABLE_TYPE_MISMATCH =
-      const CheckedModeCompileTimeErrorCode.con1(
+  static const CheckedModeCompileTimeErrorCode VARIABLE_TYPE_MISMATCH
+      = const CheckedModeCompileTimeErrorCode(
           'VARIABLE_TYPE_MISMATCH',
-          6,
           "The object type '{0}' cannot be assigned to a variable of type '{1}'");
 
-  static const List<CheckedModeCompileTimeErrorCode> values = const [
-      CONST_CONSTRUCTOR_FIELD_TYPE_MISMATCH,
-      CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH,
-      CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE,
-      LIST_ELEMENT_TYPE_NOT_ASSIGNABLE,
-      MAP_KEY_TYPE_NOT_ASSIGNABLE,
-      MAP_VALUE_TYPE_NOT_ASSIGNABLE,
-      VARIABLE_TYPE_MISMATCH];
-
   /**
-   * The template used to create the message to be displayed for this error.
+   * Initialize a newly created error code to have the given [name]. The message
+   * associated with the error will be created from the given [message]
+   * template. The correction associated with the error will be created from the
+   * given [correction] template.
    */
-  final String message;
-
-  /**
-   * The template used to create the correction to be displayed for this error, or `null` if
-   * there is no correction information for this error.
-   */
-  final String correction;
-
-  /**
-   * Initialize a newly created error code to have the given message.
-   *
-   * @param message the message template used to create the message to be displayed for the error
-   */
-  const CheckedModeCompileTimeErrorCode.con1(String name, int ordinal, String message) : this.con2(name, ordinal, message, null);
-
-  /**
-   * Initialize a newly created error code to have the given message and correction.
-   *
-   * @param message the template used to create the message to be displayed for the error
-   * @param correction the template used to create the correction to be displayed for the error
-   */
-  const CheckedModeCompileTimeErrorCode.con2(String name, int ordinal, this.message, this.correction) : super(name, ordinal);
+  const CheckedModeCompileTimeErrorCode(String name, String message, [String correction])
+      : super(name, message, correction);
 
   @override
   ErrorSeverity get errorSeverity => ErrorType.CHECKED_MODE_COMPILE_TIME_ERROR.severity;
 
   @override
   ErrorType get type => ErrorType.CHECKED_MODE_COMPILE_TIME_ERROR;
-
-  @override
-  String get uniqueName => "$runtimeType.$name";
 }
 
 /**
- * The enumeration `CompileTimeErrorCode` defines the error codes used for compile time
- * errors. The convention for this class is for the name of the error code to indicate the problem
- * that caused the error to be generated and for the error message to explain what is wrong and,
- * when appropriate, how the problem can be corrected.
+ * The enumeration `CompileTimeErrorCode` defines the error codes used for
+ * compile time errors. The convention for this class is for the name of the
+ * error code to indicate the problem that caused the error to be generated and
+ * for the error message to explain what is wrong and, when appropriate, how the
+ * problem can be corrected.
  */
-class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCode {
+class CompileTimeErrorCode extends ErrorCode {
   /**
-   * Enum proposal: It is also a compile-time error to explicitly instantiate an enum via 'new' or
-   * 'const' or to access its private fields.
+   * Enum proposal: It is also a compile-time error to explicitly instantiate an
+   * enum via 'new' or 'const' or to access its private fields.
    */
-  static const CompileTimeErrorCode ACCESS_PRIVATE_ENUM_FIELD = const CompileTimeErrorCode.con1('ACCESS_PRIVATE_ENUM_FIELD', 0, "The private fields of an enum cannot be accessed, even within the same library");
+  static const CompileTimeErrorCode ACCESS_PRIVATE_ENUM_FIELD = const CompileTimeErrorCode('ACCESS_PRIVATE_ENUM_FIELD', "The private fields of an enum cannot be accessed, even within the same library");
 
   /**
-   * 14.2 Exports: It is a compile-time error if a name <i>N</i> is re-exported by a library
-   * <i>L</i> and <i>N</i> is introduced into the export namespace of <i>L</i> by more than one
-   * export, unless each all exports refer to same declaration for the name N.
+   * 14.2 Exports: It is a compile-time error if a name <i>N</i> is re-exported
+   * by a library <i>L</i> and <i>N</i> is introduced into the export namespace
+   * of <i>L</i> by more than one export, unless each all exports refer to same
+   * declaration for the name N.
    *
    * @param ambiguousElementName the name of the ambiguous element
-   * @param firstLibraryName the name of the first library that the type is found
-   * @param secondLibraryName the name of the second library that the type is found
+   * @param firstLibraryName the name of the first library that the type is
+   *        found
+   * @param secondLibraryName the name of the second library that the type is
+   *        found
    */
-  static const CompileTimeErrorCode AMBIGUOUS_EXPORT = const CompileTimeErrorCode.con1('AMBIGUOUS_EXPORT', 1, "The name '{0}' is defined in the libraries '{1}' and '{2}'");
+  static const CompileTimeErrorCode AMBIGUOUS_EXPORT = const CompileTimeErrorCode('AMBIGUOUS_EXPORT', "The name '{0}' is defined in the libraries '{1}' and '{2}'");
 
   /**
-   * 12.33 Argument Definition Test: It is a compile time error if <i>v</i> does not denote a formal
-   * parameter.
+   * 12.33 Argument Definition Test: It is a compile time error if <i>v</i> does
+   * not denote a formal parameter.
    *
-   * @param the name of the identifier in the argument definition test that is not a parameter
+   * @param the name of the identifier in the argument definition test that is
+   *        not a parameter
    */
-  static const CompileTimeErrorCode ARGUMENT_DEFINITION_TEST_NON_PARAMETER = const CompileTimeErrorCode.con1('ARGUMENT_DEFINITION_TEST_NON_PARAMETER', 2, "'{0}' is not a parameter");
+  static const CompileTimeErrorCode ARGUMENT_DEFINITION_TEST_NON_PARAMETER = const CompileTimeErrorCode('ARGUMENT_DEFINITION_TEST_NON_PARAMETER', "'{0}' is not a parameter");
 
   /**
-   * ?? Asynchronous For-in: It is a compile-time error if an asynchronous for-in statement appears
-   * inside a synchronous function.
+   * ?? Asynchronous For-in: It is a compile-time error if an asynchronous
+   * for-in statement appears inside a synchronous function.
    */
-  static const CompileTimeErrorCode ASYNC_FOR_IN_WRONG_CONTEXT = const CompileTimeErrorCode.con1('ASYNC_FOR_IN_WRONG_CONTEXT', 3, "The asynchronous for-in can only be used in a function marked with async or async*");
+  static const CompileTimeErrorCode ASYNC_FOR_IN_WRONG_CONTEXT = const CompileTimeErrorCode('ASYNC_FOR_IN_WRONG_CONTEXT', "The asynchronous for-in can only be used in a function marked with async or async*");
 
   /**
-   * ??: It is a compile-time error if the function immediately enclosing a is not declared
-   * asynchronous.
+   * ??: It is a compile-time error if the function immediately enclosing a is
+   * not declared asynchronous.
    */
-  static const CompileTimeErrorCode AWAIT_IN_WRONG_CONTEXT = const CompileTimeErrorCode.con1('AWAIT_IN_WRONG_CONTEXT', 4, "The await expression can only be used in a function marked as async or async*");
+  static const CompileTimeErrorCode AWAIT_IN_WRONG_CONTEXT = const CompileTimeErrorCode('AWAIT_IN_WRONG_CONTEXT', "The await expression can only be used in a function marked as async or async*");
 
   /**
-   * 12.30 Identifier Reference: It is a compile-time error to use a built-in identifier other than
-   * dynamic as a type annotation.
+   * 12.30 Identifier Reference: It is a compile-time error to use a built-in
+   * identifier other than dynamic as a type annotation.
    */
-  static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPE = const CompileTimeErrorCode.con1('BUILT_IN_IDENTIFIER_AS_TYPE', 5, "The built-in identifier '{0}' cannot be as a type");
+  static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPE = const CompileTimeErrorCode('BUILT_IN_IDENTIFIER_AS_TYPE', "The built-in identifier '{0}' cannot be as a type");
 
   /**
-   * 12.30 Identifier Reference: It is a compile-time error if a built-in identifier is used as the
-   * declared name of a class, type parameter or type alias.
+   * 12.30 Identifier Reference: It is a compile-time error if a built-in
+   * identifier is used as the declared name of a class, type parameter or type
+   * alias.
    */
-  static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPE_NAME = const CompileTimeErrorCode.con1('BUILT_IN_IDENTIFIER_AS_TYPE_NAME', 6, "The built-in identifier '{0}' cannot be used as a type name");
+  static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPE_NAME = const CompileTimeErrorCode('BUILT_IN_IDENTIFIER_AS_TYPE_NAME', "The built-in identifier '{0}' cannot be used as a type name");
 
   /**
-   * 12.30 Identifier Reference: It is a compile-time error if a built-in identifier is used as the
-   * declared name of a class, type parameter or type alias.
+   * 12.30 Identifier Reference: It is a compile-time error if a built-in
+   * identifier is used as the declared name of a class, type parameter or type
+   * alias.
    */
-  static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME = const CompileTimeErrorCode.con1('BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME', 7, "The built-in identifier '{0}' cannot be used as a type alias name");
+  static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME = const CompileTimeErrorCode('BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME', "The built-in identifier '{0}' cannot be used as a type alias name");
 
   /**
-   * 12.30 Identifier Reference: It is a compile-time error if a built-in identifier is used as the
-   * declared name of a class, type parameter or type alias.
+   * 12.30 Identifier Reference: It is a compile-time error if a built-in
+   * identifier is used as the declared name of a class, type parameter or type
+   * alias.
    */
-  static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME = const CompileTimeErrorCode.con1('BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME', 8, "The built-in identifier '{0}' cannot be used as a type parameter name");
+  static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME = const CompileTimeErrorCode('BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME', "The built-in identifier '{0}' cannot be used as a type parameter name");
 
   /**
-   * 13.9 Switch: It is a compile-time error if the class <i>C</i> implements the operator
-   * <i>==</i>.
+   * 13.9 Switch: It is a compile-time error if the class <i>C</i> implements
+   * the operator <i>==</i>.
    */
-  static const CompileTimeErrorCode CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS = const CompileTimeErrorCode.con1('CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS', 9, "The switch case expression type '{0}' cannot override the == operator");
+  static const CompileTimeErrorCode CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS = const CompileTimeErrorCode('CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS', "The switch case expression type '{0}' cannot override the == operator");
 
   /**
-   * 12.1 Constants: It is a compile-time error if evaluation of a compile-time constant would raise
+   * 12.1 Constants: It is a compile-time error if evaluation of a compile-time
+   * constant would raise
    * an exception.
    */
-  static const CompileTimeErrorCode COMPILE_TIME_CONSTANT_RAISES_EXCEPTION = const CompileTimeErrorCode.con1('COMPILE_TIME_CONSTANT_RAISES_EXCEPTION', 10, "");
+  static const CompileTimeErrorCode COMPILE_TIME_CONSTANT_RAISES_EXCEPTION = const CompileTimeErrorCode('COMPILE_TIME_CONSTANT_RAISES_EXCEPTION', "");
 
   /**
-   * 7.2 Getters: It is a compile-time error if a class has both a getter and a method with the same
-   * name. This restriction holds regardless of whether the getter is defined explicitly or
-   * implicitly, or whether the getter or the method are inherited or not.
+   * 7.2 Getters: It is a compile-time error if a class has both a getter and a
+   * method with the same name. This restriction holds regardless of whether the
+   * getter is defined explicitly or implicitly, or whether the getter or the
+   * method are inherited or not.
    */
-  static const CompileTimeErrorCode CONFLICTING_GETTER_AND_METHOD = const CompileTimeErrorCode.con1('CONFLICTING_GETTER_AND_METHOD', 11, "Class '{0}' cannot have both getter '{1}.{2}' and method with the same name");
+  static const CompileTimeErrorCode CONFLICTING_GETTER_AND_METHOD = const CompileTimeErrorCode('CONFLICTING_GETTER_AND_METHOD', "Class '{0}' cannot have both getter '{1}.{2}' and method with the same name");
 
   /**
-   * 7.2 Getters: It is a compile-time error if a class has both a getter and a method with the same
-   * name. This restriction holds regardless of whether the getter is defined explicitly or
-   * implicitly, or whether the getter or the method are inherited or not.
+   * 7.2 Getters: It is a compile-time error if a class has both a getter and a
+   * method with the same name. This restriction holds regardless of whether the
+   * getter is defined explicitly or implicitly, or whether the getter or the
+   * method are inherited or not.
    */
-  static const CompileTimeErrorCode CONFLICTING_METHOD_AND_GETTER = const CompileTimeErrorCode.con1('CONFLICTING_METHOD_AND_GETTER', 12, "Class '{0}' cannot have both method '{1}.{2}' and getter with the same name");
+  static const CompileTimeErrorCode CONFLICTING_METHOD_AND_GETTER = const CompileTimeErrorCode('CONFLICTING_METHOD_AND_GETTER', "Class '{0}' cannot have both method '{1}.{2}' and getter with the same name");
 
   /**
-   * 7.6 Constructors: A constructor name always begins with the name of its immediately enclosing
-   * class, and may optionally be followed by a dot and an identifier <i>id</i>. It is a
-   * compile-time error if <i>id</i> is the name of a member declared in the immediately enclosing
-   * class.
+   * 7.6 Constructors: A constructor name always begins with the name of its
+   * immediately enclosing class, and may optionally be followed by a dot and an
+   * identifier <i>id</i>. It is a compile-time error if <i>id</i> is the name
+   * of a member declared in the immediately enclosing class.
    */
-  static const CompileTimeErrorCode CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD = const CompileTimeErrorCode.con1('CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD', 13, "'{0}' cannot be used to name a constructor and a field in this class");
+  static const CompileTimeErrorCode CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD = const CompileTimeErrorCode('CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD', "'{0}' cannot be used to name a constructor and a field in this class");
 
   /**
-   * 7.6 Constructors: A constructor name always begins with the name of its immediately enclosing
-   * class, and may optionally be followed by a dot and an identifier <i>id</i>. It is a
-   * compile-time error if <i>id</i> is the name of a member declared in the immediately enclosing
-   * class.
+   * 7.6 Constructors: A constructor name always begins with the name of its
+   * immediately enclosing class, and may optionally be followed by a dot and an
+   * identifier <i>id</i>. It is a compile-time error if <i>id</i> is the name
+   * of a member declared in the immediately enclosing class.
    */
-  static const CompileTimeErrorCode CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD = const CompileTimeErrorCode.con1('CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD', 14, "'{0}' cannot be used to name a constructor and a method in this class");
+  static const CompileTimeErrorCode CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD = const CompileTimeErrorCode('CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD', "'{0}' cannot be used to name a constructor and a method in this class");
 
   /**
-   * 7. Classes: It is a compile time error if a generic class declares a type variable with the
-   * same name as the class or any of its members or constructors.
+   * 7. Classes: It is a compile time error if a generic class declares a type
+   * variable with the same name as the class or any of its members or
+   * constructors.
    */
-  static const CompileTimeErrorCode CONFLICTING_TYPE_VARIABLE_AND_CLASS = const CompileTimeErrorCode.con1('CONFLICTING_TYPE_VARIABLE_AND_CLASS', 15, "'{0}' cannot be used to name a type varaible in a class with the same name");
+  static const CompileTimeErrorCode CONFLICTING_TYPE_VARIABLE_AND_CLASS = const CompileTimeErrorCode('CONFLICTING_TYPE_VARIABLE_AND_CLASS', "'{0}' cannot be used to name a type varaible in a class with the same name");
 
   /**
-   * 7. Classes: It is a compile time error if a generic class declares a type variable with the
-   * same name as the class or any of its members or constructors.
+   * 7. Classes: It is a compile time error if a generic class declares a type
+   * variable with the same name as the class or any of its members or
+   * constructors.
    */
-  static const CompileTimeErrorCode CONFLICTING_TYPE_VARIABLE_AND_MEMBER = const CompileTimeErrorCode.con1('CONFLICTING_TYPE_VARIABLE_AND_MEMBER', 16, "'{0}' cannot be used to name a type varaible and member in this class");
+  static const CompileTimeErrorCode CONFLICTING_TYPE_VARIABLE_AND_MEMBER = const CompileTimeErrorCode('CONFLICTING_TYPE_VARIABLE_AND_MEMBER', "'{0}' cannot be used to name a type varaible and member in this class");
 
   /**
-   * 12.11.2 Const: It is a compile-time error if evaluation of a constant object results in an
-   * uncaught exception being thrown.
+   * 12.11.2 Const: It is a compile-time error if evaluation of a constant
+   * object results in an uncaught exception being thrown.
    */
-  static const CompileTimeErrorCode CONST_CONSTRUCTOR_THROWS_EXCEPTION = const CompileTimeErrorCode.con1('CONST_CONSTRUCTOR_THROWS_EXCEPTION', 17, "'const' constructors cannot throw exceptions");
+  static const CompileTimeErrorCode CONST_CONSTRUCTOR_THROWS_EXCEPTION = const CompileTimeErrorCode('CONST_CONSTRUCTOR_THROWS_EXCEPTION', "'const' constructors cannot throw exceptions");
 
   /**
-   * 10.6.3 Constant Constructors: It is a compile-time error if a constant constructor is declared
-   * by a class C if any instance variable declared in C is initialized with an expression that is
-   * not a constant expression.
+   * 10.6.3 Constant Constructors: It is a compile-time error if a constant
+   * constructor is declared by a class C if any instance variable declared in C
+   * is initialized with an expression that is not a constant expression.
    */
-  static const CompileTimeErrorCode CONST_CONSTRUCTOR_WITH_FIELD_INITIALIZED_BY_NON_CONST = const CompileTimeErrorCode.con1('CONST_CONSTRUCTOR_WITH_FIELD_INITIALIZED_BY_NON_CONST', 18, "Can't define the 'const' constructor because the field '{0}' is initialized with a non-constant value");
+  static const CompileTimeErrorCode CONST_CONSTRUCTOR_WITH_FIELD_INITIALIZED_BY_NON_CONST = const CompileTimeErrorCode('CONST_CONSTRUCTOR_WITH_FIELD_INITIALIZED_BY_NON_CONST', "Can't define the 'const' constructor because the field '{0}' is initialized with a non-constant value");
 
   /**
-   * 7.6.3 Constant Constructors: The superinitializer that appears, explicitly or implicitly, in
-   * the initializer list of a constant constructor must specify a constant constructor of the
-   * superclass of the immediately enclosing class or a compile-time error occurs.
+   * 7.6.3 Constant Constructors: The superinitializer that appears, explicitly
+   * or implicitly, in the initializer list of a constant constructor must
+   * specify a constant constructor of the superclass of the immediately
+   * enclosing class or a compile-time error occurs.
    *
-   * 9 Mixins: For each generative constructor named ... an implicitly declared constructor named
-   * ... is declared.
+   * 9 Mixins: For each generative constructor named ... an implicitly declared
+   * constructor named ... is declared.
    */
-  static const CompileTimeErrorCode CONST_CONSTRUCTOR_WITH_MIXIN = const CompileTimeErrorCode.con1('CONST_CONSTRUCTOR_WITH_MIXIN', 19, "Constant constructor cannot be declared for a class with a mixin");
+  static const CompileTimeErrorCode CONST_CONSTRUCTOR_WITH_MIXIN = const CompileTimeErrorCode('CONST_CONSTRUCTOR_WITH_MIXIN', "Constant constructor cannot be declared for a class with a mixin");
 
   /**
-   * 7.6.3 Constant Constructors: The superinitializer that appears, explicitly or implicitly, in
-   * the initializer list of a constant constructor must specify a constant constructor of the
-   * superclass of the immediately enclosing class or a compile-time error occurs.
+   * 7.6.3 Constant Constructors: The superinitializer that appears, explicitly
+   * or implicitly, in the initializer list of a constant constructor must
+   * specify a constant constructor of the superclass of the immediately
+   * enclosing class or a compile-time error occurs.
    */
-  static const CompileTimeErrorCode CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER = const CompileTimeErrorCode.con1('CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER', 20, "Constant constructor cannot call non-constant super constructor of '{0}'");
+  static const CompileTimeErrorCode CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER = const CompileTimeErrorCode('CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER', "Constant constructor cannot call non-constant super constructor of '{0}'");
 
   /**
-   * 7.6.3 Constant Constructors: It is a compile-time error if a constant constructor is declared
-   * by a class that has a non-final instance variable.
+   * 7.6.3 Constant Constructors: It is a compile-time error if a constant
+   * constructor is declared by a class that has a non-final instance variable.
    *
    * The above refers to both locally declared and inherited instance variables.
    */
-  static const CompileTimeErrorCode CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD = const CompileTimeErrorCode.con1('CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD', 21, "Cannot define the 'const' constructor for a class with non-final fields");
+  static const CompileTimeErrorCode CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD = const CompileTimeErrorCode('CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD', "Cannot define the 'const' constructor for a class with non-final fields");
 
   /**
    * 12.12.2 Const: It is a compile-time error if <i>T</i> is a deferred type.
    */
-  static const CompileTimeErrorCode CONST_DEFERRED_CLASS = const CompileTimeErrorCode.con1('CONST_DEFERRED_CLASS', 22, "Deferred classes cannot be created with 'const'");
+  static const CompileTimeErrorCode CONST_DEFERRED_CLASS = const CompileTimeErrorCode('CONST_DEFERRED_CLASS', "Deferred classes cannot be created with 'const'");
 
   /**
-   * 6.2 Formal Parameters: It is a compile-time error if a formal parameter is declared as a
-   * constant variable.
+   * 6.2 Formal Parameters: It is a compile-time error if a formal parameter is
+   * declared as a constant variable.
    */
-  static const CompileTimeErrorCode CONST_FORMAL_PARAMETER = const CompileTimeErrorCode.con1('CONST_FORMAL_PARAMETER', 23, "Parameters cannot be 'const'");
+  static const CompileTimeErrorCode CONST_FORMAL_PARAMETER = const CompileTimeErrorCode('CONST_FORMAL_PARAMETER', "Parameters cannot be 'const'");
 
   /**
-   * 5 Variables: A constant variable must be initialized to a compile-time constant or a
-   * compile-time error occurs.
+   * 5 Variables: A constant variable must be initialized to a compile-time
+   * constant or a compile-time error occurs.
    */
-  static const CompileTimeErrorCode CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE = const CompileTimeErrorCode.con1('CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE', 24, "'const' variables must be constant value");
+  static const CompileTimeErrorCode CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE = const CompileTimeErrorCode('CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE', "'const' variables must be constant value");
 
   /**
-   * 5 Variables: A constant variable must be initialized to a compile-time constant or a
-   * compile-time error occurs.
+   * 5 Variables: A constant variable must be initialized to a compile-time
+   * constant or a compile-time error occurs.
    *
-   * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a
-   * deferred prefix.
+   * 12.1 Constants: A qualified reference to a static constant variable that is
+   * not qualified by a deferred prefix.
    */
-  static const CompileTimeErrorCode CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE_FROM_DEFERRED_LIBRARY = const CompileTimeErrorCode.con1('CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE_FROM_DEFERRED_LIBRARY', 25, "Constant values from a deferred library cannot be used to initialized a 'const' variable");
+  static const CompileTimeErrorCode CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE_FROM_DEFERRED_LIBRARY = const CompileTimeErrorCode('CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE_FROM_DEFERRED_LIBRARY', "Constant values from a deferred library cannot be used to initialized a 'const' variable");
 
   /**
-   * 7.5 Instance Variables: It is a compile-time error if an instance variable is declared to be
-   * constant.
+   * 7.5 Instance Variables: It is a compile-time error if an instance variable
+   * is declared to be constant.
    */
-  static const CompileTimeErrorCode CONST_INSTANCE_FIELD = const CompileTimeErrorCode.con1('CONST_INSTANCE_FIELD', 26, "Only static fields can be declared as 'const'");
+  static const CompileTimeErrorCode CONST_INSTANCE_FIELD = const CompileTimeErrorCode('CONST_INSTANCE_FIELD', "Only static fields can be declared as 'const'");
 
   /**
-   * 12.8 Maps: It is a compile-time error if the key of an entry in a constant map literal is an
-   * instance of a class that implements the operator <i>==</i> unless the key is a string or
-   * integer.
+   * 12.8 Maps: It is a compile-time error if the key of an entry in a constant
+   * map literal is an instance of a class that implements the operator
+   * <i>==</i> unless the key is a string or integer.
    */
-  static const CompileTimeErrorCode CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQUALS = const CompileTimeErrorCode.con1('CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQUALS', 27, "The constant map entry key expression type '{0}' cannot override the == operator");
+  static const CompileTimeErrorCode CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQUALS = const CompileTimeErrorCode('CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQUALS', "The constant map entry key expression type '{0}' cannot override the == operator");
 
   /**
-   * 5 Variables: A constant variable must be initialized to a compile-time constant (12.1) or a
-   * compile-time error occurs.
+   * 5 Variables: A constant variable must be initialized to a compile-time
+   * constant (12.1) or a compile-time error occurs.
    *
    * @param name the name of the uninitialized final variable
    */
-  static const CompileTimeErrorCode CONST_NOT_INITIALIZED = const CompileTimeErrorCode.con1('CONST_NOT_INITIALIZED', 28, "The const variable '{0}' must be initialized");
+  static const CompileTimeErrorCode CONST_NOT_INITIALIZED = const CompileTimeErrorCode('CONST_NOT_INITIALIZED', "The const variable '{0}' must be initialized");
 
   /**
-   * 12.11.2 Const: An expression of one of the forms !e, e1 && e2 or e1 || e2, where e, e1 and e2
-   * are constant expressions that evaluate to a boolean value.
+   * 12.11.2 Const: An expression of one of the forms !e, e1 && e2 or e1 || e2,
+   * where e, e1 and e2 are constant expressions that evaluate to a boolean
+   * value.
    */
-  static const CompileTimeErrorCode CONST_EVAL_TYPE_BOOL = const CompileTimeErrorCode.con1('CONST_EVAL_TYPE_BOOL', 29, "An expression of type 'bool' was expected");
+  static const CompileTimeErrorCode CONST_EVAL_TYPE_BOOL = const CompileTimeErrorCode('CONST_EVAL_TYPE_BOOL', "An expression of type 'bool' was expected");
 
   /**
-   * 12.11.2 Const: An expression of one of the forms e1 == e2 or e1 != e2 where e1 and e2 are
-   * constant expressions that evaluate to a numeric, string or boolean value or to null.
+   * 12.11.2 Const: An expression of one of the forms e1 == e2 or e1 != e2 where
+   * e1 and e2 are constant expressions that evaluate to a numeric, string or
+   * boolean value or to null.
    */
-  static const CompileTimeErrorCode CONST_EVAL_TYPE_BOOL_NUM_STRING = const CompileTimeErrorCode.con1('CONST_EVAL_TYPE_BOOL_NUM_STRING', 30, "An expression of type 'bool', 'num', 'String' or 'null' was expected");
+  static const CompileTimeErrorCode CONST_EVAL_TYPE_BOOL_NUM_STRING = const CompileTimeErrorCode('CONST_EVAL_TYPE_BOOL_NUM_STRING', "An expression of type 'bool', 'num', 'String' or 'null' was expected");
 
   /**
-   * 12.11.2 Const: An expression of one of the forms ~e, e1 ^ e2, e1 & e2, e1 | e2, e1 >> e2 or e1
-   * << e2, where e, e1 and e2 are constant expressions that evaluate to an integer value or to
-   * null.
+   * 12.11.2 Const: An expression of one of the forms ~e, e1 ^ e2, e1 & e2,
+   * e1 | e2, e1 >> e2 or e1 << e2, where e, e1 and e2 are constant expressions
+   * that evaluate to an integer value or to null.
    */
-  static const CompileTimeErrorCode CONST_EVAL_TYPE_INT = const CompileTimeErrorCode.con1('CONST_EVAL_TYPE_INT', 31, "An expression of type 'int' was expected");
+  static const CompileTimeErrorCode CONST_EVAL_TYPE_INT = const CompileTimeErrorCode('CONST_EVAL_TYPE_INT', "An expression of type 'int' was expected");
 
   /**
-   * 12.11.2 Const: An expression of one of the forms e, e1 + e2, e1 - e2, e1 * e2, e1 / e2, e1 ~/
-   * e2, e1 > e2, e1 < e2, e1 >= e2, e1 <= e2 or e1 % e2, where e, e1 and e2 are constant
-   * expressions that evaluate to a numeric value or to null..
+   * 12.11.2 Const: An expression of one of the forms e, e1 + e2, e1 - e2, e1 *
+   * e2, e1 / e2, e1 ~/ e2, e1 > e2, e1 < e2, e1 >= e2, e1 <= e2 or e1 % e2,
+   * where e, e1 and e2 are constant expressions that evaluate to a numeric
+   * value or to null.
    */
-  static const CompileTimeErrorCode CONST_EVAL_TYPE_NUM = const CompileTimeErrorCode.con1('CONST_EVAL_TYPE_NUM', 32, "An expression of type 'num' was expected");
+  static const CompileTimeErrorCode CONST_EVAL_TYPE_NUM = const CompileTimeErrorCode('CONST_EVAL_TYPE_NUM', "An expression of type 'num' was expected");
 
   /**
-   * 12.11.2 Const: It is a compile-time error if evaluation of a constant object results in an
-   * uncaught exception being thrown.
+   * 12.11.2 Const: It is a compile-time error if evaluation of a constant
+   * object results in an uncaught exception being thrown.
    */
-  static const CompileTimeErrorCode CONST_EVAL_THROWS_EXCEPTION = const CompileTimeErrorCode.con1('CONST_EVAL_THROWS_EXCEPTION', 33, "Evaluation of this constant expression causes exception");
+  static const CompileTimeErrorCode CONST_EVAL_THROWS_EXCEPTION = const CompileTimeErrorCode('CONST_EVAL_THROWS_EXCEPTION', "Evaluation of this constant expression causes exception");
 
   /**
-   * 12.11.2 Const: It is a compile-time error if evaluation of a constant object results in an
-   * uncaught exception being thrown.
+   * 12.11.2 Const: It is a compile-time error if evaluation of a constant
+   * object results in an uncaught exception being thrown.
    */
-  static const CompileTimeErrorCode CONST_EVAL_THROWS_IDBZE = const CompileTimeErrorCode.con1('CONST_EVAL_THROWS_IDBZE', 34, "Evaluation of this constant expression throws IntegerDivisionByZeroException");
+  static const CompileTimeErrorCode CONST_EVAL_THROWS_IDBZE = const CompileTimeErrorCode('CONST_EVAL_THROWS_IDBZE', "Evaluation of this constant expression throws IntegerDivisionByZeroException");
 
   /**
-   * 12.11.2 Const: If <i>T</i> is a parameterized type <i>S&lt;U<sub>1</sub>, &hellip;,
-   * U<sub>m</sub>&gt;</i>, let <i>R = S</i>; It is a compile time error if <i>S</i> is not a
-   * generic type with <i>m</i> type parameters.
+   * 12.11.2 Const: If <i>T</i> is a parameterized type <i>S&lt;U<sub>1</sub>,
+   * &hellip;, U<sub>m</sub>&gt;</i>, let <i>R = S</i>; It is a compile time
+   * error if <i>S</i> is not a generic type with <i>m</i> type parameters.
    *
    * @param typeName the name of the type being referenced (<i>S</i>)
    * @param parameterCount the number of type parameters that were declared
    * @param argumentCount the number of type arguments provided
-   * @see CompileTimeErrorCode#NEW_WITH_INVALID_TYPE_PARAMETERS
-   * @see StaticTypeWarningCode#WRONG_NUMBER_OF_TYPE_ARGUMENTS
+   * See [CompileTimeErrorCode.NEW_WITH_INVALID_TYPE_PARAMETERS], and
+   * [StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS].
    */
-  static const CompileTimeErrorCode CONST_WITH_INVALID_TYPE_PARAMETERS = const CompileTimeErrorCode.con1('CONST_WITH_INVALID_TYPE_PARAMETERS', 35, "The type '{0}' is declared with {1} type parameters, but {2} type arguments were given");
+  static const CompileTimeErrorCode CONST_WITH_INVALID_TYPE_PARAMETERS = const CompileTimeErrorCode('CONST_WITH_INVALID_TYPE_PARAMETERS', "The type '{0}' is declared with {1} type parameters, but {2} type arguments were given");
 
   /**
-   * 12.11.2 Const: If <i>e</i> is of the form <i>const T(a<sub>1</sub>, &hellip;, a<sub>n</sub>,
-   * x<sub>n+1</sub>: a<sub>n+1</sub>, &hellip;, x<sub>n+k</sub>: a<sub>n+k</sub>)</i> it is a
-   * compile-time error if the type <i>T</i> does not declare a constant constructor with the same
-   * name as the declaration of <i>T</i>.
+   * 12.11.2 Const: If <i>e</i> is of the form <i>const T(a<sub>1</sub>,
+   * &hellip;, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</sub>, &hellip;,
+   * x<sub>n+k</sub>: a<sub>n+k</sub>)</i> it is a compile-time error if the
+   * type <i>T</i> does not declare a constant constructor with the same name as
+   * the declaration of <i>T</i>.
    */
-  static const CompileTimeErrorCode CONST_WITH_NON_CONST = const CompileTimeErrorCode.con1('CONST_WITH_NON_CONST', 36, "The constructor being called is not a 'const' constructor");
+  static const CompileTimeErrorCode CONST_WITH_NON_CONST = const CompileTimeErrorCode('CONST_WITH_NON_CONST', "The constructor being called is not a 'const' constructor");
 
   /**
-   * 12.11.2 Const: In all of the above cases, it is a compile-time error if <i>a<sub>i</sub>, 1
-   * &lt;= i &lt;= n + k</i>, is not a compile-time constant expression.
+   * 12.11.2 Const: In all of the above cases, it is a compile-time error if
+   * <i>a<sub>i</sub>, 1 &lt;= i &lt;= n + k</i>, is not a compile-time constant
+   * expression.
    */
-  static const CompileTimeErrorCode CONST_WITH_NON_CONSTANT_ARGUMENT = const CompileTimeErrorCode.con1('CONST_WITH_NON_CONSTANT_ARGUMENT', 37, "Arguments of a constant creation must be constant expressions");
+  static const CompileTimeErrorCode CONST_WITH_NON_CONSTANT_ARGUMENT = const CompileTimeErrorCode('CONST_WITH_NON_CONSTANT_ARGUMENT', "Arguments of a constant creation must be constant expressions");
 
   /**
-   * 12.11.2 Const: It is a compile-time error if <i>T</i> is not a class accessible in the current
-   * scope, optionally followed by type arguments.
+   * 12.11.2 Const: It is a compile-time error if <i>T</i> is not a class
+   * accessible in the current scope, optionally followed by type arguments.
    *
-   * 12.11.2 Const: If <i>e</i> is of the form <i>const T.id(a<sub>1</sub>, &hellip;, a<sub>n</sub>,
-   * x<sub>n+1</sub>: a<sub>n+1</sub>, &hellip; x<sub>n+k</sub>: a<sub>n+k</sub>)</i> it is a
-   * compile-time error if <i>T</i> is not a class accessible in the current scope, optionally
+   * 12.11.2 Const: If <i>e</i> is of the form <i>const T.id(a<sub>1</sub>,
+   * &hellip;, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</sub>, &hellip;
+   * x<sub>n+k</sub>: a<sub>n+k</sub>)</i> it is a compile-time error if
+   * <i>T</i> is not a class accessible in the current scope, optionally
    * followed by type arguments.
    *
    * @param name the name of the non-type element
    */
-  static const CompileTimeErrorCode CONST_WITH_NON_TYPE = const CompileTimeErrorCode.con1('CONST_WITH_NON_TYPE', 38, "The name '{0}' is not a class");
+  static const CompileTimeErrorCode CONST_WITH_NON_TYPE = const CompileTimeErrorCode('CONST_WITH_NON_TYPE', "The name '{0}' is not a class");
 
   /**
-   * 12.11.2 Const: It is a compile-time error if <i>T</i> includes any type parameters.
+   * 12.11.2 Const: It is a compile-time error if <i>T</i> includes any type
+   * parameters.
    */
-  static const CompileTimeErrorCode CONST_WITH_TYPE_PARAMETERS = const CompileTimeErrorCode.con1('CONST_WITH_TYPE_PARAMETERS', 39, "The constant creation cannot use a type parameter");
+  static const CompileTimeErrorCode CONST_WITH_TYPE_PARAMETERS = const CompileTimeErrorCode('CONST_WITH_TYPE_PARAMETERS', "The constant creation cannot use a type parameter");
 
   /**
-   * 12.11.2 Const: It is a compile-time error if <i>T.id</i> is not the name of a constant
-   * constructor declared by the type <i>T</i>.
+   * 12.11.2 Const: It is a compile-time error if <i>T.id</i> is not the name of
+   * a constant constructor declared by the type <i>T</i>.
    *
    * @param typeName the name of the type
    * @param constructorName the name of the requested constant constructor
    */
-  static const CompileTimeErrorCode CONST_WITH_UNDEFINED_CONSTRUCTOR = const CompileTimeErrorCode.con1('CONST_WITH_UNDEFINED_CONSTRUCTOR', 40, "The class '{0}' does not have a constant constructor '{1}'");
+  static const CompileTimeErrorCode CONST_WITH_UNDEFINED_CONSTRUCTOR = const CompileTimeErrorCode('CONST_WITH_UNDEFINED_CONSTRUCTOR', "The class '{0}' does not have a constant constructor '{1}'");
 
   /**
-   * 12.11.2 Const: It is a compile-time error if <i>T.id</i> is not the name of a constant
-   * constructor declared by the type <i>T</i>.
+   * 12.11.2 Const: It is a compile-time error if <i>T.id</i> is not the name of
+   * a constant constructor declared by the type <i>T</i>.
    *
    * @param typeName the name of the type
    */
-  static const CompileTimeErrorCode CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT = const CompileTimeErrorCode.con1('CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT', 41, "The class '{0}' does not have a default constant constructor");
+  static const CompileTimeErrorCode CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT = const CompileTimeErrorCode('CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT', "The class '{0}' does not have a default constant constructor");
 
   /**
-   * 15.3.1 Typedef: It is a compile-time error if any default values are specified in the signature
-   * of a function type alias.
+   * 15.3.1 Typedef: It is a compile-time error if any default values are
+   * specified in the signature of a function type alias.
    */
-  static const CompileTimeErrorCode DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS = const CompileTimeErrorCode.con1('DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS', 42, "Default values aren't allowed in typedefs");
+  static const CompileTimeErrorCode DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS = const CompileTimeErrorCode('DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS', "Default values aren't allowed in typedefs");
 
   /**
-   * 6.2.1 Required Formals: By means of a function signature that names the parameter and describes
-   * its type as a function type. It is a compile-time error if any default values are specified in
-   * the signature of such a function type.
+   * 6.2.1 Required Formals: By means of a function signature that names the
+   * parameter and describes its type as a function type. It is a compile-time
+   * error if any default values are specified in the signature of such a
+   * function type.
    */
-  static const CompileTimeErrorCode DEFAULT_VALUE_IN_FUNCTION_TYPED_PARAMETER = const CompileTimeErrorCode.con1('DEFAULT_VALUE_IN_FUNCTION_TYPED_PARAMETER', 43, "Default values aren't allowed in function type parameters");
+  static const CompileTimeErrorCode DEFAULT_VALUE_IN_FUNCTION_TYPED_PARAMETER = const CompileTimeErrorCode('DEFAULT_VALUE_IN_FUNCTION_TYPED_PARAMETER', "Default values aren't allowed in function type parameters");
 
   /**
-   * 7.6.2 Factories: It is a compile-time error if <i>k</i> explicitly specifies a default value
-   * for an optional parameter.
+   * 7.6.2 Factories: It is a compile-time error if <i>k</i> explicitly
+   * specifies a default value for an optional parameter.
    */
-  static const CompileTimeErrorCode DEFAULT_VALUE_IN_REDIRECTING_FACTORY_CONSTRUCTOR = const CompileTimeErrorCode.con1('DEFAULT_VALUE_IN_REDIRECTING_FACTORY_CONSTRUCTOR', 44, "Default values aren't allowed in factory constructors that redirect to another constructor");
+  static const CompileTimeErrorCode DEFAULT_VALUE_IN_REDIRECTING_FACTORY_CONSTRUCTOR = const CompileTimeErrorCode('DEFAULT_VALUE_IN_REDIRECTING_FACTORY_CONSTRUCTOR', "Default values aren't allowed in factory constructors that redirect to another constructor");
 
   /**
-   * 3.1 Scoping: It is a compile-time error if there is more than one entity with the same name
-   * declared in the same scope.
+   * 3.1 Scoping: It is a compile-time error if there is more than one entity
+   * with the same name declared in the same scope.
    */
-  static const CompileTimeErrorCode DUPLICATE_CONSTRUCTOR_DEFAULT = const CompileTimeErrorCode.con1('DUPLICATE_CONSTRUCTOR_DEFAULT', 45, "The default constructor is already defined");
+  static const CompileTimeErrorCode DUPLICATE_CONSTRUCTOR_DEFAULT = const CompileTimeErrorCode('DUPLICATE_CONSTRUCTOR_DEFAULT', "The default constructor is already defined");
 
   /**
-   * 3.1 Scoping: It is a compile-time error if there is more than one entity with the same name
-   * declared in the same scope.
+   * 3.1 Scoping: It is a compile-time error if there is more than one entity
+   * with the same name declared in the same scope.
    *
    * @param duplicateName the name of the duplicate entity
    */
-  static const CompileTimeErrorCode DUPLICATE_CONSTRUCTOR_NAME = const CompileTimeErrorCode.con1('DUPLICATE_CONSTRUCTOR_NAME', 46, "The constructor with name '{0}' is already defined");
+  static const CompileTimeErrorCode DUPLICATE_CONSTRUCTOR_NAME = const CompileTimeErrorCode('DUPLICATE_CONSTRUCTOR_NAME', "The constructor with name '{0}' is already defined");
 
   /**
-   * 3.1 Scoping: It is a compile-time error if there is more than one entity with the same name
-   * declared in the same scope.
+   * 3.1 Scoping: It is a compile-time error if there is more than one entity
+   * with the same name declared in the same scope.
    *
-   * 7 Classes: It is a compile-time error if a class declares two members of the same name.
+   * 7 Classes: It is a compile-time error if a class declares two members of
+   * the same name.
    *
-   * 7 Classes: It is a compile-time error if a class has an instance member and a static member
-   * with the same name.
+   * 7 Classes: It is a compile-time error if a class has an instance member and
+   * a static member with the same name.
    *
    * @param duplicateName the name of the duplicate entity
    */
-  static const CompileTimeErrorCode DUPLICATE_DEFINITION = const CompileTimeErrorCode.con1('DUPLICATE_DEFINITION', 47, "The name '{0}' is already defined");
+  static const CompileTimeErrorCode DUPLICATE_DEFINITION = const CompileTimeErrorCode('DUPLICATE_DEFINITION', "The name '{0}' is already defined");
 
   /**
-   * 7. Classes: It is a compile-time error if a class has an instance member and a static member
-   * with the same name.
+   * 7. Classes: It is a compile-time error if a class has an instance member
+   * and a static member with the same name.
    *
-   * This covers the additional duplicate definition cases where inheritance has to be considered.
+   * This covers the additional duplicate definition cases where inheritance has
+   * to be considered.
    *
-   * @param className the name of the class that has conflicting instance/static members
+   * @param className the name of the class that has conflicting instance/static
+   *        members
    * @param name the name of the conflicting members
-   * @see #DUPLICATE_DEFINITION
+   * See [DUPLICATE_DEFINITION].
    */
-  static const CompileTimeErrorCode DUPLICATE_DEFINITION_INHERITANCE = const CompileTimeErrorCode.con1('DUPLICATE_DEFINITION_INHERITANCE', 48, "The name '{0}' is already defined in '{1}'");
+  static const CompileTimeErrorCode DUPLICATE_DEFINITION_INHERITANCE = const CompileTimeErrorCode('DUPLICATE_DEFINITION_INHERITANCE', "The name '{0}' is already defined in '{1}'");
 
   /**
-   * 12.14.2 Binding Actuals to Formals: It is a compile-time error if <i>q<sub>i</sub> =
-   * q<sub>j</sub></i> for any <i>i != j</i> [where <i>q<sub>i</sub></i> is the label for a named
-   * argument].
+   * 12.14.2 Binding Actuals to Formals: It is a compile-time error if
+   * <i>q<sub>i</sub> = q<sub>j</sub></i> for any <i>i != j</i> [where
+   * <i>q<sub>i</sub></i> is the label for a named argument].
    */
-  static const CompileTimeErrorCode DUPLICATE_NAMED_ARGUMENT = const CompileTimeErrorCode.con1('DUPLICATE_NAMED_ARGUMENT', 49, "The argument for the named parameter '{0}' was already specified");
+  static const CompileTimeErrorCode DUPLICATE_NAMED_ARGUMENT = const CompileTimeErrorCode('DUPLICATE_NAMED_ARGUMENT', "The argument for the named parameter '{0}' was already specified");
 
   /**
    * SDK implementation libraries can be exported only by other SDK libraries.
    *
    * @param uri the uri pointing to a library
    */
-  static const CompileTimeErrorCode EXPORT_INTERNAL_LIBRARY = const CompileTimeErrorCode.con1('EXPORT_INTERNAL_LIBRARY', 50, "The library '{0}' is internal and cannot be exported");
+  static const CompileTimeErrorCode EXPORT_INTERNAL_LIBRARY = const CompileTimeErrorCode('EXPORT_INTERNAL_LIBRARY', "The library '{0}' is internal and cannot be exported");
 
   /**
-   * 14.2 Exports: It is a compile-time error if the compilation unit found at the specified URI is
-   * not a library declaration.
+   * 14.2 Exports: It is a compile-time error if the compilation unit found at
+   * the specified URI is not a library declaration.
    *
    * @param uri the uri pointing to a non-library declaration
    */
-  static const CompileTimeErrorCode EXPORT_OF_NON_LIBRARY = const CompileTimeErrorCode.con1('EXPORT_OF_NON_LIBRARY', 51, "The exported library '{0}' must not have a part-of directive");
+  static const CompileTimeErrorCode EXPORT_OF_NON_LIBRARY = const CompileTimeErrorCode('EXPORT_OF_NON_LIBRARY', "The exported library '{0}' must not have a part-of directive");
 
   /**
-   * Enum proposal: It is a compile-time error to subclass, mix-in or implement an enum.
+   * Enum proposal: It is a compile-time error to subclass, mix-in or implement
+   * an enum.
    */
-  static const CompileTimeErrorCode EXTENDS_ENUM = const CompileTimeErrorCode.con1('EXTENDS_ENUM', 52, "Classes cannot extend an enum");
+  static const CompileTimeErrorCode EXTENDS_ENUM = const CompileTimeErrorCode('EXTENDS_ENUM', "Classes cannot extend an enum");
 
   /**
-   * 7.9 Superclasses: It is a compile-time error if the extends clause of a class <i>C</i> includes
-   * a type expression that does not denote a class available in the lexical scope of <i>C</i>.
+   * 7.9 Superclasses: It is a compile-time error if the extends clause of a
+   * class <i>C</i> includes a type expression that does not denote a class
+   * available in the lexical scope of <i>C</i>.
    *
    * @param typeName the name of the superclass that was not found
    */
-  static const CompileTimeErrorCode EXTENDS_NON_CLASS = const CompileTimeErrorCode.con1('EXTENDS_NON_CLASS', 53, "Classes can only extend other classes");
+  static const CompileTimeErrorCode EXTENDS_NON_CLASS = const CompileTimeErrorCode('EXTENDS_NON_CLASS', "Classes can only extend other classes");
 
   /**
-   * 12.2 Null: It is a compile-time error for a class to attempt to extend or implement Null.
+   * 12.2 Null: It is a compile-time error for a class to attempt to extend or
+   * implement Null.
    *
-   * 12.3 Numbers: It is a compile-time error for a class to attempt to extend or implement int.
+   * 12.3 Numbers: It is a compile-time error for a class to attempt to extend
+   * or implement int.
    *
-   * 12.3 Numbers: It is a compile-time error for a class to attempt to extend or implement double.
+   * 12.3 Numbers: It is a compile-time error for a class to attempt to extend
+   * or implement double.
    *
-   * 12.3 Numbers: It is a compile-time error for any type other than the types int and double to
+   * 12.3 Numbers: It is a compile-time error for any type other than the types
+   * int and double to
    * attempt to extend or implement num.
    *
-   * 12.4 Booleans: It is a compile-time error for a class to attempt to extend or implement bool.
+   * 12.4 Booleans: It is a compile-time error for a class to attempt to extend
+   * or implement bool.
    *
-   * 12.5 Strings: It is a compile-time error for a class to attempt to extend or implement String.
+   * 12.5 Strings: It is a compile-time error for a class to attempt to extend
+   * or implement String.
    *
    * @param typeName the name of the type that cannot be extended
-   * @see #IMPLEMENTS_DISALLOWED_CLASS
+   * See [IMPLEMENTS_DISALLOWED_CLASS].
    */
-  static const CompileTimeErrorCode EXTENDS_DISALLOWED_CLASS = const CompileTimeErrorCode.con1('EXTENDS_DISALLOWED_CLASS', 54, "Classes cannot extend '{0}'");
+  static const CompileTimeErrorCode EXTENDS_DISALLOWED_CLASS = const CompileTimeErrorCode('EXTENDS_DISALLOWED_CLASS', "Classes cannot extend '{0}'");
 
   /**
-   * 7.9 Superclasses: It is a compile-time error if the extends clause of a class <i>C</i> includes
-   * a deferred type expression.
+   * 7.9 Superclasses: It is a compile-time error if the extends clause of a
+   * class <i>C</i> includes a deferred type expression.
    *
    * @param typeName the name of the type that cannot be extended
-   * @see #IMPLEMENTS_DEFERRED_CLASS
-   * @see #MIXIN_DEFERRED_CLASS
+   * See [IMPLEMENTS_DEFERRED_CLASS], and [MIXIN_DEFERRED_CLASS].
    */
-  static const CompileTimeErrorCode EXTENDS_DEFERRED_CLASS = const CompileTimeErrorCode.con1('EXTENDS_DEFERRED_CLASS', 55, "This class cannot extend the deferred class '{0}'");
+  static const CompileTimeErrorCode EXTENDS_DEFERRED_CLASS = const CompileTimeErrorCode('EXTENDS_DEFERRED_CLASS', "This class cannot extend the deferred class '{0}'");
 
   /**
-   * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m &lt; h</i> or if <i>m &gt;
-   * n</i>.
+   * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m &lt;
+   * h</i> or if <i>m &gt; n</i>.
    *
-   * 12.11.2 Const: It is a compile-time error if evaluation of a constant object results in an
-   * uncaught exception being thrown.
+   * 12.11.2 Const: It is a compile-time error if evaluation of a constant
+   * object results in an uncaught exception being thrown.
    *
    * @param requiredCount the maximum number of positional arguments
    * @param argumentCount the actual number of positional arguments given
    */
-  static const CompileTimeErrorCode EXTRA_POSITIONAL_ARGUMENTS = const CompileTimeErrorCode.con1('EXTRA_POSITIONAL_ARGUMENTS', 56, "{0} positional arguments expected, but {1} found");
+  static const CompileTimeErrorCode EXTRA_POSITIONAL_ARGUMENTS = const CompileTimeErrorCode('EXTRA_POSITIONAL_ARGUMENTS', "{0} positional arguments expected, but {1} found");
 
   /**
-   * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It is a compile time
-   * error if more than one initializer corresponding to a given instance variable appears in
-   * <i>k</i>'s list.
+   * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It
+   * is a compile time error if more than one initializer corresponding to a
+   * given instance variable appears in <i>k</i>'s list.
    */
-  static const CompileTimeErrorCode FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS = const CompileTimeErrorCode.con1('FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS', 57, "The field '{0}' cannot be initialized twice in the same constructor");
+  static const CompileTimeErrorCode FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS = const CompileTimeErrorCode('FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS', "The field '{0}' cannot be initialized twice in the same constructor");
 
   /**
-   * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It is a compile time
-   * error if <i>k</i>'s initializer list contains an initializer for a variable that is initialized
-   * by means of an initializing formal of <i>k</i>.
+   * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It
+   * is a compile time error if <i>k</i>'s initializer list contains an
+   * initializer for a variable that is initialized by means of an initializing
+   * formal of <i>k</i>.
    */
-  static const CompileTimeErrorCode FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER = const CompileTimeErrorCode.con1('FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER', 58, "Fields cannot be initialized in both the parameter list and the initializers");
+  static const CompileTimeErrorCode FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER = const CompileTimeErrorCode('FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER', "Fields cannot be initialized in both the parameter list and the initializers");
 
   /**
-   * 5 Variables: It is a compile-time error if a final instance variable that has is initialized by
-   * means of an initializing formal of a constructor is also initialized elsewhere in the same
-   * constructor.
+   * 5 Variables: It is a compile-time error if a final instance variable that
+   * has is initialized by means of an initializing formal of a constructor is
+   * also initialized elsewhere in the same constructor.
    *
    * @param name the name of the field in question
    */
-  static const CompileTimeErrorCode FINAL_INITIALIZED_MULTIPLE_TIMES = const CompileTimeErrorCode.con1('FINAL_INITIALIZED_MULTIPLE_TIMES', 59, "'{0}' is a final field and so can only be set once");
+  static const CompileTimeErrorCode FINAL_INITIALIZED_MULTIPLE_TIMES = const CompileTimeErrorCode('FINAL_INITIALIZED_MULTIPLE_TIMES', "'{0}' is a final field and so can only be set once");
 
   /**
-   * 7.6.1 Generative Constructors: It is a compile-time error if an initializing formal is used by
-   * a function other than a non-redirecting generative constructor.
+   * 7.6.1 Generative Constructors: It is a compile-time error if an
+   * initializing formal is used by a function other than a non-redirecting
+   * generative constructor.
    */
-  static const CompileTimeErrorCode FIELD_INITIALIZER_FACTORY_CONSTRUCTOR = const CompileTimeErrorCode.con1('FIELD_INITIALIZER_FACTORY_CONSTRUCTOR', 60, "Initializing formal fields cannot be used in factory constructors");
+  static const CompileTimeErrorCode FIELD_INITIALIZER_FACTORY_CONSTRUCTOR = const CompileTimeErrorCode('FIELD_INITIALIZER_FACTORY_CONSTRUCTOR', "Initializing formal fields cannot be used in factory constructors");
 
   /**
-   * 7.6.1 Generative Constructors: It is a compile-time error if an initializing formal is used by
-   * a function other than a non-redirecting generative constructor.
+   * 7.6.1 Generative Constructors: It is a compile-time error if an
+   * initializing formal is used by a function other than a non-redirecting
+   * generative constructor.
    */
-  static const CompileTimeErrorCode FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR = const CompileTimeErrorCode.con1('FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR', 61, "Initializing formal fields can only be used in constructors");
+  static const CompileTimeErrorCode FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR = const CompileTimeErrorCode('FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR', "Initializing formal fields can only be used in constructors");
 
   /**
-   * 7.6.1 Generative Constructors: A generative constructor may be redirecting, in which case its
-   * only action is to invoke another generative constructor.
+   * 7.6.1 Generative Constructors: A generative constructor may be redirecting,
+   * in which case its only action is to invoke another generative constructor.
    *
-   * 7.6.1 Generative Constructors: It is a compile-time error if an initializing formal is used by
-   * a function other than a non-redirecting generative constructor.
+   * 7.6.1 Generative Constructors: It is a compile-time error if an
+   * initializing formal is used by a function other than a non-redirecting
+   * generative constructor.
    */
-  static const CompileTimeErrorCode FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR = const CompileTimeErrorCode.con1('FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR', 62, "The redirecting constructor cannot have a field initializer");
+  static const CompileTimeErrorCode FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR = const CompileTimeErrorCode('FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR', "The redirecting constructor cannot have a field initializer");
 
   /**
-   * 7.2 Getters: It is a compile-time error if a class has both a getter and a method with the same
-   * name.
+   * 7.2 Getters: It is a compile-time error if a class has both a getter and a
+   * method with the same name.
    *
    * @param name the conflicting name of the getter and method
    */
-  static const CompileTimeErrorCode GETTER_AND_METHOD_WITH_SAME_NAME = const CompileTimeErrorCode.con1('GETTER_AND_METHOD_WITH_SAME_NAME', 63, "'{0}' cannot be used to name a getter, there is already a method with the same name");
+  static const CompileTimeErrorCode GETTER_AND_METHOD_WITH_SAME_NAME = const CompileTimeErrorCode('GETTER_AND_METHOD_WITH_SAME_NAME', "'{0}' cannot be used to name a getter, there is already a method with the same name");
 
   /**
-   * 7.10 Superinterfaces: It is a compile-time error if the implements clause of a class <i>C</i>
-   * specifies a malformed type or deferred type as a superinterface.
+   * 7.10 Superinterfaces: It is a compile-time error if the implements clause
+   * of a class <i>C</i> specifies a malformed type or deferred type as a
+   * superinterface.
    *
    * @param typeName the name of the type that cannot be extended
-   * @see #EXTENDS_DEFERRED_CLASS
-   * @see #MIXIN_DEFERRED_CLASS
+   * See [EXTENDS_DEFERRED_CLASS], and [MIXIN_DEFERRED_CLASS].
    */
-  static const CompileTimeErrorCode IMPLEMENTS_DEFERRED_CLASS = const CompileTimeErrorCode.con1('IMPLEMENTS_DEFERRED_CLASS', 64, "This class cannot implement the deferred class '{0}'");
+  static const CompileTimeErrorCode IMPLEMENTS_DEFERRED_CLASS = const CompileTimeErrorCode('IMPLEMENTS_DEFERRED_CLASS', "This class cannot implement the deferred class '{0}'");
 
   /**
-   * 12.2 Null: It is a compile-time error for a class to attempt to extend or implement Null.
+   * 12.2 Null: It is a compile-time error for a class to attempt to extend or
+   * implement Null.
    *
-   * 12.3 Numbers: It is a compile-time error for a class to attempt to extend or implement int.
+   * 12.3 Numbers: It is a compile-time error for a class to attempt to extend
+   * or implement int.
    *
-   * 12.3 Numbers: It is a compile-time error for a class to attempt to extend or implement double.
+   * 12.3 Numbers: It is a compile-time error for a class to attempt to extend
+   * or implement double.
    *
-   * 12.3 Numbers: It is a compile-time error for any type other than the types int and double to
+   * 12.3 Numbers: It is a compile-time error for any type other than the types
+   * int and double to
    * attempt to extend or implement num.
    *
-   * 12.4 Booleans: It is a compile-time error for a class to attempt to extend or implement bool.
+   * 12.4 Booleans: It is a compile-time error for a class to attempt to extend
+   * or implement bool.
    *
-   * 12.5 Strings: It is a compile-time error for a class to attempt to extend or implement String.
+   * 12.5 Strings: It is a compile-time error for a class to attempt to extend
+   * or implement String.
    *
    * @param typeName the name of the type that cannot be implemented
-   * @see #EXTENDS_DISALLOWED_CLASS
+   * See [EXTENDS_DISALLOWED_CLASS].
    */
-  static const CompileTimeErrorCode IMPLEMENTS_DISALLOWED_CLASS = const CompileTimeErrorCode.con1('IMPLEMENTS_DISALLOWED_CLASS', 65, "Classes cannot implement '{0}'");
+  static const CompileTimeErrorCode IMPLEMENTS_DISALLOWED_CLASS = const CompileTimeErrorCode('IMPLEMENTS_DISALLOWED_CLASS', "Classes cannot implement '{0}'");
 
   /**
-   * 7.10 Superinterfaces: It is a compile-time error if the implements clause of a class includes
-   * type dynamic.
+   * 7.10 Superinterfaces: It is a compile-time error if the implements clause
+   * of a class includes type dynamic.
    */
-  static const CompileTimeErrorCode IMPLEMENTS_DYNAMIC = const CompileTimeErrorCode.con1('IMPLEMENTS_DYNAMIC', 66, "Classes cannot implement 'dynamic'");
+  static const CompileTimeErrorCode IMPLEMENTS_DYNAMIC = const CompileTimeErrorCode('IMPLEMENTS_DYNAMIC', "Classes cannot implement 'dynamic'");
 
   /**
-   * Enum proposal: It is a compile-time error to subclass, mix-in or implement an enum.
+   * Enum proposal: It is a compile-time error to subclass, mix-in or implement
+   * an enum.
    */
-  static const CompileTimeErrorCode IMPLEMENTS_ENUM = const CompileTimeErrorCode.con1('IMPLEMENTS_ENUM', 67, "Classes cannot implement an enum");
+  static const CompileTimeErrorCode IMPLEMENTS_ENUM = const CompileTimeErrorCode('IMPLEMENTS_ENUM', "Classes cannot implement an enum");
 
   /**
-   * 7.10 Superinterfaces: It is a compile-time error if the implements clause of a class <i>C</i>
-   * includes a type expression that does not denote a class available in the lexical scope of
-   * <i>C</i>.
+   * 7.10 Superinterfaces: It is a compile-time error if the implements clause
+   * of a class <i>C</i> includes a type expression that does not denote a class
+   * available in the lexical scope of <i>C</i>.
    *
    * @param typeName the name of the interface that was not found
    */
-  static const CompileTimeErrorCode IMPLEMENTS_NON_CLASS = const CompileTimeErrorCode.con1('IMPLEMENTS_NON_CLASS', 68, "Classes can only implement other classes");
+  static const CompileTimeErrorCode IMPLEMENTS_NON_CLASS = const CompileTimeErrorCode('IMPLEMENTS_NON_CLASS', "Classes can only implement other classes");
 
   /**
-   * 7.10 Superinterfaces: It is a compile-time error if a type <i>T</i> appears more than once in
-   * the implements clause of a class.
+   * 7.10 Superinterfaces: It is a compile-time error if a type <i>T</i> appears
+   * more than once in the implements clause of a class.
    *
    * @param className the name of the class that is implemented more than once
    */
-  static const CompileTimeErrorCode IMPLEMENTS_REPEATED = const CompileTimeErrorCode.con1('IMPLEMENTS_REPEATED', 69, "'{0}' can only be implemented once");
+  static const CompileTimeErrorCode IMPLEMENTS_REPEATED = const CompileTimeErrorCode('IMPLEMENTS_REPEATED', "'{0}' can only be implemented once");
 
   /**
-   * 7.10 Superinterfaces: It is a compile-time error if the superclass of a class <i>C</i> appears
-   * in the implements clause of <i>C</i>.
+   * 7.10 Superinterfaces: It is a compile-time error if the superclass of a
+   * class <i>C</i> appears in the implements clause of <i>C</i>.
    *
-   * @param className the name of the class that appears in both "extends" and "implements" clauses
+   * @param className the name of the class that appears in both "extends" and
+   *        "implements" clauses
    */
-  static const CompileTimeErrorCode IMPLEMENTS_SUPER_CLASS = const CompileTimeErrorCode.con1('IMPLEMENTS_SUPER_CLASS', 70, "'{0}' cannot be used in both 'extends' and 'implements' clauses");
+  static const CompileTimeErrorCode IMPLEMENTS_SUPER_CLASS = const CompileTimeErrorCode('IMPLEMENTS_SUPER_CLASS', "'{0}' cannot be used in both 'extends' and 'implements' clauses");
 
   /**
-   * 7.6.1 Generative Constructors: Note that <b>this</b> is not in scope on the right hand side of
-   * an initializer.
+   * 7.6.1 Generative Constructors: Note that <b>this</b> is not in scope on the
+   * right hand side of an initializer.
    *
-   * 12.10 This: It is a compile-time error if this appears in a top-level function or variable
-   * initializer, in a factory constructor, or in a static method or variable initializer, or in the
-   * initializer of an instance variable.
+   * 12.10 This: It is a compile-time error if this appears in a top-level
+   * function or variable initializer, in a factory constructor, or in a static
+   * method or variable initializer, or in the initializer of an instance
+   * variable.
    *
    * @param name the name of the type in question
    */
-  static const CompileTimeErrorCode IMPLICIT_THIS_REFERENCE_IN_INITIALIZER = const CompileTimeErrorCode.con1('IMPLICIT_THIS_REFERENCE_IN_INITIALIZER', 71, "Only static members can be accessed in initializers");
+  static const CompileTimeErrorCode IMPLICIT_THIS_REFERENCE_IN_INITIALIZER = const CompileTimeErrorCode('IMPLICIT_THIS_REFERENCE_IN_INITIALIZER', "Only static members can be accessed in initializers");
 
   /**
    * SDK implementation libraries can be imported only by other SDK libraries.
    *
    * @param uri the uri pointing to a library
    */
-  static const CompileTimeErrorCode IMPORT_INTERNAL_LIBRARY = const CompileTimeErrorCode.con1('IMPORT_INTERNAL_LIBRARY', 72, "The library '{0}' is internal and cannot be imported");
+  static const CompileTimeErrorCode IMPORT_INTERNAL_LIBRARY = const CompileTimeErrorCode('IMPORT_INTERNAL_LIBRARY', "The library '{0}' is internal and cannot be imported");
 
   /**
-   * 14.1 Imports: It is a compile-time error if the specified URI of an immediate import does not
-   * refer to a library declaration.
+   * 14.1 Imports: It is a compile-time error if the specified URI of an
+   * immediate import does not refer to a library declaration.
    *
    * @param uri the uri pointing to a non-library declaration
-   * @see StaticWarningCode#IMPORT_OF_NON_LIBRARY
+   * See [StaticWarningCode.IMPORT_OF_NON_LIBRARY].
    */
-  static const CompileTimeErrorCode IMPORT_OF_NON_LIBRARY = const CompileTimeErrorCode.con1('IMPORT_OF_NON_LIBRARY', 73, "The imported library '{0}' must not have a part-of directive");
+  static const CompileTimeErrorCode IMPORT_OF_NON_LIBRARY = const CompileTimeErrorCode('IMPORT_OF_NON_LIBRARY', "The imported library '{0}' must not have a part-of directive");
 
   /**
-   * 13.9 Switch: It is a compile-time error if values of the expressions <i>e<sub>k</sub></i> are
-   * not instances of the same class <i>C</i>, for all <i>1 &lt;= k &lt;= n</i>.
+   * 13.9 Switch: It is a compile-time error if values of the expressions
+   * <i>e<sub>k</sub></i> are not instances of the same class <i>C</i>, for all
+   * <i>1 &lt;= k &lt;= n</i>.
    *
-   * @param expressionSource the expression source code that is the unexpected type
+   * @param expressionSource the expression source code that is the unexpected
+   *        type
    * @param expectedType the name of the expected type
    */
-  static const CompileTimeErrorCode INCONSISTENT_CASE_EXPRESSION_TYPES = const CompileTimeErrorCode.con1('INCONSISTENT_CASE_EXPRESSION_TYPES', 74, "Case expressions must have the same types, '{0}' is not a '{1}'");
+  static const CompileTimeErrorCode INCONSISTENT_CASE_EXPRESSION_TYPES = const CompileTimeErrorCode('INCONSISTENT_CASE_EXPRESSION_TYPES', "Case expressions must have the same types, '{0}' is not a '{1}'");
 
   /**
-   * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It is a compile-time
-   * error if <i>k</i>'s initializer list contains an initializer for a variable that is not an
-   * instance variable declared in the immediately surrounding class.
+   * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It
+   * is a compile-time error if <i>k</i>'s initializer list contains an
+   * initializer for a variable that is not an instance variable declared in the
+   * immediately surrounding class.
    *
-   * @param id the name of the initializing formal that is not an instance variable in the
-   *          immediately enclosing class
-   * @see #INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD
+   * @param id the name of the initializing formal that is not an instance
+   *        variable in the immediately enclosing class
+   * See [INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD].
    */
-  static const CompileTimeErrorCode INITIALIZER_FOR_NON_EXISTENT_FIELD = const CompileTimeErrorCode.con1('INITIALIZER_FOR_NON_EXISTENT_FIELD', 75, "'{0}' is not a variable in the enclosing class");
+  static const CompileTimeErrorCode INITIALIZER_FOR_NON_EXISTENT_FIELD = const CompileTimeErrorCode('INITIALIZER_FOR_NON_EXISTENT_FIELD', "'{0}' is not a variable in the enclosing class");
 
   /**
-   * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It is a compile-time
-   * error if <i>k</i>'s initializer list contains an initializer for a variable that is not an
-   * instance variable declared in the immediately surrounding class.
+   * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It
+   * is a compile-time error if <i>k</i>'s initializer list contains an
+   * initializer for a variable that is not an instance variable declared in the
+   * immediately surrounding class.
    *
-   * @param id the name of the initializing formal that is a static variable in the immediately
-   *          enclosing class
-   * @see #INITIALIZING_FORMAL_FOR_STATIC_FIELD
+   * @param id the name of the initializing formal that is a static variable in
+   *        the immediately enclosing class
+   * See [INITIALIZING_FORMAL_FOR_STATIC_FIELD].
    */
-  static const CompileTimeErrorCode INITIALIZER_FOR_STATIC_FIELD = const CompileTimeErrorCode.con1('INITIALIZER_FOR_STATIC_FIELD', 76, "'{0}' is a static variable in the enclosing class, variables initialized in a constructor cannot be static");
+  static const CompileTimeErrorCode INITIALIZER_FOR_STATIC_FIELD = const CompileTimeErrorCode('INITIALIZER_FOR_STATIC_FIELD', "'{0}' is a static variable in the enclosing class, variables initialized in a constructor cannot be static");
 
   /**
-   * 7.6.1 Generative Constructors: An initializing formal has the form <i>this.id</i>. It is a
-   * compile-time error if <i>id</i> is not the name of an instance variable of the immediately
-   * enclosing class.
+   * 7.6.1 Generative Constructors: An initializing formal has the form
+   * <i>this.id</i>. It is a compile-time error if <i>id</i> is not the name of
+   * an instance variable of the immediately enclosing class.
    *
-   * @param id the name of the initializing formal that is not an instance variable in the
-   *          immediately enclosing class
-   * @see #INITIALIZING_FORMAL_FOR_STATIC_FIELD
-   * @see #INITIALIZER_FOR_NON_EXISTENT_FIELD
+   * @param id the name of the initializing formal that is not an instance
+   *        variable in the immediately enclosing class
+   * See [INITIALIZING_FORMAL_FOR_STATIC_FIELD], and
+   * [INITIALIZER_FOR_NON_EXISTENT_FIELD].
    */
-  static const CompileTimeErrorCode INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD = const CompileTimeErrorCode.con1('INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD', 77, "'{0}' is not a variable in the enclosing class");
+  static const CompileTimeErrorCode INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD = const CompileTimeErrorCode('INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD', "'{0}' is not a variable in the enclosing class");
 
   /**
-   * 7.6.1 Generative Constructors: An initializing formal has the form <i>this.id</i>. It is a
-   * compile-time error if <i>id</i> is not the name of an instance variable of the immediately
-   * enclosing class.
+   * 7.6.1 Generative Constructors: An initializing formal has the form
+   * <i>this.id</i>. It is a compile-time error if <i>id</i> is not the name of
+   * an instance variable of the immediately enclosing class.
    *
-   * @param id the name of the initializing formal that is a static variable in the immediately
-   *          enclosing class
-   * @see #INITIALIZER_FOR_STATIC_FIELD
+   * @param id the name of the initializing formal that is a static variable in
+   *        the immediately enclosing class
+   * See [INITIALIZER_FOR_STATIC_FIELD].
    */
-  static const CompileTimeErrorCode INITIALIZING_FORMAL_FOR_STATIC_FIELD = const CompileTimeErrorCode.con1('INITIALIZING_FORMAL_FOR_STATIC_FIELD', 78, "'{0}' is a static field in the enclosing class, fields initialized in a constructor cannot be static");
+  static const CompileTimeErrorCode INITIALIZING_FORMAL_FOR_STATIC_FIELD = const CompileTimeErrorCode('INITIALIZING_FORMAL_FOR_STATIC_FIELD', "'{0}' is a static field in the enclosing class, fields initialized in a constructor cannot be static");
 
   /**
-   * 12.30 Identifier Reference: Otherwise, e is equivalent to the property extraction
-   * <b>this</b>.<i>id</i>.
+   * 12.30 Identifier Reference: Otherwise, e is equivalent to the property
+   * extraction <b>this</b>.<i>id</i>.
    */
-  static const CompileTimeErrorCode INSTANCE_MEMBER_ACCESS_FROM_FACTORY = const CompileTimeErrorCode.con1('INSTANCE_MEMBER_ACCESS_FROM_FACTORY', 79, "Instance members cannot be accessed from a factory constructor");
+  static const CompileTimeErrorCode INSTANCE_MEMBER_ACCESS_FROM_FACTORY = const CompileTimeErrorCode('INSTANCE_MEMBER_ACCESS_FROM_FACTORY', "Instance members cannot be accessed from a factory constructor");
 
   /**
-   * 12.30 Identifier Reference: Otherwise, e is equivalent to the property extraction
-   * <b>this</b>.<i>id</i>.
+   * 12.30 Identifier Reference: Otherwise, e is equivalent to the property
+   * extraction <b>this</b>.<i>id</i>.
    */
-  static const CompileTimeErrorCode INSTANCE_MEMBER_ACCESS_FROM_STATIC = const CompileTimeErrorCode.con1('INSTANCE_MEMBER_ACCESS_FROM_STATIC', 80, "Instance members cannot be accessed from a static method");
+  static const CompileTimeErrorCode INSTANCE_MEMBER_ACCESS_FROM_STATIC = const CompileTimeErrorCode('INSTANCE_MEMBER_ACCESS_FROM_STATIC', "Instance members cannot be accessed from a static method");
 
   /**
-   * Enum proposal: It is also a compile-time error to explicitly instantiate an enum via 'new' or
-   * 'const' or to access its private fields.
+   * Enum proposal: It is also a compile-time error to explicitly instantiate an
+   * enum via 'new' or 'const' or to access its private fields.
    */
-  static const CompileTimeErrorCode INSTANTIATE_ENUM = const CompileTimeErrorCode.con1('INSTANTIATE_ENUM', 81, "Enums cannot be instantiated");
+  static const CompileTimeErrorCode INSTANTIATE_ENUM = const CompileTimeErrorCode('INSTANTIATE_ENUM', "Enums cannot be instantiated");
 
   /**
-   * 11 Metadata: Metadata consists of a series of annotations, each of which begin with the
-   * character @, followed by a constant expression that must be either a reference to a
-   * compile-time constant variable, or a call to a constant constructor.
+   * 11 Metadata: Metadata consists of a series of annotations, each of which
+   * begin with the character @, followed by a constant expression that must be
+   * either a reference to a compile-time constant variable, or a call to a
+   * constant constructor.
    */
-  static const CompileTimeErrorCode INVALID_ANNOTATION = const CompileTimeErrorCode.con1('INVALID_ANNOTATION', 82, "Annotation can be only constant variable or constant constructor invocation");
+  static const CompileTimeErrorCode INVALID_ANNOTATION = const CompileTimeErrorCode('INVALID_ANNOTATION', "Annotation can be only constant variable or constant constructor invocation");
 
   /**
-   * 11 Metadata: Metadata consists of a series of annotations, each of which begin with the
-   * character @, followed by a constant expression that must be either a reference to a
-   * compile-time constant variable, or a call to a constant constructor.
+   * 11 Metadata: Metadata consists of a series of annotations, each of which
+   * begin with the character @, followed by a constant expression that must be
+   * either a reference to a compile-time constant variable, or a call to a
+   * constant constructor.
    *
-   * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a
-   * deferred prefix.
+   * 12.1 Constants: A qualified reference to a static constant variable that is
+   * not qualified by a deferred prefix.
    */
-  static const CompileTimeErrorCode INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY = const CompileTimeErrorCode.con1('INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY', 83, "Constant values from a deferred library cannot be used as annotations");
+  static const CompileTimeErrorCode INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY = const CompileTimeErrorCode('INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY', "Constant values from a deferred library cannot be used as annotations");
 
   /**
-   * 15.31 Identifier Reference: It is a compile-time error if any of the identifiers async, await
-   * or yield is used as an identifier in a function body marked with either async, async* or sync*.
+   * 15.31 Identifier Reference: It is a compile-time error if any of the
+   * identifiers async, await or yield is used as an identifier in a function
+   * body marked with either async, async* or sync*.
    */
-  static const CompileTimeErrorCode INVALID_IDENTIFIER_IN_ASYNC = const CompileTimeErrorCode.con1('INVALID_IDENTIFIER_IN_ASYNC', 84, "The identifier '{0}' cannot be used in a function marked with async, async* or sync*");
+  static const CompileTimeErrorCode INVALID_IDENTIFIER_IN_ASYNC = const CompileTimeErrorCode('INVALID_IDENTIFIER_IN_ASYNC', "The identifier '{0}' cannot be used in a function marked with async, async* or sync*");
 
   /**
-   * 9. Functions: It is a compile-time error if an async, async* or sync* modifier is attached to
-   * the body of a setter or constructor.
+   * 9. Functions: It is a compile-time error if an async, async* or sync*
+   * modifier is attached to the body of a setter or constructor.
    */
-  static const CompileTimeErrorCode INVALID_MODIFIER_ON_CONSTRUCTOR = const CompileTimeErrorCode.con1('INVALID_MODIFIER_ON_CONSTRUCTOR', 85, "The modifier '{0}' cannot be applied to the body of a constructor");
+  static const CompileTimeErrorCode INVALID_MODIFIER_ON_CONSTRUCTOR = const CompileTimeErrorCode('INVALID_MODIFIER_ON_CONSTRUCTOR', "The modifier '{0}' cannot be applied to the body of a constructor");
 
   /**
-   * 9. Functions: It is a compile-time error if an async, async* or sync* modifier is attached to
-   * the body of a setter or constructor.
+   * 9. Functions: It is a compile-time error if an async, async* or sync*
+   * modifier is attached to the body of a setter or constructor.
    */
-  static const CompileTimeErrorCode INVALID_MODIFIER_ON_SETTER = const CompileTimeErrorCode.con1('INVALID_MODIFIER_ON_SETTER', 86, "The modifier '{0}' cannot be applied to the body of a setter");
+  static const CompileTimeErrorCode INVALID_MODIFIER_ON_SETTER = const CompileTimeErrorCode('INVALID_MODIFIER_ON_SETTER', "The modifier '{0}' cannot be applied to the body of a setter");
 
   /**
-   * TODO(brianwilkerson) Remove this when we have decided on how to report errors in compile-time
-   * constants. Until then, this acts as a placeholder for more informative errors.
+   * TODO(brianwilkerson) Remove this when we have decided on how to report
+   * errors in compile-time constants. Until then, this acts as a placeholder
+   * for more informative errors.
    *
    * See TODOs in ConstantVisitor
    */
-  static const CompileTimeErrorCode INVALID_CONSTANT = const CompileTimeErrorCode.con1('INVALID_CONSTANT', 87, "Invalid constant value");
+  static const CompileTimeErrorCode INVALID_CONSTANT = const CompileTimeErrorCode('INVALID_CONSTANT', "Invalid constant value");
 
   /**
-   * 7.6 Constructors: It is a compile-time error if the name of a constructor is not a constructor
-   * name.
+   * 7.6 Constructors: It is a compile-time error if the name of a constructor
+   * is not a constructor name.
    */
-  static const CompileTimeErrorCode INVALID_CONSTRUCTOR_NAME = const CompileTimeErrorCode.con1('INVALID_CONSTRUCTOR_NAME', 88, "Invalid constructor name");
+  static const CompileTimeErrorCode INVALID_CONSTRUCTOR_NAME = const CompileTimeErrorCode('INVALID_CONSTRUCTOR_NAME', "Invalid constructor name");
 
   /**
-   * 7.6.2 Factories: It is a compile-time error if <i>M</i> is not the name of the immediately
-   * enclosing class.
+   * 7.6.2 Factories: It is a compile-time error if <i>M</i> is not the name of
+   * the immediately enclosing class.
    */
-  static const CompileTimeErrorCode INVALID_FACTORY_NAME_NOT_A_CLASS = const CompileTimeErrorCode.con1('INVALID_FACTORY_NAME_NOT_A_CLASS', 89, "The name of the immediately enclosing class expected");
+  static const CompileTimeErrorCode INVALID_FACTORY_NAME_NOT_A_CLASS = const CompileTimeErrorCode('INVALID_FACTORY_NAME_NOT_A_CLASS', "The name of the immediately enclosing class expected");
 
   /**
-   * 12.10 This: It is a compile-time error if this appears in a top-level function or variable
-   * initializer, in a factory constructor, or in a static method or variable initializer, or in the
-   * initializer of an instance variable.
+   * 12.10 This: It is a compile-time error if this appears in a top-level
+   * function or variable initializer, in a factory constructor, or in a static
+   * method or variable initializer, or in the initializer of an instance
+   * variable.
    */
-  static const CompileTimeErrorCode INVALID_REFERENCE_TO_THIS = const CompileTimeErrorCode.con1('INVALID_REFERENCE_TO_THIS', 90, "Invalid reference to 'this' expression");
+  static const CompileTimeErrorCode INVALID_REFERENCE_TO_THIS = const CompileTimeErrorCode('INVALID_REFERENCE_TO_THIS', "Invalid reference to 'this' expression");
 
   /**
-   * 12.6 Lists: It is a compile time error if the type argument of a constant list literal includes
-   * a type parameter.
+   * 12.6 Lists: It is a compile time error if the type argument of a constant
+   * list literal includes a type parameter.
    *
    * @name the name of the type parameter
    */
-  static const CompileTimeErrorCode INVALID_TYPE_ARGUMENT_IN_CONST_LIST = const CompileTimeErrorCode.con1('INVALID_TYPE_ARGUMENT_IN_CONST_LIST', 91, "Constant list literals cannot include a type parameter as a type argument, such as '{0}'");
+  static const CompileTimeErrorCode INVALID_TYPE_ARGUMENT_IN_CONST_LIST = const CompileTimeErrorCode('INVALID_TYPE_ARGUMENT_IN_CONST_LIST', "Constant list literals cannot include a type parameter as a type argument, such as '{0}'");
 
   /**
-   * 12.7 Maps: It is a compile time error if the type arguments of a constant map literal include a
-   * type parameter.
+   * 12.7 Maps: It is a compile time error if the type arguments of a constant
+   * map literal include a type parameter.
    *
    * @name the name of the type parameter
    */
-  static const CompileTimeErrorCode INVALID_TYPE_ARGUMENT_IN_CONST_MAP = const CompileTimeErrorCode.con1('INVALID_TYPE_ARGUMENT_IN_CONST_MAP', 92, "Constant map literals cannot include a type parameter as a type argument, such as '{0}'");
+  static const CompileTimeErrorCode INVALID_TYPE_ARGUMENT_IN_CONST_MAP = const CompileTimeErrorCode('INVALID_TYPE_ARGUMENT_IN_CONST_MAP', "Constant map literals cannot include a type parameter as a type argument, such as '{0}'");
 
   /**
-   * 14.2 Exports: It is a compile-time error if the compilation unit found at the specified URI is
-   * not a library declaration.
+   * 14.2 Exports: It is a compile-time error if the compilation unit found at
+   * the specified URI is not a library declaration.
    *
-   * 14.1 Imports: It is a compile-time error if the compilation unit found at the specified URI is
-   * not a library declaration.
+   * 14.1 Imports: It is a compile-time error if the compilation unit found at
+   * the specified URI is not a library declaration.
    *
-   * 14.3 Parts: It is a compile time error if the contents of the URI are not a valid part
-   * declaration.
+   * 14.3 Parts: It is a compile time error if the contents of the URI are not a
+   * valid part declaration.
    *
    * @param uri the URI that is invalid
-   * @see #URI_DOES_NOT_EXIST
+   * See [URI_DOES_NOT_EXIST].
    */
-  static const CompileTimeErrorCode INVALID_URI = const CompileTimeErrorCode.con1('INVALID_URI', 93, "Invalid URI syntax: '{0}'");
+  static const CompileTimeErrorCode INVALID_URI = const CompileTimeErrorCode('INVALID_URI', "Invalid URI syntax: '{0}'");
 
   /**
-   * 13.13 Break: It is a compile-time error if no such statement <i>s<sub>E</sub></i> exists within
-   * the innermost function in which <i>s<sub>b</sub></i> occurs.
+   * 13.13 Break: It is a compile-time error if no such statement
+   * <i>s<sub>E</sub></i> exists within the innermost function in which
+   * <i>s<sub>b</sub></i> occurs.
    *
-   * 13.14 Continue: It is a compile-time error if no such statement or case clause
-   * <i>s<sub>E</sub></i> exists within the innermost function in which <i>s<sub>c</sub></i> occurs.
+   * 13.14 Continue: It is a compile-time error if no such statement or case
+   * clause <i>s<sub>E</sub></i> exists within the innermost function in which
+   * <i>s<sub>c</sub></i> occurs.
    *
    * @param labelName the name of the unresolvable label
    */
-  static const CompileTimeErrorCode LABEL_IN_OUTER_SCOPE = const CompileTimeErrorCode.con1('LABEL_IN_OUTER_SCOPE', 94, "Cannot reference label '{0}' declared in an outer method");
+  static const CompileTimeErrorCode LABEL_IN_OUTER_SCOPE = const CompileTimeErrorCode('LABEL_IN_OUTER_SCOPE', "Cannot reference label '{0}' declared in an outer method");
 
   /**
-   * 13.13 Break: It is a compile-time error if no such statement <i>s<sub>E</sub></i> exists within
-   * the innermost function in which <i>s<sub>b</sub></i> occurs.
+   * 13.13 Break: It is a compile-time error if no such statement
+   * <i>s<sub>E</sub></i> exists within the innermost function in which
+   * <i>s<sub>b</sub></i> occurs.
    *
-   * 13.14 Continue: It is a compile-time error if no such statement or case clause
-   * <i>s<sub>E</sub></i> exists within the innermost function in which <i>s<sub>c</sub></i> occurs.
+   * 13.14 Continue: It is a compile-time error if no such statement or case
+   * clause <i>s<sub>E</sub></i> exists within the innermost function in which
+   * <i>s<sub>c</sub></i> occurs.
    *
    * @param labelName the name of the unresolvable label
    */
-  static const CompileTimeErrorCode LABEL_UNDEFINED = const CompileTimeErrorCode.con1('LABEL_UNDEFINED', 95, "Cannot reference undefined label '{0}'");
+  static const CompileTimeErrorCode LABEL_UNDEFINED = const CompileTimeErrorCode('LABEL_UNDEFINED', "Cannot reference undefined label '{0}'");
 
   /**
-   * 7 Classes: It is a compile time error if a class <i>C</i> declares a member with the same name
-   * as <i>C</i>.
+   * 7 Classes: It is a compile time error if a class <i>C</i> declares a member
+   * with the same name as <i>C</i>.
    */
-  static const CompileTimeErrorCode MEMBER_WITH_CLASS_NAME = const CompileTimeErrorCode.con1('MEMBER_WITH_CLASS_NAME', 96, "Class members cannot have the same name as the enclosing class");
+  static const CompileTimeErrorCode MEMBER_WITH_CLASS_NAME = const CompileTimeErrorCode('MEMBER_WITH_CLASS_NAME', "Class members cannot have the same name as the enclosing class");
 
   /**
-   * 7.2 Getters: It is a compile-time error if a class has both a getter and a method with the same
-   * name.
+   * 7.2 Getters: It is a compile-time error if a class has both a getter and a
+   * method with the same name.
    *
    * @param name the conflicting name of the getter and method
    */
-  static const CompileTimeErrorCode METHOD_AND_GETTER_WITH_SAME_NAME = const CompileTimeErrorCode.con1('METHOD_AND_GETTER_WITH_SAME_NAME', 97, "'{0}' cannot be used to name a method, there is already a getter with the same name");
+  static const CompileTimeErrorCode METHOD_AND_GETTER_WITH_SAME_NAME = const CompileTimeErrorCode('METHOD_AND_GETTER_WITH_SAME_NAME', "'{0}' cannot be used to name a method, there is already a getter with the same name");
 
   /**
    * 12.1 Constants: A constant expression is ... a constant list literal.
    */
-  static const CompileTimeErrorCode MISSING_CONST_IN_LIST_LITERAL = const CompileTimeErrorCode.con1('MISSING_CONST_IN_LIST_LITERAL', 98, "List literals must be prefixed with 'const' when used as a constant expression");
+  static const CompileTimeErrorCode MISSING_CONST_IN_LIST_LITERAL = const CompileTimeErrorCode('MISSING_CONST_IN_LIST_LITERAL', "List literals must be prefixed with 'const' when used as a constant expression");
 
   /**
    * 12.1 Constants: A constant expression is ... a constant map literal.
    */
-  static const CompileTimeErrorCode MISSING_CONST_IN_MAP_LITERAL = const CompileTimeErrorCode.con1('MISSING_CONST_IN_MAP_LITERAL', 99, "Map literals must be prefixed with 'const' when used as a constant expression");
+  static const CompileTimeErrorCode MISSING_CONST_IN_MAP_LITERAL = const CompileTimeErrorCode('MISSING_CONST_IN_MAP_LITERAL', "Map literals must be prefixed with 'const' when used as a constant expression");
 
   /**
-   * Enum proposal: It is a static warning if all of the following conditions hold:
+   * Enum proposal: It is a static warning if all of the following conditions
+   * hold:
    * * The switch statement does not have a 'default' clause.
-   * * The static type of <i>e</i> is an enumerated typed with elements <i>id<sub>1</sub></i>,
-   * &hellip;, <i>id<sub>n</sub></i>.
-   * * The sets {<i>e<sub>1</sub></i>, &hellip;, <i>e<sub>k</sub></i>} and {<i>id<sub>1</sub></i>,
-   * &hellip;, <i>id<sub>n</sub></i>} are not the same.
+   * * The static type of <i>e</i> is an enumerated typed with elements
+   *   <i>id<sub>1</sub></i>, &hellip;, <i>id<sub>n</sub></i>.
+   * * The sets {<i>e<sub>1</sub></i>, &hellip;, <i>e<sub>k</sub></i>} and
+   *   {<i>id<sub>1</sub></i>, &hellip;, <i>id<sub>n</sub></i>} are not the same.
    *
    * @param constantName the name of the constant that is missing
    */
-  static const CompileTimeErrorCode MISSING_ENUM_CONSTANT_IN_SWITCH = const CompileTimeErrorCode.con2('MISSING_ENUM_CONSTANT_IN_SWITCH', 100, "Missing case clause for '{0}'", "Add a case clause for the missing constant or add a default clause.");
+  static const CompileTimeErrorCode MISSING_ENUM_CONSTANT_IN_SWITCH = const CompileTimeErrorCode('MISSING_ENUM_CONSTANT_IN_SWITCH', "Missing case clause for '{0}'", "Add a case clause for the missing constant or add a default clause.");
 
   /**
-   * 9 Mixins: It is a compile-time error if a declared or derived mixin explicitly declares a
-   * constructor.
+   * 9 Mixins: It is a compile-time error if a declared or derived mixin
+   * explicitly declares a constructor.
    *
    * @param typeName the name of the mixin that is invalid
    */
-  static const CompileTimeErrorCode MIXIN_DECLARES_CONSTRUCTOR = const CompileTimeErrorCode.con1('MIXIN_DECLARES_CONSTRUCTOR', 101, "The class '{0}' cannot be used as a mixin because it declares a constructor");
+  static const CompileTimeErrorCode MIXIN_DECLARES_CONSTRUCTOR = const CompileTimeErrorCode('MIXIN_DECLARES_CONSTRUCTOR', "The class '{0}' cannot be used as a mixin because it declares a constructor");
 
   /**
-   * 9.1 Mixin Application: It is a compile-time error if the with clause of a mixin application
-   * <i>C</i> includes a deferred type expression.
+   * 9.1 Mixin Application: It is a compile-time error if the with clause of a
+   * mixin application <i>C</i> includes a deferred type expression.
    *
    * @param typeName the name of the type that cannot be extended
-   * @see #EXTENDS_DEFERRED_CLASS
-   * @see #IMPLEMENTS_DEFERRED_CLASS
+   * See [EXTENDS_DEFERRED_CLASS], and [IMPLEMENTS_DEFERRED_CLASS].
    */
-  static const CompileTimeErrorCode MIXIN_DEFERRED_CLASS = const CompileTimeErrorCode.con1('MIXIN_DEFERRED_CLASS', 102, "This class cannot mixin the deferred class '{0}'");
+  static const CompileTimeErrorCode MIXIN_DEFERRED_CLASS = const CompileTimeErrorCode('MIXIN_DEFERRED_CLASS', "This class cannot mixin the deferred class '{0}'");
 
   /**
-   * 9 Mixins: It is a compile-time error if a mixin is derived from a class whose superclass is not
-   * Object.
+   * Not yet in the spec, but consistent with VM behavior.  It is a
+   * compile-time error if all of the constructors of a mixin's base class have
+   * at least one optional parameter (since only constructors that lack
+   * optional parameters can be forwarded to the mixin).  See
+   * https://code.google.com/p/dart/issues/detail?id=15101#c4
+   */
+  static const CompileTimeErrorCode MIXIN_HAS_NO_CONSTRUCTORS =
+      const CompileTimeErrorCode('MIXIN_HAS_NO_CONSTRUCTORS',
+          "This mixin application is invalid because all of the constructors "
+          "in the base class '{0}' have optional parameters.");
+
+  /**
+   * 9 Mixins: It is a compile-time error if a mixin is derived from a class
+   * whose superclass is not Object.
    *
    * @param typeName the name of the mixin that is invalid
    */
-  static const CompileTimeErrorCode MIXIN_INHERITS_FROM_NOT_OBJECT = const CompileTimeErrorCode.con1('MIXIN_INHERITS_FROM_NOT_OBJECT', 103, "The class '{0}' cannot be used as a mixin because it extends a class other than Object");
+  static const CompileTimeErrorCode MIXIN_INHERITS_FROM_NOT_OBJECT = const CompileTimeErrorCode('MIXIN_INHERITS_FROM_NOT_OBJECT', "The class '{0}' cannot be used as a mixin because it extends a class other than Object");
 
   /**
-   * 12.2 Null: It is a compile-time error for a class to attempt to extend or implement Null.
+   * 12.2 Null: It is a compile-time error for a class to attempt to extend or
+   * implement Null.
    *
-   * 12.3 Numbers: It is a compile-time error for a class to attempt to extend or implement int.
+   * 12.3 Numbers: It is a compile-time error for a class to attempt to extend
+   * or implement int.
    *
-   * 12.3 Numbers: It is a compile-time error for a class to attempt to extend or implement double.
+   * 12.3 Numbers: It is a compile-time error for a class to attempt to extend
+   * or implement double.
    *
-   * 12.3 Numbers: It is a compile-time error for any type other than the types int and double to
-   * attempt to extend or implement num.
+   * 12.3 Numbers: It is a compile-time error for any type other than the types
+   * int and double to attempt to extend or implement num.
    *
-   * 12.4 Booleans: It is a compile-time error for a class to attempt to extend or implement bool.
+   * 12.4 Booleans: It is a compile-time error for a class to attempt to extend
+   * or implement bool.
    *
-   * 12.5 Strings: It is a compile-time error for a class to attempt to extend or implement String.
+   * 12.5 Strings: It is a compile-time error for a class to attempt to extend
+   * or implement String.
    *
    * @param typeName the name of the type that cannot be extended
-   * @see #IMPLEMENTS_DISALLOWED_CLASS
+   * See [IMPLEMENTS_DISALLOWED_CLASS].
    */
-  static const CompileTimeErrorCode MIXIN_OF_DISALLOWED_CLASS = const CompileTimeErrorCode.con1('MIXIN_OF_DISALLOWED_CLASS', 104, "Classes cannot mixin '{0}'");
+  static const CompileTimeErrorCode MIXIN_OF_DISALLOWED_CLASS = const CompileTimeErrorCode('MIXIN_OF_DISALLOWED_CLASS', "Classes cannot mixin '{0}'");
 
   /**
-   * Enum proposal: It is a compile-time error to subclass, mix-in or implement an enum.
+   * Enum proposal: It is a compile-time error to subclass, mix-in or implement
+   * an enum.
    */
-  static const CompileTimeErrorCode MIXIN_OF_ENUM = const CompileTimeErrorCode.con1('MIXIN_OF_ENUM', 105, "Classes cannot mixin an enum");
+  static const CompileTimeErrorCode MIXIN_OF_ENUM = const CompileTimeErrorCode('MIXIN_OF_ENUM', "Classes cannot mixin an enum");
 
   /**
-   * 9.1 Mixin Application: It is a compile-time error if <i>M</i> does not denote a class or mixin
-   * available in the immediately enclosing scope.
+   * 9.1 Mixin Application: It is a compile-time error if <i>M</i> does not
+   * denote a class or mixin available in the immediately enclosing scope.
    */
-  static const CompileTimeErrorCode MIXIN_OF_NON_CLASS = const CompileTimeErrorCode.con1('MIXIN_OF_NON_CLASS', 106, "Classes can only mixin other classes");
+  static const CompileTimeErrorCode MIXIN_OF_NON_CLASS = const CompileTimeErrorCode('MIXIN_OF_NON_CLASS', "Classes can only mixin other classes");
 
   /**
-   * 9 Mixins: It is a compile-time error if a declared or derived mixin refers to super.
+   * 9 Mixins: It is a compile-time error if a declared or derived mixin refers
+   * to super.
    */
-  static const CompileTimeErrorCode MIXIN_REFERENCES_SUPER = const CompileTimeErrorCode.con1('MIXIN_REFERENCES_SUPER', 107, "The class '{0}' cannot be used as a mixin because it references 'super'");
+  static const CompileTimeErrorCode MIXIN_REFERENCES_SUPER = const CompileTimeErrorCode('MIXIN_REFERENCES_SUPER', "The class '{0}' cannot be used as a mixin because it references 'super'");
 
   /**
-   * 9.1 Mixin Application: It is a compile-time error if <i>S</i> does not denote a class available
-   * in the immediately enclosing scope.
+   * 9.1 Mixin Application: It is a compile-time error if <i>S</i> does not
+   * denote a class available in the immediately enclosing scope.
    */
-  static const CompileTimeErrorCode MIXIN_WITH_NON_CLASS_SUPERCLASS = const CompileTimeErrorCode.con1('MIXIN_WITH_NON_CLASS_SUPERCLASS', 108, "Mixin can only be applied to class");
+  static const CompileTimeErrorCode MIXIN_WITH_NON_CLASS_SUPERCLASS = const CompileTimeErrorCode('MIXIN_WITH_NON_CLASS_SUPERCLASS', "Mixin can only be applied to class");
 
   /**
-   * 7.6.1 Generative Constructors: A generative constructor may be redirecting, in which case its
-   * only action is to invoke another generative constructor.
+   * 7.6.1 Generative Constructors: A generative constructor may be redirecting,
+   * in which case its only action is to invoke another generative constructor.
    */
-  static const CompileTimeErrorCode MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS = const CompileTimeErrorCode.con1('MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS', 109, "Constructor may have at most one 'this' redirection");
+  static const CompileTimeErrorCode MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS = const CompileTimeErrorCode('MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS', "Constructor may have at most one 'this' redirection");
 
   /**
-   * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. Then <i>k</i> may
-   * include at most one superinitializer in its initializer list or a compile time error occurs.
+   * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor.
+   * Then <i>k</i> may include at most one superinitializer in its initializer
+   * list or a compile time error occurs.
    */
-  static const CompileTimeErrorCode MULTIPLE_SUPER_INITIALIZERS = const CompileTimeErrorCode.con1('MULTIPLE_SUPER_INITIALIZERS', 110, "Constructor may have at most one 'super' initializer");
+  static const CompileTimeErrorCode MULTIPLE_SUPER_INITIALIZERS = const CompileTimeErrorCode('MULTIPLE_SUPER_INITIALIZERS', "Constructor may have at most one 'super' initializer");
 
   /**
-   * 11 Metadata: Metadata consists of a series of annotations, each of which begin with the
-   * character @, followed by a constant expression that must be either a reference to a
-   * compile-time constant variable, or a call to a constant constructor.
+   * 11 Metadata: Metadata consists of a series of annotations, each of which
+   * begin with the character @, followed by a constant expression that must be
+   * either a reference to a compile-time constant variable, or a call to a
+   * constant constructor.
    */
-  static const CompileTimeErrorCode NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS = const CompileTimeErrorCode.con1('NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS', 111, "Annotation creation must have arguments");
+  static const CompileTimeErrorCode NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS = const CompileTimeErrorCode('NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS', "Annotation creation must have arguments");
 
   /**
-   * 7.6.1 Generative Constructors: If no superinitializer is provided, an implicit superinitializer
-   * of the form <b>super</b>() is added at the end of <i>k</i>'s initializer list, unless the
-   * enclosing class is class <i>Object</i>.
+   * 7.6.1 Generative Constructors: If no superinitializer is provided, an
+   * implicit superinitializer of the form <b>super</b>() is added at the end of
+   * <i>k</i>'s initializer list, unless the enclosing class is class
+   * <i>Object</i>.
    *
-   * 7.6.1 Generative constructors. It is a compile-time error if class <i>S</i> does not declare a
-   * generative constructor named <i>S</i> (respectively <i>S.id</i>)
+   * 7.6.1 Generative constructors. It is a compile-time error if class <i>S</i>
+   * does not declare a generative constructor named <i>S</i> (respectively
+   * <i>S.id</i>)
    */
-  static const CompileTimeErrorCode NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT = const CompileTimeErrorCode.con1('NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT', 112, "The class '{0}' does not have a default constructor");
+  static const CompileTimeErrorCode NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT = const CompileTimeErrorCode('NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT', "The class '{0}' does not have a default constructor");
 
   /**
-   * 7.6 Constructors: Iff no constructor is specified for a class <i>C</i>, it implicitly has a
-   * default constructor C() : <b>super<b>() {}, unless <i>C</i> is class <i>Object</i>.
+   * 7.6 Constructors: Iff no constructor is specified for a class <i>C</i>, it
+   * implicitly has a default constructor C() : <b>super<b>() {}, unless
+   * <i>C</i> is class <i>Object</i>.
    *
-   * 7.6.1 Generative constructors. It is a compile-time error if class <i>S</i> does not declare a
-   * generative constructor named <i>S</i> (respectively <i>S.id</i>)
+   * 7.6.1 Generative constructors. It is a compile-time error if class <i>S</i>
+   * does not declare a generative constructor named <i>S</i> (respectively
+   * <i>S.id</i>)
    */
-  static const CompileTimeErrorCode NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT = const CompileTimeErrorCode.con1('NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT', 113, "The class '{0}' does not have a default constructor");
+  static const CompileTimeErrorCode NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT = const CompileTimeErrorCode('NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT', "The class '{0}' does not have a default constructor");
 
   /**
-   * 13.2 Expression Statements: It is a compile-time error if a non-constant map literal that has
-   * no explicit type arguments appears in a place where a statement is expected.
+   * 13.2 Expression Statements: It is a compile-time error if a non-constant
+   * map literal that has no explicit type arguments appears in a place where a
+   * statement is expected.
    */
-  static const CompileTimeErrorCode NON_CONST_MAP_AS_EXPRESSION_STATEMENT = const CompileTimeErrorCode.con1('NON_CONST_MAP_AS_EXPRESSION_STATEMENT', 114, "A non-constant map literal without type arguments cannot be used as an expression statement");
+  static const CompileTimeErrorCode NON_CONST_MAP_AS_EXPRESSION_STATEMENT = const CompileTimeErrorCode('NON_CONST_MAP_AS_EXPRESSION_STATEMENT', "A non-constant map literal without type arguments cannot be used as an expression statement");
 
   /**
-   * 13.9 Switch: Given a switch statement of the form <i>switch (e) { label<sub>11</sub> &hellip;
-   * label<sub>1j1</sub> case e<sub>1</sub>: s<sub>1</sub> &hellip; label<sub>n1</sub> &hellip;
-   * label<sub>njn</sub> case e<sub>n</sub>: s<sub>n</sub> default: s<sub>n+1</sub>}</i> or the form
-   * <i>switch (e) { label<sub>11</sub> &hellip; label<sub>1j1</sub> case e<sub>1</sub>:
-   * s<sub>1</sub> &hellip; label<sub>n1</sub> &hellip; label<sub>njn</sub> case e<sub>n</sub>:
-   * s<sub>n</sub>}</i>, it is a compile-time error if the expressions <i>e<sub>k</sub></i> are not
+   * 13.9 Switch: Given a switch statement of the form <i>switch (e) {
+   * label<sub>11</sub> &hellip; label<sub>1j1</sub> case e<sub>1</sub>:
+   * s<sub>1</sub> &hellip; label<sub>n1</sub> &hellip; label<sub>njn</sub> case
+   * e<sub>n</sub>: s<sub>n</sub> default: s<sub>n+1</sub>}</i> or the form
+   * <i>switch (e) { label<sub>11</sub> &hellip; label<sub>1j1</sub> case
+   * e<sub>1</sub>: s<sub>1</sub> &hellip; label<sub>n1</sub> &hellip;
+   * label<sub>njn</sub> case e<sub>n</sub>: s<sub>n</sub>}</i>, it is a
+   * compile-time error if the expressions <i>e<sub>k</sub></i> are not
    * compile-time constants, for all <i>1 &lt;= k &lt;= n</i>.
    */
-  static const CompileTimeErrorCode NON_CONSTANT_CASE_EXPRESSION = const CompileTimeErrorCode.con1('NON_CONSTANT_CASE_EXPRESSION', 115, "Case expressions must be constant");
+  static const CompileTimeErrorCode NON_CONSTANT_CASE_EXPRESSION = const CompileTimeErrorCode('NON_CONSTANT_CASE_EXPRESSION', "Case expressions must be constant");
 
   /**
-   * 13.9 Switch: Given a switch statement of the form <i>switch (e) { label<sub>11</sub> &hellip;
-   * label<sub>1j1</sub> case e<sub>1</sub>: s<sub>1</sub> &hellip; label<sub>n1</sub> &hellip;
-   * label<sub>njn</sub> case e<sub>n</sub>: s<sub>n</sub> default: s<sub>n+1</sub>}</i> or the form
-   * <i>switch (e) { label<sub>11</sub> &hellip; label<sub>1j1</sub> case e<sub>1</sub>:
-   * s<sub>1</sub> &hellip; label<sub>n1</sub> &hellip; label<sub>njn</sub> case e<sub>n</sub>:
-   * s<sub>n</sub>}</i>, it is a compile-time error if the expressions <i>e<sub>k</sub></i> are not
+   * 13.9 Switch: Given a switch statement of the form <i>switch (e) {
+   * label<sub>11</sub> &hellip; label<sub>1j1</sub> case e<sub>1</sub>:
+   * s<sub>1</sub> &hellip; label<sub>n1</sub> &hellip; label<sub>njn</sub> case
+   * e<sub>n</sub>: s<sub>n</sub> default: s<sub>n+1</sub>}</i> or the form
+   * <i>switch (e) { label<sub>11</sub> &hellip; label<sub>1j1</sub> case
+   * e<sub>1</sub>: s<sub>1</sub> &hellip; label<sub>n1</sub> &hellip;
+   * label<sub>njn</sub> case e<sub>n</sub>: s<sub>n</sub>}</i>, it is a
+   * compile-time error if the expressions <i>e<sub>k</sub></i> are not
    * compile-time constants, for all <i>1 &lt;= k &lt;= n</i>.
    *
-   * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a
-   * deferred prefix.
+   * 12.1 Constants: A qualified reference to a static constant variable that is
+   * not qualified by a deferred prefix.
    */
-  static const CompileTimeErrorCode NON_CONSTANT_CASE_EXPRESSION_FROM_DEFERRED_LIBRARY = const CompileTimeErrorCode.con1('NON_CONSTANT_CASE_EXPRESSION_FROM_DEFERRED_LIBRARY', 116, "Constant values from a deferred library cannot be used as a case expression");
+  static const CompileTimeErrorCode NON_CONSTANT_CASE_EXPRESSION_FROM_DEFERRED_LIBRARY = const CompileTimeErrorCode('NON_CONSTANT_CASE_EXPRESSION_FROM_DEFERRED_LIBRARY', "Constant values from a deferred library cannot be used as a case expression");
 
   /**
-   * 6.2.2 Optional Formals: It is a compile-time error if the default value of an optional
-   * parameter is not a compile-time constant.
+   * 6.2.2 Optional Formals: It is a compile-time error if the default value of
+   * an optional parameter is not a compile-time constant.
    */
-  static const CompileTimeErrorCode NON_CONSTANT_DEFAULT_VALUE = const CompileTimeErrorCode.con1('NON_CONSTANT_DEFAULT_VALUE', 117, "Default values of an optional parameter must be constant");
+  static const CompileTimeErrorCode NON_CONSTANT_DEFAULT_VALUE = const CompileTimeErrorCode('NON_CONSTANT_DEFAULT_VALUE', "Default values of an optional parameter must be constant");
 
   /**
-   * 6.2.2 Optional Formals: It is a compile-time error if the default value of an optional
-   * parameter is not a compile-time constant.
+   * 6.2.2 Optional Formals: It is a compile-time error if the default value of
+   * an optional parameter is not a compile-time constant.
    *
-   * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a
-   * deferred prefix.
+   * 12.1 Constants: A qualified reference to a static constant variable that is
+   * not qualified by a deferred prefix.
    */
-  static const CompileTimeErrorCode NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED_LIBRARY = const CompileTimeErrorCode.con1('NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED_LIBRARY', 118, "Constant values from a deferred library cannot be used as a default parameter value");
+  static const CompileTimeErrorCode NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED_LIBRARY = const CompileTimeErrorCode('NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED_LIBRARY', "Constant values from a deferred library cannot be used as a default parameter value");
 
   /**
-   * 12.6 Lists: It is a compile time error if an element of a constant list literal is not a
-   * compile-time constant.
-   */
-  static const CompileTimeErrorCode NON_CONSTANT_LIST_ELEMENT = const CompileTimeErrorCode.con1('NON_CONSTANT_LIST_ELEMENT', 119, "'const' lists must have all constant values");
-
-  /**
-   * 12.6 Lists: It is a compile time error if an element of a constant list literal is not a
-   * compile-time constant.
-   *
-   * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a
-   * deferred prefix.
-   */
-  static const CompileTimeErrorCode NON_CONSTANT_LIST_ELEMENT_FROM_DEFERRED_LIBRARY = const CompileTimeErrorCode.con1('NON_CONSTANT_LIST_ELEMENT_FROM_DEFERRED_LIBRARY', 120, "Constant values from a deferred library cannot be used as values in a 'const' list");
-
-  /**
-   * 12.7 Maps: It is a compile time error if either a key or a value of an entry in a constant map
+   * 12.6 Lists: It is a compile time error if an element of a constant list
    * literal is not a compile-time constant.
    */
-  static const CompileTimeErrorCode NON_CONSTANT_MAP_KEY = const CompileTimeErrorCode.con1('NON_CONSTANT_MAP_KEY', 121, "The keys in a map must be constant");
+  static const CompileTimeErrorCode NON_CONSTANT_LIST_ELEMENT = const CompileTimeErrorCode('NON_CONSTANT_LIST_ELEMENT', "'const' lists must have all constant values");
 
   /**
-   * 12.7 Maps: It is a compile time error if either a key or a value of an entry in a constant map
+   * 12.6 Lists: It is a compile time error if an element of a constant list
    * literal is not a compile-time constant.
    *
-   * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a
-   * deferred prefix.
+   * 12.1 Constants: A qualified reference to a static constant variable that is
+   * not qualified by a deferred prefix.
    */
-  static const CompileTimeErrorCode NON_CONSTANT_MAP_KEY_FROM_DEFERRED_LIBRARY = const CompileTimeErrorCode.con1('NON_CONSTANT_MAP_KEY_FROM_DEFERRED_LIBRARY', 122, "Constant values from a deferred library cannot be used as keys in a map");
+  static const CompileTimeErrorCode NON_CONSTANT_LIST_ELEMENT_FROM_DEFERRED_LIBRARY = const CompileTimeErrorCode('NON_CONSTANT_LIST_ELEMENT_FROM_DEFERRED_LIBRARY', "Constant values from a deferred library cannot be used as values in a 'const' list");
 
   /**
-   * 12.7 Maps: It is a compile time error if either a key or a value of an entry in a constant map
-   * literal is not a compile-time constant.
+   * 12.7 Maps: It is a compile time error if either a key or a value of an
+   * entry in a constant map literal is not a compile-time constant.
    */
-  static const CompileTimeErrorCode NON_CONSTANT_MAP_VALUE = const CompileTimeErrorCode.con1('NON_CONSTANT_MAP_VALUE', 123, "The values in a 'const' map must be constant");
+  static const CompileTimeErrorCode NON_CONSTANT_MAP_KEY = const CompileTimeErrorCode('NON_CONSTANT_MAP_KEY', "The keys in a map must be constant");
 
   /**
-   * 12.7 Maps: It is a compile time error if either a key or a value of an entry in a constant map
-   * literal is not a compile-time constant.
+   * 12.7 Maps: It is a compile time error if either a key or a value of an
+   * entry in a constant map literal is not a compile-time constant.
    *
-   * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a
-   * deferred prefix.
+   * 12.1 Constants: A qualified reference to a static constant variable that is
+   * not qualified by a deferred prefix.
    */
-  static const CompileTimeErrorCode NON_CONSTANT_MAP_VALUE_FROM_DEFERRED_LIBRARY = const CompileTimeErrorCode.con1('NON_CONSTANT_MAP_VALUE_FROM_DEFERRED_LIBRARY', 124, "Constant values from a deferred library cannot be used as values in a 'const' map");
+  static const CompileTimeErrorCode NON_CONSTANT_MAP_KEY_FROM_DEFERRED_LIBRARY = const CompileTimeErrorCode('NON_CONSTANT_MAP_KEY_FROM_DEFERRED_LIBRARY', "Constant values from a deferred library cannot be used as keys in a map");
 
   /**
-   * 11 Metadata: Metadata consists of a series of annotations, each of which begin with the
-   * character @, followed by a constant expression that must be either a reference to a
-   * compile-time constant variable, or a call to a constant constructor.
+   * 12.7 Maps: It is a compile time error if either a key or a value of an
+   * entry in a constant map literal is not a compile-time constant.
+   */
+  static const CompileTimeErrorCode NON_CONSTANT_MAP_VALUE = const CompileTimeErrorCode('NON_CONSTANT_MAP_VALUE', "The values in a 'const' map must be constant");
+
+  /**
+   * 12.7 Maps: It is a compile time error if either a key or a value of an
+   * entry in a constant map literal is not a compile-time constant.
+   *
+   * 12.1 Constants: A qualified reference to a static constant variable that is
+   * not qualified by a deferred prefix.
+   */
+  static const CompileTimeErrorCode NON_CONSTANT_MAP_VALUE_FROM_DEFERRED_LIBRARY = const CompileTimeErrorCode('NON_CONSTANT_MAP_VALUE_FROM_DEFERRED_LIBRARY', "Constant values from a deferred library cannot be used as values in a 'const' map");
+
+  /**
+   * 11 Metadata: Metadata consists of a series of annotations, each of which
+   * begin with the character @, followed by a constant expression that must be
+   * either a reference to a compile-time constant variable, or a call to a
+   * constant constructor.
    *
    * "From deferred library" case is covered by
-   * [CompileTimeErrorCode#INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY].
+   * [CompileTimeErrorCode.INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY].
    */
-  static const CompileTimeErrorCode NON_CONSTANT_ANNOTATION_CONSTRUCTOR = const CompileTimeErrorCode.con1('NON_CONSTANT_ANNOTATION_CONSTRUCTOR', 125, "Annotation creation can use only 'const' constructor");
+  static const CompileTimeErrorCode NON_CONSTANT_ANNOTATION_CONSTRUCTOR = const CompileTimeErrorCode('NON_CONSTANT_ANNOTATION_CONSTRUCTOR', "Annotation creation can use only 'const' constructor");
 
   /**
-   * 7.6.3 Constant Constructors: Any expression that appears within the initializer list of a
-   * constant constructor must be a potentially constant expression, or a compile-time error occurs.
+   * 7.6.3 Constant Constructors: Any expression that appears within the
+   * initializer list of a constant constructor must be a potentially constant
+   * expression, or a compile-time error occurs.
    */
-  static const CompileTimeErrorCode NON_CONSTANT_VALUE_IN_INITIALIZER = const CompileTimeErrorCode.con1('NON_CONSTANT_VALUE_IN_INITIALIZER', 126, "Initializer expressions in constant constructors must be constants");
+  static const CompileTimeErrorCode NON_CONSTANT_VALUE_IN_INITIALIZER = const CompileTimeErrorCode('NON_CONSTANT_VALUE_IN_INITIALIZER', "Initializer expressions in constant constructors must be constants");
 
   /**
-   * 7.6.3 Constant Constructors: Any expression that appears within the initializer list of a
-   * constant constructor must be a potentially constant expression, or a compile-time error occurs.
+   * 7.6.3 Constant Constructors: Any expression that appears within the
+   * initializer list of a constant constructor must be a potentially constant
+   * expression, or a compile-time error occurs.
    *
-   * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a
-   * deferred prefix.
+   * 12.1 Constants: A qualified reference to a static constant variable that is
+   * not qualified by a deferred prefix.
    */
-  static const CompileTimeErrorCode NON_CONSTANT_VALUE_IN_INITIALIZER_FROM_DEFERRED_LIBRARY = const CompileTimeErrorCode.con1('NON_CONSTANT_VALUE_IN_INITIALIZER_FROM_DEFERRED_LIBRARY', 127, "Constant values from a deferred library cannot be used as constant initializers");
+  static const CompileTimeErrorCode NON_CONSTANT_VALUE_IN_INITIALIZER_FROM_DEFERRED_LIBRARY = const CompileTimeErrorCode('NON_CONSTANT_VALUE_IN_INITIALIZER_FROM_DEFERRED_LIBRARY', "Constant values from a deferred library cannot be used as constant initializers");
 
   /**
-   * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m < h</i> or if <i>m > n</i>.
+   * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m < h</i>
+   * or if <i>m > n</i>.
    *
-   * 12.11.2 Const: It is a compile-time error if evaluation of a constant object results in an
-   * uncaught exception being thrown.
+   * 12.11.2 Const: It is a compile-time error if evaluation of a constant
+   * object results in an uncaught exception being thrown.
    *
    * @param requiredCount the expected number of required arguments
    * @param argumentCount the actual number of positional arguments given
    */
-  static const CompileTimeErrorCode NOT_ENOUGH_REQUIRED_ARGUMENTS = const CompileTimeErrorCode.con1('NOT_ENOUGH_REQUIRED_ARGUMENTS', 128, "{0} required argument(s) expected, but {1} found");
+  static const CompileTimeErrorCode NOT_ENOUGH_REQUIRED_ARGUMENTS = const CompileTimeErrorCode('NOT_ENOUGH_REQUIRED_ARGUMENTS', "{0} required argument(s) expected, but {1} found");
 
   /**
-   * 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the superinitializer appears
-   * and let <i>S</i> be the superclass of <i>C</i>. Let <i>k</i> be a generative constructor. It is
-   * a compile-time error if class <i>S</i> does not declare a generative constructor named <i>S</i>
+   * 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the
+   * superinitializer appears and let <i>S</i> be the superclass of <i>C</i>.
+   * Let <i>k</i> be a generative constructor. It is a compile-time error if
+   * class <i>S</i> does not declare a generative constructor named <i>S</i>
    * (respectively <i>S.id</i>)
    */
-  static const CompileTimeErrorCode NON_GENERATIVE_CONSTRUCTOR = const CompileTimeErrorCode.con1('NON_GENERATIVE_CONSTRUCTOR', 129, "The generative constructor '{0}' expected, but factory found");
+  static const CompileTimeErrorCode NON_GENERATIVE_CONSTRUCTOR = const CompileTimeErrorCode('NON_GENERATIVE_CONSTRUCTOR', "The generative constructor '{0}' expected, but factory found");
 
   /**
-   * 7.9 Superclasses: It is a compile-time error to specify an extends clause for class Object.
+   * 7.9 Superclasses: It is a compile-time error to specify an extends clause
+   * for class Object.
    */
-  static const CompileTimeErrorCode OBJECT_CANNOT_EXTEND_ANOTHER_CLASS = const CompileTimeErrorCode.con1('OBJECT_CANNOT_EXTEND_ANOTHER_CLASS', 130, "");
+  static const CompileTimeErrorCode OBJECT_CANNOT_EXTEND_ANOTHER_CLASS = const CompileTimeErrorCode('OBJECT_CANNOT_EXTEND_ANOTHER_CLASS', "");
 
   /**
-   * 7.1.1 Operators: It is a compile-time error to declare an optional parameter in an operator.
+   * 7.1.1 Operators: It is a compile-time error to declare an optional
+   * parameter in an operator.
    */
-  static const CompileTimeErrorCode OPTIONAL_PARAMETER_IN_OPERATOR = const CompileTimeErrorCode.con1('OPTIONAL_PARAMETER_IN_OPERATOR', 131, "Optional parameters are not allowed when defining an operator");
+  static const CompileTimeErrorCode OPTIONAL_PARAMETER_IN_OPERATOR = const CompileTimeErrorCode('OPTIONAL_PARAMETER_IN_OPERATOR', "Optional parameters are not allowed when defining an operator");
 
   /**
-   * 14.3 Parts: It is a compile time error if the contents of the URI are not a valid part
-   * declaration.
+   * 14.3 Parts: It is a compile time error if the contents of the URI are not a
+   * valid part declaration.
    *
    * @param uri the uri pointing to a non-library declaration
    */
-  static const CompileTimeErrorCode PART_OF_NON_PART = const CompileTimeErrorCode.con1('PART_OF_NON_PART', 132, "The included part '{0}' must have a part-of directive");
+  static const CompileTimeErrorCode PART_OF_NON_PART = const CompileTimeErrorCode('PART_OF_NON_PART', "The included part '{0}' must have a part-of directive");
 
   /**
-   * 14.1 Imports: It is a compile-time error if the current library declares a top-level member
-   * named <i>p</i>.
+   * 14.1 Imports: It is a compile-time error if the current library declares a
+   * top-level member named <i>p</i>.
    */
-  static const CompileTimeErrorCode PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER = const CompileTimeErrorCode.con1('PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER', 133, "The name '{0}' is already used as an import prefix and cannot be used to name a top-level element");
+  static const CompileTimeErrorCode PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER = const CompileTimeErrorCode('PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER', "The name '{0}' is already used as an import prefix and cannot be used to name a top-level element");
 
   /**
-   * 6.2.2 Optional Formals: It is a compile-time error if the name of a named optional parameter
-   * begins with an '_' character.
+   * 6.2.2 Optional Formals: It is a compile-time error if the name of a named
+   * optional parameter begins with an '_' character.
    */
-  static const CompileTimeErrorCode PRIVATE_OPTIONAL_PARAMETER = const CompileTimeErrorCode.con1('PRIVATE_OPTIONAL_PARAMETER', 134, "Named optional parameters cannot start with an underscore");
+  static const CompileTimeErrorCode PRIVATE_OPTIONAL_PARAMETER = const CompileTimeErrorCode('PRIVATE_OPTIONAL_PARAMETER', "Named optional parameters cannot start with an underscore");
 
   /**
-   * 12.1 Constants: It is a compile-time error if the value of a compile-time constant expression
-   * depends on itself.
+   * 12.1 Constants: It is a compile-time error if the value of a compile-time
+   * constant expression depends on itself.
    */
-  static const CompileTimeErrorCode RECURSIVE_COMPILE_TIME_CONSTANT = const CompileTimeErrorCode.con1('RECURSIVE_COMPILE_TIME_CONSTANT', 135, "");
+  static const CompileTimeErrorCode RECURSIVE_COMPILE_TIME_CONSTANT = const CompileTimeErrorCode('RECURSIVE_COMPILE_TIME_CONSTANT', "");
 
   /**
-   * 7.6.1 Generative Constructors: A generative constructor may be redirecting, in which case its
-   * only action is to invoke another generative constructor.
+   * 7.6.1 Generative Constructors: A generative constructor may be redirecting,
+   * in which case its only action is to invoke another generative constructor.
    *
-   * TODO(scheglov) review this later, there are no explicit "it is a compile-time error" in
-   * specification. But it was added to the co19 and there is same error for factories.
+   * TODO(scheglov) review this later, there are no explicit "it is a
+   * compile-time error" in specification. But it was added to the co19 and
+   * there is same error for factories.
    *
    * https://code.google.com/p/dart/issues/detail?id=954
    */
-  static const CompileTimeErrorCode RECURSIVE_CONSTRUCTOR_REDIRECT = const CompileTimeErrorCode.con1('RECURSIVE_CONSTRUCTOR_REDIRECT', 136, "Cycle in redirecting generative constructors");
+  static const CompileTimeErrorCode RECURSIVE_CONSTRUCTOR_REDIRECT = const CompileTimeErrorCode('RECURSIVE_CONSTRUCTOR_REDIRECT', "Cycle in redirecting generative constructors");
 
   /**
-   * 7.6.2 Factories: It is a compile-time error if a redirecting factory constructor redirects to
-   * itself, either directly or indirectly via a sequence of redirections.
+   * 7.6.2 Factories: It is a compile-time error if a redirecting factory
+   * constructor redirects to itself, either directly or indirectly via a
+   * sequence of redirections.
    */
-  static const CompileTimeErrorCode RECURSIVE_FACTORY_REDIRECT = const CompileTimeErrorCode.con1('RECURSIVE_FACTORY_REDIRECT', 137, "Cycle in redirecting factory constructors");
+  static const CompileTimeErrorCode RECURSIVE_FACTORY_REDIRECT = const CompileTimeErrorCode('RECURSIVE_FACTORY_REDIRECT', "Cycle in redirecting factory constructors");
 
   /**
-   * 7.10 Superinterfaces: It is a compile-time error if the interface of a class <i>C</i> is a
+   * 7.10 Superinterfaces: It is a compile-time error if the interface of a
+   * class <i>C</i> is a superinterface of itself.
+   *
+   * 8.1 Superinterfaces: It is a compile-time error if an interface is a
    * superinterface of itself.
    *
-   * 8.1 Superinterfaces: It is a compile-time error if an interface is a superinterface of itself.
-   *
-   * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a superclass of itself.
+   * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a
+   * superclass of itself.
    *
    * @param className the name of the class that implements itself recursively
    * @param strImplementsPath a string representation of the implements loop
    */
-  static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE = const CompileTimeErrorCode.con1('RECURSIVE_INTERFACE_INHERITANCE', 138, "'{0}' cannot be a superinterface of itself: {1}");
+  static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE = const CompileTimeErrorCode('RECURSIVE_INTERFACE_INHERITANCE', "'{0}' cannot be a superinterface of itself: {1}");
 
   /**
-   * 7.10 Superinterfaces: It is a compile-time error if the interface of a class <i>C</i> is a
+   * 7.10 Superinterfaces: It is a compile-time error if the interface of a
+   * class <i>C</i> is a superinterface of itself.
+   *
+   * 8.1 Superinterfaces: It is a compile-time error if an interface is a
    * superinterface of itself.
    *
-   * 8.1 Superinterfaces: It is a compile-time error if an interface is a superinterface of itself.
-   *
-   * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a superclass of itself.
+   * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a
+   * superclass of itself.
    *
    * @param className the name of the class that implements itself recursively
    */
-  static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_EXTENDS = const CompileTimeErrorCode.con1('RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_EXTENDS', 139, "'{0}' cannot extend itself");
+  static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_EXTENDS = const CompileTimeErrorCode('RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_EXTENDS', "'{0}' cannot extend itself");
 
   /**
-   * 7.10 Superinterfaces: It is a compile-time error if the interface of a class <i>C</i> is a
+   * 7.10 Superinterfaces: It is a compile-time error if the interface of a
+   * class <i>C</i> is a superinterface of itself.
+   *
+   * 8.1 Superinterfaces: It is a compile-time error if an interface is a
    * superinterface of itself.
    *
-   * 8.1 Superinterfaces: It is a compile-time error if an interface is a superinterface of itself.
-   *
-   * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a superclass of itself.
+   * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a
+   * superclass of itself.
    *
    * @param className the name of the class that implements itself recursively
    */
-  static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_IMPLEMENTS = const CompileTimeErrorCode.con1('RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_IMPLEMENTS', 140, "'{0}' cannot implement itself");
+  static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_IMPLEMENTS = const CompileTimeErrorCode('RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_IMPLEMENTS', "'{0}' cannot implement itself");
 
   /**
-   * 7.10 Superinterfaces: It is a compile-time error if the interface of a class <i>C</i> is a
+   * 7.10 Superinterfaces: It is a compile-time error if the interface of a
+   * class <i>C</i> is a superinterface of itself.
+   *
+   * 8.1 Superinterfaces: It is a compile-time error if an interface is a
    * superinterface of itself.
    *
-   * 8.1 Superinterfaces: It is a compile-time error if an interface is a superinterface of itself.
-   *
-   * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a superclass of itself.
+   * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a
+   * superclass of itself.
    *
    * @param className the name of the class that implements itself recursively
    */
-  static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_WITH = const CompileTimeErrorCode.con1('RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_WITH', 141, "'{0}' cannot use itself as a mixin");
+  static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_WITH = const CompileTimeErrorCode('RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_WITH', "'{0}' cannot use itself as a mixin");
 
   /**
-   * 7.6.2 Factories: It is a compile-time error if <i>k</i> is prefixed with the const modifier but
-   * <i>k'</i> is not a constant constructor.
+   * 7.6.2 Factories: It is a compile-time error if <i>k</i> is prefixed with
+   * the const modifier but <i>k'</i> is not a constant constructor.
    */
-  static const CompileTimeErrorCode REDIRECT_TO_MISSING_CONSTRUCTOR = const CompileTimeErrorCode.con1('REDIRECT_TO_MISSING_CONSTRUCTOR', 142, "The constructor '{0}' could not be found in '{1}'");
+  static const CompileTimeErrorCode REDIRECT_TO_MISSING_CONSTRUCTOR = const CompileTimeErrorCode('REDIRECT_TO_MISSING_CONSTRUCTOR', "The constructor '{0}' could not be found in '{1}'");
 
   /**
-   * 7.6.2 Factories: It is a compile-time error if <i>k</i> is prefixed with the const modifier but
-   * <i>k'</i> is not a constant constructor.
+   * 7.6.2 Factories: It is a compile-time error if <i>k</i> is prefixed with
+   * the const modifier but <i>k'</i> is not a constant constructor.
    */
-  static const CompileTimeErrorCode REDIRECT_TO_NON_CLASS = const CompileTimeErrorCode.con1('REDIRECT_TO_NON_CLASS', 143, "The name '{0}' is not a type and cannot be used in a redirected constructor");
+  static const CompileTimeErrorCode REDIRECT_TO_NON_CLASS = const CompileTimeErrorCode('REDIRECT_TO_NON_CLASS', "The name '{0}' is not a type and cannot be used in a redirected constructor");
 
   /**
-   * 7.6.2 Factories: It is a compile-time error if <i>k</i> is prefixed with the const modifier but
-   * <i>k'</i> is not a constant constructor.
+   * 7.6.2 Factories: It is a compile-time error if <i>k</i> is prefixed with
+   * the const modifier but <i>k'</i> is not a constant constructor.
    */
-  static const CompileTimeErrorCode REDIRECT_TO_NON_CONST_CONSTRUCTOR = const CompileTimeErrorCode.con1('REDIRECT_TO_NON_CONST_CONSTRUCTOR', 144, "Constant factory constructor cannot delegate to a non-constant constructor");
+  static const CompileTimeErrorCode REDIRECT_TO_NON_CONST_CONSTRUCTOR = const CompileTimeErrorCode('REDIRECT_TO_NON_CONST_CONSTRUCTOR', "Constant factory constructor cannot delegate to a non-constant constructor");
 
   /**
-   * 7.6.1 Generative constructors: A generative constructor may be <i>redirecting</i>, in which
-   * case its only action is to invoke another generative constructor.
+   * 7.6.1 Generative constructors: A generative constructor may be
+   * <i>redirecting</i>, in which case its only action is to invoke another
+   * generative constructor.
    */
-  static const CompileTimeErrorCode REDIRECT_GENERATIVE_TO_MISSING_CONSTRUCTOR = const CompileTimeErrorCode.con1('REDIRECT_GENERATIVE_TO_MISSING_CONSTRUCTOR', 145, "The constructor '{0}' could not be found in '{1}'");
+  static const CompileTimeErrorCode REDIRECT_GENERATIVE_TO_MISSING_CONSTRUCTOR = const CompileTimeErrorCode('REDIRECT_GENERATIVE_TO_MISSING_CONSTRUCTOR', "The constructor '{0}' could not be found in '{1}'");
 
   /**
-   * 7.6.1 Generative constructors: A generative constructor may be <i>redirecting</i>, in which
-   * case its only action is to invoke another generative constructor.
+   * 7.6.1 Generative constructors: A generative constructor may be
+   * <i>redirecting</i>, in which case its only action is to invoke another
+   * generative constructor.
    */
-  static const CompileTimeErrorCode REDIRECT_GENERATIVE_TO_NON_GENERATIVE_CONSTRUCTOR = const CompileTimeErrorCode.con1('REDIRECT_GENERATIVE_TO_NON_GENERATIVE_CONSTRUCTOR', 146, "Generative constructor cannot redirect to a factory constructor");
+  static const CompileTimeErrorCode REDIRECT_GENERATIVE_TO_NON_GENERATIVE_CONSTRUCTOR = const CompileTimeErrorCode('REDIRECT_GENERATIVE_TO_NON_GENERATIVE_CONSTRUCTOR', "Generative constructor cannot redirect to a factory constructor");
 
   /**
-   * 5 Variables: A local variable may only be referenced at a source code location that is after
-   * its initializer, if any, is complete, or a compile-time error occurs.
+   * 5 Variables: A local variable may only be referenced at a source code
+   * location that is after its initializer, if any, is complete, or a
+   * compile-time error occurs.
    */
-  static const CompileTimeErrorCode REFERENCED_BEFORE_DECLARATION = const CompileTimeErrorCode.con1('REFERENCED_BEFORE_DECLARATION', 147, "Local variables cannot be referenced before they are declared");
+  static const CompileTimeErrorCode REFERENCED_BEFORE_DECLARATION = const CompileTimeErrorCode('REFERENCED_BEFORE_DECLARATION', "Local variables cannot be referenced before they are declared");
 
   /**
-   * 12.8.1 Rethrow: It is a compile-time error if an expression of the form <i>rethrow;</i> is not
-   * enclosed within a on-catch clause.
+   * 12.8.1 Rethrow: It is a compile-time error if an expression of the form
+   * <i>rethrow;</i> is not enclosed within a on-catch clause.
    */
-  static const CompileTimeErrorCode RETHROW_OUTSIDE_CATCH = const CompileTimeErrorCode.con1('RETHROW_OUTSIDE_CATCH', 148, "rethrow must be inside of a catch clause");
+  static const CompileTimeErrorCode RETHROW_OUTSIDE_CATCH = const CompileTimeErrorCode('RETHROW_OUTSIDE_CATCH', "rethrow must be inside of a catch clause");
 
   /**
-   * 13.12 Return: It is a compile-time error if a return statement of the form <i>return e;</i>
-   * appears in a generative constructor.
+   * 13.12 Return: It is a compile-time error if a return statement of the form
+   * <i>return e;</i> appears in a generative constructor.
    */
-  static const CompileTimeErrorCode RETURN_IN_GENERATIVE_CONSTRUCTOR = const CompileTimeErrorCode.con1('RETURN_IN_GENERATIVE_CONSTRUCTOR', 149, "Constructors cannot return a value");
+  static const CompileTimeErrorCode RETURN_IN_GENERATIVE_CONSTRUCTOR = const CompileTimeErrorCode('RETURN_IN_GENERATIVE_CONSTRUCTOR', "Constructors cannot return a value");
 
   /**
-   * 13.12 Return: It is a compile-time error if a return statement of the form <i>return e;</i>
-   * appears in a generator function.
+   * 13.12 Return: It is a compile-time error if a return statement of the form
+   * <i>return e;</i> appears in a generator function.
    */
-  static const CompileTimeErrorCode RETURN_IN_GENERATOR = const CompileTimeErrorCode.con1('RETURN_IN_GENERATOR', 150, "Cannot return a value from a generator function (one marked with either 'async*' or 'sync*')");
+  static const CompileTimeErrorCode RETURN_IN_GENERATOR = const CompileTimeErrorCode('RETURN_IN_GENERATOR', "Cannot return a value from a generator function (one marked with either 'async*' or 'sync*')");
 
   /**
-   * 14.1 Imports: It is a compile-time error if a prefix used in a deferred import is used in
-   * another import clause.
+   * 14.1 Imports: It is a compile-time error if a prefix used in a deferred
+   * import is used in another import clause.
    */
-  static const CompileTimeErrorCode SHARED_DEFERRED_PREFIX = const CompileTimeErrorCode.con1('SHARED_DEFERRED_PREFIX', 151, "The prefix of a deferred import cannot be used in other import directives");
+  static const CompileTimeErrorCode SHARED_DEFERRED_PREFIX = const CompileTimeErrorCode('SHARED_DEFERRED_PREFIX', "The prefix of a deferred import cannot be used in other import directives");
 
   /**
    * 12.15.4 Super Invocation: A super method invocation <i>i</i> has the form
-   * <i>super.m(a<sub>1</sub>, &hellip;, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</sub>, &hellip;
-   * x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. It is a compile-time error if a super method invocation
-   * occurs in a top-level function or variable initializer, in an instance variable initializer or
-   * initializer list, in class Object, in a factory constructor, or in a static method or variable
-   * initializer.
+   * <i>super.m(a<sub>1</sub>, &hellip;, a<sub>n</sub>, x<sub>n+1</sub>:
+   * a<sub>n+1</sub>, &hellip; x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. It is a
+   * compile-time error if a super method invocation occurs in a top-level
+   * function or variable initializer, in an instance variable initializer or
+   * initializer list, in class Object, in a factory constructor, or in a static
+   * method or variable initializer.
    */
-  static const CompileTimeErrorCode SUPER_IN_INVALID_CONTEXT = const CompileTimeErrorCode.con1('SUPER_IN_INVALID_CONTEXT', 152, "Invalid context for 'super' invocation");
+  static const CompileTimeErrorCode SUPER_IN_INVALID_CONTEXT = const CompileTimeErrorCode('SUPER_IN_INVALID_CONTEXT', "Invalid context for 'super' invocation");
 
   /**
-   * 7.6.1 Generative Constructors: A generative constructor may be redirecting, in which case its
-   * only action is to invoke another generative constructor.
+   * 7.6.1 Generative Constructors: A generative constructor may be redirecting,
+   * in which case its only action is to invoke another generative constructor.
    */
-  static const CompileTimeErrorCode SUPER_IN_REDIRECTING_CONSTRUCTOR = const CompileTimeErrorCode.con1('SUPER_IN_REDIRECTING_CONSTRUCTOR', 153, "The redirecting constructor cannot have a 'super' initializer");
+  static const CompileTimeErrorCode SUPER_IN_REDIRECTING_CONSTRUCTOR = const CompileTimeErrorCode('SUPER_IN_REDIRECTING_CONSTRUCTOR', "The redirecting constructor cannot have a 'super' initializer");
 
   /**
-   * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It is a compile-time
-   * error if a generative constructor of class Object includes a superinitializer.
+   * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It
+   * is a compile-time error if a generative constructor of class Object
+   * includes a superinitializer.
    */
-  static const CompileTimeErrorCode SUPER_INITIALIZER_IN_OBJECT = const CompileTimeErrorCode.con1('SUPER_INITIALIZER_IN_OBJECT', 154, "");
+  static const CompileTimeErrorCode SUPER_INITIALIZER_IN_OBJECT = const CompileTimeErrorCode('SUPER_INITIALIZER_IN_OBJECT', "");
 
   /**
-   * 12.11 Instance Creation: It is a static type warning if any of the type arguments to a
-   * constructor of a generic type <i>G</i> invoked by a new expression or a constant object
-   * expression are not subtypes of the bounds of the corresponding formal type parameters of
-   * <i>G</i>.
+   * 12.11 Instance Creation: It is a static type warning if any of the type
+   * arguments to a constructor of a generic type <i>G</i> invoked by a new
+   * expression or a constant object expression are not subtypes of the bounds
+   * of the corresponding formal type parameters of <i>G</i>.
    *
-   * 12.11.1 New: If T is malformed a dynamic error occurs. In checked mode, if T is mal-bounded a
-   * dynamic error occurs.
+   * 12.11.1 New: If T is malformed a dynamic error occurs. In checked mode, if
+   * T is mal-bounded a dynamic error occurs.
    *
-   * 12.1 Constants: It is a compile-time error if evaluation of a compile-time constant would raise
-   * an exception.
+   * 12.1 Constants: It is a compile-time error if evaluation of a compile-time
+   * constant would raise an exception.
    *
-   * @param boundedTypeName the name of the type used in the instance creation that should be
-   *          limited by the bound as specified in the class declaration
+   * @param boundedTypeName the name of the type used in the instance creation
+   *        that should be limited by the bound as specified in the class
+   *        declaration
    * @param boundingTypeName the name of the bounding type
-   * @see StaticTypeWarningCode#TYPE_ARGUMENT_NOT_MATCHING_BOUNDS
+   * See [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS].
    */
-  static const CompileTimeErrorCode TYPE_ARGUMENT_NOT_MATCHING_BOUNDS = const CompileTimeErrorCode.con1('TYPE_ARGUMENT_NOT_MATCHING_BOUNDS', 155, "'{0}' does not extend '{1}'");
+  static const CompileTimeErrorCode TYPE_ARGUMENT_NOT_MATCHING_BOUNDS = const CompileTimeErrorCode('TYPE_ARGUMENT_NOT_MATCHING_BOUNDS', "'{0}' does not extend '{1}'");
 
   /**
-   * 15.3.1 Typedef: Any self reference, either directly, or recursively via another typedef, is a
-   * compile time error.
+   * 15.3.1 Typedef: Any self reference, either directly, or recursively via
+   * another typedef, is a compile time error.
    */
-  static const CompileTimeErrorCode TYPE_ALIAS_CANNOT_REFERENCE_ITSELF = const CompileTimeErrorCode.con1('TYPE_ALIAS_CANNOT_REFERENCE_ITSELF', 156, "Type alias cannot reference itself directly or recursively via another typedef");
+  static const CompileTimeErrorCode TYPE_ALIAS_CANNOT_REFERENCE_ITSELF = const CompileTimeErrorCode('TYPE_ALIAS_CANNOT_REFERENCE_ITSELF', "Type alias cannot reference itself directly or recursively via another typedef");
 
   /**
-   * 12.11.2 Const: It is a compile-time error if <i>T</i> is not a class accessible in the current
-   * scope, optionally followed by type arguments.
+   * 12.11.2 Const: It is a compile-time error if <i>T</i> is not a class
+   * accessible in the current scope, optionally followed by type arguments.
    */
-  static const CompileTimeErrorCode UNDEFINED_CLASS = const CompileTimeErrorCode.con1('UNDEFINED_CLASS', 157, "Undefined class '{0}'");
+  static const CompileTimeErrorCode UNDEFINED_CLASS = const CompileTimeErrorCode('UNDEFINED_CLASS', "Undefined class '{0}'");
 
   /**
-   * 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the superinitializer appears
-   * and let <i>S</i> be the superclass of <i>C</i>. Let <i>k</i> be a generative constructor. It is
-   * a compile-time error if class <i>S</i> does not declare a generative constructor named <i>S</i>
+   * 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the
+   * superinitializer appears and let <i>S</i> be the superclass of <i>C</i>.
+   * Let <i>k</i> be a generative constructor. It is a compile-time error if
+   * class <i>S</i> does not declare a generative constructor named <i>S</i>
    * (respectively <i>S.id</i>)
    */
-  static const CompileTimeErrorCode UNDEFINED_CONSTRUCTOR_IN_INITIALIZER = const CompileTimeErrorCode.con1('UNDEFINED_CONSTRUCTOR_IN_INITIALIZER', 158, "The class '{0}' does not have a generative constructor '{1}'");
+  static const CompileTimeErrorCode UNDEFINED_CONSTRUCTOR_IN_INITIALIZER = const CompileTimeErrorCode('UNDEFINED_CONSTRUCTOR_IN_INITIALIZER', "The class '{0}' does not have a generative constructor '{1}'");
 
   /**
-   * 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the superinitializer appears
-   * and let <i>S</i> be the superclass of <i>C</i>. Let <i>k</i> be a generative constructor. It is
-   * a compile-time error if class <i>S</i> does not declare a generative constructor named <i>S</i>
+   * 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the
+   * superinitializer appears and let <i>S</i> be the superclass of <i>C</i>.
+   * Let <i>k</i> be a generative constructor. It is a compile-time error if
+   * class <i>S</i> does not declare a generative constructor named <i>S</i>
    * (respectively <i>S.id</i>)
    */
-  static const CompileTimeErrorCode UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT = const CompileTimeErrorCode.con1('UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT', 159, "The class '{0}' does not have a default generative constructor");
+  static const CompileTimeErrorCode UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT = const CompileTimeErrorCode('UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT', "The class '{0}' does not have a default generative constructor");
 
   /**
-   * 12.14.2 Binding Actuals to Formals: Furthermore, each <i>q<sub>i</sub></i>, <i>1<=i<=l</i>,
-   * must have a corresponding named parameter in the set {<i>p<sub>n+1</sub></i> ...
-   * <i>p<sub>n+k</sub></i>} or a static warning occurs.
+   * 12.14.2 Binding Actuals to Formals: Furthermore, each <i>q<sub>i</sub></i>,
+   * <i>1<=i<=l</i>, must have a corresponding named parameter in the set
+   * {<i>p<sub>n+1</sub></i> ... <i>p<sub>n+k</sub></i>} or a static warning
+   * occurs.
    *
-   * 12.11.2 Const: It is a compile-time error if evaluation of a constant object results in an
-   * uncaught exception being thrown.
+   * 12.11.2 Const: It is a compile-time error if evaluation of a constant
+   * object results in an uncaught exception being thrown.
    *
    * @param name the name of the requested named parameter
    */
-  static const CompileTimeErrorCode UNDEFINED_NAMED_PARAMETER = const CompileTimeErrorCode.con1('UNDEFINED_NAMED_PARAMETER', 160, "The named parameter '{0}' is not defined");
+  static const CompileTimeErrorCode UNDEFINED_NAMED_PARAMETER = const CompileTimeErrorCode('UNDEFINED_NAMED_PARAMETER', "The named parameter '{0}' is not defined");
 
   /**
-   * 14.2 Exports: It is a compile-time error if the compilation unit found at the specified URI is
-   * not a library declaration.
+   * 14.2 Exports: It is a compile-time error if the compilation unit found at
+   * the specified URI is not a library declaration.
    *
-   * 14.1 Imports: It is a compile-time error if the compilation unit found at the specified URI is
-   * not a library declaration.
+   * 14.1 Imports: It is a compile-time error if the compilation unit found at
+   * the specified URI is not a library declaration.
    *
-   * 14.3 Parts: It is a compile time error if the contents of the URI are not a valid part
-   * declaration.
+   * 14.3 Parts: It is a compile time error if the contents of the URI are not a
+   * valid part declaration.
    *
    * @param uri the URI pointing to a non-existent file
-   * @see #INVALID_URI
+   * See [INVALID_URI].
    */
-  static const CompileTimeErrorCode URI_DOES_NOT_EXIST = const CompileTimeErrorCode.con1('URI_DOES_NOT_EXIST', 161, "Target of URI does not exist: '{0}'");
+  static const CompileTimeErrorCode URI_DOES_NOT_EXIST = const CompileTimeErrorCode('URI_DOES_NOT_EXIST', "Target of URI does not exist: '{0}'");
 
   /**
-   * 14.1 Imports: It is a compile-time error if <i>x</i> is not a compile-time constant, or if
-   * <i>x</i> involves string interpolation.
+   * 14.1 Imports: It is a compile-time error if <i>x</i> is not a compile-time
+   * constant, or if <i>x</i> involves string interpolation.
    *
-   * 14.3 Parts: It is a compile-time error if <i>s</i> is not a compile-time constant, or if
-   * <i>s</i> involves string interpolation.
+   * 14.3 Parts: It is a compile-time error if <i>s</i> is not a compile-time
+   * constant, or if <i>s</i> involves string interpolation.
    *
-   * 14.5 URIs: It is a compile-time error if the string literal <i>x</i> that describes a URI is
-   * not a compile-time constant, or if <i>x</i> involves string interpolation.
+   * 14.5 URIs: It is a compile-time error if the string literal <i>x</i> that
+   * describes a URI is not a compile-time constant, or if <i>x</i> involves
+   * string interpolation.
    */
-  static const CompileTimeErrorCode URI_WITH_INTERPOLATION = const CompileTimeErrorCode.con1('URI_WITH_INTERPOLATION', 162, "URIs cannot use string interpolation");
+  static const CompileTimeErrorCode URI_WITH_INTERPOLATION = const CompileTimeErrorCode('URI_WITH_INTERPOLATION', "URIs cannot use string interpolation");
 
   /**
-   * 7.1.1 Operators: It is a compile-time error if the arity of the user-declared operator []= is
-   * not 2. It is a compile time error if the arity of a user-declared operator with one of the
-   * names: &lt;, &gt;, &lt;=, &gt;=, ==, +, /, ~/, *, %, |, ^, &, &lt;&lt;, &gt;&gt;, [] is not 1.
-   * It is a compile time error if the arity of the user-declared operator - is not 0 or 1. It is a
-   * compile time error if the arity of the user-declared operator ~ is not 0.
+   * 7.1.1 Operators: It is a compile-time error if the arity of the
+   * user-declared operator []= is not 2. It is a compile time error if the
+   * arity of a user-declared operator with one of the names: &lt;, &gt;, &lt;=,
+   * &gt;=, ==, +, /, ~/, *, %, |, ^, &, &lt;&lt;, &gt;&gt;, [] is not 1. It is
+   * a compile time error if the arity of the user-declared operator - is not 0
+   * or 1. It is a compile time error if the arity of the user-declared operator
+   * ~ is not 0.
    *
    * @param operatorName the name of the declared operator
    * @param expectedNumberOfParameters the number of parameters expected
-   * @param actualNumberOfParameters the number of parameters found in the operator declaration
+   * @param actualNumberOfParameters the number of parameters found in the
+   *        operator declaration
    */
-  static const CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR = const CompileTimeErrorCode.con1('WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR', 163, "Operator '{0}' should declare exactly {1} parameter(s), but {2} found");
+  static const CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR = const CompileTimeErrorCode('WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR', "Operator '{0}' should declare exactly {1} parameter(s), but {2} found");
 
   /**
-   * 7.1.1 Operators: It is a compile time error if the arity of the user-declared operator - is not
-   * 0 or 1.
+   * 7.1.1 Operators: It is a compile time error if the arity of the
+   * user-declared operator - is not 0 or 1.
    *
-   * @param actualNumberOfParameters the number of parameters found in the operator declaration
+   * @param actualNumberOfParameters the number of parameters found in the
+   *        operator declaration
    */
-  static const CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINUS = const CompileTimeErrorCode.con1('WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINUS', 164, "Operator '-' should declare 0 or 1 parameter, but {0} found");
+  static const CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINUS = const CompileTimeErrorCode('WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINUS', "Operator '-' should declare 0 or 1 parameter, but {0} found");
 
   /**
-   * 7.3 Setters: It is a compile-time error if a setter's formal parameter list does not include
-   * exactly one required formal parameter <i>p</i>.
+   * 7.3 Setters: It is a compile-time error if a setter's formal parameter list
+   * does not include exactly one required formal parameter <i>p</i>.
    */
-  static const CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER = const CompileTimeErrorCode.con1('WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER', 165, "Setters should declare exactly one required parameter");
+  static const CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER = const CompileTimeErrorCode('WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER', "Setters should declare exactly one required parameter");
 
   /**
-   * ?? Yield: It is a compile-time error if a yield statement appears in a function that is not a
-   * generator function.
+   * ?? Yield: It is a compile-time error if a yield statement appears in a
+   * function that is not a generator function.
    */
-  static const CompileTimeErrorCode YIELD_EACH_IN_NON_GENERATOR = const CompileTimeErrorCode.con1('YIELD_EACH_IN_NON_GENERATOR', 166, "Yield-each statements must be in a generator function (one marked with either 'async*' or 'sync*')");
+  static const CompileTimeErrorCode YIELD_EACH_IN_NON_GENERATOR = const CompileTimeErrorCode('YIELD_EACH_IN_NON_GENERATOR', "Yield-each statements must be in a generator function (one marked with either 'async*' or 'sync*')");
 
   /**
-   * ?? Yield: It is a compile-time error if a yield statement appears in a function that is not a
-   * generator function.
+   * ?? Yield: It is a compile-time error if a yield statement appears in a
+   * function that is not a generator function.
    */
-  static const CompileTimeErrorCode YIELD_IN_NON_GENERATOR = const CompileTimeErrorCode.con1('YIELD_IN_NON_GENERATOR', 167, "Yield statements must be in a generator function (one marked with either 'async*' or 'sync*')");
-
-  static const List<CompileTimeErrorCode> values = const [
-      ACCESS_PRIVATE_ENUM_FIELD,
-      AMBIGUOUS_EXPORT,
-      ARGUMENT_DEFINITION_TEST_NON_PARAMETER,
-      ASYNC_FOR_IN_WRONG_CONTEXT,
-      AWAIT_IN_WRONG_CONTEXT,
-      BUILT_IN_IDENTIFIER_AS_TYPE,
-      BUILT_IN_IDENTIFIER_AS_TYPE_NAME,
-      BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME,
-      BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME,
-      CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS,
-      COMPILE_TIME_CONSTANT_RAISES_EXCEPTION,
-      CONFLICTING_GETTER_AND_METHOD,
-      CONFLICTING_METHOD_AND_GETTER,
-      CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD,
-      CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD,
-      CONFLICTING_TYPE_VARIABLE_AND_CLASS,
-      CONFLICTING_TYPE_VARIABLE_AND_MEMBER,
-      CONST_CONSTRUCTOR_THROWS_EXCEPTION,
-      CONST_CONSTRUCTOR_WITH_FIELD_INITIALIZED_BY_NON_CONST,
-      CONST_CONSTRUCTOR_WITH_MIXIN,
-      CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER,
-      CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD,
-      CONST_DEFERRED_CLASS,
-      CONST_FORMAL_PARAMETER,
-      CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE,
-      CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE_FROM_DEFERRED_LIBRARY,
-      CONST_INSTANCE_FIELD,
-      CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQUALS,
-      CONST_NOT_INITIALIZED,
-      CONST_EVAL_TYPE_BOOL,
-      CONST_EVAL_TYPE_BOOL_NUM_STRING,
-      CONST_EVAL_TYPE_INT,
-      CONST_EVAL_TYPE_NUM,
-      CONST_EVAL_THROWS_EXCEPTION,
-      CONST_EVAL_THROWS_IDBZE,
-      CONST_WITH_INVALID_TYPE_PARAMETERS,
-      CONST_WITH_NON_CONST,
-      CONST_WITH_NON_CONSTANT_ARGUMENT,
-      CONST_WITH_NON_TYPE,
-      CONST_WITH_TYPE_PARAMETERS,
-      CONST_WITH_UNDEFINED_CONSTRUCTOR,
-      CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT,
-      DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS,
-      DEFAULT_VALUE_IN_FUNCTION_TYPED_PARAMETER,
-      DEFAULT_VALUE_IN_REDIRECTING_FACTORY_CONSTRUCTOR,
-      DUPLICATE_CONSTRUCTOR_DEFAULT,
-      DUPLICATE_CONSTRUCTOR_NAME,
-      DUPLICATE_DEFINITION,
-      DUPLICATE_DEFINITION_INHERITANCE,
-      DUPLICATE_NAMED_ARGUMENT,
-      EXPORT_INTERNAL_LIBRARY,
-      EXPORT_OF_NON_LIBRARY,
-      EXTENDS_ENUM,
-      EXTENDS_NON_CLASS,
-      EXTENDS_DISALLOWED_CLASS,
-      EXTENDS_DEFERRED_CLASS,
-      EXTRA_POSITIONAL_ARGUMENTS,
-      FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS,
-      FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER,
-      FINAL_INITIALIZED_MULTIPLE_TIMES,
-      FIELD_INITIALIZER_FACTORY_CONSTRUCTOR,
-      FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR,
-      FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR,
-      GETTER_AND_METHOD_WITH_SAME_NAME,
-      IMPLEMENTS_DEFERRED_CLASS,
-      IMPLEMENTS_DISALLOWED_CLASS,
-      IMPLEMENTS_DYNAMIC,
-      IMPLEMENTS_ENUM,
-      IMPLEMENTS_NON_CLASS,
-      IMPLEMENTS_REPEATED,
-      IMPLEMENTS_SUPER_CLASS,
-      IMPLICIT_THIS_REFERENCE_IN_INITIALIZER,
-      IMPORT_INTERNAL_LIBRARY,
-      IMPORT_OF_NON_LIBRARY,
-      INCONSISTENT_CASE_EXPRESSION_TYPES,
-      INITIALIZER_FOR_NON_EXISTENT_FIELD,
-      INITIALIZER_FOR_STATIC_FIELD,
-      INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD,
-      INITIALIZING_FORMAL_FOR_STATIC_FIELD,
-      INSTANCE_MEMBER_ACCESS_FROM_FACTORY,
-      INSTANCE_MEMBER_ACCESS_FROM_STATIC,
-      INSTANTIATE_ENUM,
-      INVALID_ANNOTATION,
-      INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY,
-      INVALID_IDENTIFIER_IN_ASYNC,
-      INVALID_MODIFIER_ON_CONSTRUCTOR,
-      INVALID_MODIFIER_ON_SETTER,
-      INVALID_CONSTANT,
-      INVALID_CONSTRUCTOR_NAME,
-      INVALID_FACTORY_NAME_NOT_A_CLASS,
-      INVALID_REFERENCE_TO_THIS,
-      INVALID_TYPE_ARGUMENT_IN_CONST_LIST,
-      INVALID_TYPE_ARGUMENT_IN_CONST_MAP,
-      INVALID_URI,
-      LABEL_IN_OUTER_SCOPE,
-      LABEL_UNDEFINED,
-      MEMBER_WITH_CLASS_NAME,
-      METHOD_AND_GETTER_WITH_SAME_NAME,
-      MISSING_CONST_IN_LIST_LITERAL,
-      MISSING_CONST_IN_MAP_LITERAL,
-      MISSING_ENUM_CONSTANT_IN_SWITCH,
-      MIXIN_DECLARES_CONSTRUCTOR,
-      MIXIN_DEFERRED_CLASS,
-      MIXIN_INHERITS_FROM_NOT_OBJECT,
-      MIXIN_OF_DISALLOWED_CLASS,
-      MIXIN_OF_ENUM,
-      MIXIN_OF_NON_CLASS,
-      MIXIN_REFERENCES_SUPER,
-      MIXIN_WITH_NON_CLASS_SUPERCLASS,
-      MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS,
-      MULTIPLE_SUPER_INITIALIZERS,
-      NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS,
-      NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT,
-      NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT,
-      NON_CONST_MAP_AS_EXPRESSION_STATEMENT,
-      NON_CONSTANT_CASE_EXPRESSION,
-      NON_CONSTANT_CASE_EXPRESSION_FROM_DEFERRED_LIBRARY,
-      NON_CONSTANT_DEFAULT_VALUE,
-      NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED_LIBRARY,
-      NON_CONSTANT_LIST_ELEMENT,
-      NON_CONSTANT_LIST_ELEMENT_FROM_DEFERRED_LIBRARY,
-      NON_CONSTANT_MAP_KEY,
-      NON_CONSTANT_MAP_KEY_FROM_DEFERRED_LIBRARY,
-      NON_CONSTANT_MAP_VALUE,
-      NON_CONSTANT_MAP_VALUE_FROM_DEFERRED_LIBRARY,
-      NON_CONSTANT_ANNOTATION_CONSTRUCTOR,
-      NON_CONSTANT_VALUE_IN_INITIALIZER,
-      NON_CONSTANT_VALUE_IN_INITIALIZER_FROM_DEFERRED_LIBRARY,
-      NOT_ENOUGH_REQUIRED_ARGUMENTS,
-      NON_GENERATIVE_CONSTRUCTOR,
-      OBJECT_CANNOT_EXTEND_ANOTHER_CLASS,
-      OPTIONAL_PARAMETER_IN_OPERATOR,
-      PART_OF_NON_PART,
-      PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER,
-      PRIVATE_OPTIONAL_PARAMETER,
-      RECURSIVE_COMPILE_TIME_CONSTANT,
-      RECURSIVE_CONSTRUCTOR_REDIRECT,
-      RECURSIVE_FACTORY_REDIRECT,
-      RECURSIVE_INTERFACE_INHERITANCE,
-      RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_EXTENDS,
-      RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_IMPLEMENTS,
-      RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_WITH,
-      REDIRECT_TO_MISSING_CONSTRUCTOR,
-      REDIRECT_TO_NON_CLASS,
-      REDIRECT_TO_NON_CONST_CONSTRUCTOR,
-      REDIRECT_GENERATIVE_TO_MISSING_CONSTRUCTOR,
-      REDIRECT_GENERATIVE_TO_NON_GENERATIVE_CONSTRUCTOR,
-      REFERENCED_BEFORE_DECLARATION,
-      RETHROW_OUTSIDE_CATCH,
-      RETURN_IN_GENERATIVE_CONSTRUCTOR,
-      RETURN_IN_GENERATOR,
-      SHARED_DEFERRED_PREFIX,
-      SUPER_IN_INVALID_CONTEXT,
-      SUPER_IN_REDIRECTING_CONSTRUCTOR,
-      SUPER_INITIALIZER_IN_OBJECT,
-      TYPE_ARGUMENT_NOT_MATCHING_BOUNDS,
-      TYPE_ALIAS_CANNOT_REFERENCE_ITSELF,
-      UNDEFINED_CLASS,
-      UNDEFINED_CONSTRUCTOR_IN_INITIALIZER,
-      UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT,
-      UNDEFINED_NAMED_PARAMETER,
-      URI_DOES_NOT_EXIST,
-      URI_WITH_INTERPOLATION,
-      WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR,
-      WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINUS,
-      WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER,
-      YIELD_EACH_IN_NON_GENERATOR,
-      YIELD_IN_NON_GENERATOR];
+  static const CompileTimeErrorCode YIELD_IN_NON_GENERATOR = const CompileTimeErrorCode('YIELD_IN_NON_GENERATOR', "Yield statements must be in a generator function (one marked with either 'async*' or 'sync*')");
 
   /**
-   * The template used to create the message to be displayed for this error.
+   * Initialize a newly created error code to have the given [name]. The message
+   * associated with the error will be created from the given [message]
+   * template. The correction associated with the error will be created from the
+   * given [correction] template.
    */
-  final String message;
-
-  /**
-   * The template used to create the correction to be displayed for this error, or `null` if
-   * there is no correction information for this error.
-   */
-  final String correction;
-
-  /**
-   * Initialize a newly created error code to have the given message.
-   *
-   * @param message the message template used to create the message to be displayed for the error
-   */
-  const CompileTimeErrorCode.con1(String name, int ordinal, String message) : this.con2(name, ordinal, message, null);
-
-  /**
-   * Initialize a newly created error code to have the given message and correction.
-   *
-   * @param message the template used to create the message to be displayed for the error
-   * @param correction the template used to create the correction to be displayed for the error
-   */
-  const CompileTimeErrorCode.con2(String name, int ordinal, this.message, this.correction) : super(name, ordinal);
+  const CompileTimeErrorCode(String name, String message, [String correction]) : super(name, message, correction);
 
   @override
   ErrorSeverity get errorSeverity => ErrorType.COMPILE_TIME_ERROR.severity;
 
   @override
   ErrorType get type => ErrorType.COMPILE_TIME_ERROR;
-
-  @override
-  String get uniqueName => "$runtimeType.$name";
 }
 
 /**
- * The interface `ErrorCode` defines the behavior common to objects representing error codes
- * associated with [AnalysisError].
+ * An `ErrorCode` represents an error code associated with an [AnalysisError].
  *
- * Generally, we want to provide messages that consist of three sentences: 1. what is wrong, 2. why
- * is it wrong, and 3. how do I fix it. However, we combine the first two in the result of
- * [getMessage] and the last in the result of [getCorrection].
+ * Generally, we want to provide messages that consist of three sentences. From
+ * the user's perspective these sentences should explain:
+ * 1. what is wrong,
+ * 2. why is it wrong, and
+ * 3. how do I fix it.
+ * However, we combine the first two in the [message] and the last in the
+ * [correction].
  */
 abstract class ErrorCode {
   /**
-   * Return the template used to create the correction to be displayed for this error, or
-   * `null` if there is no correction information for this error. The correction should
-   * indicate how the user can fix the error.
-   *
-   * @return the template used to create the correction to be displayed for this error
+   * The name of the error code.
    */
-  String get correction;
+  final String name;
 
   /**
-   * Return the severity of this error.
-   *
-   * @return the severity of this error
+   * The template used to create the message to be displayed for this error. The
+   * message should indicate what is wrong and why it is wrong.
+   */
+  final String message;
+
+  /**
+   * The template used to create the correction to be displayed for this error,
+   * or `null` if there is no correction information for this error. The
+   * correction should indicate how the user can fix the error.
+   */
+  final String correction;
+
+  /**
+   * An empty list of error codes.
+   */
+  static const List<ErrorCode> EMPTY_LIST = const <ErrorCode>[];
+
+  /**
+   * Initialize a newly created error code to have the given [name]. The message
+   * associated with the error will be created from the given [message]
+   * template. The correction associated with the error will be created from the
+   * given [correction] template.
+   */
+  const ErrorCode(this.name, this.message, [this.correction]);
+
+  /**
+   * The severity of the error.
    */
   ErrorSeverity get errorSeverity;
 
   /**
-   * Return the template used to create the message to be displayed for this error. The message
-   * should indicate what is wrong and why it is wrong.
-   *
-   * @return the template used to create the message to be displayed for this error
-   */
-  String get message;
-
-  /**
-   * Return the type of the error.
-   *
-   * @return the type of the error
+   * The type of the error.
    */
   ErrorType get type;
 
   /**
-   * Return a unique name for this error code.
-   *
-   * @return a unique name for this error code
+   * The unique name of this error code.
    */
-  String get uniqueName;
+  String get uniqueName => "$runtimeType.$name";
 }
 
 /**
@@ -2233,7 +2177,7 @@
    * @param node the node specifying the location of the error
    * @param arguments the arguments to the error, used to compose the error message
    */
-  void reportErrorForNode(ErrorCode errorCode, AstNode node, List<Object> arguments) {
+  void reportErrorForNode(ErrorCode errorCode, AstNode node, [List<Object> arguments]) {
     reportErrorForOffset(errorCode, node.offset, node.length, arguments);
   }
 
@@ -2245,7 +2189,7 @@
    * @param length the length of the location of the error
    * @param arguments the arguments to the error, used to compose the error message
    */
-  void reportErrorForOffset(ErrorCode errorCode, int offset, int length, List<Object> arguments) {
+  void reportErrorForOffset(ErrorCode errorCode, int offset, int length, [List<Object> arguments]) {
     _errorListener.onError(new AnalysisError.con2(_source, offset, length, errorCode, arguments));
   }
 
@@ -2256,7 +2200,7 @@
    * @param token the token specifying the location of the error
    * @param arguments the arguments to the error, used to compose the error message
    */
-  void reportErrorForToken(ErrorCode errorCode, Token token, List<Object> arguments) {
+  void reportErrorForToken(ErrorCode errorCode, Token token, [List<Object> arguments]) {
     reportErrorForOffset(errorCode, token.offset, token.length, arguments);
   }
 
@@ -2478,1714 +2422,1637 @@
 }
 
 /**
- * The enumeration `HintCode` defines the hints and coding recommendations for best practices
- * which are not mentioned in the Dart Language Specification.
+ * The class `HintCode` defines the hints and coding recommendations for best
+ * practices which are not mentioned in the Dart Language Specification.
  */
-class HintCode extends Enum<HintCode> implements ErrorCode {
+class HintCode extends ErrorCode {
   /**
    * This hint is generated anywhere where the
-   * [StaticWarningCode#ARGUMENT_TYPE_NOT_ASSIGNABLE] would have been generated, if we used
-   * propagated information for the warnings.
+   * [StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE] would have been generated,
+   * if we used propagated information for the warnings.
    *
    * @param actualType the name of the actual argument type
    * @param expectedType the name of the expected type
-   * @see StaticWarningCode#ARGUMENT_TYPE_NOT_ASSIGNABLE
    */
-  static const HintCode ARGUMENT_TYPE_NOT_ASSIGNABLE = const HintCode.con1('ARGUMENT_TYPE_NOT_ASSIGNABLE', 0, "The argument type '{0}' cannot be assigned to the parameter type '{1}'");
+  static const HintCode ARGUMENT_TYPE_NOT_ASSIGNABLE = const HintCode('ARGUMENT_TYPE_NOT_ASSIGNABLE', "The argument type '{0}' cannot be assigned to the parameter type '{1}'");
 
   /**
-   * Dead code is code that is never reached, this can happen for instance if a statement follows a
-   * return statement.
+   * Dead code is code that is never reached, this can happen for instance if a
+   * statement follows a return statement.
    */
-  static const HintCode DEAD_CODE = const HintCode.con1('DEAD_CODE', 1, "Dead code");
+  static const HintCode DEAD_CODE = const HintCode('DEAD_CODE', "Dead code");
 
   /**
-   * Dead code is code that is never reached. This case covers cases where the user has catch
-   * clauses after `catch (e)` or `on Object catch (e)`.
+   * Dead code is code that is never reached. This case covers cases where the
+   * user has catch clauses after `catch (e)` or `on Object catch (e)`.
    */
-  static const HintCode DEAD_CODE_CATCH_FOLLOWING_CATCH = const HintCode.con1('DEAD_CODE_CATCH_FOLLOWING_CATCH', 2, "Dead code, catch clauses after a 'catch (e)' or an 'on Object catch (e)' are never reached");
+  static const HintCode DEAD_CODE_CATCH_FOLLOWING_CATCH = const HintCode('DEAD_CODE_CATCH_FOLLOWING_CATCH', "Dead code, catch clauses after a 'catch (e)' or an 'on Object catch (e)' are never reached");
 
   /**
-   * Dead code is code that is never reached. This case covers cases where the user has an on-catch
-   * clause such as `on A catch (e)`, where a supertype of `A` was already caught.
+   * Dead code is code that is never reached. This case covers cases where the
+   * user has an on-catch clause such as `on A catch (e)`, where a supertype of
+   * `A` was already caught.
    *
    * @param subtypeName name of the subtype
    * @param supertypeName name of the supertype
    */
-  static const HintCode DEAD_CODE_ON_CATCH_SUBTYPE = const HintCode.con1('DEAD_CODE_ON_CATCH_SUBTYPE', 3, "Dead code, this on-catch block will never be executed since '{0}' is a subtype of '{1}'");
+  static const HintCode DEAD_CODE_ON_CATCH_SUBTYPE = const HintCode('DEAD_CODE_ON_CATCH_SUBTYPE', "Dead code, this on-catch block will never be executed since '{0}' is a subtype of '{1}'");
 
   /**
    * Deprecated members should not be invoked or used.
    *
    * @param memberName the name of the member
    */
-  static const HintCode DEPRECATED_MEMBER_USE = const HintCode.con1('DEPRECATED_MEMBER_USE', 4, "'{0}' is deprecated");
+  static const HintCode DEPRECATED_MEMBER_USE = const HintCode('DEPRECATED_MEMBER_USE', "'{0}' is deprecated");
 
   /**
    * Duplicate imports.
    */
-  static const HintCode DUPLICATE_IMPORT = const HintCode.con1('DUPLICATE_IMPORT', 5, "Duplicate import");
+  static const HintCode DUPLICATE_IMPORT = const HintCode('DUPLICATE_IMPORT', "Duplicate import");
 
   /**
    * Hint to use the ~/ operator.
    */
-  static const HintCode DIVISION_OPTIMIZATION = const HintCode.con1('DIVISION_OPTIMIZATION', 6, "The operator x ~/ y is more efficient than (x / y).toInt()");
+  static const HintCode DIVISION_OPTIMIZATION = const HintCode('DIVISION_OPTIMIZATION', "The operator x ~/ y is more efficient than (x / y).toInt()");
 
   /**
    * Hint for the `x is double` type checks.
    */
-  static const HintCode IS_DOUBLE = const HintCode.con1('IS_DOUBLE', 7, "When compiled to JS, this test might return true when the left hand side is an int");
+  static const HintCode IS_DOUBLE = const HintCode('IS_DOUBLE', "When compiled to JS, this test might return true when the left hand side is an int");
 
   /**
    * Hint for the `x is int` type checks.
    */
-  static const HintCode IS_INT = const HintCode.con1('IS_INT', 8, "When compiled to JS, this test might return true when the left hand side is a double");
+  static const HintCode IS_INT = const HintCode('IS_INT', "When compiled to JS, this test might return true when the left hand side is a double");
 
   /**
    * Hint for the `x is! double` type checks.
    */
-  static const HintCode IS_NOT_DOUBLE = const HintCode.con1('IS_NOT_DOUBLE', 9, "When compiled to JS, this test might return false when the left hand side is an int");
+  static const HintCode IS_NOT_DOUBLE = const HintCode('IS_NOT_DOUBLE', "When compiled to JS, this test might return false when the left hand side is an int");
 
   /**
    * Hint for the `x is! int` type checks.
    */
-  static const HintCode IS_NOT_INT = const HintCode.con1('IS_NOT_INT', 10, "When compiled to JS, this test might return false when the left hand side is a double");
+  static const HintCode IS_NOT_INT = const HintCode('IS_NOT_INT', "When compiled to JS, this test might return false when the left hand side is a double");
 
   /**
    * Deferred libraries shouldn't define a top level function 'loadLibrary'.
    */
-  static const HintCode IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION = const HintCode.con1('IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION', 11, "The library '{0}' defines a top-level function named 'loadLibrary' which is hidden by deferring this library");
+  static const HintCode IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION = const HintCode('IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION', "The library '{0}' defines a top-level function named 'loadLibrary' which is hidden by deferring this library");
 
   /**
-   * This hint is generated anywhere where the [StaticTypeWarningCode#INVALID_ASSIGNMENT]
-   * would have been generated, if we used propagated information for the warnings.
+   * This hint is generated anywhere where the
+   * [StaticTypeWarningCode.INVALID_ASSIGNMENT] would have been generated, if we
+   * used propagated information for the warnings.
    *
    * @param rhsTypeName the name of the right hand side type
    * @param lhsTypeName the name of the left hand side type
-   * @see StaticTypeWarningCode#INVALID_ASSIGNMENT
+   * See [StaticTypeWarningCode.INVALID_ASSIGNMENT].
    */
-  static const HintCode INVALID_ASSIGNMENT = const HintCode.con1('INVALID_ASSIGNMENT', 12, "A value of type '{0}' cannot be assigned to a variable of type '{1}'");
+  static const HintCode INVALID_ASSIGNMENT = const HintCode('INVALID_ASSIGNMENT', "A value of type '{0}' cannot be assigned to a variable of type '{1}'");
 
   /**
-   * Generate a hint for methods or functions that have a return type, but do not have a non-void
-   * return statement on all branches. At the end of methods or functions with no return, Dart
-   * implicitly returns `null`, avoiding these implicit returns is considered a best practice.
+   * Generate a hint for methods or functions that have a return type, but do
+   * not have a non-void return statement on all branches. At the end of methods
+   * or functions with no return, Dart implicitly returns `null`, avoiding these
+   * implicit returns is considered a best practice.
    *
    * @param returnType the name of the declared return type
    */
-  static const HintCode MISSING_RETURN = const HintCode.con2('MISSING_RETURN', 13, "This function declares a return type of '{0}', but does not end with a return statement", "Either add a return statement or change the return type to 'void'");
+  static const HintCode MISSING_RETURN = const HintCode('MISSING_RETURN', "This function declares a return type of '{0}', but does not end with a return statement", "Either add a return statement or change the return type to 'void'");
 
   /**
    * A getter with the override annotation does not override an existing getter.
    */
-  static const HintCode OVERRIDE_ON_NON_OVERRIDING_GETTER = const HintCode.con1('OVERRIDE_ON_NON_OVERRIDING_GETTER', 14, "Getter does not override an inherited getter");
+  static const HintCode OVERRIDE_ON_NON_OVERRIDING_GETTER = const HintCode('OVERRIDE_ON_NON_OVERRIDING_GETTER', "Getter does not override an inherited getter");
 
   /**
    * A method with the override annotation does not override an existing method.
    */
-  static const HintCode OVERRIDE_ON_NON_OVERRIDING_METHOD = const HintCode.con1('OVERRIDE_ON_NON_OVERRIDING_METHOD', 15, "Method does not override an inherited method");
+  static const HintCode OVERRIDE_ON_NON_OVERRIDING_METHOD = const HintCode('OVERRIDE_ON_NON_OVERRIDING_METHOD', "Method does not override an inherited method");
 
   /**
    * A setter with the override annotation does not override an existing setter.
    */
-  static const HintCode OVERRIDE_ON_NON_OVERRIDING_SETTER = const HintCode.con1('OVERRIDE_ON_NON_OVERRIDING_SETTER', 16, "Setter does not override an inherited setter");
+  static const HintCode OVERRIDE_ON_NON_OVERRIDING_SETTER = const HintCode('OVERRIDE_ON_NON_OVERRIDING_SETTER', "Setter does not override an inherited setter");
 
   /**
    * Hint for classes that override equals, but not hashCode.
    *
    * @param className the name of the current class
    */
-  static const HintCode OVERRIDE_EQUALS_BUT_NOT_HASH_CODE = const HintCode.con1('OVERRIDE_EQUALS_BUT_NOT_HASH_CODE', 17, "The class '{0}' overrides 'operator==', but not 'get hashCode'");
+  static const HintCode OVERRIDE_EQUALS_BUT_NOT_HASH_CODE = const HintCode('OVERRIDE_EQUALS_BUT_NOT_HASH_CODE', "The class '{0}' overrides 'operator==', but not 'get hashCode'");
 
   /**
    * Type checks of the type `x is! Null` should be done with `x != null`.
    */
-  static const HintCode TYPE_CHECK_IS_NOT_NULL = const HintCode.con1('TYPE_CHECK_IS_NOT_NULL', 18, "Tests for non-null should be done with '!= null'");
+  static const HintCode TYPE_CHECK_IS_NOT_NULL = const HintCode('TYPE_CHECK_IS_NOT_NULL', "Tests for non-null should be done with '!= null'");
 
   /**
    * Type checks of the type `x is Null` should be done with `x == null`.
    */
-  static const HintCode TYPE_CHECK_IS_NULL = const HintCode.con1('TYPE_CHECK_IS_NULL', 19, "Tests for null should be done with '== null'");
+  static const HintCode TYPE_CHECK_IS_NULL = const HintCode('TYPE_CHECK_IS_NULL', "Tests for null should be done with '== null'");
 
   /**
-   * This hint is generated anywhere where the [StaticTypeWarningCode#UNDEFINED_GETTER] or
-   * [StaticWarningCode#UNDEFINED_GETTER] would have been generated, if we used propagated
-   * information for the warnings.
+   * This hint is generated anywhere where the
+   * [StaticTypeWarningCode.UNDEFINED_GETTER] or
+   * [StaticWarningCode.UNDEFINED_GETTER] would have been generated, if we used
+   * propagated information for the warnings.
    *
    * @param getterName the name of the getter
-   * @param enclosingType the name of the enclosing type where the getter is being looked for
-   * @see StaticTypeWarningCode#UNDEFINED_GETTER
-   * @see StaticWarningCode#UNDEFINED_GETTER
+   * @param enclosingType the name of the enclosing type where the getter is
+   *        being looked for
+   * See [StaticTypeWarningCode.UNDEFINED_GETTER], and
+   * [StaticWarningCode.UNDEFINED_GETTER].
    */
-  static const HintCode UNDEFINED_GETTER = const HintCode.con1('UNDEFINED_GETTER', 20, "There is no such getter '{0}' in '{1}'");
+  static const HintCode UNDEFINED_GETTER = const HintCode('UNDEFINED_GETTER', "There is no such getter '{0}' in '{1}'");
 
   /**
-   * This hint is generated anywhere where the [StaticTypeWarningCode#UNDEFINED_METHOD] would
-   * have been generated, if we used propagated information for the warnings.
+   * This hint is generated anywhere where the
+   * [StaticTypeWarningCode.UNDEFINED_METHOD] would have been generated, if we
+   * used propagated information for the warnings.
    *
    * @param methodName the name of the method that is undefined
-   * @param typeName the resolved type name that the method lookup is happening on
-   * @see StaticTypeWarningCode#UNDEFINED_METHOD
+   * @param typeName the resolved type name that the method lookup is happening
+   *        on
+   * See [StaticTypeWarningCode.UNDEFINED_METHOD].
    */
-  static const HintCode UNDEFINED_METHOD = const HintCode.con1('UNDEFINED_METHOD', 21, "The method '{0}' is not defined for the class '{1}'");
+  static const HintCode UNDEFINED_METHOD = const HintCode('UNDEFINED_METHOD', "The method '{0}' is not defined for the class '{1}'");
 
   /**
-   * This hint is generated anywhere where the [StaticTypeWarningCode#UNDEFINED_OPERATOR]
-   * would have been generated, if we used propagated information for the warnings.
+   * This hint is generated anywhere where the
+   * [StaticTypeWarningCode.UNDEFINED_OPERATOR] would have been generated, if we
+   * used propagated information for the warnings.
    *
    * @param operator the name of the operator
-   * @param enclosingType the name of the enclosing type where the operator is being looked for
-   * @see StaticTypeWarningCode#UNDEFINED_OPERATOR
+   * @param enclosingType the name of the enclosing type where the operator is
+   *        being looked for
+   * See [StaticTypeWarningCode.UNDEFINED_OPERATOR].
    */
-  static const HintCode UNDEFINED_OPERATOR = const HintCode.con1('UNDEFINED_OPERATOR', 22, "There is no such operator '{0}' in '{1}'");
+  static const HintCode UNDEFINED_OPERATOR = const HintCode('UNDEFINED_OPERATOR', "There is no such operator '{0}' in '{1}'");
 
   /**
-   * This hint is generated anywhere where the [StaticTypeWarningCode#UNDEFINED_SETTER] or
-   * [StaticWarningCode#UNDEFINED_SETTER] would have been generated, if we used propagated
-   * information for the warnings.
+   * This hint is generated anywhere where the
+   * [StaticTypeWarningCode.UNDEFINED_SETTER] or
+   * [StaticWarningCode.UNDEFINED_SETTER] would have been generated, if we used
+   * propagated information for the warnings.
    *
    * @param setterName the name of the setter
-   * @param enclosingType the name of the enclosing type where the setter is being looked for
-   * @see StaticTypeWarningCode#UNDEFINED_SETTER
-   * @see StaticWarningCode#UNDEFINED_SETTER
+   * @param enclosingType the name of the enclosing type where the setter is
+   *        being looked for
+   * See [StaticTypeWarningCode.UNDEFINED_SETTER], and
+   * [StaticWarningCode.UNDEFINED_SETTER].
    */
-  static const HintCode UNDEFINED_SETTER = const HintCode.con1('UNDEFINED_SETTER', 23, "There is no such setter '{0}' in '{1}'");
+  static const HintCode UNDEFINED_SETTER = const HintCode('UNDEFINED_SETTER', "There is no such setter '{0}' in '{1}'");
 
   /**
    * Unnecessary cast.
    */
-  static const HintCode UNNECESSARY_CAST = const HintCode.con1('UNNECESSARY_CAST', 24, "Unnecessary cast");
+  static const HintCode UNNECESSARY_CAST = const HintCode('UNNECESSARY_CAST', "Unnecessary cast");
 
   /**
    * Unnecessary type checks, the result is always true.
    */
-  static const HintCode UNNECESSARY_TYPE_CHECK_FALSE = const HintCode.con1('UNNECESSARY_TYPE_CHECK_FALSE', 25, "Unnecessary type check, the result is always false");
+  static const HintCode UNNECESSARY_TYPE_CHECK_FALSE = const HintCode('UNNECESSARY_TYPE_CHECK_FALSE', "Unnecessary type check, the result is always false");
 
   /**
    * Unnecessary type checks, the result is always false.
    */
-  static const HintCode UNNECESSARY_TYPE_CHECK_TRUE = const HintCode.con1('UNNECESSARY_TYPE_CHECK_TRUE', 26, "Unnecessary type check, the result is always true");
+  static const HintCode UNNECESSARY_TYPE_CHECK_TRUE = const HintCode('UNNECESSARY_TYPE_CHECK_TRUE', "Unnecessary type check, the result is always true");
 
   /**
-   * Unused imports are imports which are never not used.
+   * See [Modifier.IS_USED_IN_LIBRARY].
    */
-  static const HintCode UNUSED_IMPORT = const HintCode.con1('UNUSED_IMPORT', 27, "Unused import");
+  static const HintCode UNUSED_ELEMENT = const HintCode('UNUSED_ELEMENT', "The {0} '{1}' is not used");
 
   /**
-   * Hint for cases where the source expects a method or function to return a non-void result, but
-   * the method or function signature returns void.
+   * Unused imports are imports which are never used.
+   */
+  static const HintCode UNUSED_IMPORT = const HintCode('UNUSED_IMPORT', "Unused import");
+
+  /**
+   * Unused local variables are local varaibles which are never read.
+   */
+  static const HintCode UNUSED_LOCAL_VARIABLE = const HintCode('UNUSED_LOCAL_VARIABLE', "The value of the local variable '{0}' is not used");
+
+  /**
+   * Hint for cases where the source expects a method or function to return a
+   * non-void result, but the method or function signature returns void.
    *
    * @param name the name of the method or function that returns void
    */
-  static const HintCode USE_OF_VOID_RESULT = const HintCode.con1('USE_OF_VOID_RESULT', 28, "The result of '{0}' is being used, even though it is declared to be 'void'");
+  static const HintCode USE_OF_VOID_RESULT = const HintCode('USE_OF_VOID_RESULT', "The result of '{0}' is being used, even though it is declared to be 'void'");
 
   /**
-   * It is a bad practice for a source file in a package "lib" directory hierarchy to traverse
-   * outside that directory hierarchy. For example, a source file in the "lib" directory should not
-   * contain a directive such as `import '../web/some.dart'` which references a file outside
-   * the lib directory.
+   * It is a bad practice for a source file in a package "lib" directory
+   * hierarchy to traverse outside that directory hierarchy. For example, a
+   * source file in the "lib" directory should not contain a directive such as
+   * `import '../web/some.dart'` which references a file outside the lib
+   * directory.
    */
-  static const HintCode FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE = const HintCode.con1('FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE', 29, "A file in the 'lib' directory hierarchy should not reference a file outside that hierarchy");
+  static const HintCode FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE = const HintCode('FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE', "A file in the 'lib' directory hierarchy should not reference a file outside that hierarchy");
 
   /**
-   * It is a bad practice for a source file ouside a package "lib" directory hierarchy to traverse
-   * into that directory hierarchy. For example, a source file in the "web" directory should not
-   * contain a directive such as `import '../lib/some.dart'` which references a file inside
-   * the lib directory.
+   * It is a bad practice for a source file ouside a package "lib" directory
+   * hierarchy to traverse into that directory hierarchy. For example, a source
+   * file in the "web" directory should not contain a directive such as
+   * `import '../lib/some.dart'` which references a file inside the lib
+   * directory.
    */
-  static const HintCode FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE = const HintCode.con1('FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE', 30, "A file outside the 'lib' directory hierarchy should not reference a file inside that hierarchy. Use a package: reference instead.");
+  static const HintCode FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE = const HintCode('FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE', "A file outside the 'lib' directory hierarchy should not reference a file inside that hierarchy. Use a package: reference instead.");
 
   /**
-   * It is a bad practice for a package import to reference anything outside the given package, or
-   * more generally, it is bad practice for a package import to contain a "..". For example, a
-   * source file should not contain a directive such as `import 'package:foo/../some.dart'`.
+   * It is a bad practice for a package import to reference anything outside the
+   * given package, or more generally, it is bad practice for a package import
+   * to contain a "..". For example, a source file should not contain a
+   * directive such as `import 'package:foo/../some.dart'`.
    */
-  static const HintCode PACKAGE_IMPORT_CONTAINS_DOT_DOT = const HintCode.con1('PACKAGE_IMPORT_CONTAINS_DOT_DOT', 31, "A package import should not contain '..'");
-
-  static const List<HintCode> values = const [
-      ARGUMENT_TYPE_NOT_ASSIGNABLE,
-      DEAD_CODE,
-      DEAD_CODE_CATCH_FOLLOWING_CATCH,
-      DEAD_CODE_ON_CATCH_SUBTYPE,
-      DEPRECATED_MEMBER_USE,
-      DUPLICATE_IMPORT,
-      DIVISION_OPTIMIZATION,
-      IS_DOUBLE,
-      IS_INT,
-      IS_NOT_DOUBLE,
-      IS_NOT_INT,
-      IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION,
-      INVALID_ASSIGNMENT,
-      MISSING_RETURN,
-      OVERRIDE_ON_NON_OVERRIDING_GETTER,
-      OVERRIDE_ON_NON_OVERRIDING_METHOD,
-      OVERRIDE_ON_NON_OVERRIDING_SETTER,
-      OVERRIDE_EQUALS_BUT_NOT_HASH_CODE,
-      TYPE_CHECK_IS_NOT_NULL,
-      TYPE_CHECK_IS_NULL,
-      UNDEFINED_GETTER,
-      UNDEFINED_METHOD,
-      UNDEFINED_OPERATOR,
-      UNDEFINED_SETTER,
-      UNNECESSARY_CAST,
-      UNNECESSARY_TYPE_CHECK_FALSE,
-      UNNECESSARY_TYPE_CHECK_TRUE,
-      UNUSED_IMPORT,
-      USE_OF_VOID_RESULT,
-      FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE,
-      FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE,
-      PACKAGE_IMPORT_CONTAINS_DOT_DOT];
+  static const HintCode PACKAGE_IMPORT_CONTAINS_DOT_DOT = const HintCode('PACKAGE_IMPORT_CONTAINS_DOT_DOT', "A package import should not contain '..'");
 
   /**
-   * The template used to create the message to be displayed for this error.
+   * Initialize a newly created error code to have the given [name]. The message
+   * associated with the error will be created from the given [message]
+   * template. The correction associated with the error will be created from the
+   * given [correction] template.
    */
-  final String message;
-
-  /**
-   * The template used to create the correction to be displayed for this error, or `null` if
-   * there is no correction information for this error.
-   */
-  final String correction;
-
-  /**
-   * Initialize a newly created error code to have the given message.
-   *
-   * @param message the message template used to create the message to be displayed for the error
-   */
-  const HintCode.con1(String name, int ordinal, String message) : this.con2(name, ordinal, message, null);
-
-  /**
-   * Initialize a newly created error code to have the given message and correction.
-   *
-   * @param message the template used to create the message to be displayed for the error
-   * @param correction the template used to create the correction to be displayed for the error
-   */
-  const HintCode.con2(String name, int ordinal, this.message, this.correction) : super(name, ordinal);
+  const HintCode(String name, String message, [String correction]) : super(name, message, correction);
 
   @override
   ErrorSeverity get errorSeverity => ErrorType.HINT.severity;
 
   @override
   ErrorType get type => ErrorType.HINT;
-
-  @override
-  String get uniqueName => "$runtimeType.$name";
 }
 
 /**
- * The enumeration `HtmlWarningCode` defines the error codes used for warnings in HTML files.
- * The convention for this class is for the name of the error code to indicate the problem that
- * caused the error to be generated and for the error message to explain what is wrong and, when
- * appropriate, how the problem can be corrected.
+ * The enumeration `HtmlWarningCode` defines the error codes used for warnings
+ * in HTML files. The convention for this class is for the name of the error
+ * code to indicate the problem that caused the error to be generated and for
+ * the error message to explain what is wrong and, when appropriate, how the
+ * problem can be corrected.
  */
-class HtmlWarningCode extends Enum<HtmlWarningCode> implements ErrorCode {
+class HtmlWarningCode extends ErrorCode {
   /**
-   * An error code indicating that the value of the 'src' attribute of a Dart script tag is not a
-   * valid URI.
+   * An error code indicating that the value of the 'src' attribute of a Dart
+   * script tag is not a valid URI.
    *
    * @param uri the URI that is invalid
    */
-  static const HtmlWarningCode INVALID_URI = const HtmlWarningCode.con1('INVALID_URI', 0, "Invalid URI syntax: '{0}'");
+  static const HtmlWarningCode INVALID_URI = const HtmlWarningCode('INVALID_URI', "Invalid URI syntax: '{0}'");
 
   /**
-   * An error code indicating that the value of the 'src' attribute of a Dart script tag references
-   * a file that does not exist.
+   * An error code indicating that the value of the 'src' attribute of a Dart
+   * script tag references a file that does not exist.
    *
    * @param uri the URI pointing to a non-existent file
    */
-  static const HtmlWarningCode URI_DOES_NOT_EXIST = const HtmlWarningCode.con1('URI_DOES_NOT_EXIST', 1, "Target of URI does not exist: '{0}'");
-
-  static const List<HtmlWarningCode> values = const [INVALID_URI, URI_DOES_NOT_EXIST];
+  static const HtmlWarningCode URI_DOES_NOT_EXIST = const HtmlWarningCode('URI_DOES_NOT_EXIST', "Target of URI does not exist: '{0}'");
 
   /**
-   * The template used to create the message to be displayed for this error.
+   * Initialize a newly created error code to have the given [name]. The message
+   * associated with the error will be created from the given [message]
+   * template. The correction associated with the error will be created from the
+   * given [correction] template.
    */
-  final String message;
-
-  /**
-   * The template used to create the correction to be displayed for this error, or `null` if
-   * there is no correction information for this error.
-   */
-  final String correction;
-
-  /**
-   * Initialize a newly created error code to have the given message.
-   *
-   * @param message the message template used to create the message to be displayed for the error
-   */
-  const HtmlWarningCode.con1(String name, int ordinal, String message) : this.con2(name, ordinal, message, null);
-
-  /**
-   * Initialize a newly created error code to have the given message and correction.
-   *
-   * @param message the template used to create the message to be displayed for the error
-   * @param correction the template used to create the correction to be displayed for the error
-   */
-  const HtmlWarningCode.con2(String name, int ordinal, this.message, this.correction) : super(name, ordinal);
+  const HtmlWarningCode(String name, String message, [String correction]) : super(name, message, correction);
 
   @override
   ErrorSeverity get errorSeverity => ErrorSeverity.WARNING;
 
   @override
   ErrorType get type => ErrorType.STATIC_WARNING;
-
-  @override
-  String get uniqueName => "$runtimeType.$name";
 }
 
 /**
  * The enumeration `PolymerCode` defines Polymer specific problems.
  */
-class PolymerCode extends Enum<PolymerCode> implements ErrorCode {
-  static const PolymerCode ATTRIBUTE_FIELD_NOT_PUBLISHED = const PolymerCode('ATTRIBUTE_FIELD_NOT_PUBLISHED', 0, "Field '{0}' in '{1}' must be @published");
+class PolymerCode extends ErrorCode {
+  static const PolymerCode ATTRIBUTE_FIELD_NOT_PUBLISHED = const PolymerCode('ATTRIBUTE_FIELD_NOT_PUBLISHED', "Field '{0}' in '{1}' must be @published");
 
-  static const PolymerCode DUPLICATE_ATTRIBUTE_DEFINITION = const PolymerCode('DUPLICATE_ATTRIBUTE_DEFINITION', 1, "The attribute '{0}' is already defined");
+  static const PolymerCode DUPLICATE_ATTRIBUTE_DEFINITION = const PolymerCode('DUPLICATE_ATTRIBUTE_DEFINITION', "The attribute '{0}' is already defined");
 
-  static const PolymerCode EMPTY_ATTRIBUTES = const PolymerCode('EMPTY_ATTRIBUTES', 2, "Empty 'attributes' attribute is useless");
+  static const PolymerCode EMPTY_ATTRIBUTES = const PolymerCode('EMPTY_ATTRIBUTES', "Empty 'attributes' attribute is useless");
 
-  static const PolymerCode INVALID_ATTRIBUTE_NAME = const PolymerCode('INVALID_ATTRIBUTE_NAME', 3, "'{0}' is not a valid name for a custom element attribute");
+  static const PolymerCode INVALID_ATTRIBUTE_NAME = const PolymerCode('INVALID_ATTRIBUTE_NAME', "'{0}' is not a valid name for a custom element attribute");
 
-  static const PolymerCode INVALID_TAG_NAME = const PolymerCode('INVALID_TAG_NAME', 4, "'{0}' is not a valid name for a custom element");
+  static const PolymerCode INVALID_TAG_NAME = const PolymerCode('INVALID_TAG_NAME', "'{0}' is not a valid name for a custom element");
 
-  static const PolymerCode MISSING_TAG_NAME = const PolymerCode('MISSING_TAG_NAME', 5, "Missing tag name of the custom element. Please include an attribute like name='your-tag-name'");
+  static const PolymerCode MISSING_TAG_NAME = const PolymerCode('MISSING_TAG_NAME', "Missing tag name of the custom element. Please include an attribute like name='your-tag-name'");
 
-  static const PolymerCode UNDEFINED_ATTRIBUTE_FIELD = const PolymerCode('UNDEFINED_ATTRIBUTE_FIELD', 6, "There is no such field '{0}' in '{1}'");
-
-  static const List<PolymerCode> values = const [
-      ATTRIBUTE_FIELD_NOT_PUBLISHED,
-      DUPLICATE_ATTRIBUTE_DEFINITION,
-      EMPTY_ATTRIBUTES,
-      INVALID_ATTRIBUTE_NAME,
-      INVALID_TAG_NAME,
-      MISSING_TAG_NAME,
-      UNDEFINED_ATTRIBUTE_FIELD];
+  static const PolymerCode UNDEFINED_ATTRIBUTE_FIELD = const PolymerCode('UNDEFINED_ATTRIBUTE_FIELD', "There is no such field '{0}' in '{1}'");
 
   /**
-   * The template used to create the message to be displayed for this error.
+   * Initialize a newly created error code to have the given [name]. The message
+   * associated with the error will be created from the given [message]
+   * template. The correction associated with the error will be created from the
+   * given [correction] template.
    */
-  final String message;
-
-  /**
-   * Initialize a newly created error code to have the given message.
-   *
-   * @param message the message template used to create the message to be displayed for the error
-   */
-  const PolymerCode(String name, int ordinal, this.message) : super(name, ordinal);
-
-  @override
-  String get correction => null;
+  const PolymerCode(String name, String message, [String correction]) : super(name, message, correction);
 
   @override
   ErrorSeverity get errorSeverity => ErrorSeverity.INFO;
 
   @override
   ErrorType get type => ErrorType.POLYMER;
-
-  @override
-  String get uniqueName => "$runtimeType.$name";
 }
 
 /**
- * The enumeration `StaticTypeWarningCode` defines the error codes used for static type
- * warnings. The convention for this class is for the name of the error code to indicate the problem
- * that caused the error to be generated and for the error message to explain what is wrong and,
- * when appropriate, how the problem can be corrected.
+ * The class `StaticTypeWarningCode` defines the error codes used for static
+ * type warnings. The convention for this class is for the name of the error
+ * code to indicate the problem that caused the error to be generated and for
+ * the error message to explain what is wrong and, when appropriate, how the
+ * problem can be corrected.
  */
-class StaticTypeWarningCode extends Enum<StaticTypeWarningCode> implements ErrorCode {
+class StaticTypeWarningCode extends ErrorCode {
   /**
-   * 12.7 Lists: A fresh instance (7.6.1) <i>a</i>, of size <i>n</i>, whose class implements the
-   * built-in class <i>List&lt;E></i> is allocated.
+   * 12.7 Lists: A fresh instance (7.6.1) <i>a</i>, of size <i>n</i>, whose
+   * class implements the built-in class <i>List&lt;E></i> is allocated.
    *
    * @param numTypeArgument the number of provided type arguments
    */
-  static const StaticTypeWarningCode EXPECTED_ONE_LIST_TYPE_ARGUMENTS = const StaticTypeWarningCode.con1('EXPECTED_ONE_LIST_TYPE_ARGUMENTS', 0, "List literal requires exactly one type arguments or none, but {0} found");
+  static const StaticTypeWarningCode EXPECTED_ONE_LIST_TYPE_ARGUMENTS = const StaticTypeWarningCode('EXPECTED_ONE_LIST_TYPE_ARGUMENTS', "List literal requires exactly one type arguments or none, but {0} found");
 
   /**
-   * 12.8 Maps: A fresh instance (7.6.1) <i>m</i>, of size <i>n</i>, whose class implements the
-   * built-in class <i>Map&lt;K, V></i> is allocated.
+   * 12.8 Maps: A fresh instance (7.6.1) <i>m</i>, of size <i>n</i>, whose class
+   * implements the built-in class <i>Map&lt;K, V></i> is allocated.
    *
    * @param numTypeArgument the number of provided type arguments
    */
-  static const StaticTypeWarningCode EXPECTED_TWO_MAP_TYPE_ARGUMENTS = const StaticTypeWarningCode.con1('EXPECTED_TWO_MAP_TYPE_ARGUMENTS', 1, "Map literal requires exactly two type arguments or none, but {0} found");
+  static const StaticTypeWarningCode EXPECTED_TWO_MAP_TYPE_ARGUMENTS = const StaticTypeWarningCode('EXPECTED_TWO_MAP_TYPE_ARGUMENTS', "Map literal requires exactly two type arguments or none, but {0} found");
 
   /**
-   * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>. It is a static type
-   * warning if <i>T</i> does not have an accessible instance setter named <i>v=</i>.
+   * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>.
+   * It is a static type warning if <i>T</i> does not have an accessible
+   * instance setter named <i>v=</i>.
    *
-   * @see #UNDEFINED_SETTER
+   * See [UNDEFINED_SETTER].
    */
-  static const StaticTypeWarningCode INACCESSIBLE_SETTER = const StaticTypeWarningCode.con1('INACCESSIBLE_SETTER', 2, "");
+  static const StaticTypeWarningCode INACCESSIBLE_SETTER = const StaticTypeWarningCode('INACCESSIBLE_SETTER', "");
 
   /**
-   * 8.1.1 Inheritance and Overriding: However, if the above rules would cause multiple members
-   * <i>m<sub>1</sub>, &hellip;, m<sub>k</sub></i> with the same name <i>n</i> that would be
-   * inherited (because identically named members existed in several superinterfaces) then at most
-   * one member is inherited.
+   * 8.1.1 Inheritance and Overriding: However, if the above rules would cause
+   * multiple members <i>m<sub>1</sub>, &hellip;, m<sub>k</sub></i> with the
+   * same name <i>n</i> that would be inherited (because identically named
+   * members existed in several superinterfaces) then at most one member is
+   * inherited.
    *
-   * If the static types <i>T<sub>1</sub>, &hellip;, T<sub>k</sub></i> of the members
-   * <i>m<sub>1</sub>, &hellip;, m<sub>k</sub></i> are not identical, then there must be a member
-   * <i>m<sub>x</sub></i> such that <i>T<sub>x</sub> &lt;: T<sub>i</sub>, 1 &lt;= x &lt;= k</i> for
-   * all <i>i, 1 &lt;= i &lt;= k</i>, or a static type warning occurs. The member that is inherited
-   * is <i>m<sub>x</sub></i>, if it exists; otherwise:
-   * * Let <i>numberOfPositionals</i>(<i>f</i>) denote the number of positional parameters of a
-   * function <i>f</i>, and let <i>numberOfRequiredParams</i>(<i>f</i>) denote the number of
-   * required parameters of a function <i>f</i>. Furthermore, let <i>s</i> denote the set of all
-   * named parameters of the <i>m<sub>1</sub>, &hellip;, m<sub>k</sub></i>. Then let
+   * If the static types <i>T<sub>1</sub>, &hellip;, T<sub>k</sub></i> of the
+   * members <i>m<sub>1</sub>, &hellip;, m<sub>k</sub></i> are not identical,
+   * then there must be a member <i>m<sub>x</sub></i> such that <i>T<sub>x</sub>
+   * &lt;: T<sub>i</sub>, 1 &lt;= x &lt;= k</i> for all <i>i, 1 &lt;= i &lt;=
+   * k</i>, or a static type warning occurs. The member that is inherited is
+   * <i>m<sub>x</sub></i>, if it exists; otherwise:
+   * * Let <i>numberOfPositionals</i>(<i>f</i>) denote the number of positional
+   *   parameters of a function <i>f</i>, and let
+   *   <i>numberOfRequiredParams</i>(<i>f</i>) denote the number of required
+   *   parameters of a function <i>f</i>. Furthermore, let <i>s</i> denote the
+   *   set of all named parameters of the <i>m<sub>1</sub>, &hellip;,
+   *   m<sub>k</sub></i>. Then let
    * * <i>h = max(numberOfPositionals(m<sub>i</sub>)),</i>
-   * * <i>r = min(numberOfRequiredParams(m<sub>i</sub>)), for all <i>i</i>, 1 <= i <= k.</i>
-   * If <i>r <= h</i> then <i>I</i> has a method named <i>n</i>, with <i>r</i> required parameters
-   * of type <b>dynamic</b>, <i>h</i> positional parameters of type <b>dynamic</b>, named parameters
-   * <i>s</i> of type <b>dynamic</b> and return type <b>dynamic</b>.
-   * * Otherwise none of the members <i>m<sub>1</sub>, &hellip;, m<sub>k</sub></i> is inherited.
+   * * <i>r = min(numberOfRequiredParams(m<sub>i</sub>)), for all <i>i</i>, 1 <=
+   *   i <= k.</i> If <i>r <= h</i> then <i>I</i> has a method named <i>n</i>,
+   *   with <i>r</i> required parameters of type <b>dynamic</b>, <i>h</i>
+   *   positional parameters of type <b>dynamic</b>, named parameters <i>s</i>
+   *   of type <b>dynamic</b> and return type <b>dynamic</b>.
+   * * Otherwise none of the members <i>m<sub>1</sub>, &hellip;,
+   *   m<sub>k</sub></i> is inherited.
    */
-  static const StaticTypeWarningCode INCONSISTENT_METHOD_INHERITANCE = const StaticTypeWarningCode.con1('INCONSISTENT_METHOD_INHERITANCE', 3, "'{0}' is inherited by at least two interfaces inconsistently, from {1}");
+  static const StaticTypeWarningCode INCONSISTENT_METHOD_INHERITANCE = const StaticTypeWarningCode('INCONSISTENT_METHOD_INHERITANCE', "'{0}' is inherited by at least two interfaces inconsistently, from {1}");
 
   /**
-   * 12.15.1 Ordinary Invocation: It is a static type warning if <i>T</i> does not have an
-   * accessible (3.2) instance member named <i>m</i>.
+   * 12.15.1 Ordinary Invocation: It is a static type warning if <i>T</i> does
+   * not have an accessible (3.2) instance member named <i>m</i>.
    *
    * @param memberName the name of the static member
-   * @see UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER
+   * See [UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER].
    */
-  static const StaticTypeWarningCode INSTANCE_ACCESS_TO_STATIC_MEMBER = const StaticTypeWarningCode.con1('INSTANCE_ACCESS_TO_STATIC_MEMBER', 4, "Static member '{0}' cannot be accessed using instance access");
+  static const StaticTypeWarningCode INSTANCE_ACCESS_TO_STATIC_MEMBER = const StaticTypeWarningCode('INSTANCE_ACCESS_TO_STATIC_MEMBER', "Static member '{0}' cannot be accessed using instance access");
 
   /**
-   * 12.18 Assignment: It is a static type warning if the static type of <i>e</i> may not be
-   * assigned to the static type of <i>v</i>. The static type of the expression <i>v = e</i> is the
-   * static type of <i>e</i>.
+   * 12.18 Assignment: It is a static type warning if the static type of
+   * <i>e</i> may not be assigned to the static type of <i>v</i>. The static
+   * type of the expression <i>v = e</i> is the static type of <i>e</i>.
    *
-   * 12.18 Assignment: It is a static type warning if the static type of <i>e</i> may not be
-   * assigned to the static type of <i>C.v</i>. The static type of the expression <i>C.v = e</i> is
-   * the static type of <i>e</i>.
+   * 12.18 Assignment: It is a static type warning if the static type of
+   * <i>e</i> may not be assigned to the static type of <i>C.v</i>. The static
+   * type of the expression <i>C.v = e</i> is the static type of <i>e</i>.
    *
-   * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>. It is a static type
-   * warning if the static type of <i>e<sub>2</sub></i> may not be assigned to <i>T</i>.
+   * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>.
+   * It is a static type warning if the static type of <i>e<sub>2</sub></i> may
+   * not be assigned to <i>T</i>.
    *
    * @param rhsTypeName the name of the right hand side type
    * @param lhsTypeName the name of the left hand side type
    */
-  static const StaticTypeWarningCode INVALID_ASSIGNMENT = const StaticTypeWarningCode.con1('INVALID_ASSIGNMENT', 5, "A value of type '{0}' cannot be assigned to a variable of type '{1}'");
+  static const StaticTypeWarningCode INVALID_ASSIGNMENT = const StaticTypeWarningCode('INVALID_ASSIGNMENT', "A value of type '{0}' cannot be assigned to a variable of type '{1}'");
 
   /**
-   * 12.15.1 Ordinary Invocation: An ordinary method invocation <i>i</i> has the form
-   * <i>o.m(a<sub>1</sub>, &hellip;, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</sub>, &hellip;
-   * x<sub>n+k</sub>: a<sub>n+k</sub>)</i>.
+   * 12.15.1 Ordinary Invocation: An ordinary method invocation <i>i</i> has the
+   * form <i>o.m(a<sub>1</sub>, &hellip;, a<sub>n</sub>, x<sub>n+1</sub>:
+   * a<sub>n+1</sub>, &hellip; x<sub>n+k</sub>: a<sub>n+k</sub>)</i>.
    *
-   * Let <i>T</i> be the static type of <i>o</i>. It is a static type warning if <i>T</i> does not
-   * have an accessible instance member named <i>m</i>. If <i>T.m</i> exists, it is a static warning
-   * if the type <i>F</i> of <i>T.m</i> may not be assigned to a function type. If <i>T.m</i> does
-   * not exist, or if <i>F</i> is not a function type, the static type of <i>i</i> is dynamic.
+   * Let <i>T</i> be the static type of <i>o</i>. It is a static type warning if
+   * <i>T</i> does not have an accessible instance member named <i>m</i>. If
+   * <i>T.m</i> exists, it is a static warning if the type <i>F</i> of
+   * <i>T.m</i> may not be assigned to a function type. If <i>T.m</i> does not
+   * exist, or if <i>F</i> is not a function type, the static type of <i>i</i>
+   * is dynamic.
    *
-   * 12.15.3 Static Invocation: It is a static type warning if the type <i>F</i> of <i>C.m</i> may
-   * not be assigned to a function type.
+   * 12.15.3 Static Invocation: It is a static type warning if the type <i>F</i>
+   * of <i>C.m</i> may not be assigned to a function type.
    *
    * 12.15.4 Super Invocation: A super method invocation <i>i</i> has the form
-   * <i>super.m(a<sub>1</sub>, &hellip;, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</sub>, &hellip;
-   * x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. If <i>S.m</i> exists, it is a static warning if the type
-   * <i>F</i> of <i>S.m</i> may not be assigned to a function type.
+   * <i>super.m(a<sub>1</sub>, &hellip;, a<sub>n</sub>, x<sub>n+1</sub>:
+   * a<sub>n+1</sub>, &hellip; x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. If
+   * <i>S.m</i> exists, it is a static warning if the type <i>F</i> of
+   * <i>S.m</i> may not be assigned to a function type.
    *
-   * @param nonFunctionIdentifier the name of the identifier that is not a function type
+   * @param nonFunctionIdentifier the name of the identifier that is not a
+   *        function type
    */
-  static const StaticTypeWarningCode INVOCATION_OF_NON_FUNCTION = const StaticTypeWarningCode.con1('INVOCATION_OF_NON_FUNCTION', 6, "'{0}' is not a method");
+  static const StaticTypeWarningCode INVOCATION_OF_NON_FUNCTION = const StaticTypeWarningCode('INVOCATION_OF_NON_FUNCTION', "'{0}' is not a method");
 
   /**
-   * 12.14.4 Function Expression Invocation: A function expression invocation <i>i</i> has the form
-   * <i>e<sub>f</sub>(a<sub>1</sub>, &hellip;, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</sub>,
-   * &hellip;, x<sub>n+k</sub>: a<sub>n+k</sub>)</i>, where <i>e<sub>f</sub></i> is an expression.
+   * 12.14.4 Function Expression Invocation: A function expression invocation
+   * <i>i</i> has the form <i>e<sub>f</sub>(a<sub>1</sub>, &hellip;,
+   * a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</sub>, &hellip;, x<sub>n+k</sub>:
+   * a<sub>n+k</sub>)</i>, where <i>e<sub>f</sub></i> is an expression.
    *
-   * It is a static type warning if the static type <i>F</i> of <i>e<sub>f</sub></i> may not be
-   * assigned to a function type.
+   * It is a static type warning if the static type <i>F</i> of
+   * <i>e<sub>f</sub></i> may not be assigned to a function type.
    */
-  static const StaticTypeWarningCode INVOCATION_OF_NON_FUNCTION_EXPRESSION = const StaticTypeWarningCode.con1('INVOCATION_OF_NON_FUNCTION_EXPRESSION', 7, "Cannot invoke a non-function");
+  static const StaticTypeWarningCode INVOCATION_OF_NON_FUNCTION_EXPRESSION = const StaticTypeWarningCode('INVOCATION_OF_NON_FUNCTION_EXPRESSION', "Cannot invoke a non-function");
 
   /**
-   * 12.20 Conditional: It is a static type warning if the type of <i>e<sub>1</sub></i> may not be
+   * 12.20 Conditional: It is a static type warning if the type of
+   * <i>e<sub>1</sub></i> may not be assigned to bool.
+   *
+   * 13.5 If: It is a static type warning if the type of the expression <i>b</i>
+   * may not be assigned to bool.
+   *
+   * 13.7 While: It is a static type warning if the type of <i>e</i> may not be
    * assigned to bool.
    *
-   * 13.5 If: It is a static type warning if the type of the expression <i>b</i> may not be assigned
-   * to bool.
-   *
-   * 13.7 While: It is a static type warning if the type of <i>e</i> may not be assigned to bool.
-   *
-   * 13.8 Do: It is a static type warning if the type of <i>e</i> cannot be assigned to bool.
-   */
-  static const StaticTypeWarningCode NON_BOOL_CONDITION = const StaticTypeWarningCode.con1('NON_BOOL_CONDITION', 8, "Conditions must have a static type of 'bool'");
-
-  /**
-   * 13.15 Assert: It is a static type warning if the type of <i>e</i> may not be assigned to either
-   * bool or () &rarr; bool
-   */
-  static const StaticTypeWarningCode NON_BOOL_EXPRESSION = const StaticTypeWarningCode.con1('NON_BOOL_EXPRESSION', 9, "Assertions must be on either a 'bool' or '() -> bool'");
-
-  /**
-   * 12.28 Unary Expressions: The expression !<i>e</i> is equivalent to the expression
-   * <i>e</i>?<b>false<b> : <b>true</b>.
-   *
-   * 12.20 Conditional: It is a static type warning if the type of <i>e<sub>1</sub></i> may not be
+   * 13.8 Do: It is a static type warning if the type of <i>e</i> cannot be
    * assigned to bool.
    */
-  static const StaticTypeWarningCode NON_BOOL_NEGATION_EXPRESSION = const StaticTypeWarningCode.con1('NON_BOOL_NEGATION_EXPRESSION', 10, "Negation argument must have a static type of 'bool'");
+  static const StaticTypeWarningCode NON_BOOL_CONDITION = const StaticTypeWarningCode('NON_BOOL_CONDITION', "Conditions must have a static type of 'bool'");
 
   /**
-   * 12.21 Logical Boolean Expressions: It is a static type warning if the static types of both of
-   * <i>e<sub>1</sub></i> and <i>e<sub>2</sub></i> may not be assigned to bool.
+   * 13.15 Assert: It is a static type warning if the type of <i>e</i> may not
+   * be assigned to either bool or () &rarr; bool
+   */
+  static const StaticTypeWarningCode NON_BOOL_EXPRESSION = const StaticTypeWarningCode('NON_BOOL_EXPRESSION', "Assertions must be on either a 'bool' or '() -> bool'");
+
+  /**
+   * 12.28 Unary Expressions: The expression !<i>e</i> is equivalent to the
+   * expression <i>e</i>?<b>false<b> : <b>true</b>.
+   *
+   * 12.20 Conditional: It is a static type warning if the type of
+   * <i>e<sub>1</sub></i> may not be assigned to bool.
+   */
+  static const StaticTypeWarningCode NON_BOOL_NEGATION_EXPRESSION = const StaticTypeWarningCode('NON_BOOL_NEGATION_EXPRESSION', "Negation argument must have a static type of 'bool'");
+
+  /**
+   * 12.21 Logical Boolean Expressions: It is a static type warning if the
+   * static types of both of <i>e<sub>1</sub></i> and <i>e<sub>2</sub></i> may
+   * not be assigned to bool.
    *
    * @param operator the lexeme of the logical operator
    */
-  static const StaticTypeWarningCode NON_BOOL_OPERAND = const StaticTypeWarningCode.con1('NON_BOOL_OPERAND', 11, "The operands of the '{0}' operator must be assignable to 'bool'");
+  static const StaticTypeWarningCode NON_BOOL_OPERAND = const StaticTypeWarningCode('NON_BOOL_OPERAND', "The operands of the '{0}' operator must be assignable to 'bool'");
 
   /**
-   * 15.8 Parameterized Types: It is a static type warning if <i>A<sub>i</sub>, 1 &lt;= i &lt;=
-   * n</i> does not denote a type in the enclosing lexical scope.
+   * 15.8 Parameterized Types: It is a static type warning if <i>A<sub>i</sub>,
+   * 1 &lt;= i &lt;= n</i> does not denote a type in the enclosing lexical scope.
    */
-  static const StaticTypeWarningCode NON_TYPE_AS_TYPE_ARGUMENT = const StaticTypeWarningCode.con1('NON_TYPE_AS_TYPE_ARGUMENT', 12, "The name '{0}' is not a type and cannot be used as a parameterized type");
+  static const StaticTypeWarningCode NON_TYPE_AS_TYPE_ARGUMENT = const StaticTypeWarningCode('NON_TYPE_AS_TYPE_ARGUMENT', "The name '{0}' is not a type and cannot be used as a parameterized type");
 
   /**
-   * 13.11 Return: It is a static type warning if the type of <i>e</i> may not be assigned to the
-   * declared return type of the immediately enclosing function.
+   * 13.11 Return: It is a static type warning if the type of <i>e</i> may not
+   * be assigned to the declared return type of the immediately enclosing
+   * function.
    *
    * @param actualReturnType the return type as declared in the return statement
    * @param expectedReturnType the expected return type as defined by the method
    * @param methodName the name of the method
    */
-  static const StaticTypeWarningCode RETURN_OF_INVALID_TYPE = const StaticTypeWarningCode.con1('RETURN_OF_INVALID_TYPE', 13, "The return type '{0}' is not a '{1}', as defined by the method '{2}'");
+  static const StaticTypeWarningCode RETURN_OF_INVALID_TYPE = const StaticTypeWarningCode('RETURN_OF_INVALID_TYPE', "The return type '{0}' is not a '{1}', as defined by the method '{2}'");
 
   /**
-   * 12.11 Instance Creation: It is a static type warning if any of the type arguments to a
-   * constructor of a generic type <i>G</i> invoked by a new expression or a constant object
-   * expression are not subtypes of the bounds of the corresponding formal type parameters of
-   * <i>G</i>.
+   * 12.11 Instance Creation: It is a static type warning if any of the type
+   * arguments to a constructor of a generic type <i>G</i> invoked by a new
+   * expression or a constant object expression are not subtypes of the bounds
+   * of the corresponding formal type parameters of <i>G</i>.
    *
-   * 15.8 Parameterized Types: If <i>S</i> is the static type of a member <i>m</i> of <i>G</i>, then
-   * the static type of the member <i>m</i> of <i>G&lt;A<sub>1</sub>, &hellip;,
-   * A<sub>n</sub>&gt;</i> is <i>[A<sub>1</sub>, &hellip;, A<sub>n</sub>/T<sub>1</sub>, &hellip;,
-   * T<sub>n</sub>]S</i> where <i>T<sub>1</sub>, &hellip;, T<sub>n</sub></i> are the formal type
-   * parameters of <i>G</i>. Let <i>B<sub>i</sub></i> be the bounds of <i>T<sub>i</sub>, 1 &lt;= i
-   * &lt;= n</i>. It is a static type warning if <i>A<sub>i</sub></i> is not a subtype of
-   * <i>[A<sub>1</sub>, &hellip;, A<sub>n</sub>/T<sub>1</sub>, &hellip;,
-   * T<sub>n</sub>]B<sub>i</sub>, 1 &lt;= i &lt;= n</i>.
+   * 15.8 Parameterized Types: If <i>S</i> is the static type of a member
+   * <i>m</i> of <i>G</i>, then the static type of the member <i>m</i> of
+   * <i>G&lt;A<sub>1</sub>, &hellip;, A<sub>n</sub>&gt;</i> is <i>[A<sub>1</sub>,
+   * &hellip;, A<sub>n</sub>/T<sub>1</sub>, &hellip;, T<sub>n</sub>]S</i> where
+   * <i>T<sub>1</sub>, &hellip;, T<sub>n</sub></i> are the formal type
+   * parameters of <i>G</i>. Let <i>B<sub>i</sub></i> be the bounds of
+   * <i>T<sub>i</sub>, 1 &lt;= i &lt;= n</i>. It is a static type warning if
+   * <i>A<sub>i</sub></i> is not a subtype of <i>[A<sub>1</sub>, &hellip;,
+   * A<sub>n</sub>/T<sub>1</sub>, &hellip;, T<sub>n</sub>]B<sub>i</sub>, 1 &lt;=
+   * i &lt;= n</i>.
    *
-   * 7.6.2 Factories: It is a static type warning if any of the type arguments to <i>k'</i> are not
-   * subtypes of the bounds of the corresponding formal type parameters of type.
+   * 7.6.2 Factories: It is a static type warning if any of the type arguments
+   * to <i>k'</i> are not subtypes of the bounds of the corresponding formal
+   * type parameters of type.
    *
-   * @param boundedTypeName the name of the type used in the instance creation that should be
-   *          limited by the bound as specified in the class declaration
+   * @param boundedTypeName the name of the type used in the instance creation
+   *        that should be limited by the bound as specified in the class
+   *        declaration
    * @param boundingTypeName the name of the bounding type
-   * @see #TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND
+   * See [TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND].
    */
-  static const StaticTypeWarningCode TYPE_ARGUMENT_NOT_MATCHING_BOUNDS = const StaticTypeWarningCode.con1('TYPE_ARGUMENT_NOT_MATCHING_BOUNDS', 14, "'{0}' does not extend '{1}'");
+  static const StaticTypeWarningCode TYPE_ARGUMENT_NOT_MATCHING_BOUNDS = const StaticTypeWarningCode('TYPE_ARGUMENT_NOT_MATCHING_BOUNDS', "'{0}' does not extend '{1}'");
 
   /**
-   * 10 Generics: It is a static type warning if a type parameter is a supertype of its upper bound.
+   * 10 Generics: It is a static type warning if a type parameter is a supertype
+   * of its upper bound.
    *
    * @param typeParameterName the name of the type parameter
-   * @see #TYPE_ARGUMENT_NOT_MATCHING_BOUNDS
+   * See [TYPE_ARGUMENT_NOT_MATCHING_BOUNDS].
    */
-  static const StaticTypeWarningCode TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND = const StaticTypeWarningCode.con1('TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND', 15, "'{0}' cannot be a supertype of its upper bound");
+  static const StaticTypeWarningCode TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND = const StaticTypeWarningCode('TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND', "'{0}' cannot be a supertype of its upper bound");
 
   /**
-   * 12.17 Getter Invocation: It is a static warning if there is no class <i>C</i> in the enclosing
-   * lexical scope of <i>i</i>, or if <i>C</i> does not declare, implicitly or explicitly, a getter
-   * named <i>m</i>.
+   * 12.17 Getter Invocation: It is a static warning if there is no class
+   * <i>C</i> in the enclosing lexical scope of <i>i</i>, or if <i>C</i> does
+   * not declare, implicitly or explicitly, a getter named <i>m</i>.
    *
-   * @param constantName the name of the enumeration constant that is not defined
+   * @param constantName the name of the enumeration constant that is not
+   *        defined
    * @param enumName the name of the enumeration used to access the constant
    */
-  static const StaticTypeWarningCode UNDEFINED_ENUM_CONSTANT = const StaticTypeWarningCode.con1('UNDEFINED_ENUM_CONSTANT', 16, "There is no constant named '{0}' in '{1}'");
+  static const StaticTypeWarningCode UNDEFINED_ENUM_CONSTANT = const StaticTypeWarningCode('UNDEFINED_ENUM_CONSTANT', "There is no constant named '{0}' in '{1}'");
 
   /**
-   * 12.15.3 Unqualified Invocation: If there exists a lexically visible declaration named
-   * <i>id</i>, let <i>f<sub>id</sub></i> be the innermost such declaration. Then: [skip].
-   * Otherwise, <i>f<sub>id</sub></i> is considered equivalent to the ordinary method invocation
-   * <b>this</b>.<i>id</i>(<i>a<sub>1</sub></i>, ..., <i>a<sub>n</sub></i>, <i>x<sub>n+1</sub></i> :
-   * <i>a<sub>n+1</sub></i>, ..., <i>x<sub>n+k</sub></i> : <i>a<sub>n+k</sub></i>).
+   * 12.15.3 Unqualified Invocation: If there exists a lexically visible
+   * declaration named <i>id</i>, let <i>f<sub>id</sub></i> be the innermost
+   * such declaration. Then: [skip]. Otherwise, <i>f<sub>id</sub></i> is
+   * considered equivalent to the ordinary method invocation
+   * <b>this</b>.<i>id</i>(<i>a<sub>1</sub></i>, ..., <i>a<sub>n</sub></i>,
+   * <i>x<sub>n+1</sub></i> : <i>a<sub>n+1</sub></i>, ...,
+   * <i>x<sub>n+k</sub></i> : <i>a<sub>n+k</sub></i>).
    *
    * @param methodName the name of the method that is undefined
    */
-  static const StaticTypeWarningCode UNDEFINED_FUNCTION = const StaticTypeWarningCode.con1('UNDEFINED_FUNCTION', 17, "The function '{0}' is not defined");
+  static const StaticTypeWarningCode UNDEFINED_FUNCTION = const StaticTypeWarningCode('UNDEFINED_FUNCTION', "The function '{0}' is not defined");
 
   /**
-   * 12.17 Getter Invocation: Let <i>T</i> be the static type of <i>e</i>. It is a static type
-   * warning if <i>T</i> does not have a getter named <i>m</i>.
+   * 12.17 Getter Invocation: Let <i>T</i> be the static type of <i>e</i>. It is
+   * a static type warning if <i>T</i> does not have a getter named <i>m</i>.
    *
    * @param getterName the name of the getter
-   * @param enclosingType the name of the enclosing type where the getter is being looked for
+   * @param enclosingType the name of the enclosing type where the getter is
+   *        being looked for
    */
-  static const StaticTypeWarningCode UNDEFINED_GETTER = const StaticTypeWarningCode.con1('UNDEFINED_GETTER', 18, "There is no such getter '{0}' in '{1}'");
+  static const StaticTypeWarningCode UNDEFINED_GETTER = const StaticTypeWarningCode('UNDEFINED_GETTER', "There is no such getter '{0}' in '{1}'");
 
   /**
-   * 12.15.1 Ordinary Invocation: Let <i>T</i> be the static type of <i>o</i>. It is a static type
-   * warning if <i>T</i> does not have an accessible instance member named <i>m</i>.
+   * 12.15.1 Ordinary Invocation: Let <i>T</i> be the static type of <i>o</i>.
+   * It is a static type warning if <i>T</i> does not have an accessible
+   * instance member named <i>m</i>.
    *
    * @param methodName the name of the method that is undefined
-   * @param typeName the resolved type name that the method lookup is happening on
+   * @param typeName the resolved type name that the method lookup is happening
+   *        on
    */
-  static const StaticTypeWarningCode UNDEFINED_METHOD = const StaticTypeWarningCode.con1('UNDEFINED_METHOD', 19, "The method '{0}' is not defined for the class '{1}'");
+  static const StaticTypeWarningCode UNDEFINED_METHOD = const StaticTypeWarningCode('UNDEFINED_METHOD', "The method '{0}' is not defined for the class '{1}'");
 
   /**
    * 12.18 Assignment: Evaluation of an assignment of the form
-   * <i>e<sub>1</sub></i>[<i>e<sub>2</sub></i>] = <i>e<sub>3</sub></i> is equivalent to the
-   * evaluation of the expression (a, i, e){a.[]=(i, e); return e;} (<i>e<sub>1</sub></i>,
-   * <i>e<sub>2</sub></i>, <i>e<sub>2</sub></i>).
+   * <i>e<sub>1</sub></i>[<i>e<sub>2</sub></i>] = <i>e<sub>3</sub></i> is
+   * equivalent to the evaluation of the expression (a, i, e){a.[]=(i, e);
+   * return e;} (<i>e<sub>1</sub></i>, <i>e<sub>2</sub></i>,
+   * <i>e<sub>2</sub></i>).
    *
    * 12.29 Assignable Expressions: An assignable expression of the form
-   * <i>e<sub>1</sub></i>[<i>e<sub>2</sub></i>] is evaluated as a method invocation of the operator
-   * method [] on <i>e<sub>1</sub></i> with argument <i>e<sub>2</sub></i>.
+   * <i>e<sub>1</sub></i>[<i>e<sub>2</sub></i>] is evaluated as a method
+   * invocation of the operator method [] on <i>e<sub>1</sub></i> with argument
+   * <i>e<sub>2</sub></i>.
    *
-   * 12.15.1 Ordinary Invocation: Let <i>T</i> be the static type of <i>o</i>. It is a static type
-   * warning if <i>T</i> does not have an accessible instance member named <i>m</i>.
+   * 12.15.1 Ordinary Invocation: Let <i>T</i> be the static type of <i>o</i>.
+   * It is a static type warning if <i>T</i> does not have an accessible
+   * instance member named <i>m</i>.
    *
    * @param operator the name of the operator
-   * @param enclosingType the name of the enclosing type where the operator is being looked for
+   * @param enclosingType the name of the enclosing type where the operator is
+   *        being looked for
    */
-  static const StaticTypeWarningCode UNDEFINED_OPERATOR = const StaticTypeWarningCode.con1('UNDEFINED_OPERATOR', 20, "There is no such operator '{0}' in '{1}'");
+  static const StaticTypeWarningCode UNDEFINED_OPERATOR = const StaticTypeWarningCode('UNDEFINED_OPERATOR', "There is no such operator '{0}' in '{1}'");
 
   /**
-   * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>. It is a static type
-   * warning if <i>T</i> does not have an accessible instance setter named <i>v=</i>.
+   * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>.
+   * It is a static type warning if <i>T</i> does not have an accessible
+   * instance setter named <i>v=</i>.
    *
    * @param setterName the name of the setter
-   * @param enclosingType the name of the enclosing type where the setter is being looked for
-   * @see #INACCESSIBLE_SETTER
+   * @param enclosingType the name of the enclosing type where the setter is
+   *        being looked for
+   * See [INACCESSIBLE_SETTER].
    */
-  static const StaticTypeWarningCode UNDEFINED_SETTER = const StaticTypeWarningCode.con1('UNDEFINED_SETTER', 21, "There is no such setter '{0}' in '{1}'");
+  static const StaticTypeWarningCode UNDEFINED_SETTER = const StaticTypeWarningCode('UNDEFINED_SETTER', "There is no such setter '{0}' in '{1}'");
 
   /**
    * 12.15.4 Super Invocation: A super method invocation <i>i</i> has the form
-   * <i>super.m(a<sub>1</sub>, &hellip;, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</sub>, &hellip;
-   * x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. It is a static type warning if <i>S</i> does not have an
-   * accessible instance member named <i>m</i>.
+   * <i>super.m(a<sub>1</sub>, &hellip;, a<sub>n</sub>, x<sub>n+1</sub>:
+   * a<sub>n+1</sub>, &hellip; x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. It is a
+   * static type warning if <i>S</i> does not have an accessible instance member
+   * named <i>m</i>.
    *
    * @param methodName the name of the method that is undefined
-   * @param typeName the resolved type name that the method lookup is happening on
+   * @param typeName the resolved type name that the method lookup is happening
+   *        on
    */
-  static const StaticTypeWarningCode UNDEFINED_SUPER_METHOD = const StaticTypeWarningCode.con1('UNDEFINED_SUPER_METHOD', 22, "There is no such method '{0}' in '{1}'");
+  static const StaticTypeWarningCode UNDEFINED_SUPER_METHOD = const StaticTypeWarningCode('UNDEFINED_SUPER_METHOD', "There is no such method '{0}' in '{1}'");
 
   /**
-   * 12.15.1 Ordinary Invocation: It is a static type warning if <i>T</i> does not have an
-   * accessible (3.2) instance member named <i>m</i>.
+   * 12.15.1 Ordinary Invocation: It is a static type warning if <i>T</i> does
+   * not have an accessible (3.2) instance member named <i>m</i>.
    *
-   * This is a specialization of [INSTANCE_ACCESS_TO_STATIC_MEMBER] that is used when we are
-   * able to find the name defined in a supertype. It exists to provide a more informative error
-   * message.
+   * This is a specialization of [INSTANCE_ACCESS_TO_STATIC_MEMBER] that is used
+   * when we are able to find the name defined in a supertype. It exists to
+   * provide a more informative error message.
    */
-  static const StaticTypeWarningCode UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER = const StaticTypeWarningCode.con1('UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER', 23, "Static members from supertypes must be qualified by the name of the defining type");
+  static const StaticTypeWarningCode UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER = const StaticTypeWarningCode('UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER', "Static members from supertypes must be qualified by the name of the defining type");
 
   /**
-   * 15.8 Parameterized Types: It is a static type warning if <i>G</i> is not a generic type with
-   * exactly <i>n</i> type parameters.
+   * 15.8 Parameterized Types: It is a static type warning if <i>G</i> is not a
+   * generic type with exactly <i>n</i> type parameters.
    *
    * @param typeName the name of the type being referenced (<i>G</i>)
    * @param parameterCount the number of type parameters that were declared
    * @param argumentCount the number of type arguments provided
-   * @see CompileTimeErrorCode#CONST_WITH_INVALID_TYPE_PARAMETERS
-   * @see CompileTimeErrorCode#NEW_WITH_INVALID_TYPE_PARAMETERS
+   * See [CompileTimeErrorCode.CONST_WITH_INVALID_TYPE_PARAMETERS], and
+   * [CompileTimeErrorCode.NEW_WITH_INVALID_TYPE_PARAMETERS].
    */
-  static const StaticTypeWarningCode WRONG_NUMBER_OF_TYPE_ARGUMENTS = const StaticTypeWarningCode.con1('WRONG_NUMBER_OF_TYPE_ARGUMENTS', 24, "The type '{0}' is declared with {1} type parameters, but {2} type arguments were given");
-
-  static const List<StaticTypeWarningCode> values = const [
-      EXPECTED_ONE_LIST_TYPE_ARGUMENTS,
-      EXPECTED_TWO_MAP_TYPE_ARGUMENTS,
-      INACCESSIBLE_SETTER,
-      INCONSISTENT_METHOD_INHERITANCE,
-      INSTANCE_ACCESS_TO_STATIC_MEMBER,
-      INVALID_ASSIGNMENT,
-      INVOCATION_OF_NON_FUNCTION,
-      INVOCATION_OF_NON_FUNCTION_EXPRESSION,
-      NON_BOOL_CONDITION,
-      NON_BOOL_EXPRESSION,
-      NON_BOOL_NEGATION_EXPRESSION,
-      NON_BOOL_OPERAND,
-      NON_TYPE_AS_TYPE_ARGUMENT,
-      RETURN_OF_INVALID_TYPE,
-      TYPE_ARGUMENT_NOT_MATCHING_BOUNDS,
-      TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND,
-      UNDEFINED_ENUM_CONSTANT,
-      UNDEFINED_FUNCTION,
-      UNDEFINED_GETTER,
-      UNDEFINED_METHOD,
-      UNDEFINED_OPERATOR,
-      UNDEFINED_SETTER,
-      UNDEFINED_SUPER_METHOD,
-      UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER,
-      WRONG_NUMBER_OF_TYPE_ARGUMENTS];
+  static const StaticTypeWarningCode WRONG_NUMBER_OF_TYPE_ARGUMENTS = const StaticTypeWarningCode('WRONG_NUMBER_OF_TYPE_ARGUMENTS', "The type '{0}' is declared with {1} type parameters, but {2} type arguments were given");
 
   /**
-   * The template used to create the message to be displayed for this error.
+   * Initialize a newly created error code to have the given [name]. The message
+   * associated with the error will be created from the given [message]
+   * template. The correction associated with the error will be created from the
+   * given [correction] template.
    */
-  final String message;
-
-  /**
-   * The template used to create the correction to be displayed for this error, or `null` if
-   * there is no correction information for this error.
-   */
-  final String correction;
-
-  /**
-   * Initialize a newly created error code to have the given message.
-   *
-   * @param message the message template used to create the message to be displayed for the error
-   */
-  const StaticTypeWarningCode.con1(String name, int ordinal, String message) : this.con2(name, ordinal, message, null);
-
-  /**
-   * Initialize a newly created error code to have the given message and correction.
-   *
-   * @param message the template used to create the message to be displayed for the error
-   * @param correction the template used to create the correction to be displayed for the error
-   */
-  const StaticTypeWarningCode.con2(String name, int ordinal, this.message, this.correction) : super(name, ordinal);
+  const StaticTypeWarningCode(String name, String message, [String correction]) : super(name, message, correction);
 
   @override
   ErrorSeverity get errorSeverity => ErrorType.STATIC_TYPE_WARNING.severity;
 
   @override
   ErrorType get type => ErrorType.STATIC_TYPE_WARNING;
-
-  @override
-  String get uniqueName => "$runtimeType.$name";
 }
 
 /**
- * The enumeration `StaticWarningCode` defines the error codes used for static warnings. The
- * convention for this class is for the name of the error code to indicate the problem that caused
- * the error to be generated and for the error message to explain what is wrong and, when
- * appropriate, how the problem can be corrected.
+ * The enumeration `StaticWarningCode` defines the error codes used for static
+ * warnings. The convention for this class is for the name of the error code to
+ * indicate the problem that caused the error to be generated and for the error
+ * message to explain what is wrong and, when appropriate, how the problem can
+ * be corrected.
  */
-class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode {
+class StaticWarningCode extends ErrorCode {
   /**
-   * 14.1 Imports: If a name <i>N</i> is referenced by a library <i>L</i> and <i>N</i> is introduced
-   * into the top level scope <i>L</i> by more than one import then:
-   * <ol>
-   * * A static warning occurs.
-   * * If <i>N</i> is referenced as a function, getter or setter, a <i>NoSuchMethodError</i> is
-   * raised.
-   * * If <i>N</i> is referenced as a type, it is treated as a malformed type.
-   * </ol>
+   * 14.1 Imports: If a name <i>N</i> is referenced by a library <i>L</i> and
+   * <i>N</i> is introduced into the top level scope <i>L</i> by more than one
+   * import then:
+   * 1. A static warning occurs.
+   * 2. If <i>N</i> is referenced as a function, getter or setter, a
+   *    <i>NoSuchMethodError</i> is raised.
+   * 3. If <i>N</i> is referenced as a type, it is treated as a malformed type.
    *
    * @param ambiguousTypeName the name of the ambiguous type
-   * @param firstLibraryName the name of the first library that the type is found
-   * @param secondLibraryName the name of the second library that the type is found
+   * @param firstLibraryName the name of the first library that the type is
+   *        found
+   * @param secondLibraryName the name of the second library that the type is
+   *        found
    */
-  static const StaticWarningCode AMBIGUOUS_IMPORT = const StaticWarningCode.con1('AMBIGUOUS_IMPORT', 0, "The name '{0}' is defined in the libraries {1}");
+  static const StaticWarningCode AMBIGUOUS_IMPORT = const StaticWarningCode('AMBIGUOUS_IMPORT', "The name '{0}' is defined in the libraries {1}");
 
   /**
-   * 12.11.1 New: It is a static warning if the static type of <i>a<sub>i</sub>, 1 &lt;= i &lt;= n+
-   * k</i> may not be assigned to the type of the corresponding formal parameter of the constructor
-   * <i>T.id</i> (respectively <i>T</i>).
+   * 12.11.1 New: It is a static warning if the static type of <i>a<sub>i</sub>,
+   * 1 &lt;= i &lt;= n+ k</i> may not be assigned to the type of the
+   * corresponding formal parameter of the constructor <i>T.id</i> (respectively
+   * <i>T</i>).
    *
-   * 12.11.2 Const: It is a static warning if the static type of <i>a<sub>i</sub>, 1 &lt;= i &lt;=
-   * n+ k</i> may not be assigned to the type of the corresponding formal parameter of the
-   * constructor <i>T.id</i> (respectively <i>T</i>).
+   * 12.11.2 Const: It is a static warning if the static type of
+   * <i>a<sub>i</sub>, 1 &lt;= i &lt;= n+ k</i> may not be assigned to the type
+   * of the corresponding formal parameter of the constructor <i>T.id</i>
+   * (respectively <i>T</i>).
    *
-   * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of
-   * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</sub>, 1 &lt;= i &lt;=
-   * n+k</i> and let <i>S<sub>q</sub></i> be the type of the named parameter <i>q</i> of <i>f</i>.
-   * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<sub>j</sub>, 1 &lt;=
-   * j &lt;= m</i>.
+   * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static
+   * type of <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of
+   * <i>p<sub>i</sub>, 1 &lt;= i &lt;= n+k</i> and let <i>S<sub>q</sub></i> be
+   * the type of the named parameter <i>q</i> of <i>f</i>. It is a static
+   * warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<sub>j</sub>, 1
+   * &lt;= j &lt;= m</i>.
    *
-   * 12.14.2 Binding Actuals to Formals: Furthermore, each <i>q<sub>i</sub>, 1 &lt;= i &lt;= l</i>,
-   * must have a corresponding named parameter in the set <i>{p<sub>n+1</sub>, &hellip;
-   * p<sub>n+k</sub>}</i> or a static warning occurs. It is a static warning if
-   * <i>T<sub>m+j</sub></i> may not be assigned to <i>S<sub>r</sub></i>, where <i>r = q<sub>j</sub>,
-   * 1 &lt;= j &lt;= l</i>.
+   * 12.14.2 Binding Actuals to Formals: Furthermore, each <i>q<sub>i</sub>, 1
+   * &lt;= i &lt;= l</i>, must have a corresponding named parameter in the set
+   * <i>{p<sub>n+1</sub>, &hellip; p<sub>n+k</sub>}</i> or a static warning
+   * occurs. It is a static warning if <i>T<sub>m+j</sub></i> may not be
+   * assigned to <i>S<sub>r</sub></i>, where <i>r = q<sub>j</sub>, 1 &lt;= j
+   * &lt;= l</i>.
    *
    * @param actualType the name of the actual argument type
    * @param expectedType the name of the expected type
    */
-  static const StaticWarningCode ARGUMENT_TYPE_NOT_ASSIGNABLE = const StaticWarningCode.con1('ARGUMENT_TYPE_NOT_ASSIGNABLE', 1, "The argument type '{0}' cannot be assigned to the parameter type '{1}'");
+  static const StaticWarningCode ARGUMENT_TYPE_NOT_ASSIGNABLE = const StaticWarningCode('ARGUMENT_TYPE_NOT_ASSIGNABLE', "The argument type '{0}' cannot be assigned to the parameter type '{1}'");
 
   /**
-   * 5 Variables: Attempting to assign to a final variable elsewhere will cause a NoSuchMethodError
-   * to be thrown, because no setter is defined for it. The assignment will also give rise to a
-   * static warning for the same reason.
+   * 5 Variables: Attempting to assign to a final variable elsewhere will cause
+   * a NoSuchMethodError to be thrown, because no setter is defined for it. The
+   * assignment will also give rise to a static warning for the same reason.
    *
    * A constant variable is always implicitly final.
    */
-  static const StaticWarningCode ASSIGNMENT_TO_CONST = const StaticWarningCode.con1('ASSIGNMENT_TO_CONST', 2, "Constant variables cannot be assigned a value");
+  static const StaticWarningCode ASSIGNMENT_TO_CONST = const StaticWarningCode('ASSIGNMENT_TO_CONST', "Constant variables cannot be assigned a value");
 
   /**
-   * 5 Variables: Attempting to assign to a final variable elsewhere will cause a NoSuchMethodError
-   * to be thrown, because no setter is defined for it. The assignment will also give rise to a
-   * static warning for the same reason.
+   * 5 Variables: Attempting to assign to a final variable elsewhere will cause
+   * a NoSuchMethodError to be thrown, because no setter is defined for it. The
+   * assignment will also give rise to a static warning for the same reason.
    */
-  static const StaticWarningCode ASSIGNMENT_TO_FINAL = const StaticWarningCode.con1('ASSIGNMENT_TO_FINAL', 3, "'{0}' cannot be used as a setter, it is final");
+  static const StaticWarningCode ASSIGNMENT_TO_FINAL = const StaticWarningCode('ASSIGNMENT_TO_FINAL', "'{0}' cannot be used as a setter, it is final");
 
   /**
-   * 5 Variables: Attempting to assign to a final variable elsewhere will cause a NoSuchMethodError
-   * to be thrown, because no setter is defined for it. The assignment will also give rise to a
-   * static warning for the same reason.
+   * 5 Variables: Attempting to assign to a final variable elsewhere will cause
+   * a NoSuchMethodError to be thrown, because no setter is defined for it. The
+   * assignment will also give rise to a static warning for the same reason.
    */
-  static const StaticWarningCode ASSIGNMENT_TO_FINAL_NO_SETTER = const StaticWarningCode.con1('ASSIGNMENT_TO_FINAL_NO_SETTER', 4, "No setter named '{0}' in class '{1}'");
+  static const StaticWarningCode ASSIGNMENT_TO_FINAL_NO_SETTER = const StaticWarningCode('ASSIGNMENT_TO_FINAL_NO_SETTER', "No setter named '{0}' in class '{1}'");
 
   /**
-   * 12.18 Assignment: It is as static warning if an assignment of the form <i>v = e</i> occurs
-   * inside a top level or static function (be it function, method, getter, or setter) or variable
-   * initializer and there is neither a local variable declaration with name <i>v</i> nor setter
-   * declaration with name <i>v=</i> in the lexical scope enclosing the assignment.
+   * 12.18 Assignment: It is as static warning if an assignment of the form
+   * <i>v = e</i> occurs inside a top level or static function (be it function,
+   * method, getter, or setter) or variable initializer and there is neither a
+   * local variable declaration with name <i>v</i> nor setter declaration with
+   * name <i>v=</i> in the lexical scope enclosing the assignment.
    */
-  static const StaticWarningCode ASSIGNMENT_TO_FUNCTION = const StaticWarningCode.con1('ASSIGNMENT_TO_FUNCTION', 5, "Functions cannot be assigned a value");
+  static const StaticWarningCode ASSIGNMENT_TO_FUNCTION = const StaticWarningCode('ASSIGNMENT_TO_FUNCTION', "Functions cannot be assigned a value");
 
   /**
-   * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>. It is a static type
-   * warning if <i>T</i> does not have an accessible instance setter named <i>v=</i>.
+   * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>
+   * It is a static type warning if <i>T</i> does not have an accessible
+   * instance setter named <i>v=</i>.
    */
-  static const StaticWarningCode ASSIGNMENT_TO_METHOD = const StaticWarningCode.con1('ASSIGNMENT_TO_METHOD', 6, "Methods cannot be assigned a value");
+  static const StaticWarningCode ASSIGNMENT_TO_METHOD = const StaticWarningCode('ASSIGNMENT_TO_METHOD', "Methods cannot be assigned a value");
 
   /**
-   * 13.9 Switch: It is a static warning if the last statement of the statement sequence
-   * <i>s<sub>k</sub></i> is not a break, continue, return or throw statement.
+   * 13.9 Switch: It is a static warning if the last statement of the statement
+   * sequence <i>s<sub>k</sub></i> is not a break, continue, return or throw
+   * statement.
    */
-  static const StaticWarningCode CASE_BLOCK_NOT_TERMINATED = const StaticWarningCode.con1('CASE_BLOCK_NOT_TERMINATED', 7, "The last statement of the 'case' should be 'break', 'continue', 'return' or 'throw'");
+  static const StaticWarningCode CASE_BLOCK_NOT_TERMINATED = const StaticWarningCode('CASE_BLOCK_NOT_TERMINATED', "The last statement of the 'case' should be 'break', 'continue', 'return' or 'throw'");
 
   /**
-   * 12.32 Type Cast: It is a static warning if <i>T</i> does not denote a type available in the
-   * current lexical scope.
+   * 12.32 Type Cast: It is a static warning if <i>T</i> does not denote a type
+   * available in the current lexical scope.
    */
-  static const StaticWarningCode CAST_TO_NON_TYPE = const StaticWarningCode.con1('CAST_TO_NON_TYPE', 8, "The name '{0}' is not a type and cannot be used in an 'as' expression");
+  static const StaticWarningCode CAST_TO_NON_TYPE = const StaticWarningCode('CAST_TO_NON_TYPE', "The name '{0}' is not a type and cannot be used in an 'as' expression");
 
   /**
-   * 7.4 Abstract Instance Members: It is a static warning if an abstract member is declared or
-   * inherited in a concrete class.
+   * 7.4 Abstract Instance Members: It is a static warning if an abstract member
+   * is declared or inherited in a concrete class.
    */
-  static const StaticWarningCode CONCRETE_CLASS_WITH_ABSTRACT_MEMBER = const StaticWarningCode.con1('CONCRETE_CLASS_WITH_ABSTRACT_MEMBER', 9, "'{0}' must have a method body because '{1}' is not abstract");
+  static const StaticWarningCode CONCRETE_CLASS_WITH_ABSTRACT_MEMBER = const StaticWarningCode('CONCRETE_CLASS_WITH_ABSTRACT_MEMBER', "'{0}' must have a method body because '{1}' is not abstract");
 
   /**
-   * 14.1 Imports: If a name <i>N</i> is referenced by a library <i>L</i> and <i>N</i> would be
-   * introduced into the top level scope of <i>L</i> by an import from a library whose URI begins
-   * with <i>dart:</i> and an import from a library whose URI does not begin with <i>dart:</i>:
+   * 14.1 Imports: If a name <i>N</i> is referenced by a library <i>L</i> and
+   * <i>N</i> would be introduced into the top level scope of <i>L</i> by an
+   * import from a library whose URI begins with <i>dart:</i> and an import from
+   * a library whose URI does not begin with <i>dart:</i>:
    * * The import from <i>dart:</i> is implicitly extended by a hide N clause.
    * * A static warning is issued.
    *
    * @param ambiguousName the ambiguous name
-   * @param sdkLibraryName the name of the dart: library that the element is found
-   * @param otherLibraryName the name of the non-dart: library that the element is found
+   * @param sdkLibraryName the name of the dart: library that the element is
+   *        found
+   * @param otherLibraryName the name of the non-dart: library that the element
+   *        is found
    */
-  static const StaticWarningCode CONFLICTING_DART_IMPORT = const StaticWarningCode.con1('CONFLICTING_DART_IMPORT', 10, "Element '{0}' from SDK library '{1}' is implicitly hidden by '{2}'");
+  static const StaticWarningCode CONFLICTING_DART_IMPORT = const StaticWarningCode('CONFLICTING_DART_IMPORT', "Element '{0}' from SDK library '{1}' is implicitly hidden by '{2}'");
 
   /**
-   * 7.2 Getters: It is a static warning if a class <i>C</i> declares an instance getter named
-   * <i>v</i> and an accessible static member named <i>v</i> or <i>v=</i> is declared in a
-   * superclass of <i>C</i>.
+   * 7.2 Getters: It is a static warning if a class <i>C</i> declares an
+   * instance getter named <i>v</i> and an accessible static member named
+   * <i>v</i> or <i>v=</i> is declared in a superclass of <i>C</i>.
    *
    * @param superName the name of the super class declaring a static member
    */
-  static const StaticWarningCode CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER = const StaticWarningCode.con1('CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER', 11, "Superclass '{0}' declares static member with the same name");
+  static const StaticWarningCode CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER = const StaticWarningCode('CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER', "Superclass '{0}' declares static member with the same name");
 
   /**
-   * 7.1 Instance Methods: It is a static warning if a class <i>C</i> declares an instance method
-   * named <i>n</i> and has a setter named <i>n=</i>.
+   * 7.1 Instance Methods: It is a static warning if a class <i>C</i> declares
+   * an instance method named <i>n</i> and has a setter named <i>n=</i>.
    */
-  static const StaticWarningCode CONFLICTING_INSTANCE_METHOD_SETTER = const StaticWarningCode.con1('CONFLICTING_INSTANCE_METHOD_SETTER', 12, "Class '{0}' declares instance method '{1}', but also has a setter with the same name from '{2}'");
+  static const StaticWarningCode CONFLICTING_INSTANCE_METHOD_SETTER = const StaticWarningCode('CONFLICTING_INSTANCE_METHOD_SETTER', "Class '{0}' declares instance method '{1}', but also has a setter with the same name from '{2}'");
 
   /**
-   * 7.1 Instance Methods: It is a static warning if a class <i>C</i> declares an instance method
-   * named <i>n</i> and has a setter named <i>n=</i>.
+   * 7.1 Instance Methods: It is a static warning if a class <i>C</i> declares
+   * an instance method named <i>n</i> and has a setter named <i>n=</i>.
    */
-  static const StaticWarningCode CONFLICTING_INSTANCE_METHOD_SETTER2 = const StaticWarningCode.con1('CONFLICTING_INSTANCE_METHOD_SETTER2', 13, "Class '{0}' declares the setter '{1}', but also has an instance method in the same class");
+  static const StaticWarningCode CONFLICTING_INSTANCE_METHOD_SETTER2 = const StaticWarningCode('CONFLICTING_INSTANCE_METHOD_SETTER2', "Class '{0}' declares the setter '{1}', but also has an instance method in the same class");
 
   /**
-   * 7.3 Setters: It is a static warning if a class <i>C</i> declares an instance setter named
-   * <i>v=</i> and an accessible static member named <i>v=</i> or <i>v</i> is declared in a
-   * superclass of <i>C</i>.
+   * 7.3 Setters: It is a static warning if a class <i>C</i> declares an
+   * instance setter named <i>v=</i> and an accessible static member named
+   * <i>v=</i> or <i>v</i> is declared in a superclass of <i>C</i>.
    *
    * @param superName the name of the super class declaring a static member
    */
-  static const StaticWarningCode CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_MEMBER = const StaticWarningCode.con1('CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_MEMBER', 14, "Superclass '{0}' declares static member with the same name");
+  static const StaticWarningCode CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_MEMBER = const StaticWarningCode('CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_MEMBER', "Superclass '{0}' declares static member with the same name");
 
   /**
-   * 7.2 Getters: It is a static warning if a class declares a static getter named <i>v</i> and also
-   * has a non-static setter named <i>v=</i>.
+   * 7.2 Getters: It is a static warning if a class declares a static getter
+   * named <i>v</i> and also has a non-static setter named <i>v=</i>.
    */
-  static const StaticWarningCode CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER = const StaticWarningCode.con1('CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER', 15, "Class '{0}' declares non-static setter with the same name");
+  static const StaticWarningCode CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER = const StaticWarningCode('CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER', "Class '{0}' declares non-static setter with the same name");
 
   /**
-   * 7.3 Setters: It is a static warning if a class declares a static setter named <i>v=</i> and
-   * also has a non-static member named <i>v</i>.
+   * 7.3 Setters: It is a static warning if a class declares a static setter
+   * named <i>v=</i> and also has a non-static member named <i>v</i>.
    */
-  static const StaticWarningCode CONFLICTING_STATIC_SETTER_AND_INSTANCE_MEMBER = const StaticWarningCode.con1('CONFLICTING_STATIC_SETTER_AND_INSTANCE_MEMBER', 16, "Class '{0}' declares non-static member with the same name");
+  static const StaticWarningCode CONFLICTING_STATIC_SETTER_AND_INSTANCE_MEMBER = const StaticWarningCode('CONFLICTING_STATIC_SETTER_AND_INSTANCE_MEMBER', "Class '{0}' declares non-static member with the same name");
 
   /**
-   * 12.11.2 Const: Given an instance creation expression of the form <i>const q(a<sub>1</sub>,
-   * &hellip; a<sub>n</sub>)</i> it is a static warning if <i>q</i> is the constructor of an
-   * abstract class but <i>q</i> is not a factory constructor.
+   * 12.11.2 Const: Given an instance creation expression of the form <i>const
+   * q(a<sub>1</sub>, &hellip; a<sub>n</sub>)</i> it is a static warning if
+   * <i>q</i> is the constructor of an abstract class but <i>q</i> is not a
+   * factory constructor.
    */
-  static const StaticWarningCode CONST_WITH_ABSTRACT_CLASS = const StaticWarningCode.con1('CONST_WITH_ABSTRACT_CLASS', 17, "Abstract classes cannot be created with a 'const' expression");
+  static const StaticWarningCode CONST_WITH_ABSTRACT_CLASS = const StaticWarningCode('CONST_WITH_ABSTRACT_CLASS', "Abstract classes cannot be created with a 'const' expression");
 
   /**
-   * 12.7 Maps: It is a static warning if the values of any two keys in a map literal are equal.
+   * 12.7 Maps: It is a static warning if the values of any two keys in a map
+   * literal are equal.
    */
-  static const StaticWarningCode EQUAL_KEYS_IN_MAP = const StaticWarningCode.con1('EQUAL_KEYS_IN_MAP', 18, "Keys in a map cannot be equal");
+  static const StaticWarningCode EQUAL_KEYS_IN_MAP = const StaticWarningCode('EQUAL_KEYS_IN_MAP', "Keys in a map cannot be equal");
 
   /**
-   * 14.2 Exports: It is a static warning to export two different libraries with the same name.
+   * 14.2 Exports: It is a static warning to export two different libraries with
+   * the same name.
    *
    * @param uri1 the uri pointing to a first library
    * @param uri2 the uri pointing to a second library
    * @param name the shared name of the exported libraries
    */
-  static const StaticWarningCode EXPORT_DUPLICATED_LIBRARY_NAME = const StaticWarningCode.con1('EXPORT_DUPLICATED_LIBRARY_NAME', 19, "The exported libraries '{0}' and '{1}' should not have the same name '{2}'");
+  static const StaticWarningCode EXPORT_DUPLICATED_LIBRARY_NAMED
+      = const StaticWarningCode(
+          'EXPORT_DUPLICATED_LIBRARY_NAMED',
+          "The exported libraries '{0}' and '{1}' cannot have the same name '{2}'");
 
   /**
-   * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m &lt; h</i> or if <i>m &gt;
-   * n</i>.
+   * 14.2 Exports: It is a static warning to export two different libraries with
+   * the same name.
+   *
+   * @param uri1 the uri pointing to a first library
+   * @param uri2 the uri pointing to a second library
+   */
+  static const StaticWarningCode EXPORT_DUPLICATED_LIBRARY_UNNAMED
+      = const StaticWarningCode(
+          'EXPORT_DUPLICATED_LIBRARY_UNNAMED',
+          "The exported libraries '{0}' and '{1}' cannot both be unnamed");
+
+  /**
+   * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m &lt;
+   * h</i> or if <i>m &gt; n</i>.
    *
    * @param requiredCount the maximum number of positional arguments
    * @param argumentCount the actual number of positional arguments given
-   * @see #NOT_ENOUGH_REQUIRED_ARGUMENTS
+   * See [NOT_ENOUGH_REQUIRED_ARGUMENTS].
    */
-  static const StaticWarningCode EXTRA_POSITIONAL_ARGUMENTS = const StaticWarningCode.con1('EXTRA_POSITIONAL_ARGUMENTS', 20, "{0} positional arguments expected, but {1} found");
+  static const StaticWarningCode EXTRA_POSITIONAL_ARGUMENTS = const StaticWarningCode('EXTRA_POSITIONAL_ARGUMENTS', "{0} positional arguments expected, but {1} found");
 
   /**
-   * 5. Variables: It is a static warning if a final instance variable that has been initialized at
-   * its point of declaration is also initialized in a constructor.
+   * 5. Variables: It is a static warning if a final instance variable that has
+   * been initialized at its point of declaration is also initialized in a
+   * constructor.
    */
-  static const StaticWarningCode FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION = const StaticWarningCode.con1('FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION', 21, "Values cannot be set in the constructor if they are final, and have already been set");
+  static const StaticWarningCode FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION = const StaticWarningCode('FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION', "Values cannot be set in the constructor if they are final, and have already been set");
 
   /**
-   * 5. Variables: It is a static warning if a final instance variable that has been initialized at
-   * its point of declaration is also initialized in a constructor.
+   * 5. Variables: It is a static warning if a final instance variable that has
+   * been initialized at its point of declaration is also initialized in a
+   * constructor.
    *
    * @param name the name of the field in question
    */
-  static const StaticWarningCode FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR = const StaticWarningCode.con1('FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR', 22, "'{0}' is final and was given a value when it was declared, so it cannot be set to a new value");
+  static const StaticWarningCode FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR = const StaticWarningCode('FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR', "'{0}' is final and was given a value when it was declared, so it cannot be set to a new value");
 
   /**
-   * 7.6.1 Generative Constructors: Execution of an initializer of the form <b>this</b>.<i>v</i> =
-   * <i>e</i> proceeds as follows: First, the expression <i>e</i> is evaluated to an object
-   * <i>o</i>. Then, the instance variable <i>v</i> of the object denoted by this is bound to
-   * <i>o</i>.
+   * 7.6.1 Generative Constructors: Execution of an initializer of the form
+   * <b>this</b>.<i>v</i> = <i>e</i> proceeds as follows: First, the expression
+   * <i>e</i> is evaluated to an object <i>o</i>. Then, the instance variable
+   * <i>v</i> of the object denoted by this is bound to <i>o</i>.
    *
-   * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of
-   * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</sub>, 1 &lt;= i &lt;=
-   * n+k</i> and let <i>S<sub>q</sub></i> be the type of the named parameter <i>q</i> of <i>f</i>.
-   * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<sub>j</sub>, 1 &lt;=
-   * j &lt;= m</i>.
+   * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static
+   * type of <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of
+   * <i>p<sub>i</sub>, 1 &lt;= i &lt;= n+k</i> and let <i>S<sub>q</sub></i> be
+   * the type of the named parameter <i>q</i> of <i>f</i>. It is a static
+   * warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<sub>j</sub>, 1
+   * &lt;= j &lt;= m</i>.
    *
    * @param initializerType the name of the type of the initializer expression
    * @param fieldType the name of the type of the field
    */
-  static const StaticWarningCode FIELD_INITIALIZER_NOT_ASSIGNABLE = const StaticWarningCode.con1('FIELD_INITIALIZER_NOT_ASSIGNABLE', 23, "The initializer type '{0}' cannot be assigned to the field type '{1}'");
+  static const StaticWarningCode FIELD_INITIALIZER_NOT_ASSIGNABLE = const StaticWarningCode('FIELD_INITIALIZER_NOT_ASSIGNABLE', "The initializer type '{0}' cannot be assigned to the field type '{1}'");
 
   /**
-   * 7.6.1 Generative Constructors: An initializing formal has the form <i>this.id</i>. It is a
-   * static warning if the static type of <i>id</i> is not assignable to <i>T<sub>id</sub></i>.
+   * 7.6.1 Generative Constructors: An initializing formal has the form
+   * <i>this.id</i>. It is a static warning if the static type of <i>id</i> is
+   * not assignable to <i>T<sub>id</sub></i>.
    *
    * @param parameterType the name of the type of the field formal parameter
    * @param fieldType the name of the type of the field
    */
-  static const StaticWarningCode FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE = const StaticWarningCode.con1('FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE', 24, "The parameter type '{0}' is incompatable with the field type '{1}'");
+  static const StaticWarningCode FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE = const StaticWarningCode('FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE', "The parameter type '{0}' is incompatable with the field type '{1}'");
 
   /**
-   * 5 Variables: It is a static warning if a library, static or local variable <i>v</i> is final
-   * and <i>v</i> is not initialized at its point of declaration.
+   * 5 Variables: It is a static warning if a library, static or local variable
+   * <i>v</i> is final and <i>v</i> is not initialized at its point of
+   * declaration.
    *
-   * 7.6.1 Generative Constructors: Each final instance variable <i>f</i> declared in the
-   * immediately enclosing class must have an initializer in <i>k</i>'s initializer list unless it
-   * has already been initialized by one of the following means:
+   * 7.6.1 Generative Constructors: Each final instance variable <i>f</i>
+   * declared in the immediately enclosing class must have an initializer in
+   * <i>k</i>'s initializer list unless it has already been initialized by one
+   * of the following means:
    * * Initialization at the declaration of <i>f</i>.
    * * Initialization by means of an initializing formal of <i>k</i>.
    * or a static warning occurs.
    *
    * @param name the name of the uninitialized final variable
    */
-  static const StaticWarningCode FINAL_NOT_INITIALIZED = const StaticWarningCode.con1('FINAL_NOT_INITIALIZED', 25, "The final variable '{0}' must be initialized");
+  static const StaticWarningCode FINAL_NOT_INITIALIZED = const StaticWarningCode('FINAL_NOT_INITIALIZED', "The final variable '{0}' must be initialized");
 
   /**
-   * 15.5 Function Types: It is a static warning if a concrete class implements Function and does
-   * not have a concrete method named call().
+   * 15.5 Function Types: It is a static warning if a concrete class implements
+   * Function and does not have a concrete method named call().
    */
-  static const StaticWarningCode FUNCTION_WITHOUT_CALL = const StaticWarningCode.con1('FUNCTION_WITHOUT_CALL', 26, "Concrete classes that implement Function must implement the method call()");
+  static const StaticWarningCode FUNCTION_WITHOUT_CALL = const StaticWarningCode('FUNCTION_WITHOUT_CALL', "Concrete classes that implement Function must implement the method call()");
 
   /**
-   * 14.1 Imports: It is a static warning to import two different libraries with the same name.
+   * 14.1 Imports: It is a static warning to import two different libraries with
+   * the same name.
    *
    * @param uri1 the uri pointing to a first library
    * @param uri2 the uri pointing to a second library
    * @param name the shared name of the imported libraries
    */
-  static const StaticWarningCode IMPORT_DUPLICATED_LIBRARY_NAME = const StaticWarningCode.con1('IMPORT_DUPLICATED_LIBRARY_NAME', 27, "The imported libraries '{0}' and '{1}' should not have the same name '{2}'");
+  static const StaticWarningCode IMPORT_DUPLICATED_LIBRARY_NAMED
+      = const StaticWarningCode(
+          'IMPORT_DUPLICATED_LIBRARY_NAMED',
+          "The imported libraries '{0}' and '{1}' cannot have the same name '{2}'");
 
   /**
-   * 14.1 Imports: It is a static warning if the specified URI of a deferred import does not refer
-   * to a library declaration.
+   * 14.1 Imports: It is a static warning to import two different libraries with
+   * the same name.
+   *
+   * @param uri1 the uri pointing to a first library
+   * @param uri2 the uri pointing to a second library
+   */
+  static const StaticWarningCode IMPORT_DUPLICATED_LIBRARY_UNNAMED
+      = const StaticWarningCode(
+          'IMPORT_DUPLICATED_LIBRARY_UNNAMED',
+          "The imported libraries '{0}' and '{1}' cannot both be unnamed");
+
+  /**
+   * 14.1 Imports: It is a static warning if the specified URI of a deferred
+   * import does not refer to a library declaration.
    *
    * @param uri the uri pointing to a non-library declaration
-   * @see CompileTimeErrorCode#IMPORT_OF_NON_LIBRARY
+   * See [CompileTimeErrorCode.IMPORT_OF_NON_LIBRARY].
    */
-  static const StaticWarningCode IMPORT_OF_NON_LIBRARY = const StaticWarningCode.con1('IMPORT_OF_NON_LIBRARY', 28, "The imported library '{0}' must not have a part-of directive");
+  static const StaticWarningCode IMPORT_OF_NON_LIBRARY = const StaticWarningCode('IMPORT_OF_NON_LIBRARY', "The imported library '{0}' must not have a part-of directive");
 
   /**
-   * 8.1.1 Inheritance and Overriding: However, if the above rules would cause multiple members
-   * <i>m<sub>1</sub>, &hellip;, m<sub>k</sub></i> with the same name <i>n</i> that would be
-   * inherited (because identically named members existed in several superinterfaces) then at most
-   * one member is inherited.
+   * 8.1.1 Inheritance and Overriding: However, if the above rules would cause
+   * multiple members <i>m<sub>1</sub>, &hellip;, m<sub>k</sub></i> with the
+   * same name <i>n</i> that would be inherited (because identically named
+   * members existed in several superinterfaces) then at most one member is
+   * inherited.
    *
-   * If some but not all of the <i>m<sub>i</sub>, 1 &lt;= i &lt;= k</i> are getters none of the
-   * <i>m<sub>i</sub></i> are inherited, and a static warning is issued.
+   * If some but not all of the <i>m<sub>i</sub>, 1 &lt;= i &lt;= k</i> are
+   * getters none of the <i>m<sub>i</sub></i> are inherited, and a static
+   * warning is issued.
    */
-  static const StaticWarningCode INCONSISTENT_METHOD_INHERITANCE_GETTER_AND_METHOD = const StaticWarningCode.con1('INCONSISTENT_METHOD_INHERITANCE_GETTER_AND_METHOD', 29, "'{0}' is inherited as a getter and also a method");
+  static const StaticWarningCode INCONSISTENT_METHOD_INHERITANCE_GETTER_AND_METHOD = const StaticWarningCode('INCONSISTENT_METHOD_INHERITANCE_GETTER_AND_METHOD', "'{0}' is inherited as a getter and also a method");
 
   /**
-   * 7.1 Instance Methods: It is a static warning if a class <i>C</i> declares an instance method
-   * named <i>n</i> and an accessible static member named <i>n</i> is declared in a superclass of
-   * <i>C</i>.
+   * 7.1 Instance Methods: It is a static warning if a class <i>C</i> declares
+   * an instance method named <i>n</i> and an accessible static member named
+   * <i>n</i> is declared in a superclass of <i>C</i>.
    *
    * @param memberName the name of the member with the name conflict
-   * @param superclassName the name of the enclosing class that has the static member
+   * @param superclassName the name of the enclosing class that has the static
+   *        member
    */
-  static const StaticWarningCode INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC = const StaticWarningCode.con1('INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC', 30, "'{0}' collides with a static member in the superclass '{1}'");
+  static const StaticWarningCode INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC = const StaticWarningCode('INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC', "'{0}' collides with a static member in the superclass '{1}'");
 
   /**
-   * 7.2 Getters: It is a static warning if a getter <i>m1</i> overrides a getter <i>m2</i> and the
-   * type of <i>m1</i> is not a subtype of the type of <i>m2</i>.
-   *
-   * @param actualReturnTypeName the name of the expected return type
-   * @param expectedReturnType the name of the actual return type, not assignable to the
-   *          actualReturnTypeName
-   * @param className the name of the class where the overridden getter is declared
-   * @see #INVALID_METHOD_OVERRIDE_RETURN_TYPE
-   */
-  static const StaticWarningCode INVALID_GETTER_OVERRIDE_RETURN_TYPE = const StaticWarningCode.con1('INVALID_GETTER_OVERRIDE_RETURN_TYPE', 31, "The return type '{0}' is not assignable to '{1}' as required by the getter it is overriding from '{2}'");
-
-  /**
-   * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i> overrides an
-   * instance method <i>m2</i> and the type of <i>m1</i> is not a subtype of the type of <i>m2</i>.
-   *
-   * @param actualParamTypeName the name of the expected parameter type
-   * @param expectedParamType the name of the actual parameter type, not assignable to the
-   *          actualParamTypeName
-   * @param className the name of the class where the overridden method is declared
-   */
-  static const StaticWarningCode INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE = const StaticWarningCode.con1('INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE', 32, "The parameter type '{0}' is not assignable to '{1}' as required by the method it is overriding from '{2}'");
-
-  /**
-   * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i> overrides an
-   * instance method <i>m2</i> and the type of <i>m1</i> is not a subtype of the type of <i>m2</i>.
-   *
-   * @param actualParamTypeName the name of the expected parameter type
-   * @param expectedParamType the name of the actual parameter type, not assignable to the
-   *          actualParamTypeName
-   * @param className the name of the class where the overridden method is declared
-   * @see #INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE
-   */
-  static const StaticWarningCode INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE = const StaticWarningCode.con1('INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE', 33, "The parameter type '{0}' is not assignable to '{1}' as required by the method it is overriding from '{2}'");
-
-  /**
-   * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i> overrides an
-   * instance method <i>m2</i> and the type of <i>m1</i> is not a subtype of the type of <i>m2</i>.
-   *
-   * @param actualParamTypeName the name of the expected parameter type
-   * @param expectedParamType the name of the actual parameter type, not assignable to the
-   *          actualParamTypeName
-   * @param className the name of the class where the overridden method is declared
-   */
-  static const StaticWarningCode INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE = const StaticWarningCode.con1('INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE', 34, "The parameter type '{0}' is not assignable to '{1}' as required by the method it is overriding from '{2}'");
-
-  /**
-   * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i> overrides an
-   * instance method <i>m2</i> and the type of <i>m1</i> is not a subtype of the type of <i>m2</i>.
-   *
-   * @param actualReturnTypeName the name of the expected return type
-   * @param expectedReturnType the name of the actual return type, not assignable to the
-   *          actualReturnTypeName
-   * @param className the name of the class where the overridden method is declared
-   * @see #INVALID_GETTER_OVERRIDE_RETURN_TYPE
-   */
-  static const StaticWarningCode INVALID_METHOD_OVERRIDE_RETURN_TYPE = const StaticWarningCode.con1('INVALID_METHOD_OVERRIDE_RETURN_TYPE', 35, "The return type '{0}' is not assignable to '{1}' as required by the method it is overriding from '{2}'");
-
-  /**
-   * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i> overrides an
-   * instance member <i>m2</i>, the signature of <i>m2</i> explicitly specifies a default value for
-   * a formal parameter <i>p</i> and the signature of <i>m1</i> specifies a different default value
-   * for <i>p</i>.
-   */
-  static const StaticWarningCode INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_NAMED = const StaticWarningCode.con1('INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_NAMED', 36, "Parameters cannot override default values, this method overrides '{0}.{1}' where '{2}' has a different value");
-
-  /**
-   * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i> overrides an
-   * instance member <i>m2</i>, the signature of <i>m2</i> explicitly specifies a default value for
-   * a formal parameter <i>p</i> and the signature of <i>m1</i> specifies a different default value
-   * for <i>p</i>.
-   */
-  static const StaticWarningCode INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_POSITIONAL = const StaticWarningCode.con1('INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_POSITIONAL', 37, "Parameters cannot override default values, this method overrides '{0}.{1}' where this positional parameter has a different value");
-
-  /**
-   * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i> overrides an
-   * instance member <i>m2</i> and <i>m1</i> does not declare all the named parameters declared by
+   * 7.2 Getters: It is a static warning if a getter <i>m1</i> overrides a
+   * getter <i>m2</i> and the type of <i>m1</i> is not a subtype of the type of
    * <i>m2</i>.
    *
+   * @param actualReturnTypeName the name of the expected return type
+   * @param expectedReturnType the name of the actual return type, not
+   *        assignable to the actualReturnTypeName
+   * @param className the name of the class where the overridden getter is
+   *        declared
+   * See [INVALID_METHOD_OVERRIDE_RETURN_TYPE].
+   */
+  static const StaticWarningCode INVALID_GETTER_OVERRIDE_RETURN_TYPE = const StaticWarningCode('INVALID_GETTER_OVERRIDE_RETURN_TYPE', "The return type '{0}' is not assignable to '{1}' as required by the getter it is overriding from '{2}'");
+
+  /**
+   * 7.1 Instance Methods: It is a static warning if an instance method
+   * <i>m1</i> overrides an instance method <i>m2</i> and the type of <i>m1</i>
+   * is not a subtype of the type of <i>m2</i>.
+   *
+   * @param actualParamTypeName the name of the expected parameter type
+   * @param expectedParamType the name of the actual parameter type, not
+   *        assignable to the actualParamTypeName
+   * @param className the name of the class where the overridden method is
+   *        declared
+   */
+  static const StaticWarningCode INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE = const StaticWarningCode('INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE', "The parameter type '{0}' is not assignable to '{1}' as required by the method it is overriding from '{2}'");
+
+  /**
+   * 7.1 Instance Methods: It is a static warning if an instance method
+   * <i>m1</i> overrides an instance method <i>m2</i> and the type of <i>m1</i>
+   * is not a subtype of the type of <i>m2</i>.
+   *
+   * @param actualParamTypeName the name of the expected parameter type
+   * @param expectedParamType the name of the actual parameter type, not
+   *        assignable to the actualParamTypeName
+   * @param className the name of the class where the overridden method is
+   *        declared
+   * See [INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE].
+   */
+  static const StaticWarningCode INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE = const StaticWarningCode('INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE', "The parameter type '{0}' is not assignable to '{1}' as required by the method it is overriding from '{2}'");
+
+  /**
+   * 7.1 Instance Methods: It is a static warning if an instance method
+   * <i>m1</i> overrides an instance method <i>m2</i> and the type of <i>m1</i>
+   * is not a subtype of the type of <i>m2</i>.
+   *
+   * @param actualParamTypeName the name of the expected parameter type
+   * @param expectedParamType the name of the actual parameter type, not
+   *        assignable to the actualParamTypeName
+   * @param className the name of the class where the overridden method is
+   *        declared
+   */
+  static const StaticWarningCode INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE = const StaticWarningCode('INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE', "The parameter type '{0}' is not assignable to '{1}' as required by the method it is overriding from '{2}'");
+
+  /**
+   * 7.1 Instance Methods: It is a static warning if an instance method
+   * <i>m1</i> overrides an instance method <i>m2</i> and the type of <i>m1</i>
+   * is not a subtype of the type of <i>m2</i>.
+   *
+   * @param actualReturnTypeName the name of the expected return type
+   * @param expectedReturnType the name of the actual return type, not
+   *        assignable to the actualReturnTypeName
+   * @param className the name of the class where the overridden method is
+   *        declared
+   * See [INVALID_GETTER_OVERRIDE_RETURN_TYPE].
+   */
+  static const StaticWarningCode INVALID_METHOD_OVERRIDE_RETURN_TYPE = const StaticWarningCode('INVALID_METHOD_OVERRIDE_RETURN_TYPE', "The return type '{0}' is not assignable to '{1}' as required by the method it is overriding from '{2}'");
+
+  /**
+   * 7.1 Instance Methods: It is a static warning if an instance method
+   * <i>m1</i> overrides an instance member <i>m2</i>, the signature of
+   * <i>m2</i> explicitly specifies a default value for a formal parameter
+   * <i>p</i> and the signature of <i>m1</i> specifies a different default value
+   * for <i>p</i>.
+   */
+  static const StaticWarningCode INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_NAMED = const StaticWarningCode('INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_NAMED', "Parameters cannot override default values, this method overrides '{0}.{1}' where '{2}' has a different value");
+
+  /**
+   * 7.1 Instance Methods: It is a static warning if an instance method
+   * <i>m1</i> overrides an instance member <i>m2</i>, the signature of
+   * <i>m2</i> explicitly specifies a default value for a formal parameter
+   * <i>p</i> and the signature of <i>m1</i> specifies a different default value
+   * for <i>p</i>.
+   */
+  static const StaticWarningCode INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_POSITIONAL = const StaticWarningCode('INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_POSITIONAL', "Parameters cannot override default values, this method overrides '{0}.{1}' where this positional parameter has a different value");
+
+  /**
+   * 7.1 Instance Methods: It is a static warning if an instance method
+   * <i>m1</i> overrides an instance member <i>m2</i> and <i>m1</i> does not
+   * declare all the named parameters declared by <i>m2</i>.
+   *
    * @param paramCount the number of named parameters in the overridden member
    * @param className the name of the class from the overridden method
    */
-  static const StaticWarningCode INVALID_OVERRIDE_NAMED = const StaticWarningCode.con1('INVALID_OVERRIDE_NAMED', 38, "Missing the named parameter '{0}' to match the overridden method from '{1}'");
+  static const StaticWarningCode INVALID_OVERRIDE_NAMED = const StaticWarningCode('INVALID_OVERRIDE_NAMED', "Missing the named parameter '{0}' to match the overridden method from '{1}'");
 
   /**
-   * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i> overrides an
-   * instance member <i>m2</i> and <i>m1</i> has fewer positional parameters than <i>m2</i>.
+   * 7.1 Instance Methods: It is a static warning if an instance method
+   * <i>m1</i> overrides an instance member <i>m2</i> and <i>m1</i> has fewer
+   * positional parameters than <i>m2</i>.
    *
-   * @param paramCount the number of positional parameters in the overridden member
+   * @param paramCount the number of positional parameters in the overridden
+   *        member
    * @param className the name of the class from the overridden method
    */
-  static const StaticWarningCode INVALID_OVERRIDE_POSITIONAL = const StaticWarningCode.con1('INVALID_OVERRIDE_POSITIONAL', 39, "Must have at least {0} parameters to match the overridden method from '{1}'");
+  static const StaticWarningCode INVALID_OVERRIDE_POSITIONAL = const StaticWarningCode('INVALID_OVERRIDE_POSITIONAL', "Must have at least {0} parameters to match the overridden method from '{1}'");
 
   /**
-   * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i> overrides an
-   * instance member <i>m2</i> and <i>m1</i> has a greater number of required parameters than
+   * 7.1 Instance Methods: It is a static warning if an instance method
+   * <i>m1</i> overrides an instance member <i>m2</i> and <i>m1</i> has a
+   * greater number of required parameters than <i>m2</i>.
+   *
+   * @param paramCount the number of required parameters in the overridden
+   *        member
+   * @param className the name of the class from the overridden method
+   */
+  static const StaticWarningCode INVALID_OVERRIDE_REQUIRED = const StaticWarningCode('INVALID_OVERRIDE_REQUIRED', "Must have {0} required parameters or less to match the overridden method from '{1}'");
+
+  /**
+   * 7.3 Setters: It is a static warning if a setter <i>m1</i> overrides a
+   * setter <i>m2</i> and the type of <i>m1</i> is not a subtype of the type of
    * <i>m2</i>.
    *
-   * @param paramCount the number of required parameters in the overridden member
-   * @param className the name of the class from the overridden method
-   */
-  static const StaticWarningCode INVALID_OVERRIDE_REQUIRED = const StaticWarningCode.con1('INVALID_OVERRIDE_REQUIRED', 40, "Must have {0} required parameters or less to match the overridden method from '{1}'");
-
-  /**
-   * 7.3 Setters: It is a static warning if a setter <i>m1</i> overrides a setter <i>m2</i> and the
-   * type of <i>m1</i> is not a subtype of the type of <i>m2</i>.
-   *
    * @param actualParamTypeName the name of the expected parameter type
-   * @param expectedParamType the name of the actual parameter type, not assignable to the
-   *          actualParamTypeName
-   * @param className the name of the class where the overridden setter is declared
-   * @see #INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE
+   * @param expectedParamType the name of the actual parameter type, not
+   *        assignable to the actualParamTypeName
+   * @param className the name of the class where the overridden setter is
+   *        declared
+   * See [INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE].
    */
-  static const StaticWarningCode INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE = const StaticWarningCode.con1('INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE', 41, "The parameter type '{0}' is not assignable to '{1}' as required by the setter it is overriding from '{2}'");
+  static const StaticWarningCode INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE = const StaticWarningCode('INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE', "The parameter type '{0}' is not assignable to '{1}' as required by the setter it is overriding from '{2}'");
 
   /**
-   * 12.6 Lists: A run-time list literal &lt;<i>E</i>&gt; [<i>e<sub>1</sub></i> &hellip;
-   * <i>e<sub>n</sub></i>] is evaluated as follows:
-   * * The operator []= is invoked on <i>a</i> with first argument <i>i</i> and second argument
-   * <i>o<sub>i+1</sub></i><i>, 1 &lt;= i &lt;= n</i>
+   * 12.6 Lists: A run-time list literal &lt;<i>E</i>&gt; [<i>e<sub>1</sub></i>
+   * &hellip; <i>e<sub>n</sub></i>] is evaluated as follows:
+   * * The operator []= is invoked on <i>a</i> with first argument <i>i</i> and
+   *   second argument <i>o<sub>i+1</sub></i><i>, 1 &lt;= i &lt;= n</i>
    *
-   * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of
-   * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</sub>, 1 &lt;= i &lt;=
-   * n+k</i> and let <i>S<sub>q</sub></i> be the type of the named parameter <i>q</i> of <i>f</i>.
-   * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<sub>j</sub>, 1 &lt;=
-   * j &lt;= m</i>.
+   * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static
+   * type of <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of
+   * <i>p<sub>i</sub>, 1 &lt;= i &lt;= n+k</i> and let <i>S<sub>q</sub></i> be
+   * the type of the named parameter <i>q</i> of <i>f</i>. It is a static
+   * warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<sub>j</sub>, 1
+   * &lt;= j &lt;= m</i>.
    */
-  static const StaticWarningCode LIST_ELEMENT_TYPE_NOT_ASSIGNABLE = const StaticWarningCode.con1('LIST_ELEMENT_TYPE_NOT_ASSIGNABLE', 42, "The element type '{0}' cannot be assigned to the list type '{1}'");
+  static const StaticWarningCode LIST_ELEMENT_TYPE_NOT_ASSIGNABLE = const StaticWarningCode('LIST_ELEMENT_TYPE_NOT_ASSIGNABLE', "The element type '{0}' cannot be assigned to the list type '{1}'");
 
   /**
-   * 12.7 Map: A run-time map literal &lt;<i>K</i>, <i>V</i>&gt; [<i>k<sub>1</sub></i> :
-   * <i>e<sub>1</sub></i> &hellip; <i>k<sub>n</sub></i> : <i>e<sub>n</sub></i>] is evaluated as
-   * follows:
-   * * The operator []= is invoked on <i>m</i> with first argument <i>k<sub>i</sub></i> and second
-   * argument <i>e<sub>i</sub></i><i>, 1 &lt;= i &lt;= n</i>
+   * 12.7 Map: A run-time map literal &lt;<i>K</i>, <i>V</i>&gt;
+   * [<i>k<sub>1</sub></i> : <i>e<sub>1</sub></i> &hellip; <i>k<sub>n</sub></i>
+   * : <i>e<sub>n</sub></i>] is evaluated as follows:
+   * * The operator []= is invoked on <i>m</i> with first argument
+   *   <i>k<sub>i</sub></i> and second argument <i>e<sub>i</sub></i><i>, 1 &lt;=
+   *   i &lt;= n</i>
    *
-   * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of
-   * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</sub>, 1 &lt;= i &lt;=
-   * n+k</i> and let <i>S<sub>q</sub></i> be the type of the named parameter <i>q</i> of <i>f</i>.
-   * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<sub>j</sub>, 1 &lt;=
-   * j &lt;= m</i>.
+   * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static
+   * type of <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of
+   * <i>p<sub>i</sub>, 1 &lt;= i &lt;= n+k</i> and let <i>S<sub>q</sub></i> be
+   * the type of the named parameter <i>q</i> of <i>f</i>. It is a static
+   * warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<sub>j</sub>, 1
+   * &lt;= j &lt;= m</i>.
    */
-  static const StaticWarningCode MAP_KEY_TYPE_NOT_ASSIGNABLE = const StaticWarningCode.con1('MAP_KEY_TYPE_NOT_ASSIGNABLE', 43, "The element type '{0}' cannot be assigned to the map key type '{1}'");
+  static const StaticWarningCode MAP_KEY_TYPE_NOT_ASSIGNABLE = const StaticWarningCode('MAP_KEY_TYPE_NOT_ASSIGNABLE', "The element type '{0}' cannot be assigned to the map key type '{1}'");
 
   /**
-   * 12.7 Map: A run-time map literal &lt;<i>K</i>, <i>V</i>&gt; [<i>k<sub>1</sub></i> :
-   * <i>e<sub>1</sub></i> &hellip; <i>k<sub>n</sub></i> : <i>e<sub>n</sub></i>] is evaluated as
-   * follows:
-   * * The operator []= is invoked on <i>m</i> with first argument <i>k<sub>i</sub></i> and second
-   * argument <i>e<sub>i</sub></i><i>, 1 &lt;= i &lt;= n</i>
+   * 12.7 Map: A run-time map literal &lt;<i>K</i>, <i>V</i>&gt;
+   * [<i>k<sub>1</sub></i> : <i>e<sub>1</sub></i> &hellip; <i>k<sub>n</sub></i>
+   * : <i>e<sub>n</sub></i>] is evaluated as follows:
+   * * The operator []= is invoked on <i>m</i> with first argument
+   *   <i>k<sub>i</sub></i> and second argument <i>e<sub>i</sub></i><i>, 1 &lt;=
+   *   i &lt;= n</i>
    *
-   * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of
-   * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</sub>, 1 &lt;= i &lt;=
-   * n+k</i> and let <i>S<sub>q</sub></i> be the type of the named parameter <i>q</i> of <i>f</i>.
-   * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<sub>j</sub>, 1 &lt;=
-   * j &lt;= m</i>.
+   * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static
+   * type of <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of
+   * <i>p<sub>i</sub>, 1 &lt;= i &lt;= n+k</i> and let <i>S<sub>q</sub></i> be
+   * the type of the named parameter <i>q</i> of <i>f</i>. It is a static
+   * warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<sub>j</sub>, 1
+   * &lt;= j &lt;= m</i>.
    */
-  static const StaticWarningCode MAP_VALUE_TYPE_NOT_ASSIGNABLE = const StaticWarningCode.con1('MAP_VALUE_TYPE_NOT_ASSIGNABLE', 44, "The element type '{0}' cannot be assigned to the map value type '{1}'");
+  static const StaticWarningCode MAP_VALUE_TYPE_NOT_ASSIGNABLE = const StaticWarningCode('MAP_VALUE_TYPE_NOT_ASSIGNABLE', "The element type '{0}' cannot be assigned to the map value type '{1}'");
 
   /**
-   * 7.3 Setters: It is a static warning if a class has a setter named <i>v=</i> with argument type
-   * <i>T</i> and a getter named <i>v</i> with return type <i>S</i>, and <i>T</i> may not be
-   * assigned to <i>S</i>.
+   * 7.3 Setters: It is a static warning if a class has a setter named <i>v=</i>
+   * with argument type <i>T</i> and a getter named <i>v</i> with return type
+   * <i>S</i>, and <i>T</i> may not be assigned to <i>S</i>.
    */
-  static const StaticWarningCode MISMATCHED_GETTER_AND_SETTER_TYPES = const StaticWarningCode.con1('MISMATCHED_GETTER_AND_SETTER_TYPES', 45, "The parameter type for setter '{0}' is '{1}' which is not assignable to its getter (of type '{2}')");
+  static const StaticWarningCode MISMATCHED_GETTER_AND_SETTER_TYPES = const StaticWarningCode('MISMATCHED_GETTER_AND_SETTER_TYPES', "The parameter type for setter '{0}' is '{1}' which is not assignable to its getter (of type '{2}')");
 
   /**
-   * 7.3 Setters: It is a static warning if a class has a setter named <i>v=</i> with argument type
-   * <i>T</i> and a getter named <i>v</i> with return type <i>S</i>, and <i>T</i> may not be
-   * assigned to <i>S</i>.
+   * 7.3 Setters: It is a static warning if a class has a setter named <i>v=</i>
+   * with argument type <i>T</i> and a getter named <i>v</i> with return type
+   * <i>S</i>, and <i>T</i> may not be assigned to <i>S</i>.
    */
-  static const StaticWarningCode MISMATCHED_GETTER_AND_SETTER_TYPES_FROM_SUPERTYPE = const StaticWarningCode.con1('MISMATCHED_GETTER_AND_SETTER_TYPES_FROM_SUPERTYPE', 46, "The parameter type for setter '{0}' is '{1}' which is not assignable to its getter (of type '{2}'), from superclass '{3}'");
+  static const StaticWarningCode MISMATCHED_GETTER_AND_SETTER_TYPES_FROM_SUPERTYPE = const StaticWarningCode('MISMATCHED_GETTER_AND_SETTER_TYPES_FROM_SUPERTYPE', "The parameter type for setter '{0}' is '{1}' which is not assignable to its getter (of type '{2}'), from superclass '{3}'");
 
   /**
-   * 13.12 Return: It is a static warning if a function contains both one or more return statements
-   * of the form <i>return;</i> and one or more return statements of the form <i>return e;</i>.
+   * 13.12 Return: It is a static warning if a function contains both one or
+   * more return statements of the form <i>return;</i> and one or more return
+   * statements of the form <i>return e;</i>.
    */
-  static const StaticWarningCode MIXED_RETURN_TYPES = const StaticWarningCode.con1('MIXED_RETURN_TYPES', 47, "Methods and functions cannot use return both with and without values");
+  static const StaticWarningCode MIXED_RETURN_TYPES = const StaticWarningCode('MIXED_RETURN_TYPES', "Methods and functions cannot use return both with and without values");
 
   /**
-   * 12.11.1 New: It is a static warning if <i>q</i> is a constructor of an abstract class and
-   * <i>q</i> is not a factory constructor.
+   * 12.11.1 New: It is a static warning if <i>q</i> is a constructor of an
+   * abstract class and <i>q</i> is not a factory constructor.
    */
-  static const StaticWarningCode NEW_WITH_ABSTRACT_CLASS = const StaticWarningCode.con1('NEW_WITH_ABSTRACT_CLASS', 48, "Abstract classes cannot be created with a 'new' expression");
+  static const StaticWarningCode NEW_WITH_ABSTRACT_CLASS = const StaticWarningCode('NEW_WITH_ABSTRACT_CLASS', "Abstract classes cannot be created with a 'new' expression");
 
   /**
-   * 15.8 Parameterized Types: Any use of a malbounded type gives rise to a static warning.
+   * 15.8 Parameterized Types: Any use of a malbounded type gives rise to a
+   * static warning.
    *
    * @param typeName the name of the type being referenced (<i>S</i>)
    * @param parameterCount the number of type parameters that were declared
    * @param argumentCount the number of type arguments provided
-   * @see CompileTimeErrorCode#CONST_WITH_INVALID_TYPE_PARAMETERS
-   * @see StaticTypeWarningCode#WRONG_NUMBER_OF_TYPE_ARGUMENTS
+   * See [CompileTimeErrorCode.CONST_WITH_INVALID_TYPE_PARAMETERS], and
+   * [StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS].
    */
-  static const StaticWarningCode NEW_WITH_INVALID_TYPE_PARAMETERS = const StaticWarningCode.con1('NEW_WITH_INVALID_TYPE_PARAMETERS', 49, "The type '{0}' is declared with {1} type parameters, but {2} type arguments were given");
+  static const StaticWarningCode NEW_WITH_INVALID_TYPE_PARAMETERS = const StaticWarningCode('NEW_WITH_INVALID_TYPE_PARAMETERS', "The type '{0}' is declared with {1} type parameters, but {2} type arguments were given");
 
   /**
-   * 12.11.1 New: It is a static warning if <i>T</i> is not a class accessible in the current scope,
-   * optionally followed by type arguments.
+   * 12.11.1 New: It is a static warning if <i>T</i> is not a class accessible
+   * in the current scope, optionally followed by type arguments.
    *
    * @param name the name of the non-type element
    */
-  static const StaticWarningCode NEW_WITH_NON_TYPE = const StaticWarningCode.con1('NEW_WITH_NON_TYPE', 50, "The name '{0}' is not a class");
+  static const StaticWarningCode NEW_WITH_NON_TYPE = const StaticWarningCode('NEW_WITH_NON_TYPE', "The name '{0}' is not a class");
 
   /**
-   * 12.11.1 New: If <i>T</i> is a class or parameterized type accessible in the current scope then:
-   * 1. If <i>e</i> is of the form <i>new T.id(a<sub>1</sub>, &hellip;, a<sub>n</sub>,
-   * x<sub>n+1</sub>: a<sub>n+1</sub>, &hellip;, x<sub>n+k</sub>: a<sub>n+k</sub>)</i> it is a
-   * static warning if <i>T.id</i> is not the name of a constructor declared by the type <i>T</i>.
-   * If <i>e</i> of the form <i>new T(a<sub>1</sub>, &hellip;, a<sub>n</sub>, x<sub>n+1</sub>:
-   * a<sub>n+1</sub>, &hellip;, x<sub>n+k</sub>: a<sub>n+kM/sub>)</i> it is a static warning if the
-   * type <i>T</i> does not declare a constructor with the same name as the declaration of <i>T</i>.
+   * 12.11.1 New: If <i>T</i> is a class or parameterized type accessible in the
+   * current scope then:
+   * 1. If <i>e</i> is of the form <i>new T.id(a<sub>1</sub>, &hellip;,
+   *    a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</sub>, &hellip;,
+   *    x<sub>n+k</sub>: a<sub>n+k</sub>)</i> it is a static warning if
+   *    <i>T.id</i> is not the name of a constructor declared by the type
+   *    <i>T</i>.
+   * If <i>e</i> of the form <i>new T(a<sub>1</sub>, &hellip;, a<sub>n</sub>,
+   * x<sub>n+1</sub>: a<sub>n+1</sub>, &hellip;, x<sub>n+k</sub>:
+   * a<sub>n+kM/sub>)</i> it is a static warning if the type <i>T</i> does not
+   * declare a constructor with the same name as the declaration of <i>T</i>.
    */
-  static const StaticWarningCode NEW_WITH_UNDEFINED_CONSTRUCTOR = const StaticWarningCode.con1('NEW_WITH_UNDEFINED_CONSTRUCTOR', 51, "The class '{0}' does not have a constructor '{1}'");
+  static const StaticWarningCode NEW_WITH_UNDEFINED_CONSTRUCTOR = const StaticWarningCode('NEW_WITH_UNDEFINED_CONSTRUCTOR', "The class '{0}' does not have a constructor '{1}'");
 
   /**
-   * 12.11.1 New: If <i>T</i> is a class or parameterized type accessible in the current scope then:
-   * 1. If <i>e</i> is of the form <i>new T.id(a<sub>1</sub>, &hellip;, a<sub>n</sub>,
-   * x<sub>n+1</sub>: a<sub>n+1</sub>, &hellip;, x<sub>n+k</sub>: a<sub>n+k</sub>)</i> it is a
-   * static warning if <i>T.id</i> is not the name of a constructor declared by the type <i>T</i>.
-   * If <i>e</i> of the form <i>new T(a<sub>1</sub>, &hellip;, a<sub>n</sub>, x<sub>n+1</sub>:
-   * a<sub>n+1</sub>, &hellip;, x<sub>n+k</sub>: a<sub>n+kM/sub>)</i> it is a static warning if the
-   * type <i>T</i> does not declare a constructor with the same name as the declaration of <i>T</i>.
+   * 12.11.1 New: If <i>T</i> is a class or parameterized type accessible in the
+   * current scope then:
+   * 1. If <i>e</i> is of the form <i>new T.id(a<sub>1</sub>, &hellip;,
+   * a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</sub>, &hellip;, x<sub>n+k</sub>:
+   * a<sub>n+k</sub>)</i> it is a static warning if <i>T.id</i> is not the name
+   * of a constructor declared by the type <i>T</i>. If <i>e</i> of the form
+   * <i>new T(a<sub>1</sub>, &hellip;, a<sub>n</sub>, x<sub>n+1</sub>:
+   * a<sub>n+1</sub>, &hellip;, x<sub>n+k</sub>: a<sub>n+kM/sub>)</i> it is a
+   * static warning if the type <i>T</i> does not declare a constructor with the
+   * same name as the declaration of <i>T</i>.
    */
-  static const StaticWarningCode NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT = const StaticWarningCode.con1('NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT', 52, "The class '{0}' does not have a default constructor");
+  static const StaticWarningCode NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT = const StaticWarningCode('NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT', "The class '{0}' does not have a default constructor");
 
   /**
-   * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract class inherits an
-   * abstract method.
+   * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract
+   * class inherits an abstract method.
    *
-   * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not declare its own
-   * <i>noSuchMethod()</i> method. It is a static warning if the implicit interface of <i>C</i>
-   * includes an instance member <i>m</i> of type <i>F</i> and <i>C</i> does not declare or inherit
-   * a corresponding instance member <i>m</i> of type <i>F'</i> such that <i>F' <: F</i>.
+   * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not
+   * declare its own <i>noSuchMethod()</i> method. It is a static warning if the
+   * implicit interface of <i>C</i> includes an instance member <i>m</i> of type
+   * <i>F</i> and <i>C</i> does not declare or inherit a corresponding instance
+   * member <i>m</i> of type <i>F'</i> such that <i>F' <: F</i>.
    *
-   * 7.4 Abstract Instance Members: It is a static warning if an abstract member is declared or
-   * inherited in a concrete class unless that member overrides a concrete one.
+   * 7.4 Abstract Instance Members: It is a static warning if an abstract member
+   * is declared or inherited in a concrete class unless that member overrides a
+   * concrete one.
    *
    * @param memberName the name of the first member
    * @param memberName the name of the second member
    * @param memberName the name of the third member
    * @param memberName the name of the fourth member
-   * @param additionalCount the number of additional missing members that aren't listed
+   * @param additionalCount the number of additional missing members that aren't
+   *        listed
    */
-  static const StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FIVE_PLUS = const StaticWarningCode.con1('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FIVE_PLUS', 53, "Missing concrete implementation of {0}, {1}, {2}, {3} and {4} more");
+  static const StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FIVE_PLUS = const StaticWarningCode('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FIVE_PLUS', "Missing concrete implementation of {0}, {1}, {2}, {3} and {4} more");
 
   /**
-   * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract class inherits an
-   * abstract method.
+   * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract
+   * class inherits an abstract method.
    *
-   * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not declare its own
-   * <i>noSuchMethod()</i> method. It is a static warning if the implicit interface of <i>C</i>
-   * includes an instance member <i>m</i> of type <i>F</i> and <i>C</i> does not declare or inherit
-   * a corresponding instance member <i>m</i> of type <i>F'</i> such that <i>F' <: F</i>.
+   * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not
+   * declare its own <i>noSuchMethod()</i> method. It is a static warning if the
+   * implicit interface of <i>C</i> includes an instance member <i>m</i> of type
+   * <i>F</i> and <i>C</i> does not declare or inherit a corresponding instance
+   * member <i>m</i> of type <i>F'</i> such that <i>F' <: F</i>.
    *
-   * 7.4 Abstract Instance Members: It is a static warning if an abstract member is declared or
-   * inherited in a concrete class unless that member overrides a concrete one.
+   * 7.4 Abstract Instance Members: It is a static warning if an abstract member
+   * is declared or inherited in a concrete class unless that member overrides a
+   * concrete one.
    *
    * @param memberName the name of the first member
    * @param memberName the name of the second member
    * @param memberName the name of the third member
    * @param memberName the name of the fourth member
    */
-  static const StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOUR = const StaticWarningCode.con1('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOUR', 54, "Missing concrete implementation of {0}, {1}, {2} and {3}");
+  static const StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOUR = const StaticWarningCode('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOUR', "Missing concrete implementation of {0}, {1}, {2} and {3}");
 
   /**
-   * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract class inherits an
-   * abstract method.
+   * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract
+   * class inherits an abstract method.
    *
-   * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not declare its own
-   * <i>noSuchMethod()</i> method. It is a static warning if the implicit interface of <i>C</i>
-   * includes an instance member <i>m</i> of type <i>F</i> and <i>C</i> does not declare or inherit
-   * a corresponding instance member <i>m</i> of type <i>F'</i> such that <i>F' <: F</i>.
+   * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not
+   * declare its own <i>noSuchMethod()</i> method. It is a static warning if the
+   * implicit interface of <i>C</i> includes an instance member <i>m</i> of type
+   * <i>F</i> and <i>C</i> does not declare or inherit a corresponding instance
+   * member <i>m</i> of type <i>F'</i> such that <i>F' <: F</i>.
    *
-   * 7.4 Abstract Instance Members: It is a static warning if an abstract member is declared or
-   * inherited in a concrete class unless that member overrides a concrete one.
+   * 7.4 Abstract Instance Members: It is a static warning if an abstract member
+   * is declared or inherited in a concrete class unless that member overrides a
+   * concrete one.
    *
    * @param memberName the name of the member
    */
-  static const StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE = const StaticWarningCode.con1('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE', 55, "Missing concrete implementation of {0}");
+  static const StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE = const StaticWarningCode('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE', "Missing concrete implementation of {0}");
 
   /**
-   * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract class inherits an
-   * abstract method.
+   * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract
+   * class inherits an abstract method.
    *
-   * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not declare its own
-   * <i>noSuchMethod()</i> method. It is a static warning if the implicit interface of <i>C</i>
-   * includes an instance member <i>m</i> of type <i>F</i> and <i>C</i> does not declare or inherit
-   * a corresponding instance member <i>m</i> of type <i>F'</i> such that <i>F' <: F</i>.
+   * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not
+   * declare its own <i>noSuchMethod()</i> method. It is a static warning if the
+   * implicit interface of <i>C</i> includes an instance member <i>m</i> of type
+   * <i>F</i> and <i>C</i> does not declare or inherit a corresponding instance
+   * member <i>m</i> of type <i>F'</i> such that <i>F' <: F</i>.
    *
-   * 7.4 Abstract Instance Members: It is a static warning if an abstract member is declared or
-   * inherited in a concrete class unless that member overrides a concrete one.
+   * 7.4 Abstract Instance Members: It is a static warning if an abstract member
+   * is declared or inherited in a concrete class unless that member overrides a
+   * concrete one.
    *
    * @param memberName the name of the first member
    * @param memberName the name of the second member
    * @param memberName the name of the third member
    */
-  static const StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THREE = const StaticWarningCode.con1('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THREE', 56, "Missing concrete implementation of {0}, {1} and {2}");
+  static const StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THREE = const StaticWarningCode('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THREE', "Missing concrete implementation of {0}, {1} and {2}");
 
   /**
-   * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract class inherits an
-   * abstract method.
+   * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract
+   * class inherits an abstract method.
    *
-   * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not declare its own
-   * <i>noSuchMethod()</i> method. It is a static warning if the implicit interface of <i>C</i>
-   * includes an instance member <i>m</i> of type <i>F</i> and <i>C</i> does not declare or inherit
-   * a corresponding instance member <i>m</i> of type <i>F'</i> such that <i>F' <: F</i>.
+   * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not
+   * declare its own <i>noSuchMethod()</i> method. It is a static warning if the
+   * implicit interface of <i>C</i> includes an instance member <i>m</i> of type
+   * <i>F</i> and <i>C</i> does not declare or inherit a corresponding instance
+   * member <i>m</i> of type <i>F'</i> such that <i>F' <: F</i>.
    *
-   * 7.4 Abstract Instance Members: It is a static warning if an abstract member is declared or
-   * inherited in a concrete class unless that member overrides a concrete one.
+   * 7.4 Abstract Instance Members: It is a static warning if an abstract member
+   * is declared or inherited in a concrete class unless that member overrides a
+   * concrete one.
    *
    * @param memberName the name of the first member
    * @param memberName the name of the second member
    */
-  static const StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO = const StaticWarningCode.con1('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO', 57, "Missing concrete implementation of {0} and {1}");
+  static const StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO = const StaticWarningCode('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO', "Missing concrete implementation of {0} and {1}");
 
   /**
-   * 13.11 Try: An on-catch clause of the form <i>on T catch (p<sub>1</sub>, p<sub>2</sub>) s</i> or
-   * <i>on T s</i> matches an object <i>o</i> if the type of <i>o</i> is a subtype of <i>T</i>. It
-   * is a static warning if <i>T</i> does not denote a type available in the lexical scope of the
+   * 13.11 Try: An on-catch clause of the form <i>on T catch (p<sub>1</sub>,
+   * p<sub>2</sub>) s</i> or <i>on T s</i> matches an object <i>o</i> if the
+   * type of <i>o</i> is a subtype of <i>T</i>. It is a static warning if
+   * <i>T</i> does not denote a type available in the lexical scope of the
    * catch clause.
    *
    * @param name the name of the non-type element
    */
-  static const StaticWarningCode NON_TYPE_IN_CATCH_CLAUSE = const StaticWarningCode.con1('NON_TYPE_IN_CATCH_CLAUSE', 58, "The name '{0}' is not a type and cannot be used in an on-catch clause");
+  static const StaticWarningCode NON_TYPE_IN_CATCH_CLAUSE = const StaticWarningCode('NON_TYPE_IN_CATCH_CLAUSE', "The name '{0}' is not a type and cannot be used in an on-catch clause");
 
   /**
-   * 7.1.1 Operators: It is a static warning if the return type of the user-declared operator []= is
-   * explicitly declared and not void.
+   * 7.1.1 Operators: It is a static warning if the return type of the
+   * user-declared operator []= is explicitly declared and not void.
    */
-  static const StaticWarningCode NON_VOID_RETURN_FOR_OPERATOR = const StaticWarningCode.con1('NON_VOID_RETURN_FOR_OPERATOR', 59, "The return type of the operator []= must be 'void'");
+  static const StaticWarningCode NON_VOID_RETURN_FOR_OPERATOR = const StaticWarningCode('NON_VOID_RETURN_FOR_OPERATOR', "The return type of the operator []= must be 'void'");
 
   /**
-   * 7.3 Setters: It is a static warning if a setter declares a return type other than void.
+   * 7.3 Setters: It is a static warning if a setter declares a return type
+   * other than void.
    */
-  static const StaticWarningCode NON_VOID_RETURN_FOR_SETTER = const StaticWarningCode.con1('NON_VOID_RETURN_FOR_SETTER', 60, "The return type of the setter must be 'void'");
+  static const StaticWarningCode NON_VOID_RETURN_FOR_SETTER = const StaticWarningCode('NON_VOID_RETURN_FOR_SETTER', "The return type of the setter must be 'void'");
 
   /**
-   * 15.1 Static Types: A type <i>T</i> is malformed iff: * <i>T</i> has the form <i>id</i> or the
-   * form <i>prefix.id</i>, and in the enclosing lexical scope, the name <i>id</i> (respectively
-   * <i>prefix.id</i>) does not denote a type. * <i>T</i> denotes a type parameter in the
-   * enclosing lexical scope, but occurs in the signature or body of a static member. *
-   * <i>T</i> is a parameterized type of the form <i>G&lt;S<sub>1</sub>, .., S<sub>n</sub>&gt;</i>,
+   * 15.1 Static Types: A type <i>T</i> is malformed iff:
+   * * <i>T</i> has the form <i>id</i> or the form <i>prefix.id</i>, and in the
+   *   enclosing lexical scope, the name <i>id</i> (respectively
+   *   <i>prefix.id</i>) does not denote a type.
+   * * <i>T</i> denotes a type parameter in the enclosing lexical scope, but
+   * occurs in the signature or body of a static member.
+   * * <i>T</i> is a parameterized type of the form <i>G&lt;S<sub>1</sub>, ..,
+   * S<sub>n</sub>&gt;</i>,
    *
    * Any use of a malformed type gives rise to a static warning.
    *
    * @param nonTypeName the name that is not a type
    */
-  static const StaticWarningCode NOT_A_TYPE = const StaticWarningCode.con1('NOT_A_TYPE', 61, "{0} is not a type");
+  static const StaticWarningCode NOT_A_TYPE = const StaticWarningCode('NOT_A_TYPE', "{0} is not a type");
 
   /**
-   * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m &lt; h</i> or if <i>m &gt;
-   * n</i>.
+   * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m &lt;
+   * h</i> or if <i>m &gt; n</i>.
    *
    * @param requiredCount the expected number of required arguments
    * @param argumentCount the actual number of positional arguments given
-   * @see #EXTRA_POSITIONAL_ARGUMENTS
+   * See [EXTRA_POSITIONAL_ARGUMENTS].
    */
-  static const StaticWarningCode NOT_ENOUGH_REQUIRED_ARGUMENTS = const StaticWarningCode.con1('NOT_ENOUGH_REQUIRED_ARGUMENTS', 62, "{0} required argument(s) expected, but {1} found");
+  static const StaticWarningCode NOT_ENOUGH_REQUIRED_ARGUMENTS = const StaticWarningCode('NOT_ENOUGH_REQUIRED_ARGUMENTS', "{0} required argument(s) expected, but {1} found");
 
   /**
-   * 14.3 Parts: It is a static warning if the referenced part declaration <i>p</i> names a library
-   * other than the current library as the library to which <i>p</i> belongs.
+   * 14.3 Parts: It is a static warning if the referenced part declaration
+   * <i>p</i> names a library other than the current library as the library to
+   * which <i>p</i> belongs.
    *
    * @param expectedLibraryName the name of expected library name
-   * @param actualLibraryName the non-matching actual library name from the "part of" declaration
+   * @param actualLibraryName the non-matching actual library name from the
+   *        "part of" declaration
    */
-  static const StaticWarningCode PART_OF_DIFFERENT_LIBRARY = const StaticWarningCode.con1('PART_OF_DIFFERENT_LIBRARY', 63, "Expected this library to be part of '{0}', not '{1}'");
+  static const StaticWarningCode PART_OF_DIFFERENT_LIBRARY = const StaticWarningCode('PART_OF_DIFFERENT_LIBRARY', "Expected this library to be part of '{0}', not '{1}'");
 
   /**
-   * 7.6.2 Factories: It is a static warning if the function type of <i>k'</i> is not a subtype of
-   * the type of <i>k</i>.
+   * 7.6.2 Factories: It is a static warning if the function type of <i>k'</i>
+   * is not a subtype of the type of <i>k</i>.
    *
    * @param redirectedName the name of the redirected constructor
    * @param redirectingName the name of the redirecting constructor
    */
-  static const StaticWarningCode REDIRECT_TO_INVALID_FUNCTION_TYPE = const StaticWarningCode.con1('REDIRECT_TO_INVALID_FUNCTION_TYPE', 64, "The redirected constructor '{0}' has incompatible parameters with '{1}'");
+  static const StaticWarningCode REDIRECT_TO_INVALID_FUNCTION_TYPE = const StaticWarningCode('REDIRECT_TO_INVALID_FUNCTION_TYPE', "The redirected constructor '{0}' has incompatible parameters with '{1}'");
 
   /**
-   * 7.6.2 Factories: It is a static warning if the function type of <i>k'</i> is not a subtype of
-   * the type of <i>k</i>.
+   * 7.6.2 Factories: It is a static warning if the function type of <i>k'</i>
+   * is not a subtype of the type of <i>k</i>.
    *
    * @param redirectedName the name of the redirected constructor return type
    * @param redirectingName the name of the redirecting constructor return type
    */
-  static const StaticWarningCode REDIRECT_TO_INVALID_RETURN_TYPE = const StaticWarningCode.con1('REDIRECT_TO_INVALID_RETURN_TYPE', 65, "The return type '{0}' of the redirected constructor is not assignable to '{1}'");
+  static const StaticWarningCode REDIRECT_TO_INVALID_RETURN_TYPE = const StaticWarningCode('REDIRECT_TO_INVALID_RETURN_TYPE', "The return type '{0}' of the redirected constructor is not assignable to '{1}'");
 
   /**
-   * 7.6.2 Factories: It is a static warning if type does not denote a class accessible in the
-   * current scope; if type does denote such a class <i>C</i> it is a static warning if the
-   * referenced constructor (be it <i>type</i> or <i>type.id</i>) is not a constructor of <i>C</i>.
+   * 7.6.2 Factories: It is a static warning if type does not denote a class
+   * accessible in the current scope; if type does denote such a class <i>C</i>
+   * it is a static warning if the referenced constructor (be it <i>type</i> or
+   * <i>type.id</i>) is not a constructor of <i>C</i>.
    */
-  static const StaticWarningCode REDIRECT_TO_MISSING_CONSTRUCTOR = const StaticWarningCode.con1('REDIRECT_TO_MISSING_CONSTRUCTOR', 66, "The constructor '{0}' could not be found in '{1}'");
+  static const StaticWarningCode REDIRECT_TO_MISSING_CONSTRUCTOR = const StaticWarningCode('REDIRECT_TO_MISSING_CONSTRUCTOR', "The constructor '{0}' could not be found in '{1}'");
 
   /**
-   * 7.6.2 Factories: It is a static warning if type does not denote a class accessible in the
-   * current scope; if type does denote such a class <i>C</i> it is a static warning if the
-   * referenced constructor (be it <i>type</i> or <i>type.id</i>) is not a constructor of <i>C</i>.
+   * 7.6.2 Factories: It is a static warning if type does not denote a class
+   * accessible in the current scope; if type does denote such a class <i>C</i>
+   * it is a static warning if the referenced constructor (be it <i>type</i> or
+   * <i>type.id</i>) is not a constructor of <i>C</i>.
    */
-  static const StaticWarningCode REDIRECT_TO_NON_CLASS = const StaticWarningCode.con1('REDIRECT_TO_NON_CLASS', 67, "The name '{0}' is not a type and cannot be used in a redirected constructor");
+  static const StaticWarningCode REDIRECT_TO_NON_CLASS = const StaticWarningCode('REDIRECT_TO_NON_CLASS', "The name '{0}' is not a type and cannot be used in a redirected constructor");
 
   /**
-   * 13.12 Return: Let <i>f</i> be the function immediately enclosing a return statement of the form
-   * <i>return;</i> It is a static warning if both of the following conditions hold:
-   * <ol>
+   * 13.12 Return: Let <i>f</i> be the function immediately enclosing a return
+   * statement of the form <i>return;</i> It is a static warning if both of the
+   * following conditions hold:
    * * <i>f</i> is not a generative constructor.
    * * The return type of <i>f</i> may not be assigned to void.
-   * </ol>
    */
-  static const StaticWarningCode RETURN_WITHOUT_VALUE = const StaticWarningCode.con1('RETURN_WITHOUT_VALUE', 68, "Missing return value after 'return'");
+  static const StaticWarningCode RETURN_WITHOUT_VALUE = const StaticWarningCode('RETURN_WITHOUT_VALUE', "Missing return value after 'return'");
 
   /**
-   * 12.16.3 Static Invocation: It is a static warning if <i>C</i> does not declare a static method
-   * or getter <i>m</i>.
+   * 12.16.3 Static Invocation: It is a static warning if <i>C</i> does not
+   * declare a static method or getter <i>m</i>.
    *
    * @param memberName the name of the instance member
    */
-  static const StaticWarningCode STATIC_ACCESS_TO_INSTANCE_MEMBER = const StaticWarningCode.con1('STATIC_ACCESS_TO_INSTANCE_MEMBER', 69, "Instance member '{0}' cannot be accessed using static access");
+  static const StaticWarningCode STATIC_ACCESS_TO_INSTANCE_MEMBER = const StaticWarningCode('STATIC_ACCESS_TO_INSTANCE_MEMBER', "Instance member '{0}' cannot be accessed using static access");
 
   /**
-   * 13.9 Switch: It is a static warning if the type of <i>e</i> may not be assigned to the type of
-   * <i>e<sub>k</sub></i>.
+   * 13.9 Switch: It is a static warning if the type of <i>e</i> may not be
+   * assigned to the type of <i>e<sub>k</sub></i>.
    */
-  static const StaticWarningCode SWITCH_EXPRESSION_NOT_ASSIGNABLE = const StaticWarningCode.con1('SWITCH_EXPRESSION_NOT_ASSIGNABLE', 70, "Type '{0}' of the switch expression is not assignable to the type '{1}' of case expressions");
+  static const StaticWarningCode SWITCH_EXPRESSION_NOT_ASSIGNABLE = const StaticWarningCode('SWITCH_EXPRESSION_NOT_ASSIGNABLE', "Type '{0}' of the switch expression is not assignable to the type '{1}' of case expressions");
 
   /**
-   * 15.1 Static Types: It is a static warning to use a deferred type in a type annotation.
+   * 15.1 Static Types: It is a static warning to use a deferred type in a type
+   * annotation.
    *
-   * @param name the name of the type that is deferred and being used in a type annotation
+   * @param name the name of the type that is deferred and being used in a type
+   *        annotation
    */
-  static const StaticWarningCode TYPE_ANNOTATION_DEFERRED_CLASS = const StaticWarningCode.con1('TYPE_ANNOTATION_DEFERRED_CLASS', 71, "The deferred type '{0}' cannot be used in a declaration, cast or type test");
+  static const StaticWarningCode TYPE_ANNOTATION_DEFERRED_CLASS = const StaticWarningCode('TYPE_ANNOTATION_DEFERRED_CLASS', "The deferred type '{0}' cannot be used in a declaration, cast or type test");
 
   /**
-   * 12.31 Type Test: It is a static warning if <i>T</i> does not denote a type available in the
-   * current lexical scope.
+   * 12.31 Type Test: It is a static warning if <i>T</i> does not denote a type
+   * available in the current lexical scope.
    */
-  static const StaticWarningCode TYPE_TEST_NON_TYPE = const StaticWarningCode.con1('TYPE_TEST_NON_TYPE', 72, "The name '{0}' is not a type and cannot be used in an 'is' expression");
+  static const StaticWarningCode TYPE_TEST_NON_TYPE = const StaticWarningCode('TYPE_TEST_NON_TYPE', "The name '{0}' is not a type and cannot be used in an 'is' expression");
 
   /**
-   * 10 Generics: However, a type parameter is considered to be a malformed type when referenced by
-   * a static member.
+   * 10 Generics: However, a type parameter is considered to be a malformed type
+   * when referenced by a static member.
    *
-   * 15.1 Static Types: Any use of a malformed type gives rise to a static warning. A malformed type
-   * is then interpreted as dynamic by the static type checker and the runtime.
+   * 15.1 Static Types: Any use of a malformed type gives rise to a static
+   * warning. A malformed type is then interpreted as dynamic by the static type
+   * checker and the runtime.
    */
-  static const StaticWarningCode TYPE_PARAMETER_REFERENCED_BY_STATIC = const StaticWarningCode.con1('TYPE_PARAMETER_REFERENCED_BY_STATIC', 73, "Static members cannot reference type parameters");
+  static const StaticWarningCode TYPE_PARAMETER_REFERENCED_BY_STATIC = const StaticWarningCode('TYPE_PARAMETER_REFERENCED_BY_STATIC', "Static members cannot reference type parameters");
 
   /**
    * 12.16.3 Static Invocation: A static method invocation <i>i</i> has the form
-   * <i>C.m(a<sub>1</sub>, &hellip;, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</sub>, &hellip;
-   * x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. It is a static warning if <i>C</i> does not denote a
-   * class in the current scope.
+   * <i>C.m(a<sub>1</sub>, &hellip;, a<sub>n</sub>, x<sub>n+1</sub>:
+   * a<sub>n+1</sub>, &hellip; x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. It is a
+   * static warning if <i>C</i> does not denote a class in the current scope.
    *
    * @param undefinedClassName the name of the undefined class
    */
-  static const StaticWarningCode UNDEFINED_CLASS = const StaticWarningCode.con1('UNDEFINED_CLASS', 74, "Undefined class '{0}'");
+  static const StaticWarningCode UNDEFINED_CLASS = const StaticWarningCode('UNDEFINED_CLASS', "Undefined class '{0}'");
 
   /**
    * Same as [UNDEFINED_CLASS], but to catch using "boolean" instead of "bool".
    */
-  static const StaticWarningCode UNDEFINED_CLASS_BOOLEAN = const StaticWarningCode.con1('UNDEFINED_CLASS_BOOLEAN', 75, "Undefined class 'boolean'; did you mean 'bool'?");
+  static const StaticWarningCode UNDEFINED_CLASS_BOOLEAN = const StaticWarningCode('UNDEFINED_CLASS_BOOLEAN', "Undefined class 'boolean'; did you mean 'bool'?");
 
   /**
-   * 12.17 Getter Invocation: It is a static warning if there is no class <i>C</i> in the enclosing
-   * lexical scope of <i>i</i>, or if <i>C</i> does not declare, implicitly or explicitly, a getter
-   * named <i>m</i>.
+   * 12.17 Getter Invocation: It is a static warning if there is no class
+   * <i>C</i> in the enclosing lexical scope of <i>i</i>, or if <i>C</i> does
+   * not declare, implicitly or explicitly, a getter named <i>m</i>.
    *
    * @param getterName the name of the getter
-   * @param enclosingType the name of the enclosing type where the getter is being looked for
+   * @param enclosingType the name of the enclosing type where the getter is
+   *        being looked for
    */
-  static const StaticWarningCode UNDEFINED_GETTER = const StaticWarningCode.con1('UNDEFINED_GETTER', 76, "There is no such getter '{0}' in '{1}'");
+  static const StaticWarningCode UNDEFINED_GETTER = const StaticWarningCode('UNDEFINED_GETTER', "There is no such getter '{0}' in '{1}'");
 
   /**
-   * 12.30 Identifier Reference: It is as static warning if an identifier expression of the form
-   * <i>id</i> occurs inside a top level or static function (be it function, method, getter, or
-   * setter) or variable initializer and there is no declaration <i>d</i> with name <i>id</i> in the
+   * 12.30 Identifier Reference: It is as static warning if an identifier
+   * expression of the form <i>id</i> occurs inside a top level or static
+   * function (be it function, method, getter, or setter) or variable
+   * initializer and there is no declaration <i>d</i> with name <i>id</i> in the
    * lexical scope enclosing the expression.
    *
    * @param name the name of the identifier
    */
-  static const StaticWarningCode UNDEFINED_IDENTIFIER = const StaticWarningCode.con1('UNDEFINED_IDENTIFIER', 77, "Undefined name '{0}'");
+  static const StaticWarningCode UNDEFINED_IDENTIFIER = const StaticWarningCode('UNDEFINED_IDENTIFIER', "Undefined name '{0}'");
 
   /**
-   * 12.14.2 Binding Actuals to Formals: Furthermore, each <i>q<sub>i</sub></i>, <i>1<=i<=l</i>,
-   * must have a corresponding named parameter in the set {<i>p<sub>n+1</sub></i> &hellip;
-   * <i>p<sub>n+k</sub></i>} or a static warning occurs.
+   * 12.14.2 Binding Actuals to Formals: Furthermore, each <i>q<sub>i</sub></i>,
+   * <i>1<=i<=l</i>, must have a corresponding named parameter in the set
+   * {<i>p<sub>n+1</sub></i> &hellip; <i>p<sub>n+k</sub></i>} or a static
+   * warning occurs.
    *
    * @param name the name of the requested named parameter
    */
-  static const StaticWarningCode UNDEFINED_NAMED_PARAMETER = const StaticWarningCode.con1('UNDEFINED_NAMED_PARAMETER', 78, "The named parameter '{0}' is not defined");
+  static const StaticWarningCode UNDEFINED_NAMED_PARAMETER = const StaticWarningCode('UNDEFINED_NAMED_PARAMETER', "The named parameter '{0}' is not defined");
 
   /**
-   * 12.18 Assignment: It is as static warning if an assignment of the form <i>v = e</i> occurs
-   * inside a top level or static function (be it function, method, getter, or setter) or variable
-   * initializer and there is no declaration <i>d</i> with name <i>v=</i> in the lexical scope
-   * enclosing the assignment.
+   * 12.18 Assignment: It is as static warning if an assignment of the form
+   * <i>v = e</i> occurs inside a top level or static function (be it function,
+   * method, getter, or setter) or variable initializer and there is no
+   * declaration <i>d</i> with name <i>v=</i> in the lexical scope enclosing the
+   * assignment.
    *
-   * 12.18 Assignment: It is a static warning if there is no class <i>C</i> in the enclosing lexical
-   * scope of the assignment, or if <i>C</i> does not declare, implicitly or explicitly, a setter
-   * <i>v=</i>.
+   * 12.18 Assignment: It is a static warning if there is no class <i>C</i> in
+   * the enclosing lexical scope of the assignment, or if <i>C</i> does not
+   * declare, implicitly or explicitly, a setter <i>v=</i>.
    *
    * @param setterName the name of the getter
-   * @param enclosingType the name of the enclosing type where the setter is being looked for
+   * @param enclosingType the name of the enclosing type where the setter is
+   *        being looked for
    */
-  static const StaticWarningCode UNDEFINED_SETTER = const StaticWarningCode.con1('UNDEFINED_SETTER', 79, "There is no such setter '{0}' in '{1}'");
+  static const StaticWarningCode UNDEFINED_SETTER = const StaticWarningCode('UNDEFINED_SETTER', "There is no such setter '{0}' in '{1}'");
 
   /**
-   * 12.16.3 Static Invocation: It is a static warning if <i>C</i> does not declare a static method
-   * or getter <i>m</i>.
+   * 12.16.3 Static Invocation: It is a static warning if <i>C</i> does not
+   * declare a static method or getter <i>m</i>.
    *
    * @param methodName the name of the method
-   * @param enclosingType the name of the enclosing type where the method is being looked for
+   * @param enclosingType the name of the enclosing type where the method is
+   *        being looked for
    */
-  static const StaticWarningCode UNDEFINED_STATIC_METHOD_OR_GETTER = const StaticWarningCode.con1('UNDEFINED_STATIC_METHOD_OR_GETTER', 80, "There is no such static method, getter or setter '{0}' in '{1}'");
+  static const StaticWarningCode UNDEFINED_STATIC_METHOD_OR_GETTER = const StaticWarningCode('UNDEFINED_STATIC_METHOD_OR_GETTER', "There is no such static method, getter or setter '{0}' in '{1}'");
 
   /**
    * 7.2 Getters: It is a static warning if the return type of a getter is void.
    */
-  static const StaticWarningCode VOID_RETURN_FOR_GETTER = const StaticWarningCode.con1('VOID_RETURN_FOR_GETTER', 81, "The return type of the getter must not be 'void'");
-
-  static const List<StaticWarningCode> values = const [
-      AMBIGUOUS_IMPORT,
-      ARGUMENT_TYPE_NOT_ASSIGNABLE,
-      ASSIGNMENT_TO_CONST,
-      ASSIGNMENT_TO_FINAL,
-      ASSIGNMENT_TO_FINAL_NO_SETTER,
-      ASSIGNMENT_TO_FUNCTION,
-      ASSIGNMENT_TO_METHOD,
-      CASE_BLOCK_NOT_TERMINATED,
-      CAST_TO_NON_TYPE,
-      CONCRETE_CLASS_WITH_ABSTRACT_MEMBER,
-      CONFLICTING_DART_IMPORT,
-      CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER,
-      CONFLICTING_INSTANCE_METHOD_SETTER,
-      CONFLICTING_INSTANCE_METHOD_SETTER2,
-      CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_MEMBER,
-      CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER,
-      CONFLICTING_STATIC_SETTER_AND_INSTANCE_MEMBER,
-      CONST_WITH_ABSTRACT_CLASS,
-      EQUAL_KEYS_IN_MAP,
-      EXPORT_DUPLICATED_LIBRARY_NAME,
-      EXTRA_POSITIONAL_ARGUMENTS,
-      FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION,
-      FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR,
-      FIELD_INITIALIZER_NOT_ASSIGNABLE,
-      FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE,
-      FINAL_NOT_INITIALIZED,
-      FUNCTION_WITHOUT_CALL,
-      IMPORT_DUPLICATED_LIBRARY_NAME,
-      IMPORT_OF_NON_LIBRARY,
-      INCONSISTENT_METHOD_INHERITANCE_GETTER_AND_METHOD,
-      INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC,
-      INVALID_GETTER_OVERRIDE_RETURN_TYPE,
-      INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE,
-      INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE,
-      INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE,
-      INVALID_METHOD_OVERRIDE_RETURN_TYPE,
-      INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_NAMED,
-      INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_POSITIONAL,
-      INVALID_OVERRIDE_NAMED,
-      INVALID_OVERRIDE_POSITIONAL,
-      INVALID_OVERRIDE_REQUIRED,
-      INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE,
-      LIST_ELEMENT_TYPE_NOT_ASSIGNABLE,
-      MAP_KEY_TYPE_NOT_ASSIGNABLE,
-      MAP_VALUE_TYPE_NOT_ASSIGNABLE,
-      MISMATCHED_GETTER_AND_SETTER_TYPES,
-      MISMATCHED_GETTER_AND_SETTER_TYPES_FROM_SUPERTYPE,
-      MIXED_RETURN_TYPES,
-      NEW_WITH_ABSTRACT_CLASS,
-      NEW_WITH_INVALID_TYPE_PARAMETERS,
-      NEW_WITH_NON_TYPE,
-      NEW_WITH_UNDEFINED_CONSTRUCTOR,
-      NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT,
-      NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FIVE_PLUS,
-      NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOUR,
-      NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE,
-      NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THREE,
-      NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO,
-      NON_TYPE_IN_CATCH_CLAUSE,
-      NON_VOID_RETURN_FOR_OPERATOR,
-      NON_VOID_RETURN_FOR_SETTER,
-      NOT_A_TYPE,
-      NOT_ENOUGH_REQUIRED_ARGUMENTS,
-      PART_OF_DIFFERENT_LIBRARY,
-      REDIRECT_TO_INVALID_FUNCTION_TYPE,
-      REDIRECT_TO_INVALID_RETURN_TYPE,
-      REDIRECT_TO_MISSING_CONSTRUCTOR,
-      REDIRECT_TO_NON_CLASS,
-      RETURN_WITHOUT_VALUE,
-      STATIC_ACCESS_TO_INSTANCE_MEMBER,
-      SWITCH_EXPRESSION_NOT_ASSIGNABLE,
-      TYPE_ANNOTATION_DEFERRED_CLASS,
-      TYPE_TEST_NON_TYPE,
-      TYPE_PARAMETER_REFERENCED_BY_STATIC,
-      UNDEFINED_CLASS,
-      UNDEFINED_CLASS_BOOLEAN,
-      UNDEFINED_GETTER,
-      UNDEFINED_IDENTIFIER,
-      UNDEFINED_NAMED_PARAMETER,
-      UNDEFINED_SETTER,
-      UNDEFINED_STATIC_METHOD_OR_GETTER,
-      VOID_RETURN_FOR_GETTER];
+  static const StaticWarningCode VOID_RETURN_FOR_GETTER = const StaticWarningCode('VOID_RETURN_FOR_GETTER', "The return type of the getter must not be 'void'");
 
   /**
-   * The template used to create the message to be displayed for this error.
+   * Initialize a newly created error code to have the given [name]. The message
+   * associated with the error will be created from the given [message]
+   * template. The correction associated with the error will be created from the
+   * given [correction] template.
    */
-  final String message;
-
-  /**
-   * The template used to create the correction to be displayed for this error, or `null` if
-   * there is no correction information for this error.
-   */
-  final String correction;
-
-  /**
-   * Initialize a newly created error code to have the given message.
-   *
-   * @param message the message template used to create the message to be displayed for the error
-   */
-  const StaticWarningCode.con1(String name, int ordinal, String message) : this.con2(name, ordinal, message, null);
-
-  /**
-   * Initialize a newly created error code to have the given message and correction.
-   *
-   * @param message the template used to create the message to be displayed for the error
-   * @param correction the template used to create the correction to be displayed for the error
-   */
-  const StaticWarningCode.con2(String name, int ordinal, this.message, this.correction) : super(name, ordinal);
+  const StaticWarningCode(String name, String message, [String correction]) : super(name, message, correction);
 
   @override
   ErrorSeverity get errorSeverity => ErrorType.STATIC_WARNING.severity;
 
   @override
   ErrorType get type => ErrorType.STATIC_WARNING;
-
-  @override
-  String get uniqueName => "$runtimeType.$name";
 }
 
 /**
- * The enumeration `TodoCode` defines the single TODO `ErrorCode`.
+ * The class `TodoCode` defines the single TODO error code.
  */
-class TodoCode extends Enum<TodoCode> implements ErrorCode {
+class TodoCode extends ErrorCode {
   /**
    * The single enum of TodoCode.
    */
-  static const TodoCode TODO = const TodoCode('TODO', 0);
-
-  static const List<TodoCode> values = const [TODO];
+  static const TodoCode TODO = const TodoCode('TODO');
 
   /**
    * This matches the two common Dart task styles
@@ -4202,20 +4069,14 @@
    */
   static RegExp TODO_REGEX = new RegExp("([\\s/\\*])((TODO[^\\w\\d][^\\r\\n]*)|(TODO:?\$))");
 
-  const TodoCode(String name, int ordinal) : super(name, ordinal);
-
-  @override
-  String get correction => null;
+  /**
+   * Initialize a newly created error code to have the given [name].
+   */
+  const TodoCode(String name) : super(name, "{0}");
 
   @override
   ErrorSeverity get errorSeverity => ErrorSeverity.INFO;
 
   @override
-  String get message => "{0}";
-
-  @override
   ErrorType get type => ErrorType.TODO;
-
-  @override
-  String get uniqueName => "$runtimeType.$name";
 }
\ No newline at end of file
diff --git a/pkg/analyzer/lib/src/generated/error_verifier.dart b/pkg/analyzer/lib/src/generated/error_verifier.dart
index 74542c1..ec2f4e3 100644
--- a/pkg/analyzer/lib/src/generated/error_verifier.dart
+++ b/pkg/analyzer/lib/src/generated/error_verifier.dart
@@ -90,7 +90,7 @@
    * This is set to `true` iff the visitor is currently visiting children nodes of a
    * [ConstructorDeclaration] and the constructor is 'const'.
    *
-   * @see #visitConstructorDeclaration(ConstructorDeclaration)
+   * See [visitConstructorDeclaration].
    */
   bool _isEnclosingConstructorConst = false;
 
@@ -108,7 +108,7 @@
    * This is set to `true` iff the visitor is currently visiting children nodes of a
    * [CatchClause].
    *
-   * @see #visitCatchClause(CatchClause)
+   * See [visitCatchClause].
    */
   bool _isInCatchClause = false;
 
@@ -187,7 +187,7 @@
    * This is set to `false` on the entry of every [BlockFunctionBody], and is restored
    * to the enclosing value on exit. The value is used in
    * [checkForMixedReturns] to prevent both
-   * [StaticWarningCode#MIXED_RETURN_TYPES] and [StaticWarningCode#RETURN_WITHOUT_VALUE]
+   * [StaticWarningCode.MIXED_RETURN_TYPES] and [StaticWarningCode.RETURN_WITHOUT_VALUE]
    * from being generated in the same function body.
    */
   bool _hasReturnWithoutValue = false;
@@ -221,14 +221,13 @@
    * not in an enclosing class declaration, then the map is set to `null`.
    *
    * When set the map maps the set of [FieldElement]s in the class to an
-   * [INIT_STATE#NOT_INIT] or [INIT_STATE#INIT_IN_DECLARATION]. <code>checkFor*</code>
+   * [INIT_STATE.NOT_INIT] or [INIT_STATE.INIT_IN_DECLARATION]. <code>checkFor*</code>
    * methods, specifically [checkForAllFinalInitializedErrorCodes],
    * can make a copy of the map to compute error code states. <code>checkFor*</code> methods should
    * only ever make a copy, or read from this map after it has been set in
    * [visitClassDeclaration].
    *
-   * @see #visitClassDeclaration(ClassDeclaration)
-   * @see #checkForAllFinalInitializedErrorCodes(ConstructorDeclaration)
+   * See [visitClassDeclaration], and [_checkForAllFinalInitializedErrorCodes].
    */
   HashMap<FieldElement, INIT_STATE> _initialFieldElementsMap;
 
@@ -253,26 +252,26 @@
   HashSet<String> _namesForReferenceToDeclaredVariableInInitializer = new HashSet<String>();
 
   /**
-   * A list of types used by the [CompileTimeErrorCode#EXTENDS_DISALLOWED_CLASS] and
-   * [CompileTimeErrorCode#IMPLEMENTS_DISALLOWED_CLASS] error codes.
+   * A list of types used by the [CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS] and
+   * [CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS] error codes.
    */
   List<InterfaceType> _DISALLOWED_TYPES_TO_EXTEND_OR_IMPLEMENT;
 
   /**
    * Static final string with value `"getter "` used in the construction of the
-   * [StaticWarningCode#NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE], and similar, error
+   * [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE], and similar, error
    * code messages.
    *
-   * @see #checkForNonAbstractClassInheritsAbstractMember(ClassDeclaration)
+   * See [_checkForNonAbstractClassInheritsAbstractMember].
    */
   static String _GETTER_SPACE = "getter ";
 
   /**
    * Static final string with value `"setter "` used in the construction of the
-   * [StaticWarningCode#NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE], and similar, error
+   * [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE], and similar, error
    * code messages.
    *
-   * @see #checkForNonAbstractClassInheritsAbstractMember(ClassDeclaration)
+   * See [_checkForNonAbstractClassInheritsAbstractMember].
    */
   static String _SETTER_SPACE = "setter ";
 
@@ -342,7 +341,7 @@
   @override
   Object visitAwaitExpression(AwaitExpression node) {
     if (!_inAsync) {
-      _errorReporter.reportErrorForToken(CompileTimeErrorCode.AWAIT_IN_WRONG_CONTEXT, node.awaitKeyword, []);
+      _errorReporter.reportErrorForToken(CompileTimeErrorCode.AWAIT_IN_WRONG_CONTEXT, node.awaitKeyword);
     }
     return super.visitAwaitExpression(node);
   }
@@ -392,7 +391,7 @@
     if (labelNode != null) {
       Element labelElement = labelNode.staticElement;
       if (labelElement is LabelElementImpl && labelElement.isOnSwitchMember) {
-        _errorReporter.reportErrorForNode(ResolverErrorCode.BREAK_LABEL_ON_SWITCH_MEMBER, labelNode, []);
+        _errorReporter.reportErrorForNode(ResolverErrorCode.BREAK_LABEL_ON_SWITCH_MEMBER, labelNode);
       }
     }
     return null;
@@ -553,7 +552,7 @@
     if (labelNode != null) {
       Element labelElement = labelNode.staticElement;
       if (labelElement is LabelElementImpl && labelElement.isOnSwitchStatement) {
-        _errorReporter.reportErrorForNode(ResolverErrorCode.CONTINUE_LABEL_ON_SWITCH, labelNode, []);
+        _errorReporter.reportErrorForNode(ResolverErrorCode.CONTINUE_LABEL_ON_SWITCH, labelNode);
       }
     }
     return null;
@@ -608,7 +607,7 @@
     if (_isInInstanceVariableDeclaration) {
       VariableDeclarationList variables = node.fields;
       if (variables.isConst) {
-        _errorReporter.reportErrorForToken(CompileTimeErrorCode.CONST_INSTANCE_FIELD, variables.keyword, []);
+        _errorReporter.reportErrorForToken(CompileTimeErrorCode.CONST_INSTANCE_FIELD, variables.keyword);
       }
     }
     try {
@@ -683,7 +682,7 @@
     Expression functionExpression = node.function;
     DartType expressionType = functionExpression.staticType;
     if (!_isFunctionType(expressionType)) {
-      _errorReporter.reportErrorForNode(StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION_EXPRESSION, functionExpression, []);
+      _errorReporter.reportErrorForNode(StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION_EXPRESSION, functionExpression);
     }
     return super.visitFunctionExpressionInvocation(node);
   }
@@ -852,7 +851,7 @@
   Object visitNativeClause(NativeClause node) {
     // TODO(brianwilkerson) Figure out the right rule for when 'native' is allowed.
     if (!_isInSystemLibrary) {
-      _errorReporter.reportErrorForNode(ParserErrorCode.NATIVE_CLAUSE_IN_NON_SDK_CODE, node, []);
+      _errorReporter.reportErrorForNode(ParserErrorCode.NATIVE_CLAUSE_IN_NON_SDK_CODE, node);
     }
     return super.visitNativeClause(node);
   }
@@ -1059,7 +1058,7 @@
       } else {
         errorCode = CompileTimeErrorCode.YIELD_IN_NON_GENERATOR;
       }
-      _errorReporter.reportErrorForNode(errorCode, node, []);
+      _errorReporter.reportErrorForNode(errorCode, node);
     }
     return super.visitYieldStatement(node);
   }
@@ -1069,7 +1068,7 @@
    *
    * @param typeArguments the type arguments, always non-`null`
    * @return `true` if and only if an error code is generated on the passed node
-   * @see StaticTypeWarningCode#EXPECTED_TWO_MAP_TYPE_ARGUMENTS
+   * See [StaticTypeWarningCode.EXPECTED_TWO_MAP_TYPE_ARGUMENTS].
    */
   bool _checkExpectedTwoMapTypeArguments(TypeArgumentList typeArguments) {
     // check number of type arguments
@@ -1088,9 +1087,9 @@
    *
    * @param node the [ConstructorDeclaration] to evaluate
    * @return `true` if and only if an error code is generated on the passed node
-   * @see #initialFieldElementsMap
-   * @see CompileTimeErrorCode#FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR
-   * @see CompileTimeErrorCode#FINAL_INITIALIZED_MULTIPLE_TIMES
+   * See [_initialFieldElementsMap],
+   * [StaticWarningCode.FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR],
+   * and [CompileTimeErrorCode.FINAL_INITIALIZED_MULTIPLE_TIMES].
    */
   bool _checkForAllFinalInitializedErrorCodes(ConstructorDeclaration node) {
     if (node.factoryKeyword != null || node.redirectedConstructor != null || node.externalKeyword != null) {
@@ -1144,11 +1143,11 @@
             fieldElementsMap[fieldElement] = INIT_STATE.INIT_IN_INITIALIZERS;
           } else if (state == INIT_STATE.INIT_IN_DECLARATION) {
             if (fieldElement.isFinal || fieldElement.isConst) {
-              _errorReporter.reportErrorForNode(StaticWarningCode.FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION, fieldName, []);
+              _errorReporter.reportErrorForNode(StaticWarningCode.FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION, fieldName);
               foundError = true;
             }
           } else if (state == INIT_STATE.INIT_IN_FIELD_FORMAL) {
-            _errorReporter.reportErrorForNode(CompileTimeErrorCode.FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER, fieldName, []);
+            _errorReporter.reportErrorForNode(CompileTimeErrorCode.FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER, fieldName);
             foundError = true;
           } else if (state == INIT_STATE.INIT_IN_INITIALIZERS) {
             _errorReporter.reportErrorForNode(CompileTimeErrorCode.FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS, fieldName, [fieldElement.displayName]);
@@ -1187,17 +1186,17 @@
    * @param parameters the parameters of the executable element
    * @param errorNameTarget the node to report problems on
    * @return `true` if and only if an error code is generated on the passed node
-   * @see StaticWarningCode#INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC
-   * @see CompileTimeErrorCode#INVALID_OVERRIDE_REQUIRED
-   * @see CompileTimeErrorCode#INVALID_OVERRIDE_POSITIONAL
-   * @see CompileTimeErrorCode#INVALID_OVERRIDE_NAMED
-   * @see StaticWarningCode#INVALID_GETTER_OVERRIDE_RETURN_TYPE
-   * @see StaticWarningCode#INVALID_METHOD_OVERRIDE_RETURN_TYPE
-   * @see StaticWarningCode#INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE
-   * @see StaticWarningCode#INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE
-   * @see StaticWarningCode#INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE
-   * @see StaticWarningCode#INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE
-   * @see StaticWarningCode#INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES
+   * See [StaticWarningCode.INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC],
+   * [CompileTimeErrorCode.INVALID_OVERRIDE_REQUIRED],
+   * [CompileTimeErrorCode.INVALID_OVERRIDE_POSITIONAL],
+   * [CompileTimeErrorCode.INVALID_OVERRIDE_NAMED],
+   * [StaticWarningCode.INVALID_GETTER_OVERRIDE_RETURN_TYPE],
+   * [StaticWarningCode.INVALID_METHOD_OVERRIDE_RETURN_TYPE],
+   * [StaticWarningCode.INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE],
+   * [StaticWarningCode.INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE],
+   * [StaticWarningCode.INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE],
+   * [StaticWarningCode.INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE], and
+   * [StaticWarningCode.INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES].
    */
   bool _checkForAllInvalidOverrideErrorCodes(ExecutableElement executableElement, ExecutableElement overriddenExecutable, List<ParameterElement> parameters, List<AstNode> parameterLocations, SimpleIdentifier errorNameTarget) {
     bool isGetter = false;
@@ -1359,6 +1358,11 @@
           String parameterName = parameterElt.name;
           for (int j = 0; j < overriddenParameterElts.length; j++) {
             ParameterElementImpl overriddenParameterElt = overriddenParameterElts[j];
+            if (overriddenParameterElt.initializer == null) {
+              // There is no warning if the overridden parameter has an
+              // implicit default.
+              continue;
+            }
             String overriddenParameterName = overriddenParameterElt.name;
             if (parameterName != null && parameterName == overriddenParameterName) {
               EvaluationResultImpl overriddenResult = overriddenParameterElt.evaluationResult;
@@ -1385,6 +1389,11 @@
             continue;
           }
           ParameterElementImpl overriddenParameterElt = overriddenParameterElts[i];
+          if (overriddenParameterElt.initializer == null) {
+            // There is no warning if the overridden parameter has an implicit
+            // default.
+            continue;
+          }
           EvaluationResultImpl overriddenResult = overriddenParameterElt.evaluationResult;
           if (_isUserDefinedObject(overriddenResult)) {
             continue;
@@ -1418,12 +1427,9 @@
     // Compute the overridden executable from the InheritanceManager
     //
     List<ExecutableElement> overriddenExecutables = _inheritanceManager.lookupOverrides(_enclosingClass, executableElement.name);
-    if (overriddenExecutables.isEmpty) {
-      // Nothing is overridden, so we just have to check if the new name collides
-      // with a static defined in the superclass.
-      // TODO(paulberry): currently we don't do this check if the new element
-      // overrides a method in an interface (see issue 18947).
-      return _checkForInstanceMethodNameCollidesWithSuperclassStatic(executableElement, errorNameTarget);
+    if (_checkForInstanceMethodNameCollidesWithSuperclassStatic(
+        executableElement, errorNameTarget)) {
+      return true;
     }
     for (ExecutableElement overriddenElement in overriddenExecutables) {
       if (_checkForAllInvalidOverrideErrorCodes(executableElement, overriddenElement, parameters, parameterLocations, errorNameTarget)) {
@@ -1438,7 +1444,7 @@
    *
    * @param node the [MethodDeclaration] to evaluate
    * @return `true` if and only if an error code is generated on the passed node
-   * @see #checkForAllInvalidOverrideErrorCodes(ExecutableElement)
+   * See [_checkForAllInvalidOverrideErrorCodes].
    */
   bool _checkForAllInvalidOverrideErrorCodesForField(FieldDeclaration node) {
     if (_enclosingClass == null || node.isStatic) {
@@ -1481,7 +1487,7 @@
    *
    * @param node the [MethodDeclaration] to evaluate
    * @return `true` if and only if an error code is generated on the passed node
-   * @see #checkForAllInvalidOverrideErrorCodes(ExecutableElement)
+   * See [_checkForAllInvalidOverrideErrorCodes].
    */
   bool _checkForAllInvalidOverrideErrorCodesForMethod(MethodDeclaration node) {
     if (_enclosingClass == null || node.isStatic || node.body is NativeFunctionBody) {
@@ -1506,9 +1512,9 @@
    *
    * @param node the 'with' clause to evaluate
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#MIXIN_DECLARES_CONSTRUCTOR
-   * @see CompileTimeErrorCode#MIXIN_INHERITS_FROM_NOT_OBJECT
-   * @see CompileTimeErrorCode#MIXIN_REFERENCES_SUPER
+   * See [CompileTimeErrorCode.MIXIN_DECLARES_CONSTRUCTOR],
+   * [CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT], and
+   * [CompileTimeErrorCode.MIXIN_REFERENCES_SUPER].
    */
   bool _checkForAllMixinErrorCodes(WithClause withClause) {
     if (withClause == null) {
@@ -1550,9 +1556,9 @@
    *
    * @param node the constructor declaration to evaluate
    * @return `true` if and only if an error code is generated on the passed node
-   * @see StaticWarningCode#REDIRECT_TO_INVALID_RETURN_TYPE
-   * @see StaticWarningCode#REDIRECT_TO_INVALID_FUNCTION_TYPE
-   * @see StaticWarningCode#REDIRECT_TO_MISSING_CONSTRUCTOR
+   * See [StaticWarningCode.REDIRECT_TO_INVALID_RETURN_TYPE],
+   * [StaticWarningCode.REDIRECT_TO_INVALID_FUNCTION_TYPE], and
+   * [StaticWarningCode.REDIRECT_TO_MISSING_CONSTRUCTOR].
    */
   bool _checkForAllRedirectConstructorErrorCodes(ConstructorDeclaration node) {
     //
@@ -1620,9 +1626,9 @@
    *
    * @param node the return statement to evaluate
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#RETURN_IN_GENERATIVE_CONSTRUCTOR
-   * @see StaticWarningCode#RETURN_WITHOUT_VALUE
-   * @see StaticTypeWarningCode#RETURN_OF_INVALID_TYPE
+   * See [CompileTimeErrorCode.RETURN_IN_GENERATIVE_CONSTRUCTOR],
+   * [StaticWarningCode.RETURN_WITHOUT_VALUE], and
+   * [StaticTypeWarningCode.RETURN_OF_INVALID_TYPE].
    */
   bool _checkForAllReturnStatementErrorCodes(ReturnStatement node) {
     FunctionType functionType = _enclosingFunction == null ? null : _enclosingFunction.type;
@@ -1634,7 +1640,7 @@
       if (returnExpression == null) {
         return false;
       }
-      _errorReporter.reportErrorForNode(CompileTimeErrorCode.RETURN_IN_GENERATIVE_CONSTRUCTOR, returnExpression, []);
+      _errorReporter.reportErrorForNode(CompileTimeErrorCode.RETURN_IN_GENERATIVE_CONSTRUCTOR, returnExpression);
       return true;
     }
     // RETURN_WITHOUT_VALUE
@@ -1643,11 +1649,11 @@
         return false;
       }
       _hasReturnWithoutValue = true;
-      _errorReporter.reportErrorForNode(StaticWarningCode.RETURN_WITHOUT_VALUE, node, []);
+      _errorReporter.reportErrorForNode(StaticWarningCode.RETURN_WITHOUT_VALUE, node);
       return true;
     } else if (_inGenerator) {
       // RETURN_IN_GENERATOR
-      _errorReporter.reportErrorForNode(CompileTimeErrorCode.RETURN_IN_GENERATOR, node, []);
+      _errorReporter.reportErrorForNode(CompileTimeErrorCode.RETURN_IN_GENERATOR, node);
     }
     // RETURN_OF_INVALID_TYPE
     return _checkForReturnOfInvalidType(returnExpression, expectedReturnType);
@@ -1662,7 +1668,7 @@
    *          node was `null`, then this method is not called
    * @param exportedLibrary the library element containing the exported element
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#AMBIGUOUS_EXPORT
+   * See [CompileTimeErrorCode.AMBIGUOUS_EXPORT].
    */
   bool _checkForAmbiguousExport(ExportDirective node, ExportElement exportElement, LibraryElement exportedLibrary) {
     if (exportedLibrary == null) {
@@ -1699,13 +1705,13 @@
    *          `null`
    * @param actualPropagatedType the expected propagated type of the parameter, may be `null`
    * @return `true` if and only if an error code is generated on the passed node
-   * @see StaticWarningCode#ARGUMENT_TYPE_NOT_ASSIGNABLE
-   * @see CompileTimeErrorCode#LIST_ELEMENT_TYPE_NOT_ASSIGNABLE
-   * @see StaticWarningCode#LIST_ELEMENT_TYPE_NOT_ASSIGNABLE
-   * @see CompileTimeErrorCode#MAP_KEY_TYPE_NOT_ASSIGNABLE
-   * @see CompileTimeErrorCode#MAP_VALUE_TYPE_NOT_ASSIGNABLE
-   * @see StaticWarningCode#MAP_KEY_TYPE_NOT_ASSIGNABLE
-   * @see StaticWarningCode#MAP_VALUE_TYPE_NOT_ASSIGNABLE
+   * See [StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE],
+   * [CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE],
+   * [StaticWarningCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE],
+   * [CompileTimeErrorCode.MAP_KEY_TYPE_NOT_ASSIGNABLE],
+   * [CompileTimeErrorCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE],
+   * [StaticWarningCode.MAP_KEY_TYPE_NOT_ASSIGNABLE], and
+   * [StaticWarningCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE].
    */
   bool _checkForArgumentTypeNotAssignable(Expression expression, DartType expectedStaticType, DartType actualStaticType, ErrorCode errorCode) {
     //
@@ -1727,7 +1733,7 @@
    *
    * @param argument the argument to evaluate
    * @return `true` if and only if an error code is generated on the passed node
-   * @see StaticWarningCode#ARGUMENT_TYPE_NOT_ASSIGNABLE
+   * See [StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE].
    */
   bool _checkForArgumentTypeNotAssignableForArgument(Expression argument) {
     if (argument == null) {
@@ -1748,13 +1754,13 @@
    * @param expectedStaticType the expected static type
    * @param expectedPropagatedType the expected propagated type, may be `null`
    * @return `true` if and only if an error code is generated on the passed node
-   * @see StaticWarningCode#ARGUMENT_TYPE_NOT_ASSIGNABLE
-   * @see CompileTimeErrorCode#LIST_ELEMENT_TYPE_NOT_ASSIGNABLE
-   * @see StaticWarningCode#LIST_ELEMENT_TYPE_NOT_ASSIGNABLE
-   * @see CompileTimeErrorCode#MAP_KEY_TYPE_NOT_ASSIGNABLE
-   * @see CompileTimeErrorCode#MAP_VALUE_TYPE_NOT_ASSIGNABLE
-   * @see StaticWarningCode#MAP_KEY_TYPE_NOT_ASSIGNABLE
-   * @see StaticWarningCode#MAP_VALUE_TYPE_NOT_ASSIGNABLE
+   * See [StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE],
+   * [CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE],
+   * [StaticWarningCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE],
+   * [CompileTimeErrorCode.MAP_KEY_TYPE_NOT_ASSIGNABLE],
+   * [CompileTimeErrorCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE],
+   * [StaticWarningCode.MAP_KEY_TYPE_NOT_ASSIGNABLE], and
+   * [StaticWarningCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE].
    */
   bool _checkForArgumentTypeNotAssignableWithExpectedTypes(Expression expression, DartType expectedStaticType, ErrorCode errorCode) => _checkForArgumentTypeNotAssignable(expression, expectedStaticType, getStaticType(expression), errorCode);
 
@@ -1765,7 +1771,7 @@
    *
    * @param node the arguments to evaluate
    * @return `true` if and only if an error code is generated on the passed node
-   * @see StaticWarningCode#ARGUMENT_TYPE_NOT_ASSIGNABLE
+   * See [StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE].
    */
   bool _checkForArgumentTypesNotAssignableInList(ArgumentList argumentList) {
     if (argumentList == null) {
@@ -1810,9 +1816,9 @@
    *
    * @param node the expression to evaluate
    * @return `true` if and only if an error code is generated on the passed node
-   * @see StaticWarningCode#ASSIGNMENT_TO_CONST
-   * @see StaticWarningCode#ASSIGNMENT_TO_FINAL
-   * @see StaticWarningCode#ASSIGNMENT_TO_METHOD
+   * See [StaticWarningCode.ASSIGNMENT_TO_CONST],
+   * [StaticWarningCode.ASSIGNMENT_TO_FINAL], and
+   * [StaticWarningCode.ASSIGNMENT_TO_METHOD].
    */
   bool _checkForAssignmentToFinal(Expression expression) {
     // prepare element
@@ -1836,7 +1842,7 @@
     if (element is VariableElement) {
       VariableElement variable = element as VariableElement;
       if (variable.isConst) {
-        _errorReporter.reportErrorForNode(StaticWarningCode.ASSIGNMENT_TO_CONST, expression, []);
+        _errorReporter.reportErrorForNode(StaticWarningCode.ASSIGNMENT_TO_CONST, expression);
         return true;
       }
       if (variable.isFinal) {
@@ -1850,11 +1856,11 @@
       return false;
     }
     if (element is FunctionElement) {
-      _errorReporter.reportErrorForNode(StaticWarningCode.ASSIGNMENT_TO_FUNCTION, expression, []);
+      _errorReporter.reportErrorForNode(StaticWarningCode.ASSIGNMENT_TO_FUNCTION, expression);
       return true;
     }
     if (element is MethodElement) {
-      _errorReporter.reportErrorForNode(StaticWarningCode.ASSIGNMENT_TO_METHOD, expression, []);
+      _errorReporter.reportErrorForNode(StaticWarningCode.ASSIGNMENT_TO_METHOD, expression);
       return true;
     }
     return false;
@@ -1867,13 +1873,13 @@
    * @param identifier the identifier to check to ensure that it is not a keyword
    * @param errorCode if the passed identifier is a keyword then this error code is created on the
    *          identifier, the error code will be one of
-   *          [CompileTimeErrorCode#BUILT_IN_IDENTIFIER_AS_TYPE_NAME],
-   *          [CompileTimeErrorCode#BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME] or
-   *          [CompileTimeErrorCode#BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME]
+   *          [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_NAME],
+   *          [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME] or
+   *          [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME]
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#BUILT_IN_IDENTIFIER_AS_TYPE_NAME
-   * @see CompileTimeErrorCode#BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME
-   * @see CompileTimeErrorCode#BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME
+   * See [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_NAME],
+   * [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME], and
+   * [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME].
    */
   bool _checkForBuiltInIdentifierAsName(SimpleIdentifier identifier, ErrorCode errorCode) {
     sc.Token token = identifier.token;
@@ -1890,7 +1896,7 @@
    *
    * @param node the switch case to evaluate
    * @return `true` if and only if an error code is generated on the passed node
-   * @see StaticWarningCode#CASE_BLOCK_NOT_TERMINATED
+   * see [StaticWarningCode.CASE_BLOCK_NOT_TERMINATED].
    */
   bool _checkForCaseBlockNotTerminated(SwitchCase node) {
     NodeList<Statement> statements = node.statements;
@@ -1921,7 +1927,7 @@
       }
     }
     // report error
-    _errorReporter.reportErrorForToken(StaticWarningCode.CASE_BLOCK_NOT_TERMINATED, node.keyword, []);
+    _errorReporter.reportErrorForToken(StaticWarningCode.CASE_BLOCK_NOT_TERMINATED, node.keyword);
     return true;
   }
 
@@ -1931,7 +1937,7 @@
    *
    * @param node the switch statement containing the cases to be checked
    * @return `true` if and only if an error code is generated on the passed node
-   * @see StaticWarningCode#CASE_BLOCK_NOT_TERMINATED
+   * See [StaticWarningCode.CASE_BLOCK_NOT_TERMINATED].
    */
   bool _checkForCaseBlocksNotTerminated(SwitchStatement node) {
     bool foundError = false;
@@ -1952,7 +1958,7 @@
    *
    * @param node the method declaration to evaluate
    * @return `true` if and only if an error code is generated on the passed node
-   * @see StaticWarningCode#CONCRETE_CLASS_WITH_ABSTRACT_MEMBER
+   * See [StaticWarningCode.CONCRETE_CLASS_WITH_ABSTRACT_MEMBER].
    */
   bool _checkForConcreteClassWithAbstractMember(MethodDeclaration node) {
     if (node.isAbstract && _enclosingClass != null && !_enclosingClass.isAbstract) {
@@ -1981,10 +1987,10 @@
    * @param node the constructor declaration to evaluate
    * @param constructorElement the constructor element
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#DUPLICATE_CONSTRUCTOR_DEFAULT
-   * @see CompileTimeErrorCode#DUPLICATE_CONSTRUCTOR_NAME
-   * @see CompileTimeErrorCode#CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD
-   * @see CompileTimeErrorCode#CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD
+   * See [CompileTimeErrorCode.DUPLICATE_CONSTRUCTOR_DEFAULT],
+   * [CompileTimeErrorCode.DUPLICATE_CONSTRUCTOR_NAME],
+   * [CompileTimeErrorCode.CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD], and
+   * [CompileTimeErrorCode.CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD].
    */
   bool _checkForConflictingConstructorNameAndMember(ConstructorDeclaration node, ConstructorElement constructorElement) {
     SimpleIdentifier constructorName = node.name;
@@ -1998,7 +2004,7 @@
       }
       if (name == otherConstructor.name) {
         if (name == null || name.length == 0) {
-          _errorReporter.reportErrorForNode(CompileTimeErrorCode.DUPLICATE_CONSTRUCTOR_DEFAULT, node, []);
+          _errorReporter.reportErrorForNode(CompileTimeErrorCode.DUPLICATE_CONSTRUCTOR_DEFAULT, node);
         } else {
           _errorReporter.reportErrorForNode(CompileTimeErrorCode.DUPLICATE_CONSTRUCTOR_NAME, node, [name]);
         }
@@ -2028,8 +2034,8 @@
    * same name on, via inheritance.
    *
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#CONFLICTING_GETTER_AND_METHOD
-   * @see CompileTimeErrorCode#CONFLICTING_METHOD_AND_GETTER
+   * See [CompileTimeErrorCode.CONFLICTING_GETTER_AND_METHOD], and
+   * [CompileTimeErrorCode.CONFLICTING_METHOD_AND_GETTER].
    */
   bool _checkForConflictingGetterAndMethod() {
     if (_enclosingClass == null) {
@@ -2080,8 +2086,8 @@
    *
    * @param node the method declaration to evaluate
    * @return `true` if and only if an error code is generated on the passed node
-   * @see StaticWarningCode#CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER
-   * @see StaticWarningCode#CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_MEMBER
+   * See [StaticWarningCode.CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER], and
+   * [StaticWarningCode.CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_MEMBER].
    */
   bool _checkForConflictingInstanceGetterAndSuperclassMember() {
     if (_enclosingClass == null) {
@@ -2141,7 +2147,7 @@
    *
    * @param node the method declaration to evaluate
    * @return `true` if and only if an error code is generated on the passed node
-   * @see StaticWarningCode#CONFLICTING_INSTANCE_METHOD_SETTER
+   * See [StaticWarningCode.CONFLICTING_INSTANCE_METHOD_SETTER].
    */
   bool _checkForConflictingInstanceMethodSetter(ClassDeclaration node) {
     // Reference all of the class members in this class.
@@ -2222,7 +2228,7 @@
    *
    * @param node the method declaration to evaluate
    * @return `true` if and only if an error code is generated on the passed node
-   * @see StaticWarningCode#CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER
+   * See [StaticWarningCode.CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER].
    */
   bool _checkForConflictingStaticGetterAndInstanceSetter(MethodDeclaration node) {
     if (!node.isStatic) {
@@ -2262,7 +2268,7 @@
    *
    * @param node the method declaration to evaluate
    * @return `true` if and only if an error code is generated on the passed node
-   * @see StaticWarningCode#CONFLICTING_STATIC_SETTER_AND_INSTANCE_MEMBER
+   * See [StaticWarningCode.CONFLICTING_STATIC_SETTER_AND_INSTANCE_MEMBER].
    */
   bool _checkForConflictingStaticSetterAndInstanceMember(MethodDeclaration node) {
     if (!node.isStatic) {
@@ -2308,8 +2314,8 @@
    *
    * @param node the class declaration to evaluate
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#CONFLICTING_TYPE_VARIABLE_AND_CLASS
-   * @see CompileTimeErrorCode#CONFLICTING_TYPE_VARIABLE_AND_MEMBER
+   * See [CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_CLASS], and
+   * [CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER].
    */
   bool _checkForConflictingTypeVariableErrorCodes(ClassDeclaration node) {
     bool problemReported = false;
@@ -2335,7 +2341,7 @@
    *
    * @param node the constructor declaration to evaluate
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER
+   * See [CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER].
    */
   bool _checkForConstConstructorWithNonConstSuper(ConstructorDeclaration node) {
     if (!_isEnclosingConstructorConst) {
@@ -2347,7 +2353,7 @@
     }
     // check for mixins
     if (_enclosingClass.mixins.length != 0) {
-      _errorReporter.reportErrorForNode(CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_MIXIN, node.returnType, []);
+      _errorReporter.reportErrorForNode(CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_MIXIN, node.returnType);
       return true;
     }
     // try to find and check super constructor invocation
@@ -2389,7 +2395,7 @@
    * @param node the constructor declaration to evaluate
    * @param constructorElement the constructor element
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD
+   * See [CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD].
    */
   bool _checkForConstConstructorWithNonFinalField(ConstructorDeclaration node, ConstructorElement constructorElement) {
     if (!_isEnclosingConstructorConst) {
@@ -2401,7 +2407,7 @@
       return false;
     }
     // report problem
-    _errorReporter.reportErrorForNode(CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD, node, []);
+    _errorReporter.reportErrorForNode(CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD, node);
     return true;
   }
 
@@ -2413,7 +2419,7 @@
    * @param constructorName the constructor name, always non-`null`
    * @param typeName the name of the type defining the constructor, always non-`null`
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#CONST_DEFERRED_CLASS
+   * See [CompileTimeErrorCode.CONST_DEFERRED_CLASS].
    */
   bool _checkForConstDeferredClass(InstanceCreationExpression node, ConstructorName constructorName, TypeName typeName) {
     if (typeName.isDeferred) {
@@ -2429,11 +2435,11 @@
    *
    * @param node the throw expression expression to evaluate
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#CONST_CONSTRUCTOR_THROWS_EXCEPTION
+   * See [CompileTimeErrorCode.CONST_CONSTRUCTOR_THROWS_EXCEPTION].
    */
   bool _checkForConstEvalThrowsException(ThrowExpression node) {
     if (_isEnclosingConstructorConst) {
-      _errorReporter.reportErrorForNode(CompileTimeErrorCode.CONST_CONSTRUCTOR_THROWS_EXCEPTION, node, []);
+      _errorReporter.reportErrorForNode(CompileTimeErrorCode.CONST_CONSTRUCTOR_THROWS_EXCEPTION, node);
       return true;
     }
     return false;
@@ -2444,11 +2450,11 @@
    *
    * @param node the normal formal parameter to evaluate
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#CONST_FORMAL_PARAMETER
+   * See [CompileTimeErrorCode.CONST_FORMAL_PARAMETER].
    */
   bool _checkForConstFormalParameter(NormalFormalParameter node) {
     if (node.isConst) {
-      _errorReporter.reportErrorForNode(CompileTimeErrorCode.CONST_FORMAL_PARAMETER, node, []);
+      _errorReporter.reportErrorForNode(CompileTimeErrorCode.CONST_FORMAL_PARAMETER, node);
       return true;
     }
     return false;
@@ -2463,17 +2469,17 @@
    *          [InstanceCreationExpression], this is the AST node that the error is attached to
    * @param type the type being constructed with this [InstanceCreationExpression]
    * @return `true` if and only if an error code is generated on the passed node
-   * @see StaticWarningCode#CONST_WITH_ABSTRACT_CLASS
-   * @see StaticWarningCode#NEW_WITH_ABSTRACT_CLASS
+   * See [StaticWarningCode.CONST_WITH_ABSTRACT_CLASS], and
+   * [StaticWarningCode.NEW_WITH_ABSTRACT_CLASS].
    */
   bool _checkForConstOrNewWithAbstractClass(InstanceCreationExpression node, TypeName typeName, InterfaceType type) {
     if (type.element.isAbstract) {
       ConstructorElement element = node.staticElement;
       if (element != null && !element.isFactory) {
         if ((node.keyword as sc.KeywordToken).keyword == sc.Keyword.CONST) {
-          _errorReporter.reportErrorForNode(StaticWarningCode.CONST_WITH_ABSTRACT_CLASS, typeName, []);
+          _errorReporter.reportErrorForNode(StaticWarningCode.CONST_WITH_ABSTRACT_CLASS, typeName);
         } else {
-          _errorReporter.reportErrorForNode(StaticWarningCode.NEW_WITH_ABSTRACT_CLASS, typeName, []);
+          _errorReporter.reportErrorForNode(StaticWarningCode.NEW_WITH_ABSTRACT_CLASS, typeName);
         }
         return true;
       }
@@ -2489,11 +2495,11 @@
    *          [InstanceCreationExpression], this is the AST node that the error is attached to
    * @param type the type being constructed with this [InstanceCreationExpression]
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#INSTANTIATE_ENUM
+   * See [CompileTimeErrorCode.INSTANTIATE_ENUM].
    */
   bool _checkForConstOrNewWithEnum(InstanceCreationExpression node, TypeName typeName, InterfaceType type) {
     if (type.element.isEnum) {
-      _errorReporter.reportErrorForNode(CompileTimeErrorCode.INSTANTIATE_ENUM, typeName, []);
+      _errorReporter.reportErrorForNode(CompileTimeErrorCode.INSTANTIATE_ENUM, typeName);
       return true;
     }
     return false;
@@ -2507,12 +2513,12 @@
    *
    * @param node the instance creation expression to verify
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#CONST_WITH_NON_CONST
+   * See [CompileTimeErrorCode.CONST_WITH_NON_CONST].
    */
   bool _checkForConstWithNonConst(InstanceCreationExpression node) {
     ConstructorElement constructorElement = node.staticElement;
     if (constructorElement != null && !constructorElement.isConst) {
-      _errorReporter.reportErrorForNode(CompileTimeErrorCode.CONST_WITH_NON_CONST, node, []);
+      _errorReporter.reportErrorForNode(CompileTimeErrorCode.CONST_WITH_NON_CONST, node);
       return true;
     }
     return false;
@@ -2523,7 +2529,7 @@
    *
    * @param typeName the type name to evaluate
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#CONST_WITH_TYPE_PARAMETERS
+   * See [CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS].
    */
   bool _checkForConstWithTypeParameters(TypeName typeName) {
     // something wrong with AST
@@ -2536,7 +2542,7 @@
     }
     // should not be a type parameter
     if (name.staticElement is TypeParameterElement) {
-      _errorReporter.reportErrorForNode(CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS, name, []);
+      _errorReporter.reportErrorForNode(CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS, name);
     }
     // check type arguments
     TypeArgumentList typeArguments = typeName.typeArguments;
@@ -2563,8 +2569,8 @@
    * @param constructorName the constructor name, always non-`null`
    * @param typeName the name of the type defining the constructor, always non-`null`
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#CONST_WITH_UNDEFINED_CONSTRUCTOR
-   * @see CompileTimeErrorCode#CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT
+   * See [CompileTimeErrorCode.CONST_WITH_UNDEFINED_CONSTRUCTOR], and
+   * [CompileTimeErrorCode.CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT].
    */
   bool _checkForConstWithUndefinedConstructor(InstanceCreationExpression node, ConstructorName constructorName, TypeName typeName) {
     // OK if resolved
@@ -2595,7 +2601,7 @@
    *
    * @param node the function type alias to evaluate
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS
+   * See [CompileTimeErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS].
    */
   bool _checkForDefaultValueInFunctionTypeAlias(FunctionTypeAlias node) {
     bool result = false;
@@ -2605,7 +2611,7 @@
       if (formalParameter is DefaultFormalParameter) {
         DefaultFormalParameter defaultFormalParameter = formalParameter;
         if (defaultFormalParameter.defaultValue != null) {
-          _errorReporter.reportErrorForNode(CompileTimeErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS, node, []);
+          _errorReporter.reportErrorForNode(CompileTimeErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS, node);
           result = true;
         }
       }
@@ -2619,7 +2625,7 @@
    *
    * @param node the default formal parameter to evaluate
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#DEFAULT_VALUE_IN_FUNCTION_TYPED_PARAMETER
+   * See [CompileTimeErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPED_PARAMETER].
    */
   bool _checkForDefaultValueInFunctionTypedParameter(DefaultFormalParameter node) {
     // OK, not in a function typed parameter.
@@ -2631,7 +2637,7 @@
       return false;
     }
     // Report problem.
-    _errorReporter.reportErrorForNode(CompileTimeErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPED_PARAMETER, node, []);
+    _errorReporter.reportErrorForNode(CompileTimeErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPED_PARAMETER, node);
     return true;
   }
 
@@ -2640,7 +2646,7 @@
    *
    * @param node the compilation unit containing the imports to be checked
    * @return `true` if an error was generated
-   * @see CompileTimeErrorCode#SHARED_DEFERRED_PREFIX
+   * See [CompileTimeErrorCode.SHARED_DEFERRED_PREFIX].
    */
   bool _checkForDeferredPrefixCollisions(CompilationUnit node) {
     bool foundError = false;
@@ -2681,7 +2687,7 @@
    * the static member.
    *
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#DUPLICATE_DEFINITION_INHERITANCE
+   * See [CompileTimeErrorCode.DUPLICATE_DEFINITION_INHERITANCE].
    */
   bool _checkForDuplicateDefinitionInheritance() {
     if (_enclosingClass == null) {
@@ -2707,7 +2713,7 @@
    *
    * @param staticMember the static member to check conflict for
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#DUPLICATE_DEFINITION_INHERITANCE
+   * See [CompileTimeErrorCode.DUPLICATE_DEFINITION_INHERITANCE].
    */
   bool _checkForDuplicateDefinitionOfMember(ExecutableElement staticMember) {
     // prepare name
@@ -2744,7 +2750,7 @@
    * @param node the list literal to evaluate
    * @param typeArguments the type arguments, always non-`null`
    * @return `true` if and only if an error code is generated on the passed node
-   * @see StaticTypeWarningCode#EXPECTED_ONE_LIST_TYPE_ARGUMENTS
+   * See [StaticTypeWarningCode.EXPECTED_ONE_LIST_TYPE_ARGUMENTS].
    */
   bool _checkForExpectedOneListTypeArgument(ListLiteral node, TypeArgumentList typeArguments) {
     // check number of type arguments
@@ -2765,7 +2771,7 @@
    *          node was `null`, then this method is not called
    * @param exportedLibrary the library element containing the exported element
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#EXPORT_DUPLICATED_LIBRARY_NAME
+   * See [CompileTimeErrorCode.EXPORT_DUPLICATED_LIBRARY_NAME].
    */
   bool _checkForExportDuplicateLibraryName(ExportDirective node, ExportElement exportElement, LibraryElement exportedLibrary) {
     if (exportedLibrary == null) {
@@ -2776,10 +2782,20 @@
     LibraryElement prevLibrary = _nameToExportElement[name];
     if (prevLibrary != null) {
       if (prevLibrary != exportedLibrary) {
-        _errorReporter.reportErrorForNode(StaticWarningCode.EXPORT_DUPLICATED_LIBRARY_NAME, node, [
-            prevLibrary.definingCompilationUnit.displayName,
-            exportedLibrary.definingCompilationUnit.displayName,
-            name]);
+        if (name.isEmpty) {
+          _errorReporter.reportErrorForNode(
+              StaticWarningCode.EXPORT_DUPLICATED_LIBRARY_UNNAMED,
+              node,
+              [prevLibrary.definingCompilationUnit.displayName,
+                  exportedLibrary.definingCompilationUnit.displayName]);
+        } else {
+          _errorReporter.reportErrorForNode(
+              StaticWarningCode.EXPORT_DUPLICATED_LIBRARY_NAMED,
+              node,
+              [prevLibrary.definingCompilationUnit.displayName,
+                  exportedLibrary.definingCompilationUnit.displayName,
+                  name]);
+        }
         return true;
       }
     } else {
@@ -2797,7 +2813,7 @@
    * @param exportElement the [ExportElement] retrieved from the node, if the element in the
    *          node was `null`, then this method is not called
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#EXPORT_INTERNAL_LIBRARY
+   * See [CompileTimeErrorCode.EXPORT_INTERNAL_LIBRARY].
    */
   bool _checkForExportInternalLibrary(ExportDirective node, ExportElement exportElement) {
     if (_isInSystemLibrary) {
@@ -2823,7 +2839,7 @@
    *
    * @param node the extends clause to test
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#EXTENDS_DEFERRED_CLASS
+   * See [CompileTimeErrorCode.EXTENDS_DEFERRED_CLASS].
    */
   bool _checkForExtendsDeferredClass(ExtendsClause node) {
     if (node == null) {
@@ -2837,7 +2853,7 @@
    *
    * @param node the extends clause to test
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#EXTENDS_DISALLOWED_CLASS
+   * See [CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS].
    */
   bool _checkForExtendsDeferredClassInTypeAlias(ClassTypeAlias node) {
     if (node == null) {
@@ -2851,7 +2867,7 @@
    *
    * @param node the extends clause to test
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#EXTENDS_DISALLOWED_CLASS
+   * See [CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS].
    */
   bool _checkForExtendsDisallowedClass(ExtendsClause node) {
     if (node == null) {
@@ -2865,7 +2881,7 @@
    *
    * @param node the extends clause to test
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#EXTENDS_DISALLOWED_CLASS
+   * See [CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS].
    */
   bool _checkForExtendsDisallowedClassInTypeAlias(ClassTypeAlias node) {
     if (node == null) {
@@ -2880,13 +2896,13 @@
    *
    * @param node the type name to test
    * @return `true` if and only if an error code is generated on the passed node
-   * @see #checkForExtendsDeferredClass(ExtendsClause)
-   * @see #checkForExtendsDeferredClassInTypeAlias(ClassTypeAlias)
-   * @see #checkForImplementsDeferredClass(ImplementsClause)
-   * @see #checkForAllMixinErrorCodes(WithClause)
-   * @see CompileTimeErrorCode#EXTENDS_DEFERRED_CLASS
-   * @see CompileTimeErrorCode#IMPLEMENTS_DEFERRED_CLASS
-   * @see CompileTimeErrorCode#MIXIN_DEFERRED_CLASS
+   * See [_checkForExtendsDeferredClass],
+   * [_checkForExtendsDeferredClassInTypeAlias],
+   * [_checkForImplementsDeferredClass],
+   * [_checkForAllMixinErrorCodes],
+   * [CompileTimeErrorCode.EXTENDS_DEFERRED_CLASS],
+   * [CompileTimeErrorCode.IMPLEMENTS_DEFERRED_CLASS], and
+   * [CompileTimeErrorCode.MIXIN_DEFERRED_CLASS].
    */
   bool _checkForExtendsOrImplementsDeferredClass(TypeName typeName, ErrorCode errorCode) {
     if (typeName.isSynthetic) {
@@ -2905,13 +2921,13 @@
    *
    * @param node the type name to test
    * @return `true` if and only if an error code is generated on the passed node
-   * @see #checkForExtendsDisallowedClass(ExtendsClause)
-   * @see #checkForExtendsDisallowedClassInTypeAlias(ClassTypeAlias)
-   * @see #checkForImplementsDisallowedClass(ImplementsClause)
-   * @see #checkForAllMixinErrorCodes(WithClause)
-   * @see CompileTimeErrorCode#EXTENDS_DISALLOWED_CLASS
-   * @see CompileTimeErrorCode#IMPLEMENTS_DISALLOWED_CLASS
-   * @see CompileTimeErrorCode#MIXIN_OF_DISALLOWED_CLASS
+   * See [_checkForExtendsDisallowedClass],
+   * [_checkForExtendsDisallowedClassInTypeAlias],
+   * [_checkForImplementsDisallowedClass],
+   * [_checkForAllMixinErrorCodes],
+   * [CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS],
+   * [CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS], and
+   * [CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS].
    */
   bool _checkForExtendsOrImplementsDisallowedClass(TypeName typeName, ErrorCode errorCode) {
     if (typeName.isSynthetic) {
@@ -2952,8 +2968,8 @@
    * @param staticElement the static element from the name in the
    *          [ConstructorFieldInitializer]
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE
-   * @see StaticWarningCode#FIELD_INITIALIZER_NOT_ASSIGNABLE
+   * See [CompileTimeErrorCode.CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE], and
+   * [StaticWarningCode.FIELD_INITIALIZER_NOT_ASSIGNABLE].
    */
   bool _checkForFieldInitializerNotAssignable(ConstructorFieldInitializer node, Element staticElement) {
     // prepare field element
@@ -3012,23 +3028,23 @@
    *
    * @param node the field formal parameter to test
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR
+   * See [CompileTimeErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR].
    */
   bool _checkForFieldInitializingFormalRedirectingConstructor(FieldFormalParameter node) {
     ConstructorDeclaration constructor = node.getAncestor((node) => node is ConstructorDeclaration);
     if (constructor == null) {
-      _errorReporter.reportErrorForNode(CompileTimeErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR, node, []);
+      _errorReporter.reportErrorForNode(CompileTimeErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR, node);
       return true;
     }
     // constructor cannot be a factory
     if (constructor.factoryKeyword != null) {
-      _errorReporter.reportErrorForNode(CompileTimeErrorCode.FIELD_INITIALIZER_FACTORY_CONSTRUCTOR, node, []);
+      _errorReporter.reportErrorForNode(CompileTimeErrorCode.FIELD_INITIALIZER_FACTORY_CONSTRUCTOR, node);
       return true;
     }
     // constructor cannot have a redirection
     for (ConstructorInitializer initializer in constructor.initializers) {
       if (initializer is RedirectingConstructorInvocation) {
-        _errorReporter.reportErrorForNode(CompileTimeErrorCode.FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR, node, []);
+        _errorReporter.reportErrorForNode(CompileTimeErrorCode.FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR, node);
         return true;
       }
     }
@@ -3045,8 +3061,8 @@
    *
    * @param node the class declaration to test
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#CONST_NOT_INITIALIZED
-   * @see StaticWarningCode#FINAL_NOT_INITIALIZED
+   * See [CompileTimeErrorCode.CONST_NOT_INITIALIZED], and
+   * [StaticWarningCode.FINAL_NOT_INITIALIZED].
    */
   bool _checkForFinalNotInitialized(VariableDeclarationList node) {
     if (_isInNativeClass) {
@@ -3076,8 +3092,8 @@
    *
    * @param node the class declaration to test
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#CONST_NOT_INITIALIZED
-   * @see StaticWarningCode#FINAL_NOT_INITIALIZED
+   * See [CompileTimeErrorCode.CONST_NOT_INITIALIZED], and
+   * [StaticWarningCode.FINAL_NOT_INITIALIZED].
    */
   bool _checkForFinalNotInitializedInClass(ClassDeclaration node) {
     NodeList<ClassMember> classMembers = node.members;
@@ -3101,7 +3117,7 @@
    *
    * @param node the implements clause to test
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#IMPLEMENTS_DEFERRED_CLASS
+   * See [CompileTimeErrorCode.IMPLEMENTS_DEFERRED_CLASS].
    */
   bool _checkForImplementsDeferredClass(ImplementsClause node) {
     if (node == null) {
@@ -3124,7 +3140,7 @@
    *
    * @param node the implements clause to test
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#IMPLEMENTS_DISALLOWED_CLASS
+   * See [CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS].
    */
   bool _checkForImplementsDisallowedClass(ImplementsClause node) {
     if (node == null) {
@@ -3147,8 +3163,9 @@
    *
    * @param node the simple identifier to test
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#IMPLICIT_THIS_REFERENCE_IN_INITIALIZER
-   * @see CompileTimeErrorCode#INSTANCE_MEMBER_ACCESS_FROM_STATIC TODO(scheglov) rename thid method
+   * See [CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER], and
+   * [CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_STATIC].
+   * TODO(scheglov) rename thid method
    */
   bool _checkForImplicitThisReferenceInInitializer(SimpleIdentifier node) {
     if (!_isInConstructorInitializer && !_isInStaticMethod && !_isInFactory && !_isInInstanceVariableInitializer && !_isInStaticVariableDeclaration) {
@@ -3196,11 +3213,11 @@
     }
     // report problem
     if (_isInStaticMethod) {
-      _errorReporter.reportErrorForNode(CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_STATIC, node, []);
+      _errorReporter.reportErrorForNode(CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_STATIC, node);
     } else if (_isInFactory) {
-      _errorReporter.reportErrorForNode(CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_FACTORY, node, []);
+      _errorReporter.reportErrorForNode(CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_FACTORY, node);
     } else {
-      _errorReporter.reportErrorForNode(CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER, node, []);
+      _errorReporter.reportErrorForNode(CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER, node);
     }
     return true;
   }
@@ -3212,7 +3229,7 @@
    * @param importElement the [ImportElement] retrieved from the node, if the element in the
    *          node was `null`, then this method is not called
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#IMPORT_DUPLICATED_LIBRARY_NAME
+   * See [CompileTimeErrorCode.IMPORT_DUPLICATED_LIBRARY_NAME].
    */
   bool _checkForImportDuplicateLibraryName(ImportDirective node, ImportElement importElement) {
     // prepare imported library
@@ -3221,14 +3238,24 @@
       return false;
     }
     String name = nodeLibrary.name;
-    // check if there is other imported library with the same name
+    // check if there is another imported library with the same name
     LibraryElement prevLibrary = _nameToImportElement[name];
     if (prevLibrary != null) {
       if (prevLibrary != nodeLibrary) {
-        _errorReporter.reportErrorForNode(StaticWarningCode.IMPORT_DUPLICATED_LIBRARY_NAME, node, [
-            prevLibrary.definingCompilationUnit.displayName,
-            nodeLibrary.definingCompilationUnit.displayName,
-            name]);
+        if (name.isEmpty) {
+          _errorReporter.reportErrorForNode(
+              StaticWarningCode.IMPORT_DUPLICATED_LIBRARY_UNNAMED,
+              node,
+              [prevLibrary.definingCompilationUnit.displayName,
+                  nodeLibrary.definingCompilationUnit.displayName]);
+        } else {
+          _errorReporter.reportErrorForNode(
+              StaticWarningCode.IMPORT_DUPLICATED_LIBRARY_NAMED,
+              node,
+              [prevLibrary.definingCompilationUnit.displayName,
+                  nodeLibrary.definingCompilationUnit.displayName,
+                  name]);
+        }
         return true;
       }
     } else {
@@ -3246,7 +3273,7 @@
    * @param importElement the [ImportElement] retrieved from the node, if the element in the
    *          node was `null`, then this method is not called
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#IMPORT_INTERNAL_LIBRARY
+   * See [CompileTimeErrorCode.IMPORT_INTERNAL_LIBRARY].
    */
   bool _checkForImportInternalLibrary(ImportDirective node, ImportElement importElement) {
     if (_isInSystemLibrary) {
@@ -3272,7 +3299,7 @@
    * inherited consistently.
    *
    * @return `true` if and only if an error code is generated on the passed node
-   * @see StaticTypeWarningCode#INCONSISTENT_METHOD_INHERITANCE
+   * See [StaticTypeWarningCode.INCONSISTENT_METHOD_INHERITANCE].
    */
   bool _checkForInconsistentMethodInheritance() {
     // Ensure that the inheritance manager has a chance to generate all errors we may care about,
@@ -3297,7 +3324,7 @@
    *          [getTypeReference]
    * @param name the accessed name to evaluate
    * @return `true` if and only if an error code is generated on the passed node
-   * @see StaticTypeWarningCode#INSTANCE_ACCESS_TO_STATIC_MEMBER
+   * See [StaticTypeWarningCode.INSTANCE_ACCESS_TO_STATIC_MEMBER].
    */
   bool _checkForInstanceAccessToStaticMember(ClassElement typeReference, SimpleIdentifier name) {
     // OK, in comment
@@ -3334,7 +3361,7 @@
    * @param executableElement the method to check.
    * @param errorNameTarget the node to report problems on.
    * @return `true` if and only if a warning was generated.
-   * @see StaticTypeWarningCode#INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC
+   * See [StaticTypeWarningCode.INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC].
    */
   bool _checkForInstanceMethodNameCollidesWithSuperclassStatic(ExecutableElement executableElement, SimpleIdentifier errorNameTarget) {
     String executableElementName = executableElement.name;
@@ -3398,7 +3425,7 @@
    *
    * @param argument the expression to which the operator is being applied
    * @return `true` if and only if an error code is generated on the passed node
-   * @see StaticWarningCode#ARGUMENT_TYPE_NOT_ASSIGNABLE
+   * See [StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE].
    */
   bool _checkForIntNotAssignable(Expression argument) {
     if (argument == null) {
@@ -3414,13 +3441,13 @@
    *
    * @param node the [Annotation]
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode.INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY
+   * See [CompileTimeErrorCode.INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY].
    */
   bool _checkForInvalidAnnotationFromDeferredLibrary(Annotation node) {
     Identifier nameIdentifier = node.name;
     if (nameIdentifier is PrefixedIdentifier) {
       if (nameIdentifier.isDeferred) {
-        _errorReporter.reportErrorForNode(CompileTimeErrorCode.INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY, node.name, []);
+        _errorReporter.reportErrorForNode(CompileTimeErrorCode.INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY, node.name);
         return true;
       }
     }
@@ -3433,7 +3460,7 @@
    * @param lhs the left hand side expression
    * @param rhs the right hand side expression
    * @return `true` if and only if an error code is generated on the passed node
-   * @see StaticTypeWarningCode#INVALID_ASSIGNMENT
+   * See [StaticTypeWarningCode.INVALID_ASSIGNMENT].
    */
   bool _checkForInvalidAssignment(Expression lhs, Expression rhs) {
     if (lhs == null || rhs == null) {
@@ -3457,7 +3484,7 @@
    * @param lhs the left hand side expression
    * @param rhs the right hand side expression
    * @return `true` if and only if an error code is generated on the passed node
-   * @see StaticTypeWarningCode#INVALID_ASSIGNMENT
+   * See [StaticTypeWarningCode.INVALID_ASSIGNMENT].
    */
   bool _checkForInvalidCompoundAssignment(AssignmentExpression node, Expression lhs, Expression rhs) {
     if (lhs == null) {
@@ -3524,11 +3551,11 @@
    *
    * @param node the 'this' expression to evaluate
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#INVALID_REFERENCE_TO_THIS
+   * See [CompileTimeErrorCode.INVALID_REFERENCE_TO_THIS].
    */
   bool _checkForInvalidReferenceToThis(ThisExpression node) {
     if (!_isThisInValidContext(node)) {
-      _errorReporter.reportErrorForNode(CompileTimeErrorCode.INVALID_REFERENCE_TO_THIS, node, []);
+      _errorReporter.reportErrorForNode(CompileTimeErrorCode.INVALID_REFERENCE_TO_THIS, node);
       return true;
     }
     return false;
@@ -3540,8 +3567,8 @@
    *
    * @param arguments a non-`null`, non-empty [TypeName] node list from the respective
    *          [ListLiteral] or [MapLiteral]
-   * @param errorCode either [CompileTimeErrorCode#INVALID_TYPE_ARGUMENT_IN_CONST_LIST] or
-   *          [CompileTimeErrorCode#INVALID_TYPE_ARGUMENT_IN_CONST_MAP]
+   * @param errorCode either [CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_IN_CONST_LIST] or
+   *          [CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_IN_CONST_MAP]
    * @return `true` if and only if an error code is generated on the passed node
    */
   bool _checkForInvalidTypeArgumentInConstTypedLiteral(NodeList<TypeName> arguments, ErrorCode errorCode) {
@@ -3562,8 +3589,8 @@
    * @param node the list literal to evaluate
    * @param typeArguments the type arguments, always non-`null`
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#LIST_ELEMENT_TYPE_NOT_ASSIGNABLE
-   * @see StaticWarningCode#LIST_ELEMENT_TYPE_NOT_ASSIGNABLE
+   * See [CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE], and
+   * [StaticWarningCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE].
    */
   bool _checkForListElementTypeNotAssignable(ListLiteral node, TypeArgumentList typeArguments) {
     NodeList<TypeName> typeNames = typeArguments.arguments;
@@ -3601,10 +3628,10 @@
    * @param node the map literal to evaluate
    * @param typeArguments the type arguments, always non-`null`
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#MAP_KEY_TYPE_NOT_ASSIGNABLE
-   * @see CompileTimeErrorCode#MAP_VALUE_TYPE_NOT_ASSIGNABLE
-   * @see StaticWarningCode#MAP_KEY_TYPE_NOT_ASSIGNABLE
-   * @see StaticWarningCode#MAP_VALUE_TYPE_NOT_ASSIGNABLE
+   * See [CompileTimeErrorCode.MAP_KEY_TYPE_NOT_ASSIGNABLE],
+   * [CompileTimeErrorCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE],
+   * [StaticWarningCode.MAP_KEY_TYPE_NOT_ASSIGNABLE], and
+   * [StaticWarningCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE].
    */
   bool _checkForMapTypeNotAssignable(MapLiteral node, TypeArgumentList typeArguments) {
     // Prepare maps key/value types.
@@ -3657,7 +3684,7 @@
    * the enclosing class.
    *
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#MEMBER_WITH_CLASS_NAME
+   * See [CompileTimeErrorCode.MEMBER_WITH_CLASS_NAME].
    */
   bool _checkForMemberWithClassName() {
     if (_enclosingClass == null) {
@@ -3671,7 +3698,7 @@
     // check accessors
     for (PropertyAccessorElement accessor in _enclosingClass.accessors) {
       if (className == accessor.name) {
-        _errorReporter.reportErrorForOffset(CompileTimeErrorCode.MEMBER_WITH_CLASS_NAME, accessor.nameOffset, className.length, []);
+        _errorReporter.reportErrorForOffset(CompileTimeErrorCode.MEMBER_WITH_CLASS_NAME, accessor.nameOffset, className.length);
         problemReported = true;
       }
     }
@@ -3686,8 +3713,8 @@
    *
    * @param node the accessor currently being visited
    * @return `true` if and only if an error code is generated on the passed node
-   * @see StaticWarningCode.MISMATCHED_GETTER_AND_SETTER_TYPES
-   * @see StaticWarningCode.MISMATCHED_GETTER_AND_SETTER_TYPES_FROM_SUPERTYPE
+   * See [StaticWarningCode.MISMATCHED_GETTER_AND_SETTER_TYPES], and
+   * [StaticWarningCode.MISMATCHED_GETTER_AND_SETTER_TYPES_FROM_SUPERTYPE].
    */
   bool _checkForMismatchedAccessorTypes(Declaration accessorDeclaration, String accessorTextName) {
     ExecutableElement accessorElement = accessorDeclaration.element as ExecutableElement;
@@ -3817,7 +3844,7 @@
    *
    * @param node the function body being tested
    * @return `true` if and only if an error code is generated on the passed node
-   * @see StaticWarningCode#MIXED_RETURN_TYPES
+   * See [StaticWarningCode.MIXED_RETURN_TYPES].
    */
   bool _checkForMixedReturns(BlockFunctionBody node) {
     if (_hasReturnWithoutValue) {
@@ -3827,10 +3854,10 @@
     int withoutCount = _returnsWithout.length;
     if (withCount > 0 && withoutCount > 0) {
       for (int i = 0; i < withCount; i++) {
-        _errorReporter.reportErrorForToken(StaticWarningCode.MIXED_RETURN_TYPES, _returnsWith[i].keyword, []);
+        _errorReporter.reportErrorForToken(StaticWarningCode.MIXED_RETURN_TYPES, _returnsWith[i].keyword);
       }
       for (int i = 0; i < withoutCount; i++) {
-        _errorReporter.reportErrorForToken(StaticWarningCode.MIXED_RETURN_TYPES, _returnsWithout[i].keyword, []);
+        _errorReporter.reportErrorForToken(StaticWarningCode.MIXED_RETURN_TYPES, _returnsWithout[i].keyword);
       }
       return true;
     }
@@ -3843,7 +3870,7 @@
    * @param mixinName the node to report problem on
    * @param mixinElement the mixing to evaluate
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#MIXIN_DECLARES_CONSTRUCTOR
+   * See [CompileTimeErrorCode.MIXIN_DECLARES_CONSTRUCTOR].
    */
   bool _checkForMixinDeclaresConstructor(TypeName mixinName, ClassElement mixinElement) {
     for (ConstructorElement constructor in mixinElement.constructors) {
@@ -3861,7 +3888,7 @@
    * @param mixinName the node to report problem on
    * @param mixinElement the mixing to evaluate
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#MIXIN_INHERITS_FROM_NOT_OBJECT
+   * See [CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT].
    */
   bool _checkForMixinInheritsNotFromObject(TypeName mixinName, ClassElement mixinElement) {
     InterfaceType mixinSupertype = mixinElement.supertype;
@@ -3880,7 +3907,7 @@
    * @param mixinName the node to report problem on
    * @param mixinElement the mixing to evaluate
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#MIXIN_REFERENCES_SUPER
+   * See [CompileTimeErrorCode.MIXIN_REFERENCES_SUPER].
    */
   bool _checkForMixinReferencesSuper(TypeName mixinName, ClassElement mixinElement) {
     if (mixinElement.hasReferenceToSuper) {
@@ -3894,7 +3921,7 @@
    *
    * @param node the constructor declaration to evaluate
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#MULTIPLE_SUPER_INITIALIZERS
+   * See [CompileTimeErrorCode.MULTIPLE_SUPER_INITIALIZERS].
    */
   bool _checkForMultipleSuperInitializers(ConstructorDeclaration node) {
     int numSuperInitializers = 0;
@@ -3902,7 +3929,7 @@
       if (initializer is SuperConstructorInvocation) {
         numSuperInitializers++;
         if (numSuperInitializers > 1) {
-          _errorReporter.reportErrorForNode(CompileTimeErrorCode.MULTIPLE_SUPER_INITIALIZERS, initializer, []);
+          _errorReporter.reportErrorForNode(CompileTimeErrorCode.MULTIPLE_SUPER_INITIALIZERS, initializer);
         }
       }
     }
@@ -3914,11 +3941,11 @@
    *
    * @param node the native function body to test
    * @return `true` if and only if an error code is generated on the passed node
-   * @see ParserErrorCode#NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE
+   * See [ParserErrorCode.NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE].
    */
   bool _checkForNativeFunctionBodyInNonSDKCode(NativeFunctionBody node) {
     if (!_isInSystemLibrary && !_hasExtUri) {
-      _errorReporter.reportErrorForNode(ParserErrorCode.NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE, node, []);
+      _errorReporter.reportErrorForNode(ParserErrorCode.NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE, node);
       return true;
     }
     return false;
@@ -3933,7 +3960,7 @@
    * @param constructorName the constructor name, always non-`null`
    * @param typeName the name of the type defining the constructor, always non-`null`
    * @return `true` if and only if an error code is generated on the passed node
-   * @see StaticWarningCode#NEW_WITH_UNDEFINED_CONSTRUCTOR
+   * See [StaticWarningCode.NEW_WITH_UNDEFINED_CONSTRUCTOR].
    */
   bool _checkForNewWithUndefinedConstructor(InstanceCreationExpression node, ConstructorName constructorName, TypeName typeName) {
     // OK if resolved
@@ -3966,7 +3993,7 @@
    *
    * @param node the [ClassDeclaration] to evaluate
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT
+   * See [CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT].
    */
   bool _checkForNoDefaultSuperConstructorImplicit(ClassDeclaration node) {
     // do nothing if there is explicit constructor
@@ -3987,7 +4014,9 @@
         _errorReporter.reportErrorForNode(CompileTimeErrorCode.NON_GENERATIVE_CONSTRUCTOR, node.name, [superUnnamedConstructor]);
         return true;
       }
-      if (superUnnamedConstructor.isDefaultConstructor) {
+      if (superUnnamedConstructor.isDefaultConstructor &&
+          _enclosingClass.isSuperConstructorAccessible(
+              superUnnamedConstructor)) {
         return true;
       }
     }
@@ -4003,11 +4032,11 @@
    * @param classNameNode the [SimpleIdentifier] to be used if there is a violation, this is
    *          either the named from the [ClassDeclaration] or from the [ClassTypeAlias].
    * @return `true` if and only if an error code is generated on the passed node
-   * @see StaticWarningCode#NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE
-   * @see StaticWarningCode#NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO
-   * @see StaticWarningCode#NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THREE
-   * @see StaticWarningCode#NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOUR
-   * @see StaticWarningCode#NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FIVE_PLUS
+   * See [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE],
+   * [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO],
+   * [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THREE],
+   * [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOUR], and
+   * [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FIVE_PLUS].
    */
   bool _checkForNonAbstractClassInheritsAbstractMember(SimpleIdentifier classNameNode) {
     if (_enclosingClass.isAbstract) {
@@ -4145,12 +4174,12 @@
    *
    * @param condition the conditional expression to test
    * @return `true` if and only if an error code is generated on the passed node
-   * @see StaticTypeWarningCode#NON_BOOL_CONDITION
+   * See [StaticTypeWarningCode.NON_BOOL_CONDITION].
    */
   bool _checkForNonBoolCondition(Expression condition) {
     DartType conditionType = getStaticType(condition);
     if (conditionType != null && !conditionType.isAssignableTo(_boolType)) {
-      _errorReporter.reportErrorForNode(StaticTypeWarningCode.NON_BOOL_CONDITION, condition, []);
+      _errorReporter.reportErrorForNode(StaticTypeWarningCode.NON_BOOL_CONDITION, condition);
       return true;
     }
     return false;
@@ -4161,20 +4190,20 @@
    *
    * @param node the assert statement to evaluate
    * @return `true` if and only if an error code is generated on the passed node
-   * @see StaticTypeWarningCode#NON_BOOL_EXPRESSION
+   * See [StaticTypeWarningCode.NON_BOOL_EXPRESSION].
    */
   bool _checkForNonBoolExpression(AssertStatement node) {
     Expression expression = node.condition;
     DartType type = getStaticType(expression);
     if (type is InterfaceType) {
       if (!type.isAssignableTo(_boolType)) {
-        _errorReporter.reportErrorForNode(StaticTypeWarningCode.NON_BOOL_EXPRESSION, expression, []);
+        _errorReporter.reportErrorForNode(StaticTypeWarningCode.NON_BOOL_EXPRESSION, expression);
         return true;
       }
     } else if (type is FunctionType) {
       FunctionType functionType = type;
       if (functionType.typeArguments.length == 0 && !functionType.returnType.isAssignableTo(_boolType)) {
-        _errorReporter.reportErrorForNode(StaticTypeWarningCode.NON_BOOL_EXPRESSION, expression, []);
+        _errorReporter.reportErrorForNode(StaticTypeWarningCode.NON_BOOL_EXPRESSION, expression);
         return true;
       }
     }
@@ -4186,12 +4215,12 @@
    *
    * @param expression the expression expression to test
    * @return `true` if and only if an error code is generated on the passed node
-   * @see StaticTypeWarningCode#NON_BOOL_NEGATION_EXPRESSION
+   * See [StaticTypeWarningCode.NON_BOOL_NEGATION_EXPRESSION].
    */
   bool _checkForNonBoolNegationExpression(Expression expression) {
     DartType conditionType = getStaticType(expression);
     if (conditionType != null && !conditionType.isAssignableTo(_boolType)) {
-      _errorReporter.reportErrorForNode(StaticTypeWarningCode.NON_BOOL_NEGATION_EXPRESSION, expression, []);
+      _errorReporter.reportErrorForNode(StaticTypeWarningCode.NON_BOOL_NEGATION_EXPRESSION, expression);
       return true;
     }
     return false;
@@ -4205,7 +4234,7 @@
    *
    * @param node the map literal to evaluate
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#NON_CONST_MAP_AS_EXPRESSION_STATEMENT
+   * See [CompileTimeErrorCode.NON_CONST_MAP_AS_EXPRESSION_STATEMENT].
    */
   bool _checkForNonConstMapAsExpressionStatement(MapLiteral node) {
     // "const"
@@ -4226,7 +4255,7 @@
       return false;
     }
     // report problem
-    _errorReporter.reportErrorForNode(CompileTimeErrorCode.NON_CONST_MAP_AS_EXPRESSION_STATEMENT, node, []);
+    _errorReporter.reportErrorForNode(CompileTimeErrorCode.NON_CONST_MAP_AS_EXPRESSION_STATEMENT, node);
     return true;
   }
 
@@ -4236,7 +4265,7 @@
    *
    * @param node the method declaration to evaluate
    * @return `true` if and only if an error code is generated on the passed node
-   * @see StaticWarningCode#NON_VOID_RETURN_FOR_OPERATOR
+   * See [StaticWarningCode.NON_VOID_RETURN_FOR_OPERATOR].
    */
   bool _checkForNonVoidReturnTypeForOperator(MethodDeclaration node) {
     // check that []= operator
@@ -4249,7 +4278,7 @@
     if (typeName != null) {
       DartType type = typeName.type;
       if (type != null && !type.isVoid) {
-        _errorReporter.reportErrorForNode(StaticWarningCode.NON_VOID_RETURN_FOR_OPERATOR, typeName, []);
+        _errorReporter.reportErrorForNode(StaticWarningCode.NON_VOID_RETURN_FOR_OPERATOR, typeName);
       }
     }
     // no warning
@@ -4261,13 +4290,13 @@
    *
    * @param typeName the type name to evaluate
    * @return `true` if and only if an error code is generated on the passed node
-   * @see StaticWarningCode#NON_VOID_RETURN_FOR_SETTER
+   * See [StaticWarningCode.NON_VOID_RETURN_FOR_SETTER].
    */
   bool _checkForNonVoidReturnTypeForSetter(TypeName typeName) {
     if (typeName != null) {
       DartType type = typeName.type;
       if (type != null && !type.isVoid) {
-        _errorReporter.reportErrorForNode(StaticWarningCode.NON_VOID_RETURN_FOR_SETTER, typeName, []);
+        _errorReporter.reportErrorForNode(StaticWarningCode.NON_VOID_RETURN_FOR_SETTER, typeName);
       }
     }
     return false;
@@ -4281,7 +4310,7 @@
    *
    * @param node the method declaration to evaluate
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#OPTIONAL_PARAMETER_IN_OPERATOR
+   * See [CompileTimeErrorCode.OPTIONAL_PARAMETER_IN_OPERATOR].
    */
   bool _checkForOptionalParameterInOperator(MethodDeclaration node) {
     FormalParameterList parameterList = node.parameters;
@@ -4292,7 +4321,7 @@
     NodeList<FormalParameter> formalParameters = parameterList.parameters;
     for (FormalParameter formalParameter in formalParameters) {
       if (formalParameter.kind.isOptional) {
-        _errorReporter.reportErrorForNode(CompileTimeErrorCode.OPTIONAL_PARAMETER_IN_OPERATOR, formalParameter, []);
+        _errorReporter.reportErrorForNode(CompileTimeErrorCode.OPTIONAL_PARAMETER_IN_OPERATOR, formalParameter);
         foundError = true;
       }
     }
@@ -4304,7 +4333,7 @@
    *
    * @param node the default formal parameter to evaluate
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#PRIVATE_OPTIONAL_PARAMETER
+   * See [CompileTimeErrorCode.PRIVATE_OPTIONAL_PARAMETER].
    */
   bool _checkForPrivateOptionalParameter(FormalParameter node) {
     // should be named parameter
@@ -4317,7 +4346,7 @@
       return false;
     }
     // report problem
-    _errorReporter.reportErrorForNode(CompileTimeErrorCode.PRIVATE_OPTIONAL_PARAMETER, node, []);
+    _errorReporter.reportErrorForNode(CompileTimeErrorCode.PRIVATE_OPTIONAL_PARAMETER, node);
     return true;
   }
 
@@ -4328,7 +4357,7 @@
    * @param node the constructor declaration to evaluate
    * @param constructorElement the constructor element
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#RECURSIVE_CONSTRUCTOR_REDIRECT
+   * See [CompileTimeErrorCode.RECURSIVE_CONSTRUCTOR_REDIRECT].
    */
   bool _checkForRecursiveConstructorRedirect(ConstructorDeclaration node, ConstructorElement constructorElement) {
     // we check generative constructor here
@@ -4343,7 +4372,7 @@
           return false;
         }
         // report error
-        _errorReporter.reportErrorForNode(CompileTimeErrorCode.RECURSIVE_CONSTRUCTOR_REDIRECT, initializer, []);
+        _errorReporter.reportErrorForNode(CompileTimeErrorCode.RECURSIVE_CONSTRUCTOR_REDIRECT, initializer);
         return true;
       }
     }
@@ -4358,7 +4387,7 @@
    * @param node the constructor declaration to evaluate
    * @param constructorElement the constructor element
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#RECURSIVE_FACTORY_REDIRECT
+   * See [CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT].
    */
   bool _checkForRecursiveFactoryRedirect(ConstructorDeclaration node, ConstructorElement constructorElement) {
     // prepare redirected constructor
@@ -4371,7 +4400,7 @@
       return false;
     }
     // report error
-    _errorReporter.reportErrorForNode(CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT, redirectedConstructorNode, []);
+    _errorReporter.reportErrorForNode(CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT, redirectedConstructorNode);
     return true;
   }
 
@@ -4380,9 +4409,9 @@
    *
    * @param classElt the class element to test
    * @return `true` if and only if an error code is generated on the passed element
-   * @see CompileTimeErrorCode#RECURSIVE_INTERFACE_INHERITANCE
-   * @see CompileTimeErrorCode#RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_EXTENDS
-   * @see CompileTimeErrorCode#RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_IMPLEMENTS
+   * See [CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE],
+   * [CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_EXTENDS], and
+   * [CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_IMPLEMENTS].
    */
   bool _checkForRecursiveInterfaceInheritance(ClassElement classElt) {
     if (classElt == null) {
@@ -4397,11 +4426,11 @@
    *
    * @param node the constructor declaration to evaluate
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#DEFAULT_VALUE_IN_REDIRECTING_FACTORY_CONSTRUCTOR
-   * @see CompileTimeErrorCode#FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR
-   * @see CompileTimeErrorCode#MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS
-   * @see CompileTimeErrorCode#SUPER_IN_REDIRECTING_CONSTRUCTOR
-   * @see CompileTimeErrorCode#REDIRECT_GENERATIVE_TO_NON_GENERATIVE_CONSTRUCTOR
+   * See [CompileTimeErrorCode.DEFAULT_VALUE_IN_REDIRECTING_FACTORY_CONSTRUCTOR],
+   * [CompileTimeErrorCode.FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR],
+   * [CompileTimeErrorCode.MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS],
+   * [CompileTimeErrorCode.SUPER_IN_REDIRECTING_CONSTRUCTOR], and
+   * [CompileTimeErrorCode.REDIRECT_GENERATIVE_TO_NON_GENERATIVE_CONSTRUCTOR].
    */
   bool _checkForRedirectingConstructorErrorCodes(ConstructorDeclaration node) {
     bool errorReported = false;
@@ -4412,7 +4441,7 @@
     if (redirectedConstructor != null) {
       for (FormalParameter parameter in node.parameters.parameters) {
         if (parameter is DefaultFormalParameter && parameter.defaultValue != null) {
-          _errorReporter.reportErrorForNode(CompileTimeErrorCode.DEFAULT_VALUE_IN_REDIRECTING_FACTORY_CONSTRUCTOR, parameter.identifier, []);
+          _errorReporter.reportErrorForNode(CompileTimeErrorCode.DEFAULT_VALUE_IN_REDIRECTING_FACTORY_CONSTRUCTOR, parameter.identifier);
           errorReported = true;
         }
       }
@@ -4422,7 +4451,7 @@
     for (ConstructorInitializer initializer in node.initializers) {
       if (initializer is RedirectingConstructorInvocation) {
         if (numRedirections > 0) {
-          _errorReporter.reportErrorForNode(CompileTimeErrorCode.MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS, initializer, []);
+          _errorReporter.reportErrorForNode(CompileTimeErrorCode.MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS, initializer);
           errorReported = true;
         }
         if (node.factoryKeyword == null) {
@@ -4437,7 +4466,7 @@
             _errorReporter.reportErrorForNode(CompileTimeErrorCode.REDIRECT_GENERATIVE_TO_MISSING_CONSTRUCTOR, invocation, [constructorStrName, enclosingTypeName]);
           } else {
             if (redirectingElement.isFactory) {
-              _errorReporter.reportErrorForNode(CompileTimeErrorCode.REDIRECT_GENERATIVE_TO_NON_GENERATIVE_CONSTRUCTOR, initializer, []);
+              _errorReporter.reportErrorForNode(CompileTimeErrorCode.REDIRECT_GENERATIVE_TO_NON_GENERATIVE_CONSTRUCTOR, initializer);
             }
           }
         }
@@ -4448,11 +4477,11 @@
     if (numRedirections > 0) {
       for (ConstructorInitializer initializer in node.initializers) {
         if (initializer is SuperConstructorInvocation) {
-          _errorReporter.reportErrorForNode(CompileTimeErrorCode.SUPER_IN_REDIRECTING_CONSTRUCTOR, initializer, []);
+          _errorReporter.reportErrorForNode(CompileTimeErrorCode.SUPER_IN_REDIRECTING_CONSTRUCTOR, initializer);
           errorReported = true;
         }
         if (initializer is ConstructorFieldInitializer) {
-          _errorReporter.reportErrorForNode(CompileTimeErrorCode.FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR, initializer, []);
+          _errorReporter.reportErrorForNode(CompileTimeErrorCode.FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR, initializer);
           errorReported = true;
         }
       }
@@ -4468,7 +4497,7 @@
    * @param node the constructor declaration to evaluate
    * @param constructorElement the constructor element
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#REDIRECT_TO_NON_CONST_CONSTRUCTOR
+   * See [CompileTimeErrorCode.REDIRECT_TO_NON_CONST_CONSTRUCTOR].
    */
   bool _checkForRedirectToNonConstConstructor(ConstructorDeclaration node, ConstructorElement constructorElement) {
     // prepare redirected constructor
@@ -4494,7 +4523,7 @@
       return false;
     }
     // report error
-    _errorReporter.reportErrorForNode(CompileTimeErrorCode.REDIRECT_TO_NON_CONST_CONSTRUCTOR, redirectedConstructorNode, []);
+    _errorReporter.reportErrorForNode(CompileTimeErrorCode.REDIRECT_TO_NON_CONST_CONSTRUCTOR, redirectedConstructorNode);
     return true;
   }
 
@@ -4503,11 +4532,11 @@
    *
    * @param node the rethrow expression to evaluate
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#RETHROW_OUTSIDE_CATCH
+   * See [CompileTimeErrorCode.RETHROW_OUTSIDE_CATCH].
    */
   bool _checkForRethrowOutsideCatch(RethrowExpression node) {
     if (!_isInCatchClause) {
-      _errorReporter.reportErrorForNode(CompileTimeErrorCode.RETHROW_OUTSIDE_CATCH, node, []);
+      _errorReporter.reportErrorForNode(CompileTimeErrorCode.RETHROW_OUTSIDE_CATCH, node);
       return true;
     }
     return false;
@@ -4519,7 +4548,7 @@
    *
    * @param node the constructor to evaluate
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#RETURN_IN_GENERATIVE_CONSTRUCTOR
+   * See [CompileTimeErrorCode.RETURN_IN_GENERATIVE_CONSTRUCTOR].
    */
   bool _checkForReturnInGenerativeConstructor(ConstructorDeclaration node) {
     // ignore factory
@@ -4532,7 +4561,7 @@
       return false;
     }
     // report error
-    _errorReporter.reportErrorForNode(CompileTimeErrorCode.RETURN_IN_GENERATIVE_CONSTRUCTOR, body, []);
+    _errorReporter.reportErrorForNode(CompileTimeErrorCode.RETURN_IN_GENERATIVE_CONSTRUCTOR, body);
     return true;
   }
 
@@ -4546,7 +4575,7 @@
    * @param returnExpression the returned expression to evaluate
    * @param expectedReturnType the expressed return type by the enclosing method or function
    * @return `true` if and only if an error code is generated on the passed node
-   * @see StaticTypeWarningCode#RETURN_OF_INVALID_TYPE
+   * See [StaticTypeWarningCode.RETURN_OF_INVALID_TYPE].
    */
   bool _checkForReturnOfInvalidType(Expression returnExpression, DartType expectedReturnType) {
     if (_enclosingFunction == null) {
@@ -4611,7 +4640,7 @@
    *          [getTypeReference]
    * @param name the accessed name to evaluate
    * @return `true` if and only if an error code is generated on the passed node
-   * @see StaticWarningCode#STATIC_ACCESS_TO_INSTANCE_MEMBER
+   * See [StaticWarningCode.STATIC_ACCESS_TO_INSTANCE_MEMBER].
    */
   bool _checkForStaticAccessToInstanceMember(ClassElement typeReference, SimpleIdentifier name) {
     // OK, target is not a type
@@ -4639,7 +4668,7 @@
    *
    * @param node the 'switch' statement to evaluate
    * @return `true` if and only if an error code is generated on the passed node
-   * @see StaticWarningCode#SWITCH_EXPRESSION_NOT_ASSIGNABLE
+   * See [StaticWarningCode.SWITCH_EXPRESSION_NOT_ASSIGNABLE].
    */
   bool _checkForSwitchExpressionNotAssignable(SwitchStatement node) {
     // prepare 'switch' expression type
@@ -4674,14 +4703,14 @@
    *
    * @param node the function type alias to evaluate
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#TYPE_ALIAS_CANNOT_REFERENCE_ITSELF
+   * See [CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF].
    */
   bool _checkForTypeAliasCannotReferenceItself_function(FunctionTypeAlias node) {
     FunctionTypeAliasElement element = node.element;
     if (!_hasTypedefSelfReference(element)) {
       return false;
     }
-    _errorReporter.reportErrorForNode(CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF, node, []);
+    _errorReporter.reportErrorForNode(CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF, node);
     return true;
   }
 
@@ -4690,7 +4719,7 @@
    *
    * @param expression the expression to evaluate
    * @return `true` if and only if an error code is generated on the passed node
-   * @see StaticWarningCode#TYPE_ANNOTATION_DEFERRED_CLASS
+   * See [StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS].
    */
   bool _checkForTypeAnnotationDeferredClass(TypeName node) {
     if (node != null && node.isDeferred) {
@@ -4704,7 +4733,7 @@
    *
    * @param node the [TypeName] to evaluate
    * @return `true` if and only if an error code is generated on the passed node
-   * @see StaticTypeWarningCode#TYPE_ARGUMENT_NOT_MATCHING_BOUNDS
+   * See [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS].
    */
   bool _checkForTypeArgumentNotMatchingBounds(TypeName node) {
     if (node.typeArguments == null) {
@@ -4758,13 +4787,13 @@
    *
    * @param node the type name to evaluate
    * @return `true` if and only if an error code is generated on the passed node
-   * @see StaticWarningCode#TYPE_PARAMETER_REFERENCED_BY_STATIC
+   * See [StaticWarningCode.TYPE_PARAMETER_REFERENCED_BY_STATIC].
    */
   bool _checkForTypeParameterReferencedByStatic(TypeName node) {
     if (_isInStaticMethod || _isInStaticVariableDeclaration) {
       DartType type = node.type;
       if (type is TypeParameterType) {
-        _errorReporter.reportErrorForNode(StaticWarningCode.TYPE_PARAMETER_REFERENCED_BY_STATIC, node, []);
+        _errorReporter.reportErrorForNode(StaticWarningCode.TYPE_PARAMETER_REFERENCED_BY_STATIC, node);
         return true;
       }
     }
@@ -4776,7 +4805,7 @@
    *
    * @param node the type parameter to evaluate
    * @return `true` if and only if an error code is generated on the passed node
-   * @see StaticTypeWarningCode#TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND
+   * See [StaticTypeWarningCode.TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND].
    */
   bool _checkForTypeParameterSupertypeOfItsBound(TypeParameter node) {
     TypeParameterElement element = node.element;
@@ -4801,9 +4830,9 @@
    *
    * @param node the constructor declaration to evaluate
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT
-   * @see CompileTimeErrorCode#NON_GENERATIVE_CONSTRUCTOR
-   * @see StaticWarningCode#NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT
+   * See [CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT],
+   * [CompileTimeErrorCode.NON_GENERATIVE_CONSTRUCTOR], and
+   * [StaticWarningCode.NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT].
    */
   bool _checkForUndefinedConstructorInInitializerImplicit(ConstructorDeclaration node) {
     //
@@ -4838,7 +4867,9 @@
         _errorReporter.reportErrorForNode(CompileTimeErrorCode.NON_GENERATIVE_CONSTRUCTOR, node.returnType, [superUnnamedConstructor]);
         return true;
       }
-      if (!superUnnamedConstructor.isDefaultConstructor) {
+      if (!superUnnamedConstructor.isDefaultConstructor ||
+          !_enclosingClass.isSuperConstructorAccessible(
+              superUnnamedConstructor)) {
         int offset;
         int length;
         {
@@ -4861,7 +4892,7 @@
    *
    * @param name the name to be evaluated
    * @return `true` if and only if an error code is generated on the passed node
-   * @see StaticTypeWarningCode#UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER
+   * See [StaticTypeWarningCode.UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER].
    */
   bool _checkForUnqualifiedReferenceToNonLocalStaticMember(SimpleIdentifier name) {
     Element element = name.staticElement;
@@ -4912,7 +4943,7 @@
     }
     //    else {
     //    // TODO(jwren) Report error, constructor initializer variable is a top level element
-    //    // (Either here or in ErrorVerifier#checkForAllFinalInitializedErrorCodes)
+    //    // (Either here or in ErrorVerifier.checkForAllFinalInitializedErrorCodes)
     //    }
   }
 
@@ -4921,14 +4952,14 @@
    *
    * @param node the method declaration to evaluate
    * @return `true` if and only if an error code is generated on the passed node
-   * @see StaticWarningCode#VOID_RETURN_FOR_GETTER
+   * See [StaticWarningCode.VOID_RETURN_FOR_GETTER].
    */
   bool _checkForVoidReturnType(MethodDeclaration node) {
     TypeName returnType = node.returnType;
     if (returnType == null || returnType.name.name != "void") {
       return false;
     }
-    _errorReporter.reportErrorForNode(StaticWarningCode.VOID_RETURN_FOR_GETTER, returnType, []);
+    _errorReporter.reportErrorForNode(StaticWarningCode.VOID_RETURN_FOR_GETTER, returnType);
     return true;
   }
 
@@ -4940,7 +4971,7 @@
    *
    * @param node the method declaration to evaluate
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR
+   * See [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR].
    */
   bool _checkForWrongNumberOfParametersForOperator(MethodDeclaration node) {
     // prepare number of parameters
@@ -4985,7 +5016,7 @@
    * @param setterName the name of the setter to report problems on
    * @param parameterList the parameter list to evaluate
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER
+   * See [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER].
    */
   bool _checkForWrongNumberOfParametersForSetter(SimpleIdentifier setterName, FormalParameterList parameterList) {
     if (setterName == null) {
@@ -4996,7 +5027,7 @@
     }
     NodeList<FormalParameter> parameters = parameterList.parameters;
     if (parameters.length != 1 || parameters[0].kind != ParameterKind.REQUIRED) {
-      _errorReporter.reportErrorForNode(CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER, setterName, []);
+      _errorReporter.reportErrorForNode(CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER, setterName);
       return true;
     }
     return false;
@@ -5007,7 +5038,7 @@
    * concrete implementation of the call method.
    *
    * @return `true` if and only if an error code is generated on the passed node
-   * @see StaticWarningCode#FUNCTION_WITHOUT_CALL
+   * See [StaticWarningCode.FUNCTION_WITHOUT_CALL].
    */
   bool _checkImplementsFunctionWithoutCall(ClassDeclaration node) {
     if (node.isAbstract) {
@@ -5026,7 +5057,7 @@
     }
     ExecutableElement callMethod = _inheritanceManager.lookupMember(classElement, "call");
     if (callMethod == null || callMethod is! MethodElement || (callMethod as MethodElement).isAbstract) {
-      _errorReporter.reportErrorForNode(StaticWarningCode.FUNCTION_WITHOUT_CALL, node.name, []);
+      _errorReporter.reportErrorForNode(StaticWarningCode.FUNCTION_WITHOUT_CALL, node.name);
       return true;
     }
     return false;
@@ -5037,7 +5068,7 @@
    * and 'implements' clauses.
    *
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#IMPLEMENTS_SUPER_CLASS
+   * See [CompileTimeErrorCode.IMPLEMENTS_SUPER_CLASS].
    */
   bool _checkImplementsSuperClass(ClassDeclaration node) {
     // prepare super type
@@ -5138,7 +5169,7 @@
    *
    * @param directives the list of directives that have the same prefix
    * @return `true` if an error was generated
-   * @see CompileTimeErrorCode#SHARED_DEFERRED_PREFIX
+   * See [CompileTimeErrorCode.SHARED_DEFERRED_PREFIX].
    */
   bool _hasDeferredPrefixCollision(List<ImportDirective> directives) {
     bool foundError = false;
@@ -5147,7 +5178,7 @@
       for (int i = 0; i < count; i++) {
         sc.Token deferredToken = directives[i].deferredToken;
         if (deferredToken != null) {
-          _errorReporter.reportErrorForToken(CompileTimeErrorCode.SHARED_DEFERRED_PREFIX, deferredToken, []);
+          _errorReporter.reportErrorForToken(CompileTimeErrorCode.SHARED_DEFERRED_PREFIX, deferredToken);
           foundError = true;
         }
       }
@@ -5181,6 +5212,8 @@
   bool _hasTypedefSelfReference(Element target) {
     Set<Element> checked = new HashSet<Element>();
     List<Element> toCheck = new List<Element>();
+    GeneralizingElementVisitor_ErrorVerifier_hasTypedefSelfReference elementVisitor =
+        new GeneralizingElementVisitor_ErrorVerifier_hasTypedefSelfReference(toCheck);
     toCheck.add(target);
     bool firstIteration = true;
     while (true) {
@@ -5206,7 +5239,7 @@
         }
       }
       // check current element
-      current.accept(new GeneralizingElementVisitor_ErrorVerifier_hasTypedefSelfReference(target, toCheck));
+      current.accept(elementVisitor);
       checked.add(current);
     }
   }
@@ -5363,10 +5396,10 @@
    * @param classElt the class element to test
    * @param path a list containing the potentially cyclic implements path
    * @return `true` if and only if an error code is generated on the passed element
-   * @see CompileTimeErrorCode#RECURSIVE_INTERFACE_INHERITANCE
-   * @see CompileTimeErrorCode#RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_EXTENDS
-   * @see CompileTimeErrorCode#RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_IMPLEMENTS
-   * @see CompileTimeErrorCode#RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_WITH
+   * See [CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE],
+   * [CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_EXTENDS],
+   * [CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_IMPLEMENTS], and
+   * [CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_WITH].
    */
   bool _safeCheckForRecursiveInterfaceInheritance(ClassElement classElt, List<ClassElement> path) {
     // Detect error condition.
@@ -5421,35 +5454,15 @@
 }
 
 class GeneralizingElementVisitor_ErrorVerifier_hasTypedefSelfReference extends GeneralizingElementVisitor<Object> {
-  Element target;
-
   List<Element> toCheck;
 
-  GeneralizingElementVisitor_ErrorVerifier_hasTypedefSelfReference(this.target, this.toCheck) : super();
-
-  bool _inClass = false;
+  GeneralizingElementVisitor_ErrorVerifier_hasTypedefSelfReference(
+      this.toCheck) : super();
 
   @override
   Object visitClassElement(ClassElement element) {
-    _addTypeToCheck(element.supertype);
-    for (InterfaceType mixin in element.mixins) {
-      _addTypeToCheck(mixin);
-    }
-    _inClass = !element.isTypedef;
-    try {
-      return super.visitClassElement(element);
-    } finally {
-      _inClass = false;
-    }
-  }
-
-  @override
-  Object visitExecutableElement(ExecutableElement element) {
-    if (element.isSynthetic) {
-      return null;
-    }
-    _addTypeToCheck(element.returnType);
-    return super.visitExecutableElement(element);
+    // Typedefs are allowed to reference themselves via classes.
+    return null;
   }
 
   @override
@@ -5470,23 +5483,12 @@
     return super.visitTypeParameterElement(element);
   }
 
-  @override
-  Object visitVariableElement(VariableElement element) {
-    _addTypeToCheck(element.type);
-    return super.visitVariableElement(element);
-  }
-
   void _addTypeToCheck(DartType type) {
     if (type == null) {
       return;
     }
-    Element element = type.element;
-    // it is OK to reference target from class
-    if (_inClass && target == element) {
-      return;
-    }
     // schedule for checking
-    toCheck.add(element);
+    toCheck.add(type.element);
     // type arguments
     if (type is InterfaceType) {
       InterfaceType interfaceType = type;
diff --git a/pkg/analyzer/lib/src/generated/html.dart b/pkg/analyzer/lib/src/generated/html.dart
index 50743a1..956a2da 100644
--- a/pkg/analyzer/lib/src/generated/html.dart
+++ b/pkg/analyzer/lib/src/generated/html.dart
@@ -23,7 +23,7 @@
  * required to implement the interface used to access the characters being scanned.
  */
 abstract class AbstractScanner {
-  static List<String> _NO_PASS_THROUGH_ELEMENTS = <String> [];
+  static List<String> _NO_PASS_THROUGH_ELEMENTS = <String>[];
 
   /**
    * The source being scanned.
@@ -1196,6 +1196,11 @@
   List<XmlExpression> expressions = XmlExpression.EMPTY_ARRAY;
 
   /**
+   * An empty list of XML attribute nodes.
+   */
+  static const List<XmlAttributeNode> EMPTY_LIST = const <XmlAttributeNode>[];
+
+  /**
    * Construct a new instance representing an XML attribute.
    *
    * @param name the name token (not `null`). This may be a zero length token if the attribute
@@ -1659,7 +1664,7 @@
 
   /**
    * Parse the token stream for an attribute. This method advances the current token over the
-   * attribute, but should not be called if the [currentToken] is not [TokenType#TAG].
+   * attribute, but should not be called if the [currentToken] is not [TokenType.TAG].
    *
    * @return the attribute (not `null`)
    */
@@ -1690,7 +1695,7 @@
 
   /**
    * Parse the stream for a sequence of attributes. This method advances the current token to the
-   * next [TokenType#GT], [TokenType#SLASH_GT], or [TokenType#EOF].
+   * next [TokenType.GT], [TokenType.SLASH_GT], or [TokenType.EOF].
    *
    * @return a collection of zero or more attributes (not `null`, contains no `null`s)
    */
@@ -1714,7 +1719,7 @@
 
   /**
    * Parse the stream for a sequence of tag nodes existing within a parent tag node. This method
-   * advances the current token to the next [TokenType#LT_SLASH] or [TokenType#EOF].
+   * advances the current token to the next [TokenType.LT_SLASH] or [TokenType.EOF].
    *
    * @return a list of nodes (not `null`, contains no `null`s)
    */
@@ -1741,12 +1746,12 @@
 
   /**
    * Parse the token stream for the next tag node. This method advances current token over the
-   * parsed tag node, but should only be called if the current token is [TokenType#LT]
+   * parsed tag node, but should only be called if the current token is [TokenType.LT]
    *
    * @return the tag node or `null` if none found
    */
   XmlTagNode _parseTagNode() {
-    // Assume that the current node is a tag node start TokenType#LT
+    // Assume that the current node is a tag node start TokenType.LT
     Token nodeStart = _currentToken;
     _currentToken = _currentToken.next;
     // Get the tag or create a synthetic tag and report an error
@@ -1831,12 +1836,12 @@
   static List<XmlTagNode> NO_TAG_NODES = new UnmodifiableListView(new List<XmlTagNode>());
 
   /**
-   * The starting [TokenType#LT] token (not `null`).
+   * The starting [TokenType.LT] token (not `null`).
    */
   final Token nodeStart;
 
   /**
-   * The [TokenType#TAG] token after the starting '&lt;' (not `null`).
+   * The [TokenType.TAG] token after the starting '&lt;' (not `null`).
    */
   final Token _tag;
 
@@ -1846,7 +1851,7 @@
   List<XmlAttributeNode> _attributes;
 
   /**
-   * The [TokenType#GT] or [TokenType#SLASH_GT] token after the attributes (not
+   * The [TokenType.GT] or [TokenType.SLASH_GT] token after the attributes (not
    * `null`). The token may be the same token as [nodeEnd] if there are no child
    * [tagNodes].
    */
@@ -1859,23 +1864,23 @@
 
   /**
    * The token (not `null`) after the content, which may be
-   * * (1) [TokenType#LT_SLASH] for nodes with open and close tags, or
-   * * (2) the [TokenType#LT] nodeStart of the next sibling node if this node is self
-   * closing or the attributeEnd is [TokenType#SLASH_GT], or
-   * * (3) [TokenType#EOF] if the node does not have a closing tag and is the last node in
-   * the stream [TokenType#LT_SLASH] token after the content, or `null` if there is no
-   * content and the attributes ended with [TokenType#SLASH_GT].
+   * * (1) [TokenType.LT_SLASH] for nodes with open and close tags, or
+   * * (2) the [TokenType.LT] nodeStart of the next sibling node if this node is self
+   * closing or the attributeEnd is [TokenType.SLASH_GT], or
+   * * (3) [TokenType.EOF] if the node does not have a closing tag and is the last node in
+   * the stream [TokenType.LT_SLASH] token after the content, or `null` if there is no
+   * content and the attributes ended with [TokenType.SLASH_GT].
    */
   final Token contentEnd;
 
   /**
-   * The closing [TokenType#TAG] after the child elements or `null` if there is no
-   * content and the attributes ended with [TokenType#SLASH_GT]
+   * The closing [TokenType.TAG] after the child elements or `null` if there is no
+   * content and the attributes ended with [TokenType.SLASH_GT]
    */
   final Token closingTag;
 
   /**
-   * The ending [TokenType#GT] or [TokenType#SLASH_GT] token (not `null`).
+   * The ending [TokenType.GT] or [TokenType.SLASH_GT] token (not `null`).
    */
   final Token nodeEnd;
 
@@ -1887,25 +1892,25 @@
   /**
    * Construct a new instance representing an XML or HTML element
    *
-   * @param nodeStart the starting [TokenType#LT] token (not `null`)
-   * @param tag the [TokenType#TAG] token after the starting '&lt;' (not `null`).
+   * @param nodeStart the starting [TokenType.LT] token (not `null`)
+   * @param tag the [TokenType.TAG] token after the starting '&lt;' (not `null`).
    * @param attributes the attributes associated with this element or [NO_ATTRIBUTES] (not
    *          `null`, contains no `null`s)
-   * @param attributeEnd The [TokenType#GT] or [TokenType#SLASH_GT] token after the
+   * @param attributeEnd The [TokenType.GT] or [TokenType.SLASH_GT] token after the
    *          attributes (not `null`). The token may be the same token as [nodeEnd] if
    *          there are no child [tagNodes].
    * @param tagNodes child tag nodes of the receiver or [NO_TAG_NODES] (not `null`,
    *          contains no `null`s)
    * @param contentEnd the token (not `null`) after the content, which may be
-   *          * (1) [TokenType#LT_SLASH] for nodes with open and close tags, or
-   *          * (2) the [TokenType#LT] nodeStart of the next sibling node if this node is
-   *          self closing or the attributeEnd is [TokenType#SLASH_GT], or
-   *          * (3) [TokenType#EOF] if the node does not have a closing tag and is the last
-   *          node in the stream [TokenType#LT_SLASH] token after the content, or `null`
-   *          if there is no content and the attributes ended with [TokenType#SLASH_GT].
-   * @param closingTag the closing [TokenType#TAG] after the child elements or `null` if
-   *          there is no content and the attributes ended with [TokenType#SLASH_GT]
-   * @param nodeEnd the ending [TokenType#GT] or [TokenType#SLASH_GT] token (not
+   *          * (1) [TokenType.LT_SLASH] for nodes with open and close tags, or
+   *          * (2) the [TokenType.LT] nodeStart of the next sibling node if this node is
+   *          self closing or the attributeEnd is [TokenType.SLASH_GT], or
+   *          * (3) [TokenType.EOF] if the node does not have a closing tag and is the last
+   *          node in the stream [TokenType.LT_SLASH] token after the content, or `null`
+   *          if there is no content and the attributes ended with [TokenType.SLASH_GT].
+   * @param closingTag the closing [TokenType.TAG] after the child elements or `null` if
+   *          there is no content and the attributes ended with [TokenType.SLASH_GT]
+   * @param nodeEnd the ending [TokenType.GT] or [TokenType.SLASH_GT] token (not
    *          `null`)
    */
   XmlTagNode(this.nodeStart, this._tag, List<XmlAttributeNode> attributes, this.attributeEnd, List<XmlTagNode> tagNodes, this.contentEnd, this.closingTag, this.nodeEnd) {
@@ -1942,7 +1947,7 @@
   /**
    * Find the attribute with the given name (see [getAttribute] and answer the lexeme
    * for the attribute's value token without the leading and trailing quotes (see
-   * [XmlAttributeNode#getText]).
+   * [XmlAttributeNode.getText]).
    *
    * @param name the attribute name
    * @return the attribute text or `null` if no matching attribute is found
@@ -2021,7 +2026,7 @@
   List<XmlTagNode> get tagNodes => _tagNodes;
 
   /**
-   * Answer the [TokenType#TAG] token after the starting '&lt;'.
+   * Answer the [TokenType.TAG] token after the starting '&lt;'.
    *
    * @return the token (not `null`)
    */
diff --git a/pkg/analyzer/lib/src/generated/instrumentation.dart b/pkg/analyzer/lib/src/generated/instrumentation.dart
index c21a997..918c0ff 100644
--- a/pkg/analyzer/lib/src/generated/instrumentation.dart
+++ b/pkg/analyzer/lib/src/generated/instrumentation.dart
@@ -31,9 +31,9 @@
  * // save the file
  * instrumentation.metric("chars", fileLength).log();
  * </pre>
- * The `Instrumentation.builder` method creates a new [InstrumentationBuilder
- ] and records the time at which it was created. The
- * [InstrumentationBuilder#metric] appends the information specified by the
+ * The `Instrumentation.builder` method creates a new [InstrumentationBuilder]
+ * and records the time at which it was created. The
+ * [InstrumentationBuilder.metric] appends the information specified by the
  * arguments and records the time at which the method is called so that the time to complete the
  * save operation can be calculated. The `log` method tells the builder that all of the data
  * has been collected and that the resulting information should be logged.
@@ -155,8 +155,8 @@
   /**
    * Answer the [InstrumentationLevel] of this `InstrumentationBuilder`.
    *
-   * @return one of [InstrumentationLevel#EVERYTHING], [InstrumentationLevel#METRICS],
-   *         [InstrumentationLevel#OFF]
+   * @return one of [InstrumentationLevel.EVERYTHING], [InstrumentationLevel.METRICS],
+   *         [InstrumentationLevel.OFF]
    */
   InstrumentationLevel get instrumentationLevel;
 
diff --git a/pkg/analyzer/lib/src/generated/java_core.dart b/pkg/analyzer/lib/src/generated/java_core.dart
index a816069..9c86f23 100644
--- a/pkg/analyzer/lib/src/generated/java_core.dart
+++ b/pkg/analyzer/lib/src/generated/java_core.dart
@@ -154,12 +154,12 @@
       markFound = false;
       // %d
       if (c == 0x64) {
-        sb.writeCharCode(args[argIndex++]);
+        sb.write(args[argIndex++]);
         continue;
       }
       // %s
       if (c == 0x73) {
-        sb.writeCharCode(args[argIndex++]);
+        sb.write(args[argIndex++]);
         continue;
       }
       // unknown
@@ -420,11 +420,14 @@
  *     format('{0} are you {1}ing?', ['How', 'do']) = 'How are you doing?'
  *     format('{0} are you {1}ing?', ['What', 'read']) = 'What are you reading?'
  */
-String formatList(String pattern, List args) {
+String formatList(String pattern, List<Object> arguments) {
+  if (arguments == null || arguments.isEmpty) {
+    return pattern;
+  }
   return pattern.replaceAllMapped(new RegExp(r'\{(\d+)\}'), (match) {
     String indexStr = match.group(1);
     int index = int.parse(indexStr);
-    var arg = args[index];
+    Object arg = arguments[index];
     return arg != null ? arg.toString() : null;
   });
 }
diff --git a/pkg/analyzer/lib/src/generated/parser.dart b/pkg/analyzer/lib/src/generated/parser.dart
index 0e7d123..7f95463 100644
--- a/pkg/analyzer/lib/src/generated/parser.dart
+++ b/pkg/analyzer/lib/src/generated/parser.dart
@@ -1776,7 +1776,7 @@
           bool blankArgument = argument is SimpleIdentifier && (argument as SimpleIdentifier).name.isEmpty;
           if (!generatedError && !(argument is NamedExpression && !blankArgument)) {
             // Report the error, once, but allow the arguments to be in any order in the AST.
-            _reportErrorForCurrentToken(ParserErrorCode.POSITIONAL_AFTER_NAMED_ARGUMENT, []);
+            _reportErrorForCurrentToken(ParserErrorCode.POSITIONAL_AFTER_NAMED_ARGUMENT);
             generatedError = true;
           }
         } else if (argument is NamedExpression) {
@@ -1890,7 +1890,7 @@
             //
             // We appear to have a variable declaration with a type of "void".
             //
-            _reportErrorForNode(ParserErrorCode.VOID_VARIABLE, returnType, []);
+            _reportErrorForNode(ParserErrorCode.VOID_VARIABLE, returnType);
             return _parseInitializedIdentifierList(commentAndMetadata, modifiers.staticKeyword, _validateModifiersForField(modifiers), returnType);
           }
         }
@@ -1901,7 +1901,7 @@
           _validateModifiersForOperator(modifiers);
           return _parseOperator(commentAndMetadata, modifiers.externalKeyword, returnType);
         }
-        _reportErrorForToken(ParserErrorCode.EXPECTED_EXECUTABLE, _currentToken, []);
+        _reportErrorForToken(ParserErrorCode.EXPECTED_EXECUTABLE, _currentToken);
         return null;
       }
     } else if (_matchesKeyword(Keyword.GET) && _tokenMatchesIdentifier(_peek())) {
@@ -1932,12 +1932,12 @@
         //
         // We appear to have found an incomplete field declaration.
         //
-        _reportErrorForCurrentToken(ParserErrorCode.MISSING_IDENTIFIER, []);
+        _reportErrorForCurrentToken(ParserErrorCode.MISSING_IDENTIFIER);
         List<VariableDeclaration> variables = new List<VariableDeclaration>();
         variables.add(new VariableDeclaration(null, null, _createSyntheticIdentifier(), null, null));
         return new FieldDeclaration(commentAndMetadata.comment, commentAndMetadata.metadata, null, new VariableDeclarationList(null, null, keyword, null, variables), _expectSemicolon());
       }
-      _reportErrorForToken(ParserErrorCode.EXPECTED_CLASS_MEMBER, _currentToken, []);
+      _reportErrorForToken(ParserErrorCode.EXPECTED_CLASS_MEMBER, _currentToken);
       if (commentAndMetadata.comment != null || !commentAndMetadata.metadata.isEmpty) {
         //
         // We appear to have found an incomplete declaration at the end of the class. At this point
@@ -1960,7 +1960,7 @@
       return _parseMethodDeclarationAfterParameters(commentAndMetadata, modifiers.externalKeyword, modifiers.staticKeyword, null, methodName, parameters);
     } else if (_peek().matchesAny([TokenType.EQ, TokenType.COMMA, TokenType.SEMICOLON])) {
       if (modifiers.constKeyword == null && modifiers.finalKeyword == null && modifiers.varKeyword == null) {
-        _reportErrorForCurrentToken(ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE, []);
+        _reportErrorForCurrentToken(ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE);
       }
       return _parseInitializedIdentifierList(commentAndMetadata, modifiers.staticKeyword, _validateModifiersForField(modifiers), null);
     }
@@ -1995,7 +1995,7 @@
       // At this point it consists of a type name, so we'll treat it as a field declaration
       // with a missing field name and semicolon.
       //
-      _reportErrorForToken(ParserErrorCode.EXPECTED_CLASS_MEMBER, _currentToken, []);
+      _reportErrorForToken(ParserErrorCode.EXPECTED_CLASS_MEMBER, _currentToken);
       try {
         _lockErrorListener();
         return _parseInitializedIdentifierList(commentAndMetadata, modifiers.staticKeyword, _validateModifiersForField(modifiers), type);
@@ -2006,7 +2006,7 @@
       SimpleIdentifier methodName = parseSimpleIdentifier();
       FormalParameterList parameters = parseFormalParameterList();
       if (methodName.name == className) {
-        _reportErrorForNode(ParserErrorCode.CONSTRUCTOR_WITH_RETURN_TYPE, type, []);
+        _reportErrorForNode(ParserErrorCode.CONSTRUCTOR_WITH_RETURN_TYPE, type);
         return _parseConstructor(commentAndMetadata, modifiers.externalKeyword, _validateModifiersForConstructor(modifiers), modifiers.factoryKeyword, methodName, null, null, parameters);
       }
       _validateModifiersForGetterOrSetterOrMethod(modifiers);
@@ -2016,7 +2016,7 @@
       // We have found "TypeName identifier {", and are guessing that this is a getter without the
       // keyword 'get'.
       _validateModifiersForGetterOrSetterOrMethod(modifiers);
-      _reportErrorForCurrentToken(ParserErrorCode.MISSING_GET, []);
+      _reportErrorForCurrentToken(ParserErrorCode.MISSING_GET);
       _currentToken = _injectToken(new Parser_SyntheticKeywordToken(Keyword.GET, _currentToken.offset));
       return _parseGetter(commentAndMetadata, modifiers.externalKeyword, modifiers.staticKeyword, type);
     }
@@ -2067,15 +2067,15 @@
       if ((_matchesKeyword(Keyword.IMPORT) || _matchesKeyword(Keyword.EXPORT) || _matchesKeyword(Keyword.LIBRARY) || _matchesKeyword(Keyword.PART)) && !_tokenMatches(_peek(), TokenType.PERIOD) && !_tokenMatches(_peek(), TokenType.LT) && !_tokenMatches(_peek(), TokenType.OPEN_PAREN)) {
         Directive directive = _parseDirective(commentAndMetadata);
         if (declarations.length > 0 && !directiveFoundAfterDeclaration) {
-          _reportErrorForCurrentToken(ParserErrorCode.DIRECTIVE_AFTER_DECLARATION, []);
+          _reportErrorForCurrentToken(ParserErrorCode.DIRECTIVE_AFTER_DECLARATION);
           directiveFoundAfterDeclaration = true;
         }
         if (directive is LibraryDirective) {
           if (libraryDirectiveFound) {
-            _reportErrorForCurrentToken(ParserErrorCode.MULTIPLE_LIBRARY_DIRECTIVES, []);
+            _reportErrorForCurrentToken(ParserErrorCode.MULTIPLE_LIBRARY_DIRECTIVES);
           } else {
             if (directives.length > 0) {
-              _reportErrorForToken(ParserErrorCode.LIBRARY_DIRECTIVE_NOT_FIRST, directive.libraryToken, []);
+              _reportErrorForToken(ParserErrorCode.LIBRARY_DIRECTIVE_NOT_FIRST, directive.libraryToken);
             }
             libraryDirectiveFound = true;
           }
@@ -2083,24 +2083,24 @@
           partDirectiveFound = true;
         } else if (partDirectiveFound) {
           if (directive is ExportDirective) {
-            _reportErrorForToken(ParserErrorCode.EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE, directive.keyword, []);
+            _reportErrorForToken(ParserErrorCode.EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE, directive.keyword);
           } else if (directive is ImportDirective) {
-            _reportErrorForToken(ParserErrorCode.IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE, directive.keyword, []);
+            _reportErrorForToken(ParserErrorCode.IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE, directive.keyword);
           }
         }
         if (directive is PartOfDirective) {
           if (partOfDirectiveFound) {
-            _reportErrorForCurrentToken(ParserErrorCode.MULTIPLE_PART_OF_DIRECTIVES, []);
+            _reportErrorForCurrentToken(ParserErrorCode.MULTIPLE_PART_OF_DIRECTIVES);
           } else {
             int directiveCount = directives.length;
             for (int i = 0; i < directiveCount; i++) {
-              _reportErrorForToken(ParserErrorCode.NON_PART_OF_DIRECTIVE_IN_PART, directives[i].keyword, []);
+              _reportErrorForToken(ParserErrorCode.NON_PART_OF_DIRECTIVE_IN_PART, directives[i].keyword);
             }
             partOfDirectiveFound = true;
           }
         } else {
           if (partOfDirectiveFound) {
-            _reportErrorForToken(ParserErrorCode.NON_PART_OF_DIRECTIVE_IN_PART, directive.keyword, []);
+            _reportErrorForToken(ParserErrorCode.NON_PART_OF_DIRECTIVE_IN_PART, directive.keyword);
           }
         }
         directives.add(directive);
@@ -2291,9 +2291,10 @@
       return new FormalParameterList(leftParenthesis, null, null, null, andAdvance);
     }
     //
-    // Even though it is invalid to have default parameters outside of brackets, required parameters
-    // inside of brackets, or multiple groups of default and named parameters, we allow all of these
-    // cases so that we can recover better.
+    // Even though it is invalid to have default parameters outside of brackets,
+    // required parameters inside of brackets, or multiple groups of default and
+    // named parameters, we allow all of these cases so that we can recover
+    // better.
     //
     List<FormalParameter> parameters = new List<FormalParameter>();
     List<FormalParameter> normalParameters = new List<FormalParameter>();
@@ -2319,7 +2320,7 @@
         if (_getEndToken(leftParenthesis) != null) {
           _reportErrorForCurrentToken(ParserErrorCode.EXPECTED_TOKEN, [TokenType.COMMA.lexeme]);
         } else {
-          _reportErrorForToken(ParserErrorCode.MISSING_CLOSING_PARENTHESIS, _currentToken.previous, []);
+          _reportErrorForToken(ParserErrorCode.MISSING_CLOSING_PARENTHESIS, _currentToken.previous);
           break;
         }
       }
@@ -2330,11 +2331,11 @@
       if (_matches(TokenType.OPEN_SQUARE_BRACKET)) {
         wasOptionalParameter = true;
         if (leftSquareBracket != null && !reportedMuliplePositionalGroups) {
-          _reportErrorForCurrentToken(ParserErrorCode.MULTIPLE_POSITIONAL_PARAMETER_GROUPS, []);
+          _reportErrorForCurrentToken(ParserErrorCode.MULTIPLE_POSITIONAL_PARAMETER_GROUPS);
           reportedMuliplePositionalGroups = true;
         }
         if (leftCurlyBracket != null && !reportedMixedGroups) {
-          _reportErrorForCurrentToken(ParserErrorCode.MIXED_PARAMETER_GROUPS, []);
+          _reportErrorForCurrentToken(ParserErrorCode.MIXED_PARAMETER_GROUPS);
           reportedMixedGroups = true;
         }
         leftSquareBracket = andAdvance;
@@ -2343,11 +2344,11 @@
       } else if (_matches(TokenType.OPEN_CURLY_BRACKET)) {
         wasOptionalParameter = true;
         if (leftCurlyBracket != null && !reportedMulipleNamedGroups) {
-          _reportErrorForCurrentToken(ParserErrorCode.MULTIPLE_NAMED_PARAMETER_GROUPS, []);
+          _reportErrorForCurrentToken(ParserErrorCode.MULTIPLE_NAMED_PARAMETER_GROUPS);
           reportedMulipleNamedGroups = true;
         }
         if (leftSquareBracket != null && !reportedMixedGroups) {
-          _reportErrorForCurrentToken(ParserErrorCode.MIXED_PARAMETER_GROUPS, []);
+          _reportErrorForCurrentToken(ParserErrorCode.MIXED_PARAMETER_GROUPS);
           reportedMixedGroups = true;
         }
         leftCurlyBracket = andAdvance;
@@ -2361,7 +2362,7 @@
       parameters.add(parameter);
       currentParameters.add(parameter);
       if (kind == ParameterKind.REQUIRED && wasOptionalParameter) {
-        _reportErrorForNode(ParserErrorCode.NORMAL_BEFORE_OPTIONAL_PARAMETERS, parameter, []);
+        _reportErrorForNode(ParserErrorCode.NORMAL_BEFORE_OPTIONAL_PARAMETERS, parameter);
       }
       //
       // Handle the end of parameter groups.
@@ -2527,7 +2528,8 @@
   }
 
   /**
-   * Parse a normal formal parameter.
+   * Parse a normal formal parameter and return the normal formal parameter that
+   * was parsed.
    *
    * <pre>
    * normalFormalParameter ::=
@@ -2545,8 +2547,6 @@
    *     declaredIdentifier
    *   | metadata identifier
    * </pre>
-   *
-   * @return the normal formal parameter that was parsed
    */
   NormalFormalParameter parseNormalFormalParameter() {
     CommentAndMetadata commentAndMetadata = _parseCommentAndMetadata();
@@ -2562,7 +2562,7 @@
       FormalParameterList parameters = parseFormalParameterList();
       if (thisKeyword == null) {
         if (holder.keyword != null) {
-          _reportErrorForToken(ParserErrorCode.FUNCTION_TYPED_PARAMETER_VAR, holder.keyword, []);
+          _reportErrorForToken(ParserErrorCode.FUNCTION_TYPED_PARAMETER_VAR, holder.keyword);
         }
         return new FunctionTypedFormalParameter(commentAndMetadata.comment, commentAndMetadata.metadata, holder.type, identifier, parameters);
       } else {
@@ -2572,9 +2572,9 @@
     TypeName type = holder.type;
     if (type != null) {
       if (_tokenMatchesKeyword(type.name.beginToken, Keyword.VOID)) {
-        _reportErrorForToken(ParserErrorCode.VOID_PARAMETER, type.name.beginToken, []);
+        _reportErrorForToken(ParserErrorCode.VOID_PARAMETER, type.name.beginToken);
       } else if (holder.keyword != null && _tokenMatchesKeyword(holder.keyword, Keyword.VAR)) {
-        _reportErrorForToken(ParserErrorCode.VAR_AND_TYPE, holder.keyword, []);
+        _reportErrorForToken(ParserErrorCode.VAR_AND_TYPE, holder.keyword);
       }
     }
     if (thisKeyword != null) {
@@ -2636,7 +2636,7 @@
     if (_matchesIdentifier()) {
       return new SimpleIdentifier(andAdvance);
     }
-    _reportErrorForCurrentToken(ParserErrorCode.MISSING_IDENTIFIER, []);
+    _reportErrorForCurrentToken(ParserErrorCode.MISSING_IDENTIFIER);
     return _createSyntheticIdentifier();
   }
 
@@ -2684,7 +2684,7 @@
       }
     }
     if (strings.length < 1) {
-      _reportErrorForCurrentToken(ParserErrorCode.EXPECTED_STRING_LITERAL, []);
+      _reportErrorForCurrentToken(ParserErrorCode.EXPECTED_STRING_LITERAL);
       return _createSyntheticStringLiteral();
     } else if (strings.length == 1) {
       return strings[0];
@@ -2730,13 +2730,13 @@
   TypeName parseTypeName() {
     Identifier typeName;
     if (_matchesKeyword(Keyword.VAR)) {
-      _reportErrorForCurrentToken(ParserErrorCode.VAR_AS_TYPE_NAME, []);
+      _reportErrorForCurrentToken(ParserErrorCode.VAR_AS_TYPE_NAME);
       typeName = new SimpleIdentifier(andAdvance);
     } else if (_matchesIdentifier()) {
       typeName = parsePrefixedIdentifier();
     } else {
       typeName = _createSyntheticIdentifier();
-      _reportErrorForCurrentToken(ParserErrorCode.EXPECTED_TYPE_NAME, []);
+      _reportErrorForCurrentToken(ParserErrorCode.EXPECTED_TYPE_NAME);
     }
     TypeArgumentList typeArguments = null;
     if (_matches(TokenType.LT)) {
@@ -2991,15 +2991,14 @@
    */
   void _ensureAssignable(Expression expression) {
     if (expression != null && !expression.isAssignable) {
-      _reportErrorForCurrentToken(ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE, []);
+      _reportErrorForCurrentToken(ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE);
     }
   }
 
   /**
    * If the current token has the expected type, return it after advancing to the next token.
    * Otherwise report an error and return the current token without advancing. Note that the method
-   * [expectGt] should be used if the argument to this method would be [TokenType#GT]
-   * .
+   * [_expectGt] should be used if the argument to this method would be [TokenType.GT].
    *
    * @param type the type of token that is expected
    * @return the token that matched the given type
@@ -3019,7 +3018,7 @@
   }
 
   /**
-   * If the current token has the type [TokenType#GT], return it after advancing to the next
+   * If the current token has the type [TokenType.GT], return it after advancing to the next
    * token. Otherwise report an error and return the current token without advancing.
    *
    * @return the token that matched the given type
@@ -3400,11 +3399,8 @@
   }
 
   /**
-   * Return `true` if the given token appears to be the first token of a type name that is
-   * followed by a variable or field formal parameter.
-   *
-   * @param startToken the first token of the sequence being checked
-   * @return `true` if there is a type name and variable starting at the given token
+   * Return `true` if the [startToken] appears to be the first token of a type
+   * name that is followed by a variable or field formal parameter.
    */
   bool _isTypedIdentifier(Token startToken) {
     Token token = _skipReturnType(startToken);
@@ -3412,7 +3408,17 @@
       return false;
     } else if (_tokenMatchesIdentifier(token)) {
       return true;
-    } else if (_tokenMatchesKeyword(token, Keyword.THIS) && _tokenMatches(token.next, TokenType.PERIOD) && _tokenMatchesIdentifier(token.next.next)) {
+    } else if (_tokenMatchesKeyword(token, Keyword.THIS)
+        && _tokenMatches(token.next, TokenType.PERIOD)
+        && _tokenMatchesIdentifier(token.next.next)) {
+      return true;
+    } else if (_tokenMatchesKeyword(startToken, Keyword.VOID)) {
+      // The keyword 'void' isn't a valid identifier, so it should be assumed to
+      // be a type name.
+      return true;
+    } else if (startToken.next != token) {
+      // The type is more than a simple identifier, so it should be assumed to
+      // be a type name.
       return true;
     }
     return false;
@@ -3452,8 +3458,8 @@
 
   /**
    * Return `true` if the current token has the given type. Note that the method
-   * [matchesGt] should be used if the argument to this method would be
-   * [TokenType#GT].
+   * [_matchesGt] should be used if the argument to this method would be
+   * [TokenType.GT].
    *
    * @param type the type of token that can optionally appear in the current location
    * @return `true` if the current token has the given type
@@ -3461,12 +3467,12 @@
   bool _matches(TokenType type) => _currentToken.type == type;
 
   /**
-   * Return `true` if the current token has a type of [TokenType#GT]. Note that this
+   * Return `true` if the current token has a type of [TokenType.GT]. Note that this
    * method, unlike other variants, will modify the token stream if possible to match desired type.
    * In particular, if the next token is either a '>>' or '>>>', the token stream will be re-written
    * and `true` will be returned.
    *
-   * @return `true` if the current token has a type of [TokenType#GT]
+   * @return `true` if the current token has a type of [TokenType.GT]
    */
   bool _matchesGt() {
     TokenType currentType = _currentToken.type;
@@ -3532,7 +3538,7 @@
   /**
    * If the current token has the given type, then advance to the next token and return `true`
    * . Otherwise, return `false` without advancing. This method should not be invoked with an
-   * argument value of [TokenType#GT].
+   * argument value of [TokenType.GT].
    *
    * @param type the type of token that can optionally appear in the current location
    * @return `true` if the current token has the given type
@@ -3585,13 +3591,13 @@
     Token leftParen = _expect(TokenType.OPEN_PAREN);
     Expression expression = parseExpression2();
     if (expression is AssignmentExpression) {
-      _reportErrorForNode(ParserErrorCode.ASSERT_DOES_NOT_TAKE_ASSIGNMENT, expression, []);
+      _reportErrorForNode(ParserErrorCode.ASSERT_DOES_NOT_TAKE_ASSIGNMENT, expression);
     } else if (expression is CascadeExpression) {
-      _reportErrorForNode(ParserErrorCode.ASSERT_DOES_NOT_TAKE_CASCADE, expression, []);
+      _reportErrorForNode(ParserErrorCode.ASSERT_DOES_NOT_TAKE_CASCADE, expression);
     } else if (expression is ThrowExpression) {
-      _reportErrorForNode(ParserErrorCode.ASSERT_DOES_NOT_TAKE_THROW, expression, []);
+      _reportErrorForNode(ParserErrorCode.ASSERT_DOES_NOT_TAKE_THROW, expression);
     } else if (expression is RethrowExpression) {
-      _reportErrorForNode(ParserErrorCode.ASSERT_DOES_NOT_TAKE_RETHROW, expression, []);
+      _reportErrorForNode(ParserErrorCode.ASSERT_DOES_NOT_TAKE_RETHROW, expression);
     }
     Token rightParen = _expect(TokenType.CLOSE_PAREN);
     Token semicolon = _expect(TokenType.SEMICOLON);
@@ -3686,7 +3692,7 @@
     } else {
       if (!optional) {
         // Report the missing selector.
-        _reportErrorForCurrentToken(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, []);
+        _reportErrorForCurrentToken(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR);
       }
       return prefix;
     }
@@ -3775,7 +3781,7 @@
       label = parseSimpleIdentifier();
     }
     if (!_inLoop && !_inSwitch && label == null) {
-      _reportErrorForToken(ParserErrorCode.BREAK_OUTSIDE_OF_LOOP, breakKeyword, []);
+      _reportErrorForToken(ParserErrorCode.BREAK_OUTSIDE_OF_LOOP, breakKeyword);
     }
     Token semicolon = _expect(TokenType.SEMICOLON);
     return new BreakStatement(breakKeyword, label, semicolon);
@@ -3910,22 +3916,22 @@
         if (extendsClause == null) {
           extendsClause = parseExtendsClause();
           if (withClause != null) {
-            _reportErrorForToken(ParserErrorCode.WITH_BEFORE_EXTENDS, withClause.withKeyword, []);
+            _reportErrorForToken(ParserErrorCode.WITH_BEFORE_EXTENDS, withClause.withKeyword);
           } else if (implementsClause != null) {
-            _reportErrorForToken(ParserErrorCode.IMPLEMENTS_BEFORE_EXTENDS, implementsClause.keyword, []);
+            _reportErrorForToken(ParserErrorCode.IMPLEMENTS_BEFORE_EXTENDS, implementsClause.keyword);
           }
         } else {
-          _reportErrorForToken(ParserErrorCode.MULTIPLE_EXTENDS_CLAUSES, extendsClause.keyword, []);
+          _reportErrorForToken(ParserErrorCode.MULTIPLE_EXTENDS_CLAUSES, extendsClause.keyword);
           parseExtendsClause();
         }
       } else if (_matchesKeyword(Keyword.WITH)) {
         if (withClause == null) {
           withClause = parseWithClause();
           if (implementsClause != null) {
-            _reportErrorForToken(ParserErrorCode.IMPLEMENTS_BEFORE_WITH, implementsClause.keyword, []);
+            _reportErrorForToken(ParserErrorCode.IMPLEMENTS_BEFORE_WITH, implementsClause.keyword);
           }
         } else {
-          _reportErrorForToken(ParserErrorCode.MULTIPLE_WITH_CLAUSES, withClause.withKeyword, []);
+          _reportErrorForToken(ParserErrorCode.MULTIPLE_WITH_CLAUSES, withClause.withKeyword);
           parseWithClause();
           // TODO(brianwilkerson) Should we merge the list of applied mixins into a single list?
         }
@@ -3933,7 +3939,7 @@
         if (implementsClause == null) {
           implementsClause = parseImplementsClause();
         } else {
-          _reportErrorForToken(ParserErrorCode.MULTIPLE_IMPLEMENTS_CLAUSES, implementsClause.keyword, []);
+          _reportErrorForToken(ParserErrorCode.MULTIPLE_IMPLEMENTS_CLAUSES, implementsClause.keyword);
           parseImplementsClause();
           // TODO(brianwilkerson) Should we merge the list of implemented classes into a single list?
         }
@@ -3942,7 +3948,7 @@
       }
     }
     if (withClause != null && extendsClause == null) {
-      _reportErrorForToken(ParserErrorCode.WITH_WITHOUT_EXTENDS, withClause.withKeyword, []);
+      _reportErrorForToken(ParserErrorCode.WITH_WITHOUT_EXTENDS, withClause.withKeyword);
     }
     //
     // Look for and skip over the extra-lingual 'native' specification.
@@ -3964,7 +3970,7 @@
     } else {
       leftBracket = _createSyntheticToken(TokenType.OPEN_CURLY_BRACKET);
       rightBracket = _createSyntheticToken(TokenType.CLOSE_CURLY_BRACKET);
-      _reportErrorForCurrentToken(ParserErrorCode.MISSING_CLASS_BODY, []);
+      _reportErrorForCurrentToken(ParserErrorCode.MISSING_CLASS_BODY);
     }
     ClassDeclaration classDeclaration = new ClassDeclaration(commentAndMetadata.comment, commentAndMetadata.metadata, abstractKeyword, keyword, name, typeParameters, extendsClause, withClause, implementsClause, leftBracket, members, rightBracket);
     classDeclaration.nativeClause = nativeClause;
@@ -4268,7 +4274,7 @@
         _validateModifiersForTopLevelFunction(modifiers);
         return _parseFunctionDeclaration(commentAndMetadata, modifiers.externalKeyword, returnType);
       } else if (_matchesKeyword(Keyword.OPERATOR) && _isOperator(_peek())) {
-        _reportErrorForToken(ParserErrorCode.TOP_LEVEL_OPERATOR, _currentToken, []);
+        _reportErrorForToken(ParserErrorCode.TOP_LEVEL_OPERATOR, _currentToken);
         return _convertToFunctionDeclaration(_parseOperator(commentAndMetadata, modifiers.externalKeyword, returnType));
       } else if (_matchesIdentifier() && _peek().matchesAny([
           TokenType.OPEN_PAREN,
@@ -4285,18 +4291,18 @@
             //
             // We appear to have a variable declaration with a type of "void".
             //
-            _reportErrorForNode(ParserErrorCode.VOID_VARIABLE, returnType, []);
+            _reportErrorForNode(ParserErrorCode.VOID_VARIABLE, returnType);
             return new TopLevelVariableDeclaration(commentAndMetadata.comment, commentAndMetadata.metadata, _parseVariableDeclarationListAfterType(null, _validateModifiersForTopLevelVariable(modifiers), null), _expect(TokenType.SEMICOLON));
           }
         }
-        _reportErrorForToken(ParserErrorCode.EXPECTED_EXECUTABLE, _currentToken, []);
+        _reportErrorForToken(ParserErrorCode.EXPECTED_EXECUTABLE, _currentToken);
         return null;
       }
     } else if ((_matchesKeyword(Keyword.GET) || _matchesKeyword(Keyword.SET)) && _tokenMatchesIdentifier(_peek())) {
       _validateModifiersForTopLevelFunction(modifiers);
       return _parseFunctionDeclaration(commentAndMetadata, modifiers.externalKeyword, null);
     } else if (_matchesKeyword(Keyword.OPERATOR) && _isOperator(_peek())) {
-      _reportErrorForToken(ParserErrorCode.TOP_LEVEL_OPERATOR, _currentToken, []);
+      _reportErrorForToken(ParserErrorCode.TOP_LEVEL_OPERATOR, _currentToken);
       return _convertToFunctionDeclaration(_parseOperator(commentAndMetadata, modifiers.externalKeyword, null));
     } else if (!_matchesIdentifier()) {
       Token keyword = modifiers.varKeyword;
@@ -4310,19 +4316,19 @@
         //
         // We appear to have found an incomplete top-level variable declaration.
         //
-        _reportErrorForCurrentToken(ParserErrorCode.MISSING_IDENTIFIER, []);
+        _reportErrorForCurrentToken(ParserErrorCode.MISSING_IDENTIFIER);
         List<VariableDeclaration> variables = new List<VariableDeclaration>();
         variables.add(new VariableDeclaration(null, null, _createSyntheticIdentifier(), null, null));
         return new TopLevelVariableDeclaration(commentAndMetadata.comment, commentAndMetadata.metadata, new VariableDeclarationList(null, null, keyword, null, variables), _expectSemicolon());
       }
-      _reportErrorForToken(ParserErrorCode.EXPECTED_EXECUTABLE, _currentToken, []);
+      _reportErrorForToken(ParserErrorCode.EXPECTED_EXECUTABLE, _currentToken);
       return null;
     } else if (_tokenMatches(_peek(), TokenType.OPEN_PAREN)) {
       _validateModifiersForTopLevelFunction(modifiers);
       return _parseFunctionDeclaration(commentAndMetadata, modifiers.externalKeyword, null);
     } else if (_peek().matchesAny([TokenType.EQ, TokenType.COMMA, TokenType.SEMICOLON])) {
       if (modifiers.constKeyword == null && modifiers.finalKeyword == null && modifiers.varKeyword == null) {
-        _reportErrorForCurrentToken(ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE, []);
+        _reportErrorForCurrentToken(ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE);
       }
       return new TopLevelVariableDeclaration(commentAndMetadata.comment, commentAndMetadata.metadata, _parseVariableDeclarationListAfterType(null, _validateModifiersForTopLevelVariable(modifiers), null), _expect(TokenType.SEMICOLON));
     }
@@ -4331,13 +4337,13 @@
       _validateModifiersForTopLevelFunction(modifiers);
       return _parseFunctionDeclaration(commentAndMetadata, modifiers.externalKeyword, returnType);
     } else if (_matchesKeyword(Keyword.OPERATOR) && _isOperator(_peek())) {
-      _reportErrorForToken(ParserErrorCode.TOP_LEVEL_OPERATOR, _currentToken, []);
+      _reportErrorForToken(ParserErrorCode.TOP_LEVEL_OPERATOR, _currentToken);
       return _convertToFunctionDeclaration(_parseOperator(commentAndMetadata, modifiers.externalKeyword, returnType));
     } else if (_matches(TokenType.AT)) {
       return new TopLevelVariableDeclaration(commentAndMetadata.comment, commentAndMetadata.metadata, _parseVariableDeclarationListAfterType(null, _validateModifiersForTopLevelVariable(modifiers), returnType), _expect(TokenType.SEMICOLON));
     } else if (!_matchesIdentifier()) {
       // TODO(brianwilkerson) Generalize this error. We could also be parsing a top-level variable at this point.
-      _reportErrorForToken(ParserErrorCode.EXPECTED_EXECUTABLE, _currentToken, []);
+      _reportErrorForToken(ParserErrorCode.EXPECTED_EXECUTABLE, _currentToken);
       Token semicolon;
       if (_matches(TokenType.SEMICOLON)) {
         semicolon = andAdvance;
@@ -4402,10 +4408,16 @@
           }
         } else if (_matchesKeyword(Keyword.SUPER)) {
           initializers.add(_parseSuperConstructorInvocation());
+        } else if (_matches(TokenType.OPEN_CURLY_BRACKET)
+            || _matches(TokenType.FUNCTION)) {
+          _reportErrorForCurrentToken(ParserErrorCode.MISSING_INITIALIZER);
         } else {
           initializers.add(_parseConstructorFieldInitializer());
         }
       } while (_optional(TokenType.COMMA));
+      if (factoryKeyword != null) {
+        _reportErrorForToken(ParserErrorCode.FACTORY_WITH_INITIALIZERS, factoryKeyword);
+      }
     }
     ConstructorName redirectedConstructor = null;
     FunctionBody body;
@@ -4414,21 +4426,21 @@
       redirectedConstructor = parseConstructorName();
       body = new EmptyFunctionBody(_expect(TokenType.SEMICOLON));
       if (factoryKeyword == null) {
-        _reportErrorForNode(ParserErrorCode.REDIRECTION_IN_NON_FACTORY_CONSTRUCTOR, redirectedConstructor, []);
+        _reportErrorForNode(ParserErrorCode.REDIRECTION_IN_NON_FACTORY_CONSTRUCTOR, redirectedConstructor);
       }
     } else {
       body = _parseFunctionBody(true, ParserErrorCode.MISSING_FUNCTION_BODY, false);
       if (constKeyword != null && factoryKeyword != null && externalKeyword == null) {
-        _reportErrorForToken(ParserErrorCode.CONST_FACTORY, factoryKeyword, []);
+        _reportErrorForToken(ParserErrorCode.CONST_FACTORY, factoryKeyword);
       } else if (body is EmptyFunctionBody) {
         if (factoryKeyword != null && externalKeyword == null) {
-          _reportErrorForToken(ParserErrorCode.FACTORY_WITHOUT_BODY, factoryKeyword, []);
+          _reportErrorForToken(ParserErrorCode.FACTORY_WITHOUT_BODY, factoryKeyword);
         }
       } else {
         if (constKeyword != null) {
-          _reportErrorForNode(ParserErrorCode.CONST_CONSTRUCTOR_WITH_BODY, body, []);
+          _reportErrorForNode(ParserErrorCode.CONST_CONSTRUCTOR_WITH_BODY, body);
         } else if (!bodyAllowed) {
-          _reportErrorForNode(ParserErrorCode.EXTERNAL_CONSTRUCTOR_WITH_BODY, body, []);
+          _reportErrorForNode(ParserErrorCode.EXTERNAL_CONSTRUCTOR_WITH_BODY, body);
         }
       }
     }
@@ -4453,7 +4465,24 @@
       period = _expect(TokenType.PERIOD);
     }
     SimpleIdentifier fieldName = parseSimpleIdentifier();
-    Token equals = _expect(TokenType.EQ);
+    Token equals = null;
+    if (_matches(TokenType.EQ)) {
+      equals = andAdvance;
+    } else if (!_matchesKeyword(Keyword.THIS)
+        && !_matchesKeyword(Keyword.SUPER)
+        && !_matches(TokenType.OPEN_CURLY_BRACKET)
+        && !_matches(TokenType.FUNCTION)) {
+      _reportErrorForCurrentToken(ParserErrorCode.MISSING_ASSIGNMENT_IN_INITIALIZER);
+      equals = _createSyntheticToken(TokenType.EQ);
+    } else {
+      _reportErrorForCurrentToken(ParserErrorCode.MISSING_ASSIGNMENT_IN_INITIALIZER);
+      return new ConstructorFieldInitializer(
+          keyword,
+          period,
+          fieldName,
+          _createSyntheticToken(TokenType.EQ),
+          _createSyntheticIdentifier());
+    }
     bool wasInInitializer = _inInitializer;
     _inInitializer = true;
     try {
@@ -4489,14 +4518,14 @@
   Statement _parseContinueStatement() {
     Token continueKeyword = _expectKeyword(Keyword.CONTINUE);
     if (!_inLoop && !_inSwitch) {
-      _reportErrorForToken(ParserErrorCode.CONTINUE_OUTSIDE_OF_LOOP, continueKeyword, []);
+      _reportErrorForToken(ParserErrorCode.CONTINUE_OUTSIDE_OF_LOOP, continueKeyword);
     }
     SimpleIdentifier label = null;
     if (_matchesIdentifier()) {
       label = parseSimpleIdentifier();
     }
     if (_inSwitch && !_inLoop && label == null) {
-      _reportErrorForToken(ParserErrorCode.CONTINUE_WITHOUT_LABEL_IN_CASE, continueKeyword, []);
+      _reportErrorForToken(ParserErrorCode.CONTINUE_WITHOUT_LABEL_IN_CASE, continueKeyword);
     }
     Token semicolon = _expect(TokenType.SEMICOLON);
     return new ContinueStatement(continueKeyword, label, semicolon);
@@ -4677,10 +4706,10 @@
         constants.add(_parseEnumConstantDeclaration());
       } else if (_matches(TokenType.COMMA) && _tokenMatchesIdentifier(_peek())) {
         constants.add(_parseEnumConstantDeclaration());
-        _reportErrorForCurrentToken(ParserErrorCode.MISSING_IDENTIFIER, []);
+        _reportErrorForCurrentToken(ParserErrorCode.MISSING_IDENTIFIER);
       } else {
         constants.add(_parseEnumConstantDeclaration());
-        _reportErrorForCurrentToken(ParserErrorCode.EMPTY_ENUM_BODY, []);
+        _reportErrorForCurrentToken(ParserErrorCode.EMPTY_ENUM_BODY);
       }
       while (_optional(TokenType.COMMA)) {
         if (_matches(TokenType.CLOSE_CURLY_BRACKET)) {
@@ -4692,7 +4721,7 @@
     } else {
       leftBracket = _createSyntheticToken(TokenType.OPEN_CURLY_BRACKET);
       rightBracket = _createSyntheticToken(TokenType.CLOSE_CURLY_BRACKET);
-      _reportErrorForCurrentToken(ParserErrorCode.MISSING_ENUM_BODY, []);
+      _reportErrorForCurrentToken(ParserErrorCode.MISSING_ENUM_BODY);
     }
     return new EnumDeclaration(commentAndMetadata.comment, commentAndMetadata.metadata, keyword, name, leftBracket, constants, rightBracket);
   }
@@ -4719,7 +4748,7 @@
     while (_currentToken.type.isEqualityOperator) {
       Token operator = andAdvance;
       if (leftEqualityExpression) {
-        _reportErrorForNode(ParserErrorCode.EQUALITY_CANNOT_BE_EQUALITY_OPERAND, expression, []);
+        _reportErrorForNode(ParserErrorCode.EQUALITY_CANNOT_BE_EQUALITY_OPERAND, expression);
       }
       expression = new BinaryExpression(expression, operator, _parseRelationalExpression());
       leftEqualityExpression = true;
@@ -4793,7 +4822,7 @@
       if (_isTypedIdentifier(_currentToken)) {
         type = parseReturnType();
       } else if (!optional) {
-        _reportErrorForCurrentToken(ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE, []);
+        _reportErrorForCurrentToken(ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE);
       }
     }
     return new FinalConstVarOrType(keyword, type);
@@ -4821,18 +4850,18 @@
       Token seperator = andAdvance;
       Expression defaultValue = parseExpression2();
       if (kind == ParameterKind.NAMED) {
-        _reportErrorForToken(ParserErrorCode.WRONG_SEPARATOR_FOR_NAMED_PARAMETER, seperator, []);
+        _reportErrorForToken(ParserErrorCode.WRONG_SEPARATOR_FOR_NAMED_PARAMETER, seperator);
       } else if (kind == ParameterKind.REQUIRED) {
-        _reportErrorForNode(ParserErrorCode.POSITIONAL_PARAMETER_OUTSIDE_GROUP, parameter, []);
+        _reportErrorForNode(ParserErrorCode.POSITIONAL_PARAMETER_OUTSIDE_GROUP, parameter);
       }
       return new DefaultFormalParameter(parameter, kind, seperator, defaultValue);
     } else if (_matches(TokenType.COLON)) {
       Token seperator = andAdvance;
       Expression defaultValue = parseExpression2();
       if (kind == ParameterKind.POSITIONAL) {
-        _reportErrorForToken(ParserErrorCode.WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER, seperator, []);
+        _reportErrorForToken(ParserErrorCode.WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER, seperator);
       } else if (kind == ParameterKind.REQUIRED) {
-        _reportErrorForNode(ParserErrorCode.NAMED_PARAMETER_OUTSIDE_GROUP, parameter, []);
+        _reportErrorForNode(ParserErrorCode.NAMED_PARAMETER_OUTSIDE_GROUP, parameter);
       }
       return new DefaultFormalParameter(parameter, kind, seperator, defaultValue);
     } else if (kind != ParameterKind.REQUIRED) {
@@ -4889,7 +4918,7 @@
           SimpleIdentifier identifier = null;
           if (variableList == null) {
             // We found: <expression> 'in'
-            _reportErrorForCurrentToken(ParserErrorCode.MISSING_VARIABLE_IN_FOR_EACH, []);
+            _reportErrorForCurrentToken(ParserErrorCode.MISSING_VARIABLE_IN_FOR_EACH);
           } else {
             NodeList<VariableDeclaration> variables = variableList.variables;
             if (variables.length > 1) {
@@ -4897,7 +4926,7 @@
             }
             VariableDeclaration variable = variables[0];
             if (variable.initializer != null) {
-              _reportErrorForCurrentToken(ParserErrorCode.INITIALIZED_VARIABLE_IN_FOR_EACH, []);
+              _reportErrorForCurrentToken(ParserErrorCode.INITIALIZED_VARIABLE_IN_FOR_EACH);
             }
             Token keyword = variableList.keyword;
             TypeName type = variableList.type;
@@ -4922,7 +4951,7 @@
         }
       }
       if (awaitKeyword != null) {
-        _reportErrorForToken(ParserErrorCode.INVALID_AWAIT_IN_FOR, awaitKeyword, []);
+        _reportErrorForToken(ParserErrorCode.INVALID_AWAIT_IN_FOR, awaitKeyword);
       }
       Token leftSeparator = _expect(TokenType.SEMICOLON);
       Expression condition = null;
@@ -4973,7 +5002,7 @@
     try {
       if (_matches(TokenType.SEMICOLON)) {
         if (!mayBeEmpty) {
-          _reportErrorForCurrentToken(emptyErrorCode, []);
+          _reportErrorForCurrentToken(emptyErrorCode);
         }
         return new EmptyFunctionBody(andAdvance);
       } else if (_matchesString(_NATIVE)) {
@@ -5005,10 +5034,10 @@
       if (_matches(TokenType.FUNCTION)) {
         if (keyword != null) {
           if (!_tokenMatchesString(keyword, ASYNC)) {
-            _reportErrorForToken(ParserErrorCode.INVALID_SYNC, keyword, []);
+            _reportErrorForToken(ParserErrorCode.INVALID_SYNC, keyword);
             keyword = null;
           } else if (star != null) {
-            _reportErrorForToken(ParserErrorCode.INVALID_STAR_AFTER_ASYNC, star, []);
+            _reportErrorForToken(ParserErrorCode.INVALID_STAR_AFTER_ASYNC, star);
           }
         }
         Token functionDefinition = andAdvance;
@@ -5024,7 +5053,7 @@
       } else if (_matches(TokenType.OPEN_CURLY_BRACKET)) {
         if (keyword != null) {
           if (_tokenMatchesString(keyword, SYNC) && star == null) {
-            _reportErrorForToken(ParserErrorCode.MISSING_STAR_AFTER_SYNC, keyword, []);
+            _reportErrorForToken(ParserErrorCode.MISSING_STAR_AFTER_SYNC, keyword);
           }
         }
         if (!_parseFunctionBodies) {
@@ -5034,7 +5063,7 @@
         return new BlockFunctionBody(keyword, star, parseBlock());
       } else {
         // Invalid function body
-        _reportErrorForCurrentToken(emptyErrorCode, []);
+        _reportErrorForCurrentToken(emptyErrorCode);
         return new EmptyFunctionBody(_createSyntheticToken(TokenType.SEMICOLON));
       }
     } finally {
@@ -5077,10 +5106,10 @@
         parameters = parseFormalParameterList();
         _validateFormalParameterList(parameters);
       } else {
-        _reportErrorForCurrentToken(ParserErrorCode.MISSING_FUNCTION_PARAMETERS, []);
+        _reportErrorForCurrentToken(ParserErrorCode.MISSING_FUNCTION_PARAMETERS);
       }
     } else if (_matches(TokenType.OPEN_PAREN)) {
-      _reportErrorForCurrentToken(ParserErrorCode.GETTER_WITH_PARAMETERS, []);
+      _reportErrorForCurrentToken(ParserErrorCode.GETTER_WITH_PARAMETERS);
       parseFormalParameterList();
     }
     FunctionBody body;
@@ -5131,9 +5160,9 @@
     Token propertyKeyword = declaration.propertyKeyword;
     if (propertyKeyword != null) {
       if ((propertyKeyword as KeywordToken).keyword == Keyword.GET) {
-        _reportErrorForToken(ParserErrorCode.GETTER_IN_FUNCTION, propertyKeyword, []);
+        _reportErrorForToken(ParserErrorCode.GETTER_IN_FUNCTION, propertyKeyword);
       } else {
-        _reportErrorForToken(ParserErrorCode.SETTER_IN_FUNCTION, propertyKeyword, []);
+        _reportErrorForToken(ParserErrorCode.SETTER_IN_FUNCTION, propertyKeyword);
       }
     }
     return new FunctionDeclarationStatement(declaration);
@@ -5165,12 +5194,12 @@
       typeParameters = parseTypeParameterList();
     }
     if (_matches(TokenType.SEMICOLON) || _matches(TokenType.EOF)) {
-      _reportErrorForCurrentToken(ParserErrorCode.MISSING_TYPEDEF_PARAMETERS, []);
+      _reportErrorForCurrentToken(ParserErrorCode.MISSING_TYPEDEF_PARAMETERS);
       FormalParameterList parameters = new FormalParameterList(_createSyntheticToken(TokenType.OPEN_PAREN), null, null, null, _createSyntheticToken(TokenType.CLOSE_PAREN));
       Token semicolon = _expect(TokenType.SEMICOLON);
       return new FunctionTypeAlias(commentAndMetadata.comment, commentAndMetadata.metadata, keyword, returnType, name, typeParameters, parameters, semicolon);
     } else if (!_matches(TokenType.OPEN_PAREN)) {
-      _reportErrorForCurrentToken(ParserErrorCode.MISSING_TYPEDEF_PARAMETERS, []);
+      _reportErrorForCurrentToken(ParserErrorCode.MISSING_TYPEDEF_PARAMETERS);
       // TODO(brianwilkerson) Recover from this error. At the very least we should skip to the start
       // of the next valid compilation unit member, allowing for the possibility of finding the
       // typedef parameters before that point.
@@ -5205,13 +5234,13 @@
     Token propertyKeyword = _expectKeyword(Keyword.GET);
     SimpleIdentifier name = parseSimpleIdentifier();
     if (_matches(TokenType.OPEN_PAREN) && _tokenMatches(_peek(), TokenType.CLOSE_PAREN)) {
-      _reportErrorForCurrentToken(ParserErrorCode.GETTER_WITH_PARAMETERS, []);
+      _reportErrorForCurrentToken(ParserErrorCode.GETTER_WITH_PARAMETERS);
       _advance();
       _advance();
     }
     FunctionBody body = _parseFunctionBody(externalKeyword != null || staticKeyword == null, ParserErrorCode.STATIC_GETTER_WITHOUT_BODY, false);
     if (externalKeyword != null && body is! EmptyFunctionBody) {
-      _reportErrorForCurrentToken(ParserErrorCode.EXTERNAL_GETTER_WITH_BODY, []);
+      _reportErrorForCurrentToken(ParserErrorCode.EXTERNAL_GETTER_WITH_BODY);
     }
     return new MethodDeclaration(commentAndMetadata.comment, commentAndMetadata.metadata, externalKeyword, staticKeyword, returnType, propertyKeyword, null, name, null, body);
   }
@@ -5282,7 +5311,7 @@
       if (_parseDeferredLibraries) {
         deferredToken = andAdvance;
       } else {
-        _reportErrorForCurrentToken(ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED, []);
+        _reportErrorForCurrentToken(ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED);
         _advance();
       }
     }
@@ -5290,7 +5319,7 @@
       asToken = andAdvance;
       prefix = parseSimpleIdentifier();
     } else if (deferredToken != null) {
-      _reportErrorForCurrentToken(ParserErrorCode.MISSING_PREFIX_IN_DEFERRED_IMPORT, []);
+      _reportErrorForCurrentToken(ParserErrorCode.MISSING_PREFIX_IN_DEFERRED_IMPORT);
     }
     List<Combinator> combinators = _parseCombinators();
     Token semicolon = _expectSemicolon();
@@ -5380,9 +5409,9 @@
       // TODO(brianwilkerson) Recovery: This should be extended to handle arbitrary tokens until we
       // can find a token that can start a compilation unit member.
       StringLiteral string = parseStringLiteral();
-      _reportErrorForNode(ParserErrorCode.NON_IDENTIFIER_LIBRARY_NAME, string, []);
+      _reportErrorForNode(ParserErrorCode.NON_IDENTIFIER_LIBRARY_NAME, string);
     } else {
-      _reportErrorForToken(missingNameError, missingNameToken, []);
+      _reportErrorForToken(missingNameError, missingNameToken);
     }
     List<SimpleIdentifier> components = new List<SimpleIdentifier>();
     components.add(_createSyntheticIdentifier());
@@ -5461,7 +5490,7 @@
     } else if (_matches(TokenType.OPEN_SQUARE_BRACKET) || _matches(TokenType.INDEX)) {
       return _parseListLiteral(modifier, typeArguments);
     }
-    _reportErrorForCurrentToken(ParserErrorCode.EXPECTED_LIST_OR_MAP_LITERAL, []);
+    _reportErrorForCurrentToken(ParserErrorCode.EXPECTED_LIST_OR_MAP_LITERAL);
     return new ListLiteral(modifier, typeArguments, _createSyntheticToken(TokenType.OPEN_SQUARE_BRACKET), null, _createSyntheticToken(TokenType.CLOSE_SQUARE_BRACKET));
   }
 
@@ -5543,11 +5572,11 @@
     FunctionBody body = _parseFunctionBody(externalKeyword != null || staticKeyword == null, ParserErrorCode.MISSING_FUNCTION_BODY, false);
     if (externalKeyword != null) {
       if (body is! EmptyFunctionBody) {
-        _reportErrorForNode(ParserErrorCode.EXTERNAL_METHOD_WITH_BODY, body, []);
+        _reportErrorForNode(ParserErrorCode.EXTERNAL_METHOD_WITH_BODY, body);
       }
     } else if (staticKeyword != null) {
       if (body is EmptyFunctionBody) {
-        _reportErrorForNode(ParserErrorCode.ABSTRACT_STATIC_METHOD, body, []);
+        _reportErrorForNode(ParserErrorCode.ABSTRACT_STATIC_METHOD, body);
       }
     }
     return new MethodDeclaration(commentAndMetadata.comment, commentAndMetadata.metadata, externalKeyword, staticKeyword, returnType, null, null, name, parameters, body);
@@ -5784,7 +5813,7 @@
               //
               // We appear to have a variable declaration with a type of "void".
               //
-              _reportErrorForNode(ParserErrorCode.VOID_VARIABLE, returnType, []);
+              _reportErrorForNode(ParserErrorCode.VOID_VARIABLE, returnType);
               return _parseVariableDeclarationStatementAfterMetadata(commentAndMetadata);
             }
           } else if (_matches(TokenType.CLOSE_CURLY_BRACKET)) {
@@ -5794,7 +5823,7 @@
             //
             return _parseVariableDeclarationStatementAfterType(commentAndMetadata, null, returnType);
           }
-          _reportErrorForCurrentToken(ParserErrorCode.MISSING_STATEMENT, []);
+          _reportErrorForCurrentToken(ParserErrorCode.MISSING_STATEMENT);
           // TODO(brianwilkerson) Recover from this error.
           return new EmptyStatement(_createSyntheticToken(TokenType.SEMICOLON));
         }
@@ -5820,7 +5849,7 @@
         //
         // We have found an error of some kind. Try to recover.
         //
-        _reportErrorForCurrentToken(ParserErrorCode.MISSING_STATEMENT, []);
+        _reportErrorForCurrentToken(ParserErrorCode.MISSING_STATEMENT);
         return new EmptyStatement(_createSyntheticToken(TokenType.SEMICOLON));
       }
     } else if (_inGenerator && _matchesString(_YIELD)) {
@@ -5834,7 +5863,7 @@
       Token awaitToken = _currentToken;
       Statement statement = _parseForStatement();
       if (statement is! ForStatement) {
-        _reportErrorForToken(CompileTimeErrorCode.ASYNC_FOR_IN_WRONG_CONTEXT, awaitToken, []);
+        _reportErrorForToken(CompileTimeErrorCode.ASYNC_FOR_IN_WRONG_CONTEXT, awaitToken);
       }
       return statement;
     } else if (_matches(TokenType.SEMICOLON)) {
@@ -5844,7 +5873,7 @@
     } else if (_isFunctionDeclaration()) {
       return _parseFunctionDeclarationStatement();
     } else if (_matches(TokenType.CLOSE_CURLY_BRACKET)) {
-      _reportErrorForCurrentToken(ParserErrorCode.MISSING_STATEMENT, []);
+      _reportErrorForCurrentToken(ParserErrorCode.MISSING_STATEMENT);
       return new EmptyStatement(_createSyntheticToken(TokenType.SEMICOLON));
     } else {
       return new ExpressionStatement(parseExpression2(), _expect(TokenType.SEMICOLON));
@@ -5874,7 +5903,7 @@
     if (_matchesKeyword(Keyword.OPERATOR)) {
       operatorKeyword = andAdvance;
     } else {
-      _reportErrorForToken(ParserErrorCode.MISSING_KEYWORD_OPERATOR, _currentToken, []);
+      _reportErrorForToken(ParserErrorCode.MISSING_KEYWORD_OPERATOR, _currentToken);
       operatorKeyword = _createSyntheticKeyword(Keyword.OPERATOR);
     }
     if (!_currentToken.isUserDefinableOperator) {
@@ -5892,7 +5921,7 @@
     _validateFormalParameterList(parameters);
     FunctionBody body = _parseFunctionBody(true, ParserErrorCode.MISSING_FUNCTION_BODY, false);
     if (externalKeyword != null && body is! EmptyFunctionBody) {
-      _reportErrorForCurrentToken(ParserErrorCode.EXTERNAL_OPERATOR_WITH_BODY, []);
+      _reportErrorForCurrentToken(ParserErrorCode.EXTERNAL_OPERATOR_WITH_BODY);
     }
     return new MethodDeclaration(commentAndMetadata.comment, commentAndMetadata.metadata, externalKeyword, null, returnType, null, operatorKeyword, name, parameters, body);
   }
@@ -6099,7 +6128,7 @@
     } else if (_matches(TokenType.HASH)) {
       return _parseSymbolLiteral();
     } else {
-      _reportErrorForCurrentToken(ParserErrorCode.MISSING_IDENTIFIER, []);
+      _reportErrorForCurrentToken(ParserErrorCode.MISSING_IDENTIFIER);
       return _createSyntheticIdentifier();
     }
   }
@@ -6220,7 +6249,7 @@
     _validateFormalParameterList(parameters);
     FunctionBody body = _parseFunctionBody(externalKeyword != null || staticKeyword == null, ParserErrorCode.STATIC_SETTER_WITHOUT_BODY, false);
     if (externalKeyword != null && body is! EmptyFunctionBody) {
-      _reportErrorForCurrentToken(ParserErrorCode.EXTERNAL_SETTER_WITH_BODY, []);
+      _reportErrorForCurrentToken(ParserErrorCode.EXTERNAL_SETTER_WITH_BODY);
     }
     return new MethodDeclaration(commentAndMetadata.comment, commentAndMetadata.metadata, externalKeyword, staticKeyword, returnType, propertyKeyword, null, name, parameters, body);
   }
@@ -6385,11 +6414,11 @@
           Token colon = _expect(TokenType.COLON);
           members.add(new SwitchCase(labels, caseKeyword, caseExpression, colon, _parseStatementList()));
           if (defaultKeyword != null) {
-            _reportErrorForToken(ParserErrorCode.SWITCH_HAS_CASE_AFTER_DEFAULT_CASE, caseKeyword, []);
+            _reportErrorForToken(ParserErrorCode.SWITCH_HAS_CASE_AFTER_DEFAULT_CASE, caseKeyword);
           }
         } else if (_matchesKeyword(Keyword.DEFAULT)) {
           if (defaultKeyword != null) {
-            _reportErrorForToken(ParserErrorCode.SWITCH_HAS_MULTIPLE_DEFAULT_CASES, _peek(), []);
+            _reportErrorForToken(ParserErrorCode.SWITCH_HAS_MULTIPLE_DEFAULT_CASES, _peek());
           }
           defaultKeyword = andAdvance;
           Token colon = _expect(TokenType.COLON);
@@ -6397,7 +6426,7 @@
         } else {
           // We need to advance, otherwise we could end up in an infinite loop, but this could be a
           // lot smarter about recovering from the error.
-          _reportErrorForCurrentToken(ParserErrorCode.EXPECTED_CASE_OR_DEFAULT, []);
+          _reportErrorForCurrentToken(ParserErrorCode.EXPECTED_CASE_OR_DEFAULT);
           while (!_matches(TokenType.EOF) && !_matches(TokenType.CLOSE_CURLY_BRACKET) && !_matchesKeyword(Keyword.CASE) && !_matchesKeyword(Keyword.DEFAULT)) {
             _advance();
           }
@@ -6430,7 +6459,7 @@
         if (_matchesIdentifier()) {
           components.add(andAdvance);
         } else {
-          _reportErrorForCurrentToken(ParserErrorCode.MISSING_IDENTIFIER, []);
+          _reportErrorForCurrentToken(ParserErrorCode.MISSING_IDENTIFIER);
           components.add(_createSyntheticToken(TokenType.IDENTIFIER));
           break;
         }
@@ -6440,7 +6469,7 @@
     } else if (_tokenMatchesKeyword(_currentToken, Keyword.VOID)) {
       components.add(andAdvance);
     } else {
-      _reportErrorForCurrentToken(ParserErrorCode.MISSING_IDENTIFIER, []);
+      _reportErrorForCurrentToken(ParserErrorCode.MISSING_IDENTIFIER);
       components.add(_createSyntheticToken(TokenType.IDENTIFIER));
     }
     return new SymbolLiteral(poundSign, components);
@@ -6459,7 +6488,7 @@
   Expression _parseThrowExpression() {
     Token keyword = _expectKeyword(Keyword.THROW);
     if (_matches(TokenType.SEMICOLON) || _matches(TokenType.CLOSE_PAREN)) {
-      _reportErrorForToken(ParserErrorCode.MISSING_EXPRESSION_IN_THROW, _currentToken, []);
+      _reportErrorForToken(ParserErrorCode.MISSING_EXPRESSION_IN_THROW, _currentToken);
       return new ThrowExpression(keyword, _createSyntheticIdentifier());
     }
     Expression expression = parseExpression2();
@@ -6479,7 +6508,7 @@
   Expression _parseThrowExpressionWithoutCascade() {
     Token keyword = _expectKeyword(Keyword.THROW);
     if (_matches(TokenType.SEMICOLON) || _matches(TokenType.CLOSE_PAREN)) {
-      _reportErrorForToken(ParserErrorCode.MISSING_EXPRESSION_IN_THROW, _currentToken, []);
+      _reportErrorForToken(ParserErrorCode.MISSING_EXPRESSION_IN_THROW, _currentToken);
       return new ThrowExpression(keyword, _createSyntheticIdentifier());
     }
     Expression expression = parseExpressionWithoutCascade();
@@ -6543,7 +6572,7 @@
       finallyClause = parseBlock();
     } else {
       if (catchClauses.isEmpty) {
-        _reportErrorForCurrentToken(ParserErrorCode.MISSING_CATCH_OR_FINALLY, []);
+        _reportErrorForCurrentToken(ParserErrorCode.MISSING_CATCH_OR_FINALLY);
       }
     }
     return new TryStatement(tryKeyword, body, catchClauses, finallyKeyword, finallyClause);
@@ -6584,12 +6613,12 @@
         next = _skipTypeParameterList(next);
         if (next != null && _tokenMatches(next, TokenType.EQ)) {
           TypeAlias typeAlias = _parseClassTypeAlias(commentAndMetadata, null, keyword);
-          _reportErrorForToken(ParserErrorCode.DEPRECATED_CLASS_TYPE_ALIAS, keyword, []);
+          _reportErrorForToken(ParserErrorCode.DEPRECATED_CLASS_TYPE_ALIAS, keyword);
           return typeAlias;
         }
       } else if (_tokenMatches(next, TokenType.EQ)) {
         TypeAlias typeAlias = _parseClassTypeAlias(commentAndMetadata, null, keyword);
-        _reportErrorForToken(ParserErrorCode.DEPRECATED_CLASS_TYPE_ALIAS, keyword, []);
+        _reportErrorForToken(ParserErrorCode.DEPRECATED_CLASS_TYPE_ALIAS, keyword);
         return typeAlias;
       }
     }
@@ -6653,7 +6682,7 @@
       }
       return new PrefixExpression(operator, _parseAssignableExpression(false));
     } else if (_matches(TokenType.PLUS)) {
-      _reportErrorForCurrentToken(ParserErrorCode.MISSING_IDENTIFIER, []);
+      _reportErrorForCurrentToken(ParserErrorCode.MISSING_IDENTIFIER);
       return _createSyntheticIdentifier();
     } else if (_matchesString(_AWAIT)) {
       return _parseAwaitExpression();
@@ -6716,7 +6745,7 @@
    */
   VariableDeclarationList _parseVariableDeclarationListAfterType(CommentAndMetadata commentAndMetadata, Token keyword, TypeName type) {
     if (type != null && keyword != null && _tokenMatchesKeyword(keyword, Keyword.VAR)) {
-      _reportErrorForToken(ParserErrorCode.VAR_AND_TYPE, keyword, []);
+      _reportErrorForToken(ParserErrorCode.VAR_AND_TYPE, keyword);
     }
     List<VariableDeclaration> variables = new List<VariableDeclaration>();
     variables.add(_parseVariableDeclaration());
@@ -6860,7 +6889,7 @@
    * @param errorCode the error code of the error to be reported
    * @param arguments the arguments to the error, used to compose the error message
    */
-  void _reportErrorForCurrentToken(ParserErrorCode errorCode, List<Object> arguments) {
+  void _reportErrorForCurrentToken(ParserErrorCode errorCode, [List<Object> arguments]) {
     _reportErrorForToken(errorCode, _currentToken, arguments);
   }
 
@@ -6871,7 +6900,7 @@
    * @param node the node specifying the location of the error
    * @param arguments the arguments to the error, used to compose the error message
    */
-  void _reportErrorForNode(ParserErrorCode errorCode, AstNode node, List<Object> arguments) {
+  void _reportErrorForNode(ParserErrorCode errorCode, AstNode node, [List<Object> arguments]) {
     _reportError(new AnalysisError.con2(_source, node.offset, node.length, errorCode, arguments));
   }
 
@@ -6882,7 +6911,7 @@
    * @param token the token specifying the location of the error
    * @param arguments the arguments to the error, used to compose the error message
    */
-  void _reportErrorForToken(ErrorCode errorCode, Token token, List<Object> arguments) {
+  void _reportErrorForToken(ErrorCode errorCode, Token token, [List<Object> arguments]) {
     if (token.type == TokenType.EOF) {
       token = token.previous;
     }
@@ -7413,14 +7442,14 @@
     } else if (currentChar == 0x78) {
       if (currentIndex + 2 >= length) {
         // Illegal escape sequence: not enough hex digits
-        _reportErrorForCurrentToken(ParserErrorCode.INVALID_HEX_ESCAPE, []);
+        _reportErrorForCurrentToken(ParserErrorCode.INVALID_HEX_ESCAPE);
         return length;
       }
       int firstDigit = lexeme.codeUnitAt(currentIndex + 1);
       int secondDigit = lexeme.codeUnitAt(currentIndex + 2);
       if (!_isHexDigit(firstDigit) || !_isHexDigit(secondDigit)) {
         // Illegal escape sequence: invalid hex digit
-        _reportErrorForCurrentToken(ParserErrorCode.INVALID_HEX_ESCAPE, []);
+        _reportErrorForCurrentToken(ParserErrorCode.INVALID_HEX_ESCAPE);
       } else {
         int charCode = (Character.digit(firstDigit, 16) << 4)
             + Character.digit(secondDigit, 16);
@@ -7431,7 +7460,7 @@
       currentIndex++;
       if (currentIndex >= length) {
         // Illegal escape sequence: not enough hex digits
-        _reportErrorForCurrentToken(ParserErrorCode.INVALID_UNICODE_ESCAPE, []);
+        _reportErrorForCurrentToken(ParserErrorCode.INVALID_UNICODE_ESCAPE);
         return length;
       }
       currentChar = lexeme.codeUnitAt(currentIndex);
@@ -7439,9 +7468,7 @@
         currentIndex++;
         if (currentIndex >= length) {
           // Illegal escape sequence: incomplete escape
-          _reportErrorForCurrentToken(
-              ParserErrorCode.INVALID_UNICODE_ESCAPE,
-              []);
+          _reportErrorForCurrentToken(ParserErrorCode.INVALID_UNICODE_ESCAPE);
           return length;
         }
         currentChar = lexeme.codeUnitAt(currentIndex);
@@ -7450,9 +7477,7 @@
         while (currentChar != 0x7D) {
           if (!_isHexDigit(currentChar)) {
             // Illegal escape sequence: invalid hex digit
-            _reportErrorForCurrentToken(
-                ParserErrorCode.INVALID_UNICODE_ESCAPE,
-                []);
+            _reportErrorForCurrentToken(ParserErrorCode.INVALID_UNICODE_ESCAPE);
             currentIndex++;
             while (currentIndex < length
                 && lexeme.codeUnitAt(currentIndex) != 0x7D) {
@@ -7465,18 +7490,14 @@
           currentIndex++;
           if (currentIndex >= length) {
             // Illegal escape sequence: incomplete escape
-            _reportErrorForCurrentToken(
-                ParserErrorCode.INVALID_UNICODE_ESCAPE,
-                []);
+            _reportErrorForCurrentToken(ParserErrorCode.INVALID_UNICODE_ESCAPE);
             return length;
           }
           currentChar = lexeme.codeUnitAt(currentIndex);
         }
         if (digitCount < 1 || digitCount > 6) {
           // Illegal escape sequence: not enough or too many hex digits
-          _reportErrorForCurrentToken(
-              ParserErrorCode.INVALID_UNICODE_ESCAPE,
-              []);
+          _reportErrorForCurrentToken(ParserErrorCode.INVALID_UNICODE_ESCAPE);
         }
         _appendScalarValue(
             buffer,
@@ -7488,9 +7509,7 @@
       } else {
         if (currentIndex + 3 >= length) {
           // Illegal escape sequence: not enough hex digits
-          _reportErrorForCurrentToken(
-              ParserErrorCode.INVALID_UNICODE_ESCAPE,
-              []);
+          _reportErrorForCurrentToken(ParserErrorCode.INVALID_UNICODE_ESCAPE);
           return length;
         }
         int firstDigit = currentChar;
@@ -7502,7 +7521,7 @@
             || !_isHexDigit(thirdDigit)
             || !_isHexDigit(fourthDigit)) {
           // Illegal escape sequence: invalid hex digits
-          _reportErrorForCurrentToken(ParserErrorCode.INVALID_UNICODE_ESCAPE, []);
+          _reportErrorForCurrentToken(ParserErrorCode.INVALID_UNICODE_ESCAPE);
         } else {
           _appendScalarValue(
               buffer,
@@ -7541,7 +7560,7 @@
   void _validateFormalParameterList(FormalParameterList parameterList) {
     for (FormalParameter parameter in parameterList.parameters) {
       if (parameter is FieldFormalParameter) {
-        _reportErrorForNode(ParserErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR, parameter.identifier, []);
+        _reportErrorForNode(ParserErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR, parameter.identifier);
       }
     }
   }
@@ -7555,16 +7574,16 @@
   Token _validateModifiersForClass(Modifiers modifiers) {
     _validateModifiersForTopLevelDeclaration(modifiers);
     if (modifiers.constKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.CONST_CLASS, modifiers.constKeyword, []);
+      _reportErrorForToken(ParserErrorCode.CONST_CLASS, modifiers.constKeyword);
     }
     if (modifiers.externalKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.EXTERNAL_CLASS, modifiers.externalKeyword, []);
+      _reportErrorForToken(ParserErrorCode.EXTERNAL_CLASS, modifiers.externalKeyword);
     }
     if (modifiers.finalKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.FINAL_CLASS, modifiers.finalKeyword, []);
+      _reportErrorForToken(ParserErrorCode.FINAL_CLASS, modifiers.finalKeyword);
     }
     if (modifiers.varKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.VAR_CLASS, modifiers.varKeyword, []);
+      _reportErrorForToken(ParserErrorCode.VAR_CLASS, modifiers.varKeyword);
     }
     return modifiers.abstractKeyword;
   }
@@ -7578,25 +7597,25 @@
    */
   Token _validateModifiersForConstructor(Modifiers modifiers) {
     if (modifiers.abstractKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.ABSTRACT_CLASS_MEMBER, modifiers.abstractKeyword, []);
+      _reportErrorForToken(ParserErrorCode.ABSTRACT_CLASS_MEMBER, modifiers.abstractKeyword);
     }
     if (modifiers.finalKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.FINAL_CONSTRUCTOR, modifiers.finalKeyword, []);
+      _reportErrorForToken(ParserErrorCode.FINAL_CONSTRUCTOR, modifiers.finalKeyword);
     }
     if (modifiers.staticKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.STATIC_CONSTRUCTOR, modifiers.staticKeyword, []);
+      _reportErrorForToken(ParserErrorCode.STATIC_CONSTRUCTOR, modifiers.staticKeyword);
     }
     if (modifiers.varKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.CONSTRUCTOR_WITH_RETURN_TYPE, modifiers.varKeyword, []);
+      _reportErrorForToken(ParserErrorCode.CONSTRUCTOR_WITH_RETURN_TYPE, modifiers.varKeyword);
     }
     Token externalKeyword = modifiers.externalKeyword;
     Token constKeyword = modifiers.constKeyword;
     Token factoryKeyword = modifiers.factoryKeyword;
     if (externalKeyword != null && constKeyword != null && constKeyword.offset < externalKeyword.offset) {
-      _reportErrorForToken(ParserErrorCode.EXTERNAL_AFTER_CONST, externalKeyword, []);
+      _reportErrorForToken(ParserErrorCode.EXTERNAL_AFTER_CONST, externalKeyword);
     }
     if (externalKeyword != null && factoryKeyword != null && factoryKeyword.offset < externalKeyword.offset) {
-      _reportErrorForToken(ParserErrorCode.EXTERNAL_AFTER_FACTORY, externalKeyword, []);
+      _reportErrorForToken(ParserErrorCode.EXTERNAL_AFTER_FACTORY, externalKeyword);
     }
     return constKeyword;
   }
@@ -7610,19 +7629,19 @@
   void _validateModifiersForEnum(Modifiers modifiers) {
     _validateModifiersForTopLevelDeclaration(modifiers);
     if (modifiers.abstractKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.ABSTRACT_ENUM, modifiers.abstractKeyword, []);
+      _reportErrorForToken(ParserErrorCode.ABSTRACT_ENUM, modifiers.abstractKeyword);
     }
     if (modifiers.constKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.CONST_ENUM, modifiers.constKeyword, []);
+      _reportErrorForToken(ParserErrorCode.CONST_ENUM, modifiers.constKeyword);
     }
     if (modifiers.externalKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.EXTERNAL_ENUM, modifiers.externalKeyword, []);
+      _reportErrorForToken(ParserErrorCode.EXTERNAL_ENUM, modifiers.externalKeyword);
     }
     if (modifiers.finalKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.FINAL_ENUM, modifiers.finalKeyword, []);
+      _reportErrorForToken(ParserErrorCode.FINAL_ENUM, modifiers.finalKeyword);
     }
     if (modifiers.varKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.VAR_ENUM, modifiers.varKeyword, []);
+      _reportErrorForToken(ParserErrorCode.VAR_ENUM, modifiers.varKeyword);
     }
   }
 
@@ -7635,13 +7654,13 @@
    */
   Token _validateModifiersForField(Modifiers modifiers) {
     if (modifiers.abstractKeyword != null) {
-      _reportErrorForCurrentToken(ParserErrorCode.ABSTRACT_CLASS_MEMBER, []);
+      _reportErrorForCurrentToken(ParserErrorCode.ABSTRACT_CLASS_MEMBER);
     }
     if (modifiers.externalKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.EXTERNAL_FIELD, modifiers.externalKeyword, []);
+      _reportErrorForToken(ParserErrorCode.EXTERNAL_FIELD, modifiers.externalKeyword);
     }
     if (modifiers.factoryKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.NON_CONSTRUCTOR_FACTORY, modifiers.factoryKeyword, []);
+      _reportErrorForToken(ParserErrorCode.NON_CONSTRUCTOR_FACTORY, modifiers.factoryKeyword);
     }
     Token staticKeyword = modifiers.staticKeyword;
     Token constKeyword = modifiers.constKeyword;
@@ -7649,23 +7668,23 @@
     Token varKeyword = modifiers.varKeyword;
     if (constKeyword != null) {
       if (finalKeyword != null) {
-        _reportErrorForToken(ParserErrorCode.CONST_AND_FINAL, finalKeyword, []);
+        _reportErrorForToken(ParserErrorCode.CONST_AND_FINAL, finalKeyword);
       }
       if (varKeyword != null) {
-        _reportErrorForToken(ParserErrorCode.CONST_AND_VAR, varKeyword, []);
+        _reportErrorForToken(ParserErrorCode.CONST_AND_VAR, varKeyword);
       }
       if (staticKeyword != null && constKeyword.offset < staticKeyword.offset) {
-        _reportErrorForToken(ParserErrorCode.STATIC_AFTER_CONST, staticKeyword, []);
+        _reportErrorForToken(ParserErrorCode.STATIC_AFTER_CONST, staticKeyword);
       }
     } else if (finalKeyword != null) {
       if (varKeyword != null) {
-        _reportErrorForToken(ParserErrorCode.FINAL_AND_VAR, varKeyword, []);
+        _reportErrorForToken(ParserErrorCode.FINAL_AND_VAR, varKeyword);
       }
       if (staticKeyword != null && finalKeyword.offset < staticKeyword.offset) {
-        _reportErrorForToken(ParserErrorCode.STATIC_AFTER_FINAL, staticKeyword, []);
+        _reportErrorForToken(ParserErrorCode.STATIC_AFTER_FINAL, staticKeyword);
       }
     } else if (varKeyword != null && staticKeyword != null && varKeyword.offset < staticKeyword.offset) {
-      _reportErrorForToken(ParserErrorCode.STATIC_AFTER_VAR, staticKeyword, []);
+      _reportErrorForToken(ParserErrorCode.STATIC_AFTER_VAR, staticKeyword);
     }
     return _lexicallyFirst([constKeyword, finalKeyword, varKeyword]);
   }
@@ -7677,7 +7696,7 @@
    */
   void _validateModifiersForFunctionDeclarationStatement(Modifiers modifiers) {
     if (modifiers.abstractKeyword != null || modifiers.constKeyword != null || modifiers.externalKeyword != null || modifiers.factoryKeyword != null || modifiers.finalKeyword != null || modifiers.staticKeyword != null || modifiers.varKeyword != null) {
-      _reportErrorForCurrentToken(ParserErrorCode.LOCAL_FUNCTION_DECLARATION_MODIFIER, []);
+      _reportErrorForCurrentToken(ParserErrorCode.LOCAL_FUNCTION_DECLARATION_MODIFIER);
     }
   }
 
@@ -7688,24 +7707,24 @@
    */
   void _validateModifiersForGetterOrSetterOrMethod(Modifiers modifiers) {
     if (modifiers.abstractKeyword != null) {
-      _reportErrorForCurrentToken(ParserErrorCode.ABSTRACT_CLASS_MEMBER, []);
+      _reportErrorForCurrentToken(ParserErrorCode.ABSTRACT_CLASS_MEMBER);
     }
     if (modifiers.constKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.CONST_METHOD, modifiers.constKeyword, []);
+      _reportErrorForToken(ParserErrorCode.CONST_METHOD, modifiers.constKeyword);
     }
     if (modifiers.factoryKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.NON_CONSTRUCTOR_FACTORY, modifiers.factoryKeyword, []);
+      _reportErrorForToken(ParserErrorCode.NON_CONSTRUCTOR_FACTORY, modifiers.factoryKeyword);
     }
     if (modifiers.finalKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.FINAL_METHOD, modifiers.finalKeyword, []);
+      _reportErrorForToken(ParserErrorCode.FINAL_METHOD, modifiers.finalKeyword);
     }
     if (modifiers.varKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.VAR_RETURN_TYPE, modifiers.varKeyword, []);
+      _reportErrorForToken(ParserErrorCode.VAR_RETURN_TYPE, modifiers.varKeyword);
     }
     Token externalKeyword = modifiers.externalKeyword;
     Token staticKeyword = modifiers.staticKeyword;
     if (externalKeyword != null && staticKeyword != null && staticKeyword.offset < externalKeyword.offset) {
-      _reportErrorForToken(ParserErrorCode.EXTERNAL_AFTER_STATIC, externalKeyword, []);
+      _reportErrorForToken(ParserErrorCode.EXTERNAL_AFTER_STATIC, externalKeyword);
     }
   }
 
@@ -7716,22 +7735,22 @@
    */
   void _validateModifiersForOperator(Modifiers modifiers) {
     if (modifiers.abstractKeyword != null) {
-      _reportErrorForCurrentToken(ParserErrorCode.ABSTRACT_CLASS_MEMBER, []);
+      _reportErrorForCurrentToken(ParserErrorCode.ABSTRACT_CLASS_MEMBER);
     }
     if (modifiers.constKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.CONST_METHOD, modifiers.constKeyword, []);
+      _reportErrorForToken(ParserErrorCode.CONST_METHOD, modifiers.constKeyword);
     }
     if (modifiers.factoryKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.NON_CONSTRUCTOR_FACTORY, modifiers.factoryKeyword, []);
+      _reportErrorForToken(ParserErrorCode.NON_CONSTRUCTOR_FACTORY, modifiers.factoryKeyword);
     }
     if (modifiers.finalKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.FINAL_METHOD, modifiers.finalKeyword, []);
+      _reportErrorForToken(ParserErrorCode.FINAL_METHOD, modifiers.finalKeyword);
     }
     if (modifiers.staticKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.STATIC_OPERATOR, modifiers.staticKeyword, []);
+      _reportErrorForToken(ParserErrorCode.STATIC_OPERATOR, modifiers.staticKeyword);
     }
     if (modifiers.varKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.VAR_RETURN_TYPE, modifiers.varKeyword, []);
+      _reportErrorForToken(ParserErrorCode.VAR_RETURN_TYPE, modifiers.varKeyword);
     }
   }
 
@@ -7742,10 +7761,10 @@
    */
   void _validateModifiersForTopLevelDeclaration(Modifiers modifiers) {
     if (modifiers.factoryKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.FACTORY_TOP_LEVEL_DECLARATION, modifiers.factoryKeyword, []);
+      _reportErrorForToken(ParserErrorCode.FACTORY_TOP_LEVEL_DECLARATION, modifiers.factoryKeyword);
     }
     if (modifiers.staticKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.STATIC_TOP_LEVEL_DECLARATION, modifiers.staticKeyword, []);
+      _reportErrorForToken(ParserErrorCode.STATIC_TOP_LEVEL_DECLARATION, modifiers.staticKeyword);
     }
   }
 
@@ -7757,16 +7776,16 @@
   void _validateModifiersForTopLevelFunction(Modifiers modifiers) {
     _validateModifiersForTopLevelDeclaration(modifiers);
     if (modifiers.abstractKeyword != null) {
-      _reportErrorForCurrentToken(ParserErrorCode.ABSTRACT_TOP_LEVEL_FUNCTION, []);
+      _reportErrorForCurrentToken(ParserErrorCode.ABSTRACT_TOP_LEVEL_FUNCTION);
     }
     if (modifiers.constKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.CONST_CLASS, modifiers.constKeyword, []);
+      _reportErrorForToken(ParserErrorCode.CONST_CLASS, modifiers.constKeyword);
     }
     if (modifiers.finalKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.FINAL_CLASS, modifiers.finalKeyword, []);
+      _reportErrorForToken(ParserErrorCode.FINAL_CLASS, modifiers.finalKeyword);
     }
     if (modifiers.varKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.VAR_RETURN_TYPE, modifiers.varKeyword, []);
+      _reportErrorForToken(ParserErrorCode.VAR_RETURN_TYPE, modifiers.varKeyword);
     }
   }
 
@@ -7780,24 +7799,24 @@
   Token _validateModifiersForTopLevelVariable(Modifiers modifiers) {
     _validateModifiersForTopLevelDeclaration(modifiers);
     if (modifiers.abstractKeyword != null) {
-      _reportErrorForCurrentToken(ParserErrorCode.ABSTRACT_TOP_LEVEL_VARIABLE, []);
+      _reportErrorForCurrentToken(ParserErrorCode.ABSTRACT_TOP_LEVEL_VARIABLE);
     }
     if (modifiers.externalKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.EXTERNAL_FIELD, modifiers.externalKeyword, []);
+      _reportErrorForToken(ParserErrorCode.EXTERNAL_FIELD, modifiers.externalKeyword);
     }
     Token constKeyword = modifiers.constKeyword;
     Token finalKeyword = modifiers.finalKeyword;
     Token varKeyword = modifiers.varKeyword;
     if (constKeyword != null) {
       if (finalKeyword != null) {
-        _reportErrorForToken(ParserErrorCode.CONST_AND_FINAL, finalKeyword, []);
+        _reportErrorForToken(ParserErrorCode.CONST_AND_FINAL, finalKeyword);
       }
       if (varKeyword != null) {
-        _reportErrorForToken(ParserErrorCode.CONST_AND_VAR, varKeyword, []);
+        _reportErrorForToken(ParserErrorCode.CONST_AND_VAR, varKeyword);
       }
     } else if (finalKeyword != null) {
       if (varKeyword != null) {
-        _reportErrorForToken(ParserErrorCode.FINAL_AND_VAR, varKeyword, []);
+        _reportErrorForToken(ParserErrorCode.FINAL_AND_VAR, varKeyword);
       }
     }
     return _lexicallyFirst([constKeyword, finalKeyword, varKeyword]);
@@ -7812,520 +7831,355 @@
   void _validateModifiersForTypedef(Modifiers modifiers) {
     _validateModifiersForTopLevelDeclaration(modifiers);
     if (modifiers.abstractKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.ABSTRACT_TYPEDEF, modifiers.abstractKeyword, []);
+      _reportErrorForToken(ParserErrorCode.ABSTRACT_TYPEDEF, modifiers.abstractKeyword);
     }
     if (modifiers.constKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.CONST_TYPEDEF, modifiers.constKeyword, []);
+      _reportErrorForToken(ParserErrorCode.CONST_TYPEDEF, modifiers.constKeyword);
     }
     if (modifiers.externalKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.EXTERNAL_TYPEDEF, modifiers.externalKeyword, []);
+      _reportErrorForToken(ParserErrorCode.EXTERNAL_TYPEDEF, modifiers.externalKeyword);
     }
     if (modifiers.finalKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.FINAL_TYPEDEF, modifiers.finalKeyword, []);
+      _reportErrorForToken(ParserErrorCode.FINAL_TYPEDEF, modifiers.finalKeyword);
     }
     if (modifiers.varKeyword != null) {
-      _reportErrorForToken(ParserErrorCode.VAR_TYPEDEF, modifiers.varKeyword, []);
+      _reportErrorForToken(ParserErrorCode.VAR_TYPEDEF, modifiers.varKeyword);
     }
   }
 }
 
 /**
- * The enumeration `ParserErrorCode` defines the error codes used for errors detected by the
- * parser. The convention for this class is for the name of the error code to indicate the problem
- * that caused the error to be generated and for the error message to explain what is wrong and,
- * when appropriate, how the problem can be corrected.
+ * The enumeration `ParserErrorCode` defines the error codes used for errors
+ * detected by the parser. The convention for this class is for the name of the
+ * error code to indicate the problem that caused the error to be generated and
+ * for the error message to explain what is wrong and, when appropriate, how the
+ * problem can be corrected.
  */
-class ParserErrorCode extends Enum<ParserErrorCode> implements ErrorCode {
-  static const ParserErrorCode ABSTRACT_CLASS_MEMBER = const ParserErrorCode.con3('ABSTRACT_CLASS_MEMBER', 0, "Members of classes cannot be declared to be 'abstract'");
+class ParserErrorCode extends ErrorCode {
+  static const ParserErrorCode ABSTRACT_CLASS_MEMBER= const ParserErrorCode('ABSTRACT_CLASS_MEMBER', "Members of classes cannot be declared to be 'abstract'");
 
-  static const ParserErrorCode ABSTRACT_ENUM = const ParserErrorCode.con3('ABSTRACT_ENUM', 1, "Enums cannot be declared to be 'abstract'");
+  static const ParserErrorCode ABSTRACT_ENUM = const ParserErrorCode('ABSTRACT_ENUM', "Enums cannot be declared to be 'abstract'");
 
-  static const ParserErrorCode ABSTRACT_STATIC_METHOD = const ParserErrorCode.con3('ABSTRACT_STATIC_METHOD', 2, "Static methods cannot be declared to be 'abstract'");
+  static const ParserErrorCode ABSTRACT_STATIC_METHOD = const ParserErrorCode('ABSTRACT_STATIC_METHOD', "Static methods cannot be declared to be 'abstract'");
 
-  static const ParserErrorCode ABSTRACT_TOP_LEVEL_FUNCTION = const ParserErrorCode.con3('ABSTRACT_TOP_LEVEL_FUNCTION', 3, "Top-level functions cannot be declared to be 'abstract'");
+  static const ParserErrorCode ABSTRACT_TOP_LEVEL_FUNCTION = const ParserErrorCode('ABSTRACT_TOP_LEVEL_FUNCTION', "Top-level functions cannot be declared to be 'abstract'");
 
-  static const ParserErrorCode ABSTRACT_TOP_LEVEL_VARIABLE = const ParserErrorCode.con3('ABSTRACT_TOP_LEVEL_VARIABLE', 4, "Top-level variables cannot be declared to be 'abstract'");
+  static const ParserErrorCode ABSTRACT_TOP_LEVEL_VARIABLE = const ParserErrorCode('ABSTRACT_TOP_LEVEL_VARIABLE', "Top-level variables cannot be declared to be 'abstract'");
 
-  static const ParserErrorCode ABSTRACT_TYPEDEF = const ParserErrorCode.con3('ABSTRACT_TYPEDEF', 5, "Type aliases cannot be declared to be 'abstract'");
+  static const ParserErrorCode ABSTRACT_TYPEDEF = const ParserErrorCode('ABSTRACT_TYPEDEF', "Type aliases cannot be declared to be 'abstract'");
 
-  static const ParserErrorCode ASSERT_DOES_NOT_TAKE_ASSIGNMENT = const ParserErrorCode.con3('ASSERT_DOES_NOT_TAKE_ASSIGNMENT', 6, "Assert cannot be called on an assignment");
+  static const ParserErrorCode ASSERT_DOES_NOT_TAKE_ASSIGNMENT = const ParserErrorCode('ASSERT_DOES_NOT_TAKE_ASSIGNMENT', "Assert cannot be called on an assignment");
 
-  static const ParserErrorCode ASSERT_DOES_NOT_TAKE_CASCADE = const ParserErrorCode.con3('ASSERT_DOES_NOT_TAKE_CASCADE', 7, "Assert cannot be called on cascade");
+  static const ParserErrorCode ASSERT_DOES_NOT_TAKE_CASCADE = const ParserErrorCode('ASSERT_DOES_NOT_TAKE_CASCADE', "Assert cannot be called on cascade");
 
-  static const ParserErrorCode ASSERT_DOES_NOT_TAKE_THROW = const ParserErrorCode.con3('ASSERT_DOES_NOT_TAKE_THROW', 8, "Assert cannot be called on throws");
+  static const ParserErrorCode ASSERT_DOES_NOT_TAKE_THROW = const ParserErrorCode('ASSERT_DOES_NOT_TAKE_THROW', "Assert cannot be called on throws");
 
-  static const ParserErrorCode ASSERT_DOES_NOT_TAKE_RETHROW = const ParserErrorCode.con3('ASSERT_DOES_NOT_TAKE_RETHROW', 9, "Assert cannot be called on rethrows");
+  static const ParserErrorCode ASSERT_DOES_NOT_TAKE_RETHROW = const ParserErrorCode('ASSERT_DOES_NOT_TAKE_RETHROW', "Assert cannot be called on rethrows");
 
-  static const ParserErrorCode BREAK_OUTSIDE_OF_LOOP = const ParserErrorCode.con3('BREAK_OUTSIDE_OF_LOOP', 10, "A break statement cannot be used outside of a loop or switch statement");
+  static const ParserErrorCode BREAK_OUTSIDE_OF_LOOP = const ParserErrorCode('BREAK_OUTSIDE_OF_LOOP', "A break statement cannot be used outside of a loop or switch statement");
 
-  static const ParserErrorCode CONST_AND_FINAL = const ParserErrorCode.con3('CONST_AND_FINAL', 11, "Members cannot be declared to be both 'const' and 'final'");
+  static const ParserErrorCode CONST_AND_FINAL = const ParserErrorCode('CONST_AND_FINAL', "Members cannot be declared to be both 'const' and 'final'");
 
-  static const ParserErrorCode CONST_AND_VAR = const ParserErrorCode.con3('CONST_AND_VAR', 12, "Members cannot be declared to be both 'const' and 'var'");
+  static const ParserErrorCode CONST_AND_VAR = const ParserErrorCode('CONST_AND_VAR', "Members cannot be declared to be both 'const' and 'var'");
 
-  static const ParserErrorCode CONST_CLASS = const ParserErrorCode.con3('CONST_CLASS', 13, "Classes cannot be declared to be 'const'");
+  static const ParserErrorCode CONST_CLASS = const ParserErrorCode('CONST_CLASS', "Classes cannot be declared to be 'const'");
 
-  static const ParserErrorCode CONST_CONSTRUCTOR_WITH_BODY = const ParserErrorCode.con3('CONST_CONSTRUCTOR_WITH_BODY', 14, "'const' constructors cannot have a body");
+  static const ParserErrorCode CONST_CONSTRUCTOR_WITH_BODY = const ParserErrorCode('CONST_CONSTRUCTOR_WITH_BODY', "'const' constructors cannot have a body");
 
-  static const ParserErrorCode CONST_ENUM = const ParserErrorCode.con3('CONST_ENUM', 15, "Enums cannot be declared to be 'const'");
+  static const ParserErrorCode CONST_ENUM = const ParserErrorCode('CONST_ENUM', "Enums cannot be declared to be 'const'");
 
-  static const ParserErrorCode CONST_FACTORY = const ParserErrorCode.con3('CONST_FACTORY', 16, "Only redirecting factory constructors can be declared to be 'const'");
+  static const ParserErrorCode CONST_FACTORY = const ParserErrorCode('CONST_FACTORY', "Only redirecting factory constructors can be declared to be 'const'");
 
-  static const ParserErrorCode CONST_METHOD = const ParserErrorCode.con3('CONST_METHOD', 17, "Getters, setters and methods cannot be declared to be 'const'");
+  static const ParserErrorCode CONST_METHOD = const ParserErrorCode('CONST_METHOD', "Getters, setters and methods cannot be declared to be 'const'");
 
-  static const ParserErrorCode CONST_TYPEDEF = const ParserErrorCode.con3('CONST_TYPEDEF', 18, "Type aliases cannot be declared to be 'const'");
+  static const ParserErrorCode CONST_TYPEDEF = const ParserErrorCode('CONST_TYPEDEF', "Type aliases cannot be declared to be 'const'");
 
-  static const ParserErrorCode CONSTRUCTOR_WITH_RETURN_TYPE = const ParserErrorCode.con3('CONSTRUCTOR_WITH_RETURN_TYPE', 19, "Constructors cannot have a return type");
+  static const ParserErrorCode CONSTRUCTOR_WITH_RETURN_TYPE = const ParserErrorCode('CONSTRUCTOR_WITH_RETURN_TYPE', "Constructors cannot have a return type");
 
-  static const ParserErrorCode CONTINUE_OUTSIDE_OF_LOOP = const ParserErrorCode.con3('CONTINUE_OUTSIDE_OF_LOOP', 20, "A continue statement cannot be used outside of a loop or switch statement");
+  static const ParserErrorCode CONTINUE_OUTSIDE_OF_LOOP = const ParserErrorCode('CONTINUE_OUTSIDE_OF_LOOP', "A continue statement cannot be used outside of a loop or switch statement");
 
-  static const ParserErrorCode CONTINUE_WITHOUT_LABEL_IN_CASE = const ParserErrorCode.con3('CONTINUE_WITHOUT_LABEL_IN_CASE', 21, "A continue statement in a switch statement must have a label as a target");
+  static const ParserErrorCode CONTINUE_WITHOUT_LABEL_IN_CASE = const ParserErrorCode('CONTINUE_WITHOUT_LABEL_IN_CASE', "A continue statement in a switch statement must have a label as a target");
 
-  static const ParserErrorCode DEFERRED_IMPORTS_NOT_SUPPORTED = const ParserErrorCode.con3('DEFERRED_IMPORTS_NOT_SUPPORTED', 22, "Deferred imports are not supported by default");
+  static const ParserErrorCode DEFERRED_IMPORTS_NOT_SUPPORTED = const ParserErrorCode('DEFERRED_IMPORTS_NOT_SUPPORTED', "Deferred imports are not supported by default");
 
-  static const ParserErrorCode DEPRECATED_CLASS_TYPE_ALIAS = const ParserErrorCode.con3('DEPRECATED_CLASS_TYPE_ALIAS', 23, "The 'typedef' mixin application was replaced with 'class'");
+  static const ParserErrorCode DEPRECATED_CLASS_TYPE_ALIAS = const ParserErrorCode('DEPRECATED_CLASS_TYPE_ALIAS', "The 'typedef' mixin application was replaced with 'class'");
 
-  static const ParserErrorCode DIRECTIVE_AFTER_DECLARATION = const ParserErrorCode.con3('DIRECTIVE_AFTER_DECLARATION', 24, "Directives must appear before any declarations");
+  static const ParserErrorCode DIRECTIVE_AFTER_DECLARATION = const ParserErrorCode('DIRECTIVE_AFTER_DECLARATION', "Directives must appear before any declarations");
 
-  static const ParserErrorCode DUPLICATE_LABEL_IN_SWITCH_STATEMENT = const ParserErrorCode.con3('DUPLICATE_LABEL_IN_SWITCH_STATEMENT', 25, "The label {0} was already used in this switch statement");
+  static const ParserErrorCode DUPLICATE_LABEL_IN_SWITCH_STATEMENT = const ParserErrorCode('DUPLICATE_LABEL_IN_SWITCH_STATEMENT', "The label {0} was already used in this switch statement");
 
-  static const ParserErrorCode DUPLICATED_MODIFIER = const ParserErrorCode.con3('DUPLICATED_MODIFIER', 26, "The modifier '{0}' was already specified.");
+  static const ParserErrorCode DUPLICATED_MODIFIER = const ParserErrorCode('DUPLICATED_MODIFIER', "The modifier '{0}' was already specified.");
 
-  static const ParserErrorCode EMPTY_ENUM_BODY = const ParserErrorCode.con3('EMPTY_ENUM_BODY', 27, "An enum must declare at least one constant name");
+  static const ParserErrorCode EMPTY_ENUM_BODY = const ParserErrorCode('EMPTY_ENUM_BODY', "An enum must declare at least one constant name");
 
-  static const ParserErrorCode EQUALITY_CANNOT_BE_EQUALITY_OPERAND = const ParserErrorCode.con3('EQUALITY_CANNOT_BE_EQUALITY_OPERAND', 28, "Equality expression cannot be operand of another equality expression.");
+  static const ParserErrorCode EQUALITY_CANNOT_BE_EQUALITY_OPERAND = const ParserErrorCode('EQUALITY_CANNOT_BE_EQUALITY_OPERAND', "Equality expression cannot be operand of another equality expression.");
 
-  static const ParserErrorCode EXPECTED_CASE_OR_DEFAULT = const ParserErrorCode.con3('EXPECTED_CASE_OR_DEFAULT', 29, "Expected 'case' or 'default'");
+  static const ParserErrorCode EXPECTED_CASE_OR_DEFAULT = const ParserErrorCode('EXPECTED_CASE_OR_DEFAULT', "Expected 'case' or 'default'");
 
-  static const ParserErrorCode EXPECTED_CLASS_MEMBER = const ParserErrorCode.con3('EXPECTED_CLASS_MEMBER', 30, "Expected a class member");
+  static const ParserErrorCode EXPECTED_CLASS_MEMBER = const ParserErrorCode('EXPECTED_CLASS_MEMBER', "Expected a class member");
 
-  static const ParserErrorCode EXPECTED_EXECUTABLE = const ParserErrorCode.con3('EXPECTED_EXECUTABLE', 31, "Expected a method, getter, setter or operator declaration");
+  static const ParserErrorCode EXPECTED_EXECUTABLE = const ParserErrorCode('EXPECTED_EXECUTABLE', "Expected a method, getter, setter or operator declaration");
 
-  static const ParserErrorCode EXPECTED_LIST_OR_MAP_LITERAL = const ParserErrorCode.con3('EXPECTED_LIST_OR_MAP_LITERAL', 32, "Expected a list or map literal");
+  static const ParserErrorCode EXPECTED_LIST_OR_MAP_LITERAL = const ParserErrorCode('EXPECTED_LIST_OR_MAP_LITERAL', "Expected a list or map literal");
 
-  static const ParserErrorCode EXPECTED_STRING_LITERAL = const ParserErrorCode.con3('EXPECTED_STRING_LITERAL', 33, "Expected a string literal");
+  static const ParserErrorCode EXPECTED_STRING_LITERAL = const ParserErrorCode('EXPECTED_STRING_LITERAL', "Expected a string literal");
 
-  static const ParserErrorCode EXPECTED_TOKEN = const ParserErrorCode.con3('EXPECTED_TOKEN', 34, "Expected to find '{0}'");
+  static const ParserErrorCode EXPECTED_TOKEN = const ParserErrorCode('EXPECTED_TOKEN', "Expected to find '{0}'");
 
-  static const ParserErrorCode EXPECTED_TYPE_NAME = const ParserErrorCode.con3('EXPECTED_TYPE_NAME', 35, "Expected a type name");
+  static const ParserErrorCode EXPECTED_TYPE_NAME = const ParserErrorCode('EXPECTED_TYPE_NAME', "Expected a type name");
 
-  static const ParserErrorCode EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE = const ParserErrorCode.con3('EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE', 36, "Export directives must preceed part directives");
+  static const ParserErrorCode EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE = const ParserErrorCode('EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE', "Export directives must preceed part directives");
 
-  static const ParserErrorCode EXTERNAL_AFTER_CONST = const ParserErrorCode.con3('EXTERNAL_AFTER_CONST', 37, "The modifier 'external' should be before the modifier 'const'");
+  static const ParserErrorCode EXTERNAL_AFTER_CONST = const ParserErrorCode('EXTERNAL_AFTER_CONST', "The modifier 'external' should be before the modifier 'const'");
 
-  static const ParserErrorCode EXTERNAL_AFTER_FACTORY = const ParserErrorCode.con3('EXTERNAL_AFTER_FACTORY', 38, "The modifier 'external' should be before the modifier 'factory'");
+  static const ParserErrorCode EXTERNAL_AFTER_FACTORY = const ParserErrorCode('EXTERNAL_AFTER_FACTORY', "The modifier 'external' should be before the modifier 'factory'");
 
-  static const ParserErrorCode EXTERNAL_AFTER_STATIC = const ParserErrorCode.con3('EXTERNAL_AFTER_STATIC', 39, "The modifier 'external' should be before the modifier 'static'");
+  static const ParserErrorCode EXTERNAL_AFTER_STATIC = const ParserErrorCode('EXTERNAL_AFTER_STATIC', "The modifier 'external' should be before the modifier 'static'");
 
-  static const ParserErrorCode EXTERNAL_CLASS = const ParserErrorCode.con3('EXTERNAL_CLASS', 40, "Classes cannot be declared to be 'external'");
+  static const ParserErrorCode EXTERNAL_CLASS = const ParserErrorCode('EXTERNAL_CLASS', "Classes cannot be declared to be 'external'");
 
-  static const ParserErrorCode EXTERNAL_CONSTRUCTOR_WITH_BODY = const ParserErrorCode.con3('EXTERNAL_CONSTRUCTOR_WITH_BODY', 41, "External constructors cannot have a body");
+  static const ParserErrorCode EXTERNAL_CONSTRUCTOR_WITH_BODY = const ParserErrorCode('EXTERNAL_CONSTRUCTOR_WITH_BODY', "External constructors cannot have a body");
 
-  static const ParserErrorCode EXTERNAL_ENUM = const ParserErrorCode.con3('EXTERNAL_ENUM', 42, "Enums cannot be declared to be 'external'");
+  static const ParserErrorCode EXTERNAL_ENUM = const ParserErrorCode('EXTERNAL_ENUM', "Enums cannot be declared to be 'external'");
 
-  static const ParserErrorCode EXTERNAL_FIELD = const ParserErrorCode.con3('EXTERNAL_FIELD', 43, "Fields cannot be declared to be 'external'");
+  static const ParserErrorCode EXTERNAL_FIELD = const ParserErrorCode('EXTERNAL_FIELD', "Fields cannot be declared to be 'external'");
 
-  static const ParserErrorCode EXTERNAL_GETTER_WITH_BODY = const ParserErrorCode.con3('EXTERNAL_GETTER_WITH_BODY', 44, "External getters cannot have a body");
+  static const ParserErrorCode EXTERNAL_GETTER_WITH_BODY = const ParserErrorCode('EXTERNAL_GETTER_WITH_BODY', "External getters cannot have a body");
 
-  static const ParserErrorCode EXTERNAL_METHOD_WITH_BODY = const ParserErrorCode.con3('EXTERNAL_METHOD_WITH_BODY', 45, "External methods cannot have a body");
+  static const ParserErrorCode EXTERNAL_METHOD_WITH_BODY = const ParserErrorCode('EXTERNAL_METHOD_WITH_BODY', "External methods cannot have a body");
 
-  static const ParserErrorCode EXTERNAL_OPERATOR_WITH_BODY = const ParserErrorCode.con3('EXTERNAL_OPERATOR_WITH_BODY', 46, "External operators cannot have a body");
+  static const ParserErrorCode EXTERNAL_OPERATOR_WITH_BODY = const ParserErrorCode('EXTERNAL_OPERATOR_WITH_BODY', "External operators cannot have a body");
 
-  static const ParserErrorCode EXTERNAL_SETTER_WITH_BODY = const ParserErrorCode.con3('EXTERNAL_SETTER_WITH_BODY', 47, "External setters cannot have a body");
+  static const ParserErrorCode EXTERNAL_SETTER_WITH_BODY = const ParserErrorCode('EXTERNAL_SETTER_WITH_BODY', "External setters cannot have a body");
 
-  static const ParserErrorCode EXTERNAL_TYPEDEF = const ParserErrorCode.con3('EXTERNAL_TYPEDEF', 48, "Type aliases cannot be declared to be 'external'");
+  static const ParserErrorCode EXTERNAL_TYPEDEF = const ParserErrorCode('EXTERNAL_TYPEDEF', "Type aliases cannot be declared to be 'external'");
 
-  static const ParserErrorCode FACTORY_TOP_LEVEL_DECLARATION = const ParserErrorCode.con3('FACTORY_TOP_LEVEL_DECLARATION', 49, "Top-level declarations cannot be declared to be 'factory'");
+  static const ParserErrorCode FACTORY_TOP_LEVEL_DECLARATION = const ParserErrorCode('FACTORY_TOP_LEVEL_DECLARATION', "Top-level declarations cannot be declared to be 'factory'");
 
-  static const ParserErrorCode FACTORY_WITHOUT_BODY = const ParserErrorCode.con3('FACTORY_WITHOUT_BODY', 50, "A non-redirecting 'factory' constructor must have a body");
+  static const ParserErrorCode FACTORY_WITH_INITIALIZERS
+      = const ParserErrorCode(
+          'FACTORY_WITH_INITIALIZERS',
+          "A 'factory' constructor cannot have initializers",
+          "Either remove the 'factory' keyword to make this a generative "
+          "constructor or remove the initializers.");
 
-  static const ParserErrorCode FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR = const ParserErrorCode.con3('FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR', 51, "Field initializers can only be used in a constructor");
+  static const ParserErrorCode FACTORY_WITHOUT_BODY = const ParserErrorCode('FACTORY_WITHOUT_BODY', "A non-redirecting 'factory' constructor must have a body");
 
-  static const ParserErrorCode FINAL_AND_VAR = const ParserErrorCode.con3('FINAL_AND_VAR', 52, "Members cannot be declared to be both 'final' and 'var'");
+  static const ParserErrorCode FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR = const ParserErrorCode('FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR', "Field initializers can only be used in a constructor");
 
-  static const ParserErrorCode FINAL_CLASS = const ParserErrorCode.con3('FINAL_CLASS', 53, "Classes cannot be declared to be 'final'");
+  static const ParserErrorCode FINAL_AND_VAR = const ParserErrorCode('FINAL_AND_VAR', "Members cannot be declared to be both 'final' and 'var'");
 
-  static const ParserErrorCode FINAL_CONSTRUCTOR = const ParserErrorCode.con3('FINAL_CONSTRUCTOR', 54, "A constructor cannot be declared to be 'final'");
+  static const ParserErrorCode FINAL_CLASS = const ParserErrorCode('FINAL_CLASS', "Classes cannot be declared to be 'final'");
 
-  static const ParserErrorCode FINAL_ENUM = const ParserErrorCode.con3('FINAL_ENUM', 55, "Enums cannot be declared to be 'final'");
+  static const ParserErrorCode FINAL_CONSTRUCTOR = const ParserErrorCode('FINAL_CONSTRUCTOR', "A constructor cannot be declared to be 'final'");
 
-  static const ParserErrorCode FINAL_METHOD = const ParserErrorCode.con3('FINAL_METHOD', 56, "Getters, setters and methods cannot be declared to be 'final'");
+  static const ParserErrorCode FINAL_ENUM = const ParserErrorCode('FINAL_ENUM', "Enums cannot be declared to be 'final'");
 
-  static const ParserErrorCode FINAL_TYPEDEF = const ParserErrorCode.con3('FINAL_TYPEDEF', 57, "Type aliases cannot be declared to be 'final'");
+  static const ParserErrorCode FINAL_METHOD = const ParserErrorCode('FINAL_METHOD', "Getters, setters and methods cannot be declared to be 'final'");
 
-  static const ParserErrorCode FUNCTION_TYPED_PARAMETER_VAR = const ParserErrorCode.con3('FUNCTION_TYPED_PARAMETER_VAR', 58, "Function typed parameters cannot specify 'const', 'final' or 'var' instead of return type");
+  static const ParserErrorCode FINAL_TYPEDEF = const ParserErrorCode('FINAL_TYPEDEF', "Type aliases cannot be declared to be 'final'");
 
-  static const ParserErrorCode GETTER_IN_FUNCTION = const ParserErrorCode.con3('GETTER_IN_FUNCTION', 59, "Getters cannot be defined within methods or functions");
+  static const ParserErrorCode FUNCTION_TYPED_PARAMETER_VAR = const ParserErrorCode('FUNCTION_TYPED_PARAMETER_VAR', "Function typed parameters cannot specify 'const', 'final' or 'var' instead of return type");
 
-  static const ParserErrorCode GETTER_WITH_PARAMETERS = const ParserErrorCode.con3('GETTER_WITH_PARAMETERS', 60, "Getter should be declared without a parameter list");
+  static const ParserErrorCode GETTER_IN_FUNCTION = const ParserErrorCode('GETTER_IN_FUNCTION', "Getters cannot be defined within methods or functions");
 
-  static const ParserErrorCode ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE = const ParserErrorCode.con3('ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE', 61, "Illegal assignment to non-assignable expression");
+  static const ParserErrorCode GETTER_WITH_PARAMETERS = const ParserErrorCode('GETTER_WITH_PARAMETERS', "Getter should be declared without a parameter list");
 
-  static const ParserErrorCode IMPLEMENTS_BEFORE_EXTENDS = const ParserErrorCode.con3('IMPLEMENTS_BEFORE_EXTENDS', 62, "The extends clause must be before the implements clause");
+  static const ParserErrorCode ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE = const ParserErrorCode('ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE', "Illegal assignment to non-assignable expression");
 
-  static const ParserErrorCode IMPLEMENTS_BEFORE_WITH = const ParserErrorCode.con3('IMPLEMENTS_BEFORE_WITH', 63, "The with clause must be before the implements clause");
+  static const ParserErrorCode IMPLEMENTS_BEFORE_EXTENDS = const ParserErrorCode('IMPLEMENTS_BEFORE_EXTENDS', "The extends clause must be before the implements clause");
 
-  static const ParserErrorCode IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE = const ParserErrorCode.con3('IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE', 64, "Import directives must preceed part directives");
+  static const ParserErrorCode IMPLEMENTS_BEFORE_WITH = const ParserErrorCode('IMPLEMENTS_BEFORE_WITH', "The with clause must be before the implements clause");
 
-  static const ParserErrorCode INITIALIZED_VARIABLE_IN_FOR_EACH = const ParserErrorCode.con3('INITIALIZED_VARIABLE_IN_FOR_EACH', 65, "The loop variable in a for-each loop cannot be initialized");
+  static const ParserErrorCode IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE = const ParserErrorCode('IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE', "Import directives must preceed part directives");
 
-  static const ParserErrorCode INVALID_AWAIT_IN_FOR = const ParserErrorCode.con4('INVALID_AWAIT_IN_FOR', 66, "The modifier 'await' is not allowed for a normal 'for' statement", "Remove the keyword or use a for-each statement.");
+  static const ParserErrorCode INITIALIZED_VARIABLE_IN_FOR_EACH = const ParserErrorCode('INITIALIZED_VARIABLE_IN_FOR_EACH', "The loop variable in a for-each loop cannot be initialized");
 
-  static const ParserErrorCode INVALID_CODE_POINT = const ParserErrorCode.con3('INVALID_CODE_POINT', 67, "The escape sequence '{0}' is not a valid code point");
+  static const ParserErrorCode INVALID_AWAIT_IN_FOR = const ParserErrorCode('INVALID_AWAIT_IN_FOR', "The modifier 'await' is not allowed for a normal 'for' statement", "Remove the keyword or use a for-each statement.");
 
-  static const ParserErrorCode INVALID_COMMENT_REFERENCE = const ParserErrorCode.con3('INVALID_COMMENT_REFERENCE', 68, "Comment references should contain a possibly prefixed identifier and can start with 'new', but should not contain anything else");
+  static const ParserErrorCode INVALID_CODE_POINT = const ParserErrorCode('INVALID_CODE_POINT', "The escape sequence '{0}' is not a valid code point");
 
-  static const ParserErrorCode INVALID_HEX_ESCAPE = const ParserErrorCode.con3('INVALID_HEX_ESCAPE', 69, "An escape sequence starting with '\\x' must be followed by 2 hexidecimal digits");
+  static const ParserErrorCode INVALID_COMMENT_REFERENCE = const ParserErrorCode('INVALID_COMMENT_REFERENCE', "Comment references should contain a possibly prefixed identifier and can start with 'new', but should not contain anything else");
 
-  static const ParserErrorCode INVALID_OPERATOR = const ParserErrorCode.con3('INVALID_OPERATOR', 70, "The string '{0}' is not a valid operator");
+  static const ParserErrorCode INVALID_HEX_ESCAPE = const ParserErrorCode('INVALID_HEX_ESCAPE', "An escape sequence starting with '\\x' must be followed by 2 hexidecimal digits");
 
-  static const ParserErrorCode INVALID_OPERATOR_FOR_SUPER = const ParserErrorCode.con3('INVALID_OPERATOR_FOR_SUPER', 71, "The operator '{0}' cannot be used with 'super'");
+  static const ParserErrorCode INVALID_OPERATOR = const ParserErrorCode('INVALID_OPERATOR', "The string '{0}' is not a valid operator");
 
-  static const ParserErrorCode INVALID_STAR_AFTER_ASYNC = const ParserErrorCode.con4('INVALID_STAR_AFTER_ASYNC', 72, "The modifier 'async*' is not allowed for an expression function body", "Convert the body to a block.");
+  static const ParserErrorCode INVALID_OPERATOR_FOR_SUPER = const ParserErrorCode('INVALID_OPERATOR_FOR_SUPER', "The operator '{0}' cannot be used with 'super'");
 
-  static const ParserErrorCode INVALID_SYNC = const ParserErrorCode.con4('INVALID_SYNC', 73, "The modifier 'sync' is not allowed for an exrpression function body", "Convert the body to a block.");
+  static const ParserErrorCode INVALID_STAR_AFTER_ASYNC = const ParserErrorCode('INVALID_STAR_AFTER_ASYNC', "The modifier 'async*' is not allowed for an expression function body", "Convert the body to a block.");
 
-  static const ParserErrorCode INVALID_UNICODE_ESCAPE = const ParserErrorCode.con3('INVALID_UNICODE_ESCAPE', 74, "An escape sequence starting with '\\u' must be followed by 4 hexidecimal digits or from 1 to 6 digits between '{' and '}'");
+  static const ParserErrorCode INVALID_SYNC = const ParserErrorCode('INVALID_SYNC', "The modifier 'sync' is not allowed for an exrpression function body", "Convert the body to a block.");
 
-  static const ParserErrorCode LIBRARY_DIRECTIVE_NOT_FIRST = const ParserErrorCode.con3('LIBRARY_DIRECTIVE_NOT_FIRST', 75, "The library directive must appear before all other directives");
+  static const ParserErrorCode INVALID_UNICODE_ESCAPE = const ParserErrorCode('INVALID_UNICODE_ESCAPE', "An escape sequence starting with '\\u' must be followed by 4 hexidecimal digits or from 1 to 6 digits between '{' and '}'");
 
-  static const ParserErrorCode LOCAL_FUNCTION_DECLARATION_MODIFIER = const ParserErrorCode.con3('LOCAL_FUNCTION_DECLARATION_MODIFIER', 76, "Local function declarations cannot specify any modifier");
+  static const ParserErrorCode LIBRARY_DIRECTIVE_NOT_FIRST = const ParserErrorCode('LIBRARY_DIRECTIVE_NOT_FIRST', "The library directive must appear before all other directives");
 
-  static const ParserErrorCode MISSING_ASSIGNABLE_SELECTOR = const ParserErrorCode.con3('MISSING_ASSIGNABLE_SELECTOR', 77, "Missing selector such as \".<identifier>\" or \"[0]\"");
+  static const ParserErrorCode LOCAL_FUNCTION_DECLARATION_MODIFIER = const ParserErrorCode('LOCAL_FUNCTION_DECLARATION_MODIFIER', "Local function declarations cannot specify any modifier");
 
-  static const ParserErrorCode MISSING_CATCH_OR_FINALLY = const ParserErrorCode.con3('MISSING_CATCH_OR_FINALLY', 78, "A try statement must have either a catch or finally clause");
+  static const ParserErrorCode MISSING_ASSIGNABLE_SELECTOR = const ParserErrorCode('MISSING_ASSIGNABLE_SELECTOR', "Missing selector such as \".<identifier>\" or \"[0]\"");
 
-  static const ParserErrorCode MISSING_CLASS_BODY = const ParserErrorCode.con3('MISSING_CLASS_BODY', 79, "A class definition must have a body, even if it is empty");
+  static const ParserErrorCode MISSING_ASSIGNMENT_IN_INITIALIZER
+      = const ParserErrorCode(
+          'MISSING_ASSIGNMENT_IN_INITIALIZER',
+          "Expected an assignment after the field name");
 
-  static const ParserErrorCode MISSING_CLOSING_PARENTHESIS = const ParserErrorCode.con3('MISSING_CLOSING_PARENTHESIS', 80, "The closing parenthesis is missing");
+  static const ParserErrorCode MISSING_CATCH_OR_FINALLY = const ParserErrorCode('MISSING_CATCH_OR_FINALLY', "A try statement must have either a catch or finally clause");
 
-  static const ParserErrorCode MISSING_CONST_FINAL_VAR_OR_TYPE = const ParserErrorCode.con3('MISSING_CONST_FINAL_VAR_OR_TYPE', 81, "Variables must be declared using the keywords 'const', 'final', 'var' or a type name");
+  static const ParserErrorCode MISSING_CLASS_BODY = const ParserErrorCode('MISSING_CLASS_BODY', "A class definition must have a body, even if it is empty");
 
-  static const ParserErrorCode MISSING_ENUM_BODY = const ParserErrorCode.con3('MISSING_ENUM_BODY', 82, "An enum definition must have a body with at least one constant name");
+  static const ParserErrorCode MISSING_CLOSING_PARENTHESIS = const ParserErrorCode('MISSING_CLOSING_PARENTHESIS', "The closing parenthesis is missing");
 
-  static const ParserErrorCode MISSING_EXPRESSION_IN_THROW = const ParserErrorCode.con3('MISSING_EXPRESSION_IN_THROW', 83, "Throw expressions must compute the object to be thrown");
+  static const ParserErrorCode MISSING_CONST_FINAL_VAR_OR_TYPE = const ParserErrorCode('MISSING_CONST_FINAL_VAR_OR_TYPE', "Variables must be declared using the keywords 'const', 'final', 'var' or a type name");
 
-  static const ParserErrorCode MISSING_FUNCTION_BODY = const ParserErrorCode.con3('MISSING_FUNCTION_BODY', 84, "A function body must be provided");
+  static const ParserErrorCode MISSING_ENUM_BODY = const ParserErrorCode('MISSING_ENUM_BODY', "An enum definition must have a body with at least one constant name");
 
-  static const ParserErrorCode MISSING_FUNCTION_PARAMETERS = const ParserErrorCode.con3('MISSING_FUNCTION_PARAMETERS', 85, "Functions must have an explicit list of parameters");
+  static const ParserErrorCode MISSING_EXPRESSION_IN_INITIALIZER
+      = const ParserErrorCode(
+          'MISSING_EXPRESSION_IN_INITIALIZER',
+          "Expected an expression after the assignment operator");
 
-  static const ParserErrorCode MISSING_GET = const ParserErrorCode.con3('MISSING_GET', 86, "Getters must have the keyword 'get' before the getter name");
+  static const ParserErrorCode MISSING_EXPRESSION_IN_THROW = const ParserErrorCode('MISSING_EXPRESSION_IN_THROW', "Throw expressions must compute the object to be thrown");
 
-  static const ParserErrorCode MISSING_IDENTIFIER = const ParserErrorCode.con3('MISSING_IDENTIFIER', 87, "Expected an identifier");
+  static const ParserErrorCode MISSING_FUNCTION_BODY = const ParserErrorCode('MISSING_FUNCTION_BODY', "A function body must be provided");
 
-  static const ParserErrorCode MISSING_KEYWORD_OPERATOR = const ParserErrorCode.con3('MISSING_KEYWORD_OPERATOR', 88, "Operator declarations must be preceeded by the keyword 'operator'");
+  static const ParserErrorCode MISSING_FUNCTION_PARAMETERS = const ParserErrorCode('MISSING_FUNCTION_PARAMETERS', "Functions must have an explicit list of parameters");
 
-  static const ParserErrorCode MISSING_NAME_IN_LIBRARY_DIRECTIVE = const ParserErrorCode.con3('MISSING_NAME_IN_LIBRARY_DIRECTIVE', 89, "Library directives must include a library name");
+  static const ParserErrorCode MISSING_GET = const ParserErrorCode('MISSING_GET', "Getters must have the keyword 'get' before the getter name");
 
-  static const ParserErrorCode MISSING_NAME_IN_PART_OF_DIRECTIVE = const ParserErrorCode.con3('MISSING_NAME_IN_PART_OF_DIRECTIVE', 90, "Library directives must include a library name");
+  static const ParserErrorCode MISSING_IDENTIFIER = const ParserErrorCode('MISSING_IDENTIFIER', "Expected an identifier");
 
-  static const ParserErrorCode MISSING_PREFIX_IN_DEFERRED_IMPORT = const ParserErrorCode.con3('MISSING_PREFIX_IN_DEFERRED_IMPORT', 91, "Deferred imports must have a prefix");
+  static const ParserErrorCode MISSING_INITIALIZER
+      = const ParserErrorCode('MISSING_INITIALIZER', "Expected an initializer");
 
-  static const ParserErrorCode MISSING_STAR_AFTER_SYNC = const ParserErrorCode.con4('MISSING_STAR_AFTER_SYNC', 92, "The modifier 'sync' must be followed by a star ('*')", "Remove the modifier or add a star.");
+  static const ParserErrorCode MISSING_KEYWORD_OPERATOR = const ParserErrorCode('MISSING_KEYWORD_OPERATOR', "Operator declarations must be preceeded by the keyword 'operator'");
 
-  static const ParserErrorCode MISSING_STATEMENT = const ParserErrorCode.con3('MISSING_STATEMENT', 93, "Expected a statement");
+  static const ParserErrorCode MISSING_NAME_IN_LIBRARY_DIRECTIVE = const ParserErrorCode('MISSING_NAME_IN_LIBRARY_DIRECTIVE', "Library directives must include a library name");
 
-  static const ParserErrorCode MISSING_TERMINATOR_FOR_PARAMETER_GROUP = const ParserErrorCode.con3('MISSING_TERMINATOR_FOR_PARAMETER_GROUP', 94, "There is no '{0}' to close the parameter group");
+  static const ParserErrorCode MISSING_NAME_IN_PART_OF_DIRECTIVE = const ParserErrorCode('MISSING_NAME_IN_PART_OF_DIRECTIVE', "Library directives must include a library name");
 
-  static const ParserErrorCode MISSING_TYPEDEF_PARAMETERS = const ParserErrorCode.con3('MISSING_TYPEDEF_PARAMETERS', 95, "Type aliases for functions must have an explicit list of parameters");
+  static const ParserErrorCode MISSING_PREFIX_IN_DEFERRED_IMPORT = const ParserErrorCode('MISSING_PREFIX_IN_DEFERRED_IMPORT', "Deferred imports must have a prefix");
 
-  static const ParserErrorCode MISSING_VARIABLE_IN_FOR_EACH = const ParserErrorCode.con3('MISSING_VARIABLE_IN_FOR_EACH', 96, "A loop variable must be declared in a for-each loop before the 'in', but none were found");
+  static const ParserErrorCode MISSING_STAR_AFTER_SYNC = const ParserErrorCode('MISSING_STAR_AFTER_SYNC', "The modifier 'sync' must be followed by a star ('*')", "Remove the modifier or add a star.");
 
-  static const ParserErrorCode MIXED_PARAMETER_GROUPS = const ParserErrorCode.con3('MIXED_PARAMETER_GROUPS', 97, "Cannot have both positional and named parameters in a single parameter list");
+  static const ParserErrorCode MISSING_STATEMENT = const ParserErrorCode('MISSING_STATEMENT', "Expected a statement");
 
-  static const ParserErrorCode MULTIPLE_EXTENDS_CLAUSES = const ParserErrorCode.con3('MULTIPLE_EXTENDS_CLAUSES', 98, "Each class definition can have at most one extends clause");
+  static const ParserErrorCode MISSING_TERMINATOR_FOR_PARAMETER_GROUP = const ParserErrorCode('MISSING_TERMINATOR_FOR_PARAMETER_GROUP', "There is no '{0}' to close the parameter group");
 
-  static const ParserErrorCode MULTIPLE_IMPLEMENTS_CLAUSES = const ParserErrorCode.con3('MULTIPLE_IMPLEMENTS_CLAUSES', 99, "Each class definition can have at most one implements clause");
+  static const ParserErrorCode MISSING_TYPEDEF_PARAMETERS = const ParserErrorCode('MISSING_TYPEDEF_PARAMETERS', "Type aliases for functions must have an explicit list of parameters");
 
-  static const ParserErrorCode MULTIPLE_LIBRARY_DIRECTIVES = const ParserErrorCode.con3('MULTIPLE_LIBRARY_DIRECTIVES', 100, "Only one library directive may be declared in a file");
+  static const ParserErrorCode MISSING_VARIABLE_IN_FOR_EACH = const ParserErrorCode('MISSING_VARIABLE_IN_FOR_EACH', "A loop variable must be declared in a for-each loop before the 'in', but none were found");
 
-  static const ParserErrorCode MULTIPLE_NAMED_PARAMETER_GROUPS = const ParserErrorCode.con3('MULTIPLE_NAMED_PARAMETER_GROUPS', 101, "Cannot have multiple groups of named parameters in a single parameter list");
+  static const ParserErrorCode MIXED_PARAMETER_GROUPS = const ParserErrorCode('MIXED_PARAMETER_GROUPS', "Cannot have both positional and named parameters in a single parameter list");
 
-  static const ParserErrorCode MULTIPLE_PART_OF_DIRECTIVES = const ParserErrorCode.con3('MULTIPLE_PART_OF_DIRECTIVES', 102, "Only one part-of directive may be declared in a file");
+  static const ParserErrorCode MULTIPLE_EXTENDS_CLAUSES = const ParserErrorCode('MULTIPLE_EXTENDS_CLAUSES', "Each class definition can have at most one extends clause");
 
-  static const ParserErrorCode MULTIPLE_POSITIONAL_PARAMETER_GROUPS = const ParserErrorCode.con3('MULTIPLE_POSITIONAL_PARAMETER_GROUPS', 103, "Cannot have multiple groups of positional parameters in a single parameter list");
+  static const ParserErrorCode MULTIPLE_IMPLEMENTS_CLAUSES = const ParserErrorCode('MULTIPLE_IMPLEMENTS_CLAUSES', "Each class definition can have at most one implements clause");
 
-  static const ParserErrorCode MULTIPLE_VARIABLES_IN_FOR_EACH = const ParserErrorCode.con3('MULTIPLE_VARIABLES_IN_FOR_EACH', 104, "A single loop variable must be declared in a for-each loop before the 'in', but {0} were found");
+  static const ParserErrorCode MULTIPLE_LIBRARY_DIRECTIVES = const ParserErrorCode('MULTIPLE_LIBRARY_DIRECTIVES', "Only one library directive may be declared in a file");
+
+  static const ParserErrorCode MULTIPLE_NAMED_PARAMETER_GROUPS = const ParserErrorCode('MULTIPLE_NAMED_PARAMETER_GROUPS', "Cannot have multiple groups of named parameters in a single parameter list");
+
+  static const ParserErrorCode MULTIPLE_PART_OF_DIRECTIVES = const ParserErrorCode('MULTIPLE_PART_OF_DIRECTIVES', "Only one part-of directive may be declared in a file");
+
+  static const ParserErrorCode MULTIPLE_POSITIONAL_PARAMETER_GROUPS = const ParserErrorCode('MULTIPLE_POSITIONAL_PARAMETER_GROUPS', "Cannot have multiple groups of positional parameters in a single parameter list");
 
-  static const ParserErrorCode MULTIPLE_WITH_CLAUSES = const ParserErrorCode.con3('MULTIPLE_WITH_CLAUSES', 105, "Each class definition can have at most one with clause");
+  static const ParserErrorCode MULTIPLE_VARIABLES_IN_FOR_EACH = const ParserErrorCode('MULTIPLE_VARIABLES_IN_FOR_EACH', "A single loop variable must be declared in a for-each loop before the 'in', but {0} were found");
 
-  static const ParserErrorCode NAMED_FUNCTION_EXPRESSION = const ParserErrorCode.con3('NAMED_FUNCTION_EXPRESSION', 106, "Function expressions cannot be named");
+  static const ParserErrorCode MULTIPLE_WITH_CLAUSES = const ParserErrorCode('MULTIPLE_WITH_CLAUSES', "Each class definition can have at most one with clause");
 
-  static const ParserErrorCode NAMED_PARAMETER_OUTSIDE_GROUP = const ParserErrorCode.con3('NAMED_PARAMETER_OUTSIDE_GROUP', 107, "Named parameters must be enclosed in curly braces ('{' and '}')");
+  static const ParserErrorCode NAMED_FUNCTION_EXPRESSION = const ParserErrorCode('NAMED_FUNCTION_EXPRESSION', "Function expressions cannot be named");
 
-  static const ParserErrorCode NATIVE_CLAUSE_IN_NON_SDK_CODE = const ParserErrorCode.con3('NATIVE_CLAUSE_IN_NON_SDK_CODE', 108, "Native clause can only be used in the SDK and code that is loaded through native extensions");
+  static const ParserErrorCode NAMED_PARAMETER_OUTSIDE_GROUP = const ParserErrorCode('NAMED_PARAMETER_OUTSIDE_GROUP', "Named parameters must be enclosed in curly braces ('{' and '}')");
 
-  static const ParserErrorCode NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE = const ParserErrorCode.con3('NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE', 109, "Native functions can only be declared in the SDK and code that is loaded through native extensions");
+  static const ParserErrorCode NATIVE_CLAUSE_IN_NON_SDK_CODE = const ParserErrorCode('NATIVE_CLAUSE_IN_NON_SDK_CODE', "Native clause can only be used in the SDK and code that is loaded through native extensions");
 
-  static const ParserErrorCode NON_CONSTRUCTOR_FACTORY = const ParserErrorCode.con3('NON_CONSTRUCTOR_FACTORY', 110, "Only constructors can be declared to be a 'factory'");
+  static const ParserErrorCode NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE = const ParserErrorCode('NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE', "Native functions can only be declared in the SDK and code that is loaded through native extensions");
 
-  static const ParserErrorCode NON_IDENTIFIER_LIBRARY_NAME = const ParserErrorCode.con3('NON_IDENTIFIER_LIBRARY_NAME', 111, "The name of a library must be an identifier");
+  static const ParserErrorCode NON_CONSTRUCTOR_FACTORY = const ParserErrorCode('NON_CONSTRUCTOR_FACTORY', "Only constructors can be declared to be a 'factory'");
 
-  static const ParserErrorCode NON_PART_OF_DIRECTIVE_IN_PART = const ParserErrorCode.con3('NON_PART_OF_DIRECTIVE_IN_PART', 112, "The part-of directive must be the only directive in a part");
+  static const ParserErrorCode NON_IDENTIFIER_LIBRARY_NAME = const ParserErrorCode('NON_IDENTIFIER_LIBRARY_NAME', "The name of a library must be an identifier");
 
-  static const ParserErrorCode NON_USER_DEFINABLE_OPERATOR = const ParserErrorCode.con3('NON_USER_DEFINABLE_OPERATOR', 113, "The operator '{0}' is not user definable");
+  static const ParserErrorCode NON_PART_OF_DIRECTIVE_IN_PART = const ParserErrorCode('NON_PART_OF_DIRECTIVE_IN_PART', "The part-of directive must be the only directive in a part");
 
-  static const ParserErrorCode NORMAL_BEFORE_OPTIONAL_PARAMETERS = const ParserErrorCode.con3('NORMAL_BEFORE_OPTIONAL_PARAMETERS', 114, "Normal parameters must occur before optional parameters");
+  static const ParserErrorCode NON_USER_DEFINABLE_OPERATOR = const ParserErrorCode('NON_USER_DEFINABLE_OPERATOR', "The operator '{0}' is not user definable");
 
-  static const ParserErrorCode POSITIONAL_AFTER_NAMED_ARGUMENT = const ParserErrorCode.con3('POSITIONAL_AFTER_NAMED_ARGUMENT', 115, "Positional arguments must occur before named arguments");
+  static const ParserErrorCode NORMAL_BEFORE_OPTIONAL_PARAMETERS = const ParserErrorCode('NORMAL_BEFORE_OPTIONAL_PARAMETERS', "Normal parameters must occur before optional parameters");
 
-  static const ParserErrorCode POSITIONAL_PARAMETER_OUTSIDE_GROUP = const ParserErrorCode.con3('POSITIONAL_PARAMETER_OUTSIDE_GROUP', 116, "Positional parameters must be enclosed in square brackets ('[' and ']')");
+  static const ParserErrorCode POSITIONAL_AFTER_NAMED_ARGUMENT = const ParserErrorCode('POSITIONAL_AFTER_NAMED_ARGUMENT', "Positional arguments must occur before named arguments");
 
-  static const ParserErrorCode REDIRECTION_IN_NON_FACTORY_CONSTRUCTOR = const ParserErrorCode.con3('REDIRECTION_IN_NON_FACTORY_CONSTRUCTOR', 117, "Only factory constructor can specify '=' redirection.");
+  static const ParserErrorCode POSITIONAL_PARAMETER_OUTSIDE_GROUP = const ParserErrorCode('POSITIONAL_PARAMETER_OUTSIDE_GROUP', "Positional parameters must be enclosed in square brackets ('[' and ']')");
 
-  static const ParserErrorCode SETTER_IN_FUNCTION = const ParserErrorCode.con3('SETTER_IN_FUNCTION', 118, "Setters cannot be defined within methods or functions");
+  static const ParserErrorCode REDIRECTION_IN_NON_FACTORY_CONSTRUCTOR = const ParserErrorCode('REDIRECTION_IN_NON_FACTORY_CONSTRUCTOR', "Only factory constructor can specify '=' redirection.");
 
-  static const ParserErrorCode STATIC_AFTER_CONST = const ParserErrorCode.con3('STATIC_AFTER_CONST', 119, "The modifier 'static' should be before the modifier 'const'");
+  static const ParserErrorCode SETTER_IN_FUNCTION = const ParserErrorCode('SETTER_IN_FUNCTION', "Setters cannot be defined within methods or functions");
 
-  static const ParserErrorCode STATIC_AFTER_FINAL = const ParserErrorCode.con3('STATIC_AFTER_FINAL', 120, "The modifier 'static' should be before the modifier 'final'");
+  static const ParserErrorCode STATIC_AFTER_CONST = const ParserErrorCode('STATIC_AFTER_CONST', "The modifier 'static' should be before the modifier 'const'");
 
-  static const ParserErrorCode STATIC_AFTER_VAR = const ParserErrorCode.con3('STATIC_AFTER_VAR', 121, "The modifier 'static' should be before the modifier 'var'");
+  static const ParserErrorCode STATIC_AFTER_FINAL = const ParserErrorCode('STATIC_AFTER_FINAL', "The modifier 'static' should be before the modifier 'final'");
 
-  static const ParserErrorCode STATIC_CONSTRUCTOR = const ParserErrorCode.con3('STATIC_CONSTRUCTOR', 122, "Constructors cannot be static");
+  static const ParserErrorCode STATIC_AFTER_VAR = const ParserErrorCode('STATIC_AFTER_VAR', "The modifier 'static' should be before the modifier 'var'");
 
-  static const ParserErrorCode STATIC_GETTER_WITHOUT_BODY = const ParserErrorCode.con3('STATIC_GETTER_WITHOUT_BODY', 123, "A 'static' getter must have a body");
+  static const ParserErrorCode STATIC_CONSTRUCTOR = const ParserErrorCode('STATIC_CONSTRUCTOR', "Constructors cannot be static");
 
-  static const ParserErrorCode STATIC_OPERATOR = const ParserErrorCode.con3('STATIC_OPERATOR', 124, "Operators cannot be static");
+  static const ParserErrorCode STATIC_GETTER_WITHOUT_BODY = const ParserErrorCode('STATIC_GETTER_WITHOUT_BODY', "A 'static' getter must have a body");
 
-  static const ParserErrorCode STATIC_SETTER_WITHOUT_BODY = const ParserErrorCode.con3('STATIC_SETTER_WITHOUT_BODY', 125, "A 'static' setter must have a body");
+  static const ParserErrorCode STATIC_OPERATOR = const ParserErrorCode('STATIC_OPERATOR', "Operators cannot be static");
 
-  static const ParserErrorCode STATIC_TOP_LEVEL_DECLARATION = const ParserErrorCode.con3('STATIC_TOP_LEVEL_DECLARATION', 126, "Top-level declarations cannot be declared to be 'static'");
+  static const ParserErrorCode STATIC_SETTER_WITHOUT_BODY = const ParserErrorCode('STATIC_SETTER_WITHOUT_BODY', "A 'static' setter must have a body");
 
-  static const ParserErrorCode SWITCH_HAS_CASE_AFTER_DEFAULT_CASE = const ParserErrorCode.con3('SWITCH_HAS_CASE_AFTER_DEFAULT_CASE', 127, "The 'default' case should be the last case in a switch statement");
+  static const ParserErrorCode STATIC_TOP_LEVEL_DECLARATION = const ParserErrorCode('STATIC_TOP_LEVEL_DECLARATION', "Top-level declarations cannot be declared to be 'static'");
 
-  static const ParserErrorCode SWITCH_HAS_MULTIPLE_DEFAULT_CASES = const ParserErrorCode.con3('SWITCH_HAS_MULTIPLE_DEFAULT_CASES', 128, "The 'default' case can only be declared once");
+  static const ParserErrorCode SWITCH_HAS_CASE_AFTER_DEFAULT_CASE = const ParserErrorCode('SWITCH_HAS_CASE_AFTER_DEFAULT_CASE', "The 'default' case should be the last case in a switch statement");
 
-  static const ParserErrorCode TOP_LEVEL_OPERATOR = const ParserErrorCode.con3('TOP_LEVEL_OPERATOR', 129, "Operators must be declared within a class");
+  static const ParserErrorCode SWITCH_HAS_MULTIPLE_DEFAULT_CASES = const ParserErrorCode('SWITCH_HAS_MULTIPLE_DEFAULT_CASES', "The 'default' case can only be declared once");
 
-  static const ParserErrorCode UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP = const ParserErrorCode.con3('UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP', 130, "There is no '{0}' to open a parameter group");
+  static const ParserErrorCode TOP_LEVEL_OPERATOR = const ParserErrorCode('TOP_LEVEL_OPERATOR', "Operators must be declared within a class");
 
-  static const ParserErrorCode UNEXPECTED_TOKEN = const ParserErrorCode.con3('UNEXPECTED_TOKEN', 131, "Unexpected token '{0}'");
+  static const ParserErrorCode UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP = const ParserErrorCode('UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP', "There is no '{0}' to open a parameter group");
 
-  static const ParserErrorCode WITH_BEFORE_EXTENDS = const ParserErrorCode.con3('WITH_BEFORE_EXTENDS', 132, "The extends clause must be before the with clause");
+  static const ParserErrorCode UNEXPECTED_TOKEN = const ParserErrorCode('UNEXPECTED_TOKEN', "Unexpected token '{0}'");
 
-  static const ParserErrorCode WITH_WITHOUT_EXTENDS = const ParserErrorCode.con3('WITH_WITHOUT_EXTENDS', 133, "The with clause cannot be used without an extends clause");
+  static const ParserErrorCode WITH_BEFORE_EXTENDS = const ParserErrorCode('WITH_BEFORE_EXTENDS', "The extends clause must be before the with clause");
 
-  static const ParserErrorCode WRONG_SEPARATOR_FOR_NAMED_PARAMETER = const ParserErrorCode.con3('WRONG_SEPARATOR_FOR_NAMED_PARAMETER', 134, "The default value of a named parameter should be preceeded by ':'");
+  static const ParserErrorCode WITH_WITHOUT_EXTENDS = const ParserErrorCode('WITH_WITHOUT_EXTENDS', "The with clause cannot be used without an extends clause");
 
-  static const ParserErrorCode WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER = const ParserErrorCode.con3('WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER', 135, "The default value of a positional parameter should be preceeded by '='");
+  static const ParserErrorCode WRONG_SEPARATOR_FOR_NAMED_PARAMETER = const ParserErrorCode('WRONG_SEPARATOR_FOR_NAMED_PARAMETER', "The default value of a named parameter should be preceeded by ':'");
 
-  static const ParserErrorCode WRONG_TERMINATOR_FOR_PARAMETER_GROUP = const ParserErrorCode.con3('WRONG_TERMINATOR_FOR_PARAMETER_GROUP', 136, "Expected '{0}' to close parameter group");
+  static const ParserErrorCode WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER = const ParserErrorCode('WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER', "The default value of a positional parameter should be preceeded by '='");
 
-  static const ParserErrorCode VAR_AND_TYPE = const ParserErrorCode.con3('VAR_AND_TYPE', 137, "Variables cannot be declared using both 'var' and a type name; remove the 'var'");
+  static const ParserErrorCode WRONG_TERMINATOR_FOR_PARAMETER_GROUP = const ParserErrorCode('WRONG_TERMINATOR_FOR_PARAMETER_GROUP', "Expected '{0}' to close parameter group");
 
-  static const ParserErrorCode VAR_AS_TYPE_NAME = const ParserErrorCode.con3('VAR_AS_TYPE_NAME', 138, "The keyword 'var' cannot be used as a type name");
+  static const ParserErrorCode VAR_AND_TYPE = const ParserErrorCode('VAR_AND_TYPE', "Variables cannot be declared using both 'var' and a type name; remove the 'var'");
 
-  static const ParserErrorCode VAR_CLASS = const ParserErrorCode.con3('VAR_CLASS', 139, "Classes cannot be declared to be 'var'");
+  static const ParserErrorCode VAR_AS_TYPE_NAME = const ParserErrorCode('VAR_AS_TYPE_NAME', "The keyword 'var' cannot be used as a type name");
 
-  static const ParserErrorCode VAR_ENUM = const ParserErrorCode.con3('VAR_ENUM', 140, "Enums cannot be declared to be 'var'");
+  static const ParserErrorCode VAR_CLASS = const ParserErrorCode('VAR_CLASS', "Classes cannot be declared to be 'var'");
 
-  static const ParserErrorCode VAR_RETURN_TYPE = const ParserErrorCode.con3('VAR_RETURN_TYPE', 141, "The return type cannot be 'var'");
+  static const ParserErrorCode VAR_ENUM = const ParserErrorCode('VAR_ENUM', "Enums cannot be declared to be 'var'");
 
-  static const ParserErrorCode VAR_TYPEDEF = const ParserErrorCode.con3('VAR_TYPEDEF', 142, "Type aliases cannot be declared to be 'var'");
+  static const ParserErrorCode VAR_RETURN_TYPE = const ParserErrorCode('VAR_RETURN_TYPE', "The return type cannot be 'var'");
 
-  static const ParserErrorCode VOID_PARAMETER = const ParserErrorCode.con3('VOID_PARAMETER', 143, "Parameters cannot have a type of 'void'");
+  static const ParserErrorCode VAR_TYPEDEF = const ParserErrorCode('VAR_TYPEDEF', "Type aliases cannot be declared to be 'var'");
 
-  static const ParserErrorCode VOID_VARIABLE = const ParserErrorCode.con3('VOID_VARIABLE', 144, "Variables cannot have a type of 'void'");
+  static const ParserErrorCode VOID_PARAMETER = const ParserErrorCode('VOID_PARAMETER', "Parameters cannot have a type of 'void'");
 
-  static const List<ParserErrorCode> values = const [
-      ABSTRACT_CLASS_MEMBER,
-      ABSTRACT_ENUM,
-      ABSTRACT_STATIC_METHOD,
-      ABSTRACT_TOP_LEVEL_FUNCTION,
-      ABSTRACT_TOP_LEVEL_VARIABLE,
-      ABSTRACT_TYPEDEF,
-      ASSERT_DOES_NOT_TAKE_ASSIGNMENT,
-      ASSERT_DOES_NOT_TAKE_CASCADE,
-      ASSERT_DOES_NOT_TAKE_THROW,
-      ASSERT_DOES_NOT_TAKE_RETHROW,
-      BREAK_OUTSIDE_OF_LOOP,
-      CONST_AND_FINAL,
-      CONST_AND_VAR,
-      CONST_CLASS,
-      CONST_CONSTRUCTOR_WITH_BODY,
-      CONST_ENUM,
-      CONST_FACTORY,
-      CONST_METHOD,
-      CONST_TYPEDEF,
-      CONSTRUCTOR_WITH_RETURN_TYPE,
-      CONTINUE_OUTSIDE_OF_LOOP,
-      CONTINUE_WITHOUT_LABEL_IN_CASE,
-      DEFERRED_IMPORTS_NOT_SUPPORTED,
-      DEPRECATED_CLASS_TYPE_ALIAS,
-      DIRECTIVE_AFTER_DECLARATION,
-      DUPLICATE_LABEL_IN_SWITCH_STATEMENT,
-      DUPLICATED_MODIFIER,
-      EMPTY_ENUM_BODY,
-      EQUALITY_CANNOT_BE_EQUALITY_OPERAND,
-      EXPECTED_CASE_OR_DEFAULT,
-      EXPECTED_CLASS_MEMBER,
-      EXPECTED_EXECUTABLE,
-      EXPECTED_LIST_OR_MAP_LITERAL,
-      EXPECTED_STRING_LITERAL,
-      EXPECTED_TOKEN,
-      EXPECTED_TYPE_NAME,
-      EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE,
-      EXTERNAL_AFTER_CONST,
-      EXTERNAL_AFTER_FACTORY,
-      EXTERNAL_AFTER_STATIC,
-      EXTERNAL_CLASS,
-      EXTERNAL_CONSTRUCTOR_WITH_BODY,
-      EXTERNAL_ENUM,
-      EXTERNAL_FIELD,
-      EXTERNAL_GETTER_WITH_BODY,
-      EXTERNAL_METHOD_WITH_BODY,
-      EXTERNAL_OPERATOR_WITH_BODY,
-      EXTERNAL_SETTER_WITH_BODY,
-      EXTERNAL_TYPEDEF,
-      FACTORY_TOP_LEVEL_DECLARATION,
-      FACTORY_WITHOUT_BODY,
-      FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR,
-      FINAL_AND_VAR,
-      FINAL_CLASS,
-      FINAL_CONSTRUCTOR,
-      FINAL_ENUM,
-      FINAL_METHOD,
-      FINAL_TYPEDEF,
-      FUNCTION_TYPED_PARAMETER_VAR,
-      GETTER_IN_FUNCTION,
-      GETTER_WITH_PARAMETERS,
-      ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE,
-      IMPLEMENTS_BEFORE_EXTENDS,
-      IMPLEMENTS_BEFORE_WITH,
-      IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE,
-      INITIALIZED_VARIABLE_IN_FOR_EACH,
-      INVALID_AWAIT_IN_FOR,
-      INVALID_CODE_POINT,
-      INVALID_COMMENT_REFERENCE,
-      INVALID_HEX_ESCAPE,
-      INVALID_OPERATOR,
-      INVALID_OPERATOR_FOR_SUPER,
-      INVALID_STAR_AFTER_ASYNC,
-      INVALID_SYNC,
-      INVALID_UNICODE_ESCAPE,
-      LIBRARY_DIRECTIVE_NOT_FIRST,
-      LOCAL_FUNCTION_DECLARATION_MODIFIER,
-      MISSING_ASSIGNABLE_SELECTOR,
-      MISSING_CATCH_OR_FINALLY,
-      MISSING_CLASS_BODY,
-      MISSING_CLOSING_PARENTHESIS,
-      MISSING_CONST_FINAL_VAR_OR_TYPE,
-      MISSING_ENUM_BODY,
-      MISSING_EXPRESSION_IN_THROW,
-      MISSING_FUNCTION_BODY,
-      MISSING_FUNCTION_PARAMETERS,
-      MISSING_GET,
-      MISSING_IDENTIFIER,
-      MISSING_KEYWORD_OPERATOR,
-      MISSING_NAME_IN_LIBRARY_DIRECTIVE,
-      MISSING_NAME_IN_PART_OF_DIRECTIVE,
-      MISSING_PREFIX_IN_DEFERRED_IMPORT,
-      MISSING_STAR_AFTER_SYNC,
-      MISSING_STATEMENT,
-      MISSING_TERMINATOR_FOR_PARAMETER_GROUP,
-      MISSING_TYPEDEF_PARAMETERS,
-      MISSING_VARIABLE_IN_FOR_EACH,
-      MIXED_PARAMETER_GROUPS,
-      MULTIPLE_EXTENDS_CLAUSES,
-      MULTIPLE_IMPLEMENTS_CLAUSES,
-      MULTIPLE_LIBRARY_DIRECTIVES,
-      MULTIPLE_NAMED_PARAMETER_GROUPS,
-      MULTIPLE_PART_OF_DIRECTIVES,
-      MULTIPLE_POSITIONAL_PARAMETER_GROUPS,
-      MULTIPLE_VARIABLES_IN_FOR_EACH,
-      MULTIPLE_WITH_CLAUSES,
-      NAMED_FUNCTION_EXPRESSION,
-      NAMED_PARAMETER_OUTSIDE_GROUP,
-      NATIVE_CLAUSE_IN_NON_SDK_CODE,
-      NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE,
-      NON_CONSTRUCTOR_FACTORY,
-      NON_IDENTIFIER_LIBRARY_NAME,
-      NON_PART_OF_DIRECTIVE_IN_PART,
-      NON_USER_DEFINABLE_OPERATOR,
-      NORMAL_BEFORE_OPTIONAL_PARAMETERS,
-      POSITIONAL_AFTER_NAMED_ARGUMENT,
-      POSITIONAL_PARAMETER_OUTSIDE_GROUP,
-      REDIRECTION_IN_NON_FACTORY_CONSTRUCTOR,
-      SETTER_IN_FUNCTION,
-      STATIC_AFTER_CONST,
-      STATIC_AFTER_FINAL,
-      STATIC_AFTER_VAR,
-      STATIC_CONSTRUCTOR,
-      STATIC_GETTER_WITHOUT_BODY,
-      STATIC_OPERATOR,
-      STATIC_SETTER_WITHOUT_BODY,
-      STATIC_TOP_LEVEL_DECLARATION,
-      SWITCH_HAS_CASE_AFTER_DEFAULT_CASE,
-      SWITCH_HAS_MULTIPLE_DEFAULT_CASES,
-      TOP_LEVEL_OPERATOR,
-      UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP,
-      UNEXPECTED_TOKEN,
-      WITH_BEFORE_EXTENDS,
-      WITH_WITHOUT_EXTENDS,
-      WRONG_SEPARATOR_FOR_NAMED_PARAMETER,
-      WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER,
-      WRONG_TERMINATOR_FOR_PARAMETER_GROUP,
-      VAR_AND_TYPE,
-      VAR_AS_TYPE_NAME,
-      VAR_CLASS,
-      VAR_ENUM,
-      VAR_RETURN_TYPE,
-      VAR_TYPEDEF,
-      VOID_PARAMETER,
-      VOID_VARIABLE];
+  static const ParserErrorCode VOID_VARIABLE = const ParserErrorCode('VOID_VARIABLE', "Variables cannot have a type of 'void'");
 
   /**
-   * The severity of this error.
+   * Initialize a newly created error code to have the given [name]. The message
+   * associated with the error will be created from the given [message]
+   * template. The correction associated with the error will be created from the
+   * given [correction] template.
    */
-  final ErrorSeverity errorSeverity;
+  const ParserErrorCode(String name, String message, [String correction])
+      : super(name, message, correction);
 
-  /**
-   * The template used to create the message to be displayed for this error.
-   */
-  final String message;
-
-  /**
-   * The template used to create the correction to be displayed for this error, or `null` if
-   * there is no correction information for this error.
-   */
-  final String correction;
-
-  /**
-   * Initialize a newly created error code to have the given severity and message.
-   *
-   * @param errorSeverity the severity of the error
-   * @param message the message template used to create the message to be displayed for the error
-   */
-  const ParserErrorCode.con1(String name, int ordinal, ErrorSeverity errorSeverity, String message) : this.con2(name, ordinal, errorSeverity, message, null);
-
-  /**
-   * Initialize a newly created error code to have the given severity, message and correction.
-   *
-   * @param errorSeverity the severity of the error
-   * @param message the template used to create the message to be displayed for the error
-   * @param correction the template used to create the correction to be displayed for the error
-   */
-  const ParserErrorCode.con2(String name, int ordinal, this.errorSeverity, this.message, this.correction) : super(name, ordinal);
-
-  /**
-   * Initialize a newly created error code to have the given message and a severity of ERROR.
-   *
-   * @param message the message template used to create the message to be displayed for the error
-   */
-  const ParserErrorCode.con3(String name, int ordinal, String message) : this.con2(name, ordinal, ErrorSeverity.ERROR, message, null);
-
-  /**
-   * Initialize a newly created error code to have the given message and a severity of ERROR.
-   *
-   * @param message the message template used to create the message to be displayed for the error
-   * @param correction the template used to create the correction to be displayed for the error
-   */
-  const ParserErrorCode.con4(String name, int ordinal, String message, String correction) : this.con2(name, ordinal, ErrorSeverity.ERROR, message, correction);
+  @override
+  ErrorSeverity get errorSeverity => ErrorSeverity.ERROR;
 
   @override
   ErrorType get type => ErrorType.SYNTACTIC_ERROR;
-
-  @override
-  String get uniqueName => "$runtimeType.$name";
 }
 
 /**
diff --git a/pkg/analyzer/lib/src/generated/resolver.dart b/pkg/analyzer/lib/src/generated/resolver.dart
index aeaa972..cc92baf 100644
--- a/pkg/analyzer/lib/src/generated/resolver.dart
+++ b/pkg/analyzer/lib/src/generated/resolver.dart
@@ -381,7 +381,7 @@
     // selector
     AngularSelectorElement selector = null;
     if (!_hasStringArgument(_SELECTOR)) {
-      _reportErrorForAnnotation(AngularCode.MISSING_SELECTOR, []);
+      _reportErrorForAnnotation(AngularCode.MISSING_SELECTOR);
       isValid = false;
     } else {
       SimpleStringLiteral selectorLiteral = _getStringLiteral(_SELECTOR);
@@ -478,7 +478,7 @@
     }
     // prepare map literal
     if (mapExpression is! MapLiteral) {
-      _reportErrorForNode(AngularCode.INVALID_PROPERTY_MAP, mapExpression, []);
+      _reportErrorForNode(AngularCode.INVALID_PROPERTY_MAP, mapExpression);
       return;
     }
     MapLiteral mapLiteral = mapExpression as MapLiteral;
@@ -487,7 +487,7 @@
       // prepare property name
       Expression nameExpression = entry.key;
       if (nameExpression is! SimpleStringLiteral) {
-        _reportErrorForNode(AngularCode.INVALID_PROPERTY_NAME, nameExpression, []);
+        _reportErrorForNode(AngularCode.INVALID_PROPERTY_NAME, nameExpression);
         continue;
       }
       SimpleStringLiteral nameLiteral = nameExpression as SimpleStringLiteral;
@@ -496,7 +496,7 @@
       // prepare field specification
       Expression specExpression = entry.value;
       if (specExpression is! SimpleStringLiteral) {
-        _reportErrorForNode(AngularCode.INVALID_PROPERTY_SPEC, specExpression, []);
+        _reportErrorForNode(AngularCode.INVALID_PROPERTY_SPEC, specExpression);
         continue;
       }
       SimpleStringLiteral specLiteral = specExpression as SimpleStringLiteral;
@@ -545,13 +545,13 @@
     bool isValid = true;
     // publishAs
     if (!_hasStringArgument(_PUBLISH_AS)) {
-      _reportErrorForAnnotation(AngularCode.MISSING_PUBLISH_AS, []);
+      _reportErrorForAnnotation(AngularCode.MISSING_PUBLISH_AS);
       isValid = false;
     }
     // selector
     AngularSelectorElement selector = null;
     if (!_hasStringArgument(_SELECTOR)) {
-      _reportErrorForAnnotation(AngularCode.MISSING_SELECTOR, []);
+      _reportErrorForAnnotation(AngularCode.MISSING_SELECTOR);
       isValid = false;
     } else {
       SimpleStringLiteral selectorLiteral = _getStringLiteral(_SELECTOR);
@@ -576,7 +576,7 @@
     // selector
     AngularSelectorElement selector = null;
     if (!_hasStringArgument(_SELECTOR)) {
-      _reportErrorForAnnotation(AngularCode.MISSING_SELECTOR, []);
+      _reportErrorForAnnotation(AngularCode.MISSING_SELECTOR);
       isValid = false;
     } else {
       SimpleStringLiteral selectorLiteral = _getStringLiteral(_SELECTOR);
@@ -600,7 +600,7 @@
     bool isValid = true;
     // name
     if (!_hasStringArgument(_NAME)) {
-      _reportErrorForAnnotation(AngularCode.MISSING_NAME, []);
+      _reportErrorForAnnotation(AngularCode.MISSING_NAME);
       isValid = false;
     }
     // create
@@ -630,22 +630,22 @@
     }
   }
 
-  void _reportErrorForAnnotation(ErrorCode errorCode, List<Object> arguments) {
+  void _reportErrorForAnnotation(ErrorCode errorCode, [List<Object> arguments]) {
     _reportErrorForNode(errorCode, _annotation, arguments);
   }
 
-  void _reportErrorForArgument(String argumentName, ErrorCode errorCode, List<Object> arguments) {
+  void _reportErrorForArgument(String argumentName, ErrorCode errorCode, [List<Object> arguments]) {
     Expression argument = _getArgument(argumentName);
     _reportErrorForNode(errorCode, argument, arguments);
   }
 
-  void _reportErrorForNode(ErrorCode errorCode, AstNode node, List<Object> arguments) {
+  void _reportErrorForNode(ErrorCode errorCode, AstNode node, [List<Object> arguments]) {
     int offset = node.offset;
     int length = node.length;
     _reportErrorForOffset(errorCode, offset, length, arguments);
   }
 
-  void _reportErrorForOffset(ErrorCode errorCode, int offset, int length, List<Object> arguments) {
+  void _reportErrorForOffset(ErrorCode errorCode, int offset, int length, [List<Object> arguments]) {
     _errorListener.onError(new AnalysisError.con2(_source, offset, length, errorCode, arguments));
   }
 }
@@ -834,10 +834,9 @@
    *
    * @param node the is expression to check
    * @return `true` if and only if a hint code is generated on the passed node
-   * @see HintCode#TYPE_CHECK_IS_NOT_NULL
-   * @see HintCode#TYPE_CHECK_IS_NULL
-   * @see HintCode#UNNECESSARY_TYPE_CHECK_TRUE
-   * @see HintCode#UNNECESSARY_TYPE_CHECK_FALSE
+   * See [HintCode.TYPE_CHECK_IS_NOT_NULL], [HintCode.TYPE_CHECK_IS_NULL],
+   * [HintCode.UNNECESSARY_TYPE_CHECK_TRUE], and
+   * [HintCode.UNNECESSARY_TYPE_CHECK_FALSE].
    */
   bool _checkAllTypeChecks(IsExpression node) {
     Expression expression = node.expression;
@@ -852,10 +851,10 @@
     if (rhsType.isDynamic && rhsNameStr == sc.Keyword.DYNAMIC.syntax) {
       if (node.notOperator == null) {
         // the is case
-        _errorReporter.reportErrorForNode(HintCode.UNNECESSARY_TYPE_CHECK_TRUE, node, []);
+        _errorReporter.reportErrorForNode(HintCode.UNNECESSARY_TYPE_CHECK_TRUE, node);
       } else {
         // the is not case
-        _errorReporter.reportErrorForNode(HintCode.UNNECESSARY_TYPE_CHECK_FALSE, node, []);
+        _errorReporter.reportErrorForNode(HintCode.UNNECESSARY_TYPE_CHECK_FALSE, node);
       }
       return true;
     }
@@ -866,19 +865,19 @@
       if (rhsType.isObject || (expression is NullLiteral && rhsNameStr == _NULL_TYPE_NAME)) {
         if (node.notOperator == null) {
           // the is case
-          _errorReporter.reportErrorForNode(HintCode.UNNECESSARY_TYPE_CHECK_TRUE, node, []);
+          _errorReporter.reportErrorForNode(HintCode.UNNECESSARY_TYPE_CHECK_TRUE, node);
         } else {
           // the is not case
-          _errorReporter.reportErrorForNode(HintCode.UNNECESSARY_TYPE_CHECK_FALSE, node, []);
+          _errorReporter.reportErrorForNode(HintCode.UNNECESSARY_TYPE_CHECK_FALSE, node);
         }
         return true;
       } else if (rhsNameStr == _NULL_TYPE_NAME) {
         if (node.notOperator == null) {
           // the is case
-          _errorReporter.reportErrorForNode(HintCode.TYPE_CHECK_IS_NULL, node, []);
+          _errorReporter.reportErrorForNode(HintCode.TYPE_CHECK_IS_NULL, node);
         } else {
           // the is not case
-          _errorReporter.reportErrorForNode(HintCode.TYPE_CHECK_IS_NOT_NULL, node, []);
+          _errorReporter.reportErrorForNode(HintCode.TYPE_CHECK_IS_NOT_NULL, node);
         }
         return true;
       }
@@ -901,7 +900,7 @@
    *          `null`
    * @param actualPropagatedType the expected propagated type of the parameter, may be `null`
    * @return `true` if and only if an hint code is generated on the passed node
-   * @see HintCode#ARGUMENT_TYPE_NOT_ASSIGNABLE
+   * See [HintCode.ARGUMENT_TYPE_NOT_ASSIGNABLE].
    */
   bool _checkForArgumentTypeNotAssignable(Expression expression, DartType expectedStaticType, DartType actualStaticType, DartType expectedPropagatedType, DartType actualPropagatedType, ErrorCode hintCode) {
     //
@@ -936,7 +935,7 @@
    *
    * @param argument the argument to evaluate
    * @return `true` if and only if an hint code is generated on the passed node
-   * @see HintCode#ARGUMENT_TYPE_NOT_ASSIGNABLE
+   * See [HintCode.ARGUMENT_TYPE_NOT_ASSIGNABLE].
    */
   bool _checkForArgumentTypeNotAssignableForArgument(Expression argument) {
     if (argument == null) {
@@ -958,7 +957,7 @@
    * @param expectedStaticType the expected static type
    * @param expectedPropagatedType the expected propagated type, may be `null`
    * @return `true` if and only if an hint code is generated on the passed node
-   * @see HintCode#ARGUMENT_TYPE_NOT_ASSIGNABLE
+   * See [HintCode.ARGUMENT_TYPE_NOT_ASSIGNABLE].
    */
   bool _checkForArgumentTypeNotAssignableWithExpectedTypes(Expression expression, DartType expectedStaticType, DartType expectedPropagatedType, ErrorCode errorCode) => _checkForArgumentTypeNotAssignable(expression, expectedStaticType, expression.staticType, expectedPropagatedType, expression.propagatedType, errorCode);
 
@@ -969,7 +968,7 @@
    *
    * @param node the arguments to evaluate
    * @return `true` if and only if an hint code is generated on the passed node
-   * @see HintCode#ARGUMENT_TYPE_NOT_ASSIGNABLE
+   * See [HintCode.ARGUMENT_TYPE_NOT_ASSIGNABLE].
    */
   bool _checkForArgumentTypesNotAssignableInList(ArgumentList argumentList) {
     if (argumentList == null) {
@@ -991,7 +990,7 @@
    * @param element some element to check for deprecated use of
    * @param node the node use for the location of the error
    * @return `true` if and only if a hint code is generated on the passed node
-   * @see HintCode#DEPRECATED_MEMBER_USE
+   * See [HintCode.DEPRECATED_MEMBER_USE].
    */
   bool _checkForDeprecatedMemberUse(Element element, AstNode node) {
     if (element != null && element.isDeprecated) {
@@ -1023,7 +1022,7 @@
    *
    * @param identifier some simple identifier to check for deprecated use of
    * @return `true` if and only if a hint code is generated on the passed node
-   * @see HintCode#DEPRECATED_MEMBER_USE
+   * See [HintCode.DEPRECATED_MEMBER_USE].
    */
   bool _checkForDeprecatedMemberUseAtIdentifier(SimpleIdentifier identifier) {
     if (identifier.inDeclarationContext()) {
@@ -1037,11 +1036,11 @@
   }
 
   /**
-   * Check for the passed binary expression for the [HintCode#DIVISION_OPTIMIZATION].
+   * Check for the passed binary expression for the [HintCode.DIVISION_OPTIMIZATION].
    *
    * @param node the binary expression to check
    * @return `true` if and only if a hint code is generated on the passed node
-   * @see HintCode#DIVISION_OPTIMIZATION
+   * See [HintCode.DIVISION_OPTIMIZATION].
    */
   bool _checkForDivisionOptimizationHint(BinaryExpression node) {
     // Return if the operator is not '/'
@@ -1063,7 +1062,7 @@
       if (parenthesizedExpression.parent is MethodInvocation) {
         MethodInvocation methodInvocation = parenthesizedExpression.parent as MethodInvocation;
         if (_TO_INT_METHOD_NAME == methodInvocation.methodName.name && methodInvocation.argumentList.arguments.isEmpty) {
-          _errorReporter.reportErrorForNode(HintCode.DIVISION_OPTIMIZATION, methodInvocation, []);
+          _errorReporter.reportErrorForNode(HintCode.DIVISION_OPTIMIZATION, methodInvocation);
           return true;
         }
       }
@@ -1079,7 +1078,7 @@
    * @param lhs the left hand side expression
    * @param rhs the right hand side expression
    * @return `true` if and only if an error code is generated on the passed node
-   * @see HintCode#INVALID_ASSIGNMENT
+   * See [HintCode.INVALID_ASSIGNMENT].
    */
   bool _checkForInvalidAssignment(Expression lhs, Expression rhs) {
     if (lhs == null || rhs == null) {
@@ -1110,7 +1109,7 @@
    * @param node the import directive to evaluate
    * @param importElement the [ImportElement] retrieved from the node
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION
+   * See [CompileTimeErrorCode.IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION].
    */
   bool _checkForLoadLibraryFunction(ImportDirective node, ImportElement importElement) {
     LibraryElement importedLibrary = importElement.importedLibrary;
@@ -1132,7 +1131,7 @@
    * @param node the binary expression to check
    * @param body the function body
    * @return `true` if and only if a hint code is generated on the passed node
-   * @see HintCode#MISSING_RETURN
+   * See [HintCode.MISSING_RETURN].
    */
   bool _checkForMissingReturn(TypeName returnType, FunctionBody body) {
     // Check that the method or function has a return type, and a function body
@@ -1159,11 +1158,11 @@
 
   /**
    * Check for the passed class declaration for the
-   * [HintCode#OVERRIDE_EQUALS_BUT_NOT_HASH_CODE] hint code.
+   * [HintCode.OVERRIDE_EQUALS_BUT_NOT_HASH_CODE] hint code.
    *
    * @param node the class declaration to check
    * @return `true` if and only if a hint code is generated on the passed node
-   * @see HintCode#OVERRIDE_EQUALS_BUT_NOT_HASH_CODE
+   * See [HintCode.OVERRIDE_EQUALS_BUT_NOT_HASH_CODE].
    */
   bool _checkForOverrideEqualsButNotHashCode(ClassDeclaration node) {
     ClassElement classElement = node.element;
@@ -1182,11 +1181,11 @@
   }
 
   /**
-   * Check for the passed as expression for the [HintCode#UNNECESSARY_CAST] hint code.
+   * Check for the passed as expression for the [HintCode.UNNECESSARY_CAST] hint code.
    *
    * @param node the as expression to check
    * @return `true` if and only if a hint code is generated on the passed node
-   * @see HintCode#UNNECESSARY_CAST
+   * See [HintCode.UNNECESSARY_CAST].
    */
   bool _checkForUnnecessaryCast(AsExpression node) {
     Expression expression = node.expression;
@@ -1196,7 +1195,7 @@
     // TODO(jwren) After dartbug.com/13732, revisit this, we should be able to remove the
     // !(x instanceof TypeParameterType) checks.
     if (lhsType != null && rhsType != null && !lhsType.isDynamic && !rhsType.isDynamic && lhsType is! TypeParameterType && rhsType is! TypeParameterType && lhsType.isMoreSpecificThan(rhsType)) {
-      _errorReporter.reportErrorForNode(HintCode.UNNECESSARY_CAST, node, []);
+      _errorReporter.reportErrorForNode(HintCode.UNNECESSARY_CAST, node);
       return true;
     }
     return false;
@@ -1211,7 +1210,7 @@
    *
    * @param node expression on the RHS of some assignment
    * @return `true` if and only if a hint code is generated on the passed node
-   * @see HintCode#USE_OF_VOID_RESULT
+   * See [HintCode.USE_OF_VOID_RESULT].
    */
   bool _checkForUseOfVoidResult(Expression expression) {
     if (expression == null || expression is! MethodInvocation) {
@@ -1369,13 +1368,13 @@
       ConstructorElement constructorElement = element;
       // should 'const' constructor
       if (!constructorElement.isConst) {
-        _errorReporter.reportErrorForNode(CompileTimeErrorCode.NON_CONSTANT_ANNOTATION_CONSTRUCTOR, node, []);
+        _errorReporter.reportErrorForNode(CompileTimeErrorCode.NON_CONSTANT_ANNOTATION_CONSTRUCTOR, node);
         return null;
       }
       // should have arguments
       ArgumentList argumentList = node.arguments;
       if (argumentList == null) {
-        _errorReporter.reportErrorForNode(CompileTimeErrorCode.NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS, node, []);
+        _errorReporter.reportErrorForNode(CompileTimeErrorCode.NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS, node);
         return null;
       }
       // arguments should be constants
@@ -1475,7 +1474,7 @@
     }
     if (reportEqualKeys) {
       for (Expression key in invalidKeys) {
-        _errorReporter.reportErrorForNode(StaticWarningCode.EQUAL_KEYS_IN_MAP, key, []);
+        _errorReporter.reportErrorForNode(StaticWarningCode.EQUAL_KEYS_IN_MAP, key);
       }
     }
     return null;
@@ -1552,7 +1551,7 @@
    * @param node the switch statement to evaluate
    * @param type the common type of all 'case' expressions
    * @return `true` if and only if an error code is generated on the passed node
-   * @see CompileTimeErrorCode#CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS
+   * See [CompileTimeErrorCode.CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS].
    */
   bool _checkForCaseExpressionTypeImplementsEquals(SwitchStatement node, DartType type) {
     if (!_implementsEqualsWhenNotAllowed(type)) {
@@ -1601,7 +1600,7 @@
     DeferredLibraryReferenceDetector referenceDetector = new DeferredLibraryReferenceDetector();
     expression.accept(referenceDetector);
     if (referenceDetector.result) {
-      _errorReporter.reportErrorForNode(errorCode, expression, []);
+      _errorReporter.reportErrorForNode(errorCode, expression);
     }
   }
 
@@ -1626,7 +1625,7 @@
           identical(dataErrorCode, CheckedModeCompileTimeErrorCode.VARIABLE_TYPE_MISMATCH)) {
         _errorReporter.reportError(data);
       } else if (errorCode != null) {
-        _errorReporter.reportError(new AnalysisError.con2(data.source, data.offset, data.length, errorCode, []));
+        _errorReporter.reportError(new AnalysisError.con2(data.source, data.offset, data.length, errorCode));
       }
     }
   }
@@ -1700,14 +1699,19 @@
       if (parameter is DefaultFormalParameter) {
         DefaultFormalParameter defaultParameter = parameter;
         Expression defaultValue = defaultParameter.defaultValue;
-        if (defaultValue != null) {
-          DartObjectImpl result = _validate(defaultValue, CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE);
-          VariableElementImpl element = parameter.element as VariableElementImpl;
-          element.evaluationResult = new EvaluationResultImpl.con1(result);
+        DartObjectImpl result;
+        if (defaultValue == null) {
+          result = new DartObjectImpl(_typeProvider.nullType,
+              NullState.NULL_STATE);
+        } else {
+          result = _validate(defaultValue,
+              CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE);
           if (result != null) {
             _reportErrorIfFromDeferredLibrary(defaultValue, CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED_LIBRARY);
           }
         }
+        VariableElementImpl element = parameter.element as VariableElementImpl;
+        element.evaluationResult = new EvaluationResultImpl.con1(result);
       }
     }
   }
@@ -1838,7 +1842,7 @@
 
 /**
  * Instances of the class `Dart2JSVerifier` traverse an AST structure looking for hints for
- * code that will be compiled to JS, such as [HintCode#IS_DOUBLE].
+ * code that will be compiled to JS, such as [HintCode.IS_DOUBLE].
  */
 class Dart2JSVerifier extends RecursiveAstVisitor<Object> {
   /**
@@ -1870,10 +1874,10 @@
    *
    * @param node the is expression to check
    * @return `true` if and only if a hint code is generated on the passed node
-   * @see HintCode#IS_DOUBLE
-   * @see HintCode#IS_INT
-   * @see HintCode#IS_NOT_DOUBLE
-   * @see HintCode#IS_NOT_INT
+   * See [HintCode.IS_DOUBLE],
+   * [HintCode.IS_INT],
+   * [HintCode.IS_NOT_DOUBLE], and
+   * [HintCode.IS_NOT_INT].
    */
   bool _checkForIsDoubleHints(IsExpression node) {
     TypeName typeName = node.type;
@@ -1893,9 +1897,9 @@
       //      } else
       if (typeNameStr == _DOUBLE_TYPE_NAME && libraryElement != null && libraryElement.isDartCore) {
         if (node.notOperator == null) {
-          _errorReporter.reportErrorForNode(HintCode.IS_DOUBLE, node, []);
+          _errorReporter.reportErrorForNode(HintCode.IS_DOUBLE, node);
         } else {
-          _errorReporter.reportErrorForNode(HintCode.IS_NOT_DOUBLE, node, []);
+          _errorReporter.reportErrorForNode(HintCode.IS_NOT_DOUBLE, node);
         }
         return true;
       }
@@ -1905,8 +1909,46 @@
 }
 
 /**
+ * Instances of the class [UnusedElementVerifier] traverse an element
+ * structure looking for cases of [HintCode.UNUSED_ELEMENT] and
+ * [HintCode.UNUSED_LOCAL_VARIABLE].
+ */
+class UnusedElementVerifier extends RecursiveElementVisitor {
+  /**
+   * The error reporter by which errors will be reported.
+   */
+  final ErrorReporter _errorReporter;
+
+  /**
+   * Create a new instance of the [UnusedElementVerifier].
+   */
+  UnusedElementVerifier(this._errorReporter);
+
+  @override
+  visitClassElement(ClassElement element) {
+    if (element is ClassElementImpl && !element.isUsed) {
+      _errorReporter.reportErrorForElement(
+          HintCode.UNUSED_ELEMENT,
+          element,
+          [element.kind.displayName, element.displayName]);
+    }
+    element.visitChildren(this);
+  }
+
+  @override
+  visitLocalVariableElement(LocalVariableElement element) {
+    if (element is LocalVariableElementImpl && !element.isUsed) {
+      _errorReporter.reportErrorForElement(
+          HintCode.UNUSED_LOCAL_VARIABLE,
+          element,
+          [element.displayName]);
+    }
+  }
+}
+
+/**
  * Instances of the class `DeadCodeVerifier` traverse an AST structure looking for cases of
- * [HintCode#DEAD_CODE].
+ * [HintCode.DEAD_CODE].
  */
 class DeadCodeVerifier extends RecursiveAstVisitor<Object> {
   /**
@@ -1933,13 +1975,13 @@
         if (lhsResult != null) {
           if (lhsResult.value.isTrue && isBarBar) {
             // report error on else block: true || !e!
-            _errorReporter.reportErrorForNode(HintCode.DEAD_CODE, node.rightOperand, []);
+            _errorReporter.reportErrorForNode(HintCode.DEAD_CODE, node.rightOperand);
             // only visit the LHS:
             _safelyVisit(lhsCondition);
             return null;
           } else if (lhsResult.value.isFalse && isAmpAmp) {
             // report error on if block: false && !e!
-            _errorReporter.reportErrorForNode(HintCode.DEAD_CODE, node.rightOperand, []);
+            _errorReporter.reportErrorForNode(HintCode.DEAD_CODE, node.rightOperand);
             // only visit the LHS:
             _safelyVisit(lhsCondition);
             return null;
@@ -1990,12 +2032,12 @@
       if (result != null) {
         if (result.value.isTrue) {
           // report error on else block: true ? 1 : !2!
-          _errorReporter.reportErrorForNode(HintCode.DEAD_CODE, node.elseExpression, []);
+          _errorReporter.reportErrorForNode(HintCode.DEAD_CODE, node.elseExpression);
           _safelyVisit(node.thenExpression);
           return null;
         } else {
           // report error on if block: false ? !1! : 2
-          _errorReporter.reportErrorForNode(HintCode.DEAD_CODE, node.thenExpression, []);
+          _errorReporter.reportErrorForNode(HintCode.DEAD_CODE, node.thenExpression);
           _safelyVisit(node.elseExpression);
           return null;
         }
@@ -2015,13 +2057,13 @@
           // report error on else block: if(true) {} else {!}
           Statement elseStatement = node.elseStatement;
           if (elseStatement != null) {
-            _errorReporter.reportErrorForNode(HintCode.DEAD_CODE, elseStatement, []);
+            _errorReporter.reportErrorForNode(HintCode.DEAD_CODE, elseStatement);
             _safelyVisit(node.thenStatement);
             return null;
           }
         } else {
           // report error on if block: if (false) {!} else {}
-          _errorReporter.reportErrorForNode(HintCode.DEAD_CODE, node.thenStatement, []);
+          _errorReporter.reportErrorForNode(HintCode.DEAD_CODE, node.thenStatement);
           _safelyVisit(node.elseStatement);
           return null;
         }
@@ -2068,7 +2110,7 @@
               CatchClause lastCatchClause = catchClauses[numOfCatchClauses - 1];
               int offset = nextCatchClause.offset;
               int length = lastCatchClause.end - offset;
-              _errorReporter.reportErrorForOffset(HintCode.DEAD_CODE_CATCH_FOLLOWING_CATCH, offset, length, []);
+              _errorReporter.reportErrorForOffset(HintCode.DEAD_CODE_CATCH_FOLLOWING_CATCH, offset, length);
               return null;
             }
           }
@@ -2094,7 +2136,7 @@
           CatchClause lastCatchClause = catchClauses[numOfCatchClauses - 1];
           int offset = nextCatchClause.offset;
           int length = lastCatchClause.end - offset;
-          _errorReporter.reportErrorForOffset(HintCode.DEAD_CODE_CATCH_FOLLOWING_CATCH, offset, length, []);
+          _errorReporter.reportErrorForOffset(HintCode.DEAD_CODE_CATCH_FOLLOWING_CATCH, offset, length);
           return null;
         }
       }
@@ -2111,7 +2153,7 @@
       if (result != null) {
         if (result.value.isFalse) {
           // report error on if block: while (false) {!}
-          _errorReporter.reportErrorForNode(HintCode.DEAD_CODE, node.body, []);
+          _errorReporter.reportErrorForNode(HintCode.DEAD_CODE, node.body);
           return null;
         }
       }
@@ -2138,19 +2180,19 @@
         Statement lastStatement = statements[size - 1];
         int offset = nextStatement.offset;
         int length = lastStatement.end - offset;
-        _errorReporter.reportErrorForOffset(HintCode.DEAD_CODE, offset, length, []);
+        _errorReporter.reportErrorForOffset(HintCode.DEAD_CODE, offset, length);
         return;
       }
     }
   }
 
   /**
-   * Given some [Expression], this method returns [ValidResult#RESULT_TRUE] if it is
-   * `true`, [ValidResult#RESULT_FALSE] if it is `false`, or `null` if the
+   * Given some [Expression], this method returns [ValidResult.RESULT_TRUE] if it is
+   * `true`, [ValidResult.RESULT_FALSE] if it is `false`, or `null` if the
    * expression is not a constant boolean value.
    *
    * @param expression the expression to evaluate
-   * @return [ValidResult#RESULT_TRUE] if it is `true`, [ValidResult#RESULT_FALSE]
+   * @return [ValidResult.RESULT_TRUE] if it is `true`, [ValidResult.RESULT_FALSE]
    *         if it is `false`, or `null` if the expression is not a constant boolean
    *         value
    */
@@ -2162,25 +2204,16 @@
         return new EvaluationResultImpl.con1(new DartObjectImpl(null, BoolState.from(false)));
       }
     }
-    // Don't consider situations where we could evaluate to a constant boolean expression with the
-    // ConstantVisitor
-//
+    // Don't consider situations where we could evaluate to a constant boolean
+    // expression with the ConstantVisitor
        // else {
-//
          // EvaluationResultImpl result = expression.accept(new ConstantVisitor());
-//
          // if (result == ValidResult.RESULT_TRUE) {
-//
            // return ValidResult.RESULT_TRUE;
-//
          // } else if (result == ValidResult.RESULT_FALSE) {
-//
            // return ValidResult.RESULT_FALSE;
-//
          // }
-//
          // return null;
-//
        // }
     return null;
   }
@@ -3469,9 +3502,14 @@
   Object visitCatchClause(CatchClause node) {
     SimpleIdentifier exceptionParameter = node.exceptionParameter;
     if (exceptionParameter != null) {
+      // exception
       LocalVariableElementImpl exception = new LocalVariableElementImpl.forNode(exceptionParameter);
       _currentHolder.addLocalVariable(exception);
       exceptionParameter.staticElement = exception;
+      // we cannot catch an exception without declaring a variable,
+      // so the exception variable is always used
+      exception.markUsed();
+      // stack trace
       SimpleIdentifier stackTraceParameter = node.stackTraceParameter;
       if (stackTraceParameter != null) {
         LocalVariableElementImpl stackTrace = new LocalVariableElementImpl.forNode(stackTraceParameter);
@@ -5258,12 +5296,6 @@
     }
     _parametersDefined = true;
     Scope parameterScope = enclosingScope;
-    if (_functionElement.enclosingElement is ExecutableElement) {
-      String name = _functionElement.name;
-      if (name != null && !name.isEmpty) {
-        parameterScope.define(_functionElement);
-      }
-    }
     for (ParameterElement parameter in _functionElement.parameters) {
       if (!parameter.isInitializingFormal) {
         parameterScope.define(parameter);
@@ -5336,7 +5368,7 @@
  * Instances of the class `HintGenerator` traverse a library's worth of dart code at a time to
  * generate hints over the set of sources.
  *
- * @see HintCode
+ * See [HintCode].
  */
 class HintGenerator {
   final List<CompilationUnit> _compilationUnits;
@@ -5389,6 +5421,7 @@
     unit.accept(_importsVerifier);
     // dead code analysis
     unit.accept(new DeadCodeVerifier(errorReporter));
+    unit.element.accept(new UnusedElementVerifier(errorReporter));
     // dart2js analysis
     if (_enableDart2JSHints) {
       unit.accept(new Dart2JSVerifier(errorReporter));
@@ -5719,10 +5752,15 @@
           List<ConstructorElement> implicitConstructors = new List<ConstructorElement>();
           for (int i = 0; i < count; i++) {
             ConstructorElement explicitConstructor = constructors[i];
-            if (!explicitConstructor.isFactory) {
+            if (!explicitConstructor.isFactory &&
+                classElement.isSuperConstructorAccessible(explicitConstructor)) {
               implicitConstructors.add(_createImplicitContructor(classType, explicitConstructor, parameterTypes, argumentTypes));
             }
           }
+          if (implicitConstructors.isEmpty) {
+            reportErrorForNode(CompileTimeErrorCode.MIXIN_HAS_NO_CONSTRUCTORS,
+                node, [superclassElement.name]);
+          }
           classElement.constructors = implicitConstructors;
         }
       }
@@ -5810,7 +5848,7 @@
 /**
  * Instances of the class `ImportsVerifier` visit all of the referenced libraries in the
  * source code verifying that all of the imports are used, otherwise a
- * [HintCode#UNUSED_IMPORT] is generated with
+ * [HintCode.UNUSED_IMPORT] is generated with
  * [generateUnusedImportHints].
  *
  * While this class does not yet have support for an "Organize Imports" action, this logic built up
@@ -5835,7 +5873,7 @@
    * [ImportDirective] is removed from this list. After all the sources in the library have
    * been evaluated, this list represents the set of unused imports.
    *
-   * @see ImportsVerifier#generateUnusedImportErrors(ErrorReporter)
+   * See [ImportsVerifier.generateUnusedImportErrors].
    */
   List<ImportDirective> _unusedImports;
 
@@ -5894,24 +5932,24 @@
 
   /**
    * Any time after the defining compilation unit has been visited by this visitor, this method can
-   * be called to report an [HintCode#DUPLICATE_IMPORT] hint for each of the import directives
+   * be called to report an [HintCode.DUPLICATE_IMPORT] hint for each of the import directives
    * in the [duplicateImports] list.
    *
-   * @param errorReporter the error reporter to report the set of [HintCode#DUPLICATE_IMPORT]
+   * @param errorReporter the error reporter to report the set of [HintCode.DUPLICATE_IMPORT]
    *          hints to
    */
   void generateDuplicateImportHints(ErrorReporter errorReporter) {
     for (ImportDirective duplicateImport in _duplicateImports) {
-      errorReporter.reportErrorForNode(HintCode.DUPLICATE_IMPORT, duplicateImport.uri, []);
+      errorReporter.reportErrorForNode(HintCode.DUPLICATE_IMPORT, duplicateImport.uri);
     }
   }
 
   /**
    * After all of the compilation units have been visited by this visitor, this method can be called
-   * to report an [HintCode#UNUSED_IMPORT] hint for each of the import directives in the
+   * to report an [HintCode.UNUSED_IMPORT] hint for each of the import directives in the
    * [unusedImports] list.
    *
-   * @param errorReporter the error reporter to report the set of [HintCode#UNUSED_IMPORT]
+   * @param errorReporter the error reporter to report the set of [HintCode.UNUSED_IMPORT]
    *          hints to
    */
   void generateUnusedImportHints(ErrorReporter errorReporter) {
@@ -5924,7 +5962,7 @@
           continue;
         }
       }
-      errorReporter.reportErrorForNode(HintCode.UNUSED_IMPORT, unusedImport.uri, []);
+      errorReporter.reportErrorForNode(HintCode.UNUSED_IMPORT, unusedImport.uri);
     }
   }
 
@@ -6230,7 +6268,7 @@
   /**
    * Return `true` if the given node can be resolved independently of any other nodes.
    *
-   * <b>Note:</b> This method needs to be kept in sync with [ScopeBuilder#scopeForAstNode].
+   * <b>Note:</b> This method needs to be kept in sync with [ScopeBuilder.scopeForAstNode].
    *
    * @param node the node being tested
    * @return `true` if the given node can be resolved independently of any other nodes
@@ -6432,7 +6470,7 @@
   /**
    * Given some [ExecutableElement] return the number of positional parameters.
    *
-   * Note: by positional we mean [ParameterKind#REQUIRED] or [ParameterKind#POSITIONAL].
+   * Note: by positional we mean [ParameterKind.REQUIRED] or [ParameterKind.POSITIONAL].
    */
   static int _getNumOfPositionalParameters(ExecutableElement executableElement) => _getNumOfParameters(executableElement, ParameterKind.REQUIRED) + _getNumOfParameters(executableElement, ParameterKind.POSITIONAL);
 
@@ -7008,7 +7046,7 @@
 
   /**
    * This method is used to report errors on when they are found computing inheritance information.
-   * See [ErrorVerifier#checkForInconsistentMethodInheritance] to see where these generated
+   * See [ErrorVerifier.checkForInconsistentMethodInheritance] to see where these generated
    * error codes are reported back into the analysis engine.
    *
    * @param classElt the location of the source for which the exception occurred
@@ -7524,7 +7562,7 @@
   Source getSource(UriBasedDirective directive) {
     StringLiteral uriLiteral = directive.uri;
     if (uriLiteral is StringInterpolation) {
-      _errorListener.onError(new AnalysisError.con2(librarySource, uriLiteral.offset, uriLiteral.length, CompileTimeErrorCode.URI_WITH_INTERPOLATION, []));
+      _errorListener.onError(new AnalysisError.con2(librarySource, uriLiteral.offset, uriLiteral.length, CompileTimeErrorCode.URI_WITH_INTERPOLATION));
       return null;
     }
     String uriContent = uriLiteral.stringValue.trim();
@@ -7687,7 +7725,7 @@
       }
     }
     if (hasPartDirective && libraryNameNode == null) {
-      _errorListener.onError(new AnalysisError.con1(librarySource, ResolverErrorCode.MISSING_LIBRARY_DIRECTIVE_WITH_PART, []));
+      _errorListener.onError(new AnalysisError.con1(librarySource, ResolverErrorCode.MISSING_LIBRARY_DIRECTIVE_WITH_PART));
     }
     //
     // Create and populate the library element.
@@ -7775,7 +7813,7 @@
       }
     }
     if (hasPartDirective && libraryNameNode == null) {
-      _errorListener.onError(new AnalysisError.con1(librarySource, ResolverErrorCode.MISSING_LIBRARY_DIRECTIVE_WITH_PART, []));
+      _errorListener.onError(new AnalysisError.con1(librarySource, ResolverErrorCode.MISSING_LIBRARY_DIRECTIVE_WITH_PART));
     }
     //
     // Create and populate the library element.
@@ -7923,6 +7961,15 @@
   }
 
   @override
+  Source getSource(AstNode node) {
+    Source source = super.getSource(node);
+    if (source == null) {
+      source = _definingLibrary.definingCompilationUnit.source;
+    }
+    return source;
+  }
+
+  @override
   Element internalLookup(Identifier identifier, String name, LibraryElement referencingLibrary) {
     Element foundElement = localLookup(name, referencingLibrary);
     if (foundElement != null) {
@@ -8810,6 +8857,25 @@
         }
       }
       computer.computeValues();
+      // As a temporary workaround for issue 21572, run ConstantVerifier now.
+      // TODO(paulberry): remove this workaround once issue 21572 is fixed.
+      for (Library library in _librariesInCycles) {
+        for (Source source in library.compilationUnitSources) {
+          try {
+            CompilationUnit unit = library.getAST(source);
+            ErrorReporter errorReporter = new ErrorReporter(
+                _errorListener, source);
+            ConstantVerifier constantVerifier = new ConstantVerifier(
+                errorReporter, library.libraryElement, _typeProvider);
+            unit.accept(constantVerifier);
+          } on AnalysisException catch (exception, stackTrace) {
+            AnalysisEngine.instance.logger.logError(
+                "Internal Error: Could not access AST for ${source.fullName} "
+                "during constant verification",
+                new CaughtException(exception, stackTrace));
+          }
+        }
+      }
     } finally {
       timeCounter.stop();
     }
@@ -9335,6 +9401,19 @@
         }
       }
       computer.computeValues();
+      // As a temporary workaround for issue 21572, run ConstantVerifier now.
+      // TODO(paulberry): remove this workaround once issue 21572 is fixed.
+      for (ResolvableLibrary library in _librariesInCycle) {
+        for (ResolvableCompilationUnit unit in
+            library.resolvableCompilationUnits) {
+          CompilationUnit ast = unit.compilationUnit;
+          ErrorReporter errorReporter = new ErrorReporter(
+              _errorListener, unit.source);
+          ConstantVerifier constantVerifier = new ConstantVerifier(
+              errorReporter, library.libraryElement, _typeProvider);
+          ast.accept(constantVerifier);
+        }
+      }
     } finally {
       timeCounter.stop();
     }
@@ -9976,12 +10055,12 @@
     if (_isOverride(element)) {
       if (_getOverriddenMember(element) == null) {
         if (element is MethodElement) {
-          _errorReporter.reportErrorForNode(HintCode.OVERRIDE_ON_NON_OVERRIDING_METHOD, node.name, []);
+          _errorReporter.reportErrorForNode(HintCode.OVERRIDE_ON_NON_OVERRIDING_METHOD, node.name);
         } else if (element is PropertyAccessorElement) {
           if (element.isGetter) {
-            _errorReporter.reportErrorForNode(HintCode.OVERRIDE_ON_NON_OVERRIDING_GETTER, node.name, []);
+            _errorReporter.reportErrorForNode(HintCode.OVERRIDE_ON_NON_OVERRIDING_GETTER, node.name);
           } else {
-            _errorReporter.reportErrorForNode(HintCode.OVERRIDE_ON_NON_OVERRIDING_SETTER, node.name, []);
+            _errorReporter.reportErrorForNode(HintCode.OVERRIDE_ON_NON_OVERRIDING_SETTER, node.name);
           }
         }
       }
@@ -10154,7 +10233,7 @@
    * @param uriLiteral the import URL (not `null`)
    * @param path the file path being verified (not `null`)
    * @return `true` if and only if an error code is generated on the passed node
-   * @see PubSuggestionCode.FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE
+   * See [PubSuggestionCode.FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE].
    */
   bool _checkForFileImportInsideLibReferencesFileOutside(StringLiteral uriLiteral, String path) {
     Source source = _getSource(uriLiteral);
@@ -10173,7 +10252,7 @@
           Source pubspecSource = _context.sourceFactory.resolveUri(source, relativePubspecPath);
           if (_context.exists(pubspecSource)) {
             // Files inside the lib directory hierarchy should not reference files outside
-            _errorReporter.reportErrorForNode(HintCode.FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE, uriLiteral, []);
+            _errorReporter.reportErrorForNode(HintCode.FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE, uriLiteral);
           }
           return true;
         }
@@ -10191,7 +10270,7 @@
    * @param uriLiteral the import URL (not `null`)
    * @param path the file path being verified (not `null`)
    * @return `true` if and only if an error code is generated on the passed node
-   * @see PubSuggestionCode.FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE
+   * See [PubSuggestionCode.FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE].
    */
   bool _checkForFileImportOutsideLibReferencesFileInside(StringLiteral uriLiteral, String path) {
     if (StringUtilities.startsWith4(path, 0, 0x6C, 0x69, 0x62, 0x2F)) {
@@ -10221,7 +10300,7 @@
       if (StringUtilities.indexOf5(fullName, 0, 0x2F, 0x6C, 0x69, 0x62, 0x2F) < 0) {
         // Files outside the lib directory hierarchy should not reference files inside
         // ... use package: url instead
-        _errorReporter.reportErrorForNode(HintCode.FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE, uriLiteral, []);
+        _errorReporter.reportErrorForNode(HintCode.FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE, uriLiteral);
         return true;
       }
     }
@@ -10234,12 +10313,12 @@
    * @param uriLiteral the import URL (not `null`)
    * @param path the path to be validated (not `null`)
    * @return `true` if and only if an error code is generated on the passed node
-   * @see PubSuggestionCode.PACKAGE_IMPORT_CONTAINS_DOT_DOT
+   * See [PubSuggestionCode.PACKAGE_IMPORT_CONTAINS_DOT_DOT].
    */
   bool _checkForPackageImportContainsDotDot(StringLiteral uriLiteral, String path) {
     if (StringUtilities.startsWith3(path, 0, 0x2E, 0x2E, 0x2F) || StringUtilities.indexOf4(path, 0, 0x2F, 0x2E, 0x2E, 0x2F) >= 0) {
       // Package import should not to contain ".."
-      _errorReporter.reportErrorForNode(HintCode.PACKAGE_IMPORT_CONTAINS_DOT_DOT, uriLiteral, []);
+      _errorReporter.reportErrorForNode(HintCode.PACKAGE_IMPORT_CONTAINS_DOT_DOT, uriLiteral);
       return true;
     }
     return false;
@@ -10265,7 +10344,7 @@
 
   /**
    * Answer the full name of the given source. The returned value will have all
-   * [File#separatorChar] replace by '/'.
+   * [File.separatorChar] replace by '/'.
    *
    * @param source the source
    * @return the full name or `null` if it could not be determined
@@ -10720,61 +10799,42 @@
 }
 
 /**
- * The enumeration `ResolverErrorCode` defines the error codes used for errors detected by the
- * resolver. The convention for this class is for the name of the error code to indicate the problem
- * that caused the error to be generated and for the error message to explain what is wrong and,
- * when appropriate, how the problem can be corrected.
+ * The enumeration `ResolverErrorCode` defines the error codes used for errors
+ * detected by the resolver. The convention for this class is for the name of
+ * the error code to indicate the problem that caused the error to be generated
+ * and for the error message to explain what is wrong and, when appropriate, how
+ * the problem can be corrected.
  */
-class ResolverErrorCode extends Enum<ResolverErrorCode> implements ErrorCode {
-  static const ResolverErrorCode BREAK_LABEL_ON_SWITCH_MEMBER = const ResolverErrorCode.con1('BREAK_LABEL_ON_SWITCH_MEMBER', 0, ErrorType.COMPILE_TIME_ERROR, "Break label resolves to case or default statement");
+class ResolverErrorCode extends ErrorCode {
+  static const ResolverErrorCode BREAK_LABEL_ON_SWITCH_MEMBER
+      = const ResolverErrorCode(
+          'BREAK_LABEL_ON_SWITCH_MEMBER',
+          "Break label resolves to case or default statement");
 
-  static const ResolverErrorCode CONTINUE_LABEL_ON_SWITCH = const ResolverErrorCode.con1('CONTINUE_LABEL_ON_SWITCH', 1, ErrorType.COMPILE_TIME_ERROR, "A continue label resolves to switch, must be loop or switch member");
+  static const ResolverErrorCode CONTINUE_LABEL_ON_SWITCH
+      = const ResolverErrorCode(
+          'CONTINUE_LABEL_ON_SWITCH',
+          "A continue label resolves to switch, must be loop or switch member");
 
-  static const ResolverErrorCode MISSING_LIBRARY_DIRECTIVE_WITH_PART = const ResolverErrorCode.con1('MISSING_LIBRARY_DIRECTIVE_WITH_PART', 2, ErrorType.COMPILE_TIME_ERROR, "Libraries that have parts must have a library directive");
-
-  static const List<ResolverErrorCode> values = const [
-      BREAK_LABEL_ON_SWITCH_MEMBER,
-      CONTINUE_LABEL_ON_SWITCH,
-      MISSING_LIBRARY_DIRECTIVE_WITH_PART];
+  static const ResolverErrorCode MISSING_LIBRARY_DIRECTIVE_WITH_PART
+      = const ResolverErrorCode(
+          'MISSING_LIBRARY_DIRECTIVE_WITH_PART',
+          "Libraries that have parts must have a library directive");
 
   /**
-   * The type of this error.
+   * Initialize a newly created error code to have the given [name]. The message
+   * associated with the error will be created from the given [message]
+   * template. The correction associated with the error will be created from the
+   * given [correction] template.
    */
-  final ErrorType type;
-
-  /**
-   * The template used to create the message to be displayed for this error.
-   */
-  final String message;
-
-  /**
-   * The template used to create the correction to be displayed for this error, or `null` if
-   * there is no correction information for this error.
-   */
-  final String correction;
-
-  /**
-   * Initialize a newly created error code to have the given type and message.
-   *
-   * @param type the type of this error
-   * @param message the message template used to create the message to be displayed for the error
-   */
-  const ResolverErrorCode.con1(String name, int ordinal, ErrorType type, String message) : this.con2(name, ordinal, type, message, null);
-
-  /**
-   * Initialize a newly created error code to have the given type, message and correction.
-   *
-   * @param type the type of this error
-   * @param message the template used to create the message to be displayed for the error
-   * @param correction the template used to create the correction to be displayed for the error
-   */
-  const ResolverErrorCode.con2(String name, int ordinal, this.type, this.message, this.correction) : super(name, ordinal);
+  const ResolverErrorCode(String name, String message, [String correction])
+      : super(name, message, correction);
 
   @override
   ErrorSeverity get errorSeverity => type.severity;
 
   @override
-  String get uniqueName => "$runtimeType.$name";
+  ErrorType get type => ErrorType.COMPILE_TIME_ERROR;
 }
 
 /**
@@ -12357,7 +12417,7 @@
    * Return the scope in which the given AST structure should be resolved.
    *
    * <b>Note:</b> This method needs to be kept in sync with
-   * [IncrementalResolver#canBeResolved].
+   * [IncrementalResolver.canBeResolved].
    *
    * @param node the root of the AST structure to be resolved
    * @return the scope in which the given AST structure should be resolved
@@ -12465,6 +12525,12 @@
   LabelScope _labelScope;
 
   /**
+   * The class containing the AST nodes being visited,
+   * or `null` if we are not in the scope of a class.
+   */
+  ClassElement _enclosingClass;
+
+  /**
    * Initialize a newly created visitor to resolve the nodes in a compilation unit.
    *
    * @param library the library containing the compilation unit being resolved
@@ -12600,10 +12666,16 @@
             new CaughtException(new AnalysisException(), null));
         super.visitClassDeclaration(node);
       } else {
-        _nameScope = new TypeParameterScope(_nameScope, classElement);
-        visitClassDeclarationInScope(node);
-        _nameScope = new ClassScope(_nameScope, classElement);
-        visitClassMembersInScope(node);
+        ClassElement outerClass = _enclosingClass;
+        try {
+          _enclosingClass = node.element;
+          _nameScope = new TypeParameterScope(_nameScope, classElement);
+          visitClassDeclarationInScope(node);
+          _nameScope = new ClassScope(_nameScope, classElement);
+          visitClassMembersInScope(node);
+        } finally {
+          _enclosingClass = outerClass;
+        }
       }
     } finally {
       _nameScope = outerScope;
@@ -12721,6 +12793,10 @@
   @override
   Object visitFunctionDeclaration(FunctionDeclaration node) {
     ExecutableElement functionElement = node.element;
+    if (functionElement != null &&
+        functionElement.enclosingElement is! CompilationUnitElement) {
+      _nameScope.define(functionElement);
+    }
     Scope outerScope = _nameScope;
     try {
       if (functionElement == null) {
@@ -12734,9 +12810,6 @@
     } finally {
       _nameScope = outerScope;
     }
-    if (functionElement != null && functionElement.enclosingElement is! CompilationUnitElement) {
-      _nameScope.define(functionElement);
-    }
     return null;
   }
 
@@ -12916,7 +12989,7 @@
    * @param node the node specifying the location of the error
    * @param arguments the arguments to the error, used to compose the error message
    */
-  void reportErrorForNode(ErrorCode errorCode, AstNode node, List<Object> arguments) {
+  void reportErrorForNode(ErrorCode errorCode, AstNode node, [List<Object> arguments]) {
     _errorListener.onError(new AnalysisError.con2(source, node.offset, node.length, errorCode, arguments));
   }
 
@@ -12928,7 +13001,7 @@
    * @param length the length of the location of the error
    * @param arguments the arguments to the error, used to compose the error message
    */
-  void reportErrorForOffset(ErrorCode errorCode, int offset, int length, List<Object> arguments) {
+  void reportErrorForOffset(ErrorCode errorCode, int offset, int length, [List<Object> arguments]) {
     _errorListener.onError(new AnalysisError.con2(source, offset, length, errorCode, arguments));
   }
 
@@ -12939,7 +13012,7 @@
    * @param token the token specifying the location of the error
    * @param arguments the arguments to the error, used to compose the error message
    */
-  void reportErrorForToken(ErrorCode errorCode, sc.Token token, List<Object> arguments) {
+  void reportErrorForToken(ErrorCode errorCode, sc.Token token, [List<Object> arguments]) {
     _errorListener.onError(new AnalysisError.con2(source, token.offset, token.length, errorCode, arguments));
   }
 
@@ -15033,7 +15106,7 @@
     if (type is InterfaceType) {
       ClassElement element = type.element;
       if (element != null && element.isEnum) {
-        reportErrorForNode(enumTypeError, typeName, []);
+        reportErrorForNode(enumTypeError, typeName);
         return null;
       }
       return type;
@@ -15073,6 +15146,7 @@
     if (element != null) {
       if (typeName is SimpleIdentifier) {
         typeName.staticElement = element;
+        _markTypeNameElementUsed(typeName, element);
       } else if (typeName is PrefixedIdentifier) {
         PrefixedIdentifier identifier = typeName;
         identifier.identifier.staticElement = element;
@@ -15086,6 +15160,31 @@
   }
 
   /**
+   * Marks [element] as used in its defining library.
+   */
+  void _markTypeNameElementUsed(Identifier typeName, Element element) {
+    if (identical(element, _enclosingClass)) {
+      return;
+    }
+    // ignore places where the element is not actually used
+    if (typeName.parent is TypeName) {
+      AstNode parent2 = typeName.parent.parent;
+      if (parent2 is IsExpression) {
+        return;
+      }
+      if (parent2 is VariableDeclarationList) {
+        return;
+      }
+    }
+    // check if the element is a local top-level element
+    if (element is ElementImpl &&
+        element.enclosingElement is CompilationUnitElement &&
+        identical(element.library, definingLibrary)) {
+      element.markUsed();
+    }
+  }
+
+  /**
    * Given a parameter element, create a function type based on the given return type and parameter
    * list and associate the created type with the element.
    *
@@ -15266,7 +15365,9 @@
     if (parent is PropertyAccess && identical(parent.propertyName, node)) {
       return null;
     }
-    if (parent is MethodInvocation && identical(parent.methodName, node)) {
+    if (parent is MethodInvocation &&
+        identical(parent.methodName, node) &&
+        parent.target != null) {
       return null;
     }
     if (parent is ConstructorName) {
@@ -15284,13 +15385,28 @@
     ElementKind kind = element.kind;
     if (kind == ElementKind.LOCAL_VARIABLE) {
       node.staticElement = element;
+      LocalVariableElementImpl variableImpl = element as LocalVariableElementImpl;
       if (node.inSetterContext()) {
-        LocalVariableElementImpl variableImpl = element as LocalVariableElementImpl;
         variableImpl.markPotentiallyMutatedInScope();
         if (element.enclosingElement != _enclosingFunction) {
           variableImpl.markPotentiallyMutatedInClosure();
         }
       }
+      if (node.inGetterContext()) {
+        if (parent.parent is ExpressionStatement &&
+            (parent is PrefixExpression ||
+             parent is PostfixExpression ||
+             parent is AssignmentExpression && parent.leftHandSide == node)) {
+          // v++;
+          // ++v;
+          // v += 2;
+        } else {
+          variableImpl.markUsed();
+        }
+      }
+      if (parent is MethodInvocation && parent.methodName == node) {
+        variableImpl.markUsed();
+      }
     } else if (kind == ElementKind.PARAMETER) {
       node.staticElement = element;
       if (node.inSetterContext()) {
diff --git a/pkg/analyzer/lib/src/generated/scanner.dart b/pkg/analyzer/lib/src/generated/scanner.dart
index 26457d7..28fd8df 100644
--- a/pkg/analyzer/lib/src/generated/scanner.dart
+++ b/pkg/analyzer/lib/src/generated/scanner.dart
@@ -1267,7 +1267,7 @@
    * @param errorCode the error code indicating the nature of the error
    * @param arguments any arguments needed to complete the error message
    */
-  void _reportError(ScannerErrorCode errorCode, List<Object> arguments) {
+  void _reportError(ScannerErrorCode errorCode, [List<Object> arguments]) {
     _errorListener.onError(new AnalysisError.con2(source, _reader.offset, 1, errorCode, arguments));
   }
 
@@ -1373,7 +1373,7 @@
         hasDigits = true;
       } else {
         if (!hasDigits) {
-          _reportError(ScannerErrorCode.MISSING_DIGIT, []);
+          _reportError(ScannerErrorCode.MISSING_DIGIT);
         }
         return next;
       }
@@ -1440,7 +1440,7 @@
         hasDigits = true;
       } else {
         if (!hasDigits) {
-          _reportError(ScannerErrorCode.MISSING_HEX_DIGIT, []);
+          _reportError(ScannerErrorCode.MISSING_HEX_DIGIT);
         }
         _appendStringToken(TokenType.HEXADECIMAL, _reader.getString(start, next < 0 ? 0 : -1));
         return next;
@@ -1560,7 +1560,7 @@
     next = _reader.advance();
     while (true) {
       if (-1 == next) {
-        _reportError(ScannerErrorCode.UNTERMINATED_MULTI_LINE_COMMENT, []);
+        _reportError(ScannerErrorCode.UNTERMINATED_MULTI_LINE_COMMENT);
         _appendCommentToken(TokenType.MULTI_LINE_COMMENT, _reader.getString(_tokenStart, 0));
         return next;
       } else if (0x2A == next) {
@@ -1622,7 +1622,7 @@
         }
       }
     }
-    _reportError(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, []);
+    _reportError(ScannerErrorCode.UNTERMINATED_STRING_LITERAL);
     _appendStringToken(TokenType.STRING, _reader.getString(start, 0));
     return _reader.advance();
   }
@@ -1681,7 +1681,7 @@
         next = _reader.advance();
       }
     }
-    _reportError(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, []);
+    _reportError(ScannerErrorCode.UNTERMINATED_STRING_LITERAL);
     if (start == _reader.offset) {
       _appendStringTokenWithOffset(TokenType.STRING, "", 1);
     } else {
@@ -1757,13 +1757,13 @@
         _appendStringToken(TokenType.STRING, _reader.getString(start, 0));
         return _reader.advance();
       } else if (next == 0xD || next == 0xA) {
-        _reportError(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, []);
+        _reportError(ScannerErrorCode.UNTERMINATED_STRING_LITERAL);
         _appendStringToken(TokenType.STRING, _reader.getString(start, -1));
         return _reader.advance();
       }
       next = _reader.advance();
     }
-    _reportError(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, []);
+    _reportError(ScannerErrorCode.UNTERMINATED_STRING_LITERAL);
     _appendStringToken(TokenType.STRING, _reader.getString(start, 0));
     return _reader.advance();
   }
@@ -1780,7 +1780,7 @@
         continue;
       }
       if (next <= 0xD && (next == 0xA || next == 0xD || next == -1)) {
-        _reportError(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, []);
+        _reportError(ScannerErrorCode.UNTERMINATED_STRING_LITERAL);
         if (start == _reader.offset) {
           _appendStringTokenWithOffset(TokenType.STRING, "", 1);
         } else if (next == -1) {
@@ -1870,64 +1870,48 @@
 }
 
 /**
- * The enumeration `ScannerErrorCode` defines the error codes used for errors detected by the
- * scanner.
+ * The enumeration `ScannerErrorCode` defines the error codes used for errors
+ * detected by the scanner.
  */
-class ScannerErrorCode extends Enum<ScannerErrorCode> implements ErrorCode {
-  static const ScannerErrorCode ILLEGAL_CHARACTER = const ScannerErrorCode.con1('ILLEGAL_CHARACTER', 0, "Illegal character {0}");
+class ScannerErrorCode extends ErrorCode {
+  static const ScannerErrorCode ILLEGAL_CHARACTER
+      = const ScannerErrorCode('ILLEGAL_CHARACTER', "Illegal character {0}");
 
-  static const ScannerErrorCode MISSING_DIGIT = const ScannerErrorCode.con1('MISSING_DIGIT', 1, "Decimal digit expected");
+  static const ScannerErrorCode MISSING_DIGIT
+      = const ScannerErrorCode('MISSING_DIGIT', "Decimal digit expected");
 
-  static const ScannerErrorCode MISSING_HEX_DIGIT = const ScannerErrorCode.con1('MISSING_HEX_DIGIT', 2, "Hexidecimal digit expected");
+  static const ScannerErrorCode MISSING_HEX_DIGIT
+      = const ScannerErrorCode(
+          'MISSING_HEX_DIGIT',
+          "Hexidecimal digit expected");
 
-  static const ScannerErrorCode MISSING_QUOTE = const ScannerErrorCode.con1('MISSING_QUOTE', 3, "Expected quote (' or \")");
+  static const ScannerErrorCode MISSING_QUOTE
+      = const ScannerErrorCode('MISSING_QUOTE', "Expected quote (' or \")");
 
-  static const ScannerErrorCode UNTERMINATED_MULTI_LINE_COMMENT = const ScannerErrorCode.con1('UNTERMINATED_MULTI_LINE_COMMENT', 4, "Unterminated multi-line comment");
+  static const ScannerErrorCode UNTERMINATED_MULTI_LINE_COMMENT
+      = const ScannerErrorCode(
+          'UNTERMINATED_MULTI_LINE_COMMENT',
+          "Unterminated multi-line comment");
 
-  static const ScannerErrorCode UNTERMINATED_STRING_LITERAL = const ScannerErrorCode.con1('UNTERMINATED_STRING_LITERAL', 5, "Unterminated string literal");
-
-  static const List<ScannerErrorCode> values = const [
-      ILLEGAL_CHARACTER,
-      MISSING_DIGIT,
-      MISSING_HEX_DIGIT,
-      MISSING_QUOTE,
-      UNTERMINATED_MULTI_LINE_COMMENT,
-      UNTERMINATED_STRING_LITERAL];
+  static const ScannerErrorCode UNTERMINATED_STRING_LITERAL
+      = const ScannerErrorCode(
+          'UNTERMINATED_STRING_LITERAL',
+          "Unterminated string literal");
 
   /**
-   * The template used to create the message to be displayed for this error.
+   * Initialize a newly created error code to have the given [name]. The message
+   * associated with the error will be created from the given [message]
+   * template. The correction associated with the error will be created from the
+   * given [correction] template.
    */
-  final String message;
-
-  /**
-   * The template used to create the correction to be displayed for this error, or `null` if
-   * there is no correction information for this error.
-   */
-  final String correction;
-
-  /**
-   * Initialize a newly created error code to have the given message.
-   *
-   * @param message the message template used to create the message to be displayed for this error
-   */
-  const ScannerErrorCode.con1(String name, int ordinal, String message) : this.con2(name, ordinal, message, null);
-
-  /**
-   * Initialize a newly created error code to have the given message and correction.
-   *
-   * @param message the template used to create the message to be displayed for the error
-   * @param correction the template used to create the correction to be displayed for the error
-   */
-  const ScannerErrorCode.con2(String name, int ordinal, this.message, this.correction) : super(name, ordinal);
+  const ScannerErrorCode(String name, String message, [String correction])
+      : super(name, message, correction);
 
   @override
   ErrorSeverity get errorSeverity => ErrorSeverity.ERROR;
 
   @override
   ErrorType get type => ErrorType.SYNTACTIC_ERROR;
-
-  @override
-  String get uniqueName => "$runtimeType.$name";
 }
 
 /**
diff --git a/pkg/analyzer/lib/src/generated/source.dart b/pkg/analyzer/lib/src/generated/source.dart
index 47bb620..da29487 100644
--- a/pkg/analyzer/lib/src/generated/source.dart
+++ b/pkg/analyzer/lib/src/generated/source.dart
@@ -37,7 +37,7 @@
    * contents of the source.
    *
    * <b>Note:</b> This method is not intended to be used except by
-   * [AnalysisContext#getContents].
+   * [AnalysisContext.getContents].
    *
    * @param source the source whose content is to be returned
    * @return the contents of the given source
@@ -49,7 +49,7 @@
    * override the contents of the source.
    *
    * <b>Note:</b> This method is not intended to be used except by
-   * [AnalysisContext#getModificationStamp].
+   * [AnalysisContext.getModificationStamp].
    *
    * @param source the source whose modification stamp is to be returned
    * @return the modification stamp of the given source
@@ -375,7 +375,7 @@
    * @param object the object to be compared with this object
    * @return `true` if the given object is a source that represents the same source code as
    *         this source
-   * @see Object#equals(Object)
+   * See [Object.==].
    */
   @override
   bool operator ==(Object object);
@@ -383,7 +383,7 @@
   /**
    * Return `true` if this source exists.
    *
-   * Clients should consider using the the method [AnalysisContext#exists] because
+   * Clients should consider using the the method [AnalysisContext.exists] because
    * contexts can have local overrides of the content of a source that the source is not aware of
    * and a source with local content is considered to exist even if there is no file on disk.
    *
@@ -394,7 +394,7 @@
   /**
    * Get the contents and timestamp of this source.
    *
-   * Clients should consider using the the method [AnalysisContext#getContents]
+   * Clients should consider using the the method [AnalysisContext.getContents]
    * because contexts can have local overrides of the content of a source that the source is not
    * aware of.
    *
@@ -408,7 +408,7 @@
    * equal to this source.
    *
    * @return an encoded representation of this source
-   * @see SourceFactory#fromEncoding(String)
+   * See [SourceFactory.fromEncoding].
    */
   String get encoding;
 
@@ -429,7 +429,7 @@
    * will be different.
    *
    * Clients should consider using the the method
-   * [AnalysisContext#getModificationStamp] because contexts can have local overrides
+   * [AnalysisContext.getModificationStamp] because contexts can have local overrides
    * of the content of a source that the source is not aware of.
    *
    * @return the modification stamp for this source
@@ -465,7 +465,7 @@
    * Return a hash code for this source.
    *
    * @return a hash code for this source
-   * @see Object#hashCode()
+   * See [Object.hashCode].
    */
   @override
   int get hashCode;
@@ -585,7 +585,7 @@
    * @param encoding the encoding of a source object
    * @return a source object that is described by the given encoding
    * @throws IllegalArgumentException if the argument is not a valid encoding
-   * @see Source#getEncoding()
+   * See [Source.encoding].
    */
   Source fromEncoding(String encoding) {
     Source source = forUri(encoding);
@@ -638,8 +638,10 @@
       // Force the creation of an escaped URI to deal with spaces, etc.
       return _internalResolveUri(containingSource, parseUriWithException(containedUri));
     } catch (exception, stackTrace) {
+      String containingFullName =
+          containingSource != null ? containingSource.fullName : '<null>';
       AnalysisEngine.instance.logger.logError(
-          "Could not resolve URI ($containedUri) relative to source (${containingSource.fullName})",
+          "Could not resolve URI ($containedUri) relative to source ($containingFullName)",
           new CaughtException(exception, stackTrace));
       return null;
     }
diff --git a/pkg/analyzer/lib/src/generated/source_io.dart b/pkg/analyzer/lib/src/generated/source_io.dart
index 9fa796a..b7ec971 100644
--- a/pkg/analyzer/lib/src/generated/source_io.dart
+++ b/pkg/analyzer/lib/src/generated/source_io.dart
@@ -42,9 +42,8 @@
 
   /**
    * Construct a container representing the specified directory and containing any sources whose
-   * [Source#getFullName] starts with the directory's path. This is a convenience method,
-   * fully equivalent to [DirectoryBasedSourceContainer#DirectoryBasedSourceContainer]
-   * .
+   * [Source.fullName] starts with the directory's path. This is a convenience method,
+   * fully equivalent to [DirectoryBasedSourceContainer.con2].
    *
    * @param directory the directory (not `null`)
    */
@@ -52,7 +51,7 @@
 
   /**
    * Construct a container representing the specified path and containing any sources whose
-   * [Source#getFullName] starts with the specified path.
+   * [Source.fullName] starts with the specified path.
    *
    * @param path the path (not `null` and not empty)
    */
@@ -95,6 +94,11 @@
   final JavaFile file;
 
   /**
+   * The cached absolute path of this source.
+   */
+  String _absolutePath;
+
+  /**
    * The cached encoding for this source.
    */
   String _encoding;
@@ -139,7 +143,12 @@
   }
 
   @override
-  String get fullName => file.getAbsolutePath();
+  String get fullName {
+    if (_absolutePath == null) {
+      _absolutePath = file.getAbsolutePath();
+    }
+    return _absolutePath;
+  }
 
   @override
   int get modificationStamp => file.lastModified();
@@ -200,13 +209,13 @@
   /**
    * Get the contents and timestamp of the underlying file.
    *
-   * Clients should consider using the the method [AnalysisContext#getContents]
+   * Clients should consider using the the method [AnalysisContext.getContents]
    * because contexts can have local overrides of the content of a source that the source is not
    * aware of.
    *
    * @return the contents of the source paired with the modification stamp of the source
    * @throws Exception if the contents of this source could not be accessed
-   * @see #getContents()
+   * See [contents].
    */
   TimestampedData<String> get contentsFromFile {
     return new TimestampedData<String>(file.lastModified(), file.readAsStringSync());
diff --git a/pkg/analyzer/lib/src/generated/testing/ast_factory.dart b/pkg/analyzer/lib/src/generated/testing/ast_factory.dart
index d4328ca..d761f82 100644
--- a/pkg/analyzer/lib/src/generated/testing/ast_factory.dart
+++ b/pkg/analyzer/lib/src/generated/testing/ast_factory.dart
@@ -26,13 +26,17 @@
  * 'identifier' rather than 'prefixedIdentifier', or 'integer' rather than 'integerLiteral'.
  */
 class AstFactory {
-  static AdjacentStrings adjacentStrings(List<StringLiteral> strings) => new AdjacentStrings(list(strings));
+  static AdjacentStrings adjacentStrings(List<StringLiteral> strings) => new AdjacentStrings(strings);
 
   static Annotation annotation(Identifier name) => new Annotation(TokenFactory.tokenFromType(TokenType.AT), name, null, null, null);
 
   static Annotation annotation2(Identifier name, SimpleIdentifier constructorName, ArgumentList arguments) => new Annotation(TokenFactory.tokenFromType(TokenType.AT), name, TokenFactory.tokenFromType(TokenType.PERIOD), constructorName, arguments);
 
-  static ArgumentList argumentList(List<Expression> arguments) => new ArgumentList(TokenFactory.tokenFromType(TokenType.OPEN_PAREN), list(arguments), TokenFactory.tokenFromType(TokenType.CLOSE_PAREN));
+  static ArgumentList argumentList([List<Expression> arguments])
+      => new ArgumentList(
+          TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
+          arguments,
+          TokenFactory.tokenFromType(TokenType.CLOSE_PAREN));
 
   static AsExpression asExpression(Expression expression, TypeName type) => new AsExpression(expression, TokenFactory.tokenFromKeyword(Keyword.AS), type);
 
@@ -40,21 +44,35 @@
 
   static AssignmentExpression assignmentExpression(Expression leftHandSide, TokenType operator, Expression rightHandSide) => new AssignmentExpression(leftHandSide, TokenFactory.tokenFromType(operator), rightHandSide);
 
-  static BlockFunctionBody asyncBlockFunctionBody(List<Statement> statements) => new BlockFunctionBody(TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "async"), null, block(statements));
+  static BlockFunctionBody asyncBlockFunctionBody([List<Statement> statements])
+     => new BlockFunctionBody(
+         TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "async"),
+         null,
+         block(statements));
 
   static ExpressionFunctionBody asyncExpressionFunctionBody(Expression expression) => new ExpressionFunctionBody(TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "async"), TokenFactory.tokenFromType(TokenType.FUNCTION), expression, TokenFactory.tokenFromType(TokenType.SEMICOLON));
 
-  static BlockFunctionBody asyncGeneratorBlockFunctionBody(List<Statement> statements) => new BlockFunctionBody(TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "async"), TokenFactory.tokenFromType(TokenType.STAR), block(statements));
+  static BlockFunctionBody asyncGeneratorBlockFunctionBody([List<Statement> statements])
+     => new BlockFunctionBody(
+         TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "async"),
+          TokenFactory.tokenFromType(TokenType.STAR),
+          block(statements));
 
   static AwaitExpression awaitExpression(Expression expression) => new AwaitExpression(TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "await"), expression);
 
   static BinaryExpression binaryExpression(Expression leftOperand, TokenType operator, Expression rightOperand) => new BinaryExpression(leftOperand, TokenFactory.tokenFromType(operator), rightOperand);
 
-  static Block block(List<Statement> statements) => new Block(TokenFactory.tokenFromType(TokenType.OPEN_CURLY_BRACKET), list(statements), TokenFactory.tokenFromType(TokenType.CLOSE_CURLY_BRACKET));
+  static Block block([List<Statement> statements])
+      => new Block(
+          TokenFactory.tokenFromType(TokenType.OPEN_CURLY_BRACKET),
+          statements,
+          TokenFactory.tokenFromType(TokenType.CLOSE_CURLY_BRACKET));
 
-  static BlockFunctionBody blockFunctionBody(Block block) => new BlockFunctionBody(null, null, block);
+  static BlockFunctionBody blockFunctionBody(Block block)
+      => new BlockFunctionBody(null, null, block);
 
-  static BlockFunctionBody blockFunctionBody2(List<Statement> statements) => new BlockFunctionBody(null, null, block(statements));
+  static BlockFunctionBody blockFunctionBody2([List<Statement> statements])
+      => new BlockFunctionBody(null, null, block(statements));
 
   static BooleanLiteral booleanLiteral(bool value) => new BooleanLiteral(value ? TokenFactory.tokenFromKeyword(Keyword.TRUE) : TokenFactory.tokenFromKeyword(Keyword.FALSE), value);
 
@@ -64,39 +82,72 @@
 
   static IndexExpression cascadedIndexExpression(Expression index) => new IndexExpression.forCascade(TokenFactory.tokenFromType(TokenType.PERIOD_PERIOD), TokenFactory.tokenFromType(TokenType.OPEN_SQUARE_BRACKET), index, TokenFactory.tokenFromType(TokenType.CLOSE_SQUARE_BRACKET));
 
-  static MethodInvocation cascadedMethodInvocation(String methodName, List<Expression> arguments) => new MethodInvocation(null, TokenFactory.tokenFromType(TokenType.PERIOD_PERIOD), identifier3(methodName), argumentList(arguments));
+  static MethodInvocation cascadedMethodInvocation(String methodName, [List<Expression> arguments])
+      => new MethodInvocation(
+          null,
+          TokenFactory.tokenFromType(TokenType.PERIOD_PERIOD),
+          identifier3(methodName),
+          argumentList(arguments));
 
   static PropertyAccess cascadedPropertyAccess(String propertyName) => new PropertyAccess(null, TokenFactory.tokenFromType(TokenType.PERIOD_PERIOD), identifier3(propertyName));
 
-  static CascadeExpression cascadeExpression(Expression target, List<Expression> cascadeSections) => new CascadeExpression(target, list(cascadeSections));
+  static CascadeExpression cascadeExpression(Expression target, [List<Expression> cascadeSections])
+      => new CascadeExpression(target, cascadeSections);
 
-  static CatchClause catchClause(String exceptionParameter, List<Statement> statements) => catchClause5(null, exceptionParameter, null, statements);
+  static CatchClause catchClause(String exceptionParameter, [List<Statement> statements])
+      => catchClause5(null, exceptionParameter, null, statements);
 
-  static CatchClause catchClause2(String exceptionParameter, String stackTraceParameter, List<Statement> statements) => catchClause5(null, exceptionParameter, stackTraceParameter, statements);
+  static CatchClause catchClause2(String exceptionParameter, String stackTraceParameter, [List<Statement> statements])
+      => catchClause5(null, exceptionParameter, stackTraceParameter, statements);
 
-  static CatchClause catchClause3(TypeName exceptionType, List<Statement> statements) => catchClause5(exceptionType, null, null, statements);
+  static CatchClause catchClause3(TypeName exceptionType, [List<Statement> statements])
+      => catchClause5(exceptionType, null, null, statements);
 
-  static CatchClause catchClause4(TypeName exceptionType, String exceptionParameter, List<Statement> statements) => catchClause5(exceptionType, exceptionParameter, null, statements);
+  static CatchClause catchClause4(TypeName exceptionType, String exceptionParameter, [List<Statement> statements])
+      => catchClause5(exceptionType, exceptionParameter, null, statements);
 
-  static CatchClause catchClause5(TypeName exceptionType, String exceptionParameter, String stackTraceParameter, List<Statement> statements) => new CatchClause(exceptionType == null ? null : TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "on"), exceptionType, exceptionParameter == null ? null : TokenFactory.tokenFromKeyword(Keyword.CATCH), exceptionParameter == null ? null : TokenFactory.tokenFromType(TokenType.OPEN_PAREN), exceptionParameter == null ? null : identifier3(exceptionParameter), stackTraceParameter == null ? null : TokenFactory.tokenFromType(TokenType.COMMA), stackTraceParameter == null ? null : identifier3(stackTraceParameter), exceptionParameter == null ? null : TokenFactory.tokenFromType(TokenType.CLOSE_PAREN), block(statements));
+  static CatchClause catchClause5(TypeName exceptionType, String exceptionParameter, String stackTraceParameter, [List<Statement> statements])
+      => new CatchClause(
+          exceptionType == null ? null : TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "on"),
+          exceptionType,
+          exceptionParameter == null ? null : TokenFactory.tokenFromKeyword(Keyword.CATCH),
+          exceptionParameter == null ? null : TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
+          exceptionParameter == null ? null : identifier3(exceptionParameter),
+          stackTraceParameter == null ? null : TokenFactory.tokenFromType(TokenType.COMMA),
+          stackTraceParameter == null ? null : identifier3(stackTraceParameter),
+          exceptionParameter == null ? null : TokenFactory.tokenFromType(TokenType.CLOSE_PAREN),
+          block(statements));
 
-  static ClassDeclaration classDeclaration(Keyword abstractKeyword, String name, TypeParameterList typeParameters, ExtendsClause extendsClause, WithClause withClause, ImplementsClause implementsClause, List<ClassMember> members) => new ClassDeclaration(null, null, abstractKeyword == null ? null : TokenFactory.tokenFromKeyword(abstractKeyword), TokenFactory.tokenFromKeyword(Keyword.CLASS), identifier3(name), typeParameters, extendsClause, withClause, implementsClause, TokenFactory.tokenFromType(TokenType.OPEN_CURLY_BRACKET), list(members), TokenFactory.tokenFromType(TokenType.CLOSE_CURLY_BRACKET));
+  static ClassDeclaration classDeclaration(Keyword abstractKeyword, String name, TypeParameterList typeParameters, ExtendsClause extendsClause, WithClause withClause, ImplementsClause implementsClause, [List<ClassMember> members])
+      => new ClassDeclaration(
+          null,
+          null,
+          abstractKeyword == null ? null : TokenFactory.tokenFromKeyword(abstractKeyword),
+          TokenFactory.tokenFromKeyword(Keyword.CLASS),
+          identifier3(name),
+          typeParameters,
+          extendsClause,
+          withClause,
+          implementsClause,
+          TokenFactory.tokenFromType(TokenType.OPEN_CURLY_BRACKET),
+          members,
+          TokenFactory.tokenFromType(TokenType.CLOSE_CURLY_BRACKET));
 
   static ClassTypeAlias classTypeAlias(String name, TypeParameterList typeParameters, Keyword abstractKeyword, TypeName superclass, WithClause withClause, ImplementsClause implementsClause) => new ClassTypeAlias(null, null, TokenFactory.tokenFromKeyword(Keyword.CLASS), identifier3(name), typeParameters, TokenFactory.tokenFromType(TokenType.EQ), abstractKeyword == null ? null : TokenFactory.tokenFromKeyword(abstractKeyword), superclass, withClause, implementsClause, TokenFactory.tokenFromType(TokenType.SEMICOLON));
 
   static CompilationUnit compilationUnit() => compilationUnit8(null, null, null);
 
-  static CompilationUnit compilationUnit2(List<CompilationUnitMember> declarations) => compilationUnit8(null, null, list(declarations));
+  static CompilationUnit compilationUnit2(List<CompilationUnitMember> declarations) => compilationUnit8(null, null, declarations);
 
-  static CompilationUnit compilationUnit3(List<Directive> directives) => compilationUnit8(null, list(directives), null);
+  static CompilationUnit compilationUnit3(List<Directive> directives) => compilationUnit8(null, directives, null);
 
   static CompilationUnit compilationUnit4(List<Directive> directives, List<CompilationUnitMember> declarations) => compilationUnit8(null, directives, declarations);
 
   static CompilationUnit compilationUnit5(String scriptTag) => compilationUnit8(scriptTag, null, null);
 
-  static CompilationUnit compilationUnit6(String scriptTag, List<CompilationUnitMember> declarations) => compilationUnit8(scriptTag, null, list(declarations));
+  static CompilationUnit compilationUnit6(String scriptTag, List<CompilationUnitMember> declarations) => compilationUnit8(scriptTag, null, declarations);
 
-  static CompilationUnit compilationUnit7(String scriptTag, List<Directive> directives) => compilationUnit8(scriptTag, list(directives), null);
+  static CompilationUnit compilationUnit7(String scriptTag, List<Directive> directives) => compilationUnit8(scriptTag, directives, null);
 
   static CompilationUnit compilationUnit8(String scriptTag, List<Directive> directives, List<CompilationUnitMember> declarations) => new CompilationUnit(TokenFactory.tokenFromType(TokenType.EOF), scriptTag == null ? null : AstFactory.scriptTag(scriptTag), directives == null ? new List<Directive>() : directives, declarations == null ? new List<CompilationUnitMember>() : declarations, TokenFactory.tokenFromType(TokenType.EOF));
 
@@ -110,10 +161,11 @@
 
   static ConstructorName constructorName(TypeName type, String name) => new ConstructorName(type, name == null ? null : TokenFactory.tokenFromType(TokenType.PERIOD), name == null ? null : identifier3(name));
 
-  static ContinueStatement continueStatement([String label]) {
-    SimpleIdentifier labelNode = label == null ? null : identifier3(label);
-    return new ContinueStatement(TokenFactory.tokenFromKeyword(Keyword.CONTINUE), labelNode, TokenFactory.tokenFromType(TokenType.SEMICOLON));
-  }
+  static ContinueStatement continueStatement([String label])
+      => new ContinueStatement(
+          TokenFactory.tokenFromKeyword(Keyword.CONTINUE),
+          label == null ? null : identifier3(label),
+          TokenFactory.tokenFromType(TokenType.SEMICOLON));
 
   static DeclaredIdentifier declaredIdentifier(Keyword keyword, String identifier) => declaredIdentifier2(keyword, null, identifier);
 
@@ -131,7 +183,7 @@
 
   static EmptyStatement emptyStatement() => new EmptyStatement(TokenFactory.tokenFromType(TokenType.SEMICOLON));
 
-  static EnumDeclaration enumDeclaration(SimpleIdentifier name, List<EnumConstantDeclaration> constants) => new EnumDeclaration(null, null, TokenFactory.tokenFromKeyword(Keyword.ENUM), name, TokenFactory.tokenFromType(TokenType.OPEN_CURLY_BRACKET), list(constants), TokenFactory.tokenFromType(TokenType.CLOSE_CURLY_BRACKET));
+  static EnumDeclaration enumDeclaration(SimpleIdentifier name, List<EnumConstantDeclaration> constants) => new EnumDeclaration(null, null, TokenFactory.tokenFromKeyword(Keyword.ENUM), name, TokenFactory.tokenFromType(TokenType.OPEN_CURLY_BRACKET), constants, TokenFactory.tokenFromType(TokenType.CLOSE_CURLY_BRACKET));
 
   static EnumDeclaration enumDeclaration2(String name, List<String> constantNames) {
     int count = constantNames.length;
@@ -142,9 +194,17 @@
     return enumDeclaration(identifier3(name), constants);
   }
 
-  static ExportDirective exportDirective(List<Annotation> metadata, String uri, List<Combinator> combinators) => new ExportDirective(null, metadata, TokenFactory.tokenFromKeyword(Keyword.EXPORT), string2(uri), list(combinators), TokenFactory.tokenFromType(TokenType.SEMICOLON));
+  static ExportDirective exportDirective(List<Annotation> metadata, String uri, [List<Combinator> combinators])
+      => new ExportDirective(
+          null,
+          metadata,
+          TokenFactory.tokenFromKeyword(Keyword.EXPORT),
+          string2(uri),
+          combinators,
+          TokenFactory.tokenFromType(TokenType.SEMICOLON));
 
-  static ExportDirective exportDirective2(String uri, List<Combinator> combinators) => exportDirective(new List<Annotation>(), uri, combinators);
+  static ExportDirective exportDirective2(String uri, [List<Combinator> combinators])
+      => exportDirective(null, uri, combinators);
 
   static ExpressionFunctionBody expressionFunctionBody(Expression expression) => new ExpressionFunctionBody(null, TokenFactory.tokenFromType(TokenType.FUNCTION), expression, TokenFactory.tokenFromType(TokenType.SEMICOLON));
 
@@ -164,7 +224,13 @@
 
   static ForEachStatement forEachStatement2(SimpleIdentifier identifier, Expression iterator, Statement body) => new ForEachStatement.con2(null, TokenFactory.tokenFromKeyword(Keyword.FOR), TokenFactory.tokenFromType(TokenType.OPEN_PAREN), identifier, TokenFactory.tokenFromKeyword(Keyword.IN), iterator, TokenFactory.tokenFromType(TokenType.CLOSE_PAREN), body);
 
-  static FormalParameterList formalParameterList(List<FormalParameter> parameters) => new FormalParameterList(TokenFactory.tokenFromType(TokenType.OPEN_PAREN), list(parameters), null, null, TokenFactory.tokenFromType(TokenType.CLOSE_PAREN));
+  static FormalParameterList formalParameterList([List<FormalParameter> parameters])
+      => new FormalParameterList(
+          TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
+          parameters,
+          null,
+          null,
+          TokenFactory.tokenFromType(TokenType.CLOSE_PAREN));
 
   static ForStatement forStatement(Expression initialization, Expression condition, List<Expression> updaters, Statement body) => new ForStatement(TokenFactory.tokenFromKeyword(Keyword.FOR), TokenFactory.tokenFromType(TokenType.OPEN_PAREN), null, initialization, TokenFactory.tokenFromType(TokenType.SEMICOLON), condition, TokenFactory.tokenFromType(TokenType.SEMICOLON), updaters, TokenFactory.tokenFromType(TokenType.CLOSE_PAREN), body);
 
@@ -174,23 +240,27 @@
 
   static FunctionDeclarationStatement functionDeclarationStatement(TypeName type, Keyword keyword, String name, FunctionExpression functionExpression) => new FunctionDeclarationStatement(functionDeclaration(type, keyword, name, functionExpression));
 
-  static FunctionExpression functionExpression() => new FunctionExpression(formalParameterList([]), blockFunctionBody2([]));
+  static FunctionExpression functionExpression() => new FunctionExpression(formalParameterList(), blockFunctionBody2());
 
   static FunctionExpression functionExpression2(FormalParameterList parameters, FunctionBody body) => new FunctionExpression(parameters, body);
 
-  static FunctionExpressionInvocation functionExpressionInvocation(Expression function, List<Expression> arguments) => new FunctionExpressionInvocation(function, argumentList(arguments));
+  static FunctionExpressionInvocation functionExpressionInvocation(Expression function, [List<Expression> arguments])
+      => new FunctionExpressionInvocation(function, argumentList(arguments));
 
-  static FunctionTypedFormalParameter functionTypedFormalParameter(TypeName returnType, String identifier, List<FormalParameter> parameters) => new FunctionTypedFormalParameter(null, null, returnType, identifier3(identifier), formalParameterList(parameters));
+  static FunctionTypedFormalParameter functionTypedFormalParameter(TypeName returnType, String identifier, [List<FormalParameter> parameters])
+      => new FunctionTypedFormalParameter(
+          null,
+          null,
+          returnType,
+          identifier3(identifier),
+          formalParameterList(parameters));
 
-  static HideCombinator hideCombinator(List<SimpleIdentifier> identifiers) => new HideCombinator(TokenFactory.tokenFromString("hide"), list(identifiers));
+  static HideCombinator hideCombinator(List<SimpleIdentifier> identifiers) => new HideCombinator(TokenFactory.tokenFromString("hide"), identifiers);
 
-  static HideCombinator hideCombinator2(List<String> identifiers) {
-    List<SimpleIdentifier> identifierList = new List<SimpleIdentifier>();
-    for (String identifier in identifiers) {
-      identifierList.add(identifier3(identifier));
-    }
-    return new HideCombinator(TokenFactory.tokenFromString("hide"), identifierList);
-  }
+  static HideCombinator hideCombinator2(List<String> identifiers)
+      => new HideCombinator(
+          TokenFactory.tokenFromString("hide"),
+          identifierList(identifiers));
 
   static PrefixedIdentifier identifier(SimpleIdentifier prefix, SimpleIdentifier identifier) => new PrefixedIdentifier(prefix, TokenFactory.tokenFromType(TokenType.PERIOD), identifier);
 
@@ -200,25 +270,56 @@
 
   static PrefixedIdentifier identifier5(String prefix, String identifier) => new PrefixedIdentifier(identifier3(prefix), TokenFactory.tokenFromType(TokenType.PERIOD), identifier3(identifier));
 
+  static List<SimpleIdentifier> identifierList(List<String> identifiers) {
+    if (identifiers == null) {
+      return null;
+    }
+    return identifiers.map((String identifier) => identifier3(identifier)).toList();
+  }
+
   static IfStatement ifStatement(Expression condition, Statement thenStatement) => ifStatement2(condition, thenStatement, null);
 
   static IfStatement ifStatement2(Expression condition, Statement thenStatement, Statement elseStatement) => new IfStatement(TokenFactory.tokenFromKeyword(Keyword.IF), TokenFactory.tokenFromType(TokenType.OPEN_PAREN), condition, TokenFactory.tokenFromType(TokenType.CLOSE_PAREN), thenStatement, elseStatement == null ? null : TokenFactory.tokenFromKeyword(Keyword.ELSE), elseStatement);
 
-  static ImplementsClause implementsClause(List<TypeName> types) => new ImplementsClause(TokenFactory.tokenFromKeyword(Keyword.IMPLEMENTS), list(types));
+  static ImplementsClause implementsClause(List<TypeName> types) => new ImplementsClause(TokenFactory.tokenFromKeyword(Keyword.IMPLEMENTS), types);
 
-  static ImportDirective importDirective(List<Annotation> metadata, String uri, bool isDeferred, String prefix, List<Combinator> combinators) => new ImportDirective(null, metadata, TokenFactory.tokenFromKeyword(Keyword.IMPORT), string2(uri), !isDeferred ? null : TokenFactory.tokenFromKeyword(Keyword.DEFERRED), prefix == null ? null : TokenFactory.tokenFromKeyword(Keyword.AS), prefix == null ? null : identifier3(prefix), list(combinators), TokenFactory.tokenFromType(TokenType.SEMICOLON));
+  static ImportDirective importDirective(List<Annotation> metadata, String uri, bool isDeferred, String prefix, [List<Combinator> combinators])
+      => new ImportDirective(
+          null,
+          metadata,
+          TokenFactory.tokenFromKeyword(Keyword.IMPORT),
+          string2(uri),
+          !isDeferred ? null : TokenFactory.tokenFromKeyword(Keyword.DEFERRED),
+          prefix == null ? null : TokenFactory.tokenFromKeyword(Keyword.AS),
+          prefix == null ? null : identifier3(prefix),
+          combinators,
+          TokenFactory.tokenFromType(TokenType.SEMICOLON));
 
-  static ImportDirective importDirective2(String uri, bool isDeferred, String prefix, List<Combinator> combinators) => importDirective(new List<Annotation>(), uri, isDeferred, prefix, combinators);
+  static ImportDirective importDirective2(String uri, bool isDeferred, String prefix, [List<Combinator> combinators])
+      => importDirective(null, uri, isDeferred, prefix, combinators);
 
-  static ImportDirective importDirective3(String uri, String prefix, List<Combinator> combinators) => importDirective(new List<Annotation>(), uri, false, prefix, combinators);
+  static ImportDirective importDirective3(String uri, String prefix, [List<Combinator> combinators])
+      => importDirective(null, uri, false, prefix, combinators);
 
   static IndexExpression indexExpression(Expression array, Expression index) => new IndexExpression.forTarget(array, TokenFactory.tokenFromType(TokenType.OPEN_SQUARE_BRACKET), index, TokenFactory.tokenFromType(TokenType.CLOSE_SQUARE_BRACKET));
 
-  static InstanceCreationExpression instanceCreationExpression(Keyword keyword, ConstructorName name, List<Expression> arguments) => new InstanceCreationExpression(keyword == null ? null : TokenFactory.tokenFromKeyword(keyword), name, argumentList(arguments));
+  static InstanceCreationExpression instanceCreationExpression(Keyword keyword, ConstructorName name, [List<Expression> arguments])
+      => new InstanceCreationExpression(
+          keyword == null ? null : TokenFactory.tokenFromKeyword(keyword),
+          name,
+          argumentList(arguments));
 
-  static InstanceCreationExpression instanceCreationExpression2(Keyword keyword, TypeName type, List<Expression> arguments) => instanceCreationExpression3(keyword, type, null, arguments);
+  static InstanceCreationExpression instanceCreationExpression2(Keyword keyword, TypeName type, [List<Expression> arguments])
+      => instanceCreationExpression3(keyword, type, null, arguments);
 
-  static InstanceCreationExpression instanceCreationExpression3(Keyword keyword, TypeName type, String identifier, List<Expression> arguments) => instanceCreationExpression(keyword, new ConstructorName(type, identifier == null ? null : TokenFactory.tokenFromType(TokenType.PERIOD), identifier == null ? null : identifier3(identifier)), arguments);
+  static InstanceCreationExpression instanceCreationExpression3(Keyword keyword, TypeName type, String identifier, [List<Expression> arguments])
+      => instanceCreationExpression(
+          keyword,
+          new ConstructorName(
+              type,
+              identifier == null ? null : TokenFactory.tokenFromType(TokenType.PERIOD),
+              identifier == null ? null : identifier3(identifier)),
+          arguments);
 
   static IntegerLiteral integer(int value) => new IntegerLiteral(TokenFactory.tokenFromTypeAndString(TokenType.INT, value.toString()), value);
 
@@ -240,31 +341,37 @@
 
   static LibraryDirective libraryDirective2(String libraryName) => libraryDirective(new List<Annotation>(), libraryIdentifier2([libraryName]));
 
-  static LibraryIdentifier libraryIdentifier(List<SimpleIdentifier> components) => new LibraryIdentifier(list(components));
+  static LibraryIdentifier libraryIdentifier(List<SimpleIdentifier> components) => new LibraryIdentifier(components);
 
   static LibraryIdentifier libraryIdentifier2(List<String> components) {
-    List<SimpleIdentifier> componentList = new List<SimpleIdentifier>();
-    for (String component in components) {
-      componentList.add(identifier3(component));
-    }
-    return new LibraryIdentifier(componentList);
+    return new LibraryIdentifier(identifierList(components));
   }
 
   static List list(List<Object> elements) {
-    List elementList = new List();
-    for (Object element in elements) {
-      elementList.add(element);
-    }
-    return elementList;
+    return elements;
   }
 
-  static ListLiteral listLiteral(List<Expression> elements) => listLiteral2(null, null, elements);
+  static ListLiteral listLiteral([List<Expression> elements])
+      => listLiteral2(null, null, elements);
 
-  static ListLiteral listLiteral2(Keyword keyword, TypeArgumentList typeArguments, List<Expression> elements) => new ListLiteral(keyword == null ? null : TokenFactory.tokenFromKeyword(keyword), typeArguments, TokenFactory.tokenFromType(TokenType.OPEN_SQUARE_BRACKET), list(elements), TokenFactory.tokenFromType(TokenType.CLOSE_SQUARE_BRACKET));
+  static ListLiteral listLiteral2(Keyword keyword, TypeArgumentList typeArguments, [List<Expression> elements])
+      => new ListLiteral(
+          keyword == null ? null : TokenFactory.tokenFromKeyword(keyword),
+          typeArguments,
+          TokenFactory.tokenFromType(TokenType.OPEN_SQUARE_BRACKET),
+          elements,
+          TokenFactory.tokenFromType(TokenType.CLOSE_SQUARE_BRACKET));
 
-  static MapLiteral mapLiteral(Keyword keyword, TypeArgumentList typeArguments, List<MapLiteralEntry> entries) => new MapLiteral(keyword == null ? null : TokenFactory.tokenFromKeyword(keyword), typeArguments, TokenFactory.tokenFromType(TokenType.OPEN_CURLY_BRACKET), list(entries), TokenFactory.tokenFromType(TokenType.CLOSE_CURLY_BRACKET));
+  static MapLiteral mapLiteral(Keyword keyword, TypeArgumentList typeArguments, [List<MapLiteralEntry> entries])
+      => new MapLiteral(
+          keyword == null ? null : TokenFactory.tokenFromKeyword(keyword),
+          typeArguments,
+          TokenFactory.tokenFromType(TokenType.OPEN_CURLY_BRACKET),
+          entries,
+          TokenFactory.tokenFromType(TokenType.CLOSE_CURLY_BRACKET));
 
-  static MapLiteral mapLiteral2(List<MapLiteralEntry> entries) => mapLiteral(null, null, entries);
+  static MapLiteral mapLiteral2([List<MapLiteralEntry> entries])
+      => mapLiteral(null, null, entries);
 
   static MapLiteralEntry mapLiteralEntry(String key, Expression value) => new MapLiteralEntry(string2(key), TokenFactory.tokenFromType(TokenType.COLON), value);
 
@@ -272,9 +379,15 @@
 
   static MethodDeclaration methodDeclaration2(Keyword modifier, TypeName returnType, Keyword property, Keyword operator, SimpleIdentifier name, FormalParameterList parameters, FunctionBody body) => new MethodDeclaration(null, null, null, modifier == null ? null : TokenFactory.tokenFromKeyword(modifier), returnType, property == null ? null : TokenFactory.tokenFromKeyword(property), operator == null ? null : TokenFactory.tokenFromKeyword(operator), name, parameters, body);
 
-  static MethodInvocation methodInvocation(Expression target, String methodName, List<Expression> arguments) => new MethodInvocation(target, target == null ? null : TokenFactory.tokenFromType(TokenType.PERIOD), identifier3(methodName), argumentList(arguments));
+  static MethodInvocation methodInvocation(Expression target, String methodName, [List<Expression> arguments])
+      => new MethodInvocation(
+          target,
+          target == null ? null : TokenFactory.tokenFromType(TokenType.PERIOD),
+          identifier3(methodName),
+          argumentList(arguments));
 
-  static MethodInvocation methodInvocation2(String methodName, List<Expression> arguments) => methodInvocation(null, methodName, arguments);
+  static MethodInvocation methodInvocation2(String methodName, [List<Expression> arguments])
+      => methodInvocation(null, methodName, arguments);
 
   static NamedExpression namedExpression(Label label, Expression expression) => new NamedExpression(label, expression);
 
@@ -308,9 +421,15 @@
 
   static PropertyAccess propertyAccess2(Expression target, String propertyName) => new PropertyAccess(target, TokenFactory.tokenFromType(TokenType.PERIOD), identifier3(propertyName));
 
-  static RedirectingConstructorInvocation redirectingConstructorInvocation(List<Expression> arguments) => redirectingConstructorInvocation2(null, arguments);
+  static RedirectingConstructorInvocation redirectingConstructorInvocation([List<Expression> arguments])
+      => redirectingConstructorInvocation2(null, arguments);
 
-  static RedirectingConstructorInvocation redirectingConstructorInvocation2(String constructorName, List<Expression> arguments) => new RedirectingConstructorInvocation(TokenFactory.tokenFromKeyword(Keyword.THIS), constructorName == null ? null : TokenFactory.tokenFromType(TokenType.PERIOD), constructorName == null ? null : identifier3(constructorName), argumentList(arguments));
+  static RedirectingConstructorInvocation redirectingConstructorInvocation2(String constructorName, [List<Expression> arguments])
+      => new RedirectingConstructorInvocation(
+          TokenFactory.tokenFromKeyword(Keyword.THIS),
+          constructorName == null ? null : TokenFactory.tokenFromType(TokenType.PERIOD),
+          constructorName == null ? null : identifier3(constructorName),
+          argumentList(arguments));
 
   static RethrowExpression rethrowExpression() => new RethrowExpression(TokenFactory.tokenFromKeyword(Keyword.RETHROW));
 
@@ -320,15 +439,12 @@
 
   static ScriptTag scriptTag(String scriptTag) => new ScriptTag(TokenFactory.tokenFromString(scriptTag));
 
-  static ShowCombinator showCombinator(List<SimpleIdentifier> identifiers) => new ShowCombinator(TokenFactory.tokenFromString("show"), list(identifiers));
+  static ShowCombinator showCombinator(List<SimpleIdentifier> identifiers) => new ShowCombinator(TokenFactory.tokenFromString("show"), identifiers);
 
-  static ShowCombinator showCombinator2(List<String> identifiers) {
-    List<SimpleIdentifier> identifierList = new List<SimpleIdentifier>();
-    for (String identifier in identifiers) {
-      identifierList.add(identifier3(identifier));
-    }
-    return new ShowCombinator(TokenFactory.tokenFromString("show"), identifierList);
-  }
+  static ShowCombinator showCombinator2(List<String> identifiers)
+      => new ShowCombinator(
+          TokenFactory.tokenFromString("show"),
+          identifierList(identifiers));
 
   static SimpleFormalParameter simpleFormalParameter(Keyword keyword, String parameterName) => simpleFormalParameter2(keyword, null, parameterName);
 
@@ -338,25 +454,32 @@
 
   static SimpleFormalParameter simpleFormalParameter4(TypeName type, String parameterName) => simpleFormalParameter2(null, type, parameterName);
 
-  static StringInterpolation string(List<InterpolationElement> elements) => new StringInterpolation(list(elements));
+  static StringInterpolation string([List<InterpolationElement> elements])
+      => new StringInterpolation(elements);
 
   static SimpleStringLiteral string2(String content) => new SimpleStringLiteral(TokenFactory.tokenFromString("'$content'"), content);
 
-  static SuperConstructorInvocation superConstructorInvocation(List<Expression> arguments) => superConstructorInvocation2(null, arguments);
+  static SuperConstructorInvocation superConstructorInvocation([List<Expression> arguments])
+      => superConstructorInvocation2(null, arguments);
 
-  static SuperConstructorInvocation superConstructorInvocation2(String name, List<Expression> arguments) => new SuperConstructorInvocation(TokenFactory.tokenFromKeyword(Keyword.SUPER), name == null ? null : TokenFactory.tokenFromType(TokenType.PERIOD), name == null ? null : identifier3(name), argumentList(arguments));
+  static SuperConstructorInvocation superConstructorInvocation2(String name, [List<Expression> arguments])
+      => new SuperConstructorInvocation(
+          TokenFactory.tokenFromKeyword(Keyword.SUPER),
+          name == null ? null : TokenFactory.tokenFromType(TokenType.PERIOD),
+          name == null ? null : identifier3(name),
+          argumentList(arguments));
 
   static SuperExpression superExpression() => new SuperExpression(TokenFactory.tokenFromKeyword(Keyword.SUPER));
 
   static SwitchCase switchCase(Expression expression, List<Statement> statements) => switchCase2(new List<Label>(), expression, statements);
 
-  static SwitchCase switchCase2(List<Label> labels, Expression expression, List<Statement> statements) => new SwitchCase(labels, TokenFactory.tokenFromKeyword(Keyword.CASE), expression, TokenFactory.tokenFromType(TokenType.COLON), list(statements));
+  static SwitchCase switchCase2(List<Label> labels, Expression expression, List<Statement> statements) => new SwitchCase(labels, TokenFactory.tokenFromKeyword(Keyword.CASE), expression, TokenFactory.tokenFromType(TokenType.COLON), statements);
 
-  static SwitchDefault switchDefault(List<Label> labels, List<Statement> statements) => new SwitchDefault(labels, TokenFactory.tokenFromKeyword(Keyword.DEFAULT), TokenFactory.tokenFromType(TokenType.COLON), list(statements));
+  static SwitchDefault switchDefault(List<Label> labels, List<Statement> statements) => new SwitchDefault(labels, TokenFactory.tokenFromKeyword(Keyword.DEFAULT), TokenFactory.tokenFromType(TokenType.COLON), statements);
 
   static SwitchDefault switchDefault2(List<Statement> statements) => switchDefault(new List<Label>(), statements);
 
-  static SwitchStatement switchStatement(Expression expression, List<SwitchMember> members) => new SwitchStatement(TokenFactory.tokenFromKeyword(Keyword.SWITCH), TokenFactory.tokenFromType(TokenType.OPEN_PAREN), expression, TokenFactory.tokenFromType(TokenType.CLOSE_PAREN), TokenFactory.tokenFromType(TokenType.OPEN_CURLY_BRACKET), list(members), TokenFactory.tokenFromType(TokenType.CLOSE_CURLY_BRACKET));
+  static SwitchStatement switchStatement(Expression expression, List<SwitchMember> members) => new SwitchStatement(TokenFactory.tokenFromKeyword(Keyword.SWITCH), TokenFactory.tokenFromType(TokenType.OPEN_PAREN), expression, TokenFactory.tokenFromType(TokenType.CLOSE_PAREN), TokenFactory.tokenFromType(TokenType.OPEN_CURLY_BRACKET), members, TokenFactory.tokenFromType(TokenType.CLOSE_CURLY_BRACKET));
 
   static SymbolLiteral symbolLiteral(List<String> components) {
     List<Token> identifierList = new List<Token>();
@@ -366,9 +489,17 @@
     return new SymbolLiteral(TokenFactory.tokenFromType(TokenType.HASH), identifierList);
   }
 
-  static BlockFunctionBody syncBlockFunctionBody(List<Statement> statements) => new BlockFunctionBody(TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "sync"), null, block(statements));
+  static BlockFunctionBody syncBlockFunctionBody([List<Statement> statements])
+      => new BlockFunctionBody(
+          TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "sync"),
+          null,
+          block(statements));
 
-  static BlockFunctionBody syncGeneratorBlockFunctionBody(List<Statement> statements) => new BlockFunctionBody(TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "sync"), TokenFactory.tokenFromType(TokenType.STAR), block(statements));
+  static BlockFunctionBody syncGeneratorBlockFunctionBody([List<Statement> statements])
+     => new BlockFunctionBody(
+         TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "sync"),
+          TokenFactory.tokenFromType(TokenType.STAR),
+          block(statements));
 
   static ThisExpression thisExpression() => new ThisExpression(TokenFactory.tokenFromKeyword(Keyword.THIS));
 
@@ -382,24 +513,30 @@
 
   static TryStatement tryStatement(Block body, Block finallyClause) => tryStatement3(body, new List<CatchClause>(), finallyClause);
 
-  static TryStatement tryStatement2(Block body, List<CatchClause> catchClauses) => tryStatement3(body, list(catchClauses), null);
+  static TryStatement tryStatement2(Block body, List<CatchClause> catchClauses) => tryStatement3(body, catchClauses, null);
 
   static TryStatement tryStatement3(Block body, List<CatchClause> catchClauses, Block finallyClause) => new TryStatement(TokenFactory.tokenFromKeyword(Keyword.TRY), body, catchClauses, finallyClause == null ? null : TokenFactory.tokenFromKeyword(Keyword.FINALLY), finallyClause);
 
   static FunctionTypeAlias typeAlias(TypeName returnType, String name, TypeParameterList typeParameters, FormalParameterList parameters) => new FunctionTypeAlias(null, null, TokenFactory.tokenFromKeyword(Keyword.TYPEDEF), returnType, identifier3(name), typeParameters, parameters, TokenFactory.tokenFromType(TokenType.SEMICOLON));
 
-  static TypeArgumentList typeArgumentList(List<TypeName> typeNames) => new TypeArgumentList(TokenFactory.tokenFromType(TokenType.LT), list(typeNames), TokenFactory.tokenFromType(TokenType.GT));
+  static TypeArgumentList typeArgumentList(List<TypeName> typeNames) {
+    if (typeNames == null || typeNames.length == 0) {
+      return null;
+    }
+    return new TypeArgumentList(
+        TokenFactory.tokenFromType(TokenType.LT),
+        typeNames,
+        TokenFactory.tokenFromType(TokenType.GT));
+  }
 
   /**
-   * Create a type name whose name has been resolved to the given element and whose type has been
-   * resolved to the type of the given element.
+   * Create a type name whose name has been resolved to the given [element] and
+   * whose type has been resolved to the type of the given element.
    *
-   * <b>Note:</b> This method does not correctly handle class elements that have type parameters.
-   *
-   * @param element the element defining the type represented by the type name
-   * @return the type name that was created
+   * <b>Note:</b> This method does not correctly handle class elements that have
+   * type parameters.
    */
-  static TypeName typeName(ClassElement element, List<TypeName> arguments) {
+  static TypeName typeName(ClassElement element, [List<TypeName> arguments]) {
     SimpleIdentifier name = identifier3(element.name);
     name.staticElement = element;
     TypeName typeName = typeName3(name, arguments);
@@ -407,37 +544,35 @@
     return typeName;
   }
 
-  static TypeName typeName3(Identifier name, List<TypeName> arguments) {
-    if (arguments.length == 0) {
-      return new TypeName(name, null);
-    }
-    return new TypeName(name, typeArgumentList(arguments));
-  }
+  static TypeName typeName3(Identifier name, [List<TypeName> arguments])
+      => new TypeName(name, typeArgumentList(arguments));
 
-  static TypeName typeName4(String name, List<TypeName> arguments) {
-    if (arguments.length == 0) {
-      return new TypeName(identifier3(name), null);
-    }
-    return new TypeName(identifier3(name), typeArgumentList(arguments));
-  }
+  static TypeName typeName4(String name, [List<TypeName> arguments])
+      => new TypeName(identifier3(name), typeArgumentList(arguments));
 
   static TypeParameter typeParameter(String name) => new TypeParameter(null, null, identifier3(name), null, null);
 
   static TypeParameter typeParameter2(String name, TypeName bound) => new TypeParameter(null, null, identifier3(name), TokenFactory.tokenFromKeyword(Keyword.EXTENDS), bound);
 
-  static TypeParameterList typeParameterList(List<String> typeNames) {
-    List<TypeParameter> typeParameters = new List<TypeParameter>();
-    for (String typeName in typeNames) {
-      typeParameters.add(typeParameter(typeName));
+  static TypeParameterList typeParameterList([List<String> typeNames]) {
+    List<TypeParameter> typeParameters = null;
+    if (typeNames != null && !typeNames.isEmpty) {
+      typeParameters = new List<TypeParameter>();
+      for (String typeName in typeNames) {
+        typeParameters.add(typeParameter(typeName));
+      }
     }
-    return new TypeParameterList(TokenFactory.tokenFromType(TokenType.LT), typeParameters, TokenFactory.tokenFromType(TokenType.GT));
+    return new TypeParameterList(
+        TokenFactory.tokenFromType(TokenType.LT),
+        typeParameters,
+        TokenFactory.tokenFromType(TokenType.GT));
   }
 
   static VariableDeclaration variableDeclaration(String name) => new VariableDeclaration(null, null, identifier3(name), null, null);
 
   static VariableDeclaration variableDeclaration2(String name, Expression initializer) => new VariableDeclaration(null, null, identifier3(name), TokenFactory.tokenFromType(TokenType.EQ), initializer);
 
-  static VariableDeclarationList variableDeclarationList(Keyword keyword, TypeName type, List<VariableDeclaration> variables) => new VariableDeclarationList(null, null, keyword == null ? null : TokenFactory.tokenFromKeyword(keyword), type, list(variables));
+  static VariableDeclarationList variableDeclarationList(Keyword keyword, TypeName type, List<VariableDeclaration> variables) => new VariableDeclarationList(null, null, keyword == null ? null : TokenFactory.tokenFromKeyword(keyword), type, variables);
 
   static VariableDeclarationList variableDeclarationList2(Keyword keyword, List<VariableDeclaration> variables) => variableDeclarationList(keyword, null, variables);
 
@@ -447,7 +582,7 @@
 
   static WhileStatement whileStatement(Expression condition, Statement body) => new WhileStatement(TokenFactory.tokenFromKeyword(Keyword.WHILE), TokenFactory.tokenFromType(TokenType.OPEN_PAREN), condition, TokenFactory.tokenFromType(TokenType.CLOSE_PAREN), body);
 
-  static WithClause withClause(List<TypeName> types) => new WithClause(TokenFactory.tokenFromKeyword(Keyword.WITH), list(types));
+  static WithClause withClause(List<TypeName> types) => new WithClause(TokenFactory.tokenFromKeyword(Keyword.WITH), types);
 
   static YieldStatement yieldEachStatement(Expression expression) => new YieldStatement(TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "yield"), TokenFactory.tokenFromType(TokenType.STAR), expression, TokenFactory.tokenFromType(TokenType.SEMICOLON));
 
diff --git a/pkg/analyzer/lib/src/generated/testing/element_factory.dart b/pkg/analyzer/lib/src/generated/testing/element_factory.dart
index 44e90c2..a7a52e2 100644
--- a/pkg/analyzer/lib/src/generated/testing/element_factory.dart
+++ b/pkg/analyzer/lib/src/generated/testing/element_factory.dart
@@ -28,28 +28,34 @@
    */
   static ClassElementImpl _objectElement;
 
-  static ClassElementImpl classElement(String typeName, InterfaceType superclassType, List<String> parameterNames) {
+  static ClassElementImpl classElement(String typeName, InterfaceType superclassType, [List<String> parameterNames]) {
     ClassElementImpl element = new ClassElementImpl(typeName, 0);
     element.supertype = superclassType;
     InterfaceTypeImpl type = new InterfaceTypeImpl.con1(element);
     element.type = type;
-    int count = parameterNames.length;
-    if (count > 0) {
-      List<TypeParameterElementImpl> typeParameters = new List<TypeParameterElementImpl>(count);
-      List<TypeParameterTypeImpl> typeParameterTypes = new List<TypeParameterTypeImpl>(count);
-      for (int i = 0; i < count; i++) {
-        TypeParameterElementImpl typeParameter = new TypeParameterElementImpl(parameterNames[i], 0);
-        typeParameters[i] = typeParameter;
-        typeParameterTypes[i] = new TypeParameterTypeImpl(typeParameter);
-        typeParameter.type = typeParameterTypes[i];
+    if (parameterNames != null) {
+      int count = parameterNames.length;
+      if (count > 0) {
+        List<TypeParameterElementImpl> typeParameters
+            = new List<TypeParameterElementImpl>(count);
+        List<TypeParameterTypeImpl> typeParameterTypes
+            = new List<TypeParameterTypeImpl>(count);
+        for (int i = 0; i < count; i++) {
+          TypeParameterElementImpl typeParameter
+              = new TypeParameterElementImpl(parameterNames[i], 0);
+          typeParameters[i] = typeParameter;
+          typeParameterTypes[i] = new TypeParameterTypeImpl(typeParameter);
+          typeParameter.type = typeParameterTypes[i];
+        }
+        element.typeParameters = typeParameters;
+        type.typeArguments = typeParameterTypes;
       }
-      element.typeParameters = typeParameters;
-      type.typeArguments = typeParameterTypes;
     }
     return element;
   }
 
-  static ClassElementImpl classElement2(String typeName, List<String> parameterNames) => classElement(typeName, objectType, parameterNames);
+  static ClassElementImpl classElement2(String typeName, [List<String> parameterNames])
+      => classElement(typeName, objectType, parameterNames);
 
   static CompilationUnitElementImpl compilationUnit(String fileName) {
     Source source = new NonExistingSource(fileName, UriKind.FILE_URI);
@@ -58,28 +64,33 @@
     return unit;
   }
 
-  static ConstructorElementImpl constructorElement(ClassElement definingClass, String name, bool isConst, List<DartType> argumentTypes) {
+  static ConstructorElementImpl constructorElement(ClassElement definingClass, String name, bool isConst, [List<DartType> argumentTypes]) {
     DartType type = definingClass.type;
     ConstructorElementImpl constructor = name == null ? new ConstructorElementImpl("", -1) : new ConstructorElementImpl(name, 0);
     constructor.const2 = isConst;
-    int count = argumentTypes.length;
-    List<ParameterElement> parameters = new List<ParameterElement>(count);
-    for (int i = 0; i < count; i++) {
-      ParameterElementImpl parameter = new ParameterElementImpl("a$i", i);
-      parameter.type = argumentTypes[i];
-      parameter.parameterKind = ParameterKind.REQUIRED;
-      parameters[i] = parameter;
+    if (argumentTypes != null) {
+      int count = argumentTypes.length;
+      List<ParameterElement> parameters = new List<ParameterElement>(count);
+      for (int i = 0; i < count; i++) {
+        ParameterElementImpl parameter = new ParameterElementImpl("a$i", i);
+        parameter.type = argumentTypes[i];
+        parameter.parameterKind = ParameterKind.REQUIRED;
+        parameters[i] = parameter;
+      }
+      constructor.parameters = parameters;
+    } else {
+      constructor.parameters = <ParameterElement>[];
     }
-    constructor.parameters = parameters;
     constructor.returnType = type;
     FunctionTypeImpl constructorType = new FunctionTypeImpl.con1(constructor);
     constructor.type = constructorType;
     return constructor;
   }
 
-  static ConstructorElementImpl constructorElement2(ClassElement definingClass, String name, List<DartType> argumentTypes) => constructorElement(definingClass, name, false, argumentTypes);
+  static ConstructorElementImpl constructorElement2(ClassElement definingClass, String name, [List<DartType> argumentTypes])
+      => constructorElement(definingClass, name, false, argumentTypes);
 
-  static ClassElementImpl enumElement(TypeProvider typeProvider, String enumName, List<String> constantNames) {
+  static ClassElementImpl enumElement(TypeProvider typeProvider, String enumName, [List<String> constantNames]) {
     //
     // Build the enum.
     //
@@ -111,19 +122,21 @@
     //
     // Build the enum constants.
     //
-    int constantCount = constantNames.length;
-    for (int i = 0; i < constantCount; i++) {
-      String constantName = constantNames[i];
-      FieldElementImpl constantElement = new ConstFieldElementImpl.con2(constantName, -1);
-      constantElement.static = true;
-      constantElement.const3 = true;
-      constantElement.type = enumType;
-      HashMap<String, DartObjectImpl> fieldMap = new HashMap<String, DartObjectImpl>();
-      fieldMap[indexFieldName] = new DartObjectImpl(intType, new IntState(i));
-      fieldMap[nameFieldName] = new DartObjectImpl(stringType, new StringState(constantName));
-      DartObjectImpl value = new DartObjectImpl(enumType, new GenericState(fieldMap));
-      constantElement.evaluationResult = new EvaluationResultImpl.con1(value);
-      fields.add(constantElement);
+    if (constantNames != null) {
+      int constantCount = constantNames.length;
+      for (int i = 0; i < constantCount; i++) {
+        String constantName = constantNames[i];
+        FieldElementImpl constantElement = new ConstFieldElementImpl.con2(constantName, -1);
+        constantElement.static = true;
+        constantElement.const3 = true;
+        constantElement.type = enumType;
+        HashMap<String, DartObjectImpl> fieldMap = new HashMap<String, DartObjectImpl>();
+        fieldMap[indexFieldName] = new DartObjectImpl(intType, new IntState(i));
+        fieldMap[nameFieldName] = new DartObjectImpl(stringType, new StringState(constantName));
+        DartObjectImpl value = new DartObjectImpl(enumType, new GenericState(fieldMap));
+        constantElement.evaluationResult = new EvaluationResultImpl.con1(value);
+        fields.add(constantElement);
+      }
     }
     //
     // Finish building the enum.
@@ -133,7 +146,7 @@
     return enumElement;
   }
 
-  static ExportElementImpl exportFor(LibraryElement exportedLibrary, List<NamespaceCombinator> combinators) {
+  static ExportElementImpl exportFor(LibraryElement exportedLibrary, [List<NamespaceCombinator> combinators = NamespaceCombinator.EMPTY_ARRAY]) {
     ExportElementImpl spec = new ExportElementImpl();
     spec.exportedLibrary = exportedLibrary;
     spec.combinators = combinators;
@@ -258,7 +271,7 @@
 
   static ClassElementImpl get object {
     if (_objectElement == null) {
-      _objectElement = classElement("Object", null, []);
+      _objectElement = classElement("Object", null);
     }
     return _objectElement;
   }
@@ -287,7 +300,7 @@
     return unit;
   }
 
-  static ImportElementImpl importFor(LibraryElement importedLibrary, PrefixElement prefix, List<NamespaceCombinator> combinators) {
+  static ImportElementImpl importFor(LibraryElement importedLibrary, PrefixElement prefix, [List<NamespaceCombinator> combinators = NamespaceCombinator.EMPTY_ARRAY]) {
     ImportElementImpl spec = new ImportElementImpl(0);
     spec.importedLibrary = importedLibrary;
     spec.prefix = prefix;
@@ -307,17 +320,21 @@
 
   static LocalVariableElementImpl localVariableElement2(String name) => new LocalVariableElementImpl(name, 0);
 
-  static MethodElementImpl methodElement(String methodName, DartType returnType, List<DartType> argumentTypes) {
+  static MethodElementImpl methodElement(String methodName, DartType returnType, [List<DartType> argumentTypes]) {
     MethodElementImpl method = new MethodElementImpl(methodName, 0);
-    int count = argumentTypes.length;
-    List<ParameterElement> parameters = new List<ParameterElement>(count);
-    for (int i = 0; i < count; i++) {
-      ParameterElementImpl parameter = new ParameterElementImpl("a$i", i);
-      parameter.type = argumentTypes[i];
-      parameter.parameterKind = ParameterKind.REQUIRED;
-      parameters[i] = parameter;
+    if (argumentTypes == null) {
+      method.parameters = ParameterElementImpl.EMPTY_ARRAY;
+    } else {
+      int count = argumentTypes.length;
+      List<ParameterElement> parameters = new List<ParameterElement>(count);
+      for (int i = 0; i < count; i++) {
+        ParameterElementImpl parameter = new ParameterElementImpl("a$i", i);
+        parameter.type = argumentTypes[i];
+        parameter.parameterKind = ParameterKind.REQUIRED;
+        parameters[i] = parameter;
+      }
+      method.parameters = parameters;
     }
-    method.parameters = parameters;
     method.returnType = returnType;
     FunctionTypeImpl methodType = new FunctionTypeImpl.con1(method);
     method.type = methodType;
diff --git a/pkg/analyzer/lib/src/generated/testing/html_factory.dart b/pkg/analyzer/lib/src/generated/testing/html_factory.dart
index 514ceaa..4be90d1 100644
--- a/pkg/analyzer/lib/src/generated/testing/html_factory.dart
+++ b/pkg/analyzer/lib/src/generated/testing/html_factory.dart
@@ -32,7 +32,7 @@
     return new Token.con1(TokenType.LT_SLASH, 0);
   }
 
-  static HtmlScriptTagNode scriptTag(List<XmlAttributeNode> attributes) {
+  static HtmlScriptTagNode scriptTag([List<XmlAttributeNode> attributes = XmlAttributeNode.EMPTY_LIST]) {
     return new HtmlScriptTagNode(
         ltToken(),
         stringToken("script"),
@@ -45,7 +45,7 @@
   }
 
   static HtmlScriptTagNode scriptTagWithContent(String contents,
-      List<XmlAttributeNode> attributes) {
+      [List<XmlAttributeNode> attributes = XmlAttributeNode.EMPTY_LIST]) {
     Token attributeEnd = gtToken();
     Token contentToken = stringToken(contents);
     attributeEnd.setNext(contentToken);
@@ -70,7 +70,7 @@
     return new Token.con2(TokenType.STRING, 0, value);
   }
 
-  static XmlTagNode tagNode(String name, List<XmlAttributeNode> attributes) {
+  static XmlTagNode tagNode(String name, [List<XmlAttributeNode> attributes = XmlAttributeNode.EMPTY_LIST]) {
     return new XmlTagNode(
         ltToken(),
         stringToken(name),
diff --git a/pkg/analyzer/lib/src/services/formatter_impl.dart b/pkg/analyzer/lib/src/services/formatter_impl.dart
index 68725e7..4c0757a 100644
--- a/pkg/analyzer/lib/src/services/formatter_impl.dart
+++ b/pkg/analyzer/lib/src/services/formatter_impl.dart
@@ -1294,7 +1294,6 @@
   visitSymbolLiteral(SymbolLiteral node) {
     token(node.poundSign);
     var components = node.components;
-    var size = components.length;
     for (var component in components) {
       // The '.' separator
       if (component.previous.lexeme == '.') {
diff --git a/pkg/analyzer/lib/src/services/writer.dart b/pkg/analyzer/lib/src/services/writer.dart
index 6c4ae5c..31dbbe2 100644
--- a/pkg/analyzer/lib/src/services/writer.dart
+++ b/pkg/analyzer/lib/src/services/writer.dart
@@ -157,7 +157,6 @@
                 newChunks.add(chunk.subChunk(newIndent, start));
               }
             } else {
-              List<LineToken> part = [];
               int start = 0;
               for (int i = 0; i < tokens.length; i++) {
                 LineToken token = tokens[i];
diff --git a/pkg/analyzer/test/enum_test.dart b/pkg/analyzer/test/enum_test.dart
index 234e8cc..22d1769 100644
--- a/pkg/analyzer/test/enum_test.dart
+++ b/pkg/analyzer/test/enum_test.dart
@@ -13,7 +13,6 @@
 import 'package:analyzer/src/generated/html.dart' as html;
 import 'package:analyzer/src/generated/instrumentation.dart';
 import 'package:analyzer/src/generated/java_core.dart';
-import 'package:analyzer/src/generated/parser.dart';
 import 'package:analyzer/src/generated/resolver.dart';
 import 'package:analyzer/src/generated/scanner.dart' as scanner;
 import 'package:analyzer/src/generated/source.dart';
@@ -37,12 +36,6 @@
         ..check_explicit_values();
   }
 
-  void test_AngularCode() {
-    new EnumTester<AngularCode>()
-        ..check_getters()
-        ..check_explicit_values();
-  }
-
   void test_AngularPropertyKind() {
     new EnumTester<AngularPropertyKind>()
         ..check_getters()
@@ -61,24 +54,12 @@
         ..check_explicit_values();
   }
 
-  void test_CheckedModeCompileTimeErrorCode() {
-    new EnumTester<CheckedModeCompileTimeErrorCode>()
-        ..check_getters()
-        ..check_explicit_values();
-  }
-
   void test_CommentType() {
     new EnumTester<CommentType>()
         ..check_getters()
         ..check_explicit_values();
   }
 
-  void test_CompileTimeErrorCode() {
-    new EnumTester<CompileTimeErrorCode>()
-        ..check_getters()
-        ..check_explicit_values();
-  }
-
   void test_ElementKind() {
     new EnumTester<ElementKind>()
         ..check_getters()
@@ -103,24 +84,12 @@
         ..check_explicit_values();
   }
 
-  void test_HintCode() {
-    new EnumTester<HintCode>()
-        ..check_getters()
-        ..check_explicit_values();
-  }
-
   void test_html_TokenType() {
     new EnumTester<html.TokenType>()
         ..check_getters()
         ..check_explicit_values();
   }
 
-  void test_HtmlWarningCode() {
-    new EnumTester<HtmlWarningCode>()
-        ..check_getters()
-        ..check_explicit_values();
-  }
-
   void test_INIT_STATE() {
     new EnumTester<INIT_STATE>()
         ..check_getters()
@@ -151,30 +120,12 @@
         ..check_explicit_values();
   }
 
-  void test_ParserErrorCode() {
-    new EnumTester<ParserErrorCode>()
-        ..check_getters()
-        ..check_explicit_values();
-  }
-
-  void test_PolymerCode() {
-    new EnumTester<PolymerCode>()
-        ..check_getters()
-        ..check_explicit_values();
-  }
-
   void test_RedirectingConstructorKind() {
     new EnumTester<RedirectingConstructorKind>()
         ..check_getters()
         ..check_explicit_values();
   }
 
-  void test_ResolverErrorCode() {
-    new EnumTester<ResolverErrorCode>()
-        ..check_getters()
-        ..check_explicit_values();
-  }
-
   void test_RetentionPriority() {
     new EnumTester<RetentionPriority>()
         ..check_getters()
@@ -187,12 +138,6 @@
         ..check_explicit_values();
   }
 
-  void test_ScannerErrorCode() {
-    new EnumTester<scanner.ScannerErrorCode>()
-        ..check_getters()
-        ..check_explicit_values();
-  }
-
   void test_SourceKind() {
     new EnumTester<SourceKind>()
         ..check_getters()
@@ -205,24 +150,6 @@
         ..check_explicit_values();
   }
 
-  void test_StaticTypeWarningCode() {
-    new EnumTester<StaticTypeWarningCode>()
-        ..check_getters()
-        ..check_explicit_values();
-  }
-
-  void test_StaticWarningCode() {
-    new EnumTester<StaticWarningCode>()
-        ..check_getters()
-        ..check_explicit_values();
-  }
-
-  void test_TodoCode() {
-    new EnumTester<TodoCode>(ignoreGetters: ['TODO_REGEX'])
-        ..check_getters()
-        ..check_explicit_values();
-  }
-
   void test_TokenClass() {
     new EnumTester<scanner.TokenClass>()
         ..check_getters()
diff --git a/pkg/analyzer/test/file_system/memory_file_system_test.dart b/pkg/analyzer/test/file_system/memory_file_system_test.dart
index d0a1871..458c2c4 100644
--- a/pkg/analyzer/test/file_system/memory_file_system_test.dart
+++ b/pkg/analyzer/test/file_system/memory_file_system_test.dart
@@ -151,7 +151,7 @@
         });
 
         test('as file', () {
-          File file = provider.newFile('/my/file', 'qwerty');
+          provider.newFile('/my/file', 'qwerty');
           expect(() {
             provider.newFolder('/my/file');
           }, throwsA(new isInstanceOf<ArgumentError>()));
diff --git a/pkg/analyzer/test/generated/all_the_rest.dart b/pkg/analyzer/test/generated/all_the_rest.dart
index 4e86f49..128ea5d 100644
--- a/pkg/analyzer/test/generated/all_the_rest.dart
+++ b/pkg/analyzer/test/generated/all_the_rest.dart
@@ -1854,7 +1854,7 @@
   }
 
   void test_getAngularElement_notLocal() {
-    Element element = ElementFactory.classElement2("Test", []);
+    Element element = ElementFactory.classElement2("Test");
     expect(AngularHtmlUnitResolver.getAngularElement(element), isNull);
   }
 
@@ -2235,7 +2235,7 @@
     assertResolvedIdentifier2("ctrl", "MyController");
   }
 
-  void test_resolveExpression_withFilter() {
+  void test_resolveExpression_withFormatter() {
     addMyController();
     _resolveIndexNoErrors(
         AngularTest.createHtmlWithMyController("{{ctrl.field | uppercase}}"));
@@ -2243,7 +2243,14 @@
     assertResolvedIdentifier("uppercase");
   }
 
-  void test_resolveExpression_withFilter_notSimpleIdentifier() {
+  void test_resolveExpression_withFormatter_missingColon() {
+    addMyController();
+    resolveIndex2(
+        AngularTest.createHtmlWithMyController("{{ctrl.field | uppercase, lowercase}}"));
+    assertErrors(indexSource, [AngularCode.MISSING_FORMATTER_COLON]);
+  }
+
+  void test_resolveExpression_withFormatter_notSimpleIdentifier() {
     addMyController();
     resolveIndex2(
         AngularTest.createHtmlWithMyController("{{ctrl.field | not.supported}}"));
@@ -2601,7 +2608,7 @@
    * @throws AssertionFailedError if a different number of errors have been reported than were
    *           expected
    */
-  void assertErrors(Source source, List<ErrorCode> expectedErrorCodes) {
+  void assertErrors(Source source, [List<ErrorCode> expectedErrorCodes = ErrorCode.EMPTY_LIST]) {
     GatheringErrorListener errorListener = new GatheringErrorListener();
     AnalysisErrorInfo errorsInfo = context.getErrors(source);
     for (AnalysisError error in errorsInfo.errors) {
@@ -2618,18 +2625,18 @@
    * Assert that no errors have been reported against the [indexSource].
    */
   void assertNoErrors() {
-    assertErrors(indexSource, []);
+    assertErrors(indexSource);
   }
 
   void assertNoErrors2(Source source) {
-    assertErrors(source, []);
+    assertErrors(source);
   }
 
   /**
    * Assert that no errors have been reported against the [mainSource].
    */
   void assertNoMainErrors() {
-    assertErrors(mainSource, []);
+    assertErrors(mainSource);
   }
 
   /**
@@ -3470,12 +3477,12 @@
             null,
             null,
             name,
-            AstFactory.formalParameterList([]),
+            AstFactory.formalParameterList(),
             null,
-            AstFactory.blockFunctionBody2([]));
-    ClassElement classElement = ElementFactory.classElement2(name, []);
+            AstFactory.blockFunctionBody2());
+    ClassElement classElement = ElementFactory.classElement2(name);
     ConstructorElement element =
-        ElementFactory.constructorElement(classElement, name, isConst, []);
+        ElementFactory.constructorElement(classElement, name, isConst);
     constructorDeclaration.element = element;
     _node = constructorDeclaration;
     return element;
@@ -3484,8 +3491,7 @@
   void _setupInstanceCreationExpression(String name, bool isConst) {
     _node = AstFactory.instanceCreationExpression2(
         isConst ? Keyword.CONST : null,
-        AstFactory.typeName3(AstFactory.identifier3(name), []),
-        []);
+        AstFactory.typeName3(AstFactory.identifier3(name)));
   }
 
   VariableElement _setupVariableDeclaration(String name, bool isConst,
@@ -3609,8 +3615,7 @@
 class A {
   const A();
 }
-const x = const A();''',
-        []);
+const x = const A();''');
   }
 
   void test_dependencyOnConstructorArgument() {
@@ -3621,8 +3626,7 @@
   final A next;
 }
 const A x = const A(null);
-const A y = const A(x);''',
-        []);
+const A y = const A(x);''');
   }
 
   void test_dependencyOnConstructorArgument_unresolvedConstructor() {
@@ -3642,8 +3646,7 @@
 class A {
   const A() : v = x;
   final int v;
-}''',
-        []);
+}''');
   }
 
   void test_dependencyOnExplicitSuperConstructor() {
@@ -3656,8 +3659,7 @@
 class B extends A {
   const B() : super(5);
 }
-const B b = const B();''',
-        []);
+const B b = const B();''');
   }
 
   void test_dependencyOnExplicitSuperConstructorParameters() {
@@ -3671,8 +3673,7 @@
   const B() : super(i);
 }
 const B b = const B();
-const int i = 5;''',
-        []);
+const int i = 5;''');
   }
 
   void test_dependencyOnFactoryRedirect() {
@@ -3682,8 +3683,7 @@
 class A {
   factory const A.foo() = A.bar;
   const A.bar();
-}''',
-        []);
+}''');
   }
 
   void test_dependencyOnFactoryRedirectWithTypeParams() {
@@ -3697,8 +3697,7 @@
   const B(this.x);
 }
 
-const A a = const A(10);''',
-        []);
+const A a = const A(10);''');
   }
 
   void test_dependencyOnImplicitSuperConstructor() {
@@ -3711,8 +3710,7 @@
 class B extends A {
   const B();
 }
-const B b = const B();''',
-        []);
+const B b = const B();''');
   }
 
   void test_dependencyOnNonFactoryRedirect() {
@@ -3722,8 +3720,7 @@
 class A {
   const A.foo() : this.bar();
   const A.bar();
-}''',
-        []);
+}''');
   }
 
   void test_dependencyOnNonFactoryRedirect_arg() {
@@ -3735,8 +3732,7 @@
   const A.foo() : this.bar(b);
   const A.bar(x) : y = x;
   final int y;
-}''',
-        []);
+}''');
   }
 
   void test_dependencyOnNonFactoryRedirect_defaultValue() {
@@ -3748,8 +3744,7 @@
   const A.foo() : this.bar();
   const A.bar([x = b]) : y = x;
   final int y;
-}''',
-        []);
+}''');
   }
 
   void test_dependencyOnNonFactoryRedirect_toMissing() {
@@ -3771,8 +3766,7 @@
 class A {
   const A.foo() : this.bar();
   A.bar();
-}''',
-        []);
+}''');
   }
 
   void test_dependencyOnNonFactoryRedirect_unnamed() {
@@ -3782,8 +3776,7 @@
 class A {
   const A.foo() : this();
   const A();
-}''',
-        []);
+}''');
   }
 
   void test_dependencyOnOptionalParameterDefault() {
@@ -3796,16 +3789,14 @@
 class B {
   const B();
 }
-const A a = const A();''',
-        []);
+const A a = const A();''');
   }
 
   void test_dependencyOnVariable() {
     // x depends on y
     _assertProperDependencies(r'''
 const x = y + 1;
-const y = 2;''',
-        []);
+const y = 2;''');
   }
 
   void test_fromEnvironment_bool_default_false() {
@@ -4043,7 +4034,7 @@
     CompilationUnit compilationUnit = resolveSource(r'''
 const foo = const B(4);
 class A {
-  const A() : x(3);
+  const A() : x = 3;
   final int x;
 }
 class B extends A {
@@ -4349,7 +4340,7 @@
   }
 
   void _assertProperDependencies(String sourceText,
-      List<ErrorCode> expectedErrorCodes) {
+      [List<ErrorCode> expectedErrorCodes = ErrorCode.EMPTY_LIST]) {
     Source source = addSource(sourceText);
     LibraryElement element = resolve(source);
     CompilationUnit unit =
@@ -4569,12 +4560,11 @@
     errorListener.assertNoErrors();
   }
 
-  void
-      test_visitConditionalExpression_instanceCreation_invalidFieldInitializer() {
+  void test_visitConditionalExpression_instanceCreation_invalidFieldInitializer() {
     TestTypeProvider typeProvider = new TestTypeProvider();
     LibraryElementImpl libraryElement = ElementFactory.library(null, "lib");
     String className = "C";
-    ClassElementImpl classElement = ElementFactory.classElement2(className, []);
+    ClassElementImpl classElement = ElementFactory.classElement2(className);
     (libraryElement.definingCompilationUnit as CompilationUnitElementImpl).types =
         <ClassElement>[classElement];
     ConstructorElementImpl constructorElement =
@@ -4588,7 +4578,7 @@
     InstanceCreationExpression expression =
         AstFactory.instanceCreationExpression2(
             Keyword.CONST,
-            AstFactory.typeName4(className, []),
+            AstFactory.typeName4(className),
             [AstFactory.integer(0)]);
     expression.staticElement = constructorElement;
     GatheringErrorListener errorListener = new GatheringErrorListener();
@@ -5019,19 +5009,19 @@
   }
 
   void test_equalEqual_list_empty() {
-    _assertEqualEqual(null, _listValue([]), _listValue([]));
+    _assertEqualEqual(null, _listValue(), _listValue());
   }
 
   void test_equalEqual_list_false() {
-    _assertEqualEqual(null, _listValue([]), _listValue([]));
+    _assertEqualEqual(null, _listValue(), _listValue());
   }
 
   void test_equalEqual_map_empty() {
-    _assertEqualEqual(null, _mapValue([]), _mapValue([]));
+    _assertEqualEqual(null, _mapValue(), _mapValue());
   }
 
   void test_equalEqual_map_false() {
-    _assertEqualEqual(null, _mapValue([]), _mapValue([]));
+    _assertEqualEqual(null, _mapValue(), _mapValue());
   }
 
   void test_equalEqual_null() {
@@ -5069,7 +5059,7 @@
   }
 
   void test_equals_list_true_empty() {
-    expect(_listValue([]), _listValue([]));
+    expect(_listValue(), _listValue());
   }
 
   void test_equals_list_true_nonEmpty() {
@@ -5077,7 +5067,7 @@
   }
 
   void test_equals_map_true_empty() {
-    expect(_mapValue([]), _mapValue([]));
+    expect(_mapValue(), _mapValue());
   }
 
   void test_equals_symbol_false() {
@@ -5119,7 +5109,7 @@
   }
 
   void test_getValue_list_empty() {
-    Object result = _listValue([]).value;
+    Object result = _listValue().value;
     _assertInstanceOfObjectArray(result);
     List<Object> array = result as List<Object>;
     expect(array, hasLength(0));
@@ -5133,7 +5123,7 @@
   }
 
   void test_getValue_map_empty() {
-    Object result = _mapValue([]).value;
+    Object result = _mapValue().value;
     EngineTestCase.assertInstanceOf((obj) => obj is Map, Map, result);
     Map map = result as Map;
     expect(map, hasLength(0));
@@ -5351,7 +5341,7 @@
   }
 
   void test_hasExactValue_list_empty() {
-    expect(_listValue([]).hasExactValue, isTrue);
+    expect(_listValue().hasExactValue, isTrue);
   }
 
   void test_hasExactValue_list_invalid() {
@@ -5363,7 +5353,7 @@
   }
 
   void test_hasExactValue_map_empty() {
-    expect(_mapValue([]).hasExactValue, isTrue);
+    expect(_mapValue().hasExactValue, isTrue);
   }
 
   void test_hasExactValue_map_invalidKey() {
@@ -5431,20 +5421,20 @@
   }
 
   void test_identical_list_empty() {
-    _assertIdentical(_boolValue(true), _listValue([]), _listValue([]));
+    _assertIdentical(_boolValue(true), _listValue(), _listValue());
   }
 
   void test_identical_list_false() {
-    _assertIdentical(_boolValue(false), _listValue([]),
+    _assertIdentical(_boolValue(false), _listValue(),
         _listValue([_intValue(3)]));
   }
 
   void test_identical_map_empty() {
-    _assertIdentical(_boolValue(true), _mapValue([]), _mapValue([]));
+    _assertIdentical(_boolValue(true), _mapValue(), _mapValue());
   }
 
   void test_identical_map_false() {
-    _assertIdentical(_boolValue(false), _mapValue([]),
+    _assertIdentical(_boolValue(false), _mapValue(),
         _mapValue([_intValue(1), _intValue(2)]));
   }
 
@@ -5564,7 +5554,7 @@
   }
 
   void test_isBoolNumStringOrNull_list() {
-    expect(_listValue([]).isBoolNumStringOrNull, isFalse);
+    expect(_listValue().isBoolNumStringOrNull, isFalse);
   }
 
   void test_isBoolNumStringOrNull_null() {
@@ -6939,11 +6929,11 @@
     }
   }
 
-  DartObjectImpl _listValue(List<DartObjectImpl> elements) {
+  DartObjectImpl _listValue([List<DartObjectImpl> elements = DartObjectImpl.EMPTY_LIST]) {
     return new DartObjectImpl(_typeProvider.listType, new ListState(elements));
   }
 
-  DartObjectImpl _mapValue(List<DartObjectImpl> keyElementPairs) {
+  DartObjectImpl _mapValue([List<DartObjectImpl> keyElementPairs = DartObjectImpl.EMPTY_LIST]) {
     Map<DartObjectImpl, DartObjectImpl> map =
         new Map<DartObjectImpl, DartObjectImpl>();
     int count = keyElementPairs.length;
@@ -7254,7 +7244,7 @@
     String exceptionParameterName = "e";
     String stackParameterName = "s";
     CatchClause clause =
-        AstFactory.catchClause2(exceptionParameterName, stackParameterName, []);
+        AstFactory.catchClause2(exceptionParameterName, stackParameterName);
     clause.accept(builder);
     List<LocalVariableElement> variables = holder.localVariables;
     expect(variables, hasLength(2));
@@ -7284,8 +7274,7 @@
         null,
         null,
         null,
-        null,
-        []);
+        null);
     classDeclaration.accept(builder);
     List<ClassElement> types = holder.types;
     expect(types, hasLength(1));
@@ -7303,7 +7292,7 @@
     ElementBuilder builder = new ElementBuilder(holder);
     String className = "C";
     ClassDeclaration classDeclaration =
-        AstFactory.classDeclaration(null, className, null, null, null, null, []);
+        AstFactory.classDeclaration(null, className, null, null, null, null);
     classDeclaration.accept(builder);
     List<ClassElement> types = holder.types;
     expect(types, hasLength(1));
@@ -7328,8 +7317,7 @@
         AstFactory.typeParameterList([firstVariableName, secondVariableName]),
         null,
         null,
-        null,
-        []);
+        null);
     classDeclaration.accept(builder);
     List<ClassElement> types = holder.types;
     expect(types, hasLength(1));
@@ -7369,8 +7357,8 @@
                 null,
                 null,
                 AstFactory.identifier3(methodName),
-                AstFactory.formalParameterList([]),
-                AstFactory.blockFunctionBody2([]))]);
+                AstFactory.formalParameterList(),
+                AstFactory.blockFunctionBody2())]);
     classDeclaration.accept(builder);
     List<ClassElement> types = holder.types;
     expect(types, hasLength(1));
@@ -7396,6 +7384,83 @@
     expect(method.name, methodName);
   }
 
+  void test_visitClassTypeAlias() {
+    // class B {}
+    // class M {}
+    // class C = B with M
+    ElementHolder holder = new ElementHolder();
+    ElementBuilder builder = new ElementBuilder(holder);
+    ClassElementImpl classB = ElementFactory.classElement2('B', []);
+    ConstructorElementImpl constructorB =
+        ElementFactory.constructorElement2(classB, '', []);
+    constructorB.setModifier(Modifier.SYNTHETIC, true);
+    classB.constructors = [constructorB];
+    ClassElement classM = ElementFactory.classElement2('M', []);
+    WithClause withClause =
+        AstFactory.withClause([AstFactory.typeName(classM, [])]);
+    ClassTypeAlias alias = AstFactory.classTypeAlias('C', null, null,
+        AstFactory.typeName(classB, []), withClause, null);
+    alias.accept(builder);
+    List<ClassElement> types = holder.types;
+    expect(types, hasLength(1));
+    ClassElement type = types[0];
+    expect(alias.element, same(type));
+    expect(type.name, equals('C'));
+    expect(type.isAbstract, isFalse);
+    expect(type.isSynthetic, isFalse);
+    expect(type.typeParameters, isEmpty);
+    expect(type.fields, isEmpty);
+    expect(type.methods, isEmpty);
+  }
+
+  void test_visitClassTypeAlias_abstract() {
+    // class B {}
+    // class M {}
+    // abstract class C = B with M
+    ElementHolder holder = new ElementHolder();
+    ElementBuilder builder = new ElementBuilder(holder);
+    ClassElementImpl classB = ElementFactory.classElement2('B', []);
+    ConstructorElementImpl constructorB =
+        ElementFactory.constructorElement2(classB, '', []);
+    constructorB.setModifier(Modifier.SYNTHETIC, true);
+    classB.constructors = [constructorB];
+    ClassElement classM = ElementFactory.classElement2('M', []);
+    WithClause withClause =
+        AstFactory.withClause([AstFactory.typeName(classM, [])]);
+    ClassTypeAlias classCAst = AstFactory.classTypeAlias('C', null,
+        Keyword.ABSTRACT, AstFactory.typeName(classB, []), withClause, null);
+    classCAst.accept(builder);
+    List<ClassElement> types = holder.types;
+    expect(types, hasLength(1));
+    ClassElement type = types[0];
+    expect(type.isAbstract, isTrue);
+  }
+
+  void test_visitClassTypeAlias_typeParams() {
+    // class B {}
+    // class M {}
+    // class C<T> = B with M
+    ElementHolder holder = new ElementHolder();
+    ElementBuilder builder = new ElementBuilder(holder);
+    ClassElementImpl classB = ElementFactory.classElement2('B', []);
+    ConstructorElementImpl constructorB =
+        ElementFactory.constructorElement2(classB, '', []);
+    constructorB.setModifier(Modifier.SYNTHETIC, true);
+    classB.constructors = [constructorB];
+    ClassElementImpl classM = ElementFactory.classElement2('M', []);
+    WithClause withClause =
+        AstFactory.withClause([AstFactory.typeName(classM, [])]);
+    ClassTypeAlias classCAst = AstFactory.classTypeAlias('C',
+        AstFactory.typeParameterList(['T']), null,
+        AstFactory.typeName(classB, []), withClause, null);
+    classCAst.accept(builder);
+    List<ClassElement> types = holder.types;
+    expect(types, hasLength(1));
+    ClassElement type = types[0];
+    expect(type.typeParameters, hasLength(1));
+    expect(type.typeParameters[0].name, equals('T'));
+  }
+
   void test_visitConstructorDeclaration_factory() {
     ElementHolder holder = new ElementHolder();
     ElementBuilder builder = new ElementBuilder(holder);
@@ -7406,9 +7471,9 @@
             Keyword.FACTORY,
             AstFactory.identifier3(className),
             null,
-            AstFactory.formalParameterList([]),
+            AstFactory.formalParameterList(),
             null,
-            AstFactory.blockFunctionBody2([]));
+            AstFactory.blockFunctionBody2());
     constructorDeclaration.accept(builder);
     List<ConstructorElement> constructors = holder.constructors;
     expect(constructors, hasLength(1));
@@ -7432,9 +7497,9 @@
             null,
             AstFactory.identifier3(className),
             null,
-            AstFactory.formalParameterList([]),
+            AstFactory.formalParameterList(),
             null,
-            AstFactory.blockFunctionBody2([]));
+            AstFactory.blockFunctionBody2());
     constructorDeclaration.accept(builder);
     List<ConstructorElement> constructors = holder.constructors;
     expect(constructors, hasLength(1));
@@ -7459,9 +7524,9 @@
             null,
             AstFactory.identifier3(className),
             constructorName,
-            AstFactory.formalParameterList([]),
+            AstFactory.formalParameterList(),
             null,
-            AstFactory.blockFunctionBody2([]));
+            AstFactory.blockFunctionBody2());
     constructorDeclaration.accept(builder);
     List<ConstructorElement> constructors = holder.constructors;
     expect(constructors, hasLength(1));
@@ -7487,9 +7552,9 @@
             null,
             AstFactory.identifier3(className),
             null,
-            AstFactory.formalParameterList([]),
+            AstFactory.formalParameterList(),
             null,
-            AstFactory.blockFunctionBody2([]));
+            AstFactory.blockFunctionBody2());
     constructorDeclaration.accept(builder);
     List<ConstructorElement> constructors = holder.constructors;
     expect(constructors, hasLength(1));
@@ -7616,8 +7681,8 @@
         Keyword.GET,
         functionName,
         AstFactory.functionExpression2(
-            AstFactory.formalParameterList([]),
-            AstFactory.blockFunctionBody2([])));
+            AstFactory.formalParameterList(),
+            AstFactory.blockFunctionBody2()));
     declaration.accept(builder);
     List<PropertyAccessorElement> accessors = holder.accessors;
     expect(accessors, hasLength(1));
@@ -7646,8 +7711,8 @@
         null,
         functionName,
         AstFactory.functionExpression2(
-            AstFactory.formalParameterList([]),
-            AstFactory.blockFunctionBody2([])));
+            AstFactory.formalParameterList(),
+            AstFactory.blockFunctionBody2()));
     declaration.accept(builder);
     List<FunctionElement> functions = holder.functions;
     expect(functions, hasLength(1));
@@ -7668,8 +7733,8 @@
         Keyword.SET,
         functionName,
         AstFactory.functionExpression2(
-            AstFactory.formalParameterList([]),
-            AstFactory.blockFunctionBody2([])));
+            AstFactory.formalParameterList(),
+            AstFactory.blockFunctionBody2()));
     declaration.accept(builder);
     List<PropertyAccessorElement> accessors = holder.accessors;
     expect(accessors, hasLength(1));
@@ -7693,8 +7758,8 @@
     ElementHolder holder = new ElementHolder();
     ElementBuilder builder = new ElementBuilder(holder);
     FunctionExpression expression = AstFactory.functionExpression2(
-        AstFactory.formalParameterList([]),
-        AstFactory.blockFunctionBody2([]));
+        AstFactory.formalParameterList(),
+        AstFactory.blockFunctionBody2());
     expression.accept(builder);
     List<FunctionElement> functions = holder.functions;
     expect(functions, hasLength(1));
@@ -7733,7 +7798,7 @@
     ElementBuilder builder = new ElementBuilder(holder);
     String parameterName = "p";
     FunctionTypedFormalParameter formalParameter =
-        AstFactory.functionTypedFormalParameter(null, parameterName, []);
+        AstFactory.functionTypedFormalParameter(null, parameterName);
     _useParameterInMethod(formalParameter, 100, 110);
     formalParameter.accept(builder);
     List<ParameterElement> parameters = holder.parameters;
@@ -7758,7 +7823,7 @@
     ElementBuilder builder = new ElementBuilder(holder);
     String labelName = "l";
     LabeledStatement statement = AstFactory.labeledStatement(
-        AstFactory.list([AstFactory.label2(labelName)]),
+        [AstFactory.label2(labelName)],
         AstFactory.breakStatement());
     statement.accept(builder);
     List<LabelElement> labels = holder.labels;
@@ -7779,7 +7844,7 @@
         null,
         null,
         AstFactory.identifier3(methodName),
-        AstFactory.formalParameterList([]),
+        AstFactory.formalParameterList(),
         AstFactory.emptyFunctionBody());
     methodDeclaration.accept(builder);
     List<MethodElement> methods = holder.methods;
@@ -7806,8 +7871,8 @@
         Keyword.GET,
         null,
         AstFactory.identifier3(methodName),
-        AstFactory.formalParameterList([]),
-        AstFactory.blockFunctionBody2([]));
+        AstFactory.formalParameterList(),
+        AstFactory.blockFunctionBody2());
     methodDeclaration.accept(builder);
     List<FieldElement> fields = holder.fields;
     expect(fields, hasLength(1));
@@ -7839,7 +7904,7 @@
         Keyword.GET,
         null,
         AstFactory.identifier3(methodName),
-        AstFactory.formalParameterList([]),
+        AstFactory.formalParameterList(),
         AstFactory.emptyFunctionBody());
     methodDeclaration.accept(builder);
     List<FieldElement> fields = holder.fields;
@@ -7872,7 +7937,7 @@
         Keyword.GET,
         null,
         AstFactory.identifier3(methodName),
-        AstFactory.formalParameterList([]));
+        AstFactory.formalParameterList());
     methodDeclaration.accept(builder);
     List<FieldElement> fields = holder.fields;
     expect(fields, hasLength(1));
@@ -7904,8 +7969,8 @@
         null,
         null,
         AstFactory.identifier3(methodName),
-        AstFactory.formalParameterList([]),
-        AstFactory.blockFunctionBody2([]));
+        AstFactory.formalParameterList(),
+        AstFactory.blockFunctionBody2());
     methodDeclaration.accept(builder);
     List<MethodElement> methods = holder.methods;
     expect(methods, hasLength(1));
@@ -7932,7 +7997,7 @@
         Keyword.OPERATOR,
         AstFactory.identifier3(methodName),
         AstFactory.formalParameterList([AstFactory.simpleFormalParameter3("addend")]),
-        AstFactory.blockFunctionBody2([]));
+        AstFactory.blockFunctionBody2());
     methodDeclaration.accept(builder);
     List<MethodElement> methods = holder.methods;
     expect(methods, hasLength(1));
@@ -7958,8 +8023,8 @@
         Keyword.SET,
         null,
         AstFactory.identifier3(methodName),
-        AstFactory.formalParameterList([]),
-        AstFactory.blockFunctionBody2([]));
+        AstFactory.formalParameterList(),
+        AstFactory.blockFunctionBody2());
     methodDeclaration.accept(builder);
     List<FieldElement> fields = holder.fields;
     expect(fields, hasLength(1));
@@ -7992,7 +8057,7 @@
         Keyword.SET,
         null,
         AstFactory.identifier3(methodName),
-        AstFactory.formalParameterList([]),
+        AstFactory.formalParameterList(),
         AstFactory.emptyFunctionBody());
     methodDeclaration.accept(builder);
     List<FieldElement> fields = holder.fields;
@@ -8026,7 +8091,7 @@
         Keyword.SET,
         null,
         AstFactory.identifier3(methodName),
-        AstFactory.formalParameterList([]));
+        AstFactory.formalParameterList());
     methodDeclaration.accept(builder);
     List<FieldElement> fields = holder.fields;
     expect(fields, hasLength(1));
@@ -8059,8 +8124,8 @@
         null,
         null,
         AstFactory.identifier3(methodName),
-        AstFactory.formalParameterList([]),
-        AstFactory.blockFunctionBody2([]));
+        AstFactory.formalParameterList(),
+        AstFactory.blockFunctionBody2());
     methodDeclaration.accept(builder);
     List<MethodElement> methods = holder.methods;
     expect(methods, hasLength(1));
@@ -8092,18 +8157,15 @@
         AstFactory.identifier3(methodName),
         AstFactory.formalParameterList(
             [AstFactory.simpleFormalParameter3(parameterName)]),
-        AstFactory.blockFunctionBody2(
-            [
-                AstFactory.variableDeclarationStatement2(
-                    Keyword.VAR,
-                    [AstFactory.variableDeclaration(localVariableName)]),
-                AstFactory.tryStatement2(
-                    AstFactory.block(
-                        [
-                            AstFactory.labeledStatement(
-                                AstFactory.list([AstFactory.label2(labelName)]),
-                                AstFactory.returnStatement())]),
-                    [AstFactory.catchClause(exceptionParameterName, [])])]));
+        AstFactory.blockFunctionBody2([
+            AstFactory.variableDeclarationStatement2(
+                Keyword.VAR,
+                [AstFactory.variableDeclaration(localVariableName)]),
+            AstFactory.tryStatement2(
+                AstFactory.block([AstFactory.labeledStatement(
+                    [AstFactory.label2(labelName)],
+                    AstFactory.returnStatement())]),
+                [AstFactory.catchClause(exceptionParameterName)])]));
     methodDeclaration.accept(builder);
     List<MethodElement> methods = holder.methods;
     expect(methods, hasLength(1));
@@ -8213,7 +8275,7 @@
     TypeAlias typeAlias = AstFactory.typeAlias(
         null,
         aliasName,
-        AstFactory.typeParameterList([]),
+        AstFactory.typeParameterList(),
         AstFactory.formalParameterList(
             [
                 AstFactory.simpleFormalParameter3(firstParameterName),
@@ -8245,7 +8307,7 @@
         null,
         aliasName,
         AstFactory.typeParameterList([firstTypeParameterName, secondTypeParameterName]),
-        AstFactory.formalParameterList([]));
+        AstFactory.formalParameterList());
     typeAlias.accept(builder);
     List<FunctionTypeAliasElement> aliases = holder.typeAliases;
     expect(aliases, hasLength(1));
@@ -8294,7 +8356,7 @@
         null,
         AstFactory.identifier3("C"),
         "C",
-        AstFactory.formalParameterList([]),
+        AstFactory.formalParameterList(),
         null,
         AstFactory.blockFunctionBody2([statement]));
     constructor.accept(builder);
@@ -8324,7 +8386,7 @@
         null,
         null,
         AstFactory.identifier3("m"),
-        AstFactory.formalParameterList([]),
+        AstFactory.formalParameterList(),
         AstFactory.blockFunctionBody2([statement]));
     constructor.accept(builder);
     List<MethodElement> methods = holder.methods;
@@ -8347,7 +8409,7 @@
     Statement statement =
         AstFactory.variableDeclarationStatement2(null, [variable]);
     Expression initializer = AstFactory.functionExpression2(
-        AstFactory.formalParameterList([]),
+        AstFactory.formalParameterList(),
         AstFactory.blockFunctionBody2([statement]));
     String fieldName = "f";
     VariableDeclaration field =
@@ -8396,7 +8458,7 @@
 
   void _useParameterInMethod(FormalParameter formalParameter, int blockOffset,
       int blockEnd) {
-    Block block = AstFactory.block([]);
+    Block block = AstFactory.block();
     block.leftBracket.offset = blockOffset;
     block.rightBracket.offset = blockEnd - 1;
     BlockFunctionBody body = AstFactory.blockFunctionBody(block);
@@ -8665,14 +8727,13 @@
     InstanceCreationExpression creation =
         AstFactory.instanceCreationExpression2(
             Keyword.NEW,
-            AstFactory.typeName3(prefixedIdentifier, []),
-            []);
+            AstFactory.typeName3(prefixedIdentifier));
     // set ClassElement
-    ClassElement classElement = ElementFactory.classElement2("A", []);
+    ClassElement classElement = ElementFactory.classElement2("A");
     identifier.staticElement = classElement;
     // set ConstructorElement
     ConstructorElement constructorElement =
-        ElementFactory.constructorElement2(classElement, null, []);
+        ElementFactory.constructorElement2(classElement, null);
     creation.constructorName.staticElement = constructorElement;
     // verify that "A" is resolved to ConstructorElement
     Element element = ElementLocator.locate(identifier);
@@ -8685,14 +8746,13 @@
     InstanceCreationExpression creation =
         AstFactory.instanceCreationExpression2(
             Keyword.NEW,
-            AstFactory.typeName3(identifier, []),
-            []);
+            AstFactory.typeName3(identifier));
     // set ClassElement
-    ClassElement classElement = ElementFactory.classElement2("A", []);
+    ClassElement classElement = ElementFactory.classElement2("A");
     identifier.staticElement = classElement;
     // set ConstructorElement
     ConstructorElement constructorElement =
-        ElementFactory.constructorElement2(classElement, null, []);
+        ElementFactory.constructorElement2(classElement, null);
     creation.constructorName.staticElement = constructorElement;
     // verify that "A" is resolved to ConstructorElement
     Element element = ElementLocator.locate(identifier);
@@ -8996,7 +9056,7 @@
    */
   InterfaceType createType(String fileName, String typeName) {
     CompilationUnitElementImpl unit = ElementFactory.compilationUnit(fileName);
-    ClassElementImpl element = ElementFactory.classElement2(typeName, []);
+    ClassElementImpl element = ElementFactory.classElement2(typeName);
     unit.types = <ClassElement>[element];
     return element.type;
   }
@@ -9556,7 +9616,7 @@
 
   void _assertHasReturn(bool expectedResult, String source) {
     ExitDetector detector = new ExitDetector();
-    Statement statement = ParserTestCase.parseStatement(source, []);
+    Statement statement = ParserTestCase.parseStatement(source);
     expect(statement.accept(detector), same(expectedResult));
   }
 
@@ -9844,7 +9904,7 @@
                 [
                     _t4(
                         "body",
-                        [_t("script", _a(["type", "'application/dart'"]), scriptBody, [])])])]);
+                        [_t("script", _a(["type", "'application/dart'"]), scriptBody)])])]);
   }
   ht.HtmlUnit parse(String contents) {
 //    TestSource source =
@@ -9863,7 +9923,7 @@
     ht.HtmlUnit htmlUnit = parse("<html><body foo=\"sdfsdf\"></body></html>");
     _validate(
         htmlUnit,
-        [_t4("html", [_t("body", _a(["foo", "\"sdfsdf\""]), "", [])])]);
+        [_t4("html", [_t("body", _a(["foo", "\"sdfsdf\""]), "")])]);
     ht.XmlTagNode htmlNode = htmlUnit.tagNodes[0];
     ht.XmlTagNode bodyNode = htmlNode.tagNodes[0];
     expect(bodyNode.attributes[0].text, "sdfsdf");
@@ -9872,13 +9932,13 @@
     ht.HtmlUnit htmlUnit = parse("<html><body foo=\"sdfsdf\"");
     _validate(
         htmlUnit,
-        [_t4("html", [_t("body", _a(["foo", "\"sdfsdf\""]), "", [])])]);
+        [_t4("html", [_t("body", _a(["foo", "\"sdfsdf\""]), "")])]);
   }
   void test_parse_attribute_EOF_missing_quote() {
     ht.HtmlUnit htmlUnit = parse("<html><body foo=\"sdfsd");
     _validate(
         htmlUnit,
-        [_t4("html", [_t("body", _a(["foo", "\"sdfsd"]), "", [])])]);
+        [_t4("html", [_t("body", _a(["foo", "\"sdfsd"]), "")])]);
     ht.XmlTagNode htmlNode = htmlUnit.tagNodes[0];
     ht.XmlTagNode bodyNode = htmlNode.tagNodes[0];
     expect(bodyNode.attributes[0].text, "sdfsd");
@@ -9887,28 +9947,28 @@
     ht.HtmlUnit htmlUnit = parse("<html><body foo=\"sdfsdf\"\"></body></html>");
     _validate(
         htmlUnit,
-        [_t4("html", [_t("body", _a(["foo", "\"sdfsdf\""]), "", [])])]);
+        [_t4("html", [_t("body", _a(["foo", "\"sdfsdf\""]), "")])]);
   }
   void test_parse_attribute_single_quote() {
     ht.HtmlUnit htmlUnit = parse("<html><body foo='sdfsdf'></body></html>");
     _validate(
         htmlUnit,
-        [_t4("html", [_t("body", _a(["foo", "'sdfsdf'"]), "", [])])]);
+        [_t4("html", [_t("body", _a(["foo", "'sdfsdf'"]), "")])]);
     ht.XmlTagNode htmlNode = htmlUnit.tagNodes[0];
     ht.XmlTagNode bodyNode = htmlNode.tagNodes[0];
     expect(bodyNode.attributes[0].text, "sdfsdf");
   }
   void test_parse_comment_embedded() {
     ht.HtmlUnit htmlUnit = parse("<html <!-- comment -->></html>");
-    _validate(htmlUnit, [_t3("html", "", [])]);
+    _validate(htmlUnit, [_t3("html", "")]);
   }
   void test_parse_comment_first() {
     ht.HtmlUnit htmlUnit = parse("<!-- comment --><html></html>");
-    _validate(htmlUnit, [_t3("html", "", [])]);
+    _validate(htmlUnit, [_t3("html", "")]);
   }
   void test_parse_comment_in_content() {
     ht.HtmlUnit htmlUnit = parse("<html><!-- comment --></html>");
-    _validate(htmlUnit, [_t3("html", "<!-- comment -->", [])]);
+    _validate(htmlUnit, [_t3("html", "<!-- comment -->")]);
   }
   void test_parse_content() {
     ht.HtmlUnit htmlUnit = parse("<html>\n<p a=\"b\">blat \n </p>\n</html>");
@@ -9920,21 +9980,21 @@
             _t3(
                 "html",
                 "\n<pa=\"b\">blat \n </p>\n",
-                [_t("p", _a(["a", "\"b\""]), "blat \n ", [])])]);
+                [_t("p", _a(["a", "\"b\""]), "blat \n ")])]);
   }
   void test_parse_content_none() {
     ht.HtmlUnit htmlUnit = parse("<html><p/>blat<p/></html>");
     _validate(
         htmlUnit,
-        [_t3("html", "<p/>blat<p/>", [_t3("p", "", []), _t3("p", "", [])])]);
+        [_t3("html", "<p/>blat<p/>", [_t3("p", ""), _t3("p", "")])]);
   }
   void test_parse_declaration() {
     ht.HtmlUnit htmlUnit = parse("<!DOCTYPE html>\n\n<html><p></p></html>");
-    _validate(htmlUnit, [_t4("html", [_t3("p", "", [])])]);
+    _validate(htmlUnit, [_t4("html", [_t3("p", "")])]);
   }
   void test_parse_directive() {
     ht.HtmlUnit htmlUnit = parse("<?xml ?>\n\n<html><p></p></html>");
-    _validate(htmlUnit, [_t4("html", [_t3("p", "", [])])]);
+    _validate(htmlUnit, [_t4("html", [_t3("p", "")])]);
   }
   void test_parse_getAttribute() {
     ht.HtmlUnit htmlUnit = parse("<html><body foo=\"sdfsdf\"></body></html>");
@@ -9965,34 +10025,34 @@
     ht.HtmlUnit htmlUnit = parse(code);
     _validate(
         htmlUnit,
-        [_t4("html", [_t4("body", [_t3("h2", "000", []), _t4("div", [])])])]);
+        [_t4("html", [_t4("body", [_t3("h2", "000"), _t4("div")])])]);
   }
   void test_parse_script() {
     ht.HtmlUnit htmlUnit =
         parse("<html><script >here is <p> some</script></html>");
-    _validate(htmlUnit, [_t4("html", [_t3("script", "here is <p> some", [])])]);
+    _validate(htmlUnit, [_t4("html", [_t3("script", "here is <p> some")])]);
   }
   void test_parse_self_closing() {
     ht.HtmlUnit htmlUnit = parse("<html>foo<br>bar</html>");
-    _validate(htmlUnit, [_t3("html", "foo<br>bar", [_t3("br", "", [])])]);
+    _validate(htmlUnit, [_t3("html", "foo<br>bar", [_t3("br", "")])]);
   }
   void test_parse_self_closing_declaration() {
     ht.HtmlUnit htmlUnit = parse("<!DOCTYPE html><html>foo</html>");
-    _validate(htmlUnit, [_t3("html", "foo", [])]);
+    _validate(htmlUnit, [_t3("html", "foo")]);
   }
   XmlValidator_Attributes _a(List<String> keyValuePairs) =>
       new XmlValidator_Attributes(keyValuePairs);
   XmlValidator_Tag _t(String tag, XmlValidator_Attributes attributes,
-      String content, List<XmlValidator_Tag> children) =>
+      String content, [List<XmlValidator_Tag> children = XmlValidator_Tag.EMPTY_LIST]) =>
       new XmlValidator_Tag(tag, attributes, content, children);
   XmlValidator_Tag _t2(String tag, XmlValidator_Attributes attributes,
-      List<XmlValidator_Tag> children) =>
+      [List<XmlValidator_Tag> children = XmlValidator_Tag.EMPTY_LIST]) =>
       new XmlValidator_Tag(tag, attributes, null, children);
   XmlValidator_Tag _t3(String tag, String content,
-      List<XmlValidator_Tag> children) =>
-      new XmlValidator_Tag(tag, new XmlValidator_Attributes([]), content, children);
-  XmlValidator_Tag _t4(String tag, List<XmlValidator_Tag> children) =>
-      new XmlValidator_Tag(tag, new XmlValidator_Attributes([]), null, children);
+      [List<XmlValidator_Tag> children = XmlValidator_Tag.EMPTY_LIST]) =>
+      new XmlValidator_Tag(tag, new XmlValidator_Attributes(), content, children);
+  XmlValidator_Tag _t4(String tag, [List<XmlValidator_Tag> children = XmlValidator_Tag.EMPTY_LIST]) =>
+      new XmlValidator_Tag(tag, new XmlValidator_Attributes(), null, children);
   void _validate(ht.HtmlUnit htmlUnit, List<XmlValidator_Tag> expectedTags) {
     XmlValidator validator = new XmlValidator();
     validator.expectTags(expectedTags);
@@ -10048,7 +10108,7 @@
 <html>
 <script type="application/dart"></script>
 </html>''');
-    _validate(element, [_s(_l([]))]);
+    _validate(element, [_s(_l())]);
   }
   void test_external_script() {
     HtmlElementImpl element = _build(r'''
@@ -10100,7 +10160,7 @@
         _context.parseHtmlUnit(source));
   }
   HtmlUnitBuilderTest_ExpectedLibrary
-      _l(List<HtmlUnitBuilderTest_ExpectedVariable> expectedVariables) =>
+      _l([List<HtmlUnitBuilderTest_ExpectedVariable> expectedVariables = HtmlUnitBuilderTest_ExpectedVariable.EMPTY_LIST]) =>
       new HtmlUnitBuilderTest_ExpectedLibrary(this, expectedVariables);
   _ExpectedScript _s(HtmlUnitBuilderTest_ExpectedLibrary expectedLibrary) =>
       new _ExpectedScript.con1(expectedLibrary);
@@ -10125,7 +10185,7 @@
   final HtmlUnitBuilderTest HtmlUnitBuilderTest_this;
   final List<HtmlUnitBuilderTest_ExpectedVariable> _expectedVariables;
   HtmlUnitBuilderTest_ExpectedLibrary(this.HtmlUnitBuilderTest_this,
-      this._expectedVariables);
+      [this._expectedVariables = HtmlUnitBuilderTest_ExpectedVariable.EMPTY_LIST]);
   void _validate(int scriptIndex, EmbeddedHtmlScriptElementImpl script) {
     LibraryElement library = script.scriptLibrary;
     expect(library, isNotNull, reason: "script $scriptIndex");
@@ -10144,6 +10204,8 @@
 
 class HtmlUnitBuilderTest_ExpectedVariable {
   final String _expectedName;
+  static const List<HtmlUnitBuilderTest_ExpectedVariable> EMPTY_LIST
+      = const <HtmlUnitBuilderTest_ExpectedVariable>[];
   HtmlUnitBuilderTest_ExpectedVariable(this._expectedName);
   void validate(int scriptIndex, TopLevelVariableElement variable) {
     expect(variable, isNotNull, reason: "script $scriptIndex");
@@ -10335,7 +10397,7 @@
   }
   void test_visitSuperConstructorInvocation_unresolved() {
     SuperConstructorInvocation superConstructorInvocation =
-        AstFactory.superConstructorInvocation([]);
+        AstFactory.superConstructorInvocation();
     _tail = superConstructorInvocation;
     _visitNode(superConstructorInvocation);
     _assertNoArcs();
@@ -10363,22 +10425,21 @@
         AstFactory.constructorDeclaration(
             AstFactory.identifier3(name),
             null,
-            AstFactory.formalParameterList([]),
+            AstFactory.formalParameterList(),
             initializers);
     if (isConstDeclaration) {
       constructorDeclaration.constKeyword = new KeywordToken(Keyword.CONST, 0);
     }
-    ClassElementImpl classElement = ElementFactory.classElement2(name, []);
+    ClassElementImpl classElement = ElementFactory.classElement2(name);
     SimpleIdentifier identifier = AstFactory.identifier3(name);
-    TypeName type = AstFactory.typeName3(identifier, []);
+    TypeName type = AstFactory.typeName3(identifier);
     InstanceCreationExpression instanceCreationExpression =
         AstFactory.instanceCreationExpression2(
             isConstUsage ? Keyword.CONST : Keyword.NEW,
-            type,
-            []);
+            type);
     _tail = instanceCreationExpression;
     ConstructorElementImpl constructorElement =
-        ElementFactory.constructorElement(classElement, name, isConstDeclaration, []);
+        ElementFactory.constructorElement(classElement, name, isConstDeclaration);
     if (inMap) {
       _constructorDeclarationMap[constructorElement] = constructorDeclaration;
     }
@@ -10393,17 +10454,17 @@
         AstFactory.constructorDeclaration(
             AstFactory.identifier3(name),
             null,
-            AstFactory.formalParameterList([]),
+            AstFactory.formalParameterList(),
             initializers);
     _tail = constructorDeclaration;
     if (isConst) {
       constructorDeclaration.constKeyword = new KeywordToken(Keyword.CONST, 0);
     }
-    ClassElementImpl classElement = ElementFactory.classElement2(name, []);
+    ClassElementImpl classElement = ElementFactory.classElement2(name);
     SuperConstructorInvocation superConstructorInvocation =
-        AstFactory.superConstructorInvocation([]);
+        AstFactory.superConstructorInvocation();
     ConstructorElementImpl constructorElement =
-        ElementFactory.constructorElement(classElement, name, isConst, []);
+        ElementFactory.constructorElement(classElement, name, isConst);
     if (inMap) {
       _constructorDeclarationMap[constructorElement] = constructorDeclaration;
     }
@@ -10595,7 +10656,7 @@
   void fail_visitHtmlScriptTagNode_noAttributes_content() {
     _assertSource(
         "<script>f() {}</script>",
-        HtmlFactory.scriptTagWithContent("f() {}", []));
+        HtmlFactory.scriptTagWithContent("f() {}"));
   }
 
   void test_visitHtmlScriptTagNode_attributes_noContent() {
@@ -10605,7 +10666,7 @@
   }
 
   void test_visitHtmlScriptTagNode_noAttributes_noContent() {
-    _assertSource("<script/>", HtmlFactory.scriptTag([]));
+    _assertSource("<script/>", HtmlFactory.scriptTag());
   }
 
   void test_visitHtmlUnit_empty() {
@@ -10615,7 +10676,7 @@
   void test_visitHtmlUnit_nonEmpty() {
     _assertSource(
         "<html/>",
-        new ht.HtmlUnit(null, [HtmlFactory.tagNode("html", [])], null));
+        new ht.HtmlUnit(null, [HtmlFactory.tagNode("html")], null));
   }
 
   void test_visitXmlAttributeNode() {
@@ -10996,7 +11057,7 @@
 
 class XmlValidator_Attributes {
   final List<String> _keyValuePairs;
-  XmlValidator_Attributes(this._keyValuePairs);
+  XmlValidator_Attributes([this._keyValuePairs = StringUtilities.EMPTY_ARRAY]);
 }
 
 
@@ -11005,7 +11066,8 @@
   final XmlValidator_Attributes _attributes;
   final String _content;
   final List<XmlValidator_Tag> _children;
-  XmlValidator_Tag(this._tag, this._attributes, this._content, this._children);
+  static const List<XmlValidator_Tag> EMPTY_LIST = const <XmlValidator_Tag>[];
+  XmlValidator_Tag(this._tag, this._attributes, this._content, [this._children = EMPTY_LIST]);
 }
 
 
diff --git a/pkg/analyzer/test/generated/ast_test.dart b/pkg/analyzer/test/generated/ast_test.dart
index 58ea86f..0cdbae7 100644
--- a/pkg/analyzer/test/generated/ast_test.dart
+++ b/pkg/analyzer/test/generated/ast_test.dart
@@ -78,7 +78,7 @@
     return null;
   }
 }''';
-    CompilationUnit unit = ParserTestCase.parseCompilationUnit(source, []);
+    CompilationUnit unit = ParserTestCase.parseCompilationUnit(source);
     List<AstNode> nodes = new List<AstNode>();
     BreadthFirstVisitor<Object> visitor = new BreadthFirstVisitor_BreadthFirstVisitorTest_testIt(nodes);
     visitor.visitAllNodes(unit);
@@ -107,9 +107,9 @@
 class ClassDeclarationTest extends ParserTestCase {
   void test_getConstructor() {
     List<ConstructorInitializer> initializers = new List<ConstructorInitializer>();
-    ConstructorDeclaration defaultConstructor = AstFactory.constructorDeclaration(AstFactory.identifier3("Test"), null, AstFactory.formalParameterList([]), initializers);
-    ConstructorDeclaration aConstructor = AstFactory.constructorDeclaration(AstFactory.identifier3("Test"), "a", AstFactory.formalParameterList([]), initializers);
-    ConstructorDeclaration bConstructor = AstFactory.constructorDeclaration(AstFactory.identifier3("Test"), "b", AstFactory.formalParameterList([]), initializers);
+    ConstructorDeclaration defaultConstructor = AstFactory.constructorDeclaration(AstFactory.identifier3("Test"), null, AstFactory.formalParameterList(), initializers);
+    ConstructorDeclaration aConstructor = AstFactory.constructorDeclaration(AstFactory.identifier3("Test"), "a", AstFactory.formalParameterList(), initializers);
+    ConstructorDeclaration bConstructor = AstFactory.constructorDeclaration(AstFactory.identifier3("Test"), "b", AstFactory.formalParameterList(), initializers);
     ClassDeclaration clazz = AstFactory.classDeclaration(null, "Test", null, null, null, null, [defaultConstructor, aConstructor, bConstructor]);
     expect(clazz.getConstructor(null), same(defaultConstructor));
     expect(clazz.getConstructor("a"), same(aConstructor));
@@ -131,8 +131,8 @@
   }
 
   void test_getMethod() {
-    MethodDeclaration aMethod = AstFactory.methodDeclaration(null, null, null, null, AstFactory.identifier3("a"), AstFactory.formalParameterList([]));
-    MethodDeclaration bMethod = AstFactory.methodDeclaration(null, null, null, null, AstFactory.identifier3("b"), AstFactory.formalParameterList([]));
+    MethodDeclaration aMethod = AstFactory.methodDeclaration(null, null, null, null, AstFactory.identifier3("a"), AstFactory.formalParameterList());
+    MethodDeclaration bMethod = AstFactory.methodDeclaration(null, null, null, null, AstFactory.identifier3("b"), AstFactory.formalParameterList());
     ClassDeclaration clazz = AstFactory.classDeclaration(null, "Test", null, null, null, null, [aMethod, bMethod]);
     expect(clazz.getMethod("a"), same(aMethod));
     expect(clazz.getMethod("b"), same(bMethod));
@@ -140,8 +140,8 @@
   }
 
   void test_isAbstract() {
-    expect(AstFactory.classDeclaration(null, "A", null, null, null, null, []).isAbstract, isFalse);
-    expect(AstFactory.classDeclaration(Keyword.ABSTRACT, "B", null, null, null, null, []).isAbstract, isTrue);
+    expect(AstFactory.classDeclaration(null, "A", null, null, null, null).isAbstract, isFalse);
+    expect(AstFactory.classDeclaration(Keyword.ABSTRACT, "B", null, null, null, null).isAbstract, isTrue);
   }
 }
 
@@ -465,7 +465,7 @@
     expect(value as int, -42);
   }
 
-  Object _getConstantValue(String source) => ParserTestCase.parseExpression(source, []).accept(new ConstantEvaluator());
+  Object _getConstantValue(String source) => ParserTestCase.parseExpression(source).accept(new ConstantEvaluator());
 }
 
 class IndexExpressionTest extends EngineTestCase {
@@ -556,7 +556,7 @@
 
 class NodeListTest extends EngineTestCase {
   void test_add() {
-    AstNode parent = AstFactory.argumentList([]);
+    AstNode parent = AstFactory.argumentList();
     AstNode firstNode = AstFactory.booleanLiteral(true);
     AstNode secondNode = AstFactory.booleanLiteral(false);
     NodeList<AstNode> list = new NodeList<AstNode>(parent);
@@ -579,7 +579,7 @@
   }
 
   void test_add_negative() {
-    NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList([]));
+    NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList());
     try {
       list.insert(-1, AstFactory.booleanLiteral(true));
       fail("Expected IndexOutOfBoundsException");
@@ -589,7 +589,7 @@
   }
 
   void test_add_tooBig() {
-    NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList([]));
+    NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList());
     try {
       list.insert(1, AstFactory.booleanLiteral(true));
       fail("Expected IndexOutOfBoundsException");
@@ -599,7 +599,7 @@
   }
 
   void test_addAll() {
-    AstNode parent = AstFactory.argumentList([]);
+    AstNode parent = AstFactory.argumentList();
     List<AstNode> firstNodes = new List<AstNode>();
     AstNode firstNode = AstFactory.booleanLiteral(true);
     AstNode secondNode = AstFactory.booleanLiteral(false);
@@ -630,7 +630,7 @@
   }
 
   void test_create() {
-    AstNode owner = AstFactory.argumentList([]);
+    AstNode owner = AstFactory.argumentList();
     NodeList<AstNode> list = NodeList.create(owner);
     expect(list, isNotNull);
     expect(list, hasLength(0));
@@ -638,7 +638,7 @@
   }
 
   void test_creation() {
-    AstNode owner = AstFactory.argumentList([]);
+    AstNode owner = AstFactory.argumentList();
     NodeList<AstNode> list = new NodeList<AstNode>(owner);
     expect(list, isNotNull);
     expect(list, hasLength(0));
@@ -646,7 +646,7 @@
   }
 
   void test_get_negative() {
-    NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList([]));
+    NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList());
     try {
       list[-1];
       fail("Expected IndexOutOfBoundsException");
@@ -656,7 +656,7 @@
   }
 
   void test_get_tooBig() {
-    NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList([]));
+    NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList());
     try {
       list[1];
       fail("Expected IndexOutOfBoundsException");
@@ -666,24 +666,24 @@
   }
 
   void test_getBeginToken_empty() {
-    NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList([]));
+    NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList());
     expect(list.beginToken, isNull);
   }
 
   void test_getBeginToken_nonEmpty() {
-    NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList([]));
+    NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList());
     AstNode node = AstFactory.parenthesizedExpression(AstFactory.booleanLiteral(true));
     list.add(node);
     expect(list.beginToken, same(node.beginToken));
   }
 
   void test_getEndToken_empty() {
-    NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList([]));
+    NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList());
     expect(list.endToken, isNull);
   }
 
   void test_getEndToken_nonEmpty() {
-    NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList([]));
+    NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList());
     AstNode node = AstFactory.parenthesizedExpression(AstFactory.booleanLiteral(true));
     list.add(node);
     expect(list.endToken, same(node.endToken));
@@ -698,7 +698,7 @@
     nodes.add(firstNode);
     nodes.add(secondNode);
     nodes.add(thirdNode);
-    NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList([]));
+    NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList());
     list.addAll(nodes);
     expect(list, hasLength(3));
     expect(list.indexOf(firstNode), 0);
@@ -716,7 +716,7 @@
     nodes.add(firstNode);
     nodes.add(secondNode);
     nodes.add(thirdNode);
-    NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList([]));
+    NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList());
     list.addAll(nodes);
     expect(list, hasLength(3));
     expect(list.removeAt(1), same(secondNode));
@@ -726,7 +726,7 @@
   }
 
   void test_remove_negative() {
-    NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList([]));
+    NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList());
     try {
       list.removeAt(-1);
       fail("Expected IndexOutOfBoundsException");
@@ -736,7 +736,7 @@
   }
 
   void test_remove_tooBig() {
-    NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList([]));
+    NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList());
     try {
       list.removeAt(1);
       fail("Expected IndexOutOfBoundsException");
@@ -753,7 +753,7 @@
     nodes.add(firstNode);
     nodes.add(secondNode);
     nodes.add(thirdNode);
-    NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList([]));
+    NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList());
     list.addAll(nodes);
     expect(list, hasLength(3));
     AstNode fourthNode = AstFactory.integer(0);
@@ -766,7 +766,7 @@
 
   void test_set_negative() {
     AstNode node = AstFactory.booleanLiteral(true);
-    NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList([]));
+    NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList());
     try {
       javaListSet(list, -1, node);
       fail("Expected IndexOutOfBoundsException");
@@ -777,7 +777,7 @@
 
   void test_set_tooBig() {
     AstNode node = AstFactory.booleanLiteral(true);
-    NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList([]));
+    NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList());
     try {
       javaListSet(list, 1, node);
       fail("Expected IndexOutOfBoundsException");
@@ -789,7 +789,7 @@
 
 class NodeLocatorTest extends ParserTestCase {
   void test_range() {
-    CompilationUnit unit = ParserTestCase.parseCompilationUnit("library myLib;", []);
+    CompilationUnit unit = ParserTestCase.parseCompilationUnit("library myLib;");
     _assertLocate(unit, 4, 10, (node) => node is LibraryDirective, LibraryDirective);
   }
 
@@ -799,14 +799,14 @@
   }
 
   void test_searchWithin_offset() {
-    CompilationUnit unit = ParserTestCase.parseCompilationUnit("library myLib;", []);
+    CompilationUnit unit = ParserTestCase.parseCompilationUnit("library myLib;");
     _assertLocate(unit, 10, 10, (node) => node is SimpleIdentifier, SimpleIdentifier);
   }
 
   void test_searchWithin_offsetAfterNode() {
     CompilationUnit unit = ParserTestCase.parseCompilationUnit(r'''
 class A {}
-class B {}''', []);
+class B {}''');
     NodeLocator locator = new NodeLocator.con2(1024, 1024);
     AstNode node = locator.searchWithin(unit.declarations[0]);
     expect(node, isNull);
@@ -815,7 +815,7 @@
   void test_searchWithin_offsetBeforeNode() {
     CompilationUnit unit = ParserTestCase.parseCompilationUnit(r'''
 class A {}
-class B {}''', []);
+class B {}''');
     NodeLocator locator = new NodeLocator.con2(0, 0);
     AstNode node = locator.searchWithin(unit.declarations[1]);
     expect(node, isNull);
@@ -834,17 +834,17 @@
 
 class SimpleIdentifierTest extends ParserTestCase {
   void test_inDeclarationContext_catch_exception() {
-    SimpleIdentifier identifier = AstFactory.catchClause("e", []).exceptionParameter;
+    SimpleIdentifier identifier = AstFactory.catchClause("e").exceptionParameter;
     expect(identifier.inDeclarationContext(), isTrue);
   }
 
   void test_inDeclarationContext_catch_stack() {
-    SimpleIdentifier identifier = AstFactory.catchClause2("e", "s", []).stackTraceParameter;
+    SimpleIdentifier identifier = AstFactory.catchClause2("e", "s").stackTraceParameter;
     expect(identifier.inDeclarationContext(), isTrue);
   }
 
   void test_inDeclarationContext_classDeclaration() {
-    SimpleIdentifier identifier = AstFactory.classDeclaration(null, "C", null, null, null, null, []).name;
+    SimpleIdentifier identifier = AstFactory.classDeclaration(null, "C", null, null, null, null).name;
     expect(identifier.inDeclarationContext(), isTrue);
   }
 
@@ -899,7 +899,7 @@
   void test_inDeclarationContext_label_true() {
     Label label = AstFactory.label2("l");
     SimpleIdentifier identifier = label.label;
-    AstFactory.labeledStatement(AstFactory.list([label]), AstFactory.emptyStatement());
+    AstFactory.labeledStatement([label], AstFactory.emptyStatement());
     expect(identifier.inDeclarationContext(), isTrue);
   }
 
@@ -910,7 +910,7 @@
   }
 
   void test_inDeclarationContext_prefix() {
-    SimpleIdentifier identifier = AstFactory.importDirective3("uri", "pref", []).prefix;
+    SimpleIdentifier identifier = AstFactory.importDirective3("uri", "pref").prefix;
     expect(identifier.inDeclarationContext(), isTrue);
   }
 
@@ -920,7 +920,7 @@
   }
 
   void test_inDeclarationContext_typeParameter_bound() {
-    TypeName bound = AstFactory.typeName4("A", []);
+    TypeName bound = AstFactory.typeName4("A");
     SimpleIdentifier identifier = bound.name as SimpleIdentifier;
     AstFactory.typeParameter2("E", bound);
     expect(identifier.inDeclarationContext(), isFalse);
@@ -955,10 +955,9 @@
 
   void test_inGetterContext_forEachLoop() {
     SimpleIdentifier identifier = AstFactory.identifier3("a");
-    Expression iterator = AstFactory.listLiteral([]);
-    Statement body = AstFactory.block([]);
-    ForEachStatement forEachStatement =
-        AstFactory.forEachStatement2(identifier, iterator, body);
+    Expression iterator = AstFactory.listLiteral();
+    Statement body = AstFactory.block();
+    AstFactory.forEachStatement2(identifier, iterator, body);
     expect(identifier.inGetterContext(), isFalse);
   }
 
@@ -988,10 +987,9 @@
 
   void test_inSetterContext_forEachLoop() {
     SimpleIdentifier identifier = AstFactory.identifier3("a");
-    Expression iterator = AstFactory.listLiteral([]);
-    Statement body = AstFactory.block([]);
-    ForEachStatement forEachStatement =
-        AstFactory.forEachStatement2(identifier, iterator, body);
+    Expression iterator = AstFactory.listLiteral();
+    Statement body = AstFactory.block();
+    AstFactory.forEachStatement2(identifier, iterator, body);
     expect(identifier.inSetterContext(), isTrue);
   }
 
@@ -1207,7 +1205,7 @@
 
 class StringInterpolationTest extends ParserTestCase {
   void test_contentsOffsetEnd() {
-    var be = AstFactory.interpolationExpression(AstFactory.identifier3('bb'));
+    AstFactory.interpolationExpression(AstFactory.identifier3('bb'));
     // 'a${bb}ccc'
     {
       var ae = AstFactory.interpolationString("'a", "a");
@@ -1329,7 +1327,7 @@
   }
 
   void test_isRaw() {
-    StringInterpolation node = AstFactory.string([]);
+    StringInterpolation node = AstFactory.string();
     expect(node.isRaw, isFalse);
   }
 }
@@ -1344,7 +1342,7 @@
   }
 
   void test_visitAnnotation_constructor() {
-    _assertSource("@A.c()", AstFactory.annotation2(AstFactory.identifier3("A"), AstFactory.identifier3("c"), AstFactory.argumentList([])));
+    _assertSource("@A.c()", AstFactory.annotation2(AstFactory.identifier3("A"), AstFactory.identifier3("c"), AstFactory.argumentList()));
   }
 
   void test_visitArgumentList() {
@@ -1352,7 +1350,7 @@
   }
 
   void test_visitAsExpression() {
-    _assertSource("e as T", AstFactory.asExpression(AstFactory.identifier3("e"), AstFactory.typeName4("T", [])));
+    _assertSource("e as T", AstFactory.asExpression(AstFactory.identifier3("e"), AstFactory.typeName4("T")));
   }
 
   void test_visitAssertStatement() {
@@ -1372,7 +1370,7 @@
   }
 
   void test_visitBlock_empty() {
-    _assertSource("{}", AstFactory.block([]));
+    _assertSource("{}", AstFactory.block());
   }
 
   void test_visitBlock_nonEmpty() {
@@ -1380,23 +1378,23 @@
   }
 
   void test_visitBlockFunctionBody_async() {
-    _assertSource("async {}", AstFactory.asyncBlockFunctionBody([]));
+    _assertSource("async {}", AstFactory.asyncBlockFunctionBody());
   }
 
   void test_visitBlockFunctionBody_async_star() {
-    _assertSource("async* {}", AstFactory.asyncGeneratorBlockFunctionBody([]));
+    _assertSource("async* {}", AstFactory.asyncGeneratorBlockFunctionBody());
   }
 
   void test_visitBlockFunctionBody_simple() {
-    _assertSource("{}", AstFactory.blockFunctionBody2([]));
+    _assertSource("{}", AstFactory.blockFunctionBody2());
   }
 
   void test_visitBlockFunctionBody_sync() {
-    _assertSource("sync {}", AstFactory.syncBlockFunctionBody([]));
+    _assertSource("sync {}", AstFactory.syncBlockFunctionBody());
   }
 
   void test_visitBlockFunctionBody_sync_star() {
-    _assertSource("sync* {}", AstFactory.syncGeneratorBlockFunctionBody([]));
+    _assertSource("sync* {}", AstFactory.syncGeneratorBlockFunctionBody());
   }
 
   void test_visitBooleanLiteral_false() {
@@ -1429,52 +1427,52 @@
 
   void test_visitCascadeExpression_method() {
     _assertSource("a..b()..c()", AstFactory.cascadeExpression(AstFactory.identifier3("a"), [
-        AstFactory.cascadedMethodInvocation("b", []),
-        AstFactory.cascadedMethodInvocation("c", [])]));
+        AstFactory.cascadedMethodInvocation("b"),
+        AstFactory.cascadedMethodInvocation("c")]));
   }
 
   void test_visitCatchClause_catch_noStack() {
-    _assertSource("catch (e) {}", AstFactory.catchClause("e", []));
+    _assertSource("catch (e) {}", AstFactory.catchClause("e"));
   }
 
   void test_visitCatchClause_catch_stack() {
-    _assertSource("catch (e, s) {}", AstFactory.catchClause2("e", "s", []));
+    _assertSource("catch (e, s) {}", AstFactory.catchClause2("e", "s"));
   }
 
   void test_visitCatchClause_on() {
-    _assertSource("on E {}", AstFactory.catchClause3(AstFactory.typeName4("E", []), []));
+    _assertSource("on E {}", AstFactory.catchClause3(AstFactory.typeName4("E")));
   }
 
   void test_visitCatchClause_on_catch() {
-    _assertSource("on E catch (e) {}", AstFactory.catchClause4(AstFactory.typeName4("E", []), "e", []));
+    _assertSource("on E catch (e) {}", AstFactory.catchClause4(AstFactory.typeName4("E"), "e"));
   }
 
   void test_visitClassDeclaration_abstract() {
-    _assertSource("abstract class C {}", AstFactory.classDeclaration(Keyword.ABSTRACT, "C", null, null, null, null, []));
+    _assertSource("abstract class C {}", AstFactory.classDeclaration(Keyword.ABSTRACT, "C", null, null, null, null));
   }
 
   void test_visitClassDeclaration_empty() {
-    _assertSource("class C {}", AstFactory.classDeclaration(null, "C", null, null, null, null, []));
+    _assertSource("class C {}", AstFactory.classDeclaration(null, "C", null, null, null, null));
   }
 
   void test_visitClassDeclaration_extends() {
-    _assertSource("class C extends A {}", AstFactory.classDeclaration(null, "C", null, AstFactory.extendsClause(AstFactory.typeName4("A", [])), null, null, []));
+    _assertSource("class C extends A {}", AstFactory.classDeclaration(null, "C", null, AstFactory.extendsClause(AstFactory.typeName4("A")), null, null));
   }
 
   void test_visitClassDeclaration_extends_implements() {
-    _assertSource("class C extends A implements B {}", AstFactory.classDeclaration(null, "C", null, AstFactory.extendsClause(AstFactory.typeName4("A", [])), null, AstFactory.implementsClause([AstFactory.typeName4("B", [])]), []));
+    _assertSource("class C extends A implements B {}", AstFactory.classDeclaration(null, "C", null, AstFactory.extendsClause(AstFactory.typeName4("A")), null, AstFactory.implementsClause([AstFactory.typeName4("B")])));
   }
 
   void test_visitClassDeclaration_extends_with() {
-    _assertSource("class C extends A with M {}", AstFactory.classDeclaration(null, "C", null, AstFactory.extendsClause(AstFactory.typeName4("A", [])), AstFactory.withClause([AstFactory.typeName4("M", [])]), null, []));
+    _assertSource("class C extends A with M {}", AstFactory.classDeclaration(null, "C", null, AstFactory.extendsClause(AstFactory.typeName4("A")), AstFactory.withClause([AstFactory.typeName4("M")]), null));
   }
 
   void test_visitClassDeclaration_extends_with_implements() {
-    _assertSource("class C extends A with M implements B {}", AstFactory.classDeclaration(null, "C", null, AstFactory.extendsClause(AstFactory.typeName4("A", [])), AstFactory.withClause([AstFactory.typeName4("M", [])]), AstFactory.implementsClause([AstFactory.typeName4("B", [])]), []));
+    _assertSource("class C extends A with M implements B {}", AstFactory.classDeclaration(null, "C", null, AstFactory.extendsClause(AstFactory.typeName4("A")), AstFactory.withClause([AstFactory.typeName4("M")]), AstFactory.implementsClause([AstFactory.typeName4("B")])));
   }
 
   void test_visitClassDeclaration_implements() {
-    _assertSource("class C implements B {}", AstFactory.classDeclaration(null, "C", null, null, null, AstFactory.implementsClause([AstFactory.typeName4("B", [])]), []));
+    _assertSource("class C implements B {}", AstFactory.classDeclaration(null, "C", null, null, null, AstFactory.implementsClause([AstFactory.typeName4("B")])));
   }
 
   void test_visitClassDeclaration_multipleMember() {
@@ -1484,27 +1482,27 @@
   }
 
   void test_visitClassDeclaration_parameters() {
-    _assertSource("class C<E> {}", AstFactory.classDeclaration(null, "C", AstFactory.typeParameterList(["E"]), null, null, null, []));
+    _assertSource("class C<E> {}", AstFactory.classDeclaration(null, "C", AstFactory.typeParameterList(["E"]), null, null, null));
   }
 
   void test_visitClassDeclaration_parameters_extends() {
-    _assertSource("class C<E> extends A {}", AstFactory.classDeclaration(null, "C", AstFactory.typeParameterList(["E"]), AstFactory.extendsClause(AstFactory.typeName4("A", [])), null, null, []));
+    _assertSource("class C<E> extends A {}", AstFactory.classDeclaration(null, "C", AstFactory.typeParameterList(["E"]), AstFactory.extendsClause(AstFactory.typeName4("A")), null, null));
   }
 
   void test_visitClassDeclaration_parameters_extends_implements() {
-    _assertSource("class C<E> extends A implements B {}", AstFactory.classDeclaration(null, "C", AstFactory.typeParameterList(["E"]), AstFactory.extendsClause(AstFactory.typeName4("A", [])), null, AstFactory.implementsClause([AstFactory.typeName4("B", [])]), []));
+    _assertSource("class C<E> extends A implements B {}", AstFactory.classDeclaration(null, "C", AstFactory.typeParameterList(["E"]), AstFactory.extendsClause(AstFactory.typeName4("A")), null, AstFactory.implementsClause([AstFactory.typeName4("B")])));
   }
 
   void test_visitClassDeclaration_parameters_extends_with() {
-    _assertSource("class C<E> extends A with M {}", AstFactory.classDeclaration(null, "C", AstFactory.typeParameterList(["E"]), AstFactory.extendsClause(AstFactory.typeName4("A", [])), AstFactory.withClause([AstFactory.typeName4("M", [])]), null, []));
+    _assertSource("class C<E> extends A with M {}", AstFactory.classDeclaration(null, "C", AstFactory.typeParameterList(["E"]), AstFactory.extendsClause(AstFactory.typeName4("A")), AstFactory.withClause([AstFactory.typeName4("M")]), null));
   }
 
   void test_visitClassDeclaration_parameters_extends_with_implements() {
-    _assertSource("class C<E> extends A with M implements B {}", AstFactory.classDeclaration(null, "C", AstFactory.typeParameterList(["E"]), AstFactory.extendsClause(AstFactory.typeName4("A", [])), AstFactory.withClause([AstFactory.typeName4("M", [])]), AstFactory.implementsClause([AstFactory.typeName4("B", [])]), []));
+    _assertSource("class C<E> extends A with M implements B {}", AstFactory.classDeclaration(null, "C", AstFactory.typeParameterList(["E"]), AstFactory.extendsClause(AstFactory.typeName4("A")), AstFactory.withClause([AstFactory.typeName4("M")]), AstFactory.implementsClause([AstFactory.typeName4("B")])));
   }
 
   void test_visitClassDeclaration_parameters_implements() {
-    _assertSource("class C<E> implements B {}", AstFactory.classDeclaration(null, "C", AstFactory.typeParameterList(["E"]), null, null, AstFactory.implementsClause([AstFactory.typeName4("B", [])]), []));
+    _assertSource("class C<E> implements B {}", AstFactory.classDeclaration(null, "C", AstFactory.typeParameterList(["E"]), null, null, AstFactory.implementsClause([AstFactory.typeName4("B")])));
   }
 
   void test_visitClassDeclaration_singleMember() {
@@ -1512,46 +1510,48 @@
   }
 
   void test_visitClassDeclaration_withMetadata() {
-    ClassDeclaration declaration = AstFactory.classDeclaration(null, "C", null, null, null, null, []);
-    declaration.metadata = AstFactory.list([AstFactory.annotation(AstFactory.identifier3("deprecated"))]);
+    ClassDeclaration declaration = AstFactory.classDeclaration(null, "C", null, null, null, null);
+    declaration.metadata = [
+        AstFactory.annotation(AstFactory.identifier3("deprecated"))];
     _assertSource("@deprecated class C {}", declaration);
   }
 
   void test_visitClassTypeAlias_abstract() {
-    _assertSource("abstract class C = S with M1;", AstFactory.classTypeAlias("C", null, Keyword.ABSTRACT, AstFactory.typeName4("S", []), AstFactory.withClause([AstFactory.typeName4("M1", [])]), null));
+    _assertSource("abstract class C = S with M1;", AstFactory.classTypeAlias("C", null, Keyword.ABSTRACT, AstFactory.typeName4("S"), AstFactory.withClause([AstFactory.typeName4("M1")]), null));
   }
 
   void test_visitClassTypeAlias_abstract_implements() {
-    _assertSource("abstract class C = S with M1 implements I;", AstFactory.classTypeAlias("C", null, Keyword.ABSTRACT, AstFactory.typeName4("S", []), AstFactory.withClause([AstFactory.typeName4("M1", [])]), AstFactory.implementsClause([AstFactory.typeName4("I", [])])));
+    _assertSource("abstract class C = S with M1 implements I;", AstFactory.classTypeAlias("C", null, Keyword.ABSTRACT, AstFactory.typeName4("S"), AstFactory.withClause([AstFactory.typeName4("M1")]), AstFactory.implementsClause([AstFactory.typeName4("I")])));
   }
 
   void test_visitClassTypeAlias_generic() {
-    _assertSource("class C<E> = S<E> with M1<E>;", AstFactory.classTypeAlias("C", AstFactory.typeParameterList(["E"]), null, AstFactory.typeName4("S", [AstFactory.typeName4("E", [])]), AstFactory.withClause([AstFactory.typeName4("M1", [AstFactory.typeName4("E", [])])]), null));
+    _assertSource("class C<E> = S<E> with M1<E>;", AstFactory.classTypeAlias("C", AstFactory.typeParameterList(["E"]), null, AstFactory.typeName4("S", [AstFactory.typeName4("E")]), AstFactory.withClause([AstFactory.typeName4("M1", [AstFactory.typeName4("E")])]), null));
   }
 
   void test_visitClassTypeAlias_implements() {
-    _assertSource("class C = S with M1 implements I;", AstFactory.classTypeAlias("C", null, null, AstFactory.typeName4("S", []), AstFactory.withClause([AstFactory.typeName4("M1", [])]), AstFactory.implementsClause([AstFactory.typeName4("I", [])])));
+    _assertSource("class C = S with M1 implements I;", AstFactory.classTypeAlias("C", null, null, AstFactory.typeName4("S"), AstFactory.withClause([AstFactory.typeName4("M1")]), AstFactory.implementsClause([AstFactory.typeName4("I")])));
   }
 
   void test_visitClassTypeAlias_minimal() {
-    _assertSource("class C = S with M1;", AstFactory.classTypeAlias("C", null, null, AstFactory.typeName4("S", []), AstFactory.withClause([AstFactory.typeName4("M1", [])]), null));
+    _assertSource("class C = S with M1;", AstFactory.classTypeAlias("C", null, null, AstFactory.typeName4("S"), AstFactory.withClause([AstFactory.typeName4("M1")]), null));
   }
 
   void test_visitClassTypeAlias_parameters_abstract() {
-    _assertSource("abstract class C<E> = S with M1;", AstFactory.classTypeAlias("C", AstFactory.typeParameterList(["E"]), Keyword.ABSTRACT, AstFactory.typeName4("S", []), AstFactory.withClause([AstFactory.typeName4("M1", [])]), null));
+    _assertSource("abstract class C<E> = S with M1;", AstFactory.classTypeAlias("C", AstFactory.typeParameterList(["E"]), Keyword.ABSTRACT, AstFactory.typeName4("S"), AstFactory.withClause([AstFactory.typeName4("M1")]), null));
   }
 
   void test_visitClassTypeAlias_parameters_abstract_implements() {
-    _assertSource("abstract class C<E> = S with M1 implements I;", AstFactory.classTypeAlias("C", AstFactory.typeParameterList(["E"]), Keyword.ABSTRACT, AstFactory.typeName4("S", []), AstFactory.withClause([AstFactory.typeName4("M1", [])]), AstFactory.implementsClause([AstFactory.typeName4("I", [])])));
+    _assertSource("abstract class C<E> = S with M1 implements I;", AstFactory.classTypeAlias("C", AstFactory.typeParameterList(["E"]), Keyword.ABSTRACT, AstFactory.typeName4("S"), AstFactory.withClause([AstFactory.typeName4("M1")]), AstFactory.implementsClause([AstFactory.typeName4("I")])));
   }
 
   void test_visitClassTypeAlias_parameters_implements() {
-    _assertSource("class C<E> = S with M1 implements I;", AstFactory.classTypeAlias("C", AstFactory.typeParameterList(["E"]), null, AstFactory.typeName4("S", []), AstFactory.withClause([AstFactory.typeName4("M1", [])]), AstFactory.implementsClause([AstFactory.typeName4("I", [])])));
+    _assertSource("class C<E> = S with M1 implements I;", AstFactory.classTypeAlias("C", AstFactory.typeParameterList(["E"]), null, AstFactory.typeName4("S"), AstFactory.withClause([AstFactory.typeName4("M1")]), AstFactory.implementsClause([AstFactory.typeName4("I")])));
   }
 
   void test_visitClassTypeAlias_withMetadata() {
-    ClassTypeAlias declaration = AstFactory.classTypeAlias("C", null, null, AstFactory.typeName4("S", []), AstFactory.withClause([AstFactory.typeName4("M1", [])]), null);
-    declaration.metadata = AstFactory.list([AstFactory.annotation(AstFactory.identifier3("deprecated"))]);
+    ClassTypeAlias declaration = AstFactory.classTypeAlias("C", null, null, AstFactory.typeName4("S"), AstFactory.withClause([AstFactory.typeName4("M1")]), null);
+    declaration.metadata = [
+        AstFactory.annotation(AstFactory.identifier3("deprecated"))];
     _assertSource("@deprecated class C = S with M1;", declaration);
   }
 
@@ -1572,7 +1572,11 @@
   }
 
   void test_visitCompilationUnit_directive_declaration() {
-    _assertSource("library l; var a;", AstFactory.compilationUnit4(AstFactory.list([AstFactory.libraryDirective2("l")]), AstFactory.list([AstFactory.topLevelVariableDeclaration2(Keyword.VAR, [AstFactory.variableDeclaration("a")])])));
+    _assertSource("library l; var a;", AstFactory.compilationUnit4(
+        [AstFactory.libraryDirective2("l")],
+        [AstFactory.topLevelVariableDeclaration2(
+            Keyword.VAR,
+            [AstFactory.variableDeclaration("a")])]));
   }
 
   void test_visitCompilationUnit_empty() {
@@ -1592,7 +1596,12 @@
   }
 
   void test_visitCompilationUnit_script_directives_declarations() {
-    _assertSource("!#/bin/dartvm library l; var a;", AstFactory.compilationUnit8("!#/bin/dartvm", AstFactory.list([AstFactory.libraryDirective2("l")]), AstFactory.list([AstFactory.topLevelVariableDeclaration2(Keyword.VAR, [AstFactory.variableDeclaration("a")])])));
+    _assertSource("!#/bin/dartvm library l; var a;", AstFactory.compilationUnit8(
+        "!#/bin/dartvm",
+        [AstFactory.libraryDirective2("l")],
+        [AstFactory.topLevelVariableDeclaration2(
+            Keyword.VAR,
+            [AstFactory.variableDeclaration("a")])]));
   }
 
   void test_visitConditionalExpression() {
@@ -1600,40 +1609,54 @@
   }
 
   void test_visitConstructorDeclaration_const() {
-    _assertSource("const C() {}", AstFactory.constructorDeclaration2(Keyword.CONST, null, AstFactory.identifier3("C"), null, AstFactory.formalParameterList([]), null, AstFactory.blockFunctionBody2([])));
+    _assertSource("const C() {}", AstFactory.constructorDeclaration2(Keyword.CONST, null, AstFactory.identifier3("C"), null, AstFactory.formalParameterList(), null, AstFactory.blockFunctionBody2()));
   }
 
   void test_visitConstructorDeclaration_external() {
-    _assertSource("external C();", AstFactory.constructorDeclaration(AstFactory.identifier3("C"), null, AstFactory.formalParameterList([]), null));
+    _assertSource("external C();", AstFactory.constructorDeclaration(AstFactory.identifier3("C"), null, AstFactory.formalParameterList(), null));
   }
 
   void test_visitConstructorDeclaration_minimal() {
-    _assertSource("C() {}", AstFactory.constructorDeclaration2(null, null, AstFactory.identifier3("C"), null, AstFactory.formalParameterList([]), null, AstFactory.blockFunctionBody2([])));
+    _assertSource("C() {}", AstFactory.constructorDeclaration2(null, null, AstFactory.identifier3("C"), null, AstFactory.formalParameterList(), null, AstFactory.blockFunctionBody2()));
   }
 
   void test_visitConstructorDeclaration_multipleInitializers() {
-    _assertSource("C() : a = b, c = d {}", AstFactory.constructorDeclaration2(null, null, AstFactory.identifier3("C"), null, AstFactory.formalParameterList([]), AstFactory.list([
-        AstFactory.constructorFieldInitializer(false, "a", AstFactory.identifier3("b")),
-        AstFactory.constructorFieldInitializer(false, "c", AstFactory.identifier3("d"))]), AstFactory.blockFunctionBody2([])));
+    _assertSource("C() : a = b, c = d {}", AstFactory.constructorDeclaration2(
+        null,
+        null,
+        AstFactory.identifier3("C"),
+        null,
+        AstFactory.formalParameterList(),
+        [
+          AstFactory.constructorFieldInitializer(false, "a", AstFactory.identifier3("b")),
+          AstFactory.constructorFieldInitializer(false, "c", AstFactory.identifier3("d"))],
+        AstFactory.blockFunctionBody2()));
   }
 
   void test_visitConstructorDeclaration_multipleParameters() {
     _assertSource("C(var a, var b) {}", AstFactory.constructorDeclaration2(null, null, AstFactory.identifier3("C"), null, AstFactory.formalParameterList([
         AstFactory.simpleFormalParameter(Keyword.VAR, "a"),
-        AstFactory.simpleFormalParameter(Keyword.VAR, "b")]), null, AstFactory.blockFunctionBody2([])));
+        AstFactory.simpleFormalParameter(Keyword.VAR, "b")]), null, AstFactory.blockFunctionBody2()));
   }
 
   void test_visitConstructorDeclaration_named() {
-    _assertSource("C.m() {}", AstFactory.constructorDeclaration2(null, null, AstFactory.identifier3("C"), "m", AstFactory.formalParameterList([]), null, AstFactory.blockFunctionBody2([])));
+    _assertSource("C.m() {}", AstFactory.constructorDeclaration2(null, null, AstFactory.identifier3("C"), "m", AstFactory.formalParameterList(), null, AstFactory.blockFunctionBody2()));
   }
 
   void test_visitConstructorDeclaration_singleInitializer() {
-    _assertSource("C() : a = b {}", AstFactory.constructorDeclaration2(null, null, AstFactory.identifier3("C"), null, AstFactory.formalParameterList([]), AstFactory.list([AstFactory.constructorFieldInitializer(false, "a", AstFactory.identifier3("b"))]), AstFactory.blockFunctionBody2([])));
+    _assertSource("C() : a = b {}", AstFactory.constructorDeclaration2(
+        null,
+        null,
+        AstFactory.identifier3("C"),
+        null,
+        AstFactory.formalParameterList(),
+        [AstFactory.constructorFieldInitializer(false, "a", AstFactory.identifier3("b"))],
+        AstFactory.blockFunctionBody2()));
   }
 
   void test_visitConstructorDeclaration_withMetadata() {
-    ConstructorDeclaration declaration = AstFactory.constructorDeclaration2(null, null, AstFactory.identifier3("C"), null, AstFactory.formalParameterList([]), null, AstFactory.blockFunctionBody2([]));
-    declaration.metadata = AstFactory.list([AstFactory.annotation(AstFactory.identifier3("deprecated"))]);
+    ConstructorDeclaration declaration = AstFactory.constructorDeclaration2(null, null, AstFactory.identifier3("C"), null, AstFactory.formalParameterList(), null, AstFactory.blockFunctionBody2());
+    declaration.metadata = [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
     _assertSource("@deprecated C() {}", declaration);
   }
 
@@ -1646,15 +1669,15 @@
   }
 
   void test_visitConstructorName_named_prefix() {
-    _assertSource("p.C.n", AstFactory.constructorName(AstFactory.typeName4("p.C.n", []), null));
+    _assertSource("p.C.n", AstFactory.constructorName(AstFactory.typeName4("p.C.n"), null));
   }
 
   void test_visitConstructorName_unnamed_noPrefix() {
-    _assertSource("C", AstFactory.constructorName(AstFactory.typeName4("C", []), null));
+    _assertSource("C", AstFactory.constructorName(AstFactory.typeName4("C"), null));
   }
 
   void test_visitConstructorName_unnamed_prefix() {
-    _assertSource("p.C", AstFactory.constructorName(AstFactory.typeName3(AstFactory.identifier5("p", "C"), []), null));
+    _assertSource("p.C", AstFactory.constructorName(AstFactory.typeName3(AstFactory.identifier5("p", "C")), null));
   }
 
   void test_visitContinueStatement_label() {
@@ -1682,7 +1705,7 @@
   }
 
   void test_visitDoStatement() {
-    _assertSource("do {} while (c);", AstFactory.doStatement(AstFactory.block([]), AstFactory.identifier3("c")));
+    _assertSource("do {} while (c);", AstFactory.doStatement(AstFactory.block(), AstFactory.identifier3("c")));
   }
 
   void test_visitDoubleLiteral() {
@@ -1716,12 +1739,12 @@
   }
 
   void test_visitExportDirective_minimal() {
-    _assertSource("export 'a.dart';", AstFactory.exportDirective2("a.dart", []));
+    _assertSource("export 'a.dart';", AstFactory.exportDirective2("a.dart"));
   }
 
   void test_visitExportDirective_withMetadata() {
-    ExportDirective directive = AstFactory.exportDirective2("a.dart", []);
-    directive.metadata = AstFactory.list([AstFactory.annotation(AstFactory.identifier3("deprecated"))]);
+    ExportDirective directive = AstFactory.exportDirective2("a.dart");
+    directive.metadata = [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
     _assertSource("@deprecated export 'a.dart';", directive);
   }
 
@@ -1738,7 +1761,7 @@
   }
 
   void test_visitExtendsClause() {
-    _assertSource("extends C", AstFactory.extendsClause(AstFactory.typeName4("C", [])));
+    _assertSource("extends C", AstFactory.extendsClause(AstFactory.typeName4("C")));
   }
 
   void test_visitFieldDeclaration_instance() {
@@ -1751,12 +1774,12 @@
 
   void test_visitFieldDeclaration_withMetadata() {
     FieldDeclaration declaration = AstFactory.fieldDeclaration2(false, Keyword.VAR, [AstFactory.variableDeclaration("a")]);
-    declaration.metadata = AstFactory.list([AstFactory.annotation(AstFactory.identifier3("deprecated"))]);
+    declaration.metadata = [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
     _assertSource("@deprecated var a;", declaration);
   }
 
   void test_visitFieldFormalParameter_functionTyped() {
-    _assertSource("A this.a(b)", AstFactory.fieldFormalParameter(null, AstFactory.typeName4("A", []), "a", AstFactory.formalParameterList([AstFactory.simpleFormalParameter3("b")])));
+    _assertSource("A this.a(b)", AstFactory.fieldFormalParameter(null, AstFactory.typeName4("A"), "a", AstFactory.formalParameterList([AstFactory.simpleFormalParameter3("b")])));
   }
 
   void test_visitFieldFormalParameter_keyword() {
@@ -1764,27 +1787,27 @@
   }
 
   void test_visitFieldFormalParameter_keywordAndType() {
-    _assertSource("final A this.a", AstFactory.fieldFormalParameter(Keyword.FINAL, AstFactory.typeName4("A", []), "a"));
+    _assertSource("final A this.a", AstFactory.fieldFormalParameter(Keyword.FINAL, AstFactory.typeName4("A"), "a"));
   }
 
   void test_visitFieldFormalParameter_type() {
-    _assertSource("A this.a", AstFactory.fieldFormalParameter(null, AstFactory.typeName4("A", []), "a"));
+    _assertSource("A this.a", AstFactory.fieldFormalParameter(null, AstFactory.typeName4("A"), "a"));
   }
 
   void test_visitForEachStatement_declared() {
-    _assertSource("for (a in b) {}", AstFactory.forEachStatement(AstFactory.declaredIdentifier3("a"), AstFactory.identifier3("b"), AstFactory.block([])));
+    _assertSource("for (a in b) {}", AstFactory.forEachStatement(AstFactory.declaredIdentifier3("a"), AstFactory.identifier3("b"), AstFactory.block()));
   }
 
   void test_visitForEachStatement_variable() {
-    _assertSource("for (a in b) {}", new ForEachStatement.con2(null, TokenFactory.tokenFromKeyword(Keyword.FOR), TokenFactory.tokenFromType(TokenType.OPEN_PAREN), AstFactory.identifier3("a"), TokenFactory.tokenFromKeyword(Keyword.IN), AstFactory.identifier3("b"), TokenFactory.tokenFromType(TokenType.CLOSE_PAREN), AstFactory.block([])));
+    _assertSource("for (a in b) {}", new ForEachStatement.con2(null, TokenFactory.tokenFromKeyword(Keyword.FOR), TokenFactory.tokenFromType(TokenType.OPEN_PAREN), AstFactory.identifier3("a"), TokenFactory.tokenFromKeyword(Keyword.IN), AstFactory.identifier3("b"), TokenFactory.tokenFromType(TokenType.CLOSE_PAREN), AstFactory.block()));
   }
 
   void test_visitForEachStatement_variable_await() {
-    _assertSource("await for (a in b) {}", new ForEachStatement.con2(TokenFactory.tokenFromString("await"), TokenFactory.tokenFromKeyword(Keyword.FOR), TokenFactory.tokenFromType(TokenType.OPEN_PAREN), AstFactory.identifier3("a"), TokenFactory.tokenFromKeyword(Keyword.IN), AstFactory.identifier3("b"), TokenFactory.tokenFromType(TokenType.CLOSE_PAREN), AstFactory.block([])));
+    _assertSource("await for (a in b) {}", new ForEachStatement.con2(TokenFactory.tokenFromString("await"), TokenFactory.tokenFromKeyword(Keyword.FOR), TokenFactory.tokenFromType(TokenType.OPEN_PAREN), AstFactory.identifier3("a"), TokenFactory.tokenFromKeyword(Keyword.IN), AstFactory.identifier3("b"), TokenFactory.tokenFromType(TokenType.CLOSE_PAREN), AstFactory.block()));
   }
 
   void test_visitFormalParameterList_empty() {
-    _assertSource("()", AstFactory.formalParameterList([]));
+    _assertSource("()", AstFactory.formalParameterList());
   }
 
   void test_visitFormalParameterList_n() {
@@ -1874,47 +1897,47 @@
   }
 
   void test_visitForStatement_c() {
-    _assertSource("for (; c;) {}", AstFactory.forStatement(null, AstFactory.identifier3("c"), null, AstFactory.block([])));
+    _assertSource("for (; c;) {}", AstFactory.forStatement(null, AstFactory.identifier3("c"), null, AstFactory.block()));
   }
 
   void test_visitForStatement_cu() {
-    _assertSource("for (; c; u) {}", AstFactory.forStatement(null, AstFactory.identifier3("c"), AstFactory.list([AstFactory.identifier3("u")]), AstFactory.block([])));
+    _assertSource("for (; c; u) {}", AstFactory.forStatement(null, AstFactory.identifier3("c"), [AstFactory.identifier3("u")], AstFactory.block()));
   }
 
   void test_visitForStatement_e() {
-    _assertSource("for (e;;) {}", AstFactory.forStatement(AstFactory.identifier3("e"), null, null, AstFactory.block([])));
+    _assertSource("for (e;;) {}", AstFactory.forStatement(AstFactory.identifier3("e"), null, null, AstFactory.block()));
   }
 
   void test_visitForStatement_ec() {
-    _assertSource("for (e; c;) {}", AstFactory.forStatement(AstFactory.identifier3("e"), AstFactory.identifier3("c"), null, AstFactory.block([])));
+    _assertSource("for (e; c;) {}", AstFactory.forStatement(AstFactory.identifier3("e"), AstFactory.identifier3("c"), null, AstFactory.block()));
   }
 
   void test_visitForStatement_ecu() {
-    _assertSource("for (e; c; u) {}", AstFactory.forStatement(AstFactory.identifier3("e"), AstFactory.identifier3("c"), AstFactory.list([AstFactory.identifier3("u")]), AstFactory.block([])));
+    _assertSource("for (e; c; u) {}", AstFactory.forStatement(AstFactory.identifier3("e"), AstFactory.identifier3("c"), [AstFactory.identifier3("u")], AstFactory.block()));
   }
 
   void test_visitForStatement_eu() {
-    _assertSource("for (e;; u) {}", AstFactory.forStatement(AstFactory.identifier3("e"), null, AstFactory.list([AstFactory.identifier3("u")]), AstFactory.block([])));
+    _assertSource("for (e;; u) {}", AstFactory.forStatement(AstFactory.identifier3("e"), null, [AstFactory.identifier3("u")], AstFactory.block()));
   }
 
   void test_visitForStatement_i() {
-    _assertSource("for (var i;;) {}", AstFactory.forStatement2(AstFactory.variableDeclarationList2(Keyword.VAR, [AstFactory.variableDeclaration("i")]), null, null, AstFactory.block([])));
+    _assertSource("for (var i;;) {}", AstFactory.forStatement2(AstFactory.variableDeclarationList2(Keyword.VAR, [AstFactory.variableDeclaration("i")]), null, null, AstFactory.block()));
   }
 
   void test_visitForStatement_ic() {
-    _assertSource("for (var i; c;) {}", AstFactory.forStatement2(AstFactory.variableDeclarationList2(Keyword.VAR, [AstFactory.variableDeclaration("i")]), AstFactory.identifier3("c"), null, AstFactory.block([])));
+    _assertSource("for (var i; c;) {}", AstFactory.forStatement2(AstFactory.variableDeclarationList2(Keyword.VAR, [AstFactory.variableDeclaration("i")]), AstFactory.identifier3("c"), null, AstFactory.block()));
   }
 
   void test_visitForStatement_icu() {
-    _assertSource("for (var i; c; u) {}", AstFactory.forStatement2(AstFactory.variableDeclarationList2(Keyword.VAR, [AstFactory.variableDeclaration("i")]), AstFactory.identifier3("c"), AstFactory.list([AstFactory.identifier3("u")]), AstFactory.block([])));
+    _assertSource("for (var i; c; u) {}", AstFactory.forStatement2(AstFactory.variableDeclarationList2(Keyword.VAR, [AstFactory.variableDeclaration("i")]), AstFactory.identifier3("c"), [AstFactory.identifier3("u")], AstFactory.block()));
   }
 
   void test_visitForStatement_iu() {
-    _assertSource("for (var i;; u) {}", AstFactory.forStatement2(AstFactory.variableDeclarationList2(Keyword.VAR, [AstFactory.variableDeclaration("i")]), null, AstFactory.list([AstFactory.identifier3("u")]), AstFactory.block([])));
+    _assertSource("for (var i;; u) {}", AstFactory.forStatement2(AstFactory.variableDeclarationList2(Keyword.VAR, [AstFactory.variableDeclaration("i")]), null, [AstFactory.identifier3("u")], AstFactory.block()));
   }
 
   void test_visitForStatement_u() {
-    _assertSource("for (;; u) {}", AstFactory.forStatement(null, null, AstFactory.list([AstFactory.identifier3("u")]), AstFactory.block([])));
+    _assertSource("for (;; u) {}", AstFactory.forStatement(null, null, [AstFactory.identifier3("u")], AstFactory.block()));
   }
 
   void test_visitFunctionDeclaration_getter() {
@@ -1924,15 +1947,15 @@
   void test_visitFunctionDeclaration_local_blockBody() {
     FunctionDeclaration f = AstFactory.functionDeclaration(null, null, "f", AstFactory.functionExpression());
     FunctionDeclarationStatement fStatement = new FunctionDeclarationStatement(f);
-    _assertSource("main() {f() {} 42;}", AstFactory.functionDeclaration(null, null, "main", AstFactory.functionExpression2(AstFactory.formalParameterList([]), AstFactory.blockFunctionBody2([
+    _assertSource("main() {f() {} 42;}", AstFactory.functionDeclaration(null, null, "main", AstFactory.functionExpression2(AstFactory.formalParameterList(), AstFactory.blockFunctionBody2([
         fStatement,
         AstFactory.expressionStatement(AstFactory.integer(42))]))));
   }
 
   void test_visitFunctionDeclaration_local_expressionBody() {
-    FunctionDeclaration f = AstFactory.functionDeclaration(null, null, "f", AstFactory.functionExpression2(AstFactory.formalParameterList([]), AstFactory.expressionFunctionBody(AstFactory.integer(1))));
+    FunctionDeclaration f = AstFactory.functionDeclaration(null, null, "f", AstFactory.functionExpression2(AstFactory.formalParameterList(), AstFactory.expressionFunctionBody(AstFactory.integer(1))));
     FunctionDeclarationStatement fStatement = new FunctionDeclarationStatement(f);
-    _assertSource("main() {f() => 1; 2;}", AstFactory.functionDeclaration(null, null, "main", AstFactory.functionExpression2(AstFactory.formalParameterList([]), AstFactory.blockFunctionBody2([
+    _assertSource("main() {f() => 1; 2;}", AstFactory.functionDeclaration(null, null, "main", AstFactory.functionExpression2(AstFactory.formalParameterList(), AstFactory.blockFunctionBody2([
         fStatement,
         AstFactory.expressionStatement(AstFactory.integer(2))]))));
   }
@@ -1947,7 +1970,7 @@
 
   void test_visitFunctionDeclaration_withMetadata() {
     FunctionDeclaration declaration = AstFactory.functionDeclaration(null, null, "f", AstFactory.functionExpression());
-    declaration.metadata = AstFactory.list([AstFactory.annotation(AstFactory.identifier3("deprecated"))]);
+    declaration.metadata = [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
     _assertSource("@deprecated f() {}", declaration);
   }
 
@@ -1960,47 +1983,47 @@
   }
 
   void test_visitFunctionExpressionInvocation() {
-    _assertSource("f()", AstFactory.functionExpressionInvocation(AstFactory.identifier3("f"), []));
+    _assertSource("f()", AstFactory.functionExpressionInvocation(AstFactory.identifier3("f")));
   }
 
   void test_visitFunctionTypeAlias_generic() {
-    _assertSource("typedef A F<B>();", AstFactory.typeAlias(AstFactory.typeName4("A", []), "F", AstFactory.typeParameterList(["B"]), AstFactory.formalParameterList([])));
+    _assertSource("typedef A F<B>();", AstFactory.typeAlias(AstFactory.typeName4("A"), "F", AstFactory.typeParameterList(["B"]), AstFactory.formalParameterList()));
   }
 
   void test_visitFunctionTypeAlias_nonGeneric() {
-    _assertSource("typedef A F();", AstFactory.typeAlias(AstFactory.typeName4("A", []), "F", null, AstFactory.formalParameterList([])));
+    _assertSource("typedef A F();", AstFactory.typeAlias(AstFactory.typeName4("A"), "F", null, AstFactory.formalParameterList()));
   }
 
   void test_visitFunctionTypeAlias_withMetadata() {
-    FunctionTypeAlias declaration = AstFactory.typeAlias(AstFactory.typeName4("A", []), "F", null, AstFactory.formalParameterList([]));
-    declaration.metadata = AstFactory.list([AstFactory.annotation(AstFactory.identifier3("deprecated"))]);
+    FunctionTypeAlias declaration = AstFactory.typeAlias(AstFactory.typeName4("A"), "F", null, AstFactory.formalParameterList());
+    declaration.metadata = [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
     _assertSource("@deprecated typedef A F();", declaration);
   }
 
   void test_visitFunctionTypedFormalParameter_noType() {
-    _assertSource("f()", AstFactory.functionTypedFormalParameter(null, "f", []));
+    _assertSource("f()", AstFactory.functionTypedFormalParameter(null, "f"));
   }
 
   void test_visitFunctionTypedFormalParameter_type() {
-    _assertSource("T f()", AstFactory.functionTypedFormalParameter(AstFactory.typeName4("T", []), "f", []));
+    _assertSource("T f()", AstFactory.functionTypedFormalParameter(AstFactory.typeName4("T"), "f"));
   }
 
   void test_visitIfStatement_withElse() {
-    _assertSource("if (c) {} else {}", AstFactory.ifStatement2(AstFactory.identifier3("c"), AstFactory.block([]), AstFactory.block([])));
+    _assertSource("if (c) {} else {}", AstFactory.ifStatement2(AstFactory.identifier3("c"), AstFactory.block(), AstFactory.block()));
   }
 
   void test_visitIfStatement_withoutElse() {
-    _assertSource("if (c) {}", AstFactory.ifStatement(AstFactory.identifier3("c"), AstFactory.block([])));
+    _assertSource("if (c) {}", AstFactory.ifStatement(AstFactory.identifier3("c"), AstFactory.block()));
   }
 
   void test_visitImplementsClause_multiple() {
     _assertSource("implements A, B", AstFactory.implementsClause([
-        AstFactory.typeName4("A", []),
-        AstFactory.typeName4("B", [])]));
+        AstFactory.typeName4("A"),
+        AstFactory.typeName4("B")]));
   }
 
   void test_visitImplementsClause_single() {
-    _assertSource("implements A", AstFactory.implementsClause([AstFactory.typeName4("A", [])]));
+    _assertSource("implements A", AstFactory.implementsClause([AstFactory.typeName4("A")]));
   }
 
   void test_visitImportDirective_combinator() {
@@ -2014,15 +2037,15 @@
   }
 
   void test_visitImportDirective_deferred() {
-    _assertSource("import 'a.dart' deferred as p;", AstFactory.importDirective2("a.dart", true, "p", []));
+    _assertSource("import 'a.dart' deferred as p;", AstFactory.importDirective2("a.dart", true, "p"));
   }
 
   void test_visitImportDirective_minimal() {
-    _assertSource("import 'a.dart';", AstFactory.importDirective3("a.dart", null, []));
+    _assertSource("import 'a.dart';", AstFactory.importDirective3("a.dart", null));
   }
 
   void test_visitImportDirective_prefix() {
-    _assertSource("import 'a.dart' as p;", AstFactory.importDirective3("a.dart", "p", []));
+    _assertSource("import 'a.dart' as p;", AstFactory.importDirective3("a.dart", "p"));
   }
 
   void test_visitImportDirective_prefix_combinator() {
@@ -2036,8 +2059,8 @@
   }
 
   void test_visitImportDirective_withMetadata() {
-    ImportDirective directive = AstFactory.importDirective3("a.dart", null, []);
-    directive.metadata = AstFactory.list([AstFactory.annotation(AstFactory.identifier3("deprecated"))]);
+    ImportDirective directive = AstFactory.importDirective3("a.dart", null);
+    directive.metadata = [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
     _assertSource("@deprecated import 'a.dart';", directive);
   }
 
@@ -2062,15 +2085,15 @@
   }
 
   void test_visitInstanceCreationExpression_const() {
-    _assertSource("const C()", AstFactory.instanceCreationExpression2(Keyword.CONST, AstFactory.typeName4("C", []), []));
+    _assertSource("const C()", AstFactory.instanceCreationExpression2(Keyword.CONST, AstFactory.typeName4("C")));
   }
 
   void test_visitInstanceCreationExpression_named() {
-    _assertSource("new C.c()", AstFactory.instanceCreationExpression3(Keyword.NEW, AstFactory.typeName4("C", []), "c", []));
+    _assertSource("new C.c()", AstFactory.instanceCreationExpression3(Keyword.NEW, AstFactory.typeName4("C"), "c"));
   }
 
   void test_visitInstanceCreationExpression_unnamed() {
-    _assertSource("new C()", AstFactory.instanceCreationExpression2(Keyword.NEW, AstFactory.typeName4("C", []), []));
+    _assertSource("new C()", AstFactory.instanceCreationExpression2(Keyword.NEW, AstFactory.typeName4("C")));
   }
 
   void test_visitIntegerLiteral() {
@@ -2090,11 +2113,11 @@
   }
 
   void test_visitIsExpression_negated() {
-    _assertSource("a is! C", AstFactory.isExpression(AstFactory.identifier3("a"), true, AstFactory.typeName4("C", [])));
+    _assertSource("a is! C", AstFactory.isExpression(AstFactory.identifier3("a"), true, AstFactory.typeName4("C")));
   }
 
   void test_visitIsExpression_normal() {
-    _assertSource("a is C", AstFactory.isExpression(AstFactory.identifier3("a"), false, AstFactory.typeName4("C", [])));
+    _assertSource("a is C", AstFactory.isExpression(AstFactory.identifier3("a"), false, AstFactory.typeName4("C")));
   }
 
   void test_visitLabel() {
@@ -2102,11 +2125,11 @@
   }
 
   void test_visitLabeledStatement_multiple() {
-    _assertSource("a: b: return;", AstFactory.labeledStatement(AstFactory.list([AstFactory.label2("a"), AstFactory.label2("b")]), AstFactory.returnStatement()));
+    _assertSource("a: b: return;", AstFactory.labeledStatement([AstFactory.label2("a"), AstFactory.label2("b")], AstFactory.returnStatement()));
   }
 
   void test_visitLabeledStatement_single() {
-    _assertSource("a: return;", AstFactory.labeledStatement(AstFactory.list([AstFactory.label2("a")]), AstFactory.returnStatement()));
+    _assertSource("a: return;", AstFactory.labeledStatement([AstFactory.label2("a")], AstFactory.returnStatement()));
   }
 
   void test_visitLibraryDirective() {
@@ -2115,7 +2138,7 @@
 
   void test_visitLibraryDirective_withMetadata() {
     LibraryDirective directive = AstFactory.libraryDirective2("l");
-    directive.metadata = AstFactory.list([AstFactory.annotation(AstFactory.identifier3("deprecated"))]);
+    directive.metadata = [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
     _assertSource("@deprecated library l;", directive);
   }
 
@@ -2131,11 +2154,11 @@
   }
 
   void test_visitListLiteral_const() {
-    _assertSource("const []", AstFactory.listLiteral2(Keyword.CONST, null, []));
+    _assertSource("const []", AstFactory.listLiteral2(Keyword.CONST, null));
   }
 
   void test_visitListLiteral_empty() {
-    _assertSource("[]", AstFactory.listLiteral([]));
+    _assertSource("[]", AstFactory.listLiteral());
   }
 
   void test_visitListLiteral_nonEmpty() {
@@ -2146,11 +2169,11 @@
   }
 
   void test_visitMapLiteral_const() {
-    _assertSource("const {}", AstFactory.mapLiteral(Keyword.CONST, null, []));
+    _assertSource("const {}", AstFactory.mapLiteral(Keyword.CONST, null));
   }
 
   void test_visitMapLiteral_empty() {
-    _assertSource("{}", AstFactory.mapLiteral2([]));
+    _assertSource("{}", AstFactory.mapLiteral2());
   }
 
   void test_visitMapLiteral_nonEmpty() {
@@ -2165,71 +2188,71 @@
   }
 
   void test_visitMethodDeclaration_external() {
-    _assertSource("external m();", AstFactory.methodDeclaration(null, null, null, null, AstFactory.identifier3("m"), AstFactory.formalParameterList([])));
+    _assertSource("external m();", AstFactory.methodDeclaration(null, null, null, null, AstFactory.identifier3("m"), AstFactory.formalParameterList()));
   }
 
   void test_visitMethodDeclaration_external_returnType() {
-    _assertSource("external T m();", AstFactory.methodDeclaration(null, AstFactory.typeName4("T", []), null, null, AstFactory.identifier3("m"), AstFactory.formalParameterList([])));
+    _assertSource("external T m();", AstFactory.methodDeclaration(null, AstFactory.typeName4("T"), null, null, AstFactory.identifier3("m"), AstFactory.formalParameterList()));
   }
 
   void test_visitMethodDeclaration_getter() {
-    _assertSource("get m {}", AstFactory.methodDeclaration2(null, null, Keyword.GET, null, AstFactory.identifier3("m"), null, AstFactory.blockFunctionBody2([])));
+    _assertSource("get m {}", AstFactory.methodDeclaration2(null, null, Keyword.GET, null, AstFactory.identifier3("m"), null, AstFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_getter_returnType() {
-    _assertSource("T get m {}", AstFactory.methodDeclaration2(null, AstFactory.typeName4("T", []), Keyword.GET, null, AstFactory.identifier3("m"), null, AstFactory.blockFunctionBody2([])));
+    _assertSource("T get m {}", AstFactory.methodDeclaration2(null, AstFactory.typeName4("T"), Keyword.GET, null, AstFactory.identifier3("m"), null, AstFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_getter_seturnType() {
-    _assertSource("T set m(var v) {}", AstFactory.methodDeclaration2(null, AstFactory.typeName4("T", []), Keyword.SET, null, AstFactory.identifier3("m"), AstFactory.formalParameterList([AstFactory.simpleFormalParameter(Keyword.VAR, "v")]), AstFactory.blockFunctionBody2([])));
+    _assertSource("T set m(var v) {}", AstFactory.methodDeclaration2(null, AstFactory.typeName4("T"), Keyword.SET, null, AstFactory.identifier3("m"), AstFactory.formalParameterList([AstFactory.simpleFormalParameter(Keyword.VAR, "v")]), AstFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_minimal() {
-    _assertSource("m() {}", AstFactory.methodDeclaration2(null, null, null, null, AstFactory.identifier3("m"), AstFactory.formalParameterList([]), AstFactory.blockFunctionBody2([])));
+    _assertSource("m() {}", AstFactory.methodDeclaration2(null, null, null, null, AstFactory.identifier3("m"), AstFactory.formalParameterList(), AstFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_multipleParameters() {
     _assertSource("m(var a, var b) {}", AstFactory.methodDeclaration2(null, null, null, null, AstFactory.identifier3("m"), AstFactory.formalParameterList([
         AstFactory.simpleFormalParameter(Keyword.VAR, "a"),
-        AstFactory.simpleFormalParameter(Keyword.VAR, "b")]), AstFactory.blockFunctionBody2([])));
+        AstFactory.simpleFormalParameter(Keyword.VAR, "b")]), AstFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_operator() {
-    _assertSource("operator +() {}", AstFactory.methodDeclaration2(null, null, null, Keyword.OPERATOR, AstFactory.identifier3("+"), AstFactory.formalParameterList([]), AstFactory.blockFunctionBody2([])));
+    _assertSource("operator +() {}", AstFactory.methodDeclaration2(null, null, null, Keyword.OPERATOR, AstFactory.identifier3("+"), AstFactory.formalParameterList(), AstFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_operator_returnType() {
-    _assertSource("T operator +() {}", AstFactory.methodDeclaration2(null, AstFactory.typeName4("T", []), null, Keyword.OPERATOR, AstFactory.identifier3("+"), AstFactory.formalParameterList([]), AstFactory.blockFunctionBody2([])));
+    _assertSource("T operator +() {}", AstFactory.methodDeclaration2(null, AstFactory.typeName4("T"), null, Keyword.OPERATOR, AstFactory.identifier3("+"), AstFactory.formalParameterList(), AstFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_returnType() {
-    _assertSource("T m() {}", AstFactory.methodDeclaration2(null, AstFactory.typeName4("T", []), null, null, AstFactory.identifier3("m"), AstFactory.formalParameterList([]), AstFactory.blockFunctionBody2([])));
+    _assertSource("T m() {}", AstFactory.methodDeclaration2(null, AstFactory.typeName4("T"), null, null, AstFactory.identifier3("m"), AstFactory.formalParameterList(), AstFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_setter() {
-    _assertSource("set m(var v) {}", AstFactory.methodDeclaration2(null, null, Keyword.SET, null, AstFactory.identifier3("m"), AstFactory.formalParameterList([AstFactory.simpleFormalParameter(Keyword.VAR, "v")]), AstFactory.blockFunctionBody2([])));
+    _assertSource("set m(var v) {}", AstFactory.methodDeclaration2(null, null, Keyword.SET, null, AstFactory.identifier3("m"), AstFactory.formalParameterList([AstFactory.simpleFormalParameter(Keyword.VAR, "v")]), AstFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_static() {
-    _assertSource("static m() {}", AstFactory.methodDeclaration2(Keyword.STATIC, null, null, null, AstFactory.identifier3("m"), AstFactory.formalParameterList([]), AstFactory.blockFunctionBody2([])));
+    _assertSource("static m() {}", AstFactory.methodDeclaration2(Keyword.STATIC, null, null, null, AstFactory.identifier3("m"), AstFactory.formalParameterList(), AstFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_static_returnType() {
-    _assertSource("static T m() {}", AstFactory.methodDeclaration2(Keyword.STATIC, AstFactory.typeName4("T", []), null, null, AstFactory.identifier3("m"), AstFactory.formalParameterList([]), AstFactory.blockFunctionBody2([])));
+    _assertSource("static T m() {}", AstFactory.methodDeclaration2(Keyword.STATIC, AstFactory.typeName4("T"), null, null, AstFactory.identifier3("m"), AstFactory.formalParameterList(), AstFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_withMetadata() {
-    MethodDeclaration declaration = AstFactory.methodDeclaration2(null, null, null, null, AstFactory.identifier3("m"), AstFactory.formalParameterList([]), AstFactory.blockFunctionBody2([]));
-    declaration.metadata = AstFactory.list([AstFactory.annotation(AstFactory.identifier3("deprecated"))]);
+    MethodDeclaration declaration = AstFactory.methodDeclaration2(null, null, null, null, AstFactory.identifier3("m"), AstFactory.formalParameterList(), AstFactory.blockFunctionBody2());
+    declaration.metadata = [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
     _assertSource("@deprecated m() {}", declaration);
   }
 
   void test_visitMethodInvocation_noTarget() {
-    _assertSource("m()", AstFactory.methodInvocation2("m", []));
+    _assertSource("m()", AstFactory.methodInvocation2("m"));
   }
 
   void test_visitMethodInvocation_target() {
-    _assertSource("t.m()", AstFactory.methodInvocation(AstFactory.identifier3("t"), "m", []));
+    _assertSource("t.m()", AstFactory.methodInvocation(AstFactory.identifier3("t"), "m"));
   }
 
   void test_visitNamedExpression() {
@@ -2262,7 +2285,7 @@
 
   void test_visitPartDirective_withMetadata() {
     PartDirective directive = AstFactory.partDirective2("a.dart");
-    directive.metadata = AstFactory.list([AstFactory.annotation(AstFactory.identifier3("deprecated"))]);
+    directive.metadata = [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
     _assertSource("@deprecated part 'a.dart';", directive);
   }
 
@@ -2272,7 +2295,7 @@
 
   void test_visitPartOfDirective_withMetadata() {
     PartOfDirective directive = AstFactory.partOfDirective(AstFactory.libraryIdentifier2(["l"]));
-    directive.metadata = AstFactory.list([AstFactory.annotation(AstFactory.identifier3("deprecated"))]);
+    directive.metadata = [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
     _assertSource("@deprecated part of l;", directive);
   }
 
@@ -2297,11 +2320,11 @@
   }
 
   void test_visitRedirectingConstructorInvocation_named() {
-    _assertSource("this.c()", AstFactory.redirectingConstructorInvocation2("c", []));
+    _assertSource("this.c()", AstFactory.redirectingConstructorInvocation2("c"));
   }
 
   void test_visitRedirectingConstructorInvocation_unnamed() {
-    _assertSource("this()", AstFactory.redirectingConstructorInvocation([]));
+    _assertSource("this()", AstFactory.redirectingConstructorInvocation());
   }
 
   void test_visitRethrowExpression() {
@@ -2326,11 +2349,11 @@
   }
 
   void test_visitSimpleFormalParameter_keyword_type() {
-    _assertSource("final A a", AstFactory.simpleFormalParameter2(Keyword.FINAL, AstFactory.typeName4("A", []), "a"));
+    _assertSource("final A a", AstFactory.simpleFormalParameter2(Keyword.FINAL, AstFactory.typeName4("A"), "a"));
   }
 
   void test_visitSimpleFormalParameter_type() {
-    _assertSource("A a", AstFactory.simpleFormalParameter4(AstFactory.typeName4("A", []), "a"));
+    _assertSource("A a", AstFactory.simpleFormalParameter4(AstFactory.typeName4("A"), "a"));
   }
 
   void test_visitSimpleIdentifier() {
@@ -2349,11 +2372,11 @@
   }
 
   void test_visitSuperConstructorInvocation() {
-    _assertSource("super()", AstFactory.superConstructorInvocation([]));
+    _assertSource("super()", AstFactory.superConstructorInvocation());
   }
 
   void test_visitSuperConstructorInvocation_named() {
-    _assertSource("super.c()", AstFactory.superConstructorInvocation2("c", []));
+    _assertSource("super.c()", AstFactory.superConstructorInvocation2("c"));
   }
 
   void test_visitSuperExpression() {
@@ -2361,41 +2384,41 @@
   }
 
   void test_visitSwitchCase_multipleLabels() {
-    _assertSource("l1: l2: case a: {}", AstFactory.switchCase2(AstFactory.list([AstFactory.label2("l1"), AstFactory.label2("l2")]), AstFactory.identifier3("a"), [AstFactory.block([])]));
+    _assertSource("l1: l2: case a: {}", AstFactory.switchCase2([AstFactory.label2("l1"), AstFactory.label2("l2")], AstFactory.identifier3("a"), [AstFactory.block()]));
   }
 
   void test_visitSwitchCase_multipleStatements() {
-    _assertSource("case a: {} {}", AstFactory.switchCase(AstFactory.identifier3("a"), [AstFactory.block([]), AstFactory.block([])]));
+    _assertSource("case a: {} {}", AstFactory.switchCase(AstFactory.identifier3("a"), [AstFactory.block(), AstFactory.block()]));
   }
 
   void test_visitSwitchCase_noLabels() {
-    _assertSource("case a: {}", AstFactory.switchCase(AstFactory.identifier3("a"), [AstFactory.block([])]));
+    _assertSource("case a: {}", AstFactory.switchCase(AstFactory.identifier3("a"), [AstFactory.block()]));
   }
 
   void test_visitSwitchCase_singleLabel() {
-    _assertSource("l1: case a: {}", AstFactory.switchCase2(AstFactory.list([AstFactory.label2("l1")]), AstFactory.identifier3("a"), [AstFactory.block([])]));
+    _assertSource("l1: case a: {}", AstFactory.switchCase2([AstFactory.label2("l1")], AstFactory.identifier3("a"), [AstFactory.block()]));
   }
 
   void test_visitSwitchDefault_multipleLabels() {
-    _assertSource("l1: l2: default: {}", AstFactory.switchDefault(AstFactory.list([AstFactory.label2("l1"), AstFactory.label2("l2")]), [AstFactory.block([])]));
+    _assertSource("l1: l2: default: {}", AstFactory.switchDefault([AstFactory.label2("l1"), AstFactory.label2("l2")], [AstFactory.block()]));
   }
 
   void test_visitSwitchDefault_multipleStatements() {
-    _assertSource("default: {} {}", AstFactory.switchDefault2([AstFactory.block([]), AstFactory.block([])]));
+    _assertSource("default: {} {}", AstFactory.switchDefault2([AstFactory.block(), AstFactory.block()]));
   }
 
   void test_visitSwitchDefault_noLabels() {
-    _assertSource("default: {}", AstFactory.switchDefault2([AstFactory.block([])]));
+    _assertSource("default: {}", AstFactory.switchDefault2([AstFactory.block()]));
   }
 
   void test_visitSwitchDefault_singleLabel() {
-    _assertSource("l1: default: {}", AstFactory.switchDefault(AstFactory.list([AstFactory.label2("l1")]), [AstFactory.block([])]));
+    _assertSource("l1: default: {}", AstFactory.switchDefault([AstFactory.label2("l1")], [AstFactory.block()]));
   }
 
   void test_visitSwitchStatement() {
     _assertSource("switch (a) {case 'b': {} default: {}}", AstFactory.switchStatement(AstFactory.identifier3("a"), [
-        AstFactory.switchCase(AstFactory.string2("b"), [AstFactory.block([])]),
-        AstFactory.switchDefault2([AstFactory.block([])])]));
+        AstFactory.switchCase(AstFactory.string2("b"), [AstFactory.block()]),
+        AstFactory.switchDefault2([AstFactory.block()])]));
   }
 
   void test_visitSymbolLiteral_multiple() {
@@ -2425,58 +2448,58 @@
   }
 
   void test_visitTryStatement_catch() {
-    _assertSource("try {} on E {}", AstFactory.tryStatement2(AstFactory.block([]), [AstFactory.catchClause3(AstFactory.typeName4("E", []), [])]));
+    _assertSource("try {} on E {}", AstFactory.tryStatement2(AstFactory.block(), [AstFactory.catchClause3(AstFactory.typeName4("E"))]));
   }
 
   void test_visitTryStatement_catches() {
-    _assertSource("try {} on E {} on F {}", AstFactory.tryStatement2(AstFactory.block([]), [
-        AstFactory.catchClause3(AstFactory.typeName4("E", []), []),
-        AstFactory.catchClause3(AstFactory.typeName4("F", []), [])]));
+    _assertSource("try {} on E {} on F {}", AstFactory.tryStatement2(AstFactory.block(), [
+        AstFactory.catchClause3(AstFactory.typeName4("E")),
+        AstFactory.catchClause3(AstFactory.typeName4("F"))]));
   }
 
   void test_visitTryStatement_catchFinally() {
-    _assertSource("try {} on E {} finally {}", AstFactory.tryStatement3(AstFactory.block([]), AstFactory.list([AstFactory.catchClause3(AstFactory.typeName4("E", []), [])]), AstFactory.block([])));
+    _assertSource("try {} on E {} finally {}", AstFactory.tryStatement3(AstFactory.block(), [AstFactory.catchClause3(AstFactory.typeName4("E"))], AstFactory.block()));
   }
 
   void test_visitTryStatement_finally() {
-    _assertSource("try {} finally {}", AstFactory.tryStatement(AstFactory.block([]), AstFactory.block([])));
+    _assertSource("try {} finally {}", AstFactory.tryStatement(AstFactory.block(), AstFactory.block()));
   }
 
   void test_visitTypeArgumentList_multiple() {
     _assertSource("<E, F>", AstFactory.typeArgumentList([
-        AstFactory.typeName4("E", []),
-        AstFactory.typeName4("F", [])]));
+        AstFactory.typeName4("E"),
+        AstFactory.typeName4("F")]));
   }
 
   void test_visitTypeArgumentList_single() {
-    _assertSource("<E>", AstFactory.typeArgumentList([AstFactory.typeName4("E", [])]));
+    _assertSource("<E>", AstFactory.typeArgumentList([AstFactory.typeName4("E")]));
   }
 
   void test_visitTypeName_multipleArgs() {
     _assertSource("C<D, E>", AstFactory.typeName4("C", [
-        AstFactory.typeName4("D", []),
-        AstFactory.typeName4("E", [])]));
+        AstFactory.typeName4("D"),
+        AstFactory.typeName4("E")]));
   }
 
   void test_visitTypeName_nestedArg() {
-    _assertSource("C<D<E>>", AstFactory.typeName4("C", [AstFactory.typeName4("D", [AstFactory.typeName4("E", [])])]));
+    _assertSource("C<D<E>>", AstFactory.typeName4("C", [AstFactory.typeName4("D", [AstFactory.typeName4("E")])]));
   }
 
   void test_visitTypeName_noArgs() {
-    _assertSource("C", AstFactory.typeName4("C", []));
+    _assertSource("C", AstFactory.typeName4("C"));
   }
 
   void test_visitTypeName_singleArg() {
-    _assertSource("C<D>", AstFactory.typeName4("C", [AstFactory.typeName4("D", [])]));
+    _assertSource("C<D>", AstFactory.typeName4("C", [AstFactory.typeName4("D")]));
   }
 
   void test_visitTypeParameter_withExtends() {
-    _assertSource("E extends C", AstFactory.typeParameter2("E", AstFactory.typeName4("C", [])));
+    _assertSource("E extends C", AstFactory.typeParameter2("E", AstFactory.typeName4("C")));
   }
 
   void test_visitTypeParameter_withMetadata() {
     TypeParameter parameter = AstFactory.typeParameter("E");
-    parameter.metadata = AstFactory.list([AstFactory.annotation(AstFactory.identifier3("deprecated"))]);
+    parameter.metadata = [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
     _assertSource("@deprecated E", parameter);
   }
 
@@ -2502,12 +2525,12 @@
 
   void test_visitVariableDeclaration_withMetadata() {
     VariableDeclaration declaration = AstFactory.variableDeclaration("a");
-    declaration.metadata = AstFactory.list([AstFactory.annotation(AstFactory.identifier3("deprecated"))]);
+    declaration.metadata = [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
     _assertSource("@deprecated a", declaration);
   }
 
   void test_visitVariableDeclarationList_const_type() {
-    _assertSource("const C a, b", AstFactory.variableDeclarationList(Keyword.CONST, AstFactory.typeName4("C", []), [
+    _assertSource("const C a, b", AstFactory.variableDeclarationList(Keyword.CONST, AstFactory.typeName4("C"), [
         AstFactory.variableDeclaration("a"),
         AstFactory.variableDeclaration("b")]));
   }
@@ -2522,12 +2545,12 @@
     VariableDeclarationList declarationList = AstFactory.variableDeclarationList2(Keyword.FINAL, [
         AstFactory.variableDeclaration("a"),
         AstFactory.variableDeclaration("b")]);
-    declarationList.metadata = AstFactory.list([AstFactory.annotation(AstFactory.identifier3("deprecated"))]);
+    declarationList.metadata = [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
     _assertSource("@deprecated final a, b", declarationList);
   }
 
   void test_visitVariableDeclarationList_type() {
-    _assertSource("C a, b", AstFactory.variableDeclarationList(null, AstFactory.typeName4("C", []), [
+    _assertSource("C a, b", AstFactory.variableDeclarationList(null, AstFactory.typeName4("C"), [
         AstFactory.variableDeclaration("a"),
         AstFactory.variableDeclaration("b")]));
   }
@@ -2539,22 +2562,22 @@
   }
 
   void test_visitVariableDeclarationStatement() {
-    _assertSource("C c;", AstFactory.variableDeclarationStatement(null, AstFactory.typeName4("C", []), [AstFactory.variableDeclaration("c")]));
+    _assertSource("C c;", AstFactory.variableDeclarationStatement(null, AstFactory.typeName4("C"), [AstFactory.variableDeclaration("c")]));
   }
 
   void test_visitWhileStatement() {
-    _assertSource("while (c) {}", AstFactory.whileStatement(AstFactory.identifier3("c"), AstFactory.block([])));
+    _assertSource("while (c) {}", AstFactory.whileStatement(AstFactory.identifier3("c"), AstFactory.block()));
   }
 
   void test_visitWithClause_multiple() {
     _assertSource("with A, B, C", AstFactory.withClause([
-        AstFactory.typeName4("A", []),
-        AstFactory.typeName4("B", []),
-        AstFactory.typeName4("C", [])]));
+        AstFactory.typeName4("A"),
+        AstFactory.typeName4("B"),
+        AstFactory.typeName4("C")]));
   }
 
   void test_visitWithClause_single() {
-    _assertSource("with A", AstFactory.withClause([AstFactory.typeName4("A", [])]));
+    _assertSource("with A", AstFactory.withClause([AstFactory.typeName4("A")]));
   }
 
   void test_visitYieldStatement() {
diff --git a/pkg/analyzer/test/generated/compile_time_error_code_test.dart b/pkg/analyzer/test/generated/compile_time_error_code_test.dart
index a3193bc..0ad4ace8 100644
--- a/pkg/analyzer/test/generated/compile_time_error_code_test.dart
+++ b/pkg/analyzer/test/generated/compile_time_error_code_test.dart
@@ -1191,26 +1191,6 @@
     verify([source]);
   }
 
-  void test_duplicateDefinition_parameterWithFunctionName_local() {
-    Source source = addSource(r'''
-main() {
-  f(f) {}
-}''');
-    resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.DUPLICATE_DEFINITION]);
-    verify([source]);
-  }
-
-  void test_duplicateDefinition_parameterWithFunctionName_topLevel() {
-    Source source = addSource(r'''
-main() {
-  f(f) {}
-}''');
-    resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.DUPLICATE_DEFINITION]);
-    verify([source]);
-  }
-
   void test_duplicateDefinitionInheritance_instanceGetter_staticGetter() {
     Source source = addSource(r'''
 class A {
@@ -1399,7 +1379,8 @@
 class M {}
 class C = bool with M;''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS]);
+    assertErrors(source, [CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS,
+                          CompileTimeErrorCode.MIXIN_HAS_NO_CONSTRUCTORS]);
     verify([source]);
   }
 
@@ -1417,7 +1398,8 @@
 class M {}
 class C = int with M;''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS]);
+    assertErrors(source, [CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS,
+                          CompileTimeErrorCode.MIXIN_HAS_NO_CONSTRUCTORS]);
     verify([source]);
   }
 
@@ -1444,7 +1426,8 @@
 class M {}
 class C = String with M;''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS]);
+    assertErrors(source, [CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS,
+                          CompileTimeErrorCode.MIXIN_HAS_NO_CONSTRUCTORS]);
     verify([source]);
   }
 
@@ -2908,6 +2891,32 @@
 class C = B with a.A;'''], <ErrorCode> [ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED], <ErrorCode> [CompileTimeErrorCode.MIXIN_DEFERRED_CLASS]);
   }
 
+  void test_mixinHasNoConstructors_mixinApp() {
+    Source source = addSource(r'''
+class B {
+  B({x});
+}
+class M {}
+class C = B with M;
+''');
+    resolve(source);
+    assertErrors(source, [CompileTimeErrorCode.MIXIN_HAS_NO_CONSTRUCTORS]);
+    verify([source]);
+  }
+
+  void test_mixinHasNoConstructors_mixinClass() {
+    Source source = addSource(r'''
+class B {
+  B({x});
+}
+class M {}
+class C extends B with M {}
+''');
+    resolve(source);
+    assertErrors(source, [CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT]);
+    verify([source]);
+  }
+
   void test_mixinInheritsFromNotObject_classDeclaration_extends() {
     Source source = addSource(r'''
 class A {}
@@ -3196,6 +3205,202 @@
     verify([source]);
   }
 
+  void test_noDefaultSuperConstructorExplicit_MixinAppWithDirectSuperCall() {
+    Source source = addSource(r'''
+class M {}
+class B {
+  B({x});
+  B.named(); // To avoid MIXIN_HAS_NO_CONSTRUCTORS
+}
+class Mixed = B with M;
+class C extends Mixed {
+  C(x) : super();
+}
+''');
+    resolve(source);
+    assertErrors(source, [
+        CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT]);
+    verify([source]);
+  }
+
+  void test_noDefaultSuperConstructorExplicit_MixinAppWithNamedSuperCall() {
+    Source source = addSource(r'''
+class M {}
+class B {
+  B.named({x});
+  B.named2(); // To avoid MIXIN_HAS_NO_CONSTRUCTORS
+}
+class Mixed = B with M;
+class C extends Mixed {
+  C(x) : super.named();
+}
+''');
+    resolve(source);
+    assertErrors(source, [
+        CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER]);
+    // Don't verify since call to super.named() can't be resolved.
+  }
+
+  void test_noDefaultSuperConstructorExplicit_mixinAppWithNamedParam() {
+    Source source = addSource(r'''
+class M {}
+class B {
+  B({x});
+  B.named(); // To avoid MIXIN_HAS_NO_CONSTRUCTORS
+}
+class Mixed = B with M;
+class C extends Mixed {
+  C();
+}
+''');
+    resolve(source);
+    assertErrors(source, [
+        CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT]);
+    verify([source]);
+  }
+
+  void test_noDefaultSuperConstructorExplicit_mixinAppWithOptionalParam() {
+    Source source = addSource(r'''
+class M {}
+class B {
+  B([x]);
+  B.named(); // To avoid MIXIN_HAS_NO_CONSTRUCTORS
+}
+class Mixed = B with M;
+class C extends Mixed {
+  C();
+}
+''');
+    resolve(source);
+    assertErrors(source, [
+        CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT]);
+    verify([source]);
+  }
+
+  void test_noDefaultSuperConstructorExplicit_MixinWithDirectSuperCall() {
+    Source source = addSource(r'''
+class M {}
+class B {
+  B({x});
+}
+class C extends B with M {
+  C(x) : super();
+}
+''');
+    resolve(source);
+    assertErrors(source, [
+        CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT]);
+    verify([source]);
+  }
+
+  void test_noDefaultSuperConstructorExplicit_MixinWithNamedSuperCall() {
+    Source source = addSource(r'''
+class M {}
+class B {
+  B.named({x});
+}
+class C extends B with M {
+  C(x) : super.named();
+}
+''');
+    resolve(source);
+    assertErrors(source, [
+        CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER]);
+    // Don't verify since call to super.named() can't be resolved.
+  }
+
+  void test_noDefaultSuperConstructorExplicit_mixinWithNamedParam() {
+    Source source = addSource(r'''
+class M {}
+class B {
+  B({x});
+}
+class C extends B with M {
+  C();
+}
+''');
+    resolve(source);
+    assertErrors(source, [
+        CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT]);
+    verify([source]);
+  }
+
+  void test_noDefaultSuperConstructorExplicit_mixinWithOptionalParam() {
+    Source source = addSource(r'''
+class M {}
+class B {
+  B([x]);
+}
+class C extends B with M {
+  C();
+}
+''');
+    resolve(source);
+    assertErrors(source, [
+        CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT]);
+    verify([source]);
+  }
+
+  void test_noDefaultSuperConstructorImplicit_mixinAppWithNamedParam() {
+    Source source = addSource(r'''
+class M {}
+class B {
+  B({x});
+  B.named(); // To avoid MIXIN_HAS_NO_CONSTRUCTORS
+}
+class Mixed = B with M;
+class C extends Mixed {}
+''');
+    resolve(source);
+    assertErrors(source, [
+        CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT]);
+    verify([source]);
+  }
+
+  void test_noDefaultSuperConstructorImplicit_mixinAppWithOptionalParam() {
+    Source source = addSource(r'''
+class M {}
+class B {
+  B([x]);
+  B.named(); // To avoid MIXIN_HAS_NO_CONSTRUCTORS
+}
+class Mixed = B with M;
+class C extends Mixed {}
+''');
+    resolve(source);
+    assertErrors(source, [
+        CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT]);
+    verify([source]);
+  }
+
+  void test_noDefaultSuperConstructorImplicit_mixinWithNamedParam() {
+    Source source = addSource(r'''
+class M {}
+class B {
+  B({x});
+}
+class C extends B with M {}
+''');
+    resolve(source);
+    assertErrors(source, [
+        CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT]);
+    verify([source]);
+  }
+
+  void test_noDefaultSuperConstructorImplicit_mixinWithOptionalParam() {
+    Source source = addSource(r'''
+class M {}
+class B {
+  B([x]);
+}
+class C extends B with M {}
+''');
+    resolve(source);
+    assertErrors(source, [
+        CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT]);
+    verify([source]);
+  }
+
   void test_noDefaultSuperConstructorImplicit_superHasParameters() {
     Source source = addSource(r'''
 class A {
@@ -4415,6 +4620,22 @@
     verify([source]);
   }
 
+  void test_typeAliasCannotReferenceItself_19459() {
+    // A complex example involving multiple classes.  This is legal, since
+    // typedef F references itself only via a class.
+    Source source = addSource(r'''
+class A<B, C> {}
+abstract class D {
+  f(E e);
+}
+abstract class E extends A<dynamic, F> {}
+typedef D F();
+''');
+    resolve(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
   void test_typeAliasCannotReferenceItself_parameterType_named() {
     Source source = addSource("typedef A({A a});");
     resolve(source);
@@ -4444,6 +4665,7 @@
   }
 
   void test_typeAliasCannotReferenceItself_returnClass_withTypeAlias() {
+    // A typedef is allowed to indirectly reference itself via a class.
     Source source = addSource(r'''
 typedef C A();
 typedef A B();
@@ -4451,7 +4673,7 @@
   B a;
 }''');
     resolve(source);
-    assertErrors(source, [CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF]);
+    assertNoErrors(source);
     verify([source]);
   }
 
diff --git a/pkg/analyzer/test/generated/element_test.dart b/pkg/analyzer/test/generated/element_test.dart
index 7a85c93..6c5f028 100644
--- a/pkg/analyzer/test/generated/element_test.dart
+++ b/pkg/analyzer/test/generated/element_test.dart
@@ -55,9 +55,9 @@
 
 class ClassElementImplTest extends EngineTestCase {
   void test_getAllSupertypes_interface() {
-    ClassElement classA = ElementFactory.classElement2("A", []);
-    ClassElement classB = ElementFactory.classElement("B", classA.type, []);
-    ClassElementImpl elementC = ElementFactory.classElement2("C", []);
+    ClassElement classA = ElementFactory.classElement2("A");
+    ClassElement classB = ElementFactory.classElement("B", classA.type);
+    ClassElementImpl elementC = ElementFactory.classElement2("C");
     InterfaceType typeObject = classA.supertype;
     InterfaceType typeA = classA.type;
     InterfaceType typeB = classB.type;
@@ -73,9 +73,9 @@
   }
 
   void test_getAllSupertypes_mixins() {
-    ClassElement classA = ElementFactory.classElement2("A", []);
-    ClassElement classB = ElementFactory.classElement("B", classA.type, []);
-    ClassElementImpl classC = ElementFactory.classElement2("C", []);
+    ClassElement classA = ElementFactory.classElement2("A");
+    ClassElement classB = ElementFactory.classElement("B", classA.type);
+    ClassElementImpl classC = ElementFactory.classElement2("C");
     InterfaceType typeObject = classA.supertype;
     InterfaceType typeA = classA.type;
     InterfaceType typeB = classB.type;
@@ -91,15 +91,15 @@
   }
 
   void test_getAllSupertypes_recursive() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
-    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
     classA.supertype = classB.type;
     List<InterfaceType> supers = classB.allSupertypes;
     expect(supers, hasLength(1));
   }
 
   void test_getField() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String fieldName = "f";
     FieldElementImpl field = ElementFactory.fieldElement(fieldName, false, false, false, null);
     classA.fields = <FieldElement> [field];
@@ -109,17 +109,17 @@
   }
 
   void test_getMethod_declared() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElement method = ElementFactory.methodElement(methodName, null, []);
+    MethodElement method = ElementFactory.methodElement(methodName, null);
     classA.methods = <MethodElement> [method];
     expect(classA.getMethod(methodName), same(method));
   }
 
   void test_getMethod_undeclared() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElement method = ElementFactory.methodElement(methodName, null, []);
+    MethodElement method = ElementFactory.methodElement(methodName, null);
     classA.methods = <MethodElement> [method];
     expect(classA.getMethod("${methodName}x"), isNull);
   }
@@ -152,59 +152,59 @@
   }
 
   void test_hasNonFinalField_false_const() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     classA.fields = <FieldElement> [ElementFactory.fieldElement("f", false, false, true, classA.type)];
     expect(classA.hasNonFinalField, isFalse);
   }
 
   void test_hasNonFinalField_false_final() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     classA.fields = <FieldElement> [ElementFactory.fieldElement("f", false, true, false, classA.type)];
     expect(classA.hasNonFinalField, isFalse);
   }
 
   void test_hasNonFinalField_false_recursive() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
-    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
     classA.supertype = classB.type;
     expect(classA.hasNonFinalField, isFalse);
   }
 
   void test_hasNonFinalField_true_immediate() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     classA.fields = <FieldElement> [ElementFactory.fieldElement("f", false, false, false, classA.type)];
     expect(classA.hasNonFinalField, isTrue);
   }
 
   void test_hasNonFinalField_true_inherited() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
-    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
     classA.fields = <FieldElement> [ElementFactory.fieldElement("f", false, false, false, classA.type)];
     expect(classB.hasNonFinalField, isTrue);
   }
 
   void test_hasStaticMember_false_empty() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     // no members
     expect(classA.hasStaticMember, isFalse);
   }
 
   void test_hasStaticMember_false_instanceMethod() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
-    MethodElement method = ElementFactory.methodElement("foo", null, []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
+    MethodElement method = ElementFactory.methodElement("foo", null);
     classA.methods = <MethodElement> [method];
     expect(classA.hasStaticMember, isFalse);
   }
 
   void test_hasStaticMember_instanceGetter() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     PropertyAccessorElement getter = ElementFactory.getterElement("foo", false, null);
     classA.accessors = <PropertyAccessorElement> [getter];
     expect(classA.hasStaticMember, isFalse);
   }
 
   void test_hasStaticMember_true_getter() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     PropertyAccessorElementImpl getter = ElementFactory.getterElement("foo", false, null);
     classA.accessors = <PropertyAccessorElement> [getter];
     // "foo" is static
@@ -213,8 +213,8 @@
   }
 
   void test_hasStaticMember_true_method() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
-    MethodElementImpl method = ElementFactory.methodElement("foo", null, []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
+    MethodElementImpl method = ElementFactory.methodElement("foo", null);
     classA.methods = <MethodElement> [method];
     // "foo" is static
     method.static = true;
@@ -222,7 +222,7 @@
   }
 
   void test_hasStaticMember_true_setter() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     PropertyAccessorElementImpl setter = ElementFactory.setterElement("foo", false, null);
     classA.accessors = <PropertyAccessorElement> [setter];
     // "foo" is static
@@ -235,9 +235,9 @@
     //   m() {}
     // }
     LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElement method = ElementFactory.methodElement(methodName, null, []);
+    MethodElement method = ElementFactory.methodElement(methodName, null);
     classA.methods = <MethodElement> [method];
     (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA];
     expect(classA.lookUpConcreteMethod(methodName, library), same(method));
@@ -248,9 +248,9 @@
     //   m();
     // }
     LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElementImpl method = ElementFactory.methodElement(methodName, null, []);
+    MethodElementImpl method = ElementFactory.methodElement(methodName, null);
     method.abstract = true;
     classA.methods = <MethodElement> [method];
     (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA];
@@ -265,12 +265,12 @@
     //   m();
     // }
     LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElement inheritedMethod = ElementFactory.methodElement(methodName, null, []);
+    MethodElement inheritedMethod = ElementFactory.methodElement(methodName, null);
     classA.methods = <MethodElement> [inheritedMethod];
-    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
-    MethodElementImpl method = ElementFactory.methodElement(methodName, null, []);
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
+    MethodElementImpl method = ElementFactory.methodElement(methodName, null);
     method.abstract = true;
     classB.methods = <MethodElement> [method];
     (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA, classB];
@@ -285,12 +285,12 @@
     //   m() {}
     // }
     LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElement inheritedMethod = ElementFactory.methodElement(methodName, null, []);
+    MethodElement inheritedMethod = ElementFactory.methodElement(methodName, null);
     classA.methods = <MethodElement> [inheritedMethod];
-    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
-    MethodElement method = ElementFactory.methodElement(methodName, null, []);
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
+    MethodElement method = ElementFactory.methodElement(methodName, null);
     classB.methods = <MethodElement> [method];
     (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA, classB];
     expect(classB.lookUpConcreteMethod(methodName, library), same(method));
@@ -304,14 +304,14 @@
     //   m() {}
     // }
     LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     classA.abstract = true;
     String methodName = "m";
-    MethodElementImpl inheritedMethod = ElementFactory.methodElement(methodName, null, []);
+    MethodElementImpl inheritedMethod = ElementFactory.methodElement(methodName, null);
     inheritedMethod.abstract = true;
     classA.methods = <MethodElement> [inheritedMethod];
-    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
-    MethodElement method = ElementFactory.methodElement(methodName, null, []);
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
+    MethodElement method = ElementFactory.methodElement(methodName, null);
     classB.methods = <MethodElement> [method];
     (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA, classB];
     expect(classB.lookUpConcreteMethod(methodName, library), same(method));
@@ -324,11 +324,11 @@
     // class B extends A {
     // }
     LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElement inheritedMethod = ElementFactory.methodElement(methodName, null, []);
+    MethodElement inheritedMethod = ElementFactory.methodElement(methodName, null);
     classA.methods = <MethodElement> [inheritedMethod];
-    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
     (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA, classB];
     expect(classB.lookUpConcreteMethod(methodName, library), same(inheritedMethod));
   }
@@ -337,7 +337,7 @@
     // class A {
     // }
     LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA];
     expect(classA.lookUpConcreteMethod("m", library), isNull);
   }
@@ -347,7 +347,7 @@
     //   get g {}
     // }
     LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String getterName = "g";
     PropertyAccessorElement getter = ElementFactory.getterElement(getterName, false, null);
     classA.accessors = <PropertyAccessorElement> [getter];
@@ -362,11 +362,11 @@
     // class B extends A {
     // }
     LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String getterName = "g";
     PropertyAccessorElement getter = ElementFactory.getterElement(getterName, false, null);
     classA.accessors = <PropertyAccessorElement> [getter];
-    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
     (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA, classB];
     expect(classB.lookUpGetter(getterName, library), same(getter));
   }
@@ -375,7 +375,7 @@
     // class A {
     // }
     LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA];
     expect(classA.lookUpGetter("g", library), isNull);
   }
@@ -386,8 +386,8 @@
     // class B extends A {
     // }
     LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
-    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
     classA.supertype = classB.type;
     (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA, classB];
     expect(classA.lookUpGetter("g", library), isNull);
@@ -398,7 +398,7 @@
     //   get g {}
     // }
     LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String getterName = "g";
     PropertyAccessorElement getter = ElementFactory.getterElement(getterName, false, null);
     classA.accessors = <PropertyAccessorElement> [getter];
@@ -413,11 +413,11 @@
     // class B extends A {
     // }
     LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String getterName = "g";
     PropertyAccessorElement inheritedGetter = ElementFactory.getterElement(getterName, false, null);
     classA.accessors = <PropertyAccessorElement> [inheritedGetter];
-    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
     (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA, classB];
     expect(classB.lookUpInheritedConcreteGetter(getterName, library), same(inheritedGetter));
   }
@@ -426,7 +426,7 @@
     // class A {
     // }
     LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA];
     expect(classA.lookUpInheritedConcreteGetter("g", library), isNull);
   }
@@ -437,8 +437,8 @@
     // class B extends A {
     // }
     LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
-    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
     classA.supertype = classB.type;
     (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA, classB];
     expect(classA.lookUpInheritedConcreteGetter("g", library), isNull);
@@ -449,9 +449,9 @@
     //   m() {}
     // }
     LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElement method = ElementFactory.methodElement(methodName, null, []);
+    MethodElement method = ElementFactory.methodElement(methodName, null);
     classA.methods = <MethodElement> [method];
     (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA];
     expect(classA.lookUpInheritedConcreteMethod(methodName, library), isNull);
@@ -465,12 +465,12 @@
     //   m();
     // }
     LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElement inheritedMethod = ElementFactory.methodElement(methodName, null, []);
+    MethodElement inheritedMethod = ElementFactory.methodElement(methodName, null);
     classA.methods = <MethodElement> [inheritedMethod];
-    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
-    MethodElementImpl method = ElementFactory.methodElement(methodName, null, []);
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
+    MethodElementImpl method = ElementFactory.methodElement(methodName, null);
     method.abstract = true;
     classB.methods = <MethodElement> [method];
     (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA, classB];
@@ -485,12 +485,12 @@
     //   m() {}
     // }
     LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElement inheritedMethod = ElementFactory.methodElement(methodName, null, []);
+    MethodElement inheritedMethod = ElementFactory.methodElement(methodName, null);
     classA.methods = <MethodElement> [inheritedMethod];
-    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
-    MethodElement method = ElementFactory.methodElement(methodName, null, []);
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
+    MethodElement method = ElementFactory.methodElement(methodName, null);
     classB.methods = <MethodElement> [method];
     (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA, classB];
     expect(classB.lookUpInheritedConcreteMethod(methodName, library), same(inheritedMethod));
@@ -504,14 +504,14 @@
     //   m() {}
     // }
     LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     classA.abstract = true;
     String methodName = "m";
-    MethodElementImpl inheritedMethod = ElementFactory.methodElement(methodName, null, []);
+    MethodElementImpl inheritedMethod = ElementFactory.methodElement(methodName, null);
     inheritedMethod.abstract = true;
     classA.methods = <MethodElement> [inheritedMethod];
-    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
-    MethodElement method = ElementFactory.methodElement(methodName, null, []);
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
+    MethodElement method = ElementFactory.methodElement(methodName, null);
     classB.methods = <MethodElement> [method];
     (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA, classB];
     expect(classB.lookUpInheritedConcreteMethod(methodName, library), isNull);
@@ -528,16 +528,16 @@
     //   m() {}
     // }
     LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElement inheritedMethod = ElementFactory.methodElement(methodName, null, []);
+    MethodElement inheritedMethod = ElementFactory.methodElement(methodName, null);
     classA.methods = <MethodElement> [inheritedMethod];
-    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
-    MethodElementImpl abstractMethod = ElementFactory.methodElement(methodName, null, []);
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
+    MethodElementImpl abstractMethod = ElementFactory.methodElement(methodName, null);
     abstractMethod.abstract = true;
     classB.methods = <MethodElement> [abstractMethod];
-    ClassElementImpl classC = ElementFactory.classElement("C", classB.type, []);
-    MethodElementImpl method = ElementFactory.methodElement(methodName, null, []);
+    ClassElementImpl classC = ElementFactory.classElement("C", classB.type);
+    MethodElementImpl method = ElementFactory.methodElement(methodName, null);
     classC.methods = <MethodElement> [method];
     (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA, classB, classC];
     expect(classC.lookUpInheritedConcreteMethod(methodName, library), same(inheritedMethod));
@@ -550,11 +550,11 @@
     // class B extends A {
     // }
     LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElement inheritedMethod = ElementFactory.methodElement(methodName, null, []);
+    MethodElement inheritedMethod = ElementFactory.methodElement(methodName, null);
     classA.methods = <MethodElement> [inheritedMethod];
-    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
     (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA, classB];
     expect(classB.lookUpInheritedConcreteMethod(methodName, library), same(inheritedMethod));
   }
@@ -563,7 +563,7 @@
     // class A {
     // }
     LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA];
     expect(classA.lookUpInheritedConcreteMethod("m", library), isNull);
   }
@@ -573,7 +573,7 @@
     //   set g(x) {}
     // }
     LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String setterName = "s";
     PropertyAccessorElement setter = ElementFactory.setterElement(setterName, false, null);
     classA.accessors = <PropertyAccessorElement> [setter];
@@ -588,11 +588,11 @@
     // class B extends A {
     // }
     LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String setterName = "s";
     PropertyAccessorElement setter = ElementFactory.setterElement(setterName, false, null);
     classA.accessors = <PropertyAccessorElement> [setter];
-    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
     (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA, classB];
     expect(classB.lookUpInheritedConcreteSetter(setterName, library), same(setter));
   }
@@ -601,7 +601,7 @@
     // class A {
     // }
     LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA];
     expect(classA.lookUpInheritedConcreteSetter("s", library), isNull);
   }
@@ -612,8 +612,8 @@
     // class B extends A {
     // }
     LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
-    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
     classA.supertype = classB.type;
     (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA, classB];
     expect(classA.lookUpInheritedConcreteSetter("s", library), isNull);
@@ -624,9 +624,9 @@
     //   m() {}
     // }
     LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElement method = ElementFactory.methodElement(methodName, null, []);
+    MethodElement method = ElementFactory.methodElement(methodName, null);
     classA.methods = <MethodElement> [method];
     (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA];
     expect(classA.lookUpInheritedMethod(methodName, library), isNull);
@@ -640,12 +640,12 @@
     //   m() {}
     // }
     LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElement inheritedMethod = ElementFactory.methodElement(methodName, null, []);
+    MethodElement inheritedMethod = ElementFactory.methodElement(methodName, null);
     classA.methods = <MethodElement> [inheritedMethod];
-    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
-    MethodElement method = ElementFactory.methodElement(methodName, null, []);
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
+    MethodElement method = ElementFactory.methodElement(methodName, null);
     classB.methods = <MethodElement> [method];
     (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA, classB];
     expect(classB.lookUpInheritedMethod(methodName, library), same(inheritedMethod));
@@ -658,11 +658,11 @@
     // class B extends A {
     // }
     LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElement inheritedMethod = ElementFactory.methodElement(methodName, null, []);
+    MethodElement inheritedMethod = ElementFactory.methodElement(methodName, null);
     classA.methods = <MethodElement> [inheritedMethod];
-    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
     (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA, classB];
     expect(classB.lookUpInheritedMethod(methodName, library), same(inheritedMethod));
   }
@@ -671,16 +671,16 @@
     // class A {
     // }
     LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA];
     expect(classA.lookUpInheritedMethod("m", library), isNull);
   }
 
   void test_lookUpMethod_declared() {
     LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElement method = ElementFactory.methodElement(methodName, null, []);
+    MethodElement method = ElementFactory.methodElement(methodName, null);
     classA.methods = <MethodElement> [method];
     (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA];
     expect(classA.lookUpMethod(methodName, library), same(method));
@@ -688,26 +688,26 @@
 
   void test_lookUpMethod_inherited() {
     LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElement method = ElementFactory.methodElement(methodName, null, []);
+    MethodElement method = ElementFactory.methodElement(methodName, null);
     classA.methods = <MethodElement> [method];
-    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
     (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA, classB];
     expect(classB.lookUpMethod(methodName, library), same(method));
   }
 
   void test_lookUpMethod_undeclared() {
     LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA];
     expect(classA.lookUpMethod("m", library), isNull);
   }
 
   void test_lookUpMethod_undeclared_recursive() {
     LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
-    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
     classA.supertype = classB.type;
     (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA, classB];
     expect(classA.lookUpMethod("m", library), isNull);
@@ -718,7 +718,7 @@
     //   set g(x) {}
     // }
     LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String setterName = "s";
     PropertyAccessorElement setter = ElementFactory.setterElement(setterName, false, null);
     classA.accessors = <PropertyAccessorElement> [setter];
@@ -733,11 +733,11 @@
     // class B extends A {
     // }
     LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String setterName = "s";
     PropertyAccessorElement setter = ElementFactory.setterElement(setterName, false, null);
     classA.accessors = <PropertyAccessorElement> [setter];
-    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
     (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA, classB];
     expect(classB.lookUpSetter(setterName, library), same(setter));
   }
@@ -746,7 +746,7 @@
     // class A {
     // }
     LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA];
     expect(classA.lookUpSetter("s", library), isNull);
   }
@@ -757,8 +757,8 @@
     // class B extends A {
     // }
     LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
-    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
     classA.supertype = classB.type;
     (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA, classB];
     expect(classA.lookUpSetter("s", library), isNull);
@@ -770,7 +770,7 @@
     TestTypeProvider typeProvider = new TestTypeProvider();
     CompilationUnitElementImpl unit = ElementFactory.compilationUnit("/lib.dart");
     String enumName = "E";
-    ClassElement enumElement = ElementFactory.enumElement(typeProvider, enumName, []);
+    ClassElement enumElement = ElementFactory.enumElement(typeProvider, enumName);
     unit.enums = <ClassElement> [enumElement];
     expect(unit.getEnum(enumName), same(enumElement));
   }
@@ -779,7 +779,7 @@
     TestTypeProvider typeProvider = new TestTypeProvider();
     CompilationUnitElementImpl unit = ElementFactory.compilationUnit("/lib.dart");
     String enumName = "E";
-    ClassElement enumElement = ElementFactory.enumElement(typeProvider, enumName, []);
+    ClassElement enumElement = ElementFactory.enumElement(typeProvider, enumName);
     unit.enums = <ClassElement> [enumElement];
     expect(unit.getEnum("${enumName}x"), isNull);
   }
@@ -787,7 +787,7 @@
   void test_getType_declared() {
     CompilationUnitElementImpl unit = ElementFactory.compilationUnit("/lib.dart");
     String className = "C";
-    ClassElement classElement = ElementFactory.classElement2(className, []);
+    ClassElement classElement = ElementFactory.classElement2(className);
     unit.types = <ClassElement> [classElement];
     expect(unit.getType(className), same(classElement));
   }
@@ -795,7 +795,7 @@
   void test_getType_undeclared() {
     CompilationUnitElementImpl unit = ElementFactory.compilationUnit("/lib.dart");
     String className = "C";
-    ClassElement classElement = ElementFactory.classElement2(className, []);
+    ClassElement classElement = ElementFactory.classElement2(className);
     unit.types = <ClassElement> [classElement];
     expect(unit.getType("${className}x"), isNull);
   }
@@ -804,7 +804,7 @@
 class ElementImplTest extends EngineTestCase {
   void test_equals() {
     LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
-    ClassElementImpl classElement = ElementFactory.classElement2("C", []);
+    ClassElementImpl classElement = ElementFactory.classElement2("C");
     (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classElement];
     FieldElement field = ElementFactory.fieldElement("next", false, false, false, classElement.type);
     classElement.fields = <FieldElement> [field];
@@ -817,7 +817,7 @@
   void test_isAccessibleIn_private_differentLibrary() {
     AnalysisContextImpl context = createAnalysisContext();
     LibraryElementImpl library1 = ElementFactory.library(context, "lib1");
-    ClassElement classElement = ElementFactory.classElement2("_C", []);
+    ClassElement classElement = ElementFactory.classElement2("_C");
     (library1.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classElement];
     LibraryElementImpl library2 = ElementFactory.library(context, "lib2");
     expect(classElement.isAccessibleIn(library2), isFalse);
@@ -825,7 +825,7 @@
 
   void test_isAccessibleIn_private_sameLibrary() {
     LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
-    ClassElement classElement = ElementFactory.classElement2("_C", []);
+    ClassElement classElement = ElementFactory.classElement2("_C");
     (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classElement];
     expect(classElement.isAccessibleIn(library), isTrue);
   }
@@ -833,7 +833,7 @@
   void test_isAccessibleIn_public_differentLibrary() {
     AnalysisContextImpl context = createAnalysisContext();
     LibraryElementImpl library1 = ElementFactory.library(context, "lib1");
-    ClassElement classElement = ElementFactory.classElement2("C", []);
+    ClassElement classElement = ElementFactory.classElement2("C");
     (library1.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classElement];
     LibraryElementImpl library2 = ElementFactory.library(context, "lib2");
     expect(classElement.isAccessibleIn(library2), isTrue);
@@ -841,45 +841,45 @@
 
   void test_isAccessibleIn_public_sameLibrary() {
     LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
-    ClassElement classElement = ElementFactory.classElement2("C", []);
+    ClassElement classElement = ElementFactory.classElement2("C");
     (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classElement];
     expect(classElement.isAccessibleIn(library), isTrue);
   }
 
   void test_isPrivate_false() {
-    Element element = ElementFactory.classElement2("C", []);
+    Element element = ElementFactory.classElement2("C");
     expect(element.isPrivate, isFalse);
   }
 
   void test_isPrivate_null() {
-    Element element = ElementFactory.classElement2(null, []);
+    Element element = ElementFactory.classElement2(null);
     expect(element.isPrivate, isTrue);
   }
 
   void test_isPrivate_true() {
-    Element element = ElementFactory.classElement2("_C", []);
+    Element element = ElementFactory.classElement2("_C");
     expect(element.isPrivate, isTrue);
   }
 
   void test_isPublic_false() {
-    Element element = ElementFactory.classElement2("_C", []);
+    Element element = ElementFactory.classElement2("_C");
     expect(element.isPublic, isFalse);
   }
 
   void test_isPublic_null() {
-    Element element = ElementFactory.classElement2(null, []);
+    Element element = ElementFactory.classElement2(null);
     expect(element.isPublic, isFalse);
   }
 
   void test_isPublic_true() {
-    Element element = ElementFactory.classElement2("C", []);
+    Element element = ElementFactory.classElement2("C");
     expect(element.isPublic, isTrue);
   }
 
   void test_SORT_BY_OFFSET() {
-    ClassElementImpl classElementA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classElementA = ElementFactory.classElement2("A");
     classElementA.nameOffset = 1;
-    ClassElementImpl classElementB = ElementFactory.classElement2("B", []);
+    ClassElementImpl classElementB = ElementFactory.classElement2("B");
     classElementB.nameOffset = 2;
     expect(Element.SORT_BY_OFFSET(classElementA, classElementA), 0);
     expect(Element.SORT_BY_OFFSET(classElementA, classElementB) < 0, isTrue);
@@ -889,7 +889,7 @@
 
 class ElementKindTest extends EngineTestCase {
   void test_of_nonNull() {
-    expect(ElementKind.of(ElementFactory.classElement2("A", [])), same(ElementKind.CLASS));
+    expect(ElementKind.of(ElementFactory.classElement2("A")), same(ElementKind.CLASS));
   }
 
   void test_of_null() {
@@ -1011,7 +1011,7 @@
 
   void test_isAssignableTo_normalAndPositionalArgs() {
     // ([a]) -> void <: (a) -> void
-    ClassElement a = ElementFactory.classElement2("A", []);
+    ClassElement a = ElementFactory.classElement2("A");
     FunctionType t = ElementFactory.functionElement6("t", null, <ClassElement> [a]).type;
     FunctionType s = ElementFactory.functionElement5("s", <ClassElement> [a]).type;
     expect(t.isSubtypeOf(s), isTrue);
@@ -1023,7 +1023,7 @@
 
   void test_isSubtypeOf_baseCase_classFunction() {
     // () -> void <: Function
-    ClassElementImpl functionElement = ElementFactory.classElement2("Function", []);
+    ClassElementImpl functionElement = ElementFactory.classElement2("Function");
     InterfaceTypeImpl functionType = new InterfaceTypeImpl_FunctionTypeImplTest_test_isSubtypeOf_baseCase_classFunction(functionElement);
     FunctionType f = ElementFactory.functionElement("f").type;
     expect(f.isSubtypeOf(functionType), isTrue);
@@ -1033,7 +1033,7 @@
     // class C
     // ! () -> void <: C
     FunctionType f = ElementFactory.functionElement("f").type;
-    InterfaceType t = ElementFactory.classElement2("C", []).type;
+    InterfaceType t = ElementFactory.classElement2("C").type;
     expect(f.isSubtypeOf(t), isFalse);
   }
 
@@ -1053,8 +1053,8 @@
     // B extends A
     // ({name: A}) -> void <: ({name: B}) -> void
     // ({name: B}) -> void <: ({name: A}) -> void
-    ClassElement a = ElementFactory.classElement2("A", []);
-    ClassElement b = ElementFactory.classElement("B", a.type, []);
+    ClassElement a = ElementFactory.classElement2("A");
+    ClassElement b = ElementFactory.classElement("B", a.type);
     FunctionType t = ElementFactory.functionElement4("t", null, null, <String> ["name"], <ClassElement> [a]).type;
     FunctionType s = ElementFactory.functionElement4("s", null, null, <String> ["name"], <ClassElement> [b]).type;
     expect(t.isSubtypeOf(s), isTrue);
@@ -1063,8 +1063,8 @@
 
   void test_isSubtypeOf_namedParameters_isNotAssignable() {
     // ! ({name: A}) -> void <: ({name: B}) -> void
-    FunctionType t = ElementFactory.functionElement4("t", null, null, <String> ["name"], <ClassElement> [ElementFactory.classElement2("A", [])]).type;
-    FunctionType s = ElementFactory.functionElement4("s", null, null, <String> ["name"], <ClassElement> [ElementFactory.classElement2("B", [])]).type;
+    FunctionType t = ElementFactory.functionElement4("t", null, null, <String> ["name"], <ClassElement> [ElementFactory.classElement2("A")]).type;
+    FunctionType s = ElementFactory.functionElement4("s", null, null, <String> ["name"], <ClassElement> [ElementFactory.classElement2("B")]).type;
     expect(t.isSubtypeOf(s), isFalse);
   }
 
@@ -1074,8 +1074,8 @@
     // void s({A diff}) {}
     // ! t <: s
     // ! s <: t
-    ClassElement a = ElementFactory.classElement2("A", []);
-    ClassElement b = ElementFactory.classElement("B", a.type, []);
+    ClassElement a = ElementFactory.classElement2("A");
+    ClassElement b = ElementFactory.classElement("B", a.type);
     FunctionType t = ElementFactory.functionElement4("t", null, null, <String> ["name"], <ClassElement> [a]).type;
     FunctionType s = ElementFactory.functionElement4("s", null, null, <String> ["diff"], <ClassElement> [b]).type;
     expect(t.isSubtypeOf(s), isFalse);
@@ -1085,8 +1085,8 @@
   void test_isSubtypeOf_namedParameters_orderOfParams() {
     // B extends A
     // ({A: A, B: B}) -> void <: ({B: B, A: A}) -> void
-    ClassElement a = ElementFactory.classElement2("A", []);
-    ClassElement b = ElementFactory.classElement("B", a.type, []);
+    ClassElement a = ElementFactory.classElement2("A");
+    ClassElement b = ElementFactory.classElement("B", a.type);
     FunctionType t = ElementFactory.functionElement4("t", null, null, <String> ["A", "B"], <ClassElement> [a, b]).type;
     FunctionType s = ElementFactory.functionElement4("s", null, null, <String> ["B", "A"], <ClassElement> [b, a]).type;
     expect(t.isSubtypeOf(s), isTrue);
@@ -1095,8 +1095,8 @@
   void test_isSubtypeOf_namedParameters_orderOfParams2() {
     // B extends A
     // ! ({B: B}) -> void <: ({B: B, A: A}) -> void
-    ClassElement a = ElementFactory.classElement2("A", []);
-    ClassElement b = ElementFactory.classElement("B", a.type, []);
+    ClassElement a = ElementFactory.classElement2("A");
+    ClassElement b = ElementFactory.classElement("B", a.type);
     FunctionType t = ElementFactory.functionElement4("t", null, null, <String> ["B"], <ClassElement> [b]).type;
     FunctionType s = ElementFactory.functionElement4("s", null, null, <String> ["B", "A"], <ClassElement> [b, a]).type;
     expect(t.isSubtypeOf(s), isFalse);
@@ -1105,8 +1105,8 @@
   void test_isSubtypeOf_namedParameters_orderOfParams3() {
     // B extends A
     // ({A: A, B: B}) -> void <: ({A: A}) -> void
-    ClassElement a = ElementFactory.classElement2("A", []);
-    ClassElement b = ElementFactory.classElement("B", a.type, []);
+    ClassElement a = ElementFactory.classElement2("A");
+    ClassElement b = ElementFactory.classElement("B", a.type);
     FunctionType t = ElementFactory.functionElement4("t", null, null, <String> ["A", "B"], <ClassElement> [a, b]).type;
     FunctionType s = ElementFactory.functionElement4("s", null, null, <String> ["B"], <ClassElement> [b]).type;
     expect(t.isSubtypeOf(s), isTrue);
@@ -1115,8 +1115,8 @@
   void test_isSubtypeOf_namedParameters_sHasMoreParams() {
     // B extends A
     // ! ({name: A}) -> void <: ({name: B, name2: B}) -> void
-    ClassElement a = ElementFactory.classElement2("A", []);
-    ClassElement b = ElementFactory.classElement("B", a.type, []);
+    ClassElement a = ElementFactory.classElement2("A");
+    ClassElement b = ElementFactory.classElement("B", a.type);
     FunctionType t = ElementFactory.functionElement4("t", null, null, <String> ["name"], <ClassElement> [a]).type;
     FunctionType s = ElementFactory.functionElement4("s", null, null, <String> ["name", "name2"], <ClassElement> [b, b]).type;
     expect(t.isSubtypeOf(s), isFalse);
@@ -1125,8 +1125,8 @@
   void test_isSubtypeOf_namedParameters_tHasMoreParams() {
     // B extends A
     // ({name: A, name2: A}) -> void <: ({name: B}) -> void
-    ClassElement a = ElementFactory.classElement2("A", []);
-    ClassElement b = ElementFactory.classElement("B", a.type, []);
+    ClassElement a = ElementFactory.classElement2("A");
+    ClassElement b = ElementFactory.classElement("B", a.type);
     FunctionType t = ElementFactory.functionElement4("t", null, null, <String> ["name", "name2"], <ClassElement> [a, a]).type;
     FunctionType s = ElementFactory.functionElement4("s", null, null, <String> ["name"], <ClassElement> [b]).type;
     expect(t.isSubtypeOf(s), isTrue);
@@ -1134,7 +1134,7 @@
 
   void test_isSubtypeOf_normalAndPositionalArgs_1() {
     // ([a]) -> void <: (a) -> void
-    ClassElement a = ElementFactory.classElement2("A", []);
+    ClassElement a = ElementFactory.classElement2("A");
     FunctionType t = ElementFactory.functionElement6("t", null, <ClassElement> [a]).type;
     FunctionType s = ElementFactory.functionElement5("s", <ClassElement> [a]).type;
     expect(t.isSubtypeOf(s), isTrue);
@@ -1143,7 +1143,7 @@
 
   void test_isSubtypeOf_normalAndPositionalArgs_2() {
     // (a, [a]) -> void <: (a) -> void
-    ClassElement a = ElementFactory.classElement2("A", []);
+    ClassElement a = ElementFactory.classElement2("A");
     FunctionType t = ElementFactory.functionElement6("t", <ClassElement> [a], <ClassElement> [a]).type;
     FunctionType s = ElementFactory.functionElement5("s", <ClassElement> [a]).type;
     expect(t.isSubtypeOf(s), isTrue);
@@ -1152,7 +1152,7 @@
 
   void test_isSubtypeOf_normalAndPositionalArgs_3() {
     // ([a]) -> void <: () -> void
-    ClassElement a = ElementFactory.classElement2("A", []);
+    ClassElement a = ElementFactory.classElement2("A");
     FunctionType t = ElementFactory.functionElement6("t", null, <ClassElement> [a]).type;
     FunctionType s = ElementFactory.functionElement("s").type;
     expect(t.isSubtypeOf(s), isTrue);
@@ -1161,11 +1161,11 @@
 
   void test_isSubtypeOf_normalAndPositionalArgs_4() {
     // (a, b, [c, d, e]) -> void <: (a, b, c, [d]) -> void
-    ClassElement a = ElementFactory.classElement2("A", []);
-    ClassElement b = ElementFactory.classElement2("B", []);
-    ClassElement c = ElementFactory.classElement2("C", []);
-    ClassElement d = ElementFactory.classElement2("D", []);
-    ClassElement e = ElementFactory.classElement2("E", []);
+    ClassElement a = ElementFactory.classElement2("A");
+    ClassElement b = ElementFactory.classElement2("B");
+    ClassElement c = ElementFactory.classElement2("C");
+    ClassElement d = ElementFactory.classElement2("D");
+    ClassElement e = ElementFactory.classElement2("E");
     FunctionType t = ElementFactory.functionElement6("t", <ClassElement> [a, b], <ClassElement> [c, d, e]).type;
     FunctionType s = ElementFactory.functionElement6("s", <ClassElement> [a, b, c], <ClassElement> [d]).type;
     expect(t.isSubtypeOf(s), isTrue);
@@ -1176,8 +1176,8 @@
     // B extends A
     // (a) -> void <: (b) -> void
     // (b) -> void <: (a) -> void
-    ClassElement a = ElementFactory.classElement2("A", []);
-    ClassElement b = ElementFactory.classElement("B", a.type, []);
+    ClassElement a = ElementFactory.classElement2("A");
+    ClassElement b = ElementFactory.classElement("B", a.type);
     FunctionType t = ElementFactory.functionElement5("t", <ClassElement> [a]).type;
     FunctionType s = ElementFactory.functionElement5("s", <ClassElement> [b]).type;
     expect(t.isSubtypeOf(s), isTrue);
@@ -1186,16 +1186,16 @@
 
   void test_isSubtypeOf_normalParameters_isNotAssignable() {
     // ! (a) -> void <: (b) -> void
-    FunctionType t = ElementFactory.functionElement5("t", <ClassElement> [ElementFactory.classElement2("A", [])]).type;
-    FunctionType s = ElementFactory.functionElement5("s", <ClassElement> [ElementFactory.classElement2("B", [])]).type;
+    FunctionType t = ElementFactory.functionElement5("t", <ClassElement> [ElementFactory.classElement2("A")]).type;
+    FunctionType s = ElementFactory.functionElement5("s", <ClassElement> [ElementFactory.classElement2("B")]).type;
     expect(t.isSubtypeOf(s), isFalse);
   }
 
   void test_isSubtypeOf_normalParameters_sHasMoreParams() {
     // B extends A
     // ! (a) -> void <: (b, b) -> void
-    ClassElement a = ElementFactory.classElement2("A", []);
-    ClassElement b = ElementFactory.classElement("B", a.type, []);
+    ClassElement a = ElementFactory.classElement2("A");
+    ClassElement b = ElementFactory.classElement("B", a.type);
     FunctionType t = ElementFactory.functionElement5("t", <ClassElement> [a]).type;
     FunctionType s = ElementFactory.functionElement5("s", <ClassElement> [b, b]).type;
     expect(t.isSubtypeOf(s), isFalse);
@@ -1204,8 +1204,8 @@
   void test_isSubtypeOf_normalParameters_tHasMoreParams() {
     // B extends A
     // ! (a, a) -> void <: (a) -> void
-    ClassElement a = ElementFactory.classElement2("A", []);
-    ClassElement b = ElementFactory.classElement("B", a.type, []);
+    ClassElement a = ElementFactory.classElement2("A");
+    ClassElement b = ElementFactory.classElement("B", a.type);
     FunctionType t = ElementFactory.functionElement5("t", <ClassElement> [a, a]).type;
     FunctionType s = ElementFactory.functionElement5("s", <ClassElement> [b]).type;
     // note, this is a different assertion from the other "tHasMoreParams" tests, this is
@@ -1224,8 +1224,8 @@
     // B extends A
     // ([a]) -> void <: ([b]) -> void
     // ([b]) -> void <: ([a]) -> void
-    ClassElement a = ElementFactory.classElement2("A", []);
-    ClassElement b = ElementFactory.classElement("B", a.type, []);
+    ClassElement a = ElementFactory.classElement2("A");
+    ClassElement b = ElementFactory.classElement("B", a.type);
     FunctionType t = ElementFactory.functionElement6("t", null, <ClassElement> [a]).type;
     FunctionType s = ElementFactory.functionElement6("s", null, <ClassElement> [b]).type;
     expect(t.isSubtypeOf(s), isTrue);
@@ -1234,16 +1234,16 @@
 
   void test_isSubtypeOf_positionalParameters_isNotAssignable() {
     // ! ([a]) -> void <: ([b]) -> void
-    FunctionType t = ElementFactory.functionElement6("t", null, <ClassElement> [ElementFactory.classElement2("A", [])]).type;
-    FunctionType s = ElementFactory.functionElement6("s", null, <ClassElement> [ElementFactory.classElement2("B", [])]).type;
+    FunctionType t = ElementFactory.functionElement6("t", null, <ClassElement> [ElementFactory.classElement2("A")]).type;
+    FunctionType s = ElementFactory.functionElement6("s", null, <ClassElement> [ElementFactory.classElement2("B")]).type;
     expect(t.isSubtypeOf(s), isFalse);
   }
 
   void test_isSubtypeOf_positionalParameters_sHasMoreParams() {
     // B extends A
     // ! ([a]) -> void <: ([b, b]) -> void
-    ClassElement a = ElementFactory.classElement2("A", []);
-    ClassElement b = ElementFactory.classElement("B", a.type, []);
+    ClassElement a = ElementFactory.classElement2("A");
+    ClassElement b = ElementFactory.classElement("B", a.type);
     FunctionType t = ElementFactory.functionElement6("t", null, <ClassElement> [a]).type;
     FunctionType s = ElementFactory.functionElement6("s", null, <ClassElement> [b, b]).type;
     expect(t.isSubtypeOf(s), isFalse);
@@ -1252,8 +1252,8 @@
   void test_isSubtypeOf_positionalParameters_tHasMoreParams() {
     // B extends A
     // ([a, a]) -> void <: ([b]) -> void
-    ClassElement a = ElementFactory.classElement2("A", []);
-    ClassElement b = ElementFactory.classElement("B", a.type, []);
+    ClassElement a = ElementFactory.classElement2("A");
+    ClassElement b = ElementFactory.classElement("B", a.type);
     FunctionType t = ElementFactory.functionElement6("t", null, <ClassElement> [a, a]).type;
     FunctionType s = ElementFactory.functionElement6("s", null, <ClassElement> [b]).type;
     expect(t.isSubtypeOf(s), isTrue);
@@ -1272,8 +1272,8 @@
     // B extends A
     // () -> A <: () -> B
     // () -> B <: () -> A
-    ClassElement a = ElementFactory.classElement2("A", []);
-    ClassElement b = ElementFactory.classElement("B", a.type, []);
+    ClassElement a = ElementFactory.classElement2("A");
+    ClassElement b = ElementFactory.classElement("B", a.type);
     FunctionType t = ElementFactory.functionElement2("t", a).type;
     FunctionType s = ElementFactory.functionElement2("s", b).type;
     expect(t.isSubtypeOf(s), isTrue);
@@ -1282,8 +1282,8 @@
 
   void test_isSubtypeOf_returnType_tNotAssignableToS() {
     // ! () -> A <: () -> B
-    FunctionType t = ElementFactory.functionElement2("t", ElementFactory.classElement2("A", [])).type;
-    FunctionType s = ElementFactory.functionElement2("s", ElementFactory.classElement2("B", [])).type;
+    FunctionType t = ElementFactory.functionElement2("t", ElementFactory.classElement2("A")).type;
+    FunctionType s = ElementFactory.functionElement2("s", ElementFactory.classElement2("B")).type;
     expect(t.isSubtypeOf(s), isFalse);
   }
 
@@ -1317,7 +1317,7 @@
   void test_isSubtypeOf_wrongFunctionType_normal_named() {
     // ! (a) -> void <: ({name: A}) -> void
     // ! ({name: A}) -> void <: (a) -> void
-    ClassElement a = ElementFactory.classElement2("A", []);
+    ClassElement a = ElementFactory.classElement2("A");
     FunctionType t = ElementFactory.functionElement5("t", <ClassElement> [a]).type;
     FunctionType s = ElementFactory.functionElement7("s", null, <String> ["name"], <ClassElement> [a]).type;
     expect(t.isSubtypeOf(s), isFalse);
@@ -1327,7 +1327,7 @@
   void test_isSubtypeOf_wrongFunctionType_optional_named() {
     // ! ([a]) -> void <: ({name: A}) -> void
     // ! ({name: A}) -> void <: ([a]) -> void
-    ClassElement a = ElementFactory.classElement2("A", []);
+    ClassElement a = ElementFactory.classElement2("A");
     FunctionType t = ElementFactory.functionElement6("t", null, <ClassElement> [a]).type;
     FunctionType s = ElementFactory.functionElement7("s", null, <String> ["name"], <ClassElement> [a]).type;
     expect(t.isSubtypeOf(s), isFalse);
@@ -1453,11 +1453,11 @@
     //    \ /
     //     E
     //
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
-    ClassElementImpl classB = ElementFactory.classElement2("B", []);
-    ClassElementImpl classC = ElementFactory.classElement2("C", []);
-    ClassElementImpl classD = ElementFactory.classElement2("D", []);
-    ClassElementImpl classE = ElementFactory.classElement2("E", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
+    ClassElementImpl classB = ElementFactory.classElement2("B");
+    ClassElementImpl classC = ElementFactory.classElement2("C");
+    ClassElementImpl classD = ElementFactory.classElement2("D");
+    ClassElementImpl classE = ElementFactory.classElement2("E");
     classB.interfaces = <InterfaceType> [classA.type];
     classC.interfaces = <InterfaceType> [classA.type];
     classD.interfaces = <InterfaceType> [classC.type];
@@ -1480,11 +1480,11 @@
     //    \ /
     //     E
     //
-    ClassElement classA = ElementFactory.classElement2("A", []);
-    ClassElement classB = ElementFactory.classElement("B", classA.type, []);
-    ClassElement classC = ElementFactory.classElement("C", classA.type, []);
-    ClassElement classD = ElementFactory.classElement("D", classC.type, []);
-    ClassElementImpl classE = ElementFactory.classElement("E", classB.type, []);
+    ClassElement classA = ElementFactory.classElement2("A");
+    ClassElement classB = ElementFactory.classElement("B", classA.type);
+    ClassElement classC = ElementFactory.classElement("C", classA.type);
+    ClassElement classD = ElementFactory.classElement("D", classC.type);
+    ClassElementImpl classE = ElementFactory.classElement("E", classB.type);
     classE.interfaces = <InterfaceType> [classD.type];
     // assertion: even though the longest path to Object for typeB is 2, and typeE extends typeB,
     // the longest path for typeE is 4 since it also implements typeD
@@ -1498,14 +1498,14 @@
     //     |
     //     A
     //
-    ClassElement classA = ElementFactory.classElement2("A", []);
+    ClassElement classA = ElementFactory.classElement2("A");
     InterfaceType object = classA.supertype;
     expect(InterfaceTypeImpl.computeLongestInheritancePathToObject(object), 0);
   }
 
   void test_computeLongestInheritancePathToObject_recursion() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
-    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
     classA.supertype = classB.type;
     expect(InterfaceTypeImpl.computeLongestInheritancePathToObject(classA.type), 2);
   }
@@ -1520,9 +1520,9 @@
     //     |
     //     C
     //
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
-    ClassElementImpl classB = ElementFactory.classElement2("B", []);
-    ClassElementImpl classC = ElementFactory.classElement2("C", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
+    ClassElementImpl classB = ElementFactory.classElement2("B");
+    ClassElementImpl classC = ElementFactory.classElement2("C");
     classB.interfaces = <InterfaceType> [classA.type];
     classC.interfaces = <InterfaceType> [classB.type];
     expect(InterfaceTypeImpl.computeLongestInheritancePathToObject(classA.type), 1);
@@ -1540,9 +1540,9 @@
     //     |
     //     C
     //
-    ClassElement classA = ElementFactory.classElement2("A", []);
-    ClassElement classB = ElementFactory.classElement("B", classA.type, []);
-    ClassElement classC = ElementFactory.classElement("C", classB.type, []);
+    ClassElement classA = ElementFactory.classElement2("A");
+    ClassElement classB = ElementFactory.classElement("B", classA.type);
+    ClassElement classC = ElementFactory.classElement("C", classB.type);
     expect(InterfaceTypeImpl.computeLongestInheritancePathToObject(classA.type), 1);
     expect(InterfaceTypeImpl.computeLongestInheritancePathToObject(classB.type), 2);
     expect(InterfaceTypeImpl.computeLongestInheritancePathToObject(classC.type), 3);
@@ -1558,10 +1558,10 @@
     //
     //  D
     //
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     ClassElementImpl classB = ElementFactory.classElement2("B", ["T"]);
     ClassElementImpl classC = ElementFactory.classElement2("C", ["T"]);
-    ClassElement classD = ElementFactory.classElement2("D", []);
+    ClassElement classD = ElementFactory.classElement2("D");
     InterfaceType typeA = classA.type;
     classB.interfaces = <InterfaceType> [typeA];
     InterfaceTypeImpl typeBT = new InterfaceTypeImpl.con1(classB);
@@ -1600,7 +1600,7 @@
     //
     //  D
     //
-    ClassElement classA = ElementFactory.classElement2("A", []);
+    ClassElement classA = ElementFactory.classElement2("A");
     InterfaceType typeA = classA.type;
     ClassElement classB = ElementFactory.classElement("B", typeA, ["T"]);
     ClassElementImpl classC = ElementFactory.classElement2("C", ["T"]);
@@ -1608,7 +1608,7 @@
     DartType typeT = classC.type.typeArguments[0];
     typeBT.typeArguments = <DartType> [typeT];
     classC.supertype = typeBT;
-    ClassElement classD = ElementFactory.classElement2("D", []);
+    ClassElement classD = ElementFactory.classElement2("D");
     // A
     Set<InterfaceType> superinterfacesOfA = InterfaceTypeImpl.computeSuperinterfaceSet(typeA);
     expect(superinterfacesOfA, hasLength(1));
@@ -1632,11 +1632,11 @@
   }
 
   void test_computeSuperinterfaceSet_multipleInterfacePaths() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
-    ClassElementImpl classB = ElementFactory.classElement2("B", []);
-    ClassElementImpl classC = ElementFactory.classElement2("C", []);
-    ClassElementImpl classD = ElementFactory.classElement2("D", []);
-    ClassElementImpl classE = ElementFactory.classElement2("E", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
+    ClassElementImpl classB = ElementFactory.classElement2("B");
+    ClassElementImpl classC = ElementFactory.classElement2("C");
+    ClassElementImpl classD = ElementFactory.classElement2("D");
+    ClassElementImpl classE = ElementFactory.classElement2("E");
     classB.interfaces = <InterfaceType> [classA.type];
     classC.interfaces = <InterfaceType> [classA.type];
     classD.interfaces = <InterfaceType> [classC.type];
@@ -1658,11 +1658,11 @@
   }
 
   void test_computeSuperinterfaceSet_multipleSuperclassPaths() {
-    ClassElement classA = ElementFactory.classElement2("A", []);
-    ClassElement classB = ElementFactory.classElement("B", classA.type, []);
-    ClassElement classC = ElementFactory.classElement("C", classA.type, []);
-    ClassElement classD = ElementFactory.classElement("D", classC.type, []);
-    ClassElementImpl classE = ElementFactory.classElement("E", classB.type, []);
+    ClassElement classA = ElementFactory.classElement2("A");
+    ClassElement classB = ElementFactory.classElement("B", classA.type);
+    ClassElement classC = ElementFactory.classElement("C", classA.type);
+    ClassElement classD = ElementFactory.classElement("D", classC.type);
+    ClassElementImpl classE = ElementFactory.classElement("E", classB.type);
     classE.interfaces = <InterfaceType> [classD.type];
     // D
     Set<InterfaceType> superinterfacesOfD = InterfaceTypeImpl.computeSuperinterfaceSet(classD.type);
@@ -1681,17 +1681,17 @@
   }
 
   void test_computeSuperinterfaceSet_recursion() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
-    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
     classA.supertype = classB.type;
     Set<InterfaceType> superinterfacesOfB = InterfaceTypeImpl.computeSuperinterfaceSet(classB.type);
     expect(superinterfacesOfB, hasLength(2));
   }
 
   void test_computeSuperinterfaceSet_singleInterfacePath() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
-    ClassElementImpl classB = ElementFactory.classElement2("B", []);
-    ClassElementImpl classC = ElementFactory.classElement2("C", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
+    ClassElementImpl classB = ElementFactory.classElement2("B");
+    ClassElementImpl classC = ElementFactory.classElement2("C");
     classB.interfaces = <InterfaceType> [classA.type];
     classC.interfaces = <InterfaceType> [classB.type];
     // A
@@ -1719,9 +1719,9 @@
     //  |
     //  C
     //
-    ClassElement classA = ElementFactory.classElement2("A", []);
-    ClassElement classB = ElementFactory.classElement("B", classA.type, []);
-    ClassElement classC = ElementFactory.classElement("C", classB.type, []);
+    ClassElement classA = ElementFactory.classElement2("A");
+    ClassElement classB = ElementFactory.classElement("B", classA.type);
+    ClassElement classC = ElementFactory.classElement("C", classB.type);
     // A
     Set<InterfaceType> superinterfacesOfA = InterfaceTypeImpl.computeSuperinterfaceSet(classA.type);
     expect(superinterfacesOfA, hasLength(1));
@@ -1740,11 +1740,11 @@
   }
 
   void test_creation() {
-    expect(new InterfaceTypeImpl.con1(ElementFactory.classElement2("A", [])), isNotNull);
+    expect(new InterfaceTypeImpl.con1(ElementFactory.classElement2("A")), isNotNull);
   }
 
   void test_getAccessors() {
-    ClassElementImpl typeElement = ElementFactory.classElement2("A", []);
+    ClassElementImpl typeElement = ElementFactory.classElement2("A");
     PropertyAccessorElement getterG = ElementFactory.getterElement("g", false, null);
     PropertyAccessorElement getterH = ElementFactory.getterElement("h", false, null);
     typeElement.accessors = <PropertyAccessorElement> [getterG, getterH];
@@ -1753,13 +1753,13 @@
   }
 
   void test_getAccessors_empty() {
-    ClassElementImpl typeElement = ElementFactory.classElement2("A", []);
+    ClassElementImpl typeElement = ElementFactory.classElement2("A");
     InterfaceTypeImpl type = new InterfaceTypeImpl.con1(typeElement);
     expect(type.accessors.length, 0);
   }
 
   void test_getElement() {
-    ClassElementImpl typeElement = ElementFactory.classElement2("A", []);
+    ClassElementImpl typeElement = ElementFactory.classElement2("A");
     InterfaceTypeImpl type = new InterfaceTypeImpl.con1(typeElement);
     expect(type.element, typeElement);
   }
@@ -1768,7 +1768,7 @@
     //
     // class A { g {} }
     //
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String getterName = "g";
     PropertyAccessorElement getterG = ElementFactory.getterElement(getterName, false, null);
     classA.accessors = <PropertyAccessorElement> [getterG];
@@ -1789,7 +1789,7 @@
     //
     // A<I>
     //
-    InterfaceType typeI = ElementFactory.classElement2("I", []).type;
+    InterfaceType typeI = ElementFactory.classElement2("I").type;
     InterfaceTypeImpl typeAI = new InterfaceTypeImpl.con1(classA);
     typeAI.typeArguments = <DartType> [typeI];
     PropertyAccessorElement getter = typeAI.getGetter(getterName);
@@ -1802,7 +1802,7 @@
     //
     // class A {}
     //
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     InterfaceType typeA = classA.type;
     expect(typeA.getGetter("g"), isNull);
   }
@@ -1811,11 +1811,11 @@
     //
     // class C implements A, B
     //
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     InterfaceType typeA = classA.type;
-    ClassElementImpl classB = ElementFactory.classElement2("B", []);
+    ClassElementImpl classB = ElementFactory.classElement2("B");
     InterfaceType typeB = classB.type;
-    ClassElementImpl classC = ElementFactory.classElement2("C", []);
+    ClassElementImpl classC = ElementFactory.classElement2("C");
     classC.interfaces = <InterfaceType> [typeA, typeB];
     List<InterfaceType> interfaces = classC.type.interfaces;
     expect(interfaces, hasLength(2));
@@ -1841,7 +1841,7 @@
     //
     // B<I>
     //
-    InterfaceType typeI = ElementFactory.classElement2("I", []).type;
+    InterfaceType typeI = ElementFactory.classElement2("I").type;
     InterfaceTypeImpl typeBI = new InterfaceTypeImpl.con1(classB);
     typeBI.typeArguments = <DartType> [typeI];
     List<InterfaceType> interfaces = typeBI.interfaces;
@@ -1857,9 +1857,9 @@
     // class B implements A
     // class C implements B
     //
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
-    ClassElementImpl classB = ElementFactory.classElement2("B", []);
-    ClassElementImpl classC = ElementFactory.classElement2("C", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
+    ClassElementImpl classB = ElementFactory.classElement2("B");
+    ClassElementImpl classC = ElementFactory.classElement2("C");
     InterfaceType typeA = classA.type;
     InterfaceType typeB = classB.type;
     InterfaceType typeC = classC.type;
@@ -1875,9 +1875,9 @@
     // class B extends A
     // class C extends B
     //
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
-    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
-    ClassElementImpl classC = ElementFactory.classElement("C", classB.type, []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
+    ClassElementImpl classC = ElementFactory.classElement("C", classB.type);
     InterfaceType typeB = classB.type;
     InterfaceType typeC = classC.type;
     expect(typeB.getLeastUpperBound(typeC), typeB);
@@ -1885,7 +1885,7 @@
   }
 
   void test_getLeastUpperBound_functionType() {
-    DartType interfaceType = ElementFactory.classElement2("A", []).type;
+    DartType interfaceType = ElementFactory.classElement2("A").type;
     FunctionTypeImpl functionType = new FunctionTypeImpl.con1(new FunctionElementImpl.forNode(AstFactory.identifier3("f")));
     expect(interfaceType.getLeastUpperBound(functionType), isNull);
   }
@@ -1897,30 +1897,30 @@
     // class C extends A
     // class D extends B with M, N, O, P
     //
-    ClassElement classA = ElementFactory.classElement2("A", []);
-    ClassElement classB = ElementFactory.classElement("B", classA.type, []);
-    ClassElement classC = ElementFactory.classElement("C", classA.type, []);
-    ClassElementImpl classD = ElementFactory.classElement("D", classB.type, []);
+    ClassElement classA = ElementFactory.classElement2("A");
+    ClassElement classB = ElementFactory.classElement("B", classA.type);
+    ClassElement classC = ElementFactory.classElement("C", classA.type);
+    ClassElementImpl classD = ElementFactory.classElement("D", classB.type);
     InterfaceType typeA = classA.type;
     InterfaceType typeC = classC.type;
     InterfaceType typeD = classD.type;
     classD.mixins = <InterfaceType> [
-        ElementFactory.classElement2("M", []).type,
-        ElementFactory.classElement2("N", []).type,
-        ElementFactory.classElement2("O", []).type,
-        ElementFactory.classElement2("P", []).type];
+        ElementFactory.classElement2("M").type,
+        ElementFactory.classElement2("N").type,
+        ElementFactory.classElement2("O").type,
+        ElementFactory.classElement2("P").type];
     expect(typeD.getLeastUpperBound(typeC), typeA);
     expect(typeC.getLeastUpperBound(typeD), typeA);
   }
 
   void test_getLeastUpperBound_null() {
-    DartType interfaceType = ElementFactory.classElement2("A", []).type;
+    DartType interfaceType = ElementFactory.classElement2("A").type;
     expect(interfaceType.getLeastUpperBound(null), isNull);
   }
 
   void test_getLeastUpperBound_object() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
-    ClassElementImpl classB = ElementFactory.classElement2("B", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
+    ClassElementImpl classB = ElementFactory.classElement2("B");
     InterfaceType typeA = classA.type;
     InterfaceType typeB = classB.type;
     DartType typeObject = typeA.element.supertype;
@@ -1933,15 +1933,15 @@
   }
 
   void test_getLeastUpperBound_self() {
-    ClassElement classA = ElementFactory.classElement2("A", []);
+    ClassElement classA = ElementFactory.classElement2("A");
     InterfaceType typeA = classA.type;
     expect(typeA.getLeastUpperBound(typeA), typeA);
   }
 
   void test_getLeastUpperBound_sharedSuperclass1() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
-    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
-    ClassElementImpl classC = ElementFactory.classElement("C", classA.type, []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
+    ClassElementImpl classC = ElementFactory.classElement("C", classA.type);
     InterfaceType typeA = classA.type;
     InterfaceType typeB = classB.type;
     InterfaceType typeC = classC.type;
@@ -1950,10 +1950,10 @@
   }
 
   void test_getLeastUpperBound_sharedSuperclass2() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
-    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
-    ClassElementImpl classC = ElementFactory.classElement("C", classA.type, []);
-    ClassElementImpl classD = ElementFactory.classElement("D", classC.type, []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
+    ClassElementImpl classC = ElementFactory.classElement("C", classA.type);
+    ClassElementImpl classD = ElementFactory.classElement("D", classC.type);
     InterfaceType typeA = classA.type;
     InterfaceType typeB = classB.type;
     InterfaceType typeD = classD.type;
@@ -1962,10 +1962,10 @@
   }
 
   void test_getLeastUpperBound_sharedSuperclass3() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
-    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
-    ClassElementImpl classC = ElementFactory.classElement("C", classB.type, []);
-    ClassElementImpl classD = ElementFactory.classElement("D", classB.type, []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
+    ClassElementImpl classC = ElementFactory.classElement("C", classB.type);
+    ClassElementImpl classD = ElementFactory.classElement("D", classB.type);
     InterfaceType typeB = classB.type;
     InterfaceType typeC = classC.type;
     InterfaceType typeD = classD.type;
@@ -1974,11 +1974,11 @@
   }
 
   void test_getLeastUpperBound_sharedSuperclass4() {
-    ClassElement classA = ElementFactory.classElement2("A", []);
-    ClassElement classA2 = ElementFactory.classElement2("A2", []);
-    ClassElement classA3 = ElementFactory.classElement2("A3", []);
-    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
-    ClassElementImpl classC = ElementFactory.classElement("C", classA.type, []);
+    ClassElement classA = ElementFactory.classElement2("A");
+    ClassElement classA2 = ElementFactory.classElement2("A2");
+    ClassElement classA3 = ElementFactory.classElement2("A3");
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
+    ClassElementImpl classC = ElementFactory.classElement("C", classA.type);
     InterfaceType typeA = classA.type;
     InterfaceType typeA2 = classA2.type;
     InterfaceType typeA3 = classA3.type;
@@ -1991,9 +1991,9 @@
   }
 
   void test_getLeastUpperBound_sharedSuperinterface1() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
-    ClassElementImpl classB = ElementFactory.classElement2("B", []);
-    ClassElementImpl classC = ElementFactory.classElement2("C", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
+    ClassElementImpl classB = ElementFactory.classElement2("B");
+    ClassElementImpl classC = ElementFactory.classElement2("C");
     InterfaceType typeA = classA.type;
     InterfaceType typeB = classB.type;
     InterfaceType typeC = classC.type;
@@ -2004,10 +2004,10 @@
   }
 
   void test_getLeastUpperBound_sharedSuperinterface2() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
-    ClassElementImpl classB = ElementFactory.classElement2("B", []);
-    ClassElementImpl classC = ElementFactory.classElement2("C", []);
-    ClassElementImpl classD = ElementFactory.classElement2("D", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
+    ClassElementImpl classB = ElementFactory.classElement2("B");
+    ClassElementImpl classC = ElementFactory.classElement2("C");
+    ClassElementImpl classD = ElementFactory.classElement2("D");
     InterfaceType typeA = classA.type;
     InterfaceType typeB = classB.type;
     InterfaceType typeC = classC.type;
@@ -2020,10 +2020,10 @@
   }
 
   void test_getLeastUpperBound_sharedSuperinterface3() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
-    ClassElementImpl classB = ElementFactory.classElement2("B", []);
-    ClassElementImpl classC = ElementFactory.classElement2("C", []);
-    ClassElementImpl classD = ElementFactory.classElement2("D", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
+    ClassElementImpl classB = ElementFactory.classElement2("B");
+    ClassElementImpl classC = ElementFactory.classElement2("C");
+    ClassElementImpl classD = ElementFactory.classElement2("D");
     InterfaceType typeA = classA.type;
     InterfaceType typeB = classB.type;
     InterfaceType typeC = classC.type;
@@ -2036,11 +2036,11 @@
   }
 
   void test_getLeastUpperBound_sharedSuperinterface4() {
-    ClassElement classA = ElementFactory.classElement2("A", []);
-    ClassElement classA2 = ElementFactory.classElement2("A2", []);
-    ClassElement classA3 = ElementFactory.classElement2("A3", []);
-    ClassElementImpl classB = ElementFactory.classElement2("B", []);
-    ClassElementImpl classC = ElementFactory.classElement2("C", []);
+    ClassElement classA = ElementFactory.classElement2("A");
+    ClassElement classA2 = ElementFactory.classElement2("A2");
+    ClassElement classA3 = ElementFactory.classElement2("A3");
+    ClassElementImpl classB = ElementFactory.classElement2("B");
+    ClassElementImpl classC = ElementFactory.classElement2("C");
     InterfaceType typeA = classA.type;
     InterfaceType typeA2 = classA2.type;
     InterfaceType typeA3 = classA3.type;
@@ -2086,9 +2086,9 @@
     //
     // class A { m() {} }
     //
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElementImpl methodM = ElementFactory.methodElement(methodName, null, []);
+    MethodElementImpl methodM = ElementFactory.methodElement(methodName, null);
     classA.methods = <MethodElement> [methodM];
     InterfaceType typeA = classA.type;
     expect(typeA.getMethod(methodName), same(methodM));
@@ -2107,7 +2107,7 @@
     //
     // A<I>
     //
-    InterfaceType typeI = ElementFactory.classElement2("I", []).type;
+    InterfaceType typeI = ElementFactory.classElement2("I").type;
     InterfaceTypeImpl typeAI = new InterfaceTypeImpl.con1(classA);
     typeAI.typeArguments = <DartType> [typeI];
     MethodElement method = typeAI.getMethod(methodName);
@@ -2123,22 +2123,22 @@
     //
     // class A {}
     //
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     InterfaceType typeA = classA.type;
     expect(typeA.getMethod("m"), isNull);
   }
 
   void test_getMethods() {
-    ClassElementImpl typeElement = ElementFactory.classElement2("A", []);
-    MethodElementImpl methodOne = ElementFactory.methodElement("one", null, []);
-    MethodElementImpl methodTwo = ElementFactory.methodElement("two", null, []);
+    ClassElementImpl typeElement = ElementFactory.classElement2("A");
+    MethodElementImpl methodOne = ElementFactory.methodElement("one", null);
+    MethodElementImpl methodTwo = ElementFactory.methodElement("two", null);
     typeElement.methods = <MethodElement> [methodOne, methodTwo];
     InterfaceTypeImpl type = new InterfaceTypeImpl.con1(typeElement);
     expect(type.methods.length, 2);
   }
 
   void test_getMethods_empty() {
-    ClassElementImpl typeElement = ElementFactory.classElement2("A", []);
+    ClassElementImpl typeElement = ElementFactory.classElement2("A");
     InterfaceTypeImpl type = new InterfaceTypeImpl.con1(typeElement);
     expect(type.methods.length, 0);
   }
@@ -2147,11 +2147,11 @@
     //
     // class C extends Object with A, B
     //
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     InterfaceType typeA = classA.type;
-    ClassElementImpl classB = ElementFactory.classElement2("B", []);
+    ClassElementImpl classB = ElementFactory.classElement2("B");
     InterfaceType typeB = classB.type;
-    ClassElementImpl classC = ElementFactory.classElement2("C", []);
+    ClassElementImpl classC = ElementFactory.classElement2("C");
     classC.mixins = <InterfaceType> [typeA, typeB];
     List<InterfaceType> interfaces = classC.type.mixins;
     expect(interfaces, hasLength(2));
@@ -2177,7 +2177,7 @@
     //
     // B<I>
     //
-    InterfaceType typeI = ElementFactory.classElement2("I", []).type;
+    InterfaceType typeI = ElementFactory.classElement2("I").type;
     InterfaceTypeImpl typeBI = new InterfaceTypeImpl.con1(classB);
     typeBI.typeArguments = <DartType> [typeI];
     List<InterfaceType> interfaces = typeBI.mixins;
@@ -2191,7 +2191,7 @@
     //
     // class A { s() {} }
     //
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String setterName = "s";
     PropertyAccessorElement setterS = ElementFactory.setterElement(setterName, false, null);
     classA.accessors = <PropertyAccessorElement> [setterS];
@@ -2212,7 +2212,7 @@
     //
     // A<I>
     //
-    InterfaceType typeI = ElementFactory.classElement2("I", []).type;
+    InterfaceType typeI = ElementFactory.classElement2("I").type;
     InterfaceTypeImpl typeAI = new InterfaceTypeImpl.con1(classA);
     typeAI.typeArguments = <DartType> [typeI];
     PropertyAccessorElement setter = typeAI.getSetter(setterName);
@@ -2227,7 +2227,7 @@
     //
     // class A {}
     //
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     InterfaceType typeA = classA.type;
     expect(typeA.getSetter("s"), isNull);
   }
@@ -2236,9 +2236,9 @@
     //
     // class B extends A
     //
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     InterfaceType typeA = classA.type;
-    ClassElementImpl classB = ElementFactory.classElement("B", typeA, []);
+    ClassElementImpl classB = ElementFactory.classElement("B", typeA);
     InterfaceType typeB = classB.type;
     expect(typeB.superclass, same(typeA));
   }
@@ -2257,7 +2257,7 @@
     //
     // B<I>
     //
-    InterfaceType typeI = ElementFactory.classElement2("I", []).type;
+    InterfaceType typeI = ElementFactory.classElement2("I").type;
     InterfaceTypeImpl typeBI = new InterfaceTypeImpl.con1(classB);
     typeBI.typeArguments = <DartType> [typeI];
     InterfaceType superclass = typeBI.superclass;
@@ -2266,12 +2266,12 @@
   }
 
   void test_getTypeArguments_empty() {
-    InterfaceType type = ElementFactory.classElement2("A", []).type;
+    InterfaceType type = ElementFactory.classElement2("A").type;
     expect(type.typeArguments, hasLength(0));
   }
 
   void test_hashCode() {
-    ClassElement classA = ElementFactory.classElement2("A", []);
+    ClassElement classA = ElementFactory.classElement2("A");
     InterfaceType typeA = classA.type;
     expect(0 == typeA.hashCode, isFalse);
   }
@@ -2300,25 +2300,25 @@
   }
 
   void test_isDirectSupertypeOf_extends() {
-    ClassElement classA = ElementFactory.classElement2("A", []);
-    ClassElement classB = ElementFactory.classElement("B", classA.type, []);
+    ClassElement classA = ElementFactory.classElement2("A");
+    ClassElement classB = ElementFactory.classElement("B", classA.type);
     InterfaceType typeA = classA.type;
     InterfaceType typeB = classB.type;
     expect(typeA.isDirectSupertypeOf(typeB), isTrue);
   }
 
   void test_isDirectSupertypeOf_false() {
-    ClassElement classA = ElementFactory.classElement2("A", []);
-    ClassElement classB = ElementFactory.classElement2("B", []);
-    ClassElement classC = ElementFactory.classElement("C", classB.type, []);
+    ClassElement classA = ElementFactory.classElement2("A");
+    ClassElement classB = ElementFactory.classElement2("B");
+    ClassElement classC = ElementFactory.classElement("C", classB.type);
     InterfaceType typeA = classA.type;
     InterfaceType typeC = classC.type;
     expect(typeA.isDirectSupertypeOf(typeC), isFalse);
   }
 
   void test_isDirectSupertypeOf_implements() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
-    ClassElementImpl classB = ElementFactory.classElement2("B", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
+    ClassElementImpl classB = ElementFactory.classElement2("B");
     InterfaceType typeA = classA.type;
     InterfaceType typeB = classB.type;
     classB.interfaces = <InterfaceType> [typeA];
@@ -2326,8 +2326,8 @@
   }
 
   void test_isDirectSupertypeOf_with() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
-    ClassElementImpl classB = ElementFactory.classElement2("B", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
+    ClassElementImpl classB = ElementFactory.classElement2("B");
     InterfaceType typeA = classA.type;
     InterfaceType typeB = classB.type;
     classB.mixins = <InterfaceType> [typeA];
@@ -2335,14 +2335,14 @@
   }
 
   void test_isMoreSpecificThan_bottom() {
-    DartType type = ElementFactory.classElement2("A", []).type;
+    DartType type = ElementFactory.classElement2("A").type;
     expect(BottomTypeImpl.instance.isMoreSpecificThan(type), isTrue);
   }
 
   void test_isMoreSpecificThan_covariance() {
     ClassElement classA = ElementFactory.classElement2("A", ["E"]);
-    ClassElement classI = ElementFactory.classElement2("I", []);
-    ClassElement classJ = ElementFactory.classElement("J", classI.type, []);
+    ClassElement classI = ElementFactory.classElement2("I");
+    ClassElement classJ = ElementFactory.classElement("J", classI.type);
     InterfaceTypeImpl typeAI = new InterfaceTypeImpl.con1(classA);
     InterfaceTypeImpl typeAJ = new InterfaceTypeImpl.con1(classA);
     typeAI.typeArguments = <DartType> [classI.type];
@@ -2352,8 +2352,8 @@
   }
 
   void test_isMoreSpecificThan_directSupertype() {
-    ClassElement classA = ElementFactory.classElement2("A", []);
-    ClassElement classB = ElementFactory.classElement("B", classA.type, []);
+    ClassElement classA = ElementFactory.classElement2("A");
+    ClassElement classB = ElementFactory.classElement("B", classA.type);
     InterfaceType typeA = classA.type;
     InterfaceType typeB = classB.type;
     expect(typeB.isMoreSpecificThan(typeA), isTrue);
@@ -2362,13 +2362,13 @@
   }
 
   void test_isMoreSpecificThan_dynamic() {
-    InterfaceType type = ElementFactory.classElement2("A", []).type;
+    InterfaceType type = ElementFactory.classElement2("A").type;
     expect(type.isMoreSpecificThan(DynamicTypeImpl.instance), isTrue);
   }
 
   void test_isMoreSpecificThan_generic() {
     ClassElement classA = ElementFactory.classElement2("A", ["E"]);
-    ClassElement classB = ElementFactory.classElement2("B", []);
+    ClassElement classB = ElementFactory.classElement2("B");
     DartType dynamicType = DynamicTypeImpl.instance;
     InterfaceType typeAOfDynamic = classA.type.substitute4(<DartType> [dynamicType]);
     InterfaceType typeAOfB = classA.type.substitute4(<DartType> [classB.type]);
@@ -2377,7 +2377,7 @@
   }
 
   void test_isMoreSpecificThan_self() {
-    InterfaceType type = ElementFactory.classElement2("A", []).type;
+    InterfaceType type = ElementFactory.classElement2("A").type;
     expect(type.isMoreSpecificThan(type), isTrue);
   }
 
@@ -2387,9 +2387,9 @@
     //  class B extends A {}
     //  class C implements B {}
     //
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
-    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
-    ClassElementImpl classC = ElementFactory.classElement2("C", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
+    ClassElementImpl classC = ElementFactory.classElement2("C");
     classC.interfaces = <InterfaceType> [classB.type];
     InterfaceType typeA = classA.type;
     InterfaceType typeC = classC.type;
@@ -2402,9 +2402,9 @@
     //  class B extends A {}
     //  class C with B {}
     //
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
-    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
-    ClassElementImpl classC = ElementFactory.classElement2("C", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
+    ClassElementImpl classC = ElementFactory.classElement2("C");
     classC.mixins = <InterfaceType> [classB.type];
     InterfaceType typeA = classA.type;
     InterfaceType typeC = classC.type;
@@ -2417,9 +2417,9 @@
     //  class B extends A {}
     //  class C {}
     //
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
-    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
-    ClassElementImpl classC = ElementFactory.classElement2("C", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
+    ClassElementImpl classC = ElementFactory.classElement2("C");
     InterfaceType typeA = classA.type;
     InterfaceType typeC = classC.type;
     classA.supertype = classB.type;
@@ -2432,9 +2432,9 @@
     //  class B extends A {}
     //  class C extends B {}
     //
-    ClassElement classA = ElementFactory.classElement2("A", []);
-    ClassElement classB = ElementFactory.classElement("B", classA.type, []);
-    ClassElement classC = ElementFactory.classElement("C", classB.type, []);
+    ClassElement classA = ElementFactory.classElement2("A");
+    ClassElement classB = ElementFactory.classElement("B", classA.type);
+    ClassElement classC = ElementFactory.classElement("C", classB.type);
     InterfaceType typeA = classA.type;
     InterfaceType typeC = classC.type;
     expect(typeC.isMoreSpecificThan(typeA), isTrue);
@@ -2457,9 +2457,9 @@
     // class A {}
     // class B<E extends A> {}
     //
-    ClassElement classA = ElementFactory.classElement2("A", []);
+    ClassElement classA = ElementFactory.classElement2("A");
     InterfaceType typeA = classA.type;
-    ClassElementImpl classB = ElementFactory.classElement2("B", []);
+    ClassElementImpl classB = ElementFactory.classElement2("B");
     TypeParameterElementImpl parameterEA = new TypeParameterElementImpl.forNode(AstFactory.identifier3("E"));
     TypeParameterType parameterAEType = new TypeParameterTypeImpl(parameterEA);
     parameterEA.bound = typeA;
@@ -2469,8 +2469,8 @@
   }
 
   void test_isSubtypeOf_directSubtype() {
-    ClassElement classA = ElementFactory.classElement2("A", []);
-    ClassElement classB = ElementFactory.classElement("B", classA.type, []);
+    ClassElement classA = ElementFactory.classElement2("A");
+    ClassElement classB = ElementFactory.classElement("B", classA.type);
     InterfaceType typeA = classA.type;
     InterfaceType typeB = classB.type;
     expect(typeB.isSubtypeOf(typeA), isTrue);
@@ -2478,7 +2478,7 @@
   }
 
   void test_isSubtypeOf_dynamic() {
-    ClassElement classA = ElementFactory.classElement2("A", []);
+    ClassElement classA = ElementFactory.classElement2("A");
     InterfaceType typeA = classA.type;
     DartType dynamicType = DynamicTypeImpl.instance;
     expect(dynamicType.isSubtypeOf(typeA), isTrue);
@@ -2493,7 +2493,7 @@
     // }
     //
     InterfaceType stringType = _typeProvider.stringType;
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     classA.methods = <MethodElement> [ElementFactory.methodElement("call", VoidTypeImpl.instance, [stringType])];
     FunctionType functionType = ElementFactory.functionElement5("f", <ClassElement> [stringType.element]).type;
     expect(classA.type.isSubtypeOf(functionType), isTrue);
@@ -2501,7 +2501,7 @@
 
   void test_isSubtypeOf_generic() {
     ClassElement classA = ElementFactory.classElement2("A", ["E"]);
-    ClassElement classB = ElementFactory.classElement2("B", []);
+    ClassElement classB = ElementFactory.classElement2("B");
     DartType dynamicType = DynamicTypeImpl.instance;
     InterfaceType typeAOfDynamic = classA.type.substitute4(<DartType> [dynamicType]);
     InterfaceType typeAOfB = classA.type.substitute4(<DartType> [classB.type]);
@@ -2510,9 +2510,9 @@
   }
 
   void test_isSubtypeOf_interface() {
-    ClassElement classA = ElementFactory.classElement2("A", []);
-    ClassElement classB = ElementFactory.classElement("B", classA.type, []);
-    ClassElementImpl classC = ElementFactory.classElement2("C", []);
+    ClassElement classA = ElementFactory.classElement2("A");
+    ClassElement classB = ElementFactory.classElement("B", classA.type);
+    ClassElementImpl classC = ElementFactory.classElement2("C");
     InterfaceType typeObject = classA.supertype;
     InterfaceType typeA = classA.type;
     InterfaceType typeB = classB.type;
@@ -2530,9 +2530,9 @@
     // class B extends A {}
     // class C with B {}
     //
-    ClassElement classA = ElementFactory.classElement2("A", []);
-    ClassElement classB = ElementFactory.classElement("B", classA.type, []);
-    ClassElementImpl classC = ElementFactory.classElement2("C", []);
+    ClassElement classA = ElementFactory.classElement2("A");
+    ClassElement classB = ElementFactory.classElement("B", classA.type);
+    ClassElementImpl classC = ElementFactory.classElement2("C");
     InterfaceType typeObject = classA.supertype;
     InterfaceType typeA = classA.type;
     InterfaceType typeB = classB.type;
@@ -2545,7 +2545,7 @@
   }
 
   void test_isSubtypeOf_object() {
-    ClassElement classA = ElementFactory.classElement2("A", []);
+    ClassElement classA = ElementFactory.classElement2("A");
     InterfaceType typeA = classA.type;
     InterfaceType typeObject = classA.supertype;
     expect(typeA.isSubtypeOf(typeObject), isTrue);
@@ -2553,7 +2553,7 @@
   }
 
   void test_isSubtypeOf_self() {
-    ClassElement classA = ElementFactory.classElement2("A", []);
+    ClassElement classA = ElementFactory.classElement2("A");
     InterfaceType typeA = classA.type;
     expect(typeA.isSubtypeOf(typeA), isTrue);
   }
@@ -2564,9 +2564,9 @@
     //  class B extends A {}
     //  class C {}
     //
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
-    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
-    ClassElementImpl classC = ElementFactory.classElement2("C", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
+    ClassElementImpl classC = ElementFactory.classElement2("C");
     InterfaceType typeA = classA.type;
     InterfaceType typeC = classC.type;
     classA.supertype = classB.type;
@@ -2574,9 +2574,9 @@
   }
 
   void test_isSubtypeOf_transitive_superclass() {
-    ClassElement classA = ElementFactory.classElement2("A", []);
-    ClassElement classB = ElementFactory.classElement("B", classA.type, []);
-    ClassElement classC = ElementFactory.classElement("C", classB.type, []);
+    ClassElement classA = ElementFactory.classElement2("A");
+    ClassElement classB = ElementFactory.classElement("B", classA.type);
+    ClassElement classC = ElementFactory.classElement("C", classB.type);
     InterfaceType typeA = classA.type;
     InterfaceType typeC = classC.type;
     expect(typeC.isSubtypeOf(typeA), isTrue);
@@ -2586,9 +2586,9 @@
   void test_isSubtypeOf_typeArguments() {
     DartType dynamicType = DynamicTypeImpl.instance;
     ClassElement classA = ElementFactory.classElement2("A", ["E"]);
-    ClassElement classI = ElementFactory.classElement2("I", []);
-    ClassElement classJ = ElementFactory.classElement("J", classI.type, []);
-    ClassElement classK = ElementFactory.classElement2("K", []);
+    ClassElement classI = ElementFactory.classElement2("I");
+    ClassElement classJ = ElementFactory.classElement("J", classI.type);
+    ClassElement classK = ElementFactory.classElement2("K");
     InterfaceType typeA = classA.type;
     InterfaceType typeA_dynamic = typeA.substitute4(<DartType> [dynamicType]);
     InterfaceTypeImpl typeAI = new InterfaceTypeImpl.con1(classA);
@@ -2624,8 +2624,8 @@
   }
 
   void test_isSupertypeOf_directSupertype() {
-    ClassElement classA = ElementFactory.classElement2("A", []);
-    ClassElement classB = ElementFactory.classElement("B", classA.type, []);
+    ClassElement classA = ElementFactory.classElement2("A");
+    ClassElement classB = ElementFactory.classElement("B", classA.type);
     InterfaceType typeA = classA.type;
     InterfaceType typeB = classB.type;
     expect(typeB.isSupertypeOf(typeA), isFalse);
@@ -2633,7 +2633,7 @@
   }
 
   void test_isSupertypeOf_dynamic() {
-    ClassElement classA = ElementFactory.classElement2("A", []);
+    ClassElement classA = ElementFactory.classElement2("A");
     InterfaceType typeA = classA.type;
     DartType dynamicType = DynamicTypeImpl.instance;
     expect(dynamicType.isSupertypeOf(typeA), isTrue);
@@ -2641,9 +2641,9 @@
   }
 
   void test_isSupertypeOf_indirectSupertype() {
-    ClassElement classA = ElementFactory.classElement2("A", []);
-    ClassElement classB = ElementFactory.classElement("B", classA.type, []);
-    ClassElement classC = ElementFactory.classElement("C", classB.type, []);
+    ClassElement classA = ElementFactory.classElement2("A");
+    ClassElement classB = ElementFactory.classElement("B", classA.type);
+    ClassElement classC = ElementFactory.classElement("C", classB.type);
     InterfaceType typeA = classA.type;
     InterfaceType typeC = classC.type;
     expect(typeC.isSupertypeOf(typeA), isFalse);
@@ -2651,9 +2651,9 @@
   }
 
   void test_isSupertypeOf_interface() {
-    ClassElement classA = ElementFactory.classElement2("A", []);
-    ClassElement classB = ElementFactory.classElement("B", classA.type, []);
-    ClassElementImpl classC = ElementFactory.classElement2("C", []);
+    ClassElement classA = ElementFactory.classElement2("A");
+    ClassElement classB = ElementFactory.classElement("B", classA.type);
+    ClassElementImpl classC = ElementFactory.classElement2("C");
     InterfaceType typeObject = classA.supertype;
     InterfaceType typeA = classA.type;
     InterfaceType typeB = classB.type;
@@ -2671,9 +2671,9 @@
     // class B extends A {}
     // class C with B {}
     //
-    ClassElement classA = ElementFactory.classElement2("A", []);
-    ClassElement classB = ElementFactory.classElement("B", classA.type, []);
-    ClassElementImpl classC = ElementFactory.classElement2("C", []);
+    ClassElement classA = ElementFactory.classElement2("A");
+    ClassElement classB = ElementFactory.classElement("B", classA.type);
+    ClassElementImpl classC = ElementFactory.classElement2("C");
     InterfaceType typeObject = classA.supertype;
     InterfaceType typeA = classA.type;
     InterfaceType typeB = classB.type;
@@ -2686,7 +2686,7 @@
   }
 
   void test_isSupertypeOf_object() {
-    ClassElement classA = ElementFactory.classElement2("A", []);
+    ClassElement classA = ElementFactory.classElement2("A");
     InterfaceType typeA = classA.type;
     InterfaceType typeObject = classA.supertype;
     expect(typeA.isSupertypeOf(typeObject), isFalse);
@@ -2694,7 +2694,7 @@
   }
 
   void test_isSupertypeOf_self() {
-    ClassElement classA = ElementFactory.classElement2("A", []);
+    ClassElement classA = ElementFactory.classElement2("A");
     InterfaceType typeA = classA.type;
     expect(typeA.isSupertypeOf(typeA), isTrue);
   }
@@ -2703,7 +2703,7 @@
     //
     // class A { g {} }
     //
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String getterName = "g";
     PropertyAccessorElement getterG = ElementFactory.getterElement(getterName, false, null);
     classA.accessors = <PropertyAccessorElement> [getterG];
@@ -2719,11 +2719,11 @@
     // class A { g {} }
     // class B extends A {}
     //
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String getterName = "g";
     PropertyAccessorElement getterG = ElementFactory.getterElement(getterName, false, null);
     classA.accessors = <PropertyAccessorElement> [getterG];
-    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
     InterfaceType typeB = classB.type;
     LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
     CompilationUnitElement unit = library.definingCompilationUnit;
@@ -2736,9 +2736,9 @@
     // class A extends B {}
     // class B extends A {}
     //
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     InterfaceType typeA = classA.type;
-    ClassElementImpl classB = ElementFactory.classElement("B", typeA, []);
+    ClassElementImpl classB = ElementFactory.classElement("B", typeA);
     classA.supertype = classB.type;
     LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
     CompilationUnitElement unit = library.definingCompilationUnit;
@@ -2750,7 +2750,7 @@
     //
     // class A {}
     //
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     InterfaceType typeA = classA.type;
     LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
     CompilationUnitElement unit = library.definingCompilationUnit;
@@ -2762,9 +2762,9 @@
     //
     // class A { m() {} }
     //
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElementImpl methodM = ElementFactory.methodElement(methodName, null, []);
+    MethodElementImpl methodM = ElementFactory.methodElement(methodName, null);
     classA.methods = <MethodElement> [methodM];
     InterfaceType typeA = classA.type;
     LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
@@ -2778,11 +2778,11 @@
     // class A { m() {} }
     // class B extends A {}
     //
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElementImpl methodM = ElementFactory.methodElement(methodName, null, []);
+    MethodElementImpl methodM = ElementFactory.methodElement(methodName, null);
     classA.methods = <MethodElement> [methodM];
-    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
     InterfaceType typeB = classB.type;
     LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
     CompilationUnitElement unit = library.definingCompilationUnit;
@@ -2812,7 +2812,7 @@
     //
     // B<I>
     //
-    InterfaceType typeI = ElementFactory.classElement2("I", []).type;
+    InterfaceType typeI = ElementFactory.classElement2("I").type;
     InterfaceTypeImpl typeBI = new InterfaceTypeImpl.con1(classB);
     typeBI.typeArguments = <DartType> [typeI];
     MethodElement method = typeBI.lookUpMethod(methodName, library);
@@ -2829,9 +2829,9 @@
     // class A extends B {}
     // class B extends A {}
     //
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     InterfaceType typeA = classA.type;
-    ClassElementImpl classB = ElementFactory.classElement("B", typeA, []);
+    ClassElementImpl classB = ElementFactory.classElement("B", typeA);
     classA.supertype = classB.type;
     LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
     CompilationUnitElement unit = library.definingCompilationUnit;
@@ -2843,7 +2843,7 @@
     //
     // class A {}
     //
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     InterfaceType typeA = classA.type;
     LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
     CompilationUnitElement unit = library.definingCompilationUnit;
@@ -2855,7 +2855,7 @@
     //
     // class A { s(x) {} }
     //
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String setterName = "s";
     PropertyAccessorElement setterS = ElementFactory.setterElement(setterName, false, null);
     classA.accessors = <PropertyAccessorElement> [setterS];
@@ -2871,11 +2871,11 @@
     // class A { s(x) {} }
     // class B extends A {}
     //
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String setterName = "g";
     PropertyAccessorElement setterS = ElementFactory.setterElement(setterName, false, null);
     classA.accessors = <PropertyAccessorElement> [setterS];
-    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
     InterfaceType typeB = classB.type;
     LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
     CompilationUnitElement unit = library.definingCompilationUnit;
@@ -2888,9 +2888,9 @@
     // class A extends B {}
     // class B extends A {}
     //
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     InterfaceType typeA = classA.type;
-    ClassElementImpl classB = ElementFactory.classElement("B", typeA, []);
+    ClassElementImpl classB = ElementFactory.classElement("B", typeA);
     classA.supertype = classB.type;
     LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
     CompilationUnitElement unit = library.definingCompilationUnit;
@@ -2902,7 +2902,7 @@
     //
     // class A {}
     //
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     InterfaceType typeA = classA.type;
     LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
     CompilationUnitElement unit = library.definingCompilationUnit;
@@ -2911,10 +2911,10 @@
   }
 
   void test_setTypeArguments() {
-    InterfaceTypeImpl type = ElementFactory.classElement2("A", []).type as InterfaceTypeImpl;
+    InterfaceTypeImpl type = ElementFactory.classElement2("A").type as InterfaceTypeImpl;
     List<DartType> typeArguments = <DartType> [
-        ElementFactory.classElement2("B", []).type,
-        ElementFactory.classElement2("C", []).type];
+        ElementFactory.classElement2("B").type,
+        ElementFactory.classElement2("C").type];
     type.typeArguments = typeArguments;
     expect(type.typeArguments, typeArguments);
   }
@@ -2922,7 +2922,7 @@
   void test_substitute_equal() {
     ClassElement classAE = ElementFactory.classElement2("A", ["E"]);
     InterfaceType typeAE = classAE.type;
-    InterfaceType argumentType = ElementFactory.classElement2("B", []).type;
+    InterfaceType argumentType = ElementFactory.classElement2("B").type;
     List<DartType> args = [argumentType];
     List<DartType> params = [classAE.typeParameters[0].type];
     InterfaceType typeAESubbed = typeAE.substitute2(args, params);
@@ -2934,10 +2934,10 @@
 
   void test_substitute_exception() {
     try {
-      ClassElementImpl classA = ElementFactory.classElement2("A", []);
+      ClassElementImpl classA = ElementFactory.classElement2("A");
       InterfaceTypeImpl type = new InterfaceTypeImpl.con1(classA);
-      InterfaceType argumentType = ElementFactory.classElement2("B", []).type;
-      type.substitute2(<DartType> [argumentType], <DartType> []);
+      InterfaceType argumentType = ElementFactory.classElement2("B").type;
+      type.substitute2(<DartType> [argumentType], <DartType>[]);
       fail("Expected to encounter exception, argument and parameter type array lengths not equal.");
     } catch (e) {
       // Expected result
@@ -2946,12 +2946,12 @@
 
   void test_substitute_notEqual() {
     // The [test_substitute_equals] above has a slightly higher level implementation.
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     TypeParameterElementImpl parameterElement = new TypeParameterElementImpl.forNode(AstFactory.identifier3("E"));
     InterfaceTypeImpl type = new InterfaceTypeImpl.con1(classA);
     TypeParameterTypeImpl parameter = new TypeParameterTypeImpl(parameterElement);
     type.typeArguments = <DartType> [parameter];
-    InterfaceType argumentType = ElementFactory.classElement2("B", []).type;
+    InterfaceType argumentType = ElementFactory.classElement2("B").type;
     TypeParameterTypeImpl parameterType = new TypeParameterTypeImpl(new TypeParameterElementImpl.forNode(AstFactory.identifier3("F")));
     InterfaceType result = type.substitute2(<DartType> [argumentType], <DartType> [parameterType]);
     expect(result.element, classA);
@@ -2982,12 +2982,12 @@
     PrefixElement prefixA = new PrefixElementImpl.forNode(AstFactory.identifier3("a"));
     PrefixElement prefixB = new PrefixElementImpl.forNode(AstFactory.identifier3("b"));
     List<ImportElementImpl> imports = [
-        ElementFactory.importFor(library2, null, []),
-        ElementFactory.importFor(library2, prefixB, []),
-        ElementFactory.importFor(library3, null, []),
-        ElementFactory.importFor(library3, prefixA, []),
-        ElementFactory.importFor(library3, prefixB, []),
-        ElementFactory.importFor(library4, prefixA, [])];
+        ElementFactory.importFor(library2, null),
+        ElementFactory.importFor(library2, prefixB),
+        ElementFactory.importFor(library3, null),
+        ElementFactory.importFor(library3, prefixA),
+        ElementFactory.importFor(library3, prefixB),
+        ElementFactory.importFor(library4, prefixA)];
     library1.imports = imports;
     List<LibraryElement> libraries = library1.importedLibraries;
     expect(libraries, unorderedEquals(<LibraryElement> [library2, library3, library4]));
@@ -2999,11 +2999,11 @@
     PrefixElement prefixA = new PrefixElementImpl.forNode(AstFactory.identifier3("a"));
     PrefixElement prefixB = new PrefixElementImpl.forNode(AstFactory.identifier3("b"));
     List<ImportElementImpl> imports = [
-        ElementFactory.importFor(ElementFactory.library(context, "l2"), null, []),
-        ElementFactory.importFor(ElementFactory.library(context, "l3"), null, []),
-        ElementFactory.importFor(ElementFactory.library(context, "l4"), prefixA, []),
-        ElementFactory.importFor(ElementFactory.library(context, "l5"), prefixA, []),
-        ElementFactory.importFor(ElementFactory.library(context, "l6"), prefixB, [])];
+        ElementFactory.importFor(ElementFactory.library(context, "l2"), null),
+        ElementFactory.importFor(ElementFactory.library(context, "l3"), null),
+        ElementFactory.importFor(ElementFactory.library(context, "l4"), prefixA),
+        ElementFactory.importFor(ElementFactory.library(context, "l5"), prefixA),
+        ElementFactory.importFor(ElementFactory.library(context, "l6"), prefixB)];
     library.imports = imports;
     List<PrefixElement> prefixes = library.prefixes;
     expect(prefixes, hasLength(2));
@@ -3029,8 +3029,8 @@
     AnalysisContext context = createAnalysisContext();
     LibraryElementImpl library = ElementFactory.library(context, "app");
     LibraryElementImpl libraryA = ElementFactory.library(context, "A");
-    libraryA.imports = <ImportElementImpl> [ElementFactory.importFor(library, null, [])];
-    library.imports = <ImportElementImpl> [ElementFactory.importFor(libraryA, null, [])];
+    libraryA.imports = <ImportElementImpl> [ElementFactory.importFor(library, null)];
+    library.imports = <ImportElementImpl> [ElementFactory.importFor(libraryA, null)];
     List<LibraryElement> libraries = library.visibleLibraries;
     expect(libraries, unorderedEquals(<LibraryElement> [library, libraryA]));
   }
@@ -3039,7 +3039,7 @@
     AnalysisContext context = createAnalysisContext();
     LibraryElementImpl library = ElementFactory.library(context, "app");
     LibraryElementImpl libraryA = ElementFactory.library(context, "A");
-    library.exports = <ExportElementImpl> [ElementFactory.exportFor(libraryA, [])];
+    library.exports = <ExportElementImpl> [ElementFactory.exportFor(libraryA)];
     List<LibraryElement> libraries = library.visibleLibraries;
     expect(libraries, unorderedEquals(<LibraryElement> [library]));
   }
@@ -3048,7 +3048,7 @@
     AnalysisContext context = createAnalysisContext();
     LibraryElementImpl library = ElementFactory.library(context, "app");
     LibraryElementImpl libraryA = ElementFactory.library(context, "A");
-    library.imports = <ImportElementImpl> [ElementFactory.importFor(libraryA, null, [])];
+    library.imports = <ImportElementImpl> [ElementFactory.importFor(libraryA, null)];
     List<LibraryElement> libraries = library.visibleLibraries;
     expect(libraries, unorderedEquals(<LibraryElement> [library, libraryA]));
   }
@@ -3058,8 +3058,8 @@
     LibraryElementImpl library = ElementFactory.library(context, "app");
     LibraryElementImpl libraryA = ElementFactory.library(context, "A");
     LibraryElementImpl libraryAA = ElementFactory.library(context, "AA");
-    libraryA.exports = <ExportElementImpl> [ElementFactory.exportFor(libraryAA, [])];
-    library.imports = <ImportElementImpl> [ElementFactory.importFor(libraryA, null, [])];
+    libraryA.exports = <ExportElementImpl> [ElementFactory.exportFor(libraryAA)];
+    library.imports = <ImportElementImpl> [ElementFactory.importFor(libraryA, null)];
     List<LibraryElement> libraries = library.visibleLibraries;
     expect(libraries, unorderedEquals(<LibraryElement> [library, libraryA, libraryAA]));
   }
@@ -3070,10 +3070,10 @@
     LibraryElementImpl libraryA = ElementFactory.library(context, "A");
     LibraryElementImpl libraryAA = ElementFactory.library(context, "AA");
     LibraryElementImpl libraryB = ElementFactory.library(context, "B");
-    libraryA.imports = <ImportElementImpl> [ElementFactory.importFor(libraryAA, null, [])];
+    libraryA.imports = <ImportElementImpl> [ElementFactory.importFor(libraryAA, null)];
     library.imports = <ImportElementImpl> [
-        ElementFactory.importFor(libraryA, null, []),
-        ElementFactory.importFor(libraryB, null, [])];
+        ElementFactory.importFor(libraryA, null),
+        ElementFactory.importFor(libraryB, null)];
     List<LibraryElement> libraries = library.visibleLibraries;
     expect(libraries, unorderedEquals(<LibraryElement> [library, libraryA, libraryAA, libraryB]));
   }
@@ -3099,8 +3099,8 @@
     AnalysisContext context = createAnalysisContext();
     LibraryElementImpl library = new LibraryElementImpl.forNode(context, AstFactory.libraryIdentifier2(["l1"]));
     List<ImportElementImpl> expectedImports = [
-        ElementFactory.importFor(ElementFactory.library(context, "l2"), null, []),
-        ElementFactory.importFor(ElementFactory.library(context, "l3"), null, [])];
+        ElementFactory.importFor(ElementFactory.library(context, "l2"), null),
+        ElementFactory.importFor(ElementFactory.library(context, "l3"), null)];
     library.imports = expectedImports;
     List<ImportElement> actualImports = library.imports;
     expect(actualImports, hasLength(expectedImports.length));
@@ -3168,7 +3168,7 @@
   }
 
   void test_isMoreSpecificThan_typeArguments_resursive() {
-    ClassElementImpl classS = ElementFactory.classElement2("A", []);
+    ClassElementImpl classS = ElementFactory.classElement2("A");
     TypeParameterElementImpl typeParameterU = new TypeParameterElementImpl.forNode(AstFactory.identifier3("U"));
     TypeParameterTypeImpl typeParameterTypeU = new TypeParameterTypeImpl(typeParameterU);
     TypeParameterElementImpl typeParameterT = new TypeParameterElementImpl.forNode(AstFactory.identifier3("T"));
@@ -3191,8 +3191,8 @@
     //  class A {}
     //  class B extends A {}
     //
-    ClassElement classA = ElementFactory.classElement2("A", []);
-    ClassElement classB = ElementFactory.classElement("B", classA.type, []);
+    ClassElement classA = ElementFactory.classElement2("A");
+    ClassElement classB = ElementFactory.classElement("B", classA.type);
     InterfaceType typeA = classA.type;
     InterfaceType typeB = classB.type;
     TypeParameterElementImpl typeParameterT = new TypeParameterElementImpl.forNode(AstFactory.identifier3("T"));
@@ -3204,7 +3204,7 @@
   }
 
   void test_isMoreSpecificThan_typeArguments_transitivity_typeParameters() {
-    ClassElementImpl classS = ElementFactory.classElement2("A", []);
+    ClassElementImpl classS = ElementFactory.classElement2("A");
     TypeParameterElementImpl typeParameterU = new TypeParameterElementImpl.forNode(AstFactory.identifier3("U"));
     typeParameterU.bound = classS.type;
     TypeParameterTypeImpl typeParameterTypeU = new TypeParameterTypeImpl(typeParameterU);
@@ -3217,7 +3217,7 @@
   }
 
   void test_isMoreSpecificThan_typeArguments_upperBound() {
-    ClassElementImpl classS = ElementFactory.classElement2("A", []);
+    ClassElementImpl classS = ElementFactory.classElement2("A");
     TypeParameterElementImpl typeParameterT = new TypeParameterElementImpl.forNode(AstFactory.identifier3("T"));
     typeParameterT.bound = classS.type;
     TypeParameterTypeImpl typeParameterTypeT = new TypeParameterTypeImpl(typeParameterT);
@@ -3401,7 +3401,7 @@
 
   void test_unionTypeIsLessSpecificThan_function() {
     // Based on [FunctionTypeImplTest.test_isAssignableTo_normalAndPositionalArgs].
-    ClassElement a = ElementFactory.classElement2("A", []);
+    ClassElement a = ElementFactory.classElement2("A");
     FunctionType t = ElementFactory.functionElement6("t", null, <ClassElement> [a]).type;
     DartType uAT = UnionTypeImpl.union([_uA, t]);
     expect(t.isMoreSpecificThan(uAT), isTrue);
@@ -3410,7 +3410,7 @@
 
   void test_unionTypeIsSuperTypeOf_function() {
     // Based on [FunctionTypeImplTest.test_isAssignableTo_normalAndPositionalArgs].
-    ClassElement a = ElementFactory.classElement2("A", []);
+    ClassElement a = ElementFactory.classElement2("A");
     FunctionType t = ElementFactory.functionElement6("t", null, <ClassElement> [a]).type;
     DartType uAT = UnionTypeImpl.union([_uA, t]);
     expect(t.isSubtypeOf(uAT), isTrue);
@@ -3420,9 +3420,9 @@
   @override
   void setUp() {
     super.setUp();
-    _classA = ElementFactory.classElement2("A", []);
+    _classA = ElementFactory.classElement2("A");
     _typeA = _classA.type;
-    _classB = ElementFactory.classElement("B", _typeA, []);
+    _classB = ElementFactory.classElement("B", _typeA);
     _typeB = _classB.type;
     _uA = UnionTypeImpl.union([_typeA]);
     _uB = UnionTypeImpl.union([_typeB]);
@@ -3439,7 +3439,7 @@
   DartType _voidType = VoidTypeImpl.instance;
 
   void test_isMoreSpecificThan_void_A() {
-    ClassElement classA = ElementFactory.classElement2("A", []);
+    ClassElement classA = ElementFactory.classElement2("A");
     expect(_voidType.isMoreSpecificThan(classA.type), isFalse);
   }
 
@@ -3452,7 +3452,7 @@
   }
 
   void test_isSubtypeOf_void_A() {
-    ClassElement classA = ElementFactory.classElement2("A", []);
+    ClassElement classA = ElementFactory.classElement2("A");
     expect(_voidType.isSubtypeOf(classA.type), isFalse);
   }
 
diff --git a/pkg/analyzer/test/generated/engine_test.dart b/pkg/analyzer/test/generated/engine_test.dart
index 7fa5e6e..1363afb 100644
--- a/pkg/analyzer/test/generated/engine_test.dart
+++ b/pkg/analyzer/test/generated/engine_test.dart
@@ -1806,7 +1806,7 @@
   }
 
   /**
-   * Returns `true` if there is an [AnalysisError] with [ErrorSeverity#ERROR] in
+   * Returns `true` if there is an [AnalysisError] with [ErrorSeverity.ERROR] in
    * the given [AnalysisErrorInfo].
    */
   static bool _hasAnalysisErrorWithErrorSeverity(AnalysisErrorInfo errorInfo) {
@@ -2008,36 +2008,33 @@
         <AnalysisError>[
             new AnalysisError.con1(
                 source,
-                ScannerErrorCode.UNTERMINATED_STRING_LITERAL,
-                [])]);
+                ScannerErrorCode.UNTERMINATED_STRING_LITERAL)]);
     entry.setValue(
         DartEntry.PARSE_ERRORS,
         <AnalysisError>[
-            new AnalysisError.con1(source, ParserErrorCode.ABSTRACT_CLASS_MEMBER, [])]);
+            new AnalysisError.con1(source, ParserErrorCode.ABSTRACT_CLASS_MEMBER)]);
     entry.setValueInLibrary(
         DartEntry.RESOLUTION_ERRORS,
         source,
         <AnalysisError>[
             new AnalysisError.con1(
                 source,
-                CompileTimeErrorCode.CONST_CONSTRUCTOR_THROWS_EXCEPTION,
-                [])]);
+                CompileTimeErrorCode.CONST_CONSTRUCTOR_THROWS_EXCEPTION)]);
     entry.setValueInLibrary(
         DartEntry.VERIFICATION_ERRORS,
         source,
         <AnalysisError>[
             new AnalysisError.con1(
                 source,
-                StaticWarningCode.CASE_BLOCK_NOT_TERMINATED,
-                [])]);
+                StaticWarningCode.CASE_BLOCK_NOT_TERMINATED)]);
     entry.setValueInLibrary(
         DartEntry.ANGULAR_ERRORS,
         source,
-        <AnalysisError>[new AnalysisError.con1(source, AngularCode.MISSING_NAME, [])]);
+        <AnalysisError>[new AnalysisError.con1(source, AngularCode.MISSING_NAME)]);
     entry.setValueInLibrary(
         DartEntry.HINTS,
         source,
-        <AnalysisError>[new AnalysisError.con1(source, HintCode.DEAD_CODE, [])]);
+        <AnalysisError>[new AnalysisError.con1(source, HintCode.DEAD_CODE)]);
     expect(entry.allErrors, hasLength(5));
   }
 
@@ -2079,13 +2076,13 @@
     String importUri = "/f1.dart";
     Source importSource = new TestSource(importUri);
     ImportDirective importDirective =
-        AstFactory.importDirective3(importUri, null, []);
+        AstFactory.importDirective3(importUri, null);
     importDirective.source = importSource;
     importDirective.uriContent = importUri;
     String exportUri = "/f2.dart";
     Source exportSource = new TestSource(exportUri);
     ExportDirective exportDirective =
-        AstFactory.exportDirective2(exportUri, []);
+        AstFactory.exportDirective2(exportUri);
     exportDirective.source = exportSource;
     exportDirective.uriContent = exportUri;
     String partUri = "/f3.dart";
@@ -2126,13 +2123,13 @@
     String importUri = "f1.dart";
     Source importSource = new TestSource(importUri);
     ImportDirective importDirective =
-        AstFactory.importDirective3(importUri, null, []);
+        AstFactory.importDirective3(importUri, null);
     importDirective.source = importSource;
     importDirective.uriContent = importUri;
     String exportUri = "f2.dart";
     Source exportSource = new TestSource(exportUri);
     ExportDirective exportDirective =
-        AstFactory.exportDirective2(exportUri, []);
+        AstFactory.exportDirective2(exportUri);
     exportDirective.source = exportSource;
     exportDirective.uriContent = exportUri;
     String partUri = "f3.dart";
@@ -2974,7 +2971,7 @@
   void test_setValue_hints() {
     _setValueInLibrary(
         DartEntry.HINTS,
-        <AnalysisError>[new AnalysisError.con1(null, HintCode.DEAD_CODE, [])]);
+        <AnalysisError>[new AnalysisError.con1(null, HintCode.DEAD_CODE)]);
   }
 
   void test_setValue_importedLibraries() {
@@ -3001,7 +2998,7 @@
     _setValue(
         DartEntry.PARSE_ERRORS,
         <AnalysisError>[
-            new AnalysisError.con1(null, ParserErrorCode.ABSTRACT_CLASS_MEMBER, [])]);
+            new AnalysisError.con1(null, ParserErrorCode.ABSTRACT_CLASS_MEMBER)]);
   }
 
   void test_setValue_parsedUnit() {
@@ -3020,8 +3017,7 @@
         <AnalysisError>[
             new AnalysisError.con1(
                 null,
-                CompileTimeErrorCode.CONST_CONSTRUCTOR_THROWS_EXCEPTION,
-                [])]);
+                CompileTimeErrorCode.CONST_CONSTRUCTOR_THROWS_EXCEPTION)]);
   }
 
   void test_setValue_resolvedUnit() {
@@ -3034,8 +3030,7 @@
         <AnalysisError>[
             new AnalysisError.con1(
                 null,
-                ScannerErrorCode.UNTERMINATED_MULTI_LINE_COMMENT,
-                [])]);
+                ScannerErrorCode.UNTERMINATED_MULTI_LINE_COMMENT)]);
   }
 
   void test_setValue_sourceKind() {
@@ -3050,7 +3045,7 @@
     _setValueInLibrary(
         DartEntry.VERIFICATION_ERRORS,
         <AnalysisError>[
-            new AnalysisError.con1(null, StaticWarningCode.CASE_BLOCK_NOT_TERMINATED, [])]);
+            new AnalysisError.con1(null, StaticWarningCode.CASE_BLOCK_NOT_TERMINATED)]);
   }
 
   DartEntry _entryWithValidState([Source firstLibrary, Source secondLibrary]) {
@@ -3503,7 +3498,7 @@
             new AnalysisError.con1(source, PolymerCode.INVALID_ATTRIBUTE_NAME, ["-"])]);
     entry.setValue(
         HtmlEntry.HINTS,
-        <AnalysisError>[new AnalysisError.con1(source, HintCode.DEAD_CODE, [])]);
+        <AnalysisError>[new AnalysisError.con1(source, HintCode.DEAD_CODE)]);
     expect(entry.allErrors, hasLength(6));
   }
 
@@ -3597,7 +3592,7 @@
   void test_setValue_hints() {
     _setValue(
         HtmlEntry.HINTS,
-        <AnalysisError>[new AnalysisError.con1(null, HintCode.DEAD_CODE, [])]);
+        <AnalysisError>[new AnalysisError.con1(null, HintCode.DEAD_CODE)]);
   }
 
   void test_setValue_illegal() {
@@ -4931,10 +4926,9 @@
     expect(task.compilationUnit, isNotNull);
     GatheringErrorListener errorListener = new GatheringErrorListener();
     errorListener.addAll(task.errors);
-    errorListener.assertErrorsWithCodes(
-        [
-            CompileTimeErrorCode.URI_WITH_INTERPOLATION,
-            CompileTimeErrorCode.INVALID_URI]);
+    errorListener.assertErrorsWithCodes([
+        CompileTimeErrorCode.URI_WITH_INTERPOLATION,
+        CompileTimeErrorCode.INVALID_URI]);
     expect(task.source, same(source));
     expect(task.hasNonPartOfDirective, isTrue);
     expect(task.hasPartOfDirective, isFalse);
@@ -5287,10 +5281,10 @@
     LibraryElementImpl libraryElement = ElementFactory.library(context, "lib");
     CompilationUnitElementImpl unitElement =
         libraryElement.definingCompilationUnit as CompilationUnitElementImpl;
-    ClassElementImpl classElement = ElementFactory.classElement2("A", []);
+    ClassElementImpl classElement = ElementFactory.classElement2("A");
     classElement.nameOffset = 19;
     ConstructorElementImpl constructorElement =
-        ElementFactory.constructorElement2(classElement, null, []);
+        ElementFactory.constructorElement2(classElement, null);
     constructorElement.synthetic = true;
     classElement.constructors = <ConstructorElement>[constructorElement];
     unitElement.types = <ClassElement>[classElement];
diff --git a/pkg/analyzer/test/generated/non_error_resolver_test.dart b/pkg/analyzer/test/generated/non_error_resolver_test.dart
index 16d5494..978c457 100644
--- a/pkg/analyzer/test/generated/non_error_resolver_test.dart
+++ b/pkg/analyzer/test/generated/non_error_resolver_test.dart
@@ -739,7 +739,7 @@
 import 'lib1.dart' deferred as a;
 main() {
   new a.A.b();
-}'''], <ErrorCode> [ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED], <ErrorCode> []);
+}'''], <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED], <ErrorCode>[]);
   }
 
   void test_constEval_functionTypeLiteral() {
@@ -1798,7 +1798,7 @@
   static _m() {}
 }''');
     resolve(source);
-    assertErrors(source, []);
+    assertNoErrors(source);
     verify([source]);
   }
 
@@ -2428,7 +2428,7 @@
   f();
 }''');
     resolve(source);
-    assertErrors(source, []);
+    assertNoErrors(source);
     verify([source]);
   }
 
@@ -2450,9 +2450,9 @@
 import 'lib1.dart' deferred as other;
 main() {
   other.loadLibrary().then((_) => other.foo());
-}'''], <ErrorCode> [
+}'''], <ErrorCode>[
         ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED,
-        StaticTypeWarningCode.UNDEFINED_FUNCTION], <ErrorCode> []);
+        StaticTypeWarningCode.UNDEFINED_FUNCTION], <ErrorCode>[]);
   }
 
   void test_mapKeyTypeNotAssignable() {
@@ -3385,6 +3385,52 @@
     verify([source]);
   }
 
+  void test_parameterScope_local() {
+    // Parameter names shouldn't conflict with the name of the function they
+    // are enclosed in.
+    Source source = addSource(r'''
+f() {
+  g(g) {
+    h(g);
+  }
+}
+h(x) {}
+''');
+    resolve(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  void test_parameterScope_method() {
+    // Parameter names shouldn't conflict with the name of the function they
+    // are enclosed in.
+    Source source = addSource(r'''
+class C {
+  g(g) {
+    h(g);
+  }
+}
+h(x) {}
+''');
+    resolve(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  void test_parameterScope_toplevel() {
+    // Parameter names shouldn't conflict with the name of the function they
+    // are enclosed in.
+    Source source = addSource(r'''
+g(g) {
+  h(g);
+}
+h(x) {}
+''');
+    resolve(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
   void test_prefixCollidesWithTopLevelMembers() {
     addNamedSource("/lib.dart", r'''
 library lib;
@@ -3809,7 +3855,7 @@
   Type get t => T;
 }''');
     resolve(source);
-    assertErrors(source, []);
+    assertErrors(source);
     verify([source]);
   }
 
@@ -3871,7 +3917,7 @@
 import 'lib1.dart' deferred as lib1;
 import 'lib2.dart' as lib;
 import 'lib3.dart' as lib;
-main() { lib1.f1(); lib.f2(); lib.f3(); }'''], <ErrorCode> [ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED], <ErrorCode> []);
+main() { lib1.f1(); lib.f2(); lib.f3(); }'''], <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED], <ErrorCode>[]);
   }
 
   void test_staticAccessToInstanceMember_annotation() {
diff --git a/pkg/analyzer/test/generated/parser_test.dart b/pkg/analyzer/test/generated/parser_test.dart
index fc1eeb8..fdf3a50 100644
--- a/pkg/analyzer/test/generated/parser_test.dart
+++ b/pkg/analyzer/test/generated/parser_test.dart
@@ -112,38 +112,38 @@
  */
 class ComplexParserTest extends ParserTestCase {
   void test_additiveExpression_normal() {
-    BinaryExpression expression = ParserTestCase.parseExpression("x + y - z", []);
+    BinaryExpression expression = ParserTestCase.parseExpression("x + y - z");
     EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
   }
 
   void test_additiveExpression_noSpaces() {
-    BinaryExpression expression = ParserTestCase.parseExpression("i+1", []);
+    BinaryExpression expression = ParserTestCase.parseExpression("i+1");
     EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, expression.leftOperand);
     EngineTestCase.assertInstanceOf((obj) => obj is IntegerLiteral, IntegerLiteral, expression.rightOperand);
   }
 
   void test_additiveExpression_precedence_multiplicative_left() {
-    BinaryExpression expression = ParserTestCase.parseExpression("x * y + z", []);
+    BinaryExpression expression = ParserTestCase.parseExpression("x * y + z");
     EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
   }
 
   void test_additiveExpression_precedence_multiplicative_left_withSuper() {
-    BinaryExpression expression = ParserTestCase.parseExpression("super * y - z", []);
+    BinaryExpression expression = ParserTestCase.parseExpression("super * y - z");
     EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
   }
 
   void test_additiveExpression_precedence_multiplicative_right() {
-    BinaryExpression expression = ParserTestCase.parseExpression("x + y * z", []);
+    BinaryExpression expression = ParserTestCase.parseExpression("x + y * z");
     EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.rightOperand);
   }
 
   void test_additiveExpression_super() {
-    BinaryExpression expression = ParserTestCase.parseExpression("super + y - z", []);
+    BinaryExpression expression = ParserTestCase.parseExpression("super + y - z");
     EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
   }
 
   void test_assignableExpression_arguments_normal_chain() {
-    PropertyAccess propertyAccess1 = ParserTestCase.parseExpression("a(b)(c).d(e).f", []);
+    PropertyAccess propertyAccess1 = ParserTestCase.parseExpression("a(b)(c).d(e).f");
     expect(propertyAccess1.propertyName.name, "f");
     //
     // a(b)(c).d(e)
@@ -171,91 +171,91 @@
   }
 
   void test_assignmentExpression_compound() {
-    AssignmentExpression expression = ParserTestCase.parseExpression("x = y = 0", []);
+    AssignmentExpression expression = ParserTestCase.parseExpression("x = y = 0");
     EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, expression.leftHandSide);
     EngineTestCase.assertInstanceOf((obj) => obj is AssignmentExpression, AssignmentExpression, expression.rightHandSide);
   }
 
   void test_assignmentExpression_indexExpression() {
-    AssignmentExpression expression = ParserTestCase.parseExpression("x[1] = 0", []);
+    AssignmentExpression expression = ParserTestCase.parseExpression("x[1] = 0");
     EngineTestCase.assertInstanceOf((obj) => obj is IndexExpression, IndexExpression, expression.leftHandSide);
     EngineTestCase.assertInstanceOf((obj) => obj is IntegerLiteral, IntegerLiteral, expression.rightHandSide);
   }
 
   void test_assignmentExpression_prefixedIdentifier() {
-    AssignmentExpression expression = ParserTestCase.parseExpression("x.y = 0", []);
+    AssignmentExpression expression = ParserTestCase.parseExpression("x.y = 0");
     EngineTestCase.assertInstanceOf((obj) => obj is PrefixedIdentifier, PrefixedIdentifier, expression.leftHandSide);
     EngineTestCase.assertInstanceOf((obj) => obj is IntegerLiteral, IntegerLiteral, expression.rightHandSide);
   }
 
   void test_assignmentExpression_propertyAccess() {
-    AssignmentExpression expression = ParserTestCase.parseExpression("super.y = 0", []);
+    AssignmentExpression expression = ParserTestCase.parseExpression("super.y = 0");
     EngineTestCase.assertInstanceOf((obj) => obj is PropertyAccess, PropertyAccess, expression.leftHandSide);
     EngineTestCase.assertInstanceOf((obj) => obj is IntegerLiteral, IntegerLiteral, expression.rightHandSide);
   }
 
   void test_bitwiseAndExpression_normal() {
-    BinaryExpression expression = ParserTestCase.parseExpression("x & y & z", []);
+    BinaryExpression expression = ParserTestCase.parseExpression("x & y & z");
     EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
   }
 
   void test_bitwiseAndExpression_precedence_equality_left() {
-    BinaryExpression expression = ParserTestCase.parseExpression("x == y && z", []);
+    BinaryExpression expression = ParserTestCase.parseExpression("x == y && z");
     EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
   }
 
   void test_bitwiseAndExpression_precedence_equality_right() {
-    BinaryExpression expression = ParserTestCase.parseExpression("x && y == z", []);
+    BinaryExpression expression = ParserTestCase.parseExpression("x && y == z");
     EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.rightOperand);
   }
 
   void test_bitwiseAndExpression_super() {
-    BinaryExpression expression = ParserTestCase.parseExpression("super & y & z", []);
+    BinaryExpression expression = ParserTestCase.parseExpression("super & y & z");
     EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
   }
 
   void test_bitwiseOrExpression_normal() {
-    BinaryExpression expression = ParserTestCase.parseExpression("x | y | z", []);
+    BinaryExpression expression = ParserTestCase.parseExpression("x | y | z");
     EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
   }
 
   void test_bitwiseOrExpression_precedence_xor_left() {
-    BinaryExpression expression = ParserTestCase.parseExpression("x ^ y | z", []);
+    BinaryExpression expression = ParserTestCase.parseExpression("x ^ y | z");
     EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
   }
 
   void test_bitwiseOrExpression_precedence_xor_right() {
-    BinaryExpression expression = ParserTestCase.parseExpression("x | y ^ z", []);
+    BinaryExpression expression = ParserTestCase.parseExpression("x | y ^ z");
     EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.rightOperand);
   }
 
   void test_bitwiseOrExpression_super() {
-    BinaryExpression expression = ParserTestCase.parseExpression("super | y | z", []);
+    BinaryExpression expression = ParserTestCase.parseExpression("super | y | z");
     EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
   }
 
   void test_bitwiseXorExpression_normal() {
-    BinaryExpression expression = ParserTestCase.parseExpression("x ^ y ^ z", []);
+    BinaryExpression expression = ParserTestCase.parseExpression("x ^ y ^ z");
     EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
   }
 
   void test_bitwiseXorExpression_precedence_and_left() {
-    BinaryExpression expression = ParserTestCase.parseExpression("x & y ^ z", []);
+    BinaryExpression expression = ParserTestCase.parseExpression("x & y ^ z");
     EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
   }
 
   void test_bitwiseXorExpression_precedence_and_right() {
-    BinaryExpression expression = ParserTestCase.parseExpression("x ^ y & z", []);
+    BinaryExpression expression = ParserTestCase.parseExpression("x ^ y & z");
     EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.rightOperand);
   }
 
   void test_bitwiseXorExpression_super() {
-    BinaryExpression expression = ParserTestCase.parseExpression("super ^ y ^ z", []);
+    BinaryExpression expression = ParserTestCase.parseExpression("super ^ y ^ z");
     EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
   }
 
   void test_cascade_withAssignment() {
-    CascadeExpression cascade = ParserTestCase.parseExpression("new Map()..[3] = 4 ..[0] = 11;", []);
+    CascadeExpression cascade = ParserTestCase.parseExpression("new Map()..[3] = 4 ..[0] = 11;");
     Expression target = cascade.target;
     for (Expression section in cascade.cascadeSections) {
       EngineTestCase.assertInstanceOf((obj) => obj is AssignmentExpression, AssignmentExpression, section);
@@ -268,7 +268,7 @@
   }
 
   void test_conditionalExpression_precedence_logicalOrExpression() {
-    ConditionalExpression expression = ParserTestCase.parseExpression("a | b ? y : z", []);
+    ConditionalExpression expression = ParserTestCase.parseExpression("a | b ? y : z");
     EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.condition);
   }
 
@@ -278,7 +278,7 @@
   C() :
     this.a = (b == null ? c : d) {
   }
-}''', []);
+}''');
     NodeList<CompilationUnitMember> declarations = unit.declarations;
     expect(declarations, hasLength(1));
   }
@@ -289,12 +289,12 @@
   }
 
   void test_equalityExpression_precedence_relational_left() {
-    BinaryExpression expression = ParserTestCase.parseExpression("x is y == z", []);
+    BinaryExpression expression = ParserTestCase.parseExpression("x is y == z");
     EngineTestCase.assertInstanceOf((obj) => obj is IsExpression, IsExpression, expression.leftOperand);
   }
 
   void test_equalityExpression_precedence_relational_right() {
-    BinaryExpression expression = ParserTestCase.parseExpression("x == y is z", []);
+    BinaryExpression expression = ParserTestCase.parseExpression("x == y is z");
     EngineTestCase.assertInstanceOf((obj) => obj is IsExpression, IsExpression, expression.rightOperand);
   }
 
@@ -304,88 +304,88 @@
   }
 
   void test_logicalAndExpression() {
-    BinaryExpression expression = ParserTestCase.parseExpression("x && y && z", []);
+    BinaryExpression expression = ParserTestCase.parseExpression("x && y && z");
     EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
   }
 
   void test_logicalAndExpression_precedence_bitwiseOr_left() {
-    BinaryExpression expression = ParserTestCase.parseExpression("x | y < z", []);
+    BinaryExpression expression = ParserTestCase.parseExpression("x | y < z");
     EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
   }
 
   void test_logicalAndExpression_precedence_bitwiseOr_right() {
-    BinaryExpression expression = ParserTestCase.parseExpression("x < y | z", []);
+    BinaryExpression expression = ParserTestCase.parseExpression("x < y | z");
     EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.rightOperand);
   }
 
   void test_logicalOrExpression() {
-    BinaryExpression expression = ParserTestCase.parseExpression("x || y || z", []);
+    BinaryExpression expression = ParserTestCase.parseExpression("x || y || z");
     EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
   }
 
   void test_logicalOrExpression_precedence_logicalAnd_left() {
-    BinaryExpression expression = ParserTestCase.parseExpression("x && y || z", []);
+    BinaryExpression expression = ParserTestCase.parseExpression("x && y || z");
     EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
   }
 
   void test_logicalOrExpression_precedence_logicalAnd_right() {
-    BinaryExpression expression = ParserTestCase.parseExpression("x || y && z", []);
+    BinaryExpression expression = ParserTestCase.parseExpression("x || y && z");
     EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.rightOperand);
   }
 
   void test_multipleLabels_statement() {
-    LabeledStatement statement = ParserTestCase.parseStatement("a: b: c: return x;", []);
+    LabeledStatement statement = ParserTestCase.parseStatement("a: b: c: return x;");
     expect(statement.labels, hasLength(3));
     EngineTestCase.assertInstanceOf((obj) => obj is ReturnStatement, ReturnStatement, statement.statement);
   }
 
   void test_multiplicativeExpression_normal() {
-    BinaryExpression expression = ParserTestCase.parseExpression("x * y / z", []);
+    BinaryExpression expression = ParserTestCase.parseExpression("x * y / z");
     EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
   }
 
   void test_multiplicativeExpression_precedence_unary_left() {
-    BinaryExpression expression = ParserTestCase.parseExpression("-x * y", []);
+    BinaryExpression expression = ParserTestCase.parseExpression("-x * y");
     EngineTestCase.assertInstanceOf((obj) => obj is PrefixExpression, PrefixExpression, expression.leftOperand);
   }
 
   void test_multiplicativeExpression_precedence_unary_right() {
-    BinaryExpression expression = ParserTestCase.parseExpression("x * -y", []);
+    BinaryExpression expression = ParserTestCase.parseExpression("x * -y");
     EngineTestCase.assertInstanceOf((obj) => obj is PrefixExpression, PrefixExpression, expression.rightOperand);
   }
 
   void test_multiplicativeExpression_super() {
-    BinaryExpression expression = ParserTestCase.parseExpression("super * y / z", []);
+    BinaryExpression expression = ParserTestCase.parseExpression("super * y / z");
     EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
   }
 
   void test_relationalExpression_precedence_shift_right() {
-    IsExpression expression = ParserTestCase.parseExpression("x << y is z", []);
+    IsExpression expression = ParserTestCase.parseExpression("x << y is z");
     EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.expression);
   }
 
   void test_shiftExpression_normal() {
-    BinaryExpression expression = ParserTestCase.parseExpression("x >> 4 << 3", []);
+    BinaryExpression expression = ParserTestCase.parseExpression("x >> 4 << 3");
     EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
   }
 
   void test_shiftExpression_precedence_additive_left() {
-    BinaryExpression expression = ParserTestCase.parseExpression("x + y << z", []);
+    BinaryExpression expression = ParserTestCase.parseExpression("x + y << z");
     EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
   }
 
   void test_shiftExpression_precedence_additive_right() {
-    BinaryExpression expression = ParserTestCase.parseExpression("x << y + z", []);
+    BinaryExpression expression = ParserTestCase.parseExpression("x << y + z");
     EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.rightOperand);
   }
 
   void test_shiftExpression_super() {
-    BinaryExpression expression = ParserTestCase.parseExpression("super >> 4 << 3", []);
+    BinaryExpression expression = ParserTestCase.parseExpression("super >> 4 << 3");
     EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.leftOperand);
   }
 
   void test_topLevelVariable_withMetadata() {
-    ParserTestCase.parseCompilationUnit("String @A string;", []);
+    ParserTestCase.parseCompilationUnit("String @A string;");
   }
 }
 
@@ -528,11 +528,11 @@
   }
 
   void test_breakOutsideOfLoop_breakInDoStatement() {
-    ParserTestCase.parse4("parseDoStatement", "do {break;} while (x);", []);
+    ParserTestCase.parse4("parseDoStatement", "do {break;} while (x);");
   }
 
   void test_breakOutsideOfLoop_breakInForStatement() {
-    ParserTestCase.parse4("parseForStatement", "for (; x;) {break;}", []);
+    ParserTestCase.parse4("parseForStatement", "for (; x;) {break;}");
   }
 
   void test_breakOutsideOfLoop_breakInIfStatement() {
@@ -540,11 +540,11 @@
   }
 
   void test_breakOutsideOfLoop_breakInSwitchStatement() {
-    ParserTestCase.parse4("parseSwitchStatement", "switch (x) {case 1: break;}", []);
+    ParserTestCase.parse4("parseSwitchStatement", "switch (x) {case 1: break;}");
   }
 
   void test_breakOutsideOfLoop_breakInWhileStatement() {
-    ParserTestCase.parse4("parseWhileStatement", "while (x) {break;}", []);
+    ParserTestCase.parse4("parseWhileStatement", "while (x) {break;}");
   }
 
   void test_breakOutsideOfLoop_functionExpression_inALoop() {
@@ -552,7 +552,7 @@
   }
 
   void test_breakOutsideOfLoop_functionExpression_withALoop() {
-    ParserTestCase.parseStatement("() {for (; x;) {break;}};", []);
+    ParserTestCase.parseStatement("() {for (; x;) {break;}};");
   }
 
   void test_classTypeAlias_abstractAfterEq() {
@@ -604,11 +604,11 @@
   }
 
   void test_continueOutsideOfLoop_continueInDoStatement() {
-    ParserTestCase.parse4("parseDoStatement", "do {continue;} while (x);", []);
+    ParserTestCase.parse4("parseDoStatement", "do {continue;} while (x);");
   }
 
   void test_continueOutsideOfLoop_continueInForStatement() {
-    ParserTestCase.parse4("parseForStatement", "for (; x;) {continue;}", []);
+    ParserTestCase.parse4("parseForStatement", "for (; x;) {continue;}");
   }
 
   void test_continueOutsideOfLoop_continueInIfStatement() {
@@ -616,11 +616,11 @@
   }
 
   void test_continueOutsideOfLoop_continueInSwitchStatement() {
-    ParserTestCase.parse4("parseSwitchStatement", "switch (x) {case 1: continue a;}", []);
+    ParserTestCase.parse4("parseSwitchStatement", "switch (x) {case 1: continue a;}");
   }
 
   void test_continueOutsideOfLoop_continueInWhileStatement() {
-    ParserTestCase.parse4("parseWhileStatement", "while (x) {continue;}", []);
+    ParserTestCase.parse4("parseWhileStatement", "while (x) {continue;}");
   }
 
   void test_continueOutsideOfLoop_functionExpression_inALoop() {
@@ -628,7 +628,7 @@
   }
 
   void test_continueOutsideOfLoop_functionExpression_withALoop() {
-    ParserTestCase.parseStatement("() {for (; x;) {continue;}};", []);
+    ParserTestCase.parseStatement("() {for (; x;) {continue;}};");
   }
 
   void test_continueWithoutLabelInCase_error() {
@@ -636,11 +636,11 @@
   }
 
   void test_continueWithoutLabelInCase_noError() {
-    ParserTestCase.parse4("parseSwitchStatement", "switch (x) {case 1: continue a;}", []);
+    ParserTestCase.parse4("parseSwitchStatement", "switch (x) {case 1: continue a;}");
   }
 
   void test_continueWithoutLabelInCase_noError_switchInLoop() {
-    ParserTestCase.parse4("parseWhileStatement", "while (a) { switch (b) {default: continue;}}", []);
+    ParserTestCase.parse4("parseWhileStatement", "while (a) { switch (b) {default: continue;}}");
   }
 
   void test_deprecatedClassTypeAlias() {
@@ -734,7 +734,7 @@
   }
 
   void test_expectedExecutable_topLevel_eof() {
-    ParserTestCase.parse2("parseCompilationUnitMember", <Object> [emptyCommentAndMetadata()], "x", [new AnalysisError.con2(null, 0, 1, ParserErrorCode.EXPECTED_EXECUTABLE, [])]);
+    ParserTestCase.parse2("parseCompilationUnitMember", <Object> [emptyCommentAndMetadata()], "x", [new AnalysisError.con2(null, 0, 1, ParserErrorCode.EXPECTED_EXECUTABLE)]);
   }
 
   void test_expectedInterpolationIdentifier() {
@@ -745,7 +745,7 @@
     // The scanner inserts an empty string token between the two $'s; we need to make sure that the
     // MISSING_IDENTIFIER error that is generated has a nonzero width so that it will show up in
     // the editor UI.
-    ParserTestCase.parse2("parseStringLiteral", <Object> [], "'\$\$foo'", [new AnalysisError.con2(null, 2, 1, ParserErrorCode.MISSING_IDENTIFIER, [])]);
+    ParserTestCase.parse2("parseStringLiteral", <Object>[], "'\$\$foo'", [new AnalysisError.con2(null, 2, 1, ParserErrorCode.MISSING_IDENTIFIER)]);
   }
 
   void test_expectedStringLiteral() {
@@ -876,6 +876,14 @@
     ParserTestCase.parseCompilationUnit("factory typedef F();", [ParserErrorCode.FACTORY_TOP_LEVEL_DECLARATION]);
   }
 
+  void test_factoryWithInitializers() {
+    ParserTestCase.parse3(
+        "parseClassMember",
+        <Object> ["C"],
+        "factory C() : x = 3 {}",
+        [ParserErrorCode.FACTORY_WITH_INITIALIZERS]);
+  }
+
   void test_factoryWithoutBody() {
     ParserTestCase.parse3("parseClassMember", <Object> ["C"], "factory C();", [ParserErrorCode.FACTORY_WITHOUT_BODY]);
   }
@@ -1069,7 +1077,7 @@
   }
 
   void test_missingAssignableSelector_identifiersAssigned() {
-    ParserTestCase.parseExpression("x.y = y;", []);
+    ParserTestCase.parseExpression("x.y = y;");
   }
 
   void test_missingAssignableSelector_prefix_minusMinus_literal() {
@@ -1081,7 +1089,7 @@
   }
 
   void test_missingAssignableSelector_selector() {
-    ParserTestCase.parseExpression("x(y)(z).a++", []);
+    ParserTestCase.parseExpression("x(y)(z).a++");
   }
 
   void test_missingAssignableSelector_superPrimaryExpression() {
@@ -1090,7 +1098,7 @@
   }
 
   void test_missingAssignableSelector_superPropertyAccessAssigned() {
-    ParserTestCase.parseExpression("super.x = x;", []);
+    ParserTestCase.parseExpression("super.x = x;");
   }
 
   void test_missingCatchOrFinally() {
@@ -1868,7 +1876,8 @@
    * @throws Exception if the method could not be invoked or throws an exception
    * @throws AssertionFailedError if the result is `null` or if any errors are produced
    */
-  static Object parse(String methodName, List<Object> objects, String source) => parse2(methodName, objects, source, new List<AnalysisError>(0));
+  static Object parse(String methodName, List<Object> objects, String source)
+      => parse2(methodName, objects, source);
 
   /**
    * Invoke a parse method in [Parser]. The method is assumed to have the given number and
@@ -1886,7 +1895,7 @@
    * @throws AssertionFailedError if the result is `null` or the errors produced while
    *           scanning and parsing the source do not match the expected errors
    */
-  static Object parse2(String methodName, List<Object> objects, String source, List<AnalysisError> errors) {
+  static Object parse2(String methodName, List<Object> objects, String source, [List<AnalysisError> errors = AnalysisError.NO_ERRORS]) {
     GatheringErrorListener listener = new GatheringErrorListener();
     Object result = invokeParserMethod(methodName, objects, source, listener);
     listener.assertErrors(errors);
@@ -1909,7 +1918,7 @@
    * @throws AssertionFailedError if the result is `null` or the errors produced while
    *           scanning and parsing the source do not match the expected errors
    */
-  static Object parse3(String methodName, List<Object> objects, String source, List<ErrorCode> errorCodes) {
+  static Object parse3(String methodName, List<Object> objects, String source, [List<ErrorCode> errorCodes = ErrorCode.EMPTY_LIST]) {
     GatheringErrorListener listener = new GatheringErrorListener();
     Object result = invokeParserMethod(methodName, objects, source, listener);
     listener.assertErrorsWithCodes(errorCodes);
@@ -1930,7 +1939,8 @@
    * @throws AssertionFailedError if the result is `null` or the errors produced while
    *           scanning and parsing the source do not match the expected errors
    */
-  static Object parse4(String methodName, String source, List<ErrorCode> errorCodes) => parse3(methodName, _EMPTY_ARGUMENTS, source, errorCodes);
+  static Object parse4(String methodName, String source, [List<ErrorCode> errorCodes = ErrorCode.EMPTY_LIST])
+      => parse3(methodName, _EMPTY_ARGUMENTS, source, errorCodes);
 
   /**
    * Parse the given source as a compilation unit.
@@ -1941,7 +1951,7 @@
    * @throws Exception if the source could not be parsed, if the compilation errors in the source do
    *           not match those that are expected, or if the result would have been `null`
    */
-  static CompilationUnit parseCompilationUnit(String source, List<ErrorCode> errorCodes) {
+  static CompilationUnit parseCompilationUnit(String source, [List<ErrorCode> errorCodes = ErrorCode.EMPTY_LIST]) {
     GatheringErrorListener listener = new GatheringErrorListener();
     Scanner scanner = new Scanner(null, new CharSequenceReader(source), listener);
     listener.setLineInfo(new TestSource(), scanner.lineStarts);
@@ -1962,7 +1972,7 @@
    * @throws Exception if the source could not be parsed, if the compilation errors in the source do
    *           not match those that are expected, or if the result would have been `null`
    */
-  static Expression parseExpression(String source, List<ErrorCode> errorCodes) {
+  static Expression parseExpression(String source, [List<ErrorCode> errorCodes = ErrorCode.EMPTY_LIST]) {
     GatheringErrorListener listener = new GatheringErrorListener();
     Scanner scanner = new Scanner(null, new CharSequenceReader(source), listener);
     listener.setLineInfo(new TestSource(), scanner.lineStarts);
@@ -1983,7 +1993,7 @@
    * @throws Exception if the source could not be parsed, if the compilation errors in the source do
    *           not match those that are expected, or if the result would have been `null`
    */
-  static Statement parseStatement(String source, List<ErrorCode> errorCodes) {
+  static Statement parseStatement(String source, [List<ErrorCode> errorCodes = ErrorCode.EMPTY_LIST]) {
     GatheringErrorListener listener = new GatheringErrorListener();
     Scanner scanner = new Scanner(null, new CharSequenceReader(source), listener);
     listener.setLineInfo(new TestSource(), scanner.lineStarts);
@@ -2006,7 +2016,7 @@
    *           the expected count, if the compilation errors in the source do not match those that
    *           are expected, or if the result would have been `null`
    */
-  static List<Statement> parseStatements(String source, int expectedCount, List<ErrorCode> errorCodes) {
+  static List<Statement> parseStatements(String source, int expectedCount, [List<ErrorCode> errorCodes = ErrorCode.EMPTY_LIST]) {
     GatheringErrorListener listener = new GatheringErrorListener();
     Scanner scanner = new Scanner(null, new CharSequenceReader(source), listener);
     listener.setLineInfo(new TestSource(), scanner.lineStarts);
@@ -2081,12 +2091,8 @@
    * @param annotations the annotations to be wrapped in the object
    * @return a CommentAndMetadata object that can be used for testing
    */
-  CommentAndMetadata commentAndMetadata(Comment comment, List<Annotation> annotations) {
-    List<Annotation> metadata = new List<Annotation>();
-    for (Annotation annotation in annotations) {
-      metadata.add(annotation);
-    }
-    return new CommentAndMetadata(comment, metadata);
+  CommentAndMetadata commentAndMetadata(Comment comment, [List<Annotation> annotations]) {
+    return new CommentAndMetadata(comment, annotations);
   }
 
   /**
@@ -2094,7 +2100,7 @@
    *
    * @return an empty CommentAndMetadata object that can be used for testing
    */
-  CommentAndMetadata emptyCommentAndMetadata() => new CommentAndMetadata(null, new List<Annotation>());
+  CommentAndMetadata emptyCommentAndMetadata() => new CommentAndMetadata(null, null);
 
   @override
   void setUp() {
@@ -2117,7 +2123,7 @@
     result[new Symbol(name)] = value;
   });
   return result;
-}''', []);
+}''');
   }
 
   void test_additiveExpression_missing_LHS() {
@@ -2465,6 +2471,54 @@
     expect(vars[0].name.name, "v");
   }
 
+  void test_functionExpression_named() {
+    ParserTestCase.parseExpression("m(f() => 0);", [
+        ParserErrorCode.EXPECTED_TOKEN]);
+  }
+
+  void test_incomplete_conditionalExpression() {
+    ParserTestCase.parseExpression("x ? 0", [
+        ParserErrorCode.EXPECTED_TOKEN,
+        ParserErrorCode.MISSING_IDENTIFIER]);
+  }
+
+  void test_incomplete_constructorInitializers_empty() {
+    ParserTestCase.parse3(
+        "parseClassMember",
+        ["C"],
+        "C() : {}",
+        [ParserErrorCode.MISSING_INITIALIZER]);
+  }
+
+  void test_incomplete_constructorInitializers_missingEquals() {
+    ClassMember member = ParserTestCase.parse3(
+        "parseClassMember",
+        ["C"],
+        "C() : x(3) {}",
+        [ParserErrorCode.MISSING_ASSIGNMENT_IN_INITIALIZER]);
+    expect(member, new isInstanceOf<ConstructorDeclaration>());
+    NodeList<ConstructorInitializer> initializers = (member as ConstructorDeclaration).initializers;
+    expect(initializers, hasLength(1));
+    ConstructorInitializer initializer = initializers[0];
+    expect(initializer, new isInstanceOf<ConstructorFieldInitializer>());
+    Expression expression = (initializer as ConstructorFieldInitializer).expression;
+    expect(expression, isNotNull);
+    expect(expression, new isInstanceOf<ParenthesizedExpression>());
+  }
+
+  void test_incomplete_constructorInitializers_variable() {
+    ParserTestCase.parse3(
+        "parseClassMember",
+        ["C"],
+        "C() : x {}",
+        [ParserErrorCode.MISSING_ASSIGNMENT_IN_INITIALIZER]);
+  }
+
+  void test_incomplete_topLevelFunction() {
+    ParserTestCase.parseCompilationUnit("foo();", [
+        ParserErrorCode.MISSING_FUNCTION_BODY]);
+  }
+
   void test_incomplete_topLevelVariable() {
     CompilationUnit unit = ParserTestCase.parseCompilationUnit("String", [ParserErrorCode.EXPECTED_EXECUTABLE]);
     NodeList<CompilationUnitMember> declarations = unit.declarations;
@@ -2588,6 +2642,11 @@
     expect(field.name.isSynthetic, isTrue);
   }
 
+  void test_invalidFunctionBodyModifier() {
+    ParserTestCase.parseCompilationUnit("f() sync {}", [
+        ParserErrorCode.MISSING_STAR_AFTER_SYNC]);
+  }
+
   void test_isExpression_noType() {
     CompilationUnit unit = ParserTestCase.parseCompilationUnit("class Bar<T extends Foo> {m(x){if (x is ) return;if (x is !)}}", [
         ParserErrorCode.EXPECTED_TYPE_NAME,
@@ -2607,6 +2666,13 @@
     EngineTestCase.assertInstanceOf((obj) => obj is EmptyStatement, EmptyStatement, ifStatement.thenStatement);
   }
 
+  void test_keywordInPlaceOfIdentifier() {
+    // TODO(brianwilkerson) We could do better with this.
+    ParserTestCase.parseCompilationUnit("do() {}", [
+        ParserErrorCode.EXPECTED_EXECUTABLE,
+        ParserErrorCode.UNEXPECTED_TOKEN]);
+  }
+
   void test_logicalAndExpression_missing_LHS() {
     BinaryExpression expression = ParserTestCase.parseExpression("&& y", [ParserErrorCode.MISSING_IDENTIFIER]);
     EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, SimpleIdentifier, expression.leftOperand);
@@ -2683,6 +2749,11 @@
     EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, BinaryExpression, expression.rightOperand);
   }
 
+  void test_missing_commaInArgumentList() {
+    ParserTestCase.parseExpression("f(x: 1 y: 2)", [
+        ParserErrorCode.EXPECTED_TOKEN]);
+  }
+
   void test_missingGet() {
     CompilationUnit unit = ParserTestCase.parseCompilationUnit(r'''
 class C {
@@ -2855,6 +2926,11 @@
     CompilationUnitMember member = declarations[0];
     EngineTestCase.assertInstanceOf((obj) => obj is FunctionTypeAlias, FunctionTypeAlias, member);
   }
+
+  void test_unaryPlus() {
+    ParserTestCase.parseExpression("+2", [
+        ParserErrorCode.MISSING_IDENTIFIER]);
+  }
 }
 
 class ResolutionCopierTest extends EngineTestCase {
@@ -2869,12 +2945,12 @@
   }
 
   void test_visitAsExpression() {
-    AsExpression fromNode = AstFactory.asExpression(AstFactory.identifier3("x"), AstFactory.typeName4("A", []));
-    DartType propagatedType = ElementFactory.classElement2("A", []).type;
+    AsExpression fromNode = AstFactory.asExpression(AstFactory.identifier3("x"), AstFactory.typeName4("A"));
+    DartType propagatedType = ElementFactory.classElement2("A").type;
     fromNode.propagatedType = propagatedType;
-    DartType staticType = ElementFactory.classElement2("B", []).type;
+    DartType staticType = ElementFactory.classElement2("B").type;
     fromNode.staticType = staticType;
-    AsExpression toNode = AstFactory.asExpression(AstFactory.identifier3("x"), AstFactory.typeName4("A", []));
+    AsExpression toNode = AstFactory.asExpression(AstFactory.identifier3("x"), AstFactory.typeName4("A"));
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.propagatedType, same(propagatedType));
     expect(toNode.staticType, same(staticType));
@@ -2882,12 +2958,12 @@
 
   void test_visitAssignmentExpression() {
     AssignmentExpression fromNode = AstFactory.assignmentExpression(AstFactory.identifier3("a"), TokenType.PLUS_EQ, AstFactory.identifier3("b"));
-    DartType propagatedType = ElementFactory.classElement2("C", []).type;
-    MethodElement propagatedElement = ElementFactory.methodElement("+", propagatedType, []);
+    DartType propagatedType = ElementFactory.classElement2("C").type;
+    MethodElement propagatedElement = ElementFactory.methodElement("+", propagatedType);
     fromNode.propagatedElement = propagatedElement;
     fromNode.propagatedType = propagatedType;
-    DartType staticType = ElementFactory.classElement2("C", []).type;
-    MethodElement staticElement = ElementFactory.methodElement("+", staticType, []);
+    DartType staticType = ElementFactory.classElement2("C").type;
+    MethodElement staticElement = ElementFactory.methodElement("+", staticType);
     fromNode.staticElement = staticElement;
     fromNode.staticType = staticType;
     AssignmentExpression toNode = AstFactory.assignmentExpression(AstFactory.identifier3("a"), TokenType.PLUS_EQ, AstFactory.identifier3("b"));
@@ -2900,12 +2976,12 @@
 
   void test_visitBinaryExpression() {
     BinaryExpression fromNode = AstFactory.binaryExpression(AstFactory.identifier3("a"), TokenType.PLUS, AstFactory.identifier3("b"));
-    DartType propagatedType = ElementFactory.classElement2("C", []).type;
-    MethodElement propagatedElement = ElementFactory.methodElement("+", propagatedType, []);
+    DartType propagatedType = ElementFactory.classElement2("C").type;
+    MethodElement propagatedElement = ElementFactory.methodElement("+", propagatedType);
     fromNode.propagatedElement = propagatedElement;
     fromNode.propagatedType = propagatedType;
-    DartType staticType = ElementFactory.classElement2("C", []).type;
-    MethodElement staticElement = ElementFactory.methodElement("+", staticType, []);
+    DartType staticType = ElementFactory.classElement2("C").type;
+    MethodElement staticElement = ElementFactory.methodElement("+", staticType);
     fromNode.staticElement = staticElement;
     fromNode.staticType = staticType;
     BinaryExpression toNode = AstFactory.binaryExpression(AstFactory.identifier3("a"), TokenType.PLUS, AstFactory.identifier3("b"));
@@ -2918,9 +2994,9 @@
 
   void test_visitBooleanLiteral() {
     BooleanLiteral fromNode = AstFactory.booleanLiteral(true);
-    DartType propagatedType = ElementFactory.classElement2("C", []).type;
+    DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
-    DartType staticType = ElementFactory.classElement2("C", []).type;
+    DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
     BooleanLiteral toNode = AstFactory.booleanLiteral(true);
     ResolutionCopier.copyResolutionData(fromNode, toNode);
@@ -2930,9 +3006,9 @@
 
   void test_visitCascadeExpression() {
     CascadeExpression fromNode = AstFactory.cascadeExpression(AstFactory.identifier3("a"), [AstFactory.identifier3("b")]);
-    DartType propagatedType = ElementFactory.classElement2("C", []).type;
+    DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
-    DartType staticType = ElementFactory.classElement2("C", []).type;
+    DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
     CascadeExpression toNode = AstFactory.cascadeExpression(AstFactory.identifier3("a"), [AstFactory.identifier3("b")]);
     ResolutionCopier.copyResolutionData(fromNode, toNode);
@@ -2951,9 +3027,9 @@
 
   void test_visitConditionalExpression() {
     ConditionalExpression fromNode = AstFactory.conditionalExpression(AstFactory.identifier3("c"), AstFactory.identifier3("a"), AstFactory.identifier3("b"));
-    DartType propagatedType = ElementFactory.classElement2("C", []).type;
+    DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
-    DartType staticType = ElementFactory.classElement2("C", []).type;
+    DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
     ConditionalExpression toNode = AstFactory.conditionalExpression(AstFactory.identifier3("c"), AstFactory.identifier3("a"), AstFactory.identifier3("b"));
     ResolutionCopier.copyResolutionData(fromNode, toNode);
@@ -2964,28 +3040,28 @@
   void test_visitConstructorDeclaration() {
     String className = "A";
     String constructorName = "c";
-    ConstructorDeclaration fromNode = AstFactory.constructorDeclaration(AstFactory.identifier3(className), constructorName, AstFactory.formalParameterList([]), null);
-    ConstructorElement element = ElementFactory.constructorElement2(ElementFactory.classElement2(className, []), constructorName, []);
+    ConstructorDeclaration fromNode = AstFactory.constructorDeclaration(AstFactory.identifier3(className), constructorName, AstFactory.formalParameterList(), null);
+    ConstructorElement element = ElementFactory.constructorElement2(ElementFactory.classElement2(className), constructorName);
     fromNode.element = element;
-    ConstructorDeclaration toNode = AstFactory.constructorDeclaration(AstFactory.identifier3(className), constructorName, AstFactory.formalParameterList([]), null);
+    ConstructorDeclaration toNode = AstFactory.constructorDeclaration(AstFactory.identifier3(className), constructorName, AstFactory.formalParameterList(), null);
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.element, same(element));
   }
 
   void test_visitConstructorName() {
-    ConstructorName fromNode = AstFactory.constructorName(AstFactory.typeName4("A", []), "c");
-    ConstructorElement staticElement = ElementFactory.constructorElement2(ElementFactory.classElement2("A", []), "c", []);
+    ConstructorName fromNode = AstFactory.constructorName(AstFactory.typeName4("A"), "c");
+    ConstructorElement staticElement = ElementFactory.constructorElement2(ElementFactory.classElement2("A"), "c");
     fromNode.staticElement = staticElement;
-    ConstructorName toNode = AstFactory.constructorName(AstFactory.typeName4("A", []), "c");
+    ConstructorName toNode = AstFactory.constructorName(AstFactory.typeName4("A"), "c");
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.staticElement, same(staticElement));
   }
 
   void test_visitDoubleLiteral() {
     DoubleLiteral fromNode = AstFactory.doubleLiteral(1.0);
-    DartType propagatedType = ElementFactory.classElement2("C", []).type;
+    DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
-    DartType staticType = ElementFactory.classElement2("C", []).type;
+    DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
     DoubleLiteral toNode = AstFactory.doubleLiteral(1.0);
     ResolutionCopier.copyResolutionData(fromNode, toNode);
@@ -2994,23 +3070,23 @@
   }
 
   void test_visitExportDirective() {
-    ExportDirective fromNode = AstFactory.exportDirective2("dart:uri", []);
+    ExportDirective fromNode = AstFactory.exportDirective2("dart:uri");
     ExportElement element = new ExportElementImpl();
     fromNode.element = element;
-    ExportDirective toNode = AstFactory.exportDirective2("dart:uri", []);
+    ExportDirective toNode = AstFactory.exportDirective2("dart:uri");
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.element, same(element));
   }
 
   void test_visitFunctionExpression() {
-    FunctionExpression fromNode = AstFactory.functionExpression2(AstFactory.formalParameterList([]), AstFactory.emptyFunctionBody());
-    MethodElement element = ElementFactory.methodElement("m", ElementFactory.classElement2("C", []).type, []);
+    FunctionExpression fromNode = AstFactory.functionExpression2(AstFactory.formalParameterList(), AstFactory.emptyFunctionBody());
+    MethodElement element = ElementFactory.methodElement("m", ElementFactory.classElement2("C").type);
     fromNode.element = element;
-    DartType propagatedType = ElementFactory.classElement2("C", []).type;
+    DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
-    DartType staticType = ElementFactory.classElement2("C", []).type;
+    DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
-    FunctionExpression toNode = AstFactory.functionExpression2(AstFactory.formalParameterList([]), AstFactory.emptyFunctionBody());
+    FunctionExpression toNode = AstFactory.functionExpression2(AstFactory.formalParameterList(), AstFactory.emptyFunctionBody());
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.element, same(element));
     expect(toNode.propagatedType, same(propagatedType));
@@ -3018,16 +3094,16 @@
   }
 
   void test_visitFunctionExpressionInvocation() {
-    FunctionExpressionInvocation fromNode = AstFactory.functionExpressionInvocation(AstFactory.identifier3("f"), []);
-    MethodElement propagatedElement = ElementFactory.methodElement("m", ElementFactory.classElement2("C", []).type, []);
+    FunctionExpressionInvocation fromNode = AstFactory.functionExpressionInvocation(AstFactory.identifier3("f"));
+    MethodElement propagatedElement = ElementFactory.methodElement("m", ElementFactory.classElement2("C").type);
     fromNode.propagatedElement = propagatedElement;
-    DartType propagatedType = ElementFactory.classElement2("C", []).type;
+    DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
-    MethodElement staticElement = ElementFactory.methodElement("m", ElementFactory.classElement2("C", []).type, []);
+    MethodElement staticElement = ElementFactory.methodElement("m", ElementFactory.classElement2("C").type);
     fromNode.staticElement = staticElement;
-    DartType staticType = ElementFactory.classElement2("C", []).type;
+    DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
-    FunctionExpressionInvocation toNode = AstFactory.functionExpressionInvocation(AstFactory.identifier3("f"), []);
+    FunctionExpressionInvocation toNode = AstFactory.functionExpressionInvocation(AstFactory.identifier3("f"));
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.propagatedElement, same(propagatedElement));
     expect(toNode.propagatedType, same(propagatedType));
@@ -3036,25 +3112,25 @@
   }
 
   void test_visitImportDirective() {
-    ImportDirective fromNode = AstFactory.importDirective3("dart:uri", null, []);
+    ImportDirective fromNode = AstFactory.importDirective3("dart:uri", null);
     ImportElement element = new ImportElementImpl(0);
     fromNode.element = element;
-    ImportDirective toNode = AstFactory.importDirective3("dart:uri", null, []);
+    ImportDirective toNode = AstFactory.importDirective3("dart:uri", null);
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.element, same(element));
   }
 
   void test_visitIndexExpression() {
     IndexExpression fromNode = AstFactory.indexExpression(AstFactory.identifier3("a"), AstFactory.integer(0));
-    MethodElement propagatedElement = ElementFactory.methodElement("m", ElementFactory.classElement2("C", []).type, []);
-    MethodElement staticElement = ElementFactory.methodElement("m", ElementFactory.classElement2("C", []).type, []);
+    MethodElement propagatedElement = ElementFactory.methodElement("m", ElementFactory.classElement2("C").type);
+    MethodElement staticElement = ElementFactory.methodElement("m", ElementFactory.classElement2("C").type);
     AuxiliaryElements auxiliaryElements = new AuxiliaryElements(staticElement, propagatedElement);
     fromNode.auxiliaryElements = auxiliaryElements;
     fromNode.propagatedElement = propagatedElement;
-    DartType propagatedType = ElementFactory.classElement2("C", []).type;
+    DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
     fromNode.staticElement = staticElement;
-    DartType staticType = ElementFactory.classElement2("C", []).type;
+    DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
     IndexExpression toNode = AstFactory.indexExpression(AstFactory.identifier3("a"), AstFactory.integer(0));
     ResolutionCopier.copyResolutionData(fromNode, toNode);
@@ -3066,14 +3142,14 @@
   }
 
   void test_visitInstanceCreationExpression() {
-    InstanceCreationExpression fromNode = AstFactory.instanceCreationExpression2(Keyword.NEW, AstFactory.typeName4("C", []), []);
-    DartType propagatedType = ElementFactory.classElement2("C", []).type;
+    InstanceCreationExpression fromNode = AstFactory.instanceCreationExpression2(Keyword.NEW, AstFactory.typeName4("C"));
+    DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
-    ConstructorElement staticElement = ElementFactory.constructorElement2(ElementFactory.classElement2("C", []), null, []);
+    ConstructorElement staticElement = ElementFactory.constructorElement2(ElementFactory.classElement2("C"), null);
     fromNode.staticElement = staticElement;
-    DartType staticType = ElementFactory.classElement2("C", []).type;
+    DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
-    InstanceCreationExpression toNode = AstFactory.instanceCreationExpression2(Keyword.NEW, AstFactory.typeName4("C", []), []);
+    InstanceCreationExpression toNode = AstFactory.instanceCreationExpression2(Keyword.NEW, AstFactory.typeName4("C"));
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.propagatedType, same(propagatedType));
     expect(toNode.staticElement, same(staticElement));
@@ -3082,9 +3158,9 @@
 
   void test_visitIntegerLiteral() {
     IntegerLiteral fromNode = AstFactory.integer(2);
-    DartType propagatedType = ElementFactory.classElement2("C", []).type;
+    DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
-    DartType staticType = ElementFactory.classElement2("C", []).type;
+    DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
     IntegerLiteral toNode = AstFactory.integer(2);
     ResolutionCopier.copyResolutionData(fromNode, toNode);
@@ -3093,12 +3169,12 @@
   }
 
   void test_visitIsExpression() {
-    IsExpression fromNode = AstFactory.isExpression(AstFactory.identifier3("x"), false, AstFactory.typeName4("A", []));
-    DartType propagatedType = ElementFactory.classElement2("C", []).type;
+    IsExpression fromNode = AstFactory.isExpression(AstFactory.identifier3("x"), false, AstFactory.typeName4("A"));
+    DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
-    DartType staticType = ElementFactory.classElement2("C", []).type;
+    DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
-    IsExpression toNode = AstFactory.isExpression(AstFactory.identifier3("x"), false, AstFactory.typeName4("A", []));
+    IsExpression toNode = AstFactory.isExpression(AstFactory.identifier3("x"), false, AstFactory.typeName4("A"));
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.propagatedType, same(propagatedType));
     expect(toNode.staticType, same(staticType));
@@ -3106,9 +3182,9 @@
 
   void test_visitLibraryIdentifier() {
     LibraryIdentifier fromNode = AstFactory.libraryIdentifier([AstFactory.identifier3("lib")]);
-    DartType propagatedType = ElementFactory.classElement2("C", []).type;
+    DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
-    DartType staticType = ElementFactory.classElement2("C", []).type;
+    DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
     LibraryIdentifier toNode = AstFactory.libraryIdentifier([AstFactory.identifier3("lib")]);
     ResolutionCopier.copyResolutionData(fromNode, toNode);
@@ -3117,36 +3193,36 @@
   }
 
   void test_visitListLiteral() {
-    ListLiteral fromNode = AstFactory.listLiteral([]);
-    DartType propagatedType = ElementFactory.classElement2("C", []).type;
+    ListLiteral fromNode = AstFactory.listLiteral();
+    DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
-    DartType staticType = ElementFactory.classElement2("C", []).type;
+    DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
-    ListLiteral toNode = AstFactory.listLiteral([]);
+    ListLiteral toNode = AstFactory.listLiteral();
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.propagatedType, same(propagatedType));
     expect(toNode.staticType, same(staticType));
   }
 
   void test_visitMapLiteral() {
-    MapLiteral fromNode = AstFactory.mapLiteral2([]);
-    DartType propagatedType = ElementFactory.classElement2("C", []).type;
+    MapLiteral fromNode = AstFactory.mapLiteral2();
+    DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
-    DartType staticType = ElementFactory.classElement2("C", []).type;
+    DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
-    MapLiteral toNode = AstFactory.mapLiteral2([]);
+    MapLiteral toNode = AstFactory.mapLiteral2();
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.propagatedType, same(propagatedType));
     expect(toNode.staticType, same(staticType));
   }
 
   void test_visitMethodInvocation() {
-    MethodInvocation fromNode = AstFactory.methodInvocation2("m", []);
-    DartType propagatedType = ElementFactory.classElement2("C", []).type;
+    MethodInvocation fromNode = AstFactory.methodInvocation2("m");
+    DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
-    DartType staticType = ElementFactory.classElement2("C", []).type;
+    DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
-    MethodInvocation toNode = AstFactory.methodInvocation2("m", []);
+    MethodInvocation toNode = AstFactory.methodInvocation2("m");
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.propagatedType, same(propagatedType));
     expect(toNode.staticType, same(staticType));
@@ -3154,9 +3230,9 @@
 
   void test_visitNamedExpression() {
     NamedExpression fromNode = AstFactory.namedExpression2("n", AstFactory.integer(0));
-    DartType propagatedType = ElementFactory.classElement2("C", []).type;
+    DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
-    DartType staticType = ElementFactory.classElement2("C", []).type;
+    DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
     NamedExpression toNode = AstFactory.namedExpression2("n", AstFactory.integer(0));
     ResolutionCopier.copyResolutionData(fromNode, toNode);
@@ -3166,9 +3242,9 @@
 
   void test_visitNullLiteral() {
     NullLiteral fromNode = AstFactory.nullLiteral();
-    DartType propagatedType = ElementFactory.classElement2("C", []).type;
+    DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
-    DartType staticType = ElementFactory.classElement2("C", []).type;
+    DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
     NullLiteral toNode = AstFactory.nullLiteral();
     ResolutionCopier.copyResolutionData(fromNode, toNode);
@@ -3178,9 +3254,9 @@
 
   void test_visitParenthesizedExpression() {
     ParenthesizedExpression fromNode = AstFactory.parenthesizedExpression(AstFactory.integer(0));
-    DartType propagatedType = ElementFactory.classElement2("C", []).type;
+    DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
-    DartType staticType = ElementFactory.classElement2("C", []).type;
+    DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
     ParenthesizedExpression toNode = AstFactory.parenthesizedExpression(AstFactory.integer(0));
     ResolutionCopier.copyResolutionData(fromNode, toNode);
@@ -3209,13 +3285,13 @@
   void test_visitPostfixExpression() {
     String variableName = "x";
     PostfixExpression fromNode = AstFactory.postfixExpression(AstFactory.identifier3(variableName), TokenType.PLUS_PLUS);
-    MethodElement propagatedElement = ElementFactory.methodElement("+", ElementFactory.classElement2("C", []).type, []);
+    MethodElement propagatedElement = ElementFactory.methodElement("+", ElementFactory.classElement2("C").type);
     fromNode.propagatedElement = propagatedElement;
-    DartType propagatedType = ElementFactory.classElement2("C", []).type;
+    DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
-    MethodElement staticElement = ElementFactory.methodElement("+", ElementFactory.classElement2("C", []).type, []);
+    MethodElement staticElement = ElementFactory.methodElement("+", ElementFactory.classElement2("C").type);
     fromNode.staticElement = staticElement;
-    DartType staticType = ElementFactory.classElement2("C", []).type;
+    DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
     PostfixExpression toNode = AstFactory.postfixExpression(AstFactory.identifier3(variableName), TokenType.PLUS_PLUS);
     ResolutionCopier.copyResolutionData(fromNode, toNode);
@@ -3227,9 +3303,9 @@
 
   void test_visitPrefixedIdentifier() {
     PrefixedIdentifier fromNode = AstFactory.identifier5("p", "f");
-    DartType propagatedType = ElementFactory.classElement2("C", []).type;
+    DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
-    DartType staticType = ElementFactory.classElement2("C", []).type;
+    DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
     PrefixedIdentifier toNode = AstFactory.identifier5("p", "f");
     ResolutionCopier.copyResolutionData(fromNode, toNode);
@@ -3239,12 +3315,12 @@
 
   void test_visitPrefixExpression() {
     PrefixExpression fromNode = AstFactory.prefixExpression(TokenType.PLUS_PLUS, AstFactory.identifier3("x"));
-    MethodElement propagatedElement = ElementFactory.methodElement("+", ElementFactory.classElement2("C", []).type, []);
-    DartType propagatedType = ElementFactory.classElement2("C", []).type;
+    MethodElement propagatedElement = ElementFactory.methodElement("+", ElementFactory.classElement2("C").type);
+    DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedElement = propagatedElement;
     fromNode.propagatedType = propagatedType;
-    DartType staticType = ElementFactory.classElement2("C", []).type;
-    MethodElement staticElement = ElementFactory.methodElement("+", ElementFactory.classElement2("C", []).type, []);
+    DartType staticType = ElementFactory.classElement2("C").type;
+    MethodElement staticElement = ElementFactory.methodElement("+", ElementFactory.classElement2("C").type);
     fromNode.staticElement = staticElement;
     fromNode.staticType = staticType;
     PrefixExpression toNode = AstFactory.prefixExpression(TokenType.PLUS_PLUS, AstFactory.identifier3("x"));
@@ -3257,9 +3333,9 @@
 
   void test_visitPropertyAccess() {
     PropertyAccess fromNode = AstFactory.propertyAccess2(AstFactory.identifier3("x"), "y");
-    DartType propagatedType = ElementFactory.classElement2("C", []).type;
+    DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
-    DartType staticType = ElementFactory.classElement2("C", []).type;
+    DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
     PropertyAccess toNode = AstFactory.propertyAccess2(AstFactory.identifier3("x"), "y");
     ResolutionCopier.copyResolutionData(fromNode, toNode);
@@ -3268,19 +3344,19 @@
   }
 
   void test_visitRedirectingConstructorInvocation() {
-    RedirectingConstructorInvocation fromNode = AstFactory.redirectingConstructorInvocation([]);
-    ConstructorElement staticElement = ElementFactory.constructorElement2(ElementFactory.classElement2("C", []), null, []);
+    RedirectingConstructorInvocation fromNode = AstFactory.redirectingConstructorInvocation();
+    ConstructorElement staticElement = ElementFactory.constructorElement2(ElementFactory.classElement2("C"), null);
     fromNode.staticElement = staticElement;
-    RedirectingConstructorInvocation toNode = AstFactory.redirectingConstructorInvocation([]);
+    RedirectingConstructorInvocation toNode = AstFactory.redirectingConstructorInvocation();
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.staticElement, same(staticElement));
   }
 
   void test_visitRethrowExpression() {
     RethrowExpression fromNode = AstFactory.rethrowExpression();
-    DartType propagatedType = ElementFactory.classElement2("C", []).type;
+    DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
-    DartType staticType = ElementFactory.classElement2("C", []).type;
+    DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
     RethrowExpression toNode = AstFactory.rethrowExpression();
     ResolutionCopier.copyResolutionData(fromNode, toNode);
@@ -3290,15 +3366,15 @@
 
   void test_visitSimpleIdentifier() {
     SimpleIdentifier fromNode = AstFactory.identifier3("x");
-    MethodElement propagatedElement = ElementFactory.methodElement("m", ElementFactory.classElement2("C", []).type, []);
-    MethodElement staticElement = ElementFactory.methodElement("m", ElementFactory.classElement2("C", []).type, []);
+    MethodElement propagatedElement = ElementFactory.methodElement("m", ElementFactory.classElement2("C").type);
+    MethodElement staticElement = ElementFactory.methodElement("m", ElementFactory.classElement2("C").type);
     AuxiliaryElements auxiliaryElements = new AuxiliaryElements(staticElement, propagatedElement);
     fromNode.auxiliaryElements = auxiliaryElements;
     fromNode.propagatedElement = propagatedElement;
-    DartType propagatedType = ElementFactory.classElement2("C", []).type;
+    DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
     fromNode.staticElement = staticElement;
-    DartType staticType = ElementFactory.classElement2("C", []).type;
+    DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
     SimpleIdentifier toNode = AstFactory.identifier3("x");
     ResolutionCopier.copyResolutionData(fromNode, toNode);
@@ -3311,9 +3387,9 @@
 
   void test_visitSimpleStringLiteral() {
     SimpleStringLiteral fromNode = AstFactory.string2("abc");
-    DartType propagatedType = ElementFactory.classElement2("C", []).type;
+    DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
-    DartType staticType = ElementFactory.classElement2("C", []).type;
+    DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
     SimpleStringLiteral toNode = AstFactory.string2("abc");
     ResolutionCopier.copyResolutionData(fromNode, toNode);
@@ -3323,9 +3399,9 @@
 
   void test_visitStringInterpolation() {
     StringInterpolation fromNode = AstFactory.string([AstFactory.interpolationString("a", "'a'")]);
-    DartType propagatedType = ElementFactory.classElement2("C", []).type;
+    DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
-    DartType staticType = ElementFactory.classElement2("C", []).type;
+    DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
     StringInterpolation toNode = AstFactory.string([AstFactory.interpolationString("a", "'a'")]);
     ResolutionCopier.copyResolutionData(fromNode, toNode);
@@ -3334,19 +3410,19 @@
   }
 
   void test_visitSuperConstructorInvocation() {
-    SuperConstructorInvocation fromNode = AstFactory.superConstructorInvocation([]);
-    ConstructorElement staticElement = ElementFactory.constructorElement2(ElementFactory.classElement2("C", []), null, []);
+    SuperConstructorInvocation fromNode = AstFactory.superConstructorInvocation();
+    ConstructorElement staticElement = ElementFactory.constructorElement2(ElementFactory.classElement2("C"), null);
     fromNode.staticElement = staticElement;
-    SuperConstructorInvocation toNode = AstFactory.superConstructorInvocation([]);
+    SuperConstructorInvocation toNode = AstFactory.superConstructorInvocation();
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.staticElement, same(staticElement));
   }
 
   void test_visitSuperExpression() {
     SuperExpression fromNode = AstFactory.superExpression();
-    DartType propagatedType = ElementFactory.classElement2("C", []).type;
+    DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
-    DartType staticType = ElementFactory.classElement2("C", []).type;
+    DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
     SuperExpression toNode = AstFactory.superExpression();
     ResolutionCopier.copyResolutionData(fromNode, toNode);
@@ -3356,9 +3432,9 @@
 
   void test_visitSymbolLiteral() {
     SymbolLiteral fromNode = AstFactory.symbolLiteral(["s"]);
-    DartType propagatedType = ElementFactory.classElement2("C", []).type;
+    DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
-    DartType staticType = ElementFactory.classElement2("C", []).type;
+    DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
     SymbolLiteral toNode = AstFactory.symbolLiteral(["s"]);
     ResolutionCopier.copyResolutionData(fromNode, toNode);
@@ -3368,9 +3444,9 @@
 
   void test_visitThisExpression() {
     ThisExpression fromNode = AstFactory.thisExpression();
-    DartType propagatedType = ElementFactory.classElement2("C", []).type;
+    DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
-    DartType staticType = ElementFactory.classElement2("C", []).type;
+    DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
     ThisExpression toNode = AstFactory.thisExpression();
     ResolutionCopier.copyResolutionData(fromNode, toNode);
@@ -3380,9 +3456,9 @@
 
   void test_visitThrowExpression() {
     ThrowExpression fromNode = AstFactory.throwExpression();
-    DartType propagatedType = ElementFactory.classElement2("C", []).type;
+    DartType propagatedType = ElementFactory.classElement2("C").type;
     fromNode.propagatedType = propagatedType;
-    DartType staticType = ElementFactory.classElement2("C", []).type;
+    DartType staticType = ElementFactory.classElement2("C").type;
     fromNode.staticType = staticType;
     ThrowExpression toNode = AstFactory.throwExpression();
     ResolutionCopier.copyResolutionData(fromNode, toNode);
@@ -3391,10 +3467,10 @@
   }
 
   void test_visitTypeName() {
-    TypeName fromNode = AstFactory.typeName4("C", []);
-    DartType type = ElementFactory.classElement2("C", []).type;
+    TypeName fromNode = AstFactory.typeName4("C");
+    DartType type = ElementFactory.classElement2("C").type;
     fromNode.type = type;
-    TypeName toNode = AstFactory.typeName4("C", []);
+    TypeName toNode = AstFactory.typeName4("C");
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.type, same(type));
   }
@@ -3513,31 +3589,31 @@
   }
 
   void test_function_literal_allowed_at_toplevel() {
-    ParserTestCase.parseCompilationUnit("var x = () {};", []);
+    ParserTestCase.parseCompilationUnit("var x = () {};");
   }
 
   void test_function_literal_allowed_in_ArgumentList_in_ConstructorFieldInitializer() {
-    ParserTestCase.parseCompilationUnit("class C { C() : a = f(() {}); }", []);
+    ParserTestCase.parseCompilationUnit("class C { C() : a = f(() {}); }");
   }
 
   void test_function_literal_allowed_in_IndexExpression_in_ConstructorFieldInitializer() {
-    ParserTestCase.parseCompilationUnit("class C { C() : a = x[() {}]; }", []);
+    ParserTestCase.parseCompilationUnit("class C { C() : a = x[() {}]; }");
   }
 
   void test_function_literal_allowed_in_ListLiteral_in_ConstructorFieldInitializer() {
-    ParserTestCase.parseCompilationUnit("class C { C() : a = [() {}]; }", []);
+    ParserTestCase.parseCompilationUnit("class C { C() : a = [() {}]; }");
   }
 
   void test_function_literal_allowed_in_MapLiteral_in_ConstructorFieldInitializer() {
-    ParserTestCase.parseCompilationUnit("class C { C() : a = {'key': () {}}; }", []);
+    ParserTestCase.parseCompilationUnit("class C { C() : a = {'key': () {}}; }");
   }
 
   void test_function_literal_allowed_in_ParenthesizedExpression_in_ConstructorFieldInitializer() {
-    ParserTestCase.parseCompilationUnit("class C { C() : a = (() {}); }", []);
+    ParserTestCase.parseCompilationUnit("class C { C() : a = (() {}); }");
   }
 
   void test_function_literal_allowed_in_StringInterpolation_in_ConstructorFieldInitializer() {
-    ParserTestCase.parseCompilationUnit("class C { C() : a = \"\${(){}}\"; }", []);
+    ParserTestCase.parseCompilationUnit("class C { C() : a = \"\${(){}}\"; }");
   }
 
   void test_isFunctionDeclaration_nameButNoReturn_block() {
@@ -3702,7 +3778,7 @@
   }
 
   void test_parseAdditiveExpression_normal() {
-    BinaryExpression expression = ParserTestCase.parse4("parseAdditiveExpression", "x + y", []);
+    BinaryExpression expression = ParserTestCase.parse4("parseAdditiveExpression", "x + y");
     expect(expression.leftOperand, isNotNull);
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.PLUS);
@@ -3710,7 +3786,7 @@
   }
 
   void test_parseAdditiveExpression_super() {
-    BinaryExpression expression = ParserTestCase.parse4("parseAdditiveExpression", "super + y", []);
+    BinaryExpression expression = ParserTestCase.parse4("parseAdditiveExpression", "super + y");
     EngineTestCase.assertInstanceOf((obj) => obj is SuperExpression, SuperExpression, expression.leftOperand);
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.PLUS);
@@ -3718,7 +3794,7 @@
   }
 
   void test_parseAnnotation_n1() {
-    Annotation annotation = ParserTestCase.parse4("parseAnnotation", "@A", []);
+    Annotation annotation = ParserTestCase.parse4("parseAnnotation", "@A");
     expect(annotation.atSign, isNotNull);
     expect(annotation.name, isNotNull);
     expect(annotation.period, isNull);
@@ -3727,7 +3803,7 @@
   }
 
   void test_parseAnnotation_n1_a() {
-    Annotation annotation = ParserTestCase.parse4("parseAnnotation", "@A(x,y)", []);
+    Annotation annotation = ParserTestCase.parse4("parseAnnotation", "@A(x,y)");
     expect(annotation.atSign, isNotNull);
     expect(annotation.name, isNotNull);
     expect(annotation.period, isNull);
@@ -3736,7 +3812,7 @@
   }
 
   void test_parseAnnotation_n2() {
-    Annotation annotation = ParserTestCase.parse4("parseAnnotation", "@A.B", []);
+    Annotation annotation = ParserTestCase.parse4("parseAnnotation", "@A.B");
     expect(annotation.atSign, isNotNull);
     expect(annotation.name, isNotNull);
     expect(annotation.period, isNull);
@@ -3745,7 +3821,7 @@
   }
 
   void test_parseAnnotation_n2_a() {
-    Annotation annotation = ParserTestCase.parse4("parseAnnotation", "@A.B(x,y)", []);
+    Annotation annotation = ParserTestCase.parse4("parseAnnotation", "@A.B(x,y)");
     expect(annotation.atSign, isNotNull);
     expect(annotation.name, isNotNull);
     expect(annotation.period, isNull);
@@ -3754,7 +3830,7 @@
   }
 
   void test_parseAnnotation_n3() {
-    Annotation annotation = ParserTestCase.parse4("parseAnnotation", "@A.B.C", []);
+    Annotation annotation = ParserTestCase.parse4("parseAnnotation", "@A.B.C");
     expect(annotation.atSign, isNotNull);
     expect(annotation.name, isNotNull);
     expect(annotation.period, isNotNull);
@@ -3763,7 +3839,7 @@
   }
 
   void test_parseAnnotation_n3_a() {
-    Annotation annotation = ParserTestCase.parse4("parseAnnotation", "@A.B.C(x,y)", []);
+    Annotation annotation = ParserTestCase.parse4("parseAnnotation", "@A.B.C(x,y)");
     expect(annotation.atSign, isNotNull);
     expect(annotation.name, isNotNull);
     expect(annotation.period, isNotNull);
@@ -3772,7 +3848,7 @@
   }
 
   void test_parseArgument_named() {
-    NamedExpression expression = ParserTestCase.parse4("parseArgument", "n: x", []);
+    NamedExpression expression = ParserTestCase.parse4("parseArgument", "n: x");
     Label name = expression.name;
     expect(name, isNotNull);
     expect(name.label, isNotNull);
@@ -3782,36 +3858,36 @@
 
   void test_parseArgument_unnamed() {
     String lexeme = "x";
-    SimpleIdentifier identifier = ParserTestCase.parse4("parseArgument", lexeme, []);
+    SimpleIdentifier identifier = ParserTestCase.parse4("parseArgument", lexeme);
     expect(identifier.name, lexeme);
   }
 
   void test_parseArgumentList_empty() {
-    ArgumentList argumentList = ParserTestCase.parse4("parseArgumentList", "()", []);
+    ArgumentList argumentList = ParserTestCase.parse4("parseArgumentList", "()");
     NodeList<Expression> arguments = argumentList.arguments;
     expect(arguments, hasLength(0));
   }
 
   void test_parseArgumentList_mixed() {
-    ArgumentList argumentList = ParserTestCase.parse4("parseArgumentList", "(w, x, y: y, z: z)", []);
+    ArgumentList argumentList = ParserTestCase.parse4("parseArgumentList", "(w, x, y: y, z: z)");
     NodeList<Expression> arguments = argumentList.arguments;
     expect(arguments, hasLength(4));
   }
 
   void test_parseArgumentList_noNamed() {
-    ArgumentList argumentList = ParserTestCase.parse4("parseArgumentList", "(x, y, z)", []);
+    ArgumentList argumentList = ParserTestCase.parse4("parseArgumentList", "(x, y, z)");
     NodeList<Expression> arguments = argumentList.arguments;
     expect(arguments, hasLength(3));
   }
 
   void test_parseArgumentList_onlyNamed() {
-    ArgumentList argumentList = ParserTestCase.parse4("parseArgumentList", "(x: x, y: y)", []);
+    ArgumentList argumentList = ParserTestCase.parse4("parseArgumentList", "(x: x, y: y)");
     NodeList<Expression> arguments = argumentList.arguments;
     expect(arguments, hasLength(2));
   }
 
   void test_parseAssertStatement() {
-    AssertStatement statement = ParserTestCase.parse4("parseAssertStatement", "assert (x);", []);
+    AssertStatement statement = ParserTestCase.parse4("parseAssertStatement", "assert (x);");
     expect(statement.keyword, isNotNull);
     expect(statement.leftParenthesis, isNotNull);
     expect(statement.condition, isNotNull);
@@ -3910,7 +3986,7 @@
   }
 
   void test_parseAwaitExpression() {
-    AwaitExpression expression = ParserTestCase.parse4("parseAwaitExpression", "await x;", []);
+    AwaitExpression expression = ParserTestCase.parse4("parseAwaitExpression", "await x;");
     expect(expression.awaitKeyword, isNotNull);
     expect(expression.expression, isNotNull);
   }
@@ -3948,7 +4024,7 @@
   }
 
   void test_parseBitwiseAndExpression_normal() {
-    BinaryExpression expression = ParserTestCase.parse4("parseBitwiseAndExpression", "x & y", []);
+    BinaryExpression expression = ParserTestCase.parse4("parseBitwiseAndExpression", "x & y");
     expect(expression.leftOperand, isNotNull);
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.AMPERSAND);
@@ -3956,7 +4032,7 @@
   }
 
   void test_parseBitwiseAndExpression_super() {
-    BinaryExpression expression = ParserTestCase.parse4("parseBitwiseAndExpression", "super & y", []);
+    BinaryExpression expression = ParserTestCase.parse4("parseBitwiseAndExpression", "super & y");
     EngineTestCase.assertInstanceOf((obj) => obj is SuperExpression, SuperExpression, expression.leftOperand);
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.AMPERSAND);
@@ -3964,7 +4040,7 @@
   }
 
   void test_parseBitwiseOrExpression_normal() {
-    BinaryExpression expression = ParserTestCase.parse4("parseBitwiseOrExpression", "x | y", []);
+    BinaryExpression expression = ParserTestCase.parse4("parseBitwiseOrExpression", "x | y");
     expect(expression.leftOperand, isNotNull);
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.BAR);
@@ -3972,7 +4048,7 @@
   }
 
   void test_parseBitwiseOrExpression_super() {
-    BinaryExpression expression = ParserTestCase.parse4("parseBitwiseOrExpression", "super | y", []);
+    BinaryExpression expression = ParserTestCase.parse4("parseBitwiseOrExpression", "super | y");
     EngineTestCase.assertInstanceOf((obj) => obj is SuperExpression, SuperExpression, expression.leftOperand);
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.BAR);
@@ -3980,7 +4056,7 @@
   }
 
   void test_parseBitwiseXorExpression_normal() {
-    BinaryExpression expression = ParserTestCase.parse4("parseBitwiseXorExpression", "x ^ y", []);
+    BinaryExpression expression = ParserTestCase.parse4("parseBitwiseXorExpression", "x ^ y");
     expect(expression.leftOperand, isNotNull);
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.CARET);
@@ -3988,7 +4064,7 @@
   }
 
   void test_parseBitwiseXorExpression_super() {
-    BinaryExpression expression = ParserTestCase.parse4("parseBitwiseXorExpression", "super ^ y", []);
+    BinaryExpression expression = ParserTestCase.parse4("parseBitwiseXorExpression", "super ^ y");
     EngineTestCase.assertInstanceOf((obj) => obj is SuperExpression, SuperExpression, expression.leftOperand);
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.CARET);
@@ -3996,21 +4072,21 @@
   }
 
   void test_parseBlock_empty() {
-    Block block = ParserTestCase.parse4("parseBlock", "{}", []);
+    Block block = ParserTestCase.parse4("parseBlock", "{}");
     expect(block.leftBracket, isNotNull);
     expect(block.statements, hasLength(0));
     expect(block.rightBracket, isNotNull);
   }
 
   void test_parseBlock_nonEmpty() {
-    Block block = ParserTestCase.parse4("parseBlock", "{;}", []);
+    Block block = ParserTestCase.parse4("parseBlock", "{;}");
     expect(block.leftBracket, isNotNull);
     expect(block.statements, hasLength(1));
     expect(block.rightBracket, isNotNull);
   }
 
   void test_parseBreakStatement_label() {
-    BreakStatement statement = ParserTestCase.parse4("parseBreakStatement", "break foo;", []);
+    BreakStatement statement = ParserTestCase.parse4("parseBreakStatement", "break foo;");
     expect(statement.keyword, isNotNull);
     expect(statement.label, isNotNull);
     expect(statement.semicolon, isNotNull);
@@ -4024,7 +4100,7 @@
   }
 
   void test_parseCascadeSection_i() {
-    IndexExpression section = ParserTestCase.parse4("parseCascadeSection", "..[i]", []);
+    IndexExpression section = ParserTestCase.parse4("parseCascadeSection", "..[i]");
     expect(section.target, isNull);
     expect(section.leftBracket, isNotNull);
     expect(section.index, isNotNull);
@@ -4032,13 +4108,13 @@
   }
 
   void test_parseCascadeSection_ia() {
-    FunctionExpressionInvocation section = ParserTestCase.parse4("parseCascadeSection", "..[i](b)", []);
+    FunctionExpressionInvocation section = ParserTestCase.parse4("parseCascadeSection", "..[i](b)");
     EngineTestCase.assertInstanceOf((obj) => obj is IndexExpression, IndexExpression, section.function);
     expect(section.argumentList, isNotNull);
   }
 
   void test_parseCascadeSection_ii() {
-    MethodInvocation section = ParserTestCase.parse4("parseCascadeSection", "..a(b).c(d)", []);
+    MethodInvocation section = ParserTestCase.parse4("parseCascadeSection", "..a(b).c(d)");
     EngineTestCase.assertInstanceOf((obj) => obj is MethodInvocation, MethodInvocation, section.target);
     expect(section.period, isNotNull);
     expect(section.methodName, isNotNull);
@@ -4047,14 +4123,14 @@
   }
 
   void test_parseCascadeSection_p() {
-    PropertyAccess section = ParserTestCase.parse4("parseCascadeSection", "..a", []);
+    PropertyAccess section = ParserTestCase.parse4("parseCascadeSection", "..a");
     expect(section.target, isNull);
     expect(section.operator, isNotNull);
     expect(section.propertyName, isNotNull);
   }
 
   void test_parseCascadeSection_p_assign() {
-    AssignmentExpression section = ParserTestCase.parse4("parseCascadeSection", "..a = 3", []);
+    AssignmentExpression section = ParserTestCase.parse4("parseCascadeSection", "..a = 3");
     expect(section.leftHandSide, isNotNull);
     expect(section.operator, isNotNull);
     Expression rhs = section.rightHandSide;
@@ -4062,7 +4138,7 @@
   }
 
   void test_parseCascadeSection_p_assign_withCascade() {
-    AssignmentExpression section = ParserTestCase.parse4("parseCascadeSection", "..a = 3..m()", []);
+    AssignmentExpression section = ParserTestCase.parse4("parseCascadeSection", "..a = 3..m()");
     expect(section.leftHandSide, isNotNull);
     expect(section.operator, isNotNull);
     Expression rhs = section.rightHandSide;
@@ -4070,14 +4146,14 @@
   }
 
   void test_parseCascadeSection_p_builtIn() {
-    PropertyAccess section = ParserTestCase.parse4("parseCascadeSection", "..as", []);
+    PropertyAccess section = ParserTestCase.parse4("parseCascadeSection", "..as");
     expect(section.target, isNull);
     expect(section.operator, isNotNull);
     expect(section.propertyName, isNotNull);
   }
 
   void test_parseCascadeSection_pa() {
-    MethodInvocation section = ParserTestCase.parse4("parseCascadeSection", "..a(b)", []);
+    MethodInvocation section = ParserTestCase.parse4("parseCascadeSection", "..a(b)");
     expect(section.target, isNull);
     expect(section.period, isNotNull);
     expect(section.methodName, isNotNull);
@@ -4086,21 +4162,21 @@
   }
 
   void test_parseCascadeSection_paa() {
-    FunctionExpressionInvocation section = ParserTestCase.parse4("parseCascadeSection", "..a(b)(c)", []);
+    FunctionExpressionInvocation section = ParserTestCase.parse4("parseCascadeSection", "..a(b)(c)");
     EngineTestCase.assertInstanceOf((obj) => obj is MethodInvocation, MethodInvocation, section.function);
     expect(section.argumentList, isNotNull);
     expect(section.argumentList.arguments, hasLength(1));
   }
 
   void test_parseCascadeSection_paapaa() {
-    FunctionExpressionInvocation section = ParserTestCase.parse4("parseCascadeSection", "..a(b)(c).d(e)(f)", []);
+    FunctionExpressionInvocation section = ParserTestCase.parse4("parseCascadeSection", "..a(b)(c).d(e)(f)");
     EngineTestCase.assertInstanceOf((obj) => obj is MethodInvocation, MethodInvocation, section.function);
     expect(section.argumentList, isNotNull);
     expect(section.argumentList.arguments, hasLength(1));
   }
 
   void test_parseCascadeSection_pap() {
-    PropertyAccess section = ParserTestCase.parse4("parseCascadeSection", "..a(b).c", []);
+    PropertyAccess section = ParserTestCase.parse4("parseCascadeSection", "..a(b).c");
     expect(section.target, isNotNull);
     expect(section.operator, isNotNull);
     expect(section.propertyName, isNotNull);
@@ -4630,7 +4706,7 @@
   }
 
   void test_parseCombinators_h() {
-    List<Combinator> combinators = ParserTestCase.parse4("parseCombinators", "hide a;", []);
+    List<Combinator> combinators = ParserTestCase.parse4("parseCombinators", "hide a;");
     expect(combinators, hasLength(1));
     HideCombinator combinator = combinators[0] as HideCombinator;
     expect(combinator, isNotNull);
@@ -4639,7 +4715,7 @@
   }
 
   void test_parseCombinators_hs() {
-    List<Combinator> combinators = ParserTestCase.parse4("parseCombinators", "hide a show b;", []);
+    List<Combinator> combinators = ParserTestCase.parse4("parseCombinators", "hide a show b;");
     expect(combinators, hasLength(2));
     HideCombinator hideCombinator = combinators[0] as HideCombinator;
     expect(hideCombinator, isNotNull);
@@ -4652,12 +4728,12 @@
   }
 
   void test_parseCombinators_hshs() {
-    List<Combinator> combinators = ParserTestCase.parse4("parseCombinators", "hide a show b hide c show d;", []);
+    List<Combinator> combinators = ParserTestCase.parse4("parseCombinators", "hide a show b hide c show d;");
     expect(combinators, hasLength(4));
   }
 
   void test_parseCombinators_s() {
-    List<Combinator> combinators = ParserTestCase.parse4("parseCombinators", "show a;", []);
+    List<Combinator> combinators = ParserTestCase.parse4("parseCombinators", "show a;");
     expect(combinators, hasLength(1));
     ShowCombinator combinator = combinators[0] as ShowCombinator;
     expect(combinator, isNotNull);
@@ -4666,55 +4742,55 @@
   }
 
   void test_parseCommentAndMetadata_c() {
-    CommentAndMetadata commentAndMetadata = ParserTestCase.parse4("parseCommentAndMetadata", "/** 1 */ void", []);
+    CommentAndMetadata commentAndMetadata = ParserTestCase.parse4("parseCommentAndMetadata", "/** 1 */ void");
     expect(commentAndMetadata.comment, isNotNull);
     expect(commentAndMetadata.metadata, hasLength(0));
   }
 
   void test_parseCommentAndMetadata_cmc() {
-    CommentAndMetadata commentAndMetadata = ParserTestCase.parse4("parseCommentAndMetadata", "/** 1 */ @A /** 2 */ void", []);
+    CommentAndMetadata commentAndMetadata = ParserTestCase.parse4("parseCommentAndMetadata", "/** 1 */ @A /** 2 */ void");
     expect(commentAndMetadata.comment, isNotNull);
     expect(commentAndMetadata.metadata, hasLength(1));
   }
 
   void test_parseCommentAndMetadata_cmcm() {
-    CommentAndMetadata commentAndMetadata = ParserTestCase.parse4("parseCommentAndMetadata", "/** 1 */ @A /** 2 */ @B void", []);
+    CommentAndMetadata commentAndMetadata = ParserTestCase.parse4("parseCommentAndMetadata", "/** 1 */ @A /** 2 */ @B void");
     expect(commentAndMetadata.comment, isNotNull);
     expect(commentAndMetadata.metadata, hasLength(2));
   }
 
   void test_parseCommentAndMetadata_cmm() {
-    CommentAndMetadata commentAndMetadata = ParserTestCase.parse4("parseCommentAndMetadata", "/** 1 */ @A @B void", []);
+    CommentAndMetadata commentAndMetadata = ParserTestCase.parse4("parseCommentAndMetadata", "/** 1 */ @A @B void");
     expect(commentAndMetadata.comment, isNotNull);
     expect(commentAndMetadata.metadata, hasLength(2));
   }
 
   void test_parseCommentAndMetadata_m() {
-    CommentAndMetadata commentAndMetadata = ParserTestCase.parse4("parseCommentAndMetadata", "@A void", []);
+    CommentAndMetadata commentAndMetadata = ParserTestCase.parse4("parseCommentAndMetadata", "@A void");
     expect(commentAndMetadata.comment, isNull);
     expect(commentAndMetadata.metadata, hasLength(1));
   }
 
   void test_parseCommentAndMetadata_mcm() {
-    CommentAndMetadata commentAndMetadata = ParserTestCase.parse4("parseCommentAndMetadata", "@A /** 1 */ @B void", []);
+    CommentAndMetadata commentAndMetadata = ParserTestCase.parse4("parseCommentAndMetadata", "@A /** 1 */ @B void");
     expect(commentAndMetadata.comment, isNotNull);
     expect(commentAndMetadata.metadata, hasLength(2));
   }
 
   void test_parseCommentAndMetadata_mcmc() {
-    CommentAndMetadata commentAndMetadata = ParserTestCase.parse4("parseCommentAndMetadata", "@A /** 1 */ @B /** 2 */ void", []);
+    CommentAndMetadata commentAndMetadata = ParserTestCase.parse4("parseCommentAndMetadata", "@A /** 1 */ @B /** 2 */ void");
     expect(commentAndMetadata.comment, isNotNull);
     expect(commentAndMetadata.metadata, hasLength(2));
   }
 
   void test_parseCommentAndMetadata_mm() {
-    CommentAndMetadata commentAndMetadata = ParserTestCase.parse4("parseCommentAndMetadata", "@A @B(x) void", []);
+    CommentAndMetadata commentAndMetadata = ParserTestCase.parse4("parseCommentAndMetadata", "@A @B(x) void");
     expect(commentAndMetadata.comment, isNull);
     expect(commentAndMetadata.metadata, hasLength(2));
   }
 
   void test_parseCommentAndMetadata_none() {
-    CommentAndMetadata commentAndMetadata = ParserTestCase.parse4("parseCommentAndMetadata", "void", []);
+    CommentAndMetadata commentAndMetadata = ParserTestCase.parse4("parseCommentAndMetadata", "void");
     expect(commentAndMetadata.comment, isNull);
     expect(commentAndMetadata.metadata, hasLength(0));
   }
@@ -4723,7 +4799,7 @@
     CommentAndMetadata commentAndMetadata = ParserTestCase.parse4("parseCommentAndMetadata", r'''
 /// 1
 /// 2
-void''', []);
+void''');
     expect(commentAndMetadata.comment, isNotNull);
     expect(commentAndMetadata.metadata, hasLength(0));
   }
@@ -4889,74 +4965,74 @@
   }
 
   void test_parseCompilationUnit_abstractAsPrefix_parameterized() {
-    CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "abstract<dynamic> _abstract = new abstract.A();", []);
+    CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "abstract<dynamic> _abstract = new abstract.A();");
     expect(unit.scriptTag, isNull);
     expect(unit.directives, hasLength(0));
     expect(unit.declarations, hasLength(1));
   }
 
   void test_parseCompilationUnit_builtIn_asFunctionName() {
-    ParserTestCase.parse4("parseCompilationUnit", "abstract(x) => 0;", []);
-    ParserTestCase.parse4("parseCompilationUnit", "as(x) => 0;", []);
-    ParserTestCase.parse4("parseCompilationUnit", "dynamic(x) => 0;", []);
-    ParserTestCase.parse4("parseCompilationUnit", "export(x) => 0;", []);
-    ParserTestCase.parse4("parseCompilationUnit", "external(x) => 0;", []);
-    ParserTestCase.parse4("parseCompilationUnit", "factory(x) => 0;", []);
-    ParserTestCase.parse4("parseCompilationUnit", "get(x) => 0;", []);
-    ParserTestCase.parse4("parseCompilationUnit", "implements(x) => 0;", []);
-    ParserTestCase.parse4("parseCompilationUnit", "import(x) => 0;", []);
-    ParserTestCase.parse4("parseCompilationUnit", "library(x) => 0;", []);
-    ParserTestCase.parse4("parseCompilationUnit", "operator(x) => 0;", []);
-    ParserTestCase.parse4("parseCompilationUnit", "part(x) => 0;", []);
-    ParserTestCase.parse4("parseCompilationUnit", "set(x) => 0;", []);
-    ParserTestCase.parse4("parseCompilationUnit", "static(x) => 0;", []);
-    ParserTestCase.parse4("parseCompilationUnit", "typedef(x) => 0;", []);
+    ParserTestCase.parse4("parseCompilationUnit", "abstract(x) => 0;");
+    ParserTestCase.parse4("parseCompilationUnit", "as(x) => 0;");
+    ParserTestCase.parse4("parseCompilationUnit", "dynamic(x) => 0;");
+    ParserTestCase.parse4("parseCompilationUnit", "export(x) => 0;");
+    ParserTestCase.parse4("parseCompilationUnit", "external(x) => 0;");
+    ParserTestCase.parse4("parseCompilationUnit", "factory(x) => 0;");
+    ParserTestCase.parse4("parseCompilationUnit", "get(x) => 0;");
+    ParserTestCase.parse4("parseCompilationUnit", "implements(x) => 0;");
+    ParserTestCase.parse4("parseCompilationUnit", "import(x) => 0;");
+    ParserTestCase.parse4("parseCompilationUnit", "library(x) => 0;");
+    ParserTestCase.parse4("parseCompilationUnit", "operator(x) => 0;");
+    ParserTestCase.parse4("parseCompilationUnit", "part(x) => 0;");
+    ParserTestCase.parse4("parseCompilationUnit", "set(x) => 0;");
+    ParserTestCase.parse4("parseCompilationUnit", "static(x) => 0;");
+    ParserTestCase.parse4("parseCompilationUnit", "typedef(x) => 0;");
   }
 
   void test_parseCompilationUnit_directives_multiple() {
-    CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "library l;\npart 'a.dart';", []);
+    CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "library l;\npart 'a.dart';");
     expect(unit.scriptTag, isNull);
     expect(unit.directives, hasLength(2));
     expect(unit.declarations, hasLength(0));
   }
 
   void test_parseCompilationUnit_directives_single() {
-    CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "library l;", []);
+    CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "library l;");
     expect(unit.scriptTag, isNull);
     expect(unit.directives, hasLength(1));
     expect(unit.declarations, hasLength(0));
   }
 
   void test_parseCompilationUnit_empty() {
-    CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "", []);
+    CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "");
     expect(unit.scriptTag, isNull);
     expect(unit.directives, hasLength(0));
     expect(unit.declarations, hasLength(0));
   }
 
   void test_parseCompilationUnit_exportAsPrefix() {
-    CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "export.A _export = new export.A();", []);
+    CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "export.A _export = new export.A();");
     expect(unit.scriptTag, isNull);
     expect(unit.directives, hasLength(0));
     expect(unit.declarations, hasLength(1));
   }
 
   void test_parseCompilationUnit_exportAsPrefix_parameterized() {
-    CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "export<dynamic> _export = new export.A();", []);
+    CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "export<dynamic> _export = new export.A();");
     expect(unit.scriptTag, isNull);
     expect(unit.directives, hasLength(0));
     expect(unit.declarations, hasLength(1));
   }
 
   void test_parseCompilationUnit_operatorAsPrefix_parameterized() {
-    CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "operator<dynamic> _operator = new operator.A();", []);
+    CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "operator<dynamic> _operator = new operator.A();");
     expect(unit.scriptTag, isNull);
     expect(unit.directives, hasLength(0));
     expect(unit.declarations, hasLength(1));
   }
 
   void test_parseCompilationUnit_script() {
-    CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "#! /bin/dart", []);
+    CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "#! /bin/dart");
     expect(unit.scriptTag, isNotNull);
     expect(unit.directives, hasLength(0));
     expect(unit.declarations, hasLength(0));
@@ -4964,20 +5040,20 @@
 
   void test_parseCompilationUnit_skipFunctionBody_withInterpolation() {
     ParserTestCase.parseFunctionBodies = false;
-    CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "f() { '\${n}'; }", []);
+    CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "f() { '\${n}'; }");
     expect(unit.scriptTag, isNull);
     expect(unit.declarations, hasLength(1));
   }
 
   void test_parseCompilationUnit_topLevelDeclaration() {
-    CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "class A {}", []);
+    CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "class A {}");
     expect(unit.scriptTag, isNull);
     expect(unit.directives, hasLength(0));
     expect(unit.declarations, hasLength(1));
   }
 
   void test_parseCompilationUnit_typedefAsPrefix() {
-    CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "typedef.A _typedef = new typedef.A();", []);
+    CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "typedef.A _typedef = new typedef.A();");
     expect(unit.scriptTag, isNull);
     expect(unit.directives, hasLength(0));
     expect(unit.declarations, hasLength(1));
@@ -5174,7 +5250,7 @@
   }
 
   void test_parseConditionalExpression() {
-    ConditionalExpression expression = ParserTestCase.parse4("parseConditionalExpression", "x ? y : z", []);
+    ConditionalExpression expression = ParserTestCase.parse4("parseConditionalExpression", "x ? y : z");
     expect(expression.condition, isNotNull);
     expect(expression.question, isNotNull);
     expect(expression.thenExpression, isNotNull);
@@ -5183,7 +5259,7 @@
   }
 
   void test_parseConstExpression_instanceCreation() {
-    InstanceCreationExpression expression = ParserTestCase.parse4("parseConstExpression", "const A()", []);
+    InstanceCreationExpression expression = ParserTestCase.parse4("parseConstExpression", "const A()");
     expect(expression.keyword, isNotNull);
     ConstructorName name = expression.constructorName;
     expect(name, isNotNull);
@@ -5194,7 +5270,7 @@
   }
 
   void test_parseConstExpression_listLiteral_typed() {
-    ListLiteral literal = ParserTestCase.parse4("parseConstExpression", "const <A> []", []);
+    ListLiteral literal = ParserTestCase.parse4("parseConstExpression", "const <A> []");
     expect(literal.constKeyword, isNotNull);
     expect(literal.typeArguments, isNotNull);
     expect(literal.leftBracket, isNotNull);
@@ -5203,7 +5279,7 @@
   }
 
   void test_parseConstExpression_listLiteral_untyped() {
-    ListLiteral literal = ParserTestCase.parse4("parseConstExpression", "const []", []);
+    ListLiteral literal = ParserTestCase.parse4("parseConstExpression", "const []");
     expect(literal.constKeyword, isNotNull);
     expect(literal.typeArguments, isNull);
     expect(literal.leftBracket, isNotNull);
@@ -5212,7 +5288,7 @@
   }
 
   void test_parseConstExpression_mapLiteral_typed() {
-    MapLiteral literal = ParserTestCase.parse4("parseConstExpression", "const <A, B> {}", []);
+    MapLiteral literal = ParserTestCase.parse4("parseConstExpression", "const <A, B> {}");
     expect(literal.leftBracket, isNotNull);
     expect(literal.entries, hasLength(0));
     expect(literal.rightBracket, isNotNull);
@@ -5220,7 +5296,7 @@
   }
 
   void test_parseConstExpression_mapLiteral_untyped() {
-    MapLiteral literal = ParserTestCase.parse4("parseConstExpression", "const {}", []);
+    MapLiteral literal = ParserTestCase.parse4("parseConstExpression", "const {}");
     expect(literal.leftBracket, isNotNull);
     expect(literal.entries, hasLength(0));
     expect(literal.rightBracket, isNotNull);
@@ -5249,7 +5325,7 @@
   }
 
   void test_parseConstructorFieldInitializer_qualified() {
-    ConstructorFieldInitializer invocation = ParserTestCase.parse4("parseConstructorFieldInitializer", "this.a = b", []);
+    ConstructorFieldInitializer invocation = ParserTestCase.parse4("parseConstructorFieldInitializer", "this.a = b");
     expect(invocation.equals, isNotNull);
     expect(invocation.expression, isNotNull);
     expect(invocation.fieldName, isNotNull);
@@ -5258,7 +5334,7 @@
   }
 
   void test_parseConstructorFieldInitializer_unqualified() {
-    ConstructorFieldInitializer invocation = ParserTestCase.parse4("parseConstructorFieldInitializer", "a = b", []);
+    ConstructorFieldInitializer invocation = ParserTestCase.parse4("parseConstructorFieldInitializer", "a = b");
     expect(invocation.equals, isNotNull);
     expect(invocation.expression, isNotNull);
     expect(invocation.fieldName, isNotNull);
@@ -5267,28 +5343,28 @@
   }
 
   void test_parseConstructorName_named_noPrefix() {
-    ConstructorName name = ParserTestCase.parse4("parseConstructorName", "A.n;", []);
+    ConstructorName name = ParserTestCase.parse4("parseConstructorName", "A.n;");
     expect(name.type, isNotNull);
     expect(name.period, isNull);
     expect(name.name, isNull);
   }
 
   void test_parseConstructorName_named_prefixed() {
-    ConstructorName name = ParserTestCase.parse4("parseConstructorName", "p.A.n;", []);
+    ConstructorName name = ParserTestCase.parse4("parseConstructorName", "p.A.n;");
     expect(name.type, isNotNull);
     expect(name.period, isNotNull);
     expect(name.name, isNotNull);
   }
 
   void test_parseConstructorName_unnamed_noPrefix() {
-    ConstructorName name = ParserTestCase.parse4("parseConstructorName", "A;", []);
+    ConstructorName name = ParserTestCase.parse4("parseConstructorName", "A;");
     expect(name.type, isNotNull);
     expect(name.period, isNull);
     expect(name.name, isNull);
   }
 
   void test_parseConstructorName_unnamed_prefixed() {
-    ConstructorName name = ParserTestCase.parse4("parseConstructorName", "p.A;", []);
+    ConstructorName name = ParserTestCase.parse4("parseConstructorName", "p.A;");
     expect(name.type, isNotNull);
     expect(name.period, isNull);
     expect(name.name, isNull);
@@ -5349,56 +5425,56 @@
   }
 
   void test_parseDirectives_complete() {
-    CompilationUnit unit = _parseDirectives("#! /bin/dart\nlibrary l;\nclass A {}", []);
+    CompilationUnit unit = _parseDirectives("#! /bin/dart\nlibrary l;\nclass A {}");
     expect(unit.scriptTag, isNotNull);
     expect(unit.directives, hasLength(1));
   }
 
   void test_parseDirectives_empty() {
-    CompilationUnit unit = _parseDirectives("", []);
+    CompilationUnit unit = _parseDirectives("");
     expect(unit.scriptTag, isNull);
     expect(unit.directives, hasLength(0));
   }
 
   void test_parseDirectives_mixed() {
-    CompilationUnit unit = _parseDirectives("library l; class A {} part 'foo.dart';", []);
+    CompilationUnit unit = _parseDirectives("library l; class A {} part 'foo.dart';");
     expect(unit.scriptTag, isNull);
     expect(unit.directives, hasLength(1));
   }
 
   void test_parseDirectives_multiple() {
-    CompilationUnit unit = _parseDirectives("library l;\npart 'a.dart';", []);
+    CompilationUnit unit = _parseDirectives("library l;\npart 'a.dart';");
     expect(unit.scriptTag, isNull);
     expect(unit.directives, hasLength(2));
   }
 
   void test_parseDirectives_script() {
-    CompilationUnit unit = _parseDirectives("#! /bin/dart", []);
+    CompilationUnit unit = _parseDirectives("#! /bin/dart");
     expect(unit.scriptTag, isNotNull);
     expect(unit.directives, hasLength(0));
   }
 
   void test_parseDirectives_single() {
-    CompilationUnit unit = _parseDirectives("library l;", []);
+    CompilationUnit unit = _parseDirectives("library l;");
     expect(unit.scriptTag, isNull);
     expect(unit.directives, hasLength(1));
   }
 
   void test_parseDirectives_topLevelDeclaration() {
-    CompilationUnit unit = _parseDirectives("class A {}", []);
+    CompilationUnit unit = _parseDirectives("class A {}");
     expect(unit.scriptTag, isNull);
     expect(unit.directives, hasLength(0));
   }
 
   void test_parseDocumentationComment_block() {
-    Comment comment = ParserTestCase.parse4("parseDocumentationComment", "/** */ class", []);
+    Comment comment = ParserTestCase.parse4("parseDocumentationComment", "/** */ class");
     expect(comment.isBlock, isFalse);
     expect(comment.isDocumentation, isTrue);
     expect(comment.isEndOfLine, isFalse);
   }
 
   void test_parseDocumentationComment_block_withReference() {
-    Comment comment = ParserTestCase.parse4("parseDocumentationComment", "/** [a] */ class", []);
+    Comment comment = ParserTestCase.parse4("parseDocumentationComment", "/** [a] */ class");
     expect(comment.isBlock, isFalse);
     expect(comment.isDocumentation, isTrue);
     expect(comment.isEndOfLine, isFalse);
@@ -5410,14 +5486,14 @@
   }
 
   void test_parseDocumentationComment_endOfLine() {
-    Comment comment = ParserTestCase.parse4("parseDocumentationComment", "/// \n/// \n class", []);
+    Comment comment = ParserTestCase.parse4("parseDocumentationComment", "/// \n/// \n class");
     expect(comment.isBlock, isFalse);
     expect(comment.isDocumentation, isTrue);
     expect(comment.isEndOfLine, isFalse);
   }
 
   void test_parseDoStatement() {
-    DoStatement statement = ParserTestCase.parse4("parseDoStatement", "do {} while (x);", []);
+    DoStatement statement = ParserTestCase.parse4("parseDoStatement", "do {} while (x);");
     expect(statement.doKeyword, isNotNull);
     expect(statement.body, isNotNull);
     expect(statement.whileKeyword, isNotNull);
@@ -5428,7 +5504,7 @@
   }
 
   void test_parseEmptyStatement() {
-    EmptyStatement statement = ParserTestCase.parse4("parseEmptyStatement", ";", []);
+    EmptyStatement statement = ParserTestCase.parse4("parseEmptyStatement", ";");
     expect(statement.semicolon, isNotNull);
   }
 
@@ -5463,7 +5539,7 @@
   }
 
   void test_parseEqualityExpression_normal() {
-    BinaryExpression expression = ParserTestCase.parse4("parseEqualityExpression", "x == y", []);
+    BinaryExpression expression = ParserTestCase.parse4("parseEqualityExpression", "x == y");
     expect(expression.leftOperand, isNotNull);
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.EQ_EQ);
@@ -5471,7 +5547,7 @@
   }
 
   void test_parseEqualityExpression_super() {
-    BinaryExpression expression = ParserTestCase.parse4("parseEqualityExpression", "super == y", []);
+    BinaryExpression expression = ParserTestCase.parse4("parseEqualityExpression", "super == y");
     EngineTestCase.assertInstanceOf((obj) => obj is SuperExpression, SuperExpression, expression.leftOperand);
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.EQ_EQ);
@@ -5520,7 +5596,7 @@
 
   void test_parseExpression_assign() {
     // TODO(brianwilkerson) Implement more tests for this method.
-    AssignmentExpression expression = ParserTestCase.parse4("parseExpression", "x = y", []);
+    AssignmentExpression expression = ParserTestCase.parse4("parseExpression", "x = y");
     expect(expression.leftHandSide, isNotNull);
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.EQ);
@@ -5528,7 +5604,7 @@
   }
 
   void test_parseExpression_comparison() {
-    BinaryExpression expression = ParserTestCase.parse4("parseExpression", "--a.b == c", []);
+    BinaryExpression expression = ParserTestCase.parse4("parseExpression", "--a.b == c");
     expect(expression.leftOperand, isNotNull);
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.EQ_EQ);
@@ -5536,7 +5612,7 @@
   }
 
   void test_parseExpression_function_async() {
-    FunctionExpression expression = ParserTestCase.parseExpression("() async {}", []);
+    FunctionExpression expression = ParserTestCase.parseExpression("() async {}");
     expect(expression.body, isNotNull);
     expect(expression.body.isAsynchronous, isTrue);
     expect(expression.body.isGenerator, isFalse);
@@ -5544,7 +5620,7 @@
   }
 
   void test_parseExpression_function_asyncStar() {
-    FunctionExpression expression = ParserTestCase.parseExpression("() async* {}", []);
+    FunctionExpression expression = ParserTestCase.parseExpression("() async* {}");
     expect(expression.body, isNotNull);
     expect(expression.body.isAsynchronous, isTrue);
     expect(expression.body.isGenerator, isTrue);
@@ -5552,7 +5628,7 @@
   }
 
   void test_parseExpression_function_sync() {
-    FunctionExpression expression = ParserTestCase.parseExpression("() {}", []);
+    FunctionExpression expression = ParserTestCase.parseExpression("() {}");
     expect(expression.body, isNotNull);
     expect(expression.body.isAsynchronous, isFalse);
     expect(expression.body.isGenerator, isFalse);
@@ -5560,7 +5636,7 @@
   }
 
   void test_parseExpression_function_syncStar() {
-    FunctionExpression expression = ParserTestCase.parseExpression("() sync* {}", []);
+    FunctionExpression expression = ParserTestCase.parseExpression("() sync* {}");
     expect(expression.body, isNotNull);
     expect(expression.body.isAsynchronous, isFalse);
     expect(expression.body.isGenerator, isTrue);
@@ -5568,7 +5644,7 @@
   }
 
   void test_parseExpression_invokeFunctionExpression() {
-    FunctionExpressionInvocation invocation = ParserTestCase.parse4("parseExpression", "(a) {return a + a;} (3)", []);
+    FunctionExpressionInvocation invocation = ParserTestCase.parse4("parseExpression", "(a) {return a + a;} (3)");
     EngineTestCase.assertInstanceOf((obj) => obj is FunctionExpression, FunctionExpression, invocation.function);
     FunctionExpression expression = invocation.function as FunctionExpression;
     expect(expression.parameters, isNotNull);
@@ -5579,25 +5655,25 @@
   }
 
   void test_parseExpression_superMethodInvocation() {
-    MethodInvocation invocation = ParserTestCase.parse4("parseExpression", "super.m()", []);
+    MethodInvocation invocation = ParserTestCase.parse4("parseExpression", "super.m()");
     expect(invocation.target, isNotNull);
     expect(invocation.methodName, isNotNull);
     expect(invocation.argumentList, isNotNull);
   }
 
   void test_parseExpressionList_multiple() {
-    List<Expression> result = ParserTestCase.parse4("parseExpressionList", "1, 2, 3", []);
+    List<Expression> result = ParserTestCase.parse4("parseExpressionList", "1, 2, 3");
     expect(result, hasLength(3));
   }
 
   void test_parseExpressionList_single() {
-    List<Expression> result = ParserTestCase.parse4("parseExpressionList", "1", []);
+    List<Expression> result = ParserTestCase.parse4("parseExpressionList", "1");
     expect(result, hasLength(1));
   }
 
   void test_parseExpressionWithoutCascade_assign() {
     // TODO(brianwilkerson) Implement more tests for this method.
-    AssignmentExpression expression = ParserTestCase.parse4("parseExpressionWithoutCascade", "x = y", []);
+    AssignmentExpression expression = ParserTestCase.parse4("parseExpressionWithoutCascade", "x = y");
     expect(expression.leftHandSide, isNotNull);
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.EQ);
@@ -5605,7 +5681,7 @@
   }
 
   void test_parseExpressionWithoutCascade_comparison() {
-    BinaryExpression expression = ParserTestCase.parse4("parseExpressionWithoutCascade", "--a.b == c", []);
+    BinaryExpression expression = ParserTestCase.parse4("parseExpressionWithoutCascade", "--a.b == c");
     expect(expression.leftOperand, isNotNull);
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.EQ_EQ);
@@ -5613,14 +5689,14 @@
   }
 
   void test_parseExpressionWithoutCascade_superMethodInvocation() {
-    MethodInvocation invocation = ParserTestCase.parse4("parseExpressionWithoutCascade", "super.m()", []);
+    MethodInvocation invocation = ParserTestCase.parse4("parseExpressionWithoutCascade", "super.m()");
     expect(invocation.target, isNotNull);
     expect(invocation.methodName, isNotNull);
     expect(invocation.argumentList, isNotNull);
   }
 
   void test_parseExtendsClause() {
-    ExtendsClause clause = ParserTestCase.parse4("parseExtendsClause", "extends B", []);
+    ExtendsClause clause = ParserTestCase.parse4("parseExtendsClause", "extends B");
     expect(clause.keyword, isNotNull);
     expect(clause.superclass, isNotNull);
     EngineTestCase.assertInstanceOf((obj) => obj is TypeName, TypeName, clause.superclass);
@@ -5683,6 +5759,12 @@
     expect(result.type, isNotNull);
   }
 
+  void test_parseFinalConstVarOrType_type_prefixed_noIdentifier() {
+    FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType", <Object> [false], "p.A,");
+    expect(result.keyword, isNull);
+    expect(result.type, isNotNull);
+  }
+
   void test_parseFinalConstVarOrType_type_prefixedAndParameterized() {
     FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType", <Object> [false], "p.A<B> a");
     expect(result.keyword, isNull);
@@ -5704,6 +5786,18 @@
     expect(result.type, isNull);
   }
 
+  void test_parseFinalConstVarOrType_void() {
+    FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType", <Object> [false], "void f()");
+    expect(result.keyword, isNull);
+    expect(result.type, isNotNull);
+  }
+
+  void test_parseFinalConstVarOrType_void_noIdentifier() {
+    FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType", <Object> [false], "void,");
+    expect(result.keyword, isNull);
+    expect(result.type, isNotNull);
+  }
+
   void test_parseFormalParameter_final_withType_named() {
     ParameterKind kind = ParameterKind.NAMED;
     DefaultFormalParameter parameter = ParserTestCase.parse("parseFormalParameter", <Object> [kind], "final A a : null");
@@ -5810,7 +5904,7 @@
   }
 
   void test_parseFormalParameterList_empty() {
-    FormalParameterList parameterList = ParserTestCase.parse4("parseFormalParameterList", "()", []);
+    FormalParameterList parameterList = ParserTestCase.parse4("parseFormalParameterList", "()");
     expect(parameterList.leftParenthesis, isNotNull);
     expect(parameterList.leftDelimiter, isNull);
     expect(parameterList.parameters, hasLength(0));
@@ -5819,7 +5913,7 @@
   }
 
   void test_parseFormalParameterList_named_multiple() {
-    FormalParameterList parameterList = ParserTestCase.parse4("parseFormalParameterList", "({A a : 1, B b, C c : 3})", []);
+    FormalParameterList parameterList = ParserTestCase.parse4("parseFormalParameterList", "({A a : 1, B b, C c : 3})");
     expect(parameterList.leftParenthesis, isNotNull);
     expect(parameterList.leftDelimiter, isNotNull);
     expect(parameterList.parameters, hasLength(3));
@@ -5828,7 +5922,7 @@
   }
 
   void test_parseFormalParameterList_named_single() {
-    FormalParameterList parameterList = ParserTestCase.parse4("parseFormalParameterList", "({A a})", []);
+    FormalParameterList parameterList = ParserTestCase.parse4("parseFormalParameterList", "({A a})");
     expect(parameterList.leftParenthesis, isNotNull);
     expect(parameterList.leftDelimiter, isNotNull);
     expect(parameterList.parameters, hasLength(1));
@@ -5837,7 +5931,7 @@
   }
 
   void test_parseFormalParameterList_normal_multiple() {
-    FormalParameterList parameterList = ParserTestCase.parse4("parseFormalParameterList", "(A a, B b, C c)", []);
+    FormalParameterList parameterList = ParserTestCase.parse4("parseFormalParameterList", "(A a, B b, C c)");
     expect(parameterList.leftParenthesis, isNotNull);
     expect(parameterList.leftDelimiter, isNull);
     expect(parameterList.parameters, hasLength(3));
@@ -5846,7 +5940,7 @@
   }
 
   void test_parseFormalParameterList_normal_named() {
-    FormalParameterList parameterList = ParserTestCase.parse4("parseFormalParameterList", "(A a, {B b})", []);
+    FormalParameterList parameterList = ParserTestCase.parse4("parseFormalParameterList", "(A a, {B b})");
     expect(parameterList.leftParenthesis, isNotNull);
     expect(parameterList.leftDelimiter, isNotNull);
     expect(parameterList.parameters, hasLength(2));
@@ -5855,7 +5949,7 @@
   }
 
   void test_parseFormalParameterList_normal_positional() {
-    FormalParameterList parameterList = ParserTestCase.parse4("parseFormalParameterList", "(A a, [B b])", []);
+    FormalParameterList parameterList = ParserTestCase.parse4("parseFormalParameterList", "(A a, [B b])");
     expect(parameterList.leftParenthesis, isNotNull);
     expect(parameterList.leftDelimiter, isNotNull);
     expect(parameterList.parameters, hasLength(2));
@@ -5864,7 +5958,7 @@
   }
 
   void test_parseFormalParameterList_normal_single() {
-    FormalParameterList parameterList = ParserTestCase.parse4("parseFormalParameterList", "(A a)", []);
+    FormalParameterList parameterList = ParserTestCase.parse4("parseFormalParameterList", "(A a)");
     expect(parameterList.leftParenthesis, isNotNull);
     expect(parameterList.leftDelimiter, isNull);
     expect(parameterList.parameters, hasLength(1));
@@ -5873,7 +5967,7 @@
   }
 
   void test_parseFormalParameterList_positional_multiple() {
-    FormalParameterList parameterList = ParserTestCase.parse4("parseFormalParameterList", "([A a = null, B b, C c = null])", []);
+    FormalParameterList parameterList = ParserTestCase.parse4("parseFormalParameterList", "([A a = null, B b, C c = null])");
     expect(parameterList.leftParenthesis, isNotNull);
     expect(parameterList.leftDelimiter, isNotNull);
     expect(parameterList.parameters, hasLength(3));
@@ -5882,7 +5976,7 @@
   }
 
   void test_parseFormalParameterList_positional_single() {
-    FormalParameterList parameterList = ParserTestCase.parse4("parseFormalParameterList", "([A a = null])", []);
+    FormalParameterList parameterList = ParserTestCase.parse4("parseFormalParameterList", "([A a = null])");
     expect(parameterList.leftParenthesis, isNotNull);
     expect(parameterList.leftDelimiter, isNotNull);
     expect(parameterList.parameters, hasLength(1));
@@ -5891,7 +5985,7 @@
   }
 
   void test_parseForStatement_each_await() {
-    ForEachStatement statement = ParserTestCase.parse4("parseForStatement", "await for (element in list) {}", []);
+    ForEachStatement statement = ParserTestCase.parse4("parseForStatement", "await for (element in list) {}");
     expect(statement.awaitKeyword, isNotNull);
     expect(statement.forKeyword, isNotNull);
     expect(statement.leftParenthesis, isNotNull);
@@ -5904,7 +5998,7 @@
   }
 
   void test_parseForStatement_each_identifier() {
-    ForEachStatement statement = ParserTestCase.parse4("parseForStatement", "for (element in list) {}", []);
+    ForEachStatement statement = ParserTestCase.parse4("parseForStatement", "for (element in list) {}");
     expect(statement.awaitKeyword, isNull);
     expect(statement.forKeyword, isNotNull);
     expect(statement.leftParenthesis, isNotNull);
@@ -5917,7 +6011,7 @@
   }
 
   void test_parseForStatement_each_noType_metadata() {
-    ForEachStatement statement = ParserTestCase.parse4("parseForStatement", "for (@A var element in list) {}", []);
+    ForEachStatement statement = ParserTestCase.parse4("parseForStatement", "for (@A var element in list) {}");
     expect(statement.awaitKeyword, isNull);
     expect(statement.forKeyword, isNotNull);
     expect(statement.leftParenthesis, isNotNull);
@@ -5931,7 +6025,7 @@
   }
 
   void test_parseForStatement_each_type() {
-    ForEachStatement statement = ParserTestCase.parse4("parseForStatement", "for (A element in list) {}", []);
+    ForEachStatement statement = ParserTestCase.parse4("parseForStatement", "for (A element in list) {}");
     expect(statement.awaitKeyword, isNull);
     expect(statement.forKeyword, isNotNull);
     expect(statement.leftParenthesis, isNotNull);
@@ -5944,7 +6038,7 @@
   }
 
   void test_parseForStatement_each_var() {
-    ForEachStatement statement = ParserTestCase.parse4("parseForStatement", "for (var element in list) {}", []);
+    ForEachStatement statement = ParserTestCase.parse4("parseForStatement", "for (var element in list) {}");
     expect(statement.awaitKeyword, isNull);
     expect(statement.forKeyword, isNotNull);
     expect(statement.leftParenthesis, isNotNull);
@@ -5957,7 +6051,7 @@
   }
 
   void test_parseForStatement_loop_c() {
-    ForStatement statement = ParserTestCase.parse4("parseForStatement", "for (; i < count;) {}", []);
+    ForStatement statement = ParserTestCase.parse4("parseForStatement", "for (; i < count;) {}");
     expect(statement.forKeyword, isNotNull);
     expect(statement.leftParenthesis, isNotNull);
     expect(statement.variables, isNull);
@@ -5971,7 +6065,7 @@
   }
 
   void test_parseForStatement_loop_cu() {
-    ForStatement statement = ParserTestCase.parse4("parseForStatement", "for (; i < count; i++) {}", []);
+    ForStatement statement = ParserTestCase.parse4("parseForStatement", "for (; i < count; i++) {}");
     expect(statement.forKeyword, isNotNull);
     expect(statement.leftParenthesis, isNotNull);
     expect(statement.variables, isNull);
@@ -5985,7 +6079,7 @@
   }
 
   void test_parseForStatement_loop_ecu() {
-    ForStatement statement = ParserTestCase.parse4("parseForStatement", "for (i--; i < count; i++) {}", []);
+    ForStatement statement = ParserTestCase.parse4("parseForStatement", "for (i--; i < count; i++) {}");
     expect(statement.forKeyword, isNotNull);
     expect(statement.leftParenthesis, isNotNull);
     expect(statement.variables, isNull);
@@ -5999,7 +6093,7 @@
   }
 
   void test_parseForStatement_loop_i() {
-    ForStatement statement = ParserTestCase.parse4("parseForStatement", "for (var i = 0;;) {}", []);
+    ForStatement statement = ParserTestCase.parse4("parseForStatement", "for (var i = 0;;) {}");
     expect(statement.forKeyword, isNotNull);
     expect(statement.leftParenthesis, isNotNull);
     VariableDeclarationList variables = statement.variables;
@@ -6016,7 +6110,7 @@
   }
 
   void test_parseForStatement_loop_i_withMetadata() {
-    ForStatement statement = ParserTestCase.parse4("parseForStatement", "for (@A var i = 0;;) {}", []);
+    ForStatement statement = ParserTestCase.parse4("parseForStatement", "for (@A var i = 0;;) {}");
     expect(statement.forKeyword, isNotNull);
     expect(statement.leftParenthesis, isNotNull);
     VariableDeclarationList variables = statement.variables;
@@ -6033,7 +6127,7 @@
   }
 
   void test_parseForStatement_loop_ic() {
-    ForStatement statement = ParserTestCase.parse4("parseForStatement", "for (var i = 0; i < count;) {}", []);
+    ForStatement statement = ParserTestCase.parse4("parseForStatement", "for (var i = 0; i < count;) {}");
     expect(statement.forKeyword, isNotNull);
     expect(statement.leftParenthesis, isNotNull);
     VariableDeclarationList variables = statement.variables;
@@ -6049,7 +6143,7 @@
   }
 
   void test_parseForStatement_loop_icu() {
-    ForStatement statement = ParserTestCase.parse4("parseForStatement", "for (var i = 0; i < count; i++) {}", []);
+    ForStatement statement = ParserTestCase.parse4("parseForStatement", "for (var i = 0; i < count; i++) {}");
     expect(statement.forKeyword, isNotNull);
     expect(statement.leftParenthesis, isNotNull);
     VariableDeclarationList variables = statement.variables;
@@ -6065,7 +6159,7 @@
   }
 
   void test_parseForStatement_loop_iicuu() {
-    ForStatement statement = ParserTestCase.parse4("parseForStatement", "for (int i = 0, j = count; i < j; i++, j--) {}", []);
+    ForStatement statement = ParserTestCase.parse4("parseForStatement", "for (int i = 0, j = count; i < j; i++, j--) {}");
     expect(statement.forKeyword, isNotNull);
     expect(statement.leftParenthesis, isNotNull);
     VariableDeclarationList variables = statement.variables;
@@ -6081,7 +6175,7 @@
   }
 
   void test_parseForStatement_loop_iu() {
-    ForStatement statement = ParserTestCase.parse4("parseForStatement", "for (var i = 0;; i++) {}", []);
+    ForStatement statement = ParserTestCase.parse4("parseForStatement", "for (var i = 0;; i++) {}");
     expect(statement.forKeyword, isNotNull);
     expect(statement.leftParenthesis, isNotNull);
     VariableDeclarationList variables = statement.variables;
@@ -6097,7 +6191,7 @@
   }
 
   void test_parseForStatement_loop_u() {
-    ForStatement statement = ParserTestCase.parse4("parseForStatement", "for (;; i++) {}", []);
+    ForStatement statement = ParserTestCase.parse4("parseForStatement", "for (;; i++) {}");
     expect(statement.forKeyword, isNotNull);
     expect(statement.leftParenthesis, isNotNull);
     expect(statement.variables, isNull);
@@ -6215,7 +6309,7 @@
   void test_parseFunctionDeclaration_function() {
     Comment comment = Comment.createDocumentationComment(new List<Token>(0));
     TypeName returnType = new TypeName(new SimpleIdentifier(null), null);
-    FunctionDeclaration declaration = ParserTestCase.parse("parseFunctionDeclaration", <Object> [commentAndMetadata(comment, []), null, returnType], "f() {}");
+    FunctionDeclaration declaration = ParserTestCase.parse("parseFunctionDeclaration", <Object> [commentAndMetadata(comment), null, returnType], "f() {}");
     expect(declaration.documentationComment, comment);
     expect(declaration.returnType, returnType);
     expect(declaration.name, isNotNull);
@@ -6229,7 +6323,7 @@
   void test_parseFunctionDeclaration_getter() {
     Comment comment = Comment.createDocumentationComment(new List<Token>(0));
     TypeName returnType = new TypeName(new SimpleIdentifier(null), null);
-    FunctionDeclaration declaration = ParserTestCase.parse("parseFunctionDeclaration", <Object> [commentAndMetadata(comment, []), null, returnType], "get p => 0;");
+    FunctionDeclaration declaration = ParserTestCase.parse("parseFunctionDeclaration", <Object> [commentAndMetadata(comment), null, returnType], "get p => 0;");
     expect(declaration.documentationComment, comment);
     expect(declaration.returnType, returnType);
     expect(declaration.name, isNotNull);
@@ -6243,7 +6337,7 @@
   void test_parseFunctionDeclaration_setter() {
     Comment comment = Comment.createDocumentationComment(new List<Token>(0));
     TypeName returnType = new TypeName(new SimpleIdentifier(null), null);
-    FunctionDeclaration declaration = ParserTestCase.parse("parseFunctionDeclaration", <Object> [commentAndMetadata(comment, []), null, returnType], "set p(v) {}");
+    FunctionDeclaration declaration = ParserTestCase.parse("parseFunctionDeclaration", <Object> [commentAndMetadata(comment), null, returnType], "set p(v) {}");
     expect(declaration.documentationComment, comment);
     expect(declaration.returnType, returnType);
     expect(declaration.name, isNotNull);
@@ -6255,12 +6349,12 @@
   }
 
   void test_parseFunctionDeclarationStatement() {
-    FunctionDeclarationStatement statement = ParserTestCase.parse4("parseFunctionDeclarationStatement", "void f(int p) => p * 2;", []);
+    FunctionDeclarationStatement statement = ParserTestCase.parse4("parseFunctionDeclarationStatement", "void f(int p) => p * 2;");
     expect(statement.functionDeclaration, isNotNull);
   }
 
   void test_parseFunctionExpression_body_inExpression() {
-    FunctionExpression expression = ParserTestCase.parse4("parseFunctionExpression", "(int i) => i++", []);
+    FunctionExpression expression = ParserTestCase.parse4("parseFunctionExpression", "(int i) => i++");
     expect(expression.body, isNotNull);
     expect(expression.parameters, isNotNull);
     expect((expression.body as ExpressionFunctionBody).semicolon, isNull);
@@ -6269,7 +6363,7 @@
   void test_parseGetter_nonStatic() {
     Comment comment = Comment.createDocumentationComment(new List<Token>(0));
     TypeName returnType = new TypeName(new SimpleIdentifier(null), null);
-    MethodDeclaration method = ParserTestCase.parse("parseGetter", <Object> [commentAndMetadata(comment, []), null, null, returnType], "get a;");
+    MethodDeclaration method = ParserTestCase.parse("parseGetter", <Object> [commentAndMetadata(comment), null, null, returnType], "get a;");
     expect(method.body, isNotNull);
     expect(method.documentationComment, comment);
     expect(method.externalKeyword, isNull);
@@ -6286,7 +6380,7 @@
     Token staticKeyword = TokenFactory.tokenFromKeyword(Keyword.STATIC);
     TypeName returnType = new TypeName(new SimpleIdentifier(null), null);
     MethodDeclaration method = ParserTestCase.parse("parseGetter", <Object> [
-        commentAndMetadata(comment, []),
+        commentAndMetadata(comment),
         null,
         staticKeyword,
         returnType], "get a => 42;");
@@ -6302,17 +6396,17 @@
   }
 
   void test_parseIdentifierList_multiple() {
-    List<SimpleIdentifier> list = ParserTestCase.parse4("parseIdentifierList", "a, b, c", []);
+    List<SimpleIdentifier> list = ParserTestCase.parse4("parseIdentifierList", "a, b, c");
     expect(list, hasLength(3));
   }
 
   void test_parseIdentifierList_single() {
-    List<SimpleIdentifier> list = ParserTestCase.parse4("parseIdentifierList", "a", []);
+    List<SimpleIdentifier> list = ParserTestCase.parse4("parseIdentifierList", "a");
     expect(list, hasLength(1));
   }
 
   void test_parseIfStatement_else_block() {
-    IfStatement statement = ParserTestCase.parse4("parseIfStatement", "if (x) {} else {}", []);
+    IfStatement statement = ParserTestCase.parse4("parseIfStatement", "if (x) {} else {}");
     expect(statement.ifKeyword, isNotNull);
     expect(statement.leftParenthesis, isNotNull);
     expect(statement.condition, isNotNull);
@@ -6323,7 +6417,7 @@
   }
 
   void test_parseIfStatement_else_statement() {
-    IfStatement statement = ParserTestCase.parse4("parseIfStatement", "if (x) f(x); else f(y);", []);
+    IfStatement statement = ParserTestCase.parse4("parseIfStatement", "if (x) f(x); else f(y);");
     expect(statement.ifKeyword, isNotNull);
     expect(statement.leftParenthesis, isNotNull);
     expect(statement.condition, isNotNull);
@@ -6334,7 +6428,7 @@
   }
 
   void test_parseIfStatement_noElse_block() {
-    IfStatement statement = ParserTestCase.parse4("parseIfStatement", "if (x) {}", []);
+    IfStatement statement = ParserTestCase.parse4("parseIfStatement", "if (x) {}");
     expect(statement.ifKeyword, isNotNull);
     expect(statement.leftParenthesis, isNotNull);
     expect(statement.condition, isNotNull);
@@ -6345,7 +6439,7 @@
   }
 
   void test_parseIfStatement_noElse_statement() {
-    IfStatement statement = ParserTestCase.parse4("parseIfStatement", "if (x) f(x);", []);
+    IfStatement statement = ParserTestCase.parse4("parseIfStatement", "if (x) f(x);");
     expect(statement.ifKeyword, isNotNull);
     expect(statement.leftParenthesis, isNotNull);
     expect(statement.condition, isNotNull);
@@ -6356,13 +6450,13 @@
   }
 
   void test_parseImplementsClause_multiple() {
-    ImplementsClause clause = ParserTestCase.parse4("parseImplementsClause", "implements A, B, C", []);
+    ImplementsClause clause = ParserTestCase.parse4("parseImplementsClause", "implements A, B, C");
     expect(clause.interfaces, hasLength(3));
     expect(clause.keyword, isNotNull);
   }
 
   void test_parseImplementsClause_single() {
-    ImplementsClause clause = ParserTestCase.parse4("parseImplementsClause", "implements A", []);
+    ImplementsClause clause = ParserTestCase.parse4("parseImplementsClause", "implements A");
     expect(clause.interfaces, hasLength(1));
     expect(clause.keyword, isNotNull);
   }
@@ -6449,7 +6543,7 @@
     Token staticKeyword = TokenFactory.tokenFromKeyword(Keyword.STATIC);
     TypeName type = new TypeName(new SimpleIdentifier(null), null);
     FieldDeclaration declaration = ParserTestCase.parse("parseInitializedIdentifierList", <Object> [
-        commentAndMetadata(comment, []),
+        commentAndMetadata(comment),
         staticKeyword,
         null,
         type], "a = 1, b, c = 3;");
@@ -6468,7 +6562,7 @@
     Token staticKeyword = TokenFactory.tokenFromKeyword(Keyword.STATIC);
     Token varKeyword = TokenFactory.tokenFromKeyword(Keyword.VAR);
     FieldDeclaration declaration = ParserTestCase.parse("parseInitializedIdentifierList", <Object> [
-        commentAndMetadata(comment, []),
+        commentAndMetadata(comment),
         staticKeyword,
         varKeyword,
         null], "a = 1, b, c = 3;");
@@ -6539,13 +6633,13 @@
 
   void test_parseLibraryIdentifier_multiple() {
     String name = "a.b.c";
-    LibraryIdentifier identifier = ParserTestCase.parse4("parseLibraryIdentifier", name, []);
+    LibraryIdentifier identifier = ParserTestCase.parse4("parseLibraryIdentifier", name);
     expect(identifier.name, name);
   }
 
   void test_parseLibraryIdentifier_single() {
     String name = "a";
-    LibraryIdentifier identifier = ParserTestCase.parse4("parseLibraryIdentifier", name, []);
+    LibraryIdentifier identifier = ParserTestCase.parse4("parseLibraryIdentifier", name);
     expect(identifier.name, name);
   }
 
@@ -6626,7 +6720,7 @@
   }
 
   void test_parseLogicalAndExpression() {
-    BinaryExpression expression = ParserTestCase.parse4("parseLogicalAndExpression", "x && y", []);
+    BinaryExpression expression = ParserTestCase.parse4("parseLogicalAndExpression", "x && y");
     expect(expression.leftOperand, isNotNull);
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.AMPERSAND_AMPERSAND);
@@ -6634,7 +6728,7 @@
   }
 
   void test_parseLogicalOrExpression() {
-    BinaryExpression expression = ParserTestCase.parse4("parseLogicalOrExpression", "x || y", []);
+    BinaryExpression expression = ParserTestCase.parse4("parseLogicalOrExpression", "x || y");
     expect(expression.leftOperand, isNotNull);
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.BAR_BAR);
@@ -6644,8 +6738,8 @@
   void test_parseMapLiteral_empty() {
     Token token = TokenFactory.tokenFromKeyword(Keyword.CONST);
     TypeArgumentList typeArguments = AstFactory.typeArgumentList([
-        AstFactory.typeName4("String", []),
-        AstFactory.typeName4("int", [])]);
+        AstFactory.typeName4("String"),
+        AstFactory.typeName4("int")]);
     MapLiteral literal = ParserTestCase.parse("parseMapLiteral", <Object> [token, typeArguments], "{}");
     expect(literal.constKeyword, token);
     expect(literal.typeArguments, typeArguments);
@@ -6669,63 +6763,63 @@
   }
 
   void test_parseMapLiteralEntry_complex() {
-    MapLiteralEntry entry = ParserTestCase.parse4("parseMapLiteralEntry", "2 + 2 : y", []);
+    MapLiteralEntry entry = ParserTestCase.parse4("parseMapLiteralEntry", "2 + 2 : y");
     expect(entry.key, isNotNull);
     expect(entry.separator, isNotNull);
     expect(entry.value, isNotNull);
   }
 
   void test_parseMapLiteralEntry_int() {
-    MapLiteralEntry entry = ParserTestCase.parse4("parseMapLiteralEntry", "0 : y", []);
+    MapLiteralEntry entry = ParserTestCase.parse4("parseMapLiteralEntry", "0 : y");
     expect(entry.key, isNotNull);
     expect(entry.separator, isNotNull);
     expect(entry.value, isNotNull);
   }
 
   void test_parseMapLiteralEntry_string() {
-    MapLiteralEntry entry = ParserTestCase.parse4("parseMapLiteralEntry", "'x' : y", []);
+    MapLiteralEntry entry = ParserTestCase.parse4("parseMapLiteralEntry", "'x' : y");
     expect(entry.key, isNotNull);
     expect(entry.separator, isNotNull);
     expect(entry.value, isNotNull);
   }
 
   void test_parseModifiers_abstract() {
-    Modifiers modifiers = ParserTestCase.parse4("parseModifiers", "abstract A", []);
+    Modifiers modifiers = ParserTestCase.parse4("parseModifiers", "abstract A");
     expect(modifiers.abstractKeyword, isNotNull);
   }
 
   void test_parseModifiers_const() {
-    Modifiers modifiers = ParserTestCase.parse4("parseModifiers", "const A", []);
+    Modifiers modifiers = ParserTestCase.parse4("parseModifiers", "const A");
     expect(modifiers.constKeyword, isNotNull);
   }
 
   void test_parseModifiers_external() {
-    Modifiers modifiers = ParserTestCase.parse4("parseModifiers", "external A", []);
+    Modifiers modifiers = ParserTestCase.parse4("parseModifiers", "external A");
     expect(modifiers.externalKeyword, isNotNull);
   }
 
   void test_parseModifiers_factory() {
-    Modifiers modifiers = ParserTestCase.parse4("parseModifiers", "factory A", []);
+    Modifiers modifiers = ParserTestCase.parse4("parseModifiers", "factory A");
     expect(modifiers.factoryKeyword, isNotNull);
   }
 
   void test_parseModifiers_final() {
-    Modifiers modifiers = ParserTestCase.parse4("parseModifiers", "final A", []);
+    Modifiers modifiers = ParserTestCase.parse4("parseModifiers", "final A");
     expect(modifiers.finalKeyword, isNotNull);
   }
 
   void test_parseModifiers_static() {
-    Modifiers modifiers = ParserTestCase.parse4("parseModifiers", "static A", []);
+    Modifiers modifiers = ParserTestCase.parse4("parseModifiers", "static A");
     expect(modifiers.staticKeyword, isNotNull);
   }
 
   void test_parseModifiers_var() {
-    Modifiers modifiers = ParserTestCase.parse4("parseModifiers", "var A", []);
+    Modifiers modifiers = ParserTestCase.parse4("parseModifiers", "var A");
     expect(modifiers.varKeyword, isNotNull);
   }
 
   void test_parseMultiplicativeExpression_normal() {
-    BinaryExpression expression = ParserTestCase.parse4("parseMultiplicativeExpression", "x * y", []);
+    BinaryExpression expression = ParserTestCase.parse4("parseMultiplicativeExpression", "x * y");
     expect(expression.leftOperand, isNotNull);
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.STAR);
@@ -6733,7 +6827,7 @@
   }
 
   void test_parseMultiplicativeExpression_super() {
-    BinaryExpression expression = ParserTestCase.parse4("parseMultiplicativeExpression", "super * y", []);
+    BinaryExpression expression = ParserTestCase.parse4("parseMultiplicativeExpression", "super * y");
     EngineTestCase.assertInstanceOf((obj) => obj is SuperExpression, SuperExpression, expression.leftOperand);
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.STAR);
@@ -6741,7 +6835,7 @@
   }
 
   void test_parseNewExpression() {
-    InstanceCreationExpression expression = ParserTestCase.parse4("parseNewExpression", "new A()", []);
+    InstanceCreationExpression expression = ParserTestCase.parse4("parseNewExpression", "new A()");
     expect(expression.keyword, isNotNull);
     ConstructorName name = expression.constructorName;
     expect(name, isNotNull);
@@ -6752,65 +6846,65 @@
   }
 
   void test_parseNonLabeledStatement_const_list_empty() {
-    ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatement", "const [];", []);
+    ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatement", "const [];");
     expect(statement.expression, isNotNull);
   }
 
   void test_parseNonLabeledStatement_const_list_nonEmpty() {
-    ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatement", "const [1, 2];", []);
+    ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatement", "const [1, 2];");
     expect(statement.expression, isNotNull);
   }
 
   void test_parseNonLabeledStatement_const_map_empty() {
-    ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatement", "const {};", []);
+    ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatement", "const {};");
     expect(statement.expression, isNotNull);
   }
 
   void test_parseNonLabeledStatement_const_map_nonEmpty() {
     // TODO(brianwilkerson) Implement more tests for this method.
-    ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatement", "const {'a' : 1};", []);
+    ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatement", "const {'a' : 1};");
     expect(statement.expression, isNotNull);
   }
 
   void test_parseNonLabeledStatement_const_object() {
-    ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatement", "const A();", []);
+    ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatement", "const A();");
     expect(statement.expression, isNotNull);
   }
 
   void test_parseNonLabeledStatement_const_object_named_typeParameters() {
-    ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatement", "const A<B>.c();", []);
+    ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatement", "const A<B>.c();");
     expect(statement.expression, isNotNull);
   }
 
   void test_parseNonLabeledStatement_constructorInvocation() {
-    ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatement", "new C().m();", []);
+    ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatement", "new C().m();");
     expect(statement.expression, isNotNull);
   }
 
   void test_parseNonLabeledStatement_false() {
-    ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatement", "false;", []);
+    ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatement", "false;");
     expect(statement.expression, isNotNull);
   }
 
   void test_parseNonLabeledStatement_functionDeclaration() {
-    ParserTestCase.parse4("parseNonLabeledStatement", "f() {};", []);
+    ParserTestCase.parse4("parseNonLabeledStatement", "f() {};");
   }
 
   void test_parseNonLabeledStatement_functionDeclaration_arguments() {
-    ParserTestCase.parse4("parseNonLabeledStatement", "f(void g()) {};", []);
+    ParserTestCase.parse4("parseNonLabeledStatement", "f(void g()) {};");
   }
 
   void test_parseNonLabeledStatement_functionExpressionIndex() {
-    ParserTestCase.parse4("parseNonLabeledStatement", "() {}[0] = null;", []);
+    ParserTestCase.parse4("parseNonLabeledStatement", "() {}[0] = null;");
   }
 
   void test_parseNonLabeledStatement_functionInvocation() {
-    ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatement", "f();", []);
+    ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatement", "f();");
     expect(statement.expression, isNotNull);
   }
 
   void test_parseNonLabeledStatement_invokeFunctionExpression() {
-    ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatement", "(a) {return a + a;} (3);", []);
+    ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatement", "(a) {return a + a;} (3);");
     EngineTestCase.assertInstanceOf((obj) => obj is FunctionExpressionInvocation, FunctionExpressionInvocation, statement.expression);
     FunctionExpressionInvocation invocation = statement.expression as FunctionExpressionInvocation;
     EngineTestCase.assertInstanceOf((obj) => obj is FunctionExpression, FunctionExpression, invocation.function);
@@ -6823,27 +6917,27 @@
   }
 
   void test_parseNonLabeledStatement_null() {
-    ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatement", "null;", []);
+    ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatement", "null;");
     expect(statement.expression, isNotNull);
   }
 
   void test_parseNonLabeledStatement_startingWithBuiltInIdentifier() {
-    ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatement", "library.getName();", []);
+    ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatement", "library.getName();");
     expect(statement.expression, isNotNull);
   }
 
   void test_parseNonLabeledStatement_true() {
-    ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatement", "true;", []);
+    ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatement", "true;");
     expect(statement.expression, isNotNull);
   }
 
   void test_parseNonLabeledStatement_typeCast() {
-    ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatement", "double.NAN as num;", []);
+    ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatement", "double.NAN as num;");
     expect(statement.expression, isNotNull);
   }
 
   void test_parseNormalFormalParameter_field_const_noType() {
-    FieldFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalParameter", "const this.a)", []);
+    FieldFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalParameter", "const this.a)");
     expect(parameter.keyword, isNotNull);
     expect(parameter.type, isNull);
     expect(parameter.identifier, isNotNull);
@@ -6851,7 +6945,7 @@
   }
 
   void test_parseNormalFormalParameter_field_const_type() {
-    FieldFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalParameter", "const A this.a)", []);
+    FieldFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalParameter", "const A this.a)");
     expect(parameter.keyword, isNotNull);
     expect(parameter.type, isNotNull);
     expect(parameter.identifier, isNotNull);
@@ -6859,7 +6953,7 @@
   }
 
   void test_parseNormalFormalParameter_field_final_noType() {
-    FieldFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalParameter", "final this.a)", []);
+    FieldFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalParameter", "final this.a)");
     expect(parameter.keyword, isNotNull);
     expect(parameter.type, isNull);
     expect(parameter.identifier, isNotNull);
@@ -6867,7 +6961,7 @@
   }
 
   void test_parseNormalFormalParameter_field_final_type() {
-    FieldFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalParameter", "final A this.a)", []);
+    FieldFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalParameter", "final A this.a)");
     expect(parameter.keyword, isNotNull);
     expect(parameter.type, isNotNull);
     expect(parameter.identifier, isNotNull);
@@ -6875,7 +6969,7 @@
   }
 
   void test_parseNormalFormalParameter_field_function_nested() {
-    FieldFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalParameter", "this.a(B b))", []);
+    FieldFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalParameter", "this.a(B b))");
     expect(parameter.keyword, isNull);
     expect(parameter.type, isNull);
     expect(parameter.identifier, isNotNull);
@@ -6885,7 +6979,7 @@
   }
 
   void test_parseNormalFormalParameter_field_function_noNested() {
-    FieldFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalParameter", "this.a())", []);
+    FieldFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalParameter", "this.a())");
     expect(parameter.keyword, isNull);
     expect(parameter.type, isNull);
     expect(parameter.identifier, isNotNull);
@@ -6895,7 +6989,7 @@
   }
 
   void test_parseNormalFormalParameter_field_noType() {
-    FieldFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalParameter", "this.a)", []);
+    FieldFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalParameter", "this.a)");
     expect(parameter.keyword, isNull);
     expect(parameter.type, isNull);
     expect(parameter.identifier, isNotNull);
@@ -6903,7 +6997,7 @@
   }
 
   void test_parseNormalFormalParameter_field_type() {
-    FieldFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalParameter", "A this.a)", []);
+    FieldFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalParameter", "A this.a)");
     expect(parameter.keyword, isNull);
     expect(parameter.type, isNotNull);
     expect(parameter.identifier, isNotNull);
@@ -6911,7 +7005,7 @@
   }
 
   void test_parseNormalFormalParameter_field_var() {
-    FieldFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalParameter", "var this.a)", []);
+    FieldFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalParameter", "var this.a)");
     expect(parameter.keyword, isNotNull);
     expect(parameter.type, isNull);
     expect(parameter.identifier, isNotNull);
@@ -6919,63 +7013,63 @@
   }
 
   void test_parseNormalFormalParameter_function_noType() {
-    FunctionTypedFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalParameter", "a())", []);
+    FunctionTypedFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalParameter", "a())");
     expect(parameter.returnType, isNull);
     expect(parameter.identifier, isNotNull);
     expect(parameter.parameters, isNotNull);
   }
 
   void test_parseNormalFormalParameter_function_type() {
-    FunctionTypedFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalParameter", "A a())", []);
+    FunctionTypedFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalParameter", "A a())");
     expect(parameter.returnType, isNotNull);
     expect(parameter.identifier, isNotNull);
     expect(parameter.parameters, isNotNull);
   }
 
   void test_parseNormalFormalParameter_function_void() {
-    FunctionTypedFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalParameter", "void a())", []);
+    FunctionTypedFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalParameter", "void a())");
     expect(parameter.returnType, isNotNull);
     expect(parameter.identifier, isNotNull);
     expect(parameter.parameters, isNotNull);
   }
 
   void test_parseNormalFormalParameter_simple_const_noType() {
-    SimpleFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalParameter", "const a)", []);
+    SimpleFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalParameter", "const a)");
     expect(parameter.keyword, isNotNull);
     expect(parameter.type, isNull);
     expect(parameter.identifier, isNotNull);
   }
 
   void test_parseNormalFormalParameter_simple_const_type() {
-    SimpleFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalParameter", "const A a)", []);
+    SimpleFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalParameter", "const A a)");
     expect(parameter.keyword, isNotNull);
     expect(parameter.type, isNotNull);
     expect(parameter.identifier, isNotNull);
   }
 
   void test_parseNormalFormalParameter_simple_final_noType() {
-    SimpleFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalParameter", "final a)", []);
+    SimpleFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalParameter", "final a)");
     expect(parameter.keyword, isNotNull);
     expect(parameter.type, isNull);
     expect(parameter.identifier, isNotNull);
   }
 
   void test_parseNormalFormalParameter_simple_final_type() {
-    SimpleFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalParameter", "final A a)", []);
+    SimpleFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalParameter", "final A a)");
     expect(parameter.keyword, isNotNull);
     expect(parameter.type, isNotNull);
     expect(parameter.identifier, isNotNull);
   }
 
   void test_parseNormalFormalParameter_simple_noType() {
-    SimpleFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalParameter", "a)", []);
+    SimpleFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalParameter", "a)");
     expect(parameter.keyword, isNull);
     expect(parameter.type, isNull);
     expect(parameter.identifier, isNotNull);
   }
 
   void test_parseNormalFormalParameter_simple_type() {
-    SimpleFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalParameter", "A a)", []);
+    SimpleFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalParameter", "A a)");
     expect(parameter.keyword, isNull);
     expect(parameter.type, isNotNull);
     expect(parameter.identifier, isNotNull);
@@ -6984,7 +7078,7 @@
   void test_parseOperator() {
     Comment comment = Comment.createDocumentationComment(new List<Token>(0));
     TypeName returnType = new TypeName(new SimpleIdentifier(null), null);
-    MethodDeclaration method = ParserTestCase.parse("parseOperator", <Object> [commentAndMetadata(comment, []), null, returnType], "operator +(A a);");
+    MethodDeclaration method = ParserTestCase.parse("parseOperator", <Object> [commentAndMetadata(comment), null, returnType], "operator +(A a);");
     expect(method.body, isNotNull);
     expect(method.documentationComment, comment);
     expect(method.externalKeyword, isNull);
@@ -7016,167 +7110,167 @@
   }
 
   void test_parsePostfixExpression_decrement() {
-    PostfixExpression expression = ParserTestCase.parse4("parsePostfixExpression", "i--", []);
+    PostfixExpression expression = ParserTestCase.parse4("parsePostfixExpression", "i--");
     expect(expression.operand, isNotNull);
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.MINUS_MINUS);
   }
 
   void test_parsePostfixExpression_increment() {
-    PostfixExpression expression = ParserTestCase.parse4("parsePostfixExpression", "i++", []);
+    PostfixExpression expression = ParserTestCase.parse4("parsePostfixExpression", "i++");
     expect(expression.operand, isNotNull);
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.PLUS_PLUS);
   }
 
   void test_parsePostfixExpression_none_indexExpression() {
-    IndexExpression expression = ParserTestCase.parse4("parsePostfixExpression", "a[0]", []);
+    IndexExpression expression = ParserTestCase.parse4("parsePostfixExpression", "a[0]");
     expect(expression.target, isNotNull);
     expect(expression.index, isNotNull);
   }
 
   void test_parsePostfixExpression_none_methodInvocation() {
-    MethodInvocation expression = ParserTestCase.parse4("parsePostfixExpression", "a.m()", []);
+    MethodInvocation expression = ParserTestCase.parse4("parsePostfixExpression", "a.m()");
     expect(expression.target, isNotNull);
     expect(expression.methodName, isNotNull);
     expect(expression.argumentList, isNotNull);
   }
 
   void test_parsePostfixExpression_none_propertyAccess() {
-    PrefixedIdentifier expression = ParserTestCase.parse4("parsePostfixExpression", "a.b", []);
+    PrefixedIdentifier expression = ParserTestCase.parse4("parsePostfixExpression", "a.b");
     expect(expression.prefix, isNotNull);
     expect(expression.identifier, isNotNull);
   }
 
   void test_parsePrefixedIdentifier_noPrefix() {
     String lexeme = "bar";
-    SimpleIdentifier identifier = ParserTestCase.parse4("parsePrefixedIdentifier", lexeme, []);
+    SimpleIdentifier identifier = ParserTestCase.parse4("parsePrefixedIdentifier", lexeme);
     expect(identifier.token, isNotNull);
     expect(identifier.name, lexeme);
   }
 
   void test_parsePrefixedIdentifier_prefix() {
     String lexeme = "foo.bar";
-    PrefixedIdentifier identifier = ParserTestCase.parse4("parsePrefixedIdentifier", lexeme, []);
+    PrefixedIdentifier identifier = ParserTestCase.parse4("parsePrefixedIdentifier", lexeme);
     expect(identifier.prefix.name, "foo");
     expect(identifier.period, isNotNull);
     expect(identifier.identifier.name, "bar");
   }
 
   void test_parsePrimaryExpression_const() {
-    InstanceCreationExpression expression = ParserTestCase.parse4("parsePrimaryExpression", "const A()", []);
+    InstanceCreationExpression expression = ParserTestCase.parse4("parsePrimaryExpression", "const A()");
     expect(expression, isNotNull);
   }
 
   void test_parsePrimaryExpression_double() {
     String doubleLiteral = "3.2e4";
-    DoubleLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", doubleLiteral, []);
+    DoubleLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", doubleLiteral);
     expect(literal.literal, isNotNull);
     expect(literal.value, double.parse(doubleLiteral));
   }
 
   void test_parsePrimaryExpression_false() {
-    BooleanLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", "false", []);
+    BooleanLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", "false");
     expect(literal.literal, isNotNull);
     expect(literal.value, isFalse);
   }
 
   void test_parsePrimaryExpression_function_arguments() {
-    FunctionExpression expression = ParserTestCase.parse4("parsePrimaryExpression", "(int i) => i + 1", []);
+    FunctionExpression expression = ParserTestCase.parse4("parsePrimaryExpression", "(int i) => i + 1");
     expect(expression.parameters, isNotNull);
     expect(expression.body, isNotNull);
   }
 
   void test_parsePrimaryExpression_function_noArguments() {
-    FunctionExpression expression = ParserTestCase.parse4("parsePrimaryExpression", "() => 42", []);
+    FunctionExpression expression = ParserTestCase.parse4("parsePrimaryExpression", "() => 42");
     expect(expression.parameters, isNotNull);
     expect(expression.body, isNotNull);
   }
 
   void test_parsePrimaryExpression_hex() {
     String hexLiteral = "3F";
-    IntegerLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", "0x$hexLiteral", []);
+    IntegerLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", "0x$hexLiteral");
     expect(literal.literal, isNotNull);
     expect(literal.value, int.parse(hexLiteral, radix: 16));
   }
 
   void test_parsePrimaryExpression_identifier() {
-    SimpleIdentifier identifier = ParserTestCase.parse4("parsePrimaryExpression", "a", []);
+    SimpleIdentifier identifier = ParserTestCase.parse4("parsePrimaryExpression", "a");
     expect(identifier, isNotNull);
   }
 
   void test_parsePrimaryExpression_int() {
     String intLiteral = "472";
-    IntegerLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", intLiteral, []);
+    IntegerLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", intLiteral);
     expect(literal.literal, isNotNull);
     expect(literal.value, int.parse(intLiteral));
   }
 
   void test_parsePrimaryExpression_listLiteral() {
-    ListLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", "[ ]", []);
+    ListLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", "[ ]");
     expect(literal, isNotNull);
   }
 
   void test_parsePrimaryExpression_listLiteral_index() {
-    ListLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", "[]", []);
+    ListLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", "[]");
     expect(literal, isNotNull);
   }
 
   void test_parsePrimaryExpression_listLiteral_typed() {
-    ListLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", "<A>[ ]", []);
+    ListLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", "<A>[ ]");
     expect(literal.typeArguments, isNotNull);
     expect(literal.typeArguments.arguments, hasLength(1));
   }
 
   void test_parsePrimaryExpression_mapLiteral() {
-    MapLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", "{}", []);
+    MapLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", "{}");
     expect(literal, isNotNull);
   }
 
   void test_parsePrimaryExpression_mapLiteral_typed() {
-    MapLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", "<A, B>{}", []);
+    MapLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", "<A, B>{}");
     expect(literal.typeArguments, isNotNull);
     expect(literal.typeArguments.arguments, hasLength(2));
   }
 
   void test_parsePrimaryExpression_new() {
-    InstanceCreationExpression expression = ParserTestCase.parse4("parsePrimaryExpression", "new A()", []);
+    InstanceCreationExpression expression = ParserTestCase.parse4("parsePrimaryExpression", "new A()");
     expect(expression, isNotNull);
   }
 
   void test_parsePrimaryExpression_null() {
-    NullLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", "null", []);
+    NullLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", "null");
     expect(literal.literal, isNotNull);
   }
 
   void test_parsePrimaryExpression_parenthesized() {
-    ParenthesizedExpression expression = ParserTestCase.parse4("parsePrimaryExpression", "(x)", []);
+    ParenthesizedExpression expression = ParserTestCase.parse4("parsePrimaryExpression", "(x)");
     expect(expression, isNotNull);
   }
 
   void test_parsePrimaryExpression_string() {
-    SimpleStringLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", "\"string\"", []);
+    SimpleStringLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", "\"string\"");
     expect(literal.isMultiline, isFalse);
     expect(literal.isRaw, isFalse);
     expect(literal.value, "string");
   }
 
   void test_parsePrimaryExpression_string_multiline() {
-    SimpleStringLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", "'''string'''", []);
+    SimpleStringLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", "'''string'''");
     expect(literal.isMultiline, isTrue);
     expect(literal.isRaw, isFalse);
     expect(literal.value, "string");
   }
 
   void test_parsePrimaryExpression_string_raw() {
-    SimpleStringLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", "r'string'", []);
+    SimpleStringLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", "r'string'");
     expect(literal.isMultiline, isFalse);
     expect(literal.isRaw, isTrue);
     expect(literal.value, "string");
   }
 
   void test_parsePrimaryExpression_super() {
-    PropertyAccess propertyAccess = ParserTestCase.parse4("parsePrimaryExpression", "super.x", []);
+    PropertyAccess propertyAccess = ParserTestCase.parse4("parsePrimaryExpression", "super.x");
     expect(propertyAccess.target is SuperExpression, isTrue);
     expect(propertyAccess.operator, isNotNull);
     expect(propertyAccess.operator.type, TokenType.PERIOD);
@@ -7184,12 +7278,12 @@
   }
 
   void test_parsePrimaryExpression_this() {
-    ThisExpression expression = ParserTestCase.parse4("parsePrimaryExpression", "this", []);
+    ThisExpression expression = ParserTestCase.parse4("parsePrimaryExpression", "this");
     expect(expression.keyword, isNotNull);
   }
 
   void test_parsePrimaryExpression_true() {
-    BooleanLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", "true", []);
+    BooleanLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", "true");
     expect(literal.literal, isNotNull);
     expect(literal.value, isTrue);
   }
@@ -7199,7 +7293,7 @@
   }
 
   void test_parseRedirectingConstructorInvocation_named() {
-    RedirectingConstructorInvocation invocation = ParserTestCase.parse4("parseRedirectingConstructorInvocation", "this.a()", []);
+    RedirectingConstructorInvocation invocation = ParserTestCase.parse4("parseRedirectingConstructorInvocation", "this.a()");
     expect(invocation.argumentList, isNotNull);
     expect(invocation.constructorName, isNotNull);
     expect(invocation.keyword, isNotNull);
@@ -7207,7 +7301,7 @@
   }
 
   void test_parseRedirectingConstructorInvocation_unnamed() {
-    RedirectingConstructorInvocation invocation = ParserTestCase.parse4("parseRedirectingConstructorInvocation", "this()", []);
+    RedirectingConstructorInvocation invocation = ParserTestCase.parse4("parseRedirectingConstructorInvocation", "this()");
     expect(invocation.argumentList, isNotNull);
     expect(invocation.constructorName, isNull);
     expect(invocation.keyword, isNotNull);
@@ -7215,14 +7309,14 @@
   }
 
   void test_parseRelationalExpression_as() {
-    AsExpression expression = ParserTestCase.parse4("parseRelationalExpression", "x as Y", []);
+    AsExpression expression = ParserTestCase.parse4("parseRelationalExpression", "x as Y");
     expect(expression.expression, isNotNull);
     expect(expression.asOperator, isNotNull);
     expect(expression.type, isNotNull);
   }
 
   void test_parseRelationalExpression_is() {
-    IsExpression expression = ParserTestCase.parse4("parseRelationalExpression", "x is y", []);
+    IsExpression expression = ParserTestCase.parse4("parseRelationalExpression", "x is y");
     expect(expression.expression, isNotNull);
     expect(expression.isOperator, isNotNull);
     expect(expression.notOperator, isNull);
@@ -7230,7 +7324,7 @@
   }
 
   void test_parseRelationalExpression_isNot() {
-    IsExpression expression = ParserTestCase.parse4("parseRelationalExpression", "x is! y", []);
+    IsExpression expression = ParserTestCase.parse4("parseRelationalExpression", "x is! y");
     expect(expression.expression, isNotNull);
     expect(expression.isOperator, isNotNull);
     expect(expression.notOperator, isNotNull);
@@ -7238,7 +7332,7 @@
   }
 
   void test_parseRelationalExpression_normal() {
-    BinaryExpression expression = ParserTestCase.parse4("parseRelationalExpression", "x < y", []);
+    BinaryExpression expression = ParserTestCase.parse4("parseRelationalExpression", "x < y");
     expect(expression.leftOperand, isNotNull);
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.LT);
@@ -7246,7 +7340,7 @@
   }
 
   void test_parseRelationalExpression_super() {
-    BinaryExpression expression = ParserTestCase.parse4("parseRelationalExpression", "super < y", []);
+    BinaryExpression expression = ParserTestCase.parse4("parseRelationalExpression", "super < y");
     expect(expression.leftOperand, isNotNull);
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.LT);
@@ -7254,32 +7348,32 @@
   }
 
   void test_parseRethrowExpression() {
-    RethrowExpression expression = ParserTestCase.parse4("parseRethrowExpression", "rethrow;", []);
+    RethrowExpression expression = ParserTestCase.parse4("parseRethrowExpression", "rethrow;");
     expect(expression.keyword, isNotNull);
   }
 
   void test_parseReturnStatement_noValue() {
-    ReturnStatement statement = ParserTestCase.parse4("parseReturnStatement", "return;", []);
+    ReturnStatement statement = ParserTestCase.parse4("parseReturnStatement", "return;");
     expect(statement.keyword, isNotNull);
     expect(statement.expression, isNull);
     expect(statement.semicolon, isNotNull);
   }
 
   void test_parseReturnStatement_value() {
-    ReturnStatement statement = ParserTestCase.parse4("parseReturnStatement", "return x;", []);
+    ReturnStatement statement = ParserTestCase.parse4("parseReturnStatement", "return x;");
     expect(statement.keyword, isNotNull);
     expect(statement.expression, isNotNull);
     expect(statement.semicolon, isNotNull);
   }
 
   void test_parseReturnType_nonVoid() {
-    TypeName typeName = ParserTestCase.parse4("parseReturnType", "A<B>", []);
+    TypeName typeName = ParserTestCase.parse4("parseReturnType", "A<B>");
     expect(typeName.name, isNotNull);
     expect(typeName.typeArguments, isNotNull);
   }
 
   void test_parseReturnType_void() {
-    TypeName typeName = ParserTestCase.parse4("parseReturnType", "void", []);
+    TypeName typeName = ParserTestCase.parse4("parseReturnType", "void");
     expect(typeName.name, isNotNull);
     expect(typeName.typeArguments, isNull);
   }
@@ -7287,7 +7381,7 @@
   void test_parseSetter_nonStatic() {
     Comment comment = Comment.createDocumentationComment(new List<Token>(0));
     TypeName returnType = new TypeName(new SimpleIdentifier(null), null);
-    MethodDeclaration method = ParserTestCase.parse("parseSetter", <Object> [commentAndMetadata(comment, []), null, null, returnType], "set a(var x);");
+    MethodDeclaration method = ParserTestCase.parse("parseSetter", <Object> [commentAndMetadata(comment), null, null, returnType], "set a(var x);");
     expect(method.body, isNotNull);
     expect(method.documentationComment, comment);
     expect(method.externalKeyword, isNull);
@@ -7304,7 +7398,7 @@
     Token staticKeyword = TokenFactory.tokenFromKeyword(Keyword.STATIC);
     TypeName returnType = new TypeName(new SimpleIdentifier(null), null);
     MethodDeclaration method = ParserTestCase.parse("parseSetter", <Object> [
-        commentAndMetadata(comment, []),
+        commentAndMetadata(comment),
         null,
         staticKeyword,
         returnType], "set a(var x) {}");
@@ -7320,7 +7414,7 @@
   }
 
   void test_parseShiftExpression_normal() {
-    BinaryExpression expression = ParserTestCase.parse4("parseShiftExpression", "x << y", []);
+    BinaryExpression expression = ParserTestCase.parse4("parseShiftExpression", "x << y");
     expect(expression.leftOperand, isNotNull);
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.LT_LT);
@@ -7328,7 +7422,7 @@
   }
 
   void test_parseShiftExpression_super() {
-    BinaryExpression expression = ParserTestCase.parse4("parseShiftExpression", "super << y", []);
+    BinaryExpression expression = ParserTestCase.parse4("parseShiftExpression", "super << y");
     expect(expression.leftOperand, isNotNull);
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.LT_LT);
@@ -7337,14 +7431,14 @@
 
   void test_parseSimpleIdentifier_builtInIdentifier() {
     String lexeme = "as";
-    SimpleIdentifier identifier = ParserTestCase.parse4("parseSimpleIdentifier", lexeme, []);
+    SimpleIdentifier identifier = ParserTestCase.parse4("parseSimpleIdentifier", lexeme);
     expect(identifier.token, isNotNull);
     expect(identifier.name, lexeme);
   }
 
   void test_parseSimpleIdentifier_normalIdentifier() {
     String lexeme = "foo";
-    SimpleIdentifier identifier = ParserTestCase.parse4("parseSimpleIdentifier", lexeme, []);
+    SimpleIdentifier identifier = ParserTestCase.parse4("parseSimpleIdentifier", lexeme);
     expect(identifier.token, isNotNull);
     expect(identifier.name, lexeme);
   }
@@ -7355,38 +7449,38 @@
 
   void test_parseStatement_functionDeclaration() {
     // TODO(brianwilkerson) Implement more tests for this method.
-    FunctionDeclarationStatement statement = ParserTestCase.parse4("parseStatement", "int f(a, b) {};", []);
+    FunctionDeclarationStatement statement = ParserTestCase.parse4("parseStatement", "int f(a, b) {};");
     expect(statement.functionDeclaration, isNotNull);
   }
 
   void test_parseStatement_mulipleLabels() {
-    LabeledStatement statement = ParserTestCase.parse4("parseStatement", "l: m: return x;", []);
+    LabeledStatement statement = ParserTestCase.parse4("parseStatement", "l: m: return x;");
     expect(statement.labels, hasLength(2));
     expect(statement.statement, isNotNull);
   }
 
   void test_parseStatement_noLabels() {
-    ParserTestCase.parse4("parseStatement", "return x;", []);
+    ParserTestCase.parse4("parseStatement", "return x;");
   }
 
   void test_parseStatement_singleLabel() {
-    LabeledStatement statement = ParserTestCase.parse4("parseStatement", "l: return x;", []);
+    LabeledStatement statement = ParserTestCase.parse4("parseStatement", "l: return x;");
     expect(statement.labels, hasLength(1));
     expect(statement.statement, isNotNull);
   }
 
   void test_parseStatements_multiple() {
-    List<Statement> statements = ParserTestCase.parseStatements("return; return;", 2, []);
+    List<Statement> statements = ParserTestCase.parseStatements("return; return;", 2);
     expect(statements, hasLength(2));
   }
 
   void test_parseStatements_single() {
-    List<Statement> statements = ParserTestCase.parseStatements("return;", 1, []);
+    List<Statement> statements = ParserTestCase.parseStatements("return;", 1);
     expect(statements, hasLength(1));
   }
 
   void test_parseStringLiteral_adjacent() {
-    AdjacentStrings literal = ParserTestCase.parse4("parseStringLiteral", "'a' 'b'", []);
+    AdjacentStrings literal = ParserTestCase.parse4("parseStringLiteral", "'a' 'b'");
     NodeList<StringLiteral> strings = literal.strings;
     expect(strings, hasLength(2));
     StringLiteral firstString = strings[0];
@@ -7396,7 +7490,7 @@
   }
 
   void test_parseStringLiteral_interpolated() {
-    StringInterpolation literal = ParserTestCase.parse4("parseStringLiteral", "'a \${b} c \$this d'", []);
+    StringInterpolation literal = ParserTestCase.parse4("parseStringLiteral", "'a \${b} c \$this d'");
     NodeList<InterpolationElement> elements = literal.elements;
     expect(elements, hasLength(5));
     expect(elements[0] is InterpolationString, isTrue);
@@ -7407,13 +7501,13 @@
   }
 
   void test_parseStringLiteral_single() {
-    SimpleStringLiteral literal = ParserTestCase.parse4("parseStringLiteral", "'a'", []);
+    SimpleStringLiteral literal = ParserTestCase.parse4("parseStringLiteral", "'a'");
     expect(literal.literal, isNotNull);
     expect(literal.value, "a");
   }
 
   void test_parseSuperConstructorInvocation_named() {
-    SuperConstructorInvocation invocation = ParserTestCase.parse4("parseSuperConstructorInvocation", "super.a()", []);
+    SuperConstructorInvocation invocation = ParserTestCase.parse4("parseSuperConstructorInvocation", "super.a()");
     expect(invocation.argumentList, isNotNull);
     expect(invocation.constructorName, isNotNull);
     expect(invocation.keyword, isNotNull);
@@ -7421,7 +7515,7 @@
   }
 
   void test_parseSuperConstructorInvocation_unnamed() {
-    SuperConstructorInvocation invocation = ParserTestCase.parse4("parseSuperConstructorInvocation", "super()", []);
+    SuperConstructorInvocation invocation = ParserTestCase.parse4("parseSuperConstructorInvocation", "super()");
     expect(invocation.argumentList, isNotNull);
     expect(invocation.constructorName, isNull);
     expect(invocation.keyword, isNotNull);
@@ -7429,7 +7523,7 @@
   }
 
   void test_parseSwitchStatement_case() {
-    SwitchStatement statement = ParserTestCase.parse4("parseSwitchStatement", "switch (a) {case 1: return 'I';}", []);
+    SwitchStatement statement = ParserTestCase.parse4("parseSwitchStatement", "switch (a) {case 1: return 'I';}");
     expect(statement.keyword, isNotNull);
     expect(statement.leftParenthesis, isNotNull);
     expect(statement.expression, isNotNull);
@@ -7440,7 +7534,7 @@
   }
 
   void test_parseSwitchStatement_empty() {
-    SwitchStatement statement = ParserTestCase.parse4("parseSwitchStatement", "switch (a) {}", []);
+    SwitchStatement statement = ParserTestCase.parse4("parseSwitchStatement", "switch (a) {}");
     expect(statement.keyword, isNotNull);
     expect(statement.leftParenthesis, isNotNull);
     expect(statement.expression, isNotNull);
@@ -7451,7 +7545,7 @@
   }
 
   void test_parseSwitchStatement_labeledCase() {
-    SwitchStatement statement = ParserTestCase.parse4("parseSwitchStatement", "switch (a) {l1: l2: l3: case(1):}", []);
+    SwitchStatement statement = ParserTestCase.parse4("parseSwitchStatement", "switch (a) {l1: l2: l3: case(1):}");
     expect(statement.keyword, isNotNull);
     expect(statement.leftParenthesis, isNotNull);
     expect(statement.expression, isNotNull);
@@ -7463,7 +7557,7 @@
   }
 
   void test_parseSwitchStatement_labeledStatementInCase() {
-    SwitchStatement statement = ParserTestCase.parse4("parseSwitchStatement", "switch (a) {case 0: f(); l1: g(); break;}", []);
+    SwitchStatement statement = ParserTestCase.parse4("parseSwitchStatement", "switch (a) {case 0: f(); l1: g(); break;}");
     expect(statement.keyword, isNotNull);
     expect(statement.leftParenthesis, isNotNull);
     expect(statement.expression, isNotNull);
@@ -7475,7 +7569,7 @@
   }
 
   void test_parseSymbolLiteral_builtInIdentifier() {
-    SymbolLiteral literal = ParserTestCase.parse4("parseSymbolLiteral", "#dynamic.static.abstract", []);
+    SymbolLiteral literal = ParserTestCase.parse4("parseSymbolLiteral", "#dynamic.static.abstract");
     expect(literal.poundSign, isNotNull);
     List<Token> components = literal.components;
     expect(components, hasLength(3));
@@ -7485,7 +7579,7 @@
   }
 
   void test_parseSymbolLiteral_multiple() {
-    SymbolLiteral literal = ParserTestCase.parse4("parseSymbolLiteral", "#a.b.c", []);
+    SymbolLiteral literal = ParserTestCase.parse4("parseSymbolLiteral", "#a.b.c");
     expect(literal.poundSign, isNotNull);
     List<Token> components = literal.components;
     expect(components, hasLength(3));
@@ -7495,7 +7589,7 @@
   }
 
   void test_parseSymbolLiteral_operator() {
-    SymbolLiteral literal = ParserTestCase.parse4("parseSymbolLiteral", "#==", []);
+    SymbolLiteral literal = ParserTestCase.parse4("parseSymbolLiteral", "#==");
     expect(literal.poundSign, isNotNull);
     List<Token> components = literal.components;
     expect(components, hasLength(1));
@@ -7503,7 +7597,7 @@
   }
 
   void test_parseSymbolLiteral_single() {
-    SymbolLiteral literal = ParserTestCase.parse4("parseSymbolLiteral", "#a", []);
+    SymbolLiteral literal = ParserTestCase.parse4("parseSymbolLiteral", "#a");
     expect(literal.poundSign, isNotNull);
     List<Token> components = literal.components;
     expect(components, hasLength(1));
@@ -7511,7 +7605,7 @@
   }
 
   void test_parseSymbolLiteral_void() {
-    SymbolLiteral literal = ParserTestCase.parse4("parseSymbolLiteral", "#void", []);
+    SymbolLiteral literal = ParserTestCase.parse4("parseSymbolLiteral", "#void");
     expect(literal.poundSign, isNotNull);
     List<Token> components = literal.components;
     expect(components, hasLength(1));
@@ -7519,19 +7613,19 @@
   }
 
   void test_parseThrowExpression() {
-    ThrowExpression expression = ParserTestCase.parse4("parseThrowExpression", "throw x;", []);
+    ThrowExpression expression = ParserTestCase.parse4("parseThrowExpression", "throw x;");
     expect(expression.keyword, isNotNull);
     expect(expression.expression, isNotNull);
   }
 
   void test_parseThrowExpressionWithoutCascade() {
-    ThrowExpression expression = ParserTestCase.parse4("parseThrowExpressionWithoutCascade", "throw x;", []);
+    ThrowExpression expression = ParserTestCase.parse4("parseThrowExpressionWithoutCascade", "throw x;");
     expect(expression.keyword, isNotNull);
     expect(expression.expression, isNotNull);
   }
 
   void test_parseTryStatement_catch() {
-    TryStatement statement = ParserTestCase.parse4("parseTryStatement", "try {} catch (e) {}", []);
+    TryStatement statement = ParserTestCase.parse4("parseTryStatement", "try {} catch (e) {}");
     expect(statement.tryKeyword, isNotNull);
     expect(statement.body, isNotNull);
     NodeList<CatchClause> catchClauses = statement.catchClauses;
@@ -7549,7 +7643,7 @@
   }
 
   void test_parseTryStatement_catch_finally() {
-    TryStatement statement = ParserTestCase.parse4("parseTryStatement", "try {} catch (e, s) {} finally {}", []);
+    TryStatement statement = ParserTestCase.parse4("parseTryStatement", "try {} catch (e, s) {} finally {}");
     expect(statement.tryKeyword, isNotNull);
     expect(statement.body, isNotNull);
     NodeList<CatchClause> catchClauses = statement.catchClauses;
@@ -7567,7 +7661,7 @@
   }
 
   void test_parseTryStatement_finally() {
-    TryStatement statement = ParserTestCase.parse4("parseTryStatement", "try {} finally {}", []);
+    TryStatement statement = ParserTestCase.parse4("parseTryStatement", "try {} finally {}");
     expect(statement.tryKeyword, isNotNull);
     expect(statement.body, isNotNull);
     expect(statement.catchClauses, hasLength(0));
@@ -7576,7 +7670,7 @@
   }
 
   void test_parseTryStatement_multiple() {
-    TryStatement statement = ParserTestCase.parse4("parseTryStatement", "try {} on NPE catch (e) {} on Error {} catch (e) {}", []);
+    TryStatement statement = ParserTestCase.parse4("parseTryStatement", "try {} on NPE catch (e) {} on Error {} catch (e) {}");
     expect(statement.tryKeyword, isNotNull);
     expect(statement.body, isNotNull);
     expect(statement.catchClauses, hasLength(3));
@@ -7585,7 +7679,7 @@
   }
 
   void test_parseTryStatement_on() {
-    TryStatement statement = ParserTestCase.parse4("parseTryStatement", "try {} on Error {}", []);
+    TryStatement statement = ParserTestCase.parse4("parseTryStatement", "try {} on Error {}");
     expect(statement.tryKeyword, isNotNull);
     expect(statement.body, isNotNull);
     NodeList<CatchClause> catchClauses = statement.catchClauses;
@@ -7603,7 +7697,7 @@
   }
 
   void test_parseTryStatement_on_catch() {
-    TryStatement statement = ParserTestCase.parse4("parseTryStatement", "try {} on Error catch (e, s) {}", []);
+    TryStatement statement = ParserTestCase.parse4("parseTryStatement", "try {} on Error catch (e, s) {}");
     expect(statement.tryKeyword, isNotNull);
     expect(statement.body, isNotNull);
     NodeList<CatchClause> catchClauses = statement.catchClauses;
@@ -7621,7 +7715,7 @@
   }
 
   void test_parseTryStatement_on_catch_finally() {
-    TryStatement statement = ParserTestCase.parse4("parseTryStatement", "try {} on Error catch (e, s) {} finally {}", []);
+    TryStatement statement = ParserTestCase.parse4("parseTryStatement", "try {} on Error catch (e, s) {} finally {}");
     expect(statement.tryKeyword, isNotNull);
     expect(statement.body, isNotNull);
     NodeList<CatchClause> catchClauses = statement.catchClauses;
@@ -7699,14 +7793,14 @@
   }
 
   void test_parseTypeArgumentList_multiple() {
-    TypeArgumentList argumentList = ParserTestCase.parse4("parseTypeArgumentList", "<int, int, int>", []);
+    TypeArgumentList argumentList = ParserTestCase.parse4("parseTypeArgumentList", "<int, int, int>");
     expect(argumentList.leftBracket, isNotNull);
     expect(argumentList.arguments, hasLength(3));
     expect(argumentList.rightBracket, isNotNull);
   }
 
   void test_parseTypeArgumentList_nested() {
-    TypeArgumentList argumentList = ParserTestCase.parse4("parseTypeArgumentList", "<A<B>>", []);
+    TypeArgumentList argumentList = ParserTestCase.parse4("parseTypeArgumentList", "<A<B>>");
     expect(argumentList.leftBracket, isNotNull);
     expect(argumentList.arguments, hasLength(1));
     TypeName argument = argumentList.arguments[0];
@@ -7718,75 +7812,75 @@
   }
 
   void test_parseTypeArgumentList_single() {
-    TypeArgumentList argumentList = ParserTestCase.parse4("parseTypeArgumentList", "<int>", []);
+    TypeArgumentList argumentList = ParserTestCase.parse4("parseTypeArgumentList", "<int>");
     expect(argumentList.leftBracket, isNotNull);
     expect(argumentList.arguments, hasLength(1));
     expect(argumentList.rightBracket, isNotNull);
   }
 
   void test_parseTypeName_parameterized() {
-    TypeName typeName = ParserTestCase.parse4("parseTypeName", "List<int>", []);
+    TypeName typeName = ParserTestCase.parse4("parseTypeName", "List<int>");
     expect(typeName.name, isNotNull);
     expect(typeName.typeArguments, isNotNull);
   }
 
   void test_parseTypeName_simple() {
-    TypeName typeName = ParserTestCase.parse4("parseTypeName", "int", []);
+    TypeName typeName = ParserTestCase.parse4("parseTypeName", "int");
     expect(typeName.name, isNotNull);
     expect(typeName.typeArguments, isNull);
   }
 
   void test_parseTypeParameter_bounded() {
-    TypeParameter parameter = ParserTestCase.parse4("parseTypeParameter", "A extends B", []);
+    TypeParameter parameter = ParserTestCase.parse4("parseTypeParameter", "A extends B");
     expect(parameter.bound, isNotNull);
     expect(parameter.keyword, isNotNull);
     expect(parameter.name, isNotNull);
   }
 
   void test_parseTypeParameter_simple() {
-    TypeParameter parameter = ParserTestCase.parse4("parseTypeParameter", "A", []);
+    TypeParameter parameter = ParserTestCase.parse4("parseTypeParameter", "A");
     expect(parameter.bound, isNull);
     expect(parameter.keyword, isNull);
     expect(parameter.name, isNotNull);
   }
 
   void test_parseTypeParameterList_multiple() {
-    TypeParameterList parameterList = ParserTestCase.parse4("parseTypeParameterList", "<A, B extends C, D>", []);
+    TypeParameterList parameterList = ParserTestCase.parse4("parseTypeParameterList", "<A, B extends C, D>");
     expect(parameterList.leftBracket, isNotNull);
     expect(parameterList.rightBracket, isNotNull);
     expect(parameterList.typeParameters, hasLength(3));
   }
 
   void test_parseTypeParameterList_parameterizedWithTrailingEquals() {
-    TypeParameterList parameterList = ParserTestCase.parse4("parseTypeParameterList", "<A extends B<E>>=", []);
+    TypeParameterList parameterList = ParserTestCase.parse4("parseTypeParameterList", "<A extends B<E>>=");
     expect(parameterList.leftBracket, isNotNull);
     expect(parameterList.rightBracket, isNotNull);
     expect(parameterList.typeParameters, hasLength(1));
   }
 
   void test_parseTypeParameterList_single() {
-    TypeParameterList parameterList = ParserTestCase.parse4("parseTypeParameterList", "<A>", []);
+    TypeParameterList parameterList = ParserTestCase.parse4("parseTypeParameterList", "<A>");
     expect(parameterList.leftBracket, isNotNull);
     expect(parameterList.rightBracket, isNotNull);
     expect(parameterList.typeParameters, hasLength(1));
   }
 
   void test_parseTypeParameterList_withTrailingEquals() {
-    TypeParameterList parameterList = ParserTestCase.parse4("parseTypeParameterList", "<A>=", []);
+    TypeParameterList parameterList = ParserTestCase.parse4("parseTypeParameterList", "<A>=");
     expect(parameterList.leftBracket, isNotNull);
     expect(parameterList.rightBracket, isNotNull);
     expect(parameterList.typeParameters, hasLength(1));
   }
 
   void test_parseUnaryExpression_decrement_normal() {
-    PrefixExpression expression = ParserTestCase.parse4("parseUnaryExpression", "--x", []);
+    PrefixExpression expression = ParserTestCase.parse4("parseUnaryExpression", "--x");
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.MINUS_MINUS);
     expect(expression.operand, isNotNull);
   }
 
   void test_parseUnaryExpression_decrement_super() {
-    PrefixExpression expression = ParserTestCase.parse4("parseUnaryExpression", "--super", []);
+    PrefixExpression expression = ParserTestCase.parse4("parseUnaryExpression", "--super");
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.MINUS);
     Expression innerExpression = expression.operand;
@@ -7799,7 +7893,7 @@
   }
 
   void test_parseUnaryExpression_decrement_super_propertyAccess() {
-    PrefixExpression expression = ParserTestCase.parse4("parseUnaryExpression", "--super.x", []);
+    PrefixExpression expression = ParserTestCase.parse4("parseUnaryExpression", "--super.x");
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.MINUS_MINUS);
     expect(expression.operand, isNotNull);
@@ -7809,14 +7903,14 @@
   }
 
   void test_parseUnaryExpression_increment_normal() {
-    PrefixExpression expression = ParserTestCase.parse4("parseUnaryExpression", "++x", []);
+    PrefixExpression expression = ParserTestCase.parse4("parseUnaryExpression", "++x");
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.PLUS_PLUS);
     expect(expression.operand, isNotNull);
   }
 
   void test_parseUnaryExpression_increment_super_index() {
-    PrefixExpression expression = ParserTestCase.parse4("parseUnaryExpression", "++super[0]", []);
+    PrefixExpression expression = ParserTestCase.parse4("parseUnaryExpression", "++super[0]");
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.PLUS_PLUS);
     expect(expression.operand, isNotNull);
@@ -7826,7 +7920,7 @@
   }
 
   void test_parseUnaryExpression_increment_super_propertyAccess() {
-    PrefixExpression expression = ParserTestCase.parse4("parseUnaryExpression", "++super.x", []);
+    PrefixExpression expression = ParserTestCase.parse4("parseUnaryExpression", "++super.x");
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.PLUS_PLUS);
     expect(expression.operand, isNotNull);
@@ -7836,56 +7930,56 @@
   }
 
   void test_parseUnaryExpression_minus_normal() {
-    PrefixExpression expression = ParserTestCase.parse4("parseUnaryExpression", "-x", []);
+    PrefixExpression expression = ParserTestCase.parse4("parseUnaryExpression", "-x");
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.MINUS);
     expect(expression.operand, isNotNull);
   }
 
   void test_parseUnaryExpression_minus_super() {
-    PrefixExpression expression = ParserTestCase.parse4("parseUnaryExpression", "-super", []);
+    PrefixExpression expression = ParserTestCase.parse4("parseUnaryExpression", "-super");
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.MINUS);
     expect(expression.operand, isNotNull);
   }
 
   void test_parseUnaryExpression_not_normal() {
-    PrefixExpression expression = ParserTestCase.parse4("parseUnaryExpression", "!x", []);
+    PrefixExpression expression = ParserTestCase.parse4("parseUnaryExpression", "!x");
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.BANG);
     expect(expression.operand, isNotNull);
   }
 
   void test_parseUnaryExpression_not_super() {
-    PrefixExpression expression = ParserTestCase.parse4("parseUnaryExpression", "!super", []);
+    PrefixExpression expression = ParserTestCase.parse4("parseUnaryExpression", "!super");
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.BANG);
     expect(expression.operand, isNotNull);
   }
 
   void test_parseUnaryExpression_tilda_normal() {
-    PrefixExpression expression = ParserTestCase.parse4("parseUnaryExpression", "~x", []);
+    PrefixExpression expression = ParserTestCase.parse4("parseUnaryExpression", "~x");
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.TILDE);
     expect(expression.operand, isNotNull);
   }
 
   void test_parseUnaryExpression_tilda_super() {
-    PrefixExpression expression = ParserTestCase.parse4("parseUnaryExpression", "~super", []);
+    PrefixExpression expression = ParserTestCase.parse4("parseUnaryExpression", "~super");
     expect(expression.operator, isNotNull);
     expect(expression.operator.type, TokenType.TILDE);
     expect(expression.operand, isNotNull);
   }
 
   void test_parseVariableDeclaration_equals() {
-    VariableDeclaration declaration = ParserTestCase.parse4("parseVariableDeclaration", "a = b", []);
+    VariableDeclaration declaration = ParserTestCase.parse4("parseVariableDeclaration", "a = b");
     expect(declaration.name, isNotNull);
     expect(declaration.equals, isNotNull);
     expect(declaration.initializer, isNotNull);
   }
 
   void test_parseVariableDeclaration_noEquals() {
-    VariableDeclaration declaration = ParserTestCase.parse4("parseVariableDeclaration", "a", []);
+    VariableDeclaration declaration = ParserTestCase.parse4("parseVariableDeclaration", "a");
     expect(declaration.name, isNotNull);
     expect(declaration.equals, isNull);
     expect(declaration.initializer, isNull);
@@ -7980,7 +8074,7 @@
   }
 
   void test_parseWhileStatement() {
-    WhileStatement statement = ParserTestCase.parse4("parseWhileStatement", "while (x) {}", []);
+    WhileStatement statement = ParserTestCase.parse4("parseWhileStatement", "while (x) {}");
     expect(statement.keyword, isNotNull);
     expect(statement.leftParenthesis, isNotNull);
     expect(statement.condition, isNotNull);
@@ -7989,19 +8083,19 @@
   }
 
   void test_parseWithClause_multiple() {
-    WithClause clause = ParserTestCase.parse4("parseWithClause", "with A, B, C", []);
+    WithClause clause = ParserTestCase.parse4("parseWithClause", "with A, B, C");
     expect(clause.withKeyword, isNotNull);
     expect(clause.mixinTypes, hasLength(3));
   }
 
   void test_parseWithClause_single() {
-    WithClause clause = ParserTestCase.parse4("parseWithClause", "with M", []);
+    WithClause clause = ParserTestCase.parse4("parseWithClause", "with M");
     expect(clause.withKeyword, isNotNull);
     expect(clause.mixinTypes, hasLength(1));
   }
 
   void test_parseYieldStatement_each() {
-    YieldStatement statement = ParserTestCase.parse4("parseYieldStatement", "yield* x;", []);
+    YieldStatement statement = ParserTestCase.parse4("parseYieldStatement", "yield* x;");
     expect(statement.yieldKeyword, isNotNull);
     expect(statement.star, isNotNull);
     expect(statement.expression, isNotNull);
@@ -8009,7 +8103,7 @@
   }
 
   void test_parseYieldStatement_normal() {
-    YieldStatement statement = ParserTestCase.parse4("parseYieldStatement", "yield x;", []);
+    YieldStatement statement = ParserTestCase.parse4("parseYieldStatement", "yield x;");
     expect(statement.yieldKeyword, isNotNull);
     expect(statement.star, isNull);
     expect(statement.expression, isNotNull);
@@ -8125,7 +8219,7 @@
   }
 
   /**
-   * Invoke the method [Parser#computeStringValue] with the given argument.
+   * Invoke the method [Parser.computeStringValue] with the given argument.
    *
    * @param lexeme the argument to the method
    * @param first `true` if this is the first token in a string literal
@@ -8140,7 +8234,7 @@
   }
 
   /**
-   * Invoke the method [Parser#createSyntheticIdentifier] with the parser set to the token
+   * Invoke the method [Parser.createSyntheticIdentifier] with the parser set to the token
    * stream produced by scanning the given source.
    *
    * @param source the source to be scanned to produce the token stream being tested
@@ -8153,7 +8247,7 @@
   }
 
   /**
-   * Invoke the method [Parser#createSyntheticIdentifier] with the parser set to the token
+   * Invoke the method [Parser.createSyntheticIdentifier] with the parser set to the token
    * stream produced by scanning the given source.
    *
    * @param source the source to be scanned to produce the token stream being tested
@@ -8166,7 +8260,7 @@
   }
 
   /**
-   * Invoke the method [Parser#isFunctionDeclaration] with the parser set to the token
+   * Invoke the method [Parser.isFunctionDeclaration] with the parser set to the token
    * stream produced by scanning the given source.
    *
    * @param source the source to be scanned to produce the token stream being tested
@@ -8179,7 +8273,7 @@
   }
 
   /**
-   * Invoke the method [Parser#isFunctionExpression] with the parser set to the token stream
+   * Invoke the method [Parser.isFunctionExpression] with the parser set to the token stream
    * produced by scanning the given source.
    *
    * @param source the source to be scanned to produce the token stream being tested
@@ -8201,7 +8295,7 @@
   }
 
   /**
-   * Invoke the method [Parser#isInitializedVariableDeclaration] with the parser set to the
+   * Invoke the method [Parser.isInitializedVariableDeclaration] with the parser set to the
    * token stream produced by scanning the given source.
    *
    * @param source the source to be scanned to produce the token stream being tested
@@ -8214,7 +8308,7 @@
   }
 
   /**
-   * Invoke the method [Parser#isSwitchMember] with the parser set to the token stream
+   * Invoke the method [Parser.isSwitchMember] with the parser set to the token stream
    * produced by scanning the given source.
    *
    * @param source the source to be scanned to produce the token stream being tested
@@ -8235,7 +8329,7 @@
    * @throws Exception if the source could not be parsed, if the compilation errors in the source do
    *           not match those that are expected, or if the result would have been `null`
    */
-  CompilationUnit _parseDirectives(String source, List<ErrorCode> errorCodes) {
+  CompilationUnit _parseDirectives(String source, [List<ErrorCode> errorCodes = ErrorCode.EMPTY_LIST]) {
     GatheringErrorListener listener = new GatheringErrorListener();
     Scanner scanner = new Scanner(null, new CharSequenceReader(source), listener);
     listener.setLineInfo(new TestSource(), scanner.lineStarts);
@@ -8282,4 +8376,4 @@
   runReflectiveTests(RecoveryParserTest);
   runReflectiveTests(ResolutionCopierTest);
   runReflectiveTests(SimpleParserTest);
-}
\ No newline at end of file
+}
diff --git a/pkg/analyzer/test/generated/resolver_test.dart b/pkg/analyzer/test/generated/resolver_test.dart
index e05c4d0..0e5d325 100644
--- a/pkg/analyzer/test/generated/resolver_test.dart
+++ b/pkg/analyzer/test/generated/resolver_test.dart
@@ -88,7 +88,7 @@
     Source coreSource = sourceFactory.forUri(DartSdk.DART_CORE);
     coreContext.setContents(coreSource, "");
     coreUnit.source = coreSource;
-    ClassElementImpl proxyClassElement = ElementFactory.classElement2("_Proxy", []);
+    ClassElementImpl proxyClassElement = ElementFactory.classElement2("_Proxy");
     coreUnit.types = <ClassElement> [
         provider.boolType.element,
         provider.deprecatedType.element,
@@ -127,7 +127,7 @@
     ClassElementImpl futureElement = ElementFactory.classElement2("Future", ["T"]);
     InterfaceType futureType = futureElement.type;
     //   factory Future.value([value])
-    ConstructorElementImpl futureConstructor = ElementFactory.constructorElement2(futureElement, "value", []);
+    ConstructorElementImpl futureConstructor = ElementFactory.constructorElement2(futureElement, "value");
     futureConstructor.parameters = <ParameterElement> [ElementFactory.positionalParameter2("value", provider.dynamicType)];
     futureConstructor.factory = true;
     (futureConstructor.type as FunctionTypeImpl).typeArguments = futureElement.type.typeArguments;
@@ -147,7 +147,7 @@
     futureElement.methods = <MethodElement> [thenMethod];
     // Completer
     ClassElementImpl completerElement = ElementFactory.classElement2("Completer", ["T"]);
-    ConstructorElementImpl completerConstructor = ElementFactory.constructorElement2(completerElement, null, []);
+    ConstructorElementImpl completerConstructor = ElementFactory.constructorElement2(completerElement, null);
     (completerConstructor.type as FunctionTypeImpl).typeArguments = completerElement.type.typeArguments;
     completerElement.constructors = <ConstructorElement> [completerConstructor];
     asyncUnit.types = <ClassElement> [
@@ -163,30 +163,30 @@
     Source htmlSource = sourceFactory.forUri(DartSdk.DART_HTML);
     coreContext.setContents(htmlSource, "");
     htmlUnit.source = htmlSource;
-    ClassElementImpl elementElement = ElementFactory.classElement2("Element", []);
+    ClassElementImpl elementElement = ElementFactory.classElement2("Element");
     InterfaceType elementType = elementElement.type;
-    ClassElementImpl canvasElement = ElementFactory.classElement("CanvasElement", elementType, []);
-    ClassElementImpl contextElement = ElementFactory.classElement2("CanvasRenderingContext", []);
+    ClassElementImpl canvasElement = ElementFactory.classElement("CanvasElement", elementType);
+    ClassElementImpl contextElement = ElementFactory.classElement2("CanvasRenderingContext");
     InterfaceType contextElementType = contextElement.type;
-    ClassElementImpl context2dElement = ElementFactory.classElement("CanvasRenderingContext2D", contextElementType, []);
+    ClassElementImpl context2dElement = ElementFactory.classElement("CanvasRenderingContext2D", contextElementType);
     canvasElement.methods = <MethodElement> [ElementFactory.methodElement("getContext", contextElementType, [provider.stringType])];
     canvasElement.accessors = <PropertyAccessorElement> [ElementFactory.getterElement("context2D", false, context2dElement.type)];
-    ClassElementImpl documentElement = ElementFactory.classElement("Document", elementType, []);
-    ClassElementImpl htmlDocumentElement = ElementFactory.classElement("HtmlDocument", documentElement.type, []);
+    ClassElementImpl documentElement = ElementFactory.classElement("Document", elementType);
+    ClassElementImpl htmlDocumentElement = ElementFactory.classElement("HtmlDocument", documentElement.type);
     htmlDocumentElement.methods = <MethodElement> [ElementFactory.methodElement("query", elementType, <DartType> [provider.stringType])];
     htmlUnit.types = <ClassElement> [
-        ElementFactory.classElement("AnchorElement", elementType, []),
-        ElementFactory.classElement("BodyElement", elementType, []),
-        ElementFactory.classElement("ButtonElement", elementType, []),
+        ElementFactory.classElement("AnchorElement", elementType),
+        ElementFactory.classElement("BodyElement", elementType),
+        ElementFactory.classElement("ButtonElement", elementType),
         canvasElement,
         contextElement,
         context2dElement,
-        ElementFactory.classElement("DivElement", elementType, []),
+        ElementFactory.classElement("DivElement", elementType),
         documentElement,
         elementElement,
         htmlDocumentElement,
-        ElementFactory.classElement("InputElement", elementType, []),
-        ElementFactory.classElement("SelectElement", elementType, [])];
+        ElementFactory.classElement("InputElement", elementType),
+        ElementFactory.classElement("SelectElement", elementType)];
     htmlUnit.functions = <FunctionElement> [ElementFactory.functionElement3("query", elementElement, <ClassElement> [provider.stringType.element], ClassElementImpl.EMPTY_ARRAY)];
     TopLevelVariableElementImpl document = ElementFactory.topLevelVariableElement3("document", false, true, htmlDocumentElement.type);
     htmlUnit.topLevelVariables = <TopLevelVariableElement> [document];
@@ -200,20 +200,20 @@
     Source mathSource = sourceFactory.forUri(_DART_MATH);
     coreContext.setContents(mathSource, "");
     mathUnit.source = mathSource;
-    FunctionElement cosElement = ElementFactory.functionElement3("cos", provider.doubleType.element, <ClassElement> [provider.numType.element], <ClassElement> []);
+    FunctionElement cosElement = ElementFactory.functionElement3("cos", provider.doubleType.element, <ClassElement>[provider.numType.element], ClassElementImpl.EMPTY_ARRAY);
     TopLevelVariableElement ln10Element = ElementFactory.topLevelVariableElement3("LN10", true, false, provider.doubleType);
     TopLevelVariableElement piElement = ElementFactory.topLevelVariableElement3("PI", true, false, provider.doubleType);
-    ClassElementImpl randomElement = ElementFactory.classElement2("Random", []);
+    ClassElementImpl randomElement = ElementFactory.classElement2("Random");
     randomElement.abstract = true;
-    ConstructorElementImpl randomConstructor = ElementFactory.constructorElement2(randomElement, null, []);
+    ConstructorElementImpl randomConstructor = ElementFactory.constructorElement2(randomElement, null);
     randomConstructor.factory = true;
     ParameterElementImpl seedParam = new ParameterElementImpl("seed", 0);
     seedParam.parameterKind = ParameterKind.POSITIONAL;
     seedParam.type = provider.intType;
     randomConstructor.parameters = <ParameterElement> [seedParam];
     randomElement.constructors = <ConstructorElement> [randomConstructor];
-    FunctionElement sinElement = ElementFactory.functionElement3("sin", provider.doubleType.element, <ClassElement> [provider.numType.element], <ClassElement> []);
-    FunctionElement sqrtElement = ElementFactory.functionElement3("sqrt", provider.doubleType.element, <ClassElement> [provider.numType.element], <ClassElement> []);
+    FunctionElement sinElement = ElementFactory.functionElement3("sin", provider.doubleType.element, <ClassElement> [provider.numType.element], ClassElementImpl.EMPTY_ARRAY);
+    FunctionElement sqrtElement = ElementFactory.functionElement3("sqrt", provider.doubleType.element, <ClassElement> [provider.numType.element], ClassElementImpl.EMPTY_ARRAY);
     mathUnit.accessors = <PropertyAccessorElement> [ln10Element.getter, piElement.getter];
     mathUnit.functions = <FunctionElement> [cosElement, sinElement, sqrtElement];
     mathUnit.topLevelVariables = <TopLevelVariableElement> [ln10Element, piElement];
@@ -292,7 +292,7 @@
   AnalysisContext context;
 
   /**
-   * Creates new [AnalysisContext] using [AnalysisContextFactory#contextWithCore].
+   * Creates new [AnalysisContext] using [AnalysisContextFactory.contextWithCore].
    */
   AnalysisContextHelper() {
     context = AnalysisContextFactory.contextWithCore();
@@ -1066,7 +1066,7 @@
     Source source = addSource(oldContent);
     LibraryElement library = resolve(source);
     CompilationUnit oldUnit = resolveCompilationUnit(source, library);
-    CompilationUnit newUnit = ParserTestCase.parseCompilationUnit(newContent, []);
+    CompilationUnit newUnit = ParserTestCase.parseCompilationUnit(newContent);
     DeclarationMatcher matcher = new DeclarationMatcher();
     expect(matcher.matches(newUnit, oldUnit.element), expectMatch);
   }
@@ -1145,7 +1145,7 @@
     fail("Not yet tested");
     // Need to set up the exported library so that the identifier can be resolved
     ExportDirective directive = AstFactory.exportDirective2(null, [AstFactory.hideCombinator2(["A"])]);
-    _resolveNode(directive, []);
+    _resolveNode(directive);
     _listener.assertNoErrors();
   }
 
@@ -1158,7 +1158,7 @@
     fail("Not yet tested");
     // Need to set up the imported library so that the identifier can be resolved
     ImportDirective directive = AstFactory.importDirective3(null, null, [AstFactory.showCombinator2(["A"])]);
-    _resolveNode(directive, []);
+    _resolveNode(directive);
     _listener.assertNoErrors();
   }
 
@@ -1166,11 +1166,11 @@
     fail("Not yet tested");
     // Need to set up the imported library so that the identifiers can be resolved
     String prefixName = "p";
-    _definingLibrary.imports = <ImportElement> [ElementFactory.importFor(null, ElementFactory.prefix(prefixName), [])];
+    _definingLibrary.imports = <ImportElement> [ElementFactory.importFor(null, ElementFactory.prefix(prefixName))];
     ImportDirective directive = AstFactory.importDirective3(null, prefixName, [
         AstFactory.showCombinator2(["A"]),
         AstFactory.hideCombinator2(["B"])]);
-    _resolveNode(directive, []);
+    _resolveNode(directive);
     _listener.assertNoErrors();
   }
 
@@ -1191,23 +1191,23 @@
     //
     // abstract class A { int operator[](int index); }
     //
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     MethodElement operator = ElementFactory.methodElement("[]", intType, [intType]);
     classA.methods = <MethodElement> [operator];
     //
     // class B implements A {}
     //
-    ClassElementImpl classB = ElementFactory.classElement2("B", []);
+    ClassElementImpl classB = ElementFactory.classElement2("B");
     classB.interfaces = <InterfaceType> [classA.type];
     //
     // class C extends Object with B {}
     //
-    ClassElementImpl classC = ElementFactory.classElement2("C", []);
+    ClassElementImpl classC = ElementFactory.classElement2("C");
     classC.mixins = <InterfaceType> [classB.type];
     //
     // class D extends C {}
     //
-    ClassElementImpl classD = ElementFactory.classElement("D", classC.type, []);
+    ClassElementImpl classD = ElementFactory.classElement("D", classC.type);
     //
     // D a;
     // a[i];
@@ -1215,7 +1215,7 @@
     SimpleIdentifier array = AstFactory.identifier3("a");
     array.staticType = classD.type;
     IndexExpression expression = AstFactory.indexExpression(array, AstFactory.identifier3("i"));
-    expect(_resolveIndexExpression(expression, []), same(operator));
+    expect(_resolveIndexExpression(expression), same(operator));
     _listener.assertNoErrors();
   }
 
@@ -1224,14 +1224,14 @@
     SimpleIdentifier leftHandSide = AstFactory.identifier3("a");
     leftHandSide.staticType = intType;
     AssignmentExpression assignment = AstFactory.assignmentExpression(leftHandSide, TokenType.PLUS_EQ, AstFactory.integer(1));
-    _resolveNode(assignment, []);
+    _resolveNode(assignment);
     expect(assignment.staticElement, same(getMethod(_typeProvider.numType, "+")));
     _listener.assertNoErrors();
   }
 
   void test_visitAssignmentExpression_simple() {
     AssignmentExpression expression = AstFactory.assignmentExpression(AstFactory.identifier3("x"), TokenType.EQ, AstFactory.integer(0));
-    _resolveNode(expression, []);
+    _resolveNode(expression);
     expect(expression.staticElement, isNull);
     _listener.assertNoErrors();
   }
@@ -1244,7 +1244,7 @@
     SimpleIdentifier left = AstFactory.identifier3("i");
     left.staticType = numType;
     BinaryExpression expression = AstFactory.binaryExpression(left, TokenType.PLUS, AstFactory.identifier3("j"));
-    _resolveNode(expression, []);
+    _resolveNode(expression);
     expect(expression.staticElement, getMethod(numType, "+"));
     expect(expression.propagatedElement, isNull);
     _listener.assertNoErrors();
@@ -1258,7 +1258,7 @@
     SimpleIdentifier left = AstFactory.identifier3("i");
     left.propagatedType = numType;
     BinaryExpression expression = AstFactory.binaryExpression(left, TokenType.PLUS, AstFactory.identifier3("j"));
-    _resolveNode(expression, []);
+    _resolveNode(expression);
     expect(expression.staticElement, isNull);
     expect(expression.propagatedElement, getMethod(numType, "+"));
     _listener.assertNoErrors();
@@ -1279,23 +1279,23 @@
   }
 
   void test_visitConstructorName_named() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String constructorName = "a";
-    ConstructorElement constructor = ElementFactory.constructorElement2(classA, constructorName, []);
+    ConstructorElement constructor = ElementFactory.constructorElement2(classA, constructorName);
     classA.constructors = <ConstructorElement> [constructor];
-    ConstructorName name = AstFactory.constructorName(AstFactory.typeName(classA, []), constructorName);
-    _resolveNode(name, []);
+    ConstructorName name = AstFactory.constructorName(AstFactory.typeName(classA), constructorName);
+    _resolveNode(name);
     expect(name.staticElement, same(constructor));
     _listener.assertNoErrors();
   }
 
   void test_visitConstructorName_unnamed() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String constructorName = null;
-    ConstructorElement constructor = ElementFactory.constructorElement2(classA, constructorName, []);
+    ConstructorElement constructor = ElementFactory.constructorElement2(classA, constructorName);
     classA.constructors = <ConstructorElement> [constructor];
-    ConstructorName name = AstFactory.constructorName(AstFactory.typeName(classA, []), constructorName);
-    _resolveNode(name, []);
+    ConstructorName name = AstFactory.constructorName(AstFactory.typeName(classA), constructorName);
+    _resolveNode(name);
     expect(name.staticElement, same(constructor));
     _listener.assertNoErrors();
   }
@@ -1315,9 +1315,9 @@
   }
 
   void test_visitExportDirective_noCombinators() {
-    ExportDirective directive = AstFactory.exportDirective2(null, []);
-    directive.element = ElementFactory.exportFor(ElementFactory.library(_definingLibrary.context, "lib"), []);
-    _resolveNode(directive, []);
+    ExportDirective directive = AstFactory.exportDirective2(null);
+    directive.element = ElementFactory.exportFor(ElementFactory.library(_definingLibrary.context, "lib"));
+    _resolveNode(directive);
     _listener.assertNoErrors();
   }
 
@@ -1325,7 +1325,7 @@
     String fieldName = "f";
     InterfaceType intType = _typeProvider.intType;
     FieldElementImpl fieldElement = ElementFactory.fieldElement(fieldName, false, false, false, intType);
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     classA.fields = <FieldElement> [fieldElement];
     FieldFormalParameter parameter = AstFactory.fieldFormalParameter2(fieldName);
     FieldFormalParameterElementImpl parameterElement = ElementFactory.fieldFormalParameter(parameter.identifier);
@@ -1337,19 +1337,19 @@
   }
 
   void test_visitImportDirective_noCombinators_noPrefix() {
-    ImportDirective directive = AstFactory.importDirective3(null, null, []);
-    directive.element = ElementFactory.importFor(ElementFactory.library(_definingLibrary.context, "lib"), null, []);
-    _resolveNode(directive, []);
+    ImportDirective directive = AstFactory.importDirective3(null, null);
+    directive.element = ElementFactory.importFor(ElementFactory.library(_definingLibrary.context, "lib"), null);
+    _resolveNode(directive);
     _listener.assertNoErrors();
   }
 
   void test_visitImportDirective_noCombinators_prefix() {
     String prefixName = "p";
-    ImportElement importElement = ElementFactory.importFor(ElementFactory.library(_definingLibrary.context, "lib"), ElementFactory.prefix(prefixName), []);
+    ImportElement importElement = ElementFactory.importFor(ElementFactory.library(_definingLibrary.context, "lib"), ElementFactory.prefix(prefixName));
     _definingLibrary.imports = <ImportElement> [importElement];
-    ImportDirective directive = AstFactory.importDirective3(null, prefixName, []);
+    ImportDirective directive = AstFactory.importDirective3(null, prefixName);
     directive.element = importElement;
-    _resolveNode(directive, []);
+    _resolveNode(directive);
     _listener.assertNoErrors();
   }
 
@@ -1363,8 +1363,8 @@
     CompilationUnitElementImpl unit = library.definingCompilationUnit as CompilationUnitElementImpl;
     unit.accessors = <PropertyAccessorElement> [varA.getter, varA.setter, varB.getter, varC.setter];
     unit.topLevelVariables = <TopLevelVariableElement> [varA, varB, varC];
-    directive.element = ElementFactory.importFor(library, null, []);
-    _resolveNode(directive, []);
+    directive.element = ElementFactory.importFor(library, null);
+    _resolveNode(directive);
     expect(combinator.shownNames[0].staticElement, same(varA));
     expect(combinator.shownNames[1].staticElement, same(varB));
     expect(combinator.shownNames[2].staticElement, same(varC));
@@ -1372,19 +1372,19 @@
   }
 
   void test_visitIndexExpression_get() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     InterfaceType intType = _typeProvider.intType;
     MethodElement getter = ElementFactory.methodElement("[]", intType, [intType]);
     classA.methods = <MethodElement> [getter];
     SimpleIdentifier array = AstFactory.identifier3("a");
     array.staticType = classA.type;
     IndexExpression expression = AstFactory.indexExpression(array, AstFactory.identifier3("i"));
-    expect(_resolveIndexExpression(expression, []), same(getter));
+    expect(_resolveIndexExpression(expression), same(getter));
     _listener.assertNoErrors();
   }
 
   void test_visitIndexExpression_set() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     InterfaceType intType = _typeProvider.intType;
     MethodElement setter = ElementFactory.methodElement("[]=", intType, [intType]);
     classA.methods = <MethodElement> [setter];
@@ -1392,48 +1392,48 @@
     array.staticType = classA.type;
     IndexExpression expression = AstFactory.indexExpression(array, AstFactory.identifier3("i"));
     AstFactory.assignmentExpression(expression, TokenType.EQ, AstFactory.integer(0));
-    expect(_resolveIndexExpression(expression, []), same(setter));
+    expect(_resolveIndexExpression(expression), same(setter));
     _listener.assertNoErrors();
   }
 
   void test_visitInstanceCreationExpression_named() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String constructorName = "a";
-    ConstructorElement constructor = ElementFactory.constructorElement2(classA, constructorName, []);
+    ConstructorElement constructor = ElementFactory.constructorElement2(classA, constructorName);
     classA.constructors = <ConstructorElement> [constructor];
-    ConstructorName name = AstFactory.constructorName(AstFactory.typeName(classA, []), constructorName);
+    ConstructorName name = AstFactory.constructorName(AstFactory.typeName(classA), constructorName);
     name.staticElement = constructor;
-    InstanceCreationExpression creation = AstFactory.instanceCreationExpression(Keyword.NEW, name, []);
-    _resolveNode(creation, []);
+    InstanceCreationExpression creation = AstFactory.instanceCreationExpression(Keyword.NEW, name);
+    _resolveNode(creation);
     expect(creation.staticElement, same(constructor));
     _listener.assertNoErrors();
   }
 
   void test_visitInstanceCreationExpression_unnamed() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String constructorName = null;
-    ConstructorElement constructor = ElementFactory.constructorElement2(classA, constructorName, []);
+    ConstructorElement constructor = ElementFactory.constructorElement2(classA, constructorName);
     classA.constructors = <ConstructorElement> [constructor];
-    ConstructorName name = AstFactory.constructorName(AstFactory.typeName(classA, []), constructorName);
+    ConstructorName name = AstFactory.constructorName(AstFactory.typeName(classA), constructorName);
     name.staticElement = constructor;
-    InstanceCreationExpression creation = AstFactory.instanceCreationExpression(Keyword.NEW, name, []);
-    _resolveNode(creation, []);
+    InstanceCreationExpression creation = AstFactory.instanceCreationExpression(Keyword.NEW, name);
+    _resolveNode(creation);
     expect(creation.staticElement, same(constructor));
     _listener.assertNoErrors();
   }
 
   void test_visitInstanceCreationExpression_unnamed_namedParameter() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String constructorName = null;
-    ConstructorElementImpl constructor = ElementFactory.constructorElement2(classA, constructorName, []);
+    ConstructorElementImpl constructor = ElementFactory.constructorElement2(classA, constructorName);
     String parameterName = "a";
     ParameterElement parameter = ElementFactory.namedParameter(parameterName);
     constructor.parameters = <ParameterElement> [parameter];
     classA.constructors = <ConstructorElement> [constructor];
-    ConstructorName name = AstFactory.constructorName(AstFactory.typeName(classA, []), constructorName);
+    ConstructorName name = AstFactory.constructorName(AstFactory.typeName(classA), constructorName);
     name.staticElement = constructor;
     InstanceCreationExpression creation = AstFactory.instanceCreationExpression(Keyword.NEW, name, [AstFactory.namedExpression2(parameterName, AstFactory.integer(0))]);
-    _resolveNode(creation, []);
+    _resolveNode(creation);
     expect(creation.staticElement, same(constructor));
     expect((creation.argumentList.arguments[0] as NamedExpression).name.label.staticElement, same(parameter));
     _listener.assertNoErrors();
@@ -1444,24 +1444,24 @@
     SimpleIdentifier left = AstFactory.identifier3("i");
     left.staticType = numType;
     String methodName = "abs";
-    MethodInvocation invocation = AstFactory.methodInvocation(left, methodName, []);
-    _resolveNode(invocation, []);
+    MethodInvocation invocation = AstFactory.methodInvocation(left, methodName);
+    _resolveNode(invocation);
     expect(invocation.methodName.staticElement, same(getMethod(numType, methodName)));
     _listener.assertNoErrors();
   }
 
   void test_visitMethodInvocation_namedParameter() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
     String parameterName = "p";
-    MethodElementImpl method = ElementFactory.methodElement(methodName, null, []);
+    MethodElementImpl method = ElementFactory.methodElement(methodName, null);
     ParameterElement parameter = ElementFactory.namedParameter(parameterName);
     method.parameters = <ParameterElement> [parameter];
     classA.methods = <MethodElement> [method];
     SimpleIdentifier left = AstFactory.identifier3("i");
     left.staticType = classA.type;
     MethodInvocation invocation = AstFactory.methodInvocation(left, methodName, [AstFactory.namedExpression2(parameterName, AstFactory.integer(0))]);
-    _resolveNode(invocation, []);
+    _resolveNode(invocation);
     expect(invocation.methodName.staticElement, same(method));
     expect((invocation.argumentList.arguments[0] as NamedExpression).name.label.staticElement, same(parameter));
     _listener.assertNoErrors();
@@ -1472,7 +1472,7 @@
     SimpleIdentifier operand = AstFactory.identifier3("i");
     operand.staticType = numType;
     PostfixExpression expression = AstFactory.postfixExpression(operand, TokenType.PLUS_PLUS);
-    _resolveNode(expression, []);
+    _resolveNode(expression);
     expect(expression.staticElement, getMethod(numType, "+"));
     _listener.assertNoErrors();
   }
@@ -1485,14 +1485,14 @@
     target.staticElement = variable;
     target.staticType = dynamicType;
     PrefixedIdentifier identifier = AstFactory.identifier(target, AstFactory.identifier3("b"));
-    _resolveNode(identifier, []);
+    _resolveNode(identifier);
     expect(identifier.staticElement, isNull);
     expect(identifier.identifier.staticElement, isNull);
     _listener.assertNoErrors();
   }
 
   void test_visitPrefixedIdentifier_nonDynamic() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String getterName = "b";
     PropertyAccessorElement getter = ElementFactory.getterElement(getterName, false, _typeProvider.intType);
     classA.accessors = <PropertyAccessorElement> [getter];
@@ -1502,14 +1502,14 @@
     target.staticElement = variable;
     target.staticType = classA.type;
     PrefixedIdentifier identifier = AstFactory.identifier(target, AstFactory.identifier3(getterName));
-    _resolveNode(identifier, []);
+    _resolveNode(identifier);
     expect(identifier.staticElement, same(getter));
     expect(identifier.identifier.staticElement, same(getter));
     _listener.assertNoErrors();
   }
 
   void test_visitPrefixedIdentifier_staticClassMember_getter() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     // set accessors
     String propName = "b";
     PropertyAccessorElement getter = ElementFactory.getterElement(propName, false, _typeProvider.intType);
@@ -1521,20 +1521,20 @@
     target.staticType = classA.type;
     PrefixedIdentifier identifier = AstFactory.identifier(target, AstFactory.identifier3(propName));
     // resolve
-    _resolveNode(identifier, []);
+    _resolveNode(identifier);
     expect(identifier.staticElement, same(getter));
     expect(identifier.identifier.staticElement, same(getter));
     _listener.assertNoErrors();
   }
 
   void test_visitPrefixedIdentifier_staticClassMember_method() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     // set accessors
     String propName = "m";
     PropertyAccessorElement setter = ElementFactory.setterElement(propName, false, _typeProvider.intType);
     classA.accessors = <PropertyAccessorElement> [setter];
     // set methods
-    MethodElement method = ElementFactory.methodElement("m", _typeProvider.intType, []);
+    MethodElement method = ElementFactory.methodElement("m", _typeProvider.intType);
     classA.methods = <MethodElement> [method];
     // prepare "A.m"
     SimpleIdentifier target = AstFactory.identifier3("A");
@@ -1543,14 +1543,14 @@
     PrefixedIdentifier identifier = AstFactory.identifier(target, AstFactory.identifier3(propName));
     AstFactory.assignmentExpression(identifier, TokenType.EQ, AstFactory.nullLiteral());
     // resolve
-    _resolveNode(identifier, []);
+    _resolveNode(identifier);
     expect(identifier.staticElement, same(method));
     expect(identifier.identifier.staticElement, same(method));
     _listener.assertNoErrors();
   }
 
   void test_visitPrefixedIdentifier_staticClassMember_setter() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     // set accessors
     String propName = "b";
     PropertyAccessorElement getter = ElementFactory.getterElement(propName, false, _typeProvider.intType);
@@ -1563,7 +1563,7 @@
     PrefixedIdentifier identifier = AstFactory.identifier(target, AstFactory.identifier3(propName));
     AstFactory.assignmentExpression(identifier, TokenType.EQ, AstFactory.nullLiteral());
     // resolve
-    _resolveNode(identifier, []);
+    _resolveNode(identifier);
     expect(identifier.staticElement, same(setter));
     expect(identifier.identifier.staticElement, same(setter));
     _listener.assertNoErrors();
@@ -1574,20 +1574,20 @@
     SimpleIdentifier operand = AstFactory.identifier3("i");
     operand.staticType = numType;
     PrefixExpression expression = AstFactory.prefixExpression(TokenType.PLUS_PLUS, operand);
-    _resolveNode(expression, []);
+    _resolveNode(expression);
     expect(expression.staticElement, getMethod(numType, "+"));
     _listener.assertNoErrors();
   }
 
   void test_visitPropertyAccess_getter_identifier() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String getterName = "b";
     PropertyAccessorElement getter = ElementFactory.getterElement(getterName, false, _typeProvider.intType);
     classA.accessors = <PropertyAccessorElement> [getter];
     SimpleIdentifier target = AstFactory.identifier3("a");
     target.staticType = classA.type;
     PropertyAccess access = AstFactory.propertyAccess2(target, getterName);
-    _resolveNode(access, []);
+    _resolveNode(access);
     expect(access.propertyName.staticElement, same(getter));
     _listener.assertNoErrors();
   }
@@ -1601,21 +1601,21 @@
     //   ... super.m ...
     // }
     //
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String getterName = "b";
     PropertyAccessorElement getter = ElementFactory.getterElement(getterName, false, _typeProvider.intType);
     classA.accessors = <PropertyAccessorElement> [getter];
     SuperExpression target = AstFactory.superExpression();
-    target.staticType = ElementFactory.classElement("B", classA.type, []).type;
+    target.staticType = ElementFactory.classElement("B", classA.type).type;
     PropertyAccess access = AstFactory.propertyAccess2(target, getterName);
-    AstFactory.methodDeclaration2(null, null, null, null, AstFactory.identifier3("m"), AstFactory.formalParameterList([]), AstFactory.expressionFunctionBody(access));
-    _resolveNode(access, []);
+    AstFactory.methodDeclaration2(null, null, null, null, AstFactory.identifier3("m"), AstFactory.formalParameterList(), AstFactory.expressionFunctionBody(access));
+    _resolveNode(access);
     expect(access.propertyName.staticElement, same(getter));
     _listener.assertNoErrors();
   }
 
   void test_visitPropertyAccess_setter_this() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String setterName = "b";
     PropertyAccessorElement setter = ElementFactory.setterElement(setterName, false, _typeProvider.intType);
     classA.accessors = <PropertyAccessorElement> [setter];
@@ -1623,7 +1623,7 @@
     target.staticType = classA.type;
     PropertyAccess access = AstFactory.propertyAccess2(target, setterName);
     AstFactory.assignmentExpression(access, TokenType.EQ, AstFactory.integer(0));
-    _resolveNode(access, []);
+    _resolveNode(access);
     expect(access.propertyName.staticElement, same(setter));
     _listener.assertNoErrors();
   }
@@ -1639,7 +1639,7 @@
 
   void test_visitSimpleIdentifier_dynamic() {
     SimpleIdentifier node = AstFactory.identifier3("dynamic");
-    _resolveIdentifier(node, []);
+    _resolveIdentifier(node);
     expect(node.staticElement, same(_typeProvider.dynamicType.element));
     expect(node.staticType, same(_typeProvider.typeType));
     _listener.assertNoErrors();
@@ -1654,7 +1654,7 @@
 
   void test_visitSimpleIdentifier_lexicalScope_field_setter() {
     InterfaceType intType = _typeProvider.intType;
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String fieldName = "a";
     FieldElement field = ElementFactory.fieldElement(fieldName, false, false, false, intType);
     classA.fields = <FieldElement> [field];
@@ -1669,27 +1669,27 @@
   }
 
   void test_visitSuperConstructorInvocation() {
-    ClassElementImpl superclass = ElementFactory.classElement2("A", []);
-    ConstructorElementImpl superConstructor = ElementFactory.constructorElement2(superclass, null, []);
+    ClassElementImpl superclass = ElementFactory.classElement2("A");
+    ConstructorElementImpl superConstructor = ElementFactory.constructorElement2(superclass, null);
     superclass.constructors = <ConstructorElement> [superConstructor];
-    ClassElementImpl subclass = ElementFactory.classElement("B", superclass.type, []);
-    ConstructorElementImpl subConstructor = ElementFactory.constructorElement2(subclass, null, []);
+    ClassElementImpl subclass = ElementFactory.classElement("B", superclass.type);
+    ConstructorElementImpl subConstructor = ElementFactory.constructorElement2(subclass, null);
     subclass.constructors = <ConstructorElement> [subConstructor];
-    SuperConstructorInvocation invocation = AstFactory.superConstructorInvocation([]);
+    SuperConstructorInvocation invocation = AstFactory.superConstructorInvocation();
     _resolveInClass(invocation, subclass);
     expect(invocation.staticElement, superConstructor);
     _listener.assertNoErrors();
   }
 
   void test_visitSuperConstructorInvocation_namedParameter() {
-    ClassElementImpl superclass = ElementFactory.classElement2("A", []);
-    ConstructorElementImpl superConstructor = ElementFactory.constructorElement2(superclass, null, []);
+    ClassElementImpl superclass = ElementFactory.classElement2("A");
+    ConstructorElementImpl superConstructor = ElementFactory.constructorElement2(superclass, null);
     String parameterName = "p";
     ParameterElement parameter = ElementFactory.namedParameter(parameterName);
     superConstructor.parameters = <ParameterElement> [parameter];
     superclass.constructors = <ConstructorElement> [superConstructor];
-    ClassElementImpl subclass = ElementFactory.classElement("B", superclass.type, []);
-    ConstructorElementImpl subConstructor = ElementFactory.constructorElement2(subclass, null, []);
+    ClassElementImpl subclass = ElementFactory.classElement("B", superclass.type);
+    ConstructorElementImpl subConstructor = ElementFactory.constructorElement2(subclass, null);
     subclass.constructors = <ConstructorElement> [subConstructor];
     SuperConstructorInvocation invocation = AstFactory.superConstructorInvocation([AstFactory.namedExpression2(parameterName, AstFactory.integer(0))]);
     _resolveInClass(invocation, subclass);
@@ -1757,7 +1757,7 @@
    *          being resolved
    * @return the element to which the expression was resolved
    */
-  Element _resolveIdentifier(Identifier node, List<Element> definedElements) {
+  Element _resolveIdentifier(Identifier node, [List<Element> definedElements]) {
     _resolveNode(node, definedElements);
     return node.staticElement;
   }
@@ -1796,7 +1796,7 @@
    *          being resolved
    * @return the element to which the expression was resolved
    */
-  Element _resolveIndexExpression(IndexExpression node, List<Element> definedElements) {
+  Element _resolveIndexExpression(IndexExpression node, [List<Element> definedElements]) {
     _resolveNode(node, definedElements);
     return node.staticElement;
   }
@@ -1810,13 +1810,15 @@
    *          being resolved
    * @return the element to which the expression was resolved
    */
-  void _resolveNode(AstNode node, List<Element> definedElements) {
+  void _resolveNode(AstNode node, [List<Element> definedElements]) {
     try {
       Scope outerScope = _visitor.nameScope_J2DAccessor as Scope;
       try {
         EnclosedScope innerScope = new EnclosedScope(outerScope);
-        for (Element element in definedElements) {
-          innerScope.define(element);
+        if (definedElements != null) {
+          for (Element element in definedElements) {
+            innerScope.define(element);
+          }
         }
         _visitor.nameScope_J2DAccessor = innerScope;
         node.accept(_resolver);
@@ -3206,6 +3208,269 @@
     verify([source, source2]);
   }
 
+  void test_unusedElement_class_noReference() {
+    enableUnusedElement = true;
+    Source source = addSource(r'''
+class _A {}
+main() {
+}''');
+    resolve(source);
+    assertErrors(source, [HintCode.UNUSED_ELEMENT]);
+    verify([source]);
+  }
+
+  void test_unusedElement_class_inConstructorName() {
+    enableUnusedElement = true;
+    Source source = addSource(r'''
+class _A {
+  _A() {}
+  _A.named() {}
+}
+''');
+    resolve(source);
+    assertErrors(source, [HintCode.UNUSED_ELEMENT]);
+    verify([source]);
+  }
+
+  void test_unusedElement_class_inClassMember() {
+    enableUnusedElement = true;
+    Source source = addSource(r'''
+class _A {
+  static staticMethod() {
+    new _A();
+  }
+  instanceMethod() {
+    new _A();
+  }
+}
+''');
+    resolve(source);
+    assertErrors(source, [HintCode.UNUSED_ELEMENT]);
+    verify([source]);
+  }
+
+  void test_unusedElement_class_isExpression() {
+    enableUnusedElement = true;
+    Source source = addSource(r'''
+class _A {}
+main(p) {
+  if (p is _A) {
+  }
+}
+''');
+    resolve(source);
+    assertErrors(source, [HintCode.UNUSED_ELEMENT]);
+    verify([source]);
+  }
+
+  void test_unusedElement_class_variableDeclaration() {
+    enableUnusedElement = true;
+    Source source = addSource(r'''
+class _A {}
+main() {
+  _A v;
+  print(v);
+}
+print(x) {}
+''');
+    resolve(source);
+    assertErrors(source, [HintCode.UNUSED_ELEMENT]);
+    verify([source]);
+  }
+
+  void test_unusedElement_class_isUsed_extends() {
+    enableUnusedElement = true;
+    Source source = addSource(r'''
+class _A {}
+class B extends _A {}
+''');
+    resolve(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  void test_unusedElement_class_isUsed_implements() {
+    enableUnusedElement = true;
+    Source source = addSource(r'''
+class _A {}
+class B implements _A {}
+''');
+    resolve(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  void test_unusedElement_class_isUsed_instanceCreation() {
+    enableUnusedElement = true;
+    Source source = addSource(r'''
+class _A {}
+main() {
+  new _A();
+}''');
+    resolve(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  void test_unusedElement_class_isUsed_staticFieldAccess() {
+    enableUnusedElement = true;
+    Source source = addSource(r'''
+class _A {
+  static const F = 42;
+}
+main() {
+  _A.F;
+}''');
+    resolve(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  void test_unusedElement_class_isUsed_staticMethodInvocation() {
+    enableUnusedElement = true;
+    Source source = addSource(r'''
+class _A {
+  static m() {}
+}
+main() {
+  _A.m();
+}''');
+    resolve(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  void test_unusedLocalVariable() {
+    enableUnusedLocalVariable = true;
+    Source source = addSource(r'''
+main() {
+  var v = 1;
+  v = 2;
+}''');
+    resolve(source);
+    assertErrors(source, [HintCode.UNUSED_LOCAL_VARIABLE]);
+    verify([source]);
+  }
+
+  void test_unusedLocalVariable_isRead_notUsed_compoundAssign() {
+    enableUnusedLocalVariable = true;
+    Source source = addSource(r'''
+main() {
+  var v = 1;
+  v += 2;
+}''');
+    resolve(source);
+    assertErrors(source, [HintCode.UNUSED_LOCAL_VARIABLE]);
+    verify([source]);
+  }
+
+  void test_unusedLocalVariable_isRead_notUsed_postfixExpr() {
+    enableUnusedLocalVariable = true;
+    Source source = addSource(r'''
+main() {
+  var v = 1;
+  v++;
+}''');
+    resolve(source);
+    assertErrors(source, [HintCode.UNUSED_LOCAL_VARIABLE]);
+    verify([source]);
+  }
+
+  void test_unusedLocalVariable_isRead_notUsed_prefixExpr() {
+    enableUnusedLocalVariable = true;
+    Source source = addSource(r'''
+main() {
+  var v = 1;
+  ++v;
+}''');
+    resolve(source);
+    assertErrors(source, [HintCode.UNUSED_LOCAL_VARIABLE]);
+    verify([source]);
+  }
+
+  void test_unusedLocalVariable_isRead_usedArgument() {
+    enableUnusedLocalVariable = true;
+    Source source = addSource(r'''
+main() {
+  var v = 1;
+  print(++v);
+}
+print(x) {}''');
+    resolve(source);
+    assertErrors(source);
+    verify([source]);
+  }
+
+  void test_unusedLocalVariable_isRead_usedInvocationTarget() {
+    enableUnusedLocalVariable = true;
+    Source source = addSource(r'''
+class A {
+  foo() {}
+}
+main() {
+  var a = new A();
+  a.foo();
+}
+''');
+    resolve(source);
+    assertErrors(source);
+    verify([source]);
+  }
+
+  void test_unusedLocalVariable_isInvoked() {
+    enableUnusedLocalVariable = true;
+    Source source = addSource(r'''
+typedef Foo();
+main() {
+  Foo foo;
+  foo();
+}''');
+    resolve(source);
+    assertErrors(source);
+    verify([source]);
+  }
+
+  void test_unusedLocalVariable_inCatch_exception() {
+    enableUnusedLocalVariable = true;
+    Source source = addSource(r'''
+main() {
+  try {
+  } catch (exception) {
+  }
+}''');
+    resolve(source);
+    assertErrors(source);
+    verify([source]);
+  }
+
+  void test_unusedLocalVariable_inCatch_stackTrace() {
+    enableUnusedLocalVariable = true;
+    Source source = addSource(r'''
+main() {
+  try {
+  } catch (exception, stackTrace) {
+  }
+}''');
+    resolve(source);
+    assertErrors(source, [HintCode.UNUSED_LOCAL_VARIABLE]);
+    verify([source]);
+  }
+
+  void test_unusedLocalVariable_inCatch_stackTrace_used() {
+    enableUnusedLocalVariable = true;
+    Source source = addSource(r'''
+main() {
+  try {
+  } catch (exception, stackTrace) {
+    print('exception at $stackTrace');
+  }
+}
+print(x) {}''');
+    resolve(source);
+    assertErrors(source);
+    verify([source]);
+  }
+
   void test_useOfVoidResult_assignmentExpression_function() {
     Source source = addSource(r'''
 void f() {}
@@ -3352,11 +3617,11 @@
   void test_getMapOfMembersInheritedFromClasses_accessor_extends() {
     // class A { int get g; }
     // class B extends A {}
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String getterName = "g";
     PropertyAccessorElement getterG = ElementFactory.getterElement(getterName, false, _typeProvider.intType);
     classA.accessors = <PropertyAccessorElement> [getterG];
-    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
     MemberMap mapB = _inheritanceManager.getMapOfMembersInheritedFromClasses(classB);
     MemberMap mapA = _inheritanceManager.getMapOfMembersInheritedFromClasses(classA);
     expect(mapA.size, _numOfMembersInObject);
@@ -3369,11 +3634,11 @@
   void test_getMapOfMembersInheritedFromClasses_accessor_implements() {
     // class A { int get g; }
     // class B implements A {}
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String getterName = "g";
     PropertyAccessorElement getterG = ElementFactory.getterElement(getterName, false, _typeProvider.intType);
     classA.accessors = <PropertyAccessorElement> [getterG];
-    ClassElementImpl classB = ElementFactory.classElement2("B", []);
+    ClassElementImpl classB = ElementFactory.classElement2("B");
     classB.interfaces = <InterfaceType> [classA.type];
     MemberMap mapB = _inheritanceManager.getMapOfMembersInheritedFromClasses(classB);
     MemberMap mapA = _inheritanceManager.getMapOfMembersInheritedFromClasses(classA);
@@ -3387,11 +3652,11 @@
   void test_getMapOfMembersInheritedFromClasses_accessor_with() {
     // class A { int get g; }
     // class B extends Object with A {}
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String getterName = "g";
     PropertyAccessorElement getterG = ElementFactory.getterElement(getterName, false, _typeProvider.intType);
     classA.accessors = <PropertyAccessorElement> [getterG];
-    ClassElementImpl classB = ElementFactory.classElement2("B", []);
+    ClassElementImpl classB = ElementFactory.classElement2("B");
     classB.mixins = <InterfaceType> [classA.type];
     MemberMap mapB = _inheritanceManager.getMapOfMembersInheritedFromClasses(classB);
     MemberMap mapA = _inheritanceManager.getMapOfMembersInheritedFromClasses(classA);
@@ -3404,7 +3669,7 @@
 
   void test_getMapOfMembersInheritedFromClasses_implicitExtends() {
     // class A {}
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     MemberMap mapA = _inheritanceManager.getMapOfMembersInheritedFromClasses(classA);
     expect(mapA.size, _numOfMembersInObject);
     _assertNoErrors(classA);
@@ -3413,11 +3678,11 @@
   void test_getMapOfMembersInheritedFromClasses_method_extends() {
     // class A { int g(); }
     // class B extends A {}
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElement methodM = ElementFactory.methodElement(methodName, _typeProvider.intType, []);
+    MethodElement methodM = ElementFactory.methodElement(methodName, _typeProvider.intType);
     classA.methods = <MethodElement> [methodM];
-    ClassElementImpl classB = ElementFactory.classElement2("B", []);
+    ClassElementImpl classB = ElementFactory.classElement2("B");
     classB.supertype = classA.type;
     MemberMap mapB = _inheritanceManager.getMapOfMembersInheritedFromClasses(classB);
     MemberMap mapA = _inheritanceManager.getMapOfMembersInheritedFromClasses(classA);
@@ -3431,11 +3696,11 @@
   void test_getMapOfMembersInheritedFromClasses_method_implements() {
     // class A { int g(); }
     // class B implements A {}
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElement methodM = ElementFactory.methodElement(methodName, _typeProvider.intType, []);
+    MethodElement methodM = ElementFactory.methodElement(methodName, _typeProvider.intType);
     classA.methods = <MethodElement> [methodM];
-    ClassElementImpl classB = ElementFactory.classElement2("B", []);
+    ClassElementImpl classB = ElementFactory.classElement2("B");
     classB.interfaces = <InterfaceType> [classA.type];
     MemberMap mapB = _inheritanceManager.getMapOfMembersInheritedFromClasses(classB);
     MemberMap mapA = _inheritanceManager.getMapOfMembersInheritedFromClasses(classA);
@@ -3449,11 +3714,11 @@
   void test_getMapOfMembersInheritedFromClasses_method_with() {
     // class A { int g(); }
     // class B extends Object with A {}
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElement methodM = ElementFactory.methodElement(methodName, _typeProvider.intType, []);
+    MethodElement methodM = ElementFactory.methodElement(methodName, _typeProvider.intType);
     classA.methods = <MethodElement> [methodM];
-    ClassElementImpl classB = ElementFactory.classElement2("B", []);
+    ClassElementImpl classB = ElementFactory.classElement2("B");
     classB.mixins = <InterfaceType> [classA.type];
     MemberMap mapB = _inheritanceManager.getMapOfMembersInheritedFromClasses(classB);
     MemberMap mapA = _inheritanceManager.getMapOfMembersInheritedFromClasses(classA);
@@ -3467,11 +3732,11 @@
   void test_getMapOfMembersInheritedFromInterfaces_accessor_extends() {
     // class A { int get g; }
     // class B extends A {}
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String getterName = "g";
     PropertyAccessorElement getterG = ElementFactory.getterElement(getterName, false, _typeProvider.intType);
     classA.accessors = <PropertyAccessorElement> [getterG];
-    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
     MemberMap mapB = _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classB);
     MemberMap mapA = _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classA);
     expect(mapA.size, _numOfMembersInObject);
@@ -3484,11 +3749,11 @@
   void test_getMapOfMembersInheritedFromInterfaces_accessor_implements() {
     // class A { int get g; }
     // class B implements A {}
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String getterName = "g";
     PropertyAccessorElement getterG = ElementFactory.getterElement(getterName, false, _typeProvider.intType);
     classA.accessors = <PropertyAccessorElement> [getterG];
-    ClassElementImpl classB = ElementFactory.classElement2("B", []);
+    ClassElementImpl classB = ElementFactory.classElement2("B");
     classB.interfaces = <InterfaceType> [classA.type];
     MemberMap mapB = _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classB);
     MemberMap mapA = _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classA);
@@ -3502,11 +3767,11 @@
   void test_getMapOfMembersInheritedFromInterfaces_accessor_with() {
     // class A { int get g; }
     // class B extends Object with A {}
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String getterName = "g";
     PropertyAccessorElement getterG = ElementFactory.getterElement(getterName, false, _typeProvider.intType);
     classA.accessors = <PropertyAccessorElement> [getterG];
-    ClassElementImpl classB = ElementFactory.classElement2("B", []);
+    ClassElementImpl classB = ElementFactory.classElement2("B");
     classB.mixins = <InterfaceType> [classA.type];
     MemberMap mapB = _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classB);
     MemberMap mapA = _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classA);
@@ -3519,7 +3784,7 @@
 
   void test_getMapOfMembersInheritedFromInterfaces_implicitExtends() {
     // class A {}
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     MemberMap mapA = _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classA);
     expect(mapA.size, _numOfMembersInObject);
     _assertNoErrors(classA);
@@ -3529,14 +3794,14 @@
     // class I1 { int m(); }
     // class I2 { int get m; }
     // class A implements I2, I1 {}
-    ClassElementImpl classI1 = ElementFactory.classElement2("I1", []);
+    ClassElementImpl classI1 = ElementFactory.classElement2("I1");
     String methodName = "m";
-    MethodElement methodM = ElementFactory.methodElement(methodName, _typeProvider.intType, []);
+    MethodElement methodM = ElementFactory.methodElement(methodName, _typeProvider.intType);
     classI1.methods = <MethodElement> [methodM];
-    ClassElementImpl classI2 = ElementFactory.classElement2("I2", []);
+    ClassElementImpl classI2 = ElementFactory.classElement2("I2");
     PropertyAccessorElement getter = ElementFactory.getterElement(methodName, false, _typeProvider.intType);
     classI2.accessors = <PropertyAccessorElement> [getter];
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     classA.interfaces = <InterfaceType> [classI2.type, classI1.type];
     MemberMap mapA = _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classA);
     expect(mapA.size, _numOfMembersInObject);
@@ -3548,14 +3813,14 @@
     // class I1 { int m(); }
     // class I2 { String m(); }
     // class A implements I1, I2 {}
-    ClassElementImpl classI1 = ElementFactory.classElement2("I1", []);
+    ClassElementImpl classI1 = ElementFactory.classElement2("I1");
     String methodName = "m";
     MethodElement methodM1 = ElementFactory.methodElement(methodName, null, [_typeProvider.intType]);
     classI1.methods = <MethodElement> [methodM1];
-    ClassElementImpl classI2 = ElementFactory.classElement2("I2", []);
+    ClassElementImpl classI2 = ElementFactory.classElement2("I2");
     MethodElement methodM2 = ElementFactory.methodElement(methodName, null, [_typeProvider.stringType]);
     classI2.methods = <MethodElement> [methodM2];
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     classA.interfaces = <InterfaceType> [classI1.type, classI2.type];
     MemberMap mapA = _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classA);
     expect(mapA.size, _numOfMembersInObject);
@@ -3567,14 +3832,14 @@
     // class I1 { int m(); }
     // class I2 { int get m; }
     // class A implements I1, I2 {}
-    ClassElementImpl classI1 = ElementFactory.classElement2("I1", []);
+    ClassElementImpl classI1 = ElementFactory.classElement2("I1");
     String methodName = "m";
-    MethodElement methodM = ElementFactory.methodElement(methodName, _typeProvider.intType, []);
+    MethodElement methodM = ElementFactory.methodElement(methodName, _typeProvider.intType);
     classI1.methods = <MethodElement> [methodM];
-    ClassElementImpl classI2 = ElementFactory.classElement2("I2", []);
+    ClassElementImpl classI2 = ElementFactory.classElement2("I2");
     PropertyAccessorElement getter = ElementFactory.getterElement(methodName, false, _typeProvider.intType);
     classI2.accessors = <PropertyAccessorElement> [getter];
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     classA.interfaces = <InterfaceType> [classI1.type, classI2.type];
     MemberMap mapA = _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classA);
     expect(mapA.size, _numOfMembersInObject);
@@ -3586,9 +3851,9 @@
     // class I1 { dynamic m(int, [int]); }
     // class I2 { dynamic m(int, int, int); }
     // class A implements I1, I2 {}
-    ClassElementImpl classI1 = ElementFactory.classElement2("I1", []);
+    ClassElementImpl classI1 = ElementFactory.classElement2("I1");
     String methodName = "m";
-    MethodElementImpl methodM1 = ElementFactory.methodElement(methodName, _typeProvider.dynamicType, []);
+    MethodElementImpl methodM1 = ElementFactory.methodElement(methodName, _typeProvider.dynamicType);
     ParameterElementImpl parameter1 = new ParameterElementImpl.forNode(AstFactory.identifier3("a1"));
     parameter1.type = _typeProvider.intType;
     parameter1.parameterKind = ParameterKind.REQUIRED;
@@ -3597,8 +3862,8 @@
     parameter2.parameterKind = ParameterKind.POSITIONAL;
     methodM1.parameters = <ParameterElement> [parameter1, parameter2];
     classI1.methods = <MethodElement> [methodM1];
-    ClassElementImpl classI2 = ElementFactory.classElement2("I2", []);
-    MethodElementImpl methodM2 = ElementFactory.methodElement(methodName, _typeProvider.dynamicType, []);
+    ClassElementImpl classI2 = ElementFactory.classElement2("I2");
+    MethodElementImpl methodM2 = ElementFactory.methodElement(methodName, _typeProvider.dynamicType);
     ParameterElementImpl parameter3 = new ParameterElementImpl.forNode(AstFactory.identifier3("a3"));
     parameter3.type = _typeProvider.intType;
     parameter3.parameterKind = ParameterKind.REQUIRED;
@@ -3610,7 +3875,7 @@
     parameter5.parameterKind = ParameterKind.REQUIRED;
     methodM2.parameters = <ParameterElement> [parameter3, parameter4, parameter5];
     classI2.methods = <MethodElement> [methodM2];
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     classA.interfaces = <InterfaceType> [classI1.type, classI2.type];
     MemberMap mapA = _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classA);
     expect(mapA.size, _numOfMembersInObject);
@@ -3622,14 +3887,14 @@
     // class I1 { int m(); }
     // class I2 { String m(); }
     // class A implements I2, I1 {}
-    ClassElementImpl classI1 = ElementFactory.classElement2("I1", []);
+    ClassElementImpl classI1 = ElementFactory.classElement2("I1");
     String methodName = "m";
     MethodElement methodM1 = ElementFactory.methodElement(methodName, null, [_typeProvider.stringType]);
     classI1.methods = <MethodElement> [methodM1];
-    ClassElementImpl classI2 = ElementFactory.classElement2("I2", []);
+    ClassElementImpl classI2 = ElementFactory.classElement2("I2");
     MethodElement methodM2 = ElementFactory.methodElement(methodName, null, [_typeProvider.intType]);
     classI2.methods = <MethodElement> [methodM2];
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     classA.interfaces = <InterfaceType> [classI2.type, classI1.type];
     MemberMap mapA = _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classA);
     expect(mapA.size, _numOfMembersInObject);
@@ -3640,11 +3905,11 @@
   void test_getMapOfMembersInheritedFromInterfaces_method_extends() {
     // class A { int g(); }
     // class B extends A {}
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElement methodM = ElementFactory.methodElement(methodName, _typeProvider.intType, []);
+    MethodElement methodM = ElementFactory.methodElement(methodName, _typeProvider.intType);
     classA.methods = <MethodElement> [methodM];
-    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
     MemberMap mapB = _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classB);
     MemberMap mapA = _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classA);
     expect(mapA.size, _numOfMembersInObject);
@@ -3657,11 +3922,11 @@
   void test_getMapOfMembersInheritedFromInterfaces_method_implements() {
     // class A { int g(); }
     // class B implements A {}
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElement methodM = ElementFactory.methodElement(methodName, _typeProvider.intType, []);
+    MethodElement methodM = ElementFactory.methodElement(methodName, _typeProvider.intType);
     classA.methods = <MethodElement> [methodM];
-    ClassElementImpl classB = ElementFactory.classElement2("B", []);
+    ClassElementImpl classB = ElementFactory.classElement2("B");
     classB.interfaces = <InterfaceType> [classA.type];
     MemberMap mapB = _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classB);
     MemberMap mapA = _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classA);
@@ -3675,11 +3940,11 @@
   void test_getMapOfMembersInheritedFromInterfaces_method_with() {
     // class A { int g(); }
     // class B extends Object with A {}
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElement methodM = ElementFactory.methodElement(methodName, _typeProvider.intType, []);
+    MethodElement methodM = ElementFactory.methodElement(methodName, _typeProvider.intType);
     classA.methods = <MethodElement> [methodM];
-    ClassElementImpl classB = ElementFactory.classElement2("B", []);
+    ClassElementImpl classB = ElementFactory.classElement2("B");
     classB.mixins = <InterfaceType> [classA.type];
     MemberMap mapB = _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classB);
     MemberMap mapA = _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classA);
@@ -3694,15 +3959,15 @@
     // class I1 { int m1(); }
     // class I2 { int m2(); }
     // class A implements I1, I2 {}
-    ClassElementImpl classI1 = ElementFactory.classElement2("I1", []);
+    ClassElementImpl classI1 = ElementFactory.classElement2("I1");
     String methodName1 = "m1";
-    MethodElement methodM1 = ElementFactory.methodElement(methodName1, _typeProvider.intType, []);
+    MethodElement methodM1 = ElementFactory.methodElement(methodName1, _typeProvider.intType);
     classI1.methods = <MethodElement> [methodM1];
-    ClassElementImpl classI2 = ElementFactory.classElement2("I2", []);
+    ClassElementImpl classI2 = ElementFactory.classElement2("I2");
     String methodName2 = "m2";
-    MethodElement methodM2 = ElementFactory.methodElement(methodName2, _typeProvider.intType, []);
+    MethodElement methodM2 = ElementFactory.methodElement(methodName2, _typeProvider.intType);
     classI2.methods = <MethodElement> [methodM2];
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     classA.interfaces = <InterfaceType> [classI1.type, classI2.type];
     MemberMap mapA = _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classA);
     expect(mapA.size, _numOfMembersInObject + 2);
@@ -3715,14 +3980,14 @@
     // class I1 { int get g; }
     // class I2 { num get g; }
     // class A implements I1, I2 {}
-    ClassElementImpl classI1 = ElementFactory.classElement2("I1", []);
+    ClassElementImpl classI1 = ElementFactory.classElement2("I1");
     String accessorName = "g";
     PropertyAccessorElement getter1 = ElementFactory.getterElement(accessorName, false, _typeProvider.intType);
     classI1.accessors = <PropertyAccessorElement> [getter1];
-    ClassElementImpl classI2 = ElementFactory.classElement2("I2", []);
+    ClassElementImpl classI2 = ElementFactory.classElement2("I2");
     PropertyAccessorElement getter2 = ElementFactory.getterElement(accessorName, false, _typeProvider.numType);
     classI2.accessors = <PropertyAccessorElement> [getter2];
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     classA.interfaces = <InterfaceType> [classI1.type, classI2.type];
     MemberMap mapA = _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classA);
     expect(mapA.size, _numOfMembersInObject + 1);
@@ -3735,22 +4000,22 @@
     // class I1 { dynamic m(int); }
     // class I2 { dynamic m(num); }
     // class A implements I1, I2 {}
-    ClassElementImpl classI1 = ElementFactory.classElement2("I1", []);
+    ClassElementImpl classI1 = ElementFactory.classElement2("I1");
     String methodName = "m";
-    MethodElementImpl methodM1 = ElementFactory.methodElement(methodName, _typeProvider.dynamicType, []);
+    MethodElementImpl methodM1 = ElementFactory.methodElement(methodName, _typeProvider.dynamicType);
     ParameterElementImpl parameter1 = new ParameterElementImpl.forNode(AstFactory.identifier3("a0"));
     parameter1.type = _typeProvider.intType;
     parameter1.parameterKind = ParameterKind.REQUIRED;
     methodM1.parameters = <ParameterElement> [parameter1];
     classI1.methods = <MethodElement> [methodM1];
-    ClassElementImpl classI2 = ElementFactory.classElement2("I2", []);
-    MethodElementImpl methodM2 = ElementFactory.methodElement(methodName, _typeProvider.dynamicType, []);
+    ClassElementImpl classI2 = ElementFactory.classElement2("I2");
+    MethodElementImpl methodM2 = ElementFactory.methodElement(methodName, _typeProvider.dynamicType);
     ParameterElementImpl parameter2 = new ParameterElementImpl.forNode(AstFactory.identifier3("a0"));
     parameter2.type = _typeProvider.numType;
     parameter2.parameterKind = ParameterKind.REQUIRED;
     methodM2.parameters = <ParameterElement> [parameter2];
     classI2.methods = <MethodElement> [methodM2];
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     classA.interfaces = <InterfaceType> [classI1.type, classI2.type];
     MemberMap mapA = _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classA);
     expect(mapA.size, _numOfMembersInObject + 1);
@@ -3763,14 +4028,14 @@
     // class I1 { set s(int); }
     // class I2 { set s(num); }
     // class A implements I1, I2 {}
-    ClassElementImpl classI1 = ElementFactory.classElement2("I1", []);
+    ClassElementImpl classI1 = ElementFactory.classElement2("I1");
     String accessorName = "s";
     PropertyAccessorElement setter1 = ElementFactory.setterElement(accessorName, false, _typeProvider.intType);
     classI1.accessors = <PropertyAccessorElement> [setter1];
-    ClassElementImpl classI2 = ElementFactory.classElement2("I2", []);
+    ClassElementImpl classI2 = ElementFactory.classElement2("I2");
     PropertyAccessorElement setter2 = ElementFactory.setterElement(accessorName, false, _typeProvider.numType);
     classI2.accessors = <PropertyAccessorElement> [setter2];
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     classA.interfaces = <InterfaceType> [classI1.type, classI2.type];
     MemberMap mapA = _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classA);
     expect(mapA.size, _numOfMembersInObject + 1);
@@ -3788,20 +4053,20 @@
     // class I2 { B get g; }
     // class I3 { C get g; }
     // class D implements I1, I2, I3 {}
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
-    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
-    ClassElementImpl classC = ElementFactory.classElement("C", classB.type, []);
-    ClassElementImpl classI1 = ElementFactory.classElement2("I1", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
+    ClassElementImpl classC = ElementFactory.classElement("C", classB.type);
+    ClassElementImpl classI1 = ElementFactory.classElement2("I1");
     String accessorName = "g";
     PropertyAccessorElement getter1 = ElementFactory.getterElement(accessorName, false, classA.type);
     classI1.accessors = <PropertyAccessorElement> [getter1];
-    ClassElementImpl classI2 = ElementFactory.classElement2("I2", []);
+    ClassElementImpl classI2 = ElementFactory.classElement2("I2");
     PropertyAccessorElement getter2 = ElementFactory.getterElement(accessorName, false, classB.type);
     classI2.accessors = <PropertyAccessorElement> [getter2];
-    ClassElementImpl classI3 = ElementFactory.classElement2("I3", []);
+    ClassElementImpl classI3 = ElementFactory.classElement2("I3");
     PropertyAccessorElement getter3 = ElementFactory.getterElement(accessorName, false, classC.type);
     classI3.accessors = <PropertyAccessorElement> [getter3];
-    ClassElementImpl classD = ElementFactory.classElement2("D", []);
+    ClassElementImpl classD = ElementFactory.classElement2("D");
     classD.interfaces = <InterfaceType> [classI1.type, classI2.type, classI3.type];
     MemberMap mapD = _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classD);
     expect(mapD.size, _numOfMembersInObject + 1);
@@ -3818,32 +4083,32 @@
     // class I2 { dynamic m(B b); }
     // class I3 { dynamic m(C c); }
     // class D implements I1, I2, I3 {}
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
-    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
-    ClassElementImpl classC = ElementFactory.classElement("C", classB.type, []);
-    ClassElementImpl classI1 = ElementFactory.classElement2("I1", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
+    ClassElementImpl classC = ElementFactory.classElement("C", classB.type);
+    ClassElementImpl classI1 = ElementFactory.classElement2("I1");
     String methodName = "m";
-    MethodElementImpl methodM1 = ElementFactory.methodElement(methodName, _typeProvider.dynamicType, []);
+    MethodElementImpl methodM1 = ElementFactory.methodElement(methodName, _typeProvider.dynamicType);
     ParameterElementImpl parameter1 = new ParameterElementImpl.forNode(AstFactory.identifier3("a0"));
     parameter1.type = classA.type;
     parameter1.parameterKind = ParameterKind.REQUIRED;
     methodM1.parameters = <ParameterElement> [parameter1];
     classI1.methods = <MethodElement> [methodM1];
-    ClassElementImpl classI2 = ElementFactory.classElement2("I2", []);
-    MethodElementImpl methodM2 = ElementFactory.methodElement(methodName, _typeProvider.dynamicType, []);
+    ClassElementImpl classI2 = ElementFactory.classElement2("I2");
+    MethodElementImpl methodM2 = ElementFactory.methodElement(methodName, _typeProvider.dynamicType);
     ParameterElementImpl parameter2 = new ParameterElementImpl.forNode(AstFactory.identifier3("a0"));
     parameter2.type = classB.type;
     parameter2.parameterKind = ParameterKind.REQUIRED;
     methodM2.parameters = <ParameterElement> [parameter2];
     classI2.methods = <MethodElement> [methodM2];
-    ClassElementImpl classI3 = ElementFactory.classElement2("I3", []);
-    MethodElementImpl methodM3 = ElementFactory.methodElement(methodName, _typeProvider.dynamicType, []);
+    ClassElementImpl classI3 = ElementFactory.classElement2("I3");
+    MethodElementImpl methodM3 = ElementFactory.methodElement(methodName, _typeProvider.dynamicType);
     ParameterElementImpl parameter3 = new ParameterElementImpl.forNode(AstFactory.identifier3("a0"));
     parameter3.type = classC.type;
     parameter3.parameterKind = ParameterKind.REQUIRED;
     methodM3.parameters = <ParameterElement> [parameter3];
     classI3.methods = <MethodElement> [methodM3];
-    ClassElementImpl classD = ElementFactory.classElement2("D", []);
+    ClassElementImpl classD = ElementFactory.classElement2("D");
     classD.interfaces = <InterfaceType> [classI1.type, classI2.type, classI3.type];
     MemberMap mapD = _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classD);
     expect(mapD.size, _numOfMembersInObject + 1);
@@ -3860,20 +4125,20 @@
     // class I2 { set s(B); }
     // class I3 { set s(C); }
     // class D implements I1, I2, I3 {}
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
-    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
-    ClassElementImpl classC = ElementFactory.classElement("C", classB.type, []);
-    ClassElementImpl classI1 = ElementFactory.classElement2("I1", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
+    ClassElementImpl classC = ElementFactory.classElement("C", classB.type);
+    ClassElementImpl classI1 = ElementFactory.classElement2("I1");
     String accessorName = "s";
     PropertyAccessorElement setter1 = ElementFactory.setterElement(accessorName, false, classA.type);
     classI1.accessors = <PropertyAccessorElement> [setter1];
-    ClassElementImpl classI2 = ElementFactory.classElement2("I2", []);
+    ClassElementImpl classI2 = ElementFactory.classElement2("I2");
     PropertyAccessorElement setter2 = ElementFactory.setterElement(accessorName, false, classB.type);
     classI2.accessors = <PropertyAccessorElement> [setter2];
-    ClassElementImpl classI3 = ElementFactory.classElement2("I3", []);
+    ClassElementImpl classI3 = ElementFactory.classElement2("I3");
     PropertyAccessorElement setter3 = ElementFactory.setterElement(accessorName, false, classC.type);
     classI3.accessors = <PropertyAccessorElement> [setter3];
-    ClassElementImpl classD = ElementFactory.classElement2("D", []);
+    ClassElementImpl classD = ElementFactory.classElement2("D");
     classD.interfaces = <InterfaceType> [classI1.type, classI2.type, classI3.type];
     MemberMap mapD = _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classD);
     expect(mapD.size, _numOfMembersInObject + 1);
@@ -3887,18 +4152,18 @@
     // class I1 { int m(); }
     // class I2 { int m([int]); }
     // class A implements I1, I2 {}
-    ClassElementImpl classI1 = ElementFactory.classElement2("I1", []);
+    ClassElementImpl classI1 = ElementFactory.classElement2("I1");
     String methodName = "m";
-    MethodElement methodM1 = ElementFactory.methodElement(methodName, _typeProvider.intType, []);
+    MethodElement methodM1 = ElementFactory.methodElement(methodName, _typeProvider.intType);
     classI1.methods = <MethodElement> [methodM1];
-    ClassElementImpl classI2 = ElementFactory.classElement2("I2", []);
-    MethodElementImpl methodM2 = ElementFactory.methodElement(methodName, _typeProvider.intType, []);
+    ClassElementImpl classI2 = ElementFactory.classElement2("I2");
+    MethodElementImpl methodM2 = ElementFactory.methodElement(methodName, _typeProvider.intType);
     ParameterElementImpl parameter1 = new ParameterElementImpl.forNode(AstFactory.identifier3("a1"));
     parameter1.type = _typeProvider.intType;
     parameter1.parameterKind = ParameterKind.POSITIONAL;
     methodM2.parameters = <ParameterElement> [parameter1];
     classI2.methods = <MethodElement> [methodM2];
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     classA.interfaces = <InterfaceType> [classI1.type, classI2.type];
     MemberMap mapA = _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classA);
     expect(mapA.size, _numOfMembersInObject + 1);
@@ -3911,19 +4176,19 @@
     // class I2 { int m([int]); }
     // class I3 { int m([int, int]); }
     // class A implements I1, I2, I3 {}
-    ClassElementImpl classI1 = ElementFactory.classElement2("I1", []);
+    ClassElementImpl classI1 = ElementFactory.classElement2("I1");
     String methodName = "m";
-    MethodElementImpl methodM1 = ElementFactory.methodElement(methodName, _typeProvider.intType, []);
+    MethodElementImpl methodM1 = ElementFactory.methodElement(methodName, _typeProvider.intType);
     classI1.methods = <MethodElement> [methodM1];
-    ClassElementImpl classI2 = ElementFactory.classElement2("I2", []);
-    MethodElementImpl methodM2 = ElementFactory.methodElement(methodName, _typeProvider.intType, []);
+    ClassElementImpl classI2 = ElementFactory.classElement2("I2");
+    MethodElementImpl methodM2 = ElementFactory.methodElement(methodName, _typeProvider.intType);
     ParameterElementImpl parameter1 = new ParameterElementImpl.forNode(AstFactory.identifier3("a1"));
     parameter1.type = _typeProvider.intType;
     parameter1.parameterKind = ParameterKind.POSITIONAL;
     methodM1.parameters = <ParameterElement> [parameter1];
     classI2.methods = <MethodElement> [methodM2];
-    ClassElementImpl classI3 = ElementFactory.classElement2("I3", []);
-    MethodElementImpl methodM3 = ElementFactory.methodElement(methodName, _typeProvider.intType, []);
+    ClassElementImpl classI3 = ElementFactory.classElement2("I3");
+    MethodElementImpl methodM3 = ElementFactory.methodElement(methodName, _typeProvider.intType);
     ParameterElementImpl parameter2 = new ParameterElementImpl.forNode(AstFactory.identifier3("a2"));
     parameter2.type = _typeProvider.intType;
     parameter2.parameterKind = ParameterKind.POSITIONAL;
@@ -3932,7 +4197,7 @@
     parameter3.parameterKind = ParameterKind.POSITIONAL;
     methodM3.parameters = <ParameterElement> [parameter2, parameter3];
     classI3.methods = <MethodElement> [methodM3];
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     classA.interfaces = <InterfaceType> [classI1.type, classI2.type, classI3.type];
     MemberMap mapA = _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classA);
     expect(mapA.size, _numOfMembersInObject + 1);
@@ -3946,22 +4211,22 @@
     // class I3 { int m([int]); }
     // class I4 { int m([int, int]); }
     // class A implements I1, I2, I3, I4 {}
-    ClassElementImpl classI1 = ElementFactory.classElement2("I1", []);
+    ClassElementImpl classI1 = ElementFactory.classElement2("I1");
     String methodName = "m";
-    MethodElement methodM1 = ElementFactory.methodElement(methodName, _typeProvider.intType, []);
+    MethodElement methodM1 = ElementFactory.methodElement(methodName, _typeProvider.intType);
     classI1.methods = <MethodElement> [methodM1];
-    ClassElementImpl classI2 = ElementFactory.classElement2("I2", []);
-    MethodElement methodM2 = ElementFactory.methodElement(methodName, _typeProvider.intType, []);
+    ClassElementImpl classI2 = ElementFactory.classElement2("I2");
+    MethodElement methodM2 = ElementFactory.methodElement(methodName, _typeProvider.intType);
     classI2.methods = <MethodElement> [methodM2];
-    ClassElementImpl classI3 = ElementFactory.classElement2("I3", []);
-    MethodElementImpl methodM3 = ElementFactory.methodElement(methodName, _typeProvider.intType, []);
+    ClassElementImpl classI3 = ElementFactory.classElement2("I3");
+    MethodElementImpl methodM3 = ElementFactory.methodElement(methodName, _typeProvider.intType);
     ParameterElementImpl parameter1 = new ParameterElementImpl.forNode(AstFactory.identifier3("a1"));
     parameter1.type = _typeProvider.intType;
     parameter1.parameterKind = ParameterKind.POSITIONAL;
     methodM3.parameters = <ParameterElement> [parameter1];
     classI3.methods = <MethodElement> [methodM3];
-    ClassElementImpl classI4 = ElementFactory.classElement2("I4", []);
-    MethodElementImpl methodM4 = ElementFactory.methodElement(methodName, _typeProvider.intType, []);
+    ClassElementImpl classI4 = ElementFactory.classElement2("I4");
+    MethodElementImpl methodM4 = ElementFactory.methodElement(methodName, _typeProvider.intType);
     ParameterElementImpl parameter2 = new ParameterElementImpl.forNode(AstFactory.identifier3("a2"));
     parameter2.type = _typeProvider.intType;
     parameter2.parameterKind = ParameterKind.POSITIONAL;
@@ -3970,7 +4235,7 @@
     parameter3.parameterKind = ParameterKind.POSITIONAL;
     methodM4.parameters = <ParameterElement> [parameter2, parameter3];
     classI4.methods = <MethodElement> [methodM4];
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     classA.interfaces = <InterfaceType> [classI1.type, classI2.type, classI3.type, classI4.type];
     MemberMap mapA = _inheritanceManager.getMapOfMembersInheritedFromInterfaces(classA);
     expect(mapA.size, _numOfMembersInObject + 1);
@@ -3979,11 +4244,11 @@
   }
 
   void test_lookupInheritance_interface_getter() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String getterName = "g";
     PropertyAccessorElement getterG = ElementFactory.getterElement(getterName, false, _typeProvider.intType);
     classA.accessors = <PropertyAccessorElement> [getterG];
-    ClassElementImpl classB = ElementFactory.classElement2("B", []);
+    ClassElementImpl classB = ElementFactory.classElement2("B");
     classB.interfaces = <InterfaceType> [classA.type];
     expect(_inheritanceManager.lookupInheritance(classB, getterName), same(getterG));
     _assertNoErrors(classA);
@@ -3991,11 +4256,11 @@
   }
 
   void test_lookupInheritance_interface_method() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElement methodM = ElementFactory.methodElement(methodName, _typeProvider.intType, []);
+    MethodElement methodM = ElementFactory.methodElement(methodName, _typeProvider.intType);
     classA.methods = <MethodElement> [methodM];
-    ClassElementImpl classB = ElementFactory.classElement2("B", []);
+    ClassElementImpl classB = ElementFactory.classElement2("B");
     classB.interfaces = <InterfaceType> [classA.type];
     expect(_inheritanceManager.lookupInheritance(classB, methodName), same(methodM));
     _assertNoErrors(classA);
@@ -4003,11 +4268,11 @@
   }
 
   void test_lookupInheritance_interface_setter() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String setterName = "s";
     PropertyAccessorElement setterS = ElementFactory.setterElement(setterName, false, _typeProvider.intType);
     classA.accessors = <PropertyAccessorElement> [setterS];
-    ClassElementImpl classB = ElementFactory.classElement2("B", []);
+    ClassElementImpl classB = ElementFactory.classElement2("B");
     classB.interfaces = <InterfaceType> [classA.type];
     expect(_inheritanceManager.lookupInheritance(classB, "$setterName="), same(setterS));
     _assertNoErrors(classA);
@@ -4015,12 +4280,12 @@
   }
 
   void test_lookupInheritance_interface_staticMember() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElement methodM = ElementFactory.methodElement(methodName, _typeProvider.intType, []);
+    MethodElement methodM = ElementFactory.methodElement(methodName, _typeProvider.intType);
     (methodM as MethodElementImpl).static = true;
     classA.methods = <MethodElement> [methodM];
-    ClassElementImpl classB = ElementFactory.classElement2("B", []);
+    ClassElementImpl classB = ElementFactory.classElement2("B");
     classB.interfaces = <InterfaceType> [classA.type];
     expect(_inheritanceManager.lookupInheritance(classB, methodName), isNull);
     _assertNoErrors(classA);
@@ -4028,15 +4293,15 @@
   }
 
   void test_lookupInheritance_interfaces_infiniteLoop() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     classA.interfaces = <InterfaceType> [classA.type];
     expect(_inheritanceManager.lookupInheritance(classA, "name"), isNull);
     _assertNoErrors(classA);
   }
 
   void test_lookupInheritance_interfaces_infiniteLoop2() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
-    ClassElementImpl classB = ElementFactory.classElement2("B", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
+    ClassElementImpl classB = ElementFactory.classElement2("B");
     classA.interfaces = <InterfaceType> [classB.type];
     classB.interfaces = <InterfaceType> [classA.type];
     expect(_inheritanceManager.lookupInheritance(classA, "name"), isNull);
@@ -4045,16 +4310,16 @@
   }
 
   void test_lookupInheritance_interfaces_union2() {
-    ClassElementImpl classI1 = ElementFactory.classElement2("I1", []);
+    ClassElementImpl classI1 = ElementFactory.classElement2("I1");
     String methodName1 = "m1";
-    MethodElement methodM1 = ElementFactory.methodElement(methodName1, _typeProvider.intType, []);
+    MethodElement methodM1 = ElementFactory.methodElement(methodName1, _typeProvider.intType);
     classI1.methods = <MethodElement> [methodM1];
-    ClassElementImpl classI2 = ElementFactory.classElement2("I2", []);
+    ClassElementImpl classI2 = ElementFactory.classElement2("I2");
     String methodName2 = "m2";
-    MethodElement methodM2 = ElementFactory.methodElement(methodName2, _typeProvider.intType, []);
+    MethodElement methodM2 = ElementFactory.methodElement(methodName2, _typeProvider.intType);
     classI2.methods = <MethodElement> [methodM2];
     classI2.interfaces = <InterfaceType> [classI1.type];
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     classA.interfaces = <InterfaceType> [classI2.type];
     expect(_inheritanceManager.lookupInheritance(classA, methodName1), same(methodM1));
     expect(_inheritanceManager.lookupInheritance(classA, methodName2), same(methodM2));
@@ -4064,11 +4329,11 @@
   }
 
   void test_lookupInheritance_mixin_getter() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String getterName = "g";
     PropertyAccessorElement getterG = ElementFactory.getterElement(getterName, false, _typeProvider.intType);
     classA.accessors = <PropertyAccessorElement> [getterG];
-    ClassElementImpl classB = ElementFactory.classElement2("B", []);
+    ClassElementImpl classB = ElementFactory.classElement2("B");
     classB.mixins = <InterfaceType> [classA.type];
     expect(_inheritanceManager.lookupInheritance(classB, getterName), same(getterG));
     _assertNoErrors(classA);
@@ -4076,11 +4341,11 @@
   }
 
   void test_lookupInheritance_mixin_method() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElement methodM = ElementFactory.methodElement(methodName, _typeProvider.intType, []);
+    MethodElement methodM = ElementFactory.methodElement(methodName, _typeProvider.intType);
     classA.methods = <MethodElement> [methodM];
-    ClassElementImpl classB = ElementFactory.classElement2("B", []);
+    ClassElementImpl classB = ElementFactory.classElement2("B");
     classB.mixins = <InterfaceType> [classA.type];
     expect(_inheritanceManager.lookupInheritance(classB, methodName), same(methodM));
     _assertNoErrors(classA);
@@ -4088,11 +4353,11 @@
   }
 
   void test_lookupInheritance_mixin_setter() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String setterName = "s";
     PropertyAccessorElement setterS = ElementFactory.setterElement(setterName, false, _typeProvider.intType);
     classA.accessors = <PropertyAccessorElement> [setterS];
-    ClassElementImpl classB = ElementFactory.classElement2("B", []);
+    ClassElementImpl classB = ElementFactory.classElement2("B");
     classB.mixins = <InterfaceType> [classA.type];
     expect(_inheritanceManager.lookupInheritance(classB, "$setterName="), same(setterS));
     _assertNoErrors(classA);
@@ -4100,12 +4365,12 @@
   }
 
   void test_lookupInheritance_mixin_staticMember() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElement methodM = ElementFactory.methodElement(methodName, _typeProvider.intType, []);
+    MethodElement methodM = ElementFactory.methodElement(methodName, _typeProvider.intType);
     (methodM as MethodElementImpl).static = true;
     classA.methods = <MethodElement> [methodM];
-    ClassElementImpl classB = ElementFactory.classElement2("B", []);
+    ClassElementImpl classB = ElementFactory.classElement2("B");
     classB.mixins = <InterfaceType> [classA.type];
     expect(_inheritanceManager.lookupInheritance(classB, methodName), isNull);
     _assertNoErrors(classA);
@@ -4113,32 +4378,32 @@
   }
 
   void test_lookupInheritance_noMember() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     expect(_inheritanceManager.lookupInheritance(classA, "a"), isNull);
     _assertNoErrors(classA);
   }
 
   void test_lookupInheritance_superclass_getter() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String getterName = "g";
     PropertyAccessorElement getterG = ElementFactory.getterElement(getterName, false, _typeProvider.intType);
     classA.accessors = <PropertyAccessorElement> [getterG];
-    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
     expect(_inheritanceManager.lookupInheritance(classB, getterName), same(getterG));
     _assertNoErrors(classA);
     _assertNoErrors(classB);
   }
 
   void test_lookupInheritance_superclass_infiniteLoop() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     classA.supertype = classA.type;
     expect(_inheritanceManager.lookupInheritance(classA, "name"), isNull);
     _assertNoErrors(classA);
   }
 
   void test_lookupInheritance_superclass_infiniteLoop2() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
-    ClassElementImpl classB = ElementFactory.classElement2("B", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
+    ClassElementImpl classB = ElementFactory.classElement2("B");
     classA.supertype = classB.type;
     classB.supertype = classA.type;
     expect(_inheritanceManager.lookupInheritance(classA, "name"), isNull);
@@ -4147,41 +4412,41 @@
   }
 
   void test_lookupInheritance_superclass_method() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElement methodM = ElementFactory.methodElement(methodName, _typeProvider.intType, []);
+    MethodElement methodM = ElementFactory.methodElement(methodName, _typeProvider.intType);
     classA.methods = <MethodElement> [methodM];
-    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
     expect(_inheritanceManager.lookupInheritance(classB, methodName), same(methodM));
     _assertNoErrors(classA);
     _assertNoErrors(classB);
   }
 
   void test_lookupInheritance_superclass_setter() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String setterName = "s";
     PropertyAccessorElement setterS = ElementFactory.setterElement(setterName, false, _typeProvider.intType);
     classA.accessors = <PropertyAccessorElement> [setterS];
-    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
     expect(_inheritanceManager.lookupInheritance(classB, "$setterName="), same(setterS));
     _assertNoErrors(classA);
     _assertNoErrors(classB);
   }
 
   void test_lookupInheritance_superclass_staticMember() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElement methodM = ElementFactory.methodElement(methodName, _typeProvider.intType, []);
+    MethodElement methodM = ElementFactory.methodElement(methodName, _typeProvider.intType);
     (methodM as MethodElementImpl).static = true;
     classA.methods = <MethodElement> [methodM];
-    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
     expect(_inheritanceManager.lookupInheritance(classB, methodName), isNull);
     _assertNoErrors(classA);
     _assertNoErrors(classB);
   }
 
   void test_lookupMember_getter() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String getterName = "g";
     PropertyAccessorElement getterG = ElementFactory.getterElement(getterName, false, _typeProvider.intType);
     classA.accessors = <PropertyAccessorElement> [getterG];
@@ -4190,7 +4455,7 @@
   }
 
   void test_lookupMember_getter_static() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String getterName = "g";
     PropertyAccessorElement getterG = ElementFactory.getterElement(getterName, true, _typeProvider.intType);
     classA.accessors = <PropertyAccessorElement> [getterG];
@@ -4199,18 +4464,18 @@
   }
 
   void test_lookupMember_method() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElement methodM = ElementFactory.methodElement(methodName, _typeProvider.intType, []);
+    MethodElement methodM = ElementFactory.methodElement(methodName, _typeProvider.intType);
     classA.methods = <MethodElement> [methodM];
     expect(_inheritanceManager.lookupMember(classA, methodName), same(methodM));
     _assertNoErrors(classA);
   }
 
   void test_lookupMember_method_static() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElement methodM = ElementFactory.methodElement(methodName, _typeProvider.intType, []);
+    MethodElement methodM = ElementFactory.methodElement(methodName, _typeProvider.intType);
     (methodM as MethodElementImpl).static = true;
     classA.methods = <MethodElement> [methodM];
     expect(_inheritanceManager.lookupMember(classA, methodName), isNull);
@@ -4218,13 +4483,13 @@
   }
 
   void test_lookupMember_noMember() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     expect(_inheritanceManager.lookupMember(classA, "a"), isNull);
     _assertNoErrors(classA);
   }
 
   void test_lookupMember_setter() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String setterName = "s";
     PropertyAccessorElement setterS = ElementFactory.setterElement(setterName, false, _typeProvider.intType);
     classA.accessors = <PropertyAccessorElement> [setterS];
@@ -4233,7 +4498,7 @@
   }
 
   void test_lookupMember_setter_static() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String setterName = "s";
     PropertyAccessorElement setterS = ElementFactory.setterElement(setterName, true, _typeProvider.intType);
     classA.accessors = <PropertyAccessorElement> [setterS];
@@ -4242,21 +4507,21 @@
   }
 
   void test_lookupOverrides_noParentClasses() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElementImpl methodM = ElementFactory.methodElement(methodName, _typeProvider.intType, []);
+    MethodElementImpl methodM = ElementFactory.methodElement(methodName, _typeProvider.intType);
     classA.methods = <MethodElement> [methodM];
     expect(_inheritanceManager.lookupOverrides(classA, methodName), hasLength(0));
     _assertNoErrors(classA);
   }
 
   void test_lookupOverrides_overrideBaseClass() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElementImpl methodMinA = ElementFactory.methodElement(methodName, _typeProvider.intType, []);
+    MethodElementImpl methodMinA = ElementFactory.methodElement(methodName, _typeProvider.intType);
     classA.methods = <MethodElement> [methodMinA];
-    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
-    MethodElementImpl methodMinB = ElementFactory.methodElement(methodName, _typeProvider.intType, []);
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
+    MethodElementImpl methodMinB = ElementFactory.methodElement(methodName, _typeProvider.intType);
     classB.methods = <MethodElement> [methodMinB];
     List<ExecutableElement> overrides = _inheritanceManager.lookupOverrides(classB, methodName);
     expect(overrides, unorderedEquals([methodMinA]));
@@ -4265,13 +4530,13 @@
   }
 
   void test_lookupOverrides_overrideInterface() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElementImpl methodMinA = ElementFactory.methodElement(methodName, _typeProvider.intType, []);
+    MethodElementImpl methodMinA = ElementFactory.methodElement(methodName, _typeProvider.intType);
     classA.methods = <MethodElement> [methodMinA];
-    ClassElementImpl classB = ElementFactory.classElement2("B", []);
+    ClassElementImpl classB = ElementFactory.classElement2("B");
     classB.interfaces = <InterfaceType> [classA.type];
-    MethodElementImpl methodMinB = ElementFactory.methodElement(methodName, _typeProvider.intType, []);
+    MethodElementImpl methodMinB = ElementFactory.methodElement(methodName, _typeProvider.intType);
     classB.methods = <MethodElement> [methodMinB];
     List<ExecutableElement> overrides = _inheritanceManager.lookupOverrides(classB, methodName);
     expect(overrides, unorderedEquals([methodMinA]));
@@ -4280,16 +4545,16 @@
   }
 
   void test_lookupOverrides_overrideTwoInterfaces() {
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     String methodName = "m";
-    MethodElementImpl methodMinA = ElementFactory.methodElement(methodName, _typeProvider.intType, []);
+    MethodElementImpl methodMinA = ElementFactory.methodElement(methodName, _typeProvider.intType);
     classA.methods = <MethodElement> [methodMinA];
-    ClassElementImpl classB = ElementFactory.classElement2("B", []);
-    MethodElementImpl methodMinB = ElementFactory.methodElement(methodName, _typeProvider.doubleType, []);
+    ClassElementImpl classB = ElementFactory.classElement2("B");
+    MethodElementImpl methodMinB = ElementFactory.methodElement(methodName, _typeProvider.doubleType);
     classB.methods = <MethodElement> [methodMinB];
-    ClassElementImpl classC = ElementFactory.classElement2("C", []);
+    ClassElementImpl classC = ElementFactory.classElement2("C");
     classC.interfaces = <InterfaceType> [classA.type, classB.type];
-    MethodElementImpl methodMinC = ElementFactory.methodElement(methodName, _typeProvider.numType, []);
+    MethodElementImpl methodMinC = ElementFactory.methodElement(methodName, _typeProvider.numType);
     classC.methods = <MethodElement> [methodMinC];
     List<ExecutableElement> overrides = _inheritanceManager.lookupOverrides(classC, methodName);
     expect(overrides, unorderedEquals([methodMinA, methodMinB]));
@@ -4298,7 +4563,7 @@
     _assertNoErrors(classC);
   }
 
-  void _assertErrors(ClassElement classElt, List<ErrorCode> expectedErrorCodes) {
+  void _assertErrors(ClassElement classElt, [List<ErrorCode> expectedErrorCodes = ErrorCode.EMPTY_LIST]) {
     GatheringErrorListener errorListener = new GatheringErrorListener();
     HashSet<AnalysisError> actualErrors = _inheritanceManager.getErrors(classElt);
     if (actualErrors != null) {
@@ -4310,7 +4575,7 @@
   }
 
   void _assertNoErrors(ClassElement classElt) {
-    _assertErrors(classElt, []);
+    _assertErrors(classElt);
   }
 
   /**
@@ -4355,7 +4620,7 @@
     addSource("/second.dart", r'''
 part of lib;
 void set V(int v) {}''');
-    LibraryElement element = _buildLibrary(librarySource, []);
+    LibraryElement element = _buildLibrary(librarySource);
     expect(element, isNotNull);
     List<CompilationUnitElement> sourcedUnits = element.parts;
     expect(sourcedUnits, hasLength(2));
@@ -4368,7 +4633,7 @@
 
   void test_empty() {
     Source librarySource = addSource("/lib.dart", "library lib;");
-    LibraryElement element = _buildLibrary(librarySource, []);
+    LibraryElement element = _buildLibrary(librarySource);
     expect(element, isNotNull);
     expect(element.name, "lib");
     expect(element.entryPoint, isNull);
@@ -4418,7 +4683,7 @@
     addSource("/second.dart", r'''
 part of lib;
 class C {}''');
-    LibraryElement element = _buildLibrary(librarySource, []);
+    LibraryElement element = _buildLibrary(librarySource);
     expect(element, isNotNull);
     List<CompilationUnitElement> sourcedUnits = element.parts;
     expect(sourcedUnits, hasLength(2));
@@ -4437,7 +4702,7 @@
 library lib;
 
 class A {}''');
-    LibraryElement element = _buildLibrary(librarySource, []);
+    LibraryElement element = _buildLibrary(librarySource);
     expect(element, isNotNull);
     _assertTypes(element.definingCompilationUnit, ["A"]);
   }
@@ -4495,7 +4760,7 @@
    * @return the element model that was built for the library
    * @throws Exception if the element model could not be built
    */
-  LibraryElement _buildLibrary(Source librarySource, List<ErrorCode> expectedErrorCodes) {
+  LibraryElement _buildLibrary(Source librarySource, [List<ErrorCode> expectedErrorCodes = ErrorCode.EMPTY_LIST]) {
     LibraryResolver resolver = new LibraryResolver(_context);
     LibraryElementBuilder builder = new LibraryElementBuilder(resolver.analysisContext, resolver.errorListener);
     Library library = resolver.createLibrary(librarySource);
@@ -4514,17 +4779,17 @@
     String typeNameA = "A";
     String typeNameB = "B";
     String typeNameC = "C";
-    ClassElement typeA = ElementFactory.classElement2(typeNameA, []);
-    ClassElement typeB1 = ElementFactory.classElement2(typeNameB, []);
-    ClassElement typeB2 = ElementFactory.classElement2(typeNameB, []);
-    ClassElement typeC = ElementFactory.classElement2(typeNameC, []);
-    LibraryElement importedLibrary1 = createTestLibrary(context, "imported1", []);
+    ClassElement typeA = ElementFactory.classElement2(typeNameA);
+    ClassElement typeB1 = ElementFactory.classElement2(typeNameB);
+    ClassElement typeB2 = ElementFactory.classElement2(typeNameB);
+    ClassElement typeC = ElementFactory.classElement2(typeNameC);
+    LibraryElement importedLibrary1 = createTestLibrary(context, "imported1");
     (importedLibrary1.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [typeA, typeB1];
-    ImportElementImpl import1 = ElementFactory.importFor(importedLibrary1, null, []);
-    LibraryElement importedLibrary2 = createTestLibrary(context, "imported2", []);
+    ImportElementImpl import1 = ElementFactory.importFor(importedLibrary1, null);
+    LibraryElement importedLibrary2 = createTestLibrary(context, "imported2");
     (importedLibrary2.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [typeB2, typeC];
-    ImportElementImpl import2 = ElementFactory.importFor(importedLibrary2, null, []);
-    LibraryElementImpl importingLibrary = createTestLibrary(context, "importing", []);
+    ImportElementImpl import2 = ElementFactory.importFor(importedLibrary2, null);
+    LibraryElementImpl importingLibrary = createTestLibrary(context, "importing");
     importingLibrary.imports = <ImportElement> [import1, import2];
     {
       GatheringErrorListener errorListener = new GatheringErrorListener();
@@ -4550,7 +4815,7 @@
       GatheringErrorListener errorListener = new GatheringErrorListener();
       Scope scope = new LibraryImportScope(importingLibrary, errorListener);
       Identifier identifier = AstFactory.identifier3(typeNameB);
-      AstFactory.methodDeclaration(null, AstFactory.typeName3(identifier, []), null, null, AstFactory.identifier3("foo"), null);
+      AstFactory.methodDeclaration(null, AstFactory.typeName3(identifier), null, null, AstFactory.identifier3("foo"), null);
       Element element = scope.lookup(identifier, importingLibrary);
       errorListener.assertErrorsWithCodes([StaticWarningCode.AMBIGUOUS_IMPORT]);
       EngineTestCase.assertInstanceOf((obj) => obj is MultiplyDefinedElement, MultiplyDefinedElement, element);
@@ -4568,9 +4833,9 @@
     context.sourceFactory = new SourceFactory([]);
     String importedTypeName = "A";
     ClassElement importedType = new ClassElementImpl.forNode(AstFactory.identifier3(importedTypeName));
-    LibraryElement importedLibrary = createTestLibrary(context, "imported", []);
+    LibraryElement importedLibrary = createTestLibrary(context, "imported");
     (importedLibrary.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [importedType];
-    LibraryElementImpl definingLibrary = createTestLibrary(context, "importing", []);
+    LibraryElementImpl definingLibrary = createTestLibrary(context, "importing");
     ImportElementImpl importElement = new ImportElementImpl(0);
     importElement.importedLibrary = importedLibrary;
     definingLibrary.imports = <ImportElement> [importElement];
@@ -4589,12 +4854,12 @@
   void test_nonConflictingImports_fromSdk() {
     AnalysisContext context = AnalysisContextFactory.contextWithCore();
     String typeName = "List";
-    ClassElement type = ElementFactory.classElement2(typeName, []);
-    LibraryElement importedLibrary = createTestLibrary(context, "lib", []);
+    ClassElement type = ElementFactory.classElement2(typeName);
+    LibraryElement importedLibrary = createTestLibrary(context, "lib");
     (importedLibrary.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [type];
-    ImportElementImpl importCore = ElementFactory.importFor(context.getLibraryElement(context.sourceFactory.forUri("dart:core")), null, []);
-    ImportElementImpl importLib = ElementFactory.importFor(importedLibrary, null, []);
-    LibraryElementImpl importingLibrary = createTestLibrary(context, "importing", []);
+    ImportElementImpl importCore = ElementFactory.importFor(context.getLibraryElement(context.sourceFactory.forUri("dart:core")), null);
+    ImportElementImpl importLib = ElementFactory.importFor(importedLibrary, null);
+    LibraryElementImpl importingLibrary = createTestLibrary(context, "importing");
     importingLibrary.imports = <ImportElement> [importCore, importLib];
     GatheringErrorListener errorListener = new GatheringErrorListener();
     Scope scope = new LibraryImportScope(importingLibrary, errorListener);
@@ -4607,13 +4872,13 @@
     context.sourceFactory = new SourceFactory([]);
     String typeNameA = "A";
     String typeNameB = "B";
-    ClassElement typeA = ElementFactory.classElement2(typeNameA, []);
-    ClassElement typeB = ElementFactory.classElement2(typeNameB, []);
-    LibraryElement importedLibrary = createTestLibrary(context, "imported", []);
+    ClassElement typeA = ElementFactory.classElement2(typeNameA);
+    ClassElement typeB = ElementFactory.classElement2(typeNameB);
+    LibraryElement importedLibrary = createTestLibrary(context, "imported");
     (importedLibrary.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [typeA, typeB];
-    ImportElementImpl import1 = ElementFactory.importFor(importedLibrary, null, []);
-    ImportElementImpl import2 = ElementFactory.importFor(importedLibrary, null, []);
-    LibraryElementImpl importingLibrary = createTestLibrary(context, "importing", []);
+    ImportElementImpl import1 = ElementFactory.importFor(importedLibrary, null);
+    ImportElementImpl import2 = ElementFactory.importFor(importedLibrary, null);
+    LibraryElementImpl importingLibrary = createTestLibrary(context, "importing");
     importingLibrary.imports = <ImportElement> [import1, import2];
     GatheringErrorListener errorListener = new GatheringErrorListener();
     Scope scope = new LibraryImportScope(importingLibrary, errorListener);
@@ -4628,15 +4893,15 @@
     context.sourceFactory = new SourceFactory([]);
     String typeName = "C";
     String prefixName = "p";
-    ClassElement prefixedType = ElementFactory.classElement2(typeName, []);
-    ClassElement nonPrefixedType = ElementFactory.classElement2(typeName, []);
-    LibraryElement prefixedLibrary = createTestLibrary(context, "import.prefixed", []);
+    ClassElement prefixedType = ElementFactory.classElement2(typeName);
+    ClassElement nonPrefixedType = ElementFactory.classElement2(typeName);
+    LibraryElement prefixedLibrary = createTestLibrary(context, "import.prefixed");
     (prefixedLibrary.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [prefixedType];
-    ImportElementImpl prefixedImport = ElementFactory.importFor(prefixedLibrary, ElementFactory.prefix(prefixName), []);
-    LibraryElement nonPrefixedLibrary = createTestLibrary(context, "import.nonPrefixed", []);
+    ImportElementImpl prefixedImport = ElementFactory.importFor(prefixedLibrary, ElementFactory.prefix(prefixName));
+    LibraryElement nonPrefixedLibrary = createTestLibrary(context, "import.nonPrefixed");
     (nonPrefixedLibrary.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [nonPrefixedType];
-    ImportElementImpl nonPrefixedImport = ElementFactory.importFor(nonPrefixedLibrary, null, []);
-    LibraryElementImpl importingLibrary = createTestLibrary(context, "importing", []);
+    ImportElementImpl nonPrefixedImport = ElementFactory.importFor(nonPrefixedLibrary, null);
+    LibraryElementImpl importingLibrary = createTestLibrary(context, "importing");
     importingLibrary.imports = <ImportElement> [prefixedImport, nonPrefixedImport];
     GatheringErrorListener errorListener = new GatheringErrorListener();
     Scope scope = new LibraryImportScope(importingLibrary, errorListener);
@@ -4746,9 +5011,9 @@
     context.sourceFactory = new SourceFactory([]);
     String importedTypeName = "A";
     ClassElement importedType = new ClassElementImpl.forNode(AstFactory.identifier3(importedTypeName));
-    LibraryElement importedLibrary = createTestLibrary(context, "imported", []);
+    LibraryElement importedLibrary = createTestLibrary(context, "imported");
     (importedLibrary.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [importedType];
-    LibraryElementImpl definingLibrary = createTestLibrary(context, "importing", []);
+    LibraryElementImpl definingLibrary = createTestLibrary(context, "importing");
     ImportElementImpl importElement = new ImportElementImpl(0);
     importElement.importedLibrary = importedLibrary;
     definingLibrary.imports = <ImportElement> [importElement];
@@ -4882,9 +5147,9 @@
   }
 
   void test_MemberMap_copyConstructor() {
-    MethodElement m1 = ElementFactory.methodElement("m1", _nullType, []);
-    MethodElement m2 = ElementFactory.methodElement("m2", _nullType, []);
-    MethodElement m3 = ElementFactory.methodElement("m3", _nullType, []);
+    MethodElement m1 = ElementFactory.methodElement("m1", _nullType);
+    MethodElement m2 = ElementFactory.methodElement("m2", _nullType);
+    MethodElement m3 = ElementFactory.methodElement("m3", _nullType);
     MemberMap map = new MemberMap();
     map.put(m1.name, m1);
     map.put(m2.name, m2);
@@ -4897,8 +5162,8 @@
   }
 
   void test_MemberMap_override() {
-    MethodElement m1 = ElementFactory.methodElement("m", _nullType, []);
-    MethodElement m2 = ElementFactory.methodElement("m", _nullType, []);
+    MethodElement m1 = ElementFactory.methodElement("m", _nullType);
+    MethodElement m2 = ElementFactory.methodElement("m", _nullType);
     MemberMap map = new MemberMap();
     map.put(m1.name, m1);
     map.put(m2.name, m2);
@@ -4907,7 +5172,7 @@
   }
 
   void test_MemberMap_put() {
-    MethodElement m1 = ElementFactory.methodElement("m1", _nullType, []);
+    MethodElement m1 = ElementFactory.methodElement("m1", _nullType);
     MemberMap map = new MemberMap();
     expect(map.size, 0);
     map.put(m1.name, m1);
@@ -5141,7 +5406,7 @@
         r'''
 library root;
 import 'lib1.dart' deferred as lib1;
-main() { lib1.f(); }'''], <ErrorCode> [ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED], <ErrorCode> []);
+main() { lib1.f(); }'''], <ErrorCode>[ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED], ErrorCode.EMPTY_LIST);
   }
 
   void test_issue20904BuggyTypePromotionAtIfJoin_1() {
@@ -5670,7 +5935,7 @@
   const A() {}
 }''');
     resolve(source);
-    assertErrors(source, []);
+    assertErrors(source);
     verify([source, source2]);
   }
 
@@ -5689,7 +5954,7 @@
 library lib2;
 class B {}''');
     resolve(source);
-    assertErrors(source, []);
+    assertErrors(source);
     assertNoErrors(source2);
     assertNoErrors(source3);
     verify([source, source2, source3]);
@@ -6200,6 +6465,16 @@
    */
   AnalysisContextImpl analysisContext2;
 
+  /**
+   * Specifies if [assertErrors] should check for [HintCode.UNUSED_ELEMENT].
+   */
+  bool enableUnusedElement = false;
+
+  /**
+   * Specifies if [assertErrors] should check for [HintCode.UNUSED_LOCAL_VARIABLE].
+   */
+  bool enableUnusedLocalVariable = false;
+
   @override
   void setUp() {
     reset();
@@ -6239,9 +6514,17 @@
    * @throws AssertionFailedError if a different number of errors have been reported than were
    *           expected
    */
-  void assertErrors(Source source, List<ErrorCode> expectedErrorCodes) {
+  void assertErrors(Source source, [List<ErrorCode> expectedErrorCodes = ErrorCode.EMPTY_LIST]) {
     GatheringErrorListener errorListener = new GatheringErrorListener();
     for (AnalysisError error in analysisContext2.computeErrors(source)) {
+      if (error.errorCode == HintCode.UNUSED_ELEMENT &&
+          !enableUnusedElement) {
+        continue;
+      }
+      if (error.errorCode == HintCode.UNUSED_LOCAL_VARIABLE &&
+          !enableUnusedLocalVariable) {
+        continue;
+      }
       errorListener.onError(error);
     }
     errorListener.assertErrorsWithCodes(expectedErrorCodes);
@@ -6255,7 +6538,7 @@
    * @throws AssertionFailedError if any errors have been reported
    */
   void assertNoErrors(Source source) {
-    assertErrors(source, []);
+    assertErrors(source);
   }
 
   /**
@@ -6278,7 +6561,7 @@
    *
    * @return the library element that was created
    */
-  LibraryElementImpl createDefaultTestLibrary() => createTestLibrary(new AnalysisContextImpl(), "test", []);
+  LibraryElementImpl createDefaultTestLibrary() => createTestLibrary(new AnalysisContextImpl(), "test");
 
   /**
    * Create a library element that represents a library with the given name containing a single
@@ -6287,17 +6570,22 @@
    * @param libraryName the name of the library to be created
    * @return the library element that was created
    */
-  LibraryElementImpl createTestLibrary(AnalysisContext context, String libraryName, List<String> typeNames) {
-    int count = typeNames.length;
-    List<CompilationUnitElementImpl> sourcedCompilationUnits = new List<CompilationUnitElementImpl>(count);
-    for (int i = 0; i < count; i++) {
-      String typeName = typeNames[i];
-      ClassElementImpl type = new ClassElementImpl.forNode(AstFactory.identifier3(typeName));
-      String fileName = "$typeName.dart";
-      CompilationUnitElementImpl compilationUnit = new CompilationUnitElementImpl(fileName);
-      compilationUnit.source = _createNamedSource(fileName);
-      compilationUnit.types = <ClassElement> [type];
-      sourcedCompilationUnits[i] = compilationUnit;
+  LibraryElementImpl createTestLibrary(AnalysisContext context, String libraryName, [List<String> typeNames]) {
+    List<CompilationUnitElement> sourcedCompilationUnits;
+    if (typeNames == null) {
+      sourcedCompilationUnits = CompilationUnitElementImpl.EMPTY_ARRAY;
+    } else {
+      int count = typeNames.length;
+      sourcedCompilationUnits = new List<CompilationUnitElement>(count);
+      for (int i = 0; i < count; i++) {
+        String typeName = typeNames[i];
+        ClassElementImpl type = new ClassElementImpl.forNode(AstFactory.identifier3(typeName));
+        String fileName = "$typeName.dart";
+        CompilationUnitElementImpl compilationUnit = new CompilationUnitElementImpl(fileName);
+        compilationUnit.source = _createNamedSource(fileName);
+        compilationUnit.types = <ClassElement> [type];
+        sourcedCompilationUnits[i] = compilationUnit;
+      }
     }
     String fileName = "$libraryName.dart";
     CompilationUnitElementImpl compilationUnit = new CompilationUnitElementImpl(fileName);
@@ -6567,9 +6855,9 @@
   ClassDeclaration _createResolvedClassDeclaration() {
     CompilationUnit unit = _createResolvedCompilationUnit();
     String className = "C";
-    ClassDeclaration classNode = AstFactory.classDeclaration(null, className, AstFactory.typeParameterList([]), null, null, null, []);
+    ClassDeclaration classNode = AstFactory.classDeclaration(null, className, AstFactory.typeParameterList(), null, null, null);
     unit.declarations.add(classNode);
-    ClassElement classElement = ElementFactory.classElement2(className, []);
+    ClassElement classElement = ElementFactory.classElement2(className);
     classNode.name.staticElement = classElement;
     (unit.element as CompilationUnitElementImpl).types = <ClassElement> [classElement];
     return classNode;
@@ -6578,9 +6866,9 @@
   ClassTypeAlias _createResolvedClassTypeAlias() {
     CompilationUnit unit = _createResolvedCompilationUnit();
     String className = "C";
-    ClassTypeAlias classNode = AstFactory.classTypeAlias(className, AstFactory.typeParameterList([]), null, null, null, null);
+    ClassTypeAlias classNode = AstFactory.classTypeAlias(className, AstFactory.typeParameterList(), null, null, null, null);
     unit.declarations.add(classNode);
-    ClassElement classElement = ElementFactory.classElement2(className, []);
+    ClassElement classElement = ElementFactory.classElement2(className);
     classNode.name.staticElement = classElement;
     (unit.element as CompilationUnitElementImpl).types = <ClassElement> [classElement];
     return classNode;
@@ -6596,9 +6884,9 @@
   ConstructorDeclaration _createResolvedConstructorDeclaration() {
     ClassDeclaration classNode = _createResolvedClassDeclaration();
     String constructorName = "f";
-    ConstructorDeclaration constructorNode = AstFactory.constructorDeclaration(AstFactory.identifier3(constructorName), null, AstFactory.formalParameterList([]), null);
+    ConstructorDeclaration constructorNode = AstFactory.constructorDeclaration(AstFactory.identifier3(constructorName), null, AstFactory.formalParameterList(), null);
     classNode.members.add(constructorNode);
-    ConstructorElement constructorElement = ElementFactory.constructorElement2(classNode.element, null, []);
+    ConstructorElement constructorElement = ElementFactory.constructorElement2(classNode.element, null);
     constructorNode.element = constructorElement;
     (classNode.element as ClassElementImpl).constructors = <ConstructorElement> [constructorElement];
     return constructorNode;
@@ -6617,7 +6905,7 @@
 
   FunctionTypeAlias _createResolvedFunctionTypeAlias() {
     CompilationUnit unit = _createResolvedCompilationUnit();
-    FunctionTypeAlias aliasNode = AstFactory.typeAlias(AstFactory.typeName4("A", []), "F", AstFactory.typeParameterList([]), AstFactory.formalParameterList([]));
+    FunctionTypeAlias aliasNode = AstFactory.typeAlias(AstFactory.typeName4("A"), "F", AstFactory.typeParameterList(), AstFactory.formalParameterList());
     unit.declarations.add(aliasNode);
     SimpleIdentifier aliasName = aliasNode.name;
     FunctionTypeAliasElement aliasElement = new FunctionTypeAliasElementImpl.forNode(aliasName);
@@ -6629,9 +6917,9 @@
   MethodDeclaration _createResolvedMethodDeclaration() {
     ClassDeclaration classNode = _createResolvedClassDeclaration();
     String methodName = "f";
-    MethodDeclaration methodNode = AstFactory.methodDeclaration(null, null, null, null, AstFactory.identifier3(methodName), AstFactory.formalParameterList([]));
+    MethodDeclaration methodNode = AstFactory.methodDeclaration(null, null, null, null, AstFactory.identifier3(methodName), AstFactory.formalParameterList());
     classNode.members.add(methodNode);
-    MethodElement methodElement = ElementFactory.methodElement(methodName, null, []);
+    MethodElement methodElement = ElementFactory.methodElement(methodName, null);
     methodNode.name.staticElement = methodElement;
     (classNode.element as ClassElementImpl).methods = <MethodElement> [methodElement];
     return methodNode;
@@ -7797,10 +8085,10 @@
   void test_visitAsExpression() {
     // class A { ... this as B ... }
     // class B extends A {}
-    ClassElement superclass = ElementFactory.classElement2("A", []);
+    ClassElement superclass = ElementFactory.classElement2("A");
     InterfaceType superclassType = superclass.type;
-    ClassElement subclass = ElementFactory.classElement("B", superclassType, []);
-    Expression node = AstFactory.asExpression(AstFactory.thisExpression(), AstFactory.typeName(subclass, []));
+    ClassElement subclass = ElementFactory.classElement("B", superclassType);
+    Expression node = AstFactory.asExpression(AstFactory.thisExpression(), AstFactory.typeName(subclass));
     expect(_analyze3(node, superclassType), same(subclass.type));
     _listener.assertNoErrors();
   }
@@ -7881,11 +8169,11 @@
     //   A operator *(double value);
     // }
     // (a as A) * 2.0
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     InterfaceType typeA = classA.type;
     MethodElement operator = ElementFactory.methodElement("*", typeA, [_typeProvider.doubleType]);
     classA.methods = <MethodElement> [operator];
-    BinaryExpression node = AstFactory.binaryExpression(AstFactory.asExpression(AstFactory.identifier3("a"), AstFactory.typeName(classA, [])), TokenType.PLUS, _resolvedDouble(2.0));
+    BinaryExpression node = AstFactory.binaryExpression(AstFactory.asExpression(AstFactory.identifier3("a"), AstFactory.typeName(classA)), TokenType.PLUS, _resolvedDouble(2.0));
     node.staticElement = operator;
     expect(_analyze(node), same(typeA));
     _listener.assertNoErrors();
@@ -7948,7 +8236,7 @@
     _setType(p1, dynamicType);
     FormalParameter p2 = AstFactory.namedFormalParameter(AstFactory.simpleFormalParameter3("p2"), _resolvedInteger(0));
     _setType(p2, dynamicType);
-    FunctionExpression node = _resolvedFunctionExpression(AstFactory.formalParameterList([p1, p2]), AstFactory.blockFunctionBody2([]));
+    FunctionExpression node = _resolvedFunctionExpression(AstFactory.formalParameterList([p1, p2]), AstFactory.blockFunctionBody2());
     _analyze5(p1);
     _analyze5(p2);
     DartType resultType = _analyze(node);
@@ -7980,7 +8268,7 @@
     _setType(p1, dynamicType);
     FormalParameter p2 = AstFactory.simpleFormalParameter3("p2");
     _setType(p2, dynamicType);
-    FunctionExpression node = _resolvedFunctionExpression(AstFactory.formalParameterList([p1, p2]), AstFactory.blockFunctionBody2([]));
+    FunctionExpression node = _resolvedFunctionExpression(AstFactory.formalParameterList([p1, p2]), AstFactory.blockFunctionBody2());
     _analyze5(p1);
     _analyze5(p2);
     DartType resultType = _analyze(node);
@@ -8007,7 +8295,7 @@
     _setType(p1, dynamicType);
     FormalParameter p2 = AstFactory.namedFormalParameter(AstFactory.simpleFormalParameter3("p2"), _resolvedInteger(0));
     _setType(p2, dynamicType);
-    FunctionExpression node = _resolvedFunctionExpression(AstFactory.formalParameterList([p1, p2]), AstFactory.blockFunctionBody2([]));
+    FunctionExpression node = _resolvedFunctionExpression(AstFactory.formalParameterList([p1, p2]), AstFactory.blockFunctionBody2());
     _analyze5(p2);
     DartType resultType = _analyze(node);
     Map<String, DartType> expectedNamedTypes = new HashMap<String, DartType>();
@@ -8039,7 +8327,7 @@
     _setType(p1, dynamicType);
     FormalParameter p2 = AstFactory.positionalFormalParameter(AstFactory.simpleFormalParameter3("p2"), _resolvedInteger(0));
     _setType(p2, dynamicType);
-    FunctionExpression node = _resolvedFunctionExpression(AstFactory.formalParameterList([p1, p2]), AstFactory.blockFunctionBody2([]));
+    FunctionExpression node = _resolvedFunctionExpression(AstFactory.formalParameterList([p1, p2]), AstFactory.blockFunctionBody2());
     _analyze5(p1);
     _analyze5(p2);
     DartType resultType = _analyze(node);
@@ -8069,7 +8357,7 @@
     _setType(p1, dynamicType);
     FormalParameter p2 = AstFactory.positionalFormalParameter(AstFactory.simpleFormalParameter3("p2"), _resolvedInteger(0));
     _setType(p2, dynamicType);
-    FunctionExpression node = _resolvedFunctionExpression(AstFactory.formalParameterList([p1, p2]), AstFactory.blockFunctionBody2([]));
+    FunctionExpression node = _resolvedFunctionExpression(AstFactory.formalParameterList([p1, p2]), AstFactory.blockFunctionBody2());
     _analyze5(p1);
     _analyze5(p2);
     DartType resultType = _analyze(node);
@@ -8158,14 +8446,14 @@
 
   void test_visitInstanceCreationExpression_named() {
     // new C.m()
-    ClassElementImpl classElement = ElementFactory.classElement2("C", []);
+    ClassElementImpl classElement = ElementFactory.classElement2("C");
     String constructorName = "m";
-    ConstructorElementImpl constructor = ElementFactory.constructorElement2(classElement, constructorName, []);
+    ConstructorElementImpl constructor = ElementFactory.constructorElement2(classElement, constructorName);
     constructor.returnType = classElement.type;
     FunctionTypeImpl constructorType = new FunctionTypeImpl.con1(constructor);
     constructor.type = constructorType;
     classElement.constructors = <ConstructorElement> [constructor];
-    InstanceCreationExpression node = AstFactory.instanceCreationExpression2(null, AstFactory.typeName(classElement, []), [AstFactory.identifier3(constructorName)]);
+    InstanceCreationExpression node = AstFactory.instanceCreationExpression2(null, AstFactory.typeName(classElement), [AstFactory.identifier3(constructorName)]);
     node.staticElement = constructor;
     expect(_analyze(node), same(classElement.type));
     _listener.assertNoErrors();
@@ -8174,15 +8462,15 @@
   void test_visitInstanceCreationExpression_typeParameters() {
     // new C<I>()
     ClassElementImpl elementC = ElementFactory.classElement2("C", ["E"]);
-    ClassElementImpl elementI = ElementFactory.classElement2("I", []);
-    ConstructorElementImpl constructor = ElementFactory.constructorElement2(elementC, null, []);
+    ClassElementImpl elementI = ElementFactory.classElement2("I");
+    ConstructorElementImpl constructor = ElementFactory.constructorElement2(elementC, null);
     elementC.constructors = <ConstructorElement> [constructor];
     constructor.returnType = elementC.type;
     FunctionTypeImpl constructorType = new FunctionTypeImpl.con1(constructor);
     constructor.type = constructorType;
-    TypeName typeName = AstFactory.typeName(elementC, [AstFactory.typeName(elementI, [])]);
+    TypeName typeName = AstFactory.typeName(elementC, [AstFactory.typeName(elementI)]);
     typeName.type = elementC.type.substitute4(<DartType> [elementI.type]);
-    InstanceCreationExpression node = AstFactory.instanceCreationExpression2(null, typeName, []);
+    InstanceCreationExpression node = AstFactory.instanceCreationExpression2(null, typeName);
     node.staticElement = constructor;
     InterfaceType interfaceType = _analyze(node) as InterfaceType;
     List<DartType> typeArgs = interfaceType.typeArguments;
@@ -8193,13 +8481,13 @@
 
   void test_visitInstanceCreationExpression_unnamed() {
     // new C()
-    ClassElementImpl classElement = ElementFactory.classElement2("C", []);
-    ConstructorElementImpl constructor = ElementFactory.constructorElement2(classElement, null, []);
+    ClassElementImpl classElement = ElementFactory.classElement2("C");
+    ConstructorElementImpl constructor = ElementFactory.constructorElement2(classElement, null);
     constructor.returnType = classElement.type;
     FunctionTypeImpl constructorType = new FunctionTypeImpl.con1(constructor);
     constructor.type = constructorType;
     classElement.constructors = <ConstructorElement> [constructor];
-    InstanceCreationExpression node = AstFactory.instanceCreationExpression2(null, AstFactory.typeName(classElement, []), []);
+    InstanceCreationExpression node = AstFactory.instanceCreationExpression2(null, AstFactory.typeName(classElement));
     node.staticElement = constructor;
     expect(_analyze(node), same(classElement.type));
     _listener.assertNoErrors();
@@ -8214,21 +8502,21 @@
 
   void test_visitIsExpression_negated() {
     // a is! String
-    Expression node = AstFactory.isExpression(_resolvedString("a"), true, AstFactory.typeName4("String", []));
+    Expression node = AstFactory.isExpression(_resolvedString("a"), true, AstFactory.typeName4("String"));
     expect(_analyze(node), same(_typeProvider.boolType));
     _listener.assertNoErrors();
   }
 
   void test_visitIsExpression_notNegated() {
     // a is String
-    Expression node = AstFactory.isExpression(_resolvedString("a"), false, AstFactory.typeName4("String", []));
+    Expression node = AstFactory.isExpression(_resolvedString("a"), false, AstFactory.typeName4("String"));
     expect(_analyze(node), same(_typeProvider.boolType));
     _listener.assertNoErrors();
   }
 
   void test_visitListLiteral_empty() {
     // []
-    Expression node = AstFactory.listLiteral([]);
+    Expression node = AstFactory.listLiteral();
     DartType resultType = _analyze(node);
     _assertType2(_typeProvider.listType.substitute4(<DartType> [_typeProvider.dynamicType]), resultType);
     _listener.assertNoErrors();
@@ -8244,7 +8532,7 @@
 
   void test_visitMapLiteral_empty() {
     // {}
-    Expression node = AstFactory.mapLiteral2([]);
+    Expression node = AstFactory.mapLiteral2();
     DartType resultType = _analyze(node);
     _assertType2(_typeProvider.mapType.substitute4(<DartType> [_typeProvider.dynamicType, _typeProvider.dynamicType]), resultType);
     _listener.assertNoErrors();
@@ -8260,7 +8548,7 @@
 
   void test_visitMethodInvocation_then() {
     // then()
-    Expression node = AstFactory.methodInvocation(null, "then", []);
+    Expression node = AstFactory.methodInvocation(null, "then");
     _analyze(node);
     _listener.assertNoErrors();
   }
@@ -8445,8 +8733,8 @@
 
   void test_visitSuperExpression() {
     // super
-    InterfaceType superType = ElementFactory.classElement2("A", []).type;
-    InterfaceType thisType = ElementFactory.classElement("B", superType, []).type;
+    InterfaceType superType = ElementFactory.classElement2("A").type;
+    InterfaceType thisType = ElementFactory.classElement("B", superType).type;
     Expression node = AstFactory.superExpression();
     expect(_analyze3(node, thisType), same(thisType));
     _listener.assertNoErrors();
@@ -8458,7 +8746,7 @@
 
   void test_visitThisExpression() {
     // this
-    InterfaceType thisType = ElementFactory.classElement("B", ElementFactory.classElement2("A", []).type, []).type;
+    InterfaceType thisType = ElementFactory.classElement("B", ElementFactory.classElement2("A").type).type;
     Expression node = AstFactory.thisExpression();
     expect(_analyze3(node, thisType), same(thisType));
     _listener.assertNoErrors();
@@ -8648,7 +8936,7 @@
   /**
    * Create a function expression that has an element associated with it, where the element has an
    * incomplete type associated with it (just like the one
-   * [ElementBuilder#visitFunctionExpression] would have built if we had
+   * [ElementBuilder.visitFunctionExpression] would have built if we had
    * run it).
    *
    * @param parameters the parameters to the function
@@ -9182,8 +9470,8 @@
     // class A extends B
     // class B extends A
     //
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
-    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
     classA.supertype = classB.type;
     _definingCompilationUnit.types = <ClassElement> [classA, classB];
     HashSet<ClassElement> subtypesOfA = _subtypeManager.computeAllSubtypes(classA);
@@ -9200,11 +9488,11 @@
     // class D extends B
     // class E extends B
     //
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
-    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
-    ClassElementImpl classC = ElementFactory.classElement("C", classB.type, []);
-    ClassElementImpl classD = ElementFactory.classElement("D", classB.type, []);
-    ClassElementImpl classE = ElementFactory.classElement("E", classB.type, []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
+    ClassElementImpl classC = ElementFactory.classElement("C", classB.type);
+    ClassElementImpl classD = ElementFactory.classElement("D", classB.type);
+    ClassElementImpl classE = ElementFactory.classElement("E", classB.type);
     _definingCompilationUnit.types = <ClassElement> [classA, classB, classC, classD, classE];
     HashSet<ClassElement> subtypesOfA = _subtypeManager.computeAllSubtypes(classA);
     List<ClassElement> arraySubtypesOfA = new List.from(subtypesOfA);
@@ -9220,7 +9508,7 @@
     //
     // class A
     //
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
     _definingCompilationUnit.types = <ClassElement> [classA];
     HashSet<ClassElement> subtypesOfA = _subtypeManager.computeAllSubtypes(classA);
     expect(subtypesOfA, hasLength(0));
@@ -9231,8 +9519,8 @@
     // class A
     // class B extends A
     //
-    ClassElementImpl classA = ElementFactory.classElement2("A", []);
-    ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
+    ClassElementImpl classA = ElementFactory.classElement2("A");
+    ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
     _definingCompilationUnit.types = <ClassElement> [classA, classB];
     HashSet<ClassElement> subtypesOfA = _subtypeManager.computeAllSubtypes(classA);
     List<ClassElement> arraySubtypesOfA = new List.from(subtypesOfA);
@@ -9356,9 +9644,9 @@
   @override
   InterfaceType get boolType {
     if (_boolType == null) {
-      ClassElementImpl boolElement = ElementFactory.classElement2("bool", []);
+      ClassElementImpl boolElement = ElementFactory.classElement2("bool");
       _boolType = boolElement.type;
-      ConstructorElementImpl fromEnvironment = ElementFactory.constructorElement(boolElement, "fromEnvironment", true, []);
+      ConstructorElementImpl fromEnvironment = ElementFactory.constructorElement(boolElement, "fromEnvironment", true);
       fromEnvironment.parameters = <ParameterElement> [
           ElementFactory.requiredParameter2("name", stringType),
           ElementFactory.namedParameter2("defaultValue", _boolType)];
@@ -9379,7 +9667,7 @@
   @override
   InterfaceType get deprecatedType {
     if (_deprecatedType == null) {
-      ClassElementImpl deprecatedElement = ElementFactory.classElement2("Deprecated", []);
+      ClassElementImpl deprecatedElement = ElementFactory.classElement2("Deprecated");
       deprecatedElement.constructors = <ConstructorElement> [ElementFactory.constructorElement(deprecatedElement, null, true, [stringType])];
       _deprecatedType = deprecatedElement.type;
     }
@@ -9405,7 +9693,7 @@
   @override
   InterfaceType get functionType {
     if (_functionType == null) {
-      _functionType = ElementFactory.classElement2("Function", []).type;
+      _functionType = ElementFactory.classElement2("Function").type;
     }
     return _functionType;
   }
@@ -9446,7 +9734,7 @@
   InterfaceType get listType {
     if (_listType == null) {
       ClassElementImpl listElement = ElementFactory.classElement2("List", ["E"]);
-      listElement.constructors = <ConstructorElement> [ElementFactory.constructorElement2(listElement, null, [])];
+      listElement.constructors = <ConstructorElement> [ElementFactory.constructorElement2(listElement, null)];
       _listType = listElement.type;
       DartType eType = listElement.typeParameters[0].type;
       InterfaceType iterableType = this.iterableType.substitute4(<DartType> [eType]);
@@ -9480,7 +9768,7 @@
   @override
   InterfaceType get nullType {
     if (_nullType == null) {
-      _nullType = ElementFactory.classElement2("Null", []).type;
+      _nullType = ElementFactory.classElement2("Null").type;
     }
     return _nullType;
   }
@@ -9498,9 +9786,9 @@
     if (_objectType == null) {
       ClassElementImpl objectElement = ElementFactory.object;
       _objectType = objectElement.type;
-      objectElement.constructors = <ConstructorElement> [ElementFactory.constructorElement2(objectElement, null, [])];
+      objectElement.constructors = <ConstructorElement> [ElementFactory.constructorElement2(objectElement, null)];
       objectElement.methods = <MethodElement> [
-          ElementFactory.methodElement("toString", stringType, []),
+          ElementFactory.methodElement("toString", stringType),
           ElementFactory.methodElement("==", boolType, [_objectType]),
           ElementFactory.methodElement("noSuchMethod", dynamicType, [dynamicType])];
       objectElement.accessors = <PropertyAccessorElement> [
@@ -9513,7 +9801,7 @@
   @override
   InterfaceType get stackTraceType {
     if (_stackTraceType == null) {
-      _stackTraceType = ElementFactory.classElement2("StackTrace", []).type;
+      _stackTraceType = ElementFactory.classElement2("StackTrace").type;
     }
     return _stackTraceType;
   }
@@ -9521,7 +9809,7 @@
   @override
   InterfaceType get stringType {
     if (_stringType == null) {
-      _stringType = ElementFactory.classElement2("String", []).type;
+      _stringType = ElementFactory.classElement2("String").type;
       ClassElementImpl stringElement = _stringType.element as ClassElementImpl;
       stringElement.accessors = <PropertyAccessorElement> [
           ElementFactory.getterElement("isEmpty", false, boolType),
@@ -9529,9 +9817,9 @@
           ElementFactory.getterElement("codeUnits", false, listType.substitute4(<DartType> [intType]))];
       stringElement.methods = <MethodElement> [
           ElementFactory.methodElement("+", _stringType, [_stringType]),
-          ElementFactory.methodElement("toLowerCase", _stringType, []),
-          ElementFactory.methodElement("toUpperCase", _stringType, [])];
-      ConstructorElementImpl fromEnvironment = ElementFactory.constructorElement(stringElement, "fromEnvironment", true, []);
+          ElementFactory.methodElement("toLowerCase", _stringType),
+          ElementFactory.methodElement("toUpperCase", _stringType)];
+      ConstructorElementImpl fromEnvironment = ElementFactory.constructorElement(stringElement, "fromEnvironment", true);
       fromEnvironment.parameters = <ParameterElement> [
           ElementFactory.requiredParameter2("name", stringType),
           ElementFactory.namedParameter2("defaultValue", _stringType)];
@@ -9544,7 +9832,7 @@
   @override
   InterfaceType get symbolType {
     if (_symbolType == null) {
-      ClassElementImpl symbolClass = ElementFactory.classElement2("Symbol", []);
+      ClassElementImpl symbolClass = ElementFactory.classElement2("Symbol");
       ConstructorElementImpl constructor = ElementFactory.constructorElement(symbolClass, null, true, [stringType]);
       constructor.factory = true;
       symbolClass.constructors = <ConstructorElement> [constructor];
@@ -9556,7 +9844,7 @@
   @override
   InterfaceType get typeType {
     if (_typeType == null) {
-      _typeType = ElementFactory.classElement2("Type", []).type;
+      _typeType = ElementFactory.classElement2("Type").type;
     }
     return _typeType;
   }
@@ -9577,11 +9865,11 @@
     //
     // Create the type hierarchy.
     //
-    ClassElementImpl numElement = ElementFactory.classElement2("num", []);
+    ClassElementImpl numElement = ElementFactory.classElement2("num");
     _numType = numElement.type;
-    ClassElementImpl intElement = ElementFactory.classElement("int", _numType, []);
+    ClassElementImpl intElement = ElementFactory.classElement("int", _numType);
     _intType = intElement.type;
-    ClassElementImpl doubleElement = ElementFactory.classElement("double", _numType, []);
+    ClassElementImpl doubleElement = ElementFactory.classElement("double", _numType);
     _doubleType = doubleElement.type;
     //
     // Force the referenced types to be cached.
@@ -9599,23 +9887,23 @@
         ElementFactory.methodElement("%", _numType, [_numType]),
         ElementFactory.methodElement("/", _doubleType, [_numType]),
         ElementFactory.methodElement("~/", _numType, [_numType]),
-        ElementFactory.methodElement("-", _numType, []),
+        ElementFactory.methodElement("-", _numType),
         ElementFactory.methodElement("remainder", _numType, [_numType]),
         ElementFactory.methodElement("<", _boolType, [_numType]),
         ElementFactory.methodElement("<=", _boolType, [_numType]),
         ElementFactory.methodElement(">", _boolType, [_numType]),
         ElementFactory.methodElement(">=", _boolType, [_numType]),
         ElementFactory.methodElement("==", _boolType, [_objectType]),
-        ElementFactory.methodElement("isNaN", _boolType, []),
-        ElementFactory.methodElement("isNegative", _boolType, []),
-        ElementFactory.methodElement("isInfinite", _boolType, []),
-        ElementFactory.methodElement("abs", _numType, []),
-        ElementFactory.methodElement("floor", _numType, []),
-        ElementFactory.methodElement("ceil", _numType, []),
-        ElementFactory.methodElement("round", _numType, []),
-        ElementFactory.methodElement("truncate", _numType, []),
-        ElementFactory.methodElement("toInt", _intType, []),
-        ElementFactory.methodElement("toDouble", _doubleType, []),
+        ElementFactory.methodElement("isNaN", _boolType),
+        ElementFactory.methodElement("isNegative", _boolType),
+        ElementFactory.methodElement("isInfinite", _boolType),
+        ElementFactory.methodElement("abs", _numType),
+        ElementFactory.methodElement("floor", _numType),
+        ElementFactory.methodElement("ceil", _numType),
+        ElementFactory.methodElement("round", _numType),
+        ElementFactory.methodElement("truncate", _numType),
+        ElementFactory.methodElement("toInt", _intType),
+        ElementFactory.methodElement("toDouble", _doubleType),
         ElementFactory.methodElement("toStringAsFixed", _stringType, [_intType]),
         ElementFactory.methodElement("toStringAsExponential", _stringType, [_intType]),
         ElementFactory.methodElement("toStringAsPrecision", _stringType, [_intType]),
@@ -9624,17 +9912,17 @@
         ElementFactory.methodElement("&", _intType, [_intType]),
         ElementFactory.methodElement("|", _intType, [_intType]),
         ElementFactory.methodElement("^", _intType, [_intType]),
-        ElementFactory.methodElement("~", _intType, []),
+        ElementFactory.methodElement("~", _intType),
         ElementFactory.methodElement("<<", _intType, [_intType]),
         ElementFactory.methodElement(">>", _intType, [_intType]),
-        ElementFactory.methodElement("-", _intType, []),
-        ElementFactory.methodElement("abs", _intType, []),
-        ElementFactory.methodElement("round", _intType, []),
-        ElementFactory.methodElement("floor", _intType, []),
-        ElementFactory.methodElement("ceil", _intType, []),
-        ElementFactory.methodElement("truncate", _intType, []),
-        ElementFactory.methodElement("toString", _stringType, [])];
-    ConstructorElementImpl fromEnvironment = ElementFactory.constructorElement(intElement, "fromEnvironment", true, []);
+        ElementFactory.methodElement("-", _intType),
+        ElementFactory.methodElement("abs", _intType),
+        ElementFactory.methodElement("round", _intType),
+        ElementFactory.methodElement("floor", _intType),
+        ElementFactory.methodElement("ceil", _intType),
+        ElementFactory.methodElement("truncate", _intType),
+        ElementFactory.methodElement("toString", _stringType)];
+    ConstructorElementImpl fromEnvironment = ElementFactory.constructorElement(intElement, "fromEnvironment", true);
     fromEnvironment.parameters = <ParameterElement> [
         ElementFactory.requiredParameter2("name", stringType),
         ElementFactory.namedParameter2("defaultValue", _intType)];
@@ -9661,13 +9949,13 @@
         ElementFactory.methodElement("%", _doubleType, [_numType]),
         ElementFactory.methodElement("/", _doubleType, [_numType]),
         ElementFactory.methodElement("~/", _doubleType, [_numType]),
-        ElementFactory.methodElement("-", _doubleType, []),
-        ElementFactory.methodElement("abs", _doubleType, []),
-        ElementFactory.methodElement("round", _doubleType, []),
-        ElementFactory.methodElement("floor", _doubleType, []),
-        ElementFactory.methodElement("ceil", _doubleType, []),
-        ElementFactory.methodElement("truncate", _doubleType, []),
-        ElementFactory.methodElement("toString", _stringType, [])];
+        ElementFactory.methodElement("-", _doubleType),
+        ElementFactory.methodElement("abs", _doubleType),
+        ElementFactory.methodElement("round", _doubleType),
+        ElementFactory.methodElement("floor", _doubleType),
+        ElementFactory.methodElement("ceil", _doubleType),
+        ElementFactory.methodElement("truncate", _doubleType),
+        ElementFactory.methodElement("toString", _stringType)];
   }
 
   /**
@@ -9733,7 +10021,7 @@
   void test_getType_enclosedOverride() {
     TypeOverrideManager manager = new TypeOverrideManager();
     LocalVariableElementImpl element = ElementFactory.localVariableElement2("v");
-    InterfaceType type = ElementFactory.classElement2("C", []).type;
+    InterfaceType type = ElementFactory.classElement2("C").type;
     manager.enterScope();
     manager.setType(element, type);
     manager.enterScope();
@@ -9743,7 +10031,7 @@
   void test_getType_immediateOverride() {
     TypeOverrideManager manager = new TypeOverrideManager();
     LocalVariableElementImpl element = ElementFactory.localVariableElement2("v");
-    InterfaceType type = ElementFactory.classElement2("C", []).type;
+    InterfaceType type = ElementFactory.classElement2("C").type;
     manager.enterScope();
     manager.setType(element, type);
     expect(manager.getType(element), same(type));
@@ -11069,18 +11357,18 @@
     // either ElementFactory or TestTypeProvider (which uses ElementFactory) because we side-effect
     // the elements in ways that would break other tests.
     //
-    InterfaceType objectType = _classElement("Object", null, []).type;
-    InterfaceType boolType = _classElement("bool", objectType, []).type;
-    InterfaceType numType = _classElement("num", objectType, []).type;
-    InterfaceType doubleType = _classElement("double", numType, []).type;
-    InterfaceType functionType = _classElement("Function", objectType, []).type;
-    InterfaceType intType = _classElement("int", numType, []).type;
+    InterfaceType objectType = _classElement("Object", null).type;
+    InterfaceType boolType = _classElement("bool", objectType).type;
+    InterfaceType numType = _classElement("num", objectType).type;
+    InterfaceType doubleType = _classElement("double", numType).type;
+    InterfaceType functionType = _classElement("Function", objectType).type;
+    InterfaceType intType = _classElement("int", numType).type;
     InterfaceType listType = _classElement("List", objectType, ["E"]).type;
     InterfaceType mapType = _classElement("Map", objectType, ["K", "V"]).type;
-    InterfaceType stackTraceType = _classElement("StackTrace", objectType, []).type;
-    InterfaceType stringType = _classElement("String", objectType, []).type;
-    InterfaceType symbolType = _classElement("Symbol", objectType, []).type;
-    InterfaceType typeType = _classElement("Type", objectType, []).type;
+    InterfaceType stackTraceType = _classElement("StackTrace", objectType).type;
+    InterfaceType stringType = _classElement("String", objectType).type;
+    InterfaceType symbolType = _classElement("Symbol", objectType).type;
+    InterfaceType typeType = _classElement("Type", objectType).type;
     CompilationUnitElementImpl coreUnit = new CompilationUnitElementImpl("core.dart");
     coreUnit.types = <ClassElement> [
         boolType.element,
@@ -11115,23 +11403,25 @@
     expect(provider.typeType, same(typeType));
   }
 
-  ClassElement _classElement(String typeName, InterfaceType superclassType, List<String> parameterNames) {
+  ClassElement _classElement(String typeName, InterfaceType superclassType, [List<String> parameterNames]) {
     ClassElementImpl element = new ClassElementImpl.forNode(AstFactory.identifier3(typeName));
     element.supertype = superclassType;
     InterfaceTypeImpl type = new InterfaceTypeImpl.con1(element);
     element.type = type;
-    int count = parameterNames.length;
-    if (count > 0) {
-      List<TypeParameterElementImpl> typeParameters = new List<TypeParameterElementImpl>(count);
-      List<TypeParameterTypeImpl> typeArguments = new List<TypeParameterTypeImpl>(count);
-      for (int i = 0; i < count; i++) {
-        TypeParameterElementImpl typeParameter = new TypeParameterElementImpl.forNode(AstFactory.identifier3(parameterNames[i]));
-        typeParameters[i] = typeParameter;
-        typeArguments[i] = new TypeParameterTypeImpl(typeParameter);
-        typeParameter.type = typeArguments[i];
+    if (parameterNames != null) {
+      int count = parameterNames.length;
+      if (count > 0) {
+        List<TypeParameterElementImpl> typeParameters = new List<TypeParameterElementImpl>(count);
+        List<TypeParameterTypeImpl> typeArguments = new List<TypeParameterTypeImpl>(count);
+        for (int i = 0; i < count; i++) {
+          TypeParameterElementImpl typeParameter = new TypeParameterElementImpl.forNode(AstFactory.identifier3(parameterNames[i]));
+          typeParameters[i] = typeParameter;
+          typeArguments[i] = new TypeParameterTypeImpl(typeParameter);
+          typeParameter.type = typeArguments[i];
+        }
+        element.typeParameters = typeParameters;
+        type.typeArguments = typeArguments;
       }
-      element.typeParameters = typeParameters;
-      type.typeArguments = typeArguments;
     }
     return element;
   }
@@ -11191,9 +11481,9 @@
 
   void fail_visitVariableDeclaration() {
     fail("Not yet tested");
-    ClassElement type = ElementFactory.classElement2("A", []);
+    ClassElement type = ElementFactory.classElement2("A");
     VariableDeclaration node = AstFactory.variableDeclaration("a");
-    AstFactory.variableDeclarationList(null, AstFactory.typeName(type, []), [node]);
+    AstFactory.variableDeclarationList(null, AstFactory.typeName(type), [node]);
     //resolve(node);
     expect(node.name.staticType, same(type.type));
     _listener.assertNoErrors();
@@ -11217,29 +11507,29 @@
 
   void test_visitCatchClause_exception() {
     // catch (e)
-    CatchClause clause = AstFactory.catchClause("e", []);
+    CatchClause clause = AstFactory.catchClause("e");
     SimpleIdentifier exceptionParameter = clause.exceptionParameter;
     exceptionParameter.staticElement = new LocalVariableElementImpl.forNode(exceptionParameter);
-    _resolveCatchClause(clause, _typeProvider.dynamicType, null, []);
+    _resolveCatchClause(clause, _typeProvider.dynamicType, null);
     _listener.assertNoErrors();
   }
 
   void test_visitCatchClause_exception_stackTrace() {
     // catch (e, s)
-    CatchClause clause = AstFactory.catchClause2("e", "s", []);
+    CatchClause clause = AstFactory.catchClause2("e", "s");
     SimpleIdentifier exceptionParameter = clause.exceptionParameter;
     exceptionParameter.staticElement = new LocalVariableElementImpl.forNode(exceptionParameter);
     SimpleIdentifier stackTraceParameter = clause.stackTraceParameter;
     stackTraceParameter.staticElement = new LocalVariableElementImpl.forNode(stackTraceParameter);
-    _resolveCatchClause(clause, _typeProvider.dynamicType, _typeProvider.stackTraceType, []);
+    _resolveCatchClause(clause, _typeProvider.dynamicType, _typeProvider.stackTraceType);
     _listener.assertNoErrors();
   }
 
   void test_visitCatchClause_on_exception() {
     // on E catch (e)
-    ClassElement exceptionElement = ElementFactory.classElement2("E", []);
-    TypeName exceptionType = AstFactory.typeName(exceptionElement, []);
-    CatchClause clause = AstFactory.catchClause4(exceptionType, "e", []);
+    ClassElement exceptionElement = ElementFactory.classElement2("E");
+    TypeName exceptionType = AstFactory.typeName(exceptionElement);
+    CatchClause clause = AstFactory.catchClause4(exceptionType, "e");
     SimpleIdentifier exceptionParameter = clause.exceptionParameter;
     exceptionParameter.staticElement = new LocalVariableElementImpl.forNode(exceptionParameter);
     _resolveCatchClause(clause, exceptionElement.type, null, [exceptionElement]);
@@ -11248,10 +11538,10 @@
 
   void test_visitCatchClause_on_exception_stackTrace() {
     // on E catch (e, s)
-    ClassElement exceptionElement = ElementFactory.classElement2("E", []);
-    TypeName exceptionType = AstFactory.typeName(exceptionElement, []);
+    ClassElement exceptionElement = ElementFactory.classElement2("E");
+    TypeName exceptionType = AstFactory.typeName(exceptionElement);
     (exceptionType.name as SimpleIdentifier).staticElement = exceptionElement;
-    CatchClause clause = AstFactory.catchClause5(exceptionType, "e", "s", []);
+    CatchClause clause = AstFactory.catchClause5(exceptionType, "e", "s");
     SimpleIdentifier exceptionParameter = clause.exceptionParameter;
     exceptionParameter.staticElement = new LocalVariableElementImpl.forNode(exceptionParameter);
     SimpleIdentifier stackTraceParameter = clause.stackTraceParameter;
@@ -11265,14 +11555,14 @@
     // class B {}
     // class C {}
     // class D {}
-    ClassElement elementA = ElementFactory.classElement2("A", []);
-    ClassElement elementB = ElementFactory.classElement2("B", []);
-    ClassElement elementC = ElementFactory.classElement2("C", []);
-    ClassElement elementD = ElementFactory.classElement2("D", []);
-    ExtendsClause extendsClause = AstFactory.extendsClause(AstFactory.typeName(elementB, []));
-    WithClause withClause = AstFactory.withClause([AstFactory.typeName(elementC, [])]);
-    ImplementsClause implementsClause = AstFactory.implementsClause([AstFactory.typeName(elementD, [])]);
-    ClassDeclaration declaration = AstFactory.classDeclaration(null, "A", null, extendsClause, withClause, implementsClause, []);
+    ClassElement elementA = ElementFactory.classElement2("A");
+    ClassElement elementB = ElementFactory.classElement2("B");
+    ClassElement elementC = ElementFactory.classElement2("C");
+    ClassElement elementD = ElementFactory.classElement2("D");
+    ExtendsClause extendsClause = AstFactory.extendsClause(AstFactory.typeName(elementB));
+    WithClause withClause = AstFactory.withClause([AstFactory.typeName(elementC)]);
+    ImplementsClause implementsClause = AstFactory.implementsClause([AstFactory.typeName(elementD)]);
+    ClassDeclaration declaration = AstFactory.classDeclaration(null, "A", null, extendsClause, withClause, implementsClause);
     declaration.name.staticElement = elementA;
     _resolveNode(declaration, [elementA, elementB, elementC, elementD]);
     expect(elementA.supertype, same(elementB.type));
@@ -11290,11 +11580,11 @@
     // class B extends A {
     //   void A() {}
     // }
-    ClassElementImpl elementA = ElementFactory.classElement2("A", []);
-    ClassElementImpl elementB = ElementFactory.classElement2("B", []);
-    elementB.methods = <MethodElement> [ElementFactory.methodElement("A", VoidTypeImpl.instance, [])];
-    ExtendsClause extendsClause = AstFactory.extendsClause(AstFactory.typeName(elementA, []));
-    ClassDeclaration declaration = AstFactory.classDeclaration(null, "B", null, extendsClause, null, null, []);
+    ClassElementImpl elementA = ElementFactory.classElement2("A");
+    ClassElementImpl elementB = ElementFactory.classElement2("B");
+    elementB.methods = <MethodElement> [ElementFactory.methodElement("A", VoidTypeImpl.instance)];
+    ExtendsClause extendsClause = AstFactory.extendsClause(AstFactory.typeName(elementA));
+    ClassDeclaration declaration = AstFactory.classDeclaration(null, "B", null, extendsClause, null, null);
     declaration.name.staticElement = elementB;
     _resolveNode(declaration, [elementA, elementB]);
     expect(elementB.supertype, same(elementA.type));
@@ -11303,13 +11593,13 @@
 
   void test_visitClassTypeAlias() {
     // class A = B with C implements D;
-    ClassElement elementA = ElementFactory.classElement2("A", []);
-    ClassElement elementB = ElementFactory.classElement2("B", []);
-    ClassElement elementC = ElementFactory.classElement2("C", []);
-    ClassElement elementD = ElementFactory.classElement2("D", []);
-    WithClause withClause = AstFactory.withClause([AstFactory.typeName(elementC, [])]);
-    ImplementsClause implementsClause = AstFactory.implementsClause([AstFactory.typeName(elementD, [])]);
-    ClassTypeAlias alias = AstFactory.classTypeAlias("A", null, null, AstFactory.typeName(elementB, []), withClause, implementsClause);
+    ClassElement elementA = ElementFactory.classElement2("A");
+    ClassElement elementB = ElementFactory.classElement2("B");
+    ClassElement elementC = ElementFactory.classElement2("C");
+    ClassElement elementD = ElementFactory.classElement2("D");
+    WithClause withClause = AstFactory.withClause([AstFactory.typeName(elementC)]);
+    ImplementsClause implementsClause = AstFactory.implementsClause([AstFactory.typeName(elementD)]);
+    ClassTypeAlias alias = AstFactory.classTypeAlias("A", null, null, AstFactory.typeName(elementB), withClause, implementsClause);
     alias.name.staticElement = elementA;
     _resolveNode(alias, [elementA, elementB, elementC, elementD]);
     expect(elementA.supertype, same(elementB.type));
@@ -11322,9 +11612,112 @@
     _listener.assertNoErrors();
   }
 
+  void test_visitClassTypeAlias_constructorWithOptionalParams_ignored() {
+    // class T {}
+    // class B {
+    //   B.c1();
+    //   B.c2([T a0]);
+    //   B.c3({T a0});
+    // }
+    // class M {}
+    // class C = B with M
+    ClassElement classT = ElementFactory.classElement2('T', []);
+    ClassElementImpl classB = ElementFactory.classElement2('B', []);
+    ConstructorElementImpl constructorBc1 =
+        ElementFactory.constructorElement2(classB, 'c1', []);
+    ConstructorElementImpl constructorBc2 =
+        ElementFactory.constructorElement2(classB, 'c2', [classT.type]);
+    (constructorBc2.parameters[0] as ParameterElementImpl).parameterKind =
+        ParameterKind.POSITIONAL;
+    ConstructorElementImpl constructorBc3 =
+        ElementFactory.constructorElement2(classB, 'c3', [classT.type]);
+    (constructorBc3.parameters[0] as ParameterElementImpl).parameterKind =
+        ParameterKind.NAMED;
+    classB.constructors = [constructorBc1, constructorBc2, constructorBc3];
+    ClassElement classM = ElementFactory.classElement2('M', []);
+    WithClause withClause =
+        AstFactory.withClause([AstFactory.typeName(classM, [])]);
+    ClassElement classC = ElementFactory.classElement2('C', []);
+    ClassTypeAlias alias = AstFactory.classTypeAlias('C', null, null,
+        AstFactory.typeName(classB, []), withClause, null);
+    alias.name.staticElement = classC;
+    _resolveNode(alias, [classT, classB, classM, classC]);
+    expect(classC.constructors, hasLength(1));
+    ConstructorElement constructor = classC.constructors[0];
+    expect(constructor.isFactory, isFalse);
+    expect(constructor.isSynthetic, isTrue);
+    expect(constructor.name, 'c1');
+    expect(constructor.functions, hasLength(0));
+    expect(constructor.labels, hasLength(0));
+    expect(constructor.localVariables, hasLength(0));
+    expect(constructor.parameters, isEmpty);
+  }
+
+  void test_visitClassTypeAlias_constructorWithParams() {
+    // class T {}
+    // class B {
+    //   B(T a0);
+    // }
+    // class M {}
+    // class C = B with M
+    ClassElement classT = ElementFactory.classElement2('T', []);
+    ClassElementImpl classB = ElementFactory.classElement2('B', []);
+    ConstructorElementImpl constructorB =
+        ElementFactory.constructorElement2(classB, '', [classT.type]);
+    classB.constructors = [constructorB];
+    ClassElement classM = ElementFactory.classElement2('M', []);
+    WithClause withClause =
+        AstFactory.withClause([AstFactory.typeName(classM, [])]);
+    ClassElement classC = ElementFactory.classElement2('C', []);
+    ClassTypeAlias alias = AstFactory.classTypeAlias('C', null, null,
+        AstFactory.typeName(classB, []), withClause, null);
+    alias.name.staticElement = classC;
+    _resolveNode(alias, [classT, classB, classM, classC]);
+    expect(classC.constructors, hasLength(1));
+    ConstructorElement constructor = classC.constructors[0];
+    expect(constructor.isFactory, isFalse);
+    expect(constructor.isSynthetic, isTrue);
+    expect(constructor.name, '');
+    expect(constructor.functions, hasLength(0));
+    expect(constructor.labels, hasLength(0));
+    expect(constructor.localVariables, hasLength(0));
+    expect(constructor.parameters, hasLength(1));
+    expect(constructor.parameters[0].type, equals(classT.type));
+    expect(constructor.parameters[0].name,
+        equals(constructorB.parameters[0].name));
+  }
+
+  void test_visitClassTypeAlias_defaultConstructor() {
+    // class B {}
+    // class M {}
+    // class C = B with M
+    ClassElementImpl classB = ElementFactory.classElement2('B', []);
+    ConstructorElementImpl constructorB =
+        ElementFactory.constructorElement2(classB, '', []);
+    constructorB.setModifier(Modifier.SYNTHETIC, true);
+    classB.constructors = [constructorB];
+    ClassElement classM = ElementFactory.classElement2('M', []);
+    WithClause withClause =
+        AstFactory.withClause([AstFactory.typeName(classM, [])]);
+    ClassElement classC = ElementFactory.classElement2('C', []);
+    ClassTypeAlias alias = AstFactory.classTypeAlias('C', null, null,
+        AstFactory.typeName(classB, []), withClause, null);
+    alias.name.staticElement = classC;
+    _resolveNode(alias, [classB, classM, classC]);
+    expect(classC.constructors, hasLength(1));
+    ConstructorElement constructor = classC.constructors[0];
+    expect(constructor.isFactory, isFalse);
+    expect(constructor.isSynthetic, isTrue);
+    expect(constructor.name, '');
+    expect(constructor.functions, hasLength(0));
+    expect(constructor.labels, hasLength(0));
+    expect(constructor.localVariables, hasLength(0));
+    expect(constructor.parameters, isEmpty);
+  }
+
   void test_visitFieldFormalParameter_functionType() {
     InterfaceType intType = _typeProvider.intType;
-    TypeName intTypeName = AstFactory.typeName4("int", []);
+    TypeName intTypeName = AstFactory.typeName4("int");
     String innerParameterName = "a";
     SimpleFormalParameter parameter = AstFactory.simpleFormalParameter3(innerParameterName);
     parameter.identifier.staticElement = ElementFactory.requiredParameter(innerParameterName);
@@ -11343,13 +11736,13 @@
     String parameterName = "p";
     FormalParameter node = AstFactory.fieldFormalParameter(Keyword.VAR, null, parameterName);
     node.identifier.staticElement = ElementFactory.requiredParameter(parameterName);
-    expect(_resolveFormalParameter(node, []), same(_typeProvider.dynamicType));
+    expect(_resolveFormalParameter(node), same(_typeProvider.dynamicType));
     _listener.assertNoErrors();
   }
 
   void test_visitFieldFormalParameter_type() {
     InterfaceType intType = _typeProvider.intType;
-    TypeName intTypeName = AstFactory.typeName4("int", []);
+    TypeName intTypeName = AstFactory.typeName4("int");
     String parameterName = "p";
     FormalParameter node = AstFactory.fieldFormalParameter(null, intTypeName, parameterName);
     node.identifier.staticElement = ElementFactory.requiredParameter(parameterName);
@@ -11361,7 +11754,7 @@
     // p
     FormalParameter node = AstFactory.simpleFormalParameter3("p");
     node.identifier.staticElement = new ParameterElementImpl.forNode(AstFactory.identifier3("p"));
-    expect(_resolveFormalParameter(node, []), same(_typeProvider.dynamicType));
+    expect(_resolveFormalParameter(node), same(_typeProvider.dynamicType));
     _listener.assertNoErrors();
   }
 
@@ -11369,7 +11762,7 @@
     // int p
     InterfaceType intType = _typeProvider.intType;
     ClassElement intElement = intType.element;
-    FormalParameter node = AstFactory.simpleFormalParameter4(AstFactory.typeName(intElement, []), "p");
+    FormalParameter node = AstFactory.simpleFormalParameter4(AstFactory.typeName(intElement), "p");
     SimpleIdentifier identifier = node.identifier;
     ParameterElementImpl element = new ParameterElementImpl.forNode(identifier);
     identifier.staticElement = element;
@@ -11378,8 +11771,8 @@
   }
 
   void test_visitTypeName_noParameters_noArguments() {
-    ClassElement classA = ElementFactory.classElement2("A", []);
-    TypeName typeName = AstFactory.typeName(classA, []);
+    ClassElement classA = ElementFactory.classElement2("A");
+    TypeName typeName = AstFactory.typeName(classA);
     typeName.type = null;
     _resolveNode(typeName, [classA]);
     expect(typeName.type, same(classA.type));
@@ -11388,8 +11781,8 @@
 
   void test_visitTypeName_parameters_arguments() {
     ClassElement classA = ElementFactory.classElement2("A", ["E"]);
-    ClassElement classB = ElementFactory.classElement2("B", []);
-    TypeName typeName = AstFactory.typeName(classA, [AstFactory.typeName(classB, [])]);
+    ClassElement classB = ElementFactory.classElement2("B");
+    TypeName typeName = AstFactory.typeName(classA, [AstFactory.typeName(classB)]);
     typeName.type = null;
     _resolveNode(typeName, [classA, classB]);
     InterfaceType resultType = typeName.type as InterfaceType;
@@ -11402,7 +11795,7 @@
 
   void test_visitTypeName_parameters_noArguments() {
     ClassElement classA = ElementFactory.classElement2("A", ["E"]);
-    TypeName typeName = AstFactory.typeName(classA, []);
+    TypeName typeName = AstFactory.typeName(classA);
     typeName.type = null;
     _resolveNode(typeName, [classA]);
     InterfaceType resultType = typeName.type as InterfaceType;
@@ -11414,8 +11807,8 @@
   }
 
   void test_visitTypeName_void() {
-    ClassElement classA = ElementFactory.classElement2("A", []);
-    TypeName typeName = AstFactory.typeName4("void", []);
+    ClassElement classA = ElementFactory.classElement2("A");
+    TypeName typeName = AstFactory.typeName4("void");
     _resolveNode(typeName, [classA]);
     expect(typeName.type, same(VoidTypeImpl.instance));
     _listener.assertNoErrors();
@@ -11432,7 +11825,7 @@
    * @param definedElements the elements that are to be defined in the scope in which the element is
    *          being resolved
    */
-  void _resolveCatchClause(CatchClause node, DartType exceptionType, InterfaceType stackTraceType, List<Element> definedElements) {
+  void _resolveCatchClause(CatchClause node, DartType exceptionType, InterfaceType stackTraceType, [List<Element> definedElements]) {
     _resolveNode(node, definedElements);
     SimpleIdentifier exceptionParameter = node.exceptionParameter;
     if (exceptionParameter != null) {
@@ -11453,7 +11846,7 @@
    *          being resolved
    * @return the type associated with the parameter
    */
-  DartType _resolveFormalParameter(FormalParameter node, List<Element> definedElements) {
+  DartType _resolveFormalParameter(FormalParameter node, [List<Element> definedElements]) {
     _resolveNode(node, definedElements);
     return (node.identifier.staticElement as ParameterElement).type;
   }
@@ -11467,9 +11860,11 @@
    *          being resolved
    * @return the element to which the expression was resolved
    */
-  void _resolveNode(AstNode node, List<Element> definedElements) {
-    for (Element element in definedElements) {
-      _library.libraryScope.define(element);
+  void _resolveNode(AstNode node, [List<Element> definedElements]) {
+    if (definedElements != null) {
+      for (Element element in definedElements) {
+        _library.libraryScope.define(element);
+      }
     }
     node.accept(_visitor);
     node.accept(_implicitConstructorBuilder);
diff --git a/pkg/analyzer/test/generated/static_warning_code_test.dart b/pkg/analyzer/test/generated/static_warning_code_test.dart
index 2c779c5..127654a 100644
--- a/pkg/analyzer/test/generated/static_warning_code_test.dart
+++ b/pkg/analyzer/test/generated/static_warning_code_test.dart
@@ -252,6 +252,24 @@
     assertErrors(source, [StaticWarningCode.AMBIGUOUS_IMPORT]);
   }
 
+  void test_ambiguousImport_withPrefix() {
+    Source source = addSource(r'''
+library test;
+import 'lib1.dart' as p;
+import 'lib2.dart' as p;
+main() {
+  p.f();
+}''');
+    addNamedSource("/lib1.dart", r'''
+library lib1;
+f() {}''');
+    addNamedSource("/lib2.dart", r'''
+library lib2;
+f() {}''');
+    resolve(source);
+    assertErrors(source, [StaticWarningCode.AMBIGUOUS_IMPORT]);
+  }
+
   void test_argumentTypeNotAssignable_ambiguousClassName() {
     // See dartbug.com/19624
     Source source = addNamedSource("/lib1.dart", r'''
@@ -1098,7 +1116,7 @@
     verify([source]);
   }
 
-  void test_exportDuplicatedLibraryName() {
+  void test_exportDuplicatedLibraryNamed() {
     Source source = addSource(r'''
 library test;
 export 'lib1.dart';
@@ -1106,7 +1124,19 @@
     addNamedSource("/lib1.dart", "library lib;");
     addNamedSource("/lib2.dart", "library lib;");
     resolve(source);
-    assertErrors(source, [StaticWarningCode.EXPORT_DUPLICATED_LIBRARY_NAME]);
+    assertErrors(source, [StaticWarningCode.EXPORT_DUPLICATED_LIBRARY_NAMED]);
+    verify([source]);
+  }
+
+  void test_exportDuplicatedLibraryUnnamed() {
+    Source source = addSource(r'''
+library test;
+export 'lib1.dart';
+export 'lib2.dart';''');
+    addNamedSource("/lib1.dart", "");
+    addNamedSource("/lib2.dart", "");
+    resolve(source);
+    assertErrors(source, [StaticWarningCode.EXPORT_DUPLICATED_LIBRARY_UNNAMED]);
     verify([source]);
   }
 
@@ -1274,7 +1304,7 @@
     verify([source]);
   }
 
-  void test_importDuplicatedLibraryName() {
+  void test_importDuplicatedLibraryNamed() {
     Source source = addSource(r'''
 library test;
 import 'lib1.dart';
@@ -1283,7 +1313,22 @@
     addNamedSource("/lib2.dart", "library lib;");
     resolve(source);
     assertErrors(source, [
-        StaticWarningCode.IMPORT_DUPLICATED_LIBRARY_NAME,
+        StaticWarningCode.IMPORT_DUPLICATED_LIBRARY_NAMED,
+        HintCode.UNUSED_IMPORT,
+        HintCode.UNUSED_IMPORT]);
+    verify([source]);
+  }
+
+  void test_importDuplicatedLibraryUnnamed() {
+    Source source = addSource(r'''
+library test;
+import 'lib1.dart';
+import 'lib2.dart';''');
+    addNamedSource("/lib1.dart", "");
+    addNamedSource("/lib2.dart", "");
+    resolve(source);
+    assertErrors(source, [
+        StaticWarningCode.IMPORT_DUPLICATED_LIBRARY_UNNAMED,
         HintCode.UNUSED_IMPORT,
         HintCode.UNUSED_IMPORT]);
     verify([source]);
@@ -1373,6 +1418,24 @@
     verify([source]);
   }
 
+  void test_instanceMethodNameCollidesWithSuperclassStatic_interface() {
+    Source source = addSource(r'''
+class Base {
+  static foo() {}
+}
+abstract class Ifc {
+  foo();
+}
+class C extends Base implements Ifc {
+  foo() {}
+}
+''');
+    resolve(source);
+    assertErrors(source, [
+        StaticWarningCode.INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC]);
+    verify([source]);
+  }
+
   void test_instanceMethodNameCollidesWithSuperclassStatic_method() {
     Source source = addSource(r'''
 class A {
@@ -1709,6 +1772,112 @@
     verify([source]);
   }
 
+  void test_invalidOverride_defaultOverridesNonDefault() {
+    // If the base class provided an explicit value for a default parameter,
+    // then it is a static warning for the derived class to provide a different
+    // value, even if implicitly.
+    Source source = addSource(r'''
+class A {
+  foo([x = 1]) {}
+}
+class B extends A {
+  foo([x]) {}
+}
+''');
+    resolve(source);
+    assertErrors(source, [
+        StaticWarningCode.INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_POSITIONAL]);
+    verify([source]);
+  }
+
+  void test_invalidOverride_defaultOverridesNonDefault_named() {
+    // If the base class provided an explicit value for a default parameter,
+    // then it is a static warning for the derived class to provide a different
+    // value, even if implicitly.
+    Source source = addSource(r'''
+class A {
+  foo({x: 1}) {}
+}
+class B extends A {
+  foo({x}) {}
+}
+''');
+    resolve(source);
+    assertErrors(source, [
+        StaticWarningCode.INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_NAMED]);
+    verify([source]);
+  }
+
+  void test_invalidOverride_defaultOverridesNonDefaultNull() {
+    // If the base class provided an explicit null value for a default
+    // parameter, then it is ok for the derived class to let the default value
+    // be implicit, because the implicit default value of null matches the
+    // explicit default value of null.
+    Source source = addSource(r'''
+class A {
+  foo([x = null]) {}
+}
+class B extends A {
+  foo([x]) {}
+}
+''');
+    resolve(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  void test_invalidOverride_defaultOverridesNonDefaultNull_named() {
+    // If the base class provided an explicit null value for a default
+    // parameter, then it is ok for the derived class to let the default value
+    // be implicit, because the implicit default value of null matches the
+    // explicit default value of null.
+    Source source = addSource(r'''
+class A {
+  foo({x: null}) {}
+}
+class B extends A {
+  foo({x}) {}
+}
+''');
+    resolve(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  void test_invalidOverride_nonDefaultOverridesDefault() {
+    // If the base class lets the default parameter be implicit, then it is ok
+    // for the derived class to provide an explicit default value, even if it's
+    // not null.
+    Source source = addSource(r'''
+class A {
+  foo([x]) {}
+}
+class B extends A {
+  foo([x = 1]) {}
+}
+''');
+    resolve(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  void test_invalidOverride_nonDefaultOverridesDefault_named() {
+    // If the base class lets the default parameter be implicit, then it is ok
+    // for the derived class to provide an explicit default value, even if it's
+    // not null.
+    Source source = addSource(r'''
+class A {
+  foo({x}) {}
+}
+class B extends A {
+  foo({x: 1}) {}
+}
+''');
+    resolve(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
   void test_invalidOverrideDifferentDefaultValues_named() {
     Source source = addSource(r'''
 class A {
diff --git a/pkg/analyzer/test/generated/test_support.dart b/pkg/analyzer/test/generated/test_support.dart
index 20f04a8..3a48b47 100644
--- a/pkg/analyzer/test/generated/test_support.dart
+++ b/pkg/analyzer/test/generated/test_support.dart
@@ -239,7 +239,7 @@
    * @throws AssertionFailedError if a different number of errors have been gathered than were
    *           expected
    */
-  void assertErrorsWithCodes(List<ErrorCode> expectedErrorCodes) {
+  void assertErrorsWithCodes([List<ErrorCode> expectedErrorCodes = ErrorCode.EMPTY_LIST]) {
     StringBuffer buffer = new StringBuffer();
     //
     // Verify that the expected error codes have a non-empty message.
@@ -293,7 +293,7 @@
         }
         buffer.write(expectedCount);
         buffer.write(" errors of type ");
-        buffer.write("${code.runtimeType}.$code");
+        buffer.write(code.uniqueName);
         buffer.write(", found ");
         buffer.write(actualCount);
       }
@@ -310,7 +310,7 @@
         buffer.write("; ");
       }
       buffer.write("0 errors of type ");
-      buffer.write("${code.runtimeType}.$code");
+      buffer.write(code.uniqueName);
       buffer.write(", found ");
       buffer.write(actualCount);
       buffer.write(" (");
diff --git a/pkg/analyzer/test/generated/utilities_test.dart b/pkg/analyzer/test/generated/utilities_test.dart
index 27ebefd..1f509d5 100644
--- a/pkg/analyzer/test/generated/utilities_test.dart
+++ b/pkg/analyzer/test/generated/utilities_test.dart
@@ -52,7 +52,7 @@
         AstFactory.annotation2(
             AstFactory.identifier3("A"),
             AstFactory.identifier3("c"),
-            AstFactory.argumentList([])));
+            AstFactory.argumentList()));
   }
 
   void test_visitArgumentList() {
@@ -65,7 +65,7 @@
     _assertClone(
         AstFactory.asExpression(
             AstFactory.identifier3("e"),
-            AstFactory.typeName4("T", [])));
+            AstFactory.typeName4("T")));
   }
 
   void test_visitAssertStatement() {
@@ -93,11 +93,11 @@
   }
 
   void test_visitBlockFunctionBody() {
-    _assertClone(AstFactory.blockFunctionBody2([]));
+    _assertClone(AstFactory.blockFunctionBody2());
   }
 
   void test_visitBlock_empty() {
-    _assertClone(AstFactory.block([]));
+    _assertClone(AstFactory.block());
   }
 
   void test_visitBlock_nonEmpty() {
@@ -144,35 +144,35 @@
         AstFactory.cascadeExpression(
             AstFactory.identifier3("a"),
             [
-                AstFactory.cascadedMethodInvocation("b", []),
-                AstFactory.cascadedMethodInvocation("c", [])]));
+                AstFactory.cascadedMethodInvocation("b"),
+                AstFactory.cascadedMethodInvocation("c")]));
   }
 
   void test_visitCatchClause_catch_noStack() {
-    _assertClone(AstFactory.catchClause("e", []));
+    _assertClone(AstFactory.catchClause("e"));
   }
 
   void test_visitCatchClause_catch_stack() {
-    _assertClone(AstFactory.catchClause2("e", "s", []));
+    _assertClone(AstFactory.catchClause2("e", "s"));
   }
 
   void test_visitCatchClause_on() {
-    _assertClone(AstFactory.catchClause3(AstFactory.typeName4("E", []), []));
+    _assertClone(AstFactory.catchClause3(AstFactory.typeName4("E")));
   }
 
   void test_visitCatchClause_on_catch() {
     _assertClone(
-        AstFactory.catchClause4(AstFactory.typeName4("E", []), "e", []));
+        AstFactory.catchClause4(AstFactory.typeName4("E"), "e"));
   }
 
   void test_visitClassDeclaration_abstract() {
     _assertClone(
-        AstFactory.classDeclaration(Keyword.ABSTRACT, "C", null, null, null, null, []));
+        AstFactory.classDeclaration(Keyword.ABSTRACT, "C", null, null, null, null));
   }
 
   void test_visitClassDeclaration_empty() {
     _assertClone(
-        AstFactory.classDeclaration(null, "C", null, null, null, null, []));
+        AstFactory.classDeclaration(null, "C", null, null, null, null));
   }
 
   void test_visitClassDeclaration_extends() {
@@ -181,10 +181,9 @@
             null,
             "C",
             null,
-            AstFactory.extendsClause(AstFactory.typeName4("A", [])),
+            AstFactory.extendsClause(AstFactory.typeName4("A")),
             null,
-            null,
-            []));
+            null));
   }
 
   void test_visitClassDeclaration_extends_implements() {
@@ -193,10 +192,9 @@
             null,
             "C",
             null,
-            AstFactory.extendsClause(AstFactory.typeName4("A", [])),
+            AstFactory.extendsClause(AstFactory.typeName4("A")),
             null,
-            AstFactory.implementsClause([AstFactory.typeName4("B", [])]),
-            []));
+            AstFactory.implementsClause([AstFactory.typeName4("B")])));
   }
 
   void test_visitClassDeclaration_extends_with() {
@@ -205,10 +203,9 @@
             null,
             "C",
             null,
-            AstFactory.extendsClause(AstFactory.typeName4("A", [])),
-            AstFactory.withClause([AstFactory.typeName4("M", [])]),
-            null,
-            []));
+            AstFactory.extendsClause(AstFactory.typeName4("A")),
+            AstFactory.withClause([AstFactory.typeName4("M")]),
+            null));
   }
 
   void test_visitClassDeclaration_extends_with_implements() {
@@ -217,10 +214,9 @@
             null,
             "C",
             null,
-            AstFactory.extendsClause(AstFactory.typeName4("A", [])),
-            AstFactory.withClause([AstFactory.typeName4("M", [])]),
-            AstFactory.implementsClause([AstFactory.typeName4("B", [])]),
-            []));
+            AstFactory.extendsClause(AstFactory.typeName4("A")),
+            AstFactory.withClause([AstFactory.typeName4("M")]),
+            AstFactory.implementsClause([AstFactory.typeName4("B")])));
   }
 
   void test_visitClassDeclaration_implements() {
@@ -231,8 +227,7 @@
             null,
             null,
             null,
-            AstFactory.implementsClause([AstFactory.typeName4("B", [])]),
-            []));
+            AstFactory.implementsClause([AstFactory.typeName4("B")])));
   }
 
   void test_visitClassDeclaration_multipleMember() {
@@ -263,8 +258,7 @@
             AstFactory.typeParameterList(["E"]),
             null,
             null,
-            null,
-            []));
+            null));
   }
 
   void test_visitClassDeclaration_parameters_extends() {
@@ -273,10 +267,9 @@
             null,
             "C",
             AstFactory.typeParameterList(["E"]),
-            AstFactory.extendsClause(AstFactory.typeName4("A", [])),
+            AstFactory.extendsClause(AstFactory.typeName4("A")),
             null,
-            null,
-            []));
+            null));
   }
 
   void test_visitClassDeclaration_parameters_extends_implements() {
@@ -285,10 +278,9 @@
             null,
             "C",
             AstFactory.typeParameterList(["E"]),
-            AstFactory.extendsClause(AstFactory.typeName4("A", [])),
+            AstFactory.extendsClause(AstFactory.typeName4("A")),
             null,
-            AstFactory.implementsClause([AstFactory.typeName4("B", [])]),
-            []));
+            AstFactory.implementsClause([AstFactory.typeName4("B")])));
   }
 
   void test_visitClassDeclaration_parameters_extends_with() {
@@ -297,10 +289,9 @@
             null,
             "C",
             AstFactory.typeParameterList(["E"]),
-            AstFactory.extendsClause(AstFactory.typeName4("A", [])),
-            AstFactory.withClause([AstFactory.typeName4("M", [])]),
-            null,
-            []));
+            AstFactory.extendsClause(AstFactory.typeName4("A")),
+            AstFactory.withClause([AstFactory.typeName4("M")]),
+            null));
   }
 
   void test_visitClassDeclaration_parameters_extends_with_implements() {
@@ -309,10 +300,9 @@
             null,
             "C",
             AstFactory.typeParameterList(["E"]),
-            AstFactory.extendsClause(AstFactory.typeName4("A", [])),
-            AstFactory.withClause([AstFactory.typeName4("M", [])]),
-            AstFactory.implementsClause([AstFactory.typeName4("B", [])]),
-            []));
+            AstFactory.extendsClause(AstFactory.typeName4("A")),
+            AstFactory.withClause([AstFactory.typeName4("M")]),
+            AstFactory.implementsClause([AstFactory.typeName4("B")])));
   }
 
   void test_visitClassDeclaration_parameters_implements() {
@@ -323,8 +313,7 @@
             AstFactory.typeParameterList(["E"]),
             null,
             null,
-            AstFactory.implementsClause([AstFactory.typeName4("B", [])]),
-            []));
+            AstFactory.implementsClause([AstFactory.typeName4("B")])));
   }
 
   void test_visitClassDeclaration_singleMember() {
@@ -345,9 +334,9 @@
 
   void test_visitClassDeclaration_withMetadata() {
     ClassDeclaration declaration =
-        AstFactory.classDeclaration(null, "C", null, null, null, null, []);
+        AstFactory.classDeclaration(null, "C", null, null, null, null);
     declaration.metadata =
-        AstFactory.list([AstFactory.annotation(AstFactory.identifier3("deprecated"))]);
+        [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
     _assertClone(declaration);
   }
 
@@ -357,8 +346,8 @@
             "C",
             null,
             Keyword.ABSTRACT,
-            AstFactory.typeName4("S", []),
-            AstFactory.withClause([AstFactory.typeName4("M1", [])]),
+            AstFactory.typeName4("S"),
+            AstFactory.withClause([AstFactory.typeName4("M1")]),
             null));
   }
 
@@ -368,9 +357,9 @@
             "C",
             null,
             Keyword.ABSTRACT,
-            AstFactory.typeName4("S", []),
-            AstFactory.withClause([AstFactory.typeName4("M1", [])]),
-            AstFactory.implementsClause([AstFactory.typeName4("I", [])])));
+            AstFactory.typeName4("S"),
+            AstFactory.withClause([AstFactory.typeName4("M1")]),
+            AstFactory.implementsClause([AstFactory.typeName4("I")])));
   }
 
   void test_visitClassTypeAlias_generic() {
@@ -379,9 +368,9 @@
             "C",
             AstFactory.typeParameterList(["E"]),
             null,
-            AstFactory.typeName4("S", [AstFactory.typeName4("E", [])]),
+            AstFactory.typeName4("S", [AstFactory.typeName4("E")]),
             AstFactory.withClause(
-                [AstFactory.typeName4("M1", [AstFactory.typeName4("E", [])])]),
+                [AstFactory.typeName4("M1", [AstFactory.typeName4("E")])]),
             null));
   }
 
@@ -391,9 +380,9 @@
             "C",
             null,
             null,
-            AstFactory.typeName4("S", []),
-            AstFactory.withClause([AstFactory.typeName4("M1", [])]),
-            AstFactory.implementsClause([AstFactory.typeName4("I", [])])));
+            AstFactory.typeName4("S"),
+            AstFactory.withClause([AstFactory.typeName4("M1")]),
+            AstFactory.implementsClause([AstFactory.typeName4("I")])));
   }
 
   void test_visitClassTypeAlias_minimal() {
@@ -402,8 +391,8 @@
             "C",
             null,
             null,
-            AstFactory.typeName4("S", []),
-            AstFactory.withClause([AstFactory.typeName4("M1", [])]),
+            AstFactory.typeName4("S"),
+            AstFactory.withClause([AstFactory.typeName4("M1")]),
             null));
   }
 
@@ -413,8 +402,8 @@
             "C",
             AstFactory.typeParameterList(["E"]),
             Keyword.ABSTRACT,
-            AstFactory.typeName4("S", []),
-            AstFactory.withClause([AstFactory.typeName4("M1", [])]),
+            AstFactory.typeName4("S"),
+            AstFactory.withClause([AstFactory.typeName4("M1")]),
             null));
   }
 
@@ -424,9 +413,9 @@
             "C",
             AstFactory.typeParameterList(["E"]),
             Keyword.ABSTRACT,
-            AstFactory.typeName4("S", []),
-            AstFactory.withClause([AstFactory.typeName4("M1", [])]),
-            AstFactory.implementsClause([AstFactory.typeName4("I", [])])));
+            AstFactory.typeName4("S"),
+            AstFactory.withClause([AstFactory.typeName4("M1")]),
+            AstFactory.implementsClause([AstFactory.typeName4("I")])));
   }
 
   void test_visitClassTypeAlias_parameters_implements() {
@@ -435,9 +424,9 @@
             "C",
             AstFactory.typeParameterList(["E"]),
             null,
-            AstFactory.typeName4("S", []),
-            AstFactory.withClause([AstFactory.typeName4("M1", [])]),
-            AstFactory.implementsClause([AstFactory.typeName4("I", [])])));
+            AstFactory.typeName4("S"),
+            AstFactory.withClause([AstFactory.typeName4("M1")]),
+            AstFactory.implementsClause([AstFactory.typeName4("I")])));
   }
 
   void test_visitClassTypeAlias_withMetadata() {
@@ -445,11 +434,11 @@
         "C",
         null,
         null,
-        AstFactory.typeName4("S", []),
-        AstFactory.withClause([AstFactory.typeName4("M1", [])]),
+        AstFactory.typeName4("S"),
+        AstFactory.withClause([AstFactory.typeName4("M1")]),
         null);
     declaration.metadata =
-        AstFactory.list([AstFactory.annotation(AstFactory.identifier3("deprecated"))]);
+        [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
     _assertClone(declaration);
   }
 
@@ -480,12 +469,10 @@
   void test_visitCompilationUnit_directive_declaration() {
     _assertClone(
         AstFactory.compilationUnit4(
-            AstFactory.list([AstFactory.libraryDirective2("l")]),
-            AstFactory.list(
-                [
-                    AstFactory.topLevelVariableDeclaration2(
-                        Keyword.VAR,
-                        [AstFactory.variableDeclaration("a")])])));
+            [AstFactory.libraryDirective2("l")],
+            [AstFactory.topLevelVariableDeclaration2(
+                Keyword.VAR,
+                [AstFactory.variableDeclaration("a")])]));
   }
 
   void test_visitCompilationUnit_empty() {
@@ -517,12 +504,10 @@
     _assertClone(
         AstFactory.compilationUnit8(
             "!#/bin/dartvm",
-            AstFactory.list([AstFactory.libraryDirective2("l")]),
-            AstFactory.list(
-                [
-                    AstFactory.topLevelVariableDeclaration2(
-                        Keyword.VAR,
-                        [AstFactory.variableDeclaration("a")])])));
+            [AstFactory.libraryDirective2("l")],
+            [AstFactory.topLevelVariableDeclaration2(
+                Keyword.VAR,
+                [AstFactory.variableDeclaration("a")])]));
   }
 
   void test_visitConditionalExpression() {
@@ -540,9 +525,9 @@
             null,
             AstFactory.identifier3("C"),
             null,
-            AstFactory.formalParameterList([]),
+            AstFactory.formalParameterList(),
             null,
-            AstFactory.blockFunctionBody2([])));
+            AstFactory.blockFunctionBody2()));
   }
 
   void test_visitConstructorDeclaration_external() {
@@ -550,7 +535,7 @@
         AstFactory.constructorDeclaration(
             AstFactory.identifier3("C"),
             null,
-            AstFactory.formalParameterList([]),
+            AstFactory.formalParameterList(),
             null));
   }
 
@@ -561,9 +546,9 @@
             null,
             AstFactory.identifier3("C"),
             null,
-            AstFactory.formalParameterList([]),
+            AstFactory.formalParameterList(),
             null,
-            AstFactory.blockFunctionBody2([])));
+            AstFactory.blockFunctionBody2()));
   }
 
   void test_visitConstructorDeclaration_multipleInitializers() {
@@ -573,15 +558,13 @@
             null,
             AstFactory.identifier3("C"),
             null,
-            AstFactory.formalParameterList([]),
-            AstFactory.list(
-                [
-                    AstFactory.constructorFieldInitializer(false, "a", AstFactory.identifier3("b")),
-                    AstFactory.constructorFieldInitializer(
-                        false,
-                        "c",
-                        AstFactory.identifier3("d"))]),
-            AstFactory.blockFunctionBody2([])));
+            AstFactory.formalParameterList(),
+            [AstFactory.constructorFieldInitializer(false, "a", AstFactory.identifier3("b")),
+            AstFactory.constructorFieldInitializer(
+                false,
+                "c",
+                AstFactory.identifier3("d"))],
+            AstFactory.blockFunctionBody2()));
   }
 
   void test_visitConstructorDeclaration_multipleParameters() {
@@ -591,12 +574,11 @@
             null,
             AstFactory.identifier3("C"),
             null,
-            AstFactory.formalParameterList(
-                [
-                    AstFactory.simpleFormalParameter(Keyword.VAR, "a"),
-                    AstFactory.simpleFormalParameter(Keyword.VAR, "b")]),
+            AstFactory.formalParameterList([
+                AstFactory.simpleFormalParameter(Keyword.VAR, "a"),
+                AstFactory.simpleFormalParameter(Keyword.VAR, "b")]),
             null,
-            AstFactory.blockFunctionBody2([])));
+            AstFactory.blockFunctionBody2()));
   }
 
   void test_visitConstructorDeclaration_named() {
@@ -606,9 +588,9 @@
             null,
             AstFactory.identifier3("C"),
             "m",
-            AstFactory.formalParameterList([]),
+            AstFactory.formalParameterList(),
             null,
-            AstFactory.blockFunctionBody2([])));
+            AstFactory.blockFunctionBody2()));
   }
 
   void test_visitConstructorDeclaration_singleInitializer() {
@@ -618,14 +600,12 @@
             null,
             AstFactory.identifier3("C"),
             null,
-            AstFactory.formalParameterList([]),
-            AstFactory.list(
-                [
-                    AstFactory.constructorFieldInitializer(
-                        false,
-                        "a",
-                        AstFactory.identifier3("b"))]),
-            AstFactory.blockFunctionBody2([])));
+            AstFactory.formalParameterList(),
+            [AstFactory.constructorFieldInitializer(
+                false,
+                "a",
+                AstFactory.identifier3("b"))],
+            AstFactory.blockFunctionBody2()));
   }
 
   void test_visitConstructorDeclaration_withMetadata() {
@@ -634,11 +614,11 @@
         null,
         AstFactory.identifier3("C"),
         null,
-        AstFactory.formalParameterList([]),
+        AstFactory.formalParameterList(),
         null,
-        AstFactory.blockFunctionBody2([]));
+        AstFactory.blockFunctionBody2());
     declaration.metadata =
-        AstFactory.list([AstFactory.annotation(AstFactory.identifier3("deprecated"))]);
+        [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
     _assertClone(declaration);
   }
 
@@ -657,18 +637,18 @@
 
   void test_visitConstructorName_named_prefix() {
     _assertClone(
-        AstFactory.constructorName(AstFactory.typeName4("p.C.n", []), null));
+        AstFactory.constructorName(AstFactory.typeName4("p.C.n"), null));
   }
 
   void test_visitConstructorName_unnamed_noPrefix() {
     _assertClone(
-        AstFactory.constructorName(AstFactory.typeName4("C", []), null));
+        AstFactory.constructorName(AstFactory.typeName4("C"), null));
   }
 
   void test_visitConstructorName_unnamed_prefix() {
     _assertClone(
         AstFactory.constructorName(
-            AstFactory.typeName3(AstFactory.identifier5("p", "C"), []),
+            AstFactory.typeName3(AstFactory.identifier5("p", "C")),
             null));
   }
 
@@ -708,7 +688,7 @@
 
   void test_visitDoStatement() {
     _assertClone(
-        AstFactory.doStatement(AstFactory.block([]), AstFactory.identifier3("c")));
+        AstFactory.doStatement(AstFactory.block(), AstFactory.identifier3("c")));
   }
 
   void test_visitDoubleLiteral() {
@@ -740,13 +720,13 @@
   }
 
   void test_visitExportDirective_minimal() {
-    _assertClone(AstFactory.exportDirective2("a.dart", []));
+    _assertClone(AstFactory.exportDirective2("a.dart"));
   }
 
   void test_visitExportDirective_withMetadata() {
-    ExportDirective directive = AstFactory.exportDirective2("a.dart", []);
+    ExportDirective directive = AstFactory.exportDirective2("a.dart");
     directive.metadata =
-        AstFactory.list([AstFactory.annotation(AstFactory.identifier3("deprecated"))]);
+        [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
     _assertClone(directive);
   }
 
@@ -760,7 +740,7 @@
   }
 
   void test_visitExtendsClause() {
-    _assertClone(AstFactory.extendsClause(AstFactory.typeName4("C", [])));
+    _assertClone(AstFactory.extendsClause(AstFactory.typeName4("C")));
   }
 
   void test_visitFieldDeclaration_instance() {
@@ -785,7 +765,7 @@
         Keyword.VAR,
         [AstFactory.variableDeclaration("a")]);
     declaration.metadata =
-        AstFactory.list([AstFactory.annotation(AstFactory.identifier3("deprecated"))]);
+        [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
     _assertClone(declaration);
   }
 
@@ -793,7 +773,7 @@
     _assertClone(
         AstFactory.fieldFormalParameter(
             null,
-            AstFactory.typeName4("A", []),
+            AstFactory.typeName4("A"),
             "a",
             AstFactory.formalParameterList([AstFactory.simpleFormalParameter3("b")])));
   }
@@ -806,13 +786,13 @@
     _assertClone(
         AstFactory.fieldFormalParameter(
             Keyword.FINAL,
-            AstFactory.typeName4("A", []),
+            AstFactory.typeName4("A"),
             "a"));
   }
 
   void test_visitFieldFormalParameter_type() {
     _assertClone(
-        AstFactory.fieldFormalParameter(null, AstFactory.typeName4("A", []), "a"));
+        AstFactory.fieldFormalParameter(null, AstFactory.typeName4("A"), "a"));
   }
 
   void test_visitForEachStatement_declared() {
@@ -820,7 +800,7 @@
         AstFactory.forEachStatement(
             AstFactory.declaredIdentifier3("a"),
             AstFactory.identifier3("b"),
-            AstFactory.block([])));
+            AstFactory.block()));
   }
 
   void test_visitForEachStatement_variable() {
@@ -833,7 +813,7 @@
             TokenFactory.tokenFromKeyword(Keyword.IN),
             AstFactory.identifier3("b"),
             TokenFactory.tokenFromType(TokenType.CLOSE_PAREN),
-            AstFactory.block([])));
+            AstFactory.block()));
   }
 
   void test_visitForEachStatement_variable_await() {
@@ -846,7 +826,7 @@
             TokenFactory.tokenFromKeyword(Keyword.IN),
             AstFactory.identifier3("b"),
             TokenFactory.tokenFromType(TokenType.CLOSE_PAREN),
-            AstFactory.block([])));
+            AstFactory.block()));
   }
 
   void test_visitForStatement_c() {
@@ -855,7 +835,7 @@
             null,
             AstFactory.identifier3("c"),
             null,
-            AstFactory.block([])));
+            AstFactory.block()));
   }
 
   void test_visitForStatement_cu() {
@@ -863,8 +843,8 @@
         AstFactory.forStatement(
             null,
             AstFactory.identifier3("c"),
-            AstFactory.list([AstFactory.identifier3("u")]),
-            AstFactory.block([])));
+            [AstFactory.identifier3("u")],
+            AstFactory.block()));
   }
 
   void test_visitForStatement_e() {
@@ -873,7 +853,7 @@
             AstFactory.identifier3("e"),
             null,
             null,
-            AstFactory.block([])));
+            AstFactory.block()));
   }
 
   void test_visitForStatement_ec() {
@@ -882,7 +862,7 @@
             AstFactory.identifier3("e"),
             AstFactory.identifier3("c"),
             null,
-            AstFactory.block([])));
+            AstFactory.block()));
   }
 
   void test_visitForStatement_ecu() {
@@ -890,8 +870,8 @@
         AstFactory.forStatement(
             AstFactory.identifier3("e"),
             AstFactory.identifier3("c"),
-            AstFactory.list([AstFactory.identifier3("u")]),
-            AstFactory.block([])));
+            [AstFactory.identifier3("u")],
+            AstFactory.block()));
   }
 
   void test_visitForStatement_eu() {
@@ -899,8 +879,8 @@
         AstFactory.forStatement(
             AstFactory.identifier3("e"),
             null,
-            AstFactory.list([AstFactory.identifier3("u")]),
-            AstFactory.block([])));
+            [AstFactory.identifier3("u")],
+            AstFactory.block()));
   }
 
   void test_visitForStatement_i() {
@@ -911,7 +891,7 @@
                 [AstFactory.variableDeclaration("i")]),
             null,
             null,
-            AstFactory.block([])));
+            AstFactory.block()));
   }
 
   void test_visitForStatement_ic() {
@@ -922,7 +902,7 @@
                 [AstFactory.variableDeclaration("i")]),
             AstFactory.identifier3("c"),
             null,
-            AstFactory.block([])));
+            AstFactory.block()));
   }
 
   void test_visitForStatement_icu() {
@@ -932,8 +912,8 @@
                 Keyword.VAR,
                 [AstFactory.variableDeclaration("i")]),
             AstFactory.identifier3("c"),
-            AstFactory.list([AstFactory.identifier3("u")]),
-            AstFactory.block([])));
+            [AstFactory.identifier3("u")],
+            AstFactory.block()));
   }
 
   void test_visitForStatement_iu() {
@@ -943,8 +923,8 @@
                 Keyword.VAR,
                 [AstFactory.variableDeclaration("i")]),
             null,
-            AstFactory.list([AstFactory.identifier3("u")]),
-            AstFactory.block([])));
+            [AstFactory.identifier3("u")],
+            AstFactory.block()));
   }
 
   void test_visitForStatement_u() {
@@ -952,12 +932,12 @@
         AstFactory.forStatement(
             null,
             null,
-            AstFactory.list([AstFactory.identifier3("u")]),
-            AstFactory.block([])));
+            [AstFactory.identifier3("u")],
+            AstFactory.block()));
   }
 
   void test_visitFormalParameterList_empty() {
-    _assertClone(AstFactory.formalParameterList([]));
+    _assertClone(AstFactory.formalParameterList());
   }
 
   void test_visitFormalParameterList_n() {
@@ -1154,7 +1134,7 @@
         "f",
         AstFactory.functionExpression());
     declaration.metadata =
-        AstFactory.list([AstFactory.annotation(AstFactory.identifier3("deprecated"))]);
+        [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
     _assertClone(declaration);
   }
 
@@ -1164,71 +1144,70 @@
 
   void test_visitFunctionExpressionInvocation() {
     _assertClone(
-        AstFactory.functionExpressionInvocation(AstFactory.identifier3("f"), []));
+        AstFactory.functionExpressionInvocation(AstFactory.identifier3("f")));
   }
 
   void test_visitFunctionTypeAlias_generic() {
     _assertClone(
         AstFactory.typeAlias(
-            AstFactory.typeName4("A", []),
+            AstFactory.typeName4("A"),
             "F",
             AstFactory.typeParameterList(["B"]),
-            AstFactory.formalParameterList([])));
+            AstFactory.formalParameterList()));
   }
 
   void test_visitFunctionTypeAlias_nonGeneric() {
     _assertClone(
         AstFactory.typeAlias(
-            AstFactory.typeName4("A", []),
+            AstFactory.typeName4("A"),
             "F",
             null,
-            AstFactory.formalParameterList([])));
+            AstFactory.formalParameterList()));
   }
 
   void test_visitFunctionTypeAlias_withMetadata() {
     FunctionTypeAlias declaration = AstFactory.typeAlias(
-        AstFactory.typeName4("A", []),
+        AstFactory.typeName4("A"),
         "F",
         null,
-        AstFactory.formalParameterList([]));
+        AstFactory.formalParameterList());
     declaration.metadata =
-        AstFactory.list([AstFactory.annotation(AstFactory.identifier3("deprecated"))]);
+        [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
     _assertClone(declaration);
   }
 
   void test_visitFunctionTypedFormalParameter_noType() {
-    _assertClone(AstFactory.functionTypedFormalParameter(null, "f", []));
+    _assertClone(AstFactory.functionTypedFormalParameter(null, "f"));
   }
 
   void test_visitFunctionTypedFormalParameter_type() {
     _assertClone(
         AstFactory.functionTypedFormalParameter(
-            AstFactory.typeName4("T", []),
-            "f",
-            []));
+            AstFactory.typeName4("T"),
+            "f"));
   }
 
   void test_visitIfStatement_withElse() {
     _assertClone(
         AstFactory.ifStatement2(
             AstFactory.identifier3("c"),
-            AstFactory.block([]),
-            AstFactory.block([])));
+            AstFactory.block(),
+            AstFactory.block()));
   }
 
   void test_visitIfStatement_withoutElse() {
     _assertClone(
-        AstFactory.ifStatement(AstFactory.identifier3("c"), AstFactory.block([])));
+        AstFactory.ifStatement(AstFactory.identifier3("c"), AstFactory.block()));
   }
 
   void test_visitImplementsClause_multiple() {
     _assertClone(
         AstFactory.implementsClause(
-            [AstFactory.typeName4("A", []), AstFactory.typeName4("B", [])]));
+            [AstFactory.typeName4("A"), AstFactory.typeName4("B")]));
   }
 
   void test_visitImplementsClause_single() {
-    _assertClone(AstFactory.implementsClause([AstFactory.typeName4("A", [])]));
+    _assertClone(AstFactory.implementsClause([AstFactory.typeName4("A")]));
   }
 
   void test_visitImportDirective_combinator() {
@@ -1250,11 +1229,11 @@
   }
 
   void test_visitImportDirective_minimal() {
-    _assertClone(AstFactory.importDirective3("a.dart", null, []));
+    _assertClone(AstFactory.importDirective3("a.dart", null));
   }
 
   void test_visitImportDirective_prefix() {
-    _assertClone(AstFactory.importDirective3("a.dart", "p", []));
+    _assertClone(AstFactory.importDirective3("a.dart", "p"));
   }
 
   void test_visitImportDirective_prefix_combinator() {
@@ -1276,9 +1255,9 @@
   }
 
   void test_visitImportDirective_withMetadata() {
-    ImportDirective directive = AstFactory.importDirective3("a.dart", null, []);
+    ImportDirective directive = AstFactory.importDirective3("a.dart", null);
     directive.metadata =
-        AstFactory.list([AstFactory.annotation(AstFactory.identifier3("deprecated"))]);
+        [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
     _assertClone(directive);
   }
 
@@ -1313,25 +1292,22 @@
     _assertClone(
         AstFactory.instanceCreationExpression2(
             Keyword.CONST,
-            AstFactory.typeName4("C", []),
-            []));
+            AstFactory.typeName4("C")));
   }
 
   void test_visitInstanceCreationExpression_named() {
     _assertClone(
         AstFactory.instanceCreationExpression3(
             Keyword.NEW,
-            AstFactory.typeName4("C", []),
-            "c",
-            []));
+            AstFactory.typeName4("C"),
+            "c"));
   }
 
   void test_visitInstanceCreationExpression_unnamed() {
     _assertClone(
         AstFactory.instanceCreationExpression2(
             Keyword.NEW,
-            AstFactory.typeName4("C", []),
-            []));
+            AstFactory.typeName4("C")));
   }
 
   void test_visitIntegerLiteral() {
@@ -1356,7 +1332,7 @@
         AstFactory.isExpression(
             AstFactory.identifier3("a"),
             true,
-            AstFactory.typeName4("C", [])));
+            AstFactory.typeName4("C")));
   }
 
   void test_visitIsExpression_normal() {
@@ -1364,7 +1340,7 @@
         AstFactory.isExpression(
             AstFactory.identifier3("a"),
             false,
-            AstFactory.typeName4("C", [])));
+            AstFactory.typeName4("C")));
   }
 
   void test_visitLabel() {
@@ -1374,14 +1350,14 @@
   void test_visitLabeledStatement_multiple() {
     _assertClone(
         AstFactory.labeledStatement(
-            AstFactory.list([AstFactory.label2("a"), AstFactory.label2("b")]),
+            [AstFactory.label2("a"), AstFactory.label2("b")],
             AstFactory.returnStatement()));
   }
 
   void test_visitLabeledStatement_single() {
     _assertClone(
         AstFactory.labeledStatement(
-            AstFactory.list([AstFactory.label2("a")]),
+            [AstFactory.label2("a")],
             AstFactory.returnStatement()));
   }
 
@@ -1392,7 +1368,7 @@
   void test_visitLibraryDirective_withMetadata() {
     LibraryDirective directive = AstFactory.libraryDirective2("l");
     directive.metadata =
-        AstFactory.list([AstFactory.annotation(AstFactory.identifier3("deprecated"))]);
+        [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
     _assertClone(directive);
   }
 
@@ -1410,11 +1386,11 @@
   }
 
   void test_visitListLiteral_const() {
-    _assertClone(AstFactory.listLiteral2(Keyword.CONST, null, []));
+    _assertClone(AstFactory.listLiteral2(Keyword.CONST, null));
   }
 
   void test_visitListLiteral_empty() {
-    _assertClone(AstFactory.listLiteral([]));
+    _assertClone(AstFactory.listLiteral());
   }
 
   void test_visitListLiteral_nonEmpty() {
@@ -1431,11 +1407,11 @@
   }
 
   void test_visitMapLiteral_const() {
-    _assertClone(AstFactory.mapLiteral(Keyword.CONST, null, []));
+    _assertClone(AstFactory.mapLiteral(Keyword.CONST, null));
   }
 
   void test_visitMapLiteral_empty() {
-    _assertClone(AstFactory.mapLiteral2([]));
+    _assertClone(AstFactory.mapLiteral2());
   }
 
   void test_visitMapLiteral_nonEmpty() {
@@ -1455,18 +1431,18 @@
             null,
             null,
             AstFactory.identifier3("m"),
-            AstFactory.formalParameterList([])));
+            AstFactory.formalParameterList()));
   }
 
   void test_visitMethodDeclaration_external_returnType() {
     _assertClone(
         AstFactory.methodDeclaration(
             null,
-            AstFactory.typeName4("T", []),
+            AstFactory.typeName4("T"),
             null,
             null,
             AstFactory.identifier3("m"),
-            AstFactory.formalParameterList([])));
+            AstFactory.formalParameterList()));
   }
 
   void test_visitMethodDeclaration_getter() {
@@ -1478,32 +1454,32 @@
             null,
             AstFactory.identifier3("m"),
             null,
-            AstFactory.blockFunctionBody2([])));
+            AstFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_getter_returnType() {
     _assertClone(
         AstFactory.methodDeclaration2(
             null,
-            AstFactory.typeName4("T", []),
+            AstFactory.typeName4("T"),
             Keyword.GET,
             null,
             AstFactory.identifier3("m"),
             null,
-            AstFactory.blockFunctionBody2([])));
+            AstFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_getter_seturnType() {
     _assertClone(
         AstFactory.methodDeclaration2(
             null,
-            AstFactory.typeName4("T", []),
+            AstFactory.typeName4("T"),
             Keyword.SET,
             null,
             AstFactory.identifier3("m"),
             AstFactory.formalParameterList(
                 [AstFactory.simpleFormalParameter(Keyword.VAR, "v")]),
-            AstFactory.blockFunctionBody2([])));
+            AstFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_minimal() {
@@ -1514,8 +1490,8 @@
             null,
             null,
             AstFactory.identifier3("m"),
-            AstFactory.formalParameterList([]),
-            AstFactory.blockFunctionBody2([])));
+            AstFactory.formalParameterList(),
+            AstFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_multipleParameters() {
@@ -1530,7 +1506,7 @@
                 [
                     AstFactory.simpleFormalParameter(Keyword.VAR, "a"),
                     AstFactory.simpleFormalParameter(Keyword.VAR, "b")]),
-            AstFactory.blockFunctionBody2([])));
+            AstFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_operator() {
@@ -1541,32 +1517,32 @@
             null,
             Keyword.OPERATOR,
             AstFactory.identifier3("+"),
-            AstFactory.formalParameterList([]),
-            AstFactory.blockFunctionBody2([])));
+            AstFactory.formalParameterList(),
+            AstFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_operator_returnType() {
     _assertClone(
         AstFactory.methodDeclaration2(
             null,
-            AstFactory.typeName4("T", []),
+            AstFactory.typeName4("T"),
             null,
             Keyword.OPERATOR,
             AstFactory.identifier3("+"),
-            AstFactory.formalParameterList([]),
-            AstFactory.blockFunctionBody2([])));
+            AstFactory.formalParameterList(),
+            AstFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_returnType() {
     _assertClone(
         AstFactory.methodDeclaration2(
             null,
-            AstFactory.typeName4("T", []),
+            AstFactory.typeName4("T"),
             null,
             null,
             AstFactory.identifier3("m"),
-            AstFactory.formalParameterList([]),
-            AstFactory.blockFunctionBody2([])));
+            AstFactory.formalParameterList(),
+            AstFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_setter() {
@@ -1579,7 +1555,7 @@
             AstFactory.identifier3("m"),
             AstFactory.formalParameterList(
                 [AstFactory.simpleFormalParameter(Keyword.VAR, "v")]),
-            AstFactory.blockFunctionBody2([])));
+            AstFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_static() {
@@ -1590,20 +1566,20 @@
             null,
             null,
             AstFactory.identifier3("m"),
-            AstFactory.formalParameterList([]),
-            AstFactory.blockFunctionBody2([])));
+            AstFactory.formalParameterList(),
+            AstFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_static_returnType() {
     _assertClone(
         AstFactory.methodDeclaration2(
             Keyword.STATIC,
-            AstFactory.typeName4("T", []),
+            AstFactory.typeName4("T"),
             null,
             null,
             AstFactory.identifier3("m"),
-            AstFactory.formalParameterList([]),
-            AstFactory.blockFunctionBody2([])));
+            AstFactory.formalParameterList(),
+            AstFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_withMetadata() {
@@ -1613,20 +1589,20 @@
         null,
         null,
         AstFactory.identifier3("m"),
-        AstFactory.formalParameterList([]),
-        AstFactory.blockFunctionBody2([]));
+        AstFactory.formalParameterList(),
+        AstFactory.blockFunctionBody2());
     declaration.metadata =
-        AstFactory.list([AstFactory.annotation(AstFactory.identifier3("deprecated"))]);
+        [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
     _assertClone(declaration);
   }
 
   void test_visitMethodInvocation_noTarget() {
-    _assertClone(AstFactory.methodInvocation2("m", []));
+    _assertClone(AstFactory.methodInvocation2("m"));
   }
 
   void test_visitMethodInvocation_target() {
     _assertClone(
-        AstFactory.methodInvocation(AstFactory.identifier3("t"), "m", []));
+        AstFactory.methodInvocation(AstFactory.identifier3("t"), "m"));
   }
 
   void test_visitNamedExpression() {
@@ -1664,7 +1640,7 @@
   void test_visitPartDirective_withMetadata() {
     PartDirective directive = AstFactory.partDirective2("a.dart");
     directive.metadata =
-        AstFactory.list([AstFactory.annotation(AstFactory.identifier3("deprecated"))]);
+        [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
     _assertClone(directive);
   }
 
@@ -1677,7 +1653,7 @@
     PartOfDirective directive =
         AstFactory.partOfDirective(AstFactory.libraryIdentifier2(["l"]));
     directive.metadata =
-        AstFactory.list([AstFactory.annotation(AstFactory.identifier3("deprecated"))]);
+        [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
     _assertClone(directive);
   }
 
@@ -1707,11 +1683,11 @@
   }
 
   void test_visitRedirectingConstructorInvocation_named() {
-    _assertClone(AstFactory.redirectingConstructorInvocation2("c", []));
+    _assertClone(AstFactory.redirectingConstructorInvocation2("c"));
   }
 
   void test_visitRedirectingConstructorInvocation_unnamed() {
-    _assertClone(AstFactory.redirectingConstructorInvocation([]));
+    _assertClone(AstFactory.redirectingConstructorInvocation());
   }
 
   void test_visitRethrowExpression() {
@@ -1739,13 +1715,13 @@
     _assertClone(
         AstFactory.simpleFormalParameter2(
             Keyword.FINAL,
-            AstFactory.typeName4("A", []),
+            AstFactory.typeName4("A"),
             "a"));
   }
 
   void test_visitSimpleFormalParameter_type() {
     _assertClone(
-        AstFactory.simpleFormalParameter4(AstFactory.typeName4("A", []), "a"));
+        AstFactory.simpleFormalParameter4(AstFactory.typeName4("A"), "a"));
   }
 
   void test_visitSimpleIdentifier() {
@@ -1766,11 +1742,11 @@
   }
 
   void test_visitSuperConstructorInvocation() {
-    _assertClone(AstFactory.superConstructorInvocation([]));
+    _assertClone(AstFactory.superConstructorInvocation());
   }
 
   void test_visitSuperConstructorInvocation_named() {
-    _assertClone(AstFactory.superConstructorInvocation2("c", []));
+    _assertClone(AstFactory.superConstructorInvocation2("c"));
   }
 
   void test_visitSuperExpression() {
@@ -1780,52 +1756,52 @@
   void test_visitSwitchCase_multipleLabels() {
     _assertClone(
         AstFactory.switchCase2(
-            AstFactory.list([AstFactory.label2("l1"), AstFactory.label2("l2")]),
+            [AstFactory.label2("l1"), AstFactory.label2("l2")],
             AstFactory.identifier3("a"),
-            [AstFactory.block([])]));
+            [AstFactory.block()]));
   }
 
   void test_visitSwitchCase_multipleStatements() {
     _assertClone(
         AstFactory.switchCase(
             AstFactory.identifier3("a"),
-            [AstFactory.block([]), AstFactory.block([])]));
+            [AstFactory.block(), AstFactory.block()]));
   }
 
   void test_visitSwitchCase_noLabels() {
     _assertClone(
-        AstFactory.switchCase(AstFactory.identifier3("a"), [AstFactory.block([])]));
+        AstFactory.switchCase(AstFactory.identifier3("a"), [AstFactory.block()]));
   }
 
   void test_visitSwitchCase_singleLabel() {
     _assertClone(
         AstFactory.switchCase2(
-            AstFactory.list([AstFactory.label2("l1")]),
+            [AstFactory.label2("l1")],
             AstFactory.identifier3("a"),
-            [AstFactory.block([])]));
+            [AstFactory.block()]));
   }
 
   void test_visitSwitchDefault_multipleLabels() {
     _assertClone(
         AstFactory.switchDefault(
-            AstFactory.list([AstFactory.label2("l1"), AstFactory.label2("l2")]),
-            [AstFactory.block([])]));
+            [AstFactory.label2("l1"), AstFactory.label2("l2")],
+            [AstFactory.block()]));
   }
 
   void test_visitSwitchDefault_multipleStatements() {
     _assertClone(
-        AstFactory.switchDefault2([AstFactory.block([]), AstFactory.block([])]));
+        AstFactory.switchDefault2([AstFactory.block(), AstFactory.block()]));
   }
 
   void test_visitSwitchDefault_noLabels() {
-    _assertClone(AstFactory.switchDefault2([AstFactory.block([])]));
+    _assertClone(AstFactory.switchDefault2([AstFactory.block()]));
   }
 
   void test_visitSwitchDefault_singleLabel() {
     _assertClone(
         AstFactory.switchDefault(
-            AstFactory.list([AstFactory.label2("l1")]),
-            [AstFactory.block([])]));
+            [AstFactory.label2("l1")],
+            [AstFactory.block()]));
   }
 
   void test_visitSwitchStatement() {
@@ -1833,8 +1809,8 @@
         AstFactory.switchStatement(
             AstFactory.identifier3("a"),
             [
-                AstFactory.switchCase(AstFactory.string2("b"), [AstFactory.block([])]),
-                AstFactory.switchDefault2([AstFactory.block([])])]));
+                AstFactory.switchCase(AstFactory.string2("b"), [AstFactory.block()]),
+                AstFactory.switchDefault2([AstFactory.block()])]));
   }
 
   void test_visitSymbolLiteral_multiple() {
@@ -1870,62 +1846,62 @@
   void test_visitTryStatement_catch() {
     _assertClone(
         AstFactory.tryStatement2(
-            AstFactory.block([]),
-            [AstFactory.catchClause3(AstFactory.typeName4("E", []), [])]));
+            AstFactory.block(),
+            [AstFactory.catchClause3(AstFactory.typeName4("E"))]));
   }
 
   void test_visitTryStatement_catchFinally() {
     _assertClone(
         AstFactory.tryStatement3(
-            AstFactory.block([]),
-            AstFactory.list([AstFactory.catchClause3(AstFactory.typeName4("E", []), [])]),
-            AstFactory.block([])));
+            AstFactory.block(),
+            [AstFactory.catchClause3(AstFactory.typeName4("E"))],
+            AstFactory.block()));
   }
 
   void test_visitTryStatement_catches() {
     _assertClone(
         AstFactory.tryStatement2(
-            AstFactory.block([]),
+            AstFactory.block(),
             [
-                AstFactory.catchClause3(AstFactory.typeName4("E", []), []),
-                AstFactory.catchClause3(AstFactory.typeName4("F", []), [])]));
+                AstFactory.catchClause3(AstFactory.typeName4("E")),
+                AstFactory.catchClause3(AstFactory.typeName4("F"))]));
   }
 
   void test_visitTryStatement_finally() {
     _assertClone(
-        AstFactory.tryStatement(AstFactory.block([]), AstFactory.block([])));
+        AstFactory.tryStatement(AstFactory.block(), AstFactory.block()));
   }
 
   void test_visitTypeArgumentList_multiple() {
     _assertClone(
         AstFactory.typeArgumentList(
-            [AstFactory.typeName4("E", []), AstFactory.typeName4("F", [])]));
+            [AstFactory.typeName4("E"), AstFactory.typeName4("F")]));
   }
 
   void test_visitTypeArgumentList_single() {
-    _assertClone(AstFactory.typeArgumentList([AstFactory.typeName4("E", [])]));
+    _assertClone(AstFactory.typeArgumentList([AstFactory.typeName4("E")]));
   }
 
   void test_visitTypeName_multipleArgs() {
     _assertClone(
         AstFactory.typeName4(
             "C",
-            [AstFactory.typeName4("D", []), AstFactory.typeName4("E", [])]));
+            [AstFactory.typeName4("D"), AstFactory.typeName4("E")]));
   }
 
   void test_visitTypeName_nestedArg() {
     _assertClone(
         AstFactory.typeName4(
             "C",
-            [AstFactory.typeName4("D", [AstFactory.typeName4("E", [])])]));
+            [AstFactory.typeName4("D", [AstFactory.typeName4("E")])]));
   }
 
   void test_visitTypeName_noArgs() {
-    _assertClone(AstFactory.typeName4("C", []));
+    _assertClone(AstFactory.typeName4("C"));
   }
 
   void test_visitTypeName_singleArg() {
-    _assertClone(AstFactory.typeName4("C", [AstFactory.typeName4("D", [])]));
+    _assertClone(AstFactory.typeName4("C", [AstFactory.typeName4("D")]));
   }
 
   void test_visitTypeParameterList_multiple() {
@@ -1937,13 +1913,13 @@
   }
 
   void test_visitTypeParameter_withExtends() {
-    _assertClone(AstFactory.typeParameter2("E", AstFactory.typeName4("C", [])));
+    _assertClone(AstFactory.typeParameter2("E", AstFactory.typeName4("C")));
   }
 
   void test_visitTypeParameter_withMetadata() {
     TypeParameter parameter = AstFactory.typeParameter("E");
     parameter.metadata =
-        AstFactory.list([AstFactory.annotation(AstFactory.identifier3("deprecated"))]);
+        [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
     _assertClone(parameter);
   }
 
@@ -1955,7 +1931,7 @@
     _assertClone(
         AstFactory.variableDeclarationList(
             Keyword.CONST,
-            AstFactory.typeName4("C", []),
+            AstFactory.typeName4("C"),
             [AstFactory.variableDeclaration("a"), AstFactory.variableDeclaration("b")]));
   }
 
@@ -1972,7 +1948,7 @@
             Keyword.FINAL,
             [AstFactory.variableDeclaration("a"), AstFactory.variableDeclaration("b")]);
     declarationList.metadata =
-        AstFactory.list([AstFactory.annotation(AstFactory.identifier3("deprecated"))]);
+        [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
     _assertClone(declarationList);
   }
 
@@ -1980,7 +1956,7 @@
     _assertClone(
         AstFactory.variableDeclarationList(
             null,
-            AstFactory.typeName4("C", []),
+            AstFactory.typeName4("C"),
             [AstFactory.variableDeclaration("a"), AstFactory.variableDeclaration("b")]));
   }
 
@@ -1995,7 +1971,7 @@
     _assertClone(
         AstFactory.variableDeclarationStatement(
             null,
-            AstFactory.typeName4("C", []),
+            AstFactory.typeName4("C"),
             [AstFactory.variableDeclaration("c")]));
   }
 
@@ -2011,26 +1987,26 @@
   void test_visitVariableDeclaration_withMetadata() {
     VariableDeclaration declaration = AstFactory.variableDeclaration("a");
     declaration.metadata =
-        AstFactory.list([AstFactory.annotation(AstFactory.identifier3("deprecated"))]);
+        [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
     _assertClone(declaration);
   }
 
   void test_visitWhileStatement() {
     _assertClone(
-        AstFactory.whileStatement(AstFactory.identifier3("c"), AstFactory.block([])));
+        AstFactory.whileStatement(AstFactory.identifier3("c"), AstFactory.block()));
   }
 
   void test_visitWithClause_multiple() {
     _assertClone(
         AstFactory.withClause(
             [
-                AstFactory.typeName4("A", []),
-                AstFactory.typeName4("B", []),
-                AstFactory.typeName4("C", [])]));
+                AstFactory.typeName4("A"),
+                AstFactory.typeName4("B"),
+                AstFactory.typeName4("C")]));
   }
 
   void test_visitWithClause_single() {
-    _assertClone(AstFactory.withClause([AstFactory.typeName4("A", [])]));
+    _assertClone(AstFactory.withClause([AstFactory.typeName4("A")]));
   }
 
   void test_visitYieldStatement() {
@@ -3593,7 +3569,7 @@
 class ListUtilitiesTest {
   void test_addAll_emptyToEmpty() {
     List<String> list = new List<String>();
-    List<String> elements = [];
+    List<String> elements = <String>[];
     ListUtilities.addAll(list, elements);
     expect(list.length, 0);
   }
@@ -3601,7 +3577,7 @@
   void test_addAll_emptyToNonEmpty() {
     List<String> list = new List<String>();
     list.add("a");
-    List<String> elements = [];
+    List<String> elements = <String>[];
     ListUtilities.addAll(list, elements);
     expect(list.length, 1);
   }
@@ -3740,6 +3716,11 @@
 }
 
 class NodeReplacerTest extends EngineTestCase {
+  /**
+   * An empty list of tokens.
+   */
+  static const List<Token> EMPTY_TOKEN_LIST = const <Token>[];
+
   void test_adjacentStrings() {
     AdjacentStrings node =
         AstFactory.adjacentStrings([AstFactory.string2("a"), AstFactory.string2("b")]);
@@ -3771,7 +3752,7 @@
         AstFactory.integer(0),
         AstFactory.typeName3(
             AstFactory.identifier3("a"),
-            [AstFactory.typeName4("C", [])]));
+            [AstFactory.typeName4("C")]));
     _assertReplace(node, new Getter_NodeReplacerTest_test_asExpression_2());
     _assertReplace(node, new Getter_NodeReplacerTest_test_asExpression());
   }
@@ -3810,7 +3791,7 @@
   }
 
   void test_blockFunctionBody() {
-    BlockFunctionBody node = AstFactory.blockFunctionBody(AstFactory.block([]));
+    BlockFunctionBody node = AstFactory.blockFunctionBody(AstFactory.block());
     _assertReplace(node, new Getter_NodeReplacerTest_test_blockFunctionBody());
   }
 
@@ -3831,7 +3812,7 @@
 
   void test_catchClause() {
     CatchClause node = AstFactory.catchClause5(
-        AstFactory.typeName4("E", []),
+        AstFactory.typeName4("E"),
         "e",
         "s",
         [AstFactory.emptyStatement()]);
@@ -3845,18 +3826,17 @@
         null,
         "A",
         AstFactory.typeParameterList(["E"]),
-        AstFactory.extendsClause(AstFactory.typeName4("B", [])),
-        AstFactory.withClause([AstFactory.typeName4("C", [])]),
-        AstFactory.implementsClause([AstFactory.typeName4("D", [])]),
+        AstFactory.extendsClause(AstFactory.typeName4("B")),
+        AstFactory.withClause([AstFactory.typeName4("C")]),
+        AstFactory.implementsClause([AstFactory.typeName4("D")]),
         [
             AstFactory.fieldDeclaration2(
                 false,
                 null,
                 [AstFactory.variableDeclaration("f")])]);
     node.documentationComment =
-        Comment.createEndOfLineComment(new List<Token>(0));
-    node.metadata =
-        AstFactory.list([AstFactory.annotation(AstFactory.identifier3("a"))]);
+        Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
+    node.metadata = [AstFactory.annotation(AstFactory.identifier3("a"))];
     node.nativeClause = AstFactory.nativeClause("");
     _assertReplace(node, new Getter_NodeReplacerTest_test_classDeclaration_6());
     _assertReplace(node, new Getter_NodeReplacerTest_test_classDeclaration_5());
@@ -3875,13 +3855,12 @@
         "A",
         AstFactory.typeParameterList(["E"]),
         null,
-        AstFactory.typeName4("B", []),
-        AstFactory.withClause([AstFactory.typeName4("C", [])]),
-        AstFactory.implementsClause([AstFactory.typeName4("D", [])]));
+        AstFactory.typeName4("B"),
+        AstFactory.withClause([AstFactory.typeName4("C")]),
+        AstFactory.implementsClause([AstFactory.typeName4("D")]));
     node.documentationComment =
-        Comment.createEndOfLineComment(new List<Token>(0));
-    node.metadata =
-        AstFactory.list([AstFactory.annotation(AstFactory.identifier3("a"))]);
+        Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
+    node.metadata = [AstFactory.annotation(AstFactory.identifier3("a"))];
     _assertReplace(node, new Getter_NodeReplacerTest_test_classTypeAlias_4());
     _assertReplace(node, new Getter_NodeReplacerTest_test_classTypeAlias_5());
     _assertReplace(node, new Getter_NodeReplacerTest_test_classTypeAlias());
@@ -3891,7 +3870,7 @@
   }
 
   void test_comment() {
-    Comment node = Comment.createEndOfLineComment(new List<Token>(0));
+    Comment node = Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
     node.references.add(
         new CommentReference(null, AstFactory.identifier3("x")));
     _assertReplace(node, new ListGetter_NodeReplacerTest_test_comment(0));
@@ -3906,12 +3885,10 @@
   void test_compilationUnit() {
     CompilationUnit node = AstFactory.compilationUnit8(
         "",
-        AstFactory.list([AstFactory.libraryDirective2("lib")]),
-        AstFactory.list(
-            [
-                AstFactory.topLevelVariableDeclaration2(
-                    null,
-                    [AstFactory.variableDeclaration("X")])]));
+        [AstFactory.libraryDirective2("lib")],
+        [AstFactory.topLevelVariableDeclaration2(
+            null,
+            [AstFactory.variableDeclaration("X")])]);
     _assertReplace(node, new Getter_NodeReplacerTest_test_compilationUnit());
     _assertReplace(
         node,
@@ -3943,16 +3920,15 @@
         null,
         AstFactory.identifier3("C"),
         "d",
-        AstFactory.formalParameterList([]),
-        AstFactory.list(
-            [AstFactory.constructorFieldInitializer(false, "x", AstFactory.integer(0))]),
+        AstFactory.formalParameterList(),
+        [AstFactory.constructorFieldInitializer(false, "x", AstFactory.integer(0))],
         AstFactory.emptyFunctionBody());
     node.documentationComment =
-        Comment.createEndOfLineComment(new List<Token>(0));
+        Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
     node.metadata =
-        AstFactory.list([AstFactory.annotation(AstFactory.identifier3("a"))]);
+        [AstFactory.annotation(AstFactory.identifier3("a"))];
     node.redirectedConstructor =
-        AstFactory.constructorName(AstFactory.typeName4("B", []), "a");
+        AstFactory.constructorName(AstFactory.typeName4("B"), "a");
     _assertReplace(
         node,
         new Getter_NodeReplacerTest_test_constructorDeclaration_3());
@@ -3987,7 +3963,7 @@
 
   void test_constructorName() {
     ConstructorName node =
-        AstFactory.constructorName(AstFactory.typeName4("C", []), "n");
+        AstFactory.constructorName(AstFactory.typeName4("C"), "n");
     _assertReplace(node, new Getter_NodeReplacerTest_test_constructorName());
     _assertReplace(node, new Getter_NodeReplacerTest_test_constructorName_2());
   }
@@ -3999,11 +3975,11 @@
 
   void test_declaredIdentifier() {
     DeclaredIdentifier node =
-        AstFactory.declaredIdentifier4(AstFactory.typeName4("C", []), "i");
+        AstFactory.declaredIdentifier4(AstFactory.typeName4("C"), "i");
     node.documentationComment =
-        Comment.createEndOfLineComment(new List<Token>(0));
+        Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
     node.metadata =
-        AstFactory.list([AstFactory.annotation(AstFactory.identifier3("a"))]);
+        [AstFactory.annotation(AstFactory.identifier3("a"))];
     _assertReplace(node, new Getter_NodeReplacerTest_test_declaredIdentifier());
     _assertReplace(
         node,
@@ -4025,15 +4001,15 @@
 
   void test_doStatement() {
     DoStatement node =
-        AstFactory.doStatement(AstFactory.block([]), AstFactory.booleanLiteral(true));
+        AstFactory.doStatement(AstFactory.block(), AstFactory.booleanLiteral(true));
     _assertReplace(node, new Getter_NodeReplacerTest_test_doStatement_2());
     _assertReplace(node, new Getter_NodeReplacerTest_test_doStatement());
   }
 
   void test_enumConstantDeclaration() {
     EnumConstantDeclaration node = new EnumConstantDeclaration(
-        Comment.createEndOfLineComment(new List<Token>(0)),
-        AstFactory.list([AstFactory.annotation(AstFactory.identifier3("a"))]),
+        Comment.createEndOfLineComment(EMPTY_TOKEN_LIST),
+        [AstFactory.annotation(AstFactory.identifier3("a"))],
         AstFactory.identifier3("C"));
     _assertReplace(
         node,
@@ -4043,10 +4019,9 @@
 
   void test_enumDeclaration() {
     EnumDeclaration node = AstFactory.enumDeclaration2("E", ["ONE", "TWO"]);
-    node.documentationComment =
-        Comment.createEndOfLineComment(new List<Token>(0));
-    node.metadata =
-        AstFactory.list([AstFactory.annotation(AstFactory.identifier3("a"))]);
+    node.documentationComment
+        = Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
+    node.metadata = [AstFactory.annotation(AstFactory.identifier3("a"))];
     _assertReplace(node, new Getter_NodeReplacerTest_test_enumDeclaration());
     _testAnnotatedNode(node);
   }
@@ -4055,9 +4030,8 @@
     ExportDirective node =
         AstFactory.exportDirective2("", [AstFactory.hideCombinator2(["C"])]);
     node.documentationComment =
-        Comment.createEndOfLineComment(new List<Token>(0));
-    node.metadata =
-        AstFactory.list([AstFactory.annotation(AstFactory.identifier3("a"))]);
+        Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
+    node.metadata = [AstFactory.annotation(AstFactory.identifier3("a"))];
     _testNamespaceDirective(node);
   }
 
@@ -4079,7 +4053,7 @@
 
   void test_extendsClause() {
     ExtendsClause node =
-        AstFactory.extendsClause(AstFactory.typeName4("S", []));
+        AstFactory.extendsClause(AstFactory.typeName4("S"));
     _assertReplace(node, new Getter_NodeReplacerTest_test_extendsClause());
   }
 
@@ -4087,12 +4061,11 @@
     FieldDeclaration node = AstFactory.fieldDeclaration(
         false,
         null,
-        AstFactory.typeName4("C", []),
+        AstFactory.typeName4("C"),
         [AstFactory.variableDeclaration("c")]);
     node.documentationComment =
-        Comment.createEndOfLineComment(new List<Token>(0));
-    node.metadata =
-        AstFactory.list([AstFactory.annotation(AstFactory.identifier3("a"))]);
+        Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
+    node.metadata = [AstFactory.annotation(AstFactory.identifier3("a"))];
     _assertReplace(node, new Getter_NodeReplacerTest_test_fieldDeclaration());
     _testAnnotatedNode(node);
   }
@@ -4100,13 +4073,12 @@
   void test_fieldFormalParameter() {
     FieldFormalParameter node = AstFactory.fieldFormalParameter(
         null,
-        AstFactory.typeName4("C", []),
+        AstFactory.typeName4("C"),
         "f",
-        AstFactory.formalParameterList([]));
+        AstFactory.formalParameterList());
     node.documentationComment =
-        Comment.createEndOfLineComment(new List<Token>(0));
-    node.metadata =
-        AstFactory.list([AstFactory.annotation(AstFactory.identifier3("a"))]);
+        Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
+    node.metadata = [AstFactory.annotation(AstFactory.identifier3("a"))];
     _assertReplace(
         node,
         new Getter_NodeReplacerTest_test_fieldFormalParameter_2());
@@ -4120,7 +4092,7 @@
     ForEachStatement node = AstFactory.forEachStatement2(
         AstFactory.identifier3("i"),
         AstFactory.identifier3("l"),
-        AstFactory.block([]));
+        AstFactory.block());
     _assertReplace(
         node,
         new Getter_NodeReplacerTest_test_forEachStatement_withIdentifier_2());
@@ -4136,7 +4108,7 @@
     ForEachStatement node = AstFactory.forEachStatement(
         AstFactory.declaredIdentifier3("e"),
         AstFactory.identifier3("l"),
-        AstFactory.block([]));
+        AstFactory.block());
     _assertReplace(
         node,
         new Getter_NodeReplacerTest_test_forEachStatement_withLoopVariable_2());
@@ -4152,8 +4124,8 @@
     ForStatement node = AstFactory.forStatement(
         AstFactory.identifier3("a"),
         AstFactory.booleanLiteral(true),
-        AstFactory.list([AstFactory.integer(0)]),
-        AstFactory.block([]));
+        [AstFactory.integer(0)],
+        AstFactory.block());
     _assertReplace(
         node,
         new Getter_NodeReplacerTest_test_forStatement_withInitialization_3());
@@ -4174,8 +4146,8 @@
             null,
             [AstFactory.variableDeclaration("i")]),
         AstFactory.booleanLiteral(true),
-        AstFactory.list([AstFactory.integer(0)]),
-        AstFactory.block([]));
+        [AstFactory.integer(0)],
+        AstFactory.block());
     _assertReplace(
         node,
         new Getter_NodeReplacerTest_test_forStatement_withVariables_2());
@@ -4200,16 +4172,15 @@
 
   void test_functionDeclaration() {
     FunctionDeclaration node = AstFactory.functionDeclaration(
-        AstFactory.typeName4("R", []),
+        AstFactory.typeName4("R"),
         null,
         "f",
         AstFactory.functionExpression2(
-            AstFactory.formalParameterList([]),
-            AstFactory.blockFunctionBody(AstFactory.block([]))));
+            AstFactory.formalParameterList(),
+            AstFactory.blockFunctionBody(AstFactory.block())));
     node.documentationComment =
-        Comment.createEndOfLineComment(new List<Token>(0));
-    node.metadata =
-        AstFactory.list([AstFactory.annotation(AstFactory.identifier3("a"))]);
+        Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
+    node.metadata = [AstFactory.annotation(AstFactory.identifier3("a"))];
     _assertReplace(
         node,
         new Getter_NodeReplacerTest_test_functionDeclaration());
@@ -4224,12 +4195,12 @@
 
   void test_functionDeclarationStatement() {
     FunctionDeclarationStatement node = AstFactory.functionDeclarationStatement(
-        AstFactory.typeName4("R", []),
+        AstFactory.typeName4("R"),
         null,
         "f",
         AstFactory.functionExpression2(
-            AstFactory.formalParameterList([]),
-            AstFactory.blockFunctionBody(AstFactory.block([]))));
+            AstFactory.formalParameterList(),
+            AstFactory.blockFunctionBody(AstFactory.block())));
     _assertReplace(
         node,
         new Getter_NodeReplacerTest_test_functionDeclarationStatement());
@@ -4237,8 +4208,8 @@
 
   void test_functionExpression() {
     FunctionExpression node = AstFactory.functionExpression2(
-        AstFactory.formalParameterList([]),
-        AstFactory.blockFunctionBody(AstFactory.block([])));
+        AstFactory.formalParameterList(),
+        AstFactory.blockFunctionBody(AstFactory.block()));
     _assertReplace(node, new Getter_NodeReplacerTest_test_functionExpression());
     _assertReplace(
         node,
@@ -4259,14 +4230,13 @@
 
   void test_functionTypeAlias() {
     FunctionTypeAlias node = AstFactory.typeAlias(
-        AstFactory.typeName4("R", []),
+        AstFactory.typeName4("R"),
         "F",
         AstFactory.typeParameterList(["E"]),
-        AstFactory.formalParameterList([]));
+        AstFactory.formalParameterList());
     node.documentationComment =
-        Comment.createEndOfLineComment(new List<Token>(0));
-    node.metadata =
-        AstFactory.list([AstFactory.annotation(AstFactory.identifier3("a"))]);
+        Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
+    node.metadata = [AstFactory.annotation(AstFactory.identifier3("a"))];
     _assertReplace(
         node,
         new Getter_NodeReplacerTest_test_functionTypeAlias_3());
@@ -4282,13 +4252,12 @@
 
   void test_functionTypedFormalParameter() {
     FunctionTypedFormalParameter node = AstFactory.functionTypedFormalParameter(
-        AstFactory.typeName4("R", []),
+        AstFactory.typeName4("R"),
         "f",
         [AstFactory.simpleFormalParameter3("p")]);
     node.documentationComment =
-        Comment.createEndOfLineComment(new List<Token>(0));
-    node.metadata =
-        AstFactory.list([AstFactory.annotation(AstFactory.identifier3("a"))]);
+        Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
+    node.metadata = [AstFactory.annotation(AstFactory.identifier3("a"))];
     _assertReplace(
         node,
         new Getter_NodeReplacerTest_test_functionTypedFormalParameter());
@@ -4308,8 +4277,8 @@
   void test_ifStatement() {
     IfStatement node = AstFactory.ifStatement2(
         AstFactory.booleanLiteral(true),
-        AstFactory.block([]),
-        AstFactory.block([]));
+        AstFactory.block(),
+        AstFactory.block());
     _assertReplace(node, new Getter_NodeReplacerTest_test_ifStatement());
     _assertReplace(node, new Getter_NodeReplacerTest_test_ifStatement_3());
     _assertReplace(node, new Getter_NodeReplacerTest_test_ifStatement_2());
@@ -4317,7 +4286,7 @@
 
   void test_implementsClause() {
     ImplementsClause node = AstFactory.implementsClause(
-        [AstFactory.typeName4("I", []), AstFactory.typeName4("J", [])]);
+        [AstFactory.typeName4("I"), AstFactory.typeName4("J")]);
     _assertReplace(
         node,
         new ListGetter_NodeReplacerTest_test_implementsClause(0));
@@ -4329,9 +4298,8 @@
         "p",
         [AstFactory.showCombinator2(["A"]), AstFactory.hideCombinator2(["B"])]);
     node.documentationComment =
-        Comment.createEndOfLineComment(new List<Token>(0));
-    node.metadata =
-        AstFactory.list([AstFactory.annotation(AstFactory.identifier3("a"))]);
+        Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
+    node.metadata = [AstFactory.annotation(AstFactory.identifier3("a"))];
     _assertReplace(node, new Getter_NodeReplacerTest_test_importDirective());
     _testNamespaceDirective(node);
   }
@@ -4347,7 +4315,7 @@
   void test_instanceCreationExpression() {
     InstanceCreationExpression node = AstFactory.instanceCreationExpression3(
         null,
-        AstFactory.typeName4("C", []),
+        AstFactory.typeName4("C"),
         "c",
         [AstFactory.integer(2)]);
     _assertReplace(
@@ -4369,7 +4337,7 @@
     IsExpression node = AstFactory.isExpression(
         AstFactory.identifier3("v"),
         false,
-        AstFactory.typeName4("T", []));
+        AstFactory.typeName4("T"));
     _assertReplace(node, new Getter_NodeReplacerTest_test_isExpression());
     _assertReplace(node, new Getter_NodeReplacerTest_test_isExpression_2());
   }
@@ -4381,8 +4349,8 @@
 
   void test_labeledStatement() {
     LabeledStatement node = AstFactory.labeledStatement(
-        AstFactory.list([AstFactory.label2("l")]),
-        AstFactory.block([]));
+        [AstFactory.label2("l")],
+        AstFactory.block());
     _assertReplace(
         node,
         new ListGetter_NodeReplacerTest_test_labeledStatement(0));
@@ -4392,9 +4360,8 @@
   void test_libraryDirective() {
     LibraryDirective node = AstFactory.libraryDirective2("lib");
     node.documentationComment =
-        Comment.createEndOfLineComment(new List<Token>(0));
-    node.metadata =
-        AstFactory.list([AstFactory.annotation(AstFactory.identifier3("a"))]);
+        Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
+    node.metadata = [AstFactory.annotation(AstFactory.identifier3("a"))];
     _assertReplace(node, new Getter_NodeReplacerTest_test_libraryDirective());
     _testAnnotatedNode(node);
   }
@@ -4409,7 +4376,7 @@
   void test_listLiteral() {
     ListLiteral node = AstFactory.listLiteral2(
         null,
-        AstFactory.typeArgumentList([AstFactory.typeName4("E", [])]),
+        AstFactory.typeArgumentList([AstFactory.typeName4("E")]),
         [AstFactory.identifier3("e")]);
     _assertReplace(node, new ListGetter_NodeReplacerTest_test_listLiteral(0));
     _testTypedLiteral(node);
@@ -4418,7 +4385,7 @@
   void test_mapLiteral() {
     MapLiteral node = AstFactory.mapLiteral(
         null,
-        AstFactory.typeArgumentList([AstFactory.typeName4("E", [])]),
+        AstFactory.typeArgumentList([AstFactory.typeName4("E")]),
         [AstFactory.mapLiteralEntry("k", AstFactory.identifier3("v"))]);
     _assertReplace(node, new ListGetter_NodeReplacerTest_test_mapLiteral(0));
     _testTypedLiteral(node);
@@ -4434,16 +4401,15 @@
   void test_methodDeclaration() {
     MethodDeclaration node = AstFactory.methodDeclaration2(
         null,
-        AstFactory.typeName4("A", []),
+        AstFactory.typeName4("A"),
         null,
         null,
         AstFactory.identifier3("m"),
-        AstFactory.formalParameterList([]),
-        AstFactory.blockFunctionBody(AstFactory.block([])));
+        AstFactory.formalParameterList(),
+        AstFactory.blockFunctionBody(AstFactory.block()));
     node.documentationComment =
-        Comment.createEndOfLineComment(new List<Token>(0));
-    node.metadata =
-        AstFactory.list([AstFactory.annotation(AstFactory.identifier3("a"))]);
+        Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
+    node.metadata = [AstFactory.annotation(AstFactory.identifier3("a"))];
     _assertReplace(node, new Getter_NodeReplacerTest_test_methodDeclaration());
     _assertReplace(
         node,
@@ -4495,9 +4461,8 @@
   void test_partDirective() {
     PartDirective node = AstFactory.partDirective2("");
     node.documentationComment =
-        Comment.createEndOfLineComment(new List<Token>(0));
-    node.metadata =
-        AstFactory.list([AstFactory.annotation(AstFactory.identifier3("a"))]);
+        Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
+    node.metadata = [AstFactory.annotation(AstFactory.identifier3("a"))];
     _testUriBasedDirective(node);
   }
 
@@ -4505,9 +4470,8 @@
     PartOfDirective node =
         AstFactory.partOfDirective(AstFactory.libraryIdentifier2(["lib"]));
     node.documentationComment =
-        Comment.createEndOfLineComment(new List<Token>(0));
-    node.metadata =
-        AstFactory.list([AstFactory.annotation(AstFactory.identifier3("a"))]);
+        Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
+    node.metadata = [AstFactory.annotation(AstFactory.identifier3("a"))];
     _assertReplace(node, new Getter_NodeReplacerTest_test_partOfDirective());
     _testAnnotatedNode(node);
   }
@@ -4565,11 +4529,10 @@
 
   void test_simpleFormalParameter() {
     SimpleFormalParameter node =
-        AstFactory.simpleFormalParameter4(AstFactory.typeName4("T", []), "p");
+        AstFactory.simpleFormalParameter4(AstFactory.typeName4("T"), "p");
     node.documentationComment =
-        Comment.createEndOfLineComment(new List<Token>(0));
-    node.metadata =
-        AstFactory.list([AstFactory.annotation(AstFactory.identifier3("a"))]);
+        Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
+    node.metadata = [AstFactory.annotation(AstFactory.identifier3("a"))];
     _assertReplace(
         node,
         new Getter_NodeReplacerTest_test_simpleFormalParameter());
@@ -4597,17 +4560,17 @@
 
   void test_switchCase() {
     SwitchCase node = AstFactory.switchCase2(
-        AstFactory.list([AstFactory.label2("l")]),
+        [AstFactory.label2("l")],
         AstFactory.integer(0),
-        [AstFactory.block([])]);
+        [AstFactory.block()]);
     _assertReplace(node, new Getter_NodeReplacerTest_test_switchCase());
     _testSwitchMember(node);
   }
 
   void test_switchDefault() {
     SwitchDefault node = AstFactory.switchDefault(
-        AstFactory.list([AstFactory.label2("l")]),
-        [AstFactory.block([])]);
+        [AstFactory.label2("l")],
+        [AstFactory.block()]);
     _testSwitchMember(node);
   }
 
@@ -4616,12 +4579,12 @@
         AstFactory.identifier3("x"),
         [
             AstFactory.switchCase2(
-                AstFactory.list([AstFactory.label2("l")]),
+                [AstFactory.label2("l")],
                 AstFactory.integer(0),
-                [AstFactory.block([])]),
+                [AstFactory.block()]),
             AstFactory.switchDefault(
-                AstFactory.list([AstFactory.label2("l")]),
-                [AstFactory.block([])])]);
+                [AstFactory.label2("l")],
+                [AstFactory.block()])]);
     _assertReplace(node, new Getter_NodeReplacerTest_test_switchStatement());
     _assertReplace(
         node,
@@ -4637,12 +4600,11 @@
   void test_topLevelVariableDeclaration() {
     TopLevelVariableDeclaration node = AstFactory.topLevelVariableDeclaration(
         null,
-        AstFactory.typeName4("T", []),
+        AstFactory.typeName4("T"),
         [AstFactory.variableDeclaration("t")]);
     node.documentationComment =
-        Comment.createEndOfLineComment(new List<Token>(0));
-    node.metadata =
-        AstFactory.list([AstFactory.annotation(AstFactory.identifier3("a"))]);
+        Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
+    node.metadata = [AstFactory.annotation(AstFactory.identifier3("a"))];
     _assertReplace(
         node,
         new Getter_NodeReplacerTest_test_topLevelVariableDeclaration());
@@ -4651,9 +4613,9 @@
 
   void test_tryStatement() {
     TryStatement node = AstFactory.tryStatement3(
-        AstFactory.block([]),
-        AstFactory.list([AstFactory.catchClause("e", [AstFactory.block([])])]),
-        AstFactory.block([]));
+        AstFactory.block(),
+        [AstFactory.catchClause("e", [AstFactory.block()])],
+        AstFactory.block());
     _assertReplace(node, new Getter_NodeReplacerTest_test_tryStatement_2());
     _assertReplace(node, new Getter_NodeReplacerTest_test_tryStatement());
     _assertReplace(node, new ListGetter_NodeReplacerTest_test_tryStatement(0));
@@ -4661,7 +4623,7 @@
 
   void test_typeArgumentList() {
     TypeArgumentList node =
-        AstFactory.typeArgumentList([AstFactory.typeName4("A", [])]);
+        AstFactory.typeArgumentList([AstFactory.typeName4("A")]);
     _assertReplace(
         node,
         new ListGetter_NodeReplacerTest_test_typeArgumentList(0));
@@ -4670,14 +4632,14 @@
   void test_typeName() {
     TypeName node = AstFactory.typeName4(
         "T",
-        [AstFactory.typeName4("E", []), AstFactory.typeName4("F", [])]);
+        [AstFactory.typeName4("E"), AstFactory.typeName4("F")]);
     _assertReplace(node, new Getter_NodeReplacerTest_test_typeName_2());
     _assertReplace(node, new Getter_NodeReplacerTest_test_typeName());
   }
 
   void test_typeParameter() {
     TypeParameter node =
-        AstFactory.typeParameter2("E", AstFactory.typeName4("B", []));
+        AstFactory.typeParameter2("E", AstFactory.typeName4("B"));
     _assertReplace(node, new Getter_NodeReplacerTest_test_typeParameter_2());
     _assertReplace(node, new Getter_NodeReplacerTest_test_typeParameter());
   }
@@ -4693,9 +4655,8 @@
     VariableDeclaration node =
         AstFactory.variableDeclaration2("a", AstFactory.nullLiteral());
     node.documentationComment =
-        Comment.createEndOfLineComment(new List<Token>(0));
-    node.metadata =
-        AstFactory.list([AstFactory.annotation(AstFactory.identifier3("a"))]);
+        Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
+    node.metadata = [AstFactory.annotation(AstFactory.identifier3("a"))];
     _assertReplace(
         node,
         new Getter_NodeReplacerTest_test_variableDeclaration());
@@ -4708,7 +4669,7 @@
   void test_variableDeclarationList() {
     VariableDeclarationList node = AstFactory.variableDeclarationList(
         null,
-        AstFactory.typeName4("T", []),
+        AstFactory.typeName4("T"),
         [AstFactory.variableDeclaration("a")]);
     _assertReplace(
         node,
@@ -4721,7 +4682,7 @@
   void test_variableDeclarationStatement() {
     VariableDeclarationStatement node = AstFactory.variableDeclarationStatement(
         null,
-        AstFactory.typeName4("T", []),
+        AstFactory.typeName4("T"),
         [AstFactory.variableDeclaration("a")]);
     _assertReplace(
         node,
@@ -4731,13 +4692,13 @@
   void test_whileStatement() {
     WhileStatement node = AstFactory.whileStatement(
         AstFactory.booleanLiteral(true),
-        AstFactory.block([]));
+        AstFactory.block());
     _assertReplace(node, new Getter_NodeReplacerTest_test_whileStatement());
     _assertReplace(node, new Getter_NodeReplacerTest_test_whileStatement_2());
   }
 
   void test_withClause() {
-    WithClause node = AstFactory.withClause([AstFactory.typeName4("M", [])]);
+    WithClause node = AstFactory.withClause([AstFactory.typeName4("M")]);
     _assertReplace(node, new ListGetter_NodeReplacerTest_test_withClause(0));
   }
 
diff --git a/pkg/analyzer2dart/bin/analyzer2dart.dart b/pkg/analyzer2dart/bin/analyzer2dart.dart
index 0d6df5f..9f372c1 100644
--- a/pkg/analyzer2dart/bin/analyzer2dart.dart
+++ b/pkg/analyzer2dart/bin/analyzer2dart.dart
@@ -12,7 +12,7 @@
 import 'package:analyzer/src/generated/sdk.dart';
 import 'package:analyzer/src/generated/sdk_io.dart';
 import 'package:analyzer/src/generated/source_io.dart';
-import 'package:compiler/implementation/source_file_provider.dart';
+import 'package:compiler/src/source_file_provider.dart';
 
 import '../lib/src/closed_world.dart';
 import '../lib/src/driver.dart';
diff --git a/pkg/analyzer2dart/lib/src/converted_world.dart b/pkg/analyzer2dart/lib/src/converted_world.dart
index 842997a..ba6d8ce 100644
--- a/pkg/analyzer2dart/lib/src/converted_world.dart
+++ b/pkg/analyzer2dart/lib/src/converted_world.dart
@@ -7,9 +7,9 @@
 import 'dart:collection';
 
 import 'package:analyzer/analyzer.dart';
-import 'package:compiler/implementation/elements/elements.dart' as dart2js;
+import 'package:compiler/src/elements/elements.dart' as dart2js;
 import 'package:analyzer/src/generated/element.dart' as analyzer;
-import 'package:compiler/implementation/cps_ir/cps_ir_nodes.dart' as ir;
+import 'package:compiler/src/cps_ir/cps_ir_nodes.dart' as ir;
 
 import 'closed_world.dart';
 import 'element_converter.dart';
diff --git a/pkg/analyzer2dart/lib/src/cps_generator.dart b/pkg/analyzer2dart/lib/src/cps_generator.dart
index ffeea64..c9326f2 100644
--- a/pkg/analyzer2dart/lib/src/cps_generator.dart
+++ b/pkg/analyzer2dart/lib/src/cps_generator.dart
@@ -6,16 +6,16 @@
 

 import 'package:analyzer/analyzer.dart';

 

-import 'package:compiler/implementation/dart_types.dart' as dart2js;

-import 'package:compiler/implementation/elements/elements.dart' as dart2js;

+import 'package:compiler/src/dart_types.dart' as dart2js;

+import 'package:compiler/src/elements/elements.dart' as dart2js;

 import 'package:analyzer/src/generated/source.dart';

 import 'package:analyzer/src/generated/element.dart' as analyzer;

 

-import 'package:compiler/implementation/dart2jslib.dart'

+import 'package:compiler/src/dart2jslib.dart'

     show DART_CONSTANT_SYSTEM;

-import 'package:compiler/implementation/cps_ir/cps_ir_nodes.dart' as ir;

-import 'package:compiler/implementation/cps_ir/cps_ir_builder.dart';

-import 'package:compiler/implementation/universe/universe.dart';

+import 'package:compiler/src/cps_ir/cps_ir_nodes.dart' as ir;

+import 'package:compiler/src/cps_ir/cps_ir_builder.dart';

+import 'package:compiler/src/universe/universe.dart';

 

 import 'semantic_visitor.dart';

 import 'element_converter.dart';

@@ -36,8 +36,13 @@
   ir.Node visit(AstNode node) => node.accept(this);

 

   @override

-  ir.FunctionDefinition visitFunctionDeclaration(FunctionDeclaration node) {

-    analyzer.FunctionElement function = node.element;

+  ir.Primitive visitFunctionExpression(FunctionExpression node) {

+    return irBuilder.buildFunctionExpression(

+        handleFunctionDeclaration(node.element, node));

+  }

+

+  ir.FunctionDefinition handleFunctionDeclaration(

+      analyzer.FunctionElement function, FunctionExpression node) {

     dart2js.FunctionElement element = converter.convertElement(function);

     return withBuilder(

         new IrBuilder(DART_CONSTANT_SYSTEM,

@@ -52,15 +57,30 @@
       });

       // Visit the body directly to avoid processing the signature as

       // expressions.

-      visit(node.functionExpression.body);

+      visit(node.body);

       return irBuilder.buildFunctionDefinition(element, const []);

     });

   }

 

-  List<ir.Definition> visitArguments(ArgumentList argumentList) {

-    List<ir.Definition> arguments = <ir.Definition>[];

+  @override

+  ir.FunctionDefinition visitFunctionDeclaration(FunctionDeclaration node) {

+    return handleFunctionDeclaration(node.element, node.functionExpression);

+  }

+

+  @override

+  visitFunctionDeclarationStatement(FunctionDeclarationStatement node) {

+    FunctionDeclaration functionDeclaration = node.functionDeclaration;

+    analyzer.FunctionElement function = functionDeclaration.element;

+    dart2js.FunctionElement element = converter.convertElement(function);

+    ir.FunctionDefinition definition = handleFunctionDeclaration(

+        function, functionDeclaration.functionExpression);

+    irBuilder.declareLocalFunction(element, definition);

+  }

+

+  List<ir.Primitive> visitArguments(ArgumentList argumentList) {

+    List<ir.Primitive> arguments = <ir.Primitive>[];

     for (Expression argument in argumentList.arguments) {

-      ir.Definition value = build(argument);

+      ir.Primitive value = build(argument);

       if (value == null) {

         giveUp(argument,

             'Unsupported argument: $argument (${argument.runtimeType}).');

@@ -81,7 +101,7 @@
                                       AccessSemantics semantics) {

     // TODO(johnniwinther): Handle implicit `this`.

     ir.Primitive receiver = build(semantics.target);

-    List<ir.Definition> arguments = visitArguments(node.argumentList);

+    List<ir.Primitive> arguments = visitArguments(node.argumentList);

     return irBuilder.buildDynamicInvocation(

         receiver,

         createSelectorFromMethodInvocation(

@@ -94,7 +114,7 @@
                                            AccessSemantics semantics) {

     analyzer.Element staticElement = semantics.element;

     dart2js.Element element = converter.convertElement(staticElement);

-    List<ir.Definition> arguments = visitArguments(node.argumentList);

+    List<ir.Primitive> arguments = visitArguments(node.argumentList);

     return irBuilder.buildStaticInvocation(

         element,

         createSelectorFromMethodInvocation(

@@ -103,13 +123,53 @@
   }

 

   @override

+  ir.Node visitLocalFunctionAccess(AstNode node, AccessSemantics semantics) {

+    return handleLocalAccess(node, semantics);

+  }

+

+  ir.Primitive handleLocalInvocation(MethodInvocation node,

+                                     AccessSemantics semantics) {

+    analyzer.Element staticElement = semantics.element;

+    dart2js.Element element = converter.convertElement(staticElement);

+    List<ir.Definition> arguments = visitArguments(node.argumentList);

+    return irBuilder.buildLocalInvocation(

+      element,

+      createSelectorFromMethodInvocation(

+          node.argumentList, node.methodName.name),

+      arguments);

+  }

+

+  @override

+  ir.Node visitLocalVariableInvocation(MethodInvocation node,

+                                       AccessSemantics semantics) {

+    return handleLocalInvocation(node, semantics);

+  }

+

+  @override

+  ir.Primitive visitLocalFunctionInvocation(MethodInvocation node,

+                                            AccessSemantics semantics) {

+    return handleLocalInvocation(node, semantics);

+  }

+

+  @override

+  ir.Primitive visitFunctionExpressionInvocation(

+      FunctionExpressionInvocation node) {

+    ir.Primitive target = build(node.function);

+    List<ir.Definition> arguments = visitArguments(node.argumentList);

+    return irBuilder.buildFunctionExpressionInvocation(

+        target,

+        createSelectorFromMethodInvocation(node.argumentList, 'call'),

+        arguments);

+  }

+

+  @override

   ir.Primitive visitInstanceCreationExpression(

       InstanceCreationExpression node) {

     analyzer.Element staticElement = node.staticElement;

     if (staticElement != null) {

       dart2js.Element element = converter.convertElement(staticElement);

       dart2js.DartType type = converter.convertType(node.staticType);

-      List<ir.Definition> arguments = visitArguments(node.argumentList);

+      List<ir.Primitive> arguments = visitArguments(node.argumentList);

       String name = '';

       if (node.constructorName.name != null) {

         name = node.constructorName.name.name;

@@ -258,7 +318,7 @@
     ir.Primitive right = build(node.rightOperand);

     Selector selector = new Selector.binaryOperator(op);

     return irBuilder.buildDynamicInvocation(

-        left, selector, <ir.Definition>[right]);

+        left, selector, <ir.Primitive>[right]);

   }

 

   ir.Node handleLazyOperator(BinaryExpression node, {bool isLazyOr: false}) {

@@ -324,7 +384,7 @@
         build);

   }

 

-  @override
+  @override

   visitForStatement(ForStatement node) {

     // TODO(johnniwinther): Support `for` as a jump target.

     SubbuildFunction buildInitializer;

diff --git a/pkg/analyzer2dart/lib/src/dart_backend.dart b/pkg/analyzer2dart/lib/src/dart_backend.dart
index ab0f644..4b226f3 100644
--- a/pkg/analyzer2dart/lib/src/dart_backend.dart
+++ b/pkg/analyzer2dart/lib/src/dart_backend.dart
@@ -4,9 +4,9 @@
 
 library analyzer2dart.dart_backend;
 
-import 'package:compiler/implementation/elements/elements.dart';
-import 'package:compiler/implementation/dart_backend/dart_backend.dart';
-import 'package:compiler/implementation/dart2jslib.dart';
+import 'package:compiler/src/elements/elements.dart';
+import 'package:compiler/src/dart_backend/dart_backend.dart';
+import 'package:compiler/src/dart2jslib.dart';
 
 import 'driver.dart';
 import 'converted_world.dart';
diff --git a/pkg/analyzer2dart/lib/src/element_converter.dart b/pkg/analyzer2dart/lib/src/element_converter.dart
index e6400c3..b3ce83e 100644
--- a/pkg/analyzer2dart/lib/src/element_converter.dart
+++ b/pkg/analyzer2dart/lib/src/element_converter.dart
@@ -7,10 +7,10 @@
 
 library analyzer2dart.element_converter;
 
-import 'package:compiler/implementation/elements/elements.dart' as dart2js;
-import 'package:compiler/implementation/elements/modelx.dart' as modelx;
-import 'package:compiler/implementation/util/util.dart' as util;
-import 'package:compiler/implementation/dart_types.dart' as dart2js;
+import 'package:compiler/src/elements/elements.dart' as dart2js;
+import 'package:compiler/src/elements/modelx.dart' as modelx;
+import 'package:compiler/src/util/util.dart' as util;
+import 'package:compiler/src/dart_types.dart' as dart2js;
 import 'package:analyzer/src/generated/element.dart' as analyzer;
 
 part 'modely.dart';
@@ -113,7 +113,11 @@
 
   @override
   dart2js.FunctionElement visitFunctionElement(analyzer.FunctionElement input) {
-    return new TopLevelFunctionElementY(converter, input);
+    if (input.isStatic) {
+      return new TopLevelFunctionElementY(converter, input);
+    } else {
+      return new LocalFunctionElementY(converter, input);
+    }
   }
 
   @override
diff --git a/pkg/analyzer2dart/lib/src/identifier_semantics.dart b/pkg/analyzer2dart/lib/src/identifier_semantics.dart
index 026e00a..d78a939 100644
--- a/pkg/analyzer2dart/lib/src/identifier_semantics.dart
+++ b/pkg/analyzer2dart/lib/src/identifier_semantics.dart
@@ -58,6 +58,19 @@
   static const AccessKind STATIC_PROPERTY =
       const AccessKind._('STATIC_PROPERTY');
 
+  /**
+   * The destination of the access is a toplevel class, function typedef, mixin
+   * application, or the built-in type "dynamic".
+   */
+  static const AccessKind TOPLEVEL_TYPE =
+      const AccessKind._('TOPLEVEL_TYPE');
+
+  /**
+   * The destination of the access is a type parameter of the enclosing class.
+   */
+  static const AccessKind TYPE_PARAMETER =
+      const AccessKind._('TYPE_PARAMETER');
+
   final String name;
 
   String toString() => name;
@@ -91,8 +104,9 @@
   /**
    * The class containing the element being accessed, if this is a static
    * reference to an element in a class.  This will be null if [kind] is
-   * DYNAMIC, LOCAL_FUNCTION, LOCAL_VARIABLE, or PARAMETER, or if the element
-   * being accessed is defined at toplevel within a library.
+   * DYNAMIC, LOCAL_FUNCTION, LOCAL_VARIABLE, PARAMETER, TOPLEVEL_CLASS, or
+   * TYPE_PARAMETER, or if the element being accessed is defined at toplevel
+   * within a library.
    *
    * Note: it is possible for [classElement] to be non-null and for [element]
    * to be null; for example this occurs if the element being accessed is a
@@ -154,6 +168,18 @@
       : kind = AccessKind.STATIC_PROPERTY,
         target = null;
 
+  AccessSemantics.toplevelType(this.identifier, this.element)
+      : kind = AccessKind.TOPLEVEL_TYPE,
+        classElement = null,
+        isInvoke = false,
+        target = null;
+
+  AccessSemantics.typeParameter(this.identifier, this.element)
+      : kind = AccessKind.TYPE_PARAMETER,
+        classElement = null,
+        isInvoke = false,
+        target = null;
+
   /**
    * True if this is a read access to a property, or a method tear-off.  Note
    * that both [isRead] and [isWrite] will be true in the case of a
@@ -354,6 +380,9 @@
         }
       } else if (rhsElement is FunctionElement) {
         return new AccessSemantics.staticMethod(rhs, rhsElement, null);
+      } else if (rhsElement is ClassElement ||
+          rhsElement is FunctionTypeAliasElement) {
+        return new AccessSemantics.toplevelType(rhs, rhsElement);
       } else {
         return new AccessSemantics.dynamic(rhs, null);
       }
@@ -402,13 +431,7 @@
       return null;
     }
     if (parent is TypeName) {
-      // TODO(paulberry): handle this case.  Or, perhaps it would be better to
-      // require clients not to visit the children of a TypeName when visiting
-      // the AST structure.
-      //
-      // TODO(paulberry): be sure to consider type literals, e.g.:
-      //   class A {}
-      //   var a = A;
+      // TODO(paulberry): do we need to handle this case?
       return null;
     }
     if ((parent is PropertyAccess && parent.propertyName == node) ||
@@ -457,6 +480,12 @@
           node,
           staticElement,
           staticElement.enclosingElement);
+    } else if (staticElement is TypeParameterElement) {
+      return new AccessSemantics.typeParameter(node, staticElement);
+    } else if (staticElement is ClassElement ||
+        staticElement is FunctionTypeAliasElement ||
+        staticElement is DynamicElementImpl) {
+      return new AccessSemantics.toplevelType(node, staticElement);
     }
     return new AccessSemantics.dynamic(node, null);
   }
diff --git a/pkg/analyzer2dart/lib/src/modely.dart b/pkg/analyzer2dart/lib/src/modely.dart
index 4f89848..23a8391 100644
--- a/pkg/analyzer2dart/lib/src/modely.dart
+++ b/pkg/analyzer2dart/lib/src/modely.dart
@@ -385,6 +385,31 @@
       : super(converter, element);

 }

 

+class LocalFunctionElementY extends ElementY

+    with AnalyzableElementY,

+         AstElementY,

+         LocalElementMixin,

+         FunctionElementMixin

+    implements dart2js.LocalFunctionElement {

+  analyzer.FunctionElement get element => super.element;

+

+  @override

+  dart2js.ElementKind get kind => dart2js.ElementKind.FUNCTION;

+

+  @override

+  dart2js.FunctionType get type => converter.convertType(element.type);

+

+  @override

+  bool get isAbstract => false;

+

+  @override

+  bool get isConst => false;

+

+  LocalFunctionElementY(ElementConverter converter,

+                        analyzer.FunctionElement element)

+      : super(converter, element);

+}

+

 class ParameterElementY extends ElementY

     with AnalyzableElementY, AstElementY

     implements dart2js.ParameterElement {

@@ -503,7 +528,7 @@
   void forEachClassMember(f) => unsupported('forEachClassMember');

 

   @override

-  void forEachInstanceField(f, {includeSuperAndInjectedMembers}) {

+  void forEachInstanceField(f, {includeSuperAndInjectedMembers: false}) {

     unsupported('forEachInstanceField');

   }

 

@@ -515,7 +540,8 @@
 

   @override

   void forEachMember(f,

-                     {includeBackendMembers, includeSuperAndInjectedMembers}) {

+                     {includeBackendMembers: false,

+                      includeSuperAndInjectedMembers: false}) {

     unsupported('forEachMember');

   }

 

@@ -620,6 +646,9 @@
   validateConstructorLookupResults(selector,  result, noMatch) {

     unsupported('validateConstructorLookupResults');

   }

+

+  @override

+  bool get isEnumClass => unsupported('isEnum');

 }

 

 class TypedefElementY extends TypeDeclarationElementY

@@ -674,8 +703,27 @@
   get nestedClosures => unsupported('nestedClosures');

 }

 

+abstract class LocalElementMixin implements ElementY, dart2js.LocalElement {

+

+  @override

+  bool get isLocal => true;

+

+  @override

+  bool get isStatic => false;

+

+  @override

+  get executableContext => unsupported('executableContext');

+

+  // TODO(johnniwinther): Ensure the correct semantics of this.

+  @override

+  bool get isFactoryConstructor => false;

+}

+

 class LocalVariableElementY extends ElementY

-    with AnalyzableElementY, AstElementY, VariableElementMixin

+    with AnalyzableElementY,

+         AstElementY,

+         LocalElementMixin,

+         VariableElementMixin

     implements dart2js.LocalVariableElement {

 

   analyzer.LocalVariableElement get element => super.element;

@@ -683,22 +731,13 @@
   dart2js.ElementKind get kind => dart2js.ElementKind.VARIABLE;

 

   @override

-  bool get isLocal => true;

-

-  @override

   bool get isConst => element.isConst;

 

-  @override

-  bool get isStatic => false;

-

   LocalVariableElementY(ElementConverter converter,

                         analyzer.LocalVariableElement element)

       : super(converter, element);

 

   @override

-  get executableContext => unsupported('executableContext');

-

-  @override

   dart2js.DartType get type => unsupported('type');

 }

 

diff --git a/pkg/analyzer2dart/lib/src/semantic_visitor.dart b/pkg/analyzer2dart/lib/src/semantic_visitor.dart
index d53051c..2e1c170 100644
--- a/pkg/analyzer2dart/lib/src/semantic_visitor.dart
+++ b/pkg/analyzer2dart/lib/src/semantic_visitor.dart
@@ -164,6 +164,14 @@
     return giveUp(node, 'visitStaticPropertyAccess of $semantics');

   }

 

+  R visitToplevelClassAccess(AstNode node, AccessSemantics semantics) {

+    return giveUp(node, 'visitToplevelClassAccess of $semantics');

+  }

+

+  R visitTypeParameterAccess(AstNode node, AccessSemantics semantics) {

+    return giveUp(node, 'visitTypeParameterAccess of $semantics');

+  }

+

   R _handlePropertyAccess(AstNode node, AccessSemantics semantics) {

     switch (semantics.kind) {

       case AccessKind.DYNAMIC:

@@ -180,6 +188,10 @@
         return visitStaticMethodAccess(node, semantics);

       case AccessKind.STATIC_PROPERTY:

         return visitStaticPropertyAccess(node, semantics);

+      case AccessKind.TOPLEVEL_TYPE:

+        return visitToplevelClassAccess(node, semantics);

+      case AccessKind.TYPE_PARAMETER:

+        return visitTypeParameterAccess(node, semantics);

       default:

         // Unexpected access kind.

         return giveUp(node,

diff --git a/pkg/analyzer2dart/lib/src/tree_shaker.dart b/pkg/analyzer2dart/lib/src/tree_shaker.dart
index bc69438..f3fe74f 100644
--- a/pkg/analyzer2dart/lib/src/tree_shaker.dart
+++ b/pkg/analyzer2dart/lib/src/tree_shaker.dart
@@ -9,7 +9,7 @@
 import 'package:analyzer/analyzer.dart';
 import 'package:analyzer/src/generated/element.dart';
 import 'package:analyzer/src/generated/source.dart';
-import 'package:compiler/implementation/universe/universe.dart';
+import 'package:compiler/src/universe/universe.dart';
 
 import 'closed_world.dart';
 import 'util.dart';
diff --git a/pkg/analyzer2dart/lib/src/util.dart b/pkg/analyzer2dart/lib/src/util.dart
index c7fe801..18d0a86 100644
--- a/pkg/analyzer2dart/lib/src/util.dart
+++ b/pkg/analyzer2dart/lib/src/util.dart
@@ -8,8 +8,8 @@
 

 import 'package:analyzer/analyzer.dart';

 import 'package:analyzer/src/generated/source.dart';

-import 'package:compiler/implementation/universe/universe.dart';

-import 'package:compiler/implementation/source_file.dart';

+import 'package:compiler/src/universe/universe.dart';

+import 'package:compiler/src/source_file.dart';

 

 Selector createSelectorFromMethodInvocation(ArgumentList node,

                                             String name) {

diff --git a/pkg/analyzer2dart/test/driver_test.dart b/pkg/analyzer2dart/test/driver_test.dart
index fc221ae..5807714 100644
--- a/pkg/analyzer2dart/test/driver_test.dart
+++ b/pkg/analyzer2dart/test/driver_test.dart
@@ -8,7 +8,7 @@
 import 'package:analyzer/src/generated/element.dart';
 import 'package:analyzer/src/generated/sdk.dart';
 import 'package:analyzer/src/generated/source.dart';
-import 'package:compiler/implementation/dart2jslib.dart' show NullSink;
+import 'package:compiler/src/dart2jslib.dart' show NullSink;
 import 'package:unittest/unittest.dart';
 
 import '../lib/src/closed_world.dart';
diff --git a/pkg/analyzer2dart/test/end2end_data.dart b/pkg/analyzer2dart/test/end2end_data.dart
index 6237402..0d380d1 100644
--- a/pkg/analyzer2dart/test/end2end_data.dart
+++ b/pkg/analyzer2dart/test/end2end_data.dart
@@ -736,4 +736,54 @@
 }
 '''),
   ]),
+
+  const Group('Local functions', const <TestSpec>[
+    const TestSpec('''
+main(a) {
+  local() {}
+  return local();
+}
+''', '''
+main(a) {
+  return (() {})();
+}
+'''),
+
+  const TestSpec('''
+main(a) {
+  local() {}
+  var l = local;
+  return l();
+}
+''', '''
+main(a) {
+  return (() {})();
+}
+'''),
+
+  const TestSpec('''
+main(a) {
+  return () {}();
+}
+''', '''
+main(a) {
+  return (() {})();
+}
+'''),
+
+  const TestSpec('''
+main(a) {
+  var c = a ? () { return 0; } : () { return 1; }
+  return c();
+}
+''', '''
+main(a) {
+  return (a ? () {
+    return 0;
+  } : () {
+    return 1;
+  })();
+}
+'''),
+  ]),
 ];
diff --git a/pkg/analyzer2dart/test/identifier_semantics_test.dart b/pkg/analyzer2dart/test/identifier_semantics_test.dart
index b9a3044..f157625 100644
--- a/pkg/analyzer2dart/test/identifier_semantics_test.dart
+++ b/pkg/analyzer2dart/test/identifier_semantics_test.dart
@@ -1092,6 +1092,94 @@
     helper.checkDynamic('h().x', 'h()', 'x', isRead: true);
   });
 
+  test('Get class defined at top level', () {
+    Helper helper = new Helper('''
+class A {}
+var t = A;
+''');
+    helper.checkTypeReference('A', 'A', AccessKind.TOPLEVEL_TYPE);
+  });
+
+  test('Get class defined at top level via prefix', () {
+    Helper helper = new Helper('''
+import 'lib.dart' as l;
+
+var t = l.A;
+''');
+    helper.addFile('/lib.dart', '''
+library lib;
+
+class A;
+''');
+    helper.checkTypeReference('l.A', 'A', AccessKind.TOPLEVEL_TYPE);
+  });
+
+  test('Get dynamic type', () {
+    Helper helper = new Helper('''
+var t = dynamic;
+''');
+    helper.checkTypeReference('dynamic', 'dynamic', AccessKind.TOPLEVEL_TYPE);
+  });
+
+  test('Get function typedef defined at top level', () {
+    Helper helper = new Helper('''
+typedef F();
+var t = F;
+''');
+    helper.checkTypeReference('F', 'F', AccessKind.TOPLEVEL_TYPE);
+  });
+
+  test('Get function typedef defined at top level via prefix', () {
+    Helper helper = new Helper('''
+import 'lib.dart' as l;
+
+var t = l.F;
+''');
+    helper.addFile('/lib.dart', '''
+library lib;
+
+typedef F();
+''');
+    helper.checkTypeReference('l.F', 'F', AccessKind.TOPLEVEL_TYPE);
+  });
+
+  test('Get mixin application defined at top level', () {
+    Helper helper = new Helper('''
+class A {}
+class B {}
+class C = A with B;
+var t = C;
+''');
+    helper.checkTypeReference('C', 'C', AccessKind.TOPLEVEL_TYPE);
+  });
+
+  test('Get mixin application defined at top level via prefix', () {
+    Helper helper = new Helper('''
+import 'lib.dart' as l;
+
+var t = l.C;
+''');
+    helper.addFile('/lib.dart', '''
+library lib;
+
+class A;
+class B;
+class C = A with B;
+''');
+    helper.checkTypeReference('l.C', 'C', AccessKind.TOPLEVEL_TYPE);
+  });
+
+  test('Get type parameter of enclosing class', () {
+    Helper helper = new Helper('''
+class A<T, U> {
+  f() {
+    var t = U;
+  }
+}
+''');
+    helper.checkTypeReference('U', 'U', AccessKind.TYPE_PARAMETER);
+  });
+
   test('Set variable defined at top level', () {
     Helper helper = new Helper('''
 var x;
@@ -2225,6 +2313,29 @@
     libraryElement.unit.accept(visitor);
     expect(count, equals(1));
   }
+
+  /**
+   * Verify that the node represented by [expectedSource] is classified as a
+   * reference to a toplevel class or a type parameter.
+   */
+  void checkTypeReference(
+      String expectedSource, String expectedName, AccessKind expectedKind) {
+    TestVisitor visitor = new TestVisitor();
+    int count = 0;
+    visitor.onAccess = (AstNode node, AccessSemantics semantics) {
+      count++;
+      expect(node.toSource(), equals(expectedSource));
+      expect(semantics.kind, equals(expectedKind));
+      expect(semantics.element.name, equals(expectedName));
+      expect(semantics.classElement, isNull);
+      expect(semantics.target, isNull);
+      expect(semantics.isRead, isTrue);
+      expect(semantics.isWrite, isFalse);
+      expect(semantics.isInvoke, isFalse);
+    };
+    libraryElement.unit.accept(visitor);
+    expect(count, equals(1));
+  }
 }
 
 typedef void AccessHandler(Expression node, AccessSemantics semantics);
diff --git a/pkg/analyzer2dart/test/sexpr_data.dart b/pkg/analyzer2dart/test/sexpr_data.dart
index 049760f..963b781 100644
--- a/pkg/analyzer2dart/test/sexpr_data.dart
+++ b/pkg/analyzer2dart/test/sexpr_data.dart
@@ -1201,4 +1201,80 @@
   (InvokeMethod a iterator  k0))
 '''),
   ]),
+
+  const Group('Local functions', const <TestSpec>[
+    const TestSpec('''
+main(a) {
+  local() {}
+  return local();
+}
+''', '''
+(FunctionDefinition main (a return)
+  (LetPrim v0 (CreateFunction
+    (FunctionDefinition local ( return)
+      (LetPrim v1 (Constant NullConstant))
+      (InvokeContinuation return v1))))
+  (LetCont (k0 v2)
+    (InvokeContinuation return v2))
+  (InvokeMethod v0 call  k0))
+'''),
+
+  const TestSpec('''
+main(a) {
+  local() {}
+  var l = local;
+  return l();
+}
+''', '''
+(FunctionDefinition main (a return)
+  (LetPrim v0 (CreateFunction
+    (FunctionDefinition local ( return)
+      (LetPrim v1 (Constant NullConstant))
+      (InvokeContinuation return v1))))
+  (LetCont (k0 v2)
+    (InvokeContinuation return v2))
+  (InvokeMethod v0 call  k0))
+'''),
+
+  const TestSpec('''
+main(a) {
+  return () {}();
+}
+''', '''
+(FunctionDefinition main (a return)
+  (LetPrim v0 (CreateFunction
+    (FunctionDefinition  ( return)
+      (LetPrim v1 (Constant NullConstant))
+      (InvokeContinuation return v1))))
+  (LetCont (k0 v2)
+    (InvokeContinuation return v2))
+  (InvokeMethod v0 call  k0))
+'''),
+
+  const TestSpec('''
+main(a) {
+  var c = a ? () { return 0; } : () { return 1; }
+  return c();
+}
+''', '''
+(FunctionDefinition main (a return)
+  (LetCont (k0 v0)
+    (LetCont (k1 v1)
+      (InvokeContinuation return v1))
+    (InvokeMethod v0 call  k1))
+  (LetCont (k2)
+    (LetPrim v2 (CreateFunction
+      (FunctionDefinition  ( return)
+        (LetPrim v3 (Constant IntConstant(0)))
+        (InvokeContinuation return v3))))
+    (InvokeContinuation k0 v2))
+  (LetCont (k3)
+    (LetPrim v4 (CreateFunction
+      (FunctionDefinition  ( return)
+        (LetPrim v5 (Constant IntConstant(1)))
+        (InvokeContinuation return v5))))
+    (InvokeContinuation k0 v4))
+  (Branch (IsTrue a) k2 k3))
+'''),
+  ]),
 ];
diff --git a/pkg/analyzer2dart/test/sexpr_test.dart b/pkg/analyzer2dart/test/sexpr_test.dart
index c8a6fbf..74dd8ac 100644
--- a/pkg/analyzer2dart/test/sexpr_test.dart
+++ b/pkg/analyzer2dart/test/sexpr_test.dart
@@ -9,7 +9,7 @@
 import 'package:analyzer/src/generated/element.dart';
 import 'package:analyzer/src/generated/sdk.dart';
 import 'package:analyzer/src/generated/source.dart';
-import 'package:compiler/implementation/cps_ir/cps_ir_nodes_sexpr.dart';
+import 'package:compiler/src/cps_ir/cps_ir_nodes_sexpr.dart';
 import 'package:unittest/unittest.dart';
 
 import '../lib/src/closed_world.dart';
diff --git a/pkg/analyzer2dart/test/tree_shaker_test.dart b/pkg/analyzer2dart/test/tree_shaker_test.dart
index 2e0bb3c..9ba20c7 100644
--- a/pkg/analyzer2dart/test/tree_shaker_test.dart
+++ b/pkg/analyzer2dart/test/tree_shaker_test.dart
@@ -8,7 +8,7 @@
 import 'package:analyzer/src/generated/element.dart';
 import 'package:analyzer/src/generated/sdk.dart';
 import 'package:analyzer/src/generated/source.dart';
-import 'package:compiler/implementation/dart2jslib.dart' show NullSink;
+import 'package:compiler/src/dart2jslib.dart' show NullSink;
 import 'package:unittest/unittest.dart';
 
 import '../lib/src/closed_world.dart';
diff --git a/sdk/lib/_internal/compiler/compiler.dart b/pkg/compiler/lib/compiler.dart
similarity index 98%
rename from sdk/lib/_internal/compiler/compiler.dart
rename to pkg/compiler/lib/compiler.dart
index b79ab22..82b8c3b 100644
--- a/sdk/lib/_internal/compiler/compiler.dart
+++ b/pkg/compiler/lib/compiler.dart
@@ -5,7 +5,7 @@
 library compiler;
 
 import 'dart:async';
-import 'implementation/apiimpl.dart';
+import 'src/apiimpl.dart';
 
 // Unless explicitly allowed, passing [:null:] for any argument to the
 // methods of library will result in an Error being thrown.
diff --git a/sdk/lib/_internal/compiler/implementation/README.txt b/pkg/compiler/lib/src/README.txt
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/README.txt
rename to pkg/compiler/lib/src/README.txt
diff --git a/sdk/lib/_internal/compiler/implementation/apiimpl.dart b/pkg/compiler/lib/src/apiimpl.dart
similarity index 98%
rename from sdk/lib/_internal/compiler/implementation/apiimpl.dart
rename to pkg/compiler/lib/src/apiimpl.dart
index fdabf68..734bba3 100644
--- a/sdk/lib/_internal/compiler/implementation/apiimpl.dart
+++ b/pkg/compiler/lib/src/apiimpl.dart
@@ -10,7 +10,7 @@
 import 'dart2jslib.dart' as leg;
 import 'tree/tree.dart' as tree;
 import 'elements/elements.dart' as elements;
-import '../../libraries.dart';
+import 'package:_internal/libraries.dart';
 import 'source_file.dart';
 
 const bool forceIncrementalSupport =
@@ -44,6 +44,8 @@
             enableUserAssertions: hasOption(options, '--enable-checked-mode'),
             trustTypeAnnotations:
                 hasOption(options, '--trust-type-annotations'),
+            trustPrimitives:
+                hasOption(options, '--trust-primitives'),
             enableMinification: hasOption(options, '--minify'),
             preserveUris: hasOption(options, '--preserve-uris'),
             enableNativeLiveTypeAnalysis:
@@ -78,7 +80,8 @@
                 forceIncrementalSupport ||
                 hasOption(options, '--incremental-support'),
             suppressWarnings: hasOption(options, '--suppress-warnings'),
-            enableAsyncAwait: hasOption(options, '--enable-async')) {
+            enableAsyncAwait: hasOption(options, '--enable-async'),
+            enableEnums: hasOption(options, '--enable-enum')) {
     tasks.addAll([
         userHandlerTask = new leg.GenericTask('Diagnostic handler', this),
         userProviderTask = new leg.GenericTask('Input provider', this),
diff --git a/sdk/lib/_internal/compiler/implementation/cache_strategy.dart b/pkg/compiler/lib/src/cache_strategy.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/cache_strategy.dart
rename to pkg/compiler/lib/src/cache_strategy.dart
diff --git a/sdk/lib/_internal/compiler/implementation/closure.dart b/pkg/compiler/lib/src/closure.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/closure.dart
rename to pkg/compiler/lib/src/closure.dart
diff --git a/sdk/lib/_internal/compiler/implementation/code_buffer.dart b/pkg/compiler/lib/src/code_buffer.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/code_buffer.dart
rename to pkg/compiler/lib/src/code_buffer.dart
diff --git a/sdk/lib/_internal/compiler/implementation/colors.dart b/pkg/compiler/lib/src/colors.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/colors.dart
rename to pkg/compiler/lib/src/colors.dart
diff --git a/sdk/lib/_internal/compiler/implementation/common.dart b/pkg/compiler/lib/src/common.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/common.dart
rename to pkg/compiler/lib/src/common.dart
diff --git a/sdk/lib/_internal/compiler/implementation/compile_time_constants.dart b/pkg/compiler/lib/src/compile_time_constants.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/compile_time_constants.dart
rename to pkg/compiler/lib/src/compile_time_constants.dart
diff --git a/sdk/lib/_internal/compiler/implementation/compiler.dart b/pkg/compiler/lib/src/compiler.dart
similarity index 99%
rename from sdk/lib/_internal/compiler/implementation/compiler.dart
rename to pkg/compiler/lib/src/compiler.dart
index fad4298..c60a44c 100644
--- a/sdk/lib/_internal/compiler/implementation/compiler.dart
+++ b/pkg/compiler/lib/src/compiler.dart
@@ -652,6 +652,7 @@
   final bool enableTypeAssertions;
   final bool enableUserAssertions;
   final bool trustTypeAnnotations;
+  final bool trustPrimitives;
   final bool enableConcreteTypeInference;
   final bool disableTypeInferenceFlag;
   final bool dumpInfo;
@@ -721,6 +722,9 @@
   /// `true` if async/await features are supported.
   final bool enableAsyncAwait;
 
+  /// `true` if enum declarations are supported.
+  final bool enableEnums;
+
   /// If `true`, some values are cached for reuse in incremental compilation.
   /// Incremental compilation is basically calling [run] more than once.
   final bool hasIncrementalSupport;
@@ -940,6 +944,7 @@
   Compiler({this.enableTypeAssertions: false,
             this.enableUserAssertions: false,
             this.trustTypeAnnotations: false,
+            this.trustPrimitives: false,
             this.enableConcreteTypeInference: false,
             bool disableTypeInferenceFlag: false,
             this.maxConcreteTypeSize: 5,
@@ -965,6 +970,7 @@
             this.suppressWarnings: false,
             bool hasIncrementalSupport: false,
             this.enableAsyncAwait: false,
+            this.enableEnums: false,
             api.CompilerOutputProvider outputProvider,
             List<String> strips: const []})
       : this.disableTypeInferenceFlag =
diff --git a/sdk/lib/_internal/compiler/implementation/constant_system.dart b/pkg/compiler/lib/src/constant_system.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/constant_system.dart
rename to pkg/compiler/lib/src/constant_system.dart
diff --git a/sdk/lib/_internal/compiler/implementation/constant_system_dart.dart b/pkg/compiler/lib/src/constant_system_dart.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/constant_system_dart.dart
rename to pkg/compiler/lib/src/constant_system_dart.dart
diff --git a/sdk/lib/_internal/compiler/implementation/constants/expressions.dart b/pkg/compiler/lib/src/constants/expressions.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/constants/expressions.dart
rename to pkg/compiler/lib/src/constants/expressions.dart
diff --git a/sdk/lib/_internal/compiler/implementation/constants/values.dart b/pkg/compiler/lib/src/constants/values.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/constants/values.dart
rename to pkg/compiler/lib/src/constants/values.dart
diff --git a/sdk/lib/_internal/compiler/implementation/cps_ir/constant_propagation.dart b/pkg/compiler/lib/src/cps_ir/constant_propagation.dart
similarity index 98%
rename from sdk/lib/_internal/compiler/implementation/cps_ir/constant_propagation.dart
rename to pkg/compiler/lib/src/cps_ir/constant_propagation.dart
index 985cd27..fc9ebba 100644
--- a/sdk/lib/_internal/compiler/implementation/cps_ir/constant_propagation.dart
+++ b/pkg/compiler/lib/src/cps_ir/constant_propagation.dart
@@ -83,7 +83,7 @@
     Constant constant = new Constant(constExp);
     LetPrim letPrim = new LetPrim(constant);
     InvokeContinuation invoke =
-        new InvokeContinuation(continuation, <Definition>[constant]);
+        new InvokeContinuation(continuation, <Primitive>[constant]);
 
     invoke.parent = constant.parent = letPrim;
     letPrim.body = invoke;
@@ -124,7 +124,7 @@
 
     assert(successor.parameters.isEmpty);
     InvokeContinuation invoke =
-        new InvokeContinuation(successor, <Definition>[]);
+        new InvokeContinuation(successor, <Primitive>[]);
 
     InteriorNode parent = node.parent;
     invoke.parent = parent;
diff --git a/sdk/lib/_internal/compiler/implementation/cps_ir/cps_ir_builder.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart
similarity index 94%
rename from sdk/lib/_internal/compiler/implementation/cps_ir/cps_ir_builder.dart
rename to pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart
index d1605c8..538bddf 100644
--- a/sdk/lib/_internal/compiler/implementation/cps_ir/cps_ir_builder.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart
@@ -306,9 +306,6 @@
 
   /// Add [variableElement] to the environment with [initialValue] as its
   /// initial value.
-  ///
-  /// [isClosureVariable] marks whether [variableElement] is accessed from an
-  /// inner function.
   void declareLocalVariable(LocalVariableElement variableElement,
                             {ir.Primitive initialValue}) {
     assert(isOpen);
@@ -329,6 +326,20 @@
     }
   }
 
+  /// Add [functionElement] to the environment with provided [definition].
+  void declareLocalFunction(LocalFunctionElement functionElement,
+                            ir.FunctionDefinition definition) {
+    assert(isOpen);
+    if (isClosureVariable(functionElement)) {
+      add(new ir.DeclareFunction(functionElement, definition));
+    } else {
+      ir.CreateFunction prim = new ir.CreateFunction(definition);
+      add(new ir.LetPrim(prim));
+      environment.extend(functionElement, prim);
+      prim.useElementAsHint(functionElement);
+    }
+  }
+
   // Plug an expression into the 'hole' in the context being accumulated.  The
   // empty context (just a hole) is represented by root (and current) being
   // null.  Since the hole in the current context is filled by this function,
@@ -353,14 +364,14 @@
 
   ir.Primitive _buildInvokeStatic(Element element,
                                   Selector selector,
-                                  List<ir.Definition> arguments) {
+                                  List<ir.Primitive> arguments) {
     assert(isOpen);
     return _continueWithExpression(
         (k) => new ir.InvokeStatic(element, selector, k, arguments));
   }
 
   ir.Primitive _buildInvokeSuper(Selector selector,
-                                 List<ir.Definition> arguments) {
+                                 List<ir.Primitive> arguments) {
     assert(isOpen);
     return _continueWithExpression(
         (k) => new ir.InvokeSuperMethod(selector, k, arguments));
@@ -368,12 +379,21 @@
 
   ir.Primitive _buildInvokeDynamic(ir.Primitive receiver,
                                    Selector selector,
-                                   List<ir.Definition> arguments) {
+                                   List<ir.Primitive> arguments) {
     assert(isOpen);
     return _continueWithExpression(
         (k) => new ir.InvokeMethod(receiver, selector, k, arguments));
   }
 
+  ir.Primitive _buildInvokeCall(ir.Primitive target,
+                                 Selector selector,
+                                 List<ir.Definition> arguments) {
+    Selector callSelector = new Selector.callClosure(
+        selector.argumentCount,
+        selector.namedArguments);
+    return _buildInvokeDynamic(target, callSelector, arguments);
+  }
+
 
   /// Create a constant literal from [constant].
   ir.Constant buildConstantLiteral(ConstantExpression constant) {
@@ -494,6 +514,13 @@
 
   }
 
+  /// Create a function expression from [definition].
+  ir.Primitive buildFunctionExpression(ir.FunctionDefinition definition) {
+    ir.CreateFunction prim = new ir.CreateFunction(definition);
+    add(new ir.LetPrim(prim));
+    return prim;
+  }
+
   /**
    * Add an explicit `return null` for functions that don't have a return
    * statement on each branch. This includes functions with an empty body,
@@ -529,12 +556,11 @@
     }
   }
 
-
   /// Create a super invocation where the method name and the argument structure
   /// are defined by [selector] and the argument values are defined by
   /// [arguments].
   ir.Primitive buildSuperInvocation(Selector selector,
-                                    List<ir.Definition> arguments) {
+                                    List<ir.Primitive> arguments) {
     return _buildInvokeSuper(selector, arguments);
   }
 
@@ -542,14 +568,14 @@
   /// defined by [selector].
   ir.Primitive buildSuperGet(Selector selector) {
     assert(selector.isGetter);
-    return _buildInvokeSuper(selector, const <ir.Definition>[]);
+    return _buildInvokeSuper(selector, const <ir.Primitive>[]);
   }
 
   /// Create a setter invocation on the super class where the setter name and
   /// argument are defined by [selector] and [value], respectively.
   ir.Primitive buildSuperSet(Selector selector, ir.Primitive value) {
     assert(selector.isSetter);
-    _buildInvokeSuper(selector, <ir.Definition>[value]);
+    _buildInvokeSuper(selector, <ir.Primitive>[value]);
     return value;
   }
 
@@ -557,16 +583,16 @@
   /// [index] and [value].
   ir.Primitive buildSuperIndexSet(ir.Primitive index,
                                   ir.Primitive value) {
-    _buildInvokeSuper(new Selector.indexSet(), <ir.Definition>[index, value]);
+    _buildInvokeSuper(new Selector.indexSet(), <ir.Primitive>[index, value]);
     return value;
   }
 
   /// Create a dynamic invocation on [receiver] where the method name and
   /// argument structure are defined by [selector] and the argument values are
   /// defined by [arguments].
-  ir.Primitive buildDynamicInvocation(ir.Definition receiver,
+  ir.Primitive buildDynamicInvocation(ir.Primitive receiver,
                                       Selector selector,
-                                      List<ir.Definition> arguments) {
+                                      List<ir.Primitive> arguments) {
     return _buildInvokeDynamic(receiver, selector, arguments);
   }
 
@@ -574,7 +600,7 @@
   /// defined by [selector].
   ir.Primitive buildDynamicGet(ir.Primitive receiver, Selector selector) {
     assert(selector.isGetter);
-    return _buildInvokeDynamic(receiver, selector, const <ir.Definition>[]);
+    return _buildInvokeDynamic(receiver, selector, const <ir.Primitive>[]);
   }
 
   /// Create a dynamic setter invocation on [receiver] where the setter name and
@@ -583,7 +609,7 @@
                                Selector selector,
                                ir.Primitive value) {
     assert(selector.isSetter);
-    _buildInvokeDynamic(receiver, selector, <ir.Definition>[value]);
+    _buildInvokeDynamic(receiver, selector, <ir.Primitive>[value]);
     return value;
   }
 
@@ -593,7 +619,7 @@
                                      ir.Primitive index,
                                      ir.Primitive value) {
     _buildInvokeDynamic(
-        receiver, new Selector.indexSet(), <ir.Definition>[index, value]);
+        receiver, new Selector.indexSet(), <ir.Primitive>[index, value]);
     return value;
   }
 
@@ -601,7 +627,7 @@
   /// defined by [selector] and the argument values are defined by [arguments].
   ir.Primitive buildStaticInvocation(Element element,
                                      Selector selector,
-                                     List<ir.Definition> arguments) {
+                                     List<ir.Primitive> arguments) {
     return _buildInvokeStatic(element, selector, arguments);
   }
 
@@ -609,7 +635,7 @@
   /// defined by [selector].
   ir.Primitive buildStaticGet(Element element, Selector selector) {
     assert(selector.isGetter);
-    return _buildInvokeStatic(element, selector, const <ir.Definition>[]);
+    return _buildInvokeStatic(element, selector, const <ir.Primitive>[]);
   }
 
   /// Create a static setter invocation of [element] where the setter name and
@@ -618,7 +644,7 @@
                               Selector selector,
                               ir.Primitive value) {
     assert(selector.isSetter);
-    _buildInvokeStatic(element, selector, <ir.Definition>[value]);
+    _buildInvokeStatic(element, selector, <ir.Primitive>[value]);
     return value;
   }
 
@@ -628,14 +654,14 @@
   ir.Primitive buildConstructorInvocation(FunctionElement element,
                                           Selector selector,
                                           DartType type,
-                                          List<ir.Definition> arguments) {
+                                          List<ir.Primitive> arguments) {
     assert(isOpen);
     return _continueWithExpression(
         (k) => new ir.InvokeConstructor(type, element, selector, k, arguments));
   }
 
   /// Create a string concatenation of the [arguments].
-  ir.Primitive buildStringConcatenation(List<ir.Definition> arguments) {
+  ir.Primitive buildStringConcatenation(List<ir.Primitive> arguments) {
     assert(isOpen);
     return _continueWithExpression(
         (k) => new ir.ConcatenateStrings(k, arguments));
@@ -665,6 +691,31 @@
     return value;
   }
 
+  /// Create an invocation of [local] where the argument structure is defined
+  /// by [selector] and the argument values are defined by [arguments].
+  ir.Primitive buildLocalInvocation(LocalElement local,
+                                    Selector selector,
+                                    List<ir.Definition> arguments) {
+    ir.Primitive receiver;
+    if (isClosureVariable(local)) {
+      receiver = new ir.GetClosureVariable(local);
+      add(new ir.LetPrim(receiver));
+    } else {
+      receiver = environment.lookup(local);
+    }
+    return _buildInvokeCall(receiver, selector, arguments);
+  }
+
+  /// Create an invocation of the [functionExpression] where the argument
+  /// structure are defined by [selector] and the argument values are defined by
+  /// [arguments].
+  ir.Primitive buildFunctionExpressionInvocation(
+      ir.Primitive functionExpression,
+      Selector selector,
+      List<ir.Definition> arguments) {
+    return _buildInvokeCall(functionExpression, selector, arguments);
+  }
+
   /// Creates an if-then-else statement with the provided [condition] where the
   /// then and else branches are created through the [buildThenPart] and
   /// [buildElsePart] functions, respectively.
diff --git a/sdk/lib/_internal/compiler/implementation/cps_ir/cps_ir_builder_visitor.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_builder_visitor.dart
similarity index 92%
rename from sdk/lib/_internal/compiler/implementation/cps_ir/cps_ir_builder_visitor.dart
rename to pkg/compiler/lib/src/cps_ir/cps_ir_builder_visitor.dart
index 162c38a..b7ac48e 100644
--- a/sdk/lib/_internal/compiler/implementation/cps_ir/cps_ir_builder_visitor.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_builder_visitor.dart
@@ -240,9 +240,45 @@
 
   ir.Primitive visitLabeledStatement(ast.LabeledStatement node) {
     ast.Statement body = node.statement;
-    return body is ast.Loop
-        ? visit(body)
-        : giveup(node, 'labeled statement');
+    if (body is ast.Loop) return visit(body);
+    JumpTarget target = elements.getTargetDefinition(body);
+    JumpCollector jumps = new JumpCollector(target);
+    irBuilder.state.breakCollectors.add(jumps);
+    IrBuilder innerBuilder = new IrBuilder.delimited(irBuilder);
+    withBuilder(innerBuilder, () {
+      visit(body);
+    });
+    irBuilder.state.breakCollectors.removeLast();
+    bool hasBreaks = !jumps.isEmpty;
+    ir.Continuation joinContinuation;
+    if (hasBreaks) {
+      if (innerBuilder.isOpen) {
+        jumps.addJump(innerBuilder);
+      }
+
+      // All jumps to the break continuation must be in the scope of the
+      // continuation's binding.  The continuation is bound just outside the
+      // body to satisfy this property without extra analysis.
+      // As a consequence, the break continuation needs parameters for all
+      // local variables in scope at the exit from the body.
+      List<ir.Parameter> parameters =
+          new List<ir.Parameter>.generate(irBuilder.environment.length, (i) {
+        return new ir.Parameter(irBuilder.environment.index2variable[i]);
+      });
+      joinContinuation = new ir.Continuation(parameters);
+      irBuilder.invokeFullJoin(joinContinuation, jumps, recursive: false);
+      irBuilder.add(new ir.LetCont(joinContinuation, innerBuilder._root));
+      for (int i = 0; i < irBuilder.environment.length; ++i) {
+        irBuilder.environment.index2value[i] = parameters[i];
+      }
+    } else {
+      if (innerBuilder._root != null) {
+        irBuilder.add(innerBuilder._root);
+        irBuilder._current = innerBuilder._current;
+        irBuilder.environment = innerBuilder.environment;
+      }
+    }
+    return null;
   }
 
   visitWhile(ast.While node) {
@@ -431,35 +467,22 @@
     return visit(node.expression);
   }
 
-  ir.Primitive translateClosureCall(ir.Primitive receiver,
-                                    Selector closureSelector,
-                                    ast.NodeList arguments) {
-    Selector namedCallSelector = new Selector(closureSelector.kind,
-                     "call",
-                     closureSelector.library,
-                     closureSelector.argumentCount,
-                     closureSelector.namedArguments);
-    List<ir.Primitive> args = arguments.nodes.mapToList(visit, growable:false);
-    return irBuilder.buildDynamicInvocation(receiver, namedCallSelector, args);
-  }
-
   ir.Primitive visitClosureSend(ast.Send node) {
     assert(irBuilder.isOpen);
     Element element = elements[node];
-    ir.Primitive closureTarget;
-    if (element == null) {
-      closureTarget = visit(node.selector);
-    } else if (irBuilder.isClosureVariable(element)) {
-      LocalElement local = element;
-      closureTarget = new ir.GetClosureVariable(local);
-      irBuilder.add(new ir.LetPrim(closureTarget));
-    } else {
-      assert(Elements.isLocal(element));
-      closureTarget = irBuilder.environment.lookup(element);
-    }
     Selector closureSelector = elements.getSelector(node);
-    return translateClosureCall(closureTarget, closureSelector,
-        node.argumentsNode);
+    if (element == null) {
+      ir.Primitive closureTarget = visit(node.selector);
+      List<ir.Primitive> args =
+          node.arguments.mapToList(visit, growable:false);
+      return irBuilder.buildFunctionExpressionInvocation(
+          closureTarget, elements.getSelector(node), args);
+    } else {
+      List<ir.Primitive> args =
+          node.arguments.mapToList(visit, growable:false);
+      return irBuilder.buildLocalInvocation(
+          element, elements.getSelector(node), args);
+    }
   }
 
   /// If [node] is null, returns this.
@@ -611,8 +634,8 @@
     Selector selector = elements.getSelector(node);
 
     // TODO(lry): support default arguments, need support for locals.
-    List<ir.Definition> arguments = node.arguments.mapToList(visit,
-                                                             growable:false);
+    List<ir.Primitive> arguments =
+        node.arguments.mapToList(visit, growable:false);
     return irBuilder.buildStaticInvocation(element, selector, arguments);
   }
 
@@ -793,31 +816,17 @@
   }
 
   ir.FunctionDefinition makeSubFunction(ast.FunctionExpression node) {
-    // TODO(johnniwinther): Share the visitor.
-    return new IrBuilderVisitor(elements, compiler, sourceFile)
-           .buildFunctionInternal(elements[node]);
+    return buildFunctionInternal(elements[node]);
   }
 
   ir.Primitive visitFunctionExpression(ast.FunctionExpression node) {
-    FunctionElement element = elements[node];
-    ir.FunctionDefinition inner = makeSubFunction(node);
-    ir.CreateFunction prim = new ir.CreateFunction(inner);
-    irBuilder.add(new ir.LetPrim(prim));
-    return prim;
+    return irBuilder.buildFunctionExpression(makeSubFunction(node));
   }
 
-  ir.Primitive visitFunctionDeclaration(ast.FunctionDeclaration node) {
+  visitFunctionDeclaration(ast.FunctionDeclaration node) {
     LocalFunctionElement element = elements[node.function];
     ir.FunctionDefinition inner = makeSubFunction(node.function);
-    if (irBuilder.isClosureVariable(element)) {
-      irBuilder.add(new ir.DeclareFunction(element, inner));
-    } else {
-      ir.CreateFunction prim = new ir.CreateFunction(inner);
-      irBuilder.add(new ir.LetPrim(prim));
-      irBuilder.environment.extend(element, prim);
-      prim.useElementAsHint(element);
-    }
-    return null;
+    irBuilder.declareLocalFunction(element, inner);
   }
 
   static final String ABORT_IRNODE_BUILDER = "IrNode builder aborted";
diff --git a/sdk/lib/_internal/compiler/implementation/cps_ir/cps_ir_nodes.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart
similarity index 90%
rename from sdk/lib/_internal/compiler/implementation/cps_ir/cps_ir_nodes.dart
rename to pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart
index 4ea9beb..9ad19f0 100644
--- a/sdk/lib/_internal/compiler/implementation/cps_ir/cps_ir_nodes.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart
@@ -29,18 +29,18 @@
 
 /// The base class of things that variables can refer to: primitives,
 /// continuations, function and continuation parameters, etc.
-abstract class Definition extends Node {
+abstract class Definition<T extends Definition<T>> extends Node {
   // The head of a linked-list of occurrences, in no particular order.
-  Reference firstRef = null;
+  Reference<T> firstRef;
 
   bool get hasAtMostOneUse  => firstRef == null || firstRef.next == null;
   bool get hasExactlyOneUse => firstRef != null && firstRef.next == null;
   bool get hasAtLeastOneUse => firstRef != null;
   bool get hasMultipleUses  => !hasAtMostOneUse;
 
-  void substituteFor(Definition other) {
+  void substituteFor(Definition<T> other) {
     if (other.firstRef == null) return;
-    Reference previous, current = other.firstRef;
+    Reference<T> previous, current = other.firstRef;
     do {
       current.definition = this;
       previous = current;
@@ -58,7 +58,7 @@
 /// Primitives may allocate objects, this is not considered side-effect here.
 ///
 /// Although primitives may not mutate state, they may depend on state.
-abstract class Primitive extends Definition {
+abstract class Primitive extends Definition<Primitive> {
   /// The [VariableElement] or [ParameterElement] from which the primitive
   /// binding originated.
   Element hint;
@@ -80,10 +80,10 @@
 
 /// Operands to invocations and primitives are always variables.  They point to
 /// their definition and are doubly-linked into a list of occurrences.
-class Reference {
-  Definition definition;
-  Reference previous = null;
-  Reference next = null;
+class Reference<T extends Definition<T>> {
+  T definition;
+  Reference<T> previous;
+  Reference<T> next;
 
   /// A pointer to the parent node. Is null until set by optimization passes.
   Node parent;
@@ -146,7 +146,7 @@
 
 abstract class Invoke {
   Selector get selector;
-  List<Reference> get arguments;
+  List<Reference<Primitive>> get arguments;
 }
 
 /// Represents a node with a child node, which can be accessed through the
@@ -173,12 +173,12 @@
    */
   final Selector selector;
 
-  final Reference continuation;
-  final List<Reference> arguments;
+  final Reference<Continuation> continuation;
+  final List<Reference<Primitive>> arguments;
 
   InvokeStatic(this.target, this.selector, Continuation cont,
-               List<Definition> args)
-      : continuation = new Reference(cont),
+               List<Primitive> args)
+      : continuation = new Reference<Continuation>(cont),
         arguments = _referenceList(args) {
     assert(target is ErroneousElement || selector.name == target.name);
   }
@@ -189,17 +189,17 @@
 /// Invoke a method, operator, getter, setter, or index getter/setter.
 /// Converting a method to a function object is treated as a getter invocation.
 class InvokeMethod extends Expression implements Invoke {
-  final Reference receiver;
+  final Reference<Primitive> receiver;
   final Selector selector;
-  final Reference continuation;
-  final List<Reference> arguments;
+  final Reference<Continuation> continuation;
+  final List<Reference<Primitive>> arguments;
 
-  InvokeMethod(Definition receiver,
+  InvokeMethod(Primitive receiver,
                this.selector,
                Continuation cont,
-               List<Definition> args)
-      : receiver = new Reference(receiver),
-        continuation = new Reference(cont),
+               List<Primitive> args)
+      : receiver = new Reference<Primitive>(receiver),
+        continuation = new Reference<Continuation>(cont),
         arguments = _referenceList(args) {
     assert(selector != null);
     assert(selector.kind == SelectorKind.CALL ||
@@ -217,13 +217,13 @@
 /// super class in tail position.
 class InvokeSuperMethod extends Expression implements Invoke {
   final Selector selector;
-  final Reference continuation;
-  final List<Reference> arguments;
+  final Reference<Continuation> continuation;
+  final List<Reference<Primitive>> arguments;
 
   InvokeSuperMethod(this.selector,
                     Continuation cont,
-                    List<Definition> args)
-      : continuation = new Reference(cont),
+                    List<Primitive> args)
+      : continuation = new Reference<Continuation>(cont),
         arguments = _referenceList(args) {
     assert(selector != null);
     assert(selector.kind == SelectorKind.CALL ||
@@ -242,8 +242,8 @@
 class InvokeConstructor extends Expression implements Invoke {
   final DartType type;
   final FunctionElement target;
-  final Reference continuation;
-  final List<Reference> arguments;
+  final Reference<Continuation> continuation;
+  final List<Reference<Primitive>> arguments;
   final Selector selector;
 
   /// The class being instantiated. This is the same as `target.enclosingClass`
@@ -257,8 +257,8 @@
                     this.target,
                     this.selector,
                     Continuation cont,
-                    List<Definition> args)
-      : continuation = new Reference(cont),
+                    List<Primitive> args)
+      : continuation = new Reference<Continuation>(cont),
         arguments = _referenceList(args) {
     assert(dart2js.invariant(target,
         target.isErroneous || target.isConstructor,
@@ -280,9 +280,9 @@
 // But then we need to special-case for is-checks with an erroneous .type as
 // these will throw.
 class TypeOperator extends Expression {
-  final Reference receiver;
+  final Reference<Primitive> receiver;
   final DartType type;
-  final Reference continuation;
+  final Reference<Continuation> continuation;
   // TODO(johnniwinther): Use `Operator` class to encapsule the operator type.
   final bool isTypeTest;
 
@@ -290,8 +290,8 @@
                this.type,
                Continuation cont,
                {bool this.isTypeTest})
-      : this.receiver = new Reference(receiver),
-        this.continuation = new Reference(cont) {
+      : this.receiver = new Reference<Primitive>(receiver),
+        this.continuation = new Reference<Continuation>(cont) {
     assert(isTypeTest != null);
   }
 
@@ -302,11 +302,11 @@
 
 /// Invoke [toString] on each argument and concatenate the results.
 class ConcatenateStrings extends Expression {
-  final Reference continuation;
-  final List<Reference> arguments;
+  final Reference<Continuation> continuation;
+  final List<Reference<Primitive>> arguments;
 
-  ConcatenateStrings(Continuation cont, List<Definition> args)
-      : continuation = new Reference(cont),
+  ConcatenateStrings(Continuation cont, List<Primitive> args)
+      : continuation = new Reference<Continuation>(cont),
         arguments = _referenceList(args);
 
   accept(Visitor visitor) => visitor.visitConcatenateStrings(this);
@@ -346,7 +346,7 @@
 /// declared at the entry to the [variable]'s enclosing function.
 class SetClosureVariable extends Expression implements InteriorNode {
   final Local variable;
-  final Reference value;
+  final Reference<Primitive> value;
   Expression body;
 
   /// If true, this declares a new copy of the closure variable. If so, all
@@ -359,7 +359,7 @@
 
   SetClosureVariable(this.variable, Primitive value,
                      {this.isDeclaration : false })
-      : this.value = new Reference(value) {
+      : this.value = new Reference<Primitive>(value) {
     assert(variable != null);
   }
 
@@ -396,16 +396,16 @@
 
 /// Invoke a continuation in tail position.
 class InvokeContinuation extends Expression {
-  Reference continuation;
-  List<Reference> arguments;
+  Reference<Continuation> continuation;
+  List<Reference<Primitive>> arguments;
 
   // An invocation of a continuation is recursive if it occurs in the body of
   // the continuation itself.
   bool isRecursive;
 
-  InvokeContinuation(Continuation cont, List<Definition> args,
+  InvokeContinuation(Continuation cont, List<Primitive> args,
                      {recursive: false})
-      : continuation = new Reference(cont),
+      : continuation = new Reference<Continuation>(cont),
         arguments = _referenceList(args),
         isRecursive = recursive {
     assert(cont.parameters == null ||
@@ -431,9 +431,9 @@
 }
 
 class IsTrue extends Condition {
-  final Reference value;
+  final Reference<Primitive> value;
 
-  IsTrue(Definition val) : value = new Reference(val);
+  IsTrue(Primitive val) : value = new Reference<Primitive>(val);
 
   accept(Visitor visitor) => visitor.visitIsTrue(this);
 }
@@ -441,12 +441,12 @@
 /// Choose between a pair of continuations based on a condition value.
 class Branch extends Expression {
   final Condition condition;
-  final Reference trueContinuation;
-  final Reference falseContinuation;
+  final Reference<Continuation> trueContinuation;
+  final Reference<Continuation> falseContinuation;
 
   Branch(this.condition, Continuation trueCont, Continuation falseCont)
-      : trueContinuation = new Reference(trueCont),
-        falseContinuation = new Reference(falseCont);
+      : trueContinuation = new Reference<Continuation>(trueCont),
+        falseContinuation = new Reference<Continuation>(falseCont);
 
   accept(Visitor visitor) => visitor.visitBranch(this);
 }
@@ -482,7 +482,7 @@
 class LiteralList extends Primitive {
   /// The List type being created; this is not the type argument.
   final GenericType type;
-  final List<Reference> values;
+  final List<Reference<Primitive>> values;
 
   LiteralList(this.type, Iterable<Primitive> values)
       : this.values = _referenceList(values);
@@ -491,12 +491,12 @@
 }
 
 class LiteralMapEntry {
-  final Reference key;
-  final Reference value;
+  final Reference<Primitive> key;
+  final Reference<Primitive> value;
 
   LiteralMapEntry(Primitive key, Primitive value)
-      : this.key = new Reference(key),
-        this.value = new Reference(value);
+      : this.key = new Reference<Primitive>(key),
+        this.value = new Reference<Primitive>(value);
 }
 
 class LiteralMap extends Primitive {
@@ -528,7 +528,7 @@
 /// Continuations are normally bound by 'let cont'.  A continuation with one
 /// parameter and no body is used to represent a function's return continuation.
 /// The return continuation is bound by the Function, not by 'let cont'.
-class Continuation extends Definition implements InteriorNode {
+class Continuation extends Definition<Continuation> implements InteriorNode {
   final List<Parameter> parameters;
   Expression body = null;
 
@@ -575,8 +575,8 @@
   bool get isAbstract => body == null;
 }
 
-List<Reference> _referenceList(Iterable<Definition> definitions) {
-  return definitions.map((e) => new Reference(e)).toList();
+List<Reference<Primitive>> _referenceList(Iterable<Primitive> definitions) {
+  return definitions.map((e) => new Reference<Primitive>(e)).toList();
 }
 
 abstract class Visitor<T> {
diff --git a/sdk/lib/_internal/compiler/implementation/cps_ir/cps_ir_nodes_sexpr.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/cps_ir/cps_ir_nodes_sexpr.dart
rename to pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart
diff --git a/sdk/lib/_internal/compiler/implementation/cps_ir/cps_ir_tracer.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart
similarity index 98%
rename from sdk/lib/_internal/compiler/implementation/cps_ir/cps_ir_tracer.dart
rename to pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart
index 5c69e59..cf21ad4 100644
--- a/sdk/lib/_internal/compiler/implementation/cps_ir/cps_ir_tracer.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart
@@ -214,7 +214,7 @@
   String formatPrimitive(cps_ir.Primitive p) => visit(p);
 
   visitConstant(cps_ir.Constant node) {
-    return "Constant ${node.expression.value}";
+    return "Constant ${node.expression.value.toStructuredString()}";
   }
 
   visitParameter(cps_ir.Parameter node) {
diff --git a/sdk/lib/_internal/compiler/implementation/cps_ir/optimizers.dart b/pkg/compiler/lib/src/cps_ir/optimizers.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/cps_ir/optimizers.dart
rename to pkg/compiler/lib/src/cps_ir/optimizers.dart
diff --git a/sdk/lib/_internal/compiler/implementation/cps_ir/redundant_phi.dart b/pkg/compiler/lib/src/cps_ir/redundant_phi.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/cps_ir/redundant_phi.dart
rename to pkg/compiler/lib/src/cps_ir/redundant_phi.dart
diff --git a/sdk/lib/_internal/compiler/implementation/cps_ir/shrinking_reductions.dart b/pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/cps_ir/shrinking_reductions.dart
rename to pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart
diff --git a/sdk/lib/_internal/compiler/implementation/dart2js.dart b/pkg/compiler/lib/src/dart2js.dart
similarity index 97%
rename from sdk/lib/_internal/compiler/implementation/dart2js.dart
rename to pkg/compiler/lib/src/dart2js.dart
index 2359ad2..af0fad3 100644
--- a/sdk/lib/_internal/compiler/implementation/dart2js.dart
+++ b/pkg/compiler/lib/src/dart2js.dart
@@ -18,9 +18,9 @@
 import 'util/uri_extras.dart';
 import 'util/util.dart' show stackTraceFilePrefix;
 import 'util/command_line.dart';
-import '../../libraries.dart';
+import 'package:_internal/libraries.dart';
 
-const String LIBRARY_ROOT = '../../../../..';
+const String LIBRARY_ROOT = '../../../../../sdk';
 const String OUTPUT_LANGUAGE_DART = 'Dart';
 
 /**
@@ -116,6 +116,7 @@
   bool analyzeAll = false;
   bool enableAsyncAwait = false;
   bool trustTypeAnnotations = false;
+  bool trustPrimitives = false;
   bool checkedMode = false;
   // List of provided options that imply that output is expected.
   List<String> optionsImplyCompilation = <String>[];
@@ -210,6 +211,11 @@
     implyCompilation(argument);
   }
 
+  setTrustPrimitives(String argument) {
+    trustPrimitives = true;
+    implyCompilation(argument);
+  }
+
   setCheckedMode(String argument) {
     checkedMode = true;
     passThrough(argument);
@@ -309,6 +315,9 @@
     new OptionHandler('--trust-type-annotations',
                       (_) => setTrustTypeAnnotations(
                           '--trust-type-annotations')),
+    new OptionHandler('--trust-primitives',
+                      (_) => setTrustPrimitives(
+                          '--trust-primitives')),
     new OptionHandler(r'--help|/\?|/h', (_) => wantHelp = true),
     new OptionHandler('--package-root=.+|-p.+', setPackageRoot),
     new OptionHandler('--analyze-all', setAnalyzeAll),
@@ -324,6 +333,7 @@
     new OptionHandler('--show-package-warnings', passThrough),
     new OptionHandler('--csp', passThrough),
     new OptionHandler('--enable-async', setEnableAsync),
+    new OptionHandler('--enable-enum', passThrough),
     new OptionHandler('-D.+=.*', addInEnvironment),
 
     // The following two options must come last.
diff --git a/sdk/lib/_internal/compiler/implementation/dart2js_profile_many.dart b/pkg/compiler/lib/src/dart2js_profile_many.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/dart2js_profile_many.dart
rename to pkg/compiler/lib/src/dart2js_profile_many.dart
diff --git a/sdk/lib/_internal/compiler/implementation/dart2js_stress.dart b/pkg/compiler/lib/src/dart2js_stress.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/dart2js_stress.dart
rename to pkg/compiler/lib/src/dart2js_stress.dart
diff --git a/sdk/lib/_internal/compiler/implementation/dart2jslib.dart b/pkg/compiler/lib/src/dart2jslib.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/dart2jslib.dart
rename to pkg/compiler/lib/src/dart2jslib.dart
diff --git a/sdk/lib/_internal/compiler/implementation/dart_backend/backend.dart b/pkg/compiler/lib/src/dart_backend/backend.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/dart_backend/backend.dart
rename to pkg/compiler/lib/src/dart_backend/backend.dart
diff --git a/sdk/lib/_internal/compiler/implementation/dart_backend/backend_ast_emitter.dart b/pkg/compiler/lib/src/dart_backend/backend_ast_emitter.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/dart_backend/backend_ast_emitter.dart
rename to pkg/compiler/lib/src/dart_backend/backend_ast_emitter.dart
diff --git a/sdk/lib/_internal/compiler/implementation/dart_backend/backend_ast_nodes.dart b/pkg/compiler/lib/src/dart_backend/backend_ast_nodes.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/dart_backend/backend_ast_nodes.dart
rename to pkg/compiler/lib/src/dart_backend/backend_ast_nodes.dart
diff --git a/sdk/lib/_internal/compiler/implementation/dart_backend/backend_ast_to_frontend_ast.dart b/pkg/compiler/lib/src/dart_backend/backend_ast_to_frontend_ast.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/dart_backend/backend_ast_to_frontend_ast.dart
rename to pkg/compiler/lib/src/dart_backend/backend_ast_to_frontend_ast.dart
diff --git a/sdk/lib/_internal/compiler/implementation/dart_backend/copy_propagator.dart b/pkg/compiler/lib/src/dart_backend/copy_propagator.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/dart_backend/copy_propagator.dart
rename to pkg/compiler/lib/src/dart_backend/copy_propagator.dart
diff --git a/sdk/lib/_internal/compiler/implementation/dart_backend/dart_backend.dart b/pkg/compiler/lib/src/dart_backend/dart_backend.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/dart_backend/dart_backend.dart
rename to pkg/compiler/lib/src/dart_backend/dart_backend.dart
diff --git a/sdk/lib/_internal/compiler/implementation/dart_backend/logical_rewriter.dart b/pkg/compiler/lib/src/dart_backend/logical_rewriter.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/dart_backend/logical_rewriter.dart
rename to pkg/compiler/lib/src/dart_backend/logical_rewriter.dart
diff --git a/sdk/lib/_internal/compiler/implementation/dart_backend/loop_rewriter.dart b/pkg/compiler/lib/src/dart_backend/loop_rewriter.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/dart_backend/loop_rewriter.dart
rename to pkg/compiler/lib/src/dart_backend/loop_rewriter.dart
diff --git a/sdk/lib/_internal/compiler/implementation/dart_backend/outputter.dart b/pkg/compiler/lib/src/dart_backend/outputter.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/dart_backend/outputter.dart
rename to pkg/compiler/lib/src/dart_backend/outputter.dart
diff --git a/sdk/lib/_internal/compiler/implementation/dart_backend/placeholder_collector.dart b/pkg/compiler/lib/src/dart_backend/placeholder_collector.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/dart_backend/placeholder_collector.dart
rename to pkg/compiler/lib/src/dart_backend/placeholder_collector.dart
diff --git a/sdk/lib/_internal/compiler/implementation/dart_backend/renamer.dart b/pkg/compiler/lib/src/dart_backend/renamer.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/dart_backend/renamer.dart
rename to pkg/compiler/lib/src/dart_backend/renamer.dart
diff --git a/sdk/lib/_internal/compiler/implementation/dart_backend/statement_rewriter.dart b/pkg/compiler/lib/src/dart_backend/statement_rewriter.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/dart_backend/statement_rewriter.dart
rename to pkg/compiler/lib/src/dart_backend/statement_rewriter.dart
diff --git a/sdk/lib/_internal/compiler/implementation/dart_backend/tree_ir_builder.dart b/pkg/compiler/lib/src/dart_backend/tree_ir_builder.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/dart_backend/tree_ir_builder.dart
rename to pkg/compiler/lib/src/dart_backend/tree_ir_builder.dart
diff --git a/sdk/lib/_internal/compiler/implementation/dart_backend/tree_ir_nodes.dart b/pkg/compiler/lib/src/dart_backend/tree_ir_nodes.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/dart_backend/tree_ir_nodes.dart
rename to pkg/compiler/lib/src/dart_backend/tree_ir_nodes.dart
diff --git a/sdk/lib/_internal/compiler/implementation/dart_backend/tree_ir_tracer.dart b/pkg/compiler/lib/src/dart_backend/tree_ir_tracer.dart
similarity index 99%
rename from sdk/lib/_internal/compiler/implementation/dart_backend/tree_ir_tracer.dart
rename to pkg/compiler/lib/src/dart_backend/tree_ir_tracer.dart
index bcd02f5..b304450 100644
--- a/sdk/lib/_internal/compiler/implementation/dart_backend/tree_ir_tracer.dart
+++ b/pkg/compiler/lib/src/dart_backend/tree_ir_tracer.dart
@@ -339,7 +339,7 @@
   }
 
   String visitConstant(Constant node) {
-    return "${node.value}";
+    return "${node.value.toStructuredString()}";
   }
 
   String visitThis(This node) {
diff --git a/sdk/lib/_internal/compiler/implementation/dart_types.dart b/pkg/compiler/lib/src/dart_types.dart
similarity index 99%
rename from sdk/lib/_internal/compiler/implementation/dart_types.dart
rename to pkg/compiler/lib/src/dart_types.dart
index 32acb88..22d949d 100644
--- a/sdk/lib/_internal/compiler/implementation/dart_types.dart
+++ b/pkg/compiler/lib/src/dart_types.dart
@@ -127,6 +127,9 @@
   /// Is [: true :] if this type is a malformed type.
   bool get isMalformed => kind == TypeKind.MALFORMED_TYPE;
 
+  /// Is `true` if this type is declared by an enum.
+  bool get isEnumType => false;
+
   /// Returns an occurrence of a type variable within this type, if any.
   TypeVariableType get typeVariableOccurrence => null;
 
@@ -461,6 +464,8 @@
 
   bool get isObject => element.isObject;
 
+  bool get isEnumType => element.isEnumClass;
+
   InterfaceType createInstantiation(List<DartType> newTypeArguments) {
     return new InterfaceType(element, newTypeArguments);
   }
diff --git a/sdk/lib/_internal/compiler/implementation/deferred_load.dart b/pkg/compiler/lib/src/deferred_load.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/deferred_load.dart
rename to pkg/compiler/lib/src/deferred_load.dart
diff --git a/sdk/lib/_internal/compiler/implementation/diagnostic_listener.dart b/pkg/compiler/lib/src/diagnostic_listener.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/diagnostic_listener.dart
rename to pkg/compiler/lib/src/diagnostic_listener.dart
diff --git a/sdk/lib/_internal/compiler/implementation/dump_info.dart b/pkg/compiler/lib/src/dump_info.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/dump_info.dart
rename to pkg/compiler/lib/src/dump_info.dart
diff --git a/sdk/lib/_internal/compiler/implementation/elements/elements.dart b/pkg/compiler/lib/src/elements/elements.dart
similarity index 99%
rename from sdk/lib/_internal/compiler/implementation/elements/elements.dart
rename to pkg/compiler/lib/src/elements/elements.dart
index 442e12b..eabc991 100644
--- a/sdk/lib/_internal/compiler/implementation/elements/elements.dart
+++ b/pkg/compiler/lib/src/elements/elements.dart
@@ -1327,6 +1327,8 @@
   int get supertypeLoadState;
   String get nativeTagInfo;
 
+  /// `true` if this class is an enum declaration.
+  bool get isEnumClass;
   bool get isMixinApplication;
   bool get isUnnamedMixinApplication;
   bool get hasBackendMembers;
@@ -1353,8 +1355,6 @@
   void addMember(Element element, DiagnosticListener listener);
   void addToScope(Element element, DiagnosticListener listener);
 
-  void setDefaultConstructor(FunctionElement constructor, Compiler compiler);
-
   void addBackendMember(Element element);
   void reverseBackendMembers();
 
diff --git a/sdk/lib/_internal/compiler/implementation/elements/modelx.dart b/pkg/compiler/lib/src/elements/modelx.dart
similarity index 96%
rename from sdk/lib/_internal/compiler/implementation/elements/modelx.dart
rename to pkg/compiler/lib/src/elements/modelx.dart
index d435f4a..fbffa06 100644
--- a/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
+++ b/pkg/compiler/lib/src/elements/modelx.dart
@@ -1450,13 +1450,13 @@
   final FunctionType type;
   final bool hasOptionalParameters;
 
-  FunctionSignatureX(this.requiredParameters,
-                     Link<Element> optionalParameters,
-                     this.requiredParameterCount,
-                     this.optionalParameterCount,
-                     this.optionalParametersAreNamed,
-                     this.orderedOptionalParameters,
-                     this.type)
+  FunctionSignatureX({this.requiredParameters: const Link<Element>(),
+                      this.requiredParameterCount: 0,
+                      Link<Element> optionalParameters: const Link<Element>(),
+                      this.optionalParameterCount: 0,
+                      this.optionalParametersAreNamed: false,
+                      this.orderedOptionalParameters: const <Element>[],
+                      this.type})
       : optionalParameters = optionalParameters,
         hasOptionalParameters = !optionalParameters.isEmpty;
 
@@ -1718,8 +1718,7 @@
     if (functionSignatureCache != null) return functionSignature;
     compiler.withCurrentElement(this, () {
       DartType inner = new FunctionType(this);
-      functionSignatureCache = new FunctionSignatureX(const Link(),
-          const Link(), 0, 0, false, [], inner);
+      functionSignatureCache = new FunctionSignatureX(type: inner);
     });
     return functionSignatureCache;
   }
@@ -1820,9 +1819,7 @@
     if (functionSignatureCache != null) return functionSignatureCache;
     if (isDefaultConstructor) {
       return functionSignatureCache = new FunctionSignatureX(
-          const Link<Element>(), const Link<Element>(), 0, 0, false,
-          const <Element>[],
-          new FunctionType(this, enclosingClass.thisType));
+          type: new FunctionType(this, enclosingClass.thisType));
     }
     if (definingConstructor.isErroneous) {
       return functionSignatureCache =
@@ -1973,6 +1970,9 @@
 
   bool get isUnnamedMixinApplication => false;
 
+  @override
+  bool get isEnumClass => false;
+
   InterfaceType computeType(Compiler compiler) {
     if (thisTypeCache == null) {
       computeThisAndRawType(compiler, computeTypeParameters(compiler));
@@ -2355,8 +2355,6 @@
   ClassElementX(String name, Element enclosing, int id, int initialState)
       : super(name, enclosing, id, initialState);
 
-  ClassNode parseNode(Compiler compiler);
-
   bool get isMixinApplication => false;
   bool get hasLocalScopeMembers => !localScope.isEmpty;
 
@@ -2416,6 +2414,92 @@
   }
 }
 
+class EnumClassElementX extends ClassElementX {
+  final Enum node;
+
+  EnumClassElementX(String name, Element enclosing, int id, this.node)
+      : super(name, enclosing, id, STATE_NOT_STARTED);
+
+  @override
+  bool get hasNode => true;
+
+  @override
+  Token get position => node.name.token;
+
+  @override
+  bool get isEnumClass => true;
+
+  @override
+  Node parseNode(Compiler compiler) => node;
+
+  @override
+  accept(ElementVisitor visitor) => visitor.visitClassElement(this);
+
+  List<DartType> computeTypeParameters(Compiler compiler) => const <DartType>[];
+}
+
+class EnumConstructorElementX extends ConstructorElementX {
+  final FunctionExpression node;
+
+  EnumConstructorElementX(EnumClassElementX enumClass,
+                          Modifiers modifiers,
+                          this.node)
+      : super('', // Name.
+              ElementKind.GENERATIVE_CONSTRUCTOR,
+              modifiers,
+              enumClass);
+
+  @override
+  bool get hasNode => true;
+
+  @override
+  FunctionExpression parseNode(Compiler compiler) => node;
+}
+
+class EnumMethodElementX extends FunctionElementX {
+  final FunctionExpression node;
+
+  EnumMethodElementX(String name,
+                     EnumClassElementX enumClass,
+                     Modifiers modifiers,
+                     this.node)
+      : super(name,
+              ElementKind.FUNCTION,
+              modifiers,
+              enumClass,
+              false);
+
+  @override
+  bool get hasNode => true;
+
+  @override
+  FunctionExpression parseNode(Compiler compiler) => node;
+}
+
+class EnumFormalElementX extends InitializingFormalElementX {
+  EnumFormalElementX(ConstructorElement constructor,
+                     VariableDefinitions variables,
+                     Identifier identifier,
+                     EnumFieldElementX fieldElement)
+      : super(constructor, variables, identifier, null, fieldElement) {
+    typeCache = fieldElement.type;
+  }
+}
+
+class EnumFieldElementX extends FieldElementX {
+
+  EnumFieldElementX(Identifier name,
+                    EnumClassElementX enumClass,
+                    VariableList variableList,
+                    Node definition,
+                    [Expression initializer])
+      : super(name, enumClass, variableList) {
+    definitionsCache = new VariableDefinitions(null,
+        variableList.modifiers, new NodeList.singleton(definition));
+    initializerCache = initializer;
+  }
+}
+
 class MixinApplicationElementX extends BaseClassElementX
     implements MixinApplicationElement {
   final Node node;
diff --git a/sdk/lib/_internal/compiler/implementation/elements/names.dart b/pkg/compiler/lib/src/elements/names.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/elements/names.dart
rename to pkg/compiler/lib/src/elements/names.dart
diff --git a/sdk/lib/_internal/compiler/implementation/elements/visitor.dart b/pkg/compiler/lib/src/elements/visitor.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/elements/visitor.dart
rename to pkg/compiler/lib/src/elements/visitor.dart
diff --git a/sdk/lib/_internal/compiler/implementation/enqueue.dart b/pkg/compiler/lib/src/enqueue.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/enqueue.dart
rename to pkg/compiler/lib/src/enqueue.dart
diff --git a/sdk/lib/_internal/compiler/implementation/filenames.dart b/pkg/compiler/lib/src/filenames.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/filenames.dart
rename to pkg/compiler/lib/src/filenames.dart
diff --git a/sdk/lib/_internal/compiler/implementation/hash/sha1.dart b/pkg/compiler/lib/src/hash/sha1.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/hash/sha1.dart
rename to pkg/compiler/lib/src/hash/sha1.dart
diff --git a/sdk/lib/_internal/compiler/implementation/helpers/debug_collection.dart b/pkg/compiler/lib/src/helpers/debug_collection.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/helpers/debug_collection.dart
rename to pkg/compiler/lib/src/helpers/debug_collection.dart
diff --git a/sdk/lib/_internal/compiler/implementation/helpers/expensive_map.dart b/pkg/compiler/lib/src/helpers/expensive_map.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/helpers/expensive_map.dart
rename to pkg/compiler/lib/src/helpers/expensive_map.dart
diff --git a/sdk/lib/_internal/compiler/implementation/helpers/expensive_set.dart b/pkg/compiler/lib/src/helpers/expensive_set.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/helpers/expensive_set.dart
rename to pkg/compiler/lib/src/helpers/expensive_set.dart
diff --git a/sdk/lib/_internal/compiler/implementation/helpers/helpers.dart b/pkg/compiler/lib/src/helpers/helpers.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/helpers/helpers.dart
rename to pkg/compiler/lib/src/helpers/helpers.dart
diff --git a/sdk/lib/_internal/compiler/implementation/helpers/stats.dart b/pkg/compiler/lib/src/helpers/stats.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/helpers/stats.dart
rename to pkg/compiler/lib/src/helpers/stats.dart
diff --git a/sdk/lib/_internal/compiler/implementation/helpers/trace.dart b/pkg/compiler/lib/src/helpers/trace.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/helpers/trace.dart
rename to pkg/compiler/lib/src/helpers/trace.dart
diff --git a/sdk/lib/_internal/compiler/implementation/helpers/track_map.dart b/pkg/compiler/lib/src/helpers/track_map.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/helpers/track_map.dart
rename to pkg/compiler/lib/src/helpers/track_map.dart
diff --git a/sdk/lib/_internal/compiler/implementation/inferrer/closure_tracer.dart b/pkg/compiler/lib/src/inferrer/closure_tracer.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/inferrer/closure_tracer.dart
rename to pkg/compiler/lib/src/inferrer/closure_tracer.dart
diff --git a/sdk/lib/_internal/compiler/implementation/inferrer/concrete_types_inferrer.dart b/pkg/compiler/lib/src/inferrer/concrete_types_inferrer.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/inferrer/concrete_types_inferrer.dart
rename to pkg/compiler/lib/src/inferrer/concrete_types_inferrer.dart
diff --git a/sdk/lib/_internal/compiler/implementation/inferrer/inferrer_visitor.dart b/pkg/compiler/lib/src/inferrer/inferrer_visitor.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/inferrer/inferrer_visitor.dart
rename to pkg/compiler/lib/src/inferrer/inferrer_visitor.dart
diff --git a/sdk/lib/_internal/compiler/implementation/inferrer/list_tracer.dart b/pkg/compiler/lib/src/inferrer/list_tracer.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/inferrer/list_tracer.dart
rename to pkg/compiler/lib/src/inferrer/list_tracer.dart
diff --git a/sdk/lib/_internal/compiler/implementation/inferrer/map_tracer.dart b/pkg/compiler/lib/src/inferrer/map_tracer.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/inferrer/map_tracer.dart
rename to pkg/compiler/lib/src/inferrer/map_tracer.dart
diff --git a/sdk/lib/_internal/compiler/implementation/inferrer/node_tracer.dart b/pkg/compiler/lib/src/inferrer/node_tracer.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/inferrer/node_tracer.dart
rename to pkg/compiler/lib/src/inferrer/node_tracer.dart
diff --git a/sdk/lib/_internal/compiler/implementation/inferrer/simple_types_inferrer.dart b/pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/inferrer/simple_types_inferrer.dart
rename to pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart
diff --git a/sdk/lib/_internal/compiler/implementation/inferrer/type_graph_inferrer.dart b/pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/inferrer/type_graph_inferrer.dart
rename to pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart
diff --git a/sdk/lib/_internal/compiler/implementation/inferrer/type_graph_nodes.dart b/pkg/compiler/lib/src/inferrer/type_graph_nodes.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/inferrer/type_graph_nodes.dart
rename to pkg/compiler/lib/src/inferrer/type_graph_nodes.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js/builder.dart b/pkg/compiler/lib/src/js/builder.dart
similarity index 95%
rename from sdk/lib/_internal/compiler/implementation/js/builder.dart
rename to pkg/compiler/lib/src/js/builder.dart
index 838dbc8..142166e 100644
--- a/sdk/lib/_internal/compiler/implementation/js/builder.dart
+++ b/pkg/compiler/lib/src/js/builder.dart
@@ -208,7 +208,9 @@
   Expression call(String source, [var arguments]) {
     Template template = _findExpressionTemplate(source);
     if (arguments == null) return template.instantiate([]);
-    return template.instantiate(arguments is List ? arguments : [arguments]);
+    // We allow a single argument to be given directly.
+    if (arguments is! List && arguments is! Map) arguments = [arguments];
+    return template.instantiate(arguments);
   }
 
   /**
@@ -217,7 +219,9 @@
   Statement statement(String source, [var arguments]) {
     Template template = _findStatementTemplate(source);
     if (arguments == null) return template.instantiate([]);
-    return template.instantiate(arguments is List ? arguments : [arguments]);
+    // We allow a single argument to be given directly.
+    if (arguments is! List && arguments is! Map) arguments = [arguments];
+    return template.instantiate(arguments);
   }
 
   /**
@@ -402,7 +406,12 @@
   int position = 0;
   bool skippedNewline = false;  // skipped newline in last getToken?
   final String src;
+
   final List<InterpolatedNode> interpolatedValues = <InterpolatedNode>[];
+  bool get hasNamedHoles =>
+      interpolatedValues.isNotEmpty && interpolatedValues.first.isNamed;
+  bool get hasPositionalHoles =>
+      interpolatedValues.isNotEmpty && interpolatedValues.first.isPositional;
 
   static const NONE = -1;
   static const ALPHA = 0;
@@ -664,6 +673,24 @@
     throw new MiniJsParserError(this, message);
   }
 
+  /// Returns either the name for the hole, or its integer position.
+  parseHash() {
+    String holeName = lastToken;
+    if (acceptCategory(ALPHA)) {
+      // Named hole. Example: 'function #funName() { ... }'
+      if (hasPositionalHoles) {
+        error('Holes must all be positional or named. $holeName');
+      }
+      return holeName;
+    } else {
+      if (hasNamedHoles) {
+        error('Holes must all be positional or named. $holeName');
+      }
+      int position = interpolatedValues.length;
+      return position;
+    }
+  }
+
   Expression parsePrimary() {
     String last = lastToken;
     if (acceptCategory(ALPHA)) {
@@ -705,8 +732,9 @@
       Expression expression = new RegExpLiteral(regexp + flags);
       return expression;
     } else if (acceptCategory(HASH)) {
+      var nameOrPosition = parseHash();
       InterpolatedExpression expression =
-          new InterpolatedExpression(interpolatedValues.length);
+          new InterpolatedExpression(nameOrPosition);
       interpolatedValues.add(expression);
       return expression;
     } else {
@@ -732,8 +760,9 @@
     if (!acceptCategory(RPAREN)) {
       for (;;) {
         if (acceptCategory(HASH)) {
+          var nameOrPosition = parseHash();
           InterpolatedParameter parameter =
-              new InterpolatedParameter(interpolatedValues.length);
+              new InterpolatedParameter(nameOrPosition);
           interpolatedValues.add(parameter);
           params.add(parameter);
         } else {
@@ -766,8 +795,9 @@
       } else if (acceptCategory(SYMBOL)) {  // e.g. void
         propertyName = new LiteralString('"$identifier"');
       } else if (acceptCategory(HASH)) {
+        var nameOrPosition = parseHash();
         InterpolatedLiteral interpolatedLiteral =
-            new InterpolatedLiteral(interpolatedValues.length);
+            new InterpolatedLiteral(nameOrPosition);
         interpolatedValues.add(interpolatedLiteral);
         propertyName = interpolatedLiteral;
       } else {
@@ -833,8 +863,8 @@
 
   Expression getDotRhs(Expression receiver) {
     if (acceptCategory(HASH)) {
-      InterpolatedSelector property =
-          new InterpolatedSelector(interpolatedValues.length);
+      var nameOrPosition = parseHash();
+      InterpolatedSelector property = new InterpolatedSelector(nameOrPosition);
       interpolatedValues.add(property);
       return new PropertyAccess(receiver, property);
     }
@@ -1066,7 +1096,7 @@
       if (expression is InterpolatedExpression) {
         assert(identical(interpolatedValues.last, expression));
         InterpolatedStatement statement =
-            new InterpolatedStatement(expression.name);
+            new InterpolatedStatement(expression.nameOrPosition);
         interpolatedValues[interpolatedValues.length - 1] = statement;
         return statement;
       }
diff --git a/sdk/lib/_internal/compiler/implementation/js/js.dart b/pkg/compiler/lib/src/js/js.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/js/js.dart
rename to pkg/compiler/lib/src/js/js.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js/nodes.dart b/pkg/compiler/lib/src/js/nodes.dart
similarity index 96%
rename from sdk/lib/_internal/compiler/implementation/js/nodes.dart
rename to pkg/compiler/lib/src/js/nodes.dart
index 23ca6d0..8d4f35c 100644
--- a/sdk/lib/_internal/compiler/implementation/js/nodes.dart
+++ b/pkg/compiler/lib/src/js/nodes.dart
@@ -1026,65 +1026,71 @@
 
 /// Tag class for all interpolated positions.
 abstract class InterpolatedNode implements Node {
-  get name; // 'int' for positional interpolated nodes, 'String' for named.
+  get nameOrPosition;
+
+  bool get isNamed => nameOrPosition is String;
+  bool get isPositional => nameOrPosition is int;
 }
 
-class InterpolatedExpression extends Expression implements InterpolatedNode {
-  final name;
+class InterpolatedExpression extends Expression with InterpolatedNode {
+  final nameOrPosition;
 
-  InterpolatedExpression(this.name);
+  InterpolatedExpression(this.nameOrPosition);
 
   accept(NodeVisitor visitor) => visitor.visitInterpolatedExpression(this);
   void visitChildren(NodeVisitor visitor) {}
-  InterpolatedExpression _clone() => new InterpolatedExpression(name);
+  InterpolatedExpression _clone() =>
+      new InterpolatedExpression(nameOrPosition);
 
   int get precedenceLevel => PRIMARY;
 }
 
-class InterpolatedLiteral extends Literal implements InterpolatedNode {
-  final name;
+class InterpolatedLiteral extends Literal with InterpolatedNode {
+  final nameOrPosition;
 
-  InterpolatedLiteral(this.name);
+  InterpolatedLiteral(this.nameOrPosition);
 
   accept(NodeVisitor visitor) => visitor.visitInterpolatedLiteral(this);
   void visitChildren(NodeVisitor visitor) {}
-  InterpolatedLiteral _clone() => new InterpolatedLiteral(name);
+  InterpolatedLiteral _clone() => new InterpolatedLiteral(nameOrPosition);
 }
 
-class InterpolatedParameter extends Expression
-    implements Parameter, InterpolatedNode {
-  final name;
+class InterpolatedParameter extends Expression with InterpolatedNode
+    implements Parameter {
+  final nameOrPosition;
+
+  String get name { throw "InterpolatedParameter.name must not be invoked"; }
   bool get allowRename => false;
 
-  InterpolatedParameter(this.name);
+  InterpolatedParameter(this.nameOrPosition);
 
   accept(NodeVisitor visitor) => visitor.visitInterpolatedParameter(this);
   void visitChildren(NodeVisitor visitor) {}
-  InterpolatedParameter _clone() => new InterpolatedParameter(name);
+  InterpolatedParameter _clone() => new InterpolatedParameter(nameOrPosition);
 
   int get precedenceLevel => PRIMARY;
 }
 
-class InterpolatedSelector extends Expression implements InterpolatedNode {
-  final name;
+class InterpolatedSelector extends Expression with InterpolatedNode {
+  final nameOrPosition;
 
-  InterpolatedSelector(this.name);
+  InterpolatedSelector(this.nameOrPosition);
 
   accept(NodeVisitor visitor) => visitor.visitInterpolatedSelector(this);
   void visitChildren(NodeVisitor visitor) {}
-  InterpolatedSelector _clone() => new InterpolatedSelector(name);
+  InterpolatedSelector _clone() => new InterpolatedSelector(nameOrPosition);
 
   int get precedenceLevel => PRIMARY;
 }
 
-class InterpolatedStatement extends Statement implements InterpolatedNode {
-  final name;
+class InterpolatedStatement extends Statement with InterpolatedNode {
+  final nameOrPosition;
 
-  InterpolatedStatement(this.name);
+  InterpolatedStatement(this.nameOrPosition);
 
   accept(NodeVisitor visitor) => visitor.visitInterpolatedStatement(this);
   void visitChildren(NodeVisitor visitor) {}
-  InterpolatedStatement _clone() => new InterpolatedStatement(name);
+  InterpolatedStatement _clone() => new InterpolatedStatement(nameOrPosition);
 }
 
 /**
diff --git a/sdk/lib/_internal/compiler/implementation/js/precedence.dart b/pkg/compiler/lib/src/js/precedence.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/js/precedence.dart
rename to pkg/compiler/lib/src/js/precedence.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js/printer.dart b/pkg/compiler/lib/src/js/printer.dart
similarity index 99%
rename from sdk/lib/_internal/compiler/implementation/js/printer.dart
rename to pkg/compiler/lib/src/js/printer.dart
index 1a512cf..f64bdfb 100644
--- a/sdk/lib/_internal/compiler/implementation/js/printer.dart
+++ b/pkg/compiler/lib/src/js/printer.dart
@@ -874,7 +874,7 @@
   }
 
   visitInterpolatedNode(InterpolatedNode node) {
-    out('#${node.name}');
+    out('#${node.nameOrPosition}');
   }
 
   visitInterpolatedExpression(InterpolatedExpression node) =>
@@ -890,7 +890,7 @@
       visitInterpolatedNode(node);
 
   visitInterpolatedStatement(InterpolatedStatement node) {
-    outLn('#${node.name}');
+    outLn('#${node.nameOrPosition}');
   }
 
   void visitComment(Comment node) {
diff --git a/sdk/lib/_internal/compiler/implementation/js/template.dart b/pkg/compiler/lib/src/js/template.dart
similarity index 87%
rename from sdk/lib/_internal/compiler/implementation/js/template.dart
rename to pkg/compiler/lib/src/js/template.dart
index 5b574d0..03b956e 100644
--- a/sdk/lib/_internal/compiler/implementation/js/template.dart
+++ b/pkg/compiler/lib/src/js/template.dart
@@ -47,8 +47,12 @@
   final Node ast;
 
   Instantiator instantiator;
+
   int positionalArgumentCount = -1;
-  // TODO(sra): Named arguments.
+
+  // Null, unless there are named holes.
+  List<String> holeNames;
+  bool get isPositional => holeNames == null;
 
   Template(this.source, this.ast,
            {this.isExpression: true, this.forceCopy: false}) {
@@ -83,9 +87,15 @@
         new InstantiatorGeneratorVisitor(forceCopy);
     instantiator = generator.compile(ast);
     positionalArgumentCount = generator.analysis.count;
+    Set<String> names = generator.analysis.holeNames;
+    holeNames = names.isEmpty ? null : names.toList(growable:false);
   }
 
-  Node instantiate(List arguments) {
+  /// Instantiates the template with the given [arguments].
+  ///
+  /// This method fills in the holes with the given arguments. The [arguments]
+  /// must be either a [List] or a [Map].
+  Node instantiate(var arguments) {
     if (arguments is List) {
       if (arguments.length != positionalArgumentCount) {
         throw 'Wrong number of template arguments, given ${arguments.length}, '
@@ -93,14 +103,26 @@
       }
       return instantiator(arguments);
     }
-    // TODO(sra): Add named placeholders and a Map of arguments.
-    throw new UnimplementedError('Template arguments must be a list');
+    assert(arguments is Map);
+    if (holeNames.length < arguments.length) {
+      // This search is in O(n), but we only do it in case of an error, and the
+      // number of holes should be quite limited.
+      String unusedNames =
+          arguments.keys.where((name) => !holeNames.contains(name)).join(", ");
+      throw "Template arguments has unused mappings: $unusedNames";
+    }
+    if (!holeNames.every((String name) => arguments.containsKey(name))) {
+      String notFound =
+          holeNames.where((name) => !arguments.containsKey(name)).join(", ");
+      throw "Template arguments is missing mappings for: $notFound";
+    }
+    return instantiator(arguments);
   }
 }
 
 /**
  * An Instantiator is a Function that generates a JS AST tree or List of
- * trees. [arguments] is a List for positional templates, or (TODO) Map for
+ * trees. [arguments] is a List for positional templates, or Map for
  * named templates.
  */
 typedef Node Instantiator(var arguments);
@@ -164,24 +186,24 @@
   }
 
   Instantiator visitInterpolatedExpression(InterpolatedExpression node) {
-    int position = node.name;
+    var nameOrPosition = node.nameOrPosition;
     return (arguments) {
-      var value = arguments[position];
+      var value = arguments[nameOrPosition];
       if (value is Expression) return value;
-      if (value is String) return convertStringToVariableUse(value);;
-      error('Interpolated value #$position is not an Expression: $value');
+      if (value is String) return convertStringToVariableUse(value);
+      error('Interpolated value #$nameOrPosition is not an Expression: $value');
     };
   }
 
   Instantiator visitSplayableExpression(Node node) {
     if (node is InterpolatedExpression) {
-      int position = node.name;
+      var nameOrPosition = node.nameOrPosition;
       return (arguments) {
-        var value = arguments[position];
+        var value = arguments[nameOrPosition];
         Expression toExpression(item) {
           if (item is Expression) return item;
           if (item is String) return convertStringToVariableUse(item);
-          return error('Interpolated value #$position is not '
+          return error('Interpolated value #$nameOrPosition is not '
               'an Expression or List of Expressions: $value');
         }
         if (value is Iterable) return value.map(toExpression);
@@ -192,24 +214,24 @@
   }
 
   Instantiator visitInterpolatedLiteral(InterpolatedLiteral node) {
-    int position = node.name;
+    var nameOrPosition = node.nameOrPosition;
     return (arguments) {
-      var value = arguments[position];
+      var value = arguments[nameOrPosition];
       if (value is Literal) return value;
-      error('Interpolated value #$position is not a Literal: $value');
+      error('Interpolated value #$nameOrPosition is not a Literal: $value');
     };
   }
 
   Instantiator visitInterpolatedParameter(InterpolatedParameter node) {
-    int position = node.name;
+    var nameOrPosition = node.nameOrPosition;
     return (arguments) {
-      var value = arguments[position];
+      var value = arguments[nameOrPosition];
 
       Parameter toParameter(item) {
         if (item is Parameter) return item;
         if (item is String) return new Parameter(item);
-        return error('Interpolated value #$position is not a Parameter or '
-                     'List of Parameters: $value');
+        return error('Interpolated value #$nameOrPosition is not a Parameter or'
+                     ' List of Parameters: $value');
       }
       if (value is Iterable) return value.map(toParameter);
       return toParameter(value);
@@ -220,33 +242,33 @@
     // A selector is an expression, as in `a[selector]`.
     // A String argument converted into a LiteralString, so `a.#` with argument
     // 'foo' generates `a["foo"]` which prints as `a.foo`.
-    int position = node.name;
+    var nameOrPosition = node.nameOrPosition;
     return (arguments) {
-      var value = arguments[position];
+      var value = arguments[nameOrPosition];
       if (value is Expression) return value;
       if (value is String) return new LiteralString('"$value"');
-      error('Interpolated value #$position is not a selector: $value');
+      error('Interpolated value #$nameOrPosition is not a selector: $value');
     };
   }
 
   Instantiator visitInterpolatedStatement(InterpolatedStatement node) {
-    int position = node.name;
+    var nameOrPosition = node.nameOrPosition;
     return (arguments) {
-      var value = arguments[position];
+      var value = arguments[nameOrPosition];
       if (value is Node) return value.toStatement();
-      error('Interpolated value #$position is not a Statement: $value');
+      error('Interpolated value #$nameOrPosition is not a Statement: $value');
     };
   }
 
   Instantiator visitSplayableStatement(Node node) {
     if (node is InterpolatedStatement) {
-      int position = node.name;
+      var nameOrPosition = node.nameOrPosition;
       return (arguments) {
-        var value = arguments[position];
+        var value = arguments[nameOrPosition];
         Statement toStatement(item) {
           if (item is Statement) return item;
           if (item is Expression) return item.toStatement();;
-          return error('Interpolated value #$position is not '
+          return error('Interpolated value #$nameOrPosition is not '
                        'a Statement or List of Statements: $value');
         }
         if (value is Iterable) return value.map(toStatement);
@@ -317,13 +339,14 @@
   Instantiator visitIfConditionalCompilation(If node) {
     // Special version of visitInterpolatedExpression that permits bools.
     compileCondition(InterpolatedExpression node) {
-      int position = node.name;
+      var nameOrPosition = node.nameOrPosition;
       return (arguments) {
-        var value = arguments[position];
+        var value = arguments[nameOrPosition];
         if (value is bool) return value;
         if (value is Expression) return value;
         if (value is String) return convertStringToVariableUse(value);;
-        error('Interpolated value #$position is not an Expression: $value');
+        error('Interpolated value #$nameOrPosition '
+              'is not an Expression: $value');
       };
     }
     var makeCondition = compileCondition(node.condition);
@@ -647,8 +670,9 @@
  * InterpolatedNodeAnalysis extract [InterpolatedNode]s from AST.
  */
 class InterpolatedNodeAnalysis extends BaseVisitor {
-  final Set<Node> containsInterpolatedNode = new Set<Node>();
+  final Setlet<Node> containsInterpolatedNode = new Setlet<Node>();
   final List<InterpolatedNode> interpolatedNodes = <InterpolatedNode>[];
+  final Setlet<String> holeNames = new Setlet<String>();
   int count = 0;
 
   InterpolatedNodeAnalysis();
@@ -670,6 +694,7 @@
   visitInterpolatedNode(InterpolatedNode node) {
     interpolatedNodes.add(node);
     containsInterpolatedNode.add(node);
+    if (node.isNamed) holeNames.add(node.nameOrPosition);
     ++count;
   }
 }
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart b/pkg/compiler/lib/src/js_backend/backend.dart
similarity index 98%
rename from sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
rename to pkg/compiler/lib/src/js_backend/backend.dart
index dfd5a92..0f01f9c 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
+++ b/pkg/compiler/lib/src/js_backend/backend.dart
@@ -323,6 +323,12 @@
    */
   final Set<ClassElement> specialOperatorEqClasses = new Set<ClassElement>();
 
+  /**
+   * A set of members that are called from subclasses via super.
+   */
+  final Set<FunctionElement> aliasedSuperMembers =
+      new Setlet<FunctionElement>();
+
   List<CompilerTask> get tasks {
     return <CompilerTask>[builder, optimizer, generator, emitter];
   }
@@ -528,6 +534,20 @@
     return name;
   }
 
+  /**
+   * Record that [method] is called from a subclass via `super`.
+   */
+  void registerAliasedSuperMember(FunctionElement method) {
+    aliasedSuperMembers.add(method);
+  }
+
+  /**
+   * Returns `true` is [member] is called from a subclass via `super`.
+   */
+  bool isAliasedSuperMember(FunctionElement member) {
+    return aliasedSuperMembers.contains(member);
+  }
+
   bool isInterceptedMethod(Element element) {
     if (!element.isInstanceMember) return false;
     if (element.isGenerativeConstructorBody) {
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/checked_mode_helpers.dart b/pkg/compiler/lib/src/js_backend/checked_mode_helpers.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/js_backend/checked_mode_helpers.dart
rename to pkg/compiler/lib/src/js_backend/checked_mode_helpers.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/constant_emitter.dart b/pkg/compiler/lib/src/js_backend/constant_emitter.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/js_backend/constant_emitter.dart
rename to pkg/compiler/lib/src/js_backend/constant_emitter.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/constant_handler_javascript.dart b/pkg/compiler/lib/src/js_backend/constant_handler_javascript.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/js_backend/constant_handler_javascript.dart
rename to pkg/compiler/lib/src/js_backend/constant_handler_javascript.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/constant_system_javascript.dart b/pkg/compiler/lib/src/js_backend/constant_system_javascript.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/js_backend/constant_system_javascript.dart
rename to pkg/compiler/lib/src/js_backend/constant_system_javascript.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/custom_elements_analysis.dart b/pkg/compiler/lib/src/js_backend/custom_elements_analysis.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/js_backend/custom_elements_analysis.dart
rename to pkg/compiler/lib/src/js_backend/custom_elements_analysis.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/js_backend.dart b/pkg/compiler/lib/src/js_backend/js_backend.dart
similarity index 93%
rename from sdk/lib/_internal/compiler/implementation/js_backend/js_backend.dart
rename to pkg/compiler/lib/src/js_backend/js_backend.dart
index 514b225..0f9f0ce 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/js_backend.dart
+++ b/pkg/compiler/lib/src/js_backend/js_backend.dart
@@ -7,7 +7,7 @@
 import 'dart:async' show EventSink, Future;
 import 'dart:collection' show Queue, LinkedHashMap, LinkedHashSet;
 
-import '../../js_lib/shared/embedded_names.dart' as embeddedNames;
+import 'package:_internal/compiler/js_lib/shared/embedded_names.dart' as embeddedNames;
 
 import '../closure.dart';
 import '../constants/expressions.dart';
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/minify_namer.dart b/pkg/compiler/lib/src/js_backend/minify_namer.dart
similarity index 99%
rename from sdk/lib/_internal/compiler/implementation/js_backend/minify_namer.dart
rename to pkg/compiler/lib/src/js_backend/minify_namer.dart
index a318279..5ff2a2d 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/minify_namer.dart
+++ b/pkg/compiler/lib/src/js_backend/minify_namer.dart
@@ -18,6 +18,7 @@
 
   final String getterPrefix = 'g';
   final String setterPrefix = 's';
+  final String superPrefix = r's$';
   final String callPrefix = ''; // this will create function names $<n>
 
   static const ALPHABET_CHARACTERS = 52;  // a-zA-Z.
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/namer.dart b/pkg/compiler/lib/src/js_backend/namer.dart
similarity index 98%
rename from sdk/lib/_internal/compiler/implementation/js_backend/namer.dart
rename to pkg/compiler/lib/src/js_backend/namer.dart
index 4eff34a..0fe858b 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/namer.dart
+++ b/pkg/compiler/lib/src/js_backend/namer.dart
@@ -220,6 +220,7 @@
   final String currentIsolate = r'$';
   final String getterPrefix = r'get$';
   final String setterPrefix = r'set$';
+  final String superPrefix = r'super$';
   final String metadataField = '@';
   final String callPrefix = 'call';
   final String callCatchAllName = r'call$catchAll';
@@ -809,6 +810,14 @@
   // TODO(ahe): Remove this method. Use get getNameOfMember instead.
   String getNameOfInstanceMember(Element member) => getNameX(member);
 
+  String getNameOfAliasedSuperMember(Element member) {
+    ClassElement superClass = member.enclosingClass;
+    String className = getNameOfClass(superClass);
+    String memberName = getNameOfMember(member);
+    String proposal = "$superPrefix$className\$$memberName";
+    return getMappedInstanceName(proposal);
+  }
+
   String getNameOfMember(Element member) => getNameX(member);
 
   String getNameOfGlobalField(VariableElement field) => getNameX(field);
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart b/pkg/compiler/lib/src/js_backend/native_emitter.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart
rename to pkg/compiler/lib/src/js_backend/native_emitter.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart b/pkg/compiler/lib/src/js_backend/runtime_types.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart
rename to pkg/compiler/lib/src/js_backend/runtime_types.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/type_variable_handler.dart b/pkg/compiler/lib/src/js_backend/type_variable_handler.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/js_backend/type_variable_handler.dart
rename to pkg/compiler/lib/src/js_backend/type_variable_handler.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_emitter/class_stub_generator.dart b/pkg/compiler/lib/src/js_emitter/class_stub_generator.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/js_emitter/class_stub_generator.dart
rename to pkg/compiler/lib/src/js_emitter/class_stub_generator.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart b/pkg/compiler/lib/src/js_emitter/code_emitter_task.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart
rename to pkg/compiler/lib/src/js_emitter/code_emitter_task.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_emitter/helpers.dart b/pkg/compiler/lib/src/js_emitter/helpers.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/js_emitter/helpers.dart
rename to pkg/compiler/lib/src/js_emitter/helpers.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_emitter/interceptor_stub_generator.dart b/pkg/compiler/lib/src/js_emitter/interceptor_stub_generator.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/js_emitter/interceptor_stub_generator.dart
rename to pkg/compiler/lib/src/js_emitter/interceptor_stub_generator.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_emitter/js_emitter.dart b/pkg/compiler/lib/src/js_emitter/js_emitter.dart
similarity index 92%
rename from sdk/lib/_internal/compiler/implementation/js_emitter/js_emitter.dart
rename to pkg/compiler/lib/src/js_emitter/js_emitter.dart
index 825eaa0..2da79fe 100644
--- a/sdk/lib/_internal/compiler/implementation/js_emitter/js_emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/js_emitter.dart
@@ -82,8 +82,9 @@
 import '../deferred_load.dart' show
     OutputUnit;
 
-import '../../js_lib/shared/runtime_data.dart' as encoding;
-import '../../js_lib/shared/embedded_names.dart' as embeddedNames;
+import 'package:_internal/compiler/js_lib/shared/runtime_data.dart' as encoding;
+import 'package:_internal/compiler/js_lib/shared/embedded_names.dart'
+    as embeddedNames;
 
 import '../hash/sha1.dart';
 
diff --git a/sdk/lib/_internal/compiler/implementation/js_emitter/model.dart b/pkg/compiler/lib/src/js_emitter/model.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/js_emitter/model.dart
rename to pkg/compiler/lib/src/js_emitter/model.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_emitter/new_emitter/emitter.dart b/pkg/compiler/lib/src/js_emitter/new_emitter/emitter.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/js_emitter/new_emitter/emitter.dart
rename to pkg/compiler/lib/src/js_emitter/new_emitter/emitter.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_emitter/new_emitter/model_emitter.dart b/pkg/compiler/lib/src/js_emitter/new_emitter/model_emitter.dart
similarity index 98%
rename from sdk/lib/_internal/compiler/implementation/js_emitter/new_emitter/model_emitter.dart
rename to pkg/compiler/lib/src/js_emitter/new_emitter/model_emitter.dart
index d3d6c1d..1df89ae 100644
--- a/sdk/lib/_internal/compiler/implementation/js_emitter/new_emitter/model_emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/new_emitter/model_emitter.dart
@@ -11,7 +11,7 @@
     Namer,
     ConstantEmitter;
 
-import '../../../js_lib/shared/embedded_names.dart' show
+import 'package:_internal/compiler/js_lib/shared/embedded_names.dart' show
     DEFERRED_LIBRARY_URIS,
     DEFERRED_LIBRARY_HASHES,
     INITIALIZE_LOADED_HUNK,
@@ -30,7 +30,7 @@
   static const String deferredInitializersGlobal =
       r"$__dart_deferred_initializers__";
 
-  static const String deferredExtension = ".part.js";
+  static const String deferredExtension = "part.js";
 
   ModelEmitter(Compiler compiler, Namer namer)
       : this.compiler = compiler,
diff --git a/sdk/lib/_internal/compiler/implementation/js_emitter/old_emitter/class_builder.dart b/pkg/compiler/lib/src/js_emitter/old_emitter/class_builder.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/js_emitter/old_emitter/class_builder.dart
rename to pkg/compiler/lib/src/js_emitter/old_emitter/class_builder.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_emitter/old_emitter/class_emitter.dart b/pkg/compiler/lib/src/js_emitter/old_emitter/class_emitter.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/js_emitter/old_emitter/class_emitter.dart
rename to pkg/compiler/lib/src/js_emitter/old_emitter/class_emitter.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_emitter/old_emitter/code_emitter_helper.dart b/pkg/compiler/lib/src/js_emitter/old_emitter/code_emitter_helper.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/js_emitter/old_emitter/code_emitter_helper.dart
rename to pkg/compiler/lib/src/js_emitter/old_emitter/code_emitter_helper.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_emitter/old_emitter/container_builder.dart b/pkg/compiler/lib/src/js_emitter/old_emitter/container_builder.dart
similarity index 98%
rename from sdk/lib/_internal/compiler/implementation/js_emitter/old_emitter/container_builder.dart
rename to pkg/compiler/lib/src/js_emitter/old_emitter/container_builder.dart
index 802887d..6fa8fa4 100644
--- a/sdk/lib/_internal/compiler/implementation/js_emitter/old_emitter/container_builder.dart
+++ b/pkg/compiler/lib/src/js_emitter/old_emitter/container_builder.dart
@@ -414,7 +414,7 @@
 
   void addMemberMethodFromInfo(MemberInfo info, ClassBuilder builder) {
     final FunctionElement member = info.member;
-    final String name = info.name;
+    String name = info.name;
     final FunctionSignature parameters = info.parameters;
     jsAst.Expression code = info.code;
     final bool needsStubs = info.needsStubs;
@@ -427,6 +427,13 @@
 
     emitter.interceptorEmitter.recordMangledNameOfMemberMethod(member, name);
 
+    // If this member is called from a subclass via super, we have to add a
+    // renaming. This is encoded by using two names separated with a : as
+    // the property name.
+    if (backend.isAliasedSuperMember(member)) {
+      name = "$name:${namer.getNameOfAliasedSuperMember(member)}";
+    }
+
     if (!needStructuredInfo) {
       compiler.dumpInfoTask.registerElementAst(member,
           builder.addProperty(name, code));
diff --git a/sdk/lib/_internal/compiler/implementation/js_emitter/old_emitter/declarations.dart b/pkg/compiler/lib/src/js_emitter/old_emitter/declarations.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/js_emitter/old_emitter/declarations.dart
rename to pkg/compiler/lib/src/js_emitter/old_emitter/declarations.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_emitter/old_emitter/emitter.dart b/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart
similarity index 95%
rename from sdk/lib/_internal/compiler/implementation/js_emitter/old_emitter/emitter.dart
rename to pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart
index 6c26615..f874056 100644
--- a/sdk/lib/_internal/compiler/implementation/js_emitter/old_emitter/emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart
@@ -303,8 +303,8 @@
   }
 
   /** Needs defineClass to be defined. */
-  List buildInheritFrom() {
-    return [js(r'''
+  jsAst.Expression buildInheritFrom() {
+    return js(r'''
         var inheritFrom = function() {
           function tmp() {}
           var hasOwnProperty = Object.prototype.hasOwnProperty;
@@ -312,14 +312,59 @@
             tmp.prototype = superConstructor.prototype;
             var object = new tmp();
             var properties = constructor.prototype;
-            for (var member in properties)
-              if (hasOwnProperty.call(properties, member))
+            for (var member in properties) {
+              if (hasOwnProperty.call(properties, member)) {
                 object[member] = properties[member];
+              }
+            }
             object.constructor = constructor;
             constructor.prototype = object;
             return object;
           };
         }()
+      ''');
+  }
+
+  /// Code that needs to be run before first invocation of
+  /// [finishClassesFunction], but should only be run once.
+  jsAst.Expression get initFinishClasses {
+    jsAst.Expression allClassesAccess =
+        generateEmbeddedGlobalAccess(embeddedNames.ALL_CLASSES);
+    jsAst.Expression interceptorsByTagAccess =
+        generateEmbeddedGlobalAccess(embeddedNames.INTERCEPTORS_BY_TAG);
+    jsAst.Expression leafTagsAccess =
+        generateEmbeddedGlobalAccess(embeddedNames.LEAF_TAGS);
+    jsAst.Expression finishedClassesAccess =
+        generateEmbeddedGlobalAccess(embeddedNames.FINISHED_CLASSES);
+
+    return js('''
+        (function(){
+         # = Object.create(null);  // embedded allClasses.
+         # = Object.create(null);  // embedded interceptorsByTag.
+         # = Object.create(null);  // embedded leafTags.
+         # = Object.create(null);  // embedded finishedClasses
+        })()
+      ''', [allClassesAccess,
+            interceptorsByTagAccess,
+            leafTagsAccess,
+            finishedClassesAccess]);
+  }
+
+  List buildSplitOffAliases() {
+    return [js(r'''
+        var splitOffAliases = function(constructor) {
+          var hasOwnProperty = Object.prototype.hasOwnProperty;
+          var properties = constructor.prototype;
+          for (var member in properties) {
+            if (hasOwnProperty.call(properties, member)) {
+              var s = member.split(':');
+              if (s.length > 1) {
+                properties[s[0]] = properties[s[1]] = properties[member];
+                delete properties[member];
+              }
+            }
+          }
+        }
       ''')];
   }
 
@@ -342,25 +387,21 @@
         generateEmbeddedGlobalAccess(embeddedNames.ALL_CLASSES);
     jsAst.Expression metadataAccess =
         generateEmbeddedGlobalAccess(embeddedNames.METADATA);
-    jsAst.Expression interceptorsByTagAccess =
-        generateEmbeddedGlobalAccess(embeddedNames.INTERCEPTORS_BY_TAG);
-    jsAst.Expression leafTagsAccess =
-        generateEmbeddedGlobalAccess(embeddedNames.LEAF_TAGS);
 
     return js('''
       function(collectedClasses, isolateProperties, existingIsolateProperties) {
         var pendingClasses = Object.create(null);
-        if (!#) # = Object.create(null);  // embedded allClasses.
-        var allClasses = #;  // embedded allClasses;
+        var allClasses = #allClasses;
+        var constructors;
 
-        if (#)  // DEBUG_FAST_OBJECTS
+        if (#debugFastObjects)
           print("Number of classes: " +
               Object.getOwnPropertyNames(\$\$).length);
 
         var hasOwnProperty = Object.prototype.hasOwnProperty;
 
         if (typeof dart_precompiled == "function") {
-          var constructors = dart_precompiled(collectedClasses);
+          constructors = dart_precompiled(collectedClasses);
         } else {
           var combinedConstructorFunction =
              "function \$reflectable(fn){fn.$reflectableField=1;return fn};\\n"+
@@ -373,8 +414,8 @@
           if (desc instanceof Array) desc = desc[1];
 
           /* The 'fields' are either a constructor function or a
-           * string encoding fields, constructor and superclass.  Get
-           * the superclass and the fields in the format
+           * string encoding fields, constructor and superclass. Gets the
+           * superclass and fields in the format
            *   '[name/]Super;field1,field2'
            * from the CLASS_DESCRIPTOR_PROPERTY property on the descriptor.
            * The 'name/' is optional and contains the name that should be used
@@ -383,7 +424,7 @@
            */
           var classData = desc["${namer.classDescriptorProperty}"],
               supr, name = cls, fields = classData;
-          if (#)  // backend.hasRetainedMetadata
+          if (#hasRetainedMetadata)
             if (typeof classData == "object" &&
                 classData instanceof Array) {
               classData = fields = classData[0];
@@ -405,11 +446,11 @@
             var functionSignature = split[1];
             if (functionSignature)
               desc.\$signature = (function(s) {
-                  return function(){ return #[s]; };  // embedded metadata.
+                  return function(){ return #metadata[s]; };
                 })(functionSignature);
           }
 
-          if (#)  // needsMixinSupport
+          if (#needsMixinSupport)
             if (supr && supr.indexOf("+") > 0) {
               s = supr.split("+");
               supr = s[0];
@@ -447,7 +488,7 @@
             globalObject = desc[0] || isolateProperties;
             desc = desc[1];
           }
-          if (#) //backend.isTreeShakingDisabled,
+          if (#isTreeShakingDisabled)
             constructor["${namer.metadataField}"] = desc;
           allClasses[cls] = constructor;
           globalObject[cls] = constructor;
@@ -455,48 +496,50 @@
 
         constructors = null;
 
-        var finishedClasses = Object.create(null);
-        # = Object.create(null);  // embedded interceptorsByTag.
-        # = Object.create(null);  // embedded leafTags.
+        #finishClassFunction;
 
-        #;  // buildFinishClass(),
-
-        #;  // buildTrivialNsmHandlers()
+        #trivialNsmHandlers;
 
         for (var cls in pendingClasses) finishClass(cls);
-      }''', [
-          allClassesAccess, allClassesAccess,
-          allClassesAccess,
-          DEBUG_FAST_OBJECTS,
-          backend.hasRetainedMetadata,
-          metadataAccess,
-          needsMixinSupport,
-          backend.isTreeShakingDisabled,
-          interceptorsByTagAccess,
-          leafTagsAccess,
-          buildFinishClass(),
-          nsmEmitter.buildTrivialNsmHandlers()]);
+      }''', { 'allClasses': allClassesAccess,
+              'debugFastObjects': DEBUG_FAST_OBJECTS,
+              'hasRetainedMetadata': backend.hasRetainedMetadata,
+              'metadata': metadataAccess,
+              'needsMixinSupport': needsMixinSupport,
+              'isTreeShakingDisabled': backend.isTreeShakingDisabled,
+              'finishClassFunction': buildFinishClass(),
+              'trivialNsmHandlers': nsmEmitter.buildTrivialNsmHandlers()});
   }
 
   jsAst.Node optional(bool condition, jsAst.Node node) {
     return condition ? node : new jsAst.EmptyStatement();
   }
 
-  jsAst.FunctionDeclaration buildFinishClass() {
+  jsAst.Statement buildFinishClass() {
     String specProperty = '"${namer.nativeSpecProperty}"';  // "%"
 
+    jsAst.Expression finishedClassesAccess =
+        generateEmbeddedGlobalAccess(embeddedNames.FINISHED_CLASSES);
     jsAst.Expression interceptorsByTagAccess =
         generateEmbeddedGlobalAccess(embeddedNames.INTERCEPTORS_BY_TAG);
     jsAst.Expression leafTagsAccess =
         generateEmbeddedGlobalAccess(embeddedNames.LEAF_TAGS);
 
     return js.statement('''
+    {
+      var finishedClasses = #;  // finishedClassesAccess.
+
       function finishClass(cls) {
 
         if (finishedClasses[cls]) return;
         finishedClasses[cls] = true;
 
         var superclass = pendingClasses[cls];
+        var constructor = allClasses[cls];
+
+        // Process aliased members due to super calls. We have to do this early
+        // to ensure that we also hit the object class.
+        splitOffAliases(constructor);
 
         // The superclass is only false (empty string) for the Dart Object
         // class.  The minifier together with noSuchMethod can put methods on
@@ -504,7 +547,6 @@
         // that we have a string.
         if (!superclass || typeof superclass != "string") return;
         finishClass(superclass);
-        var constructor = allClasses[cls];
         var superConstructor = allClasses[superclass];
 
         if (!superConstructor)
@@ -561,12 +603,14 @@
             }
           }
         }
-      }''', [!nativeClasses.isEmpty,
-             interceptorsByTagAccess,
-             leafTagsAccess,
-             true,
-             interceptorsByTagAccess,
-             leafTagsAccess]);
+      }
+    }''', [finishedClassesAccess,
+           !nativeClasses.isEmpty,
+           interceptorsByTagAccess,
+           leafTagsAccess,
+           true,
+           interceptorsByTagAccess,
+           leafTagsAccess]);
   }
 
   jsAst.Fun get finishIsolateConstructorFunction {
@@ -671,10 +715,10 @@
   List buildDefineClassAndFinishClassFunctionsIfNecessary() {
     if (!needsDefineClass) return [];
     return defineClassFunction
-    ..addAll(buildInheritFrom())
-    ..addAll([
-      js('$finishClassesName = #', finishClassesFunction)
-    ]);
+    ..add(buildInheritFrom())
+    ..addAll(buildSplitOffAliases())
+    ..add(js('$finishClassesName = #', finishClassesFunction))
+    ..add(initFinishClasses);
   }
 
   List buildLazyInitializerFunctionIfNecessary() {
diff --git a/sdk/lib/_internal/compiler/implementation/js_emitter/old_emitter/interceptor_emitter.dart b/pkg/compiler/lib/src/js_emitter/old_emitter/interceptor_emitter.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/js_emitter/old_emitter/interceptor_emitter.dart
rename to pkg/compiler/lib/src/js_emitter/old_emitter/interceptor_emitter.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_emitter/old_emitter/metadata_emitter.dart b/pkg/compiler/lib/src/js_emitter/old_emitter/metadata_emitter.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/js_emitter/old_emitter/metadata_emitter.dart
rename to pkg/compiler/lib/src/js_emitter/old_emitter/metadata_emitter.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_emitter/old_emitter/nsm_emitter.dart b/pkg/compiler/lib/src/js_emitter/old_emitter/nsm_emitter.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/js_emitter/old_emitter/nsm_emitter.dart
rename to pkg/compiler/lib/src/js_emitter/old_emitter/nsm_emitter.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_emitter/old_emitter/reflection_data_parser.dart b/pkg/compiler/lib/src/js_emitter/old_emitter/reflection_data_parser.dart
similarity index 96%
rename from sdk/lib/_internal/compiler/implementation/js_emitter/old_emitter/reflection_data_parser.dart
rename to pkg/compiler/lib/src/js_emitter/old_emitter/reflection_data_parser.dart
index a1d3610..afd0cae 100644
--- a/sdk/lib/_internal/compiler/implementation/js_emitter/old_emitter/reflection_data_parser.dart
+++ b/pkg/compiler/lib/src/js_emitter/old_emitter/reflection_data_parser.dart
@@ -141,11 +141,16 @@
    * [array].
    */
   jsAst.Statement addStubs = js.statement('''
-  function addStubs(descriptor, array, name, isStatic,
+  function addStubs(descriptor, array, nameTag, isStatic,
                     originalDescriptor, functions) {
+    // The name could be an aliased method, which is only resolved later in
+    // finishClasses. We need to use the actual name for the generated stubs.
+    // Note that no getter for the alias is needed, as getter sends via super
+    // are handled via the prototype chain and not using the alias.
+    var name = nameTag.split(':')[0];
     var f, funcs =
-        [originalDescriptor[name] =
-        descriptor[name] = f = ${readFunction("array", "$FUNCTION_INDEX")}];
+        [originalDescriptor[nameTag] =
+        descriptor[nameTag] = f = ${readFunction("array", "$FUNCTION_INDEX")}];
     f.\$stubName = name;
     functions.push(name);
     for (var index = $FUNCTION_INDEX; index < array.length; index += 2) {
@@ -179,7 +184,7 @@
 
     if (getterStubName) {
       f = tearOff(funcs, array, isStatic, name, isIntercepted);
-      descriptor[name].\$getter = f;
+      descriptor[nameTag].\$getter = f;
       f.\$getterStub = true;
       // Used to create an isolate using spawnFunction.
       if (isStatic) #[name] = f;  // embedded globalFunctions.
diff --git a/sdk/lib/_internal/compiler/implementation/js_emitter/old_emitter/type_test_emitter.dart b/pkg/compiler/lib/src/js_emitter/old_emitter/type_test_emitter.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/js_emitter/old_emitter/type_test_emitter.dart
rename to pkg/compiler/lib/src/js_emitter/old_emitter/type_test_emitter.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_emitter/program_builder.dart b/pkg/compiler/lib/src/js_emitter/program_builder.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/js_emitter/program_builder.dart
rename to pkg/compiler/lib/src/js_emitter/program_builder.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_emitter/registry.dart b/pkg/compiler/lib/src/js_emitter/registry.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/js_emitter/registry.dart
rename to pkg/compiler/lib/src/js_emitter/registry.dart
diff --git a/sdk/lib/_internal/compiler/implementation/library_loader.dart b/pkg/compiler/lib/src/library_loader.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/library_loader.dart
rename to pkg/compiler/lib/src/library_loader.dart
diff --git a/sdk/lib/_internal/compiler/implementation/mirror_renamer/mirror_renamer.dart b/pkg/compiler/lib/src/mirror_renamer/mirror_renamer.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/mirror_renamer/mirror_renamer.dart
rename to pkg/compiler/lib/src/mirror_renamer/mirror_renamer.dart
diff --git a/sdk/lib/_internal/compiler/implementation/mirror_renamer/renamer.dart b/pkg/compiler/lib/src/mirror_renamer/renamer.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/mirror_renamer/renamer.dart
rename to pkg/compiler/lib/src/mirror_renamer/renamer.dart
diff --git a/sdk/lib/_internal/compiler/implementation/mirrors/analyze.dart b/pkg/compiler/lib/src/mirrors/analyze.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/mirrors/analyze.dart
rename to pkg/compiler/lib/src/mirrors/analyze.dart
diff --git a/sdk/lib/_internal/compiler/implementation/mirrors/dart2js_instance_mirrors.dart b/pkg/compiler/lib/src/mirrors/dart2js_instance_mirrors.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/mirrors/dart2js_instance_mirrors.dart
rename to pkg/compiler/lib/src/mirrors/dart2js_instance_mirrors.dart
diff --git a/sdk/lib/_internal/compiler/implementation/mirrors/dart2js_library_mirror.dart b/pkg/compiler/lib/src/mirrors/dart2js_library_mirror.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/mirrors/dart2js_library_mirror.dart
rename to pkg/compiler/lib/src/mirrors/dart2js_library_mirror.dart
diff --git a/sdk/lib/_internal/compiler/implementation/mirrors/dart2js_member_mirrors.dart b/pkg/compiler/lib/src/mirrors/dart2js_member_mirrors.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/mirrors/dart2js_member_mirrors.dart
rename to pkg/compiler/lib/src/mirrors/dart2js_member_mirrors.dart
diff --git a/sdk/lib/_internal/compiler/implementation/mirrors/dart2js_mirrors.dart b/pkg/compiler/lib/src/mirrors/dart2js_mirrors.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/mirrors/dart2js_mirrors.dart
rename to pkg/compiler/lib/src/mirrors/dart2js_mirrors.dart
diff --git a/sdk/lib/_internal/compiler/implementation/mirrors/dart2js_type_mirrors.dart b/pkg/compiler/lib/src/mirrors/dart2js_type_mirrors.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/mirrors/dart2js_type_mirrors.dart
rename to pkg/compiler/lib/src/mirrors/dart2js_type_mirrors.dart
diff --git a/sdk/lib/_internal/compiler/implementation/mirrors/mirrors_util.dart b/pkg/compiler/lib/src/mirrors/mirrors_util.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/mirrors/mirrors_util.dart
rename to pkg/compiler/lib/src/mirrors/mirrors_util.dart
diff --git a/sdk/lib/_internal/compiler/implementation/mirrors/source_mirrors.dart b/pkg/compiler/lib/src/mirrors/source_mirrors.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/mirrors/source_mirrors.dart
rename to pkg/compiler/lib/src/mirrors/source_mirrors.dart
diff --git a/sdk/lib/_internal/compiler/implementation/mirrors_used.dart b/pkg/compiler/lib/src/mirrors_used.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/mirrors_used.dart
rename to pkg/compiler/lib/src/mirrors_used.dart
diff --git a/sdk/lib/_internal/compiler/implementation/native/behavior.dart b/pkg/compiler/lib/src/native/behavior.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/native/behavior.dart
rename to pkg/compiler/lib/src/native/behavior.dart
diff --git a/sdk/lib/_internal/compiler/implementation/native/enqueue.dart b/pkg/compiler/lib/src/native/enqueue.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/native/enqueue.dart
rename to pkg/compiler/lib/src/native/enqueue.dart
diff --git a/sdk/lib/_internal/compiler/implementation/native/js.dart b/pkg/compiler/lib/src/native/js.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/native/js.dart
rename to pkg/compiler/lib/src/native/js.dart
diff --git a/sdk/lib/_internal/compiler/implementation/native/native.dart b/pkg/compiler/lib/src/native/native.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/native/native.dart
rename to pkg/compiler/lib/src/native/native.dart
diff --git a/sdk/lib/_internal/compiler/implementation/native/scanner.dart b/pkg/compiler/lib/src/native/scanner.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/native/scanner.dart
rename to pkg/compiler/lib/src/native/scanner.dart
diff --git a/sdk/lib/_internal/compiler/implementation/native/ssa.dart b/pkg/compiler/lib/src/native/ssa.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/native/ssa.dart
rename to pkg/compiler/lib/src/native/ssa.dart
diff --git a/sdk/lib/_internal/compiler/implementation/ordered_typeset.dart b/pkg/compiler/lib/src/ordered_typeset.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/ordered_typeset.dart
rename to pkg/compiler/lib/src/ordered_typeset.dart
diff --git a/sdk/lib/_internal/compiler/implementation/patch_parser.dart b/pkg/compiler/lib/src/patch_parser.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/patch_parser.dart
rename to pkg/compiler/lib/src/patch_parser.dart
diff --git a/sdk/lib/_internal/compiler/implementation/resolution/class_members.dart b/pkg/compiler/lib/src/resolution/class_members.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/resolution/class_members.dart
rename to pkg/compiler/lib/src/resolution/class_members.dart
diff --git a/pkg/compiler/lib/src/resolution/enum_creator.dart b/pkg/compiler/lib/src/resolution/enum_creator.dart
new file mode 100644
index 0000000..fcc1796
--- /dev/null
+++ b/pkg/compiler/lib/src/resolution/enum_creator.dart
@@ -0,0 +1,267 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library dart2js.resolution.enum_creator;
+
+import '../dart_types.dart';
+import '../dart2jslib.dart';
+import '../elements/elements.dart';
+import '../elements/modelx.dart';
+import '../scanner/scannerlib.dart';
+import '../tree/tree.dart';
+import '../util/util.dart';
+
+// TODO(johnniwinther): Merge functionality with the `TreePrinter`.
+class AstBuilder {
+  final Token position;
+
+  AstBuilder(this.position);
+
+  int get charOffset => position.charOffset;
+
+  final Modifiers finalModifiers =
+      new Modifiers.withFlags(null, Modifiers.FLAG_FINAL);
+  final Modifiers constModifiers =
+      new Modifiers.withFlags(null, Modifiers.FLAG_CONST);
+  final Modifiers staticConstModifiers =
+      new Modifiers.withFlags(null,
+          Modifiers.FLAG_STATIC | Modifiers.FLAG_CONST);
+
+  Token keywordToken(String text) {
+    return new KeywordToken(Keyword.keywords[text], position.charOffset);
+  }
+
+  Token stringToken(String text) {
+    return new StringToken.fromString(IDENTIFIER_INFO, text, charOffset);
+  }
+
+  Token symbolToken(PrecedenceInfo info) {
+    return new SymbolToken(info, charOffset);
+  }
+
+  Identifier identifier(String text) {
+    Keyword keyword = Keyword.keywords[text];
+    Token token;
+    if (keyword != null) {
+      token = new KeywordToken(Keyword.keywords[text], charOffset);
+    } else {
+      token = stringToken(text);
+    }
+    return new Identifier(token);
+  }
+
+  Link linkedList(List elements) {
+    LinkBuilder builder = new LinkBuilder();
+    elements.forEach((e) => builder.addLast(e));
+    return builder.toLink();
+  }
+
+  NodeList argumentList(List<Node> nodes) {
+    return new NodeList(symbolToken(OPEN_PAREN_INFO),
+                        linkedList(nodes),
+                        symbolToken(CLOSE_PAREN_INFO),
+                        ',');
+  }
+
+  Return returnStatement(Expression expression) {
+    return new Return(
+        keywordToken('return'),
+        symbolToken(SEMICOLON_INFO),
+        expression);
+  }
+
+  FunctionExpression functionExpression(Modifiers modifiers,
+                                        String name,
+                                        NodeList argumentList,
+                                        Statement body,
+                                        [TypeAnnotation returnType]) {
+    return new FunctionExpression(
+        identifier(name),
+        argumentList,
+        body,
+        returnType,
+        modifiers,
+        null, // Initializer.
+        null, // get/set.
+        null  // Async modifier.
+        );
+  }
+
+  EmptyStatement emptyStatement() {
+    return new EmptyStatement(symbolToken(COMMA_INFO));
+  }
+
+  LiteralInt literalInt(int value) {
+    return new LiteralInt(stringToken('$value'), null);
+  }
+
+  LiteralString literalString(String text,
+                              {String prefix: '"',
+                                String suffix: '"'}) {
+    return new LiteralString(stringToken('$prefix$text$suffix'),
+                             new DartString.literal(text));
+  }
+
+  LiteralList listLiteral(List<Node> elements, {bool isConst: false}) {
+    return new LiteralList(
+        null,
+        new NodeList(symbolToken(OPEN_SQUARE_BRACKET_INFO),
+                     linkedList(elements),
+                     symbolToken(CLOSE_SQUARE_BRACKET_INFO),
+                     ','),
+        isConst ? keywordToken('const') : null);
+  }
+
+  Node createDefinition(Identifier name, Expression initializer) {
+    if (initializer == null) return name;
+    return new SendSet(null, name, new Operator(symbolToken(EQ_INFO)),
+                 new NodeList.singleton(initializer));
+  }
+
+  VariableDefinitions initializingFormal(String fieldName) {
+    return new VariableDefinitions.forParameter(
+        new NodeList.empty(),
+        null,
+        Modifiers.EMPTY,
+        new NodeList.singleton(
+            new Send(identifier('this'), identifier(fieldName))));
+  }
+
+  NewExpression newExpression(String typeName,
+                              NodeList arguments,
+                              {bool isConst: false}) {
+    return new NewExpression(keywordToken(isConst ? 'const' : 'new'),
+        new Send(null, identifier(typeName), arguments));
+  }
+
+}
+
+class EnumCreator {
+  final Compiler compiler;
+  final EnumClassElementX enumClass;
+
+  EnumCreator(this.compiler, this.enumClass);
+
+  void createMembers() {
+    Enum node = enumClass.node;
+    InterfaceType enumType = enumClass.thisType;
+    AstBuilder builder = new AstBuilder(enumClass.position);
+
+    InterfaceType intType = compiler.intClass.computeType(compiler);
+    InterfaceType stringType = compiler.stringClass.computeType(compiler);
+
+    EnumFieldElementX addInstanceMember(String name, InterfaceType type) {
+      Identifier identifier = builder.identifier(name);
+      VariableList variableList = new VariableList(builder.finalModifiers);
+      variableList.type = type;
+      EnumFieldElementX variable = new EnumFieldElementX(
+          identifier, enumClass, variableList, identifier);
+      enumClass.addMember(variable, compiler);
+      return variable;
+    }
+
+    EnumFieldElementX indexVariable = addInstanceMember('index', intType);
+    EnumFieldElementX nameVariable = addInstanceMember('_name', stringType);
+
+    VariableDefinitions indexDefinition = builder.initializingFormal('index');
+    VariableDefinitions nameDefinition = builder.initializingFormal('_name');
+
+    FunctionExpression constructorNode = builder.functionExpression(
+        builder.constModifiers,
+        enumClass.name,
+        builder.argumentList([indexDefinition, nameDefinition]),
+        builder.emptyStatement());
+
+    EnumConstructorElementX constructor = new EnumConstructorElementX(
+        enumClass,
+        builder.constModifiers,
+        constructorNode);
+
+    EnumFormalElementX indexFormal = new EnumFormalElementX(
+        constructor,
+        indexDefinition,
+        builder.identifier('index'),
+        indexVariable);
+
+    EnumFormalElementX nameFormal = new EnumFormalElementX(
+        constructor,
+        nameDefinition,
+        builder.identifier('_name'),
+        nameVariable);
+
+    FunctionSignatureX constructorSignature = new FunctionSignatureX(
+        requiredParameters: builder.linkedList([indexFormal, nameFormal]),
+        requiredParameterCount: 2,
+        type: new FunctionType(constructor, const VoidType(),
+            <DartType>[intType, stringType]));
+    constructor.functionSignatureCache = constructorSignature;
+    enumClass.addMember(constructor, compiler);
+
+    VariableList variableList = new VariableList(builder.staticConstModifiers);
+    variableList.type = enumType;
+    int index = 0;
+    List<Node> valueReferences = <Node>[];
+    for (Link<Node> link = node.names.nodes;
+         !link.isEmpty;
+         link = link.tail) {
+      Identifier name = link.head;
+      AstBuilder valueBuilder = new AstBuilder(name.token);
+      valueReferences.add(new Send(null, name));
+
+      Expression initializer = valueBuilder.newExpression(
+          enumClass.name,
+          valueBuilder.argumentList([
+            valueBuilder.literalInt(index),
+            valueBuilder.literalString('${name.source}')
+          ]),
+          isConst: true);
+      SendSet definition = valueBuilder.createDefinition(name, initializer);
+
+      EnumFieldElementX field = new EnumFieldElementX(
+          name, enumClass, variableList, definition, initializer);
+      enumClass.addMember(field, compiler);
+      index++;
+    }
+
+    VariableList valuesVariableList =
+        new VariableList(builder.staticConstModifiers);
+    InterfaceType listType = compiler.listClass.computeType(compiler);
+    valuesVariableList.type = listType.createInstantiation([enumType]);
+
+    Identifier valuesIdentifier = builder.identifier('values');
+    // TODO(johnniwinther): Add type argument.
+    Expression initializer = builder.listLiteral(
+        valueReferences, isConst: true);
+
+    Node definition = builder.createDefinition(valuesIdentifier, initializer);
+
+    EnumFieldElementX valuesVariable = new EnumFieldElementX(
+        valuesIdentifier, enumClass, valuesVariableList,
+        definition, initializer);
+
+    enumClass.addMember(valuesVariable, compiler);
+
+    // TODO(johnniwinther): Support return type. Note `String` might be prefixed
+    // or not imported within the current library.
+    FunctionExpression toStringNode = builder.functionExpression(
+        Modifiers.EMPTY,
+        'toString',
+        builder.argumentList([]),
+        builder.returnStatement(
+            new StringInterpolation(
+                builder.literalString('${enumClass.name}.', suffix: ''),
+                new NodeList.singleton(new StringInterpolationPart(
+                    new Send(null, builder.identifier('_name')),
+                    builder.literalString('', prefix: '')))
+            ))
+        );
+
+    EnumMethodElementX toString = new EnumMethodElementX('toString',
+        enumClass, Modifiers.EMPTY, toStringNode);
+    FunctionSignatureX toStringSignature = new FunctionSignatureX(
+        type: new FunctionType(toString, stringType));
+    toString.functionSignatureCache = toStringSignature;
+    enumClass.addMember(toString, compiler);
+  }
+}
\ No newline at end of file
diff --git a/sdk/lib/_internal/compiler/implementation/resolution/member_impl.dart b/pkg/compiler/lib/src/resolution/member_impl.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/resolution/member_impl.dart
rename to pkg/compiler/lib/src/resolution/member_impl.dart
diff --git a/sdk/lib/_internal/compiler/implementation/resolution/members.dart b/pkg/compiler/lib/src/resolution/members.dart
similarity index 98%
rename from sdk/lib/_internal/compiler/implementation/resolution/members.dart
rename to pkg/compiler/lib/src/resolution/members.dart
index 937d308..353bfdf 100644
--- a/sdk/lib/_internal/compiler/implementation/resolution/members.dart
+++ b/pkg/compiler/lib/src/resolution/members.dart
@@ -1118,6 +1118,11 @@
       return;
     }
 
+    if (mixin.isEnumClass) {
+      // Mixing in an enum has already caused a compile-time error.
+      return;
+    }
+
     // Check that the mixed in class has Object as its superclass.
     if (!mixin.superclass.isObject) {
       compiler.reportError(mixin, MessageKind.ILLEGAL_MIXIN_SUPERCLASS);
@@ -3370,6 +3375,12 @@
     // and only declaration elements may be registered.
     registry.registerStaticUse(constructor.declaration);
     ClassElement cls = constructor.enclosingClass;
+    if (cls.isEnumClass && currentClass != cls) {
+      compiler.reportError(node,
+                           MessageKind.CANNOT_INSTANTIATE_ENUM,
+                           {'enumName': cls.name});
+    }
+
     InterfaceType type = registry.getType(node);
     if (node.isConst && type.containsTypeVariables) {
       compiler.reportError(node.send.selector,
@@ -4335,6 +4346,26 @@
     return element.computeType(compiler);
   }
 
+  @override
+  DartType visitEnum(Enum node) {
+    if (!compiler.enableEnums) {
+      compiler.reportError(node, MessageKind.EXPERIMENTAL_ENUMS);
+    }
+
+    invariant(node, element != null);
+    invariant(element, element.resolutionState == STATE_STARTED,
+        message: () => 'cyclic resolution of class $element');
+
+    InterfaceType enumType = element.computeType(compiler);
+    element.supertype = compiler.objectClass.computeType(compiler);
+    element.interfaces = const Link<DartType>();
+    calculateAllSupertypes(element);
+
+    EnumCreator creator = new EnumCreator(compiler, element);
+    creator.createMembers();
+    return enumType;
+  }
+
   /// Resolves the mixed type for [mixinNode] and checks that the the mixin type
   /// is a valid, non-blacklisted interface type. The mixin type is returned.
   DartType checkMixinType(TypeAnnotation mixinNode) {
@@ -4347,6 +4378,9 @@
     } else if (mixinType.isMalformed) {
       compiler.reportError(mixinNode, MessageKind.CANNOT_MIXIN_MALFORMED,
           {'className': element.name, 'malformedType': mixinType});
+    } else if (mixinType.isEnumType) {
+      compiler.reportError(mixinNode, MessageKind.CANNOT_MIXIN_ENUM,
+          {'className': element.name, 'enumType': mixinType});
     }
     return mixinType;
   }
@@ -4531,11 +4565,15 @@
   DartType resolveSupertype(ClassElement cls, TypeAnnotation superclass) {
     DartType supertype = resolveType(superclass);
     if (supertype != null) {
-      if (identical(supertype.kind, TypeKind.MALFORMED_TYPE)) {
+      if (supertype.isMalformed) {
         compiler.reportError(superclass, MessageKind.CANNOT_EXTEND_MALFORMED,
             {'className': element.name, 'malformedType': supertype});
         return objectType;
-      } else if (!identical(supertype.kind, TypeKind.INTERFACE)) {
+      } else if (supertype.isEnumType) {
+        compiler.reportError(superclass, MessageKind.CANNOT_EXTEND_ENUM,
+            {'className': element.name, 'enumType': supertype});
+        return objectType;
+      } else if (!supertype.isInterfaceType) {
         compiler.reportError(superclass.typeName,
             MessageKind.CLASS_NAME_EXPECTED);
         return objectType;
@@ -4554,11 +4592,15 @@
     for (Link<Node> link = interfaces.nodes; !link.isEmpty; link = link.tail) {
       DartType interfaceType = resolveType(link.head);
       if (interfaceType != null) {
-        if (identical(interfaceType.kind, TypeKind.MALFORMED_TYPE)) {
+        if (interfaceType.isMalformed) {
           compiler.reportError(superclass,
               MessageKind.CANNOT_IMPLEMENT_MALFORMED,
               {'className': element.name, 'malformedType': interfaceType});
-        } else if (!identical(interfaceType.kind, TypeKind.INTERFACE)) {
+        } else if (interfaceType.isEnumType) {
+          compiler.reportError(superclass,
+              MessageKind.CANNOT_IMPLEMENT_ENUM,
+              {'className': element.name, 'enumType': interfaceType});
+        } else if (!interfaceType.isInterfaceType) {
           // TODO(johnniwinther): Handle dynamic.
           TypeAnnotation typeAnnotation = link.head;
           error(typeAnnotation.typeName, MessageKind.CLASS_NAME_EXPECTED);
@@ -4701,6 +4743,10 @@
     visitNodeList(node.interfaces);
   }
 
+  void visitEnum(Enum node) {
+    loadSupertype(compiler.objectClass, node);
+  }
+
   void visitMixinApplication(MixinApplication node) {
     node.superclass.accept(this);
     visitNodeList(node.mixins);
diff --git a/sdk/lib/_internal/compiler/implementation/resolution/registry.dart b/pkg/compiler/lib/src/resolution/registry.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/resolution/registry.dart
rename to pkg/compiler/lib/src/resolution/registry.dart
diff --git a/sdk/lib/_internal/compiler/implementation/resolution/resolution.dart b/pkg/compiler/lib/src/resolution/resolution.dart
similarity index 95%
rename from sdk/lib/_internal/compiler/implementation/resolution/resolution.dart
rename to pkg/compiler/lib/src/resolution/resolution.dart
index 217b3eb..8c1f867 100644
--- a/sdk/lib/_internal/compiler/implementation/resolution/resolution.dart
+++ b/pkg/compiler/lib/src/resolution/resolution.dart
@@ -12,6 +12,7 @@
 import '../dart_types.dart';
 import '../dart2jslib.dart';
 import '../tree/tree.dart';
+import '../scanner/scannerlib.dart';
 import '../elements/elements.dart';
 import '../elements/modelx.dart'
     show BaseClassElementX,
@@ -41,6 +42,7 @@
 import '../util/util.dart';
 
 import 'class_members.dart' show MembersCreator;
+import 'enum_creator.dart';
 import 'secret_tree_element.dart' show getTreeElement, setTreeElement;
 
 part 'members.dart';
diff --git a/sdk/lib/_internal/compiler/implementation/resolution/scope.dart b/pkg/compiler/lib/src/resolution/scope.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/resolution/scope.dart
rename to pkg/compiler/lib/src/resolution/scope.dart
diff --git a/sdk/lib/_internal/compiler/implementation/resolution/secret_tree_element.dart b/pkg/compiler/lib/src/resolution/secret_tree_element.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/resolution/secret_tree_element.dart
rename to pkg/compiler/lib/src/resolution/secret_tree_element.dart
diff --git a/sdk/lib/_internal/compiler/implementation/resolution/signatures.dart b/pkg/compiler/lib/src/resolution/signatures.dart
similarity index 96%
rename from sdk/lib/_internal/compiler/implementation/resolution/signatures.dart
rename to pkg/compiler/lib/src/resolution/signatures.dart
index 08bb37f..8b31d43 100644
--- a/sdk/lib/_internal/compiler/implementation/resolution/signatures.dart
+++ b/pkg/compiler/lib/src/resolution/signatures.dart
@@ -350,13 +350,14 @@
         optionalParameterTypes,
         namedParameters,
         namedParameterTypes);
-    return new FunctionSignatureX(parameters,
-                                  visitor.optionalParameters,
-                                  requiredParameterCount,
-                                  visitor.optionalParameterCount,
-                                  visitor.optionalParametersAreNamed,
-                                  orderedOptionalParameters,
-                                  type);
+    return new FunctionSignatureX(
+        requiredParameters: parameters,
+        optionalParameters: visitor.optionalParameters,
+        requiredParameterCount: requiredParameterCount,
+        optionalParameterCount: visitor.optionalParameterCount,
+        optionalParametersAreNamed: visitor.optionalParametersAreNamed,
+        orderedOptionalParameters: orderedOptionalParameters,
+        type: type);
   }
 
   DartType resolveTypeAnnotation(TypeAnnotation annotation) {
diff --git a/sdk/lib/_internal/compiler/implementation/resolved_visitor.dart b/pkg/compiler/lib/src/resolved_visitor.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/resolved_visitor.dart
rename to pkg/compiler/lib/src/resolved_visitor.dart
diff --git a/sdk/lib/_internal/compiler/implementation/scanner/array_based_scanner.dart b/pkg/compiler/lib/src/scanner/array_based_scanner.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/scanner/array_based_scanner.dart
rename to pkg/compiler/lib/src/scanner/array_based_scanner.dart
diff --git a/sdk/lib/_internal/compiler/implementation/scanner/class_element_parser.dart b/pkg/compiler/lib/src/scanner/class_element_parser.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/scanner/class_element_parser.dart
rename to pkg/compiler/lib/src/scanner/class_element_parser.dart
diff --git a/sdk/lib/_internal/compiler/implementation/scanner/keyword.dart b/pkg/compiler/lib/src/scanner/keyword.dart
similarity index 98%
rename from sdk/lib/_internal/compiler/implementation/scanner/keyword.dart
rename to pkg/compiler/lib/src/scanner/keyword.dart
index 1e01efb..ffcf036 100644
--- a/sdk/lib/_internal/compiler/implementation/scanner/keyword.dart
+++ b/pkg/compiler/lib/src/scanner/keyword.dart
@@ -48,6 +48,7 @@
       const Keyword("abstract", isBuiltIn: true),
       const Keyword("as", info: AS_INFO, isBuiltIn: true),
       const Keyword("dynamic", isBuiltIn: true),
+      const Keyword("enum", isBuiltIn: true),
       const Keyword("export", isBuiltIn: true),
       const Keyword("external", isBuiltIn: true),
       const Keyword("factory", isBuiltIn: true),
diff --git a/sdk/lib/_internal/compiler/implementation/scanner/listener.dart b/pkg/compiler/lib/src/scanner/listener.dart
similarity index 98%
rename from sdk/lib/_internal/compiler/implementation/scanner/listener.dart
rename to pkg/compiler/lib/src/scanner/listener.dart
index 89f20d4..aa52241 100644
--- a/sdk/lib/_internal/compiler/implementation/scanner/listener.dart
+++ b/pkg/compiler/lib/src/scanner/listener.dart
@@ -82,6 +82,12 @@
                            Token endToken) {
   }
 
+  void beginEnum(Token enumKeyword) {
+  }
+
+  void endEnum(Token enumKeyword, Token endBrace, int count) {
+  }
+
   void beginExport(Token token) {
   }
 
@@ -859,6 +865,17 @@
                              isDeferred: isDeferred));
   }
 
+  void endEnum(Token enumKeyword, Token endBrace, int count) {
+    NodeList names = makeNodeList(count, enumKeyword.next.next, endBrace, ",");
+    Identifier name = popNode();
+
+    int id = idGenerator();
+    Element enclosing = compilationUnitElement;
+    pushElement(new EnumClassElementX(name.source, enclosing, id,
+        new Enum(enumKeyword, name, names)));
+    rejectBuiltInIdentifier(name);
+  }
+
   void endExport(Token exportKeyword, Token semicolon) {
     NodeList combinators = popNode();
     StringNode uri = popNode();
@@ -1535,6 +1552,12 @@
                                        classKeyword, endToken));
   }
 
+  void endEnum(Token enumKeyword, Token endBrace, int count) {
+    NodeList names = makeNodeList(count, enumKeyword.next.next, endBrace, ",");
+    Identifier name = popNode();
+    pushNode(new Enum(enumKeyword, name, names));
+  }
+
   void endClassBody(int memberCount, Token beginToken, Token endToken) {
     pushNode(makeNodeList(memberCount, beginToken, endToken, null));
   }
diff --git a/sdk/lib/_internal/compiler/implementation/scanner/parser.dart b/pkg/compiler/lib/src/scanner/parser.dart
similarity index 98%
rename from sdk/lib/_internal/compiler/implementation/scanner/parser.dart
rename to pkg/compiler/lib/src/scanner/parser.dart
index b13a7b5..057cc30 100644
--- a/sdk/lib/_internal/compiler/implementation/scanner/parser.dart
+++ b/pkg/compiler/lib/src/scanner/parser.dart
@@ -64,6 +64,8 @@
     if ((identical(value, 'abstract') && optional('class', token.next))
         || identical(value, 'class')) {
       return parseClassOrNamedMixinApplication(token);
+    } else if (identical(value, 'enum')) {
+      return parseEnum(token);
     } else if (identical(value, 'typedef')) {
       return parseTypedef(token);
     } else if (identical(value, 'library')) {
@@ -456,6 +458,28 @@
     return beginGroupToken.endGroup;
   }
 
+  Token parseEnum(Token token) {
+    listener.beginEnum(token);
+    Token enumKeyword = token;
+    token = parseIdentifier(token.next);
+    token = expect('{', token);
+    int count = 0;
+    if (!optional('}', token)) {
+      token = parseIdentifier(token);
+      count++;
+      while (optional(',', token)) {
+        token = token.next;
+        if (optional('}', token)) break;
+        token = parseIdentifier(token);
+        count++;
+      }
+    }
+    Token endBrace = token;
+    token = expect('}', token);
+    listener.endEnum(enumKeyword, endBrace, count);
+    return token;
+  }
+
   Token parseClassOrNamedMixinApplication(Token token) {
     Token begin = token;
     Token abstractKeyword;
diff --git a/sdk/lib/_internal/compiler/implementation/scanner/parser_task.dart b/pkg/compiler/lib/src/scanner/parser_task.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/scanner/parser_task.dart
rename to pkg/compiler/lib/src/scanner/parser_task.dart
diff --git a/sdk/lib/_internal/compiler/implementation/scanner/partial_parser.dart b/pkg/compiler/lib/src/scanner/partial_parser.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/scanner/partial_parser.dart
rename to pkg/compiler/lib/src/scanner/partial_parser.dart
diff --git a/sdk/lib/_internal/compiler/implementation/scanner/scanner.dart b/pkg/compiler/lib/src/scanner/scanner.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/scanner/scanner.dart
rename to pkg/compiler/lib/src/scanner/scanner.dart
diff --git a/sdk/lib/_internal/compiler/implementation/scanner/scanner_task.dart b/pkg/compiler/lib/src/scanner/scanner_task.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/scanner/scanner_task.dart
rename to pkg/compiler/lib/src/scanner/scanner_task.dart
diff --git a/sdk/lib/_internal/compiler/implementation/scanner/scannerlib.dart b/pkg/compiler/lib/src/scanner/scannerlib.dart
similarity index 97%
rename from sdk/lib/_internal/compiler/implementation/scanner/scannerlib.dart
rename to pkg/compiler/lib/src/scanner/scannerlib.dart
index cd420a6..8177496 100644
--- a/sdk/lib/_internal/compiler/implementation/scanner/scannerlib.dart
+++ b/pkg/compiler/lib/src/scanner/scannerlib.dart
@@ -15,6 +15,7 @@
     ConstructorElementX,
     DeclarationSite,
     ElementX,
+    EnumClassElementX,
     FieldElementX,
     FunctionElementX,
     MetadataAnnotationX,
diff --git a/sdk/lib/_internal/compiler/implementation/scanner/string_scanner.dart b/pkg/compiler/lib/src/scanner/string_scanner.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/scanner/string_scanner.dart
rename to pkg/compiler/lib/src/scanner/string_scanner.dart
diff --git a/sdk/lib/_internal/compiler/implementation/scanner/token.dart b/pkg/compiler/lib/src/scanner/token.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/scanner/token.dart
rename to pkg/compiler/lib/src/scanner/token.dart
diff --git a/sdk/lib/_internal/compiler/implementation/scanner/utf8_bytes_scanner.dart b/pkg/compiler/lib/src/scanner/utf8_bytes_scanner.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/scanner/utf8_bytes_scanner.dart
rename to pkg/compiler/lib/src/scanner/utf8_bytes_scanner.dart
diff --git a/sdk/lib/_internal/compiler/implementation/script.dart b/pkg/compiler/lib/src/script.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/script.dart
rename to pkg/compiler/lib/src/script.dart
diff --git a/sdk/lib/_internal/compiler/implementation/source_file.dart b/pkg/compiler/lib/src/source_file.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/source_file.dart
rename to pkg/compiler/lib/src/source_file.dart
diff --git a/sdk/lib/_internal/compiler/implementation/source_file_provider.dart b/pkg/compiler/lib/src/source_file_provider.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/source_file_provider.dart
rename to pkg/compiler/lib/src/source_file_provider.dart
diff --git a/sdk/lib/_internal/compiler/implementation/source_map_builder.dart b/pkg/compiler/lib/src/source_map_builder.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/source_map_builder.dart
rename to pkg/compiler/lib/src/source_map_builder.dart
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/builder.dart b/pkg/compiler/lib/src/ssa/builder.dart
similarity index 98%
rename from sdk/lib/_internal/compiler/implementation/ssa/builder.dart
rename to pkg/compiler/lib/src/ssa/builder.dart
index abd5e29..4b9e765 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
+++ b/pkg/compiler/lib/src/ssa/builder.dart
@@ -1006,6 +1006,9 @@
   // implementation/declaration distinction.
   Element get sourceElement => sourceElementStack.last;
 
+  bool get _checkOrTrustTypes =>
+      compiler.enableTypeAssertions || compiler.trustTypeAnnotations;
+
   HBasicBlock addNewBlock() {
     HBasicBlock block = graph.addNewBlock();
     // If adding a new block during building of an expression, it is due to
@@ -1483,8 +1486,7 @@
     // If the method is intercepted, we want the actual receiver
     // to be the first parameter.
     graph.entry.addBefore(graph.entry.last, parameter);
-    HInstruction value =
-        potentiallyCheckType(parameter, field.type);
+    HInstruction value = potentiallyCheckOrTrustType(parameter, field.type);
     add(new HFieldSet(field, thisInstruction, value));
     return closeFunction();
   }
@@ -1492,10 +1494,11 @@
   HGraph buildLazyInitializer(VariableElement variable) {
     ast.Node node = variable.node;
     openFunction(variable, node);
-    assert(variable.initializer != null);
+    assert(invariant(variable, variable.initializer != null,
+        message: "Non-constant variable $variable has no initializer."));
     visit(variable.initializer);
     HInstruction value = pop();
-    value = potentiallyCheckType(value, variable.type);
+    value = potentiallyCheckOrTrustType(value, variable.type);
     closeAndGotoExit(new HReturn(value));
     return closeFunction();
   }
@@ -1658,12 +1661,12 @@
    * function.
    */
   void potentiallyCheckInlinedParameterTypes(FunctionElement function) {
-    if (!compiler.enableTypeAssertions) return;
+    if (!_checkOrTrustTypes) return;
 
     FunctionSignature signature = function.functionSignature;
     signature.orderedForEachParameter((ParameterElement parameter) {
       HInstruction argument = localsHandler.readLocal(parameter);
-      potentiallyCheckType(argument, parameter.type);
+      potentiallyCheckOrTrustType(argument, parameter.type);
     });
   }
 
@@ -1974,7 +1977,7 @@
           } else {
             fields.add(member);
             DartType type = localsHandler.substInContext(member.type);
-            constructorArguments.add(potentiallyCheckType(value, type));
+            constructorArguments.add(potentiallyCheckOrTrustType(value, type));
           }
         },
         includeSuperAndInjectedMembers: true);
@@ -2219,7 +2222,7 @@
           //
           // Only the final target is allowed to check for the argument types.
           newParameter =
-              potentiallyCheckType(newParameter, parameterElement.type);
+              potentiallyCheckOrTrustType(newParameter, parameterElement.type);
         }
         localsHandler.directLocals[parameterElement] = newParameter;
       });
@@ -2296,25 +2299,43 @@
     }
   }
 
-  HInstruction potentiallyBuildTypeHint(HInstruction original, DartType type) {
-    if (!compiler.trustTypeAnnotations || type == null) return original;
+  HInstruction _trustType(HInstruction original, DartType type) {
+    assert(compiler.trustTypeAnnotations);
+    assert(type != null);
     type = localsHandler.substInContext(type);
+    type = type.unalias(compiler);
+    if (type.isDynamic) return original;
     if (!type.isInterfaceType) return original;
-    TypeMask mask = new TypeMask.subtype(type.element, compiler.world);
-    var result = new HTypeKnown.pinned(mask, original);
-    return result;
+    // The type element is either a class or the void element.
+    Element element = type.element;
+    if (element == compiler.objectClass) return original;
+    TypeMask mask = new TypeMask.subtype(element, compiler.world);
+    return new HTypeKnown.pinned(mask, original);
   }
 
-  HInstruction potentiallyCheckType(HInstruction original, DartType type,
-      { int kind: HTypeConversion.CHECKED_MODE_CHECK }) {
-    if (!compiler.enableTypeAssertions) return original;
+  HInstruction _checkType(HInstruction original, DartType type, int kind) {
+    assert(compiler.enableTypeAssertions);
+    assert(type != null);
     type = localsHandler.substInContext(type);
     HInstruction other = buildTypeConversion(original, type, kind);
-    if (other != original) add(other);
     registry.registerIsCheck(type);
     return other;
   }
 
+  HInstruction potentiallyCheckOrTrustType(HInstruction original, DartType type,
+      { int kind: HTypeConversion.CHECKED_MODE_CHECK }) {
+    if (type == null) return original;
+    HInstruction checkedOrTrusted = original;
+    if (compiler.trustTypeAnnotations) {
+      checkedOrTrusted = _trustType(original, type);
+    } else if (compiler.enableTypeAssertions) {
+      checkedOrTrusted = _checkType(original, type, kind);
+    }
+    if (checkedOrTrusted == original) return original;
+    add(checkedOrTrusted);
+    return checkedOrTrusted;
+  }
+
   void assertIsSubtype(ast.Node node, DartType subtype, DartType supertype,
                        String message) {
     HInstruction subtypeInstruction =
@@ -2358,8 +2379,8 @@
 
   HInstruction popBoolified() {
     HInstruction value = pop();
-    if (compiler.enableTypeAssertions) {
-      return potentiallyCheckType(
+    if (_checkOrTrustTypes) {
+      return potentiallyCheckOrTrustType(
           value,
           compiler.boolClass.rawType,
           kind: HTypeConversion.BOOLEAN_CONVERSION_CHECK);
@@ -3186,8 +3207,7 @@
         pop();
       } else {
         VariableElement field = element;
-        value =
-            potentiallyCheckType(value, field.type);
+        value = potentiallyCheckOrTrustType(value, field.type);
         addWithPosition(new HStaticStore(element, value), location);
       }
       stack.add(value);
@@ -3205,20 +3225,14 @@
       if (value.sourceElement == null) {
         value.sourceElement = local;
       }
-      HInstruction checked =
-          potentiallyCheckType(value, local.type);
-      if (!identical(checked, value)) {
+      HInstruction checkedOrTrusted =
+          potentiallyCheckOrTrustType(value, local.type);
+      if (!identical(checkedOrTrusted, value)) {
         pop();
-        stack.add(checked);
-      }
-      HInstruction trusted =
-          potentiallyBuildTypeHint(checked, local.type);
-      if (!identical(trusted, checked)) {
-        pop();
-        push(trusted);
+        stack.add(checkedOrTrusted);
       }
 
-      localsHandler.updateLocal(local, trusted);
+      localsHandler.updateLocal(local, checkedOrTrusted);
     }
   }
 
@@ -4304,7 +4318,7 @@
 
     // Finally, if we called a redirecting factory constructor, check the type.
     if (isRedirected) {
-      HInstruction checked = potentiallyCheckType(newInstance, type);
+      HInstruction checked = potentiallyCheckOrTrustType(newInstance, type);
       if (checked != newInstance) {
         pop();
         stack.add(checked);
@@ -5042,7 +5056,7 @@
     } else {
       visit(node.expression);
       value = pop();
-      value = potentiallyCheckType(value, returnType);
+      value = potentiallyCheckOrTrustType(value, returnType);
     }
 
     handleInTryStatement();
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart b/pkg/compiler/lib/src/ssa/codegen.dart
similarity index 98%
rename from sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
rename to pkg/compiler/lib/src/ssa/codegen.dart
index f67fe00..2eaad68 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
+++ b/pkg/compiler/lib/src/ssa/codegen.dart
@@ -253,6 +253,7 @@
   void preGenerateMethod(HGraph graph) {
     new SsaInstructionSelection(compiler).visitGraph(graph);
     new SsaTypeKnownRemover().visitGraph(graph);
+    new SsaTrustedCheckRemover(compiler).visitGraph(graph);
     new SsaInstructionMerger(generateAtUseSite, compiler).visitGraph(graph);
     new SsaConditionMerger(
         generateAtUseSite, controlFlowOperators).visitGraph(graph);
@@ -1682,14 +1683,23 @@
         registry.registerDynamicGetter(selector);
         registry.registerGetterForSuperMethod(node.element);
         methodName = backend.namer.invocationName(selector);
-      } else {
-        methodName = backend.namer.getNameOfInstanceMember(superMethod);
-      }
-      push(
+        push(
           js.js('#.prototype.#.call(#)', [
-              backend.namer.elementAccess(superClass),
-              methodName, visitArguments(node.inputs, start: 0)]),
+            backend.namer.elementAccess(superClass),
+            methodName, visitArguments(node.inputs, start: 0)]),
           node);
+      } else {
+        methodName =
+            backend.namer.getNameOfAliasedSuperMember(superMethod);
+        backend.registerAliasedSuperMember(superMethod);
+        use(node.inputs.first);
+        push(
+          js.js('#.#(#)', [
+            pop(), methodName,
+            visitArguments(node.inputs, start: 1)]),
+          node);
+      }
+
     }
   }
 
@@ -2563,8 +2573,9 @@
     if (node.isArgumentTypeCheck || node.isReceiverTypeCheck) {
       ClassWorld classWorld = compiler.world;
       // An int check if the input is not int or null, is not
-      // sufficient for doing a argument or receiver check.
-      assert(!node.checkedType.containsOnlyInt(classWorld) ||
+      // sufficient for doing an argument or receiver check.
+      assert(compiler.trustTypeAnnotations ||
+             !node.checkedType.containsOnlyInt(classWorld) ||
              node.checkedInput.isIntegerOrNull(compiler));
       js.Expression test = generateTest(node.checkedInput, node.checkedType);
       js.Block oldContainer = currentContainer;
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/codegen_helpers.dart b/pkg/compiler/lib/src/ssa/codegen_helpers.dart
similarity index 96%
rename from sdk/lib/_internal/compiler/implementation/ssa/codegen_helpers.dart
rename to pkg/compiler/lib/src/ssa/codegen_helpers.dart
index abc6c86..3b5c557 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/codegen_helpers.dart
+++ b/pkg/compiler/lib/src/ssa/codegen_helpers.dart
@@ -273,6 +273,37 @@
 }
 
 /**
+ * Remove [HTypeConversion] instructions from the graph in '--trust-primitives'
+ * mode.
+ */
+class SsaTrustedCheckRemover extends HBaseVisitor {
+
+  Compiler compiler;
+  SsaTrustedCheckRemover(this.compiler);
+
+  void visitGraph(HGraph graph) {
+    if (!compiler.trustPrimitives) return;
+    visitDominatorTree(graph);
+  }
+
+  void visitBasicBlock(HBasicBlock block) {
+    HInstruction instruction = block.first;
+    while (instruction != null) {
+      HInstruction next = instruction.next;
+      instruction.accept(this);
+      instruction = next;
+    }
+  }
+
+  void visitTypeConversion(HTypeConversion instruction) {
+    if (instruction.isReceiverTypeCheck || instruction.isArgumentTypeCheck) {
+      instruction.block.rewrite(instruction, instruction.checkedInput);
+      instruction.block.remove(instruction);
+    }
+  }
+}
+
+/**
  * Instead of emitting each SSA instruction with a temporary variable
  * mark instructions that can be emitted at their use-site.
  * For example, in:
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/interceptor_simplifier.dart b/pkg/compiler/lib/src/ssa/interceptor_simplifier.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/ssa/interceptor_simplifier.dart
rename to pkg/compiler/lib/src/ssa/interceptor_simplifier.dart
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/invoke_dynamic_specializers.dart b/pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/ssa/invoke_dynamic_specializers.dart
rename to pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/nodes.dart b/pkg/compiler/lib/src/ssa/nodes.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/ssa/nodes.dart
rename to pkg/compiler/lib/src/ssa/nodes.dart
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart b/pkg/compiler/lib/src/ssa/optimize.dart
similarity index 98%
rename from sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
rename to pkg/compiler/lib/src/ssa/optimize.dart
index 28f0632..43300de 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
+++ b/pkg/compiler/lib/src/ssa/optimize.dart
@@ -33,6 +33,7 @@
   void optimize(CodegenWorkItem work, HGraph graph) {
     ConstantSystem constantSystem = compiler.backend.constantSystem;
     JavaScriptItemCompilationContext context = work.compilationContext;
+    bool trustPrimitives = compiler.trustPrimitives;
     measure(() {
       SsaDeadCodeEliminator dce;
       List<OptimizationPhase> phases = <OptimizationPhase>[
@@ -46,9 +47,11 @@
           // After type propagation, more instructions can be
           // simplified.
           new SsaInstructionSimplifier(constantSystem, backend, work),
-          new SsaCheckInserter(backend, work, context.boundsChecked),
+          new SsaCheckInserter(
+              trustPrimitives, backend, work, context.boundsChecked),
           new SsaInstructionSimplifier(constantSystem, backend, work),
-          new SsaCheckInserter(backend, work, context.boundsChecked),
+          new SsaCheckInserter(
+              trustPrimitives, backend, work, context.boundsChecked),
           new SsaTypePropagator(compiler),
           // Run a dead code eliminator before LICM because dead
           // interceptors are often in the way of LICM'able instructions.
@@ -65,7 +68,8 @@
           // Previous optimizations may have generated new
           // opportunities for instruction simplification.
           new SsaInstructionSimplifier(constantSystem, backend, work),
-          new SsaCheckInserter(backend, work, context.boundsChecked),
+          new SsaCheckInserter(
+              trustPrimitives, backend, work, context.boundsChecked),
           new SsaSimplifyInterceptors(compiler, constantSystem, work),
           dce = new SsaDeadCodeEliminator(compiler),
           new SsaTypePropagator(compiler)];
@@ -76,7 +80,8 @@
             new SsaCodeMotion(),
             new SsaValueRangeAnalyzer(compiler, constantSystem, work),
             new SsaInstructionSimplifier(constantSystem, backend, work),
-            new SsaCheckInserter(backend, work, context.boundsChecked),
+            new SsaCheckInserter(
+                trustPrimitives, backend, work, context.boundsChecked),
             new SsaSimplifyInterceptors(compiler, constantSystem, work),
             new SsaDeadCodeEliminator(compiler)];
       } else {
@@ -886,16 +891,24 @@
 class SsaCheckInserter extends HBaseVisitor implements OptimizationPhase {
   final Set<HInstruction> boundsChecked;
   final CodegenWorkItem work;
+  final bool trustPrimitives;
   final JavaScriptBackend backend;
   final String name = "SsaCheckInserter";
   HGraph graph;
 
-  SsaCheckInserter(this.backend,
+  SsaCheckInserter(this.trustPrimitives,
+                   this.backend,
                    this.work,
                    this.boundsChecked);
 
   void visitGraph(HGraph graph) {
     this.graph = graph;
+
+    // In --trust-primitives mode we don't add bounds checks.  This is better
+    // than trying to remove them later as the limit expression would become
+    // dead and require DCE.
+    if (trustPrimitives) return;
+
     visitDominatorTree(graph);
   }
 
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/ssa.dart b/pkg/compiler/lib/src/ssa/ssa.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/ssa/ssa.dart
rename to pkg/compiler/lib/src/ssa/ssa.dart
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/ssa_tracer.dart b/pkg/compiler/lib/src/ssa/ssa_tracer.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/ssa/ssa_tracer.dart
rename to pkg/compiler/lib/src/ssa/ssa_tracer.dart
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/types.dart b/pkg/compiler/lib/src/ssa/types.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/ssa/types.dart
rename to pkg/compiler/lib/src/ssa/types.dart
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/types_propagation.dart b/pkg/compiler/lib/src/ssa/types_propagation.dart
similarity index 96%
rename from sdk/lib/_internal/compiler/implementation/ssa/types_propagation.dart
rename to pkg/compiler/lib/src/ssa/types_propagation.dart
index eb21bb4..4f3e7ee 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/types_propagation.dart
+++ b/pkg/compiler/lib/src/ssa/types_propagation.dart
@@ -183,13 +183,21 @@
         }
       }
     }
+    if (inputType != outputType) {
+      input.replaceAllUsersDominatedBy(instruction.next, instruction);
+    }
     return outputType;
   }
 
   TypeMask visitTypeKnown(HTypeKnown instruction) {
     HInstruction input = instruction.checkedInput;
-    return instruction.knownType.intersection(
-        input.instructionType, classWorld);
+    TypeMask inputType = input.instructionType;
+    TypeMask outputType =
+        instruction.knownType.intersection(inputType, classWorld);
+    if (inputType != outputType) {
+      input.replaceAllUsersDominatedBy(instruction.next, instruction);
+    }
+    return outputType;
   }
 
   void convertInput(HInvokeDynamic instruction,
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/validate.dart b/pkg/compiler/lib/src/ssa/validate.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/ssa/validate.dart
rename to pkg/compiler/lib/src/ssa/validate.dart
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/value_range_analyzer.dart b/pkg/compiler/lib/src/ssa/value_range_analyzer.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/ssa/value_range_analyzer.dart
rename to pkg/compiler/lib/src/ssa/value_range_analyzer.dart
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/value_set.dart b/pkg/compiler/lib/src/ssa/value_set.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/ssa/value_set.dart
rename to pkg/compiler/lib/src/ssa/value_set.dart
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/variable_allocator.dart b/pkg/compiler/lib/src/ssa/variable_allocator.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/ssa/variable_allocator.dart
rename to pkg/compiler/lib/src/ssa/variable_allocator.dart
diff --git a/sdk/lib/_internal/compiler/implementation/string_validator.dart b/pkg/compiler/lib/src/string_validator.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/string_validator.dart
rename to pkg/compiler/lib/src/string_validator.dart
diff --git a/sdk/lib/_internal/compiler/implementation/tracer.dart b/pkg/compiler/lib/src/tracer.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/tracer.dart
rename to pkg/compiler/lib/src/tracer.dart
diff --git a/sdk/lib/_internal/compiler/implementation/tree/dartstring.dart b/pkg/compiler/lib/src/tree/dartstring.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/tree/dartstring.dart
rename to pkg/compiler/lib/src/tree/dartstring.dart
diff --git a/sdk/lib/_internal/compiler/implementation/tree/nodes.dart b/pkg/compiler/lib/src/tree/nodes.dart
similarity index 98%
rename from sdk/lib/_internal/compiler/implementation/tree/nodes.dart
rename to pkg/compiler/lib/src/tree/nodes.dart
index 1e4b75d..0b65913 100644
--- a/sdk/lib/_internal/compiler/implementation/tree/nodes.dart
+++ b/pkg/compiler/lib/src/tree/nodes.dart
@@ -23,6 +23,7 @@
   R visitContinueStatement(ContinueStatement node) => visitGotoStatement(node);
   R visitDoWhile(DoWhile node) => visitLoop(node);
   R visitEmptyStatement(EmptyStatement node) => visitStatement(node);
+  R visitEnum(Enum node) => visitNode(node);
   R visitExport(Export node) => visitLibraryDependency(node);
   R visitExpression(Expression node) => visitNode(node);
   R visitExpressionStatement(ExpressionStatement node) => visitStatement(node);
@@ -158,6 +159,7 @@
   ContinueStatement asContinueStatement() => null;
   DoWhile asDoWhile() => null;
   EmptyStatement asEmptyStatement() => null;
+  Enum asEnum() => null;
   ErrorExpression asErrorExpression() => null;
   Export asExport() => null;
   Expression asExpression() => null;
@@ -1935,6 +1937,33 @@
 }
 
 /**
+ * An `enum` declaration.
+ *
+ * An `enum` defines a number of named constants inside a non-extensible class
+ */
+class Enum extends Node {
+  /** The name of the enum class. */
+  final Identifier name;
+  /** The names of the enum constants. */
+  final NodeList names;
+  final Token enumToken;
+
+  Enum(this.enumToken, this.name, this.names);
+
+  Enum asEnum() => this;
+
+  accept(Visitor visitor) => visitor.visitEnum(this);
+
+  visitChildren(Visitor visitor) {
+    name.accept(visitor);
+    if (names != null) names.accept(visitor);
+  }
+
+  Token getBeginToken() => enumToken;
+  Token getEndToken() => names.getEndToken();
+}
+
+/**
  * An [:export:] library tag.
  *
  * An export tag is dependency on another library where the exported identifiers
diff --git a/sdk/lib/_internal/compiler/implementation/tree/prettyprint.dart b/pkg/compiler/lib/src/tree/prettyprint.dart
similarity index 98%
rename from sdk/lib/_internal/compiler/implementation/tree/prettyprint.dart
rename to pkg/compiler/lib/src/tree/prettyprint.dart
index b0b1de1..6248480 100644
--- a/sdk/lib/_internal/compiler/implementation/tree/prettyprint.dart
+++ b/pkg/compiler/lib/src/tree/prettyprint.dart
@@ -178,6 +178,10 @@
     visitNodeWithChildren(node, "EmptyStatement");
   }
 
+  visitEnum(Enum node) {
+    visitNodeWithChildren(node, "Enum");
+  }
+
   visitExpressionStatement(ExpressionStatement node) {
     visitNodeWithChildren(node, "ExpressionStatement");
   }
diff --git a/sdk/lib/_internal/compiler/implementation/tree/tree.dart b/pkg/compiler/lib/src/tree/tree.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/tree/tree.dart
rename to pkg/compiler/lib/src/tree/tree.dart
diff --git a/sdk/lib/_internal/compiler/implementation/tree/unparser.dart b/pkg/compiler/lib/src/tree/unparser.dart
similarity index 98%
rename from sdk/lib/_internal/compiler/implementation/tree/unparser.dart
rename to pkg/compiler/lib/src/tree/unparser.dart
index b4ce89d..3ac6a9b 100644
--- a/sdk/lib/_internal/compiler/implementation/tree/unparser.dart
+++ b/pkg/compiler/lib/src/tree/unparser.dart
@@ -124,6 +124,13 @@
     write('}');
   }
 
+  visitEnum(Enum node) {
+    sb.write('enum ');
+    visit(node.name);
+    sb.write(' ');
+    visit(node.names);
+  }
+
   visitClassNode(ClassNode node) {
     unparseClassWithBody(node, node.body.nodes);
   }
diff --git a/sdk/lib/_internal/compiler/implementation/typechecker.dart b/pkg/compiler/lib/src/typechecker.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/typechecker.dart
rename to pkg/compiler/lib/src/typechecker.dart
diff --git a/sdk/lib/_internal/compiler/implementation/types/container_type_mask.dart b/pkg/compiler/lib/src/types/container_type_mask.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/types/container_type_mask.dart
rename to pkg/compiler/lib/src/types/container_type_mask.dart
diff --git a/sdk/lib/_internal/compiler/implementation/types/dictionary_type_mask.dart b/pkg/compiler/lib/src/types/dictionary_type_mask.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/types/dictionary_type_mask.dart
rename to pkg/compiler/lib/src/types/dictionary_type_mask.dart
diff --git a/sdk/lib/_internal/compiler/implementation/types/flat_type_mask.dart b/pkg/compiler/lib/src/types/flat_type_mask.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/types/flat_type_mask.dart
rename to pkg/compiler/lib/src/types/flat_type_mask.dart
diff --git a/sdk/lib/_internal/compiler/implementation/types/forwarding_type_mask.dart b/pkg/compiler/lib/src/types/forwarding_type_mask.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/types/forwarding_type_mask.dart
rename to pkg/compiler/lib/src/types/forwarding_type_mask.dart
diff --git a/sdk/lib/_internal/compiler/implementation/types/map_type_mask.dart b/pkg/compiler/lib/src/types/map_type_mask.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/types/map_type_mask.dart
rename to pkg/compiler/lib/src/types/map_type_mask.dart
diff --git a/sdk/lib/_internal/compiler/implementation/types/type_mask.dart b/pkg/compiler/lib/src/types/type_mask.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/types/type_mask.dart
rename to pkg/compiler/lib/src/types/type_mask.dart
diff --git a/sdk/lib/_internal/compiler/implementation/types/types.dart b/pkg/compiler/lib/src/types/types.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/types/types.dart
rename to pkg/compiler/lib/src/types/types.dart
diff --git a/sdk/lib/_internal/compiler/implementation/types/union_type_mask.dart b/pkg/compiler/lib/src/types/union_type_mask.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/types/union_type_mask.dart
rename to pkg/compiler/lib/src/types/union_type_mask.dart
diff --git a/sdk/lib/_internal/compiler/implementation/types/value_type_mask.dart b/pkg/compiler/lib/src/types/value_type_mask.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/types/value_type_mask.dart
rename to pkg/compiler/lib/src/types/value_type_mask.dart
diff --git a/sdk/lib/_internal/compiler/implementation/universe/function_set.dart b/pkg/compiler/lib/src/universe/function_set.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/universe/function_set.dart
rename to pkg/compiler/lib/src/universe/function_set.dart
diff --git a/sdk/lib/_internal/compiler/implementation/universe/side_effects.dart b/pkg/compiler/lib/src/universe/side_effects.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/universe/side_effects.dart
rename to pkg/compiler/lib/src/universe/side_effects.dart
diff --git a/sdk/lib/_internal/compiler/implementation/universe/universe.dart b/pkg/compiler/lib/src/universe/universe.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/universe/universe.dart
rename to pkg/compiler/lib/src/universe/universe.dart
diff --git a/sdk/lib/_internal/compiler/implementation/use_unused_api.dart b/pkg/compiler/lib/src/use_unused_api.dart
similarity index 99%
rename from sdk/lib/_internal/compiler/implementation/use_unused_api.dart
rename to pkg/compiler/lib/src/use_unused_api.dart
index a381aaa..8102e0c 100644
--- a/sdk/lib/_internal/compiler/implementation/use_unused_api.dart
+++ b/pkg/compiler/lib/src/use_unused_api.dart
@@ -81,6 +81,7 @@
     ..asCombinator()
     ..asConditional()
     ..asContinueStatement()
+    ..asEnum()
     ..asErrorExpression()
     ..asExport()
     ..asFor()
diff --git a/sdk/lib/_internal/compiler/implementation/util/characters.dart b/pkg/compiler/lib/src/util/characters.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/util/characters.dart
rename to pkg/compiler/lib/src/util/characters.dart
diff --git a/sdk/lib/_internal/compiler/implementation/util/command_line.dart b/pkg/compiler/lib/src/util/command_line.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/util/command_line.dart
rename to pkg/compiler/lib/src/util/command_line.dart
diff --git a/sdk/lib/_internal/compiler/implementation/util/emptyset.dart b/pkg/compiler/lib/src/util/emptyset.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/util/emptyset.dart
rename to pkg/compiler/lib/src/util/emptyset.dart
diff --git a/sdk/lib/_internal/compiler/implementation/util/indentation.dart b/pkg/compiler/lib/src/util/indentation.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/util/indentation.dart
rename to pkg/compiler/lib/src/util/indentation.dart
diff --git a/sdk/lib/_internal/compiler/implementation/util/link.dart b/pkg/compiler/lib/src/util/link.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/util/link.dart
rename to pkg/compiler/lib/src/util/link.dart
diff --git a/sdk/lib/_internal/compiler/implementation/util/link_implementation.dart b/pkg/compiler/lib/src/util/link_implementation.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/util/link_implementation.dart
rename to pkg/compiler/lib/src/util/link_implementation.dart
diff --git a/sdk/lib/_internal/compiler/implementation/util/maplet.dart b/pkg/compiler/lib/src/util/maplet.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/util/maplet.dart
rename to pkg/compiler/lib/src/util/maplet.dart
diff --git a/sdk/lib/_internal/compiler/implementation/util/setlet.dart b/pkg/compiler/lib/src/util/setlet.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/util/setlet.dart
rename to pkg/compiler/lib/src/util/setlet.dart
diff --git a/sdk/lib/_internal/compiler/implementation/util/uri_extras.dart b/pkg/compiler/lib/src/util/uri_extras.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/util/uri_extras.dart
rename to pkg/compiler/lib/src/util/uri_extras.dart
diff --git a/sdk/lib/_internal/compiler/implementation/util/util.dart b/pkg/compiler/lib/src/util/util.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/util/util.dart
rename to pkg/compiler/lib/src/util/util.dart
diff --git a/sdk/lib/_internal/compiler/implementation/util/util_implementation.dart b/pkg/compiler/lib/src/util/util_implementation.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/util/util_implementation.dart
rename to pkg/compiler/lib/src/util/util_implementation.dart
diff --git a/sdk/lib/_internal/compiler/implementation/warnings.dart b/pkg/compiler/lib/src/warnings.dart
similarity index 97%
rename from sdk/lib/_internal/compiler/implementation/warnings.dart
rename to pkg/compiler/lib/src/warnings.dart
index d6945d2..1d72b64 100644
--- a/sdk/lib/_internal/compiler/implementation/warnings.dart
+++ b/pkg/compiler/lib/src/warnings.dart
@@ -797,6 +797,50 @@
 main() => new C();
 """]);
 
+  static const MessageKind CANNOT_EXTEND_ENUM = const MessageKind(
+      "Class '#{className}' can't extend the type '#{enumType}' because "
+      "it is declared by an enum.",
+      options: const ['--enable-enum'],
+      howToFix: "Try making '#{enumType}' a normal class or removing the "
+        "'extends' clause.",
+      examples: const ["""
+enum Enum {}
+class A extends Enum {}
+main() => new A();"""]);
+
+  static const MessageKind CANNOT_IMPLEMENT_ENUM = const MessageKind(
+      "Class '#{className}' can't implement the type '#{enumType}' "
+      "because it is declared by an enum.",
+      options: const ['--enable-enum'],
+      howToFix: "Try making '#{enumType}' a normal class or removing the "
+        "type from the 'implements' clause.",
+      examples: const ["""
+enum Enum {}
+class A implements Enum {}
+main() => new A();"""]);
+
+  static const MessageKind CANNOT_MIXIN_ENUM = const MessageKind(
+      "Class '#{className}' can't mixin the type '#{enumType}' because it "
+      "is declared by an enum.",
+      options: const ['--enable-enum'],
+      howToFix: "Try making '#{enumType}' a normal class or removing the "
+        "type from the 'with' clause.",
+      examples: const ["""
+enum Enum {}
+class A extends Object with Enum {}
+main() => new A();"""]);
+
+  static const MessageKind CANNOT_INSTANTIATE_ENUM = const MessageKind(
+      "Enum type '#{enumName}' cannot be instantiated.",
+      options: const ['--enable-enum'],
+      howToFix: "Try making '#{enumType}' a normal class or use an enum "
+                "constant.",
+      examples: const ["""
+enum Enum {}
+main() => new Enum(0, '');""", """
+enum Enum {}
+main() => const Enum(0, '');"""]);
+
   static const MessageKind DUPLICATE_EXTENDS_IMPLEMENTS = const MessageKind(
       "'#{type}' can not be both extended and implemented.");
 
@@ -1983,6 +2027,14 @@
     "  <sdk>/lib/_internal/compiler/js_lib/preambles.");
 
 
+  static const MessageKind EXPERIMENTAL_ENUMS = const MessageKind(
+      "Experimental language feature 'enums' is not supported.",
+      howToFix: "Use option '--enable-enum' to use enum declarations.",
+      examples: const ["""
+enum Enum { A, B, C }
+main() => print(Enum.A);
+"""]);
+
   static const MessageKind EXPERIMENTAL_ASYNC_AWAIT = const MessageKind(
       "Experimental language feature 'async/await' is not supported.");
 
diff --git a/sdk/lib/_internal/compiler/implementation/world.dart b/pkg/compiler/lib/src/world.dart
similarity index 100%
rename from sdk/lib/_internal/compiler/implementation/world.dart
rename to pkg/compiler/lib/src/world.dart
diff --git a/sdk/lib/_internal/compiler/samples/compile_loop/compile_loop.dart b/pkg/compiler/samples/compile_loop/compile_loop.dart
similarity index 95%
rename from sdk/lib/_internal/compiler/samples/compile_loop/compile_loop.dart
rename to pkg/compiler/samples/compile_loop/compile_loop.dart
index f4920ae..9a2e44e 100644
--- a/sdk/lib/_internal/compiler/samples/compile_loop/compile_loop.dart
+++ b/pkg/compiler/samples/compile_loop/compile_loop.dart
@@ -8,7 +8,7 @@
 
 import 'dart:async';
 
-import '../../compiler.dart' as compiler;
+import '../../lib/compiler.dart' as compiler;
 
 // If this file is missing, generate it using ../jsonify/jsonify.dart.
 import 'sdk.dart';
@@ -31,7 +31,7 @@
   void handler(Uri uri, int begin, int end,
                String message, compiler.Diagnostic kind) {
     // TODO(ahe): Remove dart:io import from
-    // ../../implementation/source_file_provider.dart and use
+    // ../../lib/src/source_file_provider.dart and use
     // FormattingDiagnosticHandler instead.
     print({ 'uri': '$uri',
             'begin': begin,
diff --git a/sdk/lib/_internal/compiler/samples/darttags/darttags.dart b/pkg/compiler/samples/darttags/darttags.dart
similarity index 83%
rename from sdk/lib/_internal/compiler/samples/darttags/darttags.dart
rename to pkg/compiler/samples/darttags/darttags.dart
index 744abb6..a62b618 100644
--- a/sdk/lib/_internal/compiler/samples/darttags/darttags.dart
+++ b/pkg/compiler/samples/darttags/darttags.dart
@@ -10,7 +10,9 @@
 //     "pattern": ".",
 //     "action": [
 //       "dart/sdk/bin/dart",
-//       "dart/sdk/lib/_internal/compiler/samples/darttags/darttags.dart",
+//       # Replace "xcodebuild" with "out" on Linux, and "build" on Windows.
+//       "-pdart/xcodebuild/ReleaseIA32/packages/",
+//       "dart/pkg/compiler/samples/darttags/darttags.dart",
 //       "dart/TAGS"
 //     ],
 //   },
@@ -27,23 +29,23 @@
 
 import 'dart:mirrors';
 
-import '../../../libraries.dart'
+import 'package:_internal/libraries.dart'
     show LIBRARIES, LibraryInfo;
 
-import '../../implementation/mirrors/analyze.dart'
+import 'package:compiler/src/mirrors/analyze.dart'
     show analyze;
-import '../../implementation/mirrors/dart2js_mirrors.dart'
+import 'package:compiler/src/mirrors/dart2js_mirrors.dart'
     show BackDoor;
-import '../../implementation/mirrors/mirrors_util.dart' show nameOf;
+import 'package:compiler/src/mirrors/mirrors_util.dart' show nameOf;
 
-import '../../implementation/filenames.dart';
-import '../../implementation/source_file.dart';
-import '../../implementation/source_file_provider.dart';
-import '../../implementation/util/uri_extras.dart';
+import 'package:compiler/src/filenames.dart';
+import 'package:compiler/src/source_file.dart';
+import 'package:compiler/src/source_file_provider.dart';
+import 'package:compiler/src/util/uri_extras.dart';
 
-const DART2JS = '../../implementation/dart2js.dart';
-const DART2JS_MIRROR = '../../implementation/mirrors/dart2js_mirrors.dart';
-const SDK_ROOT = '../../../../../';
+const DART2JS = '../../lib/src/dart2js.dart';
+const DART2JS_MIRROR = '../../lib/src/mirrors/dart2js_mirrors.dart';
+const SDK_ROOT = '../../../../sdk/';
 
 bool isPublicDart2jsLibrary(String name) {
   return !name.startsWith('_') && LIBRARIES[name].isDart2jsLibrary;
@@ -74,7 +76,10 @@
   uris.add(myLocation.resolve(DART2JS));
   uris.add(myLocation.resolve(DART2JS_MIRROR));
 
-  analyze(uris, myLocation.resolve(SDK_ROOT), null, handler.provider, handler)
+  Uri libraryRoot = myLocation.resolve(SDK_ROOT);
+  Uri packageRoot = Uri.base.resolve(Platform.packageRoot);
+
+  analyze(uris, libraryRoot, packageRoot, handler.provider, handler)
       .then(processMirrors);
 }
 
diff --git a/sdk/lib/_internal/compiler/samples/jsonify/jsonify.dart b/pkg/compiler/samples/jsonify/jsonify.dart
similarity index 84%
rename from sdk/lib/_internal/compiler/samples/jsonify/jsonify.dart
rename to pkg/compiler/samples/jsonify/jsonify.dart
index 9306368..bb0c413 100644
--- a/sdk/lib/_internal/compiler/samples/jsonify/jsonify.dart
+++ b/pkg/compiler/samples/jsonify/jsonify.dart
@@ -7,22 +7,22 @@
 
 import 'dart:mirrors';
 
-import '../../../libraries.dart'
+import 'package:_internal/libraries.dart'
     show LIBRARIES, LibraryInfo;
 
-import '../../implementation/mirrors/analyze.dart'
+import '../../lib/src/mirrors/analyze.dart'
     show analyze;
-import '../../implementation/mirrors/dart2js_mirrors.dart'
+import '../../lib/src/mirrors/dart2js_mirrors.dart'
     show BackDoor;
 
-import '../../implementation/filenames.dart';
-import '../../implementation/source_file.dart';
-import '../../implementation/source_file_provider.dart';
-import '../../implementation/util/uri_extras.dart';
+import '../../lib/src/filenames.dart';
+import '../../lib/src/source_file.dart';
+import '../../lib/src/source_file_provider.dart';
+import '../../lib/src/util/uri_extras.dart';
 
-const DART2JS = '../../implementation/dart2js.dart';
-const DART2JS_MIRROR = '../../implementation/mirrors/dart2js_mirror.dart';
-const SDK_ROOT = '../../../../../';
+const DART2JS = '../../lib/src/dart2js.dart';
+const DART2JS_MIRROR = '../../lib/src/mirrors/dart2js_mirror.dart';
+const SDK_ROOT = '../../../../sdk/';
 
 bool isPublicDart2jsLibrary(String name) {
   return !name.startsWith('_') && LIBRARIES[name].isDart2jsLibrary;
diff --git a/pkg/compiler_unsupported/tool/create_library.py b/pkg/compiler_unsupported/tool/create_library.py
index 5ff330b..e84853e 100755
--- a/pkg/compiler_unsupported/tool/create_library.py
+++ b/pkg/compiler_unsupported/tool/create_library.py
@@ -44,24 +44,27 @@
   # sdk/lib/_internal
   SOURCE = join(dirname(dirname(HOME)), 'sdk', 'lib', '_internal')
 
+  # pkg
+  PKG_SOURCE = join(dirname(dirname(HOME)), 'pkg')
+
   # clean compiler_unsupported/lib
   if not os.path.exists(TARGET):
     os.mkdir(TARGET)
-  shutil.rmtree(join(TARGET, 'implementation'), True)
+  shutil.rmtree(join(TARGET, 'src'), True)
   RemoveFile(join(TARGET, 'compiler.dart'))
   RemoveFile(join(TARGET, 'libraries.dart'))
 
   # copy dart2js code
-  shutil.copy(join(SOURCE, 'compiler', 'compiler.dart'), TARGET)
+  shutil.copy(join(PKG_SOURCE, 'compiler', 'lib', 'compiler.dart'), TARGET)
   shutil.copy(join(SOURCE, 'libraries.dart'), TARGET)
   shutil.copytree(
-      join(SOURCE, 'compiler', 'implementation'),
-      join(TARGET, 'implementation'))
+      join(PKG_SOURCE, 'compiler', 'lib', 'src'),
+      join(TARGET, 'src'))
 
   # patch up the libraries.dart references
   replace = [(r'\.\./\.\./libraries\.dart', r'\.\./libraries\.dart')]
 
-  for root, dirs, files in os.walk(join(TARGET, 'implementation')):
+  for root, dirs, files in os.walk(join(TARGET, 'src')):
     for name in files:
       if name.endswith('.dart'):
         ReplaceInFiles([join(root, name)], replace)
diff --git a/pkg/dart2js_incremental/lib/dart2js_incremental.dart b/pkg/dart2js_incremental/lib/dart2js_incremental.dart
index b450c22..d1a3cb6 100644
--- a/pkg/dart2js_incremental/lib/dart2js_incremental.dart
+++ b/pkg/dart2js_incremental/lib/dart2js_incremental.dart
@@ -10,7 +10,7 @@
 import 'dart:profiler' show
     UserTag;
 
-import 'package:compiler/implementation/apiimpl.dart' show
+import 'package:compiler/src/apiimpl.dart' show
     Compiler;
 
 import 'package:compiler/compiler.dart' show
@@ -19,19 +19,21 @@
     Diagnostic,
     DiagnosticHandler;
 
-import 'package:compiler/implementation/dart2jslib.dart' show
+import 'package:compiler/src/dart2jslib.dart' show
     NullSink;
 
-import 'package:compiler/implementation/js_backend/js_backend.dart' show
+import 'package:compiler/src/js_backend/js_backend.dart' show
     JavaScriptBackend;
 
-import 'package:compiler/implementation/elements/elements.dart' show
+import 'package:compiler/src/elements/elements.dart' show
     LibraryElement;
 
 import 'library_updater.dart' show
     LibraryUpdater,
     Logger;
 
+import 'package:compiler/src/js/js.dart' as jsAst;
+
 part 'caching_compiler.dart';
 
 const List<String> INCREMENTAL_OPTIONS = const <String>[
@@ -48,6 +50,7 @@
   final List<String> options;
   final CompilerOutputProvider outputProvider;
   final Map<String, dynamic> environment;
+  final List<String> _updates = <String>[];
 
   Compiler _compiler;
 
@@ -122,8 +125,25 @@
       if (compiler.compilationFailed) {
         return null;
       } else {
-        return updater.computeUpdateJs();
+        String update = updater.computeUpdateJs();
+        _updates.add(update);
+        return update;
       }
     });
   }
+
+  String allUpdates() {
+    jsAst.Node updates = jsAst.js.escapedString(_updates.join(""));
+
+    jsAst.FunctionDeclaration mainRunner = jsAst.js.statement(r"""
+function dartMainRunner(main, args) {
+  $dart_unsafe_eval.patch(#);
+  return main(args);
+}""", updates);
+
+
+    jsAst.Printer printer = new jsAst.Printer(_compiler, null);
+    printer.blockOutWithoutBraces(mainRunner);
+    return printer.outBuffer.getText();
+  }
 }
diff --git a/pkg/dart2js_incremental/lib/diff.dart b/pkg/dart2js_incremental/lib/diff.dart
index 0cb659b..a667fad 100644
--- a/pkg/dart2js_incremental/lib/diff.dart
+++ b/pkg/dart2js_incremental/lib/diff.dart
@@ -4,7 +4,7 @@
 
 library trydart.poi.diff;
 
-import 'package:compiler/implementation/elements/elements.dart' show
+import 'package:compiler/src/elements/elements.dart' show
     AbstractFieldElement,
     ClassElement,
     CompilationUnitElement,
@@ -14,12 +14,12 @@
     LibraryElement,
     ScopeContainerElement;
 
-import 'package:compiler/implementation/elements/modelx.dart' as modelx;
+import 'package:compiler/src/elements/modelx.dart' as modelx;
 
-import 'package:compiler/implementation/elements/modelx.dart' show
+import 'package:compiler/src/elements/modelx.dart' show
     DeclarationSite;
 
-import 'package:compiler/implementation/scanner/scannerlib.dart' show
+import 'package:compiler/src/scanner/scannerlib.dart' show
     EOF_TOKEN,
     ErrorToken,
     IDENTIFIER_TOKEN,
diff --git a/pkg/dart2js_incremental/lib/library_updater.dart b/pkg/dart2js_incremental/lib/library_updater.dart
index b2a8595..b5b20fc 100644
--- a/pkg/dart2js_incremental/lib/library_updater.dart
+++ b/pkg/dart2js_incremental/lib/library_updater.dart
@@ -12,43 +12,44 @@
 
 import 'package:compiler/compiler.dart' as api;
 
-import 'package:compiler/implementation/dart2jslib.dart' show
+import 'package:compiler/src/dart2jslib.dart' show
     Compiler,
     Script;
 
-import 'package:compiler/implementation/elements/elements.dart' show
+import 'package:compiler/src/elements/elements.dart' show
     Element,
     FunctionElement,
     LibraryElement,
     ScopeContainerElement;
 
-import 'package:compiler/implementation/scanner/scannerlib.dart' show
+import 'package:compiler/src/scanner/scannerlib.dart' show
     EOF_TOKEN,
     PartialClassElement,
     PartialElement,
     PartialFunctionElement,
     Token;
 
-import 'package:compiler/implementation/source_file.dart' show
+import 'package:compiler/src/source_file.dart' show
     StringSourceFile;
 
-import 'package:compiler/implementation/tree/tree.dart' show
+import 'package:compiler/src/tree/tree.dart' show
     ClassNode,
     FunctionExpression,
     NodeList;
 
-import 'package:compiler/implementation/js/js.dart' show
+import 'package:compiler/src/js/js.dart' show
     js;
 
-import 'package:compiler/implementation/js/js.dart' as jsAst;
+import 'package:compiler/src/js/js.dart' as jsAst;
 
-import 'package:compiler/implementation/js_emitter/js_emitter.dart' show
+import 'package:compiler/src/js_emitter/js_emitter.dart' show
     CodeEmitterTask,
     MemberInfo;
 
-import 'package:compiler/js_lib/shared/embedded_names.dart' as embeddedNames;
+import 'package:_internal/compiler/js_lib/shared/embedded_names.dart'
+    as embeddedNames;
 
-import 'package:compiler/implementation/js_backend/js_backend.dart' show
+import 'package:compiler/src/js_backend/js_backend.dart' show
     JavaScriptBackend,
     Namer;
 
@@ -63,6 +64,19 @@
     PartialElement before,
     PartialElement after);
 
+class FailedUpdate {
+  /// Either an [Element] or a [Difference].
+  final context;
+  final String message;
+
+  FailedUpdate(this.context, this.message);
+
+  String toString() {
+    if (context == null) return '$message';
+    return 'In $context:\n  $message';
+  }
+}
+
 // TODO(ahe): Generalize this class. For now only works for Compiler.mainApp,
 // and only if that library has exactly one compilation unit.
 class LibraryUpdater {
@@ -78,14 +92,10 @@
   // changed.
   final Uri uri;
 
-  // When [true], updates must be applied (using [applyUpdates]) before the
-  // [compiler]'s state correctly reflects the updated program.
-  bool hasPendingUpdates = false;
-
-  bool onlySimpleUpdates = true;
-
   final List<Update> updates = <Update>[];
 
+  final List<FailedUpdate> _failedUpdates = <FailedUpdate>[];
+
   LibraryUpdater(
       this.compiler,
       this.inputProvider,
@@ -93,6 +103,12 @@
       this.logTime,
       this.logVerbose);
 
+  /// When [true], updates must be applied (using [applyUpdates]) before the
+  /// [compiler]'s state correctly reflects the updated program.
+  bool get hasPendingUpdates => !updates.isEmpty;
+
+  bool get failed => !_failedUpdates.isEmpty;
+
   JavaScriptBackend get backend => compiler.backend;
 
   Namer get namer => backend.namer;
@@ -140,6 +156,12 @@
     return canReuseScopeContainerElement(library, newLibrary);
   }
 
+  bool cannotReuse(context, String message) {
+    _failedUpdates.add(new FailedUpdate(context, message));
+    logVerbose(message);
+    return false;
+  }
+
   bool canReuseScopeContainerElement(
       ScopeContainerElement element,
       ScopeContainerElement newElement) {
@@ -148,23 +170,18 @@
     for (Difference difference in differences) {
       logTime('Looking at difference: $difference');
       if (difference.before == null || difference.after == null) {
-        logVerbose('Scope changed in $difference');
-        // Scope changed, don't reuse library.
-        onlySimpleUpdates = false;
-        return false;
+        cannotReuse(difference, "Can't reuse; Scope changed.");
+        continue;
       }
       Token diffToken = difference.token;
       if (diffToken == null) {
-        logVerbose('No token stored in difference.');
-        onlySimpleUpdates = false;
-        return false;
+        cannotReuse(difference, "No difference token.");
+        continue;
       }
       if (difference.after is! PartialElement &&
           difference.before is! PartialElement) {
-        logVerbose('Not a PartialElement: $difference');
-        // Don't know how to recompile element.
-        onlySimpleUpdates = false;
-        return false;
+        cannotReuse(difference, "Don't know how to recompile.");
+        continue;
       }
       PartialElement before = difference.before;
       PartialElement after = difference.after;
@@ -177,16 +194,15 @@
                  after is PartialClassElement) {
         reuser = canReuseClass;
       } else {
-        reuser = cannotReuse;
+        reuser = unableToReuse;
       }
       if (!reuser(diffToken, before, after)) {
-        onlySimpleUpdates = false;
-        return false;
+        assert(!_failedUpdates.isEmpty);
+        continue;
       }
     }
-    hasPendingUpdates = true;
 
-    return true;
+    return _failedUpdates.isEmpty;
   }
 
   /// Returns true if function [before] can be reused to reflect the changes in
@@ -200,16 +216,14 @@
     FunctionExpression node =
         after.parseNode(compiler).asFunctionExpression();
     if (node == null) {
-      logVerbose('Not a function expression.');
-      return false;
+      return cannotReuse(after, "Not a function expression: '$node'");
     }
     Token last = after.endToken;
     if (node.body != null) {
       last = node.body.getBeginToken();
     }
     if (isTokenBetween(diffToken, after.beginToken, last)) {
-      logVerbose('Signature changed.');
-      return false;
+      return cannotReuse(after, 'Signature changed.');
     }
     logVerbose('Simple modification of ${after} detected');
     updates.add(new FunctionUpdate(compiler, before, after));
@@ -222,17 +236,14 @@
       PartialClassElement after) {
     ClassNode node = after.parseNode(compiler).asClassNode();
     if (node == null) {
-      logVerbose('Not a ClassNode.');
-      return false;
+      return cannotReuse(after, "Not a ClassNode: '$node'");
     }
     NodeList body = node.body;
     if (body == null) {
-      logVerbose('Class has no body.');
-      return false;
+      return cannotReuse(after, "Class has no body.");
     }
     if (isTokenBetween(diffToken, node.beginToken, body.beginToken)) {
-      logVerbose('Class header changed.');
-      return false;
+      return cannotReuse(after, "Class header changed.");
     }
     logVerbose('Simple modification of ${after} detected');
     return canReuseScopeContainerElement(before, after);
@@ -249,19 +260,20 @@
     return false;
   }
 
-  bool cannotReuse(
+  bool unableToReuse(
       Token diffToken,
       PartialElement before,
       PartialElement after) {
-    logVerbose(
+    return cannotReuse(
+        after,
         'Unhandled change:'
         ' ${before} (${before.runtimeType} -> ${after.runtimeType}).');
-    return false;
   }
 
   List<Element> applyUpdates() {
-    if (!onlySimpleUpdates) {
-      throw new StateError("Can't compute update.");
+    if (!_failedUpdates.isEmpty) {
+      throw new StateError(
+          "Can't compute update.\n\n${_failedUpdates.join('\n\n')}");
     }
     return updates.map((Update update) => update.apply()).toList();
   }
diff --git a/pkg/docgen/bin/docgen.dart b/pkg/docgen/bin/docgen.dart
index ac6b364..8b5e59d 100644
--- a/pkg/docgen/bin/docgen.dart
+++ b/pkg/docgen/bin/docgen.dart
@@ -62,8 +62,8 @@
  * Print help if we are passed the help option or invalid arguments.
  */
 void _printHelpAndExit() {
-  print(_initArgParser().getUsage());
-  print('Usage: dart docgen.dart [OPTIONS] fooDir/barFile');
+  print(_initArgParser().usage);
+  print('Usage: dartdocgen [OPTIONS] fooDir/barFile');
   exit(0);
 }
 
diff --git a/pkg/docgen/lib/src/exports/dart2js_mirrors.dart b/pkg/docgen/lib/src/exports/dart2js_mirrors.dart
index a380c38..d99a98c 100644
--- a/pkg/docgen/lib/src/exports/dart2js_mirrors.dart
+++ b/pkg/docgen/lib/src/exports/dart2js_mirrors.dart
@@ -4,4 +4,4 @@
 
 library docgen.exports.dart2js_mirrors;
 
-export 'package:compiler/implementation/mirrors/dart2js_mirrors.dart';
+export 'package:compiler/src/mirrors/dart2js_mirrors.dart';
diff --git a/pkg/docgen/lib/src/exports/mirrors_util.dart b/pkg/docgen/lib/src/exports/mirrors_util.dart
index 1bee22c..f02b55e 100644
--- a/pkg/docgen/lib/src/exports/mirrors_util.dart
+++ b/pkg/docgen/lib/src/exports/mirrors_util.dart
@@ -4,4 +4,4 @@
 
 library docgen.exports.mirrors_util;
 
-export 'package:compiler/implementation/mirrors/mirrors_util.dart';
+export 'package:compiler/src/mirrors/mirrors_util.dart';
diff --git a/pkg/docgen/lib/src/exports/source_mirrors.dart b/pkg/docgen/lib/src/exports/source_mirrors.dart
index f15ef06..5f2f1ff 100644
--- a/pkg/docgen/lib/src/exports/source_mirrors.dart
+++ b/pkg/docgen/lib/src/exports/source_mirrors.dart
@@ -4,5 +4,5 @@
 
 library docgen.exports.source_mirrors;
 
-export 'package:compiler/implementation/mirrors/source_mirrors.dart'
+export 'package:compiler/src/mirrors/source_mirrors.dart'
     hide SourceLocation;
diff --git a/pkg/docgen/lib/src/generator.dart b/pkg/docgen/lib/src/generator.dart
index 4d54585..3a05041 100644
--- a/pkg/docgen/lib/src/generator.dart
+++ b/pkg/docgen/lib/src/generator.dart
@@ -13,10 +13,10 @@
 import 'package:path/path.dart' as path;
 
 import 'package:compiler/compiler.dart' as api;
-import 'package:compiler/implementation/filenames.dart';
-import 'package:compiler/implementation/mirrors/analyze.dart'
+import 'package:compiler/src/filenames.dart';
+import 'package:compiler/src/mirrors/analyze.dart'
     as dart2js;
-import 'package:compiler/implementation/source_file_provider.dart';
+import 'package:compiler/src/source_file_provider.dart';
 
 import 'exports/dart2js_mirrors.dart' as dart2js_mirrors;
 import 'exports/libraries.dart';
@@ -247,7 +247,7 @@
 
 /// Helper method to serialize the given Indexable out to a file.
 void _writeIndexableToFile(Indexable result, JsonEncoder encoder) {
-  var outputFile = result.qualifiedName + '.json';
+  var outputFile = result.fileName + '.json';
   var output = encoder.convert(result.toMap());
   _writeToFile(output, outputFile);
 }
diff --git a/pkg/docgen/lib/src/models/annotation.dart b/pkg/docgen/lib/src/models/annotation.dart
index 0374b44..5a8dd11c 100644
--- a/pkg/docgen/lib/src/models/annotation.dart
+++ b/pkg/docgen/lib/src/models/annotation.dart
@@ -14,7 +14,7 @@
 import 'mirror_based.dart';
 
 import 'dart:mirrors';
-import 'package:compiler/implementation/tree/tree.dart';
+import 'package:compiler/src/tree/tree.dart';
 
 /// Holds the name of the annotation, and its parameters.
 class Annotation extends MirrorBased<ClassMirror> {
@@ -83,7 +83,7 @@
     recursionLevel--;
   }
 
-  unparseNodeListFrom(NodeList node, var from, {spaces}) {
+  unparseNodeListFrom(NodeList node, var from, {bool spaces: true}) {
     if (from.isEmpty) return;
 
     visit(from.head);
diff --git a/pkg/docgen/lib/src/models/indexable.dart b/pkg/docgen/lib/src/models/indexable.dart
index 9231a7e..1c14a79 100644
--- a/pkg/docgen/lib/src/models/indexable.dart
+++ b/pkg/docgen/lib/src/models/indexable.dart
@@ -39,6 +39,11 @@
   /// This defines both the URL and the directory structure.
   String get qualifiedName => packagePrefix + ownerPrefix + name;
 
+  /// The name of the file we write this object's data into. The same as the
+  /// qualified name but with leading colons (i.e. dart:)
+  /// replaced by hyphens because of Windows.
+  String get fileName => qualifiedName.replaceFirst(":", "-");
+
   final TMirror mirror;
   final bool isPrivate;
   /// The comment text pre-resolution. We keep this around because inherited
diff --git a/pkg/docgen/lib/src/models/model_helpers.dart b/pkg/docgen/lib/src/models/model_helpers.dart
index 359706d..e131472 100644
--- a/pkg/docgen/lib/src/models/model_helpers.dart
+++ b/pkg/docgen/lib/src/models/model_helpers.dart
@@ -22,8 +22,16 @@
 import 'parameter.dart';
 import 'variable.dart';
 
-String getLibraryDocName(LibraryMirror mirror) =>
-    dart2js_util.qualifiedNameOf(mirror).replaceAll('.', '-');
+String getLibraryDocName(LibraryMirror mirror) {
+  var dotsFixed = dart2js_util.qualifiedNameOf(mirror).replaceAll('.', '-');
+  if (dotsFixed.startsWith('dart-dom-')) {
+    return dotsFixed.replaceFirst("dart-dom-", "dart:");
+  } else if (dotsFixed.startsWith("dart-")) {
+    return dotsFixed.replaceFirst("dart-", "dart:");
+  } else {
+    return dotsFixed;
+  }
+}
 
 /// Expand the method map [mapToExpand] into a more detailed map that
 /// separates out setters, getters, constructors, operators, and methods.
diff --git a/pkg/docgen/test/inherited_comments_test.dart b/pkg/docgen/test/inherited_comments_test.dart
index 2f229f94..3f07887 100644
--- a/pkg/docgen/test/inherited_comments_test.dart
+++ b/pkg/docgen/test/inherited_comments_test.dart
@@ -42,8 +42,8 @@
   });
 }
 
-const _TO_LIST_COMMENT = "<p>Creates a <a>dart-core.List</a> containing the "
-    "elements of this <a>dart-core.Iterable</a>.</p>\n<p>The elements are in "
+const _TO_LIST_COMMENT = "<p>Creates a <a>dart:core.List</a> containing the "
+    "elements of this <a>dart:core.Iterable</a>.</p>\n<p>The elements are in "
     "iteration order. The list is fixed-length\nif "
-    "<a>dart-core.Set.toList.growable</a> is false.</p>";
-const _TO_LIST_COMMENT_FROM = "dart-core.Iterable.toList";
+    "<a>dart:core.Set.toList.growable</a> is false.</p>";
+const _TO_LIST_COMMENT_FROM = "dart:core.Iterable.toList";
diff --git a/pkg/docgen/test/typedef_test.dart b/pkg/docgen/test/typedef_test.dart
index a134d4c..6eaa7c2 100644
--- a/pkg/docgen/test/typedef_test.dart
+++ b/pkg/docgen/test/typedef_test.dart
@@ -74,7 +74,7 @@
     '<a>root_lib.testMethod.input</a> of type <a>root_lib.C</a> '
     'instance for testing.</p>\n<p>To eliminate import warnings for '
     '<a>root_lib.A</a> and to test typedefs.</p>\n<p>It\'s important that the'
-    ' <a>dart-core</a>&lt;A> for param <a>root_lib.testMethod.listOfA</a> '
+    ' <a>dart:core</a>&lt;A> for param <a>root_lib.testMethod.listOfA</a> '
     'is not empty.</p>';
 
 // TODO: [input] is not turned into a param refenece
@@ -87,6 +87,6 @@
 // TODO(kevmoo): <a>test_lib.C</a> should be <a>root_lib.C</a> - Issues 18352
 final _TEST_TYPEDEF_COMMENT = _TEST_TYPEDEF_PREVIEW + '\n<p>To eliminate import'
     ' warnings for <a>test_lib.A</a> and to test typedefs.</p>\n<p>It\'s '
-    'important that the <a>dart-core</a>&lt;A> for param listOfA is not '
+    'important that the <a>dart:core</a>&lt;A> for param listOfA is not '
     'empty.</p>';
 
diff --git a/pkg/expect/lib/expect.dart b/pkg/expect/lib/expect.dart
index 562af8d..bdec706 100644
--- a/pkg/expect/lib/expect.dart
+++ b/pkg/expect/lib/expect.dart
@@ -65,7 +65,7 @@
    *
    * For small strings (length less than 20) nothing is done, and null is
    * returned. Small strings can be compared visually, but for longer strings
-   * only a slice  containing the first difference will be shown.
+   * only a slice containing the first difference will be shown.
    */
   static String _stringDifference(String expected, String actual) {
     if (expected.length < 20 && actual.length < 20) return null;
@@ -238,65 +238,78 @@
   static void stringEquals(String expected,
                            String actual,
                            [String reason = null]) {
+    if (expected == actual) return;
+
     String msg = _getMessage(reason);
     String defaultMessage =
         'Expect.stringEquals(expected: <$expected>", <$actual>$msg) fails';
 
-    if (expected == actual) return;
     if ((expected == null) || (actual == null)) {
       _fail('$defaultMessage');
     }
-    // scan from the left until we find a mismatch
+
+    // Scan from the left until we find the mismatch.
     int left = 0;
+    int right = 0;
     int eLen = expected.length;
     int aLen = actual.length;
+
     while (true) {
-      if (left == eLen) {
-        assert (left < aLen);
-        String snippet = actual.substring(left, aLen);
-        _fail('$defaultMessage\nDiff:\n...[  ]\n...[ $snippet ]');
-        return;
-      }
-      if (left == aLen) {
-        assert (left < eLen);
-        String snippet = expected.substring(left, eLen);
-        _fail('$defaultMessage\nDiff:\n...[  ]\n...[ $snippet ]');
-        return;
-      }
-      if (expected[left] != actual[left]) {
+      if (left == eLen || left == aLen || expected[left] != actual[left]) {
         break;
       }
       left++;
     }
 
-    // scan from the right until we find a mismatch
-    int right = 0;
+    // Scan from the right until we find the mismatch.
+    int eRem = eLen - left;  // Remaining length ignoring left match.
+    int aRem = aLen - left;
     while (true) {
-      if (right == eLen) {
-        assert (right < aLen);
-        String snippet = actual.substring(0, aLen - right);
-        _fail('$defaultMessage\nDiff:\n[  ]...\n[ $snippet ]...');
-        return;
-      }
-      if (right == aLen) {
-        assert (right < eLen);
-        String snippet = expected.substring(0, eLen - right);
-        _fail('$defaultMessage\nDiff:\n[  ]...\n[ $snippet ]...');
-        return;
-      }
-      // stop scanning if we've reached the end of the left-to-right match
-      if (eLen - right <= left || aLen - right <= left) {
-        break;
-      }
-      if (expected[eLen - right - 1] != actual[aLen - right - 1]) {
+      if (right == eRem || right == aRem ||
+          expected[eLen - right - 1] != actual[aLen - right - 1]) {
         break;
       }
       right++;
     }
+
+    // First difference is at index `left`, last at `length - right - 1`
+    // Make useful difference message.
+    // Example:
+    // Diff (1209..1209/1246):
+    // ...,{"name":"[  ]FallThroug...
+    // ...,{"name":"[ IndexError","kind":"class"},{"name":" ]FallThroug...
+    // (colors would be great!)
+
+    // Make snippets of up to ten characters before and after differences.
+
+    String leftSnippet = expected.substring(left < 10 ? 0 : left - 10, left);
+    int rightSnippetLength = right < 10 ? right : 10;
+    String rightSnippet =
+        expected.substring(eLen - right, eLen - right + rightSnippetLength);
+
+    // Make snippets of the differences.
     String eSnippet = expected.substring(left, eLen - right);
     String aSnippet = actual.substring(left, aLen - right);
-    String diff = '\nDiff:\n...[ $eSnippet ]...\n...[ $aSnippet ]...';
-    _fail('$defaultMessage$diff');
+
+    // If snippets are long, elide the middle.
+    if (eSnippet.length > 43) {
+      eSnippet = eSnippet.substring(0, 20) + "..." +
+                 eSnippet.substring(eSnippet.length - 20);
+    }
+    if (aSnippet.length > 43) {
+      aSnippet = aSnippet.substring(0, 20) + "..." +
+                 aSnippet.substring(aSnippet.length - 20);
+    }
+    // Add "..." before and after, unless the snippets reach the end.
+    String leftLead = "...";
+    String rightTail = "...";
+    if (left <= 10) leftLead = "";
+    if (right <= 10) rightTail = "";
+
+    String diff = '\nDiff ($left..${eLen - right}/${aLen - right}):\n'
+                  '$leftLead$leftSnippet[ $eSnippet ]$rightSnippet$rightTail\n'
+                  '$leftLead$leftSnippet[ $aSnippet ]$rightSnippet$rightTail';
+    _fail("$defaultMessage$diff");
   }
 
   /**
diff --git a/pkg/expect/pubspec.yaml b/pkg/expect/pubspec.yaml
index 026b85e..63f6840 100644
--- a/pkg/expect/pubspec.yaml
+++ b/pkg/expect/pubspec.yaml
@@ -1,5 +1,5 @@
 name: expect
-version: 0.9.0
+version: 0.9.1-dev
 author: "Dart Team <misc@dartlang.org>"
 homepage: http://www.dartlang.org
 description: >
diff --git a/pkg/json_rpc_2/CHANGELOG.md b/pkg/json_rpc_2/CHANGELOG.md
index 34123f9..a916c9e 100644
--- a/pkg/json_rpc_2/CHANGELOG.md
+++ b/pkg/json_rpc_2/CHANGELOG.md
@@ -1,3 +1,9 @@
+## 1.0.0
+
+* Add a `Client` class for communicating with external JSON-RPC 2.0 servers.
+
+* Add a `Peer` class that's both a `Client` and a `Server`.
+
 ## 0.1.0
 
 * Remove `Server.handleRequest()` and `Server.parseRequest()`. Instead, `new
diff --git a/pkg/json_rpc_2/lib/error_code.dart b/pkg/json_rpc_2/lib/error_code.dart
index 96cb909..14b77f2 100644
--- a/pkg/json_rpc_2/lib/error_code.dart
+++ b/pkg/json_rpc_2/lib/error_code.dart
@@ -34,3 +34,18 @@
 /// The spec reserves the range from -32000 to -32099 for implementation-defined
 /// server exceptions, but for now we only use one of those values.
 const SERVER_ERROR = -32000;
+
+/// Returns a human-readable name for [errorCode] if it's one specified by the
+/// JSON-RPC 2.0 spec.
+///
+/// If [errorCode] isn't defined in the JSON-RPC 2.0 spec, returns null.
+String name(int errorCode) {
+  switch (errorCode) {
+    case PARSE_ERROR: return "parse error";
+    case INVALID_REQUEST: return "invalid request";
+    case METHOD_NOT_FOUND: return "method not found";
+    case INVALID_PARAMS: return "invalid parameters";
+    case INTERNAL_ERROR: return "internal error";
+    default: return null;
+  }
+}
diff --git a/pkg/json_rpc_2/lib/json_rpc_2.dart b/pkg/json_rpc_2/lib/json_rpc_2.dart
index 04e4a52..08e79a1 100644
--- a/pkg/json_rpc_2/lib/json_rpc_2.dart
+++ b/pkg/json_rpc_2/lib/json_rpc_2.dart
@@ -4,6 +4,8 @@
 
 library json_rpc_2;
 
+export 'src/client.dart';
 export 'src/exception.dart';
 export 'src/parameters.dart';
+export 'src/peer.dart';
 export 'src/server.dart';
diff --git a/pkg/json_rpc_2/lib/src/client.dart b/pkg/json_rpc_2/lib/src/client.dart
new file mode 100644
index 0000000..f3c63ca
--- /dev/null
+++ b/pkg/json_rpc_2/lib/src/client.dart
@@ -0,0 +1,195 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library json_rpc_2.client;
+
+import 'dart:async';
+
+import 'package:stack_trace/stack_trace.dart';
+
+import 'exception.dart';
+import 'two_way_stream.dart';
+import 'utils.dart';
+
+/// A JSON-RPC 2.0 client.
+///
+/// A client calls methods on a server and handles the server's responses to
+/// those method calls. Methods can be called with [sendRequest], or with
+/// [sendNotification] if no response is expected.
+class Client {
+  final TwoWayStream _streams;
+
+  /// The next request id.
+  var _id = 0;
+
+  /// The current batch of requests to be sent together.
+  ///
+  /// Each element is a JSON-serializable object.
+  List _batch;
+
+  /// The map of request ids for pending requests to [Completer]s that will be
+  /// completed with those requests' responses.
+  final _pendingRequests = new Map<int, Completer>();
+
+  /// Creates a [Client] that writes requests to [requests] and reads responses
+  /// from [responses].
+  ///
+  /// If [responses] is a [StreamSink] as well as a [Stream] (for example, a
+  /// `WebSocket`), [requests] may be omitted.
+  ///
+  /// Note that the client won't begin listening to [responses] until
+  /// [Client.listen] is called.
+  Client(Stream<String> responses, [StreamSink<String> requests])
+      : _streams = new TwoWayStream(
+            "Client", responses, "responses", requests, "requests");
+
+  /// Creates a [Client] that writes decoded responses to [responses] and reads
+  /// decoded requests from [requests].
+  ///
+  /// Unlike [new Client], this doesn't read or write JSON strings. Instead, it
+  /// reads and writes decoded maps or lists.
+  ///
+  /// If [responses] is a [StreamSink] as well as a [Stream], [requests] may be
+  /// omitted.
+  ///
+  /// Note that the client won't begin listening to [responses] until
+  /// [Client.listen] is called.
+  Client.withoutJson(Stream responses, [StreamSink requests])
+      : _streams = new TwoWayStream.withoutJson(
+            "Client", responses, "responses", requests, "requests");
+
+  /// Starts listening to the underlying stream.
+  ///
+  /// Returns a [Future] that will complete when the stream is closed or when it
+  /// has an error.
+  ///
+  /// [listen] may only be called once.
+  Future listen() => _streams.listen(_handleResponse);
+
+  /// Closes the server's request sink and response subscription.
+  ///
+  /// Returns a [Future] that completes when all resources have been released.
+  ///
+  /// A client can't be closed before [listen] has been called.
+  Future close() => _streams.close();
+
+  /// Sends a JSON-RPC 2 request to invoke the given [method].
+  ///
+  /// If passed, [parameters] is the parameters for the method. This must be
+  /// either an [Iterable] (to pass parameters by position) or a [Map] with
+  /// [String] keys (to pass parameters by name). Either way, it must be
+  /// JSON-serializable.
+  ///
+  /// If the request succeeds, this returns the response result as a decoded
+  /// JSON-serializable object. If it fails, it throws an [RpcException]
+  /// describing the failure.
+  Future sendRequest(String method, [parameters]) {
+    var id = _id++;
+    _send(method, parameters, id);
+
+    var completer = new Completer.sync();
+    _pendingRequests[id] = completer;
+    return completer.future;
+  }
+
+  /// Sends a JSON-RPC 2 request to invoke the given [method] without expecting
+  /// a response.
+  ///
+  /// If passed, [parameters] is the parameters for the method. This must be
+  /// either an [Iterable] (to pass parameters by position) or a [Map] with
+  /// [String] keys (to pass parameters by name). Either way, it must be
+  /// JSON-serializable.
+  ///
+  /// Since this is just a notification to which the server isn't expected to
+  /// send a response, it has no return value.
+  void sendNotification(String method, [parameters]) =>
+      _send(method, parameters);
+
+  /// A helper method for [sendRequest] and [sendNotification].
+  ///
+  /// Sends a request to invoke [method] with [parameters]. If [id] is given,
+  /// the request uses that id.
+  void _send(String method, parameters, [int id]) {
+    if (parameters is Iterable) parameters = parameters.toList();
+    if (parameters is! Map && parameters is! List && parameters != null) {
+      throw new ArgumentError('Only maps and lists may be used as JSON-RPC '
+          'parameters, was "$parameters".');
+    }
+
+    var message = {
+      "jsonrpc": "2.0",
+      "method": method
+    };
+    if (id != null) message["id"] = id;
+    if (parameters != null) message["params"] = parameters;
+
+    if (_batch != null) {
+      _batch.add(message);
+    } else {
+      _streams.add(message);
+    }
+  }
+
+  /// Runs [callback] and batches any requests sent until it returns.
+  ///
+  /// A batch of requests is sent in a single message on the underlying stream,
+  /// and the responses are likewise sent back in a single message.
+  ///
+  /// [callback] may be synchronous or asynchronous. If it returns a [Future],
+  /// requests will be batched until that Future returns; otherwise, requests
+  /// will only be batched while synchronously executing [callback].
+  ///
+  /// If this is called in the context of another [withBatch] call, it just
+  /// invokes [callback] without creating another batch. This means that
+  /// responses are batched until the first batch ends.
+  withBatch(callback()) {
+    if (_batch != null) return callback();
+
+    _batch = [];
+    return tryFinally(callback, () {
+      _streams.add(_batch);
+      _batch = null;
+    });
+  }
+
+  /// Handles a decoded response from the server.
+  void _handleResponse(response) {
+    if (response is List) {
+      response.forEach(_handleSingleResponse);
+    } else {
+      _handleSingleResponse(response);
+    }
+  }
+
+  /// Handles a decoded response from the server after batches have been
+  /// resolved.
+  void _handleSingleResponse(response) {
+    if (!_isResponseValid(response)) return;
+    var completer = _pendingRequests.remove(response["id"]);
+    if (response.containsKey("result")) {
+      completer.complete(response["result"]);
+    } else {
+      completer.completeError(new RpcException(
+            response["error"]["code"],
+            response["error"]["message"],
+            data: response["error"]["data"]),
+          new Chain.current());
+    }
+  }
+
+  /// Determines whether the server's response is valid per the spec.
+  bool _isResponseValid(response) {
+    if (response is! Map) return false;
+    if (response["jsonrpc"] != "2.0") return false;
+    if (!_pendingRequests.containsKey(response["id"])) return false;
+    if (response.containsKey("result")) return true;
+
+    if (!response.containsKey("error")) return false;
+    var error = response["error"];
+    if (error is! Map) return false;
+    if (error["code"] is! int) return false;
+    if (error["message"] is! String) return false;
+    return true;
+  }
+}
diff --git a/pkg/json_rpc_2/lib/src/exception.dart b/pkg/json_rpc_2/lib/src/exception.dart
index be9c2d3..2fb0713 100644
--- a/pkg/json_rpc_2/lib/src/exception.dart
+++ b/pkg/json_rpc_2/lib/src/exception.dart
@@ -64,4 +64,11 @@
       'id': id
     };
   }
+
+  String toString() {
+    var prefix = "JSON-RPC error $code";
+    var errorName = error_code.name(code);
+    if (errorName != null) prefix += " ($errorName)";
+    return "$prefix: $message";
+  }
 }
diff --git a/pkg/json_rpc_2/lib/src/peer.dart b/pkg/json_rpc_2/lib/src/peer.dart
new file mode 100644
index 0000000..c83724d
--- /dev/null
+++ b/pkg/json_rpc_2/lib/src/peer.dart
@@ -0,0 +1,136 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library json_rpc_2.peer;
+
+import 'dart:async';
+
+import '../error_code.dart' as error_code;
+import 'client.dart';
+import 'exception.dart';
+import 'parameters.dart';
+import 'server.dart';
+import 'two_way_stream.dart';
+
+/// A JSON-RPC 2.0 client *and* server.
+///
+/// This supports bidirectional peer-to-peer communication with another JSON-RPC
+/// 2.0 endpoint. It sends both requests and responses across the same
+/// communication channel and expects to connect to a peer that does the same.
+class Peer implements Client, Server {
+  TwoWayStream _streams;
+
+  /// The underlying client that handles request-sending and response-receiving
+  /// logic.
+  Client _client;
+
+  /// The underlying server that handles request-receiving and response-sending
+  /// logic.
+  Server _server;
+
+  /// A stream controller that forwards incoming messages to [_server] if
+  /// they're requests.
+  final _serverIncomingForwarder = new StreamController(sync: true);
+
+  /// A stream controller that forwards incoming messages to [_client] if
+  /// they're responses.
+  final _clientIncomingForwarder = new StreamController(sync: true);
+
+  /// A stream controller that forwards outgoing messages from both [_server]
+  /// and [_client].
+  final _outgoingForwarder = new StreamController(sync: true);
+
+  /// Creates a [Peer] that reads incoming messages from [incoming] and writes
+  /// outgoing messages to [outgoing].
+  ///
+  /// If [incoming] is a [StreamSink] as well as a [Stream] (for example, a
+  /// `WebSocket`), [outgoing] may be omitted.
+  ///
+  /// Note that the peer won't begin listening to [incoming] until [Peer.listen]
+  /// is called.
+  Peer(Stream<String> incoming, [StreamSink<String> outgoing]) {
+    _streams = new TwoWayStream("Peer", incoming, "incoming",
+        outgoing, "outgoing", onInvalidInput: (message, error) {
+      _streams.add(new RpcException(error_code.PARSE_ERROR,
+          'Invalid JSON: ${error.message}').serialize(message));
+    });
+
+    _outgoingForwarder.stream.listen(_streams.add);
+    _server = new Server.withoutJson(
+        _serverIncomingForwarder.stream, _outgoingForwarder);
+    _client = new Client.withoutJson(
+        _clientIncomingForwarder.stream, _outgoingForwarder);
+  }
+
+  /// Creates a [Peer] that reads incoming decoded messages from [incoming] and
+  /// writes outgoing decoded messages to [outgoing].
+  ///
+  /// Unlike [new Peer], this doesn't read or write JSON strings. Instead, it
+  /// reads and writes decoded maps or lists.
+  ///
+  /// If [incoming] is a [StreamSink] as well as a [Stream], [outgoing] may be
+  /// omitted.
+  ///
+  /// Note that the peer won't begin listening to [incoming] until
+  /// [Peer.listen] is called.
+  Peer.withoutJson(Stream incoming, [StreamSink outgoing]) {
+    _streams = new TwoWayStream.withoutJson("Peer", incoming, "incoming",
+        outgoing, "outgoing");
+
+    _outgoingForwarder.stream.listen(_streams.add);
+    _server = new Server.withoutJson(
+        _serverIncomingForwarder.stream, _outgoingForwarder);
+    _client = new Client.withoutJson(
+        _clientIncomingForwarder.stream, _outgoingForwarder);
+  }
+
+  // Client methods.
+
+  Future sendRequest(String method, [parameters]) =>
+      _client.sendRequest(method, parameters);
+
+  void sendNotification(String method, [parameters]) =>
+      _client.sendNotification(method, parameters);
+
+  withBatch(callback()) => _client.withBatch(callback);
+
+  // Server methods.
+
+  void registerMethod(String name, Function callback) =>
+      _server.registerMethod(name, callback);
+
+  void registerFallback(callback(Parameters parameters)) =>
+      _server.registerFallback(callback);
+
+  // Shared methods.
+
+  Future listen() {
+    _client.listen();
+    _server.listen();
+    return _streams.listen((message) {
+      if (message is Map) {
+        if (message.containsKey('result') || message.containsKey('error')) {
+          _clientIncomingForwarder.add(message);
+        } else {
+          _serverIncomingForwarder.add(message);
+        }
+      } else if (message is List && message.isNotEmpty &&
+                 message.first is Map) {
+        if (message.first.containsKey('result') ||
+            message.first.containsKey('error')) {
+          _clientIncomingForwarder.add(message);
+        } else {
+          _serverIncomingForwarder.add(message);
+        }
+      } else {
+        // Non-Map and -List messages are ill-formed, so we pass them to the
+        // server since it knows how to send error responses.
+        _serverIncomingForwarder.add(message);
+      }
+    });
+  }
+
+  Future close() =>
+      Future.wait([_client.close(), _server.close(), _streams.close()]);
+}
diff --git a/pkg/json_rpc_2/lib/src/utils.dart b/pkg/json_rpc_2/lib/src/utils.dart
index a212f58..f862cb7 100644
--- a/pkg/json_rpc_2/lib/src/utils.dart
+++ b/pkg/json_rpc_2/lib/src/utils.dart
@@ -44,6 +44,28 @@
 String getErrorMessage(error) =>
     error.toString().replaceFirst(_exceptionPrefix, '');
 
+/// Like `try`/`finally`, run [body] and ensure that [whenComplete] runs
+/// afterwards, regardless of whether [body] succeeded.
+///
+/// This is synchronicity-agnostic relative to [body]. If [body] returns a
+/// [Future], this wil run asynchronously; otherwise it will run synchronously.
+tryFinally(body(), whenComplete()) {
+  var result;
+  try {
+    result = body();
+  } catch (_) {
+    whenComplete();
+    rethrow;
+  }
+
+  if (result is! Future) {
+    whenComplete();
+    return result;
+  } else {
+    return result.whenComplete(whenComplete);
+  }
+}
+
 /// Returns a [StreamSink] that wraps [sink] and maps each event added using
 /// [callback].
 StreamSink mapStreamSink(StreamSink sink, callback(event)) =>
diff --git a/pkg/json_rpc_2/pubspec.yaml b/pkg/json_rpc_2/pubspec.yaml
index 287bba7..4f6eb96 100644
--- a/pkg/json_rpc_2/pubspec.yaml
+++ b/pkg/json_rpc_2/pubspec.yaml
@@ -1,5 +1,5 @@
 name: json_rpc_2
-version: 0.1.1-dev
+version: 1.0.0
 author: Dart Team <misc@dartlang.org>
 description: An implementation of the JSON-RPC 2.0 spec.
 homepage: http://www.dartlang.org
diff --git a/pkg/json_rpc_2/test/client/client_test.dart b/pkg/json_rpc_2/test/client/client_test.dart
new file mode 100644
index 0000000..9fcf9e3
--- /dev/null
+++ b/pkg/json_rpc_2/test/client/client_test.dart
@@ -0,0 +1,239 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library json_rpc_2.test.client.client_test;
+
+import 'dart:async';
+import 'dart:convert';
+
+import 'package:unittest/unittest.dart';
+import 'package:json_rpc_2/error_code.dart' as error_code;
+import 'package:json_rpc_2/json_rpc_2.dart' as json_rpc;
+
+import 'utils.dart';
+
+void main() {
+  var controller;
+  setUp(() => controller = new ClientController());
+
+  test("sends a message and returns the response", () {
+    controller.expectRequest((request) {
+      expect(request, allOf([
+        containsPair('jsonrpc', '2.0'),
+        containsPair('method', 'foo'),
+        containsPair('params', {'param': 'value'})
+      ]));
+
+      return {
+        'jsonrpc': '2.0',
+        'result': 'bar',
+        'id': request['id']
+      };
+    });
+
+    expect(controller.client.sendRequest("foo", {'param': 'value'}),
+        completion(equals('bar')));
+  });
+
+  test("sends a notification and expects no response", () {
+    controller.expectRequest((request) {
+      expect(request, equals({
+        'jsonrpc': '2.0',
+        'method': 'foo',
+        'params': {'param': 'value'}
+      }));
+    });
+
+    controller.client.sendNotification("foo", {'param': 'value'});
+  });
+
+  test("sends a notification with positional parameters", () {
+    controller.expectRequest((request) {
+      expect(request, equals({
+        'jsonrpc': '2.0',
+        'method': 'foo',
+        'params': ['value1', 'value2']
+      }));
+    });
+
+    controller.client.sendNotification("foo", ['value1', 'value2']);
+  });
+
+  test("sends a notification with no parameters", () {
+    controller.expectRequest((request) {
+      expect(request, equals({
+        'jsonrpc': '2.0',
+        'method': 'foo'
+      }));
+    });
+
+    controller.client.sendNotification("foo");
+  });
+
+  test("sends a synchronous batch of requests", () {
+    controller.expectRequest((request) {
+      expect(request, new isInstanceOf<List>());
+      expect(request, hasLength(3));
+      expect(request[0], equals({
+        'jsonrpc': '2.0',
+        'method': 'foo'
+      }));
+      expect(request[1], allOf([
+        containsPair('jsonrpc', '2.0'),
+        containsPair('method', 'bar'),
+        containsPair('params', {'param': 'value'})
+      ]));
+      expect(request[2], allOf([
+        containsPair('jsonrpc', '2.0'),
+        containsPair('method', 'baz')
+      ]));
+
+      return [
+        {
+          'jsonrpc': '2.0',
+          'result': 'baz response',
+          'id': request[2]['id']
+        },
+        {
+          'jsonrpc': '2.0',
+          'result': 'bar response',
+          'id': request[1]['id']
+        }
+      ];
+    });
+
+    controller.client.withBatch(() {
+      controller.client.sendNotification("foo");
+      expect(controller.client.sendRequest("bar", {'param': 'value'}),
+          completion(equals("bar response")));
+      expect(controller.client.sendRequest("baz"),
+          completion(equals("baz response")));
+    });
+  });
+
+  test("sends an asynchronous batch of requests", () {
+    controller.expectRequest((request) {
+      expect(request, new isInstanceOf<List>());
+      expect(request, hasLength(3));
+      expect(request[0], equals({
+        'jsonrpc': '2.0',
+        'method': 'foo'
+      }));
+      expect(request[1], allOf([
+        containsPair('jsonrpc', '2.0'),
+        containsPair('method', 'bar'),
+        containsPair('params', {'param': 'value'})
+      ]));
+      expect(request[2], allOf([
+        containsPair('jsonrpc', '2.0'),
+        containsPair('method', 'baz')
+      ]));
+
+      return [
+        {
+          'jsonrpc': '2.0',
+          'result': 'baz response',
+          'id': request[2]['id']
+        },
+        {
+          'jsonrpc': '2.0',
+          'result': 'bar response',
+          'id': request[1]['id']
+        }
+      ];
+    });
+
+    controller.client.withBatch(() {
+      return new Future.value().then((_) {
+        controller.client.sendNotification("foo");
+        return new Future.value();
+      }).then((_) {
+        expect(controller.client.sendRequest("bar", {'param': 'value'}),
+            completion(equals("bar response")));
+        return new Future.value();
+      }).then((_) {
+        expect(controller.client.sendRequest("baz"),
+            completion(equals("baz response")));
+      });
+    });
+  });
+
+  test("reports an error from the server", () {
+    controller.expectRequest((request) {
+      expect(request, allOf([
+        containsPair('jsonrpc', '2.0'),
+        containsPair('method', 'foo')
+      ]));
+
+      return {
+        'jsonrpc': '2.0',
+        'error': {
+          'code': error_code.SERVER_ERROR,
+          'message': 'you are bad at requests',
+          'data': 'some junk'
+        },
+        'id': request['id']
+      };
+    });
+
+    expect(controller.client.sendRequest("foo", {'param': 'value'}),
+        throwsA(predicate((exception) {
+      expect(exception, new isInstanceOf<json_rpc.RpcException>());
+      expect(exception.code, equals(error_code.SERVER_ERROR));
+      expect(exception.message, equals('you are bad at requests'));
+      expect(exception.data, equals('some junk'));
+      return true;
+    })));
+  });
+
+  test("ignores bogus responses", () {
+    // Make a request so we have something to respond to.
+    controller.expectRequest((request) {
+      controller.sendJsonResponse("{invalid");
+      controller.sendResponse("not a map");
+      controller.sendResponse({
+        'jsonrpc': 'wrong version',
+        'result': 'wrong',
+        'id': request['id']
+      });
+      controller.sendResponse({
+        'jsonrpc': '2.0',
+        'result': 'wrong'
+      });
+      controller.sendResponse({
+        'jsonrpc': '2.0',
+        'id': request['id']
+      });
+      controller.sendResponse({
+        'jsonrpc': '2.0',
+        'error': 'not a map',
+        'id': request['id']
+      });
+      controller.sendResponse({
+        'jsonrpc': '2.0',
+        'error': {
+          'code': 'not an int',
+          'message': 'dang yo'
+        },
+        'id': request['id']
+      });
+      controller.sendResponse({
+        'jsonrpc': '2.0',
+        'error': {
+          'code': 123,
+          'message': 0xDEADBEEF
+        },
+        'id': request['id']
+      });
+
+      return pumpEventQueue().then((_) => {
+        'jsonrpc': '2.0',
+        'result': 'right',
+        'id': request['id']
+      });
+    });
+
+    expect(controller.client.sendRequest("foo"), completion(equals('right')));
+  });
+}
diff --git a/pkg/json_rpc_2/test/client/stream_test.dart b/pkg/json_rpc_2/test/client/stream_test.dart
new file mode 100644
index 0000000..6942ff7
--- /dev/null
+++ b/pkg/json_rpc_2/test/client/stream_test.dart
@@ -0,0 +1,96 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library json_rpc_2.test.client.stream_test;
+
+import 'dart:async';
+
+import 'package:unittest/unittest.dart';
+import 'package:json_rpc_2/json_rpc_2.dart' as json_rpc;
+
+import 'utils.dart';
+
+void main() {
+  test(".withoutJson supports decoded stream and sink", () {
+    var responseController = new StreamController();
+    var requestController = new StreamController();
+    var client = new json_rpc.Client.withoutJson(
+        responseController.stream, requestController.sink);
+    client.listen();
+
+    expect(requestController.stream.first.then((request) {
+      expect(request, allOf([
+        containsPair('jsonrpc', '2.0'),
+        containsPair('method', 'foo')
+      ]));
+
+      responseController.add({
+        'jsonrpc': '2.0',
+        'result': 'bar',
+        'id': request['id']
+      });
+    }), completes);
+
+    client.sendRequest('foo');
+  });
+
+  test(".listen returns when the controller is closed", () {
+    var responseController = new StreamController();
+    var requestController = new StreamController();
+    var client = new json_rpc.Client.withoutJson(
+        responseController.stream, requestController.sink);
+
+    var hasListenCompeted = false;
+    expect(client.listen().then((_) => hasListenCompeted = true), completes);
+
+    return pumpEventQueue().then((_) {
+      expect(hasListenCompeted, isFalse);
+
+      // This should cause listen to complete.
+      return responseController.close();
+    });
+  });
+
+  test(".listen returns a stream error", () {
+    var responseController = new StreamController();
+    var requestController = new StreamController();
+    var client = new json_rpc.Client(
+        responseController.stream, requestController.sink);
+
+    expect(client.listen(), throwsA('oh no'));
+    responseController.addError('oh no');
+  });
+
+  test(".listen can't be called twice", () {
+    var responseController = new StreamController();
+    var requestController = new StreamController();
+    var client = new json_rpc.Client(
+        responseController.stream, requestController.sink);
+    client.listen();
+
+    expect(() => client.listen(), throwsStateError);
+  });
+
+  test(".close cancels the stream subscription and closes the sink", () {
+    var responseController = new StreamController();
+    var requestController = new StreamController();
+    var client = new json_rpc.Client(
+        responseController.stream, requestController.sink);
+
+    expect(client.listen(), completes);
+    expect(client.close(), completes);
+
+    expect(() => responseController.stream.listen((_) {}), throwsStateError);
+    expect(requestController.isClosed, isTrue);
+  });
+
+  test(".close can't be called before .listen", () {
+    var responseController = new StreamController();
+    var requestController = new StreamController();
+    var client = new json_rpc.Client(
+        responseController.stream, requestController.sink);
+
+    expect(() => client.close(), throwsStateError);
+  });
+}
diff --git a/pkg/json_rpc_2/test/client/utils.dart b/pkg/json_rpc_2/test/client/utils.dart
new file mode 100644
index 0000000..a164577
--- /dev/null
+++ b/pkg/json_rpc_2/test/client/utils.dart
@@ -0,0 +1,65 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library json_rpc_2.test.client.utils;
+
+import 'dart:async';
+import 'dart:convert';
+
+import 'package:json_rpc_2/json_rpc_2.dart' as json_rpc;
+import 'package:json_rpc_2/error_code.dart' as error_code;
+import 'package:unittest/unittest.dart';
+
+/// A controller used to test a [json_rpc.Client].
+class ClientController {
+  /// The controller for the client's response stream.
+  final _responseController = new StreamController<String>();
+
+  /// The controller for the client's request sink.
+  final _requestController = new StreamController<String>();
+
+  /// The client.
+  json_rpc.Client get client => _client;
+  json_rpc.Client _client;
+
+  ClientController() {
+    _client = new json_rpc.Client(
+        _responseController.stream, _requestController.sink);
+    _client.listen();
+  }
+
+  /// Expects that the client will send a request.
+  ///
+  /// The request is passed to [callback], which can return a response. If it
+  /// returns a String, that's sent as the response directly. If it returns
+  /// null, no response is sent. Otherwise, the return value is encoded and sent
+  /// as the response.
+  void expectRequest(callback(request)) {
+    expect(_requestController.stream.first.then((request) {
+      return callback(JSON.decode(request));
+    }).then((response) {
+      if (response == null) return;
+      if (response is! String) response = JSON.encode(response);
+      _responseController.add(response);
+    }), completes);
+  }
+
+  /// Sends [response], a decoded response, to [client].
+  Future sendResponse(response) => sendJsonResponse(JSON.encode(response));
+
+  /// Sends [response], a JSON-encoded response, to [client].
+  Future sendJsonResponse(String request) => _responseController.add(request);
+}
+
+/// Returns a [Future] that completes after pumping the event queue [times]
+/// times. By default, this should pump the event queue enough times to allow
+/// any code to run, as long as it's not waiting on some external event.
+Future pumpEventQueue([int times = 20]) {
+  if (times == 0) return new Future.value();
+  // We use a delayed future to allow microtask events to finish. The
+  // Future.value or Future() constructors use scheduleMicrotask themselves and
+  // would therefore not wait for microtask callbacks that are scheduled after
+  // invoking this method.
+  return new Future.delayed(Duration.ZERO, () => pumpEventQueue(times - 1));
+}
diff --git a/pkg/json_rpc_2/test/peer_test.dart b/pkg/json_rpc_2/test/peer_test.dart
new file mode 100644
index 0000000..07bf79920
--- /dev/null
+++ b/pkg/json_rpc_2/test/peer_test.dart
@@ -0,0 +1,205 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library json_rpc_2.test.client.client_test;
+
+import 'dart:async';
+import 'dart:convert';
+
+import 'package:unittest/unittest.dart';
+import 'package:json_rpc_2/error_code.dart' as error_code;
+import 'package:json_rpc_2/json_rpc_2.dart' as json_rpc;
+
+void main() {
+  var incoming;
+  var outgoing;
+  var peer;
+  setUp(() {
+    var incomingController = new StreamController();
+    incoming = incomingController.sink;
+    var outgoingController = new StreamController();
+    outgoing = outgoingController.stream;
+    peer = new json_rpc.Peer.withoutJson(
+        incomingController.stream, outgoingController);
+  });
+
+  group("like a client,", () {
+    test("can send a message and receive a response", () {
+      expect(outgoing.first.then((request) {
+        expect(request, equals({
+          "jsonrpc": "2.0",
+          "method": "foo",
+          "params": {"bar": "baz"},
+          "id": 0
+        }));
+        incoming.add({
+          "jsonrpc": "2.0",
+          "result": "qux",
+          "id": 0
+        });
+      }), completes);
+
+      peer.listen();
+      expect(peer.sendRequest("foo", {"bar": "baz"}),
+          completion(equals("qux")));
+    });
+
+    test("can send a batch of messages and receive a batch of responses", () {
+      expect(outgoing.first.then((request) {
+        expect(request, equals([
+          {
+            "jsonrpc": "2.0",
+            "method": "foo",
+            "params": {"bar": "baz"},
+            "id": 0
+          },
+          {
+            "jsonrpc": "2.0",
+            "method": "a",
+            "params": {"b": "c"},
+            "id": 1
+          },
+          {
+            "jsonrpc": "2.0",
+            "method": "w",
+            "params": {"x": "y"},
+            "id": 2
+          }
+        ]));
+
+        incoming.add([
+          {
+            "jsonrpc": "2.0",
+            "result": "qux",
+            "id": 0
+          },
+          {
+            "jsonrpc": "2.0",
+            "result": "d",
+            "id": 1
+          },
+          {
+            "jsonrpc": "2.0",
+            "result": "z",
+            "id": 2
+          }
+        ]);
+      }), completes);
+
+      peer.listen();
+
+      peer.withBatch(() {
+        expect(peer.sendRequest("foo", {"bar": "baz"}),
+            completion(equals("qux")));
+        expect(peer.sendRequest("a", {"b": "c"}), completion(equals("d")));
+        expect(peer.sendRequest("w", {"x": "y"}), completion(equals("z")));
+      });
+    });
+  });
+
+  group("like a server,", () {
+    test("can receive a call and return a response", () {
+      expect(outgoing.first, completion(equals({
+        "jsonrpc": "2.0",
+        "result": "qux",
+        "id": 0
+      })));
+
+      peer.registerMethod("foo", (_) => "qux");
+      peer.listen();
+
+      incoming.add({
+        "jsonrpc": "2.0",
+        "method": "foo",
+        "params": {"bar": "baz"},
+        "id": 0
+      });
+    });
+
+    test("can receive a batch of calls and return a batch of responses", () {
+      expect(outgoing.first, completion(equals([
+        {
+          "jsonrpc": "2.0",
+          "result": "qux",
+          "id": 0
+        },
+        {
+          "jsonrpc": "2.0",
+          "result": "d",
+          "id": 1
+        },
+        {
+          "jsonrpc": "2.0",
+          "result": "z",
+          "id": 2
+        }
+      ])));
+
+      peer.registerMethod("foo", (_) => "qux");
+      peer.registerMethod("a", (_) => "d");
+      peer.registerMethod("w", (_) => "z");
+      peer.listen();
+
+      incoming.add([
+        {
+          "jsonrpc": "2.0",
+          "method": "foo",
+          "params": {"bar": "baz"},
+          "id": 0
+        },
+        {
+          "jsonrpc": "2.0",
+          "method": "a",
+          "params": {"b": "c"},
+          "id": 1
+        },
+        {
+          "jsonrpc": "2.0",
+          "method": "w",
+          "params": {"x": "y"},
+          "id": 2
+        }
+      ]);
+    });
+
+    test("returns a response for malformed JSON", () {
+      var incomingController = new StreamController();
+      var outgoingController = new StreamController();
+      var jsonPeer = new json_rpc.Peer(
+          incomingController.stream, outgoingController);
+
+      expect(outgoingController.stream.first.then(JSON.decode), completion({
+        "jsonrpc": "2.0",
+        "error": {
+          'code': error_code.PARSE_ERROR,
+          "message": startsWith("Invalid JSON: "),
+          "data": {'request': '{invalid'}
+        },
+        "id": null
+      }));
+
+      jsonPeer.listen();
+
+      incomingController.add("{invalid");
+    });
+
+    test("returns a response for incorrectly-structured JSON", () {
+      expect(outgoing.first, completion({
+        "jsonrpc": "2.0",
+        "error": {
+          'code': error_code.INVALID_REQUEST,
+          "message": 'Request must contain a "jsonrpc" key.',
+          "data": {'request': {'completely': 'wrong'}}
+        },
+        "id": null
+      }));
+
+      peer.listen();
+
+      incoming.add({
+        "completely": "wrong"
+      });
+    });
+  });
+}
diff --git a/pkg/pkg.gyp b/pkg/pkg.gyp
index 7751c19..ab164fc 100644
--- a/pkg/pkg.gyp
+++ b/pkg/pkg.gyp
@@ -21,8 +21,7 @@
                 '"polymer/e2e_test/"])',
             '<!@(["python", "../tools/list_pkg_directories.py", '
                 '"../runtime/bin/vmservice"])',
-            '../sdk/lib/_internal/compiler',
-            '../sdk/lib/_internal/libraries.dart',
+            '../sdk/lib/_internal',
             '../site/try',
           ],
           'outputs': [
@@ -69,8 +68,7 @@
                 '"third_party"])',
             '<!@(["python", "../tools/list_pkg_directories.py", '
                 '"../third_party/pkg"])',
-            '../sdk/lib/_internal/compiler',
-            '../sdk/lib/_internal/libraries.dart',
+            '../sdk/lib/_internal',
             '<(SHARED_INTERMEDIATE_DIR)/remove_html_imports/http/lib/http.dart',
           ],
           'outputs': [
diff --git a/pkg/pkg.status b/pkg/pkg.status
index 7ecf212..97f3075 100644
--- a/pkg/pkg.status
+++ b/pkg/pkg.status
@@ -19,7 +19,6 @@
 scheduled_test/test/scheduled_process_test: Pass, Slow # Issue 9231
 scheduled_test/test/scheduled_stream/stream_matcher_test: Pass, Slow
 polymer/test/build/script_compactor_test: Pass, Slow
-analysis_server/test/integration/asynchrony_test: Skip # Issue 21252
 
 [ $compiler == none && ($runtime == drt || $runtime == dartium || $runtime == ContentShellOnAndroid) ]
 third_party/angular_tests/browser_test/*: Skip # github perf_api.dart issue 5
@@ -30,6 +29,7 @@
 mutation_observer: Skip # Issue 21149
 
 [ $compiler == none && ($runtime == dartium || $runtime == ContentShellOnAndroid) ]
+polymer/example/component/news/test/news_index_test: Pass, RuntimeError # Issue 18931. Issue 19196.
 polymer/test/attr_deserialize_test: Pass, RuntimeError # Issue 18931
 polymer/test/attr_mustache_test: Pass, RuntimeError # Issue 18931
 polymer/test/bind_test: Pass, RuntimeError # Issue 18931
@@ -266,11 +266,12 @@
 scheduled_test/test/scheduled_test/wrap_async_test: Timeout # Issue 21007
 scheduled_test/test/scheduled_test/wrap_future_test: Timeout # Issue 21007
 
-[ ($runtime == safari && $builder_tag == mac10_7) || $runtime == safarimobilesim ]
-# Unexplained errors only occuring on Safari.
+[ $runtime == safarimobilesim ]
+# Unexplained errors only occuring on Safari 6.1 and earlier.
 typed_data/test/typed_buffers_test: RuntimeError
 
 [ $runtime == safari ]
+polymer/test/*: Skip # Issue 21434
 polymer/test/js_interop_test: Pass, RuntimeError # Issue 20075
 
 [ $runtime == safari || $ie ]
@@ -294,6 +295,8 @@
 polymer/e2e_test/canonicalization: Skip
 polymer/e2e_test/experimental_boot: Skip
 
+compiler/samples/compile_loop/compile_loop: CompileTimeError  # Issue 16524
+
 [ $compiler == dartanalyzer || $compiler == dart2analyzer ]
 # This test uses third_party/pkg/perf_api/lib/perf_api.dart, which
 # contains illegal constant constructors.
@@ -490,6 +493,3 @@
 
 [ $runtime == drt ]
 http/test/html/client_test: Skip # Issue 18566
-
-[ $system == windows ]
-analysis_server/test/integration/search/get_type_hierarchy_test: Pass, Fail # Issue 20436
diff --git a/pkg/polymer/lib/builder.dart b/pkg/polymer/lib/builder.dart
index 6a7ae45..1ddefc8 100644
--- a/pkg/polymer/lib/builder.dart
+++ b/pkg/polymer/lib/builder.dart
@@ -256,8 +256,8 @@
 ///   * `--deploy`: force deploy.
 ///   * `--no-js`: deploy replaces *.dart scripts with *.dart.js. You can turn
 ///     this feature off with --no-js, which leaves "packages/browser/dart.js".
-///   * `--csp`: replaces *.dart with *.dart.precompiled.js to comply with
-///     Content Security Policy restrictions.
+///   * `--csp`: extracts inlined JavaScript code to comply with Content
+///     Security Policy restrictions.
 ///   * `--help`: print documentation for each option and exit.
 ///
 /// Currently not all the flags are used by [lint] or [deploy] above, but they
@@ -293,7 +293,7 @@
         'leaves "packages/browser/dart.js" to do the replacement at runtime.',
         defaultsTo: true)
     ..addFlag('csp', help:
-        'replaces *.dart with *.dart.precompiled.js to comply with \n'
+        'extracts inlined JavaScript code to comply with \n'
         'Content Security Policy restrictions.')
     ..addFlag('debug', help:
         'run in debug mode. For example, use the debug polyfill \n'
diff --git a/pkg/polymer/lib/deploy.dart b/pkg/polymer/lib/deploy.dart
index c254013..a62c18b 100644
--- a/pkg/polymer/lib/deploy.dart
+++ b/pkg/polymer/lib/deploy.dart
@@ -163,7 +163,7 @@
           'web_components/platform.concat.js instead of the minified one.\n',
           defaultsTo: false)
       ..addFlag('csp', help:
-          'replaces *.dart with *.dart.precompiled.js to comply with \n'
+          'extracts inlined JavaScript code to comply with \n'
           'Content Security Policy restrictions.');
   try {
     var results = parser.parse(arguments);
diff --git a/pkg/polymer/lib/src/build/common.dart b/pkg/polymer/lib/src/build/common.dart
index 99098f8..acdd89b 100644
--- a/pkg/polymer/lib/src/build/common.dart
+++ b/pkg/polymer/lib/src/build/common.dart
@@ -67,17 +67,12 @@
   final Map<String, bool> inlineStylesheets;
 
   /// True to enable Content Security Policy.
-  /// This means the HTML page will include *.dart.precompiled.js
-  ///
-  /// This flag has no effect unless [directlyIncludeJS] is enabled.
+  /// This means the HTML page will not have inlined .js code.
   final bool contentSecurityPolicy;
 
   /// True to include the compiled JavaScript directly from the HTML page.
   /// If enabled this will remove "packages/browser/dart.js" and replace
   /// `type="application/dart"` scripts with equivalent *.dart.js files.
-  ///
-  /// If [contentSecurityPolicy] enabled, this will reference files
-  /// named *.dart.precompiled.js.
   final bool directlyIncludeJS;
 
   /// Run transformers to create a releasable app. For example, include the
diff --git a/pkg/polymer/tool/create_message_details_page.dart b/pkg/polymer/tool/create_message_details_page.dart
index 37e72a6..0e178cd 100644
--- a/pkg/polymer/tool/create_message_details_page.dart
+++ b/pkg/polymer/tool/create_message_details_page.dart
@@ -84,7 +84,7 @@
   var id = template.id;
   var hashTag = '${id.package}_${id.id}';
   var title = '### ${template.description} [#${id.id}](#$hashTag)';
-  var body = '\n$details\n\n----\n\n';
+  var body = '\n{% raw %}$details{% endraw %}\n\n----\n\n';
   // We add the anchor inside the <h3> title, otherwise the link doesn't work.
   if (forSite) {
     sb..write(title)
diff --git a/pkg/source_span/CHANGELOG.md b/pkg/source_span/CHANGELOG.md
index 04e4be2..e5190bc 100644
--- a/pkg/source_span/CHANGELOG.md
+++ b/pkg/source_span/CHANGELOG.md
@@ -1,3 +1,7 @@
+# 1.0.1
+
+* Use a more compact internal representation for `FileSpan`.
+
 # 1.0.0
 
 This package was extracted from the
diff --git a/pkg/source_span/lib/src/file.dart b/pkg/source_span/lib/src/file.dart
index 0d2d6f6..14aa226 100644
--- a/pkg/source_span/lib/src/file.dart
+++ b/pkg/source_span/lib/src/file.dart
@@ -73,7 +73,7 @@
   /// If [end] isn't passed, it defaults to the end of the file.
   FileSpan span(int start, [int end]) {
     if (end == null) end = length - 1;
-    return new FileSpan._(this, location(start), location(end));
+    return new FileSpan._(this, start, end);
   }
 
   /// Returns a location in [this] at [offset].
@@ -172,7 +172,7 @@
     }
   }
 
-  FileSpan pointSpan() => new FileSpan._(file, this, this);
+  FileSpan pointSpan() => new FileSpan._(file, offset, offset);
 }
 
 /// A [SourceSpan] within a [SourceFile].
@@ -187,14 +187,31 @@
   /// The [file] that [this] belongs to.
   final SourceFile file;
 
-  final FileLocation start;
-  final FileLocation end;
+  /// The offset of the beginning of the span.
+  ///
+  /// [start] is lazily generated from this to avoid allocating unnecessary
+  /// objects.
+  final int _start;
+
+  /// The offset of the end of the span.
+  ///
+  /// [end] is lazily generated from this to avoid allocating unnecessary
+  /// objects.
+  final int _end;
+
+  FileLocation get start => new FileLocation._(file, _start);
+  FileLocation get end => new FileLocation._(file, _end);
 
   String get text => file.getText(start.offset, end.offset);
 
-  FileSpan._(this.file, this.start, this.end) {
-    if (end.offset < start.offset) {
-      throw new ArgumentError('End $end must come after start $start.');
+  FileSpan._(this.file, this._start, this._end) {
+    if (_end < _start) {
+      throw new ArgumentError('End $_end must come after start $_start.');
+    } else if (_end > file.length) {
+      throw new RangeError("End $_end must not be greater than the number "
+          "of characters in the file, ${file.length}.");
+    } else if (_start < 0) {
+      throw new RangeError("Start may not be negative, was $_start.");
     }
   }
 
@@ -222,8 +239,8 @@
           " \"${other.sourceUrl}\" don't match.");
     }
 
-    var start = min(this.start, other.start);
-    var end = max(this.end, other.end);
+    var start = math.min(this._start, other._start);
+    var end = math.max(this._end, other._end);
     return new FileSpan._(file, start, end);    
   }
 
diff --git a/pkg/source_span/pubspec.yaml b/pkg/source_span/pubspec.yaml
index 66e5811..ae1bfcf 100644
--- a/pkg/source_span/pubspec.yaml
+++ b/pkg/source_span/pubspec.yaml
@@ -1,6 +1,6 @@
 name: source_span
 
-version: 1.0.0
+version: 1.0.1
 author: Dart Team <misc@dartlang.org>
 description: A library for identifying source spans and locations.
 homepage: http://www.dartlang.org
diff --git a/pkg/string_scanner/CHANGELOG.md b/pkg/string_scanner/CHANGELOG.md
index d7f09f3..d273748 100644
--- a/pkg/string_scanner/CHANGELOG.md
+++ b/pkg/string_scanner/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 0.1.2
+
+* Add `StringScanner.substring`, which returns a substring of the source string.
+
 ## 0.1.1
 
 * Declare `SpanScanner`'s exposed `SourceSpan`s and `SourceLocation`s to be
diff --git a/pkg/string_scanner/lib/src/string_scanner.dart b/pkg/string_scanner/lib/src/string_scanner.dart
index 44d5d2d..bc5e1f5 100644
--- a/pkg/string_scanner/lib/src/string_scanner.dart
+++ b/pkg/string_scanner/lib/src/string_scanner.dart
@@ -131,6 +131,15 @@
     return _lastMatch != null;
   }
 
+  /// Returns the substring of [string] between [start] and [end].
+  ///
+  /// Unlike [String.substring], [end] defaults to [position] rather than the
+  /// end of the string.
+  String substring(int start, [int end]) {
+    if (end == null) end = position;
+    return string.substring(start, end);
+  }
+
   /// Throws a [FormatException] with [message] as well as a detailed
   /// description of the location of the error in the string.
   ///
diff --git a/pkg/string_scanner/pubspec.yaml b/pkg/string_scanner/pubspec.yaml
index 831dfac..d14a43e 100644
--- a/pkg/string_scanner/pubspec.yaml
+++ b/pkg/string_scanner/pubspec.yaml
@@ -1,5 +1,5 @@
 name: string_scanner
-version: 0.1.1
+version: 0.1.2
 author: "Dart Team <misc@dartlang.org>"
 homepage: http://www.dartlang.org
 description: >
diff --git a/pkg/string_scanner/test/string_scanner_test.dart b/pkg/string_scanner/test/string_scanner_test.dart
index 6144bf9..fcd904a 100644
--- a/pkg/string_scanner/test/string_scanner_test.dart
+++ b/pkg/string_scanner/test/string_scanner_test.dart
@@ -61,6 +61,10 @@
       expect(scanner.position, equals(0));
     });
 
+    test("substring returns the empty string", () {
+      expect(scanner.substring(0), isEmpty);
+    });
+
     test('setting position to 1 throws an ArgumentError', () {
       expect(() {
         scanner.position = 1;
@@ -165,6 +169,18 @@
       expect(scanner.rest, equals('foo bar'));
     });
 
+    test("substring from the beginning returns the empty string", () {
+      expect(scanner.substring(0), isEmpty);
+    });
+
+    test("substring with a custom end returns the substring", () {
+      expect(scanner.substring(0, 3), equals('foo'));
+    });
+
+    test("substring with the string length returns the whole string", () {
+      expect(scanner.substring(0, 7), equals('foo bar'));
+    });
+
     test('setting position to 1 moves the cursor forward', () {
       scanner.position = 1;
       expect(scanner.position, equals(1));
@@ -260,6 +276,18 @@
       expect(scanner.position, equals(7));
     });
 
+    test("substring from the beginning returns the whole string", () {
+      expect(scanner.substring(0), equals('foo bar'));
+    });
+
+    test("substring with a custom start returns a substring from there", () {
+      expect(scanner.substring(4), equals('bar'));
+    });
+
+    test("substring with a custom start and end returns that substring", () {
+      expect(scanner.substring(3, 5), equals(' b'));
+    });
+
     test('setting position to 1 moves the cursor backward', () {
       scanner.position = 1;
       expect(scanner.position, equals(1));
diff --git a/pkg/typed_data/lib/typed_buffers.dart b/pkg/typed_data/lib/typed_buffers.dart
index b880338..50ed241 100644
--- a/pkg/typed_data/lib/typed_buffers.dart
+++ b/pkg/typed_data/lib/typed_buffers.dart
@@ -32,12 +32,12 @@
 
   int get length => _length;
   E operator[](int index) {
-    if (index >= length) throw new RangeError.range(index, 0, length - 1);
+    if (index >= length) throw new RangeError.index(index, this);
     return _buffer[index];
   }
 
   void operator[]=(int index, E value) {
-    if (index >= length) throw new RangeError.range(index, 0, length - 1);
+    if (index >= length) throw new RangeError.index(index, this);
     _buffer[index] = value;
   }
 
diff --git a/pkg/typed_data/pubspec.yaml b/pkg/typed_data/pubspec.yaml
index 5688a24..b4c3945 100644
--- a/pkg/typed_data/pubspec.yaml
+++ b/pkg/typed_data/pubspec.yaml
@@ -1,5 +1,5 @@
 name: typed_data
-version: 1.0.0
+version: 1.0.1-dev
 author: Dart Team <misc@dartlang.org>
 description: Utility functions and classes related to the 'dart:typed_data' library.
 homepage: http://www.dartlang.org
diff --git a/pkg/yaml/CHANGELOG.md b/pkg/yaml/CHANGELOG.md
index 68af5f5..f454255 100644
--- a/pkg/yaml/CHANGELOG.md
+++ b/pkg/yaml/CHANGELOG.md
@@ -1,3 +1,21 @@
+## 2.1.0
+
+* Rewrite the parser for a 10x speed improvement.
+
+* Support anchors and aliases (`&foo` and `*foo`).
+
+* Support explicit tags (e.g. `!!str`). Note that user-defined tags are still
+  not fully supported.
+
+* `%YAML` and `%TAG` directives are now parsed, although again user-defined tags
+  are not fully supported.
+
+* `YamlScalar`, `YamlList`, and `YamlMap` now expose the styles in which they
+  were written (for example plain vs folded, block vs flow).
+
+* A `yamlWarningCallback` field is exposed. This field can be used to customize
+  how YAML warnings are displayed.
+
 ## 2.0.1+1
 
 * Fix an import in a test.
diff --git a/pkg/yaml/lib/src/composer.dart b/pkg/yaml/lib/src/composer.dart
deleted file mode 100644
index 8612067..0000000
--- a/pkg/yaml/lib/src/composer.dart
+++ /dev/null
@@ -1,183 +0,0 @@
-// Copyright (c) 2012, 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.
-
-library yaml.composer;
-
-import 'model.dart';
-import 'visitor.dart';
-import 'yaml_exception.dart';
-
-/// Takes a parsed YAML document (what the spec calls the "serialization tree")
-/// and resolves aliases, resolves tags, and parses scalars to produce the
-/// "representation graph".
-class Composer extends Visitor {
-  /// The root node of the serialization tree.
-  final Node _root;
-
-  /// Map from anchor names to the most recent representation graph node with
-  /// that anchor.
-  final _anchors = <String, Node>{};
-
-  /// The next id to use for the represenation graph's anchors.
-  ///
-  /// The spec doesn't use anchors in the representation graph, but we do so
-  /// that the constructor can ensure that the same node in the representation
-  /// graph produces the same native object.
-  var _idCounter = 0;
-
-  Composer(this._root);
-
-  /// Runs the Composer to produce a representation graph.
-  Node compose() => _root.visit(this);
-
-  /// Returns the anchor to which an alias node refers.
-  Node visitAlias(AliasNode alias) {
-    if (!_anchors.containsKey(alias.anchor)) {
-      throw new YamlException("No anchor for alias ${alias.anchor}.",
-          alias.span);
-    }
-    return _anchors[alias.anchor];
-  }
-
-  /// Parses a scalar node according to its tag, or auto-detects the type if no
-  /// tag exists.
-  ///
-  /// Currently this only supports the YAML core type schema.
-  Node visitScalar(ScalarNode scalar) {
-    if (scalar.tag.name == "!") {
-      return setAnchor(scalar, parseString(scalar));
-    } else if (scalar.tag.name == "?") {
-      for (var fn in [parseNull, parseBool, parseInt, parseFloat]) {
-        var result = fn(scalar);
-        if (result != null) return result;
-      }
-      return setAnchor(scalar, parseString(scalar));
-    }
-
-    var result = _parseByTag(scalar);
-    if (result != null) return setAnchor(scalar, result);
-    throw new YamlException('Invalid literal for ${scalar.tag}.',
-        scalar.span);
-  }
-
-  ScalarNode _parseByTag(ScalarNode scalar) {
-    switch (scalar.tag.name) {
-      case "null": return parseNull(scalar);
-      case "bool": return parseBool(scalar);
-      case "int": return parseInt(scalar);
-      case "float": return parseFloat(scalar);
-      case "str": return parseString(scalar);
-    }
-    throw new YamlException('Undefined tag: ${scalar.tag}.', scalar.span);
-  }
-
-  /// Assigns a tag to the sequence and recursively composes its contents.
-  Node visitSequence(SequenceNode seq) {
-    var tagName = seq.tag.name;
-    if (tagName != "!" && tagName != "?" && tagName != Tag.yaml("seq")) {
-      throw new YamlException("Invalid tag for sequence: ${seq.tag}.",
-          seq.span);
-    }
-
-    var result = setAnchor(seq,
-        new SequenceNode(Tag.yaml('seq'), null, seq.span));
-    result.content = super.visitSequence(seq);
-    return result;
-  }
-
-  /// Assigns a tag to the mapping and recursively composes its contents.
-  Node visitMapping(MappingNode map) {
-    var tagName = map.tag.name;
-    if (tagName != "!" && tagName != "?" && tagName != Tag.yaml("map")) {
-      throw new YamlException("Invalid tag for mapping: ${map.tag}.",
-          map.span);
-    }
-
-    var result = setAnchor(map,
-        new MappingNode(Tag.yaml('map'), null, map.span));
-    result.content = super.visitMapping(map);
-    return result;
-  }
-
-  /// If the serialization tree node [anchored] has an anchor, records that
-  /// that anchor is pointing to the representation graph node [result].
-  Node setAnchor(Node anchored, Node result) {
-    if (anchored.anchor == null) return result;
-    result.anchor = '${_idCounter++}';
-    _anchors[anchored.anchor] = result;
-    return result;
-  }
-
-  /// Parses a null scalar.
-  ScalarNode parseNull(ScalarNode scalar) {
-    if (new RegExp(r"^(null|Null|NULL|~|)$").hasMatch(scalar.content)) {
-      return new ScalarNode(Tag.yaml("null"), scalar.span, value: null);
-    } else {
-      return null;
-    }
-  }
-
-  /// Parses a boolean scalar.
-  ScalarNode parseBool(ScalarNode scalar) {
-    var match = new RegExp(r"^(?:(true|True|TRUE)|(false|False|FALSE))$").
-        firstMatch(scalar.content);
-    if (match == null) return null;
-    return new ScalarNode(Tag.yaml("bool"), scalar.span,
-        value: match.group(1) != null);
-  }
-
-  /// Parses an integer scalar.
-  ScalarNode parseInt(ScalarNode scalar) {
-    var match = new RegExp(r"^[-+]?[0-9]+$").firstMatch(scalar.content);
-    if (match != null) {
-      return new ScalarNode(Tag.yaml("int"), scalar.span,
-          value: int.parse(match.group(0)));
-    }
-
-    match = new RegExp(r"^0o([0-7]+)$").firstMatch(scalar.content);
-    if (match != null) {
-      int n = int.parse(match.group(1), radix: 8);
-      return new ScalarNode(Tag.yaml("int"), scalar.span, value: n);
-    }
-
-    match = new RegExp(r"^0x[0-9a-fA-F]+$").firstMatch(scalar.content);
-    if (match != null) {
-      return new ScalarNode(Tag.yaml("int"), scalar.span,
-          value: int.parse(match.group(0)));
-    }
-
-    return null;
-  }
-
-  /// Parses a floating-point scalar.
-  ScalarNode parseFloat(ScalarNode scalar) {
-    var match = new RegExp(
-          r"^[-+]?(\.[0-9]+|[0-9]+(\.[0-9]*)?)([eE][-+]?[0-9]+)?$").
-        firstMatch(scalar.content);
-    if (match != null) {
-      // YAML allows floats of the form "0.", but Dart does not. Fix up those
-      // floats by removing the trailing dot.
-      var matchStr = match.group(0).replaceAll(new RegExp(r"\.$"), "");
-      return new ScalarNode(Tag.yaml("float"), scalar.span,
-          value: double.parse(matchStr));
-    }
-
-    match = new RegExp(r"^([+-]?)\.(inf|Inf|INF)$").firstMatch(scalar.content);
-    if (match != null) {
-      var value = match.group(1) == "-" ? -double.INFINITY : double.INFINITY;
-      return new ScalarNode(Tag.yaml("float"), scalar.span, value: value);
-    }
-
-    match = new RegExp(r"^\.(nan|NaN|NAN)$").firstMatch(scalar.content);
-    if (match != null) {
-      return new ScalarNode(Tag.yaml("float"), scalar.span, value: double.NAN);
-    }
-
-    return null;
-  }
-
-  /// Parses a string scalar.
-  ScalarNode parseString(ScalarNode scalar) =>
-    new ScalarNode(Tag.yaml("str"), scalar.span, value: scalar.content);
-}
diff --git a/pkg/yaml/lib/src/constructor.dart b/pkg/yaml/lib/src/constructor.dart
deleted file mode 100644
index 5931dae..0000000
--- a/pkg/yaml/lib/src/constructor.dart
+++ /dev/null
@@ -1,76 +0,0 @@
-// Copyright (c) 2012, 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.
-
-library yaml.constructor;
-
-import 'equality.dart';
-import 'model.dart';
-import 'visitor.dart';
-import 'yaml_node.dart';
-
-/// Takes a parsed and composed YAML document (what the spec calls the
-/// "representation graph") and creates native Dart objects that represent that
-/// document.
-class Constructor extends Visitor {
-  /// The root node of the representation graph.
-  final Node _root;
-
-  /// Map from anchor names to the most recent Dart node with that anchor.
-  final _anchors = <String, YamlNode>{};
-
-  Constructor(this._root);
-
-  /// Runs the Constructor to produce a Dart object.
-  YamlNode construct() => _root.visit(this);
-
-  /// Returns the value of a scalar.
-  YamlScalar visitScalar(ScalarNode scalar) =>
-      new YamlScalar.internal(scalar.value, scalar.span);
-
-  /// Converts a sequence into a List of Dart objects.
-  YamlList visitSequence(SequenceNode seq) {
-    var anchor = getAnchor(seq);
-    if (anchor != null) return anchor;
-    var nodes = [];
-    var dartSeq = setAnchor(seq, new YamlList.internal(nodes, seq.span));
-    nodes.addAll(super.visitSequence(seq));
-    return dartSeq;
-  }
-
-  /// Converts a mapping into a [Map] of Dart objects.
-  YamlMap visitMapping(MappingNode map) {
-    var anchor = getAnchor(map);
-    if (anchor != null) return anchor;
-    var nodes = deepEqualsMap();
-    var dartMap = setAnchor(map, new YamlMap.internal(nodes, map.span));
-    super.visitMapping(map).forEach((k, v) => nodes[k] = v);
-    return dartMap;
-  }
-
-  /// Returns a new Dart object wrapping the object that already represents
-  /// [anchored], if such a thing exists.
-  YamlNode getAnchor(Node anchored) {
-    if (anchored.anchor == null) return null;
-    var value = _anchors[anchored.anchor];
-    if (value == null) return null;
-
-    // Re-wrap [value]'s contents so that it's associated with the span of the
-    // anchor rather than its original definition.
-    if (value is YamlMap) {
-      return new YamlMap.internal(value.nodes, anchored.span);
-    } else if (value is YamlList) {
-      return new YamlList.internal(value.nodes, anchored.span);
-    } else {
-      assert(value is YamlScalar);
-      return new YamlScalar.internal(value.value, anchored.span);
-    }
-  }
-
-  /// Records that [value] is the Dart object representing [anchored].
-  YamlNode setAnchor(Node anchored, YamlNode value) {
-    if (anchored.anchor == null) return value;
-    _anchors[anchored.anchor] = value;
-    return value;
-  }
-}
diff --git a/pkg/yaml/lib/src/event.dart b/pkg/yaml/lib/src/event.dart
new file mode 100644
index 0000000..96e2f16
--- /dev/null
+++ b/pkg/yaml/lib/src/event.dart
@@ -0,0 +1,157 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library yaml.event;
+
+import 'package:source_span/source_span.dart';
+
+import 'style.dart';
+import 'yaml_document.dart';
+
+/// An event emitted by a [Parser].
+class Event {
+  /// The event type.
+  final EventType type;
+
+  /// The span associated with the event.
+  final FileSpan span;
+
+  Event(this.type, this.span);
+
+  String toString() => type.toString();
+}
+
+/// An event indicating the beginning of a YAML document.
+class DocumentStartEvent implements Event {
+  get type => EventType.DOCUMENT_START;
+  final FileSpan span;
+
+  /// The document's `%YAML` directive, or `null` if there was none.
+  final VersionDirective versionDirective;
+
+  /// The document's `%TAG` directives, if any.
+  final List<TagDirective> tagDirectives;
+
+  /// Whether the document started implicitly (that is, without an explicit
+  /// `===` sequence).
+  final bool isImplicit;
+
+  DocumentStartEvent(this.span, {this.versionDirective,
+          List<TagDirective> tagDirectives, this.isImplicit: true})
+      : tagDirectives = tagDirectives == null ? [] : tagDirectives;
+
+  String toString() => "DOCUMENT_START";
+}
+
+/// An event indicating the end of a YAML document.
+class DocumentEndEvent implements Event {
+  get type => EventType.DOCUMENT_END;
+  final FileSpan span;
+
+  /// Whether the document ended implicitly (that is, without an explicit
+  /// `...` sequence).
+  final bool isImplicit;
+
+  DocumentEndEvent(this.span, {this.isImplicit: true});
+
+  String toString() => "DOCUMENT_END";
+}
+
+/// An event indicating that an alias was referenced.
+class AliasEvent implements Event {
+  get type => EventType.ALIAS;
+  final FileSpan span;
+
+  /// The name of the anchor.
+  final String name;
+
+  AliasEvent(this.span, this.name);
+
+  String toString() => "ALIAS $name";
+}
+
+/// A base class for events that can have anchor and tag properties associated
+/// with them.
+abstract class _ValueEvent implements Event {
+  /// The name of the value's anchor, or `null` if it wasn't anchored.
+  String get anchor;
+
+  /// The text of the value's tag, or `null` if it wasn't tagged.
+  String get tag;
+
+  String toString() {
+    var buffer = new StringBuffer('$type');
+    if (anchor != null) buffer.write(" &$anchor");
+    if (tag != null) buffer.write(" $tag");
+    return buffer.toString();
+  }
+}
+
+/// An event indicating a single scalar value.
+class ScalarEvent extends _ValueEvent {
+  get type => EventType.SCALAR;
+  final FileSpan span;
+  final String anchor;
+  final String tag;
+
+  /// The contents of the scalar.
+  final String value;
+
+  /// The style of the scalar in the original source.
+  final ScalarStyle style;
+
+  ScalarEvent(this.span, this.value, this.style, {this.anchor, this.tag});
+
+  String toString() => "${super.toString()} \"$value\"";
+}
+
+/// An event indicating the beginning of a sequence.
+class SequenceStartEvent extends _ValueEvent {
+  get type => EventType.SEQUENCE_START;
+  final FileSpan span;
+  final String anchor;
+  final String tag;
+
+  /// The style of the collection in the original source.
+  final CollectionStyle style;
+
+  SequenceStartEvent(this.span, this.style, {this.anchor, this.tag});
+}
+
+/// An event indicating the beginning of a mapping.
+class MappingStartEvent extends _ValueEvent {
+  get type => EventType.MAPPING_START;
+  final FileSpan span;
+  final String anchor;
+  final String tag;
+
+  /// The style of the collection in the original source.
+  final CollectionStyle style;
+
+  MappingStartEvent(this.span, this.style, {this.anchor, this.tag});
+}
+
+/// An enum of types of [Event] object.
+class EventType {
+  static const STREAM_START = const EventType._("STREAM_START");
+  static const STREAM_END = const EventType._("STREAM_END");
+
+  static const DOCUMENT_START = const EventType._("DOCUMENT_START");
+  static const DOCUMENT_END = const EventType._("DOCUMENT_END");
+
+  static const ALIAS = const EventType._("ALIAS");
+  static const SCALAR = const EventType._("SCALAR");
+
+  static const SEQUENCE_START = const EventType._("SEQUENCE_START");
+  static const SEQUENCE_END = const EventType._("SEQUENCE_END");
+
+  static const MAPPING_START = const EventType._("MAPPING_START");
+  static const MAPPING_END = const EventType._("MAPPING_END");
+
+  final String name;
+
+  const EventType._(this.name);
+
+  String toString() => name;
+}
diff --git a/pkg/yaml/lib/src/loader.dart b/pkg/yaml/lib/src/loader.dart
new file mode 100644
index 0000000..d80578f
--- /dev/null
+++ b/pkg/yaml/lib/src/loader.dart
@@ -0,0 +1,257 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library yaml.loader;
+
+import 'package:source_span/source_span.dart';
+
+import 'equality.dart';
+import 'event.dart';
+import 'parser.dart';
+import 'yaml_document.dart';
+import 'yaml_exception.dart';
+import 'yaml_node.dart';
+
+/// A loader that reads [Event]s emitted by a [Parser] and emits
+/// [YamlDocument]s.
+///
+/// This is based on the libyaml loader, available at
+/// https://github.com/yaml/libyaml/blob/master/src/loader.c. The license for
+/// that is available in ../../libyaml-license.txt.
+class Loader {
+  /// The underlying [Parser] that generates [Event]s.
+  final Parser _parser;
+
+  /// Aliases by the alias name.
+  final _aliases = new Map<String, YamlNode>();
+
+  /// The span of the entire stream emitted so far.
+  FileSpan get span => _span;
+  FileSpan _span;
+
+  /// Creates a loader that loads [source].
+  ///
+  /// [sourceUrl] can be a String or a [Uri].
+  Loader(String source, {sourceUrl})
+      : _parser = new Parser(source, sourceUrl: sourceUrl) {
+    var event = _parser.parse();
+    _span = event.span;
+    assert(event.type == EventType.STREAM_START);
+  }
+
+  /// Loads the next document from the stream.
+  ///
+  /// If there are no more documents, returns `null`.
+  YamlDocument load() {
+    if (_parser.isDone) return null;
+
+    var event = _parser.parse();
+    if (event.type == EventType.STREAM_END) {
+      _span = _span.expand(event.span);
+      return null;
+    }
+
+    var document = _loadDocument(event);
+    _span = _span.expand(document.span);
+    _aliases.clear();
+    return document;
+  }
+
+  /// Composes a document object.
+  YamlDocument _loadDocument(DocumentStartEvent firstEvent) {
+    var contents = _loadNode(_parser.parse());
+
+    var lastEvent = _parser.parse();
+    assert(lastEvent.type == EventType.DOCUMENT_END);
+
+    return new YamlDocument.internal(
+        contents,
+        firstEvent.span.expand(lastEvent.span),
+        firstEvent.versionDirective,
+        firstEvent.tagDirectives,
+        startImplicit: firstEvent.isImplicit,
+        endImplicit: lastEvent.isImplicit);
+  }
+
+  /// Composes a node.
+  YamlNode _loadNode(Event firstEvent) {
+    switch (firstEvent.type) {
+      case EventType.ALIAS: return _loadAlias(firstEvent);
+      case EventType.SCALAR: return _loadScalar(firstEvent);
+      case EventType.SEQUENCE_START: return _loadSequence(firstEvent);
+      case EventType.MAPPING_START: return _loadMapping(firstEvent);
+      default: throw "Unreachable";
+    }
+  }
+
+  /// Registers an anchor.
+  void _registerAnchor(String anchor, YamlNode node) {
+    if (anchor == null) return;
+
+    // libyaml throws an error for duplicate anchors, but example 7.1 makes it
+    // clear that they should be overridden:
+    // http://yaml.org/spec/1.2/spec.html#id2786448.
+
+    _aliases[anchor] = node;
+  }
+
+  /// Composes a node corresponding to an alias.
+  YamlNode _loadAlias(AliasEvent event) {
+    var alias = _aliases[event.name];
+    if (alias != null) return alias;
+
+    throw new YamlException("Undefined alias.", event.span);
+  }
+
+  /// Composes a scalar node.
+  YamlNode _loadScalar(ScalarEvent scalar) {
+    var node;
+    if (scalar.tag == "!") {
+      node = _parseString(scalar);
+    } else if (scalar.tag != null) {
+      node = _parseByTag(scalar);
+    } else {
+      node = _parseNull(scalar);
+      if (node == null) node = _parseBool(scalar);
+      if (node == null) node = _parseInt(scalar);
+      if (node == null) node = _parseFloat(scalar);
+      if (node == null) node = _parseString(scalar);
+    }
+
+    _registerAnchor(scalar.anchor, node);
+    return node;
+  }
+
+  /// Composes a sequence node.
+  YamlNode _loadSequence(SequenceStartEvent firstEvent) {
+    if (firstEvent.tag != "!" && firstEvent.tag != null &&
+        firstEvent.tag != "tag:yaml.org,2002:seq") {
+      throw new YamlException("Invalid tag for sequence.", firstEvent.span);
+    }
+
+    var children = [];
+    var node = new YamlList.internal(
+        children, firstEvent.span, firstEvent.style);
+    _registerAnchor(firstEvent.anchor, node);
+
+    var event = _parser.parse();
+    while (event.type != EventType.SEQUENCE_END) {
+      children.add(_loadNode(event));
+      event = _parser.parse();
+    }
+
+    setSpan(node, firstEvent.span.expand(event.span));
+    return node;
+  }
+
+  /// Composes a mapping node.
+  YamlNode _loadMapping(MappingStartEvent firstEvent) {
+    if (firstEvent.tag != "!" && firstEvent.tag != null &&
+        firstEvent.tag != "tag:yaml.org,2002:map") {
+      throw new YamlException("Invalid tag for mapping.", firstEvent.span);
+    }
+
+    var children = deepEqualsMap();
+    var node = new YamlMap.internal(
+        children, firstEvent.span, firstEvent.style);
+    _registerAnchor(firstEvent.anchor, node);
+
+    var event = _parser.parse();
+    while (event.type != EventType.MAPPING_END) {
+      var key = _loadNode(event);
+      var value = _loadNode(_parser.parse());
+      children[key] = value;
+      event = _parser.parse();
+    }
+
+    setSpan(node, firstEvent.span.expand(event.span));
+    return node;
+  }
+
+  /// Parses a scalar according to its tag name.
+  YamlScalar _parseByTag(ScalarEvent scalar) {
+    switch (scalar.tag) {
+      case "tag:yaml.org,2002:null": return _parseNull(scalar);
+      case "tag:yaml.org,2002:bool": return _parseBool(scalar);
+      case "tag:yaml.org,2002:int": return _parseInt(scalar);
+      case "tag:yaml.org,2002:float": return _parseFloat(scalar);
+      case "tag:yaml.org,2002:str": return _parseString(scalar);
+    }
+    throw new YamlException('Undefined tag: ${scalar.tag}.', scalar.span);
+  }
+
+  /// Parses a null scalar.
+  YamlScalar _parseNull(ScalarEvent scalar) {
+    // TODO(nweiz): stop using regexps.
+    // TODO(nweiz): add ScalarStyle and implicit metadata to the scalars.
+    if (new RegExp(r"^(null|Null|NULL|~|)$").hasMatch(scalar.value)) {
+      return new YamlScalar.internal(null, scalar.span, scalar.style);
+    } else {
+      return null;
+    }
+  }
+
+  /// Parses a boolean scalar.
+  YamlScalar _parseBool(ScalarEvent scalar) {
+    var match = new RegExp(r"^(?:(true|True|TRUE)|(false|False|FALSE))$").
+        firstMatch(scalar.value);
+    if (match == null) return null;
+    return new YamlScalar.internal(
+        match.group(1) != null, scalar.span, scalar.style);
+  }
+
+  /// Parses an integer scalar.
+  YamlScalar _parseInt(ScalarEvent scalar) {
+    var match = new RegExp(r"^[-+]?[0-9]+$").firstMatch(scalar.value);
+    if (match != null) {
+      return new YamlScalar.internal(
+          int.parse(match.group(0)), scalar.span, scalar.style);
+    }
+
+    match = new RegExp(r"^0o([0-7]+)$").firstMatch(scalar.value);
+    if (match != null) {
+      var n = int.parse(match.group(1), radix: 8);
+      return new YamlScalar.internal(n, scalar.span, scalar.style);
+    }
+
+    match = new RegExp(r"^0x[0-9a-fA-F]+$").firstMatch(scalar.value);
+    if (match != null) {
+      return new YamlScalar.internal(
+          int.parse(match.group(0)), scalar.span, scalar.style);
+    }
+
+    return null;
+  }
+
+  /// Parses a floating-point scalar.
+  YamlScalar _parseFloat(ScalarEvent scalar) {
+    var match = new RegExp(
+          r"^[-+]?(\.[0-9]+|[0-9]+(\.[0-9]*)?)([eE][-+]?[0-9]+)?$").
+        firstMatch(scalar.value);
+    if (match != null) {
+      // YAML allows floats of the form "0.", but Dart does not. Fix up those
+      // floats by removing the trailing dot.
+      var matchStr = match.group(0).replaceAll(new RegExp(r"\.$"), "");
+      return new YamlScalar.internal(
+          double.parse(matchStr), scalar.span, scalar.style);
+    }
+
+    match = new RegExp(r"^([+-]?)\.(inf|Inf|INF)$").firstMatch(scalar.value);
+    if (match != null) {
+      var value = match.group(1) == "-" ? -double.INFINITY : double.INFINITY;
+      return new YamlScalar.internal(value, scalar.span, scalar.style);
+    }
+
+    match = new RegExp(r"^\.(nan|NaN|NAN)$").firstMatch(scalar.value);
+    if (match != null) {
+      return new YamlScalar.internal(double.NAN, scalar.span, scalar.style);
+    }
+
+    return null;
+  }
+
+  /// Parses a string scalar.
+  YamlScalar _parseString(ScalarEvent scalar) =>
+      new YamlScalar.internal(scalar.value, scalar.span, scalar.style);
+}
diff --git a/pkg/yaml/lib/src/model.dart b/pkg/yaml/lib/src/model.dart
deleted file mode 100644
index 93cb49c..0000000
--- a/pkg/yaml/lib/src/model.dart
+++ /dev/null
@@ -1,259 +0,0 @@
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-/// This file contains the node classes for the internal representations of YAML
-/// documents. These nodes are used for both the serialization tree and the
-/// representation graph.
-library yaml.model;
-
-import 'package:source_span/source_span.dart';
-
-import 'equality.dart';
-import 'parser.dart';
-import 'visitor.dart';
-import 'yaml_exception.dart';
-
-/// The prefix for tag types defined by the YAML spec.
-const _YAML_URI_PREFIX = "tag:yaml.org,2002:";
-
-/// A tag that indicates the type of a YAML node.
-class Tag {
-  /// The name of the tag, either a URI or a local tag beginning with "!".
-  final String name;
-
-  /// The kind of the tag.
-  final TagKind kind;
-
-  /// Returns the standard YAML tag URI for [type].
-  static String yaml(String type) => "tag:yaml.org,2002:$type";
-
-  const Tag(this.name, this.kind);
-
-  const Tag.scalar(String name)
-      : this(name, TagKind.SCALAR);
-
-  const Tag.sequence(String name)
-      : this(name, TagKind.SEQUENCE);
-
-  const Tag.mapping(String name)
-      : this(name, TagKind.MAPPING);
-
-  /// Two tags are equal if their URIs are equal.
-  operator ==(other) {
-    if (other is! Tag) return false;
-    return name == other.name;
-  }
-
-  String toString() {
-    if (name.startsWith(_YAML_URI_PREFIX)) {
-      return '!!${name.substring(_YAML_URI_PREFIX.length)}';
-    } else {
-      return '!<$name>';
-    }
-  }
-
-  int get hashCode => name.hashCode;
-}
-
-/// An enum for kinds of tags.
-class TagKind {
-  /// A tag indicating that the value is a scalar.
-  static const SCALAR = const TagKind._("scalar");
-
-  /// A tag indicating that the value is a sequence.
-  static const SEQUENCE = const TagKind._("sequence");
-
-  /// A tag indicating that the value is a mapping.
-  static const MAPPING = const TagKind._("mapping");
-
-  final String name;
-
-  const TagKind._(this.name);
-
-  String toString() => name;
-}
-
-/// The abstract class for YAML nodes.
-abstract class Node {
-  /// Every YAML node has a tag that describes its type.
-  Tag tag;
-
-  /// Any YAML node can have an anchor associated with it.
-  String anchor;
-
-  /// The source span for this node.
-  SourceSpan span;
-
-  Node(this.tag, this.span, [this.anchor]);
-
-  bool operator ==(other) {
-    if (other is! Node) return false;
-    return tag == other.tag;
-  }
-
-  int get hashCode => tag.hashCode ^ anchor.hashCode;
-
-  visit(Visitor v);
-}
-
-/// A sequence node represents an ordered list of nodes.
-class SequenceNode extends Node {
-  /// The nodes in the sequence.
-  List<Node> content;
-
-  SequenceNode(String tagName, this.content, SourceSpan span)
-    : super(new Tag.sequence(tagName), span);
-
-  /// Two sequences are equal if their tags and contents are equal.
-  bool operator ==(other) {
-    // Should be super != other; bug 2554
-    if (!(super == other) || other is! SequenceNode) return false;
-    if (content.length != other.content.length) return false;
-    for (var i = 0; i < content.length; i++) {
-      if (content[i] != other.content[i]) return false;
-    }
-    return true;
-  }
-
-  String toString() => '$tag [${content.map((e) => '$e').join(', ')}]';
-
-  int get hashCode => super.hashCode ^ deepHashCode(content);
-
-  visit(Visitor v) => v.visitSequence(this);
-}
-
-/// An alias node is a reference to an anchor.
-class AliasNode extends Node {
-  AliasNode(String anchor, SourceSpan span)
-      : super(new Tag.scalar(Tag.yaml("str")), span, anchor);
-
-  visit(Visitor v) => v.visitAlias(this);
-}
-
-/// A scalar node represents all YAML nodes that have a single value.
-class ScalarNode extends Node {
-  /// The string value of the scalar node, if it was created by the parser.
-  final String _content;
-
-  /// The Dart value of the scalar node, if it was created by the composer.
-  final value;
-
-  /// Creates a new Scalar node.
-  ///
-  /// Exactly one of [content] and [value] should be specified. Content should
-  /// be specified for a newly-parsed scalar that hasn't yet been composed.
-  /// Value should be specified for a composed scalar, although `null` is a
-  /// valid value.
-  ScalarNode(String tagName, SourceSpan span, {String content, this.value})
-   : _content = content,
-     super(new Tag.scalar(tagName), span);
-
-  /// Two scalars are equal if their string representations are equal.
-  bool operator ==(other) {
-    // Should be super != other; bug 2554
-    if (!(super == other) || other is! ScalarNode) return false;
-    return content == other.content;
-  }
-
-  /// Returns the string representation of the scalar. After composition, this
-  /// is equal to the canonical serialization of the value of the scalar.
-  String get content => _content != null ? _content : canonicalContent;
-
-  /// Returns the canonical serialization of the value of the scalar. If the
-  /// value isn't given, the result of this will be "null".
-  String get canonicalContent {
-    if (value == null || value is bool || value is int) return '$value';
-
-    if (value is num) {
-      // 20 is the maximum value for this argument, which we use since YAML
-      // doesn't specify a maximum.
-      return value.toStringAsExponential(20).
-        replaceFirst(new RegExp("0+e"), "e");
-    }
-
-    if (value is String) {
-      // TODO(nweiz): This could be faster if we used a RegExp to check for
-      // special characters and short-circuited if they didn't exist.
-
-      var escapedValue = value.codeUnits.map((c) {
-        switch (c) {
-        case Parser.TAB: return "\\t";
-        case Parser.LF: return "\\n";
-        case Parser.CR: return "\\r";
-        case Parser.DOUBLE_QUOTE: return '\\"';
-        case Parser.NULL: return "\\0";
-        case Parser.BELL: return "\\a";
-        case Parser.BACKSPACE: return "\\b";
-        case Parser.VERTICAL_TAB: return "\\v";
-        case Parser.FORM_FEED: return "\\f";
-        case Parser.ESCAPE: return "\\e";
-        case Parser.BACKSLASH: return "\\\\";
-        case Parser.NEL: return "\\N";
-        case Parser.NBSP: return "\\_";
-        case Parser.LINE_SEPARATOR: return "\\L";
-        case Parser.PARAGRAPH_SEPARATOR: return "\\P";
-        default:
-          if (c < 0x20 || (c >= 0x7f && c < 0x100)) {
-            return "\\x${zeroPad(c.toRadixString(16).toUpperCase(), 2)}";
-          } else if (c >= 0x100 && c < 0x10000) {
-            return "\\u${zeroPad(c.toRadixString(16).toUpperCase(), 4)}";
-          } else if (c >= 0x10000) {
-            return "\\u${zeroPad(c.toRadixString(16).toUpperCase(), 8)}";
-          } else {
-            return new String.fromCharCodes([c]);
-          }
-        }
-      });
-      return '"${escapedValue.join()}"';
-    }
-
-    throw new YamlException('Unknown scalar value.', span);
-  }
-
-  String toString() => '$tag "$content"';
-
-  /// Left-pads [str] with zeros so that it's at least [length] characters
-  /// long.
-  String zeroPad(String str, int length) {
-    assert(length >= str.length);
-    var prefix = new List.filled(length - str.length, '0');
-    return '${prefix.join()}$str';
-  }
-
-  int get hashCode => super.hashCode ^ content.hashCode;
-
-  visit(Visitor v) => v.visitScalar(this);
-}
-
-/// A mapping node represents an unordered map of nodes to nodes.
-class MappingNode extends Node {
-  /// The node map.
-  Map<Node, Node> content;
-
-  MappingNode(String tagName, this.content, SourceSpan span)
-    : super(new Tag.mapping(tagName), span);
-
-  /// Two mappings are equal if their tags and contents are equal.
-  bool operator ==(other) {
-    // Should be super != other; bug 2554
-    if (!(super == other) || other is! MappingNode) return false;
-    if (content.length != other.content.length) return false;
-    for (var key in content.keys) {
-      if (!other.content.containsKey(key)) return false;
-      if (content[key] != other.content[key]) return false;
-    }
-    return true;
-  }
-
-  String toString() {
-    var strContent = content.keys
-        .map((k) => '${k}: ${content[k]}')
-        .join(', ');
-    return '$tag {$strContent}';
-  }
-
-  int get hashCode => super.hashCode ^ deepHashCode(content);
-
-  visit(Visitor v) => v.visitMapping(this);
-}
diff --git a/pkg/yaml/lib/src/parser.dart b/pkg/yaml/lib/src/parser.dart
index 94f551f..72c01dc 100644
--- a/pkg/yaml/lib/src/parser.dart
+++ b/pkg/yaml/lib/src/parser.dart
@@ -1,1900 +1,817 @@
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
 library yaml.parser;
 
-import 'dart:collection';
-
 import 'package:source_span/source_span.dart';
 import 'package:string_scanner/string_scanner.dart';
 
-import 'equality.dart';
-import 'model.dart';
+import 'event.dart';
+import 'scanner.dart';
+import 'style.dart';
+import 'token.dart';
 import 'utils.dart';
+import 'yaml_document.dart';
+import 'yaml_exception.dart';
 
-/// Translates a string of characters into a YAML serialization tree.
+/// A parser that reads [Token]s emitted by a [Scanner] and emits [Event]s.
 ///
-/// This parser is designed to closely follow the spec. All productions in the
-/// spec are numbered, and the corresponding methods in the parser have the same
-/// numbers. This is certainly not the most efficient way of parsing YAML, but
-/// it is the easiest to write and read in the context of the spec.
-///
-/// Methods corresponding to productions are also named as in the spec,
-/// translating the name of the method (although not the annotation characters)
-/// into camel-case for dart style.. For example, the spec has a production
-/// named `nb-ns-plain-in-line`, and the method implementing it is named
-/// `nb_ns_plainInLine`. The exception to that rule is methods that just
-/// recognize character classes; these are named `is*`.
+/// This is based on the libyaml parser, available at
+/// https://github.com/yaml/libyaml/blob/master/src/parser.c. The license for
+/// that is available in ../../libyaml-license.txt.
 class Parser {
-  static const TAB = 0x9;
-  static const LF = 0xA;
-  static const CR = 0xD;
-  static const SP = 0x20;
-  static const TILDE = 0x7E;
-  static const NEL = 0x85;
-  static const PLUS = 0x2B;
-  static const HYPHEN = 0x2D;
-  static const QUESTION_MARK = 0x3F;
-  static const COLON = 0x3A;
-  static const COMMA = 0x2C;
-  static const LEFT_BRACKET = 0x5B;
-  static const RIGHT_BRACKET = 0x5D;
-  static const LEFT_BRACE = 0x7B;
-  static const RIGHT_BRACE = 0x7D;
-  static const HASH = 0x23;
-  static const AMPERSAND = 0x26;
-  static const ASTERISK = 0x2A;
-  static const EXCLAMATION = 0x21;
-  static const VERTICAL_BAR = 0x7C;
-  static const GREATER_THAN = 0x3E;
-  static const SINGLE_QUOTE = 0x27;
-  static const DOUBLE_QUOTE = 0x22;
-  static const PERCENT = 0x25;
-  static const AT = 0x40;
-  static const GRAVE_ACCENT = 0x60;
+  /// The underlying [Scanner] that generates [Token]s.
+  final Scanner _scanner;
 
-  static const NULL = 0x0;
-  static const BELL = 0x7;
-  static const BACKSPACE = 0x8;
-  static const VERTICAL_TAB = 0xB;
-  static const FORM_FEED = 0xC;
-  static const ESCAPE = 0x1B;
-  static const SLASH = 0x2F;
-  static const BACKSLASH = 0x5C;
-  static const UNDERSCORE = 0x5F;
-  static const NBSP = 0xA0;
-  static const LINE_SEPARATOR = 0x2028;
-  static const PARAGRAPH_SEPARATOR = 0x2029;
+  /// The stack of parse states for nested contexts.
+  final _states = new List<_State>();
 
-  static const NUMBER_0 = 0x30;
-  static const NUMBER_9 = 0x39;
+  /// The current parse state.
+  var _state = _State.STREAM_START;
 
-  static const LETTER_A = 0x61;
-  static const LETTER_B = 0x62;
-  static const LETTER_E = 0x65;
-  static const LETTER_F = 0x66;
-  static const LETTER_N = 0x6E;
-  static const LETTER_R = 0x72;
-  static const LETTER_T = 0x74;
-  static const LETTER_U = 0x75;
-  static const LETTER_V = 0x76;
-  static const LETTER_X = 0x78;
+  /// The custom tag directives, by tag handle.
+  final _tagDirectives = new Map<String, TagDirective>();
 
-  static const LETTER_CAP_A = 0x41;
-  static const LETTER_CAP_F = 0x46;
-  static const LETTER_CAP_L = 0x4C;
-  static const LETTER_CAP_N = 0x4E;
-  static const LETTER_CAP_P = 0x50;
-  static const LETTER_CAP_U = 0x55;
-  static const LETTER_CAP_X = 0x58;
+  /// Whether the parser has finished parsing.
+  bool get isDone => _state == _State.END;
 
-  static const C_SEQUENCE_ENTRY = 4;
-  static const C_MAPPING_KEY = 5;
-  static const C_MAPPING_VALUE = 6;
-  static const C_COLLECT_ENTRY = 7;
-  static const C_SEQUENCE_START = 8;
-  static const C_SEQUENCE_END = 9;
-  static const C_MAPPING_START = 10;
-  static const C_MAPPING_END = 11;
-  static const C_COMMENT = 12;
-  static const C_ANCHOR = 13;
-  static const C_ALIAS = 14;
-  static const C_TAG = 15;
-  static const C_LITERAL = 16;
-  static const C_FOLDED = 17;
-  static const C_SINGLE_QUOTE = 18;
-  static const C_DOUBLE_QUOTE = 19;
-  static const C_DIRECTIVE = 20;
-  static const C_RESERVED = 21;
-
-  static const BLOCK_OUT = 0;
-  static const BLOCK_IN = 1;
-  static const FLOW_OUT = 2;
-  static const FLOW_IN = 3;
-  static const BLOCK_KEY = 4;
-  static const FLOW_KEY = 5;
-
-  static const CHOMPING_STRIP = 0;
-  static const CHOMPING_KEEP = 1;
-  static const CHOMPING_CLIP = 2;
-
-  /// The scanner that's used to scan through the document.
-  final SpanScanner _scanner;
-
-  /// Whether we're parsing a bare document (that is, one that doesn't begin
-  /// with `---`). Bare documents don't allow `%` immediately following
-  /// newlines.
-  bool _inBareDocument = false;
-
-  /// The state of the scanner when it was the farthest in the document it's
-  /// been.
-  LineScannerState _farthestState;
-
-  /// The name of the context of the farthest position that has been parsed
-  /// successfully before backtracking. Used for error reporting.
-  String _farthestContext = "document";
-
-  /// A stack of the names of parse contexts. Used for error reporting.
-  final _contextStack = <String>["document"];
-
-  /// Annotations attached to ranges of the source string that add extra
-  /// information to any errors that occur in the annotated range.
-  final _errorAnnotations = new _RangeMap<String>();
-
-  /// The buffer containing the string currently being captured.
-  StringBuffer _capturedString;
-
-  /// The beginning of the current section of the captured string.
-  int _captureStart;
-
-  /// Whether the current string capture is being overridden.
-  bool _capturingAs = false;
-
-  Parser(String yaml, sourceUrl)
-      : _scanner = new SpanScanner(yaml, sourceUrl: sourceUrl) {
-    _farthestState = _scanner.state;
-  }
-
-  /// Returns the character at the current position, then moves that position
-  /// forward one character.
-  int next() => _scanner.readChar();
-
-  /// Returns the code unit at the current position, or the character [i]
-  /// characters after the current position.
-  int peek([int i = 0]) => _scanner.peekChar(i);
-
-  /// The truthiness operator. Returns `false` if [obj] is `null` or `false`,
-  /// `true` otherwise.
-  bool truth(obj) => obj != null && obj != false;
-
-  /// Consumes the current character if it matches [matcher]. Returns the result
-  /// of [matcher].
-  bool consume(bool matcher(int)) {
-    if (matcher(peek())) {
-      next();
-      return true;
-    }
-    return false;
-  }
-
-  /// Consumes the current character if it equals [char].
-  bool consumeChar(int char) => consume((c) => c == char);
-
-  /// Calls [consumer] until it returns a falsey value. Returns a list of all
-  /// truthy return values of [consumer], or null if it didn't consume anything.
+  /// Creates a parser that parses [source].
   ///
-  /// Conceptually, repeats a production one or more times.
-  List oneOrMore(consumer()) {
-    var first = consumer();
-    if (!truth(first)) return null;
-    var out = [first];
-    while (true) {
-      var el = consumer();
-      if (!truth(el)) return out;
-      out.add(el);
-    }
-    return null; // Unreachable.
-  }
+  /// [sourceUrl] can be a String or a [Uri].
+  Parser(String source, {sourceUrl})
+      : _scanner = new Scanner(source, sourceUrl: sourceUrl);
 
-  /// Calls [consumer] until it returns a falsey value. Returns a list of all
-  /// truthy return values of [consumer], or the empty list if it didn't consume
-  /// anything.
-  ///
-  /// Conceptually, repeats a production any number of times.
-  List zeroOrMore(consumer()) {
-    var out = [];
-    var oldPos = _scanner.position;
-    while (true) {
-      var el = consumer();
-      if (!truth(el) || oldPos == _scanner.position) return out;
-      oldPos = _scanner.position;
-      out.add(el);
-    }
-    return null; // Unreachable.
-  }
-
-  /// Just calls [consumer] and returns its result. Used to make it explicit
-  /// that a production is intended to be optional.
-  zeroOrOne(consumer()) => consumer();
-
-  /// Calls each function in [consumers] until one returns a truthy value, then
-  /// returns that.
-  or(List<Function> consumers) {
-    for (var c in consumers) {
-      var res = c();
-      if (truth(res)) return res;
-    }
-    return null;
-  }
-
-  /// Calls [consumer] and returns its result, but rolls back the parser state
-  /// if [consumer] returns a falsey value.
-  transaction(consumer()) {
-    var oldState = _scanner.state;
-    var oldCaptureStart = _captureStart;
-    String capturedSoFar = _capturedString == null ? null :
-      _capturedString.toString();
-    var res = consumer();
-    _refreshFarthestState();
-    if (truth(res)) return res;
-
-    _scanner.state = oldState;
-    _captureStart = oldCaptureStart;
-    _capturedString = capturedSoFar == null ? null :
-      new StringBuffer(capturedSoFar);
-    return res;
-  }
-
-  /// Consumes [n] characters matching [matcher], or none if there isn't a
-  /// complete match. The first argument to [matcher] is the character code, the
-  /// second is the index (from 0 to [n] - 1).
-  ///
-  /// Returns whether or not the characters were consumed.
-  bool nAtOnce(int n, bool matcher(int c, int i)) => transaction(() {
-    for (int i = 0; i < n; i++) {
-      if (!consume((c) => matcher(c, i))) return false;
-    }
-    return true;
-  });
-
-  /// Consumes the exact characters in [str], or nothing.
-  ///
-  /// Returns whether or not the string was consumed.
-  bool rawString(String str) =>
-    nAtOnce(str.length, (c, i) => str.codeUnitAt(i) == c);
-
-  /// Consumes and returns a string of characters matching [matcher], or null if
-  /// there are no such characters.
-  String stringOf(bool matcher(int)) =>
-    captureString(() => oneOrMore(() => consume(matcher)));
-
-  /// Calls [consumer] and returns the string that was consumed while doing so,
-  /// or null if [consumer] returned a falsey value. Automatically wraps
-  /// [consumer] in `transaction`.
-  String captureString(consumer()) {
-    // captureString calls may not be nested
-    assert(_capturedString == null);
-
-    _captureStart = _scanner.position;
-    _capturedString = new StringBuffer();
-    var res = transaction(consumer);
-    if (!truth(res)) {
-      _captureStart = null;
-      _capturedString = null;
-      return null;
-    }
-
-    flushCapture();
-    var result = _capturedString.toString();
-    _captureStart = null;
-    _capturedString = null;
-    return result;
-  }
-
-  captureAs(String replacement, consumer()) =>
-      captureAndTransform(consumer, (_) => replacement);
-
-  captureAndTransform(consumer(), String transformation(String captured)) {
-    if (_capturedString == null) return consumer();
-    if (_capturingAs) return consumer();
-
-    flushCapture();
-    _capturingAs = true;
-    var res = consumer();
-    _capturingAs = false;
-    if (!truth(res)) return res;
-
-    _capturedString.write(transformation(
-        _scanner.string.substring(_captureStart, _scanner.position)));
-    _captureStart = _scanner.position;
-    return res;
-  }
-
-  void flushCapture() {
-    _capturedString.write(_scanner.string.substring(
-        _captureStart, _scanner.position));
-    _captureStart = _scanner.position;
-  }
-
-  /// Adds a tag and an anchor to [node], if they're defined.
-  Node addProps(Node node, Pair<Tag, String> props) {
-    if (props == null || node == null) return node;
-    if (truth(props.first)) node.tag = props.first;
-    if (truth(props.last)) node.anchor = props.last;
-    return node;
-  }
-
-  /// Creates a MappingNode from [pairs].
-  MappingNode map(List<Pair<Node, Node>> pairs, SourceSpan span) {
-    var content = new Map<Node, Node>();
-    pairs.forEach((pair) => content[pair.first] = pair.last);
-    return new MappingNode("?", content, span);
-  }
-
-  /// Runs [fn] in a context named [name]. Used for error reporting.
-  context(String name, fn()) {
+  /// Consumes and returns the next event.
+  Event parse() {
     try {
-      _contextStack.add(name);
-      return fn();
-    } finally {
-      var popped = _contextStack.removeLast();
-      assert(popped == name);
+      if (isDone) throw new StateError("No more events.");
+      var event = _stateMachine();
+      return event;
+    } on StringScannerException catch (error) {
+      throw new YamlException(error.message, error.span);
     }
   }
 
-  /// Adds [message] as extra information to any errors that occur between the
-  /// current position and the position of the cursor after running [fn]. The
-  /// cursor is reset after [fn] is run.
-  annotateError(String message, fn()) {
-    var start = _scanner.position;
-    var end;
-    transaction(() {
-      fn();
-      end = _scanner.position;
-      return false;
-    });
-    _errorAnnotations[new _Range(start, end)] = message;
+  /// Dispatches parsing based on the current state.
+  Event _stateMachine() {
+    switch (_state) {
+      case _State.STREAM_START:
+        return _parseStreamStart();
+      case _State.DOCUMENT_START:
+        return _parseDocumentStart();
+      case _State.DOCUMENT_CONTENT:
+        return _parseDocumentContent();
+      case _State.DOCUMENT_END:
+        return _parseDocumentEnd();
+      case _State.BLOCK_NODE:
+        return _parseNode(block: true);
+      case _State.BLOCK_NODE_OR_INDENTLESS_SEQUENCE:
+        return _parseNode(block: true, indentlessSequence: true);
+      case _State.FLOW_NODE:
+        return _parseNode();
+      case _State.BLOCK_SEQUENCE_FIRST_ENTRY:
+        // Scan past the `BLOCK-SEQUENCE-FIRST-ENTRY` token to the
+        // `BLOCK-SEQUENCE-ENTRY` token.
+        _scanner.scan();
+        return _parseBlockSequenceEntry();
+      case _State.BLOCK_SEQUENCE_ENTRY:
+        return _parseBlockSequenceEntry();
+      case _State.INDENTLESS_SEQUENCE_ENTRY:
+        return _parseIndentlessSequenceEntry();
+      case _State.BLOCK_MAPPING_FIRST_KEY:
+        // Scan past the `BLOCK-MAPPING-FIRST-KEY` token to the
+        // `BLOCK-MAPPING-KEY` token.
+        _scanner.scan();
+        return _parseBlockMappingKey();
+      case _State.BLOCK_MAPPING_KEY:
+        return _parseBlockMappingKey();
+      case _State.BLOCK_MAPPING_VALUE:
+        return _parseBlockMappingValue();
+      case _State.FLOW_SEQUENCE_FIRST_ENTRY:
+        return _parseFlowSequenceEntry(first: true);
+      case _State.FLOW_SEQUENCE_ENTRY:
+        return _parseFlowSequenceEntry();
+      case _State.FLOW_SEQUENCE_ENTRY_MAPPING_KEY:
+        return _parseFlowSequenceEntryMappingKey();
+      case _State.FLOW_SEQUENCE_ENTRY_MAPPING_VALUE:
+        return _parseFlowSequenceEntryMappingValue();
+      case _State.FLOW_SEQUENCE_ENTRY_MAPPING_END:
+        return _parseFlowSequenceEntryMappingEnd();
+      case _State.FLOW_MAPPING_FIRST_KEY:
+        return _parseFlowMappingKey(first: true);
+      case _State.FLOW_MAPPING_KEY:
+        return _parseFlowMappingKey();
+      case _State.FLOW_MAPPING_VALUE:
+        return _parseFlowMappingValue();
+      case _State.FLOW_MAPPING_EMPTY_VALUE:
+        return _parseFlowMappingValue(empty: true);
+      default:
+        throw "Unreachable";
+    }
   }
 
-  /// Throws an error with additional context information.
-  void error(String message) =>
-      _scanner.error("$message (in $_farthestContext).");
-
-  /// If [result] is falsey, throws an error saying that [expected] was
-  /// expected.
-  expect(result, String expected) {
-    if (truth(result)) return result;
-    error("Expected $expected");
-  }
-
-  /// Throws an error saying that the parse failed.
+  /// Parses the production:
   ///
-  /// Uses [_farthestState] and [_farthestContext] to provide additional
-  /// information.
-  parseFailed() {
-    var message = "Invalid YAML in $_farthestContext";
-    _refreshFarthestState();
-    _scanner.state = _farthestState;
+  ///     stream ::=
+  ///       STREAM-START implicit_document? explicit_document* STREAM-END
+  ///       ************  
+  Event _parseStreamStart() {
+    var token = _scanner.scan();
+    assert(token.type == TokenType.STREAM_START);
 
-    var extraError = _errorAnnotations[_scanner.position];
-    if (extraError != null) message = "$message ($extraError)";
-    _scanner.error("$message.");
+    _state = _State.DOCUMENT_START;
+    return new Event(EventType.STREAM_START, token.span);
   }
 
-  /// Update [_farthestState] if the scanner is farther than it's been before.
-  void _refreshFarthestState() {
-    if (_scanner.position <= _farthestState.position) return;
-    _farthestState = _scanner.state;
-  }
+  /// Parses the productions:
+  ///
+  ///     implicit_document    ::= block_node DOCUMENT-END*
+  ///                              *
+  ///     explicit_document    ::=
+  ///       DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END*
+  ///       *************************
+  Event _parseDocumentStart() {
+    var token = _scanner.peek();
 
-  /// Returns the number of spaces after the current position.
-  int countIndentation() {
-    var i = 0;
-    while (peek(i) == SP) i++;
-    return i;
-  }
+    // libyaml requires any document beyond the first in the stream to have an
+    // explicit document start indicator, but the spec allows it to be omitted
+    // as long as there was an end indicator.
 
-  /// Returns the indentation for a block scalar.
-  int blockScalarAdditionalIndentation(_BlockHeader header, int indent) {
-    if (!header.autoDetectIndent) return header.additionalIndent;
-
-    var maxSpaces = 0;
-    var spaces = 0;
-    transaction(() {
-      do {
-        spaces = captureString(() => zeroOrMore(() => consumeChar(SP))).length;
-        if (spaces > maxSpaces) maxSpaces = spaces;
-      } while (b_break());
-      return false;
-    });
-
-    // If the next non-empty line isn't indented further than the start of the
-    // block scalar, that means the scalar is going to be empty. Returning any
-    // value > 0 will cause the parser not to consume any text.
-    if (spaces <= indent) return 1;
-
-    // It's an error for a leading empty line to be indented more than the first
-    // non-empty line.
-    if (maxSpaces > spaces) {
-      _scanner.error("Leading empty lines may not be indented more than the "
-          "first non-empty line.");
+    // Parse extra document end indicators.
+    while (token.type == TokenType.DOCUMENT_END) {
+      token = _scanner.advance();
     }
 
-    return spaces - indent;
+    if (token.type != TokenType.VERSION_DIRECTIVE &&
+        token.type != TokenType.TAG_DIRECTIVE &&
+        token.type != TokenType.DOCUMENT_START &&
+        token.type != TokenType.STREAM_END) {
+      // Parse an implicit document.
+      _processDirectives();
+      _states.add(_State.DOCUMENT_END);
+      _state = _State.BLOCK_NODE;
+      return new DocumentStartEvent(token.span.start.pointSpan());
+    }
+
+    if (token.type == TokenType.STREAM_END) {
+      _state = _State.END;
+      _scanner.scan();
+      return new Event(EventType.STREAM_END, token.span);
+    }
+
+    // Parse an explicit document.
+    var start = token.span;
+    var pair = _processDirectives();
+    var versionDirective = pair.first;
+    var tagDirectives = pair.last;
+    token = _scanner.peek();
+    if (token.type != TokenType.DOCUMENT_START) {
+      throw new YamlException("Expected document start.", token.span);
+    }
+
+    _states.add(_State.DOCUMENT_END);
+    _state = _State.DOCUMENT_CONTENT;
+    _scanner.scan();
+    return new DocumentStartEvent(start.expand(token.span),
+        versionDirective: versionDirective,
+        tagDirectives: tagDirectives,
+        isImplicit: false);
   }
 
-  /// Returns whether the current position is at the beginning of a line.
-  bool get atStartOfLine => _scanner.column == 0;
+  /// Parses the productions:
+  ///
+  ///     explicit_document    ::=
+  ///       DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END*
+  ///                                 ***********  
+  Event _parseDocumentContent() {
+    var token = _scanner.peek();
 
-  /// Given an indicator character, returns the type of that indicator (or null
-  /// if the indicator isn't found.
-  int indicatorType(int char) {
-    switch (char) {
-    case HYPHEN: return C_SEQUENCE_ENTRY;
-    case QUESTION_MARK: return C_MAPPING_KEY;
-    case COLON: return C_MAPPING_VALUE;
-    case COMMA: return C_COLLECT_ENTRY;
-    case LEFT_BRACKET: return C_SEQUENCE_START;
-    case RIGHT_BRACKET: return C_SEQUENCE_END;
-    case LEFT_BRACE: return C_MAPPING_START;
-    case RIGHT_BRACE: return C_MAPPING_END;
-    case HASH: return C_COMMENT;
-    case AMPERSAND: return C_ANCHOR;
-    case ASTERISK: return C_ALIAS;
-    case EXCLAMATION: return C_TAG;
-    case VERTICAL_BAR: return C_LITERAL;
-    case GREATER_THAN: return C_FOLDED;
-    case SINGLE_QUOTE: return C_SINGLE_QUOTE;
-    case DOUBLE_QUOTE: return C_DOUBLE_QUOTE;
-    case PERCENT: return C_DIRECTIVE;
-    case AT:
-    case GRAVE_ACCENT:
-      return C_RESERVED;
-    default: return null;
+    switch (token.type) {
+      case TokenType.VERSION_DIRECTIVE:
+      case TokenType.TAG_DIRECTIVE:
+      case TokenType.DOCUMENT_START:
+      case TokenType.DOCUMENT_END:
+      case TokenType.STREAM_END:
+        _state = _states.removeLast();
+        return _processEmptyScalar(token.span.start);
+      default:
+        return _parseNode(block: true);
     }
   }
 
-  // 1
-  bool isPrintable(int char) {
-    if (char == null) return false;
-    return char == TAB ||
-      char == LF ||
-      char == CR ||
-      (char >= SP && char <= TILDE) ||
-      char == NEL ||
-      (char >= 0xA0 && char <= 0xD7FF) ||
-      (char >= 0xE000 && char <= 0xFFFD) ||
-      (char >= 0x10000 && char <= 0x10FFFF);
-  }
+  /// Parses the productions:
+  ///
+  ///     implicit_document    ::= block_node DOCUMENT-END*
+  ///                                         *************
+  ///     explicit_document    ::=
+  ///       DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END*
+  ///                                             *************
+  Event _parseDocumentEnd() {
+    _tagDirectives.clear();
+    _state = _State.DOCUMENT_START;
 
-  // 2
-  bool isJson(int char) => char != null &&
-      (char == TAB || (char >= SP && char <= 0x10FFFF));
-
-  // 22
-  bool c_indicator(int type) => consume((c) => indicatorType(c) == type);
-
-  // 23
-  bool isFlowIndicator(int char) {
-    var indicator = indicatorType(char);
-    return indicator == C_COLLECT_ENTRY ||
-      indicator == C_SEQUENCE_START ||
-      indicator == C_SEQUENCE_END ||
-      indicator == C_MAPPING_START ||
-      indicator == C_MAPPING_END;
-  }
-
-  // 26
-  bool isBreak(int char) => char == LF || char == CR;
-
-  // 27
-  bool isNonBreak(int char) => isPrintable(char) && !isBreak(char);
-
-  // 28
-  bool b_break() {
-    if (consumeChar(CR)) {
-      zeroOrOne(() => consumeChar(LF));
-      return true;
-    }
-    return consumeChar(LF);
-  }
-
-  // 29
-  bool b_asLineFeed() => captureAs("\n", () => b_break());
-
-  // 30
-  bool b_nonContent() => captureAs("", () => b_break());
-
-  // 33
-  bool isSpace(int char) => char == SP || char == TAB;
-
-  // 34
-  bool isNonSpace(int char) => isNonBreak(char) && !isSpace(char);
-
-  // 35
-  bool isDecDigit(int char) => char != null && char >= NUMBER_0 &&
-      char <= NUMBER_9;
-
-  // 36
-  bool isHexDigit(int char) {
-    if (char == null) return false;
-    return isDecDigit(char) ||
-      (char >= LETTER_A && char <= LETTER_F) ||
-      (char >= LETTER_CAP_A && char <= LETTER_CAP_F);
-  }
-
-  // 41
-  bool c_escape() => captureAs("", () => consumeChar(BACKSLASH));
-
-  // 42
-  bool ns_escNull() => captureAs("\x00", () => consumeChar(NUMBER_0));
-
-  // 43
-  bool ns_escBell() => captureAs("\x07", () => consumeChar(LETTER_A));
-
-  // 44
-  bool ns_escBackspace() => captureAs("\b", () => consumeChar(LETTER_B));
-
-  // 45
-  bool ns_escHorizontalTab() => captureAs("\t", () {
-    return consume((c) => c == LETTER_T || c == TAB);
-  });
-
-  // 46
-  bool ns_escLineFeed() => captureAs("\n", () => consumeChar(LETTER_N));
-
-  // 47
-  bool ns_escVerticalTab() => captureAs("\v", () => consumeChar(LETTER_V));
-
-  // 48
-  bool ns_escFormFeed() => captureAs("\f", () => consumeChar(LETTER_F));
-
-  // 49
-  bool ns_escCarriageReturn() => captureAs("\r", () => consumeChar(LETTER_R));
-
-  // 50
-  bool ns_escEscape() => captureAs("\x1B", () => consumeChar(LETTER_E));
-
-  // 51
-  bool ns_escSpace() => consumeChar(SP);
-
-  // 52
-  bool ns_escDoubleQuote() => consumeChar(DOUBLE_QUOTE);
-
-  // 53
-  bool ns_escSlash() => consumeChar(SLASH);
-
-  // 54
-  bool ns_escBackslash() => consumeChar(BACKSLASH);
-
-  // 55
-  bool ns_escNextLine() => captureAs("\x85", () => consumeChar(LETTER_CAP_N));
-
-  // 56
-  bool ns_escNonBreakingSpace() =>
-    captureAs("\xA0", () => consumeChar(UNDERSCORE));
-
-  // 57
-  bool ns_escLineSeparator() =>
-    captureAs("\u2028", () => consumeChar(LETTER_CAP_L));
-
-  // 58
-  bool ns_escParagraphSeparator() =>
-    captureAs("\u2029", () => consumeChar(LETTER_CAP_P));
-
-  // 59
-  bool ns_esc8Bit() => ns_escNBit(LETTER_X, 2);
-
-  // 60
-  bool ns_esc16Bit() => ns_escNBit(LETTER_U, 4);
-
-  // 61
-  bool ns_esc32Bit() => ns_escNBit(LETTER_CAP_U, 8);
-
-  // Helper method for 59 - 61
-  bool ns_escNBit(int char, int digits) {
-    if (!captureAs('', () => consumeChar(char))) return false;
-    var captured = captureAndTransform(
-        () => nAtOnce(digits, (c, _) => isHexDigit(c)),
-        (hex) => new String.fromCharCodes([int.parse("0x$hex")]));
-    return expect(captured, "$digits hexidecimal digits");
-  }
-
-  // 62
-  bool c_ns_escChar() => context('escape sequence', () => transaction(() {
-      if (!truth(c_escape())) return false;
-      return truth(or([
-        ns_escNull, ns_escBell, ns_escBackspace, ns_escHorizontalTab,
-        ns_escLineFeed, ns_escVerticalTab, ns_escFormFeed, ns_escCarriageReturn,
-        ns_escEscape, ns_escSpace, ns_escDoubleQuote, ns_escSlash,
-        ns_escBackslash, ns_escNextLine, ns_escNonBreakingSpace,
-        ns_escLineSeparator, ns_escParagraphSeparator, ns_esc8Bit, ns_esc16Bit,
-        ns_esc32Bit
-      ]));
-    }));
-
-  // 63
-  bool s_indent(int indent) {
-    var result = nAtOnce(indent, (c, i) => c == SP);
-    if (peek() == TAB) {
-      annotateError("tab characters are not allowed as indentation in YAML",
-          () => zeroOrMore(() => consume(isSpace)));
-    }
-    return result;
-  }
-
-  // 64
-  bool s_indentLessThan(int indent) {
-    for (int i = 0; i < indent - 1; i++) {
-      if (!consumeChar(SP)) {
-        if (peek() == TAB) {
-          annotateError("tab characters are not allowed as indentation in YAML",
-              () {
-            for (; i < indent - 1; i++) {
-              if (!consume(isSpace)) break;
-            }
-          });
-        }
-        break;
-      }
-    }
-    return true;
-  }
-
-  // 65
-  bool s_indentLessThanOrEqualTo(int indent) => s_indentLessThan(indent + 1);
-
-  // 66
-  bool s_separateInLine() => transaction(() {
-    return captureAs('', () =>
-        truth(oneOrMore(() => consume(isSpace))) || atStartOfLine);
-  });
-
-  // 67
-  bool s_linePrefix(int indent, int ctx) => captureAs("", () {
-    switch (ctx) {
-    case BLOCK_OUT:
-    case BLOCK_IN:
-      return s_blockLinePrefix(indent);
-    case FLOW_OUT:
-    case FLOW_IN:
-      return s_flowLinePrefix(indent);
-    }
-  });
-
-  // 68
-  bool s_blockLinePrefix(int indent) => s_indent(indent);
-
-  // 69
-  bool s_flowLinePrefix(int indent) => captureAs('', () {
-    if (!truth(s_indent(indent))) return false;
-    zeroOrOne(s_separateInLine);
-    return true;
-  });
-
-  // 70
-  bool l_empty(int indent, int ctx) => transaction(() {
-    var start = or([
-      () => s_linePrefix(indent, ctx),
-      () => s_indentLessThan(indent)
-    ]);
-    if (!truth(start)) return false;
-    return b_asLineFeed();
-  });
-
-  // 71
-  bool b_asSpace() => captureAs(" ", () => consume(isBreak));
-
-  // 72
-  bool b_l_trimmed(int indent, int ctx) => transaction(() {
-    if (!truth(b_nonContent())) return false;
-    return truth(oneOrMore(() => captureAs("\n", () => l_empty(indent, ctx))));
-  });
-
-  // 73
-  bool b_l_folded(int indent, int ctx) =>
-    or([() => b_l_trimmed(indent, ctx), b_asSpace]);
-
-  // 74
-  bool s_flowFolded(int indent) => transaction(() {
-    zeroOrOne(s_separateInLine);
-    if (!truth(b_l_folded(indent, FLOW_IN))) return false;
-    return s_flowLinePrefix(indent);
-  });
-
-  // 75
-  bool c_nb_commentText() {
-    if (!truth(c_indicator(C_COMMENT))) return false;
-    zeroOrMore(() => consume(isNonBreak));
-    return true;
-  }
-
-  // 76
-  bool b_comment() => _scanner.isDone || b_nonContent();
-
-  // 77
-  bool s_b_comment() {
-    if (truth(s_separateInLine())) {
-      zeroOrOne(c_nb_commentText);
-    }
-    return b_comment();
-  }
-
-  // 78
-  bool l_comment() => transaction(() {
-    if (!truth(s_separateInLine())) return false;
-    zeroOrOne(c_nb_commentText);
-    return b_comment();
-  });
-
-  // 79
-  bool s_l_comments() {
-    if (!truth(s_b_comment()) && !atStartOfLine) return false;
-    zeroOrMore(l_comment);
-    return true;
-  }
-
-  // 80
-  bool s_separate(int indent, int ctx) {
-    switch (ctx) {
-    case BLOCK_OUT:
-    case BLOCK_IN:
-    case FLOW_OUT:
-    case FLOW_IN:
-      return s_separateLines(indent);
-    case BLOCK_KEY:
-    case FLOW_KEY:
-      return s_separateInLine();
-    default: throw 'Invalid context "$ctx".';
+    var token = _scanner.peek();
+    if (token.type == TokenType.DOCUMENT_END) {
+      _scanner.scan();
+      return new DocumentEndEvent(token.span, isImplicit: false);
+    } else {
+      return new DocumentEndEvent(
+          token.span.start.pointSpan(), isImplicit: true);
     }
   }
 
-  // 81
-  bool s_separateLines(int indent) {
-    return transaction(() => s_l_comments() && s_flowLinePrefix(indent)) ||
-      s_separateInLine();
-  }
+  /// Parses the productions:
+  ///
+  ///     block_node_or_indentless_sequence    ::=
+  ///       ALIAS
+  ///       *****
+  ///       | properties (block_content | indentless_block_sequence)?
+  ///         **********  *
+  ///       | block_content | indentless_block_sequence
+  ///         *
+  ///     block_node           ::= ALIAS
+  ///                              *****
+  ///                              | properties block_content?
+  ///                                ********** *
+  ///                              | block_content
+  ///                                *
+  ///     flow_node            ::= ALIAS
+  ///                              *****
+  ///                              | properties flow_content?
+  ///                                ********** *
+  ///                              | flow_content
+  ///                                *
+  ///     properties           ::= TAG ANCHOR? | ANCHOR TAG?
+  ///                              *************************
+  ///     block_content        ::= block_collection | flow_collection | SCALAR
+  ///                                                                   ******
+  ///     flow_content         ::= flow_collection | SCALAR
+  ///                                                ******
+  Event _parseNode({bool block: false, bool indentlessSequence: false}) {
+    var token = _scanner.peek();
 
-  // 82
-  bool l_directive() => false; // TODO(nweiz): implement
-
-  // 96
-  Pair<Tag, String> c_ns_properties(int indent, int ctx) {
-    var tag, anchor;
-    tag = c_ns_tagProperty();
-    if (truth(tag)) {
-      anchor = transaction(() {
-        if (!truth(s_separate(indent, ctx))) return null;
-        return c_ns_anchorProperty();
-      });
-      return new Pair<Tag, String>(tag, anchor);
+    if (token is AliasToken) {
+      _scanner.scan();
+      _state = _states.removeLast();
+      return new AliasEvent(token.span, token.name);
     }
 
-    anchor = c_ns_anchorProperty();
-    if (truth(anchor)) {
-      tag = transaction(() {
-        if (!truth(s_separate(indent, ctx))) return null;
-        return c_ns_tagProperty();
-      });
-      return new Pair<Tag, String>(tag, anchor);
+    var anchor;
+    var tagToken;
+    var span = token.span.start.pointSpan();
+    parseAnchor() {
+      anchor = token.name;
+      span = span.expand(token.span);
+      token = _scanner.advance();
     }
 
-    return null;
-  }
-
-  // 97
-  Tag c_ns_tagProperty() => null; // TODO(nweiz): implement
-
-  // 101
-  String c_ns_anchorProperty() => null; // TODO(nweiz): implement
-
-  // 102
-  bool isAnchorChar(int char) => isNonSpace(char) && !isFlowIndicator(char);
-
-  // 103
-  String ns_anchorName() =>
-    captureString(() => oneOrMore(() => consume(isAnchorChar)));
-
-  // 104
-  Node c_ns_aliasNode() {
-    var start = _scanner.state;
-    if (!truth(c_indicator(C_ALIAS))) return null;
-    var name = expect(ns_anchorName(), 'anchor name');
-    return new AliasNode(name, _scanner.spanFrom(start));
-  }
-
-  // 105
-  ScalarNode e_scalar() => new ScalarNode("?", _scanner.emptySpan, content: "");
-
-  // 106
-  ScalarNode e_node() => e_scalar();
-
-  // 107
-  bool nb_doubleChar() => or([
-    c_ns_escChar,
-    () => consume((c) => isJson(c) && c != BACKSLASH && c != DOUBLE_QUOTE)
-  ]);
-
-  // 108
-  bool ns_doubleChar() => !isSpace(peek()) && truth(nb_doubleChar());
-
-  // 109
-  Node c_doubleQuoted(int indent, int ctx) => context('string', () {
-    return transaction(() {
-      var start = _scanner.state;
-      if (!truth(c_indicator(C_DOUBLE_QUOTE))) return null;
-      var contents = nb_doubleText(indent, ctx);
-      if (!truth(c_indicator(C_DOUBLE_QUOTE))) return null;
-      return new ScalarNode("!", _scanner.spanFrom(start), content: contents);
-    });
-  });
-
-  // 110
-  String nb_doubleText(int indent, int ctx) => captureString(() {
-    switch (ctx) {
-    case FLOW_OUT:
-    case FLOW_IN:
-      nb_doubleMultiLine(indent);
-      break;
-    case BLOCK_KEY:
-    case FLOW_KEY:
-      nb_doubleOneLine();
-      break;
-    }
-    return true;
-  });
-
-  // 111
-  void nb_doubleOneLine() {
-    zeroOrMore(nb_doubleChar);
-  }
-
-  // 112
-  bool s_doubleEscaped(int indent) => transaction(() {
-    zeroOrMore(() => consume(isSpace));
-    if (!captureAs("", () => consumeChar(BACKSLASH))) return false;
-    if (!truth(b_nonContent())) return false;
-    zeroOrMore(() => captureAs("\n", () => l_empty(indent, FLOW_IN)));
-    return s_flowLinePrefix(indent);
-  });
-
-  // 113
-  bool s_doubleBreak(int indent) => or([
-    () => s_doubleEscaped(indent),
-    () => s_flowFolded(indent)
-  ]);
-
-  // 114
-  void nb_ns_doubleInLine() {
-    zeroOrMore(() => transaction(() {
-        zeroOrMore(() => consume(isSpace));
-        return ns_doubleChar();
-      }));
-  }
-
-  // 115
-  bool s_doubleNextLine(int indent) {
-    if (!truth(s_doubleBreak(indent))) return false;
-    zeroOrOne(() {
-      if (!truth(ns_doubleChar())) return;
-      nb_ns_doubleInLine();
-      or([
-        () => s_doubleNextLine(indent),
-        () => zeroOrMore(() => consume(isSpace))
-      ]);
-    });
-    return true;
-  }
-
-  // 116
-  void nb_doubleMultiLine(int indent) {
-    nb_ns_doubleInLine();
-    or([
-      () => s_doubleNextLine(indent),
-      () => zeroOrMore(() => consume(isSpace))
-    ]);
-  }
-
-  // 117
-  bool c_quotedQuote() => captureAs("'", () => rawString("''"));
-
-  // 118
-  bool nb_singleChar() => or([
-    c_quotedQuote,
-    () => consume((c) => isJson(c) && c != SINGLE_QUOTE)
-  ]);
-
-  // 119
-  bool ns_singleChar() => !isSpace(peek()) && truth(nb_singleChar());
-
-  // 120
-  Node c_singleQuoted(int indent, int ctx) => context('string', () {
-    return transaction(() {
-      var start = _scanner.state;
-      if (!truth(c_indicator(C_SINGLE_QUOTE))) return null;
-      var contents = nb_singleText(indent, ctx);
-      if (!truth(c_indicator(C_SINGLE_QUOTE))) return null;
-      return new ScalarNode("!", _scanner.spanFrom(start), content: contents);
-    });
-  });
-
-  // 121
-  String nb_singleText(int indent, int ctx) => captureString(() {
-    switch (ctx) {
-    case FLOW_OUT:
-    case FLOW_IN:
-      nb_singleMultiLine(indent);
-      break;
-    case BLOCK_KEY:
-    case FLOW_KEY:
-      nb_singleOneLine(indent);
-      break;
-    }
-    return true;
-  });
-
-  // 122
-  void nb_singleOneLine(int indent) {
-    zeroOrMore(nb_singleChar);
-  }
-
-  // 123
-  void nb_ns_singleInLine() {
-    zeroOrMore(() => transaction(() {
-      zeroOrMore(() => consume(isSpace));
-      return ns_singleChar();
-    }));
-  }
-
-  // 124
-  bool s_singleNextLine(int indent) {
-    if (!truth(s_flowFolded(indent))) return false;
-    zeroOrOne(() {
-      if (!truth(ns_singleChar())) return;
-      nb_ns_singleInLine();
-      or([
-        () => s_singleNextLine(indent),
-        () => zeroOrMore(() => consume(isSpace))
-      ]);
-    });
-    return true;
-  }
-
-  // 125
-  void nb_singleMultiLine(int indent) {
-    nb_ns_singleInLine();
-    or([
-      () => s_singleNextLine(indent),
-      () => zeroOrMore(() => consume(isSpace))
-    ]);
-  }
-
-  // 126
-  bool ns_plainFirst(int ctx) {
-    var char = peek();
-    var indicator = indicatorType(char);
-    if (indicator == C_RESERVED) {
-      error("Reserved indicators can't start a plain scalar");
-    }
-    var match = (isNonSpace(char) && indicator == null) ||
-      ((indicator == C_MAPPING_KEY ||
-        indicator == C_MAPPING_VALUE ||
-        indicator == C_SEQUENCE_ENTRY) &&
-       isPlainSafe(ctx, peek(1)));
-
-    if (match) next();
-    return match;
-  }
-
-  // 127
-  bool isPlainSafe(int ctx, int char) {
-    switch (ctx) {
-    case FLOW_OUT:
-    case BLOCK_KEY:
-      // 128
-      return isNonSpace(char);
-    case FLOW_IN:
-    case FLOW_KEY:
-      // 129
-      return isNonSpace(char) && !isFlowIndicator(char);
-    default: throw 'Invalid context "$ctx".';
-    }
-  }
-
-  // 130
-  bool ns_plainChar(int ctx) {
-    var char = peek();
-    var indicator = indicatorType(char);
-    var safeChar = isPlainSafe(ctx, char) && indicator != C_MAPPING_VALUE &&
-      indicator != C_COMMENT;
-    var nonCommentHash = isNonSpace(peek(-1)) && indicator == C_COMMENT;
-    var nonMappingColon = indicator == C_MAPPING_VALUE &&
-      isPlainSafe(ctx, peek(1));
-    var match = safeChar || nonCommentHash || nonMappingColon;
-
-    if (match) next();
-    return match;
-  }
-
-  // 131
-  String ns_plain(int indent, int ctx) => context('plain scalar', () {
-    return captureString(() {
-      switch (ctx) {
-      case FLOW_OUT:
-      case FLOW_IN:
-        return ns_plainMultiLine(indent, ctx);
-      case BLOCK_KEY:
-      case FLOW_KEY:
-        return ns_plainOneLine(ctx);
-      default: throw 'Invalid context "$ctx".';
-      }
-    });
-  });
-
-  // 132
-  void nb_ns_plainInLine(int ctx) {
-    zeroOrMore(() => transaction(() {
-      zeroOrMore(() => consume(isSpace));
-      return ns_plainChar(ctx);
-    }));
-  }
-
-  // 133
-  bool ns_plainOneLine(int ctx) {
-    if (truth(c_forbidden())) return false;
-    if (!truth(ns_plainFirst(ctx))) return false;
-    nb_ns_plainInLine(ctx);
-    return true;
-  }
-
-  // 134
-  bool s_ns_plainNextLine(int indent, int ctx) => transaction(() {
-    if (!truth(s_flowFolded(indent))) return false;
-    if (truth(c_forbidden())) return false;
-    if (!truth(ns_plainChar(ctx))) return false;
-    nb_ns_plainInLine(ctx);
-    return true;
-  });
-
-  // 135
-  bool ns_plainMultiLine(int indent, int ctx) {
-    if (!truth(ns_plainOneLine(ctx))) return false;
-    zeroOrMore(() => s_ns_plainNextLine(indent, ctx));
-    return true;
-  }
-
-  // 136
-  int inFlow(int ctx) {
-    switch (ctx) {
-      case FLOW_OUT:
-      case FLOW_IN:
-        return FLOW_IN;
-      case BLOCK_KEY:
-      case FLOW_KEY:
-        return FLOW_KEY;
-    }
-    throw "unreachable";
-  }
-
-  // 137
-  SequenceNode c_flowSequence(int indent, int ctx) => transaction(() {
-    var start = _scanner.state;
-    if (!truth(c_indicator(C_SEQUENCE_START))) return null;
-    zeroOrOne(() => s_separate(indent, ctx));
-    var content = zeroOrOne(() => ns_s_flowSeqEntries(indent, inFlow(ctx)));
-    if (!truth(c_indicator(C_SEQUENCE_END))) return null;
-    return new SequenceNode("?", new List<Node>.from(content),
-        _scanner.spanFrom(start));
-  });
-
-  // 138
-  Iterable<Node> ns_s_flowSeqEntries(int indent, int ctx) {
-    var first = ns_flowSeqEntry(indent, ctx);
-    if (!truth(first)) return new Queue<Node>();
-    zeroOrOne(() => s_separate(indent, ctx));
-
-    var rest;
-    if (truth(c_indicator(C_COLLECT_ENTRY))) {
-      zeroOrOne(() => s_separate(indent, ctx));
-      rest = zeroOrOne(() => ns_s_flowSeqEntries(indent, ctx));
+    parseTag() {
+      tagToken = token;
+      span = span.expand(token.span);
+      token = _scanner.advance();
     }
 
-    if (rest == null) rest = new Queue<Node>();
-    rest.addFirst(first);
-
-    return rest;
-  }
-
-  // 139
-  Node ns_flowSeqEntry(int indent, int ctx) => or([
-    () => ns_flowPair(indent, ctx),
-    () => ns_flowNode(indent, ctx)
-  ]);
-
-  // 140
-  Node c_flowMapping(int indent, int ctx) {
-    var start = _scanner.state;
-    if (!truth(c_indicator(C_MAPPING_START))) return null;
-    zeroOrOne(() => s_separate(indent, ctx));
-    var content = zeroOrOne(() => ns_s_flowMapEntries(indent, inFlow(ctx)));
-    if (!truth(c_indicator(C_MAPPING_END))) return null;
-    return new MappingNode("?", content, _scanner.spanFrom(start));
-  }
-
-  // 141
-  Map ns_s_flowMapEntries(int indent, int ctx) {
-    var first = ns_flowMapEntry(indent, ctx);
-    if (!truth(first)) return deepEqualsMap();
-    zeroOrOne(() => s_separate(indent, ctx));
-
-    var rest;
-    if (truth(c_indicator(C_COLLECT_ENTRY))) {
-      zeroOrOne(() => s_separate(indent, ctx));
-      rest = ns_s_flowMapEntries(indent, ctx);
+    if (token is AnchorToken) {
+      parseAnchor();
+      if (token is TagToken) parseTag();
+    } else if (token is TagToken) {
+      parseTag();
+      if (token is AnchorToken) parseAnchor();
     }
 
-    if (rest == null) rest = deepEqualsMap();
-
-    // TODO(nweiz): Duplicate keys should be an error. This includes keys with
-    // different representations but the same value (e.g. 10 vs 0xa). To make
-    // this user-friendly we'll probably also want to associate nodes with a
-    // source range.
-    if (!rest.containsKey(first.first)) rest[first.first] = first.last;
-
-    return rest;
-  }
-
-  // 142
-  Pair<Node, Node> ns_flowMapEntry(int indent, int ctx) => or([
-    () => transaction(() {
-      if (!truth(c_indicator(C_MAPPING_KEY))) return false;
-      if (!truth(s_separate(indent, ctx))) return false;
-      return ns_flowMapExplicitEntry(indent, ctx);
-    }),
-    () => ns_flowMapImplicitEntry(indent, ctx)
-  ]);
-
-  // 143
-  Pair<Node, Node> ns_flowMapExplicitEntry(int indent, int ctx) => or([
-    () => ns_flowMapImplicitEntry(indent, ctx),
-    () => new Pair<Node, Node>(e_node(), e_node())
-  ]);
-
-  // 144
-  Pair<Node, Node> ns_flowMapImplicitEntry(int indent, int ctx) => or([
-    () => ns_flowMapYamlKeyEntry(indent, ctx),
-    () => c_ns_flowMapEmptyKeyEntry(indent, ctx),
-    () => c_ns_flowMapJsonKeyEntry(indent, ctx)
-  ]);
-
-  // 145
-  Pair<Node, Node> ns_flowMapYamlKeyEntry(int indent, int ctx) {
-    var key = ns_flowYamlNode(indent, ctx);
-    if (!truth(key)) return null;
-    var value = or([
-      () => transaction(() {
-        zeroOrOne(() => s_separate(indent, ctx));
-        return c_ns_flowMapSeparateValue(indent, ctx);
-      }),
-      e_node
-    ]);
-    return new Pair<Node, Node>(key, value);
-  }
-
-  // 146
-  Pair<Node, Node> c_ns_flowMapEmptyKeyEntry(int indent, int ctx) {
-    var value = c_ns_flowMapSeparateValue(indent, ctx);
-    if (!truth(value)) return null;
-    return new Pair<Node, Node>(e_node(), value);
-  }
-
-  // 147
-  Node c_ns_flowMapSeparateValue(int indent, int ctx) => transaction(() {
-    if (!truth(c_indicator(C_MAPPING_VALUE))) return null;
-    if (isPlainSafe(ctx, peek())) return null;
-
-    return or([
-      () => transaction(() {
-        if (!s_separate(indent, ctx)) return null;
-        return ns_flowNode(indent, ctx);
-      }),
-      e_node
-    ]);
-  });
-
-  // 148
-  Pair<Node, Node> c_ns_flowMapJsonKeyEntry(int indent, int ctx) {
-    var key = c_flowJsonNode(indent, ctx);
-    if (!truth(key)) return null;
-    var value = or([
-      () => transaction(() {
-        zeroOrOne(() => s_separate(indent, ctx));
-        return c_ns_flowMapAdjacentValue(indent, ctx);
-      }),
-      e_node
-    ]);
-    return new Pair<Node, Node>(key, value);
-  }
-
-  // 149
-  Node c_ns_flowMapAdjacentValue(int indent, int ctx) {
-    if (!truth(c_indicator(C_MAPPING_VALUE))) return null;
-    return or([
-      () => transaction(() {
-        zeroOrOne(() => s_separate(indent, ctx));
-        return ns_flowNode(indent, ctx);
-      }),
-      e_node
-    ]);
-  }
-
-  // 150
-  Node ns_flowPair(int indent, int ctx) {
-    var start = _scanner.state;
-    var pair = or([
-      () => transaction(() {
-        if (!truth(c_indicator(C_MAPPING_KEY))) return null;
-        if (!truth(s_separate(indent, ctx))) return null;
-        return ns_flowMapExplicitEntry(indent, ctx);
-      }),
-      () => ns_flowPairEntry(indent, ctx)
-    ]);
-    if (!truth(pair)) return null;
-
-    return map([pair], _scanner.spanFrom(start));
-  }
-
-  // 151
-  Pair<Node, Node> ns_flowPairEntry(int indent, int ctx) => or([
-    () => ns_flowPairYamlKeyEntry(indent, ctx),
-    () => c_ns_flowMapEmptyKeyEntry(indent, ctx),
-    () => c_ns_flowPairJsonKeyEntry(indent, ctx)
-  ]);
-
-  // 152
-  Pair<Node, Node> ns_flowPairYamlKeyEntry(int indent, int ctx) =>
-    transaction(() {
-      var key = ns_s_implicitYamlKey(FLOW_KEY);
-      if (!truth(key)) return null;
-      var value = c_ns_flowMapSeparateValue(indent, ctx);
-      if (!truth(value)) return null;
-      return new Pair<Node, Node>(key, value);
-    });
-
-  // 153
-  Pair<Node, Node> c_ns_flowPairJsonKeyEntry(int indent, int ctx) =>
-    transaction(() {
-      var key = c_s_implicitJsonKey(FLOW_KEY);
-      if (!truth(key)) return null;
-      var value = c_ns_flowMapAdjacentValue(indent, ctx);
-      if (!truth(value)) return null;
-      return new Pair<Node, Node>(key, value);
-    });
-
-  // 154
-  Node ns_s_implicitYamlKey(int ctx) => transaction(() {
-    // TODO(nweiz): this is supposed to be limited to 1024 characters.
-
-    // The indentation parameter is "null" since it's unused in this path
-    var node = ns_flowYamlNode(null, ctx);
-    if (!truth(node)) return null;
-    zeroOrOne(s_separateInLine);
-    return node;
-  });
-
-  // 155
-  Node c_s_implicitJsonKey(int ctx) => transaction(() {
-    // TODO(nweiz): this is supposed to be limited to 1024 characters.
-
-    // The indentation parameter is "null" since it's unused in this path
-    var node = c_flowJsonNode(null, ctx);
-    if (!truth(node)) return null;
-    zeroOrOne(s_separateInLine);
-    return node;
-  });
-
-  // 156
-  Node ns_flowYamlContent(int indent, int ctx) {
-    var start = _scanner.state;
-    var str = ns_plain(indent, ctx);
-    if (!truth(str)) return null;
-    return new ScalarNode("?", _scanner.spanFrom(start), content: str);
-  }
-
-  // 157
-  Node c_flowJsonContent(int indent, int ctx) => or([
-    () => c_flowSequence(indent, ctx),
-    () => c_flowMapping(indent, ctx),
-    () => c_singleQuoted(indent, ctx),
-    () => c_doubleQuoted(indent, ctx)
-  ]);
-
-  // 158
-  Node ns_flowContent(int indent, int ctx) => or([
-    () => ns_flowYamlContent(indent, ctx),
-    () => c_flowJsonContent(indent, ctx)
-  ]);
-
-  // 159
-  Node ns_flowYamlNode(int indent, int ctx) => or([
-    c_ns_aliasNode,
-    () => ns_flowYamlContent(indent, ctx),
-    () {
-      var props = c_ns_properties(indent, ctx);
-      if (!truth(props)) return null;
-      var node = or([
-        () => transaction(() {
-          if (!truth(s_separate(indent, ctx))) return null;
-          return ns_flowYamlContent(indent, ctx);
-        }),
-        e_scalar
-      ]);
-      return addProps(node, props);
-    }
-  ]);
-
-  // 160
-  Node c_flowJsonNode(int indent, int ctx) => transaction(() {
-    var props;
-    zeroOrOne(() => transaction(() {
-        props = c_ns_properties(indent, ctx);
-        if (!truth(props)) return null;
-        return s_separate(indent, ctx);
-      }));
-
-    return addProps(c_flowJsonContent(indent, ctx), props);
-  });
-
-  // 161
-  Node ns_flowNode(int indent, int ctx) => or([
-    c_ns_aliasNode,
-    () => ns_flowContent(indent, ctx),
-    () => transaction(() {
-      var props = c_ns_properties(indent, ctx);
-      if (!truth(props)) return null;
-      var node = or([
-        () => transaction(() => s_separate(indent, ctx) ?
-            ns_flowContent(indent, ctx) : null),
-        e_scalar]);
-      return addProps(node, props);
-    })
-  ]);
-
-  // 162
-  _BlockHeader c_b_blockHeader() => transaction(() {
-    var indentation = c_indentationIndicator();
-    var chomping = c_chompingIndicator();
-    if (!truth(indentation)) indentation = c_indentationIndicator();
-    if (!truth(s_b_comment())) return null;
-
-    return new _BlockHeader(indentation, chomping);
-  });
-
-  // 163
-  int c_indentationIndicator() {
-    if (!isDecDigit(peek())) return null;
-    return next() - NUMBER_0;
-  }
-
-  // 164
-  int c_chompingIndicator() {
-    switch (peek()) {
-    case HYPHEN:
-      next();
-      return CHOMPING_STRIP;
-    case PLUS:
-      next();
-      return CHOMPING_KEEP;
-    default:
-      return CHOMPING_CLIP;
-    }
-  }
-
-  // 165
-  bool b_chompedLast(int chomping) {
-    if (_scanner.isDone) return true;
-    switch (chomping) {
-    case CHOMPING_STRIP:
-      return b_nonContent();
-    case CHOMPING_CLIP:
-    case CHOMPING_KEEP:
-      return b_asLineFeed();
-    }
-    throw "unreachable";
-  }
-
-  // 166
-  void l_chompedEmpty(int indent, int chomping) {
-    switch (chomping) {
-    case CHOMPING_STRIP:
-    case CHOMPING_CLIP:
-      l_stripEmpty(indent);
-      break;
-    case CHOMPING_KEEP:
-      l_keepEmpty(indent);
-      break;
-    }
-  }
-
-  // 167
-  void l_stripEmpty(int indent) {
-    captureAs('', () {
-      zeroOrMore(() => transaction(() {
-          if (!truth(s_indentLessThanOrEqualTo(indent))) return false;
-          return b_nonContent();
-        }));
-      zeroOrOne(() => l_trailComments(indent));
-      return true;
-    });
-  }
-
-  // 168
-  void l_keepEmpty(int indent) {
-    zeroOrMore(() => captureAs('\n', () => l_empty(indent, BLOCK_IN)));
-    zeroOrOne(() => captureAs('', () => l_trailComments(indent)));
-  }
-
-  // 169
-  bool l_trailComments(int indent) => transaction(() {
-    if (!truth(s_indentLessThanOrEqualTo(indent))) return false;
-    if (!truth(c_nb_commentText())) return false;
-    if (!truth(b_comment())) return false;
-    zeroOrMore(l_comment);
-    return true;
-  });
-
-  // 170
-  Node c_l_literal(int indent) => transaction(() {
-    var start = _scanner.state;
-    if (!truth(c_indicator(C_LITERAL))) return null;
-    var header = c_b_blockHeader();
-    if (!truth(header)) return null;
-
-    var additionalIndent = blockScalarAdditionalIndentation(header, indent);
-    var content = l_literalContent(indent + additionalIndent, header.chomping);
-    if (!truth(content)) return null;
-
-    return new ScalarNode("!", _scanner.spanFrom(start), content: content);
-  });
-
-  // 171
-  bool l_nb_literalText(int indent) => transaction(() {
-    zeroOrMore(() => captureAs("\n", () => l_empty(indent, BLOCK_IN)));
-    if (!truth(captureAs("", () => s_indent(indent)))) return false;
-    return truth(oneOrMore(() => consume(isNonBreak)));
-  });
-
-  // 172
-  bool b_nb_literalNext(int indent) => transaction(() {
-    if (!truth(b_asLineFeed())) return false;
-    return l_nb_literalText(indent);
-  });
-
-  // 173
-  String l_literalContent(int indent, int chomping) => captureString(() {
-    transaction(() {
-      if (!truth(l_nb_literalText(indent))) return false;
-      zeroOrMore(() => b_nb_literalNext(indent));
-      return b_chompedLast(chomping);
-    });
-    l_chompedEmpty(indent, chomping);
-    return true;
-  });
-
-  // 174
-  Node c_l_folded(int indent) => transaction(() {
-    var start = _scanner.state;
-    if (!truth(c_indicator(C_FOLDED))) return null;
-    var header = c_b_blockHeader();
-    if (!truth(header)) return null;
-
-    var additionalIndent = blockScalarAdditionalIndentation(header, indent);
-    var content = l_foldedContent(indent + additionalIndent, header.chomping);
-    if (!truth(content)) return null;
-
-    return new ScalarNode("!", _scanner.spanFrom(start), content: content);
-  });
-
-  // 175
-  bool s_nb_foldedText(int indent) => transaction(() {
-    if (!truth(captureAs('', () => s_indent(indent)))) return false;
-    if (!truth(consume(isNonSpace))) return false;
-    zeroOrMore(() => consume(isNonBreak));
-    return true;
-  });
-
-  // 176
-  bool l_nb_foldedLines(int indent) {
-    if (!truth(s_nb_foldedText(indent))) return false;
-    zeroOrMore(() => transaction(() {
-        if (!truth(b_l_folded(indent, BLOCK_IN))) return false;
-        return s_nb_foldedText(indent);
-      }));
-    return true;
-  }
-
-  // 177
-  bool s_nb_spacedText(int indent) => transaction(() {
-    if (!truth(captureAs('', () => s_indent(indent)))) return false;
-    if (!truth(consume(isSpace))) return false;
-    zeroOrMore(() => consume(isNonBreak));
-    return true;
-  });
-
-  // 178
-  bool b_l_spaced(int indent) {
-    if (!truth(b_asLineFeed())) return false;
-    zeroOrMore(() => captureAs("\n", () => l_empty(indent, BLOCK_IN)));
-    return true;
-  }
-
-  // 179
-  bool l_nb_spacedLines(int indent) {
-    if (!truth(s_nb_spacedText(indent))) return false;
-    zeroOrMore(() => transaction(() {
-        if (!truth(b_l_spaced(indent))) return false;
-        return s_nb_spacedText(indent);
-      }));
-    return true;
-  }
-
-  // 180
-  bool l_nb_sameLines(int indent) => transaction(() {
-    zeroOrMore(() => captureAs('\n', () => l_empty(indent, BLOCK_IN)));
-    return or([
-      () => l_nb_foldedLines(indent),
-      () => l_nb_spacedLines(indent)
-    ]);
-  });
-
-  // 181
-  bool l_nb_diffLines(int indent) {
-    if (!truth(l_nb_sameLines(indent))) return false;
-    zeroOrMore(() => transaction(() {
-        if (!truth(b_asLineFeed())) return false;
-        return l_nb_sameLines(indent);
-      }));
-    return true;
-  }
-
-  // 182
-  String l_foldedContent(int indent, int chomping) => captureString(() {
-    transaction(() {
-      if (!truth(l_nb_diffLines(indent))) return false;
-      return b_chompedLast(chomping);
-    });
-    l_chompedEmpty(indent, chomping);
-    return true;
-  });
-
-  // 183
-  SequenceNode l_blockSequence(int indent) => context('sequence', () {
-    var additionalIndent = countIndentation() - indent;
-    if (additionalIndent <= 0) return null;
-
-    var start = _scanner.state;
-    var content = oneOrMore(() => transaction(() {
-      if (!truth(s_indent(indent + additionalIndent))) return null;
-      return c_l_blockSeqEntry(indent + additionalIndent);
-    }));
-    if (!truth(content)) return null;
-
-    return new SequenceNode("?", content, _scanner.spanFrom(start));
-  });
-
-  // 184
-  Node c_l_blockSeqEntry(int indent) => transaction(() {
-    if (!truth(c_indicator(C_SEQUENCE_ENTRY))) return null;
-    if (isNonSpace(peek())) return null;
-
-    return s_l_blockIndented(indent, BLOCK_IN);
-  });
-
-  // 185
-  Node s_l_blockIndented(int indent, int ctx) {
-    var additionalIndent = countIndentation();
-    return or([
-      () => transaction(() {
-        if (!truth(s_indent(additionalIndent))) return null;
-        return or([
-          () => ns_l_compactSequence(indent + 1 + additionalIndent),
-          () => ns_l_compactMapping(indent + 1 + additionalIndent)]);
-      }),
-      () => s_l_blockNode(indent, ctx),
-      () => s_l_comments() ? e_node() : null]);
-  }
-
-  // 186
-  Node ns_l_compactSequence(int indent) => context('sequence', () {
-    var start = _scanner.state;
-    var first = c_l_blockSeqEntry(indent);
-    if (!truth(first)) return null;
-
-    var content = zeroOrMore(() => transaction(() {
-        if (!truth(s_indent(indent))) return null;
-        return c_l_blockSeqEntry(indent);
-      }));
-    content.insert(0, first);
-
-    return new SequenceNode("?", content, _scanner.spanFrom(start));
-  });
-
-  // 187
-  Node l_blockMapping(int indent) => context('mapping', () {
-    var additionalIndent = countIndentation() - indent;
-    if (additionalIndent <= 0) return null;
-
-    var start = _scanner.state;
-    var pairs = oneOrMore(() => transaction(() {
-      if (!truth(s_indent(indent + additionalIndent))) return null;
-      return ns_l_blockMapEntry(indent + additionalIndent);
-    }));
-    if (!truth(pairs)) return null;
-
-    return map(pairs, _scanner.spanFrom(start));
-  });
-
-  // 188
-  Pair<Node, Node> ns_l_blockMapEntry(int indent) => or([
-    () => c_l_blockMapExplicitEntry(indent),
-    () => ns_l_blockMapImplicitEntry(indent)
-  ]);
-
-  // 189
-  Pair<Node, Node> c_l_blockMapExplicitEntry(int indent) {
-    var key = c_l_blockMapExplicitKey(indent);
-    if (!truth(key)) return null;
-
-    var value = or([
-      () => l_blockMapExplicitValue(indent),
-      e_node
-    ]);
-
-    return new Pair<Node, Node>(key, value);
-  }
-
-  // 190
-  Node c_l_blockMapExplicitKey(int indent) => transaction(() {
-    if (!truth(c_indicator(C_MAPPING_KEY))) return null;
-    return s_l_blockIndented(indent, BLOCK_OUT);
-  });
-
-  // 191
-  Node l_blockMapExplicitValue(int indent) => transaction(() {
-    if (!truth(s_indent(indent))) return null;
-    if (!truth(c_indicator(C_MAPPING_VALUE))) return null;
-    return s_l_blockIndented(indent, BLOCK_OUT);
-  });
-
-  // 192
-  Pair<Node, Node> ns_l_blockMapImplicitEntry(int indent) => transaction(() {
-    var key = or([ns_s_blockMapImplicitKey, e_node]);
-    var value = c_l_blockMapImplicitValue(indent);
-    return truth(value) ? new Pair<Node, Node>(key, value) : null;
-  });
-
-  // 193
-  Node ns_s_blockMapImplicitKey() => context('mapping key', () => or([
-    () => c_s_implicitJsonKey(BLOCK_KEY),
-    () => ns_s_implicitYamlKey(BLOCK_KEY)
-  ]));
-
-  // 194
-  Node c_l_blockMapImplicitValue(int indent) => context('mapping value', () =>
-    transaction(() {
-      if (!truth(c_indicator(C_MAPPING_VALUE))) return null;
-      return or([
-        () => s_l_blockNode(indent, BLOCK_OUT),
-        () => s_l_comments() ? e_node() : null
-      ]);
-    }));
-
-  // 195
-  Node ns_l_compactMapping(int indent) => context('mapping', () {
-    var start = _scanner.state;
-    var first = ns_l_blockMapEntry(indent);
-    if (!truth(first)) return null;
-
-    var pairs = zeroOrMore(() => transaction(() {
-        if (!truth(s_indent(indent))) return null;
-        return ns_l_blockMapEntry(indent);
-      }));
-    pairs.insert(0, first);
-
-    return map(pairs, _scanner.spanFrom(start));
-  });
-
-  // 196
-  Node s_l_blockNode(int indent, int ctx) => or([
-    () => s_l_blockInBlock(indent, ctx),
-    () => s_l_flowInBlock(indent)
-  ]);
-
-  // 197
-  Node s_l_flowInBlock(int indent) => transaction(() {
-    if (!truth(s_separate(indent + 1, FLOW_OUT))) return null;
-    var node = ns_flowNode(indent + 1, FLOW_OUT);
-    if (!truth(node)) return null;
-    if (!truth(s_l_comments())) return null;
-    return node;
-  });
-
-  // 198
-  Node s_l_blockInBlock(int indent, int ctx) => or([
-    () => s_l_blockScalar(indent, ctx),
-    () => s_l_blockCollection(indent, ctx)
-  ]);
-
-  // 199
-  Node s_l_blockScalar(int indent, int ctx) => transaction(() {
-    if (!truth(s_separate(indent + 1, ctx))) return null;
-    var props = transaction(() {
-      var innerProps = c_ns_properties(indent + 1, ctx);
-      if (!truth(innerProps)) return null;
-      if (!truth(s_separate(indent + 1, ctx))) return null;
-      return innerProps;
-    });
-
-    var node = or([() => c_l_literal(indent), () => c_l_folded(indent)]);
-    if (!truth(node)) return null;
-    return addProps(node, props);
-  });
-
-  // 200
-  Node s_l_blockCollection(int indent, int ctx) => transaction(() {
-    var props = transaction(() {
-      if (!truth(s_separate(indent + 1, ctx))) return null;
-      return c_ns_properties(indent + 1, ctx);
-    });
-
-    if (!truth(s_l_comments())) return null;
-    return or([
-      () => l_blockSequence(seqSpaces(indent, ctx)),
-      () => l_blockMapping(indent)]);
-  });
-
-  // 201
-  int seqSpaces(int indent, int ctx) => ctx == BLOCK_OUT ? indent - 1 : indent;
-
-  // 202
-  void l_documentPrefix() {
-    zeroOrMore(l_comment);
-  }
-
-  // 203
-  bool c_directivesEnd() => rawString("---");
-
-  // 204
-  bool c_documentEnd() => rawString("...");
-
-  // 205
-  bool l_documentSuffix() => transaction(() {
-    if (!truth(c_documentEnd())) return false;
-    return s_l_comments();
-  });
-
-  // 206
-  bool c_forbidden() {
-    if (!_inBareDocument || !atStartOfLine) return false;
-    var forbidden = false;
-    transaction(() {
-      if (!truth(or([c_directivesEnd, c_documentEnd]))) return;
-      var char = peek();
-      forbidden = isBreak(char) || isSpace(char) || _scanner.isDone;
-      return;
-    });
-    return forbidden;
-  }
-
-  // 207
-  Node l_bareDocument() {
-    try {
-      _inBareDocument = true;
-      return s_l_blockNode(-1, BLOCK_IN);
-    } finally {
-      _inBareDocument = false;
-    }
-  }
-
-  // 208
-  Node l_explicitDocument() {
-    if (!truth(c_directivesEnd())) return null;
-    var doc = l_bareDocument();
-    if (truth(doc)) return doc;
-
-    doc = e_node();
-    s_l_comments();
-    return doc;
-  }
-
-  // 209
-  Node l_directiveDocument() {
-    if (!truth(oneOrMore(l_directive))) return null;
-    var doc = l_explicitDocument();
-    if (doc != null) return doc;
-    parseFailed();
-    return null; // Unreachable.
-  }
-
-  // 210
-  Node l_anyDocument() =>
-    or([l_directiveDocument, l_explicitDocument, l_bareDocument]);
-
-  // 211
-  Pair<List<Node>, SourceSpan> l_yamlStream() {
-    var start = _scanner.state;
-    var docs = [];
-    zeroOrMore(l_documentPrefix);
-    var first = zeroOrOne(l_anyDocument);
-    if (!truth(first)) first = e_node();
-    docs.add(first);
-
-    zeroOrMore(() {
-      var doc;
-      if (truth(oneOrMore(l_documentSuffix))) {
-        zeroOrMore(l_documentPrefix);
-        doc = zeroOrOne(l_anyDocument);
+    var tag;
+    if (tagToken != null) {
+      if (tagToken.handle == null) {
+        tag = tagToken.suffix;
       } else {
-        zeroOrMore(l_documentPrefix);
-        doc = zeroOrOne(l_explicitDocument);
+        var tagDirective = _tagDirectives[tagToken.handle];
+        if (tagDirective == null) {
+          throw new YamlException("Undefined tag handle.", tagToken.span);
+        }
+
+        tag = tagDirective.prefix + tagToken.suffix;
       }
-      if (truth(doc)) docs.add(doc);
-      return doc;
-    });
-
-    if (!_scanner.isDone) parseFailed();
-    return new Pair(docs, _scanner.spanFrom(start));
-  }
-}
-
-/// The information in the header for a block scalar.
-class _BlockHeader {
-  final int additionalIndent;
-  final int chomping;
-
-  _BlockHeader(this.additionalIndent, this.chomping);
-
-  bool get autoDetectIndent => additionalIndent == null;
-}
-
-/// A range of characters in the YAML document, from [start] to [end]
-/// (inclusive).
-class _Range {
-  /// The first character in the range.
-  final int start;
-
-  /// The last character in the range.
-  final int end;
-
-  _Range(this.start, this.end);
-
-  /// Returns whether or not [pos] lies within this range.
-  bool contains(int pos) => pos >= start && pos <= end;
-}
-
-/// A map that associates [E] values with [_Range]s. It's efficient to create
-/// new associations, but finding the value associated with a position is more
-/// expensive.
-class _RangeMap<E> {
-  /// The ranges and their associated elements.
-  final List<Pair<_Range, E>> _contents = <Pair<_Range, E>>[];
-
-  _RangeMap();
-
-  /// Returns the value associated with the range in which [pos] lies, or null
-  /// if there is no such range. If there's more than one such range, the most
-  /// recently set one is used.
-  E operator[](int pos) {
-    // Iterate backwards through contents so the more recent range takes
-    // precedence.
-    for (var pair in _contents.reversed) {
-      if (pair.first.contains(pos)) return pair.last;
     }
-    return null;
+
+    if (indentlessSequence && token.type == TokenType.BLOCK_ENTRY) {
+      _state = _State.INDENTLESS_SEQUENCE_ENTRY;
+      return new SequenceStartEvent(
+          span.expand(token.span), CollectionStyle.BLOCK,
+          anchor: anchor, tag: tag);
+    }
+
+    if (token is ScalarToken) {
+      // All non-plain scalars have the "!" tag by default.
+      if (tag == null && token.style != ScalarStyle.PLAIN) tag = "!";
+
+      _state = _states.removeLast();
+      _scanner.scan();
+      return new ScalarEvent(
+          span.expand(token.span), token.value, token.style,
+          anchor: anchor, tag: tag);
+    }
+
+    if (token.type == TokenType.FLOW_SEQUENCE_START) {
+      _state = _State.FLOW_SEQUENCE_FIRST_ENTRY;
+      return new SequenceStartEvent(
+          span.expand(token.span), CollectionStyle.FLOW,
+          anchor: anchor, tag: tag);
+    }
+
+    if (token.type == TokenType.FLOW_MAPPING_START) {
+      _state = _State.FLOW_MAPPING_FIRST_KEY;
+      return new MappingStartEvent(
+          span.expand(token.span), CollectionStyle.FLOW,
+          anchor: anchor, tag: tag);
+    }
+
+    if (block && token.type == TokenType.BLOCK_SEQUENCE_START) {
+      _state = _State.BLOCK_SEQUENCE_FIRST_ENTRY;
+      return new SequenceStartEvent(
+          span.expand(token.span), CollectionStyle.BLOCK,
+          anchor: anchor, tag: tag);
+    }
+
+
+    if (block && token.type == TokenType.BLOCK_MAPPING_START) {
+      _state = _State.BLOCK_MAPPING_FIRST_KEY;
+      return new MappingStartEvent(
+          span.expand(token.span), CollectionStyle.BLOCK,
+          anchor: anchor, tag: tag);
+    }
+
+    if (anchor != null || tag != null) {
+      _state = _states.removeLast();
+      return new ScalarEvent(
+          span, '', ScalarStyle.PLAIN,
+          anchor: anchor, tag: tag);
+    }
+
+    throw new YamlException("Expected node content.", span);
   }
 
-  /// Associates [value] with [range].
-  operator[]=(_Range range, E value) =>
-    _contents.add(new Pair<_Range, E>(range, value));
+  /// Parses the productions:
+  ///
+  ///     block_sequence ::=
+  ///       BLOCK-SEQUENCE-START (BLOCK-ENTRY block_node?)* BLOCK-END
+  ///       ********************  *********** *             *********
+  Event _parseBlockSequenceEntry() {
+    var token = _scanner.peek();
+
+    if (token.type == TokenType.BLOCK_ENTRY) {
+      token = _scanner.advance();
+
+      if (token.type == TokenType.BLOCK_ENTRY ||
+          token.type == TokenType.BLOCK_END) {
+        _state = _State.BLOCK_SEQUENCE_ENTRY;
+        return _processEmptyScalar(token.span.end);
+      } else {
+        _states.add(_State.BLOCK_SEQUENCE_ENTRY);
+        return _parseNode(block: true);
+      }
+    }
+
+    if (token.type == TokenType.BLOCK_END) {
+      _scanner.scan();
+      _state = _states.removeLast();
+      return new Event(EventType.SEQUENCE_END, token.span);
+    }
+
+    throw new YamlException("While parsing a block collection, expected '-'.",
+        token.span.start.pointSpan());
+  }
+
+  /// Parses the productions:
+  ///
+  ///     indentless_sequence  ::= (BLOCK-ENTRY block_node?)+
+  ///                               *********** *
+  Event _parseIndentlessSequenceEntry() {
+    var token = _scanner.peek();
+
+    if (token.type != TokenType.BLOCK_ENTRY) {
+      _state = _states.removeLast();
+      return new Event(EventType.SEQUENCE_END, token.span.start.pointSpan());
+    }
+
+    var start = token.span.start;
+    token = _scanner.advance();
+
+    if (token.type == TokenType.BLOCK_ENTRY ||
+        token.type == TokenType.KEY ||
+        token.type == TokenType.VALUE ||
+        token.type == TokenType.BLOCK_END) {
+      _state = _State.INDENTLESS_SEQUENCE_ENTRY;
+      return _processEmptyScalar(start);
+    } else {
+      _states.add(_State.INDENTLESS_SEQUENCE_ENTRY);
+      return _parseNode(block: true);
+    }
+  }
+
+  /// Parses the productions:
+  ///
+  ///     block_mapping        ::= BLOCK-MAPPING_START
+  ///                              *******************
+  ///                              ((KEY block_node_or_indentless_sequence?)?
+  ///                                *** *
+  ///                              (VALUE block_node_or_indentless_sequence?)?)*
+  ///
+  ///                              BLOCK-END
+  ///                              *********
+  Event _parseBlockMappingKey() {
+    var token = _scanner.peek();
+    if (token.type == TokenType.KEY) {
+      var start = token.span.start;
+      token = _scanner.advance();
+
+      if (token.type == TokenType.KEY ||
+          token.type == TokenType.VALUE ||
+          token.type == TokenType.BLOCK_END) {
+        _state = _State.BLOCK_MAPPING_VALUE;
+        return _processEmptyScalar(start);
+      } else {
+        _states.add(_State.BLOCK_MAPPING_VALUE);
+        return _parseNode(block: true, indentlessSequence: true);
+      }
+    }
+
+    // libyaml doesn't allow empty keys without an explicit key indicator, but
+    // the spec does. See example 8.18:
+    // http://yaml.org/spec/1.2/spec.html#id2798896.
+    if (token.type == TokenType.VALUE) {
+      _state = _State.BLOCK_MAPPING_VALUE;
+      return _processEmptyScalar(token.span.start);
+    }
+
+    if (token.type == TokenType.BLOCK_END) {
+      _scanner.scan();
+      _state = _states.removeLast();
+      return new Event(EventType.MAPPING_END, token.span);
+    }
+
+    throw new YamlException("Expected a key while parsing a block mapping.",
+        token.span.start.pointSpan());
+  }
+
+  /// Parses the productions:
+  ///
+  ///     block_mapping        ::= BLOCK-MAPPING_START
+  ///
+  ///                              ((KEY block_node_or_indentless_sequence?)?
+  ///
+  ///                              (VALUE block_node_or_indentless_sequence?)?)*
+  ///                               ***** *
+  ///                              BLOCK-END  
+  ///
+  Event _parseBlockMappingValue() {
+    var token = _scanner.peek();
+
+    if (token.type != TokenType.VALUE) {
+      _state = _State.BLOCK_MAPPING_KEY;
+      return _processEmptyScalar(token.span.start);
+    }
+
+    var start = token.span.start;
+    token = _scanner.advance();
+    if (token.type == TokenType.KEY ||
+        token.type == TokenType.VALUE ||
+        token.type == TokenType.BLOCK_END) {
+      _state = _State.BLOCK_MAPPING_KEY;
+      return _processEmptyScalar(start);
+    } else {
+      _states.add(_State.BLOCK_MAPPING_KEY);
+      return _parseNode(block: true, indentlessSequence: true);
+    }
+  }
+
+  /// Parses the productions:
+  ///
+  ///     flow_sequence        ::= FLOW-SEQUENCE-START
+  ///                              *******************
+  ///                              (flow_sequence_entry FLOW-ENTRY)*
+  ///                               *                   **********
+  ///                              flow_sequence_entry?
+  ///                              *
+  ///                              FLOW-SEQUENCE-END
+  ///                              *****************
+  ///     flow_sequence_entry  ::=
+  ///       flow_node | KEY flow_node? (VALUE flow_node?)?
+  ///       *
+  Event _parseFlowSequenceEntry({bool first: false}) {
+    if (first) _scanner.scan();
+    var token = _scanner.peek();
+
+    if (token.type != TokenType.FLOW_SEQUENCE_END) {
+      if (!first) {
+        if (token.type != TokenType.FLOW_ENTRY) {
+          throw new YamlException(
+              "While parsing a flow sequence, expected ',' or ']'.",
+              token.span.start.pointSpan());
+        }
+
+        token = _scanner.advance();
+      }
+
+      if (token.type == TokenType.KEY) {
+        _state = _State.FLOW_SEQUENCE_ENTRY_MAPPING_KEY;
+        _scanner.scan();
+        return new MappingStartEvent(
+            token.span, CollectionStyle.FLOW);
+      } else if (token.type != TokenType.FLOW_SEQUENCE_END) {
+        _states.add(_State.FLOW_SEQUENCE_ENTRY);
+        return _parseNode();
+      }
+    }
+
+    _scanner.scan();
+    _state = _states.removeLast();
+    return new Event(EventType.SEQUENCE_END, token.span);
+  }  
+
+  /// Parses the productions:
+  ///
+  ///     flow_sequence_entry  ::=
+  ///       flow_node | KEY flow_node? (VALUE flow_node?)?
+  ///                   *** *
+  Event _parseFlowSequenceEntryMappingKey() {
+    var token = _scanner.peek();
+
+    if (token.type == TokenType.VALUE ||
+        token.type == TokenType.FLOW_ENTRY ||
+        token.type == TokenType.FLOW_SEQUENCE_END) {
+      // libyaml consumes the token here, but that seems like a bug, since it
+      // always causes [_parseFlowSequenceEntryMappingValue] to emit an empty
+      // scalar.
+
+      var start = token.span.start;
+      _state = _State.FLOW_SEQUENCE_ENTRY_MAPPING_VALUE;
+      return _processEmptyScalar(start);
+    } else {
+      _states.add(_State.FLOW_SEQUENCE_ENTRY_MAPPING_VALUE);
+      return _parseNode();
+    }
+  }
+
+  /// Parses the productions:
+  ///
+  ///     flow_sequence_entry  ::=
+  ///       flow_node | KEY flow_node? (VALUE flow_node?)?
+  ///                                   ***** *
+  Event _parseFlowSequenceEntryMappingValue() {
+    var token = _scanner.peek();
+
+    if (token.type == TokenType.VALUE) {
+      token = _scanner.advance();
+      if (token.type != TokenType.FLOW_ENTRY &&
+          token.type != TokenType.FLOW_SEQUENCE_END) {
+        _states.add(_State.FLOW_SEQUENCE_ENTRY_MAPPING_END);
+        return _parseNode();
+      }
+    }
+
+    _state = _State.FLOW_SEQUENCE_ENTRY_MAPPING_END;
+    return _processEmptyScalar(token.span.start);
+  }
+
+  /// Parses the productions:
+  ///
+  ///     flow_sequence_entry  ::=
+  ///       flow_node | KEY flow_node? (VALUE flow_node?)?
+  ///                                                   *
+  Event _parseFlowSequenceEntryMappingEnd() {
+    _state = _State.FLOW_SEQUENCE_ENTRY;
+    return new Event(EventType.MAPPING_END,
+        _scanner.peek().span.start.pointSpan());
+  }
+
+  /// Parses the productions:
+  ///
+  ///     flow_mapping         ::= FLOW-MAPPING-START
+  ///                              ******************
+  ///                              (flow_mapping_entry FLOW-ENTRY)*
+  ///                               *                  **********
+  ///                              flow_mapping_entry?
+  ///                              ******************
+  ///                              FLOW-MAPPING-END
+  ///                              ****************
+  ///     flow_mapping_entry   ::=
+  ///       flow_node | KEY flow_node? (VALUE flow_node?)?
+  ///       *           *** *
+  Event _parseFlowMappingKey({bool first: false}) {
+    if (first) _scanner.scan();
+    var token = _scanner.peek();
+
+    if (token.type != TokenType.FLOW_MAPPING_END) {
+      if (!first) {
+        if (token.type != TokenType.FLOW_ENTRY) {
+          throw new YamlException(
+              "While parsing a flow mapping, expected ',' or '}'.",
+              token.span.start.pointSpan());
+        }
+
+        token = _scanner.advance();
+      }
+
+      if (token.type == TokenType.KEY) {
+        token = _scanner.advance();
+        if (token.type != TokenType.VALUE &&
+            token.type != TokenType.FLOW_ENTRY &&
+            token.type != TokenType.FLOW_MAPPING_END) {
+          _states.add(_State.FLOW_MAPPING_VALUE);
+          return _parseNode();
+        } else {
+          _state = _State.FLOW_MAPPING_VALUE;
+          return _processEmptyScalar(token.span.start);
+        }
+      } else if (token.type != TokenType.FLOW_MAPPING_END) {
+        _states.add(_State.FLOW_MAPPING_EMPTY_VALUE);
+        return _parseNode();
+      }
+    }
+
+    _scanner.scan();
+    _state = _states.removeLast();
+    return new Event(EventType.MAPPING_END, token.span);
+  }
+
+  /// Parses the productions:
+  ///
+  ///     flow_mapping_entry   ::=
+  ///       flow_node | KEY flow_node? (VALUE flow_node?)?
+  ///                *                  ***** *
+  Event _parseFlowMappingValue({bool empty: false}) {
+    var token = _scanner.peek();
+
+    if (empty) {
+      _state = _State.FLOW_MAPPING_KEY;
+      return _processEmptyScalar(token.span.start);
+    }
+
+    if (token.type == TokenType.VALUE) {
+      token = _scanner.advance();
+      if (token.type != TokenType.FLOW_ENTRY &&
+          token.type != TokenType.FLOW_MAPPING_END) {
+        _states.add(_State.FLOW_MAPPING_KEY);
+        return _parseNode();
+      }
+    }
+
+    _state = _State.FLOW_MAPPING_KEY;
+    return _processEmptyScalar(token.span.start);
+  }
+
+  /// Generate an empty scalar event.
+  Event _processEmptyScalar(SourceLocation location) =>
+      new ScalarEvent(location.pointSpan(), '', ScalarStyle.PLAIN);
+
+  /// Parses directives.
+  Pair<VersionDirective, List<TagDirective>> _processDirectives() {
+    var token = _scanner.peek();
+
+    var versionDirective;
+    var tagDirectives = [];
+    var reservedDirectives = [];
+    while (token.type == TokenType.VERSION_DIRECTIVE ||
+           token.type == TokenType.TAG_DIRECTIVE) {
+      if (token is VersionDirectiveToken) {
+        if (versionDirective != null) {
+          throw new YamlException("Duplicate %YAML directive.", token.span);
+        }
+
+        if (token.major != 1 || token.minor == 0) {
+          throw new YamlException(
+              "Incompatible YAML document. This parser only supports YAML 1.1 "
+                "and 1.2.",
+              token.span);
+        } else if (token.minor > 2) {
+          // TODO(nweiz): Print to stderr when issue 6943 is fixed and dart:io
+          // is available.
+          warn("Warning: this parser only supports YAML 1.1 and 1.2.",
+              token.span);
+        }
+
+        versionDirective = new VersionDirective(token.major, token.minor);
+      } else if (token is TagDirectiveToken) {
+        var tagDirective = new TagDirective(token.handle, token.prefix);
+        _appendTagDirective(tagDirective, token.span);
+        tagDirectives.add(tagDirective);
+      }
+
+      token = _scanner.advance();
+    }
+    
+    _appendTagDirective(
+        new TagDirective("!", "!"),
+        token.span.start.pointSpan(),
+        allowDuplicates: true);
+    _appendTagDirective(
+        new TagDirective("!!", "tag:yaml.org,2002:"),
+        token.span.start.pointSpan(),
+        allowDuplicates: true);
+
+    return new Pair(versionDirective, tagDirectives);
+  }
+
+  /// Adds a tag directive to the directives stack.
+  void _appendTagDirective(TagDirective newDirective, FileSpan span,
+      {bool allowDuplicates: false}) {
+    if (_tagDirectives.containsKey(newDirective.handle)) {
+      if (allowDuplicates) return;
+      throw new YamlException("Duplicate %TAG directive.", span);
+    }
+
+    _tagDirectives[newDirective.handle] = newDirective;
+  }
+}
+
+/// The possible states for the parser.
+class _State {
+  /// Expect [TokenType.STREAM_START].
+  static const STREAM_START = const _State("STREAM_START");
+
+  /// Expect the beginning of an implicit document.
+  static const IMPLICIT_DOCUMENT_START =
+      const _State("IMPLICIT_DOCUMENT_START");
+
+  /// Expect [TokenType.DOCUMENT_START].
+  static const DOCUMENT_START = const _State("DOCUMENT_START");
+
+  /// Expect the content of a document.
+  static const DOCUMENT_CONTENT = const _State("DOCUMENT_CONTENT");
+
+  /// Expect [TokenType.DOCUMENT_END].
+  static const DOCUMENT_END = const _State("DOCUMENT_END");
+
+  /// Expect a block node.
+  static const BLOCK_NODE = const _State("BLOCK_NODE");
+
+  /// Expect a block node or indentless sequence.
+  static const BLOCK_NODE_OR_INDENTLESS_SEQUENCE =
+      const _State("BLOCK_NODE_OR_INDENTLESS_SEQUENCE");
+
+  /// Expect a flow node.
+  static const FLOW_NODE = const _State("FLOW_NODE");
+
+  /// Expect the first entry of a block sequence.
+  static const BLOCK_SEQUENCE_FIRST_ENTRY =
+      const _State("BLOCK_SEQUENCE_FIRST_ENTRY");
+
+  /// Expect an entry of a block sequence.
+  static const BLOCK_SEQUENCE_ENTRY = const _State("BLOCK_SEQUENCE_ENTRY");
+
+  /// Expect an entry of an indentless sequence.
+  static const INDENTLESS_SEQUENCE_ENTRY =
+      const _State("INDENTLESS_SEQUENCE_ENTRY");
+
+  /// Expect the first key of a block mapping.
+  static const BLOCK_MAPPING_FIRST_KEY =
+      const _State("BLOCK_MAPPING_FIRST_KEY");
+
+  /// Expect a block mapping key.
+  static const BLOCK_MAPPING_KEY = const _State("BLOCK_MAPPING_KEY");
+
+  /// Expect a block mapping value.
+  static const BLOCK_MAPPING_VALUE = const _State("BLOCK_MAPPING_VALUE");
+
+  /// Expect the first entry of a flow sequence.
+  static const FLOW_SEQUENCE_FIRST_ENTRY =
+      const _State("FLOW_SEQUENCE_FIRST_ENTRY");
+
+  /// Expect an entry of a flow sequence.
+  static const FLOW_SEQUENCE_ENTRY = const _State("FLOW_SEQUENCE_ENTRY");
+
+  /// Expect a key of an ordered mapping.
+  static const FLOW_SEQUENCE_ENTRY_MAPPING_KEY =
+      const _State("FLOW_SEQUENCE_ENTRY_MAPPING_KEY");
+
+  /// Expect a value of an ordered mapping.
+  static const FLOW_SEQUENCE_ENTRY_MAPPING_VALUE =
+      const _State("FLOW_SEQUENCE_ENTRY_MAPPING_VALUE");
+
+  /// Expect the and of an ordered mapping entry.
+  static const FLOW_SEQUENCE_ENTRY_MAPPING_END =
+      const _State("FLOW_SEQUENCE_ENTRY_MAPPING_END");
+
+  /// Expect the first key of a flow mapping.
+  static const FLOW_MAPPING_FIRST_KEY = const _State("FLOW_MAPPING_FIRST_KEY");
+
+  /// Expect a key of a flow mapping.
+  static const FLOW_MAPPING_KEY = const _State("FLOW_MAPPING_KEY");
+
+  /// Expect a value of a flow mapping.
+  static const FLOW_MAPPING_VALUE = const _State("FLOW_MAPPING_VALUE");
+
+  /// Expect an empty value of a flow mapping.
+  static const FLOW_MAPPING_EMPTY_VALUE =
+      const _State("FLOW_MAPPING_EMPTY_VALUE");
+
+  /// Expect nothing.
+  static const END = const _State("END");
+
+  final String name;
+
+  const _State(this.name);
+
+  String toString() => name;
 }
diff --git a/pkg/yaml/lib/src/scanner.dart b/pkg/yaml/lib/src/scanner.dart
new file mode 100644
index 0000000..0068553
--- /dev/null
+++ b/pkg/yaml/lib/src/scanner.dart
@@ -0,0 +1,1663 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library yaml.scanner;
+
+import 'package:collection/collection.dart';
+import 'package:string_scanner/string_scanner.dart';
+import 'package:source_span/source_span.dart';
+
+import 'style.dart';
+import 'token.dart';
+import 'utils.dart';
+import 'yaml_exception.dart';
+
+/// A scanner that reads a string of Unicode characters and emits [Token]s.
+///
+/// This is based on the libyaml scanner, available at
+/// https://github.com/yaml/libyaml/blob/master/src/scanner.c. The license for
+/// that is available in ../../libyaml-license.txt.
+class Scanner {
+  static const TAB = 0x9;
+  static const LF = 0xA;
+  static const CR = 0xD;
+  static const SP = 0x20;
+  static const DOLLAR = 0x24;
+  static const LEFT_PAREN = 0x28;
+  static const RIGHT_PAREN = 0x29;
+  static const PLUS = 0x2B;
+  static const COMMA = 0x2C;
+  static const HYPHEN = 0x2D;
+  static const PERIOD = 0x2E;
+  static const QUESTION = 0x3F;
+  static const COLON = 0x3A;
+  static const SEMICOLON = 0x3B;
+  static const EQUALS = 0x3D;
+  static const LEFT_SQUARE = 0x5B;
+  static const RIGHT_SQUARE = 0x5D;
+  static const LEFT_CURLY = 0x7B;
+  static const RIGHT_CURLY = 0x7D;
+  static const HASH = 0x23;
+  static const AMPERSAND = 0x26;
+  static const ASTERISK = 0x2A;
+  static const EXCLAMATION = 0x21;
+  static const VERTICAL_BAR = 0x7C;
+  static const LEFT_ANGLE = 0x3C;
+  static const RIGHT_ANGLE = 0x3E;
+  static const SINGLE_QUOTE = 0x27;
+  static const DOUBLE_QUOTE = 0x22;
+  static const PERCENT = 0x25;
+  static const AT = 0x40;
+  static const GRAVE_ACCENT = 0x60;
+  static const TILDE = 0x7E;
+
+  static const NULL = 0x0;
+  static const BELL = 0x7;
+  static const BACKSPACE = 0x8;
+  static const VERTICAL_TAB = 0xB;
+  static const FORM_FEED = 0xC;
+  static const ESCAPE = 0x1B;
+  static const SLASH = 0x2F;
+  static const BACKSLASH = 0x5C;
+  static const UNDERSCORE = 0x5F;
+  static const NEL = 0x85;
+  static const NBSP = 0xA0;
+  static const LINE_SEPARATOR = 0x2028;
+  static const PARAGRAPH_SEPARATOR = 0x2029;
+  static const BOM = 0xFEFF;
+
+  static const NUMBER_0 = 0x30;
+  static const NUMBER_9 = 0x39;
+
+  static const LETTER_A = 0x61;
+  static const LETTER_B = 0x62;
+  static const LETTER_E = 0x65;
+  static const LETTER_F = 0x66;
+  static const LETTER_N = 0x6E;
+  static const LETTER_R = 0x72;
+  static const LETTER_T = 0x74;
+  static const LETTER_U = 0x75;
+  static const LETTER_V = 0x76;
+  static const LETTER_X = 0x78;
+  static const LETTER_Z = 0x7A;
+
+  static const LETTER_CAP_A = 0x41;
+  static const LETTER_CAP_F = 0x46;
+  static const LETTER_CAP_L = 0x4C;
+  static const LETTER_CAP_N = 0x4E;
+  static const LETTER_CAP_P = 0x50;
+  static const LETTER_CAP_U = 0x55;
+  static const LETTER_CAP_X = 0x58;
+  static const LETTER_CAP_Z = 0x5A;
+
+  /// The underlying [SpanScanner] used to read characters from the source text.
+  ///
+  /// This is also used to track line and column information and to generate
+  /// [SourceSpan]s.
+  final SpanScanner _scanner;
+
+  /// Whether this scanner has produced a [TokenType.STREAM_START] token
+  /// indicating the beginning of the YAML stream.
+  var _streamStartProduced = false;
+
+  /// Whether this scanner has produced a [TokenType.STREAM_END] token
+  /// indicating the end of the YAML stream.
+  var _streamEndProduced = false;
+
+  /// The queue of tokens yet to be emitted.
+  ///
+  /// These are queued up in advance so that [TokenType.KEY] tokens can be
+  /// inserted once the scanner determines that a series of tokens represents a
+  /// mapping key.
+  final _tokens = new QueueList<Token>();
+
+  /// The number of tokens that have been emitted.
+  ///
+  /// This doesn't count tokens in [tokens].
+  var _tokensParsed = 0;
+
+  /// Whether the next token in [_tokens] is ready to be returned.
+  ///
+  /// It might not be ready if there may still be a [TokenType.KEY] inserted
+  /// before it.
+  var _tokenAvailable = false;
+
+  /// The stack of indent levels for the current nested block contexts.
+  ///
+  /// The YAML spec specifies that the initial indentation level is -1 spaces.
+  final _indents = <int>[-1];
+
+  /// Whether a simple key is allowed in this context.
+  ///
+  /// A simple key refers to any mapping key that doesn't have an explicit "?".
+  var _simpleKeyAllowed = true;
+
+  /// The stack of potential simple keys for each level of flow nesting.
+  ///
+  /// Entries in this list may be `null`, indicating that there is no valid
+  /// simple key for the associated level of nesting.
+  /// 
+  /// When a ":" is parsed and there's a simple key available, a [TokenType.KEY]
+  /// token is inserted in [_tokens] before that key's token. This allows the
+  /// parser to tell that the key is intended to be a mapping key.
+  final _simpleKeys = <_SimpleKey>[null];
+
+  /// The current indentation level.
+  int get _indent => _indents.last;
+
+  /// Whether the scanner's currently positioned in a block-level structure (as
+  /// opposed to flow-level).
+  bool get _inBlockContext => _simpleKeys.length == 1;
+
+  /// Whether the current character is a line break or the end of the source.
+  bool get _isBreakOrEnd => _scanner.isDone || _isBreak;
+
+  /// Whether the current character is a line break.
+  bool get _isBreak => _isBreakAt(0);
+
+  /// Whether the current character is whitespace or the end of the source.
+  bool get _isBlankOrEnd => _isBlankOrEndAt(0);
+
+  /// Whether the current character is whitespace.
+  bool get _isBlank => _isBlankAt(0);
+
+  /// Whether the current character is a valid tag name character.
+  ///
+  /// See http://yaml.org/spec/1.2/spec.html#ns-tag-name.
+  bool get _isTagChar {
+    var char = _scanner.peekChar();
+    if (char == null) return false;
+    switch (char) {
+      case HYPHEN:
+      case SEMICOLON:
+      case SLASH:
+      case COLON:
+      case AT:
+      case AMPERSAND:
+      case EQUALS:
+      case PLUS:
+      case DOLLAR:
+      case PERIOD:
+      case TILDE:
+      case QUESTION:
+      case ASTERISK:
+      case SINGLE_QUOTE:
+      case LEFT_PAREN:
+      case RIGHT_PAREN:
+      case PERCENT:
+        return true;
+      default:
+        return (char >= NUMBER_0 && char <= NUMBER_9) ||
+               (char >= LETTER_A && char <= LETTER_Z) ||
+               (char >= LETTER_CAP_A && char <= LETTER_CAP_Z);
+    }
+  }
+
+  /// Whether the current character is a valid anchor name character.
+  ///
+  /// See http://yaml.org/spec/1.2/spec.html#ns-anchor-name.
+  bool get _isAnchorChar {
+    if (!_isNonSpace) return false;
+
+    switch (_scanner.peekChar()) {
+      case COMMA:
+      case LEFT_SQUARE:
+      case RIGHT_SQUARE:
+      case LEFT_CURLY:
+      case RIGHT_CURLY:
+        return false;
+      default:
+        return true;
+    }
+  }
+
+  /// Whether the character at the current position is a decimal digit.
+  bool get _isDigit {
+    var char = _scanner.peekChar();
+    return char != null && (char >= NUMBER_0 && char <= NUMBER_9);
+  }
+
+  /// Whether the character at the current position is a hexidecimal
+  /// digit.
+  bool get _isHex {
+    var char = _scanner.peekChar();
+    if (char == null) return false;
+    return (char >= NUMBER_0 && char <= NUMBER_9) ||
+           (char >= LETTER_A && char <= LETTER_F) ||
+           (char >= LETTER_CAP_A && char <= LETTER_CAP_F);
+  }
+
+  /// Whether the character at the current position is a plain character.
+  ///
+  /// See http://yaml.org/spec/1.2/spec.html#ns-plain-char(c).
+  bool get _isPlainChar => _isPlainCharAt(0);
+
+  /// Whether the character at the current position is a printable character
+  /// other than a line break or byte-order mark.
+  ///
+  /// See http://yaml.org/spec/1.2/spec.html#nb-char.
+  bool get _isNonBreak {
+    var char = _scanner.peekChar();
+    if (char == null) return false;
+    switch (char) {
+      case LF:
+      case CR:
+      case BOM:
+        return false;
+      case TAB:
+      case NEL:
+        return true;
+      default:
+        return (char >= 0x00020 && char <= 0x00007E) ||
+               (char >= 0x000A0 && char <= 0x00D7FF) ||
+               (char >= 0x0E000 && char <= 0x00FFFD) ||
+               (char >= 0x10000 && char <= 0x10FFFF);
+    }
+  }
+
+  /// Whether the character at the current position is a printable character
+  /// other than whitespace.
+  ///
+  /// See http://yaml.org/spec/1.2/spec.html#nb-char.
+  bool get _isNonSpace {
+    var char = _scanner.peekChar();
+    if (char == null) return false;
+    switch (char) {
+      case LF:
+      case CR:
+      case BOM:
+      case SP:
+        return false;
+      case NEL:
+        return true;
+      default:
+        return (char >= 0x00020 && char <= 0x00007E) ||
+               (char >= 0x000A0 && char <= 0x00D7FF) ||
+               (char >= 0x0E000 && char <= 0x00FFFD) ||
+               (char >= 0x10000 && char <= 0x10FFFF);
+    }
+  }
+
+  /// Returns Whether or not the current character begins a documentation
+  /// indicator.
+  ///
+  /// If so, this sets the scanner's last match to that indicator.
+  bool get _isDocumentIndicator {
+    return _scanner.column == 0 && _isBlankOrEndAt(3) &&
+        (_scanner.matches('---') || _scanner.matches('...'));
+  }
+
+  /// Creates a scanner that scans [source].
+  ///
+  /// [sourceUrl] can be a String or a [Uri].
+  Scanner(String source, {sourceUrl})
+      : _scanner = new SpanScanner(source, sourceUrl: sourceUrl);
+
+  /// Consumes and returns the next token.
+  Token scan() {
+    if (_streamEndProduced) throw new StateError("Out of tokens.");
+    if (!_tokenAvailable) _fetchMoreTokens();
+
+    var token = _tokens.removeFirst();
+    _tokenAvailable = false;
+    _tokensParsed++;
+    _streamEndProduced = token is Token &&
+        token.type == TokenType.STREAM_END;
+    return token;
+  }
+
+  /// Consumes the next token and returns the one after that.
+  Token advance() {
+    scan();
+    return peek();
+  }
+
+  /// Returns the next token without consuming it.
+  Token peek() {
+    if (_streamEndProduced) return null;
+    if (!_tokenAvailable) _fetchMoreTokens();
+    return _tokens.first;
+  }
+
+  /// Ensures that [_tokens] contains at least one token which can be returned.
+  void _fetchMoreTokens() {
+    while (true) {
+      if (_tokens.isNotEmpty) {
+        _staleSimpleKeys();
+
+        // If the current token could be a simple key, we need to scan more
+        // tokens until we determine whether it is or not. Otherwise we might
+        // not emit the `KEY` token before we emit the value of the key.
+        if (!_simpleKeys.any((key) =>
+            key != null && key.tokenNumber == _tokensParsed)) {
+          break;
+        }
+      }
+
+      _fetchNextToken();
+    }
+    _tokenAvailable = true;
+  }
+
+  /// The dispatcher for token fetchers.
+  void _fetchNextToken() {
+    if (!_streamStartProduced) {
+      _fetchStreamStart();
+      return;
+    }
+
+    _scanToNextToken();
+    _staleSimpleKeys();
+    _unrollIndent(_scanner.column);
+
+    if (_scanner.isDone) {
+      _fetchStreamEnd();
+      return;
+    }
+
+    if (_scanner.column == 0) {
+      if (_scanner.peekChar() == PERCENT) {
+        _fetchDirective();
+        return;
+      }
+
+      if (_isBlankOrEndAt(3)) {
+        if (_scanner.matches('---')) {
+          _fetchDocumentIndicator(TokenType.DOCUMENT_START);
+          return;
+        }
+
+        if (_scanner.matches('...')) {
+          _fetchDocumentIndicator(TokenType.DOCUMENT_END);
+          return;
+        }
+      }
+    }
+
+    switch (_scanner.peekChar()) {
+      case LEFT_SQUARE:
+        _fetchFlowCollectionStart(TokenType.FLOW_SEQUENCE_START);
+        return;
+      case LEFT_CURLY:
+        _fetchFlowCollectionStart(TokenType.FLOW_MAPPING_START);
+        return;
+      case RIGHT_SQUARE:
+        _fetchFlowCollectionEnd(TokenType.FLOW_SEQUENCE_END);
+        return;
+      case RIGHT_CURLY:
+        _fetchFlowCollectionEnd(TokenType.FLOW_MAPPING_END);
+        return;
+      case COMMA:
+        _fetchFlowEntry();
+        return;
+      case ASTERISK:
+        _fetchAnchor(anchor: false);
+        return;
+      case AMPERSAND:
+        _fetchAnchor(anchor: true);
+        return;
+      case EXCLAMATION:
+        _fetchTag();
+        return;
+      case SINGLE_QUOTE:
+        _fetchFlowScalar(singleQuote: true);
+        return;
+      case DOUBLE_QUOTE:
+        _fetchFlowScalar(singleQuote: false);
+        return;
+      case VERTICAL_BAR:
+        if (!_inBlockContext) _invalidScalarCharacter();
+        _fetchBlockScalar(literal: true);
+        return;
+      case RIGHT_ANGLE:
+        if (!_inBlockContext) _invalidScalarCharacter();
+        _fetchBlockScalar(literal: false);
+        return;
+      case PERCENT:
+      case AT:
+      case GRAVE_ACCENT:
+        _invalidScalarCharacter();
+        return;
+
+      // These characters may sometimes begin plain scalars.
+      case HYPHEN:
+        if (_isPlainCharAt(1)) {
+          _fetchPlainScalar();
+        } else {
+          _fetchBlockEntry();
+        }
+        return;
+      case QUESTION:
+        if (_isPlainCharAt(1)) {
+          _fetchPlainScalar();
+        } else {
+          _fetchKey();
+        }
+        return;
+      case COLON:
+        if (!_inBlockContext && _tokens.isNotEmpty) {
+          // If a colon follows a "JSON-like" value (an explicit map or list, or
+          // a quoted string) it isn't required to have whitespace after it
+          // since it unambiguously describes a map.
+          var token = _tokens.last;
+          if (token.type == TokenType.FLOW_SEQUENCE_END ||
+              token.type == TokenType.FLOW_MAPPING_END ||
+              (token.type == TokenType.SCALAR && token.style.isQuoted)) {
+            _fetchValue();
+            return;
+          }
+        }
+
+        if (_isPlainCharAt(1)) {
+          _fetchPlainScalar();
+        } else {
+          _fetchValue();
+        }
+        return;
+      default:
+        if (!_isNonBreak) _invalidScalarCharacter();
+
+        _fetchPlainScalar();
+        return;
+    }
+
+    throw 'Inaccessible';
+  }
+
+  /// Throws an error about a disallowed character.
+  void _invalidScalarCharacter() =>
+      _scanner.error("Unexpected character.", length: 1);
+
+  /// Checks the list of potential simple keys and remove the positions that
+  /// cannot contain simple keys anymore.
+  void _staleSimpleKeys() {
+    for (var i = 0; i < _simpleKeys.length; i++) {
+      var key = _simpleKeys[i];
+      if (key == null) continue;
+
+      // libyaml requires that all simple keys be a single line and no longer
+      // than 1024 characters. However, in section 7.4.2 of the spec
+      // (http://yaml.org/spec/1.2/spec.html#id2790832), these restrictions are
+      // only applied when the curly braces are omitted. It's difficult to
+      // retain enough context to know which keys need to have the restriction
+      // placed on them, so for now we go the other direction and allow
+      // everything but multiline simple keys in a block context.
+      if (!_inBlockContext) continue;
+
+      if (key.location.line == _scanner.line) continue;
+
+      if (key.required) {
+        throw new YamlException("Expected ':'.", _scanner.emptySpan);
+      }
+
+      _simpleKeys[i] = null;
+    }
+  }
+
+  /// Checks if a simple key may start at the current position and saves it if
+  /// so.
+  void _saveSimpleKey() {
+    // A simple key is required at the current position if the scanner is in the
+    // block context and the current column coincides with the indentation
+    // level.
+    var required = _inBlockContext && _indent == _scanner.column;
+
+    // A simple key is required only when it is the first token in the current
+    // line. Therefore it is always allowed. But we add a check anyway.
+    assert(_simpleKeyAllowed || !required);
+
+    if (!_simpleKeyAllowed) return;
+
+    // If the current position may start a simple key, save it.
+    _removeSimpleKey();
+    _simpleKeys[_simpleKeys.length - 1] = new _SimpleKey(
+        _tokensParsed + _tokens.length,
+        _scanner.location,
+        required: required);
+  }
+
+  /// Removes a potential simple key at the current flow level.
+  void _removeSimpleKey() {
+    var key = _simpleKeys.last;
+    if (key != null && key.required) {
+      throw new YamlException("Could not find expected ':' for simple key.",
+          key.location.pointSpan());
+    }
+
+    _simpleKeys[_simpleKeys.length - 1] = null;
+  }
+
+  /// Increases the flow level and resizes the simple key list.
+  void _increaseFlowLevel() {
+    _simpleKeys.add(null);
+  }
+
+  /// Decreases the flow level.
+  void _decreaseFlowLevel() {
+    if (_inBlockContext) return;
+    _simpleKeys.removeLast();
+  }
+
+  /// Pushes the current indentation level to the stack and sets the new level
+  /// if [column] is greater than [_indent].
+  ///
+  /// If it is, appends or inserts the specified token into [_tokens]. If
+  /// [tokenNumber] is provided, the corresponding token will be replaced;
+  /// otherwise, the token will be added at the end.
+  void _rollIndent(int column, TokenType type, SourceLocation location,
+      {int tokenNumber}) {
+    if (!_inBlockContext) return;
+    if (_indent != -1 && _indent >= column) return;
+
+    // Push the current indentation level to the stack and set the new
+    // indentation level.
+    _indents.add(column);
+
+    // Create a token and insert it into the queue.
+    var token = new Token(type, location.pointSpan());
+    if (tokenNumber == null) {
+      _tokens.add(token);
+    } else {
+      _tokens.insert(tokenNumber - _tokensParsed, token);
+    }
+  }
+
+  /// Pops indentation levels from [_indents] until the current level becomes
+  /// less than or equal to [column].
+  ///
+  /// For each indentation level, appends a [TokenType.BLOCK_END] token.
+  void _unrollIndent(int column) {
+    if (!_inBlockContext) return;
+
+    while (_indent > column) {
+      _tokens.add(new Token(TokenType.BLOCK_END, _scanner.emptySpan));
+      _indents.removeLast();
+    }
+  }
+
+  /// Pops indentation levels from [_indents] until the current level resets to
+  /// -1.
+  ///
+  /// For each indentation level, appends a [TokenType.BLOCK_END] token.
+  void _resetIndent() => _unrollIndent(-1);
+
+  /// Produces a [TokenType.STREAM_START] token.
+  void _fetchStreamStart() {
+    // Much of libyaml's initialization logic here is done in variable
+    // initializers instead.
+    _streamStartProduced = true;
+    _tokens.add(new Token(TokenType.STREAM_START, _scanner.emptySpan));
+  }
+
+  /// Produces a [TokenType.STREAM_END] token.
+  void _fetchStreamEnd() {
+    _resetIndent();
+    _removeSimpleKey();
+    _simpleKeyAllowed = false;
+    _tokens.add(new Token(TokenType.STREAM_END, _scanner.emptySpan));
+  }
+
+  /// Produces a [TokenType.VERSION_DIRECTIVE] or [TokenType.TAG_DIRECTIVE]
+  /// token.
+  void _fetchDirective() {
+    _resetIndent();
+    _removeSimpleKey();
+    _simpleKeyAllowed = false;
+    var directive = _scanDirective();
+    if (directive != null) _tokens.add(directive);
+  }
+
+  /// Produces a [TokenType.DOCUMENT_START] or [TokenType.DOCUMENT_END] token.
+  void _fetchDocumentIndicator(TokenType type) {
+    _resetIndent();
+    _removeSimpleKey();
+    _simpleKeyAllowed = false;
+
+    // Consume the indicator token.
+    var start = _scanner.state;
+    _scanner.readChar();
+    _scanner.readChar();
+    _scanner.readChar();
+
+    _tokens.add(new Token(type, _scanner.spanFrom(start)));
+  }
+
+  /// Produces a [TokenType.FLOW_SEQUENCE_START] or
+  /// [TokenType.FLOW_MAPPING_START] token.
+  void _fetchFlowCollectionStart(TokenType type) {
+    _saveSimpleKey();
+    _increaseFlowLevel();
+    _simpleKeyAllowed = true;
+    _addCharToken(type);
+  }
+
+  /// Produces a [TokenType.FLOW_SEQUENCE_END] or [TokenType.FLOW_MAPPING_END]
+  /// token.
+  void _fetchFlowCollectionEnd(TokenType type) {
+    _removeSimpleKey();
+    _decreaseFlowLevel();
+    _simpleKeyAllowed = false;
+    _addCharToken(type);
+  }
+
+  /// Produces a [TokenType.FLOW_ENTRY] token.
+  void _fetchFlowEntry() {
+    _removeSimpleKey();
+    _simpleKeyAllowed = true;
+    _addCharToken(TokenType.FLOW_ENTRY);
+  }
+
+  /// Produces a [TokenType.BLOCK_ENTRY] token.
+  void _fetchBlockEntry() {
+    if (_inBlockContext) {
+      if (!_simpleKeyAllowed) {
+        throw new YamlException(
+            "Block sequence entries are not allowed in this context.",
+            _scanner.emptySpan);
+      }
+
+      _rollIndent(
+          _scanner.column,
+          TokenType.BLOCK_SEQUENCE_START,
+          _scanner.emptySpan.start);
+    } else {
+      // It is an error for the '-' indicator to occur in the flow context, but
+      // we let the Parser detect and report it because it's able to point to
+      // the context.
+    }
+
+    _removeSimpleKey();
+    _simpleKeyAllowed = true;
+    _addCharToken(TokenType.BLOCK_ENTRY);
+  }
+
+  /// Produces the [TokenType.KEY] token.
+  void _fetchKey() {
+    if (_inBlockContext) {
+      if (!_simpleKeyAllowed) {
+        throw new YamlException("Mapping keys are not allowed in this context.",
+            _scanner.emptySpan);
+      }
+
+      _rollIndent(
+          _scanner.column,
+          TokenType.BLOCK_MAPPING_START,
+          _scanner.emptySpan.start);
+    }
+
+    // Simple keys are allowed after `?` in a block context.
+    _simpleKeyAllowed = _inBlockContext;
+    _addCharToken(TokenType.KEY);
+  }
+
+  /// Produces the [TokenType.VALUE] token.
+  void _fetchValue() {
+    var simpleKey = _simpleKeys.last;
+    if (simpleKey != null) {
+      // Add a [TokenType.KEY] directive before the first token of the simple
+      // key so the parser knows that it's part of a key/value pair.
+      _tokens.insert(simpleKey.tokenNumber - _tokensParsed,
+          new Token(TokenType.KEY, simpleKey.location.pointSpan()));
+
+      // In the block context, we may need to add the
+      // [TokenType.BLOCK_MAPPING_START] token.
+      _rollIndent(
+          simpleKey.location.column,
+          TokenType.BLOCK_MAPPING_START,
+          simpleKey.location,
+          tokenNumber: simpleKey.tokenNumber);
+
+      // Remove the simple key.
+      _simpleKeys[_simpleKeys.length - 1] = null;
+
+      // A simple key cannot follow another simple key.
+      _simpleKeyAllowed = false;
+    } else if (_inBlockContext) {
+      // If we're here, we've found the ':' indicator following a complex key.
+
+      if (!_simpleKeyAllowed) {
+        throw new YamlException(
+            "Mapping values are not allowed in this context.",
+            _scanner.emptySpan);
+      }
+
+      _rollIndent(
+          _scanner.column,
+          TokenType.BLOCK_MAPPING_START,
+          _scanner.location);
+      _simpleKeyAllowed = true;
+    } else if (_simpleKeyAllowed) {
+      // If we're here, we've found the ':' indicator with an empty key. This
+      // behavior differs from libyaml, which disallows empty implicit keys.
+      _simpleKeyAllowed = false;
+      _addCharToken(TokenType.KEY);
+    }
+
+    _addCharToken(TokenType.VALUE);
+  }
+
+  /// Adds a token with [type] to [_tokens].
+  ///
+  /// The span of the new token is the current character.
+  void _addCharToken(TokenType type) {
+    var start = _scanner.state;
+    _scanner.readChar();
+    _tokens.add(new Token(type, _scanner.spanFrom(start)));
+  }
+
+  /// Produces a [TokenType.ALIAS] or [TokenType.ANCHOR] token.
+  void _fetchAnchor({bool anchor: true}) {
+    _saveSimpleKey();
+    _simpleKeyAllowed = false;
+    _tokens.add(_scanAnchor(anchor: anchor));
+  }
+
+  /// Produces a [TokenType.TAG] token.
+  void _fetchTag() {
+    _saveSimpleKey();
+    _simpleKeyAllowed = false;
+    _tokens.add(_scanTag());
+  }
+
+  /// Produces a [TokenType.SCALAR] token with style [ScalarStyle.LITERAL] or
+  /// [ScalarStyle.FOLDED].
+  void _fetchBlockScalar({bool literal: false}) {
+    _removeSimpleKey();
+    _simpleKeyAllowed = true;
+    _tokens.add(_scanBlockScalar(literal: literal));
+  }
+
+  /// Produces a [TokenType.SCALAR] token with style [ScalarStyle.SINGLE_QUOTED]
+  /// or [ScalarStyle.DOUBLE_QUOTED].
+  void _fetchFlowScalar({bool singleQuote: false}) {
+    _saveSimpleKey();
+    _simpleKeyAllowed = false;
+    _tokens.add(_scanFlowScalar(singleQuote: singleQuote));
+  }
+
+  /// Produces a [TokenType.SCALAR] token with style [ScalarStyle.PLAIN].
+  void _fetchPlainScalar() {
+    _saveSimpleKey();
+    _simpleKeyAllowed = false;
+    _tokens.add(_scanPlainScalar());
+  }
+
+  /// Eats whitespace and comments until the next token is found.
+  void _scanToNextToken() {
+    var afterLineBreak = false;
+    while (true) {
+      // Allow the BOM to start a line.
+      if (_scanner.column == 0) _scanner.scan("\uFEFF");
+
+      // Eat whitespace.
+      //
+      // libyaml disallows tabs after "-", "?", or ":", but the spec allows
+      // them. See section 6.2: http://yaml.org/spec/1.2/spec.html#id2778241.
+      while (_scanner.peekChar() == SP ||
+             ((!_inBlockContext || !afterLineBreak) &&
+              _scanner.peekChar() == TAB)) {
+        _scanner.readChar();
+      }
+
+      if (_scanner.peekChar() == TAB) {
+        _scanner.error("Tab characters are not allowed as indentation.",
+            length: 1);
+      }
+
+      // Eat a comment until a line break.
+      _skipComment();
+
+      // If we're at a line break, eat it.
+      if (_isBreak) {
+        _skipLine();
+
+        // In the block context, a new line may start a simple key.
+        if (_inBlockContext) _simpleKeyAllowed = true;
+        afterLineBreak = true;
+      } else {
+        // Otherwise we've found a token.
+        break;
+      }
+    }
+  }
+
+  /// Scans a [TokenType.YAML_DIRECTIVE] or [TokenType.TAG_DIRECTIVE] token.
+  ///
+  ///     %YAML    1.2    # a comment \n
+  ///     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+  ///     %TAG    !yaml!  tag:yaml.org,2002:  \n
+  ///     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
+  Token _scanDirective() {
+    var start = _scanner.state;
+
+    // Eat '%'.
+    _scanner.readChar();
+
+    var token;
+    var name = _scanDirectiveName();
+    if (name == "YAML") {
+      token = _scanVersionDirectiveValue(start);
+    } else if (name == "TAG") {
+      token = _scanTagDirectiveValue(start);
+    } else {
+      warn("Warning: unknown directive.", _scanner.spanFrom(start));
+
+      // libyaml doesn't support unknown directives, but the spec says to ignore
+      // them and warn: http://yaml.org/spec/1.2/spec.html#id2781147.
+      while (!_isBreakOrEnd) {
+        _scanner.readChar();
+      }
+
+      return null;
+    }
+
+    // Eat the rest of the line, including any comments.
+    _skipBlanks();
+    _skipComment();
+
+    if (!_isBreakOrEnd) {
+      throw new YamlException(
+          "Expected comment or line break after directive.",
+          _scanner.spanFrom(start));
+    }
+
+    _skipLine();
+    return token;
+  }
+
+  /// Scans a directive name.
+  ///
+  ///      %YAML   1.2     # a comment \n
+  ///       ^^^^
+  ///      %TAG    !yaml!  tag:yaml.org,2002:  \n
+  ///       ^^^
+  String _scanDirectiveName() {
+    // libyaml only allows word characters in directive names, but the spec
+    // disagrees: http://yaml.org/spec/1.2/spec.html#ns-directive-name.
+    var start = _scanner.position;
+    while (_isNonSpace) {
+      _scanner.readChar();
+    }
+
+    var name = _scanner.substring(start);
+    if (name.isEmpty) {
+      throw new YamlException("Expected directive name.", _scanner.emptySpan);
+    } else if (!_isBlankOrEnd) {
+      throw new YamlException(
+          "Unexpected character in directive name.", _scanner.emptySpan);
+    }
+
+    return name;
+  }
+
+  /// Scans the value of a version directive.
+  ///
+  ///      %YAML   1.2     # a comment \n
+  ///           ^^^^^^
+  Token _scanVersionDirectiveValue(LineScannerState start) {
+    _skipBlanks();
+
+    var major = _scanVersionDirectiveNumber();
+    _scanner.expect('.');
+    var minor = _scanVersionDirectiveNumber();
+
+    return new VersionDirectiveToken(_scanner.spanFrom(start), major, minor);
+  }
+
+  /// Scans the version number of a version directive.
+  ///
+  ///      %YAML   1.2     # a comment \n
+  ///              ^
+  ///      %YAML   1.2     # a comment \n
+  ///                ^
+  int _scanVersionDirectiveNumber() {
+    var start = _scanner.position;
+    while (_isDigit) {
+      _scanner.readChar();
+    }
+
+    var number = _scanner.substring(start);
+    if (number.isEmpty) {
+      throw new YamlException("Expected version number.", _scanner.emptySpan);
+    }
+
+    return int.parse(number);
+  }
+
+  /// Scans the value of a tag directive.
+  ///
+  ///      %TAG    !yaml!  tag:yaml.org,2002:  \n
+  ///          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+  Token _scanTagDirectiveValue(LineScannerState start) {
+    _skipBlanks();
+
+    var handle = _scanTagHandle(directive: true);
+    if (!_isBlank) {
+      throw new YamlException("Expected whitespace.", _scanner.emptySpan);
+    }
+
+    _skipBlanks();
+
+    var prefix = _scanTagUri();
+    if (!_isBlankOrEnd) {
+      throw new YamlException("Expected whitespace.", _scanner.emptySpan);
+    }
+
+    return new TagDirectiveToken(_scanner.spanFrom(start), handle, prefix);
+  }
+
+  /// Scans a [TokenType.ANCHOR] token.
+  Token _scanAnchor({bool anchor: true}) {
+    var start = _scanner.state;
+
+    // Eat the indicator character.
+    _scanner.readChar();
+
+    // libyaml only allows word characters in anchor names, but the spec
+    // disagrees: http://yaml.org/spec/1.2/spec.html#ns-anchor-char.
+    var startPosition = _scanner.position;
+    while (_isAnchorChar) {
+      _scanner.readChar();
+    }
+    var name = _scanner.substring(startPosition);
+
+    var next = _scanner.peekChar();
+    if (name.isEmpty ||
+        (!_isBlankOrEnd  && next != QUESTION     && next != COLON &&
+         next != COMMA   && next != RIGHT_SQUARE && next != RIGHT_CURLY &&
+         next != PERCENT && next != AT           && next != GRAVE_ACCENT)) {
+      throw new YamlException("Expected alphanumeric character.",
+          _scanner.emptySpan);
+    }
+
+    if (anchor) {
+      return new AnchorToken(_scanner.spanFrom(start), name);
+    } else {
+      return new AliasToken(_scanner.spanFrom(start), name);
+    }
+  }
+
+  /// Scans a [TokenType.TAG] token.
+  Token _scanTag() {
+    var handle;
+    var suffix;
+    var start = _scanner.state;
+
+    // Check if the tag is in the canonical form.
+    if (_scanner.peekChar(1) == LEFT_ANGLE) {
+      // Eat '!<'.
+      _scanner.readChar();
+      _scanner.readChar();
+
+      handle = '';
+      suffix = _scanTagUri();
+
+      _scanner.expect('>');
+    } else {
+      // The tag has either the '!suffix' or the '!handle!suffix' form.
+
+      // First, try to scan a handle.
+      handle = _scanTagHandle();
+
+      if (handle.length > 1 && handle.startsWith('!') && handle.endsWith('!')) {
+        suffix = _scanTagUri(flowSeparators: false);
+      } else {
+        suffix = _scanTagUri(head: handle, flowSeparators: false);
+
+        // There was no explicit handle.
+        if (suffix.isEmpty) {
+          // This is the special '!' tag.
+          handle = null;
+          suffix = '!';
+        } else {
+          handle = '!';
+        }
+      }
+    }
+
+    // libyaml insists on whitespace after a tag, but example 7.2 indicates
+    // that it's not required: http://yaml.org/spec/1.2/spec.html#id2786720.
+
+    return new TagToken(_scanner.spanFrom(start), handle, suffix);
+  }
+
+  /// Scans a tag handle.
+  String _scanTagHandle({bool directive: false}) {
+    _scanner.expect('!');
+
+    var buffer = new StringBuffer('!');
+
+    // libyaml only allows word characters in tags, but the spec disagrees:
+    // http://yaml.org/spec/1.2/spec.html#ns-tag-char.
+    var start = _scanner.position;
+    while (_isTagChar) {
+      _scanner.readChar();
+    }
+    buffer.write(_scanner.substring(start));
+
+    if (_scanner.peekChar() == EXCLAMATION) {
+      buffer.writeCharCode(_scanner.readChar());
+    } else {
+      // It's either the '!' tag or not really a tag handle. If it's a %TAG
+      // directive, it's an error. If it's a tag token, it must be part of a
+      // URI.
+      if (directive && buffer.toString() != '!') _scanner.expect('!');
+    }
+
+    return buffer.toString();
+  }
+
+  /// Scans a tag URI.
+  ///
+  /// [head] is the initial portion of the tag that's already been scanned.
+  /// [flowSeparators] indicates whether the tag URI can contain flow
+  /// separators.
+  String _scanTagUri({String head, bool flowSeparators: true}) {
+    var length = head == null ? 0 : head.length;
+    var buffer = new StringBuffer();
+
+    // Copy the head if needed.
+    //
+    // Note that we don't copy the leading '!' character.
+    if (length > 1) buffer.write(head.substring(1));
+
+    // The set of characters that may appear in URI is as follows:
+    //
+    //      '0'-'9', 'A'-'Z', 'a'-'z', '_', '-', ';', '/', '?', ':', '@', '&',
+    //      '=', '+', '$', ',', '.', '!', '~', '*', '\'', '(', ')', '[', ']',
+    //      '%'.
+    //
+    // In a shorthand tag annotation, the flow separators ',', '[', and ']' are
+    // disallowed.
+    var start = _scanner.position;
+    var char = _scanner.peekChar();
+    while (_isTagChar || (flowSeparators &&
+            (char == COMMA || char == LEFT_SQUARE || char == RIGHT_SQUARE))) {
+      _scanner.readChar();
+      char = _scanner.peekChar();
+    }
+
+    // libyaml manually decodes the URL, but we don't have to do that.
+    return Uri.decodeFull(_scanner.substring(start));
+  }
+
+  /// Scans a block scalar.
+  Token _scanBlockScalar({bool literal: false}) {
+    var start = _scanner.state;
+
+    // Eat the indicator '|' or '>'.
+    _scanner.readChar();
+
+    // Check for a chomping indicator.
+    var chomping = _Chomping.CLIP;
+    var increment = 0;
+    var char = _scanner.peekChar();
+    if (char == PLUS || char == HYPHEN) {
+      chomping = char == PLUS ? _Chomping.KEEP : _Chomping.STRIP;
+      _scanner.readChar();
+
+      // Check for an indentation indicator.
+      if (_isDigit) {
+        // Check that the indentation is greater than 0.
+        if (_scanner.peekChar() == NUMBER_0) {
+          throw new YamlException(
+              "0 may not be used as an indentation indicator.",
+              _scanner.spanFrom(start));
+        }
+
+        increment = _scanner.readChar() - NUMBER_0;
+      }
+    } else if (_isDigit) {
+      // Do the same as above, but in the opposite order.
+      if (_scanner.peekChar() == NUMBER_0) {
+        throw new YamlException(
+            "0 may not be used as an indentation indicator.",
+            _scanner.spanFrom(start));
+      }
+
+      increment = _scanner.readChar() - NUMBER_0;
+
+      char = _scanner.peekChar();
+      if (char == PLUS || char == HYPHEN) {
+        chomping = char == PLUS ? _Chomping.KEEP : _Chomping.STRIP;
+        _scanner.readChar();
+      }
+    }
+
+    // Eat whitespace and comments to the end of the line.
+    _skipBlanks();
+    _skipComment();
+
+    // Check if we're at the end of the line.
+    if (!_isBreakOrEnd) {
+      throw new YamlException("Expected comment or line break.",
+          _scanner.emptySpan);
+    }
+
+    _skipLine();
+
+    // If the block scalar has an explicit indentation indicator, add that to
+    // the current indentation to get the indentation level for the scalar's
+    // contents.
+    var indent = 0;
+    if (increment != 0) {
+      indent = _indent >= 0 ? _indent + increment : increment;
+    }
+
+    // Scan the leading line breaks to determine the indentation level if
+    // needed.
+    var pair = _scanBlockScalarBreaks(indent);
+    indent = pair.first;
+    var trailingBreaks = pair.last;
+
+    // Scan the block scalar contents.
+    var buffer = new StringBuffer();
+    var leadingBreak = '';
+    var leadingBlank = false;
+    var trailingBlank = false;
+    while (_scanner.column == indent && !_scanner.isDone) {
+      // Check for a document indicator. libyaml doesn't do this, but the spec
+      // mandates it. See example 9.5:
+      // http://yaml.org/spec/1.2/spec.html#id2801606.
+      if (_isDocumentIndicator) break;
+
+      // We are at the beginning of a non-empty line.
+
+      // Is there trailing whitespace?
+      trailingBlank = _isBlank;
+
+      // Check if we need to fold the leading line break.
+      if (!literal && leadingBreak.isNotEmpty && !leadingBlank &&
+          !trailingBlank) {
+        // Do we need to join the lines with a space?
+        if (trailingBreaks.isEmpty) buffer.writeCharCode(SP);
+      } else {
+        buffer.write(leadingBreak);
+      }
+      leadingBreak = '';
+
+      // Append the remaining line breaks.
+      buffer.write(trailingBreaks);
+
+      // Is there leading whitespace?
+      leadingBlank = _isBlank;
+
+      var startPosition = _scanner.position;
+      while (!_isBreakOrEnd) {
+        _scanner.readChar();
+      }
+      buffer.write(_scanner.substring(startPosition));
+
+      // libyaml always reads a line here, but this breaks on block scalars at
+      // the end of the document that end without newlines. See example 8.1:
+      // http://yaml.org/spec/1.2/spec.html#id2793888.
+      if (!_scanner.isDone) leadingBreak = _readLine();
+
+      // Eat the following indentation and spaces.
+      var pair = _scanBlockScalarBreaks(indent);
+      indent = pair.first;
+      trailingBreaks = pair.last;
+    }
+
+    // Chomp the tail.
+    if (chomping != _Chomping.STRIP) buffer.write(leadingBreak);
+    if (chomping == _Chomping.KEEP) buffer.write(trailingBreaks);
+
+    return new ScalarToken(_scanner.spanFrom(start), buffer.toString(),
+        literal ? ScalarStyle.LITERAL : ScalarStyle.FOLDED);
+  }
+
+  /// Scans indentation spaces and line breaks for a block scalar.
+  ///
+  /// Determines the intendation level if needed. Returns the new indentation
+  /// level and the text of the line breaks.
+  Pair<int, String> _scanBlockScalarBreaks(int indent) {
+    var maxIndent = 0;
+    var breaks = new StringBuffer();
+
+    while (true) {
+      while ((indent == 0 || _scanner.column < indent) &&
+          _scanner.peekChar() == SP) {
+        _scanner.readChar();
+      }
+
+      if (_scanner.column > maxIndent) maxIndent = _scanner.column;
+
+      // libyaml throws an error here if a tab character is detected, but the
+      // spec treats tabs like any other non-space character. See example 8.2:
+      // http://yaml.org/spec/1.2/spec.html#id2794311.
+
+      if (!_isBreak) break;
+      breaks.write(_readLine());
+    }
+
+    if (indent == 0) {
+      indent = maxIndent;
+      if (indent < _indent + 1) indent = _indent + 1;
+
+      // libyaml forces indent to be at least 1 here, but that doesn't seem to
+      // be supported by the spec.
+    }
+
+    return new Pair(indent, breaks.toString());
+  }
+
+  // Scans a quoted scalar.
+  Token _scanFlowScalar({bool singleQuote: false}) {
+    var start = _scanner.state;
+    var buffer = new StringBuffer();
+
+    // Eat the left quote.
+    _scanner.readChar();
+
+    while (true) {
+      // Check that there are no document indicators at the beginning of the
+      // line.
+      if (_isDocumentIndicator) {
+        _scanner.error("Unexpected document indicator.");
+      }
+
+      if (_scanner.isDone) {
+        throw new YamlException("Unexpected end of file.", _scanner.emptySpan);
+      }
+
+      var leadingBlanks = false;
+      while (!_isBlankOrEnd) {
+        var char = _scanner.peekChar();
+        if (singleQuote && char == SINGLE_QUOTE &&
+            _scanner.peekChar(1) == SINGLE_QUOTE) {
+          // An escaped single quote.
+          _scanner.readChar();
+          _scanner.readChar();
+          buffer.writeCharCode(SINGLE_QUOTE);
+        } else if (char == (singleQuote ? SINGLE_QUOTE : DOUBLE_QUOTE)) {
+          // The closing quote.
+          break;
+        } else if (!singleQuote && char == BACKSLASH && _isBreakAt(1)) {
+          // An escaped newline.
+          _scanner.readChar();
+          _skipLine();
+          leadingBlanks = true;
+          break;
+        } else if (!singleQuote && char == BACKSLASH) {
+          var escapeStart = _scanner.state;
+
+          // An escape sequence.
+          var codeLength = null;
+          switch (_scanner.peekChar(1)) {
+            case NUMBER_0:
+              buffer.writeCharCode(NULL);
+              break;
+            case LETTER_A:
+              buffer.writeCharCode(BELL);
+              break;
+            case LETTER_B:
+              buffer.writeCharCode(BACKSPACE);
+              break;
+            case LETTER_T:
+            case TAB:
+              buffer.writeCharCode(TAB);
+              break;
+            case LETTER_N:
+              buffer.writeCharCode(LF);
+              break;
+            case LETTER_V:
+              buffer.writeCharCode(VERTICAL_TAB);
+              break;
+            case LETTER_F:
+              buffer.writeCharCode(FORM_FEED);
+              break;
+            case LETTER_R:
+              buffer.writeCharCode(CR);
+              break;
+            case LETTER_E:
+              buffer.writeCharCode(ESCAPE);
+              break;
+            case SP:
+            case DOUBLE_QUOTE:
+            case SLASH:
+            case BACKSLASH:
+              // libyaml doesn't support an escaped forward slash, but it was
+              // added in YAML 1.2. See section 5.7:
+              // http://yaml.org/spec/1.2/spec.html#id2776092
+              buffer.writeCharCode(_scanner.peekChar(1));
+              break;
+            case LETTER_CAP_N:
+              buffer.writeCharCode(NEL);
+              break;
+            case UNDERSCORE:
+              buffer.writeCharCode(NBSP);
+              break;
+            case LETTER_CAP_L:
+              buffer.writeCharCode(LINE_SEPARATOR);
+              break;
+            case LETTER_CAP_P:
+              buffer.writeCharCode(PARAGRAPH_SEPARATOR);
+              break;
+            case LETTER_X:
+              codeLength = 2;
+              break;
+            case LETTER_U:
+              codeLength = 4;
+              break;
+            case LETTER_CAP_U:
+              codeLength = 8;
+              break;
+            default:
+              throw new YamlException("Unknown escape character.",
+                  _scanner.spanFrom(escapeStart));
+          }
+
+          _scanner.readChar();
+          _scanner.readChar();
+
+          if (codeLength != null) {
+            var value = 0;
+            for (var i = 0; i < codeLength; i++) {
+              if (!_isHex) {
+                _scanner.readChar();
+                throw new YamlException(
+                    "Expected $codeLength-digit hexidecimal number.",
+                    _scanner.spanFrom(escapeStart));
+              }
+
+              value = (value << 4) + _asHex(_scanner.readChar());
+            }
+
+            // Check the value and write the character.
+            if ((value >= 0xD800 && value <= 0xDFFF) || value > 0x10FFFF) {
+              throw new YamlException(
+                  "Invalid Unicode character escape code.",
+                  _scanner.spanFrom(escapeStart));
+            }
+
+            buffer.writeCharCode(value);
+          }
+        } else {
+          buffer.writeCharCode(_scanner.readChar());
+        }
+      }
+
+      // Check if we're at the end of a scalar.
+      if (_scanner.peekChar() == (singleQuote ? SINGLE_QUOTE : DOUBLE_QUOTE)) {
+        break;
+      }
+
+      var whitespace = new StringBuffer();
+      var leadingBreak = '';
+      var trailingBreaks = new StringBuffer();
+      while (_isBlank || _isBreak) {
+        if (_isBlank) {
+          // Consume a space or a tab.
+          if (!leadingBlanks) {
+            whitespace.writeCharCode(_scanner.readChar());
+          } else {
+            _scanner.readChar();
+          }
+        } else {
+          // Check if it's a first line break.
+          if (!leadingBlanks) {
+            whitespace.clear();
+            leadingBreak = _readLine();
+            leadingBlanks = true;
+          } else {
+            trailingBreaks.write(_readLine());
+          }
+        }
+      }
+
+      // Join the whitespace or fold line breaks.
+      if (leadingBlanks) {
+        if (leadingBreak.isNotEmpty && trailingBreaks.isEmpty) {
+          buffer.writeCharCode(SP);
+        } else {
+          buffer.write(trailingBreaks);
+        }
+      } else {
+        buffer.write(whitespace);
+        whitespace.clear();
+      }
+    }
+
+    // Eat the right quote.
+    _scanner.readChar();
+
+    return new ScalarToken(_scanner.spanFrom(start), buffer.toString(),
+        singleQuote ? ScalarStyle.SINGLE_QUOTED : ScalarStyle.DOUBLE_QUOTED);
+  }
+
+  /// Scans a plain scalar.
+  Token _scanPlainScalar() {
+    var start = _scanner.state;
+    var buffer = new StringBuffer();
+    var leadingBreak = '';
+    var trailingBreaks = '';
+    var whitespace = new StringBuffer();
+    var indent = _indent + 1;
+
+    while (true) {
+      // Check for a document indicator.
+      if (_isDocumentIndicator) break;
+
+      // Check for a comment.
+      if (_scanner.peekChar() == HASH) break;
+
+      if (_isPlainChar) {
+        // Join the whitespace or fold line breaks.
+        if (leadingBreak.isNotEmpty) {
+          if (trailingBreaks.isEmpty) {
+            buffer.writeCharCode(SP);
+          } else {
+            buffer.write(trailingBreaks);
+          }
+          leadingBreak = '';
+          trailingBreaks = '';
+        } else {
+          buffer.write(whitespace);
+          whitespace.clear();
+        }
+      }
+
+      // libyaml's notion of valid identifiers differs substantially from YAML
+      // 1.2's. We use [_isPlainChar] instead of libyaml's character here.
+      var startPosition = _scanner.position;
+      while (_isPlainChar) {
+        _scanner.readChar();
+      }
+      buffer.write(_scanner.substring(startPosition));
+
+      // Is it the end?
+      if (!_isBlank && !_isBreak) break;
+
+      while (_isBlank || _isBreak) {
+        if (_isBlank) {
+          // Check for a tab character messing up the intendation.
+          if (leadingBreak.isNotEmpty && _scanner.column < indent &&
+              _scanner.peekChar() == TAB) {
+            _scanner.error("Expected a space but found a tab.", length: 1);
+          }
+
+          if (leadingBreak.isEmpty) {
+            whitespace.writeCharCode(_scanner.readChar());
+          } else {
+            _scanner.readChar();
+          }
+        } else {
+          // Check if it's a first line break.
+          if (leadingBreak.isEmpty) {
+            leadingBreak = _readLine();
+            whitespace.clear();
+          } else {
+            trailingBreaks = _readLine();
+          }
+        }
+      }
+
+      // Check the indentation level.
+      if (_inBlockContext && _scanner.column < indent) break;
+    }
+
+    // Allow a simple key after a plain scalar with leading blanks.
+    if (leadingBreak.isNotEmpty) _simpleKeyAllowed = true;
+
+    return new ScalarToken(_scanner.spanFrom(start), buffer.toString(),
+        ScalarStyle.PLAIN);
+  }
+
+  /// Moves past the current line break, if there is one.
+  void _skipLine() {
+    var char = _scanner.peekChar();
+    if (char != CR && char != LF) return;
+    _scanner.readChar();
+    if (char == CR && _scanner.peekChar() == LF) _scanner.readChar();
+  }
+
+  // Moves past the current line break and returns a newline.
+  String _readLine() {
+    var char = _scanner.peekChar();
+
+    // libyaml supports NEL, PS, and LS characters as line separators, but this
+    // is explicitly forbidden in section 5.4 of the YAML spec.
+    if (char != CR && char != LF) {
+      throw new YamlException("Expected newline.", _scanner.emptySpan);
+    }
+
+    _scanner.readChar();
+    // CR LF | CR | LF -> LF
+    if (char == CR && _scanner.peekChar() == LF) _scanner.readChar();
+    return "\n";
+  }
+
+  // Returns whether the character at [offset] is whitespace.
+  bool _isBlankAt(int offset) {
+    var char = _scanner.peekChar(offset);
+    return char == SP || char == TAB;
+  }
+
+  // Returns whether the character at [offset] is a line break.
+  bool _isBreakAt(int offset) {
+    // Libyaml considers NEL, LS, and PS to be line breaks as well, but that's
+    // contrary to the spec.
+    var char = _scanner.peekChar(offset);
+    return char == CR || char == LF;
+  }
+
+  // Returns whether the character at [offset] is whitespace or past the end of
+  // the source.
+  bool _isBlankOrEndAt(int offset) {
+    var char = _scanner.peekChar(offset);
+    return char == null || char == SP || char == TAB || char == CR ||
+        char == LF;
+  }
+
+  /// Returns whether the character at [offset] is a plain character.
+  ///
+  /// See http://yaml.org/spec/1.2/spec.html#ns-plain-char(c).
+  bool _isPlainCharAt(int offset) {
+    switch (_scanner.peekChar(offset)) {
+      case COLON:
+        return _isPlainSafeAt(offset + 1);
+      case HASH:
+        var previous = _scanner.peekChar(offset - 1);
+        return previous != SP && previous != TAB;
+      default:
+        return _isPlainSafeAt(offset);
+    }
+  }
+
+  /// Returns whether the character at [offset] is a plain-safe character.
+  ///
+  /// See http://yaml.org/spec/1.2/spec.html#ns-plain-safe(c).
+  bool _isPlainSafeAt(int offset) {
+    var char = _scanner.peekChar(offset);
+    switch (char) {
+      case COMMA:
+      case LEFT_SQUARE:
+      case RIGHT_SQUARE:
+      case LEFT_CURLY:
+      case RIGHT_CURLY:
+        // These characters are delimiters in a flow context and thus are only
+        // safe in a block context.
+        return _inBlockContext;
+      case SP:
+      case TAB:
+      case LF:
+      case CR:
+      case BOM:
+        return false;
+      case NEL:
+        return true;
+      default:
+        return char != null &&
+          ((char >= 0x00020 && char <= 0x00007E) ||
+           (char >= 0x000A0 && char <= 0x00D7FF) ||
+           (char >= 0x0E000 && char <= 0x00FFFD) ||
+           (char >= 0x10000 && char <= 0x10FFFF));
+    }
+  }
+
+  /// Returns the hexidecimal value of [char].
+  int _asHex(int char) {
+    if (char <= NUMBER_9) return char - NUMBER_0;
+    if (char <= LETTER_CAP_F) return 10 + char - LETTER_CAP_A;
+    return 10 + char - LETTER_A;
+  }
+
+  /// Moves the scanner past any blank characters.
+  void _skipBlanks() {
+    while (_isBlank) {
+      _scanner.readChar();
+    }
+  }
+
+  /// Moves the scanner past a comment, if one starts at the current position.
+  void _skipComment() {
+    if (_scanner.peekChar() != HASH) return;
+    while (!_isBreakOrEnd) {
+      _scanner.readChar();
+    }
+  }
+}
+
+/// A record of the location of a potential simple key.
+class _SimpleKey {
+  /// The index of the token that begins the simple key.
+  ///
+  /// This is the index relative to all tokens emitted, rather than relative to
+  /// [_tokens].
+  final int tokenNumber;
+
+  /// The source location of the beginning of the simple key.
+  ///
+  /// This is used for error reporting and for determining when a simple key is
+  /// no longer on the current line.
+  final SourceLocation location;
+
+  /// Whether this key must exist for the document to be scanned.
+  final bool required;
+
+  _SimpleKey(this.tokenNumber, this.location, {bool required})
+      : required = required;
+}
+
+/// An enum of chomping indicators that describe how to handle trailing
+/// whitespace for a block scalar.
+///
+/// See http://yaml.org/spec/1.2/spec.html#id2794534.
+class _Chomping {
+  /// All trailing whitespace is discarded.
+  static const STRIP = const _Chomping("STRIP");
+
+  /// A single trailing newline is retained.
+  static const CLIP = const _Chomping("CLIP");
+
+  /// All trailing whitespace is preserved.
+  static const KEEP = const _Chomping("KEEP");
+
+  final String name;
+
+  const _Chomping(this.name);
+
+  String toString() => name;
+}
diff --git a/pkg/yaml/lib/src/style.dart b/pkg/yaml/lib/src/style.dart
new file mode 100644
index 0000000..6305fce
--- /dev/null
+++ b/pkg/yaml/lib/src/style.dart
@@ -0,0 +1,73 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library yaml.style;
+
+/// An enum of source scalar styles.
+class ScalarStyle {
+  /// No source style was specified.
+  ///
+  /// This usually indicates a scalar constructed with [YamlScalar.wrap].
+  static const ANY = const ScalarStyle._("ANY");
+
+  /// The plain scalar style, unquoted and without a prefix.
+  ///
+  /// See http://yaml.org/spec/1.2/spec.html#style/flow/plain.
+  static const PLAIN = const ScalarStyle._("PLAIN");
+
+  /// The literal scalar style, with a `|` prefix.
+  ///
+  /// See http://yaml.org/spec/1.2/spec.html#id2795688.
+  static const LITERAL = const ScalarStyle._("LITERAL");
+
+
+  /// The folded scalar style, with a `>` prefix.
+  ///
+  /// See http://yaml.org/spec/1.2/spec.html#id2796251.
+  static const FOLDED = const ScalarStyle._("FOLDED");
+
+  /// The single-quoted scalar style.
+  ///
+  /// See http://yaml.org/spec/1.2/spec.html#style/flow/single-quoted.
+  static const SINGLE_QUOTED = const ScalarStyle._("SINGLE_QUOTED");
+
+  /// The double-quoted scalar style.
+  ///
+  /// See http://yaml.org/spec/1.2/spec.html#style/flow/double-quoted.
+  static const DOUBLE_QUOTED = const ScalarStyle._("DOUBLE_QUOTED");
+
+  final String name;
+
+  /// Whether this is a quoted style ([SINGLE_QUOTED] or [DOUBLE_QUOTED]).
+  bool get isQuoted => this == SINGLE_QUOTED || this == DOUBLE_QUOTED;
+
+  const ScalarStyle._(this.name);
+
+  String toString() => name;
+}
+
+/// An enum of collection styles.
+class CollectionStyle {
+  /// No source style was specified.
+  ///
+  /// This usually indicates a collection constructed with [YamlList.wrap] or
+  /// [YamlMap.wrap].
+  static const ANY = const CollectionStyle._("ANY");
+
+  /// The indentation-based block style.
+  ///
+  /// See http://yaml.org/spec/1.2/spec.html#id2797293.
+  static const BLOCK = const CollectionStyle._("BLOCK");
+
+  /// The delimiter-based block style.
+  ///
+  /// See http://yaml.org/spec/1.2/spec.html#id2790088.
+  static const FLOW = const CollectionStyle._("FLOW");
+
+  final String name;
+
+  const CollectionStyle._(this.name);
+
+  String toString() => name;
+}
diff --git a/pkg/yaml/lib/src/token.dart b/pkg/yaml/lib/src/token.dart
new file mode 100644
index 0000000..20ae547
--- /dev/null
+++ b/pkg/yaml/lib/src/token.dart
@@ -0,0 +1,148 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library yaml.token;
+
+import 'package:source_span/source_span.dart';
+
+import 'style.dart';
+
+/// A token emitted by a [Scanner].
+class Token {
+  /// The token type.
+  final TokenType type;
+
+  /// The span associated with the token.
+  final FileSpan span;
+
+  Token(this.type, this.span);
+
+  String toString() => type.toString();
+}
+
+/// A token representing a `%YAML` directive.
+class VersionDirectiveToken implements Token {
+  get type => TokenType.VERSION_DIRECTIVE;
+  final FileSpan span;
+
+  /// The declared major version of the document.
+  final int major;
+
+  /// The declared minor version of the document.
+  final int minor;
+
+  VersionDirectiveToken(this.span, this.major, this.minor);
+
+  String toString() => "VERSION_DIRECTIVE $major.$minor";
+}
+
+/// A token representing a `%TAG` directive.
+class TagDirectiveToken implements Token {
+  get type => TokenType.TAG_DIRECTIVE;
+  final FileSpan span;
+
+  /// The tag handle used in the document.
+  final String handle;
+
+  /// The tag prefix that the handle maps to.
+  final String prefix;
+
+  TagDirectiveToken(this.span, this.handle, this.prefix);
+
+  String toString() => "TAG_DIRECTIVE $handle $prefix";
+}
+
+/// A token representing an anchor (`&foo`).
+class AnchorToken implements Token {
+  get type => TokenType.ANCHOR;
+  final FileSpan span;
+
+  /// The name of the anchor.
+  final String name;
+
+  AnchorToken(this.span, this.name);
+
+  String toString() => "ANCHOR $name";
+}
+
+/// A token representing an alias (`*foo`).
+class AliasToken implements Token {
+  get type => TokenType.ALIAS;
+  final FileSpan span;
+
+  /// The name of the anchor.
+  final String name;
+
+  AliasToken(this.span, this.name);
+
+  String toString() => "ALIAS $name";
+}
+
+/// A token representing a tag (`!foo`).
+class TagToken implements Token {
+  get type => TokenType.TAG;
+  final FileSpan span;
+
+  /// The tag handle.
+  final String handle;
+
+  /// The tag suffix, or `null`.
+  final String suffix;
+
+  TagToken(this.span, this.handle, this.suffix);
+
+  String toString() => "TAG $handle $suffix";
+}
+
+/// A tkoen representing a scalar value.
+class ScalarToken implements Token {
+  get type => TokenType.SCALAR;
+  final FileSpan span;
+
+  /// The contents of the scalar.
+  final String value;
+
+  /// The style of the scalar in the original source.
+  final ScalarStyle style;
+
+  ScalarToken(this.span, this.value, this.style);
+
+  String toString() => "SCALAR $style \"$value\"";
+}
+
+/// An enum of types of [Token] object.
+class TokenType {
+  static const STREAM_START = const TokenType._("STREAM_START");
+  static const STREAM_END = const TokenType._("STREAM_END");
+
+  static const VERSION_DIRECTIVE = const TokenType._("VERSION_DIRECTIVE");
+  static const TAG_DIRECTIVE = const TokenType._("TAG_DIRECTIVE");
+  static const DOCUMENT_START = const TokenType._("DOCUMENT_START");
+  static const DOCUMENT_END = const TokenType._("DOCUMENT_END");
+
+  static const BLOCK_SEQUENCE_START = const TokenType._("BLOCK_SEQUENCE_START");
+  static const BLOCK_MAPPING_START = const TokenType._("BLOCK_MAPPING_START");
+  static const BLOCK_END = const TokenType._("BLOCK_END");
+
+  static const FLOW_SEQUENCE_START = const TokenType._("FLOW_SEQUENCE_START");
+  static const FLOW_SEQUENCE_END = const TokenType._("FLOW_SEQUENCE_END");
+  static const FLOW_MAPPING_START = const TokenType._("FLOW_MAPPING_START");
+  static const FLOW_MAPPING_END = const TokenType._("FLOW_MAPPING_END");
+
+  static const BLOCK_ENTRY = const TokenType._("BLOCK_ENTRY");
+  static const FLOW_ENTRY = const TokenType._("FLOW_ENTRY");
+  static const KEY = const TokenType._("KEY");
+  static const VALUE = const TokenType._("VALUE");
+
+  static const ALIAS = const TokenType._("ALIAS");
+  static const ANCHOR = const TokenType._("ANCHOR");
+  static const TAG = const TokenType._("TAG");
+  static const SCALAR = const TokenType._("SCALAR");
+
+  final String name;
+
+  const TokenType._(this.name);
+
+  String toString() => name;
+}
diff --git a/pkg/yaml/lib/src/utils.dart b/pkg/yaml/lib/src/utils.dart
index 84c1113..445221f 100644
--- a/pkg/yaml/lib/src/utils.dart
+++ b/pkg/yaml/lib/src/utils.dart
@@ -4,6 +4,8 @@
 
 library yaml.utils;
 
+import 'package:source_span/source_span.dart';
+
 /// A pair of values.
 class Pair<E, F> {
   final E first;
@@ -13,3 +15,30 @@
 
   String toString() => '($first, $last)';
 }
+
+/// Print a warning.
+///
+/// If [span] is passed, associates the warning with that span.
+void warn(String message, [SourceSpan span]) =>
+    yamlWarningCallback(message, span);
+
+/// A callback for emitting a warning.
+///
+/// [message] is the text of the warning. If [span] is passed, it's the portion
+/// of the document that the warning is associated with and should be included
+/// in the printed warning.
+typedef YamlWarningCallback(String message, [SourceSpan span]);
+
+/// A callback for emitting a warning.
+///
+/// In a very few cases, the YAML spec indicates that an implementation should
+/// emit a warning. To do so, it calls this callback. The default implementation
+/// prints a message using [print].
+YamlWarningCallback yamlWarningCallback = (message, [span]) {
+  // TODO(nweiz): Print to stderr with color when issue 6943 is fixed and
+  // dart:io is available.
+  if (span != null) message = span.message(message);
+  print(message);
+};
+
+
diff --git a/pkg/yaml/lib/src/visitor.dart b/pkg/yaml/lib/src/visitor.dart
deleted file mode 100644
index 3f4c455..0000000
--- a/pkg/yaml/lib/src/visitor.dart
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright (c) 2012, 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.
-
-library yaml.visitor;
-
-import 'equality.dart';
-import 'model.dart';
-
-/// The visitor pattern for YAML documents.
-class Visitor {
-  /// Returns [alias].
-  visitAlias(AliasNode alias) => alias;
-
-  /// Returns [scalar].
-  visitScalar(ScalarNode scalar) => scalar;
-
-  /// Visits each node in [seq] and returns a list of the results.
-  visitSequence(SequenceNode seq)
-      => seq.content.map((e) => e.visit(this)).toList();
-
-  /// Visits each key and value in [map] and returns a map of the results.
-  visitMapping(MappingNode map) {
-    var out = deepEqualsMap();
-    for (var key in map.content.keys) {
-      out[key.visit(this)] = map.content[key].visit(this);
-    }
-    return out;
-  }
-}
diff --git a/pkg/yaml/lib/src/yaml_document.dart b/pkg/yaml/lib/src/yaml_document.dart
new file mode 100644
index 0000000..4c249a0
--- /dev/null
+++ b/pkg/yaml/lib/src/yaml_document.dart
@@ -0,0 +1,67 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library yaml.yaml_document;
+
+import 'dart:collection';
+
+import 'package:source_span/source_span.dart';
+
+import 'yaml_node.dart';
+
+/// A YAML document, complete with metadata.
+class YamlDocument {
+  /// The contents of the document.
+  final YamlNode contents;
+
+  /// The span covering the entire document.
+  final SourceSpan span;
+
+  /// The version directive for the document, if any.
+  final VersionDirective versionDirective;
+
+  /// The tag directives for the document.
+  final List<TagDirective> tagDirectives;
+
+  /// Whether the beginning of the document was implicit (versus explicit via
+  /// `===`).
+  final bool startImplicit;
+
+  /// Whether the end of the document was implicit (versus explicit via `...`).
+  final bool endImplicit;
+
+  /// Users of the library should not use this constructor.
+  YamlDocument.internal(this.contents, this.span, this.versionDirective,
+          List<TagDirective> tagDirectives, {this.startImplicit: false,
+          this.endImplicit: false})
+      : tagDirectives = new UnmodifiableListView(tagDirectives);
+
+  String toString() => contents.toString();
+}
+
+/// A directive indicating which version of YAML a document was written to.
+class VersionDirective {
+  /// The major version number.
+  final int major;
+
+  /// The minor version number.
+  final int minor;
+
+  VersionDirective(this.major, this.minor);
+
+  String toString() => "%YAML $major.$minor";
+}
+
+/// A directive describing a custom tag handle.
+class TagDirective {
+  /// The handle for use in the document.
+  final String handle;
+
+  /// The prefix that the handle maps to.
+  final String prefix;
+
+  TagDirective(this.handle, this.prefix);
+
+  String toString() => "%TAG $handle $prefix";
+}
diff --git a/pkg/yaml/lib/src/yaml_node.dart b/pkg/yaml/lib/src/yaml_node.dart
index 6320156..027bc1b 100644
--- a/pkg/yaml/lib/src/yaml_node.dart
+++ b/pkg/yaml/lib/src/yaml_node.dart
@@ -10,6 +10,7 @@
 import 'package:source_span/source_span.dart';
 
 import 'null_span.dart';
+import 'style.dart';
 import 'yaml_node_wrapper.dart';
 
 /// An interface for parsed nodes from a YAML source tree.
@@ -26,7 +27,9 @@
   ///
   /// [SourceSpan.message] can be used to produce a human-friendly message about
   /// this node.
-  SourceSpan get span;
+  SourceSpan get span => _span;
+
+  SourceSpan _span;
 
   /// The inner value of this node.
   ///
@@ -38,8 +41,6 @@
 
 /// A read-only [Map] parsed from YAML.
 class YamlMap extends YamlNode with collection.MapMixin, UnmodifiableMapMixin  {
-  final SourceSpan span;
-
   /// A view of [this] where the keys and values are guaranteed to be
   /// [YamlNode]s.
   ///
@@ -50,6 +51,9 @@
   /// `dynamic` `map.nodes["foo"]` will still work.
   final Map<dynamic, YamlNode> nodes;
 
+  /// The style used for the map in the original document.
+  final CollectionStyle style;
+
   Map get value => this;
 
   Iterable get keys => nodes.keys.map((node) => node.value);
@@ -77,8 +81,10 @@
       new YamlMapWrapper(dartMap, sourceUrl);
 
   /// Users of the library should not use this constructor.
-  YamlMap.internal(Map<dynamic, YamlNode> nodes, this.span)
-      : nodes = new UnmodifiableMapView<dynamic, YamlNode>(nodes);
+  YamlMap.internal(Map<dynamic, YamlNode> nodes, SourceSpan span, this.style)
+      : nodes = new UnmodifiableMapView<dynamic, YamlNode>(nodes) {
+    _span = span;
+  }
 
   operator [](key) {
     var node = nodes[key];
@@ -89,10 +95,11 @@
 // TODO(nweiz): Use UnmodifiableListMixin when issue 18970 is fixed.
 /// A read-only [List] parsed from YAML.
 class YamlList extends YamlNode with collection.ListMixin {
-  final SourceSpan span;
-
   final List<YamlNode> nodes;
 
+  /// The style used for the list in the original document.
+  final CollectionStyle style;
+
   List get value => this;
 
   int get length => nodes.length;
@@ -124,8 +131,10 @@
       new YamlListWrapper(dartList, sourceUrl);
 
   /// Users of the library should not use this constructor.
-  YamlList.internal(List<YamlNode> nodes, this.span)
-      : nodes = new UnmodifiableListView<YamlNode>(nodes);
+  YamlList.internal(List<YamlNode> nodes, SourceSpan span, this.style)
+      : nodes = new UnmodifiableListView<YamlNode>(nodes) {
+    _span = span;
+  }
 
   operator [](int index) => nodes[index].value;
 
@@ -136,10 +145,11 @@
 
 /// A wrapped scalar value parsed from YAML.
 class YamlScalar extends YamlNode {
-  final SourceSpan span;
-
   final value;
 
+  /// The style used for the scalar in the original document.
+  final ScalarStyle style;
+
   /// Wraps a Dart value in a [YamlScalar].
   ///
   /// This scalar's [span] won't have useful location information. However, it
@@ -148,10 +158,21 @@
   ///
   /// [sourceUrl] may be either a [String], a [Uri], or `null`.
   YamlScalar.wrap(this.value, {sourceUrl})
-      : span = new NullSpan(sourceUrl);
+      : style = ScalarStyle.ANY {
+    _span = new NullSpan(sourceUrl);
+  }
 
   /// Users of the library should not use this constructor.
-  YamlScalar.internal(this.value, this.span);
+  YamlScalar.internal(this.value, SourceSpan span, this.style) {
+    _span = span;
+  }
 
   String toString() => value.toString();
 }
+
+/// Sets the source span of a [YamlNode].
+///
+/// This method is not exposed publicly.
+void setSpan(YamlNode node, SourceSpan span) {
+  node._span = span;
+}
diff --git a/pkg/yaml/lib/src/yaml_node_wrapper.dart b/pkg/yaml/lib/src/yaml_node_wrapper.dart
index d000dcb..be96ba4 100644
--- a/pkg/yaml/lib/src/yaml_node_wrapper.dart
+++ b/pkg/yaml/lib/src/yaml_node_wrapper.dart
@@ -10,12 +10,15 @@
 import 'package:source_span/source_span.dart';
 
 import 'null_span.dart';
+import 'style.dart';
 import 'yaml_node.dart';
 
 /// A wrapper that makes a normal Dart map behave like a [YamlMap].
 class YamlMapWrapper extends MapBase
     with pkg_collection.UnmodifiableMapMixin
     implements YamlMap {
+  final CollectionStyle style = CollectionStyle.ANY;
+
   final Map _dartMap;
 
   final SourceSpan span;
@@ -55,8 +58,8 @@
 
   final SourceSpan _span;
 
-  Iterable get keys =>
-      _dartMap.keys.map((key) => new YamlScalar.internal(key, _span));
+  Iterable get keys => _dartMap.keys.map((key) =>
+      new YamlScalar.internal(key, _span, ScalarStyle.ANY));
 
   _YamlMapNodes(this._dartMap, this._span);
 
@@ -76,6 +79,8 @@
 // TODO(nweiz): Use UnmodifiableListMixin when issue 18970 is fixed.
 /// A wrapper that makes a normal Dart list behave like a [YamlList].
 class YamlListWrapper extends ListBase implements YamlList {
+  final CollectionStyle style = CollectionStyle.ANY;
+
   final List _dartList;
 
   final SourceSpan span;
@@ -146,5 +151,5 @@
 YamlNode _nodeForValue(value, SourceSpan span) {
   if (value is Map) return new YamlMapWrapper._(value, span);
   if (value is List) return new YamlListWrapper._(value, span);
-  return new YamlScalar.internal(value, span);
+  return new YamlScalar.internal(value, span, ScalarStyle.ANY);
 }
diff --git a/pkg/yaml/lib/yaml.dart b/pkg/yaml/lib/yaml.dart
index e45dd6e..9af329a 100644
--- a/pkg/yaml/lib/yaml.dart
+++ b/pkg/yaml/lib/yaml.dart
@@ -4,16 +4,17 @@
 
 library yaml;
 
-import 'package:string_scanner/string_scanner.dart';
-
-import 'src/composer.dart';
-import 'src/constructor.dart';
-import 'src/parser.dart';
+import 'src/loader.dart';
+import 'src/style.dart';
+import 'src/yaml_document.dart';
 import 'src/yaml_exception.dart';
 import 'src/yaml_node.dart';
 
+export 'src/style.dart';
+export 'src/utils.dart' show YamlWarningCallback, yamlWarningCallback;
+export 'src/yaml_document.dart';
 export 'src/yaml_exception.dart';
-export 'src/yaml_node.dart';
+export 'src/yaml_node.dart' hide setSpan;
 
 /// Loads a single document from a YAML string.
 ///
@@ -39,13 +40,29 @@
 /// This is just like [loadYaml], except that where [loadYaml] would return a
 /// normal Dart value this returns a [YamlNode] instead. This allows the caller
 /// to be confident that the return value will always be a [YamlNode].
-YamlNode loadYamlNode(String yaml, {sourceUrl}) {
-  var stream = loadYamlStream(yaml, sourceUrl: sourceUrl);
-  if (stream.length != 1) {
-    throw new YamlException("Expected 1 document, were ${stream.length}.",
-        stream.span);
+YamlNode loadYamlNode(String yaml, {sourceUrl}) =>
+    loadYamlDocument(yaml, sourceUrl: sourceUrl).contents;
+
+/// Loads a single document from a YAML string as a [YamlDocument].
+///
+/// This is just like [loadYaml], except that where [loadYaml] would return a
+/// normal Dart value this returns a [YamlDocument] instead. This allows the
+/// caller to access document metadata.
+YamlDocument loadYamlDocument(String yaml, {sourceUrl}) {
+  var loader = new Loader(yaml, sourceUrl: sourceUrl);
+  var document = loader.load();
+  if (document == null) {
+    return new YamlDocument.internal(
+        new YamlScalar.internal(null, loader.span, ScalarStyle.ANY),
+        loader.span, null, const []);
   }
-  return stream.nodes[0];
+
+  var nextDocument = loader.load();
+  if (nextDocument != null) {
+    throw new YamlException("Only expected one document.", nextDocument.span);
+  }
+
+  return document;
 }
 
 /// Loads a stream of documents from a YAML string.
@@ -62,15 +79,34 @@
 /// If [sourceUrl] is passed, it's used as the URL from which the YAML
 /// originated for error reporting. It can be a [String], a [Uri], or `null`.
 YamlList loadYamlStream(String yaml, {sourceUrl}) {
-  var pair;
-  try {
-    pair = new Parser(yaml, sourceUrl).l_yamlStream();
-  } on StringScannerException catch (error) {
-    throw new YamlException(error.message, error.span);
+  var loader = new Loader(yaml, sourceUrl: sourceUrl);
+
+  var documents = [];
+  var document = loader.load();
+  while (document != null) {
+    documents.add(document);
+    document = loader.load();
   }
 
-  var nodes = pair.first
-      .map((doc) => new Constructor(new Composer(doc).compose()).construct())
-      .toList();
-  return new YamlList.internal(nodes, pair.last);
+  return new YamlList.internal(
+      documents.map((document) => document.contents).toList(),
+      loader.span,
+      CollectionStyle.ANY);
+}
+
+/// Loads a stream of documents from a YAML string.
+///
+/// This is like [loadYamlStream], except that it returns [YamlDocument]s with
+/// metadata wrapping the document contents.
+List<YamlDocument> loadYamlDocuments(String yaml, {sourceUrl}) {
+  var loader = new Loader(yaml, sourceUrl: sourceUrl);
+
+  var documents = [];
+  var document = loader.load();
+  while (document != null) {
+    documents.add(document);
+    document = loader.load();
+  }
+
+  return documents;
 }
diff --git a/pkg/yaml/libyaml-license.txt b/pkg/yaml/libyaml-license.txt
new file mode 100644
index 0000000..050ced2
--- /dev/null
+++ b/pkg/yaml/libyaml-license.txt
@@ -0,0 +1,19 @@
+Copyright (c) 2006 Kirill Simonov
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/pkg/yaml/pubspec.yaml b/pkg/yaml/pubspec.yaml
index 74194e5..d0d51c5 100644
--- a/pkg/yaml/pubspec.yaml
+++ b/pkg/yaml/pubspec.yaml
@@ -1,12 +1,12 @@
 name: yaml
-version: 2.0.1+1
+version: 2.1.0
 author: "Dart Team <misc@dartlang.org>"
 homepage: http://www.dartlang.org
 description: A parser for YAML.
 dependencies:
-  collection: ">=0.9.2 <2.0.0"
+  collection: ">=1.1.0 <2.0.0"
   path: ">=1.2.0 <2.0.0"
-  string_scanner: ">=0.1.0 <0.2.0"
+  string_scanner: ">=0.1.2 <0.2.0"
   source_span: ">=1.0.0 <2.0.0"
 dev_dependencies:
   unittest: ">=0.9.0 <0.12.0"
diff --git a/pkg/yaml/test/yaml_test.dart b/pkg/yaml/test/yaml_test.dart
index 4fbb108..2d9a0e8 100644
--- a/pkg/yaml/test/yaml_test.dart
+++ b/pkg/yaml/test/yaml_test.dart
@@ -4,7 +4,6 @@
 
 library yaml.test;
 
-// TODO(rnystrom): rewrite tests so that they don't need "Expect".
 import 'package:unittest/unittest.dart';
 import 'package:yaml/yaml.dart';
 
@@ -16,7 +15,7 @@
 
   group('has a friendly error message for', () {
     var tabError = predicate((e) =>
-        e.toString().contains('tab characters are not allowed as indentation'));
+        e.toString().contains('Tab characters are not allowed as indentation'));
 
     test('using a tab as indentation', () {
       expect(() => loadYaml('foo:\n\tbar'),
@@ -32,6 +31,29 @@
     });
   });
 
+  group("refuses documents that declare version", () {
+    test("1.0", () {
+      expectYamlFails("""
+         %YAML 1.0
+         --- text
+         """);
+    });
+
+    test("1.3", () {
+      expectYamlFails("""
+         %YAML 1.3
+         --- text
+         """);
+    });
+
+    test("2.0", () {
+      expectYamlFails("""
+         %YAML 2.0
+         --- text
+         """);
+    });
+  });
+
   // The following tests are all taken directly from the YAML spec
   // (http://www.yaml.org/spec/1.2/spec.html). Most of them are code examples
   // that are directly included in the spec, but additional tests are derived
@@ -173,21 +195,21 @@
           - Ken Griffey""");
     });
 
-  //   test('[Example 2.10]', () {
-  //     expectYamlLoads({
-  //       "hr": ["Mark McGwire", "Sammy Sosa"],
-  //       "rbi": ["Sammy Sosa", "Ken Griffey"]
-  //     },
-  //       """
-  //       ---
-  //       hr:
-  //         - Mark McGwire
-  //         # Following node labeled SS
-  //         - &SS Sammy Sosa
-  //       rbi:
-  //         - *SS # Subsequent occurrence
-  //         - Ken Griffey""");
-  //   });
+    test('[Example 2.10]', () {
+      expectYamlLoads({
+        "hr": ["Mark McGwire", "Sammy Sosa"],
+        "rbi": ["Sammy Sosa", "Ken Griffey"]
+      },
+        """
+        ---
+        hr:
+          - Mark McGwire
+          # Following node labeled SS
+          - &SS Sammy Sosa
+        rbi:
+          - *SS # Subsequent occurrence
+          - Ken Griffey""");
+    });
 
     test('[Example 2.11]', () {
       var doc = deepEqualsMap();
@@ -536,12 +558,12 @@
         """);
     });
 
-    // test('[Example 5.9]', () {
-    //   expectYamlLoads("text",
-    //     """
-    //     %YAML 1.2
-    //     --- text""");
-    // });
+    test('[Example 5.9]', () {
+      expectYamlLoads("text",
+        """
+        %YAML 1.2
+        --- text""");
+    });
 
     test('[Example 5.10]', () {
       expectYamlFails("commercial-at: @text");
@@ -886,179 +908,179 @@
   });
 
   group('6.8: Directives', () {
-    // // TODO(nweiz): assert that this produces a warning
-    // test('[Example 6.13]', () {
-    //   expectYamlLoads("foo",
-    //     '''
-    //     %FOO  bar baz # Should be ignored
-    //                    # with a warning.
-    //     --- "foo"''');
-    // });
+    // TODO(nweiz): assert that this produces a warning
+    test('[Example 6.13]', () {
+      expectYamlLoads("foo",
+        '''
+        %FOO  bar baz # Should be ignored
+                      # with a warning.
+        --- "foo"''');
+    });
 
-    // // TODO(nweiz): assert that this produces a warning
-    // test('[Example 6.14]', () {
-    //   expectYamlLoads("foo",
-    //     '''
-    //     %YAML 1.3 # Attempt parsing
-    //                # with a warning
-    //     ---
-    //     "foo"''');
-    // });
+    // TODO(nweiz): assert that this produces a warning.
+    test('[Example 6.14]', () {
+      expectYamlLoads("foo",
+        '''
+        %YAML 1.3 # Attempt parsing
+                   # with a warning
+        ---
+        "foo"''');
+    });
 
-    // test('[Example 6.15]', () {
-    //   expectYamlFails(
-    //     """
-    //     %YAML 1.2
-    //     %YAML 1.1
-    //     foo""");
-    // });
+    test('[Example 6.15]', () {
+      expectYamlFails(
+        """
+        %YAML 1.2
+        %YAML 1.1
+        foo""");
+    });
 
-    // test('[Example 6.16]', () {
-    //   expectYamlLoads("foo",
-    //     '''
-    //     %TAG !yaml! tag:yaml.org,2002:
-    //     ---
-    //     !yaml!str "foo"''');
-    // });
+    test('[Example 6.16]', () {
+      expectYamlLoads("foo",
+        '''
+        %TAG !yaml! tag:yaml.org,2002:
+        ---
+        !yaml!str "foo"''');
+    });
 
-    // test('[Example 6.17]', () {
-    //   ExpectYamlFails(
-    //     """
-    //     %TAG ! !foo
-    //     %TAG ! !foo
-    //     bar""");
-    // });
+    test('[Example 6.17]', () {
+      expectYamlFails(
+        """
+        %TAG ! !foo
+        %TAG ! !foo
+        bar""");
+    });
 
     // Examples 6.18 through 6.22 test custom tag URIs, which this
     // implementation currently doesn't plan to support.
   });
 
   group('6.9: Node Properties', () {
-    // test('may be specified in any order', () {
-    //   expectYamlLoads(["foo", "bar"],
-    //     """
-    //     - !!str &a1 foo
-    //     - &a2 !!str bar""");
-    // });
+    test('may be specified in any order', () {
+      expectYamlLoads(["foo", "bar"],
+        """
+        - !!str &a1 foo
+        - &a2 !!str bar""");
+    });
 
-    // test('[Example 6.23]', () {
-    //   expectYamlLoads({
-    //     "foo": "bar",
-    //     "baz": "foo"
-    //   },
-    //     '''
-    //     !!str &a1 "foo":
-    //       !!str bar
-    //     &a2 baz : *a1''');
-    // });
+    test('[Example 6.23]', () {
+      expectYamlLoads({
+        "foo": "bar",
+        "baz": "foo"
+      },
+        '''
+        !!str &a1 "foo":
+          !!str bar
+        &a2 baz : *a1''');
+    });
 
-    // // Example 6.24 tests custom tag URIs, which this implementation currently
-    // // doesn't plan to support.
+    // Example 6.24 tests custom tag URIs, which this implementation currently
+    // doesn't plan to support.
 
-    // test('[Example 6.25]', () {
-    //   expectYamlFails("- !<!> foo");
-    //   expectYamlFails("- !<\$:?> foo");
-    // });
+    test('[Example 6.25]', () {
+      expectYamlFails("- !<!> foo");
+      expectYamlFails("- !<\$:?> foo");
+    });
 
-    // // Examples 6.26 and 6.27 test custom tag URIs, which this implementation
-    // // currently doesn't plan to support.
+    // Examples 6.26 and 6.27 test custom tag URIs, which this implementation
+    // currently doesn't plan to support.
 
-    // test('[Example 6.28]', () {
-    //   expectYamlLoads(["12", 12, "12"],
-    //     '''
-    //     # Assuming conventional resolution:
-    //     - "12"
-    //     - 12
-    //     - ! 12''');
-    // });
+    test('[Example 6.28]', () {
+      expectYamlLoads(["12", 12, "12"],
+        '''
+        # Assuming conventional resolution:
+        - "12"
+        - 12
+        - ! 12''');
+    });
 
-    // test('[Example 6.29]', () {
-    //   expectYamlLoads({
-    //     "First occurrence": "Value",
-    //     "Second occurrence": "anchor"
-    //   },
-    //     """
-    //     First occurrence: &anchor Value
-    //     Second occurrence: *anchor""");
-    // });
+    test('[Example 6.29]', () {
+      expectYamlLoads({
+        "First occurrence": "Value",
+        "Second occurrence": "Value"
+      },
+        """
+        First occurrence: &anchor Value
+        Second occurrence: *anchor""");
+    });
   });
 
   // Chapter 7: Flow Styles
   group('7.1: Alias Nodes', () {
-    // test("must not use an anchor that doesn't previously occur", () {
-    //   expectYamlFails(
-    //     """
-    //     - *anchor
-    //     - &anchor foo""");
-    // });
+    test("must not use an anchor that doesn't previously occur", () {
+      expectYamlFails(
+        """
+        - *anchor
+        - &anchor foo""");
+    });
 
-    // test("don't have to exist for a given anchor node", () {
-    //   expectYamlLoads(["foo"], "- &anchor foo");
-    // });
+    test("don't have to exist for a given anchor node", () {
+      expectYamlLoads(["foo"], "- &anchor foo");
+    });
 
-    // group('must not specify', () {
-    //   test('tag properties', () => expectYamlFails(
-    //     """
-    //     - &anchor foo
-    //     - !str *anchor""");
+    group('must not specify', () {
+      test('tag properties', () => expectYamlFails(
+        """
+        - &anchor foo
+        - !str *anchor"""));
 
-    //   test('anchor properties', () => expectYamlFails(
-    //     """
-    //     - &anchor foo
-    //     - &anchor2 *anchor""");
+      test('anchor properties', () => expectYamlFails(
+        """
+        - &anchor foo
+        - &anchor2 *anchor"""));
 
-    //   test('content', () => expectYamlFails(
-    //     """
-    //     - &anchor foo
-    //     - *anchor bar""")));
-    // });
+      test('content', () => expectYamlFails(
+        """
+        - &anchor foo
+        - *anchor bar"""));
+    });
 
-    // test('must preserve structural equality', () {
-    //   var doc = loadYaml(cleanUpLiteral(
-    //     """
-    //     anchor: &anchor [a, b, c]
-    //     alias: *anchor""");
-    //   var anchorList = doc['anchor'];
-    //   var aliasList = doc['alias'];
-    //   expect(anchorList, same(aliasList));
+    test('must preserve structural equality', () {
+      var doc = loadYaml(cleanUpLiteral(
+        """
+        anchor: &anchor [a, b, c]
+        alias: *anchor"""));
+      var anchorList = doc['anchor'];
+      var aliasList = doc['alias'];
+      expect(anchorList, same(aliasList));
 
-    //   doc = loadYaml(cleanUpLiteral(
-    //     """
-    //     ? &anchor [a, b, c]
-    //     : ? *anchor
-    //       : bar""");
-    //   anchorList = doc.keys[0];
-    //   aliasList = doc[['a', 'b', 'c']].keys[0];
-    //   expect(anchorList, same(aliasList));
-    // });
+      doc = loadYaml(cleanUpLiteral(
+        """
+        ? &anchor [a, b, c]
+        : ? *anchor
+          : bar"""));
+      anchorList = doc.keys.first;
+      aliasList = doc[['a', 'b', 'c']].keys.first;
+      expect(anchorList, same(aliasList));
+    });
 
-    // test('[Example 7.1]', () {
-    //   expectYamlLoads({
-    //     "First occurence": "Foo",
-    //     "Second occurence": "Foo",
-    //     "Override anchor": "Bar",
-    //     "Reuse anchor": "Bar",
-    //   },
-    //     """
-    //     First occurrence: &anchor Foo
-    //     Second occurrence: *anchor
-    //     Override anchor: &anchor Bar
-    //     Reuse anchor: *anchor""");
-    // });
+    test('[Example 7.1]', () {
+      expectYamlLoads({
+        "First occurrence": "Foo",
+        "Second occurrence": "Foo",
+        "Override anchor": "Bar",
+        "Reuse anchor": "Bar",
+      },
+        """
+        First occurrence: &anchor Foo
+        Second occurrence: *anchor
+        Override anchor: &anchor Bar
+        Reuse anchor: *anchor""");
+    });
   });
 
   group('7.2: Empty Nodes', () {
-    // test('[Example 7.2]', () {
-    //   expectYamlLoads({
-    //     "foo": "",
-    //     "": "bar"
-    //   },
-    //     """
-    //     {
-    //       foo : !!str,
-    //       !!str : bar,
-    //     }""");
-    // });
+    test('[Example 7.2]', () {
+      expectYamlLoads({
+        "foo": "",
+        "": "bar"
+      },
+        """
+        {
+          foo : !!str,
+          !!str : bar,
+        }""");
+    });
 
     test('[Example 7.3]', () {
       var doc = deepEqualsMap({"foo": null});
@@ -1284,17 +1306,18 @@
         - [ {JSON: like}:adjacent ]""");
     });
 
-    test('[Example 7.22]', () {
-      expectYamlFails(
-        """
-        [ foo
-         bar: invalid ]""");
-
-      // TODO(nweiz): enable this when we throw an error for long keys
-      // var dotList = new List.filled(1024, ' ');
-      // var dots = dotList.join();
-      // expectYamlFails('[ "foo...$dots...bar": invalid ]');
-    });
+    // TODO(nweiz): enable this when we throw an error for long or multiline
+    // keys.
+    // test('[Example 7.22]', () {
+    //   expectYamlFails(
+    //     """
+    //     [ foo
+    //      bar: invalid ]""");
+    //
+    //   var dotList = new List.filled(1024, ' ');
+    //   var dots = dotList.join();
+    //   expectYamlFails('[ "foo...$dots...bar": invalid ]');
+    // });
   });
 
   group('7.5: Flow Nodes', () {
@@ -1308,15 +1331,15 @@
         - c""");
     });
 
-    // test('[Example 7.24]', () {
-    //   expectYamlLoads(["a", "b", "c", "c", ""],
-    //     """
-    //     - !!str "a"
-    //     - 'b'
-    //     - &anchor "c"
-    //     - *anchor
-    //     - !!str""");
-    // });
+    test('[Example 7.24]', () {
+      expectYamlLoads(["a", "b", "c", "c", ""],
+        """
+        - !!str "a"
+        - 'b'
+        - &anchor "c"
+        - *anchor
+        - !!str""");
+    });
   });
 
   // Chapter 8: Block Styles
@@ -1569,41 +1592,43 @@
           : moon: white""");
     });
 
-    // test('[Example 8.20]', () {
-    //   expectYamlLoads(["flow in block", "Block scalar\n", {"foo": "bar"}],
-    //     '''
-    //     -
-    //       "flow in block"
-    //     - >
-    //      Block scalar
-    //     - !!map # Block collection
-    //       foo : bar''');
-    // });
+    test('[Example 8.20]', () {
+      expectYamlLoads(["flow in block", "Block scalar\n", {"foo": "bar"}],
+        '''
+        -
+          "flow in block"
+        - >
+         Block scalar
+        - !!map # Block collection
+          foo : bar''');
+    });
 
-    // test('[Example 8.21]', () {
-    //   expectYamlLoads({"literal": "value", "folded": "value"},
-    //     """
-    //     literal: |2
-    //       value
-    //     folded:
-    //        !!str
-    //       >1
-    //      value""");
-    // });
+    test('[Example 8.21]', () {
+      // The spec doesn't include a newline after "value" in the parsed map, but
+      // the block scalar is clipped so it should be retained.
+      expectYamlLoads({"literal": "value\n", "folded": "value"},
+        """
+        literal: |2
+          value
+        folded:
+           !!str
+          >1
+         value""");
+    });
 
-    // test('[Example 8.22]', () {
-    //   expectYamlLoads({
-    //     "sequence": ["entry", ["nested"]],
-    //     "mapping": {"foo": "bar"}
-    //   },
-    //     """
-    //     sequence: !!seq
-    //     - entry
-    //     - !!seq
-    //      - nested
-    //     mapping: !!map
-    //      foo: bar""");
-    // });
+    test('[Example 8.22]', () {
+      expectYamlLoads({
+        "sequence": ["entry", ["nested"]],
+        "mapping": {"foo": "bar"}
+      },
+        """
+        sequence: !!seq
+        - entry
+        - !!seq
+         - nested
+        mapping: !!map
+         foo: bar""");
+    });
   });
 
   // Chapter 9: YAML Character Stream
@@ -1611,14 +1636,14 @@
     // Example 9.1 tests the use of a BOM, which this implementation currently
     // doesn't plan to support.
 
-    // test('[Example 9.2]', () {
-    //   expectYamlLoads("Document",
-    //     """
-    //     %YAML 1.2
-    //     ---
-    //     Document
-    //     ... # Suffix""");
-    // });
+    test('[Example 9.2]', () {
+      expectYamlLoads("Document",
+        """
+        %YAML 1.2
+        ---
+        Document
+        ... # Suffix""");
+    });
 
     test('[Example 9.3]', () {
       // The spec example indicates that the comment after "%!PS-Adobe-2.0"
@@ -1653,81 +1678,83 @@
         ...""");
     });
 
-    // test('[Example 9.5]', () {
-    //   expectYamlStreamLoads(["%!PS-Adobe-2.0\n", null],
-    //     """
-    //     %YAML 1.2
-    //     --- |
-    //     %!PS-Adobe-2.0
-    //     ...
-    //     %YAML1.2
-    //     ---
-    //     # Empty
-    //     ...""");
-    // });
+    test('[Example 9.5]', () {
+      // The spec doesn't have a space between the second
+      // "YAML" and "1.2", but this seems to be a typo.
+      expectYamlStreamLoads(["%!PS-Adobe-2.0\n", null],
+        """
+        %YAML 1.2
+        --- |
+        %!PS-Adobe-2.0
+        ...
+        %YAML 1.2
+        ---
+        # Empty
+        ...""");
+    });
 
-    // test('[Example 9.6]', () {
-    //   expectYamlStreamLoads(["Document", null, {"matches %": 20}],
-    //     """
-    //     Document
-    //     ---
-    //     # Empty
-    //     ...
-    //     %YAML 1.2
-    //     ---
-    //     matches %: 20""");
-    // });
+    test('[Example 9.6]', () {
+      expectYamlStreamLoads(["Document", null, {"matches %": 20}],
+        """
+        Document
+        ---
+        # Empty
+        ...
+        %YAML 1.2
+        ---
+        matches %: 20""");
+    });
   });
 
   // Chapter 10: Recommended Schemas
   group('10.1: Failsafe Schema', () {
-    // test('[Example 10.1]', () {
-    //   expectYamlStreamLoads({
-    //     "Block style": {
-    //       "Clark": "Evans",
-    //       "Ingy": "döt Net",
-    //       "Oren": "Ben-Kiki"
-    //     },
-    //     "Flow style": {
-    //       "Clark": "Evans",
-    //       "Ingy": "döt Net",
-    //       "Oren": "Ben-Kiki"
-    //     }
-    //   },
-    //     """
-    //     Block style: !!map
-    //       Clark : Evans
-    //       Ingy  : döt Net
-    //       Oren  : Ben-Kiki
+    test('[Example 10.1]', () {
+      expectYamlLoads({
+        "Block style": {
+          "Clark": "Evans",
+          "Ingy": "döt Net",
+          "Oren": "Ben-Kiki"
+        },
+        "Flow style": {
+          "Clark": "Evans",
+          "Ingy": "döt Net",
+          "Oren": "Ben-Kiki"
+        }
+      },
+        """
+        Block style: !!map
+          Clark : Evans
+          Ingy  : döt Net
+          Oren  : Ben-Kiki
 
-    //     Flow style: !!map { Clark: Evans, Ingy: döt Net, Oren: Ben-Kiki }""");
-    // });
+        Flow style: !!map { Clark: Evans, Ingy: döt Net, Oren: Ben-Kiki }""");
+    });
 
-    // test('[Example 10.2]', () {
-    //   expectYamlStreamLoads({
-    //     "Block style": ["Clark Evans", "Ingy döt Net", "Oren Ben-Kiki"],
-    //     "Flow style": ["Clark Evans", "Ingy döt Net", "Oren Ben-Kiki"]
-    //   },
-    //     """
-    //     Block style: !!seq
-    //     - Clark Evans
-    //     - Ingy döt Net
-    //     - Oren Ben-Kiki
+    test('[Example 10.2]', () {
+      expectYamlLoads({
+        "Block style": ["Clark Evans", "Ingy döt Net", "Oren Ben-Kiki"],
+        "Flow style": ["Clark Evans", "Ingy döt Net", "Oren Ben-Kiki"]
+      },
+        """
+        Block style: !!seq
+        - Clark Evans
+        - Ingy döt Net
+        - Oren Ben-Kiki
 
-    //     Flow style: !!seq [ Clark Evans, Ingy döt Net, Oren Ben-Kiki ]""");
-    // });
+        Flow style: !!seq [ Clark Evans, Ingy döt Net, Oren Ben-Kiki ]""");
+    });
 
-    // test('[Example 10.3]', () {
-    //   expectYamlStreamLoads({
-    //     "Block style": "String: just a theory.",
-    //     "Flow style": "String: just a theory."
-    //   },
-    //     '''
-    //     Block style: !!str |-
-    //       String: just a theory.
+    test('[Example 10.3]', () {
+      expectYamlLoads({
+        "Block style": "String: just a theory.",
+        "Flow style": "String: just a theory."
+      },
+        '''
+        Block style: !!str |-
+          String: just a theory.
 
-    //     Flow style: !!str "String: just a theory."''');
-    // });
+        Flow style: !!str "String: just a theory."''');
+    });
   });
 
   group('10.2: JSON Schema', () {
diff --git a/runtime/BUILD.gn b/runtime/BUILD.gn
new file mode 100644
index 0000000..4c12262
--- /dev/null
+++ b/runtime/BUILD.gn
@@ -0,0 +1,94 @@
+# Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+config("dart_config") {
+  defines = []
+  if (is_debug) {
+    defines += ["DEBUG"]
+  } else {
+    defines += ["NDEBUG"]
+  }
+
+  cflags = [
+    "-Werror",
+    "-Wall",
+    "-Wextra", # Also known as -W.
+    "-Wno-unused-parameter",
+    "-Wnon-virtual-dtor",
+    "-Wvla",
+    "-Wno-conversion-null",
+    "-Woverloaded-virtual",
+    "-g3",
+    "-ggdb3",
+    "-fno-rtti",
+    "-fno-exceptions",
+  ]
+}
+
+
+static_library("libdart") {
+  configs += [":dart_config"]
+  deps = [
+    "vm:libdart_lib",
+    "vm:libdart_vm",
+    "third_party/jscre:libjscre",
+    "third_party/double-conversion/src:libdouble_conversion",
+    ":generate_version_cc_file",
+  ]
+  include_dirs = [
+    ".",
+  ]
+  sources = [
+    "include/dart_api.h",
+    "include/dart_debugger_api.h",
+    "include/dart_mirrors_api.h",
+    "include/dart_native_api.h",
+    "vm/dart_api_impl.cc",
+    "vm/debugger_api_impl.cc",
+    "vm/mirrors_api_impl.cc",
+    "vm/native_api_impl.cc",
+    "vm/version.h",
+    "$target_gen_dir/version.cc",
+  ]
+  defines = [
+    # Using DART_SHARED_LIB to export the Dart API entries.
+    "DART_SHARED_LIB",
+  ]
+}
+
+
+action("generate_version_cc_file") {
+  deps = [
+    ":libdart_dependency_helper",
+  ]
+  inputs = [
+    "../tools/utils.py",
+    "../tools/print_version.py",
+    "../tools/VERSION",
+    "vm/version_in.cc",
+  ]
+  output = "$target_gen_dir/version.cc"
+  outputs = [ output, ]
+
+  script = "../tools/make_version.py"
+  args = [
+    "--output", rebase_path(output, root_build_dir),
+    "--input", rebase_path("vm/version_in.cc", root_build_dir),
+  ]
+}
+
+
+executable("libdart_dependency_helper") {
+  deps = [
+    "vm:libdart_lib_withcore",
+    "vm:libdart_lib",
+    "vm:libdart_vm",
+    "vm:libdart_platform",
+    "third_party/jscre:libjscre",
+    "third_party/double-conversion/src:libdouble_conversion",
+  ]
+  sources = [
+    "vm/libdart_dependency_helper.cc",
+  ]
+}
diff --git a/runtime/bin/BUILD.gn b/runtime/bin/BUILD.gn
new file mode 100644
index 0000000..467579e
--- /dev/null
+++ b/runtime/bin/BUILD.gn
@@ -0,0 +1,175 @@
+# Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+
+declare_args() {
+  dart_io_support = false
+}
+
+
+template("gen_library_src_path") {
+  assert(defined(invoker.sources), "Need sources in $target_name")
+  assert(defined(invoker.output), "Need output in $target_name")
+  action(target_name) {
+    visibility = [ ":*" ]  # Only targets in this file can see this.
+    script = "../tools/gen_library_src_paths.py"
+    inputs = [
+      "../tools/gen_library_src_paths.py",
+      "builtin_in.cc",
+    ]
+    outputs = [ invoker.output, ]
+    name = invoker.name
+    kind = invoker.kind
+    args = [
+      "--output", rebase_path(invoker.output, root_build_dir),
+      "--input_cc", rebase_path("builtin_in.cc", root_build_dir),
+      "--include", "bin/builtin.h",
+      "--var_name", "dart::bin::Builtin::${name}_${kind}_paths_",
+      "--library_name", "dart:${name}",] +
+      rebase_path(invoker.sources, root_build_dir)
+  }
+}
+
+
+builtin_sources_gypi =
+    exec_script("../../tools/gypi_to_gn.py",
+                [rebase_path("builtin_sources.gypi")],
+                "scope",
+                ["builtin_sources.gypi"])
+
+gen_library_src_path("generate_builtin_cc_file") {
+  name = "_builtin"
+  kind = "source"
+  sources = builtin_sources_gypi.sources
+  output = "$target_gen_dir/builtin_gen.cc"
+}
+
+
+iolib_sources_gypi =
+    exec_script("../../tools/gypi_to_gn.py",
+                [rebase_path("../../sdk/lib/io/iolib_sources.gypi")],
+                "scope",
+                ["../../sdk/lib/io/iolib_sources.gypi"])
+iolib_sources = rebase_path(iolib_sources_gypi.sources, ".", "../../sdk/lib/io")
+
+gen_library_src_path("generate_io_cc_file") {
+  name = "io"
+  kind = "source"
+  sources = ["../../sdk/lib/io/io.dart"] + iolib_sources
+  output = "$target_gen_dir/io_gen.cc"
+}
+
+io_sources_gypi =
+    exec_script("../../tools/gypi_to_gn.py",
+                [rebase_path("io_sources.gypi")],
+                "scope",
+                ["io_sources.gypi"])
+
+gen_library_src_path("generate_io_patch_cc_file") {
+  name = "io"
+  kind = "patch"
+  sources = io_sources_gypi.sources
+  output = "$target_gen_dir/io_patch_gen.cc"
+}
+
+
+config("libdart_builtin_config") {
+  libs = [
+    "dl",
+  ]
+}
+
+
+builtin_impl_sources_gypi =
+    exec_script("../../tools/gypi_to_gn.py",
+                [rebase_path("builtin_impl_sources.gypi")],
+                "scope",
+                ["builtin_impl_sources.gypi"])
+
+static_library("libdart_builtin") {
+  configs += ["..:dart_config"]
+  public_configs = [":libdart_builtin_config"]
+  deps = [
+    ":generate_builtin_cc_file",
+    ":generate_io_cc_file",
+    ":generate_io_patch_cc_file",
+  ]
+  include_dirs = [
+    "..",
+  ]
+  set_sources_assignment_filter(["*_test.cc", "*_test.h"])
+  sources = [
+    "log_android.cc",
+    "log_linux.cc",
+    "log_macos.cc",
+    "log_win.cc",
+  ] + builtin_impl_sources_gypi.sources
+}
+
+
+static_library("libdart_withcore") {
+  configs += ["..:dart_config"]
+  deps = [
+    "../vm:libdart_lib_withcore",
+    "../vm:libdart_vm",
+    "../vm:libdart_platform",
+    "../third_party/jscre:libjscre",
+    "../third_party/double-conversion/src:libdouble_conversion",
+    "..:generate_version_cc_file",
+  ]
+
+  sources = [
+    "../include/dart_api.h",
+    "../include/dart_debugger_api.h",
+    "../include/dart_mirrors_api.h",
+    "../include/dart_native_api.h",
+    "../vm/dart_api_impl.cc",
+    "../vm/debugger_api_impl.cc",
+    "../vm/mirrors_api_impl.cc",
+    "../vm/native_api_impl.cc",
+    "$target_gen_dir/../version.cc",
+  ]
+
+  include_dirs = [
+    "..",
+  ]
+
+  defines = [
+    "DART_SHARED_LIB",
+  ]
+}
+
+
+executable("gen_snapshot") {
+  configs += ["..:dart_config"]
+  deps = [
+    ":libdart_withcore",
+    ":libdart_builtin",
+  ]
+
+  sources = [
+    "gen_snapshot.cc",
+    # Very limited native resolver provided.
+    "builtin_gen_snapshot.cc",
+    "builtin.cc",
+    "builtin.h",
+    # Include generated source files.
+    "$target_gen_dir/builtin_gen.cc",
+    "$target_gen_dir/io_gen.cc",
+    "$target_gen_dir/io_patch_gen.cc",
+  ]
+
+  include_dirs = [
+    "..",
+  ]
+}
+
+
+static_library("libdart_embedder_noio") {
+  configs += ["..:dart_config",]
+  deps = [
+    "..:libdart",
+    "../vm:libdart_platform",
+  ]
+}
diff --git a/runtime/bin/bin.gypi b/runtime/bin/bin.gypi
index 92939b8..e078728 100644
--- a/runtime/bin/bin.gypi
+++ b/runtime/bin/bin.gypi
@@ -40,7 +40,7 @@
             '--output', '<(builtin_cc_file)',
             '--input_cc', '<(builtin_in_cc_file)',
             '--include', 'bin/builtin.h',
-            '--var_name', 'dart::bin::Builtin::builtin_source_paths_',
+            '--var_name', 'dart::bin::Builtin::_builtin_source_paths_',
             '--library_name', 'dart:_builtin',
             '<@(_sources)',
           ],
diff --git a/runtime/bin/builtin.cc b/runtime/bin/builtin.cc
index d153b11..723ad54 100644
--- a/runtime/bin/builtin.cc
+++ b/runtime/bin/builtin.cc
@@ -14,7 +14,7 @@
 
 Builtin::builtin_lib_props Builtin::builtin_libraries_[] = {
   /* { url_, source_, patch_url_, patch_source_, has_natives_ } */
-  { DartUtils::kBuiltinLibURL, builtin_source_paths_, NULL, NULL, true },
+  { DartUtils::kBuiltinLibURL, _builtin_source_paths_, NULL, NULL, true },
   { DartUtils::kIOLibURL, io_source_paths_,
     DartUtils::kIOLibPatchURL, io_patch_paths_, true },
 };
diff --git a/runtime/bin/builtin.h b/runtime/bin/builtin.h
index 5808126..32fde81 100644
--- a/runtime/bin/builtin.h
+++ b/runtime/bin/builtin.h
@@ -61,7 +61,7 @@
 
   static const uint8_t* NativeSymbol(Dart_NativeFunction nf);
 
-  static const char* builtin_source_paths_[];
+  static const char* _builtin_source_paths_[];
   static const char* io_source_paths_[];
   static const char* io_patch_paths_[];
 
diff --git a/runtime/bin/io_natives.cc b/runtime/bin/io_natives.cc
index 5f90f22..b8050cf 100644
--- a/runtime/bin/io_natives.cc
+++ b/runtime/bin/io_natives.cc
@@ -54,18 +54,19 @@
   V(Process_Pid, 1)                                                            \
   V(Process_SetSignalHandler, 1)                                               \
   V(Process_ClearSignalHandler, 1)                                             \
-  V(SecureSocket_Connect, 9)                                                   \
+  V(SecureSocket_Connect, 10)                                                  \
   V(SecureSocket_Destroy, 1)                                                   \
+  V(SecureSocket_FilterPointer, 1)                                             \
+  V(SecureSocket_GetSelectedProtocol, 1)                                       \
   V(SecureSocket_Handshake, 1)                                                 \
   V(SecureSocket_Init, 1)                                                      \
+  V(SecureSocket_InitializeLibrary, 3)                                         \
   V(SecureSocket_PeerCertificate, 1)                                           \
   V(SecureSocket_RegisterBadCertificateCallback, 2)                            \
   V(SecureSocket_RegisterHandshakeCompleteCallback, 2)                         \
   V(SecureSocket_Renegotiate, 4)                                               \
-  V(SecureSocket_InitializeLibrary, 3)                                         \
-  V(SecureSocket_FilterPointer, 1)                                             \
-  V(ServerSocket_CreateBindListen, 5)                                          \
   V(ServerSocket_Accept, 2)                                                    \
+  V(ServerSocket_CreateBindListen, 5)                                          \
   V(Socket_CreateConnect, 3)                                                   \
   V(Socket_CreateBindDatagram, 4)                                              \
   V(Socket_Available, 1)                                                       \
diff --git a/runtime/bin/secure_socket.cc b/runtime/bin/secure_socket.cc
index 350bc64..2e22fef 100644
--- a/runtime/bin/secure_socket.cc
+++ b/runtime/bin/secure_socket.cc
@@ -60,6 +60,7 @@
     free(const_cast<char*>(message));
   }
   Dart_ThrowException(exception);
+  UNREACHABLE();
 }
 
 
@@ -121,6 +122,8 @@
       DartUtils::GetBooleanValue(Dart_GetNativeArgument(args, 7));
   bool send_client_certificate =
       DartUtils::GetBooleanValue(Dart_GetNativeArgument(args, 8));
+  Dart_Handle protocols_handle =
+      ThrowIfError(Dart_GetNativeArgument(args, 9));
 
   const char* host_name = NULL;
   // TODO(whesse): Is truncating a Dart string containing \0 what we want?
@@ -142,6 +145,10 @@
   // If this is a server connection, it must have a certificate to connect with.
   ASSERT(!is_server || certificate_name != NULL);
 
+  // The protocols_handle is guaranteed to be a valid Uint8List.
+  // It will have the correct length encoding of the protocols array.
+  ASSERT(!Dart_IsNull(protocols_handle));
+
   GetFilter(args)->Connect(host_name,
                            &raw_addr,
                            static_cast<int>(port),
@@ -149,7 +156,8 @@
                            certificate_name,
                            request_client_certificate,
                            require_client_certificate,
-                           send_client_certificate);
+                           send_client_certificate,
+                           protocols_handle);
 }
 
 
@@ -166,6 +174,12 @@
 }
 
 
+void FUNCTION_NAME(SecureSocket_GetSelectedProtocol)(
+    Dart_NativeArguments args) {
+  GetFilter(args)->GetSelectedProtocol(args);
+}
+
+
 void FUNCTION_NAME(SecureSocket_Renegotiate)(Dart_NativeArguments args) {
   bool use_session_cache =
       DartUtils::GetBooleanValue(Dart_GetNativeArgument(args, 1));
@@ -658,7 +672,8 @@
                         const char* certificate_name,
                         bool request_client_certificate,
                         bool require_client_certificate,
-                        bool send_client_certificate) {
+                        bool send_client_certificate,
+                        Dart_Handle protocols_handle) {
   is_server_ = is_server;
   if (in_handshake_) {
     FATAL("Connect called twice on the same _SecureFilter.");
@@ -673,12 +688,49 @@
     ThrowPRException("TlsException", "Failed SSL_ImportFD call");
   }
 
+
+  SECStatus status;
+
+  // Enable ALPN (application layer protocol negogiation) if the caller provides
+  // a valid list of supported protocols.
+  {
+    Dart_TypedData_Type protocols_type;
+    uint8_t* protocol_string = NULL;
+    intptr_t protocol_string_len = 0;
+
+    Dart_Handle result = Dart_TypedDataAcquireData(
+        protocols_handle,
+        &protocols_type,
+        reinterpret_cast<void**>(&protocol_string),
+        &protocol_string_len);
+    if (Dart_IsError(result)) {
+      Dart_PropagateError(result);
+    }
+
+    if (protocols_type != Dart_TypedData_kUint8) {
+      Dart_TypedDataReleaseData(protocols_handle);
+      Dart_PropagateError(Dart_NewApiError(
+          "Unexpected type for protocols (expected valid Uint8List)."));
+    }
+
+    if (protocol_string_len > 0) {
+      status = SSL_OptionSet(filter_, SSL_ENABLE_ALPN, PR_TRUE);
+      ASSERT(status == SECSuccess);
+
+      status = SSL_SetNextProtoNego(filter_,
+                                    protocol_string,
+                                    protocol_string_len);
+      ASSERT(status == SECSuccess);
+    }
+
+    Dart_TypedDataReleaseData(protocols_handle);
+  }
+
   SSLVersionRange vrange;
   vrange.min = SSL_LIBRARY_VERSION_3_0;
   vrange.max = SSL_LIBRARY_VERSION_TLS_1_2;
   SSL_VersionRangeSet(filter_, &vrange);
 
-  SECStatus status;
   if (is_server) {
     CERTCertificate* certificate = NULL;
     if (strstr(certificate_name, "CN=") != NULL) {
@@ -720,6 +772,7 @@
             certificate_name);
       }
     }
+
     // kt_rsa (key type RSA) is an enum constant from the NSS libraries.
     // TODO(whesse): Allow different key types.
     status = SSL_ConfigSecureServer(filter_, certificate, key, kt_rsa);
@@ -823,6 +876,46 @@
   }
 }
 
+void SSLFilter::GetSelectedProtocol(Dart_NativeArguments args) {
+  // Space for the selected protocol.
+  const unsigned int kBufferSize = 256;
+  unsigned char buffer[kBufferSize + 1];
+
+  unsigned int outLength = 0;
+  SSLNextProtoState outState;
+
+  SECStatus status = SSL_GetNextProto(
+      filter_, &outState, buffer, &outLength, kBufferSize);
+  if (status == SECSuccess) {
+    if (outState == SSL_NEXT_PROTO_SELECTED ||
+        outState == SSL_NEXT_PROTO_NEGOTIATED) {
+      ASSERT(outLength <= kBufferSize);
+      buffer[outLength] = '\0';
+      Dart_Handle protocol_string = DartUtils::NewString(
+          reinterpret_cast<const char *>(&buffer[0]));
+      if (Dart_IsError(protocol_string)) {
+        ThrowPRException("HandshakeException",
+                         "Protocol selected via ALPN, unable to get protocol "
+                         "string.");
+      } else {
+        Dart_SetReturnValue(args, protocol_string);
+      }
+    } else if (outState == SSL_NEXT_PROTO_NO_OVERLAP) {
+      ThrowPRException("HandshakeException",
+                       "Client and Server could not agree upon a protocol");
+    } else if (outState == SSL_NEXT_PROTO_NO_SUPPORT) {
+      // A value of `null` denotes that the client did not support protocol
+      // negogiation.
+      Dart_SetReturnValue(args, Dart_Null());
+    } else {
+      UNREACHABLE();
+    }
+  } else {
+    ThrowPRException("HandshakeException",
+                     "Could not retrieve selected protocol via ALPN");
+  }
+}
+
 
 void SSLFilter::Renegotiate(bool use_session_cache,
                             bool request_client_certificate,
diff --git a/runtime/bin/secure_socket.h b/runtime/bin/secure_socket.h
index ba8eb4f..eb77fe2 100644
--- a/runtime/bin/secure_socket.h
+++ b/runtime/bin/secure_socket.h
@@ -61,9 +61,11 @@
                const char* certificate_name,
                bool request_client_certificate,
                bool require_client_certificate,
-               bool send_client_certificate);
+               bool send_client_certificate,
+               Dart_Handle protocols_handle);
   void Destroy();
   void Handshake();
+  void GetSelectedProtocol(Dart_NativeArguments args);
   void Renegotiate(bool use_session_cache,
                    bool request_client_certificate,
                    bool require_client_certificate);
diff --git a/runtime/bin/secure_socket_patch.dart b/runtime/bin/secure_socket_patch.dart
index 450738a..4e22a14 100644
--- a/runtime/bin/secure_socket_patch.dart
+++ b/runtime/bin/secure_socket_patch.dart
@@ -42,6 +42,13 @@
     }
     return _raw.peerCertificate;
   }
+
+  String get selectedProtocol {
+    if (_raw == null) {
+     throw new StateError("selectedProtocol called on destroyed SecureSocket");
+    }
+    return _raw.selectedProtocol;
+  }
 }
 
 
@@ -78,7 +85,8 @@
                String certificateName,
                bool requestClientCertificate,
                bool requireClientCertificate,
-               bool sendClientCertificate) native "SecureSocket_Connect";
+               bool sendClientCertificate,
+               Uint8List protocols) native "SecureSocket_Connect";
 
   void destroy() {
     buffers = null;
@@ -89,10 +97,13 @@
 
   void handshake() native "SecureSocket_Handshake";
 
+  String selectedProtocol() native "SecureSocket_GetSelectedProtocol";
+
   void renegotiate(bool useSessionCache,
                    bool requestClientCertificate,
                    bool requireClientCertificate)
       native "SecureSocket_Renegotiate";
+
   void init() native "SecureSocket_Init";
 
   X509Certificate get peerCertificate native "SecureSocket_PeerCertificate";
diff --git a/runtime/bin/secure_socket_unsupported.cc b/runtime/bin/secure_socket_unsupported.cc
index f382425..ff7cce6 100644
--- a/runtime/bin/secure_socket_unsupported.cc
+++ b/runtime/bin/secure_socket_unsupported.cc
@@ -41,6 +41,13 @@
 }
 
 
+void FUNCTION_NAME(SecureSocket_GetSelectedProtocol)(
+    Dart_NativeArguments args) {
+  Dart_ThrowException(DartUtils::NewDartArgumentError(
+      "Secure Sockets unsupported on this platform"));
+}
+
+
 void FUNCTION_NAME(SecureSocket_RegisterHandshakeCompleteCallback)(
     Dart_NativeArguments args) {
   Dart_ThrowException(DartUtils::NewDartArgumentError(
diff --git a/runtime/lib/corelib_sources.gypi b/runtime/lib/core_sources.gypi
similarity index 100%
rename from runtime/lib/corelib_sources.gypi
rename to runtime/lib/core_sources.gypi
diff --git a/runtime/lib/integers.cc b/runtime/lib/integers.cc
index 783b8d3..257e680 100644
--- a/runtime/lib/integers.cc
+++ b/runtime/lib/integers.cc
@@ -36,13 +36,6 @@
 }
 
 
-static int BitLengthInt64(int64_t value) {
-  value ^= value >> (8 * sizeof(value) - 1);  // flip bits if negative.
-  // TODO(regis): Utils::HighestBit handles negative values. Why the above?
-  return value == 0 ? 0 : Utils::HighestBit(value) + 1;
-}
-
-
 DEFINE_NATIVE_ENTRY(Integer_bitAndFromInteger, 2) {
   const Integer& right = Integer::CheckedHandle(arguments->NativeArgAt(0));
   GET_NON_NULL_NATIVE_ARGUMENT(Integer, left, arguments->NativeArgAt(1));
@@ -365,7 +358,7 @@
     OS::Print("Smi_bitLength: %s\n", operand.ToCString());
   }
   int64_t value = operand.AsInt64Value();
-  intptr_t result = BitLengthInt64(value);
+  intptr_t result = Utils::BitLength(value);
   ASSERT(Smi::IsValid(result));
   return Smi::New(result);
 }
@@ -391,7 +384,7 @@
     OS::Print("Mint_bitLength: %s\n", operand.ToCString());
   }
   int64_t value = operand.AsInt64Value();
-  intptr_t result = BitLengthInt64(value);
+  intptr_t result = Utils::BitLength(value);
   ASSERT(Smi::IsValid(result));
   return Smi::New(result);
 }
diff --git a/runtime/platform/globals.h b/runtime/platform/globals.h
index ac0ab6f..1e8b786 100644
--- a/runtime/platform/globals.h
+++ b/runtime/platform/globals.h
@@ -98,8 +98,8 @@
 
 struct simd128_value_t {
   union {
-    float float_storage[4];
     int32_t int_storage[4];
+    float float_storage[4];
     double double_storage[2];
   };
   simd128_value_t& readFrom(const float* v) {
diff --git a/runtime/platform/utils.h b/runtime/platform/utils.h
index a46db44..8eff2f4 100644
--- a/runtime/platform/utils.h
+++ b/runtime/platform/utils.h
@@ -81,6 +81,12 @@
 
   static int HighestBit(int64_t v);
 
+  static int BitLength(int64_t value) {
+    // Flip bits if negative (-1 becomes 0).
+    value ^= value >> (8 * sizeof(value) - 1);
+    return (value == 0) ? 0 : (Utils::HighestBit(value) + 1);
+  }
+
   static int CountLeadingZeros(uword x);
   static int CountTrailingZeros(uword x);
 
diff --git a/runtime/tests/vm/vm.status b/runtime/tests/vm/vm.status
index 7e7ab4f..2b8ec1a 100644
--- a/runtime/tests/vm/vm.status
+++ b/runtime/tests/vm/vm.status
@@ -27,10 +27,6 @@
 cc/VerifyImplicit_Crash: Crash
 cc/VerifyExplicit_Crash: Crash
 
-[ $mode == debug && $system == windows ]
-cc/VerifiedMemoryBasic: Crash # Issue 21469
-cc/VerifiedMemoryAccept: Crash # Issue 21469
-
 # The following section refers to the dart vm tests which live under
 # runtime/tests/vm/dart.
 [ $system == windows ]
diff --git a/runtime/third_party/double-conversion/src/BUILD.gn b/runtime/third_party/double-conversion/src/BUILD.gn
new file mode 100644
index 0000000..5aaa53b
--- /dev/null
+++ b/runtime/third_party/double-conversion/src/BUILD.gn
@@ -0,0 +1,32 @@
+# Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+
+static_library("libdouble_conversion") {
+  configs += [ "../../..:dart_config", ]
+  sources = [
+    "bignum.cc",
+    "bignum.h",
+    "bignum-dtoa.cc",
+    "bignum-dtoa.h",
+    "cached-powers.cc",
+    "cached-powers.h",
+    "diy-fp.cc",
+    "diy-fp.h",
+    "double-conversion.cc",
+    "double-conversion.h",
+    "fast-dtoa.cc",
+    "fast-dtoa.h",
+    "fixed-dtoa.cc",
+    "fixed-dtoa.h",
+    "ieee.h",
+    "strtod.cc",
+    "strtod.h",
+    "utils.h",
+  ]
+  include_dirs = [
+    ".",
+  ]
+}
+
diff --git a/runtime/third_party/jscre/BUILD.gn b/runtime/third_party/jscre/BUILD.gn
new file mode 100644
index 0000000..59c91a8
--- /dev/null
+++ b/runtime/third_party/jscre/BUILD.gn
@@ -0,0 +1,27 @@
+# Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+static_library("libjscre") {
+  configs += [ "../..:dart_config", ]
+  defines = [
+    "SUPPORT_UTF8",
+    "SUPPORT_UCP",
+    "NO_RECURSE",
+  ]
+  sources = [
+    "ASCIICType.h",
+    "config.h",
+    "pcre.h",
+    "pcre_internal.h",
+    "ucpinternal.h",
+    "pcre_compile.cpp",
+    "pcre_exec.cpp",
+    "pcre_tables.cpp",
+    "pcre_ucp_searchfuncs.cpp",
+    "pcre_xclass.cpp",
+  ]
+  include_dirs = [
+    ".",
+  ]
+}
diff --git a/runtime/vm/BUILD.gn b/runtime/vm/BUILD.gn
new file mode 100644
index 0000000..b1afc4f
--- /dev/null
+++ b/runtime/vm/BUILD.gn
@@ -0,0 +1,201 @@
+# Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+config("libdart_vm_config") {
+  libs = [
+    "pthread",
+    "rt",
+    "dl",
+  ]
+}
+
+
+static_library("libdart_platform") {
+  configs += ["..:dart_config"]
+  public_configs = [":libdart_vm_config"]
+
+  platform_headers_gypi =
+      exec_script("../../tools/gypi_to_gn.py",
+                  [rebase_path("../platform/platform_headers.gypi")],
+                  "scope",
+                  ["../platform/platform_headers.gypi"])
+  platform_headers =
+      rebase_path(platform_headers_gypi.sources, ".", "../platform")
+
+  platform_sources_gypi =
+      exec_script("../../tools/gypi_to_gn.py",
+                  [rebase_path("../platform/platform_sources.gypi")],
+                  "scope",
+                  ["../platform/platform_sources.gypi"])
+  platform_sources =
+      rebase_path(platform_sources_gypi.sources, ".", "../platform")
+
+  sources = platform_headers + platform_sources
+  include_dirs = [
+    "..",
+  ]
+}
+
+
+static_library("libdart_vm") {
+  configs += ["..:dart_config"]
+  public_configs = [":libdart_vm_config"]
+  deps = [ ":generate_service_cc_file", ]
+
+  vm_sources_list = exec_script("../../tools/gypi_to_gn.py",
+                                [rebase_path("vm_sources.gypi")],
+                                "scope",
+                                ["vm_sources.gypi"])
+
+  set_sources_assignment_filter(["*_test.cc", "*_test.h"])
+  sources = vm_sources_list.sources
+            + ["$target_gen_dir/service_gen.cc",]
+            - ["vtune.cc", "vtune.h"]
+  include_dirs = [
+    "..",
+  ]
+}
+
+
+template("generate_library_source") {
+  assert(defined(invoker.libname), "Need libname in $target_name")
+  assert(defined(invoker.filename), "Need a filename in $target_name")
+  assert(defined(invoker.kind), "Need kind in $target_name")
+  assert(defined(invoker.output), "Need output in $target_name")
+  action(target_name) {
+    visibility = [ ":*" ]  # Only targets in this file can see this.
+    libname = invoker.libname
+    filename = invoker.filename
+    kind = invoker.kind
+
+    if (kind == "source") {
+      path = "../../sdk/lib/${filename}"
+    } else {
+      path = "../lib"
+    }
+
+    lib_sources_gypi =
+        exec_script("../../tools/gypi_to_gn.py",
+                    [rebase_path("${path}/${filename}_sources.gypi")],
+                    "scope",
+                    ["${path}/${filename}_sources.gypi"])
+    lib_sources =
+        rebase_path(lib_sources_gypi.sources, ".", path)
+
+    script = "../tools/gen_library_src_paths.py"
+    inputs = [
+      "../tools/gen_library_src_paths.py",
+      "../lib/libgen_in.cc",
+    ]
+    outputs = [ invoker.output, ]
+    args = [
+      "--output", rebase_path(invoker.output, root_build_dir),
+      "--input_cc", rebase_path("../lib/libgen_in.cc", root_build_dir),
+      "--include", "vm/bootstrap.h",
+      "--var_name", "dart::Bootstrap::${libname}_${kind}_paths_",
+      "--library_name", "dart:${libname}",] +
+      rebase_path(lib_sources, root_build_dir)
+  }
+}
+
+
+# This templates expects invoker.sources to be a list of pairs of strings.
+# The pairs of strings mean the following.
+# library name, file name
+# e.g. for the "internal" library named "dart:_internal",
+# with sources listed at sdk/lib/internal/internal_sources.gypi and
+# lib/internal_sources.gypi, we have: ["_internal", "internal"]
+#
+# The template iterates over the list, and generates generate_library_source
+# actions for each. After that, it generates targets to compile the generated
+# sources to make libdart_lib_withcore and libdart_lib.
+template("generate_core_libraries") {
+  assert(defined(invoker.sources), "Need sources in $target_name")
+  liboutputs = []
+  libsources = []
+  libdeps = []
+  foreach(lib, invoker.sources) {
+    libname = lib[0]
+    filename = lib[1]
+    generate_library_source("generate_${filename}_cc_file") {
+      libname = libname
+      filename = filename
+      kind = "source"
+      output = "$target_gen_dir/${filename}_gen.cc"
+    }
+    generate_library_source("generate_${filename}_patch_cc_file") {
+      libname = libname
+      filename = filename
+      kind = "patch"
+      output = "$target_gen_dir/${filename}_patch_gen.cc"
+    }
+    lib_sources_gypi =
+        exec_script("../../tools/gypi_to_gn.py",
+                    [rebase_path("../lib/${filename}_sources.gypi")],
+                    "scope",
+                    ["../lib/${filename}_sources.gypi"])
+    libsources += rebase_path(lib_sources_gypi.sources, ".", "../lib")
+    liboutputs += ["$target_gen_dir/${filename}_gen.cc",
+                   "$target_gen_dir/${filename}_patch_gen.cc"]
+    libdeps += [":generate_${filename}_cc_file",
+                ":generate_${filename}_patch_cc_file"]
+  }
+
+  static_library("libdart_lib_withcore") {
+    configs += ["..:dart_config"]
+    deps = libdeps
+    sources = libsources + ["bootstrap.cc"] + liboutputs
+    include_dirs = [
+      "..",
+    ]
+  }
+  static_library("libdart_lib") {
+    configs += ["..:dart_config"]
+    sources = libsources + [ "bootstrap_nocore.cc", ]
+    include_dirs = [
+      "..",
+    ]
+  }
+}
+
+
+generate_core_libraries("core_libraries") {
+  sources = [
+    ["async", "async"],
+    ["core", "core"],
+    ["collection", "collection"],
+    ["convert", "convert"],
+    ["_internal", "internal"],
+    ["isolate", "isolate"],
+    ["math", "math"],
+    ["mirrors", "mirrors"],
+    ["typed_data", "typed_data"],
+    ["profiler", "profiler"],
+  ]
+}
+
+
+action("generate_service_cc_file") {
+  visibility = [ ":*" ]  # Only targets in this file can see this.
+  script = "../tools/create_resources.py"
+  sources = [
+    "service/client.dart",
+    "service/constants.dart",
+    "service/message.dart",
+    "service/message_router.dart",
+    "service/running_isolate.dart",
+    "service/running_isolates.dart",
+    "service/vmservice.dart",
+  ]
+
+  output = "$target_gen_dir/service_gen.cc"
+  outputs = [ output, ]
+
+  args = [
+    "--output", rebase_path(output, root_build_dir),
+    "--outer_namespace", "dart",
+    "--table_name", "service",
+    "--root_prefix", rebase_path("service/", root_build_dir)] +
+    rebase_path(sources, root_build_dir)
+}
diff --git a/runtime/vm/assembler_arm64.h b/runtime/vm/assembler_arm64.h
index 9f7018f..d2623b2 100644
--- a/runtime/vm/assembler_arm64.h
+++ b/runtime/vm/assembler_arm64.h
@@ -675,6 +675,9 @@
   void smulh(Register rd, Register rn, Register rm) {
     EmitMiscDP3Source(SMULH, rd, rn, rm, R0, kDoubleWord);
   }
+  void umaddl(Register rd, Register rn, Register rm, Register ra) {
+    EmitMiscDP3Source(UMADDL, rd, rn, rm, ra, kDoubleWord);
+  }
 
   // Move wide immediate.
   void movk(Register rd, const Immediate& imm, int hw_idx) {
@@ -782,7 +785,7 @@
 
   // Conditional branch.
   void b(Label* label, Condition cond = AL) {
-    EmitBranch(BCOND, cond, label);
+    EmitConditionalBranch(BCOND, cond, label);
   }
 
   void b(int32_t offset) {
@@ -792,7 +795,13 @@
     EmitUnconditionalBranchOp(BL, offset);
   }
 
-  // TODO(zra): cbz, cbnz.
+  void cbz(Label* label, Register rt, OperandSize sz = kDoubleWord) {
+    EmitCompareAndBranch(CBZ, rt, label, sz);
+  }
+
+  void cbnz(Label* label, Register rt, OperandSize sz = kDoubleWord) {
+    EmitCompareAndBranch(CBNZ, rt, label, sz);
+  }
 
   // Branch, link, return.
   void br(Register rn) {
@@ -1580,13 +1589,31 @@
     return static_cast<int64_t>(off);
   }
 
+  bool IsConditionalBranch(int32_t instr) {
+    return (instr & ConditionalBranchMask) ==
+           (ConditionalBranchFixed & ConditionalBranchMask);
+  }
+
+  bool IsCompareAndBranch(int32_t instr) {
+    return (instr & CompareAndBranchMask) ==
+           (CompareAndBranchFixed & CompareAndBranchMask);
+  }
+
   Condition DecodeImm19BranchCondition(int32_t instr) {
-    return static_cast<Condition>((instr & kCondMask) >> kCondShift);
+    if (IsConditionalBranch(instr)) {
+      return static_cast<Condition>((instr & kCondMask) >> kCondShift);
+    }
+    ASSERT(IsCompareAndBranch(instr));
+    return (instr & B24) ? EQ : NE;  // cbz : cbnz
   }
 
   int32_t EncodeImm19BranchCondition(Condition cond, int32_t instr) {
-    const int32_t c_imm = static_cast<int32_t>(cond);
-    return (instr & ~kCondMask) | (c_imm << kCondShift);
+    if (IsConditionalBranch(instr)) {
+      const int32_t c_imm = static_cast<int32_t>(cond);
+      return (instr & ~kCondMask) | (c_imm << kCondShift);
+    }
+    ASSERT(IsCompareAndBranch(instr));
+    return (instr & ~B24) | (cond == EQ ? B24 : 0);  // cbz : cbnz
   }
 
   int32_t EncodeImm26BranchOffset(int64_t imm, int32_t instr) {
@@ -1600,8 +1627,8 @@
     return static_cast<int64_t>(off);
   }
 
-  void EmitCompareAndBranch(CompareAndBranchOp op, Register rt, int64_t imm,
-                            OperandSize sz) {
+  void EmitCompareAndBranchOp(CompareAndBranchOp op, Register rt, int64_t imm,
+                              OperandSize sz) {
     ASSERT((sz == kDoubleWord) || (sz == kWord) || (sz == kUnsignedWord));
     ASSERT(Utils::IsInt(21, imm) && ((imm & 0x3) == 0));
     ASSERT((rt != CSP) && (rt != R31));
@@ -1615,8 +1642,8 @@
     Emit(encoding);
   }
 
-  void EmitConditionalBranch(ConditionalBranchOp op, Condition cond,
-                             int64_t imm) {
+  void EmitConditionalBranchOp(ConditionalBranchOp op, Condition cond,
+                               int64_t imm) {
     const int32_t off = EncodeImm19BranchOffset(imm, 0);
     const int32_t encoding =
         op |
@@ -1630,7 +1657,8 @@
     return Utils::IsInt(21, offset);
   }
 
-  void EmitBranch(ConditionalBranchOp op, Condition cond, Label* label) {
+  void EmitConditionalBranch(ConditionalBranchOp op, Condition cond,
+                             Label* label) {
     if (label->IsBound()) {
       const int64_t dest = label->Position() - buffer_.Size();
       if (use_far_branches() && !CanEncodeImm19BranchOffset(dest)) {
@@ -1639,12 +1667,12 @@
           // no need for a guard branch.
           b(dest);
         } else {
-          EmitConditionalBranch(
+          EmitConditionalBranchOp(
               op, InvertCondition(cond), 2 * Instr::kInstrSize);
           b(dest);
         }
       } else {
-        EmitConditionalBranch(op, cond, dest);
+        EmitConditionalBranchOp(op, cond, dest);
       }
     } else {
       const int64_t position = buffer_.Size();
@@ -1652,10 +1680,35 @@
         // When cond is AL, this guard branch will be rewritten as a nop when
         // the label is bound. We don't write it as a nop initially because it
         // makes the decoding code in Bind simpler.
-        EmitConditionalBranch(op, InvertCondition(cond), 2 * Instr::kInstrSize);
+        EmitConditionalBranchOp(
+            op, InvertCondition(cond), 2 * Instr::kInstrSize);
         b(label->position_);
       } else {
-        EmitConditionalBranch(op, cond, label->position_);
+        EmitConditionalBranchOp(op, cond, label->position_);
+      }
+      label->LinkTo(position);
+    }
+  }
+
+  void EmitCompareAndBranch(CompareAndBranchOp op, Register rt,
+                            Label* label, OperandSize sz) {
+    if (label->IsBound()) {
+      const int64_t dest = label->Position() - buffer_.Size();
+      if (use_far_branches() && !CanEncodeImm19BranchOffset(dest)) {
+          EmitCompareAndBranchOp(
+              op == CBZ ? CBNZ : CBZ, rt, 2 * Instr::kInstrSize, sz);
+          b(dest);
+      } else {
+        EmitCompareAndBranchOp(op, rt, dest, sz);
+      }
+    } else {
+      const int64_t position = buffer_.Size();
+      if (use_far_branches()) {
+        EmitCompareAndBranchOp(
+            op == CBZ ? CBNZ : CBZ, rt, 2 * Instr::kInstrSize, sz);
+        b(label->position_);
+      } else {
+        EmitCompareAndBranchOp(op, rt, label->position_, sz);
       }
       label->LinkTo(position);
     }
diff --git a/runtime/vm/assembler_arm64_test.cc b/runtime/vm/assembler_arm64_test.cc
index 6bb2e33..bb6bd0a 100644
--- a/runtime/vm/assembler_arm64_test.cc
+++ b/runtime/vm/assembler_arm64_test.cc
@@ -887,6 +887,82 @@
 }
 
 
+ASSEMBLER_TEST_GENERATE(CmpBranchIfZero, assembler) {
+  Label l;
+
+  __ movz(R0, Immediate(42), 0);
+  __ movz(R1, Immediate(0), 0);
+
+  __ cbz(&l, R1);
+  __ movz(R0, Immediate(0), 0);
+  __ Bind(&l);
+  __ ret();
+}
+
+
+ASSEMBLER_TEST_RUN(CmpBranchIfZero, test) {
+  typedef int64_t (*Int64Return)() DART_UNUSED;
+  EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry()));
+}
+
+
+ASSEMBLER_TEST_GENERATE(CmpBranchIfZeroNotTaken, assembler) {
+  Label l;
+
+  __ movz(R0, Immediate(0), 0);
+  __ movz(R1, Immediate(1), 0);
+
+  __ cbz(&l, R1);
+  __ movz(R0, Immediate(42), 0);
+  __ Bind(&l);
+  __ ret();
+}
+
+
+ASSEMBLER_TEST_RUN(CmpBranchIfZeroNotTaken, test) {
+  typedef int64_t (*Int64Return)() DART_UNUSED;
+  EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry()));
+}
+
+
+ASSEMBLER_TEST_GENERATE(CmpBranchIfNotZero, assembler) {
+  Label l;
+
+  __ movz(R0, Immediate(42), 0);
+  __ movz(R1, Immediate(1), 0);
+
+  __ cbnz(&l, R1);
+  __ movz(R0, Immediate(0), 0);
+  __ Bind(&l);
+  __ ret();
+}
+
+
+ASSEMBLER_TEST_RUN(CmpBranchIfNotZero, test) {
+  typedef int64_t (*Int64Return)() DART_UNUSED;
+  EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry()));
+}
+
+
+ASSEMBLER_TEST_GENERATE(CmpBranchIfNotZeroNotTaken, assembler) {
+  Label l;
+
+  __ movz(R0, Immediate(0), 0);
+  __ movz(R1, Immediate(0), 0);
+
+  __ cbnz(&l, R1);
+  __ movz(R0, Immediate(42), 0);
+  __ Bind(&l);
+  __ ret();
+}
+
+
+ASSEMBLER_TEST_RUN(CmpBranchIfNotZeroNotTaken, test) {
+  typedef int64_t (*Int64Return)() DART_UNUSED;
+  EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry()));
+}
+
+
 ASSEMBLER_TEST_GENERATE(FcmpEqBranch, assembler) {
   Label l;
 
@@ -1373,6 +1449,21 @@
 }
 
 
+ASSEMBLER_TEST_GENERATE(Umaddl, assembler) {
+  __ movn(R1, Immediate(0), 0);  // W1 = 0xffffffff.
+  __ movz(R2, Immediate(7), 0);  // W2 = 7.
+  __ movz(R3, Immediate(8), 0);  // X3 = 8.
+  __ umaddl(R0, R1, R2, R3);  // X0 = W1*W2 + X3 = 0x700000001.
+  __ ret();
+}
+
+
+ASSEMBLER_TEST_RUN(Umaddl, test) {
+  typedef int64_t (*Int64Return)() DART_UNUSED;
+  EXPECT_EQ(0x700000001, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry()));
+}
+
+
 // Loading immediate values without the object pool.
 ASSEMBLER_TEST_GENERATE(LoadImmediateSmall, assembler) {
   __ LoadImmediate(R0, 42, kNoRegister);
diff --git a/runtime/vm/assembler_ia32.cc b/runtime/vm/assembler_ia32.cc
index fcbdb65..8133003 100644
--- a/runtime/vm/assembler_ia32.cc
+++ b/runtime/vm/assembler_ia32.cc
@@ -2259,6 +2259,24 @@
 }
 
 
+void Assembler::StoreIntoSmiField(const Address& dest, Register value) {
+  movl(dest, value);
+#if defined(DEBUG)
+  Label done;
+  testl(value, Immediate(kHeapObjectTag));
+  j(ZERO, &done);
+  Stop("Smi expected");
+  Bind(&done);
+#endif  // defined(DEBUG)
+}
+
+
+void Assembler::IncrementSmiField(const Address& dest, int32_t increment) {
+  // TODO(koda): Implement testl for addresses and check that dest is a smi.
+  addl(dest, Immediate(Smi::RawValue(increment)));
+}
+
+
 void Assembler::LoadDoubleConstant(XmmRegister dst, double value) {
   // TODO(5410843): Need to have a code constants table.
   int64_t constant = bit_cast<int64_t, double>(value);
diff --git a/runtime/vm/assembler_ia32.h b/runtime/vm/assembler_ia32.h
index 2610898..eb3f112 100644
--- a/runtime/vm/assembler_ia32.h
+++ b/runtime/vm/assembler_ia32.h
@@ -677,6 +677,11 @@
                                 const Address& dest,
                                 const Object& value);
 
+  // Stores a Smi value into a heap object field that always contains a Smi.
+  void StoreIntoSmiField(const Address& dest, Register value);
+  // Increments a Smi field. Leaves flags in same state as an 'addl'.
+  void IncrementSmiField(const Address& dest, int32_t increment);
+
   void DoubleNegate(XmmRegister d);
   void FloatNegate(XmmRegister f);
 
diff --git a/runtime/vm/assembler_mips_test.cc b/runtime/vm/assembler_mips_test.cc
index 9e124fe..399b1bb 100644
--- a/runtime/vm/assembler_mips_test.cc
+++ b/runtime/vm/assembler_mips_test.cc
@@ -505,8 +505,8 @@
 
 
 ASSEMBLER_TEST_GENERATE(Multu_hi, assembler) {
-  __ LoadImmediate(T1, 65536);
-  __ LoadImmediate(T2, 65536);
+  __ LoadImmediate(T1, -1);
+  __ LoadImmediate(T2, -1);
   __ multu(T1, T2);
   __ mfhi(V0);
   __ jr(RA);
@@ -515,7 +515,7 @@
 
 ASSEMBLER_TEST_RUN(Multu_hi, test) {
   typedef int (*SimpleCode)() DART_UNUSED;
-  EXPECT_EQ(1, EXECUTE_TEST_CODE_INT32(SimpleCode, test->entry()));
+  EXPECT_EQ(-2, EXECUTE_TEST_CODE_INT32(SimpleCode, test->entry()));
 }
 
 
diff --git a/runtime/vm/benchmark_test.cc b/runtime/vm/benchmark_test.cc
index 00b39e5..ccca86d 100644
--- a/runtime/vm/benchmark_test.cc
+++ b/runtime/vm/benchmark_test.cc
@@ -227,7 +227,7 @@
   char buffer[2048];
   char* dart2js_path = strdup(File::GetCanonicalPath(arg));
   const char* compiler_path =
-      "%s%ssdk%slib%s_internal%scompiler%scompiler.dart";
+      "%s%spkg%scompiler%slib%scompiler.dart";
   const char* path_separator = File::PathSeparator();
   ASSERT(path_separator != NULL && strlen(path_separator) == 1);
   char* ptr = strrchr(dart2js_path, *path_separator);
@@ -265,17 +265,34 @@
   return &func;
 }
 
+static void SetupDart2JSPackagePath() {
+  Dart_Handle builtin_lib =
+      bin::Builtin::LoadAndCheckLibrary(bin::Builtin::kBuiltinLibrary);
+  DART_CHECK_VALID(builtin_lib);
+
+  bool worked = bin::DartUtils::SetOriginalWorkingDirectory();
+  EXPECT(worked);
+  char buffer[2048];
+  char* executable_path =
+      strdup(File::GetCanonicalPath(Benchmark::Executable()));
+  const char* packages_path = "%s%s..%spackages";
+  const char* path_separator = File::PathSeparator();
+  OS::SNPrint(buffer, 2048, packages_path,
+              executable_path, path_separator, path_separator);
+  bin::DartUtils::PrepareForScriptLoading(buffer, builtin_lib);
+}
 
 BENCHMARK(Dart2JSCompileAll) {
   bin::Builtin::SetNativeResolver(bin::Builtin::kBuiltinLibrary);
   bin::Builtin::SetNativeResolver(bin::Builtin::kIOLibrary);
+  SetupDart2JSPackagePath();
   char* dart_root = ComputeDart2JSPath(Benchmark::Executable());
   char* script = NULL;
   if (dart_root != NULL) {
     Isolate* isolate = Isolate::Current();
     HANDLESCOPE(isolate);
     const char* kFormatStr =
-        "import '%s/sdk/lib/_internal/compiler/compiler.dart';";
+        "import '%s/pkg/compiler/lib/compiler.dart';";
     intptr_t len = OS::SNPrint(NULL, 0, kFormatStr, dart_root) + 1;
     script = reinterpret_cast<char*>(malloc(len));
     EXPECT(script != NULL);
@@ -286,7 +303,7 @@
     EXPECT_VALID(lib);
   } else {
     Dart_Handle lib = TestCase::LoadTestScript(
-        "import 'sdk/lib/_internal/compiler/compiler.dart';",
+        "import 'pkg/compiler/lib/compiler.dart';",
         reinterpret_cast<Dart_NativeEntryResolver>(NativeResolver));
     EXPECT_VALID(lib);
   }
diff --git a/runtime/vm/bootstrap.cc b/runtime/vm/bootstrap.cc
index 56b7ea2..b66e18c 100644
--- a/runtime/vm/bootstrap.cc
+++ b/runtime/vm/bootstrap.cc
@@ -33,8 +33,8 @@
 static bootstrap_lib_props bootstrap_libraries[] = {
   INIT_LIBRARY(ObjectStore::kCore,
                core,
-               Bootstrap::corelib_source_paths_,
-               Bootstrap::corelib_patch_paths_),
+               Bootstrap::core_source_paths_,
+               Bootstrap::core_patch_paths_),
   INIT_LIBRARY(ObjectStore::kAsync,
                async,
                Bootstrap::async_source_paths_,
@@ -49,8 +49,8 @@
                Bootstrap::collection_patch_paths_),
   INIT_LIBRARY(ObjectStore::kInternal,
                _internal,
-               Bootstrap::internal_source_paths_,
-               Bootstrap::internal_patch_paths_),
+               Bootstrap::_internal_source_paths_,
+               Bootstrap::_internal_patch_paths_),
   INIT_LIBRARY(ObjectStore::kIsolate,
                isolate,
                Bootstrap::isolate_source_paths_,
diff --git a/runtime/vm/bootstrap.h b/runtime/vm/bootstrap.h
index 9a3c09b..3419828 100644
--- a/runtime/vm/bootstrap.h
+++ b/runtime/vm/bootstrap.h
@@ -21,10 +21,10 @@
 
   // Source path mapping for library URI and 'parts'.
   static const char* async_source_paths_[];
-  static const char* corelib_source_paths_[];
+  static const char* core_source_paths_[];
   static const char* collection_source_paths_[];
   static const char* convert_source_paths_[];
-  static const char* internal_source_paths_[];
+  static const char* _internal_source_paths_[];
   static const char* isolate_source_paths_[];
   static const char* json_source_paths_[];
   static const char* math_source_paths_[];
@@ -35,10 +35,10 @@
 
   // Source path mapping for patch URI and 'parts'.
   static const char* async_patch_paths_[];
-  static const char* corelib_patch_paths_[];
+  static const char* core_patch_paths_[];
   static const char* collection_patch_paths_[];
   static const char* convert_patch_paths_[];
-  static const char* internal_patch_paths_[];
+  static const char* _internal_patch_paths_[];
   static const char* isolate_patch_paths_[];
   static const char* math_patch_paths_[];
   static const char* mirrors_patch_paths_[];
diff --git a/runtime/vm/bootstrap_nocorelib.cc b/runtime/vm/bootstrap_nocore.cc
similarity index 100%
rename from runtime/vm/bootstrap_nocorelib.cc
rename to runtime/vm/bootstrap_nocore.cc
diff --git a/runtime/vm/code_patcher.h b/runtime/vm/code_patcher.h
index 10ab117..edce812 100644
--- a/runtime/vm/code_patcher.h
+++ b/runtime/vm/code_patcher.h
@@ -92,6 +92,9 @@
   static void InsertCallAt(uword start, uword target);
 
   static RawObject* GetEdgeCounterAt(uword pc, const Code& code);
+#if defined(TARGET_ARCH_IA32)
+  static int32_t EdgeCounterIncrementSizeInBytes();
+#endif  // TARGET_ARCH_IA32
 
   static int32_t GetPoolOffsetAt(uword return_address);
   static void SetPoolOffsetAt(uword return_address, int32_t offset);
diff --git a/runtime/vm/code_patcher_ia32.cc b/runtime/vm/code_patcher_ia32.cc
index d65c310..f4829de 100644
--- a/runtime/vm/code_patcher_ia32.cc
+++ b/runtime/vm/code_patcher_ia32.cc
@@ -274,7 +274,8 @@
 //  b8 imm32    mov EAX, immediate
 class EdgeCounter : public ValueObject {
  public:
-  EdgeCounter(uword pc, const Code& ignored) : end_(pc - kAdjust) {
+  EdgeCounter(uword pc, const Code& ignored)
+      : end_(pc - CodePatcher::EdgeCounterIncrementSizeInBytes()) {
     ASSERT(IsValid(end_));
   }
 
@@ -287,13 +288,16 @@
   }
 
  private:
+  uword end_;
+};
+
+
+int32_t CodePatcher::EdgeCounterIncrementSizeInBytes() {
   // The edge counter load is followed by the fixed-size edge counter
   // incrementing code:
   //     83 40 0b 02               add [eax+0xb],0x2
-  static const intptr_t kAdjust = 4;
-
-  uword end_;
-};
+  return 4;
+}
 
 
 RawObject* CodePatcher::GetEdgeCounterAt(uword pc, const Code& code) {
diff --git a/runtime/vm/constants_arm64.h b/runtime/vm/constants_arm64.h
index d420047..fd13edf 100644
--- a/runtime/vm/constants_arm64.h
+++ b/runtime/vm/constants_arm64.h
@@ -297,8 +297,8 @@
 enum CompareAndBranchOp {
   CompareAndBranchMask = 0x7e000000,
   CompareAndBranchFixed = CompareBranchFixed | B29,
-  CBZ = CompareBranchFixed,
-  CBNZ = CompareBranchFixed | B24,
+  CBZ = CompareAndBranchFixed,
+  CBNZ = CompareAndBranchFixed | B24,
 };
 
 // C.3.2.2
@@ -455,6 +455,7 @@
   MADD = MiscDP3SourceFixed,
   MSUB = MiscDP3SourceFixed | B15,
   SMULH = MiscDP3SourceFixed | B31 | B22,
+  UMADDL = MiscDP3SourceFixed | B31 | B23 | B21,
 };
 
 // C3.5.10
diff --git a/runtime/vm/constants_mips.h b/runtime/vm/constants_mips.h
index 8aae537..e850b2c 100644
--- a/runtime/vm/constants_mips.h
+++ b/runtime/vm/constants_mips.h
@@ -456,12 +456,18 @@
     kInstrSize = 4,
   };
 
+  static const int32_t kNopInstruction = 0;
+
+  // Reserved break instruction codes.
+  static const int32_t kStopMessageCode = 1 << 16;  // For Stop(message).
+  static const int32_t kRedirectCode = 2 << 16;  // For call redirection in sim.
+  static const int32_t kMsgMessageCode = 3 << 16;  // For trace message in sim.
+  static const int32_t kSimulatorBreakCode = 4 << 16;  // For breakpoint in sim.
+
+  // General breakpoint instruction: break(0), for user breakpoint and to fill
+  // assembler code buffers in debug mode.
   static const int32_t kBreakPointInstruction =
       (SPECIAL << kOpcodeShift) | (BREAK << kFunctionShift);
-  static const int32_t kNopInstruction = 0;
-  static const int32_t kStopMessageCode = 1;
-  static const int32_t kRedirectCode = 2;
-  static const int32_t kMsgMessageCode = 3;
 
   // Get the raw instruction bits.
   inline int32_t InstructionBits() const {
diff --git a/runtime/vm/dart.cc b/runtime/vm/dart.cc
index b7dbc3f..06625a6 100644
--- a/runtime/vm/dart.cc
+++ b/runtime/vm/dart.cc
@@ -80,7 +80,7 @@
                            Dart_ServiceIsolateCreateCalback service_create) {
   // TODO(iposva): Fix race condition here.
   if (vm_isolate_ != NULL || !Flags::Initialized()) {
-    return "VM already initialized.";
+    return "VM already initialized or flags not initialized.";
   }
   Isolate::SetFileCallbacks(file_open, file_read, file_write, file_close);
   Isolate::SetEntropySourceCallback(entropy_source);
diff --git a/runtime/vm/disassembler_arm64.cc b/runtime/vm/disassembler_arm64.cc
index 64ee372..dcfc848 100644
--- a/runtime/vm/disassembler_arm64.cc
+++ b/runtime/vm/disassembler_arm64.cc
@@ -1069,6 +1069,9 @@
   } else if ((instr->Bits(29, 2) == 0) && (instr->Bits(21, 3) == 2) &&
              (instr->Bit(15) == 0)) {
     Format(instr, "smulh 'rd, 'rn, 'rm");
+  } else if ((instr->Bits(29, 3) == 4) && (instr->Bits(21, 3) == 5) &&
+             (instr->Bit(15) == 0)) {
+    Format(instr, "umaddl 'rd, 'rn, 'rm, 'ra");
   } else {
     Unknown(instr);
   }
diff --git a/runtime/vm/flow_graph_builder.cc b/runtime/vm/flow_graph_builder.cc
index 3924811..8ed3f1d 100644
--- a/runtime/vm/flow_graph_builder.cc
+++ b/runtime/vm/flow_graph_builder.cc
@@ -3784,16 +3784,10 @@
                             parameter.type(),
                             parameter.name())) {
         Value* parameter_value = Bind(BuildLoadLocal(parameter));
-        AssertAssignableInstr* assert_assignable =
-            BuildAssertAssignable(parameter.token_pos(),
-                                  parameter_value,
-                                  parameter.type(),
-                                  parameter.name());
-        parameter_value = Bind(assert_assignable);
-        // Store the type checked argument back to its corresponding local
-        // variable so that ssa renaming detects the dependency and makes use
-        // of the checked type in type propagation.
-        Do(BuildStoreLocal(parameter, parameter_value));
+        Do(BuildAssertAssignable(parameter.token_pos(),
+                                 parameter_value,
+                                 parameter.type(),
+                                 parameter.name()));
       }
       pos++;
     }
diff --git a/runtime/vm/flow_graph_compiler_arm64.cc b/runtime/vm/flow_graph_compiler_arm64.cc
index 8513588..efe6b32 100644
--- a/runtime/vm/flow_graph_compiler_arm64.cc
+++ b/runtime/vm/flow_graph_compiler_arm64.cc
@@ -1600,7 +1600,14 @@
     ASSERT(source.IsConstant());
     const Object& constant = source.constant();
     if (destination.IsRegister()) {
-      __ LoadObject(destination.reg(), constant, PP);
+      if (constant.IsSmi() &&
+          (source.constant_instruction()->representation() == kUnboxedInt32)) {
+        __ LoadImmediate(destination.reg(),
+                         static_cast<int32_t>(Smi::Cast(constant).Value()),
+                         PP);
+      } else {
+        __ LoadObject(destination.reg(), constant, PP);
+      }
     } else if (destination.IsFpuRegister()) {
       const VRegister dst = destination.fpu_reg();
       if (Utils::DoublesBitEqual(Double::Cast(constant).value(), 0.0)) {
@@ -1624,7 +1631,14 @@
       ASSERT(destination.IsStackSlot());
       const intptr_t dest_offset = destination.ToStackSlotOffset();
       ScratchRegisterScope tmp(this, kNoRegister);
-      __ LoadObject(tmp.reg(), constant, PP);
+      if (constant.IsSmi() &&
+          (source.constant_instruction()->representation() == kUnboxedInt32)) {
+        __ LoadImmediate(tmp.reg(),
+                         static_cast<int32_t>(Smi::Cast(constant).Value()),
+                         PP);
+      } else {
+        __ LoadObject(tmp.reg(), constant, PP);
+      }
       __ StoreToOffset(tmp.reg(), destination.base_reg(), dest_offset, PP);
     }
   }
diff --git a/runtime/vm/flow_graph_compiler_ia32.cc b/runtime/vm/flow_graph_compiler_ia32.cc
index 5879192..5463ed7 100644
--- a/runtime/vm/flow_graph_compiler_ia32.cc
+++ b/runtime/vm/flow_graph_compiler_ia32.cc
@@ -8,6 +8,7 @@
 #include "vm/flow_graph_compiler.h"
 
 #include "vm/ast_printer.h"
+#include "vm/code_patcher.h"
 #include "vm/compiler.h"
 #include "vm/cpu.h"
 #include "vm/dart_entry.h"
@@ -1228,8 +1229,12 @@
   counter.SetAt(0, Smi::Handle(Smi::New(0)));
   __ Comment("Edge counter");
   __ LoadObject(EAX, counter);
-  __ addl(FieldAddress(EAX, Array::element_offset(0)),
-          Immediate(Smi::RawValue(1)));
+#if defined(DEBUG)
+  intptr_t increment_start = assembler_->CodeSize();
+#endif  // DEBUG
+  __ IncrementSmiField(FieldAddress(EAX, Array::element_offset(0)), 1);
+  DEBUG_ASSERT((assembler_->CodeSize() - increment_start) ==
+               CodePatcher::EdgeCounterIncrementSizeInBytes());
 }
 
 
diff --git a/runtime/vm/flow_graph_compiler_mips.cc b/runtime/vm/flow_graph_compiler_mips.cc
index c0ac35d..ab5fe5f 100644
--- a/runtime/vm/flow_graph_compiler_mips.cc
+++ b/runtime/vm/flow_graph_compiler_mips.cc
@@ -1650,7 +1650,12 @@
     ASSERT(source.IsConstant());
     const Object& constant = source.constant();
     if (destination.IsRegister()) {
-      __ LoadObject(destination.reg(), constant);
+      if (constant.IsSmi() &&
+          (source.constant_instruction()->representation() == kUnboxedInt32)) {
+        __ LoadImmediate(destination.reg(), Smi::Cast(constant).Value());
+      } else {
+        __ LoadObject(destination.reg(), constant);
+      }
     } else if (destination.IsFpuRegister()) {
       __ LoadObject(TMP, constant);
       __ LoadDFromOffset(destination.fpu_reg(), TMP,
@@ -1664,7 +1669,12 @@
       ASSERT(destination.IsStackSlot());
       const intptr_t dest_offset = destination.ToStackSlotOffset();
       ScratchRegisterScope tmp(this, kNoRegister);
-      __ LoadObject(tmp.reg(), constant);
+      if (constant.IsSmi() &&
+          (source.constant_instruction()->representation() == kUnboxedInt32)) {
+        __ LoadImmediate(tmp.reg(), Smi::Cast(constant).Value());
+      } else {
+        __ LoadObject(tmp.reg(), constant);
+      }
       __ StoreToOffset(tmp.reg(), destination.base_reg(), dest_offset);
     }
   }
diff --git a/runtime/vm/flow_graph_compiler_x64.cc b/runtime/vm/flow_graph_compiler_x64.cc
index 1c4b7d7..a7b1e2d 100644
--- a/runtime/vm/flow_graph_compiler_x64.cc
+++ b/runtime/vm/flow_graph_compiler_x64.cc
@@ -1595,6 +1595,9 @@
     if (destination.IsRegister()) {
       if (constant.IsSmi() && (Smi::Cast(constant).Value() == 0)) {
         __ xorq(destination.reg(), destination.reg());
+      } else if (constant.IsSmi() &&
+          (source.constant_instruction()->representation() == kUnboxedInt32)) {
+        __ movl(destination.reg(), Immediate(Smi::Cast(constant).Value()));
       } else {
         __ LoadObject(destination.reg(), constant, PP);
       }
@@ -1616,7 +1619,13 @@
       __ movsd(destination.ToStackSlotAddress(), XMM0);
     } else {
       ASSERT(destination.IsStackSlot());
-      StoreObject(destination.ToStackSlotAddress(), constant);
+      if (constant.IsSmi() &&
+          (source.constant_instruction()->representation() == kUnboxedInt32)) {
+        __ movl(destination.ToStackSlotAddress(),
+                Immediate(Smi::Cast(constant).Value()));
+      } else {
+        StoreObject(destination.ToStackSlotAddress(), constant);
+      }
     }
   }
 
diff --git a/runtime/vm/flow_graph_optimizer.cc b/runtime/vm/flow_graph_optimizer.cc
index 709d42b..13995c9 100644
--- a/runtime/vm/flow_graph_optimizer.cc
+++ b/runtime/vm/flow_graph_optimizer.cc
@@ -750,6 +750,57 @@
       break;
   }
 
+  if ((kSmiBits < 32) &&
+      (unboxed == kTagged) &&
+      phi->Type()->IsInt() &&
+      RangeUtils::Fits(phi->range(), RangeBoundary::kRangeBoundaryInt32)) {
+    // On 32-bit platforms conservatively unbox phis that:
+    //   - are proven to be of type Int;
+    //   - fit into 32bits range;
+    //   - have either constants or Box() operations as inputs;
+    //   - have at least one Box() operation as an input;
+    //   - are used in at least 1 Unbox() operation.
+    bool should_unbox = false;
+    for (intptr_t i = 0; i < phi->InputCount(); i++) {
+      Definition* input = phi->InputAt(i)->definition();
+      if (input->IsBox() &&
+          RangeUtils::Fits(input->range(),
+                           RangeBoundary::kRangeBoundaryInt32)) {
+        should_unbox = true;
+      } else if (!input->IsConstant()) {
+        should_unbox = false;
+        break;
+      }
+    }
+
+    if (should_unbox) {
+      // We checked inputs. Check if phi is used in at least one unbox
+      // operation.
+      bool has_unboxed_use = false;
+      for (Value* use = phi->input_use_list();
+           use != NULL;
+           use = use->next_use()) {
+        Instruction* instr = use->instruction();
+        if (instr->IsUnbox()) {
+          has_unboxed_use = true;
+          break;
+        } else if (IsUnboxedInteger(
+            instr->RequiredInputRepresentation(use->use_index()))) {
+          has_unboxed_use = true;
+          break;
+        }
+      }
+
+      if (!has_unboxed_use) {
+        should_unbox = false;
+      }
+    }
+
+    if (should_unbox) {
+      unboxed = kUnboxedInt32;
+    }
+  }
+
   phi->set_representation(unboxed);
 }
 
@@ -4862,6 +4913,7 @@
           smi_op->ReplaceWith(int32_op, NULL);
         } else if (defn->IsPhi()) {
           defn->AsPhi()->set_representation(kUnboxedInt32);
+          ASSERT(defn->Type()->IsInt());
         }
       }
     }
@@ -6313,19 +6365,15 @@
         }
 
         // For object allocation forward initial values of the fields to
-        // subsequent loads. For simplicity we ignore escaping objects.
-        //
-        // The reason to ignore escaping objects is that final fields are
+        // subsequent loads. For skip final fields.  Final fields are
         // initialized in constructor that potentially can be not inlined into
         // the function that we are currently optimizing. However at the same
         // time we assume that values of the final fields can be forwarded
         // across side-effects. If we add 'null' as known values for these
         // fields here we will incorrectly propagate this null across
         // constructor invocation.
-        // TODO(vegorov): record null-values at least for not final fields of
-        // escaping object.
         AllocateObjectInstr* alloc = instr->AsAllocateObject();
-        if ((alloc != NULL) && !aliased_set_->CanBeAliased(alloc)) {
+        if ((alloc != NULL)) {
           for (Value* use = alloc->input_use_list();
                use != NULL;
                use = use->next_use()) {
@@ -6338,20 +6386,27 @@
             if (load != NULL) {
               // Found a load. Initialize current value of the field to null for
               // normal fields, or with type arguments.
-              gen->Add(load->place_id());
-              if (out_values == NULL) out_values = CreateBlockOutValues();
 
+              // Forward for all fields for non-escaping objects and only
+              // non-final fields and type arguments for escaping ones.
+              if (aliased_set_->CanBeAliased(alloc) &&
+                  (load->field() != NULL) &&
+                  load->field()->is_final()) {
+                continue;
+              }
+
+              Definition* forward_def = graph_->constant_null();
               if (alloc->ArgumentCount() > 0) {
                 ASSERT(alloc->ArgumentCount() == 1);
                 intptr_t type_args_offset =
                     alloc->cls().type_arguments_field_offset();
                 if (load->offset_in_bytes() == type_args_offset) {
-                  (*out_values)[load->place_id()] =
-                      alloc->PushArgumentAt(0)->value()->definition();
-                  continue;
+                  forward_def = alloc->PushArgumentAt(0)->value()->definition();
                 }
               }
-              (*out_values)[load->place_id()] = graph_->constant_null();
+              gen->Add(load->place_id());
+              if (out_values == NULL) out_values = CreateBlockOutValues();
+              (*out_values)[load->place_id()] = forward_def;
             }
           }
           continue;
diff --git a/runtime/vm/flow_graph_range_analysis.cc b/runtime/vm/flow_graph_range_analysis.cc
index 18487cc..0f87533 100644
--- a/runtime/vm/flow_graph_range_analysis.cc
+++ b/runtime/vm/flow_graph_range_analysis.cc
@@ -245,8 +245,7 @@
     if (join != NULL) {
       for (PhiIterator phi_it(join); !phi_it.Done(); phi_it.Advance()) {
         PhiInstr* current = phi_it.Current();
-        if ((current->Type()->ToCid() == kSmiCid) ||
-            (current->representation() == kUnboxedInt32)) {
+        if (current->Type()->IsInt()) {
           values_.Add(current);
         }
       }
@@ -517,6 +516,28 @@
 }
 
 
+const Range* RangeAnalysis::GetIntRange(Value* value) const {
+  Definition* defn = value->definition();
+  const Range* range = defn->range();
+
+  if ((range == NULL) && !defn->Type()->IsInt()) {
+    // Type propagator determined that reaching type for this use is int.
+    // However the definition itself is not a int-definition and
+    // thus it will never have range assigned to it. Just return the widest
+    // range possible for this value.
+    // It is safe to return Int64 range as this is the widest possible range
+    // supported by our unboxing operations - if this definition produces
+    // Bigint outside of Int64 we will deoptimize whenever we actually try
+    // to unbox it.
+    // Note: that we can't return NULL here because it is used as lattice's
+    // bottom element to indicate that the range was not computed *yet*.
+    return &int64_range_;
+  }
+
+  return range;
+}
+
+
 static bool AreEqualDefinitions(Definition* a, Definition* b) {
   a = UnwrapConstraint(a);
   b = UnwrapConstraint(b);
@@ -639,6 +660,21 @@
 }
 
 
+static RangeBoundary::RangeSize RangeSizeForPhi(Definition* phi) {
+  ASSERT(phi->IsPhi());
+  if (phi->Type()->ToCid() == kSmiCid) {
+    return RangeBoundary::kRangeBoundarySmi;
+  } else if (phi->representation() == kUnboxedInt32) {
+    return RangeBoundary::kRangeBoundaryInt32;
+  } else if (phi->Type()->IsInt()) {
+    return RangeBoundary::kRangeBoundaryInt64;
+  } else {
+    UNREACHABLE();
+    return RangeBoundary::kRangeBoundaryInt64;
+  }
+}
+
+
 bool RangeAnalysis::InferRange(JoinOperator op,
                                Definition* defn,
                                intptr_t iteration) {
@@ -647,11 +683,7 @@
 
   if (!Range::IsUnknown(&range)) {
     if (!Range::IsUnknown(defn->range()) && defn->IsPhi()) {
-      // TODO(vegorov): we are currently supporting only smi/int32 phis.
-      ASSERT((defn->Type()->ToCid() == kSmiCid) ||
-             (defn->representation() == kUnboxedInt32));
-      const RangeBoundary::RangeSize size = (defn->Type()->ToCid() == kSmiCid) ?
-          RangeBoundary::kRangeBoundarySmi : RangeBoundary::kRangeBoundaryInt32;
+      const RangeBoundary::RangeSize size = RangeSizeForPhi(defn);
       if (op == WIDEN) {
         range = Range(WidenMin(defn->range(), &range, size),
                       WidenMax(defn->range(), &range, size));
@@ -755,7 +787,10 @@
   // Perform an iteration of range inference just propagating ranges
   // through the graph as-is without applying widening or narrowing.
   // This helps to improve precision of initial bounds.
-  Iterate(NONE, 1);
+  // We are doing 2 iterations to hit common cases where phi range
+  // stabilizes quickly and yields a better precision than after
+  // widening and narrowing.
+  Iterate(NONE, 2);
 
   // Perform fix-point iteration of range inference applying widening
   // operator to phis to ensure fast convergence.
@@ -2392,6 +2427,32 @@
 }
 
 
+static int BitSize(const Range* range) {
+  const int64_t min = Range::ConstantMin(range).ConstantValue();
+  const int64_t max = Range::ConstantMax(range).ConstantValue();
+  return Utils::Maximum(Utils::BitLength(min), Utils::BitLength(max));
+}
+
+
+void Range::Xor(const Range* left_range,
+                const Range* right_range,
+                RangeBoundary* result_min,
+                RangeBoundary* result_max) {
+  const int bitsize =
+      Utils::Maximum(BitSize(left_range), BitSize(right_range));
+
+  if (left_range->IsPositive() && right_range->IsPositive()) {
+    *result_min = RangeBoundary::FromConstant(0);
+  } else {
+    *result_min = RangeBoundary::FromConstant(
+        static_cast<int64_t>(-1) << bitsize);
+  }
+
+  *result_max = RangeBoundary::FromConstant(
+      (static_cast<uint64_t>(1) << bitsize) - 1);
+}
+
+
 static bool IsArrayLength(Definition* defn) {
   if (defn == NULL) {
     return false;
@@ -2560,12 +2621,18 @@
       Range::Shr(left_range, right_range, &min, &max);
       break;
     }
+
     case Token::kBIT_AND:
       if (!Range::And(left_range, right_range, &min, &max)) {
         *result = Range::Full(RangeBoundary::kRangeBoundaryInt64);
         return;
       }
       break;
+
+    case Token::kBIT_XOR:
+      Range::Xor(left_range, right_range, &min, &max);
+      break;
+
     default:
       *result = Range::Full(RangeBoundary::kRangeBoundaryInt64);
       return;
@@ -2592,6 +2659,8 @@
     *range = Range::Full(RangeBoundary::kRangeBoundaryInt64);
   } else if (IsInt32Definition()) {
     *range = Range::Full(RangeBoundary::kRangeBoundaryInt32);
+  } else if (Type()->IsInt()) {
+    *range = Range::Full(RangeBoundary::kRangeBoundaryInt64);
   } else {
     // Only Smi and Mint supported.
     UNREACHABLE();
@@ -2692,16 +2761,31 @@
 }
 
 
+static const Range* GetInputRange(RangeAnalysis* analysis,
+                                  RangeBoundary::RangeSize size,
+                                  Value* input) {
+  switch (size) {
+    case RangeBoundary::kRangeBoundarySmi:
+      return analysis->GetSmiRange(input);
+    case RangeBoundary::kRangeBoundaryInt32:
+      return input->definition()->range();
+    case RangeBoundary::kRangeBoundaryInt64:
+      return analysis->GetIntRange(input);
+    default:
+      UNREACHABLE();
+      return NULL;
+  }
+}
+
+
 void PhiInstr::InferRange(RangeAnalysis* analysis, Range* range) {
-  ASSERT((Type()->ToCid() == kSmiCid) || (representation() == kUnboxedInt32));
-  const RangeBoundary::RangeSize size = (Type()->ToCid() == kSmiCid) ?
-      RangeBoundary::kRangeBoundarySmi : RangeBoundary::kRangeBoundaryInt32;
+  const RangeBoundary::RangeSize size = RangeSizeForPhi(this);
   for (intptr_t i = 0; i < InputCount(); i++) {
     Value* input = InputAt(i);
-    const Range* input_range = (size == RangeBoundary::kRangeBoundarySmi) ?
-        analysis->GetSmiRange(input) : input->definition()->range();
     Join(range,
-         input->definition(), input_range, size);
+         input->definition(),
+         GetInputRange(analysis, size, input),
+         size);
   }
 
   BlockEntryInstr* phi_block = GetBlock();
@@ -2795,20 +2879,12 @@
                      RangeBoundary::FromConstant(65535));
       break;
     case kTypedDataInt32ArrayCid:
-      if (Typed32BitIsSmi()) {
-        *range = Range::Full(RangeBoundary::kRangeBoundarySmi);
-      } else {
-        *range = Range(RangeBoundary::FromConstant(kMinInt32),
-                       RangeBoundary::FromConstant(kMaxInt32));
-      }
+      *range = Range(RangeBoundary::FromConstant(kMinInt32),
+                     RangeBoundary::FromConstant(kMaxInt32));
       break;
     case kTypedDataUint32ArrayCid:
-      if (Typed32BitIsSmi()) {
-        *range = Range::Full(RangeBoundary::kRangeBoundarySmi);
-      } else {
-        *range = Range(RangeBoundary::FromConstant(0),
-                       RangeBoundary::FromConstant(kMaxUint32));
-      }
+      *range = Range(RangeBoundary::FromConstant(0),
+                     RangeBoundary::FromConstant(kMaxUint32));
       break;
     case kOneByteStringCid:
       *range = Range(RangeBoundary::FromConstant(0),
@@ -2915,14 +2991,13 @@
 
 
 void UnboxInt32Instr::InferRange(RangeAnalysis* analysis, Range* range) {
-  if (value()->definition()->Type()->ToCid() == kSmiCid) {
+  if (value()->Type()->ToCid() == kSmiCid) {
     const Range* value_range = analysis->GetSmiRange(value());
     if (!Range::IsUnknown(value_range)) {
       *range = *value_range;
     }
-  } else if (value()->definition()->IsMintDefinition() ||
-             value()->definition()->IsInt32Definition()) {
-    const Range* value_range = value()->definition()->range();
+  } else if (RangeAnalysis::IsIntegerDefinition(value()->definition())) {
+    const Range* value_range = analysis->GetIntRange(value());
     if (!Range::IsUnknown(value_range)) {
       *range = *value_range;
     }
@@ -2934,6 +3009,30 @@
 }
 
 
+void UnboxUint32Instr::InferRange(RangeAnalysis* analysis, Range* range) {
+  const Range* value_range = NULL;
+
+  if (value()->Type()->ToCid() == kSmiCid) {
+    value_range = analysis->GetSmiRange(value());
+  } else if (RangeAnalysis::IsIntegerDefinition(value()->definition())) {
+    value_range = analysis->GetIntRange(value());
+  } else {
+    *range = Range(RangeBoundary::FromConstant(0),
+                   RangeBoundary::FromConstant(kMaxUint32));
+    return;
+  }
+
+  if (!Range::IsUnknown(value_range)) {
+    if (value_range->IsPositive()) {
+      *range = *value_range;
+    } else {
+      *range = Range(RangeBoundary::FromConstant(0),
+                     RangeBoundary::FromConstant(kMaxUint32));
+    }
+  }
+}
+
+
 void UnboxInt64Instr::InferRange(RangeAnalysis* analysis, Range* range) {
   const Range* value_range = value()->definition()->range();
   if (value_range != NULL) {
diff --git a/runtime/vm/flow_graph_range_analysis.h b/runtime/vm/flow_graph_range_analysis.h
index 8383adc..a4bc7e6 100644
--- a/runtime/vm/flow_graph_range_analysis.h
+++ b/runtime/vm/flow_graph_range_analysis.h
@@ -459,6 +459,10 @@
                   RangeBoundary* min,
                   RangeBoundary* max);
 
+  static void Xor(const Range* left_range,
+                  const Range* right_range,
+                  RangeBoundary* min,
+                  RangeBoundary* max);
 
   // Both the a and b ranges are >= 0.
   static bool OnlyPositiveOrZero(const Range& a, const Range& b);
@@ -502,7 +506,8 @@
  public:
   explicit RangeAnalysis(FlowGraph* flow_graph)
       : flow_graph_(flow_graph),
-        smi_range_(Range::Full(RangeBoundary::kRangeBoundarySmi)) { }
+        smi_range_(Range::Full(RangeBoundary::kRangeBoundarySmi)),
+        int64_range_(Range::Full(RangeBoundary::kRangeBoundaryInt64)) { }
 
   // Infer ranges for all values and remove overflow checks from binary smi
   // operations when proven redundant.
@@ -510,14 +515,17 @@
 
   // Helper that should be used to access ranges of inputs during range
   // inference.
-  // Returns meaningful results for uses of non-smi definitions that have smi
-  // as a reaching type.
+  // Returns meaningful results for uses of non-smi/non-int definitions that
+  // have smi/int as a reaching type.
+  // For Int typed definitions we use full Int64 range as a safe approximation
+  // even though they might contain Bigint values because we only support
+  // 64-bit operations in the optimized code - which means that Bigint will
+  // cause deoptimization.
   const Range* GetSmiRange(Value* value) const;
+  const Range* GetIntRange(Value* value) const;
 
   static bool IsIntegerDefinition(Definition* defn) {
-    return (defn->Type()->ToCid() == kSmiCid) ||
-        defn->IsMintDefinition() ||
-        defn->IsInt32Definition();
+    return defn->Type()->IsInt();
   }
 
   void AssignRangesRecursively(Definition* defn);
@@ -597,6 +605,8 @@
   // Range object representing full Smi range.
   Range smi_range_;
 
+  Range int64_range_;
+
   // Value that are known to be smi or mint.
   GrowableArray<Definition*> values_;
 
diff --git a/runtime/vm/flow_graph_type_propagator.cc b/runtime/vm/flow_graph_type_propagator.cc
index fc33aaf..cce0c2a 100644
--- a/runtime/vm/flow_graph_type_propagator.cc
+++ b/runtime/vm/flow_graph_type_propagator.cc
@@ -306,6 +306,13 @@
 }
 
 
+void FlowGraphTypePropagator::VisitAssertAssignable(
+    AssertAssignableInstr* instr) {
+  SetTypeOf(instr->value()->definition(),
+            ZoneCompileType::Wrap(instr->ComputeType()));
+}
+
+
 void FlowGraphTypePropagator::AddToWorklist(Definition* defn) {
   if (defn->ssa_temp_index() == -1) {
     return;
@@ -327,15 +334,6 @@
 }
 
 
-// Unwrap all assert assignable and get a real definition of the value.
-static Definition* UnwrapAsserts(Definition* defn) {
-  while (defn->IsAssertAssignable()) {
-    defn = defn->AsAssertAssignable()->value()->definition();
-  }
-  return defn;
-}
-
-
 // In the given block strengthen type assertions by hoisting first class or smi
 // check over the same value up to the point before the assertion. This allows
 // to eliminate type assertions that are postdominated by class or smi checks as
@@ -351,7 +349,7 @@
     // If this is the first type assertion checking given value record it.
     AssertAssignableInstr* assert = instr->AsAssertAssignable();
     if (assert != NULL) {
-      Definition* defn = UnwrapAsserts(assert->value()->definition());
+      Definition* defn = assert->value()->definition()->OriginalDefinition();
       if ((*asserts_)[defn->ssa_temp_index()] == NULL) {
         (*asserts_)[defn->ssa_temp_index()] = assert;
         collected_asserts_->Add(defn->ssa_temp_index());
@@ -373,7 +371,7 @@
   AssertAssignableInstr* kStrengthenedAssertMarker =
       reinterpret_cast<AssertAssignableInstr*>(-1);
 
-  Definition* defn = UnwrapAsserts(check->InputAt(0)->definition());
+  Definition* defn = check->InputAt(0)->definition()->OriginalDefinition();
 
   AssertAssignableInstr* assert = (*asserts_)[defn->ssa_temp_index()];
   if ((assert == NULL) || (assert == kStrengthenedAssertMarker)) {
@@ -548,14 +546,12 @@
   if (type_ == NULL) {
     ASSERT(cid_ != kIllegalCid);
 
-    // VM internal Function and Context objects don't have a compile-type.
-    // Return dynamic-type in this case.
-    if (cid_ == kFunctionCid || cid_ == kContextCid) {
+    // VM-internal objects don't have a compile-type. Return dynamic-type
+    // in this case.
+    if (cid_ < kInstanceCid) {
       type_ = &Type::ZoneHandle(Type::DynamicType());
       return type_;
     }
-    // Except the special cases above, only instances are expected.
-    ASSERT(cid_ >= kInstanceCid);
 
     const Class& type_class =
         Class::Handle(Isolate::Current()->class_table()->At(cid_));
@@ -592,19 +588,16 @@
 
   // Consider the compile type of the value.
   const AbstractType& compile_type = *ToAbstractType();
+
+  // The compile-type of a value should never be void. The result of a void
+  // function must always be null, which wass checked to be null at the return
+  // statement inside the function.
+  ASSERT(!compile_type.IsVoidType());
+
   if (compile_type.IsMalformedOrMalbounded()) {
     return false;
   }
 
-  // If the compile type of the value is void, we are type checking the result
-  // of a void function, which was checked to be null at the return statement
-  // inside the function.
-  if (compile_type.IsVoidType()) {
-    ASSERT(FLAG_enable_type_checks);
-    *is_instance = true;
-    return true;
-  }
-
   // The Null type is only a subtype of Object and of dynamic.
   // Functions that do not explicitly return a value, implicitly return null,
   // except generative constructors, which return the object being constructed.
@@ -684,12 +677,12 @@
 
 
 CompileType RedefinitionInstr::ComputeType() const {
-  return CompileType::None();
+  return *value()->Type();
 }
 
 
 bool RedefinitionInstr::RecomputeType() {
-  return UpdateType(*value()->Type());
+  return UpdateType(ComputeType());
 }
 
 
@@ -769,30 +762,24 @@
 }
 
 
-CompileType* AssertAssignableInstr::ComputeInitialType() const {
+CompileType AssertAssignableInstr::ComputeType() const {
   CompileType* value_type = value()->Type();
 
   if (value_type->IsMoreSpecificThan(dst_type())) {
-    return ZoneCompileType::Wrap(*value_type);
+    return *value_type;
   }
 
   if (dst_type().IsVoidType()) {
     // The only value assignable to void is null.
-    return ZoneCompileType::Wrap(CompileType::Null());
+    return CompileType::Null();
   }
 
-  return ZoneCompileType::Wrap(
-      CompileType::FromAbstractType(dst_type(), value_type->is_nullable()));
+  return CompileType::Create(value_type->ToCid(), dst_type());
 }
 
 
 bool AssertAssignableInstr::RecomputeType() {
-  CompileType* value_type = value()->Type();
-  return UpdateType(
-      value_type->IsMoreSpecificThan(dst_type())
-          ? *value_type
-          : CompileType::FromAbstractType(dst_type(),
-                                          value_type->is_nullable()));
+  return UpdateType(ComputeType());
 }
 
 
@@ -872,8 +859,13 @@
   }
 
   if (FLAG_enable_type_checks) {
-    return CompileType::FromAbstractType(
-        AbstractType::ZoneHandle(function().result_type()));
+    // Void functions are known to return null, which is checked at the return
+    // from the function.
+    const AbstractType& result_type =
+        AbstractType::ZoneHandle(function().result_type());
+    return CompileType::FromAbstractType(result_type.IsVoidType()
+        ? AbstractType::ZoneHandle(Type::NullType())
+        : result_type);
   }
 
   return CompileType::Dynamic();
@@ -893,14 +885,14 @@
 }
 
 
-CompileType* DropTempsInstr::ComputeInitialType() const {
-  return value()->Type();
+CompileType DropTempsInstr::ComputeType() const {
+  return *value()->Type();
 }
 
 
-CompileType* StoreLocalInstr::ComputeInitialType() const {
+CompileType StoreLocalInstr::ComputeType() const {
   // Returns stored value.
-  return value()->Type();
+  return *value()->Type();
 }
 
 
@@ -920,11 +912,6 @@
 }
 
 
-CompileType* StoreInstanceFieldInstr::ComputeInitialType() const {
-  return value()->Type();
-}
-
-
 CompileType LoadStaticFieldInstr::ComputeType() const {
   bool is_nullable = CompileType::kNullable;
   intptr_t cid = kDynamicCid;
@@ -948,11 +935,6 @@
 }
 
 
-CompileType* StoreStaticFieldInstr::ComputeInitialType() const {
-  return value()->Type();
-}
-
-
 CompileType CreateArrayInstr::ComputeType() const {
   // TODO(fschneider): Add abstract type and type arguments to the compile type.
   return CompileType::FromCid(kArrayCid);
diff --git a/runtime/vm/flow_graph_type_propagator.h b/runtime/vm/flow_graph_type_propagator.h
index 60bad97..b324052 100644
--- a/runtime/vm/flow_graph_type_propagator.h
+++ b/runtime/vm/flow_graph_type_propagator.h
@@ -31,6 +31,7 @@
   virtual void VisitCheckClass(CheckClassInstr* instr);
   virtual void VisitCheckClassId(CheckClassIdInstr* instr);
   virtual void VisitGuardFieldClass(GuardFieldClassInstr* instr);
+  virtual void VisitAssertAssignable(AssertAssignableInstr* instr);
 
   // Current reaching type of the definition. Valid only during dominator tree
   // traversal.
diff --git a/runtime/vm/gc_marker.cc b/runtime/vm/gc_marker.cc
index 846e0c1..abb728b 100644
--- a/runtime/vm/gc_marker.cc
+++ b/runtime/vm/gc_marker.cc
@@ -246,9 +246,10 @@
         // after skipping the function's code pointer, then we disconnect the
         // code from the function.
         StubCode* stub_code = isolate()->stub_code();
-        func->ptr()->instructions_ =
-            stub_code->LazyCompile_entry()->code()->ptr()->instructions_;
-        func->ptr()->unoptimized_code_ = Code::null();
+        func->StorePointer(
+            &(func->ptr()->instructions_),
+            stub_code->LazyCompile_entry()->code()->ptr()->instructions_);
+        func->StorePointer(&(func->ptr()->unoptimized_code_), Code::null());
         if (FLAG_log_code_drop) {
           // NOTE: This code runs while GC is in progress and runs within
           // a NoHandleScope block. Hence it is not okay to use a regular Zone
diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc
index c0a4f03..59f0cb2 100644
--- a/runtime/vm/intermediate_language.cc
+++ b/runtime/vm/intermediate_language.cc
@@ -1260,11 +1260,50 @@
 }
 
 
+static intptr_t RepresentationBits(Representation r) {
+  switch (r) {
+    case kTagged:
+      return kBitsPerWord - 1;
+    case kUnboxedInt32:
+    case kUnboxedUint32:
+      return 32;
+    case kUnboxedMint:
+      return 64;
+    default:
+      UNREACHABLE();
+      return 0;
+  }
+}
+
+
+static int64_t RepresentationMask(Representation r) {
+  return static_cast<int64_t>(
+      static_cast<uint64_t>(-1) >> (64 - RepresentationBits(r)));
+}
+
+
 static bool ToIntegerConstant(Value* value, int64_t* result) {
   if (!value->BindsToConstant()) {
     UnboxInstr* unbox = value->definition()->AsUnbox();
-    if ((unbox != NULL) && (unbox->representation() == kUnboxedDouble)) {
-      return ToIntegerConstant(unbox->value(), result);
+    if (unbox != NULL) {
+      switch (unbox->representation()) {
+        case kUnboxedDouble:
+        case kUnboxedMint:
+          return ToIntegerConstant(unbox->value(), result);
+
+        case kUnboxedUint32:
+          if (ToIntegerConstant(unbox->value(), result)) {
+            *result &= RepresentationMask(kUnboxedUint32);
+            return true;
+          }
+          break;
+
+        // No need to handle Unbox<Int32>(Constant(C)) because it gets
+        // canonicalized to UnboxedConstant<Int32>(C).
+        case kUnboxedInt32:
+        default:
+          break;
+      }
     }
     return false;
   }
@@ -1392,28 +1431,6 @@
 }
 
 
-static intptr_t RepresentationBits(Representation r) {
-  switch (r) {
-    case kTagged:
-      return kBitsPerWord - 1;
-    case kUnboxedInt32:
-    case kUnboxedUint32:
-      return 32;
-    case kUnboxedMint:
-      return 64;
-    default:
-      UNREACHABLE();
-      return 0;
-  }
-}
-
-
-static int64_t RepresentationMask(Representation r) {
-  return static_cast<int64_t>(
-      static_cast<uint64_t>(-1) >> (64 - RepresentationBits(r)));
-}
-
-
 UnaryIntegerOpInstr* UnaryIntegerOpInstr::Make(Representation representation,
                                                Token::Kind op_kind,
                                                Value* value,
diff --git a/runtime/vm/intermediate_language.h b/runtime/vm/intermediate_language.h
index 83106c7..5867762 100644
--- a/runtime/vm/intermediate_language.h
+++ b/runtime/vm/intermediate_language.h
@@ -158,6 +158,13 @@
     return (cid_ == kIllegalCid) && (type_ == NULL);
   }
 
+  bool IsInt() {
+    return !is_nullable() &&
+      ((ToCid() == kSmiCid) ||
+       (ToCid() == kMintCid) ||
+       ((type_ != NULL) && (type_->Equals(Type::Handle(Type::IntType())))));
+  }
+
   void PrintTo(BufferFormatter* f) const;
   const char* ToCString() const;
 
@@ -631,7 +638,7 @@
 
   // Call instructions override this function and return the number of
   // pushed arguments.
-  virtual intptr_t ArgumentCount() const = 0;
+  virtual intptr_t ArgumentCount() const { return 0; }
   virtual PushArgumentInstr* PushArgumentAt(intptr_t index) const {
     UNREACHABLE();
     return NULL;
@@ -1568,9 +1575,6 @@
  public:
   explicit Definition(intptr_t deopt_id = Isolate::kNoDeoptId);
 
-  // Overridden by definitions that have pushed arguments.
-  virtual intptr_t ArgumentCount() const { return 0; }
-
   // Overridden by definitions that have call counts.
   virtual intptr_t CallCount() const {
     UNREACHABLE();
@@ -1604,15 +1608,11 @@
   // propagation during graph building.
   CompileType* Type() {
     if (type_ == NULL) {
-      type_ = ComputeInitialType();
+      type_ = ZoneCompileType::Wrap(ComputeType());
     }
     return type_;
   }
 
-  virtual CompileType* ComputeInitialType() const {
-    return ZoneCompileType::Wrap(ComputeType());
-  }
-
   // Does this define a mint?
   inline bool IsMintDefinition();
 
@@ -1837,8 +1837,6 @@
   virtual CompileType ComputeType() const;
   virtual bool RecomputeType();
 
-  virtual intptr_t ArgumentCount() const { return 0; }
-
   intptr_t InputCount() const { return inputs_.length(); }
 
   Value* InputAt(intptr_t i) const { return inputs_[i]; }
@@ -1930,8 +1928,6 @@
   // Get the block entry for that instruction.
   virtual BlockEntryInstr* GetBlock() const { return block_; }
 
-  virtual intptr_t ArgumentCount() const { return 0; }
-
   intptr_t InputCount() const { return 0; }
   Value* InputAt(intptr_t i) const {
     UNREACHABLE();
@@ -1973,8 +1969,6 @@
 
   DECLARE_INSTRUCTION(PushArgument)
 
-  virtual intptr_t ArgumentCount() const { return 0; }
-
   virtual CompileType ComputeType() const;
 
   Value* value() const { return InputAt(0); }
@@ -2005,8 +1999,6 @@
 
   DECLARE_INSTRUCTION(Return)
 
-  virtual intptr_t ArgumentCount() const { return 0; }
-
   virtual intptr_t token_pos() const { return token_pos_; }
   Value* value() const { return inputs_[0]; }
 
@@ -2091,8 +2083,6 @@
 
   DECLARE_INSTRUCTION(Goto)
 
-  virtual intptr_t ArgumentCount() const { return 0; }
-
   JoinEntryInstr* successor() const { return successor_; }
   void set_successor(JoinEntryInstr* successor) { successor_ = successor; }
   virtual intptr_t SuccessorCount() const;
@@ -2323,8 +2313,6 @@
         deopt_reason_(deopt_reason) {
   }
 
-  virtual intptr_t ArgumentCount() const { return 0; }
-
   virtual bool CanDeoptimize() const { return true; }
 
   virtual bool AttributesEqual(Instruction* other) const {
@@ -2480,7 +2468,7 @@
   }
 
   DECLARE_INSTRUCTION(AssertAssignable)
-  virtual CompileType* ComputeInitialType() const;
+  virtual CompileType ComputeType() const;
   virtual bool RecomputeType();
 
   Value* value() const { return inputs_[0]; }
@@ -3192,7 +3180,7 @@
 
   intptr_t num_temps() const { return num_temps_; }
 
-  virtual CompileType* ComputeInitialType() const;
+  virtual CompileType ComputeType() const;
 
   virtual void PrintOperandsTo(BufferFormatter* f) const;
 
@@ -3228,7 +3216,7 @@
   }
 
   DECLARE_INSTRUCTION(StoreLocal)
-  virtual CompileType* ComputeInitialType() const;
+  virtual CompileType ComputeType() const;
 
   const LocalVariable& local() const { return local_; }
   Value* value() const { return inputs_[0]; }
@@ -3306,7 +3294,6 @@
   virtual intptr_t token_pos() const { return token_pos_; }
   virtual bool CanDeoptimize() const { return false; }
   virtual EffectSet Effects() const { return EffectSet::All(); }
-  virtual intptr_t ArgumentCount() const { return 0; }
   virtual Instruction* Canonicalize(FlowGraph* flow_graph);
 
  private:
@@ -3367,8 +3354,6 @@
   bool is_initialization() const { return is_initialization_; }
   virtual intptr_t token_pos() const { return token_pos_; }
 
-  virtual CompileType* ComputeInitialType() const;
-
   const Field& field() const { return field_; }
   intptr_t offset_in_bytes() const { return offset_in_bytes_; }
 
@@ -3431,8 +3416,6 @@
 
   const Field& field() const { return field_; }
 
-  virtual intptr_t ArgumentCount() const { return 0; }
-
   virtual bool CanDeoptimize() const { return true; }
   virtual bool CanBecomeDeoptimizationTarget() const {
     // Ensure that we record kDeopt PC descriptor in unoptimized code.
@@ -3525,7 +3508,6 @@
   };
 
   DECLARE_INSTRUCTION(StoreStaticField)
-  virtual CompileType* ComputeInitialType() const;
 
   const Field& field() const { return field_; }
   Value* value() const { return inputs_[kValuePos]; }
@@ -3594,10 +3576,6 @@
     return GetDeoptId() != Isolate::kNoDeoptId;
   }
 
-  bool Typed32BitIsSmi() const {
-    return kSmiBits >= 32;
-  }
-
   virtual Representation representation() const;
   virtual void InferRange(RangeAnalysis* analysis, Range* range);
 
@@ -4285,7 +4263,6 @@
 
   DECLARE_INSTRUCTION(InitStaticField)
 
-  virtual intptr_t ArgumentCount() const { return 0; }
   virtual bool CanDeoptimize() const { return true; }
   virtual EffectSet Effects() const { return EffectSet::All(); }
   virtual Instruction* Canonicalize(FlowGraph* flow_graph);
@@ -4363,8 +4340,6 @@
 
   DECLARE_INSTRUCTION(CheckEitherNonSmi)
 
-  virtual intptr_t ArgumentCount() const { return 0; }
-
   virtual bool CanDeoptimize() const { return true; }
 
   virtual Instruction* Canonicalize(FlowGraph* flow_graph);
@@ -4679,6 +4654,8 @@
         && (value()->Type()->ToCid() != kMintCid);
   }
 
+  virtual void InferRange(RangeAnalysis* analysis, Range* range);
+
   DECLARE_INSTRUCTION_NO_BACKEND(UnboxUint32)
 
  private:
@@ -6811,8 +6788,6 @@
 
   DECLARE_INSTRUCTION(CheckStackOverflow)
 
-  virtual intptr_t ArgumentCount() const { return 0; }
-
   virtual bool CanDeoptimize() const { return true; }
 
   virtual EffectSet Effects() const { return EffectSet::None(); }
@@ -7315,8 +7290,6 @@
 
   DECLARE_INSTRUCTION(CheckClass)
 
-  virtual intptr_t ArgumentCount() const { return 0; }
-
   virtual bool CanDeoptimize() const { return true; }
 
   virtual intptr_t token_pos() const { return token_pos_; }
@@ -7368,8 +7341,6 @@
 
   DECLARE_INSTRUCTION(CheckSmi)
 
-  virtual intptr_t ArgumentCount() const { return 0; }
-
   virtual bool CanDeoptimize() const { return true; }
 
   virtual Instruction* Canonicalize(FlowGraph* flow_graph);
@@ -7398,8 +7369,6 @@
 
   DECLARE_INSTRUCTION(CheckClassId)
 
-  virtual intptr_t ArgumentCount() const { return 0; }
-
   virtual bool CanDeoptimize() const { return true; }
 
   virtual Instruction* Canonicalize(FlowGraph* flow_graph);
@@ -7433,8 +7402,6 @@
 
   DECLARE_INSTRUCTION(CheckArrayBound)
 
-  virtual intptr_t ArgumentCount() const { return 0; }
-
   virtual bool CanDeoptimize() const { return true; }
 
   bool IsRedundant(const RangeBoundary& length);
@@ -7485,8 +7452,8 @@
     ASSERT((to == kUnboxedMint) ||
            (to == kUnboxedUint32) ||
            (to == kUnboxedInt32));
-    ASSERT((to != kUnboxedInt32) || (deopt_id != Isolate::kNoDeoptId));
     SetInputAt(0, value);
+    ASSERT(!CanDeoptimize() || (deopt_id != Isolate::kNoDeoptId));
   }
 
   Value* value() const { return inputs_[0]; }
@@ -7524,6 +7491,11 @@
 
   virtual void PrintOperandsTo(BufferFormatter* f) const;
 
+  virtual CompileType ComputeType() const {
+    // TODO(vegorov) use range information to improve type.
+    return CompileType::Int();
+  }
+
   DECLARE_INSTRUCTION(UnboxedIntConverter);
 
  private:
diff --git a/runtime/vm/intrinsifier_arm.cc b/runtime/vm/intrinsifier_arm.cc
index 367ffa7..d921f98 100644
--- a/runtime/vm/intrinsifier_arm.cc
+++ b/runtime/vm/intrinsifier_arm.cc
@@ -906,14 +906,17 @@
 
   // R2 = used, R3 = digits
   __ ldrd(R2, Address(SP, 3 * kWordSize));
+  // R3 = &digits[0]
   __ add(R3, R3, Operand(TypedData::data_offset() - kHeapObjectTag));
 
   // R4 = a_used, R5 = a_digits
   __ ldrd(R4, Address(SP, 1 * kWordSize));
+  // R5 = &a_digits[0]
   __ add(R5, R5, Operand(TypedData::data_offset() - kHeapObjectTag));
 
   // R6 = r_digits
   __ ldr(R6, Address(SP, 0 * kWordSize));
+  // R6 = &r_digits[0]
   __ add(R6, R6, Operand(TypedData::data_offset() - kHeapObjectTag));
 
   // R7 = &digits[a_used >> 1], a_used is Smi.
@@ -963,14 +966,17 @@
 
   // R2 = used, R3 = digits
   __ ldrd(R2, Address(SP, 3 * kWordSize));
+  // R3 = &digits[0]
   __ add(R3, R3, Operand(TypedData::data_offset() - kHeapObjectTag));
 
   // R4 = a_used, R5 = a_digits
   __ ldrd(R4, Address(SP, 1 * kWordSize));
+  // R5 = &a_digits[0]
   __ add(R5, R5, Operand(TypedData::data_offset() - kHeapObjectTag));
 
   // R6 = r_digits
   __ ldr(R6, Address(SP, 0 * kWordSize));
+  // R6 = &r_digits[0]
   __ add(R6, R6, Operand(TypedData::data_offset() - kHeapObjectTag));
 
   // R7 = &digits[a_used >> 1], a_used is Smi.
@@ -1170,10 +1176,10 @@
   // R7 = high32(c) = 0
   __ mov(R7, Operand(0));
 
-  // int n = used - i - 1
+  // int n = used - i - 1; while (--n >= 0) ...
   __ ldr(R0, Address(SP, 0 * kWordSize));  // used is Smi
   __ sub(R8, R0, Operand(R2));
-  __ mov(R0, Operand(2));  // while (--n >= 0)
+  __ mov(R0, Operand(2));  // n = used - i - 2; if (n >= 0) ... while (--n >= 0)
   __ rsbs(R8, R0, Operand(R8, ASR, kSmiTagSize));
 
   Label loop, done;
@@ -1190,17 +1196,19 @@
   // uint32_t xi = *xip++
   __ ldr(R2, Address(R4, Bigint::kBytesPerDigit, Address::PostIndex));
 
-  // uint32_t aj = *ajp
-  __ ldr(R1, Address(R5, 0));
-
-  // uint96_t t = R2:R1:R0 = 2*x*xi + aj + c
-  __ mov(R0, Operand(0));
-  __ umaal(R0, R1, R2, R3);  // R1:R0 = R3*R2 + R1 + R0 = x*xi + aj + 0.
-  __ umlal(R6, R7, R2, R3);  // R7:R6 += R3*R2; c += x*xi.
+  // uint96_t t = R7:R6:R0 = 2*x*xi + aj + c
+  __ umull(R0, R1, R2, R3);  // R1:R0 = R2*R3.
+  __ adds(R0, R0, Operand(R0));
+  __ adcs(R1, R1, Operand(R1));
+  __ mov(R2, Operand(0));
+  __ adc(R2, R2, Operand(0));  // R2:R1:R0 = 2*x*xi.
   __ adds(R0, R0, Operand(R6));
-  __ adcs(R6, R1, Operand(R7));
-  __ mov(R7, Operand(0));
-  __ adc(R7, R7, Operand(0));  // R7:R6:R0 = R1:R0 + R7:R6 = 2*x*xi + aj + c.
+  __ adcs(R1, R1, Operand(R7));
+  __ adc(R2, R2, Operand(0));  // R2:R1:R0 = 2*x*xi + c.
+  __ ldr(R6, Address(R5, 0));  // R6 = aj = *ajp.
+  __ adds(R0, R0, Operand(R6));
+  __ adcs(R6, R1, Operand(0));
+  __ adc(R7, R2, Operand(0));  // R7:R6:R0 = 2*x*xi + c + aj.
 
   // *ajp++ = low32(t) = R0
   __ str(R0, Address(R5, Bigint::kBytesPerDigit, Address::PostIndex));
@@ -1228,7 +1236,7 @@
 
 
 void Intrinsifier::Bigint_estQuotientDigit(Assembler* assembler) {
-  // TODO(regis): Implement.
+  // No unsigned 64-bit / 32-bit divide instruction.
 }
 
 
diff --git a/runtime/vm/intrinsifier_arm64.cc b/runtime/vm/intrinsifier_arm64.cc
index c648d48..5e15cfc 100644
--- a/runtime/vm/intrinsifier_arm64.cc
+++ b/runtime/vm/intrinsifier_arm64.cc
@@ -802,32 +802,448 @@
 
 
 void Intrinsifier::Bigint_absAdd(Assembler* assembler) {
-  // TODO(regis): Implement.
+  // static void _absAdd(Uint32List digits, int used,
+  //                     Uint32List a_digits, int a_used,
+  //                     Uint32List r_digits)
+
+  // R2 = used, R3 = digits
+  __ ldp(R2, R3, Address(SP, 3 * kWordSize, Address::PairOffset));
+  // R3 = &digits[0]
+  __ add(R3, R3, Operand(TypedData::data_offset() - kHeapObjectTag));
+
+  // R4 = a_used, R5 = a_digits
+  __ ldp(R4, R5, Address(SP, 1 * kWordSize, Address::PairOffset));
+  // R5 = &a_digits[0]
+  __ add(R5, R5, Operand(TypedData::data_offset() - kHeapObjectTag));
+
+  // R6 = r_digits
+  __ ldr(R6, Address(SP, 0 * kWordSize));
+  // R6 = &r_digits[0]
+  __ add(R6, R6, Operand(TypedData::data_offset() - kHeapObjectTag));
+
+  // R7 = &digits[a_used >> 1], a_used is Smi.
+  __ add(R7, R3, Operand(R4, LSL, 1));
+
+  // R8 = &digits[used >> 1], used is Smi.
+  __ add(R8, R3, Operand(R2, LSL, 1));
+
+  __ adds(R0, R0, Operand(0));  // carry flag = 0
+  Label add_loop;
+  __ Bind(&add_loop);
+  // Loop a_used times, a_used > 0.
+  __ ldr(R0, Address(R3, Bigint::kBytesPerDigit, Address::PostIndex),
+         kUnsignedWord);
+  __ ldr(R1, Address(R5, Bigint::kBytesPerDigit, Address::PostIndex),
+         kUnsignedWord);
+  __ adcsw(R0, R0, R1);
+  __ sub(R9, R3, Operand(R7));  // Does not affect carry flag.
+  __ str(R0, Address(R6, Bigint::kBytesPerDigit, Address::PostIndex),
+         kUnsignedWord);
+  __ cbnz(&add_loop, R9);  // Does not affect carry flag.
+
+  Label last_carry;
+  __ sub(R9, R3, Operand(R8));  // Does not affect carry flag.
+  __ cbz(&last_carry, R9);  // If used - a_used == 0.
+
+  Label carry_loop;
+  __ Bind(&carry_loop);
+  // Loop used - a_used times, used - a_used > 0.
+  __ ldr(R0, Address(R3, Bigint::kBytesPerDigit, Address::PostIndex),
+         kUnsignedWord);
+  __ adcsw(R0, R0, ZR);
+  __ sub(R9, R3, Operand(R8));  // Does not affect carry flag.
+  __ str(R0, Address(R6, Bigint::kBytesPerDigit, Address::PostIndex),
+         kUnsignedWord);
+  __ cbnz(&carry_loop, R9);
+
+  __ Bind(&last_carry);
+  __ adc(R0, ZR, ZR);
+  __ str(R0, Address(R6, 0), kUnsignedWord);
+
+  // Returning Object::null() is not required, since this method is private.
+  __ ret();
 }
 
 
 void Intrinsifier::Bigint_absSub(Assembler* assembler) {
-  // TODO(regis): Implement.
+  // static void _absSub(Uint32List digits, int used,
+  //                     Uint32List a_digits, int a_used,
+  //                     Uint32List r_digits)
+
+  // R2 = used, R3 = digits
+  __ ldp(R2, R3, Address(SP, 3 * kWordSize, Address::PairOffset));
+  // R3 = &digits[0]
+  __ add(R3, R3, Operand(TypedData::data_offset() - kHeapObjectTag));
+
+  // R4 = a_used, R5 = a_digits
+  __ ldp(R4, R5, Address(SP, 1 * kWordSize, Address::PairOffset));
+  // R5 = &a_digits[0]
+  __ add(R5, R5, Operand(TypedData::data_offset() - kHeapObjectTag));
+
+  // R6 = r_digits
+  __ ldr(R6, Address(SP, 0 * kWordSize));
+  // R6 = &r_digits[0]
+  __ add(R6, R6, Operand(TypedData::data_offset() - kHeapObjectTag));
+
+  // R7 = &digits[a_used >> 1], a_used is Smi.
+  __ add(R7, R3, Operand(R4, LSL, 1));
+
+  // R8 = &digits[used >> 1], used is Smi.
+  __ add(R8, R3, Operand(R2, LSL, 1));
+
+  __ subs(R0, R0, Operand(0));  // carry flag = 1
+  Label sub_loop;
+  __ Bind(&sub_loop);
+  // Loop a_used times, a_used > 0.
+  __ ldr(R0, Address(R3, Bigint::kBytesPerDigit, Address::PostIndex),
+         kUnsignedWord);
+  __ ldr(R1, Address(R5, Bigint::kBytesPerDigit, Address::PostIndex),
+         kUnsignedWord);
+  __ sbcsw(R0, R0, R1);
+  __ sub(R9, R3, Operand(R7));  // Does not affect carry flag.
+  __ str(R0, Address(R6, Bigint::kBytesPerDigit, Address::PostIndex),
+         kUnsignedWord);
+  __ cbnz(&sub_loop, R9);  // Does not affect carry flag.
+
+  Label done;
+  __ sub(R9, R3, Operand(R8));  // Does not affect carry flag.
+  __ cbz(&done, R9);  // If used - a_used == 0.
+
+  Label carry_loop;
+  __ Bind(&carry_loop);
+  // Loop used - a_used times, used - a_used > 0.
+  __ ldr(R0, Address(R3, Bigint::kBytesPerDigit, Address::PostIndex),
+         kUnsignedWord);
+  __ sbcsw(R0, R0, ZR);
+  __ sub(R9, R3, Operand(R8));  // Does not affect carry flag.
+  __ str(R0, Address(R6, Bigint::kBytesPerDigit, Address::PostIndex),
+         kUnsignedWord);
+  __ cbnz(&carry_loop, R9);
+
+  __ Bind(&done);
+  // Returning Object::null() is not required, since this method is private.
+  __ ret();
 }
 
 
 void Intrinsifier::Bigint_mulAdd(Assembler* assembler) {
-  // TODO(regis): Implement.
+  // Pseudo code:
+  // static void _mulAdd(Uint32List x_digits, int xi,
+  //                     Uint32List m_digits, int i,
+  //                     Uint32List a_digits, int j, int n) {
+  //   uint32_t x = x_digits[xi >> 1];  // xi is Smi.
+  //   if (x == 0 || n == 0) {
+  //     return;
+  //   }
+  //   uint32_t* mip = &m_digits[i >> 1];  // i is Smi.
+  //   uint32_t* ajp = &a_digits[j >> 1];  // j is Smi.
+  //   uint32_t c = 0;
+  //   SmiUntag(n);
+  //   do {
+  //     uint32_t mi = *mip++;
+  //     uint32_t aj = *ajp;
+  //     uint64_t t = x*mi + aj + c;  // 32-bit * 32-bit -> 64-bit.
+  //     *ajp++ = low32(t);
+  //     c = high32(t);
+  //   } while (--n > 0);
+  //   while (c != 0) {
+  //     uint64_t t = *ajp + c;
+  //     *ajp++ = low32(t);
+  //     c = high32(t);  // c == 0 or 1.
+  //   }
+  // }
+
+  Label done;
+  // R3 = x, no_op if x == 0
+  // R0 = xi as Smi, R1 = x_digits.
+  __ ldp(R0, R1, Address(SP, 5 * kWordSize, Address::PairOffset));
+  __ add(R1, R1, Operand(R0, LSL, 1));
+  __ ldr(R3, FieldAddress(R1, TypedData::data_offset()), kUnsignedWord);
+  __ tst(R3, Operand(R3));
+  __ b(&done, EQ);
+
+  // R6 = SmiUntag(n), no_op if n == 0
+  __ ldr(R6, Address(SP, 0 * kWordSize));
+  __ adds(R6, ZR, Operand(R6, ASR, kSmiTagSize));  // SmiUntag(R6) and set cc.
+  __ b(&done, EQ);
+
+  // R4 = mip = &m_digits[i >> 1]
+  // R0 = i as Smi, R1 = m_digits.
+  __ ldp(R0, R1, Address(SP, 3 * kWordSize, Address::PairOffset));
+  __ add(R1, R1, Operand(R0, LSL, 1));
+  __ add(R4, R1, Operand(TypedData::data_offset() - kHeapObjectTag));
+
+  // R5 = ajp = &a_digits[j >> 1]
+  // R0 = j as Smi, R1 = a_digits.
+  __ ldp(R0, R1, Address(SP, 1 * kWordSize, Address::PairOffset));
+  __ add(R1, R1, Operand(R0, LSL, 1));
+  __ add(R5, R1, Operand(TypedData::data_offset() - kHeapObjectTag));
+
+  // R1 = c = 0
+  __ mov(R1, ZR);
+
+  Label muladd_loop;
+  __ Bind(&muladd_loop);
+  // x:   R3
+  // mip: R4
+  // ajp: R5
+  // c:   R1
+  // n:   R6
+
+  // uint32_t mi = *mip++
+  __ ldr(R2, Address(R4, Bigint::kBytesPerDigit, Address::PostIndex),
+         kUnsignedWord);
+
+  // uint32_t aj = *ajp
+  __ ldr(R0, Address(R5, 0), kUnsignedWord);
+
+  // uint64_t t = x*mi + aj + c
+  __ umaddl(R0, R2, R3, R0);  // X0 = W2*W3 + X0.
+  __ add(R0, R0, Operand(R1));  // R0 += c.
+
+  // *ajp++ = low32(t) = R0
+  __ str(R0, Address(R5, Bigint::kBytesPerDigit, Address::PostIndex),
+         kUnsignedWord);
+
+  // c = R1 = high32(t) = R0 >> 32.
+  __ LsrImmediate(R1, R0, 32);
+
+  // while (--n > 0)
+  __ subs(R6, R6, Operand(1));  // --n
+  __ b(&muladd_loop, NE);
+
+  __ tst(R1, Operand(R1));
+  __ b(&done, EQ);
+
+  // *ajp++ += c
+  __ ldr(R0, Address(R5, 0), kUnsignedWord);
+  __ addsw(R0, R0, Operand(R1));
+  __ str(R0, Address(R5, Bigint::kBytesPerDigit, Address::PostIndex),
+         kUnsignedWord);
+  __ b(&done, CC);
+
+  Label propagate_carry_loop;
+  __ Bind(&propagate_carry_loop);
+  __ ldr(R0, Address(R5, 0), kUnsignedWord);
+  __ addsw(R0, R0, Operand(1));
+  __ str(R0, Address(R5, Bigint::kBytesPerDigit, Address::PostIndex),
+         kUnsignedWord);
+  __ b(&propagate_carry_loop, CS);
+
+  __ Bind(&done);
+  // Returning Object::null() is not required, since this method is private.
+  __ ret();
 }
 
 
 void Intrinsifier::Bigint_sqrAdd(Assembler* assembler) {
-  // TODO(regis): Implement.
+  // Pseudo code:
+  // static void _sqrAdd(Uint32List x_digits, int i,
+  //                     Uint32List a_digits, int used) {
+  //   uint32_t* xip = &x_digits[i >> 1];  // i is Smi.
+  //   uint32_t x = *xip++;
+  //   if (x == 0) return;
+  //   uint32_t* ajp = &a_digits[i];  // j == 2*i, i is Smi.
+  //   uint32_t aj = *ajp;
+  //   uint64_t t = x*x + aj;
+  //   *ajp++ = low32(t);
+  //   uint64_t c = high32(t);
+  //   int n = ((used - i) >> 1) - 1;  // used and i are Smi.
+  //   while (--n >= 0) {
+  //     uint32_t xi = *xip++;
+  //     uint32_t aj = *ajp;
+  //     uint96_t t = 2*x*xi + aj + c;  // 2-bit * 32-bit * 32-bit -> 65-bit.
+  //     *ajp++ = low32(t);
+  //     c = high64(t);  // 33-bit.
+  //   }
+  //   uint32_t aj = *ajp;
+  //   uint64_t t = aj + c;  // 32-bit + 33-bit -> 34-bit.
+  //   *ajp++ = low32(t);
+  //   *ajp = high32(t);
+  // }
+
+  // R4 = xip = &x_digits[i >> 1]
+  // R2 = i as Smi, R3 = x_digits
+  __ ldp(R2, R3, Address(SP, 2 * kWordSize, Address::PairOffset));
+  __ add(R3, R3, Operand(R2, LSL, 1));
+  __ add(R4, R3, Operand(TypedData::data_offset() - kHeapObjectTag));
+
+  // R3 = x = *xip++, return if x == 0
+  Label x_zero;
+  __ ldr(R3, Address(R4, Bigint::kBytesPerDigit, Address::PostIndex),
+         kUnsignedWord);
+  __ tst(R3, Operand(R3));
+  __ b(&x_zero, EQ);
+
+  // R5 = ajp = &a_digits[i]
+  __ ldr(R1, Address(SP, 1 * kWordSize));  // a_digits
+  __ add(R1, R1, Operand(R2, LSL, 2));  // j == 2*i, i is Smi.
+  __ add(R5, R1, Operand(TypedData::data_offset() - kHeapObjectTag));
+
+  // X0 = t = x*x + *ajp
+  __ ldr(R0, Address(R5, 0), kUnsignedWord);
+  __ umaddl(R0, R3, R3, R0);  // X0 = W3*W3 + X0.
+
+  // *ajp++ = low32(t) = R0
+  __ str(R0, Address(R5, Bigint::kBytesPerDigit, Address::PostIndex),
+         kUnsignedWord);
+
+  // c = R6 = high32(t) = R0 >> 32.
+  __ LsrImmediate(R6, R0, 32);
+
+  // int n = used - i - 1
+  __ ldr(R0, Address(SP, 0 * kWordSize));  // used is Smi
+  __ sub(R8, R0, Operand(R2));
+  __ movn(R0, Immediate(1), 0);  // R0 = ~1 = -2.
+  __ adds(R8, R0, Operand(R8, ASR, kSmiTagSize));  // while (--n >= 0)
+
+  Label loop, done;
+  __ b(&done, MI);
+
+  __ Bind(&loop);
+  // x:   R3
+  // xip: R4
+  // ajp: R5
+  // c:   R6
+  // t:   R1:R0 (not live at loop entry)
+  // n:   R8
+
+  // uint32_t xi = *xip++
+  __ ldr(R2, Address(R4, Bigint::kBytesPerDigit, Address::PostIndex),
+         kUnsignedWord);
+
+  // uint32_t aj = *ajp
+  __ ldr(R1, Address(R5, 0), kUnsignedWord);
+
+  // uint96_t t = R1:R0 = 2*x*xi + aj + c
+  __ umaddl(R0, R2, R3, ZR);  // X0 = W2*W3 + 0 = x*xi.
+  __ add(R1, R0, Operand(R1));  // R1 = x*xi + aj.
+  __ adds(R0, R0, Operand(R1));
+  __ adc(R1, ZR, ZR);  // R1:R0 = 2*R0 + R1 = 2*x*xi + aj.
+  __ adds(R0, R0, Operand(R6));
+  __ adc(R1, R1, ZR);  // R1:R0 = R1:R0 + R6 = 2*x*xi + aj + c.
+
+  // *ajp++ = low32(t) = R0
+  __ str(R0, Address(R5, Bigint::kBytesPerDigit, Address::PostIndex),
+         kUnsignedWord);
+
+  // R6 = c = t >> 32.
+  __ LslImmediate(R6, R1, 32);
+  __ orr(R6, R6, Operand(R0, LSR, 32));
+
+  // while (--n >= 0)
+  __ subs(R8, R8, Operand(1));  // --n
+  __ b(&loop, PL);
+
+  __ Bind(&done);
+  // uint32_t aj = *ajp
+  __ ldr(R0, Address(R5, 0), kUnsignedWord);
+
+  // uint64_t t = aj + c
+  __ add(R6, R6, Operand(R0));
+
+  // R7 = R6 >> 32.
+  __ LsrImmediate(R7, R6, 32);
+
+  // *ajp = low32(t) = low32(R6)
+  // *(ajp + 1) = high32(t) = low32(R7)
+  __ stp(R6, R7, Address(R5, 0, Address::PairOffset), kUnsignedWord);
+
+  __ Bind(&x_zero);
+  // Returning Object::null() is not required, since this method is private.
+  __ ret();
 }
 
 
 void Intrinsifier::Bigint_estQuotientDigit(Assembler* assembler) {
-  // TODO(regis): Implement.
+  // Pseudo code:
+  // static void _estQuotientDigit(Uint32List args, Uint32List digits, int i) {
+  //   uint32_t yt = args[_YT];  // _YT == 0.
+  //   uint32_t* dp = &digits[i >> 1];  // i is Smi.
+  //   uint32_t dh = dp[0];  // dh == digits[i >> 1].
+  //   uint32_t qd;
+  //   if (dh == yt) {
+  //     qd = DIGIT_MASK;
+  //   } else {
+  //     dl = dp[-1];  // dl == digits[(i - 1) >> 1].
+  //     qd = dh:dl / yt;  // No overflow possible, because dh < yt.
+  //   }
+  //   args[_QD] = qd;  // _QD == 1;
+  // }
+
+  // R4 = args
+  __ ldr(R4, Address(SP, 2 * kWordSize));  // args
+
+  // R3 = yt = args[0]
+  __ ldr(R3, FieldAddress(R4, TypedData::data_offset()), kUnsignedWord);
+
+  // R2 = dh = digits[i >> 1]
+  // R0 = i as Smi, R1 = digits
+  __ ldp(R0, R1, Address(SP, 0 * kWordSize, Address::PairOffset));
+  __ add(R1, R1, Operand(R0, LSL, 1));
+  __ ldr(R2, FieldAddress(R1, TypedData::data_offset()), kUnsignedWord);
+
+  // R0 = qd = DIGIT_MASK = -1
+  __ movn(R0, Immediate(0), 0);
+
+  // Return qd if dh == yt
+  Label return_qd;
+  __ cmp(R2, Operand(R3));
+  __ b(&return_qd, EQ);
+
+  // R1 = dl = digits[(i - 1) >> 1]
+  __ ldr(R1,
+         FieldAddress(R1, TypedData::data_offset() - Bigint::kBytesPerDigit),
+         kUnsignedWord);
+
+  // R1 = dh:dl
+  __ orr(R1, R1, Operand(R2, LSL, 32));
+
+  // R0 = qd = dh:dl / yt = R1 / R3
+  __ udiv(R0, R1, R3);
+
+  __ Bind(&return_qd);
+  // args[1] = qd
+  __ str(R0,
+         FieldAddress(R4, TypedData::data_offset() + Bigint::kBytesPerDigit),
+         kUnsignedWord);
+
+  // Returning Object::null() is not required, since this method is private.
+  __ ret();
 }
 
 
 void Intrinsifier::Montgomery_mulMod(Assembler* assembler) {
-  // TODO(regis): Implement.
+  // Pseudo code:
+  // static void _mulMod(Uint32List args, Uint32List digits, int i) {
+  //   uint32_t rho = args[_RHO];  // _RHO == 0.
+  //   uint32_t d = digits[i >> 1];  // i is Smi.
+  //   uint64_t t = rho*d;
+  //   args[_MU] = t mod DIGIT_BASE;  // _MU == 1.
+  // }
+
+  // R4 = args
+  __ ldr(R4, Address(SP, 2 * kWordSize));  // args
+
+  // R3 = rho = args[0]
+  __ ldr(R3, FieldAddress(R4, TypedData::data_offset()), kUnsignedWord);
+
+  // R2 = digits[i >> 1]
+  // R0 = i as Smi, R1 = digits
+  __ ldp(R0, R1, Address(SP, 0 * kWordSize, Address::PairOffset));
+  __ add(R1, R1, Operand(R0, LSL, 1));
+  __ ldr(R2, FieldAddress(R1, TypedData::data_offset()), kUnsignedWord);
+
+  // X0 = t = rho*d
+  __ umaddl(R0, R2, R3, ZR);  // X0 = W2*W3 + 0.
+
+  // args[1] = t mod DIGIT_BASE = low32(t)
+  __ str(R0,
+         FieldAddress(R4, TypedData::data_offset() + Bigint::kBytesPerDigit),
+         kWord);
+
+  // Returning Object::null() is not required, since this method is private.
+  __ ret();
 }
 
 
diff --git a/runtime/vm/intrinsifier_ia32.cc b/runtime/vm/intrinsifier_ia32.cc
index 5945dbd..35db4cd 100644
--- a/runtime/vm/intrinsifier_ia32.cc
+++ b/runtime/vm/intrinsifier_ia32.cc
@@ -243,10 +243,8 @@
   // Compare length with capacity.
   __ cmpl(EBX, FieldAddress(EDI, Array::length_offset()));
   __ j(EQUAL, &fall_through);  // Must grow data.
-  const Immediate& value_one =
-      Immediate(reinterpret_cast<int32_t>(Smi::New(1)));
-  // len = len + 1;
-  __ addl(FieldAddress(EAX, GrowableObjectArray::length_offset()), value_one);
+  __ IncrementSmiField(FieldAddress(EAX, GrowableObjectArray::length_offset()),
+                       1);
   __ movl(EAX, Address(ESP, + 1 * kWordSize));  // Value
   ASSERT(kSmiTagShift == 1);
   __ StoreIntoObject(EDI,
diff --git a/runtime/vm/intrinsifier_mips.cc b/runtime/vm/intrinsifier_mips.cc
index e312650..f3c1ef5 100644
--- a/runtime/vm/intrinsifier_mips.cc
+++ b/runtime/vm/intrinsifier_mips.cc
@@ -897,32 +897,429 @@
 
 
 void Intrinsifier::Bigint_absAdd(Assembler* assembler) {
-  // TODO(regis): Implement.
+  // static void _absAdd(Uint32List digits, int used,
+  //                     Uint32List a_digits, int a_used,
+  //                     Uint32List r_digits)
+
+  // T2 = used, T3 = digits
+  __ lw(T2, Address(SP, 3 * kWordSize));
+  __ lw(T3, Address(SP, 4 * kWordSize));
+  // T3 = &digits[0]
+  __ addiu(T3, T3, Immediate(TypedData::data_offset() - kHeapObjectTag));
+
+  // T4 = a_used, T5 = a_digits
+  __ lw(T4, Address(SP, 1 * kWordSize));
+  __ lw(T5, Address(SP, 2 * kWordSize));
+  // T5 = &a_digits[0]
+  __ addiu(T5, T5, Immediate(TypedData::data_offset() - kHeapObjectTag));
+
+  // T6 = r_digits
+  __ lw(T6, Address(SP, 0 * kWordSize));
+  // T6 = &r_digits[0]
+  __ addiu(T6, T6, Immediate(TypedData::data_offset() - kHeapObjectTag));
+
+  // V0 = &digits[a_used >> 1], a_used is Smi.
+  __ sll(V0, T4, 1);
+  __ addu(V0, V0, T3);
+
+  // V1 = &digits[used >> 1], used is Smi.
+  __ sll(V1, T2, 1);
+  __ addu(V1, V1, T3);
+
+  // T2 = carry in = 0.
+  __ mov(T2, ZR);
+  Label add_loop;
+  __ Bind(&add_loop);
+  // Loop a_used times, a_used > 0.
+  __ lw(T0, Address(T3, 0));  // T0 = x.
+  __ addiu(T3, T3, Immediate(Bigint::kBytesPerDigit));
+  __ lw(T1, Address(T5, 0));  // T1 = y.
+  __ addiu(T5, T5, Immediate(Bigint::kBytesPerDigit));
+  __ addu(T1, T0, T1);  // T1 = x + y.
+  __ sltu(T4, T1, T0);  // T4 = carry out of x + y.
+  __ addu(T0, T1, T2);  // T0 = x + y + carry in.
+  __ sltu(T2, T0, T1);  // T2 = carry out of (x + y) + carry in.
+  __ or_(T2, T2, T4);   // T2 = carry out of x + y + carry in.
+  __ sw(T0, Address(T6, 0));
+  __ bne(T3, V0, &add_loop);
+  __ delay_slot()->addiu(T6, T6, Immediate(Bigint::kBytesPerDigit));
+
+  Label last_carry;
+  __ beq(T3, V1, &last_carry);
+
+  Label carry_loop;
+  __ Bind(&carry_loop);
+  // Loop used - a_used times, used - a_used > 0.
+  __ lw(T0, Address(T3, 0));  // T0 = x.
+  __ addiu(T3, T3, Immediate(Bigint::kBytesPerDigit));
+  __ addu(T1, T0, T2);  // T1 = x + carry in.
+  __ sltu(T2, T1, T0);  // T2 = carry out of x + carry in.
+  __ sw(T1, Address(T6, 0));
+  __ bne(T3, V1, &carry_loop);
+  __ delay_slot()->addiu(T6, T6, Immediate(Bigint::kBytesPerDigit));
+
+  __ Bind(&last_carry);
+  __ sw(T2, Address(T6, 0));
+
+  // Returning Object::null() is not required, since this method is private.
+  __ Ret();
 }
 
 
 void Intrinsifier::Bigint_absSub(Assembler* assembler) {
-  // TODO(regis): Implement.
+  // static void _absSub(Uint32List digits, int used,
+  //                     Uint32List a_digits, int a_used,
+  //                     Uint32List r_digits)
+
+  // T2 = used, T3 = digits
+  __ lw(T2, Address(SP, 3 * kWordSize));
+  __ lw(T3, Address(SP, 4 * kWordSize));
+  // T3 = &digits[0]
+  __ addiu(T3, T3, Immediate(TypedData::data_offset() - kHeapObjectTag));
+
+  // T4 = a_used, T5 = a_digits
+  __ lw(T4, Address(SP, 1 * kWordSize));
+  __ lw(T5, Address(SP, 2 * kWordSize));
+  // T5 = &a_digits[0]
+  __ addiu(T5, T5, Immediate(TypedData::data_offset() - kHeapObjectTag));
+
+  // T6 = r_digits
+  __ lw(T6, Address(SP, 0 * kWordSize));
+  // T6 = &r_digits[0]
+  __ addiu(T6, T6, Immediate(TypedData::data_offset() - kHeapObjectTag));
+
+  // V0 = &digits[a_used >> 1], a_used is Smi.
+  __ sll(V0, T4, 1);
+  __ addu(V0, V0, T3);
+
+  // V1 = &digits[used >> 1], used is Smi.
+  __ sll(V1, T2, 1);
+  __ addu(V1, V1, T3);
+
+  // T2 = borrow in = 0.
+  __ mov(T2, ZR);
+  Label sub_loop;
+  __ Bind(&sub_loop);
+  // Loop a_used times, a_used > 0.
+  __ lw(T0, Address(T3, 0));  // T0 = x.
+  __ addiu(T3, T3, Immediate(Bigint::kBytesPerDigit));
+  __ lw(T1, Address(T5, 0));  // T1 = y.
+  __ addiu(T5, T5, Immediate(Bigint::kBytesPerDigit));
+  __ subu(T1, T0, T1);  // T1 = x - y.
+  __ sltu(T4, T0, T1);  // T4 = borrow out of x - y.
+  __ subu(T0, T1, T2);  // T0 = x - y - borrow in.
+  __ sltu(T2, T1, T0);  // T2 = borrow out of (x - y) - borrow in.
+  __ or_(T2, T2, T4);   // T2 = borrow out of x - y - borrow in.
+  __ sw(T0, Address(T6, 0));
+  __ bne(T3, V0, &sub_loop);
+  __ delay_slot()->addiu(T6, T6, Immediate(Bigint::kBytesPerDigit));
+
+  Label done;
+  __ beq(T3, V1, &done);
+
+  Label borrow_loop;
+  __ Bind(&borrow_loop);
+  // Loop used - a_used times, used - a_used > 0.
+  __ lw(T0, Address(T3, 0));  // T0 = x.
+  __ addiu(T3, T3, Immediate(Bigint::kBytesPerDigit));
+  __ subu(T1, T0, T2);  // T1 = x - borrow in.
+  __ sltu(T2, T0, T1);  // T2 = borrow out of x - borrow in.
+  __ sw(T1, Address(T6, 0));
+  __ bne(T3, V1, &borrow_loop);
+  __ delay_slot()->addiu(T6, T6, Immediate(Bigint::kBytesPerDigit));
+
+  __ Bind(&done);
+  // Returning Object::null() is not required, since this method is private.
+  __ Ret();
 }
 
 
 void Intrinsifier::Bigint_mulAdd(Assembler* assembler) {
-  // TODO(regis): Implement.
+  // Pseudo code:
+  // static void _mulAdd(Uint32List x_digits, int xi,
+  //                     Uint32List m_digits, int i,
+  //                     Uint32List a_digits, int j, int n) {
+  //   uint32_t x = x_digits[xi >> 1];  // xi is Smi.
+  //   if (x == 0 || n == 0) {
+  //     return;
+  //   }
+  //   uint32_t* mip = &m_digits[i >> 1];  // i is Smi.
+  //   uint32_t* ajp = &a_digits[j >> 1];  // j is Smi.
+  //   uint32_t c = 0;
+  //   SmiUntag(n);
+  //   do {
+  //     uint32_t mi = *mip++;
+  //     uint32_t aj = *ajp;
+  //     uint64_t t = x*mi + aj + c;  // 32-bit * 32-bit -> 64-bit.
+  //     *ajp++ = low32(t);
+  //     c = high32(t);
+  //   } while (--n > 0);
+  //   while (c != 0) {
+  //     uint64_t t = *ajp + c;
+  //     *ajp++ = low32(t);
+  //     c = high32(t);  // c == 0 or 1.
+  //   }
+  // }
+
+  Label done;
+  // T3 = x, no_op if x == 0
+  __ lw(T0, Address(SP, 5 * kWordSize));  // T0 = xi as Smi.
+  __ lw(T1, Address(SP, 6 * kWordSize));  // T1 = x_digits.
+  __ sll(T0, T0, 1);
+  __ addu(T1, T0, T1);
+  __ lw(T3, FieldAddress(T1, TypedData::data_offset()));
+  __ beq(T3, ZR, &done);
+
+  // T6 = SmiUntag(n), no_op if n == 0
+  __ lw(T6, Address(SP, 0 * kWordSize));
+  __ SmiUntag(T6);
+  __ beq(T6, ZR, &done);
+  __ delay_slot()->addiu(T6, T6, Immediate(-1));  // ... while (n-- > 0).
+
+  // T4 = mip = &m_digits[i >> 1]
+  __ lw(T0, Address(SP, 3 * kWordSize));  // T0 = i as Smi.
+  __ lw(T1, Address(SP, 4 * kWordSize));  // T1 = m_digits.
+  __ sll(T0, T0, 1);
+  __ addu(T1, T0, T1);
+  __ addiu(T4, T1, Immediate(TypedData::data_offset() - kHeapObjectTag));
+
+  // T5 = ajp = &a_digits[j >> 1]
+  __ lw(T0, Address(SP, 1 * kWordSize));  // T0 = j as Smi.
+  __ lw(T1, Address(SP, 2 * kWordSize));  // T1 = a_digits.
+  __ sll(T0, T0, 1);
+  __ addu(T1, T0, T1);
+  __ addiu(T5, T1, Immediate(TypedData::data_offset() - kHeapObjectTag));
+
+  // T1 = c = 0
+  __ mov(T1, ZR);
+
+  Label muladd_loop;
+  __ Bind(&muladd_loop);
+  // x:   T3
+  // mip: T4
+  // ajp: T5
+  // c:   T1
+  // n-1: T6
+
+  // uint32_t mi = *mip++
+  __ lw(T2, Address(T4, 0));
+
+  // uint32_t aj = *ajp
+  __ lw(T0, Address(T5, 0));
+
+  // uint64_t t = x*mi + aj + c
+  __ multu(T2, T3);  // HI:LO = x*mi.
+  __ addiu(T4, T4, Immediate(Bigint::kBytesPerDigit));
+  __ mflo(V0);
+  __ mfhi(V1);
+  __ addu(V0, V0, T0);  // V0 = low32(x*mi) + aj.
+  __ sltu(T7, V0, T0);  // T7 = carry out of low32(x*mi) + aj.
+  __ addu(V1, V1, T7);  // V1:V0 = x*mi + aj.
+  __ addu(T0, V0, T1);  // T0 = low32(x*mi + aj) + c.
+  __ sltu(T7, T0, T1);  // T7 = carry out of low32(x*mi + aj) + c.
+  __ addu(T1, V1, T7);  // T1 = c = high32(x*mi + aj + c).
+
+  // *ajp++ = low32(t) = T0
+  __ sw(T0, Address(T5, 0));
+  __ addiu(T5, T5, Immediate(Bigint::kBytesPerDigit));
+
+  // while (n-- > 0)
+  __ bgtz(T6, &muladd_loop);
+  __ delay_slot()->addiu(T6, T6, Immediate(-1));  // --n
+
+  __ beq(T1, ZR, &done);
+
+  // *ajp++ += c
+  __ lw(T0, Address(T5, 0));
+  __ addu(T0, T0, T1);
+  __ sltu(T1, T0, T1);
+  __ sw(T0, Address(T5, 0));
+  __ beq(T1, ZR, &done);
+  __ delay_slot()->addiu(T5, T5, Immediate(Bigint::kBytesPerDigit));
+
+  Label propagate_carry_loop;
+  __ Bind(&propagate_carry_loop);
+  __ lw(T0, Address(T5, 0));
+  __ addiu(T0, T0, Immediate(1));
+  __ sw(T0, Address(T5, 0));
+  __ beq(T0, ZR, &propagate_carry_loop);
+  __ delay_slot()->addiu(T5, T5, Immediate(Bigint::kBytesPerDigit));
+
+  __ Bind(&done);
+  // Returning Object::null() is not required, since this method is private.
+  __ Ret();
 }
 
 
 void Intrinsifier::Bigint_sqrAdd(Assembler* assembler) {
-  // TODO(regis): Implement.
+  // Pseudo code:
+  // static void _sqrAdd(Uint32List x_digits, int i,
+  //                     Uint32List a_digits, int used) {
+  //   uint32_t* xip = &x_digits[i >> 1];  // i is Smi.
+  //   uint32_t x = *xip++;
+  //   if (x == 0) return;
+  //   uint32_t* ajp = &a_digits[i];  // j == 2*i, i is Smi.
+  //   uint32_t aj = *ajp;
+  //   uint64_t t = x*x + aj;
+  //   *ajp++ = low32(t);
+  //   uint64_t c = high32(t);
+  //   int n = ((used - i) >> 1) - 1;  // used and i are Smi.
+  //   while (--n >= 0) {
+  //     uint32_t xi = *xip++;
+  //     uint32_t aj = *ajp;
+  //     uint96_t t = 2*x*xi + aj + c;  // 2-bit * 32-bit * 32-bit -> 65-bit.
+  //     *ajp++ = low32(t);
+  //     c = high64(t);  // 33-bit.
+  //   }
+  //   uint32_t aj = *ajp;
+  //   uint64_t t = aj + c;  // 32-bit + 33-bit -> 34-bit.
+  //   *ajp++ = low32(t);
+  //   *ajp = high32(t);
+  // }
+
+  // T4 = xip = &x_digits[i >> 1]
+  __ lw(T2, Address(SP, 2 * kWordSize));  // T2 = i as Smi.
+  __ lw(T3, Address(SP, 3 * kWordSize));  // T3 = x_digits.
+  __ sll(T0, T2, 1);
+  __ addu(T3, T0, T3);
+  __ addiu(T4, T3, Immediate(TypedData::data_offset() - kHeapObjectTag));
+
+  // T3 = x = *xip++, return if x == 0
+  Label x_zero;
+  __ lw(T3, Address(T4, 0));
+  __ beq(T3, ZR, &x_zero);
+  __ delay_slot()->addiu(T4, T4, Immediate(Bigint::kBytesPerDigit));
+
+  // T5 = ajp = &a_digits[i]
+  __ lw(T1, Address(SP, 1 * kWordSize));  // a_digits
+  __ sll(T0, T2, 2);  // j == 2*i, i is Smi.
+  __ addu(T1, T0, T1);
+  __ addiu(T5, T1, Immediate(TypedData::data_offset() - kHeapObjectTag));
+
+  // T6:T0 = t = x*x + *ajp
+  __ lw(T0, Address(T5, 0));  // *ajp.
+  __ mthi(ZR);
+  __ mtlo(T0);
+  __ maddu(T3, T3);  // HI:LO = T3*T3 + *ajp.
+  __ mfhi(T6);
+  __ mflo(T0);
+
+  // *ajp++ = low32(t) = R0
+  __ sw(T0, Address(T5, 0));
+  __ addiu(T5, T5, Immediate(Bigint::kBytesPerDigit));
+
+  // T6 = low32(c) = high32(t)
+  // T7 = high32(c) = 0
+  __ mov(T7, ZR);
+
+  // int n = used - i - 1; while (--n >= 0) ...
+  __ lw(T0, Address(SP, 0 * kWordSize));  // used is Smi
+  __ subu(V0, T0, T2);
+  __ SmiUntag(V0);  // V0 = used - i
+  // int n = used - i - 2; if (n >= 0) ... while (n-- > 0)
+  __ addiu(V0, V0, Immediate(-2));
+
+  Label loop, done;
+  __ bltz(V0, &done);
+
+  __ Bind(&loop);
+  // x:   T3
+  // xip: T4
+  // ajp: T5
+  // c:   T7:T6
+  // t:   A2:A1:A0 (not live at loop entry)
+  // n:   V0
+
+  // uint32_t xi = *xip++
+  __ lw(T2, Address(T4, 0));
+  __ addiu(T4, T4, Immediate(Bigint::kBytesPerDigit));
+
+  // uint32_t aj = *ajp
+  __ lw(T0, Address(T5, 0));
+
+  // uint96_t t = T7:T6:T0 = 2*x*xi + aj + c
+  __ multu(T2, T3);
+  __ mfhi(A1);
+  __ mflo(A0);  // A1:A0 = x*xi.
+  __ srl(A2, A1, 31);
+  __ sll(A1, A1, 1);
+  __ srl(T1, A0, 31);
+  __ or_(A1, A1, T1);
+  __ sll(A0, A0, 1);  // A2:A1:A0 = 2*x*xi.
+  __ addu(A0, A0, T0);
+  __ sltu(T1, A0, T0);
+  __ addu(A1, A1, T1);  // No carry out possible; A2:A1:A0 = 2*x*xi + aj.
+  __ addu(T0, A0, T6);
+  __ sltu(T1, T0, T6);
+  __ addu(T6, A1, T1);  // No carry out; A2:T6:T0 = 2*x*xi + aj + low32(c).
+  __ addu(T6, T6, T7);  // No carry out; A2:T6:T0 = 2*x*xi + aj + c.
+  __ mov(T7, A2);  // T7:T6:T0 = 2*x*xi + aj + c.
+
+  // *ajp++ = low32(t) = T0
+  __ sw(T0, Address(T5, 0));
+  __ addiu(T5, T5, Immediate(Bigint::kBytesPerDigit));
+
+  // while (n-- > 0)
+  __ bgtz(V0, &loop);
+  __ delay_slot()->addiu(V0, V0, Immediate(-1));  // --n
+
+  __ Bind(&done);
+  // uint32_t aj = *ajp
+  __ lw(T0, Address(T5, 0));
+
+  // uint64_t t = aj + c
+  __ addu(T6, T6, T0);
+  __ sltu(T1, T6, T0);
+  __ addu(T7, T7, T1);
+
+  // *ajp = low32(t) = T6
+  // *(ajp + 1) = high32(t) = T7
+  __ sw(T6, Address(T5, 0));
+  __ sw(T7, Address(T5, Bigint::kBytesPerDigit));
+
+  __ Bind(&x_zero);
+  // Returning Object::null() is not required, since this method is private.
+  __ Ret();
 }
 
 
 void Intrinsifier::Bigint_estQuotientDigit(Assembler* assembler) {
-  // TODO(regis): Implement.
+  // No unsigned 64-bit / 32-bit divide instruction.
 }
 
 
 void Intrinsifier::Montgomery_mulMod(Assembler* assembler) {
-  // TODO(regis): Implement.
+  // Pseudo code:
+  // static void _mulMod(Uint32List args, Uint32List digits, int i) {
+  //   uint32_t rho = args[_RHO];  // _RHO == 0.
+  //   uint32_t d = digits[i >> 1];  // i is Smi.
+  //   uint64_t t = rho*d;
+  //   args[_MU] = t mod DIGIT_BASE;  // _MU == 1.
+  // }
+
+  // T4 = args
+  __ lw(T4, Address(SP, 2 * kWordSize));  // args
+
+  // T3 = rho = args[0]
+  __ lw(T3, FieldAddress(T4, TypedData::data_offset()));
+
+  // T2 = d = digits[i >> 1]
+  __ lw(T0, Address(SP, 0 * kWordSize));  // T0 = i as Smi.
+  __ lw(T1, Address(SP, 1 * kWordSize));  // T1 = digits.
+  __ sll(T0, T0, 1);
+  __ addu(T1, T0, T1);
+  __ lw(T2, FieldAddress(T1, TypedData::data_offset()));
+
+  // HI:LO = t = rho*d
+  __ multu(T2, T3);
+
+  // args[1] = t mod DIGIT_BASE = low32(t)
+  __ mflo(T0);
+  __ sw(T0,
+        FieldAddress(T4, TypedData::data_offset() + Bigint::kBytesPerDigit));
+
+  // Returning Object::null() is not required, since this method is private.
+  __ Ret();
 }
 
 
diff --git a/runtime/vm/method_recognizer.cc b/runtime/vm/method_recognizer.cc
index 29b08fd..9801697 100644
--- a/runtime/vm/method_recognizer.cc
+++ b/runtime/vm/method_recognizer.cc
@@ -54,23 +54,27 @@
 
   RECOGNIZED_LIST(SET_RECOGNIZED_KIND);
 
-#define SET_FUNCTION_BIT(class_name, function_name, dest, fp, setter_name)     \
+#define SET_FUNCTION_BIT(class_name, function_name, dest, fp, setter, value)   \
   func = Library::GetFunction(libs, #class_name, #function_name);              \
   if (func.IsNull()) {                                                         \
     OS::PrintErr("Missing %s::%s\n", #class_name, #function_name);             \
     UNREACHABLE();                                                             \
   }                                                                            \
   ASSERT(func.CheckSourceFingerprint(fp));                                     \
-  func.setter_name(true);
+  func.setter(value);
 
 #define SET_IS_ALWAYS_INLINE(class_name, function_name, dest, fp)              \
-  SET_FUNCTION_BIT(class_name, function_name, dest, fp, set_always_inline)
+  SET_FUNCTION_BIT(class_name, function_name, dest, fp, set_always_inline, true)
+
+#define SET_IS_NEVER_INLINE(class_name, function_name, dest, fp)              \
+  SET_FUNCTION_BIT(class_name, function_name, dest, fp, set_is_inlinable, false)
 
 #define SET_IS_POLYMORPHIC_TARGET(class_name, function_name, dest, fp)         \
   SET_FUNCTION_BIT(class_name, function_name, dest, fp,                        \
-                   set_is_polymorphic_target)
+                   set_is_polymorphic_target, true)
 
   INLINE_WHITE_LIST(SET_IS_ALWAYS_INLINE);
+  INLINE_BLACK_LIST(SET_IS_NEVER_INLINE);
   POLYMORPHIC_TARGET_LIST(SET_IS_POLYMORPHIC_TARGET);
 
 #undef SET_RECOGNIZED_KIND
diff --git a/runtime/vm/method_recognizer.h b/runtime/vm/method_recognizer.h
index 0c4a9ec..13af219 100644
--- a/runtime/vm/method_recognizer.h
+++ b/runtime/vm/method_recognizer.h
@@ -378,6 +378,15 @@
   V(_Bigint, get:_digits, Bigint_getDigits, 1408062672)                        \
   V(_Bigint, set:_digits, Bigint_setDigits, 1135754410)                        \
 
+// A list of core function that should never be inlined.
+#define INLINE_BLACK_LIST(V)                                                   \
+  V(_Bigint, _absAdd, Bigint_absAdd, 233965936)                                \
+  V(_Bigint, _absSub, Bigint_absSub, 1401148862)                               \
+  V(_Bigint, _mulAdd, Bigint_mulAdd, 1283124653)                               \
+  V(_Bigint, _sqrAdd, Bigint_sqrAdd, 1665155090)                               \
+  V(_Bigint, _estQuotientDigit, Bigint_estQuotientDigit, 643982609)            \
+  V(_Montgomery, _mulMod, Montgomery_mulMod, 149127024)                        \
+
 // A list of core functions that internally dispatch based on received id.
 #define POLYMORPHIC_TARGET_LIST(V)                                             \
   V(_StringBase, [], StringBaseCharAt, 1512210677)                             \
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 47ce72f..6a9f84b 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -942,7 +942,7 @@
 
       intptr_t leftover_len = (leftover_size - TypedData::InstanceSize(0));
       ASSERT(TypedData::InstanceSize(leftover_len) == leftover_size);
-      raw->ptr()->length_ = Smi::New(leftover_len);
+      raw->StoreSmi(&(raw->ptr()->length_), Smi::New(leftover_len));
     } else {
       // Update the leftover space as a basic object.
       ASSERT(leftover_size == Object::InstanceSize());
@@ -10428,6 +10428,7 @@
   all_libs.Add(&Library::ZoneHandle(Library::TypedDataLibrary()));
   OTHER_RECOGNIZED_LIST(CHECK_FINGERPRINTS);
   INLINE_WHITE_LIST(CHECK_FINGERPRINTS);
+  INLINE_BLACK_LIST(CHECK_FINGERPRINTS);
   POLYMORPHIC_TARGET_LIST(CHECK_FINGERPRINTS);
 
   all_libs.Clear();
@@ -12184,8 +12185,10 @@
     for (intptr_t i = 0; i < pointer_offsets.length(); i++) {
       intptr_t offset_in_instrs = pointer_offsets[i];
       code.SetPointerOffsetAt(i, offset_in_instrs);
-      const Object* object = region.Load<const Object*>(offset_in_instrs);
-      region.Store<RawObject*>(offset_in_instrs, object->raw());
+      uword addr = region.start() + offset_in_instrs;
+      const Object* object = *reinterpret_cast<Object**>(addr);
+      instrs.raw()->StorePointer(reinterpret_cast<RawObject**>(addr),
+                                 object->raw());
     }
 
     // Hook up Code and Instructions objects.
@@ -12598,7 +12601,8 @@
 
 void ContextScope::SetTokenIndexAt(intptr_t scope_index,
                                    intptr_t token_pos) const {
-  VariableDescAddr(scope_index)->token_pos = Smi::New(token_pos);
+  StoreSmi(&VariableDescAddr(scope_index)->token_pos,
+           Smi::New(token_pos));
 }
 
 
@@ -12618,7 +12622,8 @@
 
 
 void ContextScope::SetIsFinalAt(intptr_t scope_index, bool is_final) const {
-  VariableDescAddr(scope_index)->is_final = Bool::Get(is_final).raw();
+  StorePointer(&(VariableDescAddr(scope_index)->is_final),
+               Bool::Get(is_final).raw());
 }
 
 
@@ -12628,7 +12633,8 @@
 
 
 void ContextScope::SetIsConstAt(intptr_t scope_index, bool is_const) const {
-  VariableDescAddr(scope_index)->is_const = Bool::Get(is_const).raw();
+  StorePointer(&(VariableDescAddr(scope_index)->is_const),
+               Bool::Get(is_const).raw());
 }
 
 
@@ -12664,7 +12670,8 @@
 
 void ContextScope::SetContextIndexAt(intptr_t scope_index,
                                      intptr_t context_index) const {
-  VariableDescAddr(scope_index)->context_index = Smi::New(context_index);
+  StoreSmi(&(VariableDescAddr(scope_index)->context_index),
+           Smi::New(context_index));
 }
 
 
@@ -12675,7 +12682,8 @@
 
 void ContextScope::SetContextLevelAt(intptr_t scope_index,
                                      intptr_t context_level) const {
-  VariableDescAddr(scope_index)->context_level = Smi::New(context_level);
+  StoreSmi(&(VariableDescAddr(scope_index)->context_level),
+           Smi::New(context_level));
 }
 
 
@@ -18257,8 +18265,8 @@
                                       space);
     NoGCScope no_gc;
     RawOneByteString* result = reinterpret_cast<RawOneByteString*>(raw);
-    result->ptr()->length_ = Smi::New(len);
-    result->ptr()->hash_ = 0;
+    result->StoreSmi(&(result->ptr()->length_), Smi::New(len));
+    result->StoreSmi(&(result->ptr()->hash_), Smi::New(0));
     return result;
   }
 }
@@ -18795,7 +18803,7 @@
                          Array::InstanceSize(len),
                          space));
     NoGCScope no_gc;
-    raw->ptr()->length_ = Smi::New(len);
+    raw->StoreSmi(&(raw->ptr()->length_), Smi::New(len));
     return raw;
   }
 }
diff --git a/runtime/vm/object.h b/runtime/vm/object.h
index dacb7ff..7da98c0 100644
--- a/runtime/vm/object.h
+++ b/runtime/vm/object.h
@@ -589,29 +589,17 @@
     return Utils::RoundUp(size, kObjectAlignment);
   }
 
-  bool Contains(uword addr) const {
-    intptr_t this_size = raw()->Size();
-    uword this_addr = RawObject::ToAddr(raw());
-    return (addr >= this_addr) && (addr < (this_addr + this_size));
-  }
+  bool Contains(uword addr) const { return raw()->Contains(addr); }
 
   // Start of field mutator guards.
   //
   // All writes to heap objects should ultimately pass through one of the
-  // methods below, to ensure that the write barrier is correctly applied.
+  // methods below or their counterparts in RawObject, to ensure that the
+  // write barrier is correctly applied.
 
   template<typename type>
   void StorePointer(type const* addr, type value) const {
-    // Ensure that this object contains the addr.
-    ASSERT(Contains(reinterpret_cast<uword>(addr)));
-    *const_cast<type*>(addr) = value;
-    // Filter stores based on source and target.
-    if (!value->IsHeapObject()) return;
-    if (value->IsNewObject() && raw()->IsOldObject() &&
-        !raw()->IsRemembered()) {
-      raw()->SetRememberedBit();
-      Isolate::Current()->store_buffer()->AddObject(raw());
-    }
+    raw()->StorePointer(addr, value);
   }
 
   // Store a range of pointers [from, from + count) into [to, to + count).
@@ -632,9 +620,7 @@
   // Use for storing into an explicitly Smi-typed field of an object
   // (i.e., both the previous and new value are Smis).
   void StoreSmi(RawSmi* const* addr, RawSmi* value) const {
-    // Can't use Contains, as array length is initialized through this method.
-    ASSERT(reinterpret_cast<uword>(addr) >= RawObject::ToAddr(raw()));
-    *const_cast<RawSmi**>(addr) = value;
+    raw()->StoreSmi(addr, value);
   }
 
   template<typename FieldType>
@@ -4184,12 +4170,9 @@
     StoreNonPointer(&raw_ptr()->num_variables_, num_variables);
   }
 
-  RawContextScope::VariableDesc* VariableDescAddr(intptr_t index) const {
+  const RawContextScope::VariableDesc* VariableDescAddr(intptr_t index) const {
     ASSERT((index >= 0) && (index < num_variables()));
-    uword raw_addr = reinterpret_cast<uword>(raw_ptr());
-    raw_addr += sizeof(RawContextScope) +
-        (index * sizeof(RawContextScope::VariableDesc));
-    return reinterpret_cast<RawContextScope::VariableDesc*>(raw_addr);
+    return raw_ptr()->VariableDescAddr(index);
   }
 
   FINAL_HEAP_OBJECT_IMPLEMENTATION(ContextScope, Object);
@@ -6499,22 +6482,8 @@
     ASSERT((index >= 0) && (index < Length()));
     return &(DataArray()->data()[index]);
   }
-  bool DataContains(uword addr) const {
-    intptr_t data_size = data()->Size();
-    uword data_addr = RawObject::ToAddr(data());
-    return (addr >= data_addr) && (addr < (data_addr + data_size));
-  }
   void DataStorePointer(RawObject** addr, RawObject* value) const {
-    // Ensure that the backing array object contains the addr.
-    ASSERT(DataContains(reinterpret_cast<uword>(addr)));
-    *addr = value;
-    // Filter stores based on source and target.
-    if (!value->IsHeapObject()) return;
-    if (value->IsNewObject() && data()->IsOldObject() &&
-        !data()->IsRemembered()) {
-      data()->SetRememberedBit();
-      Isolate::Current()->store_buffer()->AddObject(data());
-    }
+    data()->StorePointer(addr, value);
   }
 
   static const int kDefaultInitialCapacity = 4;
@@ -7339,8 +7308,8 @@
   }
 
   static void Clear(RawWeakProperty* raw_weak) {
-    raw_weak->ptr()->key_ = Object::null();
-    raw_weak->ptr()->value_ = Object::null();
+    raw_weak->StorePointer(&(raw_weak->ptr()->key_), Object::null());
+    raw_weak->StorePointer(&(raw_weak->ptr()->value_), Object::null());
   }
 
  private:
diff --git a/runtime/vm/raw_object.h b/runtime/vm/raw_object.h
index 8e221e9..5470991 100644
--- a/runtime/vm/raw_object.h
+++ b/runtime/vm/raw_object.h
@@ -403,6 +403,12 @@
     return result;
   }
 
+  bool Contains(uword addr) const {
+    intptr_t this_size = Size();
+    uword this_addr = RawObject::ToAddr(this);
+    return (addr >= this_addr) && (addr < (this_addr + this_size));
+  }
+
   void Validate(Isolate* isolate) const;
   intptr_t VisitPointers(ObjectPointerVisitor* visitor);
   bool FindObject(FindObjectVisitor* visitor);
@@ -459,7 +465,7 @@
   class ReservedBits : public
       BitField<intptr_t, kReservedTagPos, kReservedTagSize> {};  // NOLINT
 
-  // TODO(koda): Return const*, like Object::raw_ptr().
+  // TODO(koda): After handling tags_, return const*, like Object::raw_ptr().
   RawObject* ptr() const {
     ASSERT(IsHeapObject());
     return reinterpret_cast<RawObject*>(
@@ -473,6 +479,32 @@
     return ClassIdTag::decode(tags);
   }
 
+  // All writes to heap objects should ultimately pass through one of the
+  // methods below or their counterparts in Object, to ensure that the
+  // write barrier is correctly applied.
+
+  template<typename type>
+  void StorePointer(type const* addr, type value) {
+    // Ensure that this object contains the addr.
+    ASSERT(Contains(reinterpret_cast<uword>(addr)));
+    *const_cast<type*>(addr) = value;
+    // Filter stores based on source and target.
+    if (!value->IsHeapObject()) return;
+    if (value->IsNewObject() && this->IsOldObject() &&
+        !this->IsRemembered()) {
+      this->SetRememberedBit();
+      Isolate::Current()->store_buffer()->AddObject(this);
+    }
+  }
+
+  // Use for storing into an explicitly Smi-typed field of an object
+  // (i.e., both the previous and new value are Smis).
+  void StoreSmi(RawSmi* const* addr, RawSmi* value) {
+    // Can't use Contains, as array length is initialized through this method.
+    ASSERT(reinterpret_cast<uword>(addr) >= RawObject::ToAddr(this));
+    *const_cast<RawSmi**>(addr) = value;
+  }
+
   friend class Api;
   friend class Array;
   friend class ByteBuffer;
@@ -481,11 +513,13 @@
   friend class GCMarker;
   friend class ExternalTypedData;
   friend class ForwardList;
+  friend class GrowableObjectArray;  // StorePointer
   friend class Heap;
   friend class HeapMapAsJSONVisitor;
   friend class ClassStatsVisitor;
   friend class MarkingVisitor;
   friend class Object;
+  friend class OneByteString;  // StoreSmi
   friend class RawExternalTypedData;
   friend class RawInstructions;
   friend class RawInstance;
@@ -498,6 +532,7 @@
   friend class String;
   friend class TypedData;
   friend class TypedDataView;
+  friend class WeakProperty;  // StorePointer
 
   DISALLOW_ALLOCATION();
   DISALLOW_IMPLICIT_CONSTRUCTORS(RawObject);
@@ -1210,13 +1245,20 @@
   int32_t num_variables_;
 
   RawObject** from() {
-    return reinterpret_cast<RawObject**>(&ptr()->data()[0]);
+    VariableDesc* begin = const_cast<VariableDesc*>(ptr()->VariableDescAddr(0));
+    return reinterpret_cast<RawObject**>(begin);
   }
   // Variable length data follows here.
-  RawObject** data() { OPEN_ARRAY_START(RawObject*, RawObject*); }
+  RawObject* const* data() const { OPEN_ARRAY_START(RawObject*, RawObject*); }
+  const VariableDesc* VariableDescAddr(intptr_t index) const {
+    ASSERT((index >= 0) && (index < num_variables_ + 1));
+    // data() points to the first component of the first descriptor.
+    return &(reinterpret_cast<const VariableDesc*>(data())[index]);
+  }
   RawObject** to(intptr_t num_vars) {
-    const intptr_t data_length = num_vars * (sizeof(VariableDesc)/kWordSize);
-    return reinterpret_cast<RawObject**>(&ptr()->data()[data_length - 1]);
+    uword end = reinterpret_cast<uword>(ptr()->VariableDescAddr(num_vars));
+    // 'end' is the address just beyond the last descriptor, so step back.
+    return reinterpret_cast<RawObject**>(end - kWordSize);
   }
 };
 
diff --git a/runtime/vm/simulator_arm64.cc b/runtime/vm/simulator_arm64.cc
index 2192a8f..5f126e4 100644
--- a/runtime/vm/simulator_arm64.cc
+++ b/runtime/vm/simulator_arm64.cc
@@ -2303,6 +2303,14 @@
         static_cast<__int128>(rn_val) * static_cast<__int128>(rm_val);
     const int64_t alu_out = static_cast<int64_t>(res >> 64);
     set_register(instr, rd, alu_out, R31IsZR);
+  } else if ((instr->Bits(29, 3) == 4) && (instr->Bits(21, 3) == 5) &&
+             (instr->Bit(15) == 0)) {
+    // Format(instr, "umaddl 'rd, 'rn, 'rm, 'ra");
+    const uint64_t rn_val = static_cast<uint32_t>(get_wregister(rn, R31IsZR));
+    const uint64_t rm_val = static_cast<uint32_t>(get_wregister(rm, R31IsZR));
+    const uint64_t ra_val = get_register(ra, R31IsZR);
+    const uint64_t alu_out = ra_val + (rn_val * rm_val);
+    set_register(instr, rd, alu_out, R31IsZR);
   } else {
     UnimplementedInstruction(instr);
   }
diff --git a/runtime/vm/simulator_mips.cc b/runtime/vm/simulator_mips.cc
index b1ce7f2..62c81f7 100644
--- a/runtime/vm/simulator_mips.cc
+++ b/runtime/vm/simulator_mips.cc
@@ -94,6 +94,10 @@
   bool GetFValue(char* desc, double* value);
   bool GetDValue(char* desc, double* value);
 
+  static const int32_t kSimulatorBreakpointInstruction =
+      Instr::kBreakPointInstruction |
+      (Instr::kSimulatorBreakCode << kBreakCodeShift);
+
   // Set or delete a breakpoint. Returns true if successful.
   bool SetBreakpoint(Instr* breakpc);
   bool DeleteBreakpoint(Instr* breakpc);
@@ -282,7 +286,7 @@
 
 void SimulatorDebugger::RedoBreakpoints() {
   if (sim_->break_pc_ != NULL) {
-    sim_->break_pc_->SetInstructionBits(Instr::kBreakPointInstruction);
+    sim_->break_pc_->SetInstructionBits(kSimulatorBreakpointInstruction);
   }
 }
 
@@ -1202,11 +1206,19 @@
       // Adjust for extra pc increment.
       set_pc(get_pc() - Instr::kInstrSize);
     }
-  } else {
+  } else if (instr->BreakCodeField() == Instr::kSimulatorBreakCode) {
     SimulatorDebugger dbg(this);
     dbg.Stop(instr, "breakpoint");
     // Adjust for extra pc increment.
     set_pc(get_pc() - Instr::kInstrSize);
+  } else {
+    SimulatorDebugger dbg(this);
+    set_pc(get_pc() + Instr::kInstrSize);
+    char buffer[32];
+    snprintf(buffer, sizeof(buffer), "break #0x%x", instr->BreakCodeField());
+    dbg.Stop(instr, buffer);
+    // Adjust for extra pc increment.
+    set_pc(get_pc() - Instr::kInstrSize);
   }
 }
 
@@ -1365,8 +1377,8 @@
       ASSERT(instr->RdField() == 0);
       ASSERT(instr->SaField() == 0);
       // Format(instr, "mult 'rs, 'rt");
-      int64_t rs = static_cast<int64_t>(get_register(instr->RsField()));
-      int64_t rt = static_cast<int64_t>(get_register(instr->RtField()));
+      int64_t rs = get_register(instr->RsField());
+      int64_t rt = get_register(instr->RtField());
       int64_t res = rs * rt;
       set_hi_register(Utils::High32Bits(res));
       set_lo_register(Utils::Low32Bits(res));
@@ -1376,8 +1388,8 @@
       ASSERT(instr->RdField() == 0);
       ASSERT(instr->SaField() == 0);
       // Format(instr, "multu 'rs, 'rt");
-      uint64_t rs = static_cast<uint64_t>(get_register(instr->RsField()));
-      uint64_t rt = static_cast<uint64_t>(get_register(instr->RtField()));
+      uint64_t rs = static_cast<uint32_t>(get_register(instr->RsField()));
+      uint64_t rt = static_cast<uint32_t>(get_register(instr->RtField()));
       uint64_t res = rs * rt;
       set_hi_register(Utils::High32Bits(res));
       set_lo_register(Utils::Low32Bits(res));
diff --git a/runtime/vm/snapshot.cc b/runtime/vm/snapshot.cc
index 366ad92..ad1ab1a 100644
--- a/runtime/vm/snapshot.cc
+++ b/runtime/vm/snapshot.cc
@@ -519,7 +519,7 @@
   ASSERT(isolate()->no_gc_scope_depth() != 0);                                 \
   Raw##type* obj = reinterpret_cast<Raw##type*>(                               \
       AllocateUninitialized(k##type##Cid, type::InstanceSize(length)));        \
-  obj->ptr()->length_ = Smi::New(length);                                      \
+  obj->StoreSmi(&(obj->ptr()->length_), Smi::New(length));                     \
   return obj;                                                                  \
 
 
@@ -630,7 +630,7 @@
   const intptr_t lengthInBytes = len * TypedData::ElementSizeInBytes(class_id);
   RawTypedData* obj = reinterpret_cast<RawTypedData*>(
       AllocateUninitialized(class_id, TypedData::InstanceSize(lengthInBytes)));
-  obj->ptr()->length_ = Smi::New(len);
+  obj->StoreSmi(&(obj->ptr()->length_), Smi::New(len));
   return obj;
 }
 
diff --git a/runtime/vm/stub_code_ia32.cc b/runtime/vm/stub_code_ia32.cc
index 763d2e5..92e9979 100644
--- a/runtime/vm/stub_code_ia32.cc
+++ b/runtime/vm/stub_code_ia32.cc
@@ -345,7 +345,7 @@
 // Input parameters:
 //   EDX: smi-tagged argument count, may be zero.
 //   EBP[kParamEndSlotFromFp + 1]: last argument.
-// Uses EAX, EBX, ECX, EDX.
+// Uses EAX, EBX, ECX, EDX, EDI.
 static void PushArgumentsArray(Assembler* assembler) {
   const Immediate& raw_null =
       Immediate(reinterpret_cast<intptr_t>(Object::null()));
@@ -367,8 +367,9 @@
   Label loop, loop_condition;
   __ jmp(&loop_condition, Assembler::kNearJump);
   __ Bind(&loop);
-  __ movl(EAX, Address(EBX, 0));
-  __ movl(Address(ECX, 0), EAX);
+  __ movl(EDI, Address(EBX, 0));
+  // No generational barrier needed, since array is in new space.
+  __ StoreIntoObjectNoBarrier(EAX, Address(ECX, 0), EDI);
   __ AddImmediate(ECX, Immediate(kWordSize));
   __ AddImmediate(EBX, Immediate(-kWordSize));
   __ Bind(&loop_condition);
@@ -652,7 +653,8 @@
   __ Bind(&init_loop);
   __ cmpl(EDI, EBX);
   __ j(ABOVE_EQUAL, &done, Assembler::kNearJump);
-  __ movl(Address(EDI, 0), raw_null);
+  // No generational barrier needed, since we are storing null.
+  __ StoreIntoObjectNoBarrier(EAX, Address(EDI, 0), Object::null_object());
   __ addl(EDI, Immediate(kWordSize));
   __ jmp(&init_loop, Assembler::kNearJump);
   __ Bind(&done);
@@ -855,12 +857,13 @@
     // EDX: number of context variables as integer value (not object).
     __ movl(FieldAddress(EAX, Context::num_variables_offset()), EDX);
 
-    const Immediate& raw_null =
-        Immediate(reinterpret_cast<intptr_t>(Object::null()));
     // Setup the parent field.
     // EAX: new object.
     // EDX: number of context variables.
-    __ movl(FieldAddress(EAX, Context::parent_offset()), raw_null);
+    // No generational barrier needed, since we are storing null.
+    __ StoreIntoObjectNoBarrier(EAX,
+                                FieldAddress(EAX, Context::parent_offset()),
+                                Object::null_object());
 
     // Initialize the context variables.
     // EAX: new object.
@@ -872,7 +875,10 @@
       __ jmp(&entry, Assembler::kNearJump);
       __ Bind(&loop);
       __ decl(EDX);
-      __ movl(Address(EBX, EDX, TIMES_4, 0), raw_null);
+      // No generational barrier needed, since we are storing null.
+      __ StoreIntoObjectNoBarrier(EAX,
+                                  Address(EBX, EDX, TIMES_4, 0),
+                                  Object::null_object());
       __ Bind(&entry);
       __ cmpl(EDX, Immediate(0));
       __ j(NOT_EQUAL, &loop, Assembler::kNearJump);
@@ -1025,7 +1031,7 @@
     __ movl(Address::Absolute(heap->TopAddress(space)), EBX);
     __ UpdateAllocationStats(cls.id(), ECX, space);
 
-    // EAX: new object start.
+    // EAX: new object start (untagged).
     // EBX: next object start.
     // EDX: new object type arguments (if is_cls_parameterized).
     // Set the tags.
@@ -1034,12 +1040,11 @@
     ASSERT(cls.id() != kIllegalCid);
     tags = RawObject::ClassIdTag::update(cls.id(), tags);
     __ movl(Address(EAX, Instance::tags_offset()), Immediate(tags));
+    __ addl(EAX, Immediate(kHeapObjectTag));
 
     // Initialize the remaining words of the object.
-    const Immediate& raw_null =
-        Immediate(reinterpret_cast<intptr_t>(Object::null()));
 
-    // EAX: new object start.
+    // EAX: new object (tagged).
     // EBX: next object start.
     // EDX: new object type arguments (if is_cls_parameterized).
     // First try inlining the initialization without a loop.
@@ -1049,12 +1054,14 @@
       for (intptr_t current_offset = Instance::NextFieldOffset();
            current_offset < instance_size;
            current_offset += kWordSize) {
-        __ movl(Address(EAX, current_offset), raw_null);
+        __ StoreIntoObjectNoBarrier(EAX,
+                                    FieldAddress(EAX, current_offset),
+                                    Object::null_object());
       }
     } else {
-      __ leal(ECX, Address(EAX, Instance::NextFieldOffset()));
+      __ leal(ECX, FieldAddress(EAX, Instance::NextFieldOffset()));
       // Loop until the whole object is initialized.
-      // EAX: new object.
+      // EAX: new object (tagged).
       // EBX: next object start.
       // ECX: next word to be initialized.
       // EDX: new object type arguments (if is_cls_parameterized).
@@ -1063,7 +1070,9 @@
       __ Bind(&init_loop);
       __ cmpl(ECX, EBX);
       __ j(ABOVE_EQUAL, &done, Assembler::kNearJump);
-      __ movl(Address(ECX, 0), raw_null);
+      __ StoreIntoObjectNoBarrier(EAX,
+                                  Address(ECX, 0),
+                                  Object::null_object());
       __ addl(ECX, Immediate(kWordSize));
       __ jmp(&init_loop, Assembler::kNearJump);
       __ Bind(&done);
@@ -1071,11 +1080,11 @@
     if (is_cls_parameterized) {
       // EDX: new object type arguments.
       // Set the type arguments in the new object.
-      __ movl(Address(EAX, cls.type_arguments_field_offset()), EDX);
+      intptr_t offset = cls.type_arguments_field_offset();
+      __ StoreIntoObjectNoBarrier(EAX, FieldAddress(EAX, offset), EDX);
     }
     // Done allocating and initializing the instance.
-    // EAX: new object.
-    __ addl(EAX, Immediate(kHeapObjectTag));
+    // EAX: new object (tagged).
     __ ret();
 
     __ Bind(&slow_case);
@@ -1236,7 +1245,7 @@
   __ addl(ECX, Immediate(Smi::RawValue(1)));
   __ movl(EDI, Immediate(Smi::RawValue(Smi::kMaxValue)));
   __ cmovno(EDI, ECX);
-  __ movl(Address(EBX, count_offset), EDI);
+  __ StoreIntoSmiField(Address(EBX, count_offset), EDI);
 
   __ ret();
 }
@@ -1384,7 +1393,7 @@
   __ addl(EAX, Immediate(Smi::RawValue(1)));
   __ movl(EDI, Immediate(Smi::RawValue(Smi::kMaxValue)));
   __ cmovno(EDI, EAX);
-  __ movl(Address(EBX, count_offset), EDI);
+  __ StoreIntoSmiField(Address(EBX, count_offset), EDI);
 
   __ movl(EAX, Address(EBX, target_offset));
   __ Bind(&call_target_function);
diff --git a/runtime/vm/unit_test.cc b/runtime/vm/unit_test.cc
index 1cb7ccf..6722151 100644
--- a/runtime/vm/unit_test.cc
+++ b/runtime/vm/unit_test.cc
@@ -48,6 +48,23 @@
   }
 }
 
+static const char* kPackageScheme = "package:";
+
+static bool IsPackageSchemeURL(const char* url_name) {
+  static const intptr_t kPackageSchemeLen = strlen(kPackageScheme);
+  return (strncmp(url_name, kPackageScheme, kPackageSchemeLen) == 0);
+}
+
+static Dart_Handle ResolvePackageUri(Dart_Handle builtin_lib,
+                                     const char* uri_chars) {
+  const int kNumArgs = 1;
+  Dart_Handle dart_args[kNumArgs];
+  dart_args[0] = DartUtils::NewString(uri_chars);
+  return Dart_Invoke(builtin_lib,
+                     DartUtils::NewString("_filePathFromUri"),
+                     kNumArgs,
+                     dart_args);
+}
 
 static Dart_Handle LibraryTagHandler(Dart_LibraryTag tag,
                                      Dart_Handle library,
@@ -108,6 +125,15 @@
                                                url_chars),
                            0, 0);
   }
+  if (IsPackageSchemeURL(url_chars)) {
+    Dart_Handle resolved_uri = ResolvePackageUri(builtin_lib, url_chars);
+    DART_CHECK_VALID(resolved_uri);
+    url_chars = NULL;
+    Dart_Handle result = Dart_StringToCString(resolved_uri, &url_chars);
+    if (Dart_IsError(result)) {
+      return Dart_NewApiError("accessing url characters failed");
+    }
+  }
   // Do sync loading since unit_test doesn't support async.
   Dart_Handle source = DartUtils::ReadStringFromFile(url_chars);
   EXPECT_VALID(source);
diff --git a/runtime/vm/verified_memory_test.cc b/runtime/vm/verified_memory_test.cc
index 681228d..6d97216 100644
--- a/runtime/vm/verified_memory_test.cc
+++ b/runtime/vm/verified_memory_test.cc
@@ -15,6 +15,25 @@
 }
 
 
+UNIT_TEST_CASE(VerifiedMemoryReserve) {
+  Init();
+  const intptr_t kReservationSize = 64 * KB;
+  VirtualMemory* vm = VerifiedMemory::Reserve(kReservationSize);
+  EXPECT_EQ(kReservationSize, vm->size());
+  delete vm;
+}
+
+
+UNIT_TEST_CASE(VerifiedMemoryCommit) {
+  Init();
+  const intptr_t kReservationSize = 64 * KB;
+  VirtualMemory* vm = VerifiedMemory::Reserve(kReservationSize);
+  EXPECT_EQ(kReservationSize, vm->size());
+  vm->Commit(false);
+  delete vm;
+}
+
+
 UNIT_TEST_CASE(VerifiedMemoryBasic) {
   Init();
   const intptr_t kReservationSize = 64 * KB;
@@ -33,6 +52,7 @@
   int64_t* unverified = reinterpret_cast<int64_t*>(&addr[3]);
   *unverified = 123;
   VerifiedMemory::Verify(reinterpret_cast<uword>(addr), 3 * sizeof(double));
+  delete vm;
 }
 
 
@@ -51,6 +71,7 @@
   memset(addr, 0xf3, 2 * sizeof(double));
   VerifiedMemory::Accept(reinterpret_cast<uword>(addr), 2 * sizeof(double));
   VerifiedMemory::Verify(reinterpret_cast<uword>(addr), 3 * sizeof(double));
+  delete vm;
 }
 
 
diff --git a/runtime/vm/virtual_memory_test.cc b/runtime/vm/virtual_memory_test.cc
index 218e9b9..7e5d9f2 100644
--- a/runtime/vm/virtual_memory_test.cc
+++ b/runtime/vm/virtual_memory_test.cc
@@ -76,4 +76,22 @@
   }
 }
 
+
+UNIT_TEST_CASE(VirtualMemoryCommitPartial) {
+  const intptr_t kVirtualMemoryBlockSize = 3 * MB;
+  VirtualMemory* vm = VirtualMemory::Reserve(kVirtualMemoryBlockSize);
+  EXPECT(vm != NULL);
+  // Commit only the middle MB and write to it.
+  const uword commit_start = vm->start() + (1 * MB);
+  const intptr_t kCommitSize = 1 * MB;
+  vm->Commit(commit_start, kCommitSize, false);
+  char* buf = reinterpret_cast<char*>(commit_start);
+  buf[0] = 'f';
+  buf[1] = 'o';
+  buf[2] = 'o';
+  buf[3] = 0;
+  EXPECT_STREQ("foo", buf);
+  delete vm;
+}
+
 }  // namespace dart
diff --git a/runtime/vm/virtual_memory_win.cc b/runtime/vm/virtual_memory_win.cc
index 119b472..1000417 100644
--- a/runtime/vm/virtual_memory_win.cc
+++ b/runtime/vm/virtual_memory_win.cc
@@ -54,7 +54,8 @@
   ASSERT(Contains(addr));
   ASSERT(Contains(addr + size) || (addr + size == end()));
   int prot = executable ? PAGE_EXECUTE_READWRITE : PAGE_READWRITE;
-  if (VirtualAlloc(address(), size, MEM_COMMIT, prot) == NULL) {
+  if (VirtualAlloc(reinterpret_cast<void*>(addr), size, MEM_COMMIT, prot) ==
+      NULL) {
     return false;
   }
   return true;
diff --git a/runtime/vm/vm.gypi b/runtime/vm/vm.gypi
index 84ce2357..c38c55b 100644
--- a/runtime/vm/vm.gypi
+++ b/runtime/vm/vm.gypi
@@ -9,8 +9,8 @@
     'builtin_in_cc_file': '../bin/builtin_in.cc',
     'async_cc_file': '<(gen_source_dir)/async_gen.cc',
     'async_patch_cc_file': '<(gen_source_dir)/async_patch_gen.cc',
-    'corelib_cc_file': '<(gen_source_dir)/corelib_gen.cc',
-    'corelib_patch_cc_file': '<(gen_source_dir)/corelib_patch_gen.cc',
+    'core_cc_file': '<(gen_source_dir)/core_gen.cc',
+    'core_patch_cc_file': '<(gen_source_dir)/core_patch_gen.cc',
     'collection_cc_file': '<(gen_source_dir)/collection_gen.cc',
     'collection_patch_cc_file': '<(gen_source_dir)/collection_patch_gen.cc',
     'convert_cc_file': '<(gen_source_dir)/convert_gen.cc',
@@ -107,8 +107,8 @@
       'dependencies': [
         'generate_async_cc_file#host',
         'generate_async_patch_cc_file#host',
-        'generate_corelib_cc_file#host',
-        'generate_corelib_patch_cc_file#host',
+        'generate_core_cc_file#host',
+        'generate_core_patch_cc_file#host',
         'generate_collection_cc_file#host',
         'generate_collection_patch_cc_file#host',
         'generate_convert_cc_file#host',
@@ -129,7 +129,7 @@
       'includes': [
         '../lib/async_sources.gypi',
         '../lib/collection_sources.gypi',
-        '../lib/corelib_sources.gypi',
+        '../lib/core_sources.gypi',
         '../lib/isolate_sources.gypi',
         '../lib/math_sources.gypi',
         '../lib/mirrors_sources.gypi',
@@ -142,8 +142,8 @@
         # Include generated source files.
         '<(async_cc_file)',
         '<(async_patch_cc_file)',
-        '<(corelib_cc_file)',
-        '<(corelib_patch_cc_file)',
+        '<(core_cc_file)',
+        '<(core_patch_cc_file)',
         '<(collection_cc_file)',
         '<(collection_patch_cc_file)',
         '<(convert_cc_file)',
@@ -172,7 +172,7 @@
       'includes': [
         '../lib/async_sources.gypi',
         '../lib/collection_sources.gypi',
-        '../lib/corelib_sources.gypi',
+        '../lib/core_sources.gypi',
         '../lib/isolate_sources.gypi',
         '../lib/math_sources.gypi',
         '../lib/mirrors_sources.gypi',
@@ -181,7 +181,7 @@
         '../lib/internal_sources.gypi',
       ],
       'sources': [
-        'bootstrap_nocorelib.cc',
+        'bootstrap_nocore.cc',
       ],
       'include_dirs': [
         '..',
@@ -427,12 +427,12 @@
       ]
     },
     {
-      'target_name': 'generate_corelib_cc_file',
+      'target_name': 'generate_core_cc_file',
       'type': 'none',
       'toolsets':['host'],
       'includes': [
         # Load the shared core library sources.
-        '../../sdk/lib/core/corelib_sources.gypi',
+        '../../sdk/lib/core/core_sources.gypi',
       ],
       'sources/': [
         # Exclude all .[cc|h] files.
@@ -443,36 +443,36 @@
       ],
       'actions': [
         {
-          'action_name': 'generate_corelib_cc',
+          'action_name': 'generate_core_cc',
           'inputs': [
             '../tools/gen_library_src_paths.py',
             '<(libgen_in_cc_file)',
             '<@(_sources)',
           ],
           'outputs': [
-            '<(corelib_cc_file)',
+            '<(core_cc_file)',
           ],
           'action': [
             'python',
             'tools/gen_library_src_paths.py',
-            '--output', '<(corelib_cc_file)',
+            '--output', '<(core_cc_file)',
             '--input_cc', '<(libgen_in_cc_file)',
             '--include', 'vm/bootstrap.h',
-            '--var_name', 'dart::Bootstrap::corelib_source_paths_',
+            '--var_name', 'dart::Bootstrap::core_source_paths_',
             '--library_name', 'dart:core',
             '<@(_sources)',
           ],
-          'message': 'Generating ''<(corelib_cc_file)'' file.'
+          'message': 'Generating ''<(core_cc_file)'' file.'
         },
       ]
     },
     {
-      'target_name': 'generate_corelib_patch_cc_file',
+      'target_name': 'generate_core_patch_cc_file',
       'type': 'none',
       'toolsets':['host'],
       'includes': [
         # Load the runtime implementation sources.
-        '../lib/corelib_sources.gypi',
+        '../lib/core_sources.gypi',
       ],
       'sources/': [
         # Exclude all .[cc|h] files.
@@ -483,26 +483,26 @@
       ],
       'actions': [
         {
-          'action_name': 'generate_corelib_patch_cc',
+          'action_name': 'generate_core_patch_cc',
           'inputs': [
             '../tools/gen_library_src_paths.py',
             '<(libgen_in_cc_file)',
             '<@(_sources)',
           ],
           'outputs': [
-            '<(corelib_patch_cc_file)',
+            '<(core_patch_cc_file)',
           ],
           'action': [
             'python',
             'tools/gen_library_src_paths.py',
-            '--output', '<(corelib_patch_cc_file)',
+            '--output', '<(core_patch_cc_file)',
             '--input_cc', '<(libgen_in_cc_file)',
             '--include', 'vm/bootstrap.h',
-            '--var_name', 'dart::Bootstrap::corelib_patch_paths_',
-            '--library_name', 'dart:corelib',
+            '--var_name', 'dart::Bootstrap::core_patch_paths_',
+            '--library_name', 'dart:core',
             '<@(_sources)',
           ],
-          'message': 'Generating ''<(corelib_patch_cc_file)'' file.'
+          'message': 'Generating ''<(core_patch_cc_file)'' file.'
         },
       ]
     },
@@ -538,7 +538,7 @@
             '--output', '<(internal_patch_cc_file)',
             '--input_cc', '<(libgen_in_cc_file)',
             '--include', 'vm/bootstrap.h',
-            '--var_name', 'dart::Bootstrap::internal_patch_paths_',
+            '--var_name', 'dart::Bootstrap::_internal_patch_paths_',
             '--library_name', 'dart:_internal',
             '<@(_sources)',
           ],
@@ -578,7 +578,7 @@
             '--output', '<(internal_cc_file)',
             '--input_cc', '<(libgen_in_cc_file)',
             '--include', 'vm/bootstrap.h',
-            '--var_name', 'dart::Bootstrap::internal_source_paths_',
+            '--var_name', 'dart::Bootstrap::_internal_source_paths_',
             '--library_name', 'dart:_internal',
             '<@(_sources)',
           ],
diff --git a/sdk/bin/dart2js b/sdk/bin/dart2js
index 79a857b..4fe517f 100755
--- a/sdk/bin/dart2js
+++ b/sdk/bin/dart2js
@@ -20,13 +20,8 @@
 
 SDK_DIR="$(cd "${BIN_DIR}/.." ; pwd -P)"
 
-DART2JS="$SDK_DIR/lib/_internal/compiler/implementation/dart2js.dart"
-
 DART="$BIN_DIR/dart"
 
-SNAPSHOT_DIR="$BIN_DIR/snapshots"
-SNAPSHOT="$SNAPSHOT_DIR/dart2js.dart.snapshot"
-
 unset EXTRA_OPTIONS
 declare -a EXTRA_OPTIONS
 
@@ -41,10 +36,6 @@
 unset EXTRA_VM_OPTIONS
 declare -a EXTRA_VM_OPTIONS
 
-if test -f "$SNAPSHOT"; then
-  EXTRA_OPTIONS+=("--library-root=$SDK_DIR")
-fi
-
 # Tell the VM to grow the heap more aggressively. This should only
 # be necessary temporarily until the VM is better at detecting how
 # applications use memory.
@@ -63,8 +54,21 @@
   EXTRA_VM_OPTIONS+=("${OPTIONS[@]}")
 fi
 
-if test -f "$SNAPSHOT"; then
-  exec "$DART" "${EXTRA_VM_OPTIONS[@]}" "$SNAPSHOT" "${EXTRA_OPTIONS[@]}" "$@"
-else
-  exec "$DART" "${EXTRA_VM_OPTIONS[@]}" "$DART2JS" "${EXTRA_OPTIONS[@]}" "$@"
+DART_ROOT="$(cd "${SDK_DIR}/.." ; pwd -P)"
+
+DART2JS="$DART_ROOT/pkg/compiler/lib/src/dart2js.dart"
+
+if [ -z "$DART_CONFIGURATION" ];
+then
+  DART_CONFIGURATION="ReleaseIA32"
 fi
+
+if [[ `uname` == 'Darwin' ]]; then
+  BUILD_DIR="$DART_ROOT/xcodebuild/$DART_CONFIGURATION"
+else
+  BUILD_DIR="$DART_ROOT/out/$DART_CONFIGURATION"
+fi
+
+PACKAGE_ROOT="$BUILD_DIR/packages/"
+
+exec "$DART" "${EXTRA_VM_OPTIONS[@]}" "--package-root=$PACKAGE_ROOT" "$DART2JS" "${EXTRA_OPTIONS[@]}" "$@"
diff --git a/sdk/bin/dart2js.bat b/sdk/bin/dart2js.bat
index ed460c8..daa477a 100644
--- a/sdk/bin/dart2js.bat
+++ b/sdk/bin/dart2js.bat
@@ -17,9 +17,7 @@
 rem Remove trailing backslash if there is one
 IF %SDK_DIR:~-1%==\ set SDK_DIR=%SDK_DIR:~0,-1%
 
-set DART2JS=%SDK_DIR%\lib\_internal\compiler\implementation\dart2js.dart
 set DART=%BIN_DIR%\dart
-set SNAPSHOT=%BIN_DIR%\snapshots\dart2js.dart.snapshot
 
 set EXTRA_OPTIONS=
 set EXTRA_VM_OPTIONS=
@@ -28,10 +26,6 @@
   set EXTRA_VM_OPTIONS=%EXTRA_VM_OPTIONS% --checked
 )
 
-if exist "%SNAPSHOT%" (
-  set EXTRA_OPTIONS=%EXTRA_OPTIONS% "--library-root=%SDK_DIR%"
-)
-
 rem See comments regarding options below in dart2js shell script.
 set EXTRA_VM_OPTIONS=%EXTRA_VM_OPTIONS% --heap_growth_rate=512
 
@@ -40,11 +34,22 @@
   set EXTRA_VM_OPTIONS=%EXTRA_VM_OPTIONS% %DART_VM_OPTIONS%
 )
 
-if exist "%SNAPSHOT%" (
-  "%DART%" %EXTRA_VM_OPTIONS% "%SNAPSHOT%" %EXTRA_OPTIONS% %*
-) else (
-  "%DART%" %EXTRA_VM_OPTIONS% "%DART2JS%" %EXTRA_OPTIONS% %*
-)
+rem Get absolute full name for DART_ROOT.
+for %%i in ("%SDK_DIR%\..\") do set DART_ROOT=%%~fi
+
+rem Remove trailing backslash if there is one
+if %DART_ROOT:~-1%==\ set DART_ROOT=%DART_ROOT:~0,-1%
+
+set DART2JS=%DART_ROOT%\pkg\compiler\lib\src\dart2js.dart
+
+rem DART_CONFIGURATION defaults to ReleaseIA32
+if "%DART_CONFIGURATION%"=="" set DART_CONFIGURATION=ReleaseIA32
+
+set BUILD_DIR=%DART_ROOT%\build\%DART_CONFIGURATION%
+
+set PACKAGE_ROOT=%BUILD_DIR%\packages
+
+"%DART%" %EXTRA_VM_OPTIONS% "--package-root=%PACKAGE_ROOT%" "%DART2JS%" %EXTRA_OPTIONS% %*
 
 endlocal
 
diff --git a/sdk/bin/dart2js_sdk b/sdk/bin/dart2js_sdk
new file mode 100755
index 0000000..5d7ec9c
--- /dev/null
+++ b/sdk/bin/dart2js_sdk
@@ -0,0 +1,64 @@
+#!/bin/bash
+# Copyright (c) 2012, 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.
+
+function follow_links() {
+  file="$1"
+  while [ -h "$file" ]; do
+    # On Mac OS, readlink -f doesn't work.
+    file="$(readlink "$file")"
+  done
+  echo "$file"
+}
+
+# Unlike $0, $BASH_SOURCE points to the absolute path of this file.
+PROG_NAME="$(follow_links "$BASH_SOURCE")"
+
+# Handle the case where dart-sdk/bin has been symlinked to.
+BIN_DIR="$(cd "${PROG_NAME%/*}" ; pwd -P)"
+
+SDK_DIR="$(cd "${BIN_DIR}/.." ; pwd -P)"
+
+DART="$BIN_DIR/dart"
+
+SNAPSHOT_DIR="$BIN_DIR/snapshots"
+SNAPSHOT="$SNAPSHOT_DIR/dart2js.dart.snapshot"
+
+unset EXTRA_OPTIONS
+declare -a EXTRA_OPTIONS
+
+if test -t 1; then
+  # Stdout is a terminal.
+  if test 8 -le `tput colors`; then
+    # Stdout has at least 8 colors, so enable colors.
+    EXTRA_OPTIONS+=('--enable-diagnostic-colors')
+  fi
+fi
+
+unset EXTRA_VM_OPTIONS
+declare -a EXTRA_VM_OPTIONS
+
+if test -f "$SNAPSHOT"; then
+  EXTRA_OPTIONS+=("--library-root=$SDK_DIR")
+fi
+
+# Tell the VM to grow the heap more aggressively. This should only
+# be necessary temporarily until the VM is better at detecting how
+# applications use memory.
+# TODO(ahe): Remove this option (http://dartbug.com/6495).
+EXTRA_VM_OPTIONS[${#EXTRA_VM_OPTIONS[@]}]='--heap_growth_rate=512'
+
+case $0 in
+  *_developer)
+    EXTRA_VM_OPTIONS+=('--checked')
+    ;;
+esac
+
+# We allow extra vm options to be passed in through an environment variable.
+if [[ $DART_VM_OPTIONS ]]; then
+  read -a OPTIONS <<< "$DART_VM_OPTIONS"
+  EXTRA_VM_OPTIONS+=("${OPTIONS[@]}")
+fi
+
+exec "$DART" "${EXTRA_VM_OPTIONS[@]}" "$SNAPSHOT" "${EXTRA_OPTIONS[@]}" "$@"
diff --git a/sdk/bin/dart2js_sdk.bat b/sdk/bin/dart2js_sdk.bat
new file mode 100755
index 0000000..f5ed1f0
--- /dev/null
+++ b/sdk/bin/dart2js_sdk.bat
@@ -0,0 +1,60 @@
+@echo off
+REM Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+REM for details. All rights reserved. Use of this source code is governed by a
+REM BSD-style license that can be found in the LICENSE file.
+
+setlocal
+rem Handle the case where dart-sdk/bin has been symlinked to.
+set DIR_NAME_WITH_SLASH=%~dp0
+set DIR_NAME=%DIR_NAME_WITH_SLASH:~0,-1%%
+call :follow_links "%DIR_NAME%", RETURNED_BIN_DIR
+rem Get rid of surrounding quotes.
+for %%i in ("%RETURNED_BIN_DIR%") do set BIN_DIR=%%~fi
+
+rem Get absolute full name for SDK_DIR.
+for %%i in ("%BIN_DIR%\..\") do set SDK_DIR=%%~fi
+
+rem Remove trailing backslash if there is one
+IF %SDK_DIR:~-1%==\ set SDK_DIR=%SDK_DIR:~0,-1%
+
+set DART=%BIN_DIR%\dart
+set SNAPSHOT=%BIN_DIR%\snapshots\dart2js.dart.snapshot
+
+set EXTRA_OPTIONS=
+set EXTRA_VM_OPTIONS=
+
+if _%DART2JS_DEVELOPER_MODE%_ == _1_ (
+  set EXTRA_VM_OPTIONS=%EXTRA_VM_OPTIONS% --checked
+)
+
+if exist "%SNAPSHOT%" (
+  set EXTRA_OPTIONS=%EXTRA_OPTIONS% "--library-root=%SDK_DIR%"
+)
+
+rem See comments regarding options below in dart2js shell script.
+set EXTRA_VM_OPTIONS=%EXTRA_VM_OPTIONS% --heap_growth_rate=512
+
+rem We allow extra vm options to be passed in through an environment variable.
+if not "_%DART_VM_OPTIONS%_" == "__" (
+  set EXTRA_VM_OPTIONS=%EXTRA_VM_OPTIONS% %DART_VM_OPTIONS%
+)
+
+"%DART%" %EXTRA_VM_OPTIONS% "%SNAPSHOT%" %EXTRA_OPTIONS% %*
+
+endlocal
+
+exit /b %errorlevel%
+
+:follow_links
+setlocal
+for %%i in (%1) do set result=%%~fi
+set current=
+for /f "usebackq tokens=2 delims=[]" %%i in (`dir /a:l "%~dp1" 2^>nul ^
+                                             ^| find ">     %~n1 ["`) do (
+  set current=%%i
+)
+if not "%current%"=="" call :follow_links "%current%", result
+endlocal & set %~2=%result%
+goto :eof
+
+:end
diff --git a/sdk/bin/dartdocgen b/sdk/bin/dartdocgen
new file mode 100755
index 0000000..bf807ad
--- /dev/null
+++ b/sdk/bin/dartdocgen
@@ -0,0 +1,36 @@
+#!/bin/bash
+# Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+function follow_links() {
+  file="$1"
+  while [ -h "$file" ]; do
+    # On Mac OS, readlink -f doesn't work.
+    file="$(readlink "$file")"
+  done
+  echo "$file"
+}
+
+# Unlike $0, $BASH_SOURCE points to the absolute path of this file.
+PROG_NAME="$(follow_links "$BASH_SOURCE")"
+
+# Handle the case where dart-sdk/bin has been symlinked to.
+BIN_DIR="$(cd "${PROG_NAME%/*}" ; pwd -P)"
+
+SDK_DIR="$(cd "${BIN_DIR}/.." ; pwd -P)"
+
+unset SNAPSHOT
+
+SNAPSHOT="$BIN_DIR/snapshots/utils_wrapper.dart.snapshot"
+
+if test -f "$SNAPSHOT"; then
+  exec "$BIN_DIR"/dart \
+      "--package-root=$BIN_DIR/../packages/" "--old_gen_heap_size=1024" \
+      "$SNAPSHOT" \
+       docgen "--sdk=$SDK_DIR" "$@"
+else
+  exec "$BIN_DIR"/dart \
+      "--package-root=$BIN_DIR/../packages/" "--old_gen_heap_size=1024" \
+      "$BIN_DIR/../../pkg/docgen/bin/docgen.dart" "--sdk=$SDK_DIR" "$@"
+fi
diff --git a/sdk/bin/dartdocgen.bat b/sdk/bin/dartdocgen.bat
new file mode 100644
index 0000000..136b7f9
--- /dev/null
+++ b/sdk/bin/dartdocgen.bat
@@ -0,0 +1,49 @@
+@echo off
+REM Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+REM for details. All rights reserved. Use of this source code is governed by a
+REM BSD-style license that can be found in the LICENSE file.
+
+setlocal
+rem Handle the case where dart-sdk/bin has been symlinked to.
+set DIR_NAME_WITH_SLASH=%~dp0
+set DIR_NAME=%DIR_NAME_WITH_SLASH:~0,-1%%
+call :follow_links "%DIR_NAME%", RETURNED_BIN_DIR
+rem Get rid of surrounding quotes.
+for %%i in ("%RETURNED_BIN_DIR%") do set BIN_DIR=%%~fi
+
+rem Get absolute full name for SDK_DIR.
+for %%i in ("%BIN_DIR%\..\") do set SDK_DIR=%%~fi
+
+rem Remove trailing backslash if there is one
+IF %SDK_DIR:~-1%==\ set SDK_DIR=%SDK_DIR:~0,-1%
+
+set DOCGEN=%SDK_DIR%\pkg\docgen\bin\docgen.dart
+set DART=%BIN_DIR%\dart
+set SNAPSHOT=%BIN_DIR%\snapshots\utils_wrapper.dart.snapshot
+
+if not defined DART_CONFIGURATION set DART_CONFIGURATION=ReleaseIA32
+
+set BUILD_DIR=%SDK_DIR%\..\build\%DART_CONFIGURATION%
+if exist "%SNAPSHOT%" (
+  "%DART%" "%SNAPSHOT%" "docgen" "--sdk=%SDK_DIR%" %*
+) else (
+  "%BUILD_DIR%\dart-sdk\bin\dart" "--package-root=%BUILD_DIR%\packages" "%DOCGEN%" "--sdk=%SDK_DIR%" %*
+)
+
+endlocal
+
+exit /b %errorlevel%
+
+:follow_links
+setlocal
+for %%i in (%1) do set result=%%~fi
+set current=
+for /f "tokens=2 delims=[]" %%i in ('dir /a:l ^"%~dp1^" 2^>nul ^
+                                     ^| find ">     %~n1 ["') do (
+  set current=%%i
+)
+if not "%current%"=="" call :follow_links "%current%", result
+endlocal & set %~2=%result%
+goto :eof
+
+:end
diff --git a/sdk/bin/docgen b/sdk/bin/docgen
index bf807ad..c6c5455 100755
--- a/sdk/bin/docgen
+++ b/sdk/bin/docgen
@@ -3,34 +3,5 @@
 # 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.
 
-function follow_links() {
-  file="$1"
-  while [ -h "$file" ]; do
-    # On Mac OS, readlink -f doesn't work.
-    file="$(readlink "$file")"
-  done
-  echo "$file"
-}
-
-# Unlike $0, $BASH_SOURCE points to the absolute path of this file.
-PROG_NAME="$(follow_links "$BASH_SOURCE")"
-
-# Handle the case where dart-sdk/bin has been symlinked to.
-BIN_DIR="$(cd "${PROG_NAME%/*}" ; pwd -P)"
-
-SDK_DIR="$(cd "${BIN_DIR}/.." ; pwd -P)"
-
-unset SNAPSHOT
-
-SNAPSHOT="$BIN_DIR/snapshots/utils_wrapper.dart.snapshot"
-
-if test -f "$SNAPSHOT"; then
-  exec "$BIN_DIR"/dart \
-      "--package-root=$BIN_DIR/../packages/" "--old_gen_heap_size=1024" \
-      "$SNAPSHOT" \
-       docgen "--sdk=$SDK_DIR" "$@"
-else
-  exec "$BIN_DIR"/dart \
-      "--package-root=$BIN_DIR/../packages/" "--old_gen_heap_size=1024" \
-      "$BIN_DIR/../../pkg/docgen/bin/docgen.dart" "--sdk=$SDK_DIR" "$@"
-fi
+echo "The 'docgen' name is deprecated. Prefer 'dartdocgen' instead."
+dartdocgen "$@"
diff --git a/sdk/bin/docgen.bat b/sdk/bin/docgen.bat
index 136b7f9..63a214f 100644
--- a/sdk/bin/docgen.bat
+++ b/sdk/bin/docgen.bat
@@ -3,47 +3,5 @@
 REM for details. All rights reserved. Use of this source code is governed by a
 REM BSD-style license that can be found in the LICENSE file.
 
-setlocal
-rem Handle the case where dart-sdk/bin has been symlinked to.
-set DIR_NAME_WITH_SLASH=%~dp0
-set DIR_NAME=%DIR_NAME_WITH_SLASH:~0,-1%%
-call :follow_links "%DIR_NAME%", RETURNED_BIN_DIR
-rem Get rid of surrounding quotes.
-for %%i in ("%RETURNED_BIN_DIR%") do set BIN_DIR=%%~fi
-
-rem Get absolute full name for SDK_DIR.
-for %%i in ("%BIN_DIR%\..\") do set SDK_DIR=%%~fi
-
-rem Remove trailing backslash if there is one
-IF %SDK_DIR:~-1%==\ set SDK_DIR=%SDK_DIR:~0,-1%
-
-set DOCGEN=%SDK_DIR%\pkg\docgen\bin\docgen.dart
-set DART=%BIN_DIR%\dart
-set SNAPSHOT=%BIN_DIR%\snapshots\utils_wrapper.dart.snapshot
-
-if not defined DART_CONFIGURATION set DART_CONFIGURATION=ReleaseIA32
-
-set BUILD_DIR=%SDK_DIR%\..\build\%DART_CONFIGURATION%
-if exist "%SNAPSHOT%" (
-  "%DART%" "%SNAPSHOT%" "docgen" "--sdk=%SDK_DIR%" %*
-) else (
-  "%BUILD_DIR%\dart-sdk\bin\dart" "--package-root=%BUILD_DIR%\packages" "%DOCGEN%" "--sdk=%SDK_DIR%" %*
-)
-
-endlocal
-
-exit /b %errorlevel%
-
-:follow_links
-setlocal
-for %%i in (%1) do set result=%%~fi
-set current=
-for /f "tokens=2 delims=[]" %%i in ('dir /a:l ^"%~dp1^" 2^>nul ^
-                                     ^| find ">     %~n1 ["') do (
-  set current=%%i
-)
-if not "%current%"=="" call :follow_links "%current%", result
-endlocal & set %~2=%result%
-goto :eof
-
-:end
+echo "The 'docgen.bat' name is deprecated. Prefer 'dartdocgen.bat' instead."
+dartdocgen %*
diff --git a/sdk/lib/_internal/compiler/js_lib/js_array.dart b/sdk/lib/_internal/compiler/js_lib/js_array.dart
index 23fbeca..c816907 100644
--- a/sdk/lib/_internal/compiler/js_lib/js_array.dart
+++ b/sdk/lib/_internal/compiler/js_lib/js_array.dart
@@ -168,11 +168,10 @@
   }
 
   void forEach(void f(E element)) {
-    int getLength() => JS('int', '#.length', this);
-    int length = getLength();
+    int length = this.length;
     for (int i = 0; i < length; i++) {
       f(JS('', '#[#]', this, i));
-      if (length != getLength()) {
+      if (length != this.length) {
         throw new ConcurrentModificationError(this);
       }
     }
diff --git a/sdk/lib/_internal/compiler/js_lib/native_typed_data.dart b/sdk/lib/_internal/compiler/js_lib/native_typed_data.dart
index f1ebae5..84b25bc 100644
--- a/sdk/lib/_internal/compiler/js_lib/native_typed_data.dart
+++ b/sdk/lib/_internal/compiler/js_lib/native_typed_data.dart
@@ -149,7 +149,10 @@
 
   void _invalidIndex(int index, int length) {
     if (index < 0 || index >= length) {
-      throw new RangeError.range(index, 0, length);
+      if (length == this.length) {
+        throw new RangeError.index(index, this);
+      }
+      throw new RangeError.range(index, 0, length - 1);
     } else {
       throw new ArgumentError('Invalid list index $index');
     }
@@ -255,7 +258,10 @@
 
   void _invalidIndex(int index, int length) {
     if (index < 0 || index >= length) {
-      throw new RangeError.range(index, 0, length);
+      if (length == this.length) {
+        throw new RangeError.index(index, this);
+      }
+      throw new RangeError.range(index, 0, length - 1);
     } else {
       throw new ArgumentError('Invalid list index $index');
     }
@@ -361,7 +367,10 @@
 
   void _invalidIndex(int index, int length) {
     if (index < 0 || index >= length) {
-      throw new RangeError.range(index, 0, length);
+      if (length == this.length) {
+        throw new RangeError.index(index, this);
+      }
+      throw new RangeError.range(index, 0, length - 1);
     } else {
       throw new ArgumentError('Invalid list index $index');
     }
@@ -438,7 +447,13 @@
 
   void _invalidIndex(int index, int length) {
     if (index < 0 || index >= length) {
-      throw new RangeError.range(index, 0, length);
+      if (this is List) {
+        var list = this;  // Typed as dynamic to avoid warning.
+        if (length == list.length) {
+          throw new RangeError.index(index, this);
+        }
+      }
+      throw new RangeError.range(index, 0, length - 1);
     } else {
       throw new ArgumentError('Invalid list index $index');
     }
diff --git a/sdk/lib/_internal/compiler/js_lib/shared/embedded_names.dart b/sdk/lib/_internal/compiler/js_lib/shared/embedded_names.dart
index e327860..353442a 100644
--- a/sdk/lib/_internal/compiler/js_lib/shared/embedded_names.dart
+++ b/sdk/lib/_internal/compiler/js_lib/shared/embedded_names.dart
@@ -19,6 +19,7 @@
 const MANGLED_GLOBAL_NAMES = 'mangledGlobalNames';
 const MANGLED_NAMES = 'mangledNames';
 const LIBRARIES = 'libraries';
+const FINISHED_CLASSES = 'finishedClasses';
 const ALL_CLASSES = 'allClasses';
 const METADATA = 'metadata';
 const INTERCEPTORS_BY_TAG = 'interceptorsByTag';
diff --git a/sdk/lib/_internal/pub/lib/src/barback/dart2js_transformer.dart b/sdk/lib/_internal/pub/lib/src/barback/dart2js_transformer.dart
index 1f392a8..41427e6 100644
--- a/sdk/lib/_internal/pub/lib/src/barback/dart2js_transformer.dart
+++ b/sdk/lib/_internal/pub/lib/src/barback/dart2js_transformer.dart
@@ -12,10 +12,10 @@
 import 'package:path/path.dart' as path;
 import 'package:pool/pool.dart';
 
-import '../../../../compiler/compiler.dart' as compiler;
-import '../../../../compiler/implementation/dart2js.dart'
+import '../../../../../../../pkg/compiler/lib/compiler.dart' as compiler;
+import '../../../../../../../pkg/compiler/lib/src/dart2js.dart'
     show AbortLeg;
-import '../../../../compiler/implementation/source_file.dart';
+import '../../../../../../../pkg/compiler/lib/src/source_file.dart';
 import '../barback.dart';
 import '../dart.dart' as dart;
 import '../utils.dart';
@@ -24,7 +24,7 @@
 /// The set of all valid configuration options for this transformer.
 final _validOptions = new Set<String>.from([
   'commandLineOptions', 'checked', 'csp', 'minify', 'verbose', 'environment',
-  'analyzeAll', 'preserveUris', 'suppressWarnings', 'suppressHints',
+  'preserveUris', 'suppressWarnings', 'suppressHints',
   'suppressPackageWarnings', 'terse'
 ]);
 
@@ -89,7 +89,6 @@
   void declareOutputs(DeclaringTransform transform) {
     var primaryId = transform.primaryId;
     transform.declareOutput(primaryId.addExtension(".js"));
-    transform.declareOutput(primaryId.addExtension(".precompiled.js"));
     if (_generateSourceMaps) {
       transform.declareOutput(primaryId.addExtension(".js.map"));
     }
@@ -284,6 +283,10 @@
       return new NullSink<String>();
     }
 
+    // TODO(nweiz): remove this special case when dart2js stops generating these
+    // files.
+    if (extension.endsWith(".precompiled.js")) return new NullSink<String>();
+
     var primaryId = _transform.primaryInput.id;
 
     // Dart2js uses an empty string for the name of the entrypoint library.
diff --git a/sdk/lib/_internal/pub/lib/src/barback/dependency_computer.dart b/sdk/lib/_internal/pub/lib/src/barback/dependency_computer.dart
index bac5ab5..0105cbf 100644
--- a/sdk/lib/_internal/pub/lib/src/barback/dependency_computer.dart
+++ b/sdk/lib/_internal/pub/lib/src/barback/dependency_computer.dart
@@ -96,7 +96,8 @@
   Set<TransformerId> transformersNeededByLibrary(AssetId id) {
     var library = _graph.packages[id.package].path(p.fromUri(id.path));
     _loadPackageComputer(id.package);
-    return _packageComputers[id.package].transformersNeededByLibrary(library);
+    return _packageComputers[id.package].transformersNeededByLibrary(library)
+        .where((id) => !id.isBuiltInTransformer).toSet();
   }
 
   /// Returns the set of all transformers that need to be loaded before [id] is
diff --git a/sdk/lib/_internal/pub/lib/src/dart.dart b/sdk/lib/_internal/pub/lib/src/dart.dart
index a020d9b..46d71dd 100644
--- a/sdk/lib/_internal/pub/lib/src/dart.dart
+++ b/sdk/lib/_internal/pub/lib/src/dart.dart
@@ -12,8 +12,8 @@
 import 'package:analyzer/analyzer.dart';
 import 'package:path/path.dart' as path;
 
-import '../../../compiler/compiler.dart' as compiler;
-import '../../../compiler/implementation/filenames.dart'
+import '../../../../../../pkg/compiler/lib/compiler.dart' as compiler;
+import '../../../../../../pkg/compiler/lib/src/filenames.dart'
     show appendSlash;
 
 import '../../asset/dart/serialize.dart';
diff --git a/sdk/lib/_internal/pub/lib/src/validator.dart b/sdk/lib/_internal/pub/lib/src/validator.dart
index 17e4645..7bdcdc9 100644
--- a/sdk/lib/_internal/pub/lib/src/validator.dart
+++ b/sdk/lib/_internal/pub/lib/src/validator.dart
@@ -17,6 +17,7 @@
 import 'validator/license.dart';
 import 'validator/name.dart';
 import 'validator/pubspec_field.dart';
+import 'validator/sdk_constraint.dart';
 import 'validator/size.dart';
 import 'validator/utf8_readme.dart';
 
@@ -65,7 +66,8 @@
       new DirectoryValidator(entrypoint),
       new ExecutableValidator(entrypoint),
       new CompiledDartdocValidator(entrypoint),
-      new Utf8ReadmeValidator(entrypoint)
+      new Utf8ReadmeValidator(entrypoint),
+      new SdkConstraintValidator(entrypoint)
     ];
     if (packageSize != null) {
       validators.add(new SizeValidator(entrypoint, packageSize));
diff --git a/sdk/lib/_internal/pub/lib/src/validator/dependency.dart b/sdk/lib/_internal/pub/lib/src/validator/dependency.dart
index 19f571d..7e6a933 100644
--- a/sdk/lib/_internal/pub/lib/src/validator/dependency.dart
+++ b/sdk/lib/_internal/pub/lib/src/validator/dependency.dart
@@ -11,20 +11,39 @@
 import '../entrypoint.dart';
 import '../log.dart' as log;
 import '../package.dart';
+import '../utils.dart';
 import '../validator.dart';
 
+/// The range of all pub versions that don't support `^` version constraints.
+final _preCaretPubVersions = new VersionConstraint.parse("<1.8.0-dev.3.0");
+
+// TODO(nweiz): replace this with "^1.8.0" for the 1.8 release.
+/// The range of all pub versions that do support `^` version constraints.
+///
+/// This is intersected with the user's SDK constraint to provide a suggested
+/// constraint.
+final _postCaretPubVersions = new VersionConstraint.parse("^1.8.0-dev.3.0");
+
 /// A validator that validates a package's dependencies.
 class DependencyValidator extends Validator {
+  /// Whether the SDK constraint guarantees that `^` version constraints are
+  /// safe.
+  bool get _caretAllowed => entrypoint.root.pubspec.environment.sdkVersion
+      .intersect(_preCaretPubVersions).isEmpty;
+
   DependencyValidator(Entrypoint entrypoint)
     : super(entrypoint);
 
-  Future validate() {
-    return Future.forEach(entrypoint.root.pubspec.dependencies, (dependency) {
-      if (dependency.source != "hosted") {
-        return _warnAboutSource(dependency);
-      }
+  Future validate() async {
+    var caretDeps = [];
 
-      if (dependency.constraint.isAny) {
+    // TODO(nweiz): Replace this with a real for/in loop when we update
+    // async_await.
+    await Future.forEach(entrypoint.root.pubspec.dependencies,
+        (dependency) async {
+      if (dependency.source != "hosted") {
+        await _warnAboutSource(dependency);
+      } else if (dependency.constraint.isAny) {
         _warnAboutNoConstraint(dependency);
       } else if (dependency.constraint is Version) {
         _warnAboutSingleVersionConstraint(dependency);
@@ -34,10 +53,16 @@
         } else if (dependency.constraint.max == null) {
           _warnAboutNoConstraintUpperBound(dependency);
         }
-      }
 
-      return new Future.value();
+        if (dependency.constraint.toString().startsWith("^")) {
+          caretDeps.add(dependency);
+        }
+      }
     });
+
+    if (caretDeps.isNotEmpty && !_caretAllowed) {
+      _errorAboutCaretConstraints(caretDeps);
+    }
   }
 
   /// Warn that dependencies should use the hosted source.
@@ -128,27 +153,63 @@
 
   /// Warn that dependencies should have upper bounds on their constraints.
   void _warnAboutNoConstraintUpperBound(PackageDep dep) {
+    var constraint;
+    if ((dep.constraint as VersionRange).includeMin) {
+      constraint = _constraintForVersion((dep.constraint as VersionRange).min);
+    } else {
+      constraint = '"${dep.constraint} '
+          '<${(dep.constraint as VersionRange).min.nextBreaking}"';
+    }
+
     warnings.add(
         'Your dependency on "${dep.name}" should have an upper bound. For '
             'example:\n'
         '\n'
         'dependencies:\n'
-        '  ${dep.name}: "${dep.constraint} '
-            '${_upperBoundForVersion((dep.constraint as VersionRange).min)}"\n'
+        '  ${dep.name}: $constraint\n'
         '\n'
         'Without an upper bound, you\'re promising to support '
             '${log.bold("all")} future versions of ${dep.name}.');
   }
 
+  /// Emits an error for any version constraints that use `^` without an
+  /// appropriate SDK constraint.
+  void _errorAboutCaretConstraints(List<PackageDep> caretDeps) {
+    var newSdkConstraint = entrypoint.root.pubspec.environment.sdkVersion
+        .intersect(_postCaretPubVersions);
+
+    if (newSdkConstraint.isEmpty) newSdkConstraint = _postCaretPubVersions;
+
+    var buffer = new StringBuffer(
+        "Older versions of pub don't support ^ version constraints.\n"
+        "Make sure your SDK constraint excludes those old versions:\n"
+        "\n"
+        "environment:\n"
+        "  sdk: \"$newSdkConstraint\"\n"
+        "\n");
+
+    if (caretDeps.length == 1) {
+      buffer.writeln("Or use a fully-expanded constraint:");
+    } else {
+      buffer.writeln("Or use fully-expanded constraints:");
+    }
+
+    buffer.writeln();
+    buffer.writeln("dependencies:");
+
+    caretDeps.forEach((dep) {
+      VersionRange constraint = dep.constraint;
+      buffer.writeln(
+          "  ${dep.name}: \">=${constraint.min} <${constraint.max}\"");
+    });
+
+    errors.add(buffer.toString().trim());
+  }
+
   /// Returns the suggested version constraint for a dependency that was tested
   /// against [version].
-  String _constraintForVersion(Version version) =>
-      '">=$version ${_upperBoundForVersion(version)}"';
-
-  /// Returns the suggested upper bound for a dependency that was tested against
-  /// [version].
-  String _upperBoundForVersion(Version version) {
-    if (version.major != 0) return '<${version.major + 1}.0.0';
-    return '<${version.major}.${version.minor + 1}.0';
+  String _constraintForVersion(Version version) {
+    if (_caretAllowed) return "^$version";
+    return '">=$version <${version.nextBreaking}"';
   }
 }
diff --git a/sdk/lib/_internal/pub/lib/src/validator/sdk_constraint.dart b/sdk/lib/_internal/pub/lib/src/validator/sdk_constraint.dart
new file mode 100644
index 0000000..e409f52
--- /dev/null
+++ b/sdk/lib/_internal/pub/lib/src/validator/sdk_constraint.dart
@@ -0,0 +1,34 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library pub.validator.sdk_constraint;
+
+import 'dart:async';
+
+import 'package:pub_semver/pub_semver.dart';
+
+import '../entrypoint.dart';
+import '../log.dart' as log;
+import '../package.dart';
+import '../validator.dart';
+
+/// A validator that validates that a package's SDK constraint doesn't use the
+/// "^" syntax.
+class SdkConstraintValidator extends Validator {
+  SdkConstraintValidator(Entrypoint entrypoint)
+    : super(entrypoint);
+
+  Future validate() async {
+    var constraint = entrypoint.root.pubspec.environment.sdkVersion;
+    if (!constraint.toString().startsWith("^")) return;
+
+    errors.add(
+        "^ version constraints aren't allowed for SDK constraints since "
+          "older versions of pub don't support them.\n"
+        "Expand it manually instead:\n"
+        "\n"
+        "environment:\n"
+        "  sdk: \">=${constraint.min} <${constraint.max}\"");
+  }
+}
diff --git a/sdk/lib/_internal/pub/test/build/copies_browser_js_next_to_entrypoints_test.dart b/sdk/lib/_internal/pub/test/build/copies_browser_js_next_to_entrypoints_test.dart
index fd2a853..5178021 100644
--- a/sdk/lib/_internal/pub/test/build/copies_browser_js_next_to_entrypoints_test.dart
+++ b/sdk/lib/_internal/pub/test/build/copies_browser_js_next_to_entrypoints_test.dart
@@ -43,7 +43,6 @@
       d.dir('build', [
         d.dir('foo', [
           d.matcherFile('file.dart.js', isNot(isEmpty)),
-          d.matcherFile('file.dart.precompiled.js', isNot(isEmpty)),
           d.dir('packages', [d.dir('browser', [
             d.file('dart.js', 'contents of dart.js'),
             d.file('interop.js', 'contents of interop.js')
@@ -54,12 +53,10 @@
               d.file('interop.js', 'contents of interop.js')
             ])]),
             d.matcherFile('subfile.dart.js', isNot(isEmpty)),
-            d.matcherFile('subfile.dart.precompiled.js', isNot(isEmpty)),
           ])
         ]),
         d.dir('web', [
           d.matcherFile('file.dart.js', isNot(isEmpty)),
-          d.matcherFile('file.dart.precompiled.js', isNot(isEmpty)),
           d.dir('packages', [d.dir('browser', [
             d.file('dart.js', 'contents of dart.js'),
             d.file('interop.js', 'contents of interop.js')
@@ -69,8 +66,7 @@
               d.file('dart.js', 'contents of dart.js'),
               d.file('interop.js', 'contents of interop.js')
             ])]),
-            d.matcherFile('subfile.dart.js', isNot(isEmpty)),
-            d.matcherFile('subfile.dart.precompiled.js', isNot(isEmpty))
+            d.matcherFile('subfile.dart.js', isNot(isEmpty))
           ])
         ])
       ])
diff --git a/sdk/lib/_internal/pub/test/dart2js/compiles_entrypoints_in_root_package_test.dart b/sdk/lib/_internal/pub/test/dart2js/compiles_entrypoints_in_root_package_test.dart
index 0d93ce9..c2ab7b4 100644
--- a/sdk/lib/_internal/pub/test/dart2js/compiles_entrypoints_in_root_package_test.dart
+++ b/sdk/lib/_internal/pub/test/dart2js/compiles_entrypoints_in_root_package_test.dart
@@ -46,34 +46,28 @@
       d.dir('build', [
         d.dir('benchmark', [
           d.matcherFile('file.dart.js', isNot(isEmpty)),
-          d.matcherFile('file.dart.precompiled.js', isNot(isEmpty)),
           d.nothing('file.dart'),
           d.nothing('lib.dart'),
           d.dir('subdir', [
             d.matcherFile('subfile.dart.js', isNot(isEmpty)),
-            d.matcherFile('subfile.dart.precompiled.js', isNot(isEmpty)),
             d.nothing('subfile.dart')
           ])
         ]),
         d.dir('foo', [
           d.matcherFile('file.dart.js', isNot(isEmpty)),
-          d.matcherFile('file.dart.precompiled.js', isNot(isEmpty)),
           d.nothing('file.dart'),
           d.nothing('lib.dart'),
           d.dir('subdir', [
             d.matcherFile('subfile.dart.js', isNot(isEmpty)),
-            d.matcherFile('subfile.dart.precompiled.js', isNot(isEmpty)),
             d.nothing('subfile.dart')
           ])
         ]),
         d.dir('web', [
           d.matcherFile('file.dart.js', isNot(isEmpty)),
-          d.matcherFile('file.dart.precompiled.js', isNot(isEmpty)),
           d.nothing('file.dart'),
           d.nothing('lib.dart'),
           d.dir('subdir', [
             d.matcherFile('subfile.dart.js', isNot(isEmpty)),
-            d.matcherFile('subfile.dart.precompiled.js', isNot(isEmpty)),
             d.nothing('subfile.dart')
           ])
         ])
diff --git a/sdk/lib/_internal/pub/test/dart2js/minify_configuration_overrides_mode_test.dart b/sdk/lib/_internal/pub/test/dart2js/minify_configuration_overrides_mode_test.dart
index 739bd9d..da0e6bc 100644
--- a/sdk/lib/_internal/pub/test/dart2js/minify_configuration_overrides_mode_test.dart
+++ b/sdk/lib/_internal/pub/test/dart2js/minify_configuration_overrides_mode_test.dart
@@ -15,7 +15,10 @@
         "transformers": [{
           "\$dart2js": {"minify": true}
         }]
-      })
+      }),
+      d.dir("web", [
+        d.file("main.dart", "void main() => print('Hello!');")
+      ])
     ]).create();
 
     pubServe();
diff --git a/sdk/lib/_internal/pub/test/dart2js/outputs_deferred_libraries_test.dart b/sdk/lib/_internal/pub/test/dart2js/outputs_deferred_libraries_test.dart
index a7c7568..6680f12 100644
--- a/sdk/lib/_internal/pub/test/dart2js/outputs_deferred_libraries_test.dart
+++ b/sdk/lib/_internal/pub/test/dart2js/outputs_deferred_libraries_test.dart
@@ -56,7 +56,6 @@
       d.dir('build', [
         d.dir('web', [
           d.matcherFile('main.dart.js', isNot(isEmpty)),
-          d.matcherFile('main.dart.precompiled.js', isNot(isEmpty)),
           d.matcherFile('main.dart.js_1.part.js', isNot(isEmpty)),
           d.matcherFile('main.dart.js_2.part.js', isNot(isEmpty)),
         ])
diff --git a/sdk/lib/_internal/pub/test/dart2js/supports_configuration_with_build_test.dart b/sdk/lib/_internal/pub/test/dart2js/supports_configuration_with_build_test.dart
index c76a40e..e4d56c8 100644
--- a/sdk/lib/_internal/pub/test/dart2js/supports_configuration_with_build_test.dart
+++ b/sdk/lib/_internal/pub/test/dart2js/supports_configuration_with_build_test.dart
@@ -75,7 +75,6 @@
       d.dir('build', [
         d.dir('web', [
           d.matcherFile('file.dart.js', isMinifiedDart2JSOutput),
-          d.matcherFile('file.dart.precompiled.js', isNot(isEmpty)),
           d.dir('packages', [
             d.dir('browser', [
               d.file('dart.js', 'contents of dart.js'),
diff --git a/sdk/lib/_internal/pub/test/dart2js/supports_valid_options_test.dart b/sdk/lib/_internal/pub/test/dart2js/supports_valid_options_test.dart
index 4bf175a..81212b0 100644
--- a/sdk/lib/_internal/pub/test/dart2js/supports_valid_options_test.dart
+++ b/sdk/lib/_internal/pub/test/dart2js/supports_valid_options_test.dart
@@ -22,14 +22,16 @@
             "minify": true,
             "verbose": true,
             "environment": {"name": "value"},
-            "analyzeAll": true,
             "suppressWarnings": true,
             "suppressHints": true,
             "suppressPackageWarnings": false,
             "terse": true
           }
         }]
-      })
+      }),
+      d.dir("web", [
+        d.file("main.dart", "void main() => print('Hello!');")
+      ])
     ]).create();
 
     // None of these options should be rejected, either by pub or by dart2js.
diff --git a/sdk/lib/_internal/pub/test/run/ignores_explicit_dart2js_transformer_test.dart b/sdk/lib/_internal/pub/test/run/ignores_explicit_dart2js_transformer_test.dart
new file mode 100644
index 0000000..ffeb779
--- /dev/null
+++ b/sdk/lib/_internal/pub/test/run/ignores_explicit_dart2js_transformer_test.dart
@@ -0,0 +1,25 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import '../descriptor.dart' as d;
+import '../test_pub.dart';
+
+main() {
+  initConfig();
+  integration("doesn't choke on an explicit dart2js transformer", () {
+    d.dir(appPath, [
+      d.pubspec({
+        "name": "myapp",
+        "transformers": [r"$dart2js"]
+      }),
+      d.dir("bin", [
+        d.file("script.dart", "main() => print('Hello!');")
+      ])
+    ]).create();
+
+    var pub = pubRun(args: ["script"]);
+    pub.stdout.expect("Hello!");
+    pub.shouldExit(0);
+  });
+}
diff --git a/sdk/lib/_internal/pub/test/serve/utils.dart b/sdk/lib/_internal/pub/test/serve/utils.dart
index 9516cd2..f84eb9a 100644
--- a/sdk/lib/_internal/pub/test/serve/utils.dart
+++ b/sdk/lib/_internal/pub/test/serve/utils.dart
@@ -260,6 +260,7 @@
 /// [headers] may be either a [Matcher] or a map to match an exact headers map.
 void requestShouldSucceed(String urlPath, expectation, {String root, headers}) {
   scheduleRequest(urlPath, root: root).then((response) {
+    expect(response.statusCode, equals(200));
     if (expectation != null) expect(response.body, expectation);
     if (headers != null) expect(response.headers, headers);
   });
diff --git a/sdk/lib/_internal/pub/test/validator/dependency_test.dart b/sdk/lib/_internal/pub/test/validator/dependency_test.dart
index 8c53c74..dd30129 100644
--- a/sdk/lib/_internal/pub/test/validator/dependency_test.dart
+++ b/sdk/lib/_internal/pub/test/validator/dependency_test.dart
@@ -57,9 +57,20 @@
 main() {
   initConfig();
 
-  integration('should consider a package valid if it looks normal', () {
-    d.validPackage.create();
-    expectNoValidationError(dependency);
+  group('should consider a package valid if it', () {
+    integration('looks normal', () {
+      d.validPackage.create();
+      expectNoValidationError(dependency);
+    });
+
+    integration('has a ^ constraint with an appropriate SDK constraint', () {
+      d.dir(appPath, [
+        d.libPubspec("test_pkg", "1.0.0", deps: {
+          "foo": "^1.2.3"
+        }, sdk: ">=1.8.0 <2.0.0")
+      ]).create();
+      expectNoValidationError(dependency);
+    });
   });
 
   group('should consider a package invalid if it', () {
@@ -380,5 +391,27 @@
         expectDependencyValidationWarning('  foo: ">1.2.3 <2.0.0"');
       });
     });
+
+    group('has a ^ dependency', () {
+      integration("without an SDK constraint", () {
+        d.dir(appPath, [
+          d.libPubspec("integration_pkg", "1.0.0", deps: {
+            "foo": "^1.2.3"
+          })
+        ]).create();
+
+        expectDependencyValidationError('  foo: ">=1.2.3 <2.0.0"');
+      });
+
+      integration("with a too-broad SDK constraint", () {
+        d.dir(appPath, [
+          d.libPubspec("test_pkg", "1.0.0", deps: {
+            "foo": "^1.2.3"
+          }, sdk: ">=1.5.0 <2.0.0")
+        ]).create();
+
+        expectDependencyValidationError('  foo: ">=1.2.3 <2.0.0"');
+      });
+    });
   });
 }
diff --git a/sdk/lib/_internal/pub/test/validator/sdk_constraint_test.dart b/sdk/lib/_internal/pub/test/validator/sdk_constraint_test.dart
new file mode 100644
index 0000000..4efb822
--- /dev/null
+++ b/sdk/lib/_internal/pub/test/validator/sdk_constraint_test.dart
@@ -0,0 +1,48 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:async';
+import 'dart:convert';
+
+import 'package:http/http.dart' as http;
+import 'package:http/testing.dart';
+import 'package:path/path.dart' as path;
+import 'package:scheduled_test/scheduled_test.dart';
+
+import '../../lib/src/entrypoint.dart';
+import '../../lib/src/validator.dart';
+import '../../lib/src/validator/sdk_constraint.dart';
+import '../descriptor.dart' as d;
+import '../test_pub.dart';
+import 'utils.dart';
+
+Validator sdkConstraint(Entrypoint entrypoint) =>
+  new SdkConstraintValidator(entrypoint);
+
+main() {
+  initConfig();
+
+  group('should consider a package valid if it', () {
+    integration('has no SDK constraint', () {
+      d.validPackage.create();
+      expectNoValidationError(sdkConstraint);
+    });
+
+    integration('has an SDK constraint without ^', () {
+      d.dir(appPath, [
+        d.libPubspec("test_pkg", "1.0.0", sdk: ">=1.8.0 <2.0.0")
+      ]).create();
+      expectNoValidationError(sdkConstraint);
+    });
+  });
+
+  test("should consider a package invalid if it has an SDK constraint with "
+      "^", () {
+    d.dir(appPath, [
+      d.libPubspec("test_pkg", "1.0.0", sdk: "^1.8.0")
+    ]).create();
+    expect(schedulePackageValidation(sdkConstraint),
+        completion(pairOf(anyElement(contains('">=1.8.0 <2.0.0"')), isEmpty)));
+  });
+}
diff --git a/sdk/lib/_internal/pub_generated/lib/src/barback/dart2js_transformer.dart b/sdk/lib/_internal/pub_generated/lib/src/barback/dart2js_transformer.dart
index 0d25cb8..66dce7b 100644
--- a/sdk/lib/_internal/pub_generated/lib/src/barback/dart2js_transformer.dart
+++ b/sdk/lib/_internal/pub_generated/lib/src/barback/dart2js_transformer.dart
@@ -12,9 +12,9 @@
 import 'package:path/path.dart' as path;
 import 'package:pool/pool.dart';
 
-import '../../../../compiler/compiler.dart' as compiler;
-import '../../../../compiler/implementation/dart2js.dart' show AbortLeg;
-import '../../../../compiler/implementation/source_file.dart';
+import '../../../../../../../pkg/compiler/lib/compiler.dart' as compiler;
+import '../../../../../../../pkg/compiler/lib/src/dart2js.dart' show AbortLeg;
+import '../../../../../../../pkg/compiler/lib/src/source_file.dart';
 import '../barback.dart';
 import '../dart.dart' as dart;
 import '../utils.dart';
@@ -29,7 +29,6 @@
         'minify',
         'verbose',
         'environment',
-        'analyzeAll',
         'preserveUris',
         'suppressWarnings',
         'suppressHints',
@@ -97,7 +96,6 @@
   void declareOutputs(DeclaringTransform transform) {
     var primaryId = transform.primaryId;
     transform.declareOutput(primaryId.addExtension(".js"));
-    transform.declareOutput(primaryId.addExtension(".precompiled.js"));
     if (_generateSourceMaps) {
       transform.declareOutput(primaryId.addExtension(".js.map"));
     }
@@ -300,6 +298,10 @@
       return new NullSink<String>();
     }
 
+    // TODO(nweiz): remove this special case when dart2js stops generating these
+    // files.
+    if (extension.endsWith(".precompiled.js")) return new NullSink<String>();
+
     var primaryId = _transform.primaryInput.id;
 
     // Dart2js uses an empty string for the name of the entrypoint library.
diff --git a/sdk/lib/_internal/pub_generated/lib/src/barback/dependency_computer.dart b/sdk/lib/_internal/pub_generated/lib/src/barback/dependency_computer.dart
index 36dc612..f9aff0b 100644
--- a/sdk/lib/_internal/pub_generated/lib/src/barback/dependency_computer.dart
+++ b/sdk/lib/_internal/pub_generated/lib/src/barback/dependency_computer.dart
@@ -96,7 +96,8 @@
   Set<TransformerId> transformersNeededByLibrary(AssetId id) {
     var library = _graph.packages[id.package].path(p.fromUri(id.path));
     _loadPackageComputer(id.package);
-    return _packageComputers[id.package].transformersNeededByLibrary(library);
+    return _packageComputers[id.package].transformersNeededByLibrary(
+        library).where((id) => !id.isBuiltInTransformer).toSet();
   }
 
   /// Returns the set of all transformers that need to be loaded before [id] is
diff --git a/sdk/lib/_internal/pub_generated/lib/src/dart.dart b/sdk/lib/_internal/pub_generated/lib/src/dart.dart
index b639999..8a66472 100644
--- a/sdk/lib/_internal/pub_generated/lib/src/dart.dart
+++ b/sdk/lib/_internal/pub_generated/lib/src/dart.dart
@@ -12,8 +12,8 @@
 import 'package:analyzer/analyzer.dart';
 import 'package:path/path.dart' as path;
 
-import '../../../compiler/compiler.dart' as compiler;
-import '../../../compiler/implementation/filenames.dart' show appendSlash;
+import '../../../../../../pkg/compiler/lib/compiler.dart' as compiler;
+import '../../../../../../pkg/compiler/lib/src/filenames.dart' show appendSlash;
 
 import '../../asset/dart/serialize.dart';
 import 'io.dart';
diff --git a/sdk/lib/_internal/pub_generated/lib/src/validator.dart b/sdk/lib/_internal/pub_generated/lib/src/validator.dart
index 4580ca1..25e6843 100644
--- a/sdk/lib/_internal/pub_generated/lib/src/validator.dart
+++ b/sdk/lib/_internal/pub_generated/lib/src/validator.dart
@@ -17,6 +17,7 @@
 import 'validator/license.dart';
 import 'validator/name.dart';
 import 'validator/pubspec_field.dart';
+import 'validator/sdk_constraint.dart';
 import 'validator/size.dart';
 import 'validator/utf8_readme.dart';
 
@@ -65,7 +66,8 @@
         new DirectoryValidator(entrypoint),
         new ExecutableValidator(entrypoint),
         new CompiledDartdocValidator(entrypoint),
-        new Utf8ReadmeValidator(entrypoint)];
+        new Utf8ReadmeValidator(entrypoint),
+        new SdkConstraintValidator(entrypoint)];
     if (packageSize != null) {
       validators.add(new SizeValidator(entrypoint, packageSize));
     }
diff --git a/sdk/lib/_internal/pub_generated/lib/src/validator/dependency.dart b/sdk/lib/_internal/pub_generated/lib/src/validator/dependency.dart
index 4193260..d558407 100644
--- a/sdk/lib/_internal/pub_generated/lib/src/validator/dependency.dart
+++ b/sdk/lib/_internal/pub_generated/lib/src/validator/dependency.dart
@@ -11,33 +11,127 @@
 import '../entrypoint.dart';
 import '../log.dart' as log;
 import '../package.dart';
+import '../utils.dart';
 import '../validator.dart';
 
+/// The range of all pub versions that don't support `^` version constraints.
+final _preCaretPubVersions = new VersionConstraint.parse("<1.8.0-dev.3.0");
+
+// TODO(nweiz): replace this with "^1.8.0" for the 1.8 release.
+/// The range of all pub versions that do support `^` version constraints.
+///
+/// This is intersected with the user's SDK constraint to provide a suggested
+/// constraint.
+final _postCaretPubVersions = new VersionConstraint.parse("^1.8.0-dev.3.0");
+
 /// A validator that validates a package's dependencies.
 class DependencyValidator extends Validator {
+  /// Whether the SDK constraint guarantees that `^` version constraints are
+  /// safe.
+  bool get _caretAllowed =>
+      entrypoint.root.pubspec.environment.sdkVersion.intersect(
+          _preCaretPubVersions).isEmpty;
+
   DependencyValidator(Entrypoint entrypoint)
       : super(entrypoint);
 
   Future validate() {
-    return Future.forEach(entrypoint.root.pubspec.dependencies, (dependency) {
-      if (dependency.source != "hosted") {
-        return _warnAboutSource(dependency);
+    final completer0 = new Completer();
+    scheduleMicrotask(() {
+      try {
+        var caretDeps = [];
+        Future.forEach(entrypoint.root.pubspec.dependencies, ((dependency) {
+          final completer0 = new Completer();
+          scheduleMicrotask(() {
+            try {
+              join0() {
+                completer0.complete();
+              }
+              if (dependency.source != "hosted") {
+                _warnAboutSource(dependency).then((x0) {
+                  try {
+                    x0;
+                    join0();
+                  } catch (e0, s0) {
+                    completer0.completeError(e0, s0);
+                  }
+                }, onError: completer0.completeError);
+              } else {
+                join1() {
+                  join0();
+                }
+                if (dependency.constraint.isAny) {
+                  _warnAboutNoConstraint(dependency);
+                  join1();
+                } else {
+                  join2() {
+                    join1();
+                  }
+                  if (dependency.constraint is Version) {
+                    _warnAboutSingleVersionConstraint(dependency);
+                    join2();
+                  } else {
+                    join3() {
+                      join2();
+                    }
+                    if (dependency.constraint is VersionRange) {
+                      join4() {
+                        join5() {
+                          join3();
+                        }
+                        if (dependency.constraint.toString().startsWith("^")) {
+                          caretDeps.add(dependency);
+                          join5();
+                        } else {
+                          join5();
+                        }
+                      }
+                      if (dependency.constraint.min == null) {
+                        _warnAboutNoConstraintLowerBound(dependency);
+                        join4();
+                      } else {
+                        join6() {
+                          join4();
+                        }
+                        if (dependency.constraint.max == null) {
+                          _warnAboutNoConstraintUpperBound(dependency);
+                          join6();
+                        } else {
+                          join6();
+                        }
+                      }
+                    } else {
+                      join3();
+                    }
+                  }
+                }
+              }
+            } catch (e, s) {
+              completer0.completeError(e, s);
+            }
+          });
+          return completer0.future;
+        })).then((x0) {
+          try {
+            x0;
+            join0() {
+              completer0.complete();
+            }
+            if (caretDeps.isNotEmpty && !_caretAllowed) {
+              _errorAboutCaretConstraints(caretDeps);
+              join0();
+            } else {
+              join0();
+            }
+          } catch (e0, s0) {
+            completer0.completeError(e0, s0);
+          }
+        }, onError: completer0.completeError);
+      } catch (e, s) {
+        completer0.completeError(e, s);
       }
-
-      if (dependency.constraint.isAny) {
-        _warnAboutNoConstraint(dependency);
-      } else if (dependency.constraint is Version) {
-        _warnAboutSingleVersionConstraint(dependency);
-      } else if (dependency.constraint is VersionRange) {
-        if (dependency.constraint.min == null) {
-          _warnAboutNoConstraintLowerBound(dependency);
-        } else if (dependency.constraint.max == null) {
-          _warnAboutNoConstraintUpperBound(dependency);
-        }
-      }
-
-      return new Future.value();
     });
+    return completer0.future;
   }
 
   /// Warn that dependencies should use the hosted source.
@@ -121,23 +215,56 @@
 
   /// Warn that dependencies should have upper bounds on their constraints.
   void _warnAboutNoConstraintUpperBound(PackageDep dep) {
+    var constraint;
+    if ((dep.constraint as VersionRange).includeMin) {
+      constraint = _constraintForVersion((dep.constraint as VersionRange).min);
+    } else {
+      constraint =
+          '"${dep.constraint} ' '<${(dep.constraint as VersionRange).min.nextBreaking}"';
+    }
+
     warnings.add(
         'Your dependency on "${dep.name}" should have an upper bound. For ' 'example:\n'
-            '\n' 'dependencies:\n' '  ${dep.name}: "${dep.constraint} '
-            '${_upperBoundForVersion((dep.constraint as VersionRange).min)}"\n' '\n'
+            '\n' 'dependencies:\n' '  ${dep.name}: $constraint\n' '\n'
             'Without an upper bound, you\'re promising to support '
             '${log.bold("all")} future versions of ${dep.name}.');
   }
 
+  /// Emits an error for any version constraints that use `^` without an
+  /// appropriate SDK constraint.
+  void _errorAboutCaretConstraints(List<PackageDep> caretDeps) {
+    var newSdkConstraint =
+        entrypoint.root.pubspec.environment.sdkVersion.intersect(_postCaretPubVersions);
+
+    if (newSdkConstraint.isEmpty) newSdkConstraint = _postCaretPubVersions;
+
+    var buffer = new StringBuffer(
+        "Older versions of pub don't support ^ version constraints.\n"
+            "Make sure your SDK constraint excludes those old versions:\n" "\n"
+            "environment:\n" "  sdk: \"$newSdkConstraint\"\n" "\n");
+
+    if (caretDeps.length == 1) {
+      buffer.writeln("Or use a fully-expanded constraint:");
+    } else {
+      buffer.writeln("Or use fully-expanded constraints:");
+    }
+
+    buffer.writeln();
+    buffer.writeln("dependencies:");
+
+    caretDeps.forEach((dep) {
+      VersionRange constraint = dep.constraint;
+      buffer.writeln(
+          "  ${dep.name}: \">=${constraint.min} <${constraint.max}\"");
+    });
+
+    errors.add(buffer.toString().trim());
+  }
+
   /// Returns the suggested version constraint for a dependency that was tested
   /// against [version].
-  String _constraintForVersion(Version version) =>
-      '">=$version ${_upperBoundForVersion(version)}"';
-
-  /// Returns the suggested upper bound for a dependency that was tested against
-  /// [version].
-  String _upperBoundForVersion(Version version) {
-    if (version.major != 0) return '<${version.major + 1}.0.0';
-    return '<${version.major}.${version.minor + 1}.0';
+  String _constraintForVersion(Version version) {
+    if (_caretAllowed) return "^$version";
+    return '">=$version <${version.nextBreaking}"';
   }
 }
diff --git a/sdk/lib/_internal/pub_generated/lib/src/validator/sdk_constraint.dart b/sdk/lib/_internal/pub_generated/lib/src/validator/sdk_constraint.dart
new file mode 100644
index 0000000..0fe9ac8
--- /dev/null
+++ b/sdk/lib/_internal/pub_generated/lib/src/validator/sdk_constraint.dart
@@ -0,0 +1,45 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library pub.validator.sdk_constraint;
+
+import 'dart:async';
+
+import 'package:pub_semver/pub_semver.dart';
+
+import '../entrypoint.dart';
+import '../log.dart' as log;
+import '../package.dart';
+import '../validator.dart';
+
+/// A validator that validates that a package's SDK constraint doesn't use the
+/// "^" syntax.
+class SdkConstraintValidator extends Validator {
+  SdkConstraintValidator(Entrypoint entrypoint)
+      : super(entrypoint);
+
+  Future validate() {
+    final completer0 = new Completer();
+    scheduleMicrotask(() {
+      try {
+        var constraint = entrypoint.root.pubspec.environment.sdkVersion;
+        join0() {
+          errors.add(
+              "^ version constraints aren't allowed for SDK constraints since "
+                  "older versions of pub don't support them.\n" "Expand it manually instead:\n"
+                  "\n" "environment:\n" "  sdk: \">=${constraint.min} <${constraint.max}\"");
+          completer0.complete();
+        }
+        if (!constraint.toString().startsWith("^")) {
+          completer0.complete(null);
+        } else {
+          join0();
+        }
+      } catch (e, s) {
+        completer0.completeError(e, s);
+      }
+    });
+    return completer0.future;
+  }
+}
diff --git a/sdk/lib/_internal/pub_generated/test/build/copies_browser_js_next_to_entrypoints_test.dart b/sdk/lib/_internal/pub_generated/test/build/copies_browser_js_next_to_entrypoints_test.dart
index 0b33b90..21a73ab 100644
--- a/sdk/lib/_internal/pub_generated/test/build/copies_browser_js_next_to_entrypoints_test.dart
+++ b/sdk/lib/_internal/pub_generated/test/build/copies_browser_js_next_to_entrypoints_test.dart
@@ -52,7 +52,6 @@
                         'foo',
                         [
                             d.matcherFile('file.dart.js', isNot(isEmpty)),
-                            d.matcherFile('file.dart.precompiled.js', isNot(isEmpty)),
                             d.dir(
                                 'packages',
                                 [
@@ -72,13 +71,11 @@
                                                 [
                                                     d.file('dart.js', 'contents of dart.js'),
                                                     d.file('interop.js', 'contents of interop.js')])]),
-                                    d.matcherFile('subfile.dart.js', isNot(isEmpty)),
-                                    d.matcherFile('subfile.dart.precompiled.js', isNot(isEmpty)),])]),
+                                    d.matcherFile('subfile.dart.js', isNot(isEmpty)),])]),
                     d.dir(
                         'web',
                         [
                             d.matcherFile('file.dart.js', isNot(isEmpty)),
-                            d.matcherFile('file.dart.precompiled.js', isNot(isEmpty)),
                             d.dir(
                                 'packages',
                                 [
@@ -98,7 +95,6 @@
                                                 [
                                                     d.file('dart.js', 'contents of dart.js'),
                                                     d.file('interop.js', 'contents of interop.js')])]),
-                                    d.matcherFile('subfile.dart.js', isNot(isEmpty)),
-                                    d.matcherFile('subfile.dart.precompiled.js', isNot(isEmpty))])])])]).validate();
+                                    d.matcherFile('subfile.dart.js', isNot(isEmpty))])])])]).validate();
   });
 }
diff --git a/sdk/lib/_internal/pub_generated/test/dart2js/compiles_entrypoints_in_root_package_test.dart b/sdk/lib/_internal/pub_generated/test/dart2js/compiles_entrypoints_in_root_package_test.dart
index e60d584..316754a 100644
--- a/sdk/lib/_internal/pub_generated/test/dart2js/compiles_entrypoints_in_root_package_test.dart
+++ b/sdk/lib/_internal/pub_generated/test/dart2js/compiles_entrypoints_in_root_package_test.dart
@@ -53,40 +53,34 @@
                         'benchmark',
                         [
                             d.matcherFile('file.dart.js', isNot(isEmpty)),
-                            d.matcherFile('file.dart.precompiled.js', isNot(isEmpty)),
                             d.nothing('file.dart'),
                             d.nothing('lib.dart'),
                             d.dir(
                                 'subdir',
                                 [
                                     d.matcherFile('subfile.dart.js', isNot(isEmpty)),
-                                    d.matcherFile('subfile.dart.precompiled.js', isNot(isEmpty)),
                                     d.nothing('subfile.dart')])]),
                     d.dir(
                         'foo',
                         [
                             d.matcherFile('file.dart.js', isNot(isEmpty)),
-                            d.matcherFile('file.dart.precompiled.js', isNot(isEmpty)),
                             d.nothing('file.dart'),
                             d.nothing('lib.dart'),
                             d.dir(
                                 'subdir',
                                 [
                                     d.matcherFile('subfile.dart.js', isNot(isEmpty)),
-                                    d.matcherFile('subfile.dart.precompiled.js', isNot(isEmpty)),
                                     d.nothing('subfile.dart')])]),
                     d.dir(
                         'web',
                         [
                             d.matcherFile('file.dart.js', isNot(isEmpty)),
-                            d.matcherFile('file.dart.precompiled.js', isNot(isEmpty)),
                             d.nothing('file.dart'),
                             d.nothing('lib.dart'),
                             d.dir(
                                 'subdir',
                                 [
                                     d.matcherFile('subfile.dart.js', isNot(isEmpty)),
-                                    d.matcherFile('subfile.dart.precompiled.js', isNot(isEmpty)),
                                     d.nothing('subfile.dart')])])])]).validate();
   });
 }
diff --git a/sdk/lib/_internal/pub_generated/test/dart2js/minify_configuration_overrides_mode_test.dart b/sdk/lib/_internal/pub_generated/test/dart2js/minify_configuration_overrides_mode_test.dart
index 025edab..eca9f08 100644
--- a/sdk/lib/_internal/pub_generated/test/dart2js/minify_configuration_overrides_mode_test.dart
+++ b/sdk/lib/_internal/pub_generated/test/dart2js/minify_configuration_overrides_mode_test.dart
@@ -16,7 +16,10 @@
               "minify": true
             }
           }]
-      })]).create();
+      }),
+          d.dir(
+              "web",
+              [d.file("main.dart", "void main() => print('Hello!');")])]).create();
 
     pubServe();
     requestShouldSucceed("main.dart.js", isMinifiedDart2JSOutput);
diff --git a/sdk/lib/_internal/pub_generated/test/dart2js/outputs_deferred_libraries_test.dart b/sdk/lib/_internal/pub_generated/test/dart2js/outputs_deferred_libraries_test.dart
index 970d0aa..2efeb0f 100644
--- a/sdk/lib/_internal/pub_generated/test/dart2js/outputs_deferred_libraries_test.dart
+++ b/sdk/lib/_internal/pub_generated/test/dart2js/outputs_deferred_libraries_test.dart
@@ -65,7 +65,6 @@
                         'web',
                         [
                             d.matcherFile('main.dart.js', isNot(isEmpty)),
-                            d.matcherFile('main.dart.precompiled.js', isNot(isEmpty)),
                             d.matcherFile('main.dart.js_1.part.js', isNot(isEmpty)),
                             d.matcherFile('main.dart.js_2.part.js', isNot(isEmpty)),])])]).validate();
   });
diff --git a/sdk/lib/_internal/pub_generated/test/dart2js/supports_configuration_with_build_test.dart b/sdk/lib/_internal/pub_generated/test/dart2js/supports_configuration_with_build_test.dart
index cc9f0bf..6e217f0a 100644
--- a/sdk/lib/_internal/pub_generated/test/dart2js/supports_configuration_with_build_test.dart
+++ b/sdk/lib/_internal/pub_generated/test/dart2js/supports_configuration_with_build_test.dart
@@ -83,7 +83,6 @@
                         'web',
                         [
                             d.matcherFile('file.dart.js', isMinifiedDart2JSOutput),
-                            d.matcherFile('file.dart.precompiled.js', isNot(isEmpty)),
                             d.dir(
                                 'packages',
                                 [
diff --git a/sdk/lib/_internal/pub_generated/test/dart2js/supports_valid_options_test.dart b/sdk/lib/_internal/pub_generated/test/dart2js/supports_valid_options_test.dart
index 7c799f7..07afaa9 100644
--- a/sdk/lib/_internal/pub_generated/test/dart2js/supports_valid_options_test.dart
+++ b/sdk/lib/_internal/pub_generated/test/dart2js/supports_valid_options_test.dart
@@ -23,14 +23,16 @@
               "environment": {
                 "name": "value"
               },
-              "analyzeAll": true,
               "suppressWarnings": true,
               "suppressHints": true,
               "suppressPackageWarnings": false,
               "terse": true
             }
           }]
-      })]).create();
+      }),
+          d.dir(
+              "web",
+              [d.file("main.dart", "void main() => print('Hello!');")])]).create();
 
     // None of these options should be rejected, either by pub or by dart2js.
     pubServe();
diff --git a/sdk/lib/_internal/pub_generated/test/run/ignores_explicit_dart2js_transformer_test.dart b/sdk/lib/_internal/pub_generated/test/run/ignores_explicit_dart2js_transformer_test.dart
new file mode 100644
index 0000000..e3286e7
--- /dev/null
+++ b/sdk/lib/_internal/pub_generated/test/run/ignores_explicit_dart2js_transformer_test.dart
@@ -0,0 +1,21 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import '../descriptor.dart' as d;
+import '../test_pub.dart';
+
+main() {
+  initConfig();
+  integration("doesn't choke on an explicit dart2js transformer", () {
+    d.dir(appPath, [d.pubspec({
+        "name": "myapp",
+        "transformers": [r"$dart2js"]
+      }),
+          d.dir("bin", [d.file("script.dart", "main() => print('Hello!');")])]).create();
+
+    var pub = pubRun(args: ["script"]);
+    pub.stdout.expect("Hello!");
+    pub.shouldExit(0);
+  });
+}
diff --git a/sdk/lib/_internal/pub_generated/test/serve/utils.dart b/sdk/lib/_internal/pub_generated/test/serve/utils.dart
index d784418..a0ac7cc 100644
--- a/sdk/lib/_internal/pub_generated/test/serve/utils.dart
+++ b/sdk/lib/_internal/pub_generated/test/serve/utils.dart
@@ -255,6 +255,7 @@
 /// [headers] may be either a [Matcher] or a map to match an exact headers map.
 void requestShouldSucceed(String urlPath, expectation, {String root, headers}) {
   scheduleRequest(urlPath, root: root).then((response) {
+    expect(response.statusCode, equals(200));
     if (expectation != null) expect(response.body, expectation);
     if (headers != null) expect(response.headers, headers);
   });
diff --git a/sdk/lib/_internal/pub_generated/test/validator/dependency_test.dart b/sdk/lib/_internal/pub_generated/test/validator/dependency_test.dart
index 5f05d3d..689fc66 100644
--- a/sdk/lib/_internal/pub_generated/test/validator/dependency_test.dart
+++ b/sdk/lib/_internal/pub_generated/test/validator/dependency_test.dart
@@ -59,9 +59,18 @@
 main() {
   initConfig();
 
-  integration('should consider a package valid if it looks normal', () {
-    d.validPackage.create();
-    expectNoValidationError(dependency);
+  group('should consider a package valid if it', () {
+    integration('looks normal', () {
+      d.validPackage.create();
+      expectNoValidationError(dependency);
+    });
+
+    integration('has a ^ constraint with an appropriate SDK constraint', () {
+      d.dir(appPath, [d.libPubspec("test_pkg", "1.0.0", deps: {
+          "foo": "^1.2.3"
+        }, sdk: ">=1.8.0 <2.0.0")]).create();
+      expectNoValidationError(dependency);
+    });
   });
 
   group('should consider a package invalid if it', () {
@@ -380,5 +389,23 @@
         expectDependencyValidationWarning('  foo: ">1.2.3 <2.0.0"');
       });
     });
+
+    group('has a ^ dependency', () {
+      integration("without an SDK constraint", () {
+        d.dir(appPath, [d.libPubspec("integration_pkg", "1.0.0", deps: {
+            "foo": "^1.2.3"
+          })]).create();
+
+        expectDependencyValidationError('  foo: ">=1.2.3 <2.0.0"');
+      });
+
+      integration("with a too-broad SDK constraint", () {
+        d.dir(appPath, [d.libPubspec("test_pkg", "1.0.0", deps: {
+            "foo": "^1.2.3"
+          }, sdk: ">=1.5.0 <2.0.0")]).create();
+
+        expectDependencyValidationError('  foo: ">=1.2.3 <2.0.0"');
+      });
+    });
   });
 }
diff --git a/sdk/lib/_internal/pub_generated/test/validator/sdk_constraint_test.dart b/sdk/lib/_internal/pub_generated/test/validator/sdk_constraint_test.dart
new file mode 100644
index 0000000..27c568a
--- /dev/null
+++ b/sdk/lib/_internal/pub_generated/test/validator/sdk_constraint_test.dart
@@ -0,0 +1,48 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:async';
+import 'dart:convert';
+
+import 'package:http/http.dart' as http;
+import 'package:http/testing.dart';
+import 'package:path/path.dart' as path;
+import 'package:scheduled_test/scheduled_test.dart';
+
+import '../../lib/src/entrypoint.dart';
+import '../../lib/src/validator.dart';
+import '../../lib/src/validator/sdk_constraint.dart';
+import '../descriptor.dart' as d;
+import '../test_pub.dart';
+import 'utils.dart';
+
+Validator sdkConstraint(Entrypoint entrypoint) =>
+    new SdkConstraintValidator(entrypoint);
+
+main() {
+  initConfig();
+
+  group('should consider a package valid if it', () {
+    integration('has no SDK constraint', () {
+      d.validPackage.create();
+      expectNoValidationError(sdkConstraint);
+    });
+
+    integration('has an SDK constraint without ^', () {
+      d.dir(
+          appPath,
+          [d.libPubspec("test_pkg", "1.0.0", sdk: ">=1.8.0 <2.0.0")]).create();
+      expectNoValidationError(sdkConstraint);
+    });
+  });
+
+  test(
+      "should consider a package invalid if it has an SDK constraint with " "^",
+      () {
+    d.dir(appPath, [d.libPubspec("test_pkg", "1.0.0", sdk: "^1.8.0")]).create();
+    expect(
+        schedulePackageValidation(sdkConstraint),
+        completion(pairOf(anyElement(contains('">=1.8.0 <2.0.0"')), isEmpty)));
+  });
+}
diff --git a/sdk/lib/collection/queue.dart b/sdk/lib/collection/queue.dart
index 9e8580d..fc568ff 100644
--- a/sdk/lib/collection/queue.dart
+++ b/sdk/lib/collection/queue.dart
@@ -427,8 +427,8 @@
   }
 
   E elementAt(int index) {
-    if (index < 0 || index > length) {
-      throw new RangeError.range(index, 0, length);
+    if (index < 0 || index >= length) {
+      throw new RangeError.index(index, this);
     }
     return _table[(_head + index) & (_table.length - 1)];
   }
diff --git a/sdk/lib/collection/splay_tree.dart b/sdk/lib/collection/splay_tree.dart
index 96c3cd7..0edd58d 100644
--- a/sdk/lib/collection/splay_tree.dart
+++ b/sdk/lib/collection/splay_tree.dart
@@ -289,7 +289,7 @@
    * If no values are specified for [key] and [value] the default is the
    * identity function.
    */
-  factory SplayTreeMap.fromIterable(Iterable<K> iterable,
+  factory SplayTreeMap.fromIterable(Iterable iterable,
       {K key(element), V value(element), int compare(K key1, K key2),
        bool isValidKey(potentialKey) }) {
     SplayTreeMap<K, V> map = new SplayTreeMap<K, V>(compare, isValidKey);
diff --git a/sdk/lib/convert/ascii.dart b/sdk/lib/convert/ascii.dart
index 281233a..40ff5a8 100644
--- a/sdk/lib/convert/ascii.dart
+++ b/sdk/lib/convert/ascii.dart
@@ -292,10 +292,10 @@
   void addSlice(List<int> source, int start, int end, bool isLast) {
     final int length = source.length;
     if (start < 0 || start > length) {
-      throw new RangeError.range(start, 0, length - 1);
+      throw new RangeError.range(start, 0, length);
     }
     if (end < start || end > length) {
-      throw new RangeError.range(end, start, length - 1);
+      throw new RangeError.range(end, start, length);
     }
     if (start < end) {
       if (start != 0 || end != length) {
diff --git a/sdk/lib/core/corelib_sources.gypi b/sdk/lib/core/core_sources.gypi
similarity index 100%
rename from sdk/lib/core/corelib_sources.gypi
rename to sdk/lib/core/core_sources.gypi
diff --git a/sdk/lib/core/errors.dart b/sdk/lib/core/errors.dart
index 905250c..f4509eb 100644
--- a/sdk/lib/core/errors.dart
+++ b/sdk/lib/core/errors.dart
@@ -159,16 +159,67 @@
  * Error thrown when a function is passed an unacceptable argument.
  */
 class ArgumentError extends Error {
+  /** Whether value was provided. */
+  final bool _hasValue;
+  /** The invalid value. */
+  final invalidValue;
+  /** Name of the invalid argument, if available. */
+  final String name;
+  /** Message describing the problem. */
   final message;
 
-  /** The [message] describes the erroneous argument. */
-  ArgumentError([this.message]);
+  /**
+   * The [message] describes the erroneous argument.
+   *
+   * Existing code may be using `message` to hold the invalid value.
+   * If the `message` is not a [String], it is assumed to be a value instead
+   * of a message.
+   */
+  ArgumentError([this.message])
+     : invalidValue = null,
+       _hasValue = false,
+       name = null;
+
+  /**
+   * Creates error containing the invalid [value].
+   *
+   * A message is built by suffixing the [message] argument with
+   * the [name] argument (if provided) and the value. Example
+   *
+   *    "Invalid argument (foo): null"
+   *
+   * The `name` should match the argument name of the function, but if
+   * the function is a method implementing an interface, and its argument
+   * names differ from the interface, it might be more useful to use the
+   * interface method's argument name (or just rename arguments to match).
+   */
+  ArgumentError.value(value,
+                      [String this.name,
+                       String this.message = "Invalid argument"])
+      : invalidValue = value,
+        _hasValue = true;
+
+  /**
+   * Create an argument error for a `null` argument that must not be `null`.
+   *
+   * Shorthand for calling [ArgumentError.value] with a `null` value and a
+   * message of `"Must not be null"`.
+   */
+  ArgumentError.notNull([String name])
+      : this.value(null, name, "Must not be null");
 
   String toString() {
-    if (message != null) {
-      return "Illegal argument(s): $message";
+    if (!_hasValue) {
+      if (message != null) {
+        return "Invalid argument(s): $message";
+      }
+      return "Invalid argument(s)";
     }
-    return "Illegal argument(s)";
+    String nameString = "";
+    if (name != null) {
+      nameString = " ($name)";
+    }
+    return "$message$nameString: ${Error.safeToString(invalidValue)}";
   }
 }
 
@@ -176,25 +227,115 @@
  * Error thrown due to an index being outside a valid range.
  */
 class RangeError extends ArgumentError {
+  /** The value that is outside its valid range. */
+  final num invalidValue;
+  /** The minimum value that [value] is allowed to assume. */
+  final num start;
+  /** The maximum value that [value] is allowed to assume. */
+  final num end;
+
   // TODO(lrn): This constructor should be called only with string values.
   // It currently isn't in all cases.
   /**
    * Create a new [RangeError] with the given [message].
    */
-  RangeError(var message) : super(message);
+  RangeError(var message)
+      : invalidValue = null, start = null, end = null, super(message);
 
   /** Create a new [RangeError] with a message for the given [value]. */
-  RangeError.value(num value) : super("value $value");
+  RangeError.value(num value, [String message = "Value not in range"])
+      : invalidValue = value, start = null, end = null,
+        super(message);
 
   /**
-   * Create a new [RangeError] with a message for a value and a range.
+   * Create a new [RangeError] with for an invalid value being outside a range.
    *
    * The allowed range is from [start] to [end], inclusive.
+   * If `start` or `end` are `null`, the range is infinite in that direction.
+   *
+   * For a range from 0 to the length of something, end exclusive, use
+   * [RangeError.index].
    */
-  RangeError.range(num value, num start, num end)
-      : super("value $value not in range $start..$end");
+  RangeError.range(this.invalidValue, this.start, this.end,
+                   [String message = "Invalid value"]) : super(message);
 
-  String toString() => "RangeError: $message";
+  /**
+   * Creates a new [RangeError] stating that [index] is not a valid index
+   * into [indexable].
+   *
+   * The [length] is the length of [indexable] at the time of the error.
+   * If `length` is omitted, it defaults to `indexable.length`.
+   *
+   * The message is used as part of the string representation of the error.
+   */
+  factory RangeError.index(int index, indexable,
+                           [String message,
+                            int length]) = IndexError;
+
+  String toString() {
+    if (invalidValue == null) return "$message";
+    String value = Error.safeToString(invalidValue);
+    if (start == null) {
+      if (end == null) {
+        return "$message ($value)";
+      }
+      return "$message ($value): Value must be less than or equal to $end";
+    }
+    if (end == null) {
+      return "$message ($value): Value must be greater than or equal to $start";
+    }
+    if (end > start) {
+      return "$message ($value): Value must be in range $start..$end, "
+             "inclusive.";
+    }
+    if (end < start) return "$message ($value): Valid range is empty";
+    return "$message ($value): Only valid value is $start";
+  }
+}
+
+/**
+ * A specialized [RangeError] used when an index is not in the range
+ * `0..indexable.length-1`.
+ *
+ * Also contains the indexable object, its length at the time of the error,
+ * and the invalid index itself.
+ */
+class IndexError extends ArgumentError implements RangeError {
+  /** The indexable object that [index] was not a valid index into. */
+  final indexable;
+  /** The invalid index. */
+  final int invalidValue;
+  /** The length of [indexable] at the time of the error. */
+  final int length;
+
+  /**
+   * Creates a new [IndexError] stating that [invalidValue] is not a valid index
+   * into [indexable].
+   *
+   * The [length] is the length of [indexable] at the time of the error.
+   * If `length` is omitted, it defaults to `indexable.length`.
+   *
+   * The message is used as part of the string representation of the error.
+   */
+  IndexError(this.invalidValue, indexable,
+             [String message = "Index out of range", int length])
+      : this.indexable = indexable,
+        this.length = (length != null) ? length : indexable.length,
+        super(message);
+
+  // Getters inherited from RangeError.
+  int get start => 0;
+  int get end => length - 1;
+
+  String toString() {
+    String target = Error.safeToString(indexable);
+    if (invalidValue < 0) {
+      return "RangeError: $message ($target[$invalidValue]): "
+             "index must not be negative.";
+    }
+    return "RangeError: $message: ($target[$invalidValue]): "
+           "index should be less than $length.";
+  }
 }
 
 
diff --git a/sdk/lib/core/pattern.dart b/sdk/lib/core/pattern.dart
index ba6381e..cf898af 100644
--- a/sdk/lib/core/pattern.dart
+++ b/sdk/lib/core/pattern.dart
@@ -30,12 +30,13 @@
   Iterable<Match> allMatches(String string, [int start = 0]);
 
   /**
-   * Match this pattern against the start of string.
+   * Match this pattern against the start of `string`.
    *
    * If [start] is provided, it must be an integer in the range `0` ..
    * `string.length`. In that case, this patten is tested against the
-   * string at the [start] position. That is, a match is returned if the
+   * string at the [start] position. That is, a [Match] is returned if the
    * pattern can match a part of the string starting from position [start].
+   * Returns `null` if the pattern doesn't match.
    */
   Match matchAsPrefix(String string, [int start = 0]);
 }
diff --git a/sdk/lib/core/string.dart b/sdk/lib/core/string.dart
index 8c8f8f0..b95c6e1 100644
--- a/sdk/lib/core/string.dart
+++ b/sdk/lib/core/string.dart
@@ -678,7 +678,7 @@
    */
   void set rawIndex(int rawIndex) {
     if (rawIndex >= string.length) {
-      throw new RangeError.range(rawIndex, 0, string.length - 1);
+      throw new RangeError.index(rawIndex, string);
     }
     reset(rawIndex);
     moveNext();
diff --git a/sdk/lib/html/dart2js/html_dart2js.dart b/sdk/lib/html/dart2js/html_dart2js.dart
index 88a4020..a6c7e2a 100644
--- a/sdk/lib/html/dart2js/html_dart2js.dart
+++ b/sdk/lib/html/dart2js/html_dart2js.dart
@@ -9222,7 +9222,7 @@
   String operator[](int index) {
     if (JS("bool", "# >>> 0 !== # || # >= #", index,
         index, index, length))
-      throw new RangeError.range(index, 0, length);
+      throw new RangeError.index(index, this);
     return JS("String", "#[#]", this, index);
   }
   void operator[]=(int index, String value) {
@@ -14250,7 +14250,7 @@
   File operator[](int index) {
     if (JS("bool", "# >>> 0 !== # || # >= #", index,
         index, index, length))
-      throw new RangeError.range(index, 0, length);
+      throw new RangeError.index(index, this);
     return JS("File", "#[#]", this, index);
   }
   void operator[]=(int index, File value) {
@@ -16108,7 +16108,7 @@
   Node operator[](int index) {
     if (JS("bool", "# >>> 0 !== # || # >= #", index,
         index, index, length))
-      throw new RangeError.range(index, 0, length);
+      throw new RangeError.index(index, this);
     return JS("Node", "#[#]", this, index);
   }
   void operator[]=(int index, Node value) {
@@ -20802,7 +20802,7 @@
   MimeType operator[](int index) {
     if (JS("bool", "# >>> 0 !== # || # >= #", index,
         index, index, length))
-      throw new RangeError.range(index, 0, length);
+      throw new RangeError.index(index, this);
     return JS("MimeType", "#[#]", this, index);
   }
   void operator[]=(int index, MimeType value) {
@@ -22354,7 +22354,7 @@
   Node operator[](int index) {
     if (JS("bool", "# >>> 0 !== # || # >= #", index,
         index, index, length))
-      throw new RangeError.range(index, 0, length);
+      throw new RangeError.index(index, this);
     return JS("Node", "#[#]", this, index);
   }
   void operator[]=(int index, Node value) {
@@ -23533,7 +23533,7 @@
   Plugin operator[](int index) {
     if (JS("bool", "# >>> 0 !== # || # >= #", index,
         index, index, length))
-      throw new RangeError.range(index, 0, length);
+      throw new RangeError.index(index, this);
     return JS("Plugin", "#[#]", this, index);
   }
   void operator[]=(int index, Plugin value) {
@@ -25917,7 +25917,7 @@
   SourceBuffer operator[](int index) {
     if (JS("bool", "# >>> 0 !== # || # >= #", index,
         index, index, length))
-      throw new RangeError.range(index, 0, length);
+      throw new RangeError.index(index, this);
     return JS("SourceBuffer", "#[#]", this, index);
   }
   void operator[]=(int index, SourceBuffer value) {
@@ -26123,7 +26123,7 @@
   SpeechGrammar operator[](int index) {
     if (JS("bool", "# >>> 0 !== # || # >= #", index,
         index, index, length))
-      throw new RangeError.range(index, 0, length);
+      throw new RangeError.index(index, this);
     return JS("SpeechGrammar", "#[#]", this, index);
   }
   void operator[]=(int index, SpeechGrammar value) {
@@ -27988,7 +27988,7 @@
   TextTrackCue operator[](int index) {
     if (JS("bool", "# >>> 0 !== # || # >= #", index,
         index, index, length))
-      throw new RangeError.range(index, 0, length);
+      throw new RangeError.index(index, this);
     return JS("TextTrackCue", "#[#]", this, index);
   }
   void operator[]=(int index, TextTrackCue value) {
@@ -28073,7 +28073,7 @@
   TextTrack operator[](int index) {
     if (JS("bool", "# >>> 0 !== # || # >= #", index,
         index, index, length))
-      throw new RangeError.range(index, 0, length);
+      throw new RangeError.index(index, this);
     return JS("TextTrack", "#[#]", this, index);
   }
   void operator[]=(int index, TextTrack value) {
@@ -28474,7 +28474,7 @@
   Touch operator[](int index) {
     if (JS("bool", "# >>> 0 !== # || # >= #", index,
         index, index, length))
-      throw new RangeError.range(index, 0, length);
+      throw new RangeError.index(index, this);
     return JS("Touch", "#[#]", this, index);
   }
   void operator[]=(int index, Touch value) {
@@ -32729,7 +32729,7 @@
   Rectangle operator[](int index) {
     if (JS("bool", "# >>> 0 !== # || # >= #", index,
         index, index, length))
-      throw new RangeError.range(index, 0, length);
+      throw new RangeError.index(index, this);
     return JS("Rectangle", "#[#]", this, index);
   }
   void operator[]=(int index, Rectangle value) {
@@ -32807,7 +32807,7 @@
   CssRule operator[](int index) {
     if (JS("bool", "# >>> 0 !== # || # >= #", index,
         index, index, length))
-      throw new RangeError.range(index, 0, length);
+      throw new RangeError.index(index, this);
     return JS("CssRule", "#[#]", this, index);
   }
   void operator[]=(int index, CssRule value) {
@@ -32873,7 +32873,7 @@
   _CSSValue operator[](int index) {
     if (JS("bool", "# >>> 0 !== # || # >= #", index,
         index, index, length))
-      throw new RangeError.range(index, 0, length);
+      throw new RangeError.index(index, this);
     return JS("_CSSValue", "#[#]", this, index);
   }
   void operator[]=(int index, _CSSValue value) {
@@ -33177,7 +33177,7 @@
   Gamepad operator[](int index) {
     if (JS("bool", "# >>> 0 !== # || # >= #", index,
         index, index, length))
-      throw new RangeError.range(index, 0, length);
+      throw new RangeError.index(index, this);
     return JS("Gamepad", "#[#]", this, index);
   }
   void operator[]=(int index, Gamepad value) {
@@ -33405,7 +33405,7 @@
   Node operator[](int index) {
     if (JS("bool", "# >>> 0 !== # || # >= #", index,
         index, index, length))
-      throw new RangeError.range(index, 0, length);
+      throw new RangeError.index(index, this);
     return JS("Node", "#[#]", this, index);
   }
   void operator[]=(int index, Node value) {
@@ -33671,7 +33671,7 @@
   SpeechRecognitionResult operator[](int index) {
     if (JS("bool", "# >>> 0 !== # || # >= #", index,
         index, index, length))
-      throw new RangeError.range(index, 0, length);
+      throw new RangeError.index(index, this);
     return JS("SpeechRecognitionResult", "#[#]", this, index);
   }
   void operator[]=(int index, SpeechRecognitionResult value) {
@@ -33735,7 +33735,7 @@
   StyleSheet operator[](int index) {
     if (JS("bool", "# >>> 0 !== # || # >= #", index,
         index, index, length))
-      throw new RangeError.range(index, 0, length);
+      throw new RangeError.index(index, this);
     return JS("StyleSheet", "#[#]", this, index);
   }
   void operator[]=(int index, StyleSheet value) {
diff --git a/sdk/lib/html/dartium/html_dartium.dart b/sdk/lib/html/dartium/html_dartium.dart
index 25dbbf9..168a4c7 100644
--- a/sdk/lib/html/dartium/html_dartium.dart
+++ b/sdk/lib/html/dartium/html_dartium.dart
@@ -10207,7 +10207,7 @@
 
   String operator[](int index) {
     if (index < 0 || index >= length)
-      throw new RangeError.range(index, 0, length);
+      throw new RangeError.index(index, this);
     return _blink.BlinkDOMStringList.instance.item_Callback_1_(this, index);
   }
 
@@ -15085,7 +15085,7 @@
 
   File operator[](int index) {
     if (index < 0 || index >= length)
-      throw new RangeError.range(index, 0, length);
+      throw new RangeError.index(index, this);
     return _blink.BlinkFileList.instance.item_Callback_1_(this, index);
   }
 
@@ -16993,7 +16993,7 @@
 
   Node operator[](int index) {
     if (index < 0 || index >= length)
-      throw new RangeError.range(index, 0, length);
+      throw new RangeError.index(index, this);
     return _blink.BlinkHTMLCollection.instance.item_Callback_1_(this, index);
   }
 
@@ -22836,7 +22836,7 @@
 
   MimeType operator[](int index) {
     if (index < 0 || index >= length)
-      throw new RangeError.range(index, 0, length);
+      throw new RangeError.index(index, this);
     return _blink.BlinkMimeTypeArray.instance.item_Callback_1_(this, index);
   }
 
@@ -24422,7 +24422,7 @@
 
   Node operator[](int index) {
     if (index < 0 || index >= length)
-      throw new RangeError.range(index, 0, length);
+      throw new RangeError.index(index, this);
     return _blink.BlinkNodeList.instance.item_Callback_1_(this, index);
   }
 
@@ -25722,7 +25722,7 @@
 
   Plugin operator[](int index) {
     if (index < 0 || index >= length)
-      throw new RangeError.range(index, 0, length);
+      throw new RangeError.index(index, this);
     return _blink.BlinkPluginArray.instance.item_Callback_1_(this, index);
   }
 
@@ -28178,7 +28178,7 @@
 
   SourceBuffer operator[](int index) {
     if (index < 0 || index >= length)
-      throw new RangeError.range(index, 0, length);
+      throw new RangeError.index(index, this);
     return _blink.BlinkSourceBufferList.instance.item_Callback_1_(this, index);
   }
 
@@ -28429,7 +28429,7 @@
 
   SpeechGrammar operator[](int index) {
     if (index < 0 || index >= length)
-      throw new RangeError.range(index, 0, length);
+      throw new RangeError.index(index, this);
     return _blink.BlinkSpeechGrammarList.instance.item_Callback_1_(this, index);
   }
 
@@ -30474,7 +30474,7 @@
 
   TextTrackCue operator[](int index) {
     if (index < 0 || index >= length)
-      throw new RangeError.range(index, 0, length);
+      throw new RangeError.index(index, this);
     return _blink.BlinkTextTrackCueList.instance.item_Callback_1_(this, index);
   }
 
@@ -30563,7 +30563,7 @@
 
   TextTrack operator[](int index) {
     if (index < 0 || index >= length)
-      throw new RangeError.range(index, 0, length);
+      throw new RangeError.index(index, this);
     return _blink.BlinkTextTrackList.instance.item_Callback_1_(this, index);
   }
 
@@ -30994,7 +30994,7 @@
 
   Touch operator[](int index) {
     if (index < 0 || index >= length)
-      throw new RangeError.range(index, 0, length);
+      throw new RangeError.index(index, this);
     return _blink.BlinkTouchList.instance.item_Callback_1_(this, index);
   }
 
@@ -31406,10 +31406,10 @@
     if ((blob_OR_source_OR_stream is Blob || blob_OR_source_OR_stream == null)) {
       return _blink.BlinkURL.instance.createObjectURL_Callback_1_(blob_OR_source_OR_stream);
     }
-    if ((blob_OR_source_OR_stream is MediaSource)) {
+    if ((blob_OR_source_OR_stream is MediaStream)) {
       return _blink.BlinkURL.instance.createObjectURL_Callback_1_(blob_OR_source_OR_stream);
     }
-    if ((blob_OR_source_OR_stream is MediaStream)) {
+    if ((blob_OR_source_OR_stream is MediaSource)) {
       return _blink.BlinkURL.instance.createObjectURL_Callback_1_(blob_OR_source_OR_stream);
     }
     throw new ArgumentError("Incorrect number or type of arguments");
@@ -35096,7 +35096,7 @@
 
   Rectangle operator[](int index) {
     if (index < 0 || index >= length)
-      throw new RangeError.range(index, 0, length);
+      throw new RangeError.index(index, this);
     return _blink.BlinkClientRectList.instance.item_Callback_1_(this, index);
   }
 
@@ -35180,7 +35180,7 @@
 
   CssRule operator[](int index) {
     if (index < 0 || index >= length)
-      throw new RangeError.range(index, 0, length);
+      throw new RangeError.index(index, this);
     return _blink.BlinkCSSRuleList.instance.item_Callback_1_(this, index);
   }
 
@@ -35250,7 +35250,7 @@
 
   _CSSValue operator[](int index) {
     if (index < 0 || index >= length)
-      throw new RangeError.range(index, 0, length);
+      throw new RangeError.index(index, this);
     return _blink.BlinkCSSValueList.instance.item_Callback_1_(this, index);
   }
 
@@ -35592,7 +35592,7 @@
 
   Gamepad operator[](int index) {
     if (index < 0 || index >= length)
-      throw new RangeError.range(index, 0, length);
+      throw new RangeError.index(index, this);
     return _blink.BlinkGamepadList.instance.item_Callback_1_(this, index);
   }
 
@@ -35836,7 +35836,7 @@
 
   Node operator[](int index) {
     if (index < 0 || index >= length)
-      throw new RangeError.range(index, 0, length);
+      throw new RangeError.index(index, this);
     return _blink.BlinkNamedNodeMap.instance.item_Callback_1_(this, index);
   }
 
@@ -36114,7 +36114,7 @@
 
   SpeechRecognitionResult operator[](int index) {
     if (index < 0 || index >= length)
-      throw new RangeError.range(index, 0, length);
+      throw new RangeError.index(index, this);
     return _blink.BlinkSpeechRecognitionResultList.instance.item_Callback_1_(this, index);
   }
 
@@ -36182,7 +36182,7 @@
 
   StyleSheet operator[](int index) {
     if (index < 0 || index >= length)
-      throw new RangeError.range(index, 0, length);
+      throw new RangeError.index(index, this);
     return _blink.BlinkStyleSheetList.instance.item_Callback_1_(this, index);
   }
 
diff --git a/sdk/lib/internal/list.dart b/sdk/lib/internal/list.dart
index 43e7e6a..71e08f8 100644
--- a/sdk/lib/internal/list.dart
+++ b/sdk/lib/internal/list.dart
@@ -239,7 +239,7 @@
   int get length => _backedList.length;
   int elementAt(int index) {
     if (index < 0 || index >= length) {
-      throw new RangeError.range(index, 0, length);
+      throw new RangeError.index(index, this);
     }
     return index;
   }
diff --git a/sdk/lib/io/file.dart b/sdk/lib/io/file.dart
index 979d6f6..9565d4d 100644
--- a/sdk/lib/io/file.dart
+++ b/sdk/lib/io/file.dart
@@ -496,9 +496,23 @@
 
 
 /**
- * [RandomAccessFile] provides random access to the data in a
- * file. [RandomAccessFile] objects are obtained by calling the
+ * `RandomAccessFile` provides random access to the data in a
+ * file.
+ *
+ * `RandomAccessFile` objects are obtained by calling the
  * [:open:] method on a [File] object.
+ *
+ * A `RandomAccessFile` have both asynchronous and synchronous
+ * methods. The asynchronous methods all return a `Future`
+ * whereas the synchronous methods will return the result directly,
+ * and block the current isolate until the result is ready.
+ *
+ * At most one asynchronous method can be pending on a given `RandomAccessFile`
+ * instance at the time. If an asynchronous method is called when one is
+ * already in progress a [FileSystemException] is thrown.
+ *
+ * If an asynchronous method is pending it is also not possible to call any
+ * synchronous methods. This will also throw a [FileSystemException].
  */
 abstract class RandomAccessFile {
   /**
diff --git a/sdk/lib/io/secure_server_socket.dart b/sdk/lib/io/secure_server_socket.dart
index 45cb5a6..1a0bf6e 100644
--- a/sdk/lib/io/secure_server_socket.dart
+++ b/sdk/lib/io/secure_server_socket.dart
@@ -66,7 +66,8 @@
       {int backlog: 0,
        bool v6Only: false,
        bool requestClientCertificate: false,
-       bool requireClientCertificate: false}) {
+       bool requireClientCertificate: false,
+       List<String> supportedProtocols}) {
     return RawSecureServerSocket.bind(
         address,
         port,
@@ -74,7 +75,8 @@
         backlog: backlog,
         v6Only: v6Only,
         requestClientCertificate: requestClientCertificate,
-        requireClientCertificate: requireClientCertificate).then(
+        requireClientCertificate: requireClientCertificate,
+        supportedProtocols: supportedProtocols).then(
             (serverSocket) => new SecureServerSocket._(serverSocket));
   }
 
@@ -122,12 +124,14 @@
   final String certificateName;
   final bool requestClientCertificate;
   final bool requireClientCertificate;
+  final List<String> supportedProtocols;
   bool _closed = false;
 
   RawSecureServerSocket._(RawServerSocket serverSocket,
                           this.certificateName,
                           this.requestClientCertificate,
-                          this.requireClientCertificate) {
+                          this.requireClientCertificate,
+                          this.supportedProtocols) {
     _socket = serverSocket;
     _controller = new StreamController<RawSecureSocket>(
         sync: true,
@@ -187,13 +191,15 @@
       {int backlog: 0,
        bool v6Only: false,
        bool requestClientCertificate: false,
-       bool requireClientCertificate: false}) {
+       bool requireClientCertificate: false,
+       List<String> supportedProtocols}) {
     return RawServerSocket.bind(address, port, backlog: backlog, v6Only: v6Only)
         .then((serverSocket) => new RawSecureServerSocket._(
             serverSocket,
             certificateName,
             requestClientCertificate,
-            requireClientCertificate));
+            requireClientCertificate,
+            supportedProtocols));
   }
 
   StreamSubscription<RawSecureSocket> listen(void onData(RawSecureSocket s),
@@ -241,7 +247,8 @@
         is_server: true,
         socket: connection,
         requestClientCertificate: requestClientCertificate,
-        requireClientCertificate: requireClientCertificate)
+        requireClientCertificate: requireClientCertificate,
+        supportedProtocols: supportedProtocols)
     .then((RawSecureSocket secureConnection) {
       if (_closed) {
         secureConnection.close();
diff --git a/sdk/lib/io/secure_socket.dart b/sdk/lib/io/secure_socket.dart
index f11355a..ac02978 100644
--- a/sdk/lib/io/secure_socket.dart
+++ b/sdk/lib/io/secure_socket.dart
@@ -39,12 +39,14 @@
       int port,
       {bool sendClientCertificate: false,
        String certificateName,
-       bool onBadCertificate(X509Certificate certificate)}) {
+       bool onBadCertificate(X509Certificate certificate),
+       List<String> supportedProtocols}) {
     return RawSecureSocket.connect(host,
                                    port,
                                    sendClientCertificate: sendClientCertificate,
                                    certificateName: certificateName,
-                                   onBadCertificate: onBadCertificate)
+                                   onBadCertificate: onBadCertificate,
+                                   supportedProtocols: supportedProtocols)
         .then((rawSocket) => new SecureSocket._(rawSocket));
   }
 
@@ -122,7 +124,8 @@
       String certificateName,
       {List<int> bufferedData,
        bool requestClientCertificate: false,
-       bool requireClientCertificate: false}) {
+       bool requireClientCertificate: false,
+       List<String> supportedProtocols}) {
     var completer = new Completer();
     (socket as dynamic)._detachRaw()
         .then((detachedRaw) {
@@ -132,7 +135,8 @@
             subscription: detachedRaw[1],
             bufferedData: bufferedData,
             requestClientCertificate: requestClientCertificate,
-            requireClientCertificate: requireClientCertificate);
+            requireClientCertificate: requireClientCertificate,
+            supportedProtocols: supportedProtocols);
           })
         .then((raw) {
           completer.complete(new SecureSocket._(raw));
@@ -150,6 +154,11 @@
   X509Certificate get peerCertificate;
 
   /**
+   * Get the protocol which was selected during protocol negotiation.
+   */
+  String get selectedProtocol;
+
+  /**
    * Renegotiate an existing secure connection, renewing the session keys
    * and possibly changing the connection properties.
    *
@@ -245,7 +254,8 @@
       int port,
       {bool sendClientCertificate: false,
        String certificateName,
-       bool onBadCertificate(X509Certificate certificate)}) {
+       bool onBadCertificate(X509Certificate certificate),
+       List<String> supportedProtocols}) {
     _RawSecureSocket._verifyFields(
         host,
         port,
@@ -260,7 +270,8 @@
           return secure(socket,
                         sendClientCertificate: sendClientCertificate,
                         certificateName: certificateName,
-                        onBadCertificate: onBadCertificate);
+                        onBadCertificate: onBadCertificate,
+                        supportedProtocols: supportedProtocols);
         });
   }
 
@@ -298,7 +309,8 @@
        host,
        bool sendClientCertificate: false,
        String certificateName,
-       bool onBadCertificate(X509Certificate certificate)}) {
+       bool onBadCertificate(X509Certificate certificate),
+       List<String> supportedProtocols}) {
     socket.readEventsEnabled = false;
     socket.writeEventsEnabled = false;
     return  _RawSecureSocket.connect(
@@ -309,7 +321,8 @@
         socket: socket,
         subscription: subscription,
         sendClientCertificate: sendClientCertificate,
-        onBadCertificate: onBadCertificate);
+        onBadCertificate: onBadCertificate,
+        supportedProtocols: supportedProtocols);
   }
 
   /**
@@ -341,7 +354,8 @@
       {StreamSubscription subscription,
        List<int> bufferedData,
        bool requestClientCertificate: false,
-       bool requireClientCertificate: false}) {
+       bool requireClientCertificate: false,
+       List<String> supportedProtocols}) {
     socket.readEventsEnabled = false;
     socket.writeEventsEnabled = false;
     return _RawSecureSocket.connect(
@@ -353,7 +367,8 @@
         subscription: subscription,
         bufferedData: bufferedData,
         requestClientCertificate: requestClientCertificate,
-        requireClientCertificate: requireClientCertificate);
+        requireClientCertificate: requireClientCertificate,
+        supportedProtocols: supportedProtocols);
   }
 
   /**
@@ -375,6 +390,11 @@
    * [peerCertificate] will return the server's certificate.
    */
   X509Certificate get peerCertificate;
+
+  /**
+   * Get the protocol which was selected during protocol negotiation.
+   */
+  String get selectedProtocol;
 }
 
 
@@ -459,6 +479,7 @@
 
   _SecureFilter _secureFilter = new _SecureFilter();
   int _filterPointer;
+  String _selectedProtocol;
 
   static Future<_RawSecureSocket> connect(
       host,
@@ -471,7 +492,8 @@
        bool requestClientCertificate: false,
        bool requireClientCertificate: false,
        bool sendClientCertificate: false,
-       bool onBadCertificate(X509Certificate certificate)}) {
+       bool onBadCertificate(X509Certificate certificate),
+       List<String> supportedProtocols}) {
     _verifyFields(host, requestedPort, certificateName, is_server,
                  requestClientCertificate, requireClientCertificate,
                  sendClientCertificate, onBadCertificate);
@@ -488,7 +510,8 @@
                                 requestClientCertificate,
                                 requireClientCertificate,
                                 sendClientCertificate,
-                                onBadCertificate)
+                                onBadCertificate,
+                                supportedProtocols)
         ._handshakeComplete.future;
   }
 
@@ -503,7 +526,8 @@
       this.requestClientCertificate,
       this.requireClientCertificate,
       this.sendClientCertificate,
-      this.onBadCertificate(X509Certificate certificate)) {
+      this.onBadCertificate(X509Certificate certificate),
+      List<String> supportedProtocols) {
     _controller = new StreamController<RawSocketEvent>(
         sync: true,
         onListen: _onSubscriptionStateChange,
@@ -548,13 +572,136 @@
                             requestClientCertificate ||
                                 requireClientCertificate,
                             requireClientCertificate,
-                            sendClientCertificate);
+                            sendClientCertificate,
+                            _protocolsToLengthEncoding(supportedProtocols));
       _secureHandshake();
     } catch (e, s) {
       _reportError(e, s);
     }
   }
 
+  /// Encodes a set of supported protocols for ALPN/NPN usage.
+  ///
+  /// The `protocols` list is expected to contain protocols in descending order
+  /// of preference.
+  ///
+  /// See RFC 7301 (https://tools.ietf.org/html/rfc7301) for the encoding of
+  /// `List<String> protocols`:
+  ///     opaque ProtocolName<1..2^8-1>;
+  ///
+  ///     struct {
+  ///         ProtocolName protocol_name_list<2..2^16-1>
+  ///     } ProtocolNameList;
+  ///
+  /// The encoding of the opaque `ProtocolName<lower..upper>` vector is
+  /// described in RFC 2246: 4.3 Vectors.
+  ///
+  /// Note: Even though this encoding scheme would allow a total
+  /// `ProtocolNameList` length of 65535, this limit cannot be reached. Testing
+  /// showed that more than ~ 65480 bytes will fail to negogiate a protocol.
+  /// We will be conservative and support only messages up to (1<<15) -1 bytes.
+  ///
+  /// Our NSS implementation will support ALPN and NPN transparently. The
+  /// default protocol will be the first in the encoded Uint8List.
+  ///
+  /// NOTE: The NSS library will treat the first protocol as the fallback
+  /// protocol. The remaining ones are sorted in (decreasing) priority order.
+  /// We therefore put the protocol least desired to the front, to make it the
+  /// default.
+  Uint8List _protocolsToLengthEncoding(List<String> protocols) {
+    if (protocols == null || protocols.length == 0) {
+      return new Uint8List(0);
+    }
+    int protocolsLength = protocols.length;
+
+    // Calculate the number of bytes we will need if it is ASCII.
+    int expectedLength = protocolsLength;
+    for (int i = 0; i < protocolsLength; i++) {
+      int length = protocols[i].length;
+      if (length > 0 && length <= 255) {
+        expectedLength += length;
+      } else {
+        throw new ArgumentError(
+            'Length of protocol must be between 1 and 255 (was: $length).');
+      }
+    }
+
+    if (expectedLength >= (1 << 15)) {
+      throw new ArgumentError(
+          'The maximum message length supported is 2^15-1.');
+    }
+
+    // Try encoding the `List<String> protocols` array using fast ASCII path.
+    var bytes = new Uint8List(expectedLength);
+    int bytesOffset = 0;
+    for (int i = 0; i < protocolsLength; i++) {
+      // The last protocol will be encoded as the first/default one in the list.
+      // (i.e. rotate `protocols` by 1 to the right).
+      int index = i;
+      if (index == 0) index = protocols.length;
+      String proto = protocols[index - 1];
+
+      // Add length byte.
+      bytes[bytesOffset++] = proto.length;
+      int bits = 0;
+
+      // Add protocol bytes.
+      for (int j = 0; j < proto.length; j++) {
+        var char = proto.codeUnitAt(j);
+        bits |= char;
+        bytes[bytesOffset++] = char & 0xff;
+      }
+
+      // Go slow case if we have encountered anything non-ascii.
+      if (bits > 0x7f) {
+        return _protocolsToLengthEncodingNonAsciiBailout(protocols);
+      }
+    }
+    return bytes;
+  }
+
+  Uint8List _protocolsToLengthEncodingNonAsciiBailout(List<String> protocols) {
+    void addProtocol(List<int> outBytes, String protocol) {
+      var protocolBytes = UTF8.encode(protocol);
+      var len = protocolBytes.length;
+
+      if (len > 255) {
+        throw new ArgumentError(
+            'Length of protocol must be between 1 and 255 (was: $len)');
+      }
+      // Add length byte.
+      outBytes.add(len);
+
+      // Add protocol bytes.
+      outBytes.addAll(protocolBytes);
+    }
+
+    List<int> bytes = [];
+    addProtocol(bytes, protocols.last);
+    for (var i = 0; i < protocols.length -1; i++) {
+      addProtocol(bytes, protocols[i]);
+    }
+
+    if (bytes.length >= (1 << 15)) {
+      throw new ArgumentError(
+          'The maximum message length supported is 2^15-1.');
+    }
+
+    return new Uint8List.fromList(bytes);
+  }
+
+  void _addProtocolBytes(List<int> outBytes, String protocol) {
+    var protocolBytes = UTF8.encode(protocol);
+    var len = protocolBytes.length;
+
+    if (len > 255) {
+      throw new ArgumentError(
+          'Cannot support protocols with more than 255 characters');
+    }
+    outBytes.add(len);
+    outBytes.addAll(protocolBytes);
+  }
+
   StreamSubscription listen(void onData(RawSocketEvent data),
                             {Function onError,
                              void onDone(),
@@ -732,6 +879,8 @@
 
   X509Certificate get peerCertificate => _secureFilter.peerCertificate;
 
+  String get selectedProtocol => _selectedProtocol;
+
   bool _onBadCertificateWrapper(X509Certificate certificate) {
     if (onBadCertificate == null) return false;
     var result = onBadCertificate(certificate);
@@ -845,8 +994,13 @@
     _status = CONNECTED;
     if (_connectPending) {
       _connectPending = false;
-      // We don't want user code to run synchronously in this callback.
-      Timer.run(() => _handshakeComplete.complete(this));
+      try {
+        _selectedProtocol = _secureFilter.selectedProtocol();
+        // We don't want user code to run synchronously in this callback.
+        Timer.run(() => _handshakeComplete.complete(this));
+      } catch (error, stack) {
+        _handshakeComplete.completeError(error, stack);
+      }
     }
   }
 
@@ -1206,9 +1360,11 @@
                String certificateName,
                bool requestClientCertificate,
                bool requireClientCertificate,
-               bool sendClientCertificate);
+               bool sendClientCertificate,
+               Uint8List protocols);
   void destroy();
   void handshake();
+  String selectedProtocol();
   void rehandshake();
   void renegotiate(bool useSessionCache,
                    bool requestClientCertificate,
diff --git a/sdk/lib/svg/dart2js/svg_dart2js.dart b/sdk/lib/svg/dart2js/svg_dart2js.dart
index 3486ba0..bcd5d07 100644
--- a/sdk/lib/svg/dart2js/svg_dart2js.dart
+++ b/sdk/lib/svg/dart2js/svg_dart2js.dart
@@ -2683,7 +2683,7 @@
   Length operator[](int index) {
     if (JS("bool", "# >>> 0 !== # || # >= #", index,
         index, index, length))
-      throw new RangeError.range(index, 0, length);
+      throw new RangeError.index(index, this);
     return this.getItem(index);
   }
   void operator[]=(int index, Length value) {
@@ -3135,7 +3135,7 @@
   Number operator[](int index) {
     if (JS("bool", "# >>> 0 !== # || # >= #", index,
         index, index, length))
-      throw new RangeError.range(index, 0, length);
+      throw new RangeError.index(index, this);
     return this.getItem(index);
   }
   void operator[]=(int index, Number value) {
@@ -3922,7 +3922,7 @@
   PathSeg operator[](int index) {
     if (JS("bool", "# >>> 0 !== # || # >= #", index,
         index, index, length))
-      throw new RangeError.range(index, 0, length);
+      throw new RangeError.index(index, this);
     return this.getItem(index);
   }
   void operator[]=(int index, PathSeg value) {
@@ -4617,7 +4617,7 @@
   String operator[](int index) {
     if (JS("bool", "# >>> 0 !== # || # >= #", index,
         index, index, length))
-      throw new RangeError.range(index, 0, length);
+      throw new RangeError.index(index, this);
     return this.getItem(index);
   }
   void operator[]=(int index, String value) {
@@ -6077,7 +6077,7 @@
   Transform operator[](int index) {
     if (JS("bool", "# >>> 0 !== # || # >= #", index,
         index, index, length))
-      throw new RangeError.range(index, 0, length);
+      throw new RangeError.index(index, this);
     return this.getItem(index);
   }
   void operator[]=(int index, Transform value) {
diff --git a/sdk/lib/svg/dartium/svg_dartium.dart b/sdk/lib/svg/dartium/svg_dartium.dart
index 0cd0c6a..deacd52 100644
--- a/sdk/lib/svg/dartium/svg_dartium.dart
+++ b/sdk/lib/svg/dartium/svg_dartium.dart
@@ -2955,7 +2955,7 @@
 
   Length operator[](int index) {
     if (index < 0 || index >= length)
-      throw new RangeError.range(index, 0, length);
+      throw new RangeError.index(index, this);
     return getItem(index);
   }
 
@@ -3447,7 +3447,7 @@
 
   Number operator[](int index) {
     if (index < 0 || index >= length)
-      throw new RangeError.range(index, 0, length);
+      throw new RangeError.index(index, this);
     return getItem(index);
   }
 
@@ -4471,7 +4471,7 @@
 
   PathSeg operator[](int index) {
     if (index < 0 || index >= length)
-      throw new RangeError.range(index, 0, length);
+      throw new RangeError.index(index, this);
     return getItem(index);
   }
 
@@ -5241,7 +5241,7 @@
 
   String operator[](int index) {
     if (index < 0 || index >= length)
-      throw new RangeError.range(index, 0, length);
+      throw new RangeError.index(index, this);
     return getItem(index);
   }
 
@@ -6753,7 +6753,7 @@
 
   Transform operator[](int index) {
     if (index < 0 || index >= length)
-      throw new RangeError.range(index, 0, length);
+      throw new RangeError.index(index, this);
     return getItem(index);
   }
 
diff --git a/sdk/lib/web_sql/dart2js/web_sql_dart2js.dart b/sdk/lib/web_sql/dart2js/web_sql_dart2js.dart
index 163ad79..83d7a9e 100644
--- a/sdk/lib/web_sql/dart2js/web_sql_dart2js.dart
+++ b/sdk/lib/web_sql/dart2js/web_sql_dart2js.dart
@@ -218,7 +218,7 @@
   Map operator[](int index) {
     if (JS("bool", "# >>> 0 !== # || # >= #", index,
         index, index, length))
-      throw new RangeError.range(index, 0, length);
+      throw new RangeError.index(index, this);
     return this.item(index);
   }
   void operator[]=(int index, Map value) {
diff --git a/sdk/lib/web_sql/dartium/web_sql_dartium.dart b/sdk/lib/web_sql/dartium/web_sql_dartium.dart
index e976cde..9bea22c 100644
--- a/sdk/lib/web_sql/dartium/web_sql_dartium.dart
+++ b/sdk/lib/web_sql/dartium/web_sql_dartium.dart
@@ -252,7 +252,7 @@
 
   Map operator[](int index) {
     if (index < 0 || index >= length)
-      throw new RangeError.range(index, 0, length);
+      throw new RangeError.index(index, this);
     return _blink.BlinkSQLResultSetRowList.instance.item_Callback_1_(this, index);
   }
 
diff --git a/site/try/Makefile b/site/try/Makefile
index 61e2b4e..9bab88f 100644
--- a/site/try/Makefile
+++ b/site/try/Makefile
@@ -5,6 +5,6 @@
 # TODO(ahe): Convert this to GYP.
 
 all:
-	../../sdk/bin/dart -Dlist_all_libraries=true ../../sdk/lib/_internal/compiler/samples/jsonify/jsonify.dart sdk.dart
+	../../sdk/bin/dart -Dlist_all_libraries=true ../../pkg/compiler/samples/jsonify/jsonify.dart sdk.dart
 	../../sdk/bin/dart jsonify.dart > sdk.json
 	../../sdk/bin/dart2js -Denable_ir=false leap.dart -oleap.dart.js
diff --git a/site/try/build_try.gyp b/site/try/build_try.gyp
index 1638810..c003fb0 100644
--- a/site/try/build_try.gyp
+++ b/site/try/build_try.gyp
@@ -75,7 +75,7 @@
             # This dependency is redundant for now, as this directory is
             # implicitly part of the dependencies for dart-sdk/README.
             '<!@(["python", "../../tools/list_files.py", "\\.dart$", '
-                 '"../../sdk/lib/_internal/compiler/samples/jsonify"])',
+                 '"../../pkg/compiler/samples/jsonify"])',
           ],
           'outputs': [
             '<(SHARED_INTERMEDIATE_DIR)/sdk.json',
@@ -87,7 +87,8 @@
 
             '-Dlist_all_libraries=true',
             '-DoutputJson=true',
-            '../../sdk/lib/_internal/compiler/samples/jsonify/jsonify.dart',
+            '--package-root=<(PRODUCT_DIR)/packages/',
+            '../../pkg/compiler/samples/jsonify/jsonify.dart',
             '<(SHARED_INTERMEDIATE_DIR)/sdk.json',
           ],
         },
diff --git a/site/try/poi/Makefile b/site/try/poi/Makefile
index de3d59e..82f4bc2 100644
--- a/site/try/poi/Makefile
+++ b/site/try/poi/Makefile
@@ -21,14 +21,14 @@
 	| grep -v DEPRECATED_MEMBER_USE \
 	| grep -v DEAD_CODE \
 	| grep -v -E 'INFO\|HINT\|ARGUMENT_TYPE_NOT_ASSIGNABLE\|' \
-	| grep -v -E 'INFO\|HINT\|UNUSED_IMPORT\|.*/compiler/implementation/cps_ir/optimizers\.dart\|7\|8\|27\|' \
-	| grep -v -E 'INFO\|HINT\|UNUSED_IMPORT\|.*/compiler/implementation/dart2jslib\.dart\|26\|8\|22\|' \
-	| grep -v -E 'INFO\|HINT\|UNUSED_IMPORT\|.*/compiler/implementation/dart_types\.dart\|17\|8\|22\|' \
-	| grep -v -E 'INFO\|HINT\|UNUSED_IMPORT\|.*/compiler/implementation/elements/elements\.dart\|[0-9]+\|8\|25\|' \
-	| grep -v -E 'INFO\|HINT\|UNUSED_IMPORT\|.*/compiler/implementation/elements/modelx\.dart\|[0-9]+\|8\|25\|' \
-	| grep -v -E 'INFO\|HINT\|UNUSED_IMPORT\|.*/compiler/implementation/js_emitter/js_emitter\.dart\|[0-9]+\|8\|25\|' \
-	| grep -v -E 'INFO\|HINT\|UNUSED_IMPORT\|.*/compiler/implementation/library_loader\.dart\|25\|8\|22\|' \
-	| grep -v -E 'INFO\|HINT\|UNUSED_IMPORT\|.*/compiler/implementation/patch_parser\.dart\|[0-9]+\|8\|22\|' \
-	| grep -v -E 'INFO\|HINT\|UNUSED_IMPORT\|.*/compiler/implementation/resolution/class_members\.dart\|22\|8\|25\|' \
+	| grep -v -E 'INFO\|HINT\|UNUSED_IMPORT\|.*/compiler/src/cps_ir/optimizers\.dart\|7\|8\|27\|' \
+	| grep -v -E 'INFO\|HINT\|UNUSED_IMPORT\|.*/compiler/src/dart2jslib\.dart\|26\|8\|22\|' \
+	| grep -v -E 'INFO\|HINT\|UNUSED_IMPORT\|.*/compiler/src/dart_types\.dart\|17\|8\|22\|' \
+	| grep -v -E 'INFO\|HINT\|UNUSED_IMPORT\|.*/compiler/src/elements/elements\.dart\|[0-9]+\|8\|25\|' \
+	| grep -v -E 'INFO\|HINT\|UNUSED_IMPORT\|.*/compiler/src/elements/modelx\.dart\|[0-9]+\|8\|25\|' \
+	| grep -v -E 'INFO\|HINT\|UNUSED_IMPORT\|.*/compiler/src/js_emitter/js_emitter\.dart\|[0-9]+\|8\|25\|' \
+	| grep -v -E 'INFO\|HINT\|UNUSED_IMPORT\|.*/compiler/src/library_loader\.dart\|25\|8\|22\|' \
+	| grep -v -E 'INFO\|HINT\|UNUSED_IMPORT\|.*/compiler/src/patch_parser\.dart\|[0-9]+\|8\|22\|' \
+	| grep -v -E 'INFO\|HINT\|UNUSED_IMPORT\|.*/compiler/src/resolution/class_members\.dart\|22\|8\|25\|' \
 	| sed -e "s,$(PWD)/,," \
 	| awk -F'|' '{print $$4 ":" $$5 ":" $$6 ":\n [" n$$3 "]" $$8 }' \
diff --git a/site/try/poi/poi.dart b/site/try/poi/poi.dart
index cdc400c..0261ba5 100644
--- a/site/try/poi/poi.dart
+++ b/site/try/poi/poi.dart
@@ -19,22 +19,22 @@
 import 'package:dart2js_incremental/library_updater.dart' show
     LibraryUpdater;
 
-import 'package:compiler/implementation/source_file_provider.dart' show
+import 'package:compiler/src/source_file_provider.dart' show
     FormattingDiagnosticHandler;
 
 import 'package:compiler/compiler.dart' as api;
 
-import 'package:compiler/implementation/dart2jslib.dart' show
+import 'package:compiler/src/dart2jslib.dart' show
     Compiler,
     CompilerTask,
     Enqueuer,
     QueueFilter,
     WorkItem;
 
-import 'package:compiler/implementation/elements/visitor.dart' show
+import 'package:compiler/src/elements/visitor.dart' show
     ElementVisitor;
 
-import 'package:compiler/implementation/elements/elements.dart' show
+import 'package:compiler/src/elements/elements.dart' show
     AbstractFieldElement,
     ClassElement,
     CompilationUnitElement,
@@ -44,15 +44,15 @@
     LibraryElement,
     ScopeContainerElement;
 
-import 'package:compiler/implementation/elements/modelx.dart' as modelx;
+import 'package:compiler/src/elements/modelx.dart' as modelx;
 
-import 'package:compiler/implementation/elements/modelx.dart' show
+import 'package:compiler/src/elements/modelx.dart' show
     DeclarationSite;
 
-import 'package:compiler/implementation/dart_types.dart' show
+import 'package:compiler/src/dart_types.dart' show
     DartType;
 
-import 'package:compiler/implementation/scanner/scannerlib.dart' show
+import 'package:compiler/src/scanner/scannerlib.dart' show
     EOF_TOKEN,
     IDENTIFIER_TOKEN,
     KEYWORD_TOKEN,
@@ -60,7 +60,7 @@
     PartialElement,
     Token;
 
-import 'package:compiler/implementation/js/js.dart' show
+import 'package:compiler/src/js/js.dart' show
     js;
 
 /// Enabled by the option --enable-dart-mind.  Controls if this program should
@@ -397,22 +397,35 @@
     options.add('--minify');
   }
 
-  LibraryUpdater updater =
-      new LibraryUpdater(
-          cachedCompiler, inputProvider, script, printWallClock, printVerbose);
+  LibraryUpdater updater;
+
   Future<bool> reuseLibrary(LibraryElement library) {
     return poiTask.measure(() => updater.reuseLibrary(library));
   }
 
-  return reuseCompiler(
-      diagnosticHandler: handler,
-      inputProvider: inputProvider,
-      options: options,
-      cachedCompiler: cachedCompiler,
-      libraryRoot: libraryRoot,
-      packageRoot: packageRoot,
-      packagesAreImmutable: true,
-      reuseLibrary: reuseLibrary).then((Compiler newCompiler) {
+  Future<Compiler> invokeReuseCompiler() {
+    updater = new LibraryUpdater(
+        cachedCompiler, inputProvider, script, printWallClock, printVerbose);
+    return reuseCompiler(
+        diagnosticHandler: handler,
+        inputProvider: inputProvider,
+        options: options,
+        cachedCompiler: cachedCompiler,
+        libraryRoot: libraryRoot,
+        packageRoot: packageRoot,
+        packagesAreImmutable: true,
+        reuseLibrary: reuseLibrary);
+  }
+
+  return invokeReuseCompiler().then((Compiler newCompiler) {
+    // TODO(ahe): Move this "then" block to [reuseCompiler].
+    if (updater.failed) {
+      cachedCompiler = null;
+      return invokeReuseCompiler();
+    } else {
+      return newCompiler;
+    }
+  }).then((Compiler newCompiler) {
     if (!isCompiler) {
       newCompiler.enqueuerFilter = new ScriptOnlyFilter(script);
     }
diff --git a/site/try/src/compiler_isolate.dart b/site/try/src/compiler_isolate.dart
index 8d5ff43..a969ca1 100644
--- a/site/try/src/compiler_isolate.dart
+++ b/site/try/src/compiler_isolate.dart
@@ -16,7 +16,7 @@
 import 'package:dart2js_incremental/dart2js_incremental.dart' show
     reuseCompiler;
 
-import 'package:compiler/implementation/dart2jslib.dart' show
+import 'package:compiler/src/dart2jslib.dart' show
     Compiler;
 
 const bool THROW_ON_ERROR = false;
diff --git a/site/try/src/editor.dart b/site/try/src/editor.dart
index b80296b..1345404 100644
--- a/site/try/src/editor.dart
+++ b/site/try/src/editor.dart
@@ -6,7 +6,7 @@
 
 import 'dart:html';
 
-import 'package:compiler/implementation/scanner/scannerlib.dart' show
+import 'package:compiler/src/scanner/scannerlib.dart' show
     EOF_TOKEN,
     ErrorToken,
     StringScanner,
diff --git a/site/try/src/interaction_manager.dart b/site/try/src/interaction_manager.dart
index 2dc2aa8..57cf459 100644
--- a/site/try/src/interaction_manager.dart
+++ b/site/try/src/interaction_manager.dart
@@ -21,7 +21,7 @@
 import 'dart:collection' show
     Queue;
 
-import 'package:compiler/implementation/scanner/scannerlib.dart' show
+import 'package:compiler/src/scanner/scannerlib.dart' show
     BeginGroupToken,
     EOF_TOKEN,
     ErrorToken,
@@ -33,13 +33,13 @@
     UnmatchedToken,
     UnterminatedToken;
 
-import 'package:compiler/implementation/source_file.dart' show
+import 'package:compiler/src/source_file.dart' show
     StringSourceFile;
 
-import 'package:compiler/implementation/string_validator.dart' show
+import 'package:compiler/src/string_validator.dart' show
     StringValidator;
 
-import 'package:compiler/implementation/tree/tree.dart' show
+import 'package:compiler/src/tree/tree.dart' show
     StringQuoting;
 
 import 'compilation.dart' show
diff --git a/tests/co19/co19-analyzer2.status b/tests/co19/co19-analyzer2.status
index 605504a..e7124c5 100644
--- a/tests/co19/co19-analyzer2.status
+++ b/tests/co19/co19-analyzer2.status
@@ -9,10 +9,6 @@
 # TBF: infinite look: class A {const A();final m = const A();}
 Language/12_Expressions/01_Constants_A17_t03: fail
 
-# TBF: when we override "foo([x = 0]) {}" with "foo([x]) {}" we should report warning - different default value
-Language/07_Classes/1_Instance_Methods_A04_t02: MissingStaticWarning
-Language/07_Classes/4_Abstract_Instance_Members_A07_t04: MissingStaticWarning
-
 # TBF: Static members should not be accessible via subclasses.
 Language/07_Classes/9_Superclasses/1_Inheritance_and_Overriding_A01_t05: MissingStaticWarning
 
@@ -191,7 +187,6 @@
 WebPlatformTest/dom/nodes/Node-parentNode_t01: StaticWarning # co19-roll r722: Please triage this failure.
 
 # co19-roll r738
-Language/07_Classes/4_Abstract_Instance_Members_A07_t02: MissingStaticWarning # co19-roll r738: Please triage this failure.
 Language/07_Classes/07_Classes_A03_t06: MissingStaticWarning # co19-roll r738: Please triage this failure.
 LayoutTests/fast/dom/StyleSheet/detached-parent-rule-without-wrapper_t01: StaticWarning # co19-roll r738: Please triage this failure.
 LayoutTests/fast/dom/StyleSheet/detached-stylesheet-without-wrapper_t01: StaticWarning # co19-roll r738: Please triage this failure.
diff --git a/tests/co19/co19-dart2dart.status b/tests/co19/co19-dart2dart.status
index 15a7ac0..02ccf9f 100644
--- a/tests/co19/co19-dart2dart.status
+++ b/tests/co19/co19-dart2dart.status
@@ -9,6 +9,7 @@
 
 [ $compiler == dart2dart && $builder_tag != new_backend ]
 Language/12_Expressions/18_Assignment_A04_t09: RuntimeError # co19-roll r667: Please triage this failure
+Language/13_Statements/12_Labels_A01_t03: fail # co19-roll r546: Please triage this failure
 
 [ $compiler == dart2dart ]
 Language/07_Classes/07_Classes_A13_t02: Fail # Missing CT error on member with same name a type parameter
@@ -101,7 +102,6 @@
 Language/12_Expressions/30_Identifier_Reference_A02_t01: fail # co19-roll r546: Please triage this failure
 Language/13_Statements/02_Expression_Statements_A01_t08: fail # co19-roll r546: Please triage this failure
 Language/13_Statements/09_Switch_A01_t02: fail # co19-roll r546: Please triage this failure
-Language/13_Statements/12_Labels_A01_t03: fail # co19-roll r546: Please triage this failure
 Language/14_Libraries_and_Scripts/1_Imports_A03_t08: fail # co19-roll r546: Please triage this failure
 Language/14_Libraries_and_Scripts/1_Imports_A03_t09: fail # co19-roll r546: Please triage this failure
 Language/14_Libraries_and_Scripts/1_Imports_A03_t10: fail # co19-roll r546: Please triage this failure
diff --git a/tests/co19/co19-dartium.status b/tests/co19/co19-dartium.status
index 4b68427..baab387 100644
--- a/tests/co19/co19-dartium.status
+++ b/tests/co19/co19-dartium.status
@@ -2,6 +2,20 @@
 # 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.
 
+[ $compiler == none && $runtime == drt ]
+*: Skip # running co19 tests on content_shell would make our dartium cycle-times very long
+
+[ $compiler == none && $runtime == dartium && $system == macos ]
+LayoutTests/fast/writing-mode/broken-ideographic-font_t01: Skip # Timing out on the bots
+
+[ $compiler == none && $mode == debug && ($runtime == drt || $runtime == dartium || $runtime == ContentShellOnAndroid) ]
+LayoutTests/fast/canvas/canvas-lineDash-input-sequence_t01: Skip # Issue 20867
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-video-rgba4444_t01: Skip # Issue 20540
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-video-rgb565_t01: Skip # Issue 20540
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-video-rgba5551_t01: Skip # Issue 20540
+LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-video_t01: Skip # Issue 20540
+
+[ $compiler == none && ($runtime == dartium || $runtime == ContentShellOnAndroid) ]
 LayoutTests/fast/borders/border-radius-child_t01: Skip # co19 issue 732.
 LayoutTests/fast/css-generated-content/hit-test-generated-content_t01: Skip # co19 issue 732.
 LayoutTests/fast/css/collapsed-whitespace-reattach-in-style-recalc_t01: Skip # co19 issue 732.
@@ -17,21 +31,6 @@
 LayoutTests/fast/sub-pixel/size-of-span-with-different-positions_t01: Skip # co19 issue 732.
 LayoutTests/fast/text/international/complex-text-rectangle_t01: Skip # co19 issue 732.
 LayoutTests/fast/text/line-breaks-after-hyphen-before-number_t01: Skip # co19 issue 732.
-
-[ $compiler == none && $runtime == drt ]
-*: Skip # running co19 tests on content_shell would make our dartium cycle-times very long
-
-[ $compiler == none && $runtime == dartium && $system == macos ]
-LayoutTests/fast/writing-mode/broken-ideographic-font_t01: Skip # Timing out on the bots
-
-[ $compiler == none && $mode == debug && ($runtime == drt || $runtime == dartium || $runtime == ContentShellOnAndroid) ]
-LayoutTests/fast/canvas/canvas-lineDash-input-sequence_t01: Skip # Issue 20867
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-video-rgba4444_t01: Skip # Issue 20540
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-video-rgb565_t01: Skip # Issue 20540
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-video-rgba5551_t01: Skip # Issue 20540
-LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-video_t01: Skip # Issue 20540
-
-[ $compiler == none && ($runtime == dartium || $runtime == ContentShellOnAndroid) ]
 LibTest/html/Window/document_A01_t01: RuntimeError # Issue 20146
 LibTest/html/Window/postMessage_A01_t02: RuntimeError # Issue 20146
 LibTest/html/Window/moveBy_A01_t01: RuntimeError # Issue 20146
@@ -897,7 +896,7 @@
 LayoutTests/fast/text-autosizing/text-removal_t01: RuntimeError # co19-roll r786: Please triage this failure.
 LayoutTests/fast/transforms/scrollIntoView-transformed_t01: RuntimeError # co19-roll r786: Please triage this failure.
 LayoutTests/fast/dom/partial-layout-overlay-scrollbars_t01: Pass, RuntimeError # Reenable fast/dom tests: Please triage this failure.
-LayoutTests/fast/dom/partial-layout-non-overlay-scrollbars_t01: RuntimeError # Reenable fast/dom tests: Please triage this failure.
+LayoutTests/fast/dom/partial-layout-non-overlay-scrollbars_t01: Pass, RuntimeError # Reenable fast/dom tests: Please triage this failure.
 LayoutTests/fast/dom/shadow/shadowdom-for-input-type-change_t01: RuntimeError # Reenable fast/dom tests: Please triage this failure.
 LayoutTests/fast/dom/jsDevicePixelRatio_t01: RuntimeError # Reenable fast/dom tests: Please triage this failure.
 LayoutTests/fast/dom/HTMLLinkElement/prefetch-beforeload_t01: Pass, RuntimeError # Reenable fast/dom tests: Please triage this failure.
diff --git a/tests/compiler/dart2js/analyze_dart2js_test.dart b/tests/compiler/dart2js/analyze_dart2js_test.dart
index d17f15e..5fb720d 100644
--- a/tests/compiler/dart2js/analyze_dart2js_test.dart
+++ b/tests/compiler/dart2js/analyze_dart2js_test.dart
@@ -5,7 +5,7 @@
 library analyze_dart2js;
 
 import "package:expect/expect.dart";
-import 'package:compiler/implementation/filenames.dart';
+import 'package:compiler/src/filenames.dart';
 import 'analyze_helper.dart';
 import "package:async_helper/async_helper.dart";
 
@@ -24,7 +24,6 @@
 };
 
 void main() {
-  var uri = currentDirectory.resolve(
-      'sdk/lib/_internal/compiler/implementation/dart2js.dart');
+  var uri = currentDirectory.resolve('pkg/compiler/lib/src/dart2js.dart');
   asyncTest(() => analyze([uri], WHITE_LIST));
 }
diff --git a/tests/compiler/dart2js/analyze_helper.dart b/tests/compiler/dart2js/analyze_helper.dart
index 89f00c6..62de389 100644
--- a/tests/compiler/dart2js/analyze_helper.dart
+++ b/tests/compiler/dart2js/analyze_helper.dart
@@ -7,12 +7,12 @@
 import 'dart:async';
 import 'dart:io';
 import 'package:compiler/compiler.dart' as api;
-import 'package:compiler/implementation/apiimpl.dart';
-import 'package:compiler/implementation/dart2jslib.dart'
+import 'package:compiler/src/apiimpl.dart';
+import 'package:compiler/src/dart2jslib.dart'
     hide Compiler;
-import 'package:compiler/implementation/filenames.dart';
-import 'package:compiler/implementation/source_file_provider.dart';
-import 'package:compiler/implementation/util/uri_extras.dart';
+import 'package:compiler/src/filenames.dart';
+import 'package:compiler/src/source_file_provider.dart';
+import 'package:compiler/src/util/uri_extras.dart';
 
 /**
  * Map of whitelisted warnings and errors.
@@ -142,7 +142,7 @@
   print("""
 
 
-=== 
+===
 === NOTE: If this test fails, update [WHITE_LIST] in $testFileName
 ===
 
@@ -150,6 +150,8 @@
 """);
 
   var libraryRoot = currentDirectory.resolve('sdk/');
+  var packageRoot =
+      currentDirectory.resolveUri(new Uri.file('${Platform.packageRoot}/'));
   var provider = new CompilerSourceFileProvider();
   var handler = new CollectingDiagnosticHandler(whiteList, provider);
   var options = <String>['--analyze-only', '--categories=Client,Server'];
@@ -158,17 +160,17 @@
       provider.readStringFromUri,
       null,
       handler.diagnosticHandler,
-      libraryRoot, libraryRoot,
+      libraryRoot, packageRoot,
       options,
       {});
   String MESSAGE = """
 
 
-=== 
+===
 === ERROR: Unexpected result of analysis.
-=== 
+===
 === Please update [WHITE_LIST] in $testFileName
-=== 
+===
 """;
 
   void onCompletion(_) {
diff --git a/tests/compiler/dart2js/analyze_only_test.dart b/tests/compiler/dart2js/analyze_only_test.dart
index 81b46db..38f0101 100644
--- a/tests/compiler/dart2js/analyze_only_test.dart
+++ b/tests/compiler/dart2js/analyze_only_test.dart
@@ -12,7 +12,7 @@
 import '../../utils/dummy_compiler_test.dart' as dummy;
 import 'package:compiler/compiler.dart';
 
-import 'package:compiler/implementation/dart2jslib.dart' show
+import 'package:compiler/src/dart2jslib.dart' show
     MessageKind;
 
 runCompiler(String main, List<String> options,
diff --git a/tests/compiler/dart2js/analyze_unused_dart2js_test.dart b/tests/compiler/dart2js/analyze_unused_dart2js_test.dart
index e286776..570b528 100644
--- a/tests/compiler/dart2js/analyze_unused_dart2js_test.dart
+++ b/tests/compiler/dart2js/analyze_unused_dart2js_test.dart
@@ -6,8 +6,8 @@
 
 import 'package:async_helper/async_helper.dart';
 
-import 'package:compiler/implementation/dart2jslib.dart';
-import 'package:compiler/implementation/filenames.dart';
+import 'package:compiler/src/dart2jslib.dart';
+import 'package:compiler/src/filenames.dart';
 
 import 'analyze_helper.dart';
 
@@ -15,34 +15,30 @@
 // unused members refers to WHITE_LIST by name.
 const Map<String, List<String>> WHITE_LIST = const {
   // Helper methods for debugging should never be called from production code:
-  "implementation/helpers/": const [" is never "],
+  "lib/src/helpers/": const [" is never "],
 
   // Node.asLiteralBool is never used.
-  "implementation/tree/nodes.dart": const [
+  "lib/src/tree/nodes.dart": const [
       "The method 'asLiteralBool' is never called"],
 
   // Some things in dart_printer are not yet used
-  "implementation/dart_backend/backend_ast_nodes.dart": const [" is never "],
-
-  // dart2js uses only the encoding functions, the decoding functions are used
-  // from the generated code.
-  "js_lib/shared/runtime_data.dart": const [" is never "],
+  "lib/src/dart_backend/backend_ast_nodes.dart": const [" is never "],
 
   // MethodElement
   // TODO(20377): Why is MethodElement unused?
-  "implementation/elements/elements.dart": const [" is never "]
+  "lib/src/elements/elements.dart": const [" is never "]
 };
 
 void main() {
   var uri = currentDirectory.resolve(
-      'sdk/lib/_internal/compiler/implementation/use_unused_api.dart');
+      'pkg/compiler/lib/src/use_unused_api.dart');
   asyncTest(() => analyze([uri], WHITE_LIST,
       analyzeAll: false, checkResults: checkResults));
 }
 
 bool checkResults(Compiler compiler, CollectingDiagnosticHandler handler) {
   var helperUri = currentDirectory.resolve(
-      'sdk/lib/_internal/compiler/implementation/helpers/helpers.dart');
+      'pkg/compiler/lib/src/helpers/helpers.dart');
   void checkLive(member) {
     if (member.isFunction) {
       if (compiler.enqueuer.resolution.hasBeenResolved(member)) {
diff --git a/tests/compiler/dart2js/async_compiler_input_provider_test.dart b/tests/compiler/dart2js/async_compiler_input_provider_test.dart
index 4ebe2ab..c7bc35b 100644
--- a/tests/compiler/dart2js/async_compiler_input_provider_test.dart
+++ b/tests/compiler/dart2js/async_compiler_input_provider_test.dart
@@ -9,7 +9,7 @@
 import "package:async_helper/async_helper.dart";
 
 import 'package:compiler/compiler.dart' as compiler;
-import 'package:compiler/implementation/filenames.dart';
+import 'package:compiler/src/filenames.dart';
 
 const SOURCES = const {
   "/main.dart": """
diff --git a/tests/compiler/dart2js/backend_dart/dart_backend_test.dart b/tests/compiler/dart2js/backend_dart/dart_backend_test.dart
index dbe4068..7392142 100644
--- a/tests/compiler/dart2js/backend_dart/dart_backend_test.dart
+++ b/tests/compiler/dart2js/backend_dart/dart_backend_test.dart
@@ -8,10 +8,10 @@
 import '../mock_compiler.dart';
 import '../mock_libraries.dart';
 import 'package:compiler/compiler.dart';
-import 'package:compiler/implementation/dart2jslib.dart' as leg;
-import 'package:compiler/implementation/dart_backend/dart_backend.dart';
-import 'package:compiler/implementation/elements/elements.dart';
-import 'package:compiler/implementation/tree/tree.dart';
+import 'package:compiler/src/dart2jslib.dart' as leg;
+import 'package:compiler/src/dart_backend/dart_backend.dart';
+import 'package:compiler/src/elements/elements.dart';
+import 'package:compiler/src/tree/tree.dart';
 
 const ioLib = r'''
 library io;
diff --git a/tests/compiler/dart2js/backend_dart/dart_new_backend_test.dart b/tests/compiler/dart2js/backend_dart/dart_new_backend_test.dart
index 62c6ca8..0861957 100644
--- a/tests/compiler/dart2js/backend_dart/dart_new_backend_test.dart
+++ b/tests/compiler/dart2js/backend_dart/dart_new_backend_test.dart
@@ -5,9 +5,9 @@
 import '../compiler_helper.dart';
 import 'dart:async';
 import 'package:async_helper/async_helper.dart';
-import 'package:compiler/implementation/dart2jslib.dart';
-import 'package:compiler/implementation/dart_backend/dart_backend.dart';
-import 'package:compiler/implementation/dart_backend/backend_ast_to_frontend_ast.dart'
+import 'package:compiler/src/dart2jslib.dart';
+import 'package:compiler/src/dart_backend/dart_backend.dart';
+import 'package:compiler/src/dart_backend/backend_ast_to_frontend_ast.dart'
     show INSERT_NEW_BACKEND_COMMENT;
 
 const String TestStaticField = """
diff --git a/tests/compiler/dart2js/backend_dart/dart_printer_test.dart b/tests/compiler/dart2js/backend_dart/dart_printer_test.dart
index f278080..dc6219f 100644
--- a/tests/compiler/dart2js/backend_dart/dart_printer_test.dart
+++ b/tests/compiler/dart2js/backend_dart/dart_printer_test.dart
@@ -5,16 +5,16 @@
 library dart_printer_test;
 
 import "package:expect/expect.dart";
-import 'package:compiler/implementation/constants/values.dart';
-import 'package:compiler/implementation/dart_backend/backend_ast_nodes.dart';
-import 'package:compiler/implementation/scanner/scannerlib.dart';
-import 'package:compiler/implementation/source_file.dart';
-import 'package:compiler/implementation/dart2jslib.dart';
-import 'package:compiler/implementation/tree/tree.dart' show DartString;
+import 'package:compiler/src/constants/values.dart';
+import 'package:compiler/src/dart_backend/backend_ast_nodes.dart';
+import 'package:compiler/src/scanner/scannerlib.dart';
+import 'package:compiler/src/source_file.dart';
+import 'package:compiler/src/dart2jslib.dart';
+import 'package:compiler/src/tree/tree.dart' show DartString;
 import 'dart:mirrors';
-import 'package:compiler/implementation/tree/tree.dart' as tree;
-import 'package:compiler/implementation/string_validator.dart';
-import 'package:compiler/implementation/dart_backend/backend_ast_to_frontend_ast.dart'
+import 'package:compiler/src/tree/tree.dart' as tree;
+import 'package:compiler/src/string_validator.dart';
+import 'package:compiler/src/dart_backend/backend_ast_to_frontend_ast.dart'
     show TreePrinter;
 
 /// For debugging the [AstBuilder] stack. Prints information about [x].
diff --git a/tests/compiler/dart2js/backend_dart/end2end_test.dart b/tests/compiler/dart2js/backend_dart/end2end_test.dart
index 1808d6b..f5f778f 100644
--- a/tests/compiler/dart2js/backend_dart/end2end_test.dart
+++ b/tests/compiler/dart2js/backend_dart/end2end_test.dart
@@ -6,8 +6,8 @@
 library dart_backend.end2end_test;

 

 import 'package:async_helper/async_helper.dart';

-import 'package:compiler/implementation/dart2jslib.dart';

-import 'package:compiler/implementation/dart_backend/dart_backend.dart';

+import 'package:compiler/src/dart2jslib.dart';

+import 'package:compiler/src/dart_backend/dart_backend.dart';

 import 'package:expect/expect.dart';

 

 import '../../../../pkg/analyzer2dart/test/test_helper.dart' hide TestSpec;

diff --git a/tests/compiler/dart2js/backend_dart/opt_constprop_test.dart b/tests/compiler/dart2js/backend_dart/opt_constprop_test.dart
index 84262cb..cb158e78 100644
--- a/tests/compiler/dart2js/backend_dart/opt_constprop_test.dart
+++ b/tests/compiler/dart2js/backend_dart/opt_constprop_test.dart
@@ -7,9 +7,9 @@
 import 'sexpr_unstringifier.dart';
 import 'package:async_helper/async_helper.dart';
 import "package:expect/expect.dart";
-import 'package:compiler/implementation/cps_ir/cps_ir_nodes_sexpr.dart';
-import 'package:compiler/implementation/cps_ir/optimizers.dart';
-import 'package:compiler/implementation/dart2jslib.dart' as dart2js;
+import 'package:compiler/src/cps_ir/cps_ir_nodes_sexpr.dart';
+import 'package:compiler/src/cps_ir/optimizers.dart';
+import 'package:compiler/src/dart2jslib.dart' as dart2js;
 
 // The tests in this file that ensure that sparse constant propagation on the
 // CPS IR works as expected.
diff --git a/tests/compiler/dart2js/backend_dart/opt_redundant_phi_test.dart b/tests/compiler/dart2js/backend_dart/opt_redundant_phi_test.dart
index 9e6ed7f..1d84848 100644
--- a/tests/compiler/dart2js/backend_dart/opt_redundant_phi_test.dart
+++ b/tests/compiler/dart2js/backend_dart/opt_redundant_phi_test.dart
@@ -4,9 +4,9 @@
 
 import 'sexpr_unstringifier.dart';
 import "package:expect/expect.dart";
-import 'package:compiler/implementation/cps_ir/cps_ir_nodes.dart';
-import 'package:compiler/implementation/cps_ir/cps_ir_nodes_sexpr.dart';
-import 'package:compiler/implementation/cps_ir/optimizers.dart';
+import 'package:compiler/src/cps_ir/cps_ir_nodes.dart';
+import 'package:compiler/src/cps_ir/cps_ir_nodes_sexpr.dart';
+import 'package:compiler/src/cps_ir/optimizers.dart';
 
 // The 'read in loop' IR tests the most basic case of redundant phi removal
 // and represents the following source code:
@@ -192,7 +192,7 @@
 // Ensures that continuations which are never invoked are not optimized.
 // IR written by hand.
 
-String NEVER_INVOKED1_IN = """
+String NEVER_INVOKED_IN = """
 (FunctionDefinition main ( return)
   (LetPrim v0 (Constant IntConstant(0)))
   (LetCont (k0 v1)
@@ -200,31 +200,7 @@
   (InvokeContinuation return v0))
 """;
 
-String NEVER_INVOKED1_OUT = NEVER_INVOKED1_IN;
-
-// As in the previous test, except with the added wrinkle of higher order
-// continuations.
-
-String NEVER_INVOKED2_IN = """
-(FunctionDefinition main ( return)
-  (LetCont (k0 v0)
-    (InvokeStatic print v0 return))
-  (InvokeContinuation return k0))
-""";
-
-String NEVER_INVOKED2_OUT = NEVER_INVOKED2_IN;
-
-// As in the previous test, but the continuation is invoked as well as passed
-// as an argument.
-
-String AS_ARG_IN = """
-(FunctionDefinition main ( return)
-  (LetCont (k0 v0)
-    (InvokeStatic print v0 return))
-  (InvokeContinuation k0 k0))
-""";
-
-String AS_ARG_OUT = AS_ARG_IN;
+String NEVER_INVOKED_OUT = NEVER_INVOKED_IN;
 
 /// Normalizes whitespace by replacing all whitespace sequences by a single
 /// space and trimming leading and trailing whitespace.
@@ -253,7 +229,5 @@
   testRedundantPhi(INNER_LOOP_IN, INNER_LOOP_OUT);
   testRedundantPhi(BASIC_LOOP_IN, BASIC_LOOP_OUT);
   testRedundantPhi(SCOPING_IN, SCOPING_OUT);
-  testRedundantPhi(NEVER_INVOKED1_IN, NEVER_INVOKED1_OUT);
-  testRedundantPhi(NEVER_INVOKED2_IN, NEVER_INVOKED2_OUT);
-  testRedundantPhi(AS_ARG_IN, AS_ARG_OUT);
+  testRedundantPhi(NEVER_INVOKED_IN, NEVER_INVOKED_OUT);
 }
diff --git a/tests/compiler/dart2js/backend_dart/opt_shrinking_test.dart b/tests/compiler/dart2js/backend_dart/opt_shrinking_test.dart
index bf4a3b9..4b3fc39 100644
--- a/tests/compiler/dart2js/backend_dart/opt_shrinking_test.dart
+++ b/tests/compiler/dart2js/backend_dart/opt_shrinking_test.dart
@@ -4,9 +4,9 @@
 
 import 'sexpr_unstringifier.dart';
 import "package:expect/expect.dart";
-import 'package:compiler/implementation/cps_ir/cps_ir_nodes.dart';
-import 'package:compiler/implementation/cps_ir/cps_ir_nodes_sexpr.dart';
-import 'package:compiler/implementation/cps_ir/optimizers.dart';
+import 'package:compiler/src/cps_ir/cps_ir_nodes.dart';
+import 'package:compiler/src/cps_ir/cps_ir_nodes_sexpr.dart';
+import 'package:compiler/src/cps_ir/optimizers.dart';
 
 // The tests in this file that ensure shrinking reductions work as expected.
 // Reductions and their corresponding names are taken from
@@ -135,17 +135,6 @@
   (InvokeStatic print v0 k0))
 """;
 
-// Beta-cont-lin with continuation passed as arg in invoke. IR written by hand.
-
-String ARG_BETA_CONT_LIN_IN = """
-(FunctionDefinition main ( return)
-  (LetCont (k0 v0)
-    (LetPrim v1 (Constant IntConstant(0)))
-    (InvokeStatic print v1 return))
-  (InvokeContinuation return k0))
-""";
-String ARG_BETA_CONT_LIN_OUT = ARG_BETA_CONT_LIN_IN;
-
 // Beta-cont-lin with recursive continuation. IR written by hand.
 
 String RECURSIVE_BETA_CONT_LIN_IN = """
@@ -161,17 +150,18 @@
 
 String USED_BETA_CONT_LIN_IN = """
 (FunctionDefinition main ( return)
-  (LetCont (k0 v0)
-    (LetCont (k1 v1)
-      (LetCont (k2 v2) (LetPrim v3 (Constant IntConstant(0)))
-        (InvokeContinuation return v3))
-      (InvokeStatic print v0 k2))
-    (InvokeStatic print v0 k1))
-    (LetPrim v4
+  (LetPrim v0 (Constant IntConstant(0)))
+  (LetCont (k0 v1)
+    (LetCont (k1 v2)
+      (LetCont (k2 v3) (LetPrim v4 (Constant IntConstant(0)))
+        (InvokeContinuation return v4))
+      (InvokeStatic print v1 k2))
+    (InvokeStatic print v1 k1))
+    (LetPrim v5
       (CreateFunction
         (FunctionDefinition f ( return)
-          (InvokeContinuation return k0))))
-  (InvokeContinuation k0 v4))
+          (InvokeContinuation return v1))))
+  (InvokeContinuation k0 v0))
 """;
 String USED_BETA_CONT_LIN_OUT = USED_BETA_CONT_LIN_IN;
 
@@ -186,7 +176,7 @@
   (LetPrim v4
     (CreateFunction
       (FunctionDefinition f ( return)
-        (InvokeContinuation k1 k0))))
+        (InvokeContinuation k1 v3))))
   (InvokeContinuation k0 v3))
 """;
 String ETA_CONT_OUT = """
@@ -220,7 +210,7 @@
   String expected = normalizeSExpr(expectedOutput);
   String actual   = normalizeSExpr(stringifier.visit(f));
 
-   Expect.equals(expected, actual);
+  Expect.equals(expected, actual);
 }
 
 void main() {
@@ -230,8 +220,6 @@
   testShrinkingReducer(DEAD_CONT_IN, DEAD_CONT_OUT);
   testShrinkingReducer(ITERATIVE_DEAD_CONT_IN, ITERATIVE_DEAD_CONT_OUT);
   testShrinkingReducer(BETA_CONT_LIN_IN, BETA_CONT_LIN_OUT);
-  testShrinkingReducer(ARG_BETA_CONT_LIN_IN, ARG_BETA_CONT_LIN_OUT);
   testShrinkingReducer(RECURSIVE_BETA_CONT_LIN_IN, RECURSIVE_BETA_CONT_LIN_OUT);
-  testShrinkingReducer(USED_BETA_CONT_LIN_IN, USED_BETA_CONT_LIN_OUT);
   testShrinkingReducer(ETA_CONT_IN, ETA_CONT_OUT);
 }
diff --git a/tests/compiler/dart2js/backend_dart/sexpr2_test.dart b/tests/compiler/dart2js/backend_dart/sexpr2_test.dart
index 835dd89..0225334 100644
--- a/tests/compiler/dart2js/backend_dart/sexpr2_test.dart
+++ b/tests/compiler/dart2js/backend_dart/sexpr2_test.dart
@@ -5,8 +5,8 @@
 /// Unittest test of the CPS ir generated by the dart2dart compiler.

 library dart_backend.sexpr2_test;

 

-import 'package:compiler/implementation/dart2jslib.dart';

-import 'package:compiler/implementation/cps_ir/cps_ir_nodes_sexpr.dart';

+import 'package:compiler/src/dart2jslib.dart';

+import 'package:compiler/src/cps_ir/cps_ir_nodes_sexpr.dart';

 import 'package:expect/expect.dart';

 

 import '../../../../pkg/analyzer2dart/test/test_helper.dart';

diff --git a/tests/compiler/dart2js/backend_dart/sexpr_test.dart b/tests/compiler/dart2js/backend_dart/sexpr_test.dart
index 2539d7b..4682d20 100644
--- a/tests/compiler/dart2js/backend_dart/sexpr_test.dart
+++ b/tests/compiler/dart2js/backend_dart/sexpr_test.dart
@@ -7,9 +7,9 @@
 import 'dart:async';
 
 import 'package:async_helper/async_helper.dart';
-import 'package:compiler/implementation/dart2jslib.dart';
-import 'package:compiler/implementation/cps_ir/cps_ir_nodes.dart';
-import 'package:compiler/implementation/cps_ir/cps_ir_nodes_sexpr.dart';
+import 'package:compiler/src/dart2jslib.dart';
+import 'package:compiler/src/cps_ir/cps_ir_nodes.dart';
+import 'package:compiler/src/cps_ir/cps_ir_nodes_sexpr.dart';
 import 'package:expect/expect.dart';
 
 import '../compiler_helper.dart' hide compilerFor;
diff --git a/tests/compiler/dart2js/backend_dart/sexpr_unstringifier.dart b/tests/compiler/dart2js/backend_dart/sexpr_unstringifier.dart
index 8ba1a38..b414c7f 100644
--- a/tests/compiler/dart2js/backend_dart/sexpr_unstringifier.dart
+++ b/tests/compiler/dart2js/backend_dart/sexpr_unstringifier.dart
@@ -7,22 +7,22 @@
 
 library sexpr_unstringifier;
 
-import 'package:compiler/implementation/constants/expressions.dart'
+import 'package:compiler/src/constants/expressions.dart'
     show PrimitiveConstantExpression;
-import 'package:compiler/implementation/constants/values.dart';
-import 'package:compiler/implementation/dart2jslib.dart' as dart2js
+import 'package:compiler/src/constants/values.dart';
+import 'package:compiler/src/dart2jslib.dart' as dart2js
     show MessageKind;
-import 'package:compiler/implementation/dart_types.dart' as dart_types
+import 'package:compiler/src/dart_types.dart' as dart_types
     show DartType;
-import 'package:compiler/implementation/elements/elements.dart'
+import 'package:compiler/src/elements/elements.dart'
    show Entity, Element, Elements, Local, TypeVariableElement, ErroneousElement,
          TypeDeclarationElement, ExecutableElement;
-import 'package:compiler/implementation/elements/modelx.dart'
+import 'package:compiler/src/elements/modelx.dart'
     show ErroneousElementX, TypeVariableElementX;
-import 'package:compiler/implementation/tree/tree.dart' show LiteralDartString;
-import 'package:compiler/implementation/universe/universe.dart'
+import 'package:compiler/src/tree/tree.dart' show LiteralDartString;
+import 'package:compiler/src/universe/universe.dart'
     show Selector, SelectorKind;
-import 'package:compiler/implementation/cps_ir/cps_ir_nodes.dart';
+import 'package:compiler/src/cps_ir/cps_ir_nodes.dart';
 
 /// Used whenever a node constructed by [SExpressionUnstringifier] needs a
 /// named entity.
@@ -234,16 +234,16 @@
     return null;
   }
 
-  /// def1 def2 ... defn cont )
+  /// prim1 prim2 ... primn cont)
   /// Note that cont is *not* included in the returned list and not consumed.
-  List<Definition> parseDefinitionList() {
-    List<Definition> defs = <Definition>[];
+  List<Primitive> parseArgumentList() {
+    List<Primitive> args = <Primitive>[];
     while (tokens.next != ")") {
-      Definition def = name2variable[tokens.read()];
-      assert(def != null);
-      defs.add(def);
+      Primitive prim = name2variable[tokens.read()];
+      assert(prim != null);
+      args.add(prim);
     }
-    return defs;
+    return args;
   }
 
   /// (prim1 prim2 ... primn)
@@ -321,7 +321,7 @@
   ConcatenateStrings parseConcatenateStrings() {
     tokens.consumeStart(CONCATENATE_STRINGS);
 
-    List<Definition> args = parseDefinitionList();
+    List<Primitive> args = parseArgumentList();
 
     Continuation cont = name2variable[tokens.read()];
     assert(cont != null);
@@ -360,7 +360,7 @@
     dart_types.DartType type = new DummyNamedType(split[0]);
     Element element = new DummyElement((split.length == 1) ? "" : split[1]);
 
-    List<Definition> args = parseDefinitionList();
+    List<Primitive> args = parseArgumentList();
 
     Continuation cont = name2variable[tokens.read()];
     assert(cont != null);
@@ -378,11 +378,11 @@
     Continuation cont = name2variable[tokens.read()];
     assert(cont != null);
 
-    List<Definition> args = <Definition>[];
+    List<Primitive> args = <Primitive>[];
     while (tokens.current != ")") {
-      Definition def = name2variable[tokens.read()];
-      assert(def != null);
-      args.add(def);
+      Primitive arg = name2variable[tokens.read()];
+      assert(arg != null);
+      args.add(arg);
     }
 
     tokens.consumeEnd();
@@ -398,7 +398,7 @@
 
     String methodName = tokens.read();
 
-    List<Definition> args = parseDefinitionList();
+    List<Primitive> args = parseArgumentList();
 
     Continuation cont = name2variable[tokens.read()];
     assert(cont != null);
@@ -414,7 +414,7 @@
 
     String methodName = tokens.read();
 
-    List<Definition> args = parseDefinitionList();
+    List<Primitive> args = parseArgumentList();
 
     Continuation cont = name2variable[tokens.read()];
     assert(cont != null);
@@ -432,7 +432,7 @@
 
     String methodName = tokens.read();
 
-    List<Definition> args = parseDefinitionList();
+    List<Primitive> args = parseArgumentList();
 
     Continuation cont = name2variable[tokens.read()];
     assert(cont != null);
diff --git a/tests/compiler/dart2js/backend_dart/test_helper.dart b/tests/compiler/dart2js/backend_dart/test_helper.dart
index a5d5b20..52d6aec 100644
--- a/tests/compiler/dart2js/backend_dart/test_helper.dart
+++ b/tests/compiler/dart2js/backend_dart/test_helper.dart
@@ -6,7 +6,7 @@
 

 import 'dart:async';

 import 'package:async_helper/async_helper.dart';

-import 'package:compiler/implementation/dart2jslib.dart';

+import 'package:compiler/src/dart2jslib.dart';

 import '../../../../pkg/analyzer2dart/test/test_helper.dart';

 import '../compiler_helper.dart';

 

diff --git a/tests/compiler/dart2js/bad_output_io_test.dart b/tests/compiler/dart2js/bad_output_io_test.dart
index 913614b..868d53c 100644
--- a/tests/compiler/dart2js/bad_output_io_test.dart
+++ b/tests/compiler/dart2js/bad_output_io_test.dart
@@ -11,9 +11,9 @@
 
 import 'package:compiler/compiler.dart'
        show Diagnostic;
-import 'package:compiler/implementation/dart2js.dart'
+import 'package:compiler/src/dart2js.dart'
        show exitFunc, compileFunc, compile, diagnosticHandler;
-import 'package:compiler/implementation/source_file_provider.dart'
+import 'package:compiler/src/source_file_provider.dart'
        show FormattingDiagnosticHandler;
 
 class CollectingFormattingDiagnosticHandler
diff --git a/tests/compiler/dart2js/begin_end_token_test.dart b/tests/compiler/dart2js/begin_end_token_test.dart
index d4cad6e..37949fb 100644
--- a/tests/compiler/dart2js/begin_end_token_test.dart
+++ b/tests/compiler/dart2js/begin_end_token_test.dart
@@ -4,7 +4,7 @@
 
 import "package:expect/expect.dart";
 import 'parser_helper.dart';
-import 'package:compiler/implementation/tree/tree.dart';
+import 'package:compiler/src/tree/tree.dart';
 
 void testNode(Node node, String expected, String text, [bool hard = true]) {
   var debug = 'text=$text,expected=$expected,node:${node}';
diff --git a/tests/compiler/dart2js/call_site_simple_type_inferer_test.dart b/tests/compiler/dart2js/call_site_simple_type_inferer_test.dart
index cd127f2..0c94f8e 100644
--- a/tests/compiler/dart2js/call_site_simple_type_inferer_test.dart
+++ b/tests/compiler/dart2js/call_site_simple_type_inferer_test.dart
@@ -4,7 +4,7 @@
 
 import 'package:expect/expect.dart';
 import "package:async_helper/async_helper.dart";
-import 'package:compiler/implementation/types/types.dart'
+import 'package:compiler/src/types/types.dart'
     show TypeMask;
 
 import 'compiler_helper.dart';
diff --git a/tests/compiler/dart2js/check_elements_invariants_test.dart b/tests/compiler/dart2js/check_elements_invariants_test.dart
index 948c7a0..2aff254 100644
--- a/tests/compiler/dart2js/check_elements_invariants_test.dart
+++ b/tests/compiler/dart2js/check_elements_invariants_test.dart
@@ -3,22 +3,22 @@
 // BSD-style license that can be found in the LICENSE file.
 
 import 'dart:async';
-import 'package:compiler/implementation/apiimpl.dart';
-import 'package:compiler/implementation/dart2jslib.dart' show NullSink;
+import 'package:compiler/src/apiimpl.dart';
+import 'package:compiler/src/dart2jslib.dart' show NullSink;
 import 'package:expect/expect.dart';
-import 'package:compiler/implementation/filenames.dart';
-import 'package:compiler/implementation/source_file_provider.dart';
-import 'package:compiler/implementation/elements/elements.dart'
+import 'package:compiler/src/filenames.dart';
+import 'package:compiler/src/source_file_provider.dart';
+import 'package:compiler/src/elements/elements.dart'
     show ClassElement;
-import 'package:compiler/implementation/resolution/class_members.dart'
+import 'package:compiler/src/resolution/class_members.dart'
     show ClassMemberMixin;
 import "package:async_helper/async_helper.dart";
 
 
 const String DART2JS_SOURCE =
-    'sdk/lib/_internal/compiler/implementation/dart2js.dart';
+    'pkg/compiler/lib/src/dart2js.dart';
 const List<String> DART2JS_OPTIONS = const <String>[
-      '--categories=Client,Server', 
+      '--categories=Client,Server',
       '--disable-type-inference'
     ];
 
diff --git a/tests/compiler/dart2js/command_line_split_test.dart b/tests/compiler/dart2js/command_line_split_test.dart
index d54a351..574e340 100644
--- a/tests/compiler/dart2js/command_line_split_test.dart
+++ b/tests/compiler/dart2js/command_line_split_test.dart
@@ -3,7 +3,7 @@
 // BSD-style license that can be found in the LICENSE file.
 
 import "package:expect/expect.dart";
-import 'package:compiler/implementation/util/command_line.dart';
+import 'package:compiler/src/util/command_line.dart';
 
 main() {
   Expect.listEquals(["foo", "bar"], splitLine("foo bar"));
diff --git a/tests/compiler/dart2js/compiler_alt.dart b/tests/compiler/dart2js/compiler_alt.dart
index 030e584..5296de0 100644
--- a/tests/compiler/dart2js/compiler_alt.dart
+++ b/tests/compiler/dart2js/compiler_alt.dart
@@ -6,14 +6,14 @@
 /// for later inspection.
 ///
 /// Use this in testing to inspect the compiler after compilation by setting
-/// the `compileFunc` variable in `package:compiler/implementation/dart2js.dart`
+/// the `compileFunc` variable in `package:compiler/src/dart2js.dart`
 /// to [compiler] before calling the `internalMain` function.
 
 library dart2js.alt;
 
 import 'dart:async';
 import 'package:compiler/compiler.dart';
-import 'package:compiler/implementation/apiimpl.dart';
+import 'package:compiler/src/apiimpl.dart';
 
 Compiler compiler;
 
diff --git a/tests/compiler/dart2js/compiler_helper.dart b/tests/compiler/dart2js/compiler_helper.dart
index bd98f39..64aceee 100644
--- a/tests/compiler/dart2js/compiler_helper.dart
+++ b/tests/compiler/dart2js/compiler_helper.dart
@@ -7,16 +7,16 @@
 import 'dart:async';
 import "package:expect/expect.dart";
 
-import 'package:compiler/implementation/elements/elements.dart'
+import 'package:compiler/src/elements/elements.dart'
        as lego;
-export 'package:compiler/implementation/elements/elements.dart';
+export 'package:compiler/src/elements/elements.dart';
 
-import 'package:compiler/implementation/js_backend/js_backend.dart'
+import 'package:compiler/src/js_backend/js_backend.dart'
        as js;
 
-import 'package:compiler/implementation/dart2jslib.dart'
+import 'package:compiler/src/dart2jslib.dart'
        as leg;
-export 'package:compiler/implementation/dart2jslib.dart'
+export 'package:compiler/src/dart2jslib.dart'
        show Constant,
             Message,
             MessageKind,
@@ -25,22 +25,22 @@
             SourceSpan,
             World;
 
-import 'package:compiler/implementation/ssa/ssa.dart' as ssa;
+import 'package:compiler/src/ssa/ssa.dart' as ssa;
 
-import 'package:compiler/implementation/types/types.dart'
+import 'package:compiler/src/types/types.dart'
        as types;
-export 'package:compiler/implementation/types/types.dart'
+export 'package:compiler/src/types/types.dart'
        show TypeMask;
 
-import 'package:compiler/implementation/util/util.dart';
-export 'package:compiler/implementation/util/util.dart';
+import 'package:compiler/src/util/util.dart';
+export 'package:compiler/src/util/util.dart';
 
-import 'package:compiler/implementation/source_file.dart';
+import 'package:compiler/src/source_file.dart';
 
-import 'package:compiler/implementation/dart2jslib.dart'
+import 'package:compiler/src/dart2jslib.dart'
        show Compiler;
 
-export 'package:compiler/implementation/tree/tree.dart';
+export 'package:compiler/src/tree/tree.dart';
 
 import 'mock_compiler.dart';
 export 'mock_compiler.dart';
@@ -111,6 +111,7 @@
 Future<String> compileAll(String code,
                           {Map<String, String> coreSource,
                           bool disableInlining: true,
+                          bool trustTypeAnnotations: false,
                           bool minify: false,
                           int expectedErrors,
                           int expectedWarnings}) {
@@ -118,6 +119,7 @@
   MockCompiler compiler = compilerFor(
       code, uri, coreSource: coreSource, disableInlining: disableInlining,
       minify: minify, expectedErrors: expectedErrors,
+      trustTypeAnnotations: trustTypeAnnotations,
       expectedWarnings: expectedWarnings);
   return compiler.runCompiler(uri).then((_) {
     Expect.isFalse(compiler.compilationFailed,
diff --git a/tests/compiler/dart2js/compiler_test.dart b/tests/compiler/dart2js/compiler_test.dart
index 8235686..581489c 100644
--- a/tests/compiler/dart2js/compiler_test.dart
+++ b/tests/compiler/dart2js/compiler_test.dart
@@ -5,10 +5,10 @@
 import "dart:async";
 import "package:expect/expect.dart";
 import "package:async_helper/async_helper.dart";
-import "package:compiler/implementation/dart2jslib.dart";
-import "package:compiler/implementation/elements/elements.dart";
-import "package:compiler/implementation/resolution/resolution.dart";
-import "package:compiler/implementation/util/util.dart";
+import "package:compiler/src/dart2jslib.dart";
+import "package:compiler/src/elements/elements.dart";
+import "package:compiler/src/resolution/resolution.dart";
+import "package:compiler/src/util/util.dart";
 import "mock_compiler.dart";
 
 
diff --git a/tests/compiler/dart2js/cpa_inference_test.dart b/tests/compiler/dart2js/cpa_inference_test.dart
index d636c05..d22efb7 100644
--- a/tests/compiler/dart2js/cpa_inference_test.dart
+++ b/tests/compiler/dart2js/cpa_inference_test.dart
@@ -5,8 +5,8 @@
 import 'dart:async';
 import "package:expect/expect.dart";
 import "package:async_helper/async_helper.dart";
-import 'package:compiler/implementation/types/types.dart';
-import 'package:compiler/implementation/inferrer/concrete_types_inferrer.dart';
+import 'package:compiler/src/types/types.dart';
+import 'package:compiler/src/inferrer/concrete_types_inferrer.dart';
 
 import "compiler_helper.dart";
 import "type_mask_test_helper.dart";
@@ -437,7 +437,7 @@
 testToplevelVariable3() {
   final String source = r"""
       var top = "a";
-      
+
       f() => top;
 
       main() {
@@ -678,7 +678,7 @@
   final String source = """
       int _x = 42;
       get x => _x;
- 
+
       f() => x;
 
       main() {
@@ -740,7 +740,7 @@
   final String source = """
       int _x = 42;
       set x(y) => _x = y;
- 
+
       f(y) { x = y; }
 
       main() {
@@ -1754,7 +1754,7 @@
       main() {
         // We make sure that x doesn't have type dynamic by adding C to the
         // set of seen classes and by checking that a's type doesn't contain
-        // bool. 
+        // bool.
         new C();
 
         var a;
diff --git a/tests/compiler/dart2js/dart2js.status b/tests/compiler/dart2js/dart2js.status
index 0d3ca98..1c5dd3a 100644
--- a/tests/compiler/dart2js/dart2js.status
+++ b/tests/compiler/dart2js/dart2js.status
@@ -27,6 +27,8 @@
 mirrors/library_imports_prefixed_show_hide_test: Fail
 mirrors/library_imports_shown_test: Fail
 
+patch_test/bug: RuntimeError # Issue 21132
+
 [ $unchecked ]
 exit_code_test: Skip # This tests requires checked mode.
 
diff --git a/tests/compiler/dart2js/deferred_dont_inline_deferred_constants_test.dart b/tests/compiler/dart2js/deferred_dont_inline_deferred_constants_test.dart
index ae30c6b..e0f93e5 100644
--- a/tests/compiler/dart2js/deferred_dont_inline_deferred_constants_test.dart
+++ b/tests/compiler/dart2js/deferred_dont_inline_deferred_constants_test.dart
@@ -10,7 +10,7 @@
 import 'memory_source_file_helper.dart';
 import "dart:async";
 
-import 'package:compiler/implementation/dart2jslib.dart'
+import 'package:compiler/src/dart2jslib.dart'
        as dart2js;
 
 class MemoryOutputSink extends EventSink<String> {
diff --git a/tests/compiler/dart2js/deferred_dont_inline_deferred_globals_test.dart b/tests/compiler/dart2js/deferred_dont_inline_deferred_globals_test.dart
index 8e9642a..2868661 100644
--- a/tests/compiler/dart2js/deferred_dont_inline_deferred_globals_test.dart
+++ b/tests/compiler/dart2js/deferred_dont_inline_deferred_globals_test.dart
@@ -10,7 +10,7 @@
 import 'memory_source_file_helper.dart';
 import "dart:async";
 
-import 'package:compiler/implementation/dart2jslib.dart'
+import 'package:compiler/src/dart2jslib.dart'
        as dart2js;
 
 class MemoryOutputSink extends EventSink<String> {
diff --git a/tests/compiler/dart2js/deferred_emit_type_checks_test.dart b/tests/compiler/dart2js/deferred_emit_type_checks_test.dart
index bb9449a..6ece06e 100644
--- a/tests/compiler/dart2js/deferred_emit_type_checks_test.dart
+++ b/tests/compiler/dart2js/deferred_emit_type_checks_test.dart
@@ -10,7 +10,7 @@
 import 'memory_source_file_helper.dart';
 import "dart:async";
 
-import 'package:compiler/implementation/dart2jslib.dart'
+import 'package:compiler/src/dart2jslib.dart'
        as dart2js;
 
 class MemoryOutputSink<T> extends EventSink<T> {
diff --git a/tests/compiler/dart2js/deferred_follow_constant_dependencies_test.dart b/tests/compiler/dart2js/deferred_follow_constant_dependencies_test.dart
index 5b404c1..d35780e 100644
--- a/tests/compiler/dart2js/deferred_follow_constant_dependencies_test.dart
+++ b/tests/compiler/dart2js/deferred_follow_constant_dependencies_test.dart
@@ -6,7 +6,7 @@
 
 import 'dart:async';
 import 'package:async_helper/async_helper.dart';
-import 'package:compiler/implementation/constants/values.dart';
+import 'package:compiler/src/constants/values.dart';
 import 'package:expect/expect.dart';
 import 'memory_source_file_helper.dart';
 
diff --git a/tests/compiler/dart2js/deferred_follow_implicit_super_regression_test.dart b/tests/compiler/dart2js/deferred_follow_implicit_super_regression_test.dart
index 06e9af5..a300eba 100644
--- a/tests/compiler/dart2js/deferred_follow_implicit_super_regression_test.dart
+++ b/tests/compiler/dart2js/deferred_follow_implicit_super_regression_test.dart
@@ -8,7 +8,7 @@
 import "memory_compiler.dart";
 import "dart:async";
 
-import 'package:compiler/implementation/dart2jslib.dart'
+import 'package:compiler/src/dart2jslib.dart'
        as dart2js;
 
 runTest(String mainScript, test) {
diff --git a/tests/compiler/dart2js/deferred_load_graph_segmentation_test.dart b/tests/compiler/dart2js/deferred_load_graph_segmentation_test.dart
index d20bd3e..a3ead0b 100644
--- a/tests/compiler/dart2js/deferred_load_graph_segmentation_test.dart
+++ b/tests/compiler/dart2js/deferred_load_graph_segmentation_test.dart
@@ -11,10 +11,10 @@
 import 'memory_source_file_helper.dart';
 import "dart:async";
 
-import 'package:compiler/implementation/dart2jslib.dart'
+import 'package:compiler/src/dart2jslib.dart'
        as dart2js;
 
-import 'package:compiler/implementation/deferred_load.dart';
+import 'package:compiler/src/deferred_load.dart';
 
 class FakeOutputStream<T> extends EventSink<T> {
   void add(T event) {}
diff --git a/tests/compiler/dart2js/deferred_mirrors_test.dart b/tests/compiler/dart2js/deferred_mirrors_test.dart
index babb95a..4f38d5a 100644
--- a/tests/compiler/dart2js/deferred_mirrors_test.dart
+++ b/tests/compiler/dart2js/deferred_mirrors_test.dart
@@ -11,7 +11,7 @@
 import 'memory_source_file_helper.dart';
 import "memory_compiler.dart";
 
-import 'package:compiler/implementation/dart2jslib.dart'
+import 'package:compiler/src/dart2jslib.dart'
        as dart2js;
 
 runTest(String mainScript, test) {
diff --git a/tests/compiler/dart2js/deferred_not_in_main_test.dart b/tests/compiler/dart2js/deferred_not_in_main_test.dart
index e2ba40a..9999881 100644
--- a/tests/compiler/dart2js/deferred_not_in_main_test.dart
+++ b/tests/compiler/dart2js/deferred_not_in_main_test.dart
@@ -11,7 +11,7 @@
 import 'memory_source_file_helper.dart';
 import "dart:async";
 
-import 'package:compiler/implementation/dart2jslib.dart'
+import 'package:compiler/src/dart2jslib.dart'
        as dart2js;
 
 class FakeOutputStream<T> extends EventSink<T> {
diff --git a/tests/compiler/dart2js/dump_info_test.dart b/tests/compiler/dart2js/dump_info_test.dart
index 504878e..bc962c2 100644
--- a/tests/compiler/dart2js/dump_info_test.dart
+++ b/tests/compiler/dart2js/dump_info_test.dart
@@ -6,7 +6,7 @@
 import "package:expect/expect.dart";
 import "package:async_helper/async_helper.dart";
 import 'memory_compiler.dart';
-import 'package:compiler/implementation/dump_info.dart';
+import 'package:compiler/src/dump_info.dart';
 import 'dart:convert';
 
 const String TEST_BASIC= r"""
diff --git a/tests/compiler/dart2js/erroneous_element_test.dart b/tests/compiler/dart2js/erroneous_element_test.dart
index f4f21e8..154ff0a 100644
--- a/tests/compiler/dart2js/erroneous_element_test.dart
+++ b/tests/compiler/dart2js/erroneous_element_test.dart
@@ -3,13 +3,13 @@
 // BSD-style license that can be found in the LICENSE file.
 
 import "package:expect/expect.dart";
-import 'package:compiler/implementation/elements/elements.dart';
+import 'package:compiler/src/elements/elements.dart';
 import 'parser_helper.dart';
 
-import 'package:compiler/implementation/elements/modelx.dart'
+import 'package:compiler/src/elements/modelx.dart'
     show ErroneousElementX;
 
-import 'package:compiler/implementation/dart2jslib.dart'
+import 'package:compiler/src/dart2jslib.dart'
     show MessageKind;
 
 void main() {
diff --git a/tests/compiler/dart2js/exit_code_test.dart b/tests/compiler/dart2js/exit_code_test.dart
index 27c2c61..4b9899d 100644
--- a/tests/compiler/dart2js/exit_code_test.dart
+++ b/tests/compiler/dart2js/exit_code_test.dart
@@ -13,14 +13,14 @@
 import 'package:expect/expect.dart';

 

 import 'package:compiler/compiler.dart' as api;

-import 'package:compiler/implementation/dart2js.dart' as entry;

-import 'package:compiler/implementation/dart2jslib.dart';

-import 'package:compiler/implementation/apiimpl.dart' as apiimpl;

-import 'package:compiler/implementation/elements/elements.dart';

-import 'package:compiler/implementation/library_loader.dart';

-import 'package:compiler/implementation/resolution/resolution.dart';

-import 'package:compiler/implementation/scanner/scannerlib.dart';

-import 'package:compiler/implementation/util/util.dart';

+import 'package:compiler/src/dart2js.dart' as entry;

+import 'package:compiler/src/dart2jslib.dart';

+import 'package:compiler/src/apiimpl.dart' as apiimpl;

+import 'package:compiler/src/elements/elements.dart';

+import 'package:compiler/src/library_loader.dart';

+import 'package:compiler/src/resolution/resolution.dart';

+import 'package:compiler/src/scanner/scannerlib.dart';

+import 'package:compiler/src/util/util.dart';

 

 class TestCompiler extends apiimpl.Compiler {

   final String testMarker;

diff --git a/tests/compiler/dart2js/field_type_simple_inferer_test.dart b/tests/compiler/dart2js/field_type_simple_inferer_test.dart
index bc1f6a9..be6259d 100644
--- a/tests/compiler/dart2js/field_type_simple_inferer_test.dart
+++ b/tests/compiler/dart2js/field_type_simple_inferer_test.dart
@@ -5,7 +5,7 @@
 import 'dart:async';
 import 'package:expect/expect.dart';
 import "package:async_helper/async_helper.dart";
-import 'package:compiler/implementation/types/types.dart'
+import 'package:compiler/src/types/types.dart'
     show TypeMask;
 
 import 'compiler_helper.dart';
diff --git a/tests/compiler/dart2js/find_my_name_test.dart b/tests/compiler/dart2js/find_my_name_test.dart
index bd46c30..60aba02c 100644
--- a/tests/compiler/dart2js/find_my_name_test.dart
+++ b/tests/compiler/dart2js/find_my_name_test.dart
@@ -4,10 +4,10 @@
 
 import "package:expect/expect.dart";
 import "package:async_helper/async_helper.dart";
-import "package:compiler/implementation/elements/elements.dart";
+import "package:compiler/src/elements/elements.dart";
 import "mock_compiler.dart";
 import "parser_helper.dart";
-import 'package:compiler/implementation/elements/modelx.dart';
+import 'package:compiler/src/elements/modelx.dart';
 
 String TEST_0 = '''
 class Foo {
diff --git a/tests/compiler/dart2js/indentation_test.dart b/tests/compiler/dart2js/indentation_test.dart
index 5c6e8a4..e70190c 100644
--- a/tests/compiler/dart2js/indentation_test.dart
+++ b/tests/compiler/dart2js/indentation_test.dart
@@ -3,7 +3,7 @@
 // BSD-style license that can be found in the LICENSE file.
 
 import "package:expect/expect.dart";
-import 'package:compiler/implementation/util/util.dart' show Indentation;
+import 'package:compiler/src/util/util.dart' show Indentation;
 
 main() {
   Indentation ind = new Indentation();
diff --git a/tests/compiler/dart2js/instantiated_classes_test.dart b/tests/compiler/dart2js/instantiated_classes_test.dart
index 00fd801..d125ff9 100644
--- a/tests/compiler/dart2js/instantiated_classes_test.dart
+++ b/tests/compiler/dart2js/instantiated_classes_test.dart
@@ -7,7 +7,7 @@
 import 'dart:async';

 import 'package:expect/expect.dart';

 import 'package:async_helper/async_helper.dart';

-import 'package:compiler/implementation/elements/elements.dart'

+import 'package:compiler/src/elements/elements.dart'

     show ClassElement;

 import 'type_test_helper.dart';

 

diff --git a/tests/compiler/dart2js/js_parser_statements_test.dart b/tests/compiler/dart2js/js_parser_statements_test.dart
index e2dcdbe..95d2c2b 100644
--- a/tests/compiler/dart2js/js_parser_statements_test.dart
+++ b/tests/compiler/dart2js/js_parser_statements_test.dart
@@ -6,11 +6,11 @@
 import 'package:expect/expect.dart';
 import 'package:async_helper/async_helper.dart';
 import 'mock_compiler.dart';
-import 'package:compiler/implementation/js/js.dart' as jsAst;
-import 'package:compiler/implementation/js/js.dart' show js;
+import 'package:compiler/src/js/js.dart' as jsAst;
+import 'package:compiler/src/js/js.dart' show js;
 
 
-Future testStatement(String statement, List arguments, String expect) {
+Future testStatement(String statement, arguments, String expect) {
   jsAst.Node node = js.statement(statement, arguments);
   return MockCompiler.create((MockCompiler compiler) {
     String jsText =
@@ -21,7 +21,7 @@
   });
 }
 
-Future testError(String statement, List arguments, [String expect = ""]) {
+Future testError(String statement, arguments, [String expect = ""]) {
   return new Future.sync(() {
     bool doCheck(exception) {
       String message = '$exception';
@@ -41,6 +41,11 @@
   return function harry/*named function*/() { return #; }
 }''';
 
+const NAMED_FUNCTION_1_NAMED_HOLE = r'''
+function foo/*function declaration*/() {
+  return function harry/*named function*/() { return #hole; }
+}''';
+
 const NAMED_FUNCTION_1_ONE = r'''
 function foo() {
   return function harry() {
@@ -54,6 +59,12 @@
   #;
 }''';
 
+const MISC_1_NAMED_HOLE = r'''
+function foo() {
+  /a/;
+  #hole;
+}''';
+
 const MISC_1_1 = r'''
 function foo() {
   /a/;
@@ -62,7 +73,6 @@
 }''';
 
 
-
 void main() {
 
   var eOne = js('1');
@@ -78,10 +88,13 @@
   asyncTest(() => Future.wait([
     // Interpolated Expressions are upgraded to ExpressionStatements.
     testStatement('{ #; #; }', [eOne, eOne], '{\n  1;\n  1;\n}'),
+    testStatement('{ #a; #b; }', {'a': eOne, 'b': eOne}, '{\n  1;\n  1;\n}'),
 
     // Interpolated sub-blocks are spliced.
     testStatement('{ #; #; }', [block12, block12],
         '{\n  1;\n  2;\n  1;\n  2;\n}\n'),
+    testStatement('{ #a; #b; }', {'a': block12, 'b': block12},
+        '{\n  1;\n  2;\n  1;\n  2;\n}\n'),
 
     // If-condition.  Dart booleans are evaluated, JS Expression booleans are
     // substituted.
@@ -93,37 +106,83 @@
     testStatement('if (#) #;', [false, block12], ';'),
     testStatement('if (#) 3; else #;', [true, block12], '3;'),
     testStatement('if (#) 3; else #;', [false, block12], '{\n  1;\n  2;\n}'),
+    testStatement('if (#a) #b',
+                  {'a': eOne, 'b': block12},
+                  'if (1) {\n  1;\n  2;\n}'),
+    testStatement('if (#a) #b;',
+                  {'a': eTrue, 'b': block12},
+                  'if (true) {\n  1;\n  2;\n}'),
+    testStatement('if (#a) #b;',
+                  {'a': eVar, 'b': block12},
+                  'if (x) {\n  1;\n  2;\n}'),
+    testStatement('if (#a) #b;',
+                  {'a': 'a', 'b': block12},
+                  'if (a) {\n  1;\n  2;\n}'),
+    testStatement('if (#a) #b;',
+                  {'a': true, 'b': block12},
+                  '{\n  1;\n  2;\n}'),
+    testStatement('if (#a) #b;',
+                  {'a': false, 'b': block12},
+                  ';'),
+    testStatement('if (#a) 3; else #b;',
+                  {'a': true, 'b': block12},
+                  '3;'),
+    testStatement('if (#a) 3; else #b;',
+                  {'a': false, 'b': block12},
+                  '{\n  1;\n  2;\n}'),
 
 
     testStatement(NAMED_FUNCTION_1, [eOne], NAMED_FUNCTION_1_ONE),
+    testStatement(NAMED_FUNCTION_1_NAMED_HOLE,
+                  {'hole': eOne},
+                  NAMED_FUNCTION_1_ONE),
 
     testStatement(MISC_1, [block12], MISC_1_1),
+    testStatement(MISC_1_NAMED_HOLE, {'hole': block12}, MISC_1_1),
 
     // Argument list splicing.
     testStatement('foo(#)', [[]], 'foo();'),
     testStatement('foo(#)', [[eOne]], 'foo(1);'),
     testStatement('foo(#)', [eOne], 'foo(1);'),
     testStatement('foo(#)', [[eTrue,eOne]], 'foo(true, 1);'),
+    testStatement('foo(#a)', {'a': []}, 'foo();'),
+    testStatement('foo(#a)', {'a': [eOne]}, 'foo(1);'),
+    testStatement('foo(#a)', {'a': eOne}, 'foo(1);'),
+    testStatement('foo(#a)', {'a': [eTrue,eOne]}, 'foo(true, 1);'),
 
     testStatement('foo(2,#)', [[]], 'foo(2);'),
     testStatement('foo(2,#)', [[eOne]], 'foo(2, 1);'),
     testStatement('foo(2,#)', [eOne], 'foo(2, 1);'),
     testStatement('foo(2,#)', [[eTrue,eOne]], 'foo(2, true, 1);'),
+    testStatement('foo(2,#a)', {'a': []}, 'foo(2);'),
+    testStatement('foo(2,#a)', {'a': [eOne]}, 'foo(2, 1);'),
+    testStatement('foo(2,#a)', {'a': eOne}, 'foo(2, 1);'),
+    testStatement('foo(2,#a)', {'a': [eTrue,eOne]}, 'foo(2, true, 1);'),
 
     testStatement('foo(#,3)', [[]], 'foo(3);'),
     testStatement('foo(#,3)', [[eOne]], 'foo(1, 3);'),
     testStatement('foo(#,3)', [eOne], 'foo(1, 3);'),
     testStatement('foo(#,3)', [[eTrue,eOne]], 'foo(true, 1, 3);'),
+    testStatement('foo(#a,3)', {'a': []}, 'foo(3);'),
+    testStatement('foo(#a,3)', {'a': [eOne]}, 'foo(1, 3);'),
+    testStatement('foo(#a,3)', {'a': eOne}, 'foo(1, 3);'),
+    testStatement('foo(#a,3)', {'a': [eTrue,eOne]}, 'foo(true, 1, 3);'),
 
     testStatement('foo(2,#,3)', [[]], 'foo(2, 3);'),
     testStatement('foo(2,#,3)', [[eOne]], 'foo(2, 1, 3);'),
     testStatement('foo(2,#,3)', [eOne], 'foo(2, 1, 3);'),
     testStatement('foo(2,#,3)', [[eTrue,eOne]], 'foo(2, true, 1, 3);'),
+    testStatement('foo(2,#a,3)', {'a': []}, 'foo(2, 3);'),
+    testStatement('foo(2,#a,3)', {'a': [eOne]}, 'foo(2, 1, 3);'),
+    testStatement('foo(2,#a,3)', {'a': eOne}, 'foo(2, 1, 3);'),
+    testStatement('foo(2,#a,3)', {'a': [eTrue,eOne]}, 'foo(2, true, 1, 3);'),
 
     // Interpolated Literals
     testStatement('a = {#: 1}', [eOne], 'a = {1: 1};'),
+    testStatement('a = {#a: 1}', {'a': eOne}, 'a = {1: 1};'),
     // Maybe we should make this work?
     testError('a = {#: 1}', [1], 'is not a Literal: 1'),
+    testError('a = {#a: 1}', {'a': 1}, 'is not a Literal: 1'),
 
     // Interpolated parameter splicing.
     testStatement('function foo(#){}', [new jsAst.Parameter('x')],
@@ -132,23 +191,48 @@
     testStatement('function foo(#){}', [[]], 'function foo() {\n}'),
     testStatement('function foo(#){}', [['x']], 'function foo(x) {\n}'),
     testStatement('function foo(#){}', [['x', 'y']], 'function foo(x, y) {\n}'),
+    testStatement('function foo(#a){}', {'a': new jsAst.Parameter('x')},
+        'function foo(x) {\n}'),
+    testStatement('function foo(#a){}', {'a': 'x'}, 'function foo(x) {\n}'),
+    testStatement('function foo(#a){}', {'a': []}, 'function foo() {\n}'),
+    testStatement('function foo(#a){}', {'a': ['x']}, 'function foo(x) {\n}'),
+    testStatement('function foo(#a){}',
+                  {'a': ['x', 'y']},
+                  'function foo(x, y) {\n}'),
 
 
     testStatement('a = #.#', [eVar,eOne], 'a = x[1];'),
     testStatement('a = #.#', [eVar,'foo'], 'a = x.foo;'),
+    testStatement('a = #a.#b', {'a': eVar, 'b': eOne}, 'a = x[1];'),
+    testStatement('a = #a.#b', {'a': eVar, 'b': 'foo'}, 'a = x.foo;'),
 
     testStatement('function f(#) { return #.#; }', ['x', eVar,'foo'],
         'function f(x) {\n  return x.foo;\n}'),
+    testStatement('function f(#a) { return #b.#c; }',
+                  {'a': 'x', 'b': eVar, 'c': 'foo'},
+                  'function f(x) {\n  return x.foo;\n}'),
 
     testStatement('#.prototype.# = function(#) { return #.# };',
         ['className', 'getterName', ['r', 'y'], 'r', 'fieldName'],
         'className.prototype.getterName = function(r, y) {\n'
         '  return r.fieldName;\n'
         '};'),
+    testStatement('#a.prototype.#b = function(#c) { return #d.#e };',
+                  {'a': 'className',
+                  'b': 'getterName',
+                  'c': ['r', 'y'],
+                  'd': 'r',
+                  'e': 'fieldName'},
+                  'className.prototype.getterName = function(r, y) {\n'
+                  '  return r.fieldName;\n'
+                  '};'),
 
     testStatement('function foo(r, #) { return #[r](#) }',
         [['a', 'b'], 'g', ['b', 'a']],
         'function foo(r, a, b) {\n  return g[r](b, a);\n}'),
+    testStatement('function foo(r, #a) { return #b[r](#c) }',
+        {'a': ['a', 'b'], 'b': 'g', 'c': ['b', 'a']},
+        'function foo(r, a, b) {\n  return g[r](b, a);\n}'),
 
     // Sequence is printed flattened
     testStatement('x = #', [seq1], 'x = (1, 2, 3);'),
@@ -157,5 +241,25 @@
     testStatement(
         'for (i = 0, j = #, k = 0; ; ++i, ++j, ++k){}', [seq1],
         'for (i = 0, j = (1, 2, 3), k = 0;; ++i, ++j, ++k) {\n}'),
+    testStatement('x = #a', {'a': seq1}, 'x = (1, 2, 3);'),
+    testStatement('x = (#a, #b)',
+                  {'a': seq1, 'b': seq1},
+                  'x = (1, 2, 3, 1, 2, 3);'),
+    testStatement('x = #a, #b',
+                  {'a': seq1, 'b': seq1},
+                  'x = (1, 2, 3), 1, 2, 3;'),
+    testStatement(
+        'for (i = 0, j = #a, k = 0; ; ++i, ++j, ++k){}', {'a': seq1},
+        'for (i = 0, j = (1, 2, 3), k = 0;; ++i, ++j, ++k) {\n}'),
+
+    // Use the same name several times.
+    testStatement('#a.prototype.#a = function(#b) { return #c.#c };',
+                  {'a': 'name1_2',
+                   'b': ['r', 'y'],
+                   'c': 'name4_5'},
+                  'name1_2.prototype.name1_2 = function(r, y) {\n'
+                  '  return name4_5.name4_5;\n'
+                  '};'),
+
   ]));
 }
diff --git a/tests/compiler/dart2js/js_parser_test.dart b/tests/compiler/dart2js/js_parser_test.dart
index 54fe2ad..a5f923b 100644
--- a/tests/compiler/dart2js/js_parser_test.dart
+++ b/tests/compiler/dart2js/js_parser_test.dart
@@ -6,8 +6,8 @@
 import 'package:expect/expect.dart';
 import 'package:async_helper/async_helper.dart';
 import 'mock_compiler.dart';
-import 'package:compiler/implementation/js/js.dart' as jsAst;
-import 'package:compiler/implementation/js/js.dart' show js;
+import 'package:compiler/src/js/js.dart' as jsAst;
+import 'package:compiler/src/js/js.dart' show js;
 
 Future testExpression(String expression, [String expect = ""]) {
   jsAst.Node node = js(expression);
diff --git a/tests/compiler/dart2js/js_spec_string_test.dart b/tests/compiler/dart2js/js_spec_string_test.dart
index c0191e6..42d938e 100644
--- a/tests/compiler/dart2js/js_spec_string_test.dart
+++ b/tests/compiler/dart2js/js_spec_string_test.dart
@@ -5,8 +5,8 @@
 // Unit test of the [NativeBehavior.processSpecString] method.
 
 import 'package:expect/expect.dart';
-import 'package:compiler/implementation/native/native.dart';
-import 'package:compiler/implementation/dart2jslib.dart'
+import 'package:compiler/src/native/native.dart';
+import 'package:compiler/src/dart2jslib.dart'
     show DiagnosticListener;
 
 const OBJECT = 'Object';
diff --git a/tests/compiler/dart2js/least_upper_bound_test.dart b/tests/compiler/dart2js/least_upper_bound_test.dart
index a59a36c..804b803 100644
--- a/tests/compiler/dart2js/least_upper_bound_test.dart
+++ b/tests/compiler/dart2js/least_upper_bound_test.dart
@@ -7,10 +7,10 @@
 import 'package:expect/expect.dart';

 import 'package:async_helper/async_helper.dart';

 import 'type_test_helper.dart';

-import 'package:compiler/implementation/dart_types.dart';

-import "package:compiler/implementation/elements/elements.dart"

+import 'package:compiler/src/dart_types.dart';

+import "package:compiler/src/elements/elements.dart"

        show Element, ClassElement;

-import 'package:compiler/implementation/util/util.dart';

+import 'package:compiler/src/util/util.dart';

 

 void main() {

   testInterface1();

diff --git a/tests/compiler/dart2js/link_helper.dart b/tests/compiler/dart2js/link_helper.dart
index 438afa3..dc0fe6f 100644
--- a/tests/compiler/dart2js/link_helper.dart
+++ b/tests/compiler/dart2js/link_helper.dart
@@ -4,8 +4,8 @@
 
 library link_helper;
 
-import 'package:compiler/implementation/util/util.dart';
-import 'package:compiler/implementation/util/util_implementation.dart';
+import 'package:compiler/src/util/util.dart';
+import 'package:compiler/src/util/util_implementation.dart';
 
 Link LinkFromList(List list) {
   switch (list.length) {
diff --git a/tests/compiler/dart2js/link_test.dart b/tests/compiler/dart2js/link_test.dart
index b579afe..a2c2122 100644
--- a/tests/compiler/dart2js/link_test.dart
+++ b/tests/compiler/dart2js/link_test.dart
@@ -3,7 +3,7 @@
 // BSD-style license that can be found in the LICENSE file.
 
 import "package:expect/expect.dart";
-import 'package:compiler/implementation/util/util.dart';
+import 'package:compiler/src/util/util.dart';
 import 'link_helper.dart';
 
 main() {
diff --git a/tests/compiler/dart2js/list_tracer2_test.dart b/tests/compiler/dart2js/list_tracer2_test.dart
index f92525f..249f956 100644
--- a/tests/compiler/dart2js/list_tracer2_test.dart
+++ b/tests/compiler/dart2js/list_tracer2_test.dart
@@ -7,7 +7,7 @@
 
 import 'package:expect/expect.dart';
 import "package:async_helper/async_helper.dart";
-import 'package:compiler/implementation/types/types.dart'
+import 'package:compiler/src/types/types.dart'
     show ContainerTypeMask, TypeMask;
 
 import 'compiler_helper.dart';
diff --git a/tests/compiler/dart2js/list_tracer3_test.dart b/tests/compiler/dart2js/list_tracer3_test.dart
index 9c188b3..27451ba 100644
--- a/tests/compiler/dart2js/list_tracer3_test.dart
+++ b/tests/compiler/dart2js/list_tracer3_test.dart
@@ -7,7 +7,7 @@
 
 import 'package:expect/expect.dart';
 import "package:async_helper/async_helper.dart";
-import 'package:compiler/implementation/types/types.dart'
+import 'package:compiler/src/types/types.dart'
     show ContainerTypeMask, TypeMask;
 
 import 'compiler_helper.dart';
diff --git a/tests/compiler/dart2js/list_tracer_test.dart b/tests/compiler/dart2js/list_tracer_test.dart
index 198f7e4..8391cb6 100644
--- a/tests/compiler/dart2js/list_tracer_test.dart
+++ b/tests/compiler/dart2js/list_tracer_test.dart
@@ -4,7 +4,7 @@
 
 import 'package:expect/expect.dart';
 import "package:async_helper/async_helper.dart";
-import 'package:compiler/implementation/types/types.dart'
+import 'package:compiler/src/types/types.dart'
     show ContainerTypeMask, TypeMask;
 
 import 'compiler_helper.dart';
diff --git a/tests/compiler/dart2js/list_tracer_typed_data_length_test.dart b/tests/compiler/dart2js/list_tracer_typed_data_length_test.dart
index b5ccc80..1106be3 100644
--- a/tests/compiler/dart2js/list_tracer_typed_data_length_test.dart
+++ b/tests/compiler/dart2js/list_tracer_typed_data_length_test.dart
@@ -4,9 +4,9 @@
 
 import 'package:expect/expect.dart';
 import "package:async_helper/async_helper.dart";
-import 'package:compiler/implementation/types/types.dart'
+import 'package:compiler/src/types/types.dart'
     show ContainerTypeMask, TypeMask;
-    
+
 import 'memory_compiler.dart';
 import 'compiler_helper.dart' show findElement;
 import 'type_mask_test_helper.dart';
diff --git a/tests/compiler/dart2js/lookup_member_test.dart b/tests/compiler/dart2js/lookup_member_test.dart
index 7e0eead..d43bcd0 100644
--- a/tests/compiler/dart2js/lookup_member_test.dart
+++ b/tests/compiler/dart2js/lookup_member_test.dart
@@ -7,8 +7,8 @@
 import 'package:expect/expect.dart';
 import "package:async_helper/async_helper.dart";
 import 'type_test_helper.dart';
-import 'package:compiler/implementation/dart_types.dart';
-import "package:compiler/implementation/elements/elements.dart"
+import 'package:compiler/src/dart_types.dart';
+import "package:compiler/src/elements/elements.dart"
        show Element, ClassElement, MemberSignature, PublicName;
 
 void main() {
diff --git a/tests/compiler/dart2js/map_tracer_keys_test.dart b/tests/compiler/dart2js/map_tracer_keys_test.dart
index 89904e2..5610c59 100644
--- a/tests/compiler/dart2js/map_tracer_keys_test.dart
+++ b/tests/compiler/dart2js/map_tracer_keys_test.dart
@@ -4,7 +4,7 @@
 
 import 'package:expect/expect.dart';
 import "package:async_helper/async_helper.dart";
-import 'package:compiler/implementation/types/types.dart'
+import 'package:compiler/src/types/types.dart'
     show ContainerTypeMask, TypeMask;
 
 import 'compiler_helper.dart';
diff --git a/tests/compiler/dart2js/map_tracer_test.dart b/tests/compiler/dart2js/map_tracer_test.dart
index a239a39..3405b5c 100644
--- a/tests/compiler/dart2js/map_tracer_test.dart
+++ b/tests/compiler/dart2js/map_tracer_test.dart
@@ -4,7 +4,7 @@
 
 import 'package:expect/expect.dart';
 import "package:async_helper/async_helper.dart";
-import 'package:compiler/implementation/types/types.dart'
+import 'package:compiler/src/types/types.dart'
     show MapTypeMask, TypeMask;
 
 import 'compiler_helper.dart';
diff --git a/tests/compiler/dart2js/maplet_test.dart b/tests/compiler/dart2js/maplet_test.dart
index 5549fe1..687622e 100644
--- a/tests/compiler/dart2js/maplet_test.dart
+++ b/tests/compiler/dart2js/maplet_test.dart
@@ -3,7 +3,7 @@
 // BSD-style license that can be found in the LICENSE file.
 
 import "package:expect/expect.dart";
-import "package:compiler/implementation/util/maplet.dart";
+import "package:compiler/src/util/maplet.dart";
 
 main() {
   for (int i = 1; i <= 32; i++) {
diff --git a/tests/compiler/dart2js/members_test.dart b/tests/compiler/dart2js/members_test.dart
index bbba00e..d4be7ab 100644
--- a/tests/compiler/dart2js/members_test.dart
+++ b/tests/compiler/dart2js/members_test.dart
@@ -7,11 +7,11 @@
 import 'package:expect/expect.dart';
 import "package:async_helper/async_helper.dart";
 import 'type_test_helper.dart';
-import 'package:compiler/implementation/dart_types.dart';
-import "package:compiler/implementation/elements/elements.dart"
+import 'package:compiler/src/dart_types.dart';
+import "package:compiler/src/elements/elements.dart"
        show Element, ClassElement, MemberSignature, Name, PublicName,
             DeclaredMember, Member;
-import "package:compiler/implementation/resolution/class_members.dart"
+import "package:compiler/src/resolution/class_members.dart"
   show DeclaredMember, ErroneousMember, SyntheticMember;
 
 void main() {
diff --git a/tests/compiler/dart2js/memory_compiler.dart b/tests/compiler/dart2js/memory_compiler.dart
index 9bea288..de75d6c 100644
--- a/tests/compiler/dart2js/memory_compiler.dart
+++ b/tests/compiler/dart2js/memory_compiler.dart
@@ -6,7 +6,7 @@
 
 import 'memory_source_file_helper.dart';
 
-import 'package:compiler/implementation/dart2jslib.dart'
+import 'package:compiler/src/dart2jslib.dart'
        show NullSink;
 
 import 'package:compiler/compiler.dart'
@@ -14,8 +14,8 @@
 
 import 'dart:async';
 
-import 'package:compiler/implementation/mirrors/source_mirrors.dart';
-import 'package:compiler/implementation/mirrors/analyze.dart';
+import 'package:compiler/src/mirrors/source_mirrors.dart';
+import 'package:compiler/src/mirrors/analyze.dart';
 
 class DiagnosticMessage {
   final Uri uri;
diff --git a/tests/compiler/dart2js/memory_source_file_helper.dart b/tests/compiler/dart2js/memory_source_file_helper.dart
index 09d2d86..6dc0969 100644
--- a/tests/compiler/dart2js/memory_source_file_helper.dart
+++ b/tests/compiler/dart2js/memory_source_file_helper.dart
@@ -7,19 +7,19 @@
 import 'dart:async' show Future;
 export 'dart:io' show Platform;
 
-export 'package:compiler/implementation/apiimpl.dart'
+export 'package:compiler/src/apiimpl.dart'
        show Compiler;
 
-export 'package:compiler/implementation/filenames.dart'
+export 'package:compiler/src/filenames.dart'
        show currentDirectory;
 
-import 'package:compiler/implementation/source_file.dart'
+import 'package:compiler/src/source_file.dart'
        show StringSourceFile;
 
-import 'package:compiler/implementation/source_file_provider.dart'
+import 'package:compiler/src/source_file_provider.dart'
        show SourceFileProvider;
 
-export 'package:compiler/implementation/source_file_provider.dart'
+export 'package:compiler/src/source_file_provider.dart'
        show SourceFileProvider, FormattingDiagnosticHandler;
 
 class MemorySourceFileProvider extends SourceFileProvider {
diff --git a/tests/compiler/dart2js/message_kind_helper.dart b/tests/compiler/dart2js/message_kind_helper.dart
index e6b3129..67f1d60 100644
--- a/tests/compiler/dart2js/message_kind_helper.dart
+++ b/tests/compiler/dart2js/message_kind_helper.dart
@@ -7,7 +7,7 @@
 import 'package:expect/expect.dart';
 import 'dart:async';
 
-import 'package:compiler/implementation/dart2jslib.dart' show
+import 'package:compiler/src/dart2jslib.dart' show
     Compiler,
     MessageKind;
 
diff --git a/tests/compiler/dart2js/message_kind_test.dart b/tests/compiler/dart2js/message_kind_test.dart
index 9f68cb3..75ad6c8 100644
--- a/tests/compiler/dart2js/message_kind_test.dart
+++ b/tests/compiler/dart2js/message_kind_test.dart
@@ -5,7 +5,7 @@
 import 'package:expect/expect.dart';
 import 'dart:async';
 import "package:async_helper/async_helper.dart";
-import 'package:compiler/implementation/dart2jslib.dart' show
+import 'package:compiler/src/dart2jslib.dart' show
     DualKind,
     MessageKind;
 
diff --git a/tests/compiler/dart2js/metadata_test.dart b/tests/compiler/dart2js/metadata_test.dart
index 32a2df9..9b6c42c 100644
--- a/tests/compiler/dart2js/metadata_test.dart
+++ b/tests/compiler/dart2js/metadata_test.dart
@@ -3,7 +3,7 @@
 // BSD-style license that can be found in the LICENSE file.
 
 import 'package:async_helper/async_helper.dart';
-import 'package:compiler/implementation/constants/values.dart'
+import 'package:compiler/src/constants/values.dart'
     show PrimitiveConstantValue;
 import 'package:expect/expect.dart';
 import 'compiler_helper.dart';
diff --git a/tests/compiler/dart2js/mirror_helper_rename_test.dart b/tests/compiler/dart2js/mirror_helper_rename_test.dart
index f8f98fc..3549551 100644
--- a/tests/compiler/dart2js/mirror_helper_rename_test.dart
+++ b/tests/compiler/dart2js/mirror_helper_rename_test.dart
@@ -6,12 +6,12 @@
 import 'dart:async';
 import "package:async_helper/async_helper.dart";
 import 'memory_compiler.dart' show compilerFor;
-import 'package:compiler/implementation/apiimpl.dart' show
+import 'package:compiler/src/apiimpl.dart' show
     Compiler;
-import 'package:compiler/implementation/tree/tree.dart' show
+import 'package:compiler/src/tree/tree.dart' show
     Node;
-import 'package:compiler/implementation/dart_backend/dart_backend.dart';
-import 'package:compiler/implementation/mirror_renamer/mirror_renamer.dart';
+import 'package:compiler/src/dart_backend/dart_backend.dart';
+import 'package:compiler/src/mirror_renamer/mirror_renamer.dart';
 
 main() {
   testWithMirrorHelperLibrary(minify: true);
diff --git a/tests/compiler/dart2js/mirror_helper_test.dart b/tests/compiler/dart2js/mirror_helper_test.dart
index c94dd6d..f9e1647 100644
--- a/tests/compiler/dart2js/mirror_helper_test.dart
+++ b/tests/compiler/dart2js/mirror_helper_test.dart
@@ -6,15 +6,15 @@
 import 'dart:async';
 import "package:async_helper/async_helper.dart";
 import 'memory_compiler.dart' show compilerFor;
-import 'package:compiler/implementation/apiimpl.dart' show
+import 'package:compiler/src/apiimpl.dart' show
     Compiler;
-import 'package:compiler/implementation/elements/elements.dart' show
+import 'package:compiler/src/elements/elements.dart' show
     Element, LibraryElement, ClassElement;
-import 'package:compiler/implementation/tree/tree.dart' show
+import 'package:compiler/src/tree/tree.dart' show
     Block, ExpressionStatement, FunctionExpression, Node, Send;
-import 'package:compiler/implementation/dart_backend/dart_backend.dart' show
+import 'package:compiler/src/dart_backend/dart_backend.dart' show
     DartBackend, ElementAst;
-import 'package:compiler/implementation/mirror_renamer/mirror_renamer.dart' show
+import 'package:compiler/src/mirror_renamer/mirror_renamer.dart' show
     MirrorRenamerImpl;
 
 main() {
diff --git a/tests/compiler/dart2js/mirror_helper_unique_minification_test.dart b/tests/compiler/dart2js/mirror_helper_unique_minification_test.dart
index cd87d0d..defbf6c 100644
--- a/tests/compiler/dart2js/mirror_helper_unique_minification_test.dart
+++ b/tests/compiler/dart2js/mirror_helper_unique_minification_test.dart
@@ -6,13 +6,13 @@
 import 'dart:async';
 import "package:async_helper/async_helper.dart";
 import 'memory_compiler.dart' show compilerFor;
-import 'package:compiler/implementation/apiimpl.dart' show
+import 'package:compiler/src/apiimpl.dart' show
     Compiler;
-import 'package:compiler/implementation/dart_backend/dart_backend.dart' show
+import 'package:compiler/src/dart_backend/dart_backend.dart' show
     DartBackend;
-import 'package:compiler/implementation/tree/tree.dart' show
+import 'package:compiler/src/tree/tree.dart' show
     Identifier, Node, Send;
-import 'package:compiler/implementation/mirror_renamer/mirror_renamer.dart' show
+import 'package:compiler/src/mirror_renamer/mirror_renamer.dart' show
     MirrorRenamerImpl;
 
 main() {
diff --git a/tests/compiler/dart2js/mirror_system_helper.dart b/tests/compiler/dart2js/mirror_system_helper.dart
index c592214..497e6a3 100644
--- a/tests/compiler/dart2js/mirror_system_helper.dart
+++ b/tests/compiler/dart2js/mirror_system_helper.dart
@@ -5,12 +5,12 @@
 library mirror_system_helper;

 

 import 'dart:async';

-import 'package:compiler/implementation/mirrors/source_mirrors.dart';

-import 'package:compiler/implementation/mirrors/dart2js_mirrors.dart';

+import 'package:compiler/src/mirrors/source_mirrors.dart';

+import 'package:compiler/src/mirrors/dart2js_mirrors.dart';

 import 'mock_compiler.dart';

 

-export 'package:compiler/implementation/mirrors/source_mirrors.dart';

-export 'package:compiler/implementation/mirrors/mirrors_util.dart';

+export 'package:compiler/src/mirrors/source_mirrors.dart';

+export 'package:compiler/src/mirrors/mirrors_util.dart';

 

 const String SOURCE = 'source';

 final Uri SOURCE_URI = new Uri(scheme: SOURCE, path: SOURCE);

diff --git a/tests/compiler/dart2js/mirror_tree_shaking_test.dart b/tests/compiler/dart2js/mirror_tree_shaking_test.dart
index c42aa55..91a397d 100644
--- a/tests/compiler/dart2js/mirror_tree_shaking_test.dart
+++ b/tests/compiler/dart2js/mirror_tree_shaking_test.dart
@@ -8,14 +8,14 @@
 import "package:async_helper/async_helper.dart";
 import 'memory_source_file_helper.dart';
 
-import 'package:compiler/implementation/dart2jslib.dart'
+import 'package:compiler/src/dart2jslib.dart'
        show NullSink;
 
 import 'package:compiler/compiler.dart'
        show Diagnostic;
 
 import 'dart:async';
-import 'package:compiler/implementation/js_backend/js_backend.dart'
+import 'package:compiler/src/js_backend/js_backend.dart'
        show JavaScriptBackend;
 
 main() {
diff --git a/tests/compiler/dart2js/mirrors/mirrors_reader_test.dart b/tests/compiler/dart2js/mirrors/mirrors_reader_test.dart
index 83529ca..908c20c 100644
--- a/tests/compiler/dart2js/mirrors/mirrors_reader_test.dart
+++ b/tests/compiler/dart2js/mirrors/mirrors_reader_test.dart
@@ -12,9 +12,9 @@
 

 import "mirrors_test_helper.dart";

 import "../../../lib/mirrors/mirrors_reader.dart";

-import "package:compiler/implementation/util/util.dart";

-import "package:compiler/implementation/mirrors/dart2js_mirrors.dart";

-import "package:compiler/implementation/mirrors/source_mirrors.dart";

+import "package:compiler/src/util/util.dart";

+import "package:compiler/src/mirrors/dart2js_mirrors.dart";

+import "package:compiler/src/mirrors/source_mirrors.dart";

 

 class SourceMirrorsReader extends MirrorsReader {

   final Dart2JsMirrorSystem mirrorSystem;

diff --git a/tests/compiler/dart2js/mirrors/mirrors_test_helper.dart b/tests/compiler/dart2js/mirrors/mirrors_test_helper.dart
index 61766cc..1f57a03 100644
--- a/tests/compiler/dart2js/mirrors/mirrors_test_helper.dart
+++ b/tests/compiler/dart2js/mirrors/mirrors_test_helper.dart
@@ -5,9 +5,9 @@
 import 'dart:io';

 import 'dart:async';

 

-import 'package:compiler/implementation/mirrors/source_mirrors.dart';

-import 'package:compiler/implementation/mirrors/analyze.dart' as source_mirrors;

-import 'package:compiler/implementation/source_file_provider.dart';

+import 'package:compiler/src/mirrors/source_mirrors.dart';

+import 'package:compiler/src/mirrors/analyze.dart' as source_mirrors;

+import 'package:compiler/src/source_file_provider.dart';

 

 TypeMirror createInstantiation(TypeSourceMirror type,

                                List<TypeMirror> typeArguments) {

diff --git a/tests/compiler/dart2js/mirrors_exports_test.dart b/tests/compiler/dart2js/mirrors_exports_test.dart
index 0ab74cc..a95d8516 100644
--- a/tests/compiler/dart2js/mirrors_exports_test.dart
+++ b/tests/compiler/dart2js/mirrors_exports_test.dart
@@ -6,7 +6,7 @@
 import 'package:async_helper/async_helper.dart';

 import 'dart:async';

 import 'memory_compiler.dart';

-import 'package:compiler/implementation/mirrors/source_mirrors.dart';

+import 'package:compiler/src/mirrors/source_mirrors.dart';

 

 const SOURCE_FILES = const {

 'main.dart': '''

diff --git a/tests/compiler/dart2js/mirrors_lookup_test.dart b/tests/compiler/dart2js/mirrors_lookup_test.dart
index 42b44ad..2e8802f 100644
--- a/tests/compiler/dart2js/mirrors_lookup_test.dart
+++ b/tests/compiler/dart2js/mirrors_lookup_test.dart
@@ -7,8 +7,8 @@
 import 'package:expect/expect.dart';
 import "package:async_helper/async_helper.dart";
 import 'memory_compiler.dart';
-import 'package:compiler/implementation/mirrors/source_mirrors.dart';
-import 'package:compiler/implementation/mirrors/mirrors_util.dart';
+import 'package:compiler/src/mirrors/source_mirrors.dart';
+import 'package:compiler/src/mirrors/mirrors_util.dart';
 
 const Map MEMORY_SOURCE_FILES = const {
   'main.dart': r"""
diff --git a/tests/compiler/dart2js/mirrors_test.dart b/tests/compiler/dart2js/mirrors_test.dart
index 6e3a6db..339eb3a 100644
--- a/tests/compiler/dart2js/mirrors_test.dart
+++ b/tests/compiler/dart2js/mirrors_test.dart
@@ -4,12 +4,12 @@
 
 import "package:expect/expect.dart";
 import "package:async_helper/async_helper.dart";
-import 'package:compiler/implementation/mirrors/source_mirrors.dart';
-import 'package:compiler/implementation/mirrors/mirrors_util.dart';
-import 'package:compiler/implementation/mirrors/analyze.dart';
-import 'package:compiler/implementation/filenames.dart'
+import 'package:compiler/src/mirrors/source_mirrors.dart';
+import 'package:compiler/src/mirrors/mirrors_util.dart';
+import 'package:compiler/src/mirrors/analyze.dart';
+import 'package:compiler/src/filenames.dart'
        show currentDirectory;
-import 'package:compiler/implementation/source_file_provider.dart';
+import 'package:compiler/src/source_file_provider.dart';
 
 import 'dart:io';
 
diff --git a/tests/compiler/dart2js/mirrors_used_test.dart b/tests/compiler/dart2js/mirrors_used_test.dart
index 6457d26..611dd98 100644
--- a/tests/compiler/dart2js/mirrors_used_test.dart
+++ b/tests/compiler/dart2js/mirrors_used_test.dart
@@ -12,18 +12,18 @@
 import 'memory_compiler.dart' show
     compilerFor;
 
-import 'package:compiler/implementation/apiimpl.dart' show
+import 'package:compiler/src/apiimpl.dart' show
     Compiler;
 
-import 'package:compiler/implementation/constants/values.dart' show
+import 'package:compiler/src/constants/values.dart' show
     ConstantValue,
     TypeConstantValue;
 
-import 'package:compiler/implementation/elements/elements.dart' show
+import 'package:compiler/src/elements/elements.dart' show
     Element,
     Elements;
 
-import 'package:compiler/implementation/js_backend/js_backend.dart' show
+import 'package:compiler/src/js_backend/js_backend.dart' show
     JavaScriptBackend;
 
 void expectOnlyVerboseInfo(Uri uri, int begin, int end, String message, kind) {
diff --git a/tests/compiler/dart2js/missing_file_test.dart b/tests/compiler/dart2js/missing_file_test.dart
index 6a335a6..69b76da 100644
--- a/tests/compiler/dart2js/missing_file_test.dart
+++ b/tests/compiler/dart2js/missing_file_test.dart
@@ -10,7 +10,7 @@
 import "package:async_helper/async_helper.dart";
 import 'memory_source_file_helper.dart';
 
-import 'package:compiler/implementation/dart2jslib.dart'
+import 'package:compiler/src/dart2jslib.dart'
        show NullSink;
 
 import 'package:compiler/compiler.dart'
diff --git a/tests/compiler/dart2js/mixin_typevariable_test.dart b/tests/compiler/dart2js/mixin_typevariable_test.dart
index c7ffcc4..0553589 100644
--- a/tests/compiler/dart2js/mixin_typevariable_test.dart
+++ b/tests/compiler/dart2js/mixin_typevariable_test.dart
@@ -7,8 +7,8 @@
 import 'package:expect/expect.dart';

 import "package:async_helper/async_helper.dart";

 import 'type_test_helper.dart';

-import 'package:compiler/implementation/dart_types.dart';

-import "package:compiler/implementation/elements/elements.dart"

+import 'package:compiler/src/dart_types.dart';

+import "package:compiler/src/elements/elements.dart"

        show Element, ClassElement;

 

 void main() {

@@ -22,7 +22,7 @@
       class M1<M1_T> {}

       class M2<M2_T> {}

       class M3<M3_T> {}

-      

+

       class C1<C1_T> extends S<C1_T> with M1<C1_T>, M2<C1_T>, M3<C1_T> {}

       class C2<C2_T> = S<C2_T> with M1<C2_T>, M2<C2_T>, M3<C2_T>;

       """, expectNoWarningsOrErrors: true).then((env) {

@@ -77,16 +77,16 @@
       class _ {}

       class A<A_T> {}

       class B<B_T, B_S> {}

-      

+

       class C1<C1_T> extends A with B {}

       class C2<C2_T> = A with B;

-      

+

       class D1<D1_T> extends A<D1_T> with B<D1_T, A<D1_T>> {}

       class D2<D2_T> = A<D2_T> with B<D2_T, A<D2_T>>;

-      

+

       class E1<E1_T> extends A<_> with B<_, A<_>> {}

       class E2<E2_T> = A<_> with B<_, A<_>>;

-      

+

       class F1<F1_T> extends A<_> with B<_, B<F1_T, _>> {}

       class F2<F2_T> = A<_> with B<_, B<F2_T, _>>;

       """, expectNoWarningsOrErrors: true).then((env) {

diff --git a/tests/compiler/dart2js/mock_compiler.dart b/tests/compiler/dart2js/mock_compiler.dart
index 703fada..9443988 100644
--- a/tests/compiler/dart2js/mock_compiler.dart
+++ b/tests/compiler/dart2js/mock_compiler.dart
@@ -9,25 +9,25 @@
 import 'dart:collection';
 
 import 'package:compiler/compiler.dart' as api;
-import 'package:compiler/implementation/elements/elements.dart';
-import 'package:compiler/implementation/js_backend/js_backend.dart'
+import 'package:compiler/src/elements/elements.dart';
+import 'package:compiler/src/js_backend/js_backend.dart'
     show JavaScriptBackend;
-import 'package:compiler/implementation/resolution/resolution.dart';
-import 'package:compiler/implementation/source_file.dart';
-import 'package:compiler/implementation/tree/tree.dart';
-import 'package:compiler/implementation/util/util.dart';
+import 'package:compiler/src/resolution/resolution.dart';
+import 'package:compiler/src/source_file.dart';
+import 'package:compiler/src/tree/tree.dart';
+import 'package:compiler/src/util/util.dart';
 import 'parser_helper.dart';
 
-import 'package:compiler/implementation/elements/modelx.dart'
+import 'package:compiler/src/elements/modelx.dart'
     show ElementX,
          LibraryElementX,
          ErroneousElementX,
          FunctionElementX;
 
-import 'package:compiler/implementation/dart2jslib.dart'
+import 'package:compiler/src/dart2jslib.dart'
     hide TreeElementMapping;
 
-import 'package:compiler/implementation/deferred_load.dart'
+import 'package:compiler/src/deferred_load.dart'
     show DeferredLoadTask,
          OutputUnit;
 
@@ -73,6 +73,7 @@
        // affected by inlining support.
        bool disableInlining: true,
        bool trustTypeAnnotations: false,
+       bool enableEnums: false,
        int this.expectedWarnings,
        int this.expectedErrors})
       : sourceFiles = new Map<String, SourceFile>(),
@@ -86,7 +87,8 @@
               emitJavaScript: emitJavaScript,
               preserveComments: preserveComments,
               trustTypeAnnotations: trustTypeAnnotations,
-              showPackageWarnings: true) {
+              showPackageWarnings: true,
+              enableEnums: enableEnums) {
     this.disableInlining = disableInlining;
 
     deferredLoadTask = new MockDeferredLoadTask(this);
@@ -269,8 +271,10 @@
   }
 
   /// Create a new [MockCompiler] and apply it asynchronously to [f].
-  static Future create(f(MockCompiler compiler)) {
-    MockCompiler compiler = new MockCompiler.internal();
+  static Future create(f(MockCompiler compiler),
+                       {bool enableEnums: false}) {
+    MockCompiler compiler = new MockCompiler.internal(
+        enableEnums: enableEnums);
     return compiler.init().then((_) => f(compiler));
   }
 }
diff --git a/tests/compiler/dart2js/mock_libraries.dart b/tests/compiler/dart2js/mock_libraries.dart
index f0d2b72..1a47144 100644
--- a/tests/compiler/dart2js/mock_libraries.dart
+++ b/tests/compiler/dart2js/mock_libraries.dart
@@ -100,6 +100,8 @@
   'boolConversionCheck': 'boolConversionCheck(x) {}',
   'boolTypeCast': 'boolTypeCast(value) {}',
   'boolTypeCheck': 'boolTypeCheck(value) {}',
+  'checkSubtype': 'checkSubtype(object, isField, checks, asField) {}',
+  'checkSubtypeOfRuntimeType': 'checkSubtypeOfRuntimeType(o, t) {}',
   'BoundClosure': r'''abstract class BoundClosure extends Closure {
     var self;
     var target;
@@ -205,7 +207,7 @@
   'subtypeOfRuntimeTypeCast': 'subtypeOfRuntimeTypeCast(object, type) {}',
   'throwAbstractClassInstantiationError':
       'throwAbstractClassInstantiationError(className) {}',
-  'throwCyclicInit': 'throwCyclicInit() {}',
+  'throwCyclicInit': 'throwCyclicInit(staticName) {}',
   'throwExpression': 'throwExpression(e) {}',
   'throwNoSuchMethod':
       'throwNoSuchMethod(obj, name, arguments, expectedArgumentNames) {}',
diff --git a/tests/compiler/dart2js/override_inheritance_test.dart b/tests/compiler/dart2js/override_inheritance_test.dart
index 78e34e8..1407156 100644
--- a/tests/compiler/dart2js/override_inheritance_test.dart
+++ b/tests/compiler/dart2js/override_inheritance_test.dart
@@ -5,7 +5,7 @@
 import 'dart:async';

 import 'package:async_helper/async_helper.dart';

 import 'compiler_helper.dart';

-import 'package:compiler/implementation/resolution/class_members.dart'

+import 'package:compiler/src/resolution/class_members.dart'

     show MembersCreator;

 

 main() {

@@ -1230,12 +1230,12 @@
                        MessageKind.UNIMPLEMENTED_METHOD_CONT]),

 

     check("""

-          class Class implements Function {
-          }
-          """, warnings: MessageKind.UNIMPLEMENTED_METHOD_ONE,
-               infos: []),
-
-    check("""
+          class Class implements Function {

+          }

+          """, warnings: MessageKind.UNIMPLEMENTED_METHOD_ONE,

+               infos: []),

+

+    check("""

           abstract class A {

             get getter; // testAbstractMethod:14

           }

@@ -1543,4 +1543,4 @@
           """, warnings: MessageKind.UNIMPLEMENTED_METHOD_ONE,

                infos: MessageKind.UNIMPLEMENTED_METHOD_CONT),

   ]);

-}
+}

diff --git a/tests/compiler/dart2js/package_root_test.dart b/tests/compiler/dart2js/package_root_test.dart
index 18c6f84..7a5cce3 100644
--- a/tests/compiler/dart2js/package_root_test.dart
+++ b/tests/compiler/dart2js/package_root_test.dart
@@ -10,7 +10,7 @@
 import "package:async_helper/async_helper.dart";
 import 'memory_source_file_helper.dart';
 
-import 'package:compiler/implementation/dart2jslib.dart'
+import 'package:compiler/src/dart2jslib.dart'
        show NullSink;
 
 import 'package:compiler/compiler.dart'
diff --git a/tests/compiler/dart2js/parser_helper.dart b/tests/compiler/dart2js/parser_helper.dart
index 1c27681..c7678a4 100644
--- a/tests/compiler/dart2js/parser_helper.dart
+++ b/tests/compiler/dart2js/parser_helper.dart
@@ -6,21 +6,21 @@
 
 import "package:expect/expect.dart";
 
-import "package:compiler/implementation/elements/elements.dart";
-import "package:compiler/implementation/tree/tree.dart";
-import "package:compiler/implementation/scanner/scannerlib.dart";
-import "package:compiler/implementation/source_file.dart";
-import "package:compiler/implementation/util/util.dart";
+import "package:compiler/src/elements/elements.dart";
+import "package:compiler/src/tree/tree.dart";
+import "package:compiler/src/scanner/scannerlib.dart";
+import "package:compiler/src/source_file.dart";
+import "package:compiler/src/util/util.dart";
 
-import "package:compiler/implementation/elements/modelx.dart"
+import "package:compiler/src/elements/modelx.dart"
     show CompilationUnitElementX, ElementX, LibraryElementX;
 
-import "package:compiler/implementation/dart2jslib.dart";
+import "package:compiler/src/dart2jslib.dart";
 
-export "package:compiler/implementation/dart2jslib.dart"
+export "package:compiler/src/dart2jslib.dart"
     show DiagnosticListener;
 // TODO(ahe): We should have token library to export instead.
-export "package:compiler/implementation/scanner/scannerlib.dart";
+export "package:compiler/src/scanner/scannerlib.dart";
 
 class LoggerCanceler implements DiagnosticListener {
   void cancel(String reason, {node, token, instruction, element}) {
diff --git a/tests/compiler/dart2js/parser_test.dart b/tests/compiler/dart2js/parser_test.dart
index 9582575..6606f88 100644
--- a/tests/compiler/dart2js/parser_test.dart
+++ b/tests/compiler/dart2js/parser_test.dart
@@ -4,7 +4,7 @@
 
 import "package:expect/expect.dart";
 import 'parser_helper.dart';
-import 'package:compiler/implementation/tree/tree.dart';
+import 'package:compiler/src/tree/tree.dart';
 
 void testStatement(String statement) {
   Node node = parseStatement(statement);
diff --git a/tests/compiler/dart2js/part_of_test.dart b/tests/compiler/dart2js/part_of_test.dart
index 4cf2e12..91aa645 100644
--- a/tests/compiler/dart2js/part_of_test.dart
+++ b/tests/compiler/dart2js/part_of_test.dart
@@ -7,7 +7,7 @@
 import "package:expect/expect.dart";
 import "package:async_helper/async_helper.dart";
 import 'mock_compiler.dart';
-import 'package:compiler/implementation/dart2jslib.dart'
+import 'package:compiler/src/dart2jslib.dart'
     show MessageKind;
 
 final libraryUri = Uri.parse('test:library.dart');
diff --git a/tests/compiler/dart2js/patch_test.dart b/tests/compiler/dart2js/patch_test.dart
index 93af03d..41dec19 100644
--- a/tests/compiler/dart2js/patch_test.dart
+++ b/tests/compiler/dart2js/patch_test.dart
@@ -5,12 +5,12 @@
 import 'dart:async';
 import "package:expect/expect.dart";
 import "package:async_helper/async_helper.dart";
-import "package:compiler/implementation/dart2jslib.dart";
-import "package:compiler/implementation/elements/elements.dart";
-import "package:compiler/implementation/tree/tree.dart";
+import "package:compiler/src/dart2jslib.dart";
+import "package:compiler/src/elements/elements.dart";
+import "package:compiler/src/tree/tree.dart";
 import "mock_compiler.dart";
 import "mock_libraries.dart";
-import 'package:compiler/implementation/elements/modelx.dart';
+import 'package:compiler/src/elements/modelx.dart';
 
 Future<Compiler> applyPatch(String script, String patch,
                             {bool analyzeAll: false, bool analyzeOnly: false,
@@ -854,6 +854,49 @@
          MessageKind.NOT_ASSIGNABLE);
 }
 
+void testEffectiveTarget() {
+  String origin = """
+    class A {
+      A() : super();
+      factory A.forward() = B.patchTarget;
+      factory A.forwardTwo() = B.reflectBack;
+    }
+    class B extends A {
+      B() : super();
+      external B.patchTarget();
+      external factory B.reflectBack();
+      B.originTarget() : super();
+    }
+    """;
+  String patch = """
+    @patch class B {
+      B.patchTarget() : super();
+      factory B.reflectBack() : B.originTarget;
+    }
+    """;
+
+  asyncTest(() => applyPatch(origin, patch, analyzeAll: true,
+                 analyzeOnly: true, runCompiler: true).then((compiler) {
+    ClassElement clsA = compiler.coreLibrary.find("A");
+    ClassElement clsB = compiler.coreLibrary.find("B");
+
+    Selector forwardCall = new Selector.callConstructor("forward",
+        compiler.coreLibrary);
+    ConstructorElement forward = clsA.lookupConstructor(forwardCall);
+    ConstructorElement target = forward.effectiveTarget;
+    Expect.isTrue(target.isPatch);
+    Expect.equals("patchTarget", target.name);
+
+    Selector forwardTwoCall = new Selector.callConstructor("forwardTwo",
+        compiler.coreLibrary);
+    ConstructorElement forwardTwo = clsA.lookupConstructor(forwardTwoCall);
+    target = forwardTwo.effectiveTarget;
+    Expect.isFalse(forwardTwo.isErroneous);
+    Expect.isFalse(target.isPatch);
+    Expect.equals("originTarget", target.name);
+  }));
+}
+
 void testTypecheckPatchedMembers() {
   String originText = "external void method();";
   String patchText = """
@@ -902,6 +945,8 @@
 
   testPatchAndSelector();
 
+  testEffectiveTarget(); /// bug: ok
+
   testAnalyzeAllInjectedMembers();
   testTypecheckPatchedMembers();
 }
diff --git a/tests/compiler/dart2js/private_test.dart b/tests/compiler/dart2js/private_test.dart
index 93588de..bbe3780 100644
--- a/tests/compiler/dart2js/private_test.dart
+++ b/tests/compiler/dart2js/private_test.dart
@@ -6,8 +6,8 @@
 import "package:async_helper/async_helper.dart";
 import 'mock_compiler.dart';
 
-import 'package:compiler/implementation/source_file.dart';
-import 'package:compiler/implementation/dart2jslib.dart';
+import 'package:compiler/src/source_file.dart';
+import 'package:compiler/src/dart2jslib.dart';
 
 const String PRIVATE_SOURCE_URI = 'src:private';
 const String PRIVATE_SOURCE = '''
diff --git a/tests/compiler/dart2js/reexport_handled_test.dart b/tests/compiler/dart2js/reexport_handled_test.dart
index 353e0a5..4bdd62d 100644
--- a/tests/compiler/dart2js/reexport_handled_test.dart
+++ b/tests/compiler/dart2js/reexport_handled_test.dart
@@ -7,7 +7,7 @@
 import "package:expect/expect.dart";
 import "package:async_helper/async_helper.dart";
 import 'mock_compiler.dart';
-import 'package:compiler/implementation/elements/elements.dart'
+import 'package:compiler/src/elements/elements.dart'
     show Element,
          LibraryElement;
 
diff --git a/tests/compiler/dart2js/resolution_test.dart b/tests/compiler/dart2js/resolution_test.dart
index f8c0b1a..2305eb8 100644
--- a/tests/compiler/dart2js/resolution_test.dart
+++ b/tests/compiler/dart2js/resolution_test.dart
@@ -9,7 +9,7 @@
 import "package:async_helper/async_helper.dart";
 import 'compiler_helper.dart';
 import 'parser_helper.dart';
-import 'package:compiler/implementation/apiimpl.dart';
+import 'package:compiler/src/apiimpl.dart';
 
 const String NO_RUNTIME_TYPE = r"""
 import 'dart:core' as prefix;
diff --git a/tests/compiler/dart2js/resolver_test.dart b/tests/compiler/dart2js/resolver_test.dart
index ef0f575..bc88820 100644
--- a/tests/compiler/dart2js/resolver_test.dart
+++ b/tests/compiler/dart2js/resolver_test.dart
@@ -7,12 +7,12 @@
 import "package:async_helper/async_helper.dart";
 import 'dart:collection';
 
-import "package:compiler/implementation/resolution/resolution.dart";
+import "package:compiler/src/resolution/resolution.dart";
 import "compiler_helper.dart";
 import "parser_helper.dart";
 
-import 'package:compiler/implementation/dart_types.dart';
-import 'package:compiler/implementation/elements/modelx.dart';
+import 'package:compiler/src/dart_types.dart';
+import 'package:compiler/src/elements/modelx.dart';
 import 'link_helper.dart';
 
 Node buildIdentifier(String name) => new Identifier(scan(name));
@@ -76,6 +76,7 @@
     testNewExpression,
     testTopLevelFields,
     testClassHierarchy,
+    testEnumDeclaration,
     testInitializers,
     testThis,
     testSuperCalls,
@@ -590,8 +591,8 @@
 Future testTwoInterfaces() {
   return MockCompiler.create((MockCompiler compiler) {
     compiler.parseScript(
-        """abstract class I1 {} 
-           abstract class I2 {} 
+        """abstract class I1 {}
+           abstract class I2 {}
            class C implements I1, I2 {}""");
     compiler.resolveStatement("Foo bar;");
 
@@ -761,7 +762,7 @@
     }),
     MockCompiler.create((MockCompiler compiler) {
       compiler.parseScript("""class A<T> {}
-                              class B<Z,W> extends A<int> 
+                              class B<Z,W> extends A<int>
                                   implements I<Z,List<W>> {}
                               class I<X,Y> {}
                               class C extends B<bool,String> {}
@@ -806,6 +807,96 @@
   ]);
 }
 
+Future testEnumDeclaration() {
+  final MAIN = "main";
+  return Future.wait([
+    MockCompiler.create((MockCompiler compiler) {
+      compiler.parseScript("""enum Enum {}
+                              main() { Enum e; }""");
+      FunctionElement mainElement = compiler.mainApp.find(MAIN);
+      compiler.resolver.resolve(mainElement);
+      Expect.equals(0, compiler.warnings.length,
+                    'Unexpected warnings: ${compiler.warnings}');
+      Expect.equals(0, compiler.errors.length,
+                    'Unexpected errors: ${compiler.errors}');
+    }, enableEnums: true),
+
+    MockCompiler.create((MockCompiler compiler) {
+      compiler.parseScript("""enum Enum {}
+                              main() { Enum e = Enum.A; }""");
+      FunctionElement mainElement = compiler.mainApp.find(MAIN);
+      compiler.resolver.resolve(mainElement);
+      Expect.equals(1, compiler.warnings.length,
+                    'Unexpected warnings: ${compiler.warnings}');
+      Expect.equals(MessageKind.MEMBER_NOT_FOUND,
+                    compiler.warnings[0].message.kind);
+      Expect.equals(0, compiler.errors.length,
+                    'Unexpected errors: ${compiler.errors}');
+    }, enableEnums: true),
+
+    MockCompiler.create((MockCompiler compiler) {
+      compiler.parseScript("""enum Enum { A }
+                              main() { Enum e = Enum.A; }""");
+      FunctionElement mainElement = compiler.mainApp.find(MAIN);
+      compiler.resolver.resolve(mainElement);
+      Expect.equals(0, compiler.warnings.length,
+                    'Unexpected warnings: ${compiler.warnings}');
+      Expect.equals(0, compiler.errors.length,
+                    'Unexpected errors: ${compiler.errors}');
+    }, enableEnums: true),
+
+    MockCompiler.create((MockCompiler compiler) {
+      compiler.parseScript("""enum Enum { A }
+                              main() { Enum e = Enum.B; }""");
+      FunctionElement mainElement = compiler.mainApp.find(MAIN);
+      compiler.resolver.resolve(mainElement);
+      Expect.equals(1, compiler.warnings.length,
+                    'Unexpected warnings: ${compiler.warnings}');
+      Expect.equals(MessageKind.MEMBER_NOT_FOUND,
+                    compiler.warnings[0].message.kind);
+      Expect.equals(0, compiler.errors.length,
+                    'Unexpected errors: ${compiler.errors}');
+    }, enableEnums: true),
+
+    MockCompiler.create((MockCompiler compiler) {
+      compiler.parseScript("""enum Enum { A }
+                              main() { List values = Enum.values; }""");
+      FunctionElement mainElement = compiler.mainApp.find(MAIN);
+      compiler.resolver.resolve(mainElement);
+      Expect.equals(0, compiler.warnings.length,
+                    'Unexpected warnings: ${compiler.warnings}');
+      Expect.equals(0, compiler.errors.length,
+                    'Unexpected errors: ${compiler.errors}');
+    }, enableEnums: true),
+
+    MockCompiler.create((MockCompiler compiler) {
+      compiler.parseScript("""enum Enum {}
+                              main() { new Enum(0, ''); }""");
+      FunctionElement mainElement = compiler.mainApp.find(MAIN);
+      compiler.resolver.resolve(mainElement);
+      Expect.equals(0, compiler.warnings.length,
+                    'Unexpected warnings: ${compiler.warnings}');
+      Expect.equals(1, compiler.errors.length,
+                    'Unexpected errors: ${compiler.errors}');
+      Expect.equals(MessageKind.CANNOT_INSTANTIATE_ENUM,
+                    compiler.errors[0].message.kind);
+    }, enableEnums: true),
+
+    MockCompiler.create((MockCompiler compiler) {
+      compiler.parseScript("""enum Enum {}
+                              main() { const Enum(0, ''); }""");
+      FunctionElement mainElement = compiler.mainApp.find(MAIN);
+      compiler.resolver.resolve(mainElement);
+      Expect.equals(0, compiler.warnings.length,
+                    'Unexpected warnings: ${compiler.warnings}');
+      Expect.equals(1, compiler.errors.length,
+                    'Unexpected errors: ${compiler.errors}');
+      Expect.equals(MessageKind.CANNOT_INSTANTIATE_ENUM,
+                    compiler.errors[0].message.kind);
+    }, enableEnums: true),
+  ]);
+}
+
 Future testInitializers() {
   return Future.forEach([
     () {
diff --git a/tests/compiler/dart2js/scanner_offset_length_test.dart b/tests/compiler/dart2js/scanner_offset_length_test.dart
index 531be7b..4c428dd 100644
--- a/tests/compiler/dart2js/scanner_offset_length_test.dart
+++ b/tests/compiler/dart2js/scanner_offset_length_test.dart
@@ -3,7 +3,7 @@
 // BSD-style license that can be found in the LICENSE file.
 
 import "package:expect/expect.dart";
-import 'package:compiler/implementation/scanner/scannerlib.dart';
+import 'package:compiler/src/scanner/scannerlib.dart';
 
 Token scan(String text) =>
     new StringScanner.fromString(text, includeComments: true).tokenize();
diff --git a/tests/compiler/dart2js/scanner_test.dart b/tests/compiler/dart2js/scanner_test.dart
index 11d5133..f9f42fa 100644
--- a/tests/compiler/dart2js/scanner_test.dart
+++ b/tests/compiler/dart2js/scanner_test.dart
@@ -3,8 +3,8 @@
 // BSD-style license that can be found in the LICENSE file.
 
 import "package:expect/expect.dart";
-import 'package:compiler/implementation/scanner/scannerlib.dart';
-import 'package:compiler/implementation/util/characters.dart';
+import 'package:compiler/src/scanner/scannerlib.dart';
+import 'package:compiler/src/util/characters.dart';
 import 'dart:typed_data';
 
 Token scan(List<int> bytes) => new Utf8BytesScanner.fromBytes(bytes).tokenize();
diff --git a/tests/compiler/dart2js/setlet_test.dart b/tests/compiler/dart2js/setlet_test.dart
index c4dc493..8c9a9e5 100644
--- a/tests/compiler/dart2js/setlet_test.dart
+++ b/tests/compiler/dart2js/setlet_test.dart
@@ -4,7 +4,7 @@
 
 import "package:expect/expect.dart";
 import 'dart:collection';
-import 'package:compiler/implementation/util/setlet.dart';
+import 'package:compiler/src/util/setlet.dart';
 
 main() {
   for (int i = 1; i <= 32; i++) {
diff --git a/tests/compiler/dart2js/sha1_test.dart b/tests/compiler/dart2js/sha1_test.dart
index 5e7e491..d622eec 100644
--- a/tests/compiler/dart2js/sha1_test.dart
+++ b/tests/compiler/dart2js/sha1_test.dart
@@ -6,7 +6,7 @@
 // into the compiler.
 
 library sha1_test;
-import 'package:compiler/implementation/hash/sha1.dart';
+import 'package:compiler/src/hash/sha1.dart';
 
 import "package:unittest/unittest.dart";
 
diff --git a/tests/compiler/dart2js/simple_inferrer_callers_test.dart b/tests/compiler/dart2js/simple_inferrer_callers_test.dart
index 115ccc5..acd8872 100644
--- a/tests/compiler/dart2js/simple_inferrer_callers_test.dart
+++ b/tests/compiler/dart2js/simple_inferrer_callers_test.dart
@@ -7,8 +7,8 @@
 
 import 'package:expect/expect.dart';
 import "package:async_helper/async_helper.dart";
-import 'package:compiler/implementation/types/types.dart';
-import 'package:compiler/implementation/inferrer/type_graph_inferrer.dart';
+import 'package:compiler/src/types/types.dart';
+import 'package:compiler/src/inferrer/type_graph_inferrer.dart';
 
 import 'compiler_helper.dart';
 import 'parser_helper.dart';
diff --git a/tests/compiler/dart2js/simple_inferrer_relations_test.dart b/tests/compiler/dart2js/simple_inferrer_relations_test.dart
index 70706e2..de080f4 100644
--- a/tests/compiler/dart2js/simple_inferrer_relations_test.dart
+++ b/tests/compiler/dart2js/simple_inferrer_relations_test.dart
@@ -4,7 +4,7 @@
 
 import 'package:expect/expect.dart';
 import "package:async_helper/async_helper.dart";
-import 'package:compiler/implementation/types/types.dart' show TypeMask;
+import 'package:compiler/src/types/types.dart' show TypeMask;
 
 import 'compiler_helper.dart';
 import 'parser_helper.dart';
diff --git a/tests/compiler/dart2js/simple_inferrer_test.dart b/tests/compiler/dart2js/simple_inferrer_test.dart
index 2d59561..471a84a 100644
--- a/tests/compiler/dart2js/simple_inferrer_test.dart
+++ b/tests/compiler/dart2js/simple_inferrer_test.dart
@@ -4,7 +4,7 @@
 
 import 'package:expect/expect.dart';
 import "package:async_helper/async_helper.dart";
-import 'package:compiler/implementation/types/types.dart' show TypeMask;
+import 'package:compiler/src/types/types.dart' show TypeMask;
 import 'type_mask_test_helper.dart';
 
 import 'compiler_helper.dart';
diff --git a/tests/compiler/dart2js/simple_inferrer_try_catch_test.dart b/tests/compiler/dart2js/simple_inferrer_try_catch_test.dart
index 7a3f570..19053d8 100644
--- a/tests/compiler/dart2js/simple_inferrer_try_catch_test.dart
+++ b/tests/compiler/dart2js/simple_inferrer_try_catch_test.dart
@@ -4,7 +4,7 @@
 
 import 'package:expect/expect.dart';
 import "package:async_helper/async_helper.dart";
-import 'package:compiler/implementation/types/types.dart'
+import 'package:compiler/src/types/types.dart'
     show TypeMask;
 
 import 'compiler_helper.dart';
diff --git a/tests/compiler/dart2js/source_map_d2js_validity_test.dart b/tests/compiler/dart2js/source_map_d2js_validity_test.dart
index 4fb5e0a..60de83f 100644
--- a/tests/compiler/dart2js/source_map_d2js_validity_test.dart
+++ b/tests/compiler/dart2js/source_map_d2js_validity_test.dart
@@ -6,8 +6,8 @@
 import 'dart:io';
 
 import 'package:async_helper/async_helper.dart';
-import 'package:compiler/implementation/dart2js.dart' as entry;
-import 'package:compiler/implementation/apiimpl.dart';
+import 'package:compiler/src/dart2js.dart' as entry;
+import 'package:compiler/src/apiimpl.dart';
 
 import 'source_map_validator_helper.dart';
 import 'compiler_alt.dart' as alt;
diff --git a/tests/compiler/dart2js/source_map_deferred_d2js_validity_test.dart b/tests/compiler/dart2js/source_map_deferred_d2js_validity_test.dart
index 2b7191f..bb5a956 100644
--- a/tests/compiler/dart2js/source_map_deferred_d2js_validity_test.dart
+++ b/tests/compiler/dart2js/source_map_deferred_d2js_validity_test.dart
@@ -6,8 +6,8 @@
 import 'dart:io';
 
 import 'package:async_helper/async_helper.dart';
-import 'package:compiler/implementation/dart2js.dart' as entry;
-import 'package:compiler/implementation/apiimpl.dart';
+import 'package:compiler/src/dart2js.dart' as entry;
+import 'package:compiler/src/apiimpl.dart';
 
 import 'source_map_validator_helper.dart';
 import 'compiler_alt.dart' as alt;
diff --git a/tests/compiler/dart2js/source_map_validator_helper.dart b/tests/compiler/dart2js/source_map_validator_helper.dart
index 4487ec4..4083e10 100644
--- a/tests/compiler/dart2js/source_map_validator_helper.dart
+++ b/tests/compiler/dart2js/source_map_validator_helper.dart
@@ -9,13 +9,13 @@
 import 'package:path/path.dart' as path;
 import 'package:expect/expect.dart';
 import 'package:source_maps/source_maps.dart' hide SourceFile;
-import 'package:compiler/implementation/apiimpl.dart';
-import 'package:compiler/implementation/elements/elements.dart'
+import 'package:compiler/src/apiimpl.dart';
+import 'package:compiler/src/elements/elements.dart'
     show LibraryElement,
          CompilationUnitElement,
          ClassElement,
          AstElement;
-import 'package:compiler/implementation/source_file.dart' show SourceFile;
+import 'package:compiler/src/source_file.dart' show SourceFile;
 
 validateSourceMap(Uri targetUri, [Compiler compiler]) {
   Uri mapUri = getMapUri(targetUri);
diff --git a/tests/compiler/dart2js/source_mapping_test.dart b/tests/compiler/dart2js/source_mapping_test.dart
index e1f73c0..23bb251 100644
--- a/tests/compiler/dart2js/source_mapping_test.dart
+++ b/tests/compiler/dart2js/source_mapping_test.dart
@@ -5,10 +5,10 @@
 import 'dart:async';
 import "package:expect/expect.dart";
 import "package:async_helper/async_helper.dart";
-import "package:compiler/implementation/dart2jslib.dart";
-import 'package:compiler/implementation/source_file.dart';
+import "package:compiler/src/dart2jslib.dart";
+import 'package:compiler/src/source_file.dart';
 import "mock_compiler.dart";
-import 'package:compiler/implementation/js_backend/js_backend.dart';
+import 'package:compiler/src/js_backend/js_backend.dart';
 
 Future<CodeBuffer> compileAll(SourceFile sourceFile) {
   MockCompiler compiler = new MockCompiler.internal();
diff --git a/tests/compiler/dart2js/space_test.dart b/tests/compiler/dart2js/space_test.dart
index 59c5f04..fbf933d 100644
--- a/tests/compiler/dart2js/space_test.dart
+++ b/tests/compiler/dart2js/space_test.dart
@@ -3,7 +3,7 @@
 // BSD-style license that can be found in the LICENSE file.
 
 import 'dart:io';
-import 'package:compiler/implementation/dart2js.dart'
+import 'package:compiler/src/dart2js.dart'
   as dart2js;
 
 main() {
diff --git a/tests/compiler/dart2js/stats_test.dart b/tests/compiler/dart2js/stats_test.dart
index c13335a..8aad173 100644
--- a/tests/compiler/dart2js/stats_test.dart
+++ b/tests/compiler/dart2js/stats_test.dart
@@ -3,7 +3,7 @@
 // BSD-style license that can be found in the LICENSE file.
 
 import 'package:expect/expect.dart';
-import 'package:compiler/implementation/helpers/helpers.dart';
+import 'package:compiler/src/helpers/helpers.dart';
 
 class CollectingOutput implements StatsOutput {
   final StringBuffer sb = new StringBuffer();
diff --git a/tests/compiler/dart2js/strip_comment_test.dart b/tests/compiler/dart2js/strip_comment_test.dart
index 04e8fb3..40921a9 100644
--- a/tests/compiler/dart2js/strip_comment_test.dart
+++ b/tests/compiler/dart2js/strip_comment_test.dart
@@ -5,7 +5,7 @@
 library strip_comment_test;
 
 import "package:expect/expect.dart";
-import 'package:compiler/implementation/mirrors/mirrors_util.dart';
+import 'package:compiler/src/mirrors/mirrors_util.dart';
 
 testComment(String strippedText, String commentText) {
   Expect.stringEquals(strippedText, stripComment(commentText));
diff --git a/tests/compiler/dart2js/subtype_test.dart b/tests/compiler/dart2js/subtype_test.dart
index 45179bd..bdd9e66 100644
--- a/tests/compiler/dart2js/subtype_test.dart
+++ b/tests/compiler/dart2js/subtype_test.dart
@@ -7,8 +7,8 @@
 import 'package:expect/expect.dart';
 import "package:async_helper/async_helper.dart";
 import 'type_test_helper.dart';
-import 'package:compiler/implementation/dart_types.dart';
-import "package:compiler/implementation/elements/elements.dart"
+import 'package:compiler/src/dart_types.dart';
+import "package:compiler/src/elements/elements.dart"
        show Element, ClassElement;
 
 void main() {
diff --git a/tests/compiler/dart2js/trust_type_annotations2_test.dart b/tests/compiler/dart2js/trust_type_annotations2_test.dart
new file mode 100644
index 0000000..0ff5a916
--- /dev/null
+++ b/tests/compiler/dart2js/trust_type_annotations2_test.dart
@@ -0,0 +1,34 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:expect/expect.dart';
+import "package:async_helper/async_helper.dart";
+import 'memory_compiler.dart';
+
+const MEMORY_SOURCE_FILES = const {
+  'main.dart': '''
+
+foo(int x, int y) {
+  return x + y;
+}
+
+main (x, y) {
+  if (x != null) {
+    if (y != null) {
+      return foo(x, y);
+    }
+  }
+}
+''',
+};
+
+main() {
+  var compiler = compilerFor(MEMORY_SOURCE_FILES,
+                             options: ['--trust-type-annotations']);
+  asyncTest(() => compiler.runCompiler(Uri.parse('memory:main.dart')).then((_) {
+    var element = compiler.mainApp.findExported('main');
+    var code = compiler.backend.assembleCode(element);
+    Expect.isTrue(code.contains('+'), code);
+  }));
+}
diff --git a/tests/compiler/dart2js/type_checker_test.dart b/tests/compiler/dart2js/type_checker_test.dart
index 644c59c..c7ab34b 100644
--- a/tests/compiler/dart2js/type_checker_test.dart
+++ b/tests/compiler/dart2js/type_checker_test.dart
@@ -5,19 +5,19 @@
 import 'dart:async';
 import 'package:async_helper/async_helper.dart';
 import 'package:expect/expect.dart';
-import 'package:compiler/implementation/elements/elements.dart';
-import 'package:compiler/implementation/tree/tree.dart';
-import 'package:compiler/implementation/util/util.dart';
-import 'package:compiler/implementation/source_file.dart';
+import 'package:compiler/src/elements/elements.dart';
+import 'package:compiler/src/tree/tree.dart';
+import 'package:compiler/src/util/util.dart';
+import 'package:compiler/src/source_file.dart';
 import 'mock_compiler.dart';
 import 'parser_helper.dart';
 
-import 'package:compiler/implementation/elements/modelx.dart'
+import 'package:compiler/src/elements/modelx.dart'
   show ClassElementX, CompilationUnitElementX, ElementX, FunctionElementX;
 
-import 'package:compiler/implementation/dart2jslib.dart';
+import 'package:compiler/src/dart2jslib.dart';
 
-import 'package:compiler/implementation/dart_types.dart';
+import 'package:compiler/src/dart_types.dart';
 
 final MessageKind NOT_ASSIGNABLE = MessageKind.NOT_ASSIGNABLE;
 final MessageKind MEMBER_NOT_FOUND = MessageKind.MEMBER_NOT_FOUND;
diff --git a/tests/compiler/dart2js/type_combination_test.dart b/tests/compiler/dart2js/type_combination_test.dart
index 1da033d..6914aba 100644
--- a/tests/compiler/dart2js/type_combination_test.dart
+++ b/tests/compiler/dart2js/type_combination_test.dart
@@ -5,9 +5,9 @@
 import "package:async_helper/async_helper.dart";
 import "package:expect/expect.dart";
 import "compiler_helper.dart";
-import "package:compiler/implementation/types/types.dart";
+import "package:compiler/src/types/types.dart";
 import "type_mask_test_helper.dart";
-import 'package:compiler/implementation/js_backend/js_backend.dart';
+import 'package:compiler/src/js_backend/js_backend.dart';
 
 TypeMask nullType;
 TypeMask objectType;
diff --git a/tests/compiler/dart2js/type_equals_test.dart b/tests/compiler/dart2js/type_equals_test.dart
index 4831015..2d01b36 100644
--- a/tests/compiler/dart2js/type_equals_test.dart
+++ b/tests/compiler/dart2js/type_equals_test.dart
@@ -4,7 +4,7 @@
 
 import "package:expect/expect.dart";
 import "package:async_helper/async_helper.dart";
-import 'package:compiler/implementation/dart_types.dart';
+import 'package:compiler/src/dart_types.dart';
 import "compiler_helper.dart";
 import "parser_helper.dart";
 
diff --git a/tests/compiler/dart2js/type_mask2_test.dart b/tests/compiler/dart2js/type_mask2_test.dart
index 80535ce..25c19e1 100644
--- a/tests/compiler/dart2js/type_mask2_test.dart
+++ b/tests/compiler/dart2js/type_mask2_test.dart
@@ -7,9 +7,9 @@
 import 'package:expect/expect.dart';
 import 'package:async_helper/async_helper.dart';
 import 'type_test_helper.dart';
-import 'package:compiler/implementation/elements/elements.dart'
+import 'package:compiler/src/elements/elements.dart'
        show Element, ClassElement;
-import 'package:compiler/implementation/types/types.dart';
+import 'package:compiler/src/types/types.dart';
 
 isCheckedMode() {
   try {
diff --git a/tests/compiler/dart2js/type_mask_test.dart b/tests/compiler/dart2js/type_mask_test.dart
index 3bc023d..7cbe9e4 100644
--- a/tests/compiler/dart2js/type_mask_test.dart
+++ b/tests/compiler/dart2js/type_mask_test.dart
@@ -6,7 +6,7 @@
 import "package:async_helper/async_helper.dart";
 import 'compiler_helper.dart';
 import 'parser_helper.dart';
-import "package:compiler/implementation/types/types.dart";
+import "package:compiler/src/types/types.dart";
 
 const String CODE = """
 class A {}
diff --git a/tests/compiler/dart2js/type_mask_test_helper.dart b/tests/compiler/dart2js/type_mask_test_helper.dart
index f348138..1efb937 100644
--- a/tests/compiler/dart2js/type_mask_test_helper.dart
+++ b/tests/compiler/dart2js/type_mask_test_helper.dart
@@ -4,8 +4,8 @@
 
 library type_mask_test_helper;
 
-import 'package:compiler/implementation/types/types.dart';
-import 'package:compiler/implementation/dart2jslib.dart'
+import 'package:compiler/src/types/types.dart';
+import 'package:compiler/src/dart2jslib.dart'
     show Compiler;
 
 TypeMask simplify(TypeMask mask, Compiler compiler) {
diff --git a/tests/compiler/dart2js/type_order_test.dart b/tests/compiler/dart2js/type_order_test.dart
index d3dd717..a3337f3 100644
--- a/tests/compiler/dart2js/type_order_test.dart
+++ b/tests/compiler/dart2js/type_order_test.dart
@@ -7,8 +7,8 @@
 import 'package:expect/expect.dart';

 import 'package:async_helper/async_helper.dart';

 import 'type_test_helper.dart';

-import 'package:compiler/implementation/dart_types.dart';

-import "package:compiler/implementation/elements/elements.dart"

+import 'package:compiler/src/dart_types.dart';

+import "package:compiler/src/elements/elements.dart"

        show Element, ClassElement, TypedefElement;

 

 void main() {

diff --git a/tests/compiler/dart2js/type_representation_test.dart b/tests/compiler/dart2js/type_representation_test.dart
index fd1430b..7bd7f3c 100644
--- a/tests/compiler/dart2js/type_representation_test.dart
+++ b/tests/compiler/dart2js/type_representation_test.dart
@@ -7,11 +7,11 @@
 import 'package:expect/expect.dart';
 import "package:async_helper/async_helper.dart";
 import 'type_test_helper.dart';
-import 'package:compiler/implementation/dart_types.dart';
-import 'package:compiler/implementation/js/js.dart';
-import 'package:compiler/implementation/elements/elements.dart'
+import 'package:compiler/src/dart_types.dart';
+import 'package:compiler/src/js/js.dart';
+import 'package:compiler/src/elements/elements.dart'
        show Element, ClassElement;
-import 'package:compiler/implementation/js_backend/js_backend.dart'
+import 'package:compiler/src/js_backend/js_backend.dart'
        show JavaScriptBackend, TypeRepresentationGenerator;
 
 void main() {
diff --git a/tests/compiler/dart2js/type_substitution_test.dart b/tests/compiler/dart2js/type_substitution_test.dart
index 25b4dbc..b166c1b 100644
--- a/tests/compiler/dart2js/type_substitution_test.dart
+++ b/tests/compiler/dart2js/type_substitution_test.dart
@@ -6,7 +6,7 @@
 
 import "package:expect/expect.dart";
 import "package:async_helper/async_helper.dart";
-import 'package:compiler/implementation/dart_types.dart';
+import 'package:compiler/src/dart_types.dart';
 import "compiler_helper.dart";
 import "parser_helper.dart";
 import "type_test_helper.dart";
diff --git a/tests/compiler/dart2js/type_test_helper.dart b/tests/compiler/dart2js/type_test_helper.dart
index c0f2e60..45cd843 100644
--- a/tests/compiler/dart2js/type_test_helper.dart
+++ b/tests/compiler/dart2js/type_test_helper.dart
@@ -8,10 +8,10 @@
 import 'package:expect/expect.dart';
 import 'compiler_helper.dart' as mock;
 import 'memory_compiler.dart' as memory;
-import 'package:compiler/implementation/dart_types.dart';
-import 'package:compiler/implementation/dart2jslib.dart'
+import 'package:compiler/src/dart_types.dart';
+import 'package:compiler/src/dart2jslib.dart'
     show Compiler;
-import 'package:compiler/implementation/elements/elements.dart'
+import 'package:compiler/src/elements/elements.dart'
     show Element,
          TypeDeclarationElement,
          ClassElement;
diff --git a/tests/compiler/dart2js/type_variable_occurrence_test.dart b/tests/compiler/dart2js/type_variable_occurrence_test.dart
index 7e69860..a198cd4 100644
--- a/tests/compiler/dart2js/type_variable_occurrence_test.dart
+++ b/tests/compiler/dart2js/type_variable_occurrence_test.dart
@@ -7,8 +7,8 @@
 import 'package:expect/expect.dart';
 import "package:async_helper/async_helper.dart";
 import 'type_test_helper.dart';
-import 'package:compiler/implementation/dart_types.dart';
-import "package:compiler/implementation/elements/elements.dart"
+import 'package:compiler/src/dart_types.dart';
+import "package:compiler/src/elements/elements.dart"
        show Element, ClassElement;
 
 void main() {
diff --git a/tests/compiler/dart2js/union_type_test.dart b/tests/compiler/dart2js/union_type_test.dart
index 5cbecc1..1b7e095 100644
--- a/tests/compiler/dart2js/union_type_test.dart
+++ b/tests/compiler/dart2js/union_type_test.dart
@@ -7,8 +7,8 @@
 import "compiler_helper.dart";
 import "parser_helper.dart";
 
-import "package:compiler/implementation/types/types.dart";
-import "package:compiler/implementation/dart_types.dart";
+import "package:compiler/src/types/types.dart";
+import "package:compiler/src/dart_types.dart";
 
 main() {
   MockCompiler compiler = new MockCompiler.internal(analyzeOnly: true);
diff --git a/tests/compiler/dart2js/unneeded_part_js_test.dart b/tests/compiler/dart2js/unneeded_part_js_test.dart
index dadcb60..6c52339 100644
--- a/tests/compiler/dart2js/unneeded_part_js_test.dart
+++ b/tests/compiler/dart2js/unneeded_part_js_test.dart
@@ -8,7 +8,7 @@
 import "package:async_helper/async_helper.dart";
 import 'memory_source_file_helper.dart';
 
-import 'package:compiler/implementation/dart2jslib.dart'
+import 'package:compiler/src/dart2jslib.dart'
        show NullSink;
 
 import 'package:compiler/compiler.dart'
diff --git a/tests/compiler/dart2js/unparser2_test.dart b/tests/compiler/dart2js/unparser2_test.dart
index bbf3e3d..88940b6 100644
--- a/tests/compiler/dart2js/unparser2_test.dart
+++ b/tests/compiler/dart2js/unparser2_test.dart
@@ -3,18 +3,18 @@
 // BSD-style license that can be found in the LICENSE file.
 
 import "package:expect/expect.dart";
-import "package:compiler/implementation/scanner/scannerlib.dart";
-import "package:compiler/implementation/tree/tree.dart";
+import "package:compiler/src/scanner/scannerlib.dart";
+import "package:compiler/src/tree/tree.dart";
 
-import "package:compiler/implementation/dart2jslib.dart"
+import "package:compiler/src/dart2jslib.dart"
     show DiagnosticListener,
          Script;
 
-import "package:compiler/implementation/elements/elements.dart"
+import "package:compiler/src/elements/elements.dart"
     show CompilationUnitElement,
          LibraryElement;
 
-import "package:compiler/implementation/elements/modelx.dart"
+import "package:compiler/src/elements/modelx.dart"
     show CompilationUnitElementX,
          LibraryElementX;
 
@@ -25,6 +25,11 @@
   testClass1Field1Method();
   testClass1Field2Method();
   testClassDefTypeParam();
+  testEnumDef();
+  testEnum1Value();
+  testEnum2Value();
+  testEnum3Value();
+  testEnum3CommaValue();
 }
 
 testClassDef() {
@@ -51,10 +56,34 @@
   compareCode('class T<X>{}');
 }
 
-void compareCode(String code) {
-  Expect.equals(code, doUnparse(code));
+testEnumDef() {
+  compareCode('enum T {}');
 }
 
+testEnum1Value() {
+  compareCode('enum T {A}');
+}
+
+testEnum2Value() {
+  compareCode('enum T {A,B}');
+}
+
+testEnum3Value() {
+  compareCode('enum T {A,B,C}');
+}
+
+testEnum3CommaValue() {
+  compareCode('enum T {A,B,C,}', expectedResult: 'enum T {A,B,C}');
+}
+
+void compareCode(String code, {String expectedResult}) {
+  if (expectedResult == null) {
+    expectedResult = code;
+  }
+  Expect.equals(expectedResult, doUnparse(code));
+}
+
+
 String doUnparse(String source) {
   MessageCollector diagnosticListener = new MessageCollector();
   Script script = new Script(null, null, null);
diff --git a/tests/compiler/dart2js/unparser_test.dart b/tests/compiler/dart2js/unparser_test.dart
index 8130806..86d8ab9 100644
--- a/tests/compiler/dart2js/unparser_test.dart
+++ b/tests/compiler/dart2js/unparser_test.dart
@@ -5,7 +5,7 @@
 import "package:expect/expect.dart";
 import 'parser_helper.dart';
 import 'mock_compiler.dart';
-import 'package:compiler/implementation/tree/tree.dart';
+import 'package:compiler/src/tree/tree.dart';
 
 testUnparse(String statement) {
   Node node = parseStatement(statement);
diff --git a/tests/compiler/dart2js/uri_extras_test.dart b/tests/compiler/dart2js/uri_extras_test.dart
index fcbc49c..6e263d6 100644
--- a/tests/compiler/dart2js/uri_extras_test.dart
+++ b/tests/compiler/dart2js/uri_extras_test.dart
@@ -4,7 +4,7 @@
 
 import "package:expect/expect.dart";
 
-import 'package:compiler/implementation/util/uri_extras.dart';
+import 'package:compiler/src/util/uri_extras.dart';
 
 
 void testRelativize() {
diff --git a/tests/compiler/dart2js/use_checks_test.dart b/tests/compiler/dart2js/use_checks_test.dart
new file mode 100644
index 0000000..67efbd0
--- /dev/null
+++ b/tests/compiler/dart2js/use_checks_test.dart
@@ -0,0 +1,33 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:expect/expect.dart';
+import "package:async_helper/async_helper.dart";
+import 'memory_compiler.dart';
+
+const MEMORY_SOURCE_FILES = const {
+  'main.dart': '''
+main (x, y) {
+  if (x != null) {
+    if (y != null) {
+      // Forces x and y to be int-checked.
+      int a = x;
+      int b = y;
+      // Now we must be able to do a direct "+" operation in JS.
+      return x + y;
+    }
+  }
+}
+''',
+};
+
+main() {
+  var compiler = compilerFor(MEMORY_SOURCE_FILES,
+                             options: ['--enable-checked-mode']);
+  asyncTest(() => compiler.runCompiler(Uri.parse('memory:main.dart')).then((_) {
+    var element = compiler.mainApp.findExported('main');
+    var code = compiler.backend.assembleCode(element);
+    Expect.isTrue(code.contains('+'), code);
+  }));
+}
diff --git a/tests/compiler/dart2js/value_range2_test.dart b/tests/compiler/dart2js/value_range2_test.dart
index 5bebf99..dfc2fde 100644
--- a/tests/compiler/dart2js/value_range2_test.dart
+++ b/tests/compiler/dart2js/value_range2_test.dart
@@ -3,9 +3,9 @@
 // BSD-style license that can be found in the LICENSE file.
 
 import "package:expect/expect.dart";
-import "package:compiler/implementation/ssa/ssa.dart";
-import "package:compiler/implementation/dart2jslib.dart";
-import "package:compiler/implementation/js_backend/js_backend.dart";
+import "package:compiler/src/ssa/ssa.dart";
+import "package:compiler/src/dart2jslib.dart";
+import "package:compiler/src/js_backend/js_backend.dart";
 
 ValueRangeInfo info = new ValueRangeInfo(const JavaScriptConstantSystem());
 
diff --git a/tests/compiler/dart2js/warnings_checker.dart b/tests/compiler/dart2js/warnings_checker.dart
index ed0cdde..cdcd02a 100644
--- a/tests/compiler/dart2js/warnings_checker.dart
+++ b/tests/compiler/dart2js/warnings_checker.dart
@@ -10,10 +10,10 @@
 import 'package:expect/expect.dart';

 import 'package:async_helper/async_helper.dart';

 import 'memory_compiler.dart';

-import 'package:compiler/implementation/filenames.dart';

-import 'package:compiler/implementation/source_file.dart';

-import 'package:compiler/implementation/source_file_provider.dart';

-import 'package:compiler/implementation/util/uri_extras.dart';

+import 'package:compiler/src/filenames.dart';

+import 'package:compiler/src/source_file.dart';

+import 'package:compiler/src/source_file_provider.dart';

+import 'package:compiler/src/util/uri_extras.dart';

 import 'dart:convert';

 

 void checkWarnings(Map<String, dynamic> tests, [List<String> arguments]) {

diff --git a/tests/corelib/corelib.status b/tests/corelib/corelib.status
index 743832b..f1be4a96 100644
--- a/tests/corelib/corelib.status
+++ b/tests/corelib/corelib.status
@@ -92,6 +92,12 @@
 
 [ $runtime == ff || $runtime == jsshell ]
 unicode_test: Fail
+# Firefox takes advantage of the ECMAScript number parsing cop-out clause
+# (presumably added to allow Mozilla's existing behavior)
+# and only looks at the first 20 significant digits.
+# The Dart VM and the other ECMAScript implementations follow the correct
+# IEEE-754 rounding algorithm.
+double_parse_test: Fail, OK
 
 [ $runtime == ff || $runtime == jsshell || $runtime == safari || $runtime == safarimobilesim ]
 double_round3_test: Fail, OK # Runtime rounds 0.49999999999999994 to 1.
diff --git a/tests/corelib/double_parse_test.dart b/tests/corelib/double_parse_test.dart
index dc57709..1f26e8a 100644
--- a/tests/corelib/double_parse_test.dart
+++ b/tests/corelib/double_parse_test.dart
@@ -35,11 +35,11 @@
   "\uFEFF"
 ];
 
-void expectNumEquals(double expect, var actual, String message) {
-  if (expect.isNaN) {
+void expectNumEquals(double expected, var actual, String message) {
+  if (expected.isNaN) {
     Expect.isTrue(actual is double && actual.isNaN, "isNaN: $message");
   } else {
-    Expect.identical(expect, actual, message);
+    Expect.identical(expected, actual, message);
   }
 }
 
@@ -177,98 +177,927 @@
     }
   }
 
-  testParse("9007199254740993", 9007199254740992.0);
-  testParse("9.007199254740993e15", 9007199254740992.0);
-  testParse("0.00000009007199254740991e23", 9007199254740991.0);
-
-  testParse("0.000000000000000000000000000000000000000000000000"
-            "00000000000000000000000000000000000000000000000000"
-            "00000000000000000000000000000000000000000000000000"
-            "00000000000000000000000000000000000000000000000000"
-            "00000000000000000000000000000000000000000000000000"
-            "00000000000000000000000000000000000000000000000000"
-            "00000000000000000000000004940656458412465441765687"
-            "92868221372365059802614324764425585682500675507270"
-            "20875186529983636163599237979656469544571773092665"
-            "67103559397963987747960107818781263007131903114045"
-            "27845817167848982103688718636056998730723050006387"
-            "40915356498438731247339727316961514003171538539807"
-            "41262385655911710266585566867681870395603106249319"
-            "45271591492455329305456544401127480129709999541931"
-            "98940908041656332452475714786901472678015935523861"
-            "15501348035264934720193790268107107491703332226844"
-            "75333572083243193609238289345836806010601150616980"
-            "97530783422773183292479049825247307763759272478746"
-            "56084778203734469699533647017972677717585125660551"
-            "19913150489110145103786273816725095583738973359899"
-            "36648099411642057026370902792427675445652290875386"
-            "82506419718265533447265625", 5e-324);
-
-  testParse("0.000000000000000000000000000000000000000000000000"
-            "00000000000000000000000000000000000000000000000000"
-            "00000000000000000000000000000000000000000000000000"
-            "00000000000000000000000000000000000000000000000000"
-            "00000000000000000000000000000000000000000000000000"
-            "00000000000000000000000000000000000000000000000000"
-            "00000000000000000000000002470328229206232720882843"
-            "96434110686182529901307162382212792841250337753635"
-            "10437593264991818081799618989828234772285886546332"
-            "83551779698981993873980053909390631503565951557022"
-            "63922908583924491051844359318028499365361525003193"
-            "70457678249219365623669863658480757001585769269903"
-            "70631192827955855133292783433840935197801553124659"
-            "72635795746227664652728272200563740064854999770965"
-            "99470454020828166226237857393450736339007967761930"
-            "57750674017632467360096895134053553745851666113422"
-            "37666786041621596804619144672918403005300575308490"
-            "48765391711386591646239524912623653881879636239373"
-            "28042389101867234849766823508986338858792562830275"
-            "59956575244555072551893136908362547791869486679949"
-            "68324049705821028513185451396213837722826145437693"
-            "412532098591327667236328126", 5e-324);
-
-  testParse("0.000000000000000000000000000000000000000000000000"
-            "00000000000000000000000000000000000000000000000000"
-            "00000000000000000000000000000000000000000000000000"
-            "00000000000000000000000000000000000000000000000000"
-            "00000000000000000000000000000000000000000000000000"
-            "00000000000000000000000000000000000000000000000000"
-            "00000000000000000000000002470328229206232720882843"
-            "96434110686182529901307162382212792841250337753635"
-            "10437593264991818081799618989828234772285886546332"
-            "83551779698981993873980053909390631503565951557022"
-            "63922908583924491051844359318028499365361525003193"
-            "70457678249219365623669863658480757001585769269903"
-            "70631192827955855133292783433840935197801553124659"
-            "72635795746227664652728272200563740064854999770965"
-            "99470454020828166226237857393450736339007967761930"
-            "57750674017632467360096895134053553745851666113422"
-            "37666786041621596804619144672918403005300575308490"
-            "48765391711386591646239524912623653881879636239373"
-            "28042389101867234849766823508986338858792562830275"
-            "59956575244555072551893136908362547791869486679949"
-            "68324049705821028513185451396213837722826145437693"
-            "412532098591327667236328125", 0.0);
-
-  testParse("0.0000000000000000000000000000000000000000000000000"
-            "000000000000000000000000000000000000000000000000000"
-            "000000000000000000000000000000000000000000000000000"
-            "000000000000000000000000000000000000000000000000000"
-            "000000000000000000000000000000000000000000000000000"
-            "000000000000000000000000000000000000000000000000000"
-            "00022250738585072011", 2.225073858507201e-308);
-
-  testParse("0.0000000000000000000000000000000000000000000000000"
-            "000000000000000000000000000000000000000000000000000"
-            "000000000000000000000000000000000000000000000000000"
-            "000000000000000000000000000000000000000000000000000"
-            "000000000000000000000000000000000000000000000000000"
-            "000000000000000000000000000000000000000000000000000"
-            "00022250738585072012", 2.2250738585072014e-308);
-
-  testParse("0.49999999999999994", 0.49999999999999994);
-  testParse("0.49999999999999997219", 0.49999999999999994);
-  testParse("0.49999999999999999", 0.5);
+  testParse("0.00000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000012351641146031163604414219821705534309126495065358119110639"
+            "6420625168876817552187966324959090408998094949141173861429432731"
+            "6641775889849490996936990026954695315751782975778511319614542919"
+            "6224552592217965901424968268076250159685228839124609682811834931"
+            "8292403785007928846349518531559641397792756664639171692046759890"
+            "0776562329863178978731138323263641361002818700324274998854829973"
+            "5227010414083113118928696725368169503983880965288753370088162336"
+            "8004844756702677687292583305671118833393020810798402309572336459"
+            "2015026502876542452438269585569329582311976245631182694093981811"
+            "9686640211945509336174248834117544931694293962814151377997828762"
+            "2277536275946568454181273895934743339974841620248529105142565927"
+            "256981069188614130727188467062660492956638336181640625",
+            0.0);
+  testParse("0.00000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000024703282292062327208828439643411068618252990130716238221279"
+            "2841250337753635104375932649918180817996189898282347722858865463"
+            "3283551779698981993873980053909390631503565951557022639229085839"
+            "2449105184435931802849936536152500319370457678249219365623669863"
+            "6584807570015857692699037063119282795585513329278343384093519780"
+            "1553124659726357957462276646527282722005637400648549997709659947"
+            "0454020828166226237857393450736339007967761930577506740176324673"
+            "6009689513405355374585166611342237666786041621596804619144672918"
+            "4030053005753084904876539171138659164623952491262365388187963623"
+            "9373280423891018672348497668235089863388587925628302755995657524"
+            "4555072551893136908362547791869486679949683240497058210285131854"
+            "51396213837722826145437693412532098591327667236328125",
+            0.0);
+  testParse("0.00000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000024703282292062327208828439643411068618252990130716238221279"
+            "2841250337753635104375932649918180817996189898282347722858865463"
+            "3283551779698981993873980053909390631503565951557022639229085839"
+            "2449105184435931802849936536152500319370457678249219365623669863"
+            "6584807570015857692699037063119282795585513329278343384093519780"
+            "1553124659726357957462276646527282722005637400648549997709659947"
+            "0454020828166226237857393450736339007967761930577506740176324673"
+            "6009689513405355374585166611342237666786041621596804619144672918"
+            "4030053005753084904876539171138659164623952491262365388187963623"
+            "9373280423891018672348497668235089863388587925628302755995657524"
+            "4555072551893136908362547791869486679949683240497058210285131854"
+            "51396213837722826145437693412532098591327667236328125",
+            0.0);
+  testParse("0.00000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000024703282292062327208828439643411068627545332140664243314532"
+            "8041234170109088178685677591650492652607243027730579814636067699"
+            "1112238669661707327453443265068702897439863329200619332642599205"
+            "1806252781222000513169502627641523911022607448403553068808609405"
+            "1727798181294290864842608522062097649849550765341204993205100587"
+            "2127469658709242016690593998242808606978027857019419997429604579"
+            "7572623273334010723772922131119806567715298322567005234345331218"
+            "5169920860031716486480793611343761679481328431956040281530986197"
+            "8304604971452253283193290744072288902141724247846767401941767720"
+            "8561650585989659548591956327689896895290365125294085321852619688"
+            "9863888974446146846024033780172178553364579041996676675092137151"
+            "9705456298034409473812692774776868254618683783877327369245051207"
+            "5931578479504396230612962142122846982018227555473696607567828620"
+            "5497859173707553281928994692862033843994140625",
+            5e-324);
+  testParse("0.00000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000037054923438093490813242659465116602918087143186126352238665"
+            "4061891674274999582254154033144959392383231717975289492511095959"
+            "2096640779585747657231506869704773681319051549691937265430115392"
+            "9316510179867828993955338712739726887403536747219495345250565253"
+            "9734220743745353366904984135736109339114232557854653467028698863"
+            "1755341990606652876965097618075398198036065644601954996844545287"
+            "8562428797081554870870561495721040952204106503876761616095480465"
+            "4854302923481671949982122917011832487483775622035971266330696098"
+            "1770527542930458978998057183774359009418156980309146068528141338"
+            "9871550473737887132279287842897827763181104688776671568136524122"
+            "1523792405286695424882335699501538146509629059245968850620692484"
+            "3143597161396297062546730578356156393213233025204703880754948792"
+            "4068421520495603769387037857877153017981772444526303392432171379"
+            "4502140826292446718071005307137966156005859375",
+            5e-324);
+  testParse("0.00000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000037054923438093490813242659465116602927379485196074357331918"
+            "9261875506630452656563898974877271226994284847423521584288298194"
+            "9925327669548472990810970080864085947255348927335533958843628758"
+            "8673657776653897704274904804228750479055686517373829048435504795"
+            "4877211355023786539048555594678924193378269993917515076140279670"
+            "2329686989589536936193414969790924083008456100972824996564489920"
+            "5681031242249339356786090176104508511951642895866260110264487010"
+            "4014534270108033061877749917013356500179062432395206928717009377"
+            "6045079508629627357314808756707988746935928736893548082281945435"
+            "9059920635836528008522746502352634795082881888442454133993486286"
+            "6832608827839705362543821687804230019924524860745587315427697781"
+            "770943207565842392181565401187981478869915008544921875",
+            5e-324);
+  testParse("0.00000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000037054923438093490813242659465116602936671827206022362425172"
+            "4461859338985905730873643916609583061605337976871753676065500430"
+            "7754014559511198324390433292023398213191646304979130652257142124"
+            "8030805373439966414594470895717774070707836287528162751620444337"
+            "0020201966302219711192127053621739047642307429980376685251860477"
+            "2904031988572420995421732321506449967980846557343694996284434553"
+            "2799633687417123842701618856487976071699179287855758604433493555"
+            "3174765616734394173773376917014880512874349242754442591103322657"
+            "0319631474328795735631560329641618484453700493477950096035749532"
+            "8248290797935168884766205161807441826984659088108236699850448451"
+            "2141425250392715300205307676106921893339420662245205780234703079"
+            "2275266989920550781084577445403473184185067145693733619245051207"
+            "5931578479504396230612962142122846982018227555473696607567828620"
+            "5497859173707553281928994692862033843994140625",
+            5e-324);
+  testParse("0.00000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000049406564584124654417656879286822137236505980261432476442558"
+            "5682500675507270208751865299836361635992379796564695445717730926"
+            "6567103559397963987747960107818781263007131903114045278458171678"
+            "4898210368871863605699873072305000638740915356498438731247339727"
+            "3169615140031715385398074126238565591171026658556686768187039560"
+            "3106249319452715914924553293054565444011274801297099995419319894"
+            "0908041656332452475714786901472678015935523861155013480352649347"
+            "2019379026810710749170333222684475333572083243193609238289345836"
+            "8060106011506169809753078342277318329247904982524730776375927247"
+            "8746560847782037344696995336470179726777175851256605511991315048"
+            "9110145103786273816725095583738973359899366480994116420570263709"
+            "0279242767544565229087538682506419718265533447265625",
+            5e-324);
+  testParse("0.00000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000049406564584124654417656879286822137255090664281328486629065"
+            "6082468340218176357371355183300985305214486055461159629272135398"
+            "2224477339323414654906886530137405794879726658401238665285198410"
+            "3612505562444001026339005255283047822045214896807106137617218810"
+            "3455596362588581729685217044124195299699101530682409986410201174"
+            "4254939317418484033381187996485617213956055714038839994859209159"
+            "5145246546668021447545844262239613135430596645134010468690662437"
+            "0339841720063432972961587222687523358962656863912080563061972395"
+            "6609209942904506566386581488144577804283448495693534803883535441"
+            "7123301171979319097183912655379793790580730250588170643705239377"
+            "9727777948892293692048067560344357106729158083993353350184274303"
+            "9410912596068818947625385549553736509237367567754654738490102415"
+            "1863156959008792461225924284245693964036455110947393215135657241"
+            "099571834741510656385798938572406768798828125",
+            5e-324);
+  testParse("0.00000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000074109846876186981626485318930233205836174286372252704477330"
+            "8123783348549999164508308066289918784766463435950578985022191918"
+            "4193281559171495314463013739409547362638103099383874530860230785"
+            "8633020359735657987910677425479453774807073494438990690501130507"
+            "9468441487490706733809968271472218678228465115709306934057397726"
+            "3510683981213305753930195236150796396072131289203909993689090575"
+            "7124857594163109741741122991442081904408213007753523232190960930"
+            "9708605846963343899964245834023664974967551244071942532661392196"
+            "3541055085860917957996114367548718018836313960618292137056282677"
+            "9743100947475774264558575685795655526362209377553343136273048244"
+            "3047584810573390849764671399003076293019258118491937701241384968"
+            "6287194322792594125093461156712312786426466050409407761509897584"
+            "8136843040991207538774075715754306035963544889052606784864342758"
+            "900428165258489343614201061427593231201171875",
+            5e-324);
+  testParse("0.00000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000074109846876186981626485318930233205854758970392148714663837"
+            "8523751013260905313127797949754542453988569694847043168576596389"
+            "9850655339096945981621940161728171894510697854671067917687257517"
+            "7347315553307795408549809608457500958111373034747658096871009590"
+            "9754422710047573078097111189357848386756539987835030152280559340"
+            "4659373979179073872386829939581848166016912201945649993128979841"
+            "1362062484498678713572180352209017023903285791732520220528974020"
+            "8029068540216066123755499834026713000358124864790413857434018755"
+            "2090159017259254714629617513415977493871857473787096164563890871"
+            "8119841271673056017045493004705269590165763776884908267986972573"
+            "3665217655679410725087643375608460039849049721491174630855395563"
+            "54188641513168478436313080237596295773983001708984375",
+            1e-323);
+  testParse("0.00000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000074109846876186981626485318930233205873343654412044724850344"
+            "8923718677971811461747287833219166123210675953743507352131000861"
+            "5508029119022396648780866584046796426383292609958261304514284249"
+            "6061610746879932829188941791435548141415672575056325503240888674"
+            "0040403932604439422384254107243478095284614859960753370503720954"
+            "5808063977144841990843464643012899935961693114687389992568869106"
+            "5599267374834247685403237712975952143398358575711517208866987110"
+            "6349531233468788347546753834029761025748698485508885182206645314"
+            "0639262948657591471263120659283236968907400986955900192071499065"
+            "6496581595870337769532410323614883653969318176216473399700896902"
+            "4282850500785430600410615352213843786678841324490411560469406158"
+            "4550533979841101562169154890806946368370134291387467238490102415"
+            "1863156959008792461225924284245693964036455110947393215135657241"
+            "099571834741510656385798938572406768798828125",
+            1e-323);
+  testParse("0.00000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000011125369292"
+            "5360069154511635866620203210960799023116591527666370844360221740"
+            "6959097927141579506255510282033669865517905502576217080776730054"
+            "4280061926888594105653889967660011652398050737212918180359607825"
+            "2347125186710418762540332530832907947436024558998429581982425031"
+            "7954385059152437399890443876874974725790225802525457699928291235"
+            "4093225567689679024960579905428830259962166760571761950743978498"
+            "0479564444580149632075553173315669683173879325651468588102366281"
+            "5890742832175436061414318821022423405703806955738531400844926622"
+            "0550120807237108092835830752700771425423583764509515806613894483"
+            "6485368656166704349449158753391942346304638698898642932982747054"
+            "5684547703068233784351199339157645340492308605462312698364257812"
+            "5",
+            1.1125369292536007e-308);
+  testParse("0.00000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000011125369292"
+            "5360069154511635866620203210960799023116610112350390740370408247"
+            "7359065591852485654875000165498293534740011761472681264331134525"
+            "9937435706814044772812816389978636184270645492500111567186634557"
+            "1061420380282556183179464713810955130740324099307096988352304114"
+            "8240366281709303744177586794760604434318300674651180918151452849"
+            "5241915565655447143417214608859882029906947673313501950183867763"
+            "4716769334915718603906610534082604802668952109630465576440379371"
+            "4211205525428158285205572821025471431094380576457002725617553180"
+            "9099224738635444849469333898568030900459127277678319834121502677"
+            "4862108980363986101936076072301556410108193098230208064696671383"
+            "6302180548174253659674171315763029087322100208461549627978268407"
+            "4131669828524253718537846867047316790971834120489029738490102415"
+            "1863156959008792461225924284245693964036455110947393215135657241"
+            "099571834741510656385798938572406768798828125",
+            1.1125369292536007e-308);
+  testParse("0.00000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000011125369292"
+            "5360093857793927928947412039400442434185191195972481664588256512"
+            "9400380600184308462011953048487227014291989141962100620081191046"
+            "1906239926662125432368943599250777752029021933482747432761666932"
+            "6081935177574213144751136884007361083502182696938981541236215812"
+            "4253211406611428748302338022108627812847664259678077865798649401"
+            "4497660229450268863966221848525061212023023248478571949013749179"
+            "6696380382410806898101889263285073571646568472249978339940677865"
+            "3579969652328069212208231432361613047099274956616864695216972981"
+            "6031069881591856241078866777972171115011992742603077167294249913"
+            "7481908755860441269310739102717418145889672225195380557264480249"
+            "9621987409855350817390775154421748273612200242960133979035379072"
+            "1007951555248028896005922474205893068160932603143782761509897584"
+            "8136843040991207538774075715754306035963544889052606784864342758"
+            "900428165258489343614201061427593231201171875",
+            1.1125369292536007e-308);
+  testParse("0.00000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000011125369292"
+            "5360093857793927928947412039400442434185209780656501560598443019"
+            "9800348264895214610631442931951850683514095400858564803635595517"
+            "7563613706587576099527870021569402283901616688769940819588693664"
+            "4796230371146350565390269066985408266806482237247648947606094895"
+            "4539192629168295092589480939994257521375739131803801084021811015"
+            "5646350227416036982422856551956112981967804161220311948453638445"
+            "0933585272746375869932946624052008691141641256228975328278690955"
+            "1900432345580791435999485432364661072489848577335336019989599540"
+            "4580173812990192997712369923839430590047536255771881194801858107"
+            "5858649080057723021797656421627032209693226624526945688978404579"
+            "0239620254961370692713747131027132020441991845959370908649389667"
+            "01396213837722826145437693412532098591327667236328125",
+            1.1125369292536007e-308);
+  testParse("0.00000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000011125369292"
+            "5360093857793927928947412039400442434185228365340521456608629527"
+            "0200315929606120759250932815416474352736201659755028987189999989"
+            "3220987486513026766686796443888026815774211444057134206415720396"
+            "3510525564718487986029401249963455450110781777556316353975973978"
+            "4825173851725161436876623857879887229903814003929524302244972629"
+            "6795040225381805100879491255387164751912585073962051947893527710"
+            "5170790163081944841764003984818943810636714040207972316616704045"
+            "0220895038833513659790739432367709097880422198053807344762226099"
+            "3129277744388529754345873069706690065083079768940685222309466301"
+            "4235389404255004774284573740536646273496781023858510820692328908"
+            "0857253100067390568036719107632515767271783448958607838263400261"
+            "9271291212296536333081616208300526650104600844121842238490102415"
+            "1863156959008792461225924284245693964036455110947393215135657241"
+            "099571834741510656385798938572406768798828125",
+            1.112536929253601e-308);
+  testParse("0.00000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000011125369292"
+            "5360118561076219991274620867840085845253828033646632276836664299"
+            "2641598602648849715007375581870031501510285299140912526494460981"
+            "0847165486286558093401850075478792915405182640326963458817779503"
+            "7245335555582282368240205603137908586176939915496868313229764759"
+            "1124000199184152785288518003113540316961252461082144468115330795"
+            "7199474887142394939885133198483395703973441561868861946163298392"
+            "1387606100912602107790340074788347699109403186806482068455015628"
+            "7910121858986146810584652043706898739275890198932140639134272458"
+            "8610226818743277902588909094978089754671488747034246582989821731"
+            "5231929503948741694146154089862122073081814550155248444974062103"
+            "4794692806854507601076294922896618700391675086456429118934521521"
+            "5279242767544565229087538682506419718265533447265625",
+            1.112536929253601e-308);
+  testParse("0.00000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000011125369292"
+            "5360118561076219991274620867840085845253846618330652172846850806"
+            "3041566267359755863626865465334655170732391558037376710048865452"
+            "6504539266212008760560776497797417447277777395614156845644806235"
+            "5959630749154419788879337786115955769481239455805535719599643842"
+            "1409981421741019129575660920999170025489327333207867686338492409"
+            "8348164885108163058341767901914447473918222474610601945603187657"
+            "5624810991248171079621397435555282818604475970785479056793028718"
+            "6230584552238869034375906043709946764666463819650611963906899017"
+            "7159330750141614659222412240845349229707032260203050610497429925"
+            "3608669828146023446633071408771736136885368949486813576687986432"
+            "5412325651960527476399266899502002447221466689455666048548532116"
+            "4410912596068818947625385549553736509237367567754654738490102415"
+            "1863156959008792461225924284245693964036455110947393215135657241"
+            "099571834741510656385798938572406768798828125",
+            1.112536929253601e-308);
+  testParse("0.00000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000011125369292"
+            "5360143264358512053601829696279729256322427701952743097064699071"
+            "5082881275691578670763818348323588650284368938526796065798921972"
+            "8473343486060089420116903707069559015036153836596792711219838611"
+            "0980145546446076750451009956312361722243098053437420272483555539"
+            "7422826546643144133700412148347193404018690918234764633985688961"
+            "7603909548902984778890775141579626656034298049775671944433069073"
+            "7604422038743259373816676164757751587582092333404991820293327212"
+            "5599348679138779961378564655046088380671358199810473933506318818"
+            "4091175893098026050831945120249489444259897725127807943670177161"
+            "6228469603642478614007734439187597872666848076451986069255795298"
+            "8732132513641624634115870738160721633511566723954250399605642781"
+            "1287194322792594125093461156712312786426466050409407761509897584"
+            "8136843040991207538774075715754306035963544889052606784864342758"
+            "900428165258489343614201061427593231201171875",
+            1.112536929253601e-308);
+  testParse("0.00000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000011125369292"
+            "5360143264358512053601829696279729256322446286636762993074885578"
+            "5482848940402484819383308231788212319506475197423260249353326444"
+            "4130717265985540087275830129388183546908748591883986098046865342"
+            "9694440740018214171090142139290408905547397593746087678853434622"
+            "7708807769200010477987555066232823112546765790360487852208850575"
+            "8752599546868752897347409845010678425979078962517411943872958339"
+            "1841626929078828345647733525524686707077165117383988808631340302"
+            "3919811372391502185169818655049136406061931820528945258278945377"
+            "2640279824496362807465448266116748919295441238296611971177785355"
+            "4605209927839760366494651758097211936470402475783551200969719627"
+            "9349765358747644509438842714766105380341358326953487329219653376"
+            "04188641513168478436313080237596295773983001708984375",
+            1.1125369292536017e-308);
+  testParse("0.00000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000011125369292"
+            "5360143264358512053601829696279729256322464871320782889085072085"
+            "5882816605113390968002798115252835988728581456319724432907730915"
+            "9788091045910990754434756551706808078781343347171179484873892074"
+            "8408735933590351591729274322268456088851697134054755085223313705"
+            "7994788991756876822274697984118452821074840662486211070432012189"
+            "9901289544834521015804044548441730195923859875259151943312847604"
+            "6078831819414397317478790886291621826572237901362985796969353392"
+            "2240274065644224408961072655052184431452505441247416583051571936"
+            "1189383755894699564098951411984008394330984751465415998685393549"
+            "2981950252037042118981569077006826000273956875115116332683643956"
+            "9967398203853664384761814691371489127171149929952724258833663970"
+            "9550533979841101562169154890806946368370134291387467238490102415"
+            "1863156959008792461225924284245693964036455110947393215135657241"
+            "099571834741510656385798938572406768798828125",
+            1.1125369292536017e-308);
+  testParse("0.00000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000022250738585"
+            "0720138309023271733240406421921598046233183055332741688720443481"
+            "3918195854283159012511020564067339731035811005152434161553460108"
+            "8560123853777188211307779935320023304796101474425836360719215650"
+            "4694250373420837525080665061665815894872049117996859163964850063"
+            "5908770118304874799780887753749949451580451605050915399856582470"
+            "8186451135379358049921159810857660519924333521143523901487956996"
+            "0959128889160299264151106346631339366347758651302937176204732563"
+            "1781485664350872122828637642044846811407613911477062801689853244"
+            "1100241614474216185671661505401542850847167529019031613227788967"
+            "2970737312333408698898317506783884692609277397797285865965494109"
+            "1369095406136467568702398678315290680984617210924625396728515625",
+            2.2250738585072014e-308);
+  testParse("0.00000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000022250738585"
+            "0720138309023271733240406421921598046233201640016761584730629988"
+            "4318163518994065161130510447531963400257917264048898345107864580"
+            "4217497633702638878466706357638647836668696229713029747546242382"
+            "3408545566992974945719797244643863078176348658305526570334729146"
+            "6194751340861741144068030671635579160108526477176638618079744084"
+            "9335141133345126168377794514288712289869114433885263900927846261"
+            "5196333779495868235982163707398274485842831435281934164542745653"
+            "0101948357603594346619891642047894836798187532195534126462479802"
+            "9649345545872552942305164651268802325882711042187835640735397161"
+            "1347477636530690451385234825693498756412831797128850997679418438"
+            "1986728251242487444025370654920674427814408813923862326342526219"
+            "9131669828524253718537846867047316790971834120489029738490102415"
+            "1863156959008792461225924284245693964036455110947393215135657241"
+            "099571834741510656385798938572406768798828125",
+            2.2250738585072014e-308);
+  testParse("0.00000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000022250738585"
+            "0720163012305563795567615250361241457301782723638852508948478253"
+            "6359478527325887968267463330520896879809894644538317700857921100"
+            "6186301853550719538022833566910789404427072670695665613121274757"
+            "8429060364284631907291469414840269030938207255937411123218640844"
+            "2207596465763866148192781898983602538637890062203535565726940636"
+            "8590885797139947888926801753953891471985190009050333899757727677"
+            "7175944826990956530177442436600743254820447797901446928043044146"
+            "9470712484503505273622550253384036452803081912355396096061899603"
+            "6581190688828964333914697530672942540435576507112592973908144397"
+            "3967277412027145618759897856109360492194310924094023490247227304"
+            "5306535112923584601741974493579393614104508848422446677399636884"
+            "6007951555248028896005922474205893068160932603143782761509897584"
+            "8136843040991207538774075715754306035963544889052606784864342758"
+            "900428165258489343614201061427593231201171875",
+            2.2250738585072014e-308);
+  testParse("0.00000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000022250738585"
+            "0720163012305563795567615250361241457301801308322872404958664760"
+            "6759446192036794116886953213985520549032000903434781884412325572"
+            "1843675633476170205181759989229413936299667425982858999948301489"
+            "7143355557856769327930601597818316214242506796246078529588519927"
+            "2493577688320732492479924816869232247165964934329258783950102250"
+            "9739575795105716007383436457384943241929970921792073899197616943"
+            "1413149717326525502008499797367678374315520581880443916381057236"
+            "7791175177756227497413804253387084478193655533073867420834526162"
+            "5130294620227301090548200676540202015471120020281397001415752591"
+            "2344017736224427371246815175018974555997865323425588621961151633"
+            "5924167958029604477064946470184777360934300451421683607013647479"
+            "51396213837722826145437693412532098591327667236328125",
+            2.2250738585072014e-308);
+  testParse("0.00000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000022250738585"
+            "0720163012305563795567615250361241457301819893006892300968851267"
+            "7159413856747700265506443097450144218254107162331246067966730043"
+            "7501049413401620872340686411548038468172262181270052386775328221"
+            "5857650751428906748569733780796363397546806336554745935958399010"
+            "2779558910877598836767067734754861955694039806454982002173263865"
+            "0888265793071484125840071160815995011874751834533813898637506208"
+            "5650354607662094473839557158134613493810593365859440904719070326"
+            "6111637871008949721205058253390132503584229153792338745607152721"
+            "3679398551625637847181703822407461490506663533450201028923360785"
+            "0720758060421709123733732493928588619801419722757153753675075962"
+            "6541800803135624352387918446790161107764092054420920536627658074"
+            "4271291212296536333081616208300526650104600844121842238490102415"
+            "1863156959008792461225924284245693964036455110947393215135657241"
+            "099571834741510656385798938572406768798828125",
+            2.225073858507202e-308);
+  testParse("0.00000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000022250738585"
+            "0720187715587855857894824078800884868370419561313003121196886039"
+            "9600696529790429221262885863903701367028190801717129607271191035"
+            "5127227413175152199055740043138804567803233377539881639177387328"
+            "9592460742292701130780538133970816533612964474495297895212189790"
+            "9078385258336590185178961879988515042751478263607602168043622031"
+            "1292700454832073964845713103912225963935608322440623896907276890"
+            "1867170545492751739865893248104017382283282512457950656557381910"
+            "3800864691161582871998970864729322144979697154670672039979199080"
+            "9160347625980385995424739847678861180095072511543762389603716215"
+            "1717298160115446043595312843254064419386453249053891377956809158"
+            "0479240509922741385427494262054264040883983691918741817298779334"
+            "0279242767544565229087538682506419718265533447265625",
+            2.225073858507202e-308);
+  testParse("0.00000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000022250738585"
+            "0720187715587855857894824078800884868370438145997023017207072547"
+            "0000664194501335369882375747368325036250297060613593790825595507"
+            "0784601193100602866214666465457429099675828132827075026004414060"
+            "8306755935864838551419670316948863716917264014803965301582068873"
+            "9364366480893456529466104797874144751279553135733325386266783645"
+            "2441390452797842083302347807343277733880389235182363896347166155"
+            "6104375435828320711696950608870952501778355296436947644895395000"
+            "2121327384414305095790224864732370170370270775389143364751825639"
+            "7709451557378722752058242993546120655130616024712566417111324409"
+            "0094038484312727796082230162163678483190007648385456509670733487"
+            "1096873355028761260750466238659647787713775294917978746912789928"
+            "9410912596068818947625385549553736509237367567754654738490102415"
+            "1863156959008792461225924284245693964036455110947393215135657241"
+            "099571834741510656385798938572406768798828125",
+            2.225073858507202e-308);
+  testParse("0.00000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000022250738585"
+            "0720212418870147920222032907240528279439019229619113941424920812"
+            "2041979202833158177019328630357258515802274441103013146575652027"
+            "2753405412948683525770793674729570667434204573809710891579446436"
+            "3327270733156495512991342487145269669679122612435849854465980571"
+            "5377211605795581533590856025222168129808916720760222333913980197"
+            "1697135116592663803851355047008456915996464810347433895177047571"
+            "8083986483323409005892229338073421270755971659056460408395693494"
+            "1490091511314216022792883476068511786375165155549005334351245440"
+            "4641296700335134143667775872950260869683481489637323750284071645"
+            "2713838259809182963456893192579540218971486775350629002238542353"
+            "4416680216709858418467070077318366974003875329416563097969900593"
+            "6287194322792594125093461156712312786426466050409407761509897584"
+            "8136843040991207538774075715754306035963544889052606784864342758"
+            "900428165258489343614201061427593231201171875",
+            2.225073858507202e-308);
+  testParse("0.00000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000022250738585"
+            "0720212418870147920222032907240528279439037814303133837435107319"
+            "2441946867544064325638818513821882185024380699999477330130056498"
+            "8410779192874134192929720097048195199306799329096904278406473168"
+            "2041565926728632933630474670123316852983422152744517260835859654"
+            "5663192828352447877877998943107797838336991592885945552137141811"
+            "2845825114558431922307989750439508685941245723089173894616936837"
+            "2321191373658977977723286698840356390251044443035457396733706583"
+            "9810554204566938246584137476071559811765738776267476659123871999"
+            "3190400631733470900301279018817520344719025002806127777791679839"
+            "1090578584006464715943810511489154282775041174682194133952466682"
+            "5034313061815878293790042053923750720833666932415800027583911188"
+            "54188641513168478436313080237596295773983001708984375",
+            2.2250738585072024e-308);
+  testParse("0.00000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000022250738585"
+            "0720212418870147920222032907240528279439056398987153733445293826"
+            "2841914532254970474258308397286505854246486958895941513684460970"
+            "4068152972799584860088646519366819731179394084384097665233499900"
+            "0755861120300770354269606853101364036287721693053184667205738737"
+            "5949174050909314222165141860993427546865066465011668770360303425"
+            "3994515112524200040764624453870560455886026635830913894056826102"
+            "6558396263994546949554344059607291509746117227014454385071719673"
+            "8131016897819660470375391476074607837156312396985947983896498558"
+            "1739504563131807656934782164684779819754568515974931805299288032"
+            "9467318908203746468430727830398768346578595574013759265666391011"
+            "5651945906921898169113014030529134467663458535415036957197921783"
+            "4550533979841101562169154890806946368370134291387467238490102415"
+            "1863156959008792461225924284245693964036455110947393215135657241"
+            "099571834741510656385798938572406768798828125",
+            2.2250738585072024e-308);
+  testParse("0.00000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000100208418000448638899805402"
+            "5675081023947173151201955956352756465219477298834774949553868001"
+            "7172354813827222283890479851867436841402279176933922227531985191"
+            "9016883548022442028316027357265612083085166971723487691494714589"
+            "5578331812936322386545483369746322848628024994920311121080242823"
+            "5714326388663336759990619917681011604908667604621058852897083245"
+            "0816977893343649540492907374306035456728456338904015275857972276"
+            "1526157631250497160973795706924168310120033199859199012414074894"
+            "8202195091387650850548954516920927386376492603899633528627985383"
+            "2932104496700123254769405070337764094630065313795728259355401668"
+            "8207267296623786504114239553488532354086348874488976434804499149"
+            "322509765625",
+            1.0020841800044864e-292);
+  testParse("0.00000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000100208418000448638899805402"
+            "5675081023947173151201956040050732492021560444211472901925540702"
+            "1586014286915762763038748010206109436411449756840422987132589595"
+            "3085274649978096343836685185731606312366412920027708756586099963"
+            "7975552653362983131506665648352778744386705639822064232334712197"
+            "7867779247842315182877112028658635902319185766818606103345104073"
+            "9923514010434512590195330770391813338086311968111531328662618487"
+            "3315578521649250253839821623536466419018719481428679013982985346"
+            "1571995354000952600076951720089726239270930511481845755671197870"
+            "4747866889418540057514218596081876158765839665014133210631738825"
+            "4165335079883777074977685931654819161553596657523084699300803458"
+            "3609637179288099118793858900152420545987239088654699259390735847"
+            "0152049332041520812604025151794328168042160636342216519487980314"
+            "421878240614097350935640662328296457417309284210205078125",
+            1.0020841800044864e-292);
+  testParse("0.00000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000100208418000448650025174695"
+            "1035150178458809017822159083615579461533985681124447841542417041"
+            "9717793267880261310997721975562434111911014099603638548708110842"
+            "9228554372955381818449259496459629506201971760632184806762937040"
+            "5528236159220080404124633621972774900305368909016987591808198481"
+            "1515258588636795736994571683578362033288375244948969302377353651"
+            "5803667343942465515751063883649087835332767470268261173797304563"
+            "0216301185431893700183322963627539884395226243941187598947530725"
+            "0723137660949785162435276134774551939185861652055952702429699518"
+            "1666462911218814544860422297294423455917874727086839114692958995"
+            "8734568169530500282699951928714187892923739790353511103290941894"
+            "8525105836280134665557340439005224794505069516807613438973521965"
+            "4847950667958479187395974848205671831957839363657783480512019685"
+            "578121759385902649064359337671703542582690715789794921875",
+            1.0020841800044864e-292);
+  testParse("0.00000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000100208418000448650025174695"
+            "1035150178458809017822159167313555488336068826501145793914089742"
+            "4131452740968801790145990133901106706920184679510139308308715246"
+            "3296945474911036133969917324925623735483217708936405871854322414"
+            "7925456999646741149085815900579230796064049553918740703062667855"
+            "3668711447815774159881063794555986330698893407146516552825374480"
+            "4910203461033328565453487279734865716690623099475777226601950774"
+            "2005722075830646793049348880239837993293912525510667600516441176"
+            "4092937923563086911963273337943350792080299559638164929472912005"
+            "3482225303937231347605235823038535520053649078305244065969296152"
+            "4692635952790490853563398306880474700390987573387619367787246203"
+            "8909645359318233784351199339157645340492308605462312698364257812"
+            "5",
+            1.0020841800044864e-292);
+  testParse("0.00000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000100208418000448650025174695"
+            "1035150178458809017822159251011531515138151971877843746285762442"
+            "8545112214057342269294258292239779301929355259416640067909319649"
+            "7365336576866690449490575153391617964764463657240626936945707789"
+            "0322677840073401894046998179185686691822730198820493814317137229"
+            "5822164306994752582767555905533610628109411569344063803273395309"
+            "4016739578124191615155910675820643598048478728683293279406596985"
+            "3795142966229399885915374796852136102192598807080147602085351627"
+            "7462738186176388661491270541112149644974737467220377156516124492"
+            "5297987696655648150350049348782647584189423429523649017245633309"
+            "0650703736050481424426844685046761507858235356421727632283550512"
+            "9294184882356332903145058239310065886479547694117011957754993659"
+            "5152049332041520812604025151794328168042160636342216519487980314"
+            "421878240614097350935640662328296457417309284210205078125",
+            1.0020841800044866e-292);
+  testParse("0.00000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000200416836000897255548872220"
+            "0630023738871074569163505490783914884205771542336808210387292522"
+            "0426513773371285555269939139667533951768747348715410293510510274"
+            "9473643242267695845324274779211200861374232469021139022270213528"
+            "6462413252451807248010301677826829802384000871843763078195635583"
+            "5519882659021798720200352081612073758236883604191202305937584019"
+            "3447504651307941031064654937754410393532579156664506650227987556"
+            "2093186373340695057796485067216997253892307748415460848623417226"
+            "4622904518424429578269271391797007961345371296322204255566117522"
+            "4763967378926030323867148635273985338412963098572424905483014370"
+            "3443797280914164309330161600193180015563420351180667003643504189"
+            "5081099906363532431297601321684709319015382789075374603271484375",
+            2.0041683600089726e-292);
+  testParse("0.00000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000200416836000897255548872220"
+            "0630023738871074569163505574481890911007854687713506162758965222"
+            "4840173246459826034418207298006206546777917928621911053111114678"
+            "3542034344223350160844932607677195090655478417325360087361598902"
+            "8859634092878467992971483956433285698142681516745516189450104957"
+            "7673335518200777143086844192589698055647401766388749556385604848"
+            "2554040768398804080767078333840188274890434785872022703032633767"
+            "3882607263739448150662510983829295362790994029984940850192327677"
+            "7992704781037731327797268594965806814239809203904416482609330009"
+            "6579729771644447126611962161018097402548737449790829856759351526"
+            "9401865064174154880193607978359466823030668134214775268139808498"
+            "5465639429401631550091460221837129865002621877730073862662220222"
+            "0152049332041520812604025151794328168042160636342216519487980314"
+            "421878240614097350935640662328296457417309284210205078125",
+            2.0041683600089726e-292);
+  testParse("0.00000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000200416836000897266674241512"
+            "5990092893382710435783708618046737880520279924626481102375841562"
+            "2971952227424324582377181263362531222277482271385126614686635925"
+            "9685314067200635635457506918405218284491037257929836137538435979"
+            "6412317598735565265589451930053281854061344785940439548923591241"
+            "1320814858995257697204303847509424186616591244519112755417854425"
+            "8434194101906757006322811447097462772136890288028752548167319843"
+            "0783329927522091597006012323920368828167500792497449435156873056"
+            "7143847087986563890155593009650632514154740344478523429367831657"
+            "3498325793444721613958165862230644699700772511863535760820571697"
+            "3971098153820878087915873975418835554400811267045201672129946935"
+            "0381108086393667096854941760689934113520452305882988042245006340"
+            "4847950667958479187395974848205671831957839363657783480512019685"
+            "578121759385902649064359337671703542582690715789794921875",
+            2.0041683600089726e-292);
+  testParse("0.00000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000200416836000897266674241512"
+            "5990092893382710435783708701744713907322363070003179054747514262"
+            "7385611700512865061525449421701203817286652851291627374287240329"
+            "3753705169156289950978164746871212513772283206234057202629821353"
+            "8809538439162226010550634208659737749820025430842192660178060615"
+            "3474267718174236120090795958487048484027109406716660005865875254"
+            "7540730218997620056025234843183240653494745917236268600971966054"
+            "2572750817920844689872038240532666937066187074066929436725783508"
+            "0513647350599865639683590212819431367049178252060735656411044144"
+            "5314088186163138416702979387974756763836546863081940712096908853"
+            "9929165937080868658779320353585122361868059050079309936626251244"
+            "0765647609431766215648800660842354659507691394537687301635742187"
+            "5",
+            2.004168360008973e-292);
+  testParse("0.00000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000000000000000000000000000000"
+            "0000000000000000000000000000000000000200416836000897266674241512"
+            "5990092893382710435783708785442689934124446215379877007119186963"
+            "1799271173601405540673717580039876412295823431198128133887844732"
+            "7822096271111944266498822575337206743053529154538278267721206728"
+            "1206759279588886755511816487266193645578706075743945771432529989"
+            "5627720577353214542977288069464672781437627568914207256313896083"
+            "6647266336088483105727658239269018534852601546443784653776612265"
+            "4362171708319597782738064157144965045964873355636409438294693959"
+            "3883447613213167389211587415988230219943616159642947883454256631"
+            "7129850578881555219447792913718868827972321214300345663373246010"
+            "5887233720340859229642766731751409169335306833113418201122555553"
+            "1150187132469865334442659560994775205494930483192386561026478034"
+            "5152049332041520812604025151794328168042160636342216519487980314"
+            "421878240614097350935640662328296457417309284210205078125",
+            2.004168360008973e-292);
+  testParse("0.99999999999999988897769753748434595763683319091796875",
+            0.9999999999999999);
+  testParse("0.99999999999999988897769753748434595763683319091796879176194859"
+            "5190556970945882299241904356487451251641385905655273315006228765"
+            "423911854226535211864757002331316471099853515625",
+            0.9999999999999999);
+  testParse("0.99999999999999994448884876874217297881841659545898433323805140"
+            "4809443029054117700758095643512548748358614094344726684993771234"
+            "576088145773464788135242997668683528900146484375",
+            0.9999999999999999);
+  testParse("0.999999999999999944488848768742172978818416595458984375",
+            1.0);
+  testParse("0.99999999999999994448884876874217297881841659545898441676194859"
+            "5190556970945882299241904356487451251641385905655273315006228765"
+            "423911854226535211864757002331316471099853515625",
+            1.0);
+  testParse("0.499999999999999944488848768742172978818416595458984375",
+            0.49999999999999994);
+  testParse("0.49999999999999994448884876874217297881841659545898439588097429"
+            "7595278485472941149620952178243725625820692952827636657503114382"
+            "7119559271132676059323785011656582355499267578125",
+            0.49999999999999994);
+  testParse("0.49999999999999997224442438437108648940920829772949216661902570"
+            "2404721514527058850379047821756274374179307047172363342496885617"
+            "2880440728867323940676214988343417644500732421875",
+            0.49999999999999994);
+  testParse("0.4999999999999999722444243843710864894092082977294921875",
+            0.5);
+  testParse("0.49999999999999997224442438437108648940920829772949220838097429"
+            "7595278485472941149620952178243725625820692952827636657503114382"
+            "7119559271132676059323785011656582355499267578125",
+            0.5);
+  testParse("1.9999999999999997779553950749686919152736663818359375",
+            1.9999999999999998);
+  testParse("1.99999999999999977795539507496869191527366638183593758352389719"
+            "0381113941891764598483808712974902503282771811310546630012457530"
+            "84782370845307042372951400466263294219970703125",
+            1.9999999999999998);
+  testParse("1.99999999999999988897769753748434595763683319091796866647610280"
+            "9618886058108235401516191287025097496717228188689453369987542469"
+            "15217629154692957627048599533736705780029296875",
+            1.9999999999999998);
+  testParse("1.99999999999999988897769753748434595763683319091796875",
+            2.0);
+  testParse("1.99999999999999988897769753748434595763683319091796883352389719"
+            "0381113941891764598483808712974902503282771811310546630012457530"
+            "84782370845307042372951400466263294219970703125",
+            2.0);
+  testParse("4503599627370495.5",
+            4503599627370495.5);
+  testParse("4503599627370495.50000000000000000000000000000000000018807909613"
+            "1566001274997845955559308450986489083534003441400273004546761512"
+            "75634765625",
+            4503599627370495.5);
+  testParse("4503599627370495.74999999999999999999999999999999999981192090386"
+            "8433998725002154044440691549013510916465996558599726995453238487"
+            "24365234375",
+            4503599627370495.5);
+  testParse("4503599627370495.75",
+            4503599627370496.0);
+  testParse("4503599627370495.75000000000000000000000000000000000018807909613"
+            "1566001274997845955559308450986489083534003441400273004546761512"
+            "75634765625",
+            4503599627370496.0);
+  testParse("4503599627370496",
+            4503599627370496.0);
+  testParse("4503599627370496.00000000000000000000000000000000000037615819226"
+            "3132002549995691911118616901972978167068006882800546009093523025"
+            "5126953125",
+            4503599627370496.0);
+  testParse("4503599627370496.49999999999999999999999999999999999962384180773"
+            "6867997450004308088881383098027021832931993117199453990906476974"
+            "4873046875",
+            4503599627370496.0);
+  testParse("4503599627370496.5",
+            4503599627370496.0);
+  testParse("4503599627370496.50000000000000000000000000000000000037615819226"
+            "3132002549995691911118616901972978167068006882800546009093523025"
+            "5126953125",
+            4503599627370497.0);
+  testParse("9007199254740991",
+            9007199254740991.0);
+  testParse("9007199254740991.00000000000000000000000000000000000037615819226"
+            "3132002549995691911118616901972978167068006882800546009093523025"
+            "5126953125",
+            9007199254740991.0);
+  testParse("9007199254740991.49999999999999999999999999999999999962384180773"
+            "6867997450004308088881383098027021832931993117199453990906476974"
+            "4873046875",
+            9007199254740991.0);
+  testParse("9007199254740991.5",
+            9007199254740992.0);
+  testParse("9007199254740991.50000000000000000000000000000000000037615819226"
+            "3132002549995691911118616901972978167068006882800546009093523025"
+            "5126953125",
+            9007199254740992.0);
+  testParse("1797693134862315708145274237317043567980705675258449965989174768"
+            "0315726078002853876058955863276687817154045895351438246423432132"
+            "6889464182768467546703537516986049910576551282076245490090389328"
+            "9440758685084551339423045832369032229481658085593321233482747978"
+            "26204144723168738177180919299881250404026184124858368",
+            1.7976931348623157e+308);
+  testParse("1797693134862315708145274237317043567980705675258450041064343056"
+            "0785749075118623426984641994452647172104399563141377322686588394"
+            "6121172130178666127034918365540069095282013901258936156392632590"
+            "7055367751483602939820315058278058002847941584484775356682545657"
+            "44106770877499077221865536419145864291265781790932992",
+            1.7976931348623157e+308);
+  testParse("1797693134862315807937289714053034150799341327100378194286569501"
+            "7574473832160705543739215666582761354682674973879349714831499292"
+            "8620232455220458908340124972127889717295245764493583188543574449"
+            "7703035690903649098158444443687202655781915109457910629727393062"
+            "50541739356374003666875082388828428992938306508423168",
+            1.7976931348623157e+308);
+  testParse("1797693134862315807937289714053034150799341327100378269361737789"
+            "8044496829276475094664901797758720709633028641669288791094655554"
+            "7851940402630657488671505820681908902000708383676273854845817711"
+            "5317644757302700698555713669596228429148198608349364752927190741"
+            "68444365510704342711559699508093042880177904174497792",
+            double.INFINITY);
+  testParse("1797693134862315807937289714053034150799341327100378344436906077"
+            "8514519826392244645590587928934680064583382309459227867357811816"
+            "7083648350040856069002886669235928086706171002858964521148060973"
+            "2932253823701752298952982895505254202514482107240818876126988420"
+            "86346991665034681756244316627357656767417501840572416",
+            double.INFINITY);
 
   // Edge cases of algorithm (e+-22/23).
   testParse("1e22", 1e22);
diff --git a/tests/corelib/queue_test.dart b/tests/corelib/queue_test.dart
index e590dce..cb4f2c7 100644
--- a/tests/corelib/queue_test.dart
+++ b/tests/corelib/queue_test.dart
@@ -260,6 +260,11 @@
     Expect.equals(N, queue.length);
     Expect.isFalse(queue.isEmpty);
 
+    Expect.equals(0, queue.elementAt(0));
+    Expect.equals(N - 1, queue.elementAt(N - 1));
+    Expect.throws(() { queue.elementAt(-1); });
+    Expect.throws(() { queue.elementAt(N); });
+
     Iterable skip1 = queue.skip(1);
     Iterable take1 = queue.take(1);
     Iterable mapped = queue.map((e) => -e);
diff --git a/tests/corelib/splay_tree_from_iterable_test.dart b/tests/corelib/splay_tree_from_iterable_test.dart
index 18d0106..6ba1818 100644
--- a/tests/corelib/splay_tree_from_iterable_test.dart
+++ b/tests/corelib/splay_tree_from_iterable_test.dart
@@ -13,6 +13,7 @@
   emptyIterableTest();
   equalElementsTest();
   genericTypeTest();
+  typedTest();
 }
 
 void defaultFunctionValuesTest() {
@@ -117,3 +118,56 @@
   Expect.isFalse(map is SplayTreeMap<dynamic, int>);
 }
 
+// Test in checked mode with explicitly given types.
+void typedTest() {
+  bool isCheckedMode = false;
+  assert((isCheckedMode = true));
+  if (!isCheckedMode) return;
+
+  // Assign functions to untyped function variables.
+  Function key = (int v) => "$v";
+  Function value = (int v) => v.isOdd;
+  Function id = (int i) => i;
+
+  Expect.throws(() {
+    new SplayTreeMap<String,bool>.fromIterable(<int>[1, 2, 3],
+      key: key
+      // No "value" map, defaults to identity, which returns int, not bool.
+    );
+  });
+
+  Expect.throws(() {
+    new SplayTreeMap<String,bool>.fromIterable(<int>[1, 2, 3],
+      // No "key" map, defaults to identity, which returns int, not String.
+      value: value
+    );
+  });
+
+  Expect.throws(() {
+    new SplayTreeMap<String,bool>.fromIterable(<int>[1, 2, 3],
+      key: id,     // wrong type.
+      value: value
+    );
+  });
+
+  Expect.throws(() {
+    new SplayTreeMap<String,bool>.fromIterable(<int>[1, 2, 3],
+      key: key,
+      value: id    // wrong type.
+    );
+  });
+
+  // But it works with explicit types when used correctly.
+  SplayTreeMap<String, bool> map =
+      new SplayTreeMap<String, bool>.fromIterable(<int>[1, 2, 3],
+                                                  key: key,
+                                                  value: value);
+  Iterable<String> keys = map.keys;
+  Iterable<bool> values = map.values;
+  List<String> keyList = keys.toList();
+  List<bool> valueList = values.toList();
+  Expect.equals(3, keyList.length);
+  Expect.equals(3, valueList.length);
+  Expect.equals(keys.first, map.firstKey());
+  Expect.equals(keys.last, map.lastKey());
+}
diff --git a/tests/html/html.status b/tests/html/html.status
index b0f6b4f..ecf5d31 100644
--- a/tests/html/html.status
+++ b/tests/html/html.status
@@ -120,6 +120,8 @@
 websocket_test/websocket: Fail # TODO(efortuna): Issue 7875.
 canvasrenderingcontext2d_test/drawImage_video_element: Fail # IE does not support drawImage w/ video element
 canvasrenderingcontext2d_test/drawImage_video_element_dataUrl: Fail # IE does not support drawImage w/ video element
+no_linked_scripts_htmltest: Skip # Times out on IE.  Issue 21537
+scripts_htmltest: Skip # Times out on IE.  Issue 21537
 
 [$runtime == ie10 ]
 # IE10 Feature support statuses-
@@ -308,6 +310,7 @@
 dart_object_local_storage_test: Skip  # sessionStorage NS_ERROR_DOM_NOT_SUPPORTED_ERR
 webgl_1_test: Pass, Fail   # Issue 8219
 canvasrenderingcontext2d_test/drawImage_video_element_dataUrl: Fail # Firefox does not like dataUrl videos for drawImage
+canvasrenderingcontext2d_test/drawImage_video_element: RuntimeError # Issue 21526
 
 # Firefox Feature support statuses-
 # All changes should be accompanied by platform support annotation changes.
@@ -353,6 +356,9 @@
 # Desktop operation systems do not support touch events on chrome 34 dartium.
 touchevent_test/supported: Fail
 
+[ (($runtime == dartium || $runtime == drt) && $system == macos) || $system == windows ]
+xhr_test/xhr: Skip # Times out.  Issue 21527
+
 [ $compiler == none && $runtime == dartium ]
 async_test: Timeout # Issue 13719: Please triage this failure.
 element_offset_test/offset: Pass, Fail # Issue 13719, 13296
diff --git a/tests/html/no_linked_scripts_htmltest.html b/tests/html/no_linked_scripts_htmltest.html
new file mode 100644
index 0000000..3ec0861
--- /dev/null
+++ b/tests/html/no_linked_scripts_htmltest.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!--
+Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+for details. All rights reserved. Use of this source code is governed by a
+BSD-style license that can be found in the LICENSE file.
+-->
+<!--
+START_HTML_DART_TEST
+{
+  "scripts": [ ],
+  "expectedMessages": ["hest", "fisk"]
+}
+END_HTML_DART_TEST
+-->
+<html>
+<head>
+  <script>window.parent.dispatchEvent(new Event('detect_errors'));</script>
+  <title>No Linked Scripts HTML test</title>
+</head><body>
+  <h1>No Linked Scripts HTML test</h1>
+  <script>
+    window.postMessage('fisk', '*');
+    window.postMessage('ged', '*');
+    window.postMessage('fisk', '*');
+
+    function delayed() {
+      parent.postMessage('ko', '*');
+      window.postMessage('hest', '*');
+    }
+    setTimeout(delayed, 500);
+  </script>
+</body>
+</html>
diff --git a/tests/html/scripts_htmltest.html b/tests/html/scripts_htmltest.html
new file mode 100644
index 0000000..1819595
--- /dev/null
+++ b/tests/html/scripts_htmltest.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<!--
+Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+for details. All rights reserved. Use of this source code is governed by a
+BSD-style license that can be found in the LICENSE file.
+-->
+<!--
+START_HTML_DART_TEST
+{
+  "scripts": ["scripts_test_dart.dart", "scripts_test_js.js"],
+  "expectedMessages": ["crab", "fish", "squid", "sea urchin"]
+}
+END_HTML_DART_TEST
+-->
+<html>
+<head>
+  <script>window.parent.dispatchEvent(new Event('detect_errors'));</script>
+  <title>Scripts HTML test</title>
+</head><body>
+  <h1>Scripts HTML test</h1>
+  <script src="scripts_test_dart.dart" type="application/dart"></script>
+  <script src="scripts_test_js.js"></script>
+</body>
+</html>
diff --git a/tests/html/scripts_test_dart.dart b/tests/html/scripts_test_dart.dart
new file mode 100644
index 0000000..38df274
--- /dev/null
+++ b/tests/html/scripts_test_dart.dart
@@ -0,0 +1,16 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library ScriptsTestDart;
+import 'dart:html';
+import 'dart:async';
+
+main() {
+  window.postMessage('squid', '*');
+  window.postMessage('tiger', '*');  // Unexpected message OK.
+  new Timer(new Duration(seconds: 1), () {
+    window.postMessage('squid', '*');  // Duplicate message OK.
+    window.postMessage('sea urchin', '*');
+  });
+}
\ No newline at end of file
diff --git a/tests/html/scripts_test_js.js b/tests/html/scripts_test_js.js
new file mode 100644
index 0000000..552d418
--- /dev/null
+++ b/tests/html/scripts_test_js.js
@@ -0,0 +1,12 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+window.postMessage('fish', '*');
+
+function delayed() {
+  window.postMessage('cow', '*');  // Unexpected message OK.
+  parent.postMessage('weasel', '*');  // Message to parent OK.
+  window.postMessage('crab', '*');
+}
+setTimeout(delayed, 500);
diff --git a/tests/html/xhr_test.dart b/tests/html/xhr_test.dart
index 5759222..186b596 100644
--- a/tests/html/xhr_test.dart
+++ b/tests/html/xhr_test.dart
@@ -248,10 +248,11 @@
     test('xhr responseHeaders', () {
       return HttpRequest.request(url).then(
         (xhr) {
-          var serverHeader = xhr.responseHeaders['server'];
-          expect(serverHeader, isNotNull);
-          // Should be like: 'Dart/0.1 (dart:io)'
-          expect(serverHeader.startsWith('Dart/'), isTrue);
+          var contentTypeHeader = xhr.responseHeaders['content-type'];
+          expect(contentTypeHeader, isNotNull);
+          // Should be like: 'text/plain; charset=utf-8'
+          expect(contentTypeHeader.contains('text/plain'), isTrue);
+          expect(contentTypeHeader.contains('charset=utf-8'), isTrue);
         });
     });
   });
diff --git a/tests/language/language.status b/tests/language/language.status
index 5df118e..1e35edc 100644
--- a/tests/language/language.status
+++ b/tests/language/language.status
@@ -6,8 +6,6 @@
 # current state of the language.
 
 [ $compiler == none ]
-mixin_super_constructor_named_test: Fail # Issue 12631
-mixin_super_constructor_positionals_test: Fail # Issue 12631
 built_in_identifier_prefix_test: Fail # Issue 6970
 
 # These bugs refer currently ongoing language discussions.
@@ -18,7 +16,6 @@
 
 # Regular bugs which should be fixed.
 duplicate_export_negative_test: Fail # Issue 6134
-mixin_forwarding_constructor2_test: Fail # Issue 13641
 
 
 [ $runtime != vm ]
diff --git a/tests/language/language_analyzer.status b/tests/language/language_analyzer.status
index dacf223..7e82a9c 100644
--- a/tests/language/language_analyzer.status
+++ b/tests/language/language_analyzer.status
@@ -18,6 +18,14 @@
 external_test/25: Fail
 constructor_duplicate_final_test/03: Fail
 identical_const_test: Fail # Issue 21177
+super_bound_closure_test/01: MissingStaticWarning # Issue 18914
+mixin_forwarding_constructor4_test/01: MissingCompileTimeError # Issue 19576
+mixin_forwarding_constructor4_test/02: MissingCompileTimeError # Issue 19576
+mixin_forwarding_constructor4_test/03: MissingCompileTimeError # Issue 19576
+mixin_super_constructor_named_test/01: MissingCompileTimeError # Issue 19576
+mixin_super_constructor_positionals_test/01: MissingCompileTimeError # Issue 19576
+reify_typevar_static_test/00: MissingCompileTimeError # Issue 21565
+reify_typevar_static_test/01: MissingCompileTimeError # Issue 21565
 
 # Please add new failing tests before this line.
 # Section below is for invalid tests.
@@ -163,8 +171,6 @@
 override_inheritance_no_such_method_test/04: StaticWarning # Issue 16132
 override_inheritance_no_such_method_test/05: StaticWarning # Issue 16132
 
-regress_19413_test/01: MissingStaticWarning # Issue 19424
-
 # test issue 20074
 regress_20074_test: CompileTimeError # Issue 20074
 
diff --git a/tests/language/language_analyzer2.status b/tests/language/language_analyzer2.status
index dc4e312..89154fc 100644
--- a/tests/language/language_analyzer2.status
+++ b/tests/language/language_analyzer2.status
@@ -17,6 +17,8 @@
 external_test/24: Fail
 external_test/25: Fail
 constructor_duplicate_final_test/03: Fail
+reify_typevar_static_test/00: MissingCompileTimeError # Issue 21565
+reify_typevar_static_test/01: MissingCompileTimeError # Issue 21565
 
 
 # Please add new failing tests before this line.
@@ -163,11 +165,6 @@
 override_inheritance_no_such_method_test/04: StaticWarning # Issue 16132
 override_inheritance_no_such_method_test/05: StaticWarning # Issue 16132
 
-regress_19413_test/01: MissingStaticWarning # Issue 19424
-
-# test issue 20074
-regress_20074_test: CompileTimeError # Issue 20074
-
 # The following tests are currently assumed to be failing because the test is wrong.
 #
 application_negative_test: CompileTimeError # Test Issue 14528
diff --git a/tests/language/language_dart2js.status b/tests/language/language_dart2js.status
index 660314e..fc56841 100644
--- a/tests/language/language_dart2js.status
+++ b/tests/language/language_dart2js.status
@@ -26,6 +26,11 @@
 type_variable_conflict_test/04: Fail # Issue 13702
 type_variable_conflict_test/05: Fail # Issue 13702
 type_variable_conflict_test/06: Fail # Issue 13702
+mixin_forwarding_constructor4_test/01: MissingCompileTimeError # Issue 15101
+mixin_forwarding_constructor4_test/02: MissingCompileTimeError # Issue 15101
+mixin_forwarding_constructor4_test/03: MissingCompileTimeError # Issue 15101
+mixin_super_constructor_named_test/01: Fail # Issue 15101
+mixin_super_constructor_positionals_test/01: Fail # Issue 15101
 
 ref_before_declaration_test/00: MissingCompileTimeError
 ref_before_declaration_test/01: MissingCompileTimeError
@@ -96,6 +101,8 @@
 malformed_test/none: Fail # Expect failure in lib/_internal/compiler/js_lib/preambles/d8.js
 generic_field_mixin4_test: Crash # Issue 18651
 generic_field_mixin5_test: Crash # Issue 18651
+reify_typevar_static_test/00: Crash # Issue 21566
+reify_typevar_static_test/01: MissingCompileTimeError # Issue 21566
 
 type_variable_conflict2_test/01: RuntimeError # Issue 16180
 type_variable_conflict2_test/02: Crash # Issue 16180
@@ -186,15 +193,13 @@
 type_variable_conflict2_test/08: MissingCompileTimeError # Issue 16180
 type_variable_conflict2_test/10: MissingCompileTimeError # Issue 16180
 regress_13494_test: Fail # Issue 13494
-mixin_super_constructor_named_test: Fail # Issue 12631
-mixin_super_constructor_positionals_test: Fail # Issue 12631
+reify_typevar_static_test/00: MissingCompileTimeError # Issue 21566
+reify_typevar_static_test/01: MissingCompileTimeError # Issue 21566
 
 built_in_identifier_prefix_test: Fail # Issue 6972
 constructor_initializer_test/none: Fail # Issue 12633
 
 # Mixins fail on the VM.
-mixin_forwarding_constructor2_test: Fail # Issue 13641
-
 mixin_with_two_implicit_constructors_test: Fail # Issue 11889
 
 # Calling unresolved class constructor:
diff --git a/tests/language/mixin_forwarding_constructor2_test.dart b/tests/language/mixin_forwarding_constructor2_test.dart
index 1178196..0c51276 100644
--- a/tests/language/mixin_forwarding_constructor2_test.dart
+++ b/tests/language/mixin_forwarding_constructor2_test.dart
@@ -14,7 +14,7 @@
 
 class A {
   var superField;
-  A([this.superField = 3]);
+  A() : superField = 3;
 }
 
 class B extends A with Mixin1, Mixin2 {
diff --git a/tests/language/mixin_forwarding_constructor3_test.dart b/tests/language/mixin_forwarding_constructor3_test.dart
new file mode 100644
index 0000000..1d2f5dc
--- /dev/null
+++ b/tests/language/mixin_forwarding_constructor3_test.dart
@@ -0,0 +1,36 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Verify that a named mixin constructor forwards to the corresponding named
+// base class constructor.
+
+import "package:expect/expect.dart";
+
+abstract class Mixin1 {
+  var mixin1Field = 1;
+}
+
+abstract class Mixin2 {
+  var mixin2Field = 2;
+}
+
+class A {
+  var superField;
+  A(foo) : superField = 0;
+  A.c1(foo) : superField = foo;
+  A.c2(foo) : superField = 0;
+}
+
+class B extends A with Mixin1, Mixin2 {
+  var field = 4;
+  B(unused) : super.c1(3);
+}
+
+main() {
+  var b = new B(null);
+  Expect.equals(1, b.mixin1Field);
+  Expect.equals(2, b.mixin2Field);
+  Expect.equals(3, b.superField);
+  Expect.equals(4, b.field);
+}
diff --git a/tests/language/mixin_forwarding_constructor4_test.dart b/tests/language/mixin_forwarding_constructor4_test.dart
new file mode 100644
index 0000000..5230a10
--- /dev/null
+++ b/tests/language/mixin_forwarding_constructor4_test.dart
@@ -0,0 +1,26 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Verify that when no constructors are forwarded from the base class
+// through a mixin, it is always an error; the mixin does not acquire an
+// implicit default constructor.
+
+abstract class Mixin {}
+
+class Base {
+  Base(
+      {x}        /// 01: compile-time error
+      {x}        /// 02: compile-time error
+      {x}        /// 03: compile-time error
+    );
+}
+
+class C extends Base with Mixin {
+  C();           /// 02: continued
+  C() : super(); /// 03: continued
+}
+
+main() {
+  new C();
+}
diff --git a/tests/language/mixin_super_constructor_named_test.dart b/tests/language/mixin_super_constructor_named_test.dart
index 71afb2a..068108c 100644
--- a/tests/language/mixin_super_constructor_named_test.dart
+++ b/tests/language/mixin_super_constructor_named_test.dart
@@ -6,7 +6,13 @@
 
 class Base {
   int i, j;
-  Base.ctor(int this.i, {int this.j: 10});
+  Base.ctor(int this.i
+            , {int this.j: 10}    /// 01: compile-time error
+           ) {
+    if (j == null) {
+      j = 10;
+    }
+  }
 }
 
 abstract class M {
@@ -18,17 +24,12 @@
 
 class C extends Base with M {
   int l = 131;
-  C.foo() : super.ctor(1, j: 13);
+  C.foo() : super.ctor(1, j: 13); /// 01: compile-time error
   C.bar() : super.ctor(1);
 }
 
 main() {
-  C c1 = new C.foo();
-  Expect.equals(1, c1.i);
-  Expect.equals(13, c1.j);
-  Expect.equals(14, c1.foo());
-  Expect.equals(42, c1.k);
-  Expect.equals(131, c1.l);
+  C c1 = new C.foo();             /// 01: compile-time error
   C c2 = new C.bar();
   Expect.equals(1, c2.i);
   Expect.equals(10, c2.j);
diff --git a/tests/language/mixin_super_constructor_positionals_test.dart b/tests/language/mixin_super_constructor_positionals_test.dart
index 215ae20..289822d 100644
--- a/tests/language/mixin_super_constructor_positionals_test.dart
+++ b/tests/language/mixin_super_constructor_positionals_test.dart
@@ -6,7 +6,11 @@
 
 class Base {
   int i, j;
-  Base.ctor(int this.i, [int this.j = 10]);
+  Base.ctor(int this.i,
+            [                  /// 01: compile-time error
+            int this.j
+            ]                  /// 01: continued
+           );
 }
 
 abstract class M {
@@ -19,7 +23,7 @@
 class C extends Base with M {
   int l = 131;
   C.foo() : super.ctor(1, 13);
-  C.bar() : super.ctor(1);
+  C.bar() : super.ctor(1);     /// 01: continued
 }
 
 main() {
@@ -29,10 +33,5 @@
   Expect.equals(14, c1.foo());
   Expect.equals(42, c1.k);
   Expect.equals(131, c1.l);
-  C c2 = new C.bar();
-  Expect.equals(1, c2.i);
-  Expect.equals(10, c2.j);
-  Expect.equals(11, c2.foo());
-  Expect.equals(42, c2.k);
-  Expect.equals(131, c2.l);
+  C c2 = new C.bar();          /// 01: continued
 }
diff --git a/tests/language/reify_typevar_static_test.dart b/tests/language/reify_typevar_static_test.dart
new file mode 100644
index 0000000..05d9a39
--- /dev/null
+++ b/tests/language/reify_typevar_static_test.dart
@@ -0,0 +1,30 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import "package:expect/expect.dart";
+
+class C<T> {
+  final x;
+  C([this.x]);
+
+  static staticFunction(bool b) =>
+    b ? T :                                /// 00: compile-time error
+    null;
+  factory C.factoryConstructor(bool b) => new C(
+    b ? T :                                /// 01: compile-time error
+    null);
+  C.redirectingConstructor(bool b) : this(
+    b ? T :                                /// 02: ok
+    null);
+  C.ordinaryConstructor(bool b) : x =
+    b ? T :                                /// 03: ok
+    null;
+}
+
+main() {
+  Expect.equals(null, C.staticFunction(false));
+  Expect.equals(null, new C.factoryConstructor(false).x);
+  Expect.equals(null, new C.redirectingConstructor(false).x);
+  Expect.equals(null, new C.ordinaryConstructor(false).x);
+}
diff --git a/tests/language/super_bound_closure_test.dart b/tests/language/super_bound_closure_test.dart
index eb91f5f..1663c93 100644
--- a/tests/language/super_bound_closure_test.dart
+++ b/tests/language/super_bound_closure_test.dart
@@ -72,15 +72,15 @@
   fooIntercept27() => confuse(super.lastWhere)(0);
   fooIntercept28() => confuse(super.lastWhere)(3, orElse: 77);
 
-  bar([var optional]) => -1;
-  bar2({ namedOptional }) => -1;
-  bar3(x, [var optional]) => -1;
-  bar4(x, { namedOptional }) => -1;
+  bar([var optional]) => -1;        /// 01: static type warning
+  bar2({ namedOptional }) => -1;    /// 01: continued
+  bar3(x, [var optional]) => -1;    /// 01: continued
+  bar4(x, { namedOptional }) => -1; /// 01: continued
 
-  gee([var optional]) => -1;
-  gee2({ namedOptional }) => -1;
-  gee3(x, [var optional]) => -1;
-  gee4(x, { namedOptional }) => -1;
+  gee([var optional]) => -1;        /// 01: continued
+  gee2({ namedOptional }) => -1;    /// 01: continued
+  gee3(x, [var optional]) => -1;    /// 01: continued
+  gee4(x, { namedOptional }) => -1; /// 01: continued
 
   add([var optional = 33]) => -1;
   trim({ namedOptional: 22 }) => -1;
@@ -106,27 +106,27 @@
   var ignored2 = list[confuse(3)];
 
   var t = b.gee() + b.gee2() + b.gee3(9) + b.gee4(19);
-  Expect.equals(-4, t);
+  Expect.equals(-4, t); /// 01: continued
   t = b.shuffle() + b.toList() + b.lastIndexOf(1) + b.lastWhere(2);
   Expect.equals(-4, t);
 
-  Expect.equals(499, b.foo());
-  Expect.equals(500, b.foo2());
-  Expect.equals(42, b.foo3());
-  Expect.equals(117, b.foo4());
-  Expect.equals(498, b.foo5());
-  Expect.equals(468, b.foo6());
-  Expect.equals(426, b.foo7());
-  Expect.equals(502, b.foo8());
+  Expect.equals(499, b.foo());  /// 01: continued
+  Expect.equals(500, b.foo2()); /// 01: continued
+  Expect.equals(42, b.foo3());  /// 01: continued
+  Expect.equals(117, b.foo4()); /// 01: continued
+  Expect.equals(498, b.foo5()); /// 01: continued
+  Expect.equals(468, b.foo6()); /// 01: continued
+  Expect.equals(426, b.foo7()); /// 01: continued
+  Expect.equals(502, b.foo8()); /// 01: continued
 
-  Expect.equals(499, b.fooGee());
-  Expect.equals(500, b.fooGee2());
-  Expect.equals(42, b.fooGee3());
-  Expect.equals(117, b.fooGee4());
-  Expect.equals(498, b.fooGee5());
-  Expect.equals(468, b.fooGee6());
-  Expect.equals(426, b.fooGee7());
-  Expect.equals(502, b.fooGee8());
+  Expect.equals(499, b.fooGee());  /// 01: continued
+  Expect.equals(500, b.fooGee2()); /// 01: continued
+  Expect.equals(42, b.fooGee3());  /// 01: continued
+  Expect.equals(117, b.fooGee4()); /// 01: continued
+  Expect.equals(498, b.fooGee5()); /// 01: continued
+  Expect.equals(468, b.fooGee6()); /// 01: continued
+  Expect.equals(426, b.fooGee7()); /// 01: continued
+  Expect.equals(502, b.fooGee8()); /// 01: continued
 
   Expect.equals(1267, b.fooIntercept());
   Expect.equals(1236, b.fooIntercept2());
diff --git a/tests/language/vm/issue21220_vm_test.dart b/tests/language/vm/issue21220_vm_test.dart
new file mode 100644
index 0000000..e251cb5
--- /dev/null
+++ b/tests/language/vm/issue21220_vm_test.dart
@@ -0,0 +1,17 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:typed_data';
+import 'package:expect/expect.dart';
+
+main() {
+  final val = (0xffb15062).toSigned(32);
+  final arr = new Int32x4List(1);
+  arr[0] = new Int32x4(val, val, val, val);
+  Expect.equals(val, arr[0].x);
+  Expect.equals(val, arr[0].y);
+  Expect.equals(val, arr[0].z);
+  Expect.equals(val, arr[0].w);
+}
+
diff --git a/tests/lib/analyzer/analyze_library.status b/tests/lib/analyzer/analyze_library.status
index b69a25e..bb3a64f 100644
--- a/tests/lib/analyzer/analyze_library.status
+++ b/tests/lib/analyzer/analyze_library.status
@@ -15,8 +15,6 @@
 lib/web_audio/dart2js/web_audio_dart2js: CompileTimeError # Issue 16522
 lib/web_gl/dart2js/web_gl_dart2js: CompileTimeError # Issue 16522
 lib/web_sql/dart2js/web_sql_dart2js: CompileTimeError # Issue 16522
- 
-lib/_internal/compiler/samples/compile_loop/compile_loop: CompileTimeError  # Issue 16524
 
 # The async_await compiler isn't part of the repo so it shouldn't be tested by
 # repo tests.
diff --git a/tests/lib/lib.status b/tests/lib/lib.status
index 923014f..4a89f01 100644
--- a/tests/lib/lib.status
+++ b/tests/lib/lib.status
@@ -73,7 +73,7 @@
 mirrors/mirrors_test: RuntimeError # TODO(ahe): I'm working on fixing this. When removing this line please change the "endsWith" to "/mirrors_test.dart".
 mirrors/mirrors_nsm_test/dart2js: RuntimeError # Issue 19353
 mirrors/mixin_test: RuntimeError # Issue 12464
-mirrors/mixin_application_test/none: RuntimeError # Issue 12464
+mirrors/mixin_application_test: RuntimeError # Issue 12464
 mirrors/parameter_test/none: RuntimeError # Issue 6490
 mirrors/parameter_of_mixin_app_constructor_test: RuntimeError # Issue 6490
 mirrors/private_symbol_test: CompileTimeError # Issue 13597
@@ -89,7 +89,7 @@
 mirrors/repeated_private_anon_mixin_app_test: RuntimeError # Issue 14670
 mirrors/symbol_validation_test/01: RuntimeError # Issue 13597
 mirrors/static_members_test: RuntimeError # Issue 14633, Issue 12164
-mirrors/typedef_test/none: RuntimeError # http://dartbug.com/6490
+mirrors/typedef_test: RuntimeError # http://dartbug.com/6490
 mirrors/typedef_metadata_test: RuntimeError # Issue 12785
 mirrors/typedef_reflected_type_test/01: RuntimeError # Issue 12607
 mirrors/typevariable_mirror_metadata_test: CompileTimeError # Issue 10905
@@ -225,19 +225,13 @@
 async/timer_not_available_test: Fail, OK
 mirrors/native_class_test: Fail, OK # This test is meant to run in a browser.
 
-[ $compiler == none  ]
-mirrors/hierarchy_test: Fail # TODO(ahe): This test is slightly broken. http://dartbug.com/12464
-mirrors/mixin_application_test/01: Fail, OK # TODO(ahe): Slight broken test to ensure test coverage on dart2js.
-mirrors/intercepted_object_test: Fail, OK # TODO(ahe): Slight broken test to ensure test coverage on dart2js.
-mirrors/typedef_test/01: Fail, OK # Incorrect dart2js behavior.
+[ $compiler == none ]
+async/timer_not_available_test: SkipByDesign # only meant to test when there is no way to implement timer (currently only in d8)
 
 mirrors/generic_local_function_test: RuntimeError # Issue 14913
 mirrors/symbol_validation_test: RuntimeError # Issue 13596
-mirrors/mirrors_used_inheritance_test: RuntimeError # Issue 16048
 
-async/timer_not_available_test: SkipByDesign # only meant to test when there is no way to implement timer (currently only in d8)
-
-mirrors/typedef_declaration_test/01: Fail # dartbug.com/16048. Remove multitest marker when it passes.
+mirrors/mirrors_used*: Skip # Invalid tests.
 
 [ $compiler == none && ( $runtime == drt || $runtime == dartium || $runtime == ContentShellOnAndroid) ]
 async/schedule_microtask6_test: Fail # Issue 10910
diff --git a/tests/lib/mirrors/hierarchy_test.dart b/tests/lib/mirrors/hierarchy_test.dart
deleted file mode 100644
index 16937a6..0000000
--- a/tests/lib/mirrors/hierarchy_test.dart
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright (c) 2013, 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.
-
-library hierarchy_test;
-
-@MirrorsUsed(targets: 'hierarchy_test, Object')
-import 'dart:mirrors';
-
-import 'package:expect/expect.dart';
-
-class FooMixin {
-  foo() => print('foo');
-}
-
-class Qux {
-  qux() => print('qux');
-}
-
-class Bar extends Qux implements FooMixin {
-  bar() => print('bar');
-  foo() => print('foo');
-}
-
-class Baz extends Qux with FooMixin {
-  bar() => print('bar');
-}
-
-stringifyHierarchy(mirror) {
-  var sb = new StringBuffer();
-  for (var type = mirror.type; type != null; type = type.superclass) {
-    sb.write('> ${MirrorSystem.getName(type.qualifiedName)}\n');
-    for (var i in type.superinterfaces) {
-      sb.write('  + ${MirrorSystem.getName(i.qualifiedName)}\n');
-    }
-  }
-  return '$sb';
-}
-
-main() {
-  Expect.stringEquals('''
-> hierarchy_test.Bar
-  + hierarchy_test.FooMixin
-> hierarchy_test.Qux
-> dart.core.Object
-''', stringifyHierarchy(reflect(new Bar()..foo()..bar()..qux())));
-
-  Expect.stringEquals('''
-> hierarchy_test.Baz
-> hierarchy_test.Qux with hierarchy_test.FooMixin
-  + hierarchy_test.FooMixin
-> hierarchy_test.Qux
-> dart.core.Object
-''', stringifyHierarchy(reflect(new Baz()..foo()..bar()..qux())));
-}
diff --git a/tests/lib/mirrors/intercepted_object_test.dart b/tests/lib/mirrors/intercepted_object_test.dart
index 1aa8060..e01733b 100644
--- a/tests/lib/mirrors/intercepted_object_test.dart
+++ b/tests/lib/mirrors/intercepted_object_test.dart
@@ -25,6 +25,12 @@
       return;
     }
   }
+ 
+  // A class implements itself, even if not explicitly declared.
+  if (symName == stringify(cls.simpleName)) {
+    checkClassMirrorMethods(cls);
+    return;
+  }
 
   // TODO(floitsch): use correct fail
   expect(name, "super interface not found");
diff --git a/tests/lib/mirrors/typedef_declaration_test.dart b/tests/lib/mirrors/mirrors_used_typedef_declaration_test.dart
similarity index 100%
rename from tests/lib/mirrors/typedef_declaration_test.dart
rename to tests/lib/mirrors/mirrors_used_typedef_declaration_test.dart
diff --git a/tests/lib/mirrors/mixin_application_test.dart b/tests/lib/mirrors/mixin_application_test.dart
index 10b7866..346d9d5 100644
--- a/tests/lib/mirrors/mixin_application_test.dart
+++ b/tests/lib/mirrors/mixin_application_test.dart
@@ -118,7 +118,6 @@
   ]);
 
   String owner = 'Mixin';
-  owner = 'MixinApplication'; /// 01: ok
   expect(
       '{i: Variable(s(i) in s($owner)),'
       ' m: Method(s(m) in s($owner))}',
@@ -132,9 +131,7 @@
 }
 
 testMixinApplicationA() {
-  // TODO(ahe): I don't think an anonymous mixin has an owner.
   String owner = ' in s(test.mixin_application_test)';
-  owner = ''; /// 01: ok
   checkClass(MixinApplicationA, [
       'Class(s(MixinApplicationA)'
       ' in s(test.mixin_application_test), top-level)',
@@ -147,7 +144,6 @@
   ]);
 
   owner = 'Mixin2';
-  owner = 'MixinApplicationA'; /// 01: ok
   expect(
       '{i2: Variable(s(i2) in s($owner)),'
       ' m2: Method(s(m2) in s($owner))}',
@@ -164,7 +160,6 @@
       membersOf(reflectClass(MixinApplicationA).superclass));
 
   String name = 'test.model.C with test.mixin_application_test.Mixin';
-  name = 'Mixin'; /// 01: ok
   expect(
       '{$name:'
       ' Method(s($name)'
@@ -187,7 +182,6 @@
   ]);
 
   String owner = 'Mixin';
-  owner = 'UnusedMixinApplication'; /// 01: ok
   expect(
       '{i: Variable(s(i) in s($owner)),'
       ' m: Method(s(m) in s($owner))}',
@@ -203,7 +197,6 @@
 
 testSubclass() {
   String owner = ' in s(test.mixin_application_test)';
-  owner = ''; /// 01: ok
   checkClass(Subclass, [
       'Class(s(Subclass) in s(test.mixin_application_test), top-level)',
       'Class(s(test.model.C with test.mixin_application_test.Mixin)'
@@ -228,7 +221,6 @@
       membersOf(reflectClass(Subclass).superclass));
 
   String name = 'test.model.C with test.mixin_application_test.Mixin';
-  name = 'Mixin'; /// 01: ok
   expect(
       '{$name:'
       ' Method(s($name)'
@@ -264,9 +256,7 @@
 }
 
 testSubclassA() {
-  // TODO(ahe): I don't think an anonymous mixin has an owner.
   String owner = ' in s(test.mixin_application_test)';
-  owner = ''; /// 01: ok
   checkClass(SubclassA, [
       'Class(s(SubclassA) in s(test.mixin_application_test), top-level)',
       'Class(s(test.model.C with test.mixin_application_test.Mixin,'
@@ -295,7 +285,6 @@
   String name =
       'test.model.C with test.mixin_application_test.Mixin,'
       ' test.mixin_application_test.Mixin2';
-  name = 'Mixin2'; /// 01: ok
   expect(
       '{$name: Method(s($name) in s($name), constructor)}',
       constructorsOf(reflectClass(SubclassA).superclass));
@@ -306,7 +295,6 @@
       membersOf(reflectClass(SubclassA).superclass.superclass));
 
   name = 'test.model.C with test.mixin_application_test.Mixin';
-  name = 'Mixin'; /// 01: ok
   expect(
       '{$name:'
       ' Method(s($name)'
@@ -319,9 +307,7 @@
 }
 
 testSubclass2A() {
-  // TODO(ahe): I don't think an anonymous mixin has an owner.
   String owner = ' in s(test.mixin_application_test)';
-  owner = ''; /// 01: ok
   checkClass(Subclass2A, [
       'Class(s(Subclass2A) in s(test.mixin_application_test), top-level)',
       'Class(s(MixinApplicationA) in s(test.mixin_application_test),'
diff --git a/tests/lib/mirrors/typedef_test.dart b/tests/lib/mirrors/typedef_test.dart
index 11b9e71..19c7a70 100644
--- a/tests/lib/mirrors/typedef_test.dart
+++ b/tests/lib/mirrors/typedef_test.dart
@@ -43,19 +43,13 @@
 
 // Return "$args -> $ret".
 ft(args, ret) {
-  return '$args -> $ret'
-      // TODO(ahe): dart2js doesn't fully qualify type names.
-      .replaceAll('dart.core.', '') /// 01: ok
-      ;
+  return '$args -> $ret';
 }
 
 void main() {
   String x = 'x';
   String y = 'y';
   String z = 'z';
-  x = 'argument0'; /// 01: ok
-  y = 'argument1'; /// 01: ok
-  z = 'argument2'; /// 01: ok
 
   Expect.stringEquals(
       """
diff --git a/tests/standalone/io/code_collection_test.dart b/tests/standalone/io/code_collection_test.dart
index 6ab720b..696be6e 100644
--- a/tests/standalone/io/code_collection_test.dart
+++ b/tests/standalone/io/code_collection_test.dart
@@ -23,8 +23,9 @@
 
 
 doTest() {
- var i = 0;
-  foo(1);  // Initial call to compile.
+  var i = 0;
+  var ret = foo(1);  // Initial call to compile.
+  print("foo=$ret");
   // Time passes, GC runs, foo's code is dropped.
   var ms = const Duration(milliseconds: 100);
   var t = new Timer.periodic(ms, (timer) {
@@ -34,7 +35,8 @@
       timer.cancel();
       // foo is called again to make sure we can still run it even after
       // its code has been detached.
-      foo(2);
+      var ret = foo(2);
+      print("foo=$ret");
     }
   });
 }
@@ -47,7 +49,7 @@
     // Run the test and capture stdout.
     var pr = Process.runSync(Platform.executable,
         ["--collect-code",
-         "--code-collection-interval-in-us=100000",
+         "--code-collection-interval-in-us=0",
          "--old_gen_growth_rate=10",
          "--log-code-drop",
          "--optimization-counter-threshold=-1",
@@ -55,14 +57,25 @@
          Platform.script.toFilePath(),
          "--run"]);
 
+    Expect.equals(0, pr.exitCode);
+
     // Code drops are logged with --log-code-drop. Look through stdout for the
     // message that foo's code was dropped.
-    var found = false;
+    var count = 0;
     pr.stdout.split("\n").forEach((line) {
+      if (line.contains("foo=2")) {
+        Expect.equals(0, count);
+        count++;
+      }
       if (line.contains("Detaching code") && line.contains("foo")) {
-        found = true;
+        Expect.equals(1, count);
+        count++;
+      }
+      if (line.contains("foo=3")) {
+        Expect.equals(2, count);
+        count++;
       }
     });
-    Expect.isTrue(found);
+    Expect.equals(3, count);
   }
 }
diff --git a/tests/standalone/io/secure_socket_alpn_test.dart b/tests/standalone/io/secure_socket_alpn_test.dart
new file mode 100644
index 0000000..963fb74
--- /dev/null
+++ b/tests/standalone/io/secure_socket_alpn_test.dart
@@ -0,0 +1,214 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:io';
+import 'dart:convert';
+
+import 'package:expect/expect.dart';
+import 'package:async_helper/async_helper.dart';
+
+const String MAX_LEN_ERROR =
+    'Length of protocol must be between 1 and 255';
+
+const String MAX_MSG_LEN_ERROR =
+    'The maximum message length supported is 2^15-1';
+
+void InitializeSSL() {
+  var testPkcertDatabase = Platform.script.resolve('pkcert').toFilePath();
+  SecureSocket.initialize(database: testPkcertDatabase,
+                          password: 'dartdart');
+}
+
+// Tests that client/server with same protocol can securly establish a
+// connection, negogiate the protocol and can send data to each other.
+void testSuccessfulAlpnNegogiationConnection(List<String> clientProtocols,
+                                             List<String> serverProtocols,
+                                             String selectedProtocol) {
+  asyncStart();
+  SecureServerSocket.bind('localhost', 0, 'localhost_cert',
+     supportedProtocols: serverProtocols).then((SecureServerSocket server) {
+
+    asyncStart();
+    server.first.then((SecureSocket socket) {
+      Expect.equals(selectedProtocol, socket.selectedProtocol);
+      socket..write('server message')..close();
+      socket.transform(ASCII.decoder).join('').then((String s) {
+        Expect.equals('client message', s);
+        asyncEnd();
+      });
+    });
+
+    asyncStart();
+    SecureSocket.connect('localhost', server.port,
+        supportedProtocols: clientProtocols).then((socket) {
+      Expect.equals(selectedProtocol, socket.selectedProtocol);
+      socket..write('client message')..close();
+      socket.transform(ASCII.decoder).join('').then((String s) {
+        Expect.equals('server message', s);
+        server.close();
+        asyncEnd();
+      });
+    });
+
+    asyncEnd();
+  });
+}
+
+void testFailedAlpnNegogiationConnection(List<String> clientProtocols,
+                                         List<String> serverProtocols) {
+  asyncStart();
+  SecureServerSocket.bind('localhost', 0, 'localhost_cert',
+     supportedProtocols: serverProtocols).then((SecureServerSocket server) {
+
+    asyncStart();
+    server.first.catchError((error, stack) {
+      Expect.isTrue(error is HandshakeException);
+      asyncEnd();
+    });
+
+    asyncStart();
+    SecureSocket.connect('localhost',
+                         server.port,
+                         supportedProtocols: clientProtocols)
+        .catchError((error, stack) {
+      Expect.isTrue(error is HandshakeException);
+      asyncEnd();
+    });
+
+    asyncEnd();
+  });
+}
+
+void testInvalidArgumentsLongName(List<String> protocols,
+                                  bool isLenError,
+                                  bool isMsgLenError) {
+  asyncStart();
+  SecureServerSocket.bind('localhost', 0, 'localhost_cert',
+     supportedProtocols: protocols).then((SecureServerSocket server) {
+
+    asyncStart();
+    server.first.catchError((error, stack) {
+      String errorString = '${(error as ArgumentError)}';
+      if (isLenError) {
+        Expect.isTrue(errorString.contains(MAX_LEN_ERROR));
+      } else if (isMsgLenError) {
+        Expect.isTrue(errorString.contains(MAX_MSG_LEN_ERROR));
+      } else {
+        throw 'unreachable';
+      }
+      asyncEnd();
+    });
+
+    asyncStart();
+    SecureSocket.connect('localhost',
+                         server.port,
+                         supportedProtocols: protocols)
+        .catchError((error, stack) {
+      String errorString = '${(error as ArgumentError)}';
+      if (isLenError) {
+        Expect.isTrue(errorString.contains(MAX_LEN_ERROR));
+      } else if (isMsgLenError) {
+        Expect.isTrue(errorString.contains(MAX_MSG_LEN_ERROR));
+      } else {
+        throw 'unreachable';
+      }
+      asyncEnd();
+    });
+
+    asyncEnd();
+  });
+}
+
+main() {
+  InitializeSSL();
+  final longname256 = 'p' * 256;
+  final String longname255 = 'p' * 255;
+  final String strangelongname255 = 'ø' + 'p' * 253;
+  final String strangelongname256 = 'ø' + 'p' * 254;
+
+  // This produces a message of (1 << 15)-2 bytes (1 length and 1 ascii byte).
+  final List<String> allProtocols = new Iterable.generate(
+      (1 << 14) - 1, (i) => '0').toList();
+
+  // This produces a message of (1 << 15) bytes (1 length and 1 ascii byte).
+  final List<String> allProtocolsPlusOne = new Iterable.generate(
+      (1 << 14), (i) => '0').toList();
+
+  // Protocols are in order of decreasing priority. First matching protocol
+  // will be taken.
+
+  // Test successfull negotiation, including priority.
+  testSuccessfulAlpnNegogiationConnection(['a'],
+                                          ['a'],
+                                          'a');
+
+  testSuccessfulAlpnNegogiationConnection([longname255],
+                                          [longname255],
+                                          longname255);
+
+  testSuccessfulAlpnNegogiationConnection([strangelongname255],
+                                          [strangelongname255],
+                                          strangelongname255);
+
+  testSuccessfulAlpnNegogiationConnection(allProtocols,
+                                          allProtocols,
+                                          '0');
+
+  testSuccessfulAlpnNegogiationConnection(['a', 'b', 'c'],
+                                          ['a', 'b', 'c'],
+                                          'a');
+
+  testSuccessfulAlpnNegogiationConnection(['a', 'b', 'c'],
+                                          ['c'],
+                                          'c');
+
+  // Server precedence.
+  testSuccessfulAlpnNegogiationConnection(['a', 'b', 'c'],
+                                          ['c', 'b', 'a'],
+                                          'a');
+
+  testSuccessfulAlpnNegogiationConnection(['c'],
+                                          ['a', 'b', 'c'],
+                                          'c');
+
+  testSuccessfulAlpnNegogiationConnection(['s1', 'b', 'e1'],
+                                          ['s2', 'b', 'e2'],
+                                          'b');
+
+  // Test no protocol negotiation support
+  testSuccessfulAlpnNegogiationConnection(null,
+                                          null,
+                                          null);
+
+  testSuccessfulAlpnNegogiationConnection(['a', 'b', 'c'],
+                                          null,
+                                          null);
+
+  testSuccessfulAlpnNegogiationConnection(null,
+                                          ['a', 'b', 'c'],
+                                          null);
+
+  testSuccessfulAlpnNegogiationConnection([],
+                                          [],
+                                          null);
+
+  testSuccessfulAlpnNegogiationConnection(['a', 'b', 'c'],
+                                          [],
+                                          null);
+
+  testSuccessfulAlpnNegogiationConnection([],
+                                          ['a', 'b', 'c'],
+                                          null);
+
+  // Test non-overlapping protocols.
+  testFailedAlpnNegogiationConnection(['a'], ['b']);
+
+
+  // Test too short / too long protocol names.
+  testInvalidArgumentsLongName([longname256], true, false);
+  testInvalidArgumentsLongName([strangelongname256], true, false);
+  testInvalidArgumentsLongName([''], true, false);
+  testInvalidArgumentsLongName(allProtocolsPlusOne, false, true);
+  testInvalidArgumentsLongName(allProtocolsPlusOne, false, true);
+}
diff --git a/tests/standalone/priority_queue_stress_test.dart b/tests/standalone/priority_queue_stress_test.dart
index a795892..99c0d41 100644
--- a/tests/standalone/priority_queue_stress_test.dart
+++ b/tests/standalone/priority_queue_stress_test.dart
@@ -185,7 +185,7 @@
 
   bool get isEmpty => restrictedQueues.length + mainQueue.length == 0;
 
-  int get length => restrictedQueues.fold(0, (v, e) => v + element.length) +
+  int get length => restrictedQueues.fold(0, (v, e) => v + e.length) +
                     mainQueue.length;
 
   PriorityQueue getRestricted(List<N> restrictions) {
@@ -208,7 +208,7 @@
     var candidate = getRestricted([]);
     if (candidate != null &&
         (mainQueue.isEmpty ||
-         mainQueue.first.priority < candidate.first.priority)) {
+         mainQueue.firstPriority < candidate.firstPriority)) {
       return candidate.first;
     }
     return mainQueue.isEmpty ? null : mainQueue.first;
@@ -247,6 +247,7 @@
         restrictedQueue.add(current, currentPriority);
       }
     }
+    return null;
   }
 
   String toString() {
diff --git a/tests/standalone/standalone.status b/tests/standalone/standalone.status
index 80365fc..d51d56e 100644
--- a/tests/standalone/standalone.status
+++ b/tests/standalone/standalone.status
@@ -60,8 +60,6 @@
 # This is runtime test.
 io/process_exit_negative_test: Skip
 
-priority_queue_stress_test: StaticWarning # Issue 21468
-
 [ $compiler == dart2js ]
 number_identity_test: Skip # Bigints and int/double diff. not supported.
 typed_data_test: Skip # dart:typed_data support needed.
diff --git a/tests/try/poi/apply_updates_test.dart b/tests/try/poi/apply_updates_test.dart
index 683ca94..91ecd9a 100644
--- a/tests/try/poi/apply_updates_test.dart
+++ b/tests/try/poi/apply_updates_test.dart
@@ -13,7 +13,7 @@
     LibraryUpdater,
     Update;
 
-import 'package:compiler/implementation/scanner/scannerlib.dart' show
+import 'package:compiler/src/scanner/scannerlib.dart' show
     PartialFunctionElement;
 
 import 'compiler_test_case.dart';
diff --git a/tests/try/poi/compiler_test_case.dart b/tests/try/poi/compiler_test_case.dart
index ef72dd2..ce59033 100644
--- a/tests/try/poi/compiler_test_case.dart
+++ b/tests/try/poi/compiler_test_case.dart
@@ -21,10 +21,10 @@
 export 'package:expect/expect.dart' show
     Expect;
 
-import 'package:compiler/implementation/elements/elements.dart' show
+import 'package:compiler/src/elements/elements.dart' show
     LibraryElement;
 
-export 'package:compiler/implementation/elements/elements.dart' show
+export 'package:compiler/src/elements/elements.dart' show
     LibraryElement;
 
 const String CONSTANT_CLASS = 'class Constant { const Constant(); }';
diff --git a/tests/try/poi/diff_test.dart b/tests/try/poi/diff_test.dart
index e01a1f9..6e99cd9 100644
--- a/tests/try/poi/diff_test.dart
+++ b/tests/try/poi/diff_test.dart
@@ -14,14 +14,14 @@
 import 'package:async_helper/async_helper.dart' show
     asyncTest;
 
-import 'package:compiler/implementation/dart2jslib.dart' show
+import 'package:compiler/src/dart2jslib.dart' show
     Compiler,
     Script;
 
-import 'package:compiler/implementation/source_file.dart' show
+import 'package:compiler/src/source_file.dart' show
     StringSourceFile;
 
-import 'package:compiler/implementation/elements/elements.dart' show
+import 'package:compiler/src/elements/elements.dart' show
     Element,
     LibraryElement;
 
diff --git a/tests/try/poi/forget_element_test.dart b/tests/try/poi/forget_element_test.dart
index 519a49d..b674f7c 100644
--- a/tests/try/poi/forget_element_test.dart
+++ b/tests/try/poi/forget_element_test.dart
@@ -5,7 +5,7 @@
 // Test of Compiler.forgetElement.
 library trydart.forget_element_test;
 
-import 'package:compiler/implementation/elements/elements.dart' show
+import 'package:compiler/src/elements/elements.dart' show
     AstElement,
     ClassElement,
     Element,
@@ -15,24 +15,24 @@
     ScopeContainerElement,
     VariableElement;
 
-import 'package:compiler/implementation/js_backend/js_backend.dart' show
+import 'package:compiler/src/js_backend/js_backend.dart' show
     JavaScriptBackend;
 
-import 'package:compiler/implementation/tree/tree.dart' as tree;
+import 'package:compiler/src/tree/tree.dart' as tree;
 
-import 'package:compiler/implementation/scanner/scannerlib.dart' show
+import 'package:compiler/src/scanner/scannerlib.dart' show
     PartialMetadataAnnotation;
 
-import 'package:compiler/implementation/elements/visitor.dart' show
+import 'package:compiler/src/elements/visitor.dart' show
     ElementVisitor;
 
-import 'package:compiler/implementation/dart2jslib.dart' show
+import 'package:compiler/src/dart2jslib.dart' show
     DartConstantCompiler;
 
-import 'package:compiler/implementation/universe/universe.dart' show
+import 'package:compiler/src/universe/universe.dart' show
     Universe;
 
-import 'package:compiler/implementation/dart_types.dart' show
+import 'package:compiler/src/dart_types.dart' show
     DartType;
 
 import 'compiler_test_case.dart';
diff --git a/tests/try/poi/library_updater_test.dart b/tests/try/poi/library_updater_test.dart
index 5531eeb..34a4022 100644
--- a/tests/try/poi/library_updater_test.dart
+++ b/tests/try/poi/library_updater_test.dart
@@ -40,8 +40,6 @@
         updater.canReuseLibrary(library, UTF8.encode(newSource));
     Expect.equals(expectedCanReuse, actualCanReuse);
 
-    Expect.equals(expectedCanReuse, updater.hasPendingUpdates);
-
     Expect.setEquals(
         expectedUpdates.toSet(),
         updater.updates.map((Update update) => update.before.name).toSet());
diff --git a/tests/try/poi/poi_find_test.dart b/tests/try/poi/poi_find_test.dart
index 495e59f..496697a 100644
--- a/tests/try/poi/poi_find_test.dart
+++ b/tests/try/poi/poi_find_test.dart
@@ -18,10 +18,10 @@
 
 import 'package:expect/expect.dart';
 
-import 'package:compiler/implementation/elements/elements.dart' show
+import 'package:compiler/src/elements/elements.dart' show
     Element;
 
-import 'package:compiler/implementation/source_file_provider.dart' show
+import 'package:compiler/src/source_file_provider.dart' show
     FormattingDiagnosticHandler;
 
 Future testPoi() {
diff --git a/tests/try/poi/serialize_test.dart b/tests/try/poi/serialize_test.dart
index 06b11c3..c161d97 100644
--- a/tests/try/poi/serialize_test.dart
+++ b/tests/try/poi/serialize_test.dart
@@ -21,10 +21,10 @@
 
 import 'package:expect/expect.dart';
 
-import 'package:compiler/implementation/elements/elements.dart' show
+import 'package:compiler/src/elements/elements.dart' show
     Element;
 
-import 'package:compiler/implementation/source_file_provider.dart' show
+import 'package:compiler/src/source_file_provider.dart' show
     FormattingDiagnosticHandler;
 
 Future testInteresting() {
@@ -398,6 +398,10 @@
     "kind": "class"
   },
   {
+    "name": "IndexError",
+    "kind": "class"
+  },
+  {
     "name": "FallThroughError",
     "kind": "class"
   },
diff --git a/tests/try/try.status b/tests/try/try.status
index d045b0b..fa0dfba 100644
--- a/tests/try/try.status
+++ b/tests/try/try.status
@@ -31,10 +31,7 @@
 [ $compiler == dart2js ]
 poi/*: Skip # http://dartbug.com/20031
 
-[ $runtime == ff && $unchecked ]
-# Compilation is slow, test fails at runtime due to time out.
-web/incremental_compilation_update_test: Slow, Fail
-
-[ $compiler == dart2js && $checked ]
-# Compilation is slow, test fails at runtime due to time out.
-web/incremental_compilation_update_test: Slow, Fail
+[ $compiler == dart2js ]
+# Compilation is slow, test fails at runtime due to time out, but
+# unpredictably.
+web/incremental_compilation_update_test: Skip
diff --git a/tests/utils/dart2js_test.dart b/tests/utils/dart2js_test.dart
index 84f5a3f..381475f 100644
--- a/tests/utils/dart2js_test.dart
+++ b/tests/utils/dart2js_test.dart
@@ -4,7 +4,7 @@
 
 // Test to ensure that dart2js is free of warnings.
 
-import 'package:compiler/implementation/dart2js.dart'
+import 'package:compiler/src/dart2js.dart'
     as dart2js;
 
 void main() {
diff --git a/tests/utils/source_mirrors_test.dart b/tests/utils/source_mirrors_test.dart
index a29da99..8a748c7 100644
--- a/tests/utils/source_mirrors_test.dart
+++ b/tests/utils/source_mirrors_test.dart
@@ -10,7 +10,7 @@
 import 'dart:async';
 import "package:async_helper/async_helper.dart";
 
-import 'package:compiler/implementation/mirrors/analyze.dart';
+import 'package:compiler/src/mirrors/analyze.dart';
 import 'dummy_compiler_test.dart';
 
 main() {
diff --git a/tools/VERSION b/tools/VERSION
index 998fa2d..79f8ce9 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
 MAJOR 1
 MINOR 8
 PATCH 0
-PRERELEASE 3
+PRERELEASE 4
 PRERELEASE_PATCH 0
diff --git a/tools/create_sdk.py b/tools/create_sdk.py
index 2083f05..81be9de 100755
--- a/tools/create_sdk.py
+++ b/tools/create_sdk.py
@@ -112,8 +112,8 @@
 
 
 def CopyDartScripts(home, sdk_root):
-  for executable in ['dart2js', 'dartanalyzer_sdk', 'dartfmt', 'docgen',
-                     'pub_sdk']:
+  for executable in ['dart2js_sdk', 'dartanalyzer_sdk', 'dartfmt', 'docgen',
+                     'dartdocgen', 'pub_sdk']:
     CopyShellScript(os.path.join(home, 'sdk', 'bin', executable),
                     os.path.join(sdk_root, 'bin'))
 
diff --git a/tools/dom/docs/lib/docs.dart b/tools/dom/docs/lib/docs.dart
index 62ca836..3fb5d87 100644
--- a/tools/dom/docs/lib/docs.dart
+++ b/tools/dom/docs/lib/docs.dart
@@ -11,8 +11,8 @@
 library docs;
 
 import '../../../../sdk/lib/_internal/dartdoc/lib/src/dart2js_mirrors.dart';
-import '../../../../sdk/lib/_internal/compiler/implementation/mirrors/source_mirrors.dart';
-import '../../../../sdk/lib/_internal/compiler/implementation/mirrors/mirrors_util.dart';
+import '../../../../pkg/compiler/lib/src/mirrors/source_mirrors.dart';
+import '../../../../pkg/compiler/lib/src/mirrors/mirrors_util.dart';
 import '../../../../sdk/lib/_internal/dartdoc/lib/dartdoc.dart';
 import '../../../../sdk/lib/_internal/dartdoc/lib/src/json_serializer.dart';
 import '../../../../utils/apidoc/lib/metadata.dart';
diff --git a/tools/dom/scripts/systemhtml.py b/tools/dom/scripts/systemhtml.py
index b8409e9..f4bb124 100644
--- a/tools/dom/scripts/systemhtml.py
+++ b/tools/dom/scripts/systemhtml.py
@@ -788,7 +788,7 @@
           '  $TYPE operator[](int index) {\n'
           '    if (JS("bool", "# >>> 0 !== # || # >= #", index,\n'
           '        index, index, length))\n'
-          '      throw new RangeError.range(index, 0, length);\n'
+          '      throw new RangeError.index(index, this);\n'
           '    return $INDEXED_GETTER;\n'
           '  }',
           INDEXED_GETTER=indexed_getter,
@@ -1241,7 +1241,7 @@
       imports_emitter, map_emitter = emitters
     else:
       imports_emitter, map_emitter = emitters, None
-      
+
 
     for path in sorted(self._paths):
       relpath = os.path.relpath(path, library_file_dir)
@@ -1256,7 +1256,7 @@
           "  '$IDL_NAME': () => $DART_NAME,\n",
           IDL_NAME=idl_name,
           DART_NAME=dart_name)
-      
+
 
 # ------------------------------------------------------------------------------
 
diff --git a/tools/dom/scripts/systemnative.py b/tools/dom/scripts/systemnative.py
index 432d68d..4f5a7ed 100644
--- a/tools/dom/scripts/systemnative.py
+++ b/tools/dom/scripts/systemnative.py
@@ -364,7 +364,7 @@
 class DartiumBackend(HtmlDartGenerator):
   """Generates Dart implementation for one DOM IDL interface."""
 
-  def __init__(self, interface, 
+  def __init__(self, interface,
                cpp_library_emitter, options):
     super(DartiumBackend, self).__init__(interface, options, True)
 
@@ -672,7 +672,7 @@
 
     constructor_callback_cpp_name = 'constructorCallback'
     self._EmitConstructorInfrastructure(
-        constructor_info, "", constructor_callback_cpp_name, '_create', 
+        constructor_info, "", constructor_callback_cpp_name, '_create',
         is_custom=True)
 
     self._cpp_declarations_emitter.Emit(
@@ -686,10 +686,10 @@
     return IsOptional(argument)
 
   def EmitStaticFactoryOverload(self, constructor_info, name, arguments):
-    constructor_callback_cpp_name = name + 'constructorCallback'  
+    constructor_callback_cpp_name = name + 'constructorCallback'
     self._EmitConstructorInfrastructure(
-        constructor_info, name, 'constructorCallback', name, arguments, 
-        emit_to_native=True, 
+        constructor_info, name, 'constructorCallback', name, arguments,
+        emit_to_native=True,
         is_custom=False)
 
     ext_attrs = self._interface.ext_attrs
@@ -1048,7 +1048,7 @@
           '\n'
           '  $TYPE operator[](int index) {\n'
           '    if (index < 0 || index >= length)\n'
-          '      throw new RangeError.range(index, 0, length);\n'
+          '      throw new RangeError.index(index, this);\n'
           '    return $(DART_NATIVE_NAME)(this, index);\n'
           '  }\n\n'
           '  $TYPE _nativeIndexedGetter(int index) =>'
@@ -1106,7 +1106,7 @@
         '\n'
         '  $TYPE operator[](int index) {\n'
         '    if (index < 0 || index >= length)\n'
-        '      throw new RangeError.range(index, 0, length);\n'
+        '      throw new RangeError.index(index, this);\n'
         '    return $INDEXED_GETTER(index);\n'
         '  }\n',
         TYPE=dart_element_type,
@@ -1120,7 +1120,7 @@
     formals = ', '.join(['int index', '%s value' % element_type])
     parameters = ['index', 'value']
     dart_declaration = 'void operator[]=(%s)' % formals
-    self._GenerateNativeBinding('numericIndexSetter', 3, 
+    self._GenerateNativeBinding('numericIndexSetter', 3,
       dart_declaration, False, return_type, parameters,
       'Callback', True, False)
 
diff --git a/tools/get_archive.py b/tools/get_archive.py
index f6ec8cd..409d147 100755
--- a/tools/get_archive.py
+++ b/tools/get_archive.py
@@ -240,10 +240,6 @@
         print name + ' is up to date.\nVersion: ' + latest
       return 0 # up to date
 
-  if os.path.exists(directory):
-    print 'Removing old %s tree %s' % (name, directory)
-    shutil.rmtree(directory)
-
   # download the zip file to a temporary path, and unzip to the target location
   temp_dir = tempfile.mkdtemp()
   try:
@@ -270,7 +266,10 @@
     if directory == SDK_DIR:
       unzipped_dir = os.path.join(temp_dir, 'dart-sdk')
     if os.path.exists(directory):
-      raise Exception(
+      print 'Removing old %s tree %s' % (name, directory)
+      shutil.rmtree(directory)
+      if os.path.exists(directory):
+        raise Exception(
           'Removal of directory %s failed. Is the executable running?' %
           directory)
     shutil.move(unzipped_dir, directory)
diff --git a/tools/gn_helpers.py b/tools/gn_helpers.py
new file mode 100644
index 0000000..3b0647d
--- /dev/null
+++ b/tools/gn_helpers.py
@@ -0,0 +1,39 @@
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""Helper functions useful when writing scripts that are run from GN's
+exec_script function."""
+
+class GNException(Exception):
+  pass
+
+
+def ToGNString(value, allow_dicts = True):
+  """Prints the given value to stdout.
+
+  allow_dicts indicates if this function will allow converting dictionaries
+  to GN scopes. This is only possible at the top level, you can't nest a
+  GN scope in a list, so this should be set to False for recursive calls."""
+  if isinstance(value, str):
+    if value.find('\n') >= 0:
+      raise GNException("Trying to print a string with a newline in it.")
+    return '"' + value.replace('"', '\\"') + '"'
+
+  if isinstance(value, list):
+    return '[ %s ]' % ', '.join(ToGNString(v) for v in value)
+
+  if isinstance(value, dict):
+    if not allow_dicts:
+      raise GNException("Attempting to recursively print a dictionary.")
+    result = ""
+    for key in value:
+      if not isinstance(key, str):
+        raise GNException("Dictionary key is not a string.")
+      result += "%s = %s\n" % (key, ToGNString(value[key], False))
+    return result
+
+  if isinstance(value, int):
+    return str(value)
+
+  raise GNException("Unsupported type when printing to GN.")
diff --git a/tools/gypi_to_gn.py b/tools/gypi_to_gn.py
new file mode 100644
index 0000000..a107f94
--- /dev/null
+++ b/tools/gypi_to_gn.py
@@ -0,0 +1,167 @@
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""Converts a given gypi file to a python scope and writes the result to stdout.
+
+It is assumed that the file contains a toplevel dictionary, and this script
+will return that dictionary as a GN "scope" (see example below). This script
+does not know anything about GYP and it will not expand variables or execute
+conditions.
+
+It will strip conditions blocks.
+
+A variables block at the top level will be flattened so that the variables
+appear in the root dictionary. This way they can be returned to the GN code.
+
+Say your_file.gypi looked like this:
+  {
+     'sources': [ 'a.cc', 'b.cc' ],
+     'defines': [ 'ENABLE_DOOM_MELON' ],
+  }
+
+You would call it like this:
+  gypi_values = exec_script("//build/gypi_to_gn.py",
+                            [ rebase_path("your_file.gypi") ],
+                            "scope",
+                            [ "your_file.gypi" ])
+
+Notes:
+ - The rebase_path call converts the gypi file from being relative to the
+   current build file to being system absolute for calling the script, which
+   will have a different current directory than this file.
+
+ - The "scope" parameter tells GN to interpret the result as a series of GN
+   variable assignments.
+
+ - The last file argument to exec_script tells GN that the given file is a
+   dependency of the build so Ninja can automatically re-run GN if the file
+   changes.
+
+Read the values into a target like this:
+  component("mycomponent") {
+    sources = gypi_values.sources
+    defines = gypi_values.defines
+  }
+
+Sometimes your .gypi file will include paths relative to a different
+directory than the current .gn file. In this case, you can rebase them to
+be relative to the current directory.
+  sources = rebase_path(gypi_values.sources, ".",
+                        "//path/gypi/input/values/are/relative/to")
+
+This script will tolerate a 'variables' in the toplevel dictionary or not. If
+the toplevel dictionary just contains one item called 'variables', it will be
+collapsed away and the result will be the contents of that dictinoary. Some
+.gypi files are written with or without this, depending on how they expect to
+be embedded into a .gyp file.
+
+This script also has the ability to replace certain substrings in the input.
+Generally this is used to emulate GYP variable expansion. If you passed the
+argument "--replace=<(foo)=bar" then all instances of "<(foo)" in strings in
+the input will be replaced with "bar":
+
+  gypi_values = exec_script("//build/gypi_to_gn.py",
+                            [ rebase_path("your_file.gypi"),
+                              "--replace=<(foo)=bar"],
+                            "scope",
+                            [ "your_file.gypi" ])
+
+"""
+
+import gn_helpers
+from optparse import OptionParser
+import sys
+
+def LoadPythonDictionary(path):
+  file_string = open(path).read()
+  try:
+    file_data = eval(file_string, {'__builtins__': None}, None)
+  except SyntaxError, e:
+    e.filename = path
+    raise
+  except Exception, e:
+    raise Exception("Unexpected error while reading %s: %s" % (path, str(e)))
+
+  assert isinstance(file_data, dict), "%s does not eval to a dictionary" % path
+
+  # Flatten any variables to the top level.
+  if 'variables' in file_data:
+    file_data.update(file_data['variables'])
+    del file_data['variables']
+
+  # Strip any conditions.
+  if 'conditions' in file_data:
+    del file_data['conditions']
+  if 'target_conditions' in file_data:
+    del file_data['target_conditions']
+
+  # Strip targets in the toplevel, since some files define these and we can't
+  # slurp them in.
+  if 'targets' in file_data:
+    del file_data['targets']
+
+  return file_data
+
+
+def ReplaceSubstrings(values, search_for, replace_with):
+  """Recursively replaces substrings in a value.
+
+  Replaces all substrings of the "search_for" with "repace_with" for all
+  strings occurring in "values". This is done by recursively iterating into
+  lists as well as the keys and values of dictionaries."""
+  if isinstance(values, str):
+    return values.replace(search_for, replace_with)
+
+  if isinstance(values, list):
+    return [ReplaceSubstrings(v, search_for, replace_with) for v in values]
+
+  if isinstance(values, dict):
+    # For dictionaries, do the search for both the key and values.
+    result = {}
+    for key, value in values.items():
+      new_key = ReplaceSubstrings(key, search_for, replace_with)
+      new_value = ReplaceSubstrings(value, search_for, replace_with)
+      result[new_key] = new_value
+    return result
+
+  # Assume everything else is unchanged.
+  return values
+
+def main():
+  parser = OptionParser()
+  parser.add_option("-r", "--replace", action="append",
+    help="Replaces substrings. If passed a=b, replaces all substrs a with b.")
+  (options, args) = parser.parse_args()
+
+  if len(args) != 1:
+    raise Exception("Need one argument which is the .gypi file to read.")
+
+  data = LoadPythonDictionary(args[0])
+  if options.replace:
+    # Do replacements for all specified patterns.
+    for replace in options.replace:
+      split = replace.split('=')
+      # Allow "foo=" to replace with nothing.
+      if len(split) == 1:
+        split.append('')
+      assert len(split) == 2, "Replacement must be of the form 'key=value'."
+      data = ReplaceSubstrings(data, split[0], split[1])
+
+  # Sometimes .gypi files use the GYP syntax with percents at the end of the
+  # variable name (to indicate not to overwrite a previously-defined value):
+  #   'foo%': 'bar',
+  # Convert these to regular variables.
+  for key in data:
+    if len(key) > 1 and key[len(key) - 1] == '%':
+      data[key[:-1]] = data[key]
+      del data[key]
+
+  print gn_helpers.ToGNString(data)
+
+if __name__ == '__main__':
+  try:
+    main()
+  except Exception, e:
+    print str(e)
+    sys.exit(1)
diff --git a/tools/test.dart b/tools/test.dart
index 777f701..f8cec4c 100755
--- a/tools/test.dart
+++ b/tools/test.dart
@@ -39,8 +39,8 @@
 import "testing/dart/test_suite.dart";
 import "testing/dart/utils.dart";
 
-import "../runtime/tests/vm/test_config.dart";
-import "../tests/co19/test_config.dart";
+import "testing/dart/vm_test_config.dart";
+import "testing/dart/co19_test_config.dart";
 
 /**
  * The directories that contain test suites which follow the conventions
diff --git a/tools/testing/dart/browser_controller.dart b/tools/testing/dart/browser_controller.dart
index 8a57d69..e7012d0 100644
--- a/tools/testing/dart/browser_controller.dart
+++ b/tools/testing/dart/browser_controller.dart
@@ -786,7 +786,7 @@
 
   String toJSON() => JSON.encode({'url': url,
                                   'id': id,
-                                  'isSimpleHtmlTest': false});
+                                  'isHtmlTest': false});
 }
 
 
@@ -801,7 +801,7 @@
 
   String toJSON() => JSON.encode({'url': url,
                                   'id': id,
-                                  'isSimpleHtmlTest': true,
+                                  'isHtmlTest': true,
                                   'expectedMessages': expectedMessages});
 }
 
@@ -1415,9 +1415,8 @@
       // Browsers will be killed shortly, send them a terminate signal so
       // that they stop pulling.
       return terminateSignal;
-    } else {
-      return nextTest == null ? waitSignal : nextTest.toJSON();
     }
+    return nextTest == null ? waitSignal : nextTest.toJSON();
   }
 
   String getDriverUrl(String browserId) {
diff --git a/tests/co19/test_config.dart b/tools/testing/dart/co19_test_config.dart
similarity index 89%
rename from tests/co19/test_config.dart
rename to tools/testing/dart/co19_test_config.dart
index b21a49c..57214eb 100644
--- a/tests/co19/test_config.dart
+++ b/tools/testing/dart/co19_test_config.dart
@@ -4,8 +4,8 @@
 
 library co19_test_config;
 
-import '../../tools/testing/dart/test_suite.dart';
-import '../../tools/testing/dart/utils.dart' show Path;
+import 'test_suite.dart';
+import 'utils.dart' show Path;
 
 class Co19TestSuite extends StandardTestSuite {
   RegExp _testRegExp = new RegExp(r"t[0-9]{2}.dart$");
diff --git a/tools/testing/dart/html_test.dart b/tools/testing/dart/html_test.dart
new file mode 100644
index 0000000..9808cfb
--- /dev/null
+++ b/tools/testing/dart/html_test.dart
@@ -0,0 +1,76 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/**
+ * Classes and methods for running HTML tests.
+ *
+ * HTML tests are valid HTML files whose names end in _htmltest.html, and that
+ * contain annotations specifying the scripts in the test and the
+ * messages the test should post to its window, in order to pass.
+ */
+library html_test;
+
+import "dart:convert";
+import "dart:io";
+
+import "test_suite.dart";
+import "utils.dart";
+
+RegExp htmlAnnotation =
+    new RegExp("START_HTML_DART_TEST([\\s\\S]*?)END_HTML_DART_TEST");
+
+HtmlTestInformation getInformation(String filename) {
+  if (!filename.endsWith("_htmltest.html")) {
+    DebugLogger.warning("File $filename is not an HTML test."
+        " Should end in _htmltest.html.");
+    return null;
+  }
+  String contents = new File(filename).readAsStringSync();
+  var match = htmlAnnotation.firstMatch(contents);
+  if (match == null) return null;
+  var annotation = JSON.decode(match[1]);
+  if (annotation is! Map || annotation['expectedMessages'] is! List ||
+      annotation['scripts'] is! List) {
+    DebugLogger.warning("File $filename does not have expected annotation."
+        " Should have {'scripts':[...], 'expectedMessages':[...]}");
+    return null;
+  }
+  return new HtmlTestInformation(new Path(filename),
+                                 annotation['expectedMessages'],
+                                 annotation['scripts']);
+}
+
+String getContents(HtmlTestInformation info, bool compileToJS) {
+  String contents = new File(info.filePath.toNativePath()).readAsStringSync();
+  contents = contents.replaceFirst(htmlAnnotation, '');
+  if (compileToJS) {
+    for (String script in info.scripts) {
+      if (dartExtension.hasMatch(script)) {
+        String jsScript = script.replaceFirst(dartExtension, '.js');
+        String tag = '<script src="$script" type="application/dart">';
+        String jsTag = '<script src="$jsScript">';
+        contents = contents.replaceAll(tag, jsTag);
+      }
+    }
+  }
+  return contents;
+}
+
+String makeFailingHtmlFile(String message) {
+  return '''
+<!DOCTYPE html>
+<html>
+<head>
+  <script>window.parent.dispatchEvent(new Event('detect_errors'));</script>
+  <title>Failing HTML test</title>
+</head><body>
+  <h1>Failing HTML test</h1>
+  $message
+  <script>
+    throw "HTML test failed: $message";
+  </script>
+</body>
+</html>
+''';
+}
diff --git a/tools/testing/dart/http_server.dart b/tools/testing/dart/http_server.dart
index a5e7b8e..4e04773 100644
--- a/tools/testing/dart/http_server.dart
+++ b/tools/testing/dart/http_server.dart
@@ -56,7 +56,7 @@
 /// /root_build/X: This will serve the corresponding file from the build
 ///                directory (i.e. '$BuildDirectory/X').
 /// /FOO/packages/BAR: This will serve the corresponding file from the packages
-///                    directory (i.e. '$BuildDirectory/packages/BAR') or the 
+///                    directory (i.e. '$BuildDirectory/packages/BAR') or the
 ///                    passed-in package root
 /// /ws: This will upgrade the connection to a WebSocket connection and echo
 ///      all data back to the client.
@@ -144,7 +144,7 @@
     _buildDirectory = TestUtils.absolutePath(buildDirectory);
     _dartDirectory = dartDirectory == null ? TestUtils.dartDir
         : new Path(dartDirectory);
-    _packageRoot = packageRoot == null ? 
+    _packageRoot = packageRoot == null ?
       _buildDirectory.append('packages') :
       new Path(packageRoot);
   }
@@ -399,6 +399,10 @@
       response.headers.set('Content-Type', 'application/javascript');
     } else if (path.filename.endsWith('.dart')) {
       response.headers.set('Content-Type', 'application/dart');
+    } else if (path.filename.endsWith('.css')) {
+      response.headers.set('Content-Type', 'text/css');
+    } else if (path.filename.endsWith('.xml')) {
+      response.headers.set('Content-Type', 'text/xml');
     }
     response.headers.removeAll("X-Frame-Options");
     file.openRead().pipe(response).catchError((e) {
diff --git a/tools/testing/dart/multitest.dart b/tools/testing/dart/multitest.dart
index 51468b2..2670155 100644
--- a/tools/testing/dart/multitest.dart
+++ b/tools/testing/dart/multitest.dart
@@ -265,15 +265,16 @@
       bool hasRuntimeErrors = outcome.contains('runtime error');
       bool hasCompileError = outcome.contains('compile-time error');
       bool isNegativeIfChecked = outcome.contains('dynamic type error');
-      bool hasCompileErrorIfChecked = outcome.contains('checked mode compile-time error');
+      bool hasCompileErrorIfChecked =
+          outcome.contains('checked mode compile-time error');
       doTest(multitestFilename,
+             filePath,
              hasCompileError,
              hasRuntimeErrors,
              isNegativeIfChecked: isNegativeIfChecked,
              hasCompileErrorIfChecked: hasCompileErrorIfChecked,
              hasStaticWarning: hasStaticWarning,
-             multitestKey: key,
-             originTestPath: filePath);
+             multitestKey: key);
     }
 
     return null;
diff --git a/tools/testing/dart/test_runner.dart b/tools/testing/dart/test_runner.dart
index befa478..8b1cc55 100644
--- a/tools/testing/dart/test_runner.dart
+++ b/tools/testing/dart/test_runner.dart
@@ -290,6 +290,24 @@
   }
 }
 
+class BrowserHtmlTestCommand extends BrowserTestCommand {
+  List<String> expectedMessages;
+  BrowserHtmlTestCommand._(String browser,
+                           String url,
+                           Map configuration,
+                           this.expectedMessages)
+      : super._(browser, url, configuration);
+
+  void _buildHashCode(HashCodeBuilder builder) {
+    super._buildHashCode(builder);
+    builder.addJson(expectedMessages);
+  }
+
+  bool _equal(BrowserHtmlTestCommand other) =>
+      super._equal(other) &&
+      identical(expectedMessages, other.expectedMessages);
+}
+
 class AnalysisCommand extends ProcessCommand {
   final String flavor;
 
@@ -553,6 +571,15 @@
     return _getUniqueCommand(command);
   }
 
+  BrowserHtmlTestCommand getBrowserHtmlTestCommand(String browser,
+                                               String url,
+                                               Map configuration,
+                                               List<String> expectedMessages) {
+    var command = new BrowserHtmlTestCommand._(
+        browser, url, configuration, expectedMessages);
+    return _getUniqueCommand(command);
+  }
+
   CompilationCommand getCompilationCommand(String displayName,
                                            outputFile,
                                            neverSkipCompilation,
@@ -1937,6 +1964,8 @@
         });
       };
       _process.kill();
+      _stdoutSubscription.cancel();
+      _stderrSubscription.cancel();
     } else {
       doStartTest(command, timeout);
     }
@@ -1946,12 +1975,12 @@
   Future terminate() {
     if (_process == null) return new Future.value(true);
     Completer terminateCompleter = new Completer();
-    Timer killTimer;
     _processExitHandler = (_) {
-      if (killTimer != null) killTimer.cancel();
       terminateCompleter.complete(true);
     };
     _process.kill();
+    _stdoutSubscription.cancel();
+    _stderrSubscription.cancel();
 
     return terminateCompleter.future;
   }
@@ -2346,7 +2375,7 @@
         _numProcesses--;
         if (isBrowserCommand) _numBrowserProcesses--;
 
-        // Don't loose a process
+        // Don't lose a process
         Timer.run(() => _tryRunNextCommand());
       });
     }
@@ -2499,9 +2528,14 @@
       completer.complete(
           new BrowserControllerTestOutcome(browserCommand, output));
     };
-    BrowserTest browserTest = new BrowserTest(browserCommand.url,
-                                              callback,
-                                              timeout);
+
+    BrowserTest browserTest;
+    if (browserCommand is BrowserHtmlTestCommand) {
+      browserTest = new HtmlTest(browserCommand.url, callback, timeout,
+          browserCommand.expectedMessages);
+    } else {
+      browserTest = new BrowserTest(browserCommand.url, callback, timeout);
+    }
     _getBrowserTestRunner(browserCommand.browser, browserCommand.configuration)
         .then((testRunner) {
       testRunner.queueTest(browserTest);
diff --git a/tools/testing/dart/test_suite.dart b/tools/testing/dart/test_suite.dart
index 1a55c6c..0d0b6bf 100644
--- a/tools/testing/dart/test_suite.dart
+++ b/tools/testing/dart/test_suite.dart
@@ -17,6 +17,7 @@
 import "dart:async";
 import "dart:io";
 import "drt_updater.dart";
+import "html_test.dart" as htmlTest;
 import "multitest.dart";
 import "status_file_parser.dart";
 import "test_runner.dart";
@@ -38,6 +39,7 @@
 // Require at least one non-space character before '///'
 RegExp multiTestRegExp = new RegExp(r"\S *"
                                     r"/// \w+:(.*)");
+RegExp dartExtension = new RegExp(r'\.dart$');
 
 /**
  * A simple function that tests [arg] and returns `true` or `false`.
@@ -45,13 +47,13 @@
 typedef bool Predicate<T>(T arg);
 
 typedef void CreateTest(Path filePath,
+                        Path originTestPath,
                         bool hasCompileError,
                         bool hasRuntimeError,
                         {bool isNegativeIfChecked,
                          bool hasCompileErrorIfChecked,
                          bool hasStaticWarning,
-                         String multitestKey,
-                         Path originTestPath});
+                         String multitestKey});
 
 typedef void VoidFunction();
 
@@ -69,6 +71,7 @@
   return completer.future;
 }
 
+
 /** A completer that waits until all added [Future]s complete. */
 // TODO(rnystrom): Copied from web_components. Remove from here when it gets
 // added to dart:core. (See #6626.)
@@ -110,6 +113,7 @@
   Future<List> get future => _completer.future;
 }
 
+
 /**
  * A TestSuite represents a collection of tests.  It creates a [TestCase]
  * object for each test to be run, and passes the test cases to a callback.
@@ -378,19 +382,22 @@
    * Helper function for discovering the packages in the dart repository.
    */
   Future<List> listDir(Path path, Function isValid) {
-    return new Directory(path.toNativePath())
-    .list(recursive: false)
-    .where((fse) => fse is Directory)
-    .map((Directory directory) {
-      var fullPath = directory.absolute.path;
-      var packageName = new Path(fullPath).filename;
-      if (isValid(packageName)) {
-        return [packageName, path.append(packageName).toNativePath()];
-      }
-      return null;
-    })
-    .where((name) => name != null)
-    .toList();
+    var dir = new Directory(path.toNativePath());
+    return dir.exists().then((var exist) {
+      if (!exist) return [];
+      return dir.list(recursive: false)
+      .where((fse) => fse is Directory)
+      .map((Directory directory) {
+        var fullPath = directory.absolute.path;
+        var packageName = new Path(fullPath).filename;
+        if (isValid(packageName)) {
+          return [packageName, path.append(packageName).toNativePath()];
+        }
+        return null;
+      })
+      .where((name) => name != null)
+      .toList();
+      });
   }
 
   Future<Map> discoverPackagesInRepository() {
@@ -563,8 +570,8 @@
 
 
 class TestInformation {
-  Path originTestPath;
   Path filePath;
+  Path originTestPath;
   Map optionsFromFile;
   bool hasCompileError;
   bool hasRuntimeError;
@@ -573,16 +580,27 @@
   bool hasStaticWarning;
   String multitestKey;
 
-  TestInformation(this.filePath, this.optionsFromFile,
+  TestInformation(this.filePath, this.originTestPath, this.optionsFromFile,
                   this.hasCompileError, this.hasRuntimeError,
                   this.isNegativeIfChecked, this.hasCompileErrorIfChecked,
                   this.hasStaticWarning,
-                  {this.multitestKey, this.originTestPath}) {
+                  {this.multitestKey: ''}) {
     assert(filePath.isAbsolute);
-    if (originTestPath == null) originTestPath = filePath;
   }
 }
 
+
+class HtmlTestInformation extends TestInformation {
+  List<String> expectedMessages;
+  List<String> scripts;
+
+  HtmlTestInformation(Path filePath, this.expectedMessages, this.scripts)
+      : super(filePath, filePath,
+              {'isMultitest': false, 'isMultiHtmlTest': false},
+              false, false, false, false, false) {}
+}
+
+
 /**
  * A standard [TestSuite] implementation that searches for tests in a
  * directory, and creates [TestCase]s that compile and/or run them.
@@ -671,10 +689,11 @@
   bool isTestFile(String filename) {
     // Use the specified predicate, if provided.
     if (isTestFilePredicate != null) return isTestFilePredicate(filename);
-
     return filename.endsWith("Test.dart");
   }
 
+  bool isHtmlTestFile(String filename) => filename.endsWith('_htmltest.html');
+
   List<String> additionalOptions(Path filePath) => [];
 
   Map<String, String> localPackageDirectories;
@@ -768,12 +787,20 @@
   }
 
   void enqueueFile(String filename, FutureGroup group) {
+    if (isHtmlTestFile(filename)) {
+      var info = htmlTest.getInformation(filename);
+      if (info == null) {
+        DebugLogger.error(
+            "HtmlTest $filename does not contain required annotations");
+        return;
+      }
+      cachedTests.add(info);
+      enqueueTestCaseFromTestInformation(info);
+      return;
+    }
     if (!isTestFile(filename)) return;
     Path filePath = new Path(filename);
 
-    // Only run the tests that match the pattern.
-    if (filePath.filename.endsWith('test_config.dart')) return;
-
     var optionsFromFile = readOptionsFromFile(filePath);
     CreateTest createTestCase = makeTestCaseCreator(optionsFromFile);
 
@@ -781,6 +808,7 @@
       group.add(doMultitest(filePath, buildDir, suiteDir, createTestCase));
     } else {
       createTestCase(filePath,
+                     filePath,
                      optionsFromFile['hasCompileError'],
                      optionsFromFile['hasRuntimeError'],
                      hasStaticWarning: optionsFromFile['hasStaticWarning']);
@@ -809,6 +837,14 @@
   }
 
   void enqueueTestCaseFromTestInformation(TestInformation info) {
+    String testName = buildTestCaseDisplayName(suiteDir, info.originTestPath,
+        multitestName:
+          info.optionsFromFile['isMultitest'] ? info.multitestKey : "");
+    Set<Expectation> expectations = testExpectations.expectations(testName);
+    if (info is HtmlTestInformation) {
+      enqueueHtmlTest(info, testName, expectations);
+      return;
+    }
     var filePath = info.filePath;
     var optionsFromFile = info.optionsFromFile;
 
@@ -876,15 +912,15 @@
     Path packageRoot;
     if (configuration['use_repository_packages'] ||
         configuration['use_public_packages']) {
-        Path pubspecYamlFile = _findPubspecYamlFile(filePath);
-        if (pubspecYamlFile != null) {
-          var result = buildSpecialPackageRoot(pubspecYamlFile);
-          baseCommands.addAll(result['commands']);
-          packageRoot = result['package-root'];
-          if (optionsFromFile['packageRoot'] == null ||
-              optionsFromFile['packageRoot'] == "") {
-            optionsFromFile['packageRoot'] = packageRoot.toNativePath();
-          }
+      Path pubspecYamlFile = _findPubspecYamlFile(filePath);
+      if (pubspecYamlFile != null) {
+        var result = buildSpecialPackageRoot(pubspecYamlFile);
+        baseCommands.addAll(result['commands']);
+        packageRoot = result['package-root'];
+        if (optionsFromFile['packageRoot'] == null ||
+            optionsFromFile['packageRoot'] == "") {
+          optionsFromFile['packageRoot'] = packageRoot.toNativePath();
+        }
       }
     }
     if (configuration['package_root'] != null) {
@@ -892,10 +928,6 @@
       optionsFromFile['packageRoot'] = packageRoot.toNativePath();
     }
 
-    String testName = buildTestCaseDisplayName(suiteDir, info.originTestPath,
-        multitestName: optionsFromFile['isMultitest'] ? info.multitestKey : "");
-
-    Set<Expectation> expectations = testExpectations.expectations(testName);
     if (new CompilerConfiguration(configuration).hasCompiler &&
         expectCompileError(info)) {
       // If a compile-time error is expected, and we're testing a
@@ -1020,23 +1052,23 @@
 
   CreateTest makeTestCaseCreator(Map optionsFromFile) {
     return (Path filePath,
+            Path originTestPath,
             bool hasCompileError,
             bool hasRuntimeError,
             {bool isNegativeIfChecked: false,
              bool hasCompileErrorIfChecked: false,
              bool hasStaticWarning: false,
-             String multitestKey,
-             Path originTestPath}) {
+             String multitestKey}) {
       // Cache the test information for each test case.
       var info = new TestInformation(filePath,
+                                     originTestPath,
                                      optionsFromFile,
                                      hasCompileError,
                                      hasRuntimeError,
                                      isNegativeIfChecked,
                                      hasCompileErrorIfChecked,
                                      hasStaticWarning,
-                                     multitestKey: multitestKey,
-                                     originTestPath: originTestPath);
+                                     multitestKey: multitestKey);
       cachedTests.add(info);
       enqueueTestCaseFromTestInformation(info);
     };
@@ -1070,27 +1102,24 @@
     exit(1);
   }
 
-  String _getUriForBrowserTest(TestInformation info,
-                            String pathComponent,
-                            subtestNames,
-                            subtestIndex) {
+  Uri _getUriForBrowserTest(String pathComponent, String subtestName) {
     // Note: If we run test.py with the "--list" option, no http servers
-    // will be started. So we use PORT/CROSS_ORIGIN_PORT instead of real ports.
-    var serverPort = "PORT";
-    var crossOriginPort = "CROSS_ORIGIN_PORT";
-    if (!configuration['list']) {
-      assert(configuration.containsKey('_servers_'));
-      serverPort = configuration['_servers_'].port;
-      crossOriginPort = configuration['_servers_'].crossOriginPort;
+    // will be started. So we return a dummy url instead.
+    if (configuration['list']) {
+      return Uri.parse('http://listing_the_tests_only');
     }
-
-    var localIp = configuration['local_ip'];
-    var url= 'http://$localIp:$serverPort$pathComponent'
-        '?crossOriginPort=$crossOriginPort';
-    if (info.optionsFromFile['isMultiHtmlTest'] && subtestNames.length > 0) {
-      url= '${url}&group=${subtestNames[subtestIndex]}';
+    assert(configuration.containsKey('_servers_'));
+    int serverPort = configuration['_servers_'].port;
+    int crossOriginPort = configuration['_servers_'].crossOriginPort;
+    Map parameters = {'crossOriginPort': crossOriginPort.toString()};
+    if (subtestName != null) {
+      parameters['group'] = subtestName;
     }
-    return url;
+    return new Uri(scheme: 'http',
+                   host: configuration['local_ip'],
+                   port: serverPort,
+                   path: pathComponent,
+                   queryParameters: parameters);
   }
 
   void _createWrapperFile(String dartWrapperFilename,
@@ -1118,222 +1147,332 @@
    * subTestName, Set<String>> if we are running a browser multi-test (one
    * compilation and many browser runs).
    */
-  void enqueueBrowserTest(List<Command> baseCommands,
-                          Path packageRoot,
-                          TestInformation info,
-                          String testName,
-                          expectations) {
+  void enqueueBrowserTest(
+      List<Command> baseCommands,
+      Path packageRoot,
+      TestInformation info,
+      String testName,
+      expectations) {
+    RegExp badChars = new RegExp('[-=/]');
+    List VmOptionsList = getVmOptions(info.optionsFromFile);
+    bool multipleOptions = VmOptionsList.length > 1;
+    for (var vmOptions in VmOptionsList) {
+      String optionsName =
+          multipleOptions ? vmOptions.join('-').replaceAll(badChars, '') : '';
+      String tempDir = createOutputDirectory(info.filePath, optionsName);
+      enqueueBrowserTestWithOptions(
+          baseCommands,
+          packageRoot,
+          info,
+          testName,
+          expectations,
+          vmOptions,
+          tempDir);
+    }
+  }
+
+
+  void enqueueBrowserTestWithOptions(
+      List<Command> baseCommands,
+      Path packageRoot,
+      TestInformation info,
+      String testName,
+      expectations,
+      List<String> vmOptions,
+      String tempDir) {
     // TODO(Issue 14651): If we're on dartium, we need to pass [packageRoot]
     // on to the browser (it may be test specific).
 
-    // TODO(kustermann/ricow): This method should be refactored.
-    Map optionsFromFile = info.optionsFromFile;
     Path filePath = info.filePath;
     String filename = filePath.toString();
 
     final String compiler = configuration['compiler'];
     final String runtime = configuration['runtime'];
+    final Map optionsFromFile = info.optionsFromFile;
 
-    for (var vmOptions in getVmOptions(optionsFromFile)) {
-      // Create a unique temporary directory for each set of vmOptions.
-      // TODO(dart:429): Replace separate replaceAlls with a RegExp when
-      // replaceAll(RegExp, String) is implemented.
-      String optionsName = '';
-      if (getVmOptions(optionsFromFile).length > 1) {
-          optionsName = vmOptions.join('-').replaceAll('-','')
-                                           .replaceAll('=','')
-                                           .replaceAll('/','');
-      }
-      final String compilationTempDir =
-          createCompilationOutputDirectory(info.filePath);
-      final String tempDir = createOutputDirectory(info.filePath, optionsName);
+    final String compilationTempDir =
+        createCompilationOutputDirectory(info.filePath);
 
-      String dartWrapperFilename = '$tempDir/test.dart';
-      String compiledDartWrapperFilename = '$compilationTempDir/test.js';
+    String dartWrapperFilename = '$tempDir/test.dart';
+    String compiledDartWrapperFilename = '$compilationTempDir/test.js';
 
-      String content = null;
-      Path dir = filePath.directoryPath;
-      String nameNoExt = filePath.filenameWithoutExtension;
+    String content = null;
+    Path dir = filePath.directoryPath;
+    String nameNoExt = filePath.filenameWithoutExtension;
 
-      Path pngPath = dir.append('$nameNoExt.png');
-      Path txtPath = dir.append('$nameNoExt.txt');
-      String customHtmlPath = dir.append('$nameNoExt.html').toNativePath();
-      File customHtml = new File(customHtmlPath);
+    Path pngPath = dir.append('$nameNoExt.png');
+    Path txtPath = dir.append('$nameNoExt.txt');
+    String customHtmlPath = dir.append('$nameNoExt.html').toNativePath();
+    File customHtml = new File(customHtmlPath);
 
-      // Construct the command(s) that compile all the inputs needed by the
-      // browser test. For running Dart in DRT, this will be noop commands.
-      List<Command> commands = []..addAll(baseCommands);
+    // Construct the command(s) that compile all the inputs needed by the
+    // browser test. For running Dart in DRT, this will be noop commands.
+    List<Command> commands = []..addAll(baseCommands);
 
-      // Use existing HTML document if available.
-      String htmlPath;
-      if (customHtml.existsSync()) {
-        // If necessary, run the Polymer deploy steps.
-        // TODO(jmesserly): this should be generalized for any tests that
-        // require Pub deploy, not just polymer.
-        if (customHtml.readAsStringSync().contains('<!--polymer-test')) {
-          if (compiler != 'none') {
-            commands.add(_polymerDeployCommand(
-                customHtmlPath, tempDir, optionsFromFile));
+    // Use existing HTML document if available.
+    String htmlPath;
+    if (customHtml.existsSync()) {
+      // If necessary, run the Polymer deploy steps.
+      // TODO(jmesserly): this should be generalized for any tests that
+      // require Pub deploy, not just polymer.
+      if (customHtml.readAsStringSync().contains('<!--polymer-test')) {
+        if (compiler != 'none') {
+          commands.add(
+              _polymerDeployCommand(customHtmlPath, tempDir, optionsFromFile));
 
-            Path pubspecYamlFile = _findPubspecYamlFile(filePath);
-            Path homeDir = pubspecYamlFile == null ? dir :
-                pubspecYamlFile.directoryPath;
-            htmlPath = '$tempDir/${dir.relativeTo(homeDir)}/$nameNoExt.html';
-            dartWrapperFilename = '${htmlPath}_bootstrap.dart';
-            compiledDartWrapperFilename = '$dartWrapperFilename.js';
-          } else {
-            htmlPath = customHtmlPath;
-          }
+          Path pubspecYamlFile = _findPubspecYamlFile(filePath);
+          Path homeDir =
+              (pubspecYamlFile == null) ? dir : pubspecYamlFile.directoryPath;
+          htmlPath = '$tempDir/${dir.relativeTo(homeDir)}/$nameNoExt.html';
+          dartWrapperFilename = '${htmlPath}_bootstrap.dart';
+          compiledDartWrapperFilename = '$dartWrapperFilename.js';
         } else {
-          htmlPath = '$tempDir/test.html';
-          dartWrapperFilename = filePath.toNativePath();
-
-          var htmlContents = customHtml.readAsStringSync();
-          if (compiler == 'none') {
-            htmlContents = htmlContents.replaceAll('%TEST_SCRIPTS%',
-              '<script type="application/dart" '
-              'src="${_createUrlPathFromFile(filePath)}"></script>\n'
-              '<script type="text/javascript" '
-                  'src="/packages/browser/dart.js"></script>');
-          } else {
-            compiledDartWrapperFilename = '$tempDir/$nameNoExt.js';
-            var jsFile = '$nameNoExt.js';
-            htmlContents = htmlContents.replaceAll('%TEST_SCRIPTS%',
-              '<script src="$jsFile"></script>');
-          }
-          new File(htmlPath).writeAsStringSync(htmlContents);
+          htmlPath = customHtmlPath;
         }
       } else {
         htmlPath = '$tempDir/test.html';
-        if (configuration['compiler'] != 'dart2js') {
-          // test.dart will import the dart test.
-          _createWrapperFile(dartWrapperFilename, filePath);
-        } else {
-          dartWrapperFilename = filename;
-        }
+        dartWrapperFilename = filePath.toNativePath();
 
-        // Create the HTML file for the test.
-        RandomAccessFile htmlTest =
-            new File(htmlPath).openSync(mode: FileMode.WRITE);
-
-        String scriptPath = dartWrapperFilename;
-        if (compiler != 'none') {
-          scriptPath = compiledDartWrapperFilename;
-        }
-        scriptPath = _createUrlPathFromFile(new Path(scriptPath));
-
-        content =
-            getHtmlContents(filename, scriptType, new Path("$scriptPath"));
-        htmlTest.writeStringSync(content);
-        htmlTest.closeSync();
-      }
-
-      if (compiler != 'none') {
-        commands.add(_compileCommand(
-            dartWrapperFilename, compiledDartWrapperFilename,
-            compiler, tempDir, vmOptions, optionsFromFile));
-      }
-
-      // some tests require compiling multiple input scripts.
-      List<String> otherScripts = optionsFromFile['otherScripts'];
-      for (String name in otherScripts) {
-        Path namePath = new Path(name);
-        String fileName = namePath.filename;
-        Path fromPath = filePath.directoryPath.join(namePath);
-        if (compiler != 'none') {
-          assert(namePath.extension == 'dart');
-          commands.add(_compileCommand(
-              fromPath.toNativePath(), '$tempDir/$fileName.js',
-              compiler, tempDir, vmOptions, optionsFromFile));
-        }
+        var htmlContents = customHtml.readAsStringSync();
         if (compiler == 'none') {
-          // For the tests that require multiple input scripts but are not
-          // compiled, move the input scripts over with the script so they can
-          // be accessed.
-          String result = new File(fromPath.toNativePath()).readAsStringSync();
-          new File('$tempDir/$fileName').writeAsStringSync(result);
+          var dartUrl = _createUrlPathFromFile(filePath);
+          var dartScript =
+              '<script type="application/dart" src="$dartUrl"></script>';
+          var jsUrl = '/packages/browser/dart.js';
+          var jsScript =
+              '<script type="text/javascript" src="$jsUrl"></script>';
+          htmlContents = htmlContents.replaceAll(
+              '%TEST_SCRIPTS%', '$dartScript\n$jsScript');
+        } else {
+          compiledDartWrapperFilename = '$tempDir/$nameNoExt.js';
+          var jsUrl = '$nameNoExt.js';
+          htmlContents = htmlContents.replaceAll(
+              '%TEST_SCRIPTS%', '<script src="$jsUrl"></script>');
         }
+        new File(htmlPath).writeAsStringSync(htmlContents);
+      }
+    } else {
+      htmlPath = '$tempDir/test.html';
+      if (configuration['compiler'] != 'dart2js') {
+        // test.dart will import the dart test.
+        _createWrapperFile(dartWrapperFilename, filePath);
+      } else {
+        dartWrapperFilename = filename;
       }
 
+      // Create the HTML file for the test.
+      RandomAccessFile htmlTest =
+          new File(htmlPath).openSync(mode: FileMode.WRITE);
 
-      // Variables for browser multi-tests.
-      List<String> subtestNames = info.optionsFromFile['subtestNames'];
-      int subtestIndex = 0;
-      // Construct the command that executes the browser test
-      do {
-        List<Command> commandSet = new List<Command>.from(commands);
+      String scriptPath = dartWrapperFilename;
+      if (compiler != 'none') {
+        scriptPath = compiledDartWrapperFilename;
+      }
+      scriptPath = _createUrlPathFromFile(new Path(scriptPath));
 
-        var htmlPath_subtest = _createUrlPathFromFile(new Path(htmlPath));
-        var fullHtmlPath = _getUriForBrowserTest(info, htmlPath_subtest,
-                                                 subtestNames, subtestIndex);
-
-        List<String> args = <String>[];
-
-        if (runtime == "drt") {
-          var dartFlags = [];
-          var contentShellOptions = [];
-
-          contentShellOptions.add('--no-timeout');
-          contentShellOptions.add('--dump-render-tree');
-
-          if (compiler == 'none' || compiler == 'dart2dart') {
-            dartFlags.add('--ignore-unrecognized-flags');
-            if (configuration["checked"]) {
-              dartFlags.add('--enable_asserts');
-              dartFlags.add("--enable_type_checks");
-            }
-            dartFlags.addAll(vmOptions);
-          }
-
-          commandSet.add(CommandBuilder.instance.getContentShellCommand(
-              contentShellFilename, fullHtmlPath, contentShellOptions,
-              dartFlags, environmentOverrides));
-        } else {
-          commandSet.add(CommandBuilder.instance.getBrowserTestCommand(
-              runtime, fullHtmlPath, configuration));
-        }
-
-        // Create BrowserTestCase and queue it.
-        String testDisplayName = '$suiteName/$testName';
-        var testCase;
-        if (info.optionsFromFile['isMultiHtmlTest']) {
-          testDisplayName = '$testDisplayName/${subtestNames[subtestIndex]}';
-          testCase = new BrowserTestCase(testDisplayName,
-              commandSet, configuration,
-              expectations['$testName/${subtestNames[subtestIndex]}'],
-              info, isNegative(info), fullHtmlPath);
-        } else {
-          testCase = new BrowserTestCase(testDisplayName,
-              commandSet, configuration, expectations,
-              info, isNegative(info), fullHtmlPath);
-        }
-
-        enqueueNewTestCase(testCase);
-        subtestIndex++;
-      } while(subtestIndex < subtestNames.length);
+      content = getHtmlContents(filename, scriptType, new Path("$scriptPath"));
+      htmlTest.writeStringSync(content);
+      htmlTest.closeSync();
     }
+
+    if (compiler != 'none') {
+      commands.add(
+          _compileCommand(
+              dartWrapperFilename,
+              compiledDartWrapperFilename,
+              compiler,
+              tempDir,
+              optionsFromFile));
+    }
+
+    // some tests require compiling multiple input scripts.
+    List<String> otherScripts = optionsFromFile['otherScripts'];
+    for (String name in otherScripts) {
+      Path namePath = new Path(name);
+      String fileName = namePath.filename;
+      Path fromPath = filePath.directoryPath.join(namePath);
+      if (compiler != 'none') {
+        assert(namePath.extension == 'dart');
+        commands.add(
+            _compileCommand(
+                fromPath.toNativePath(),
+                '$tempDir/$fileName.js',
+                compiler,
+                tempDir,
+                optionsFromFile));
+      }
+      if (compiler == 'none') {
+        // For the tests that require multiple input scripts but are not
+        // compiled, move the input scripts over with the script so they can
+        // be accessed.
+        String result = new File(fromPath.toNativePath()).readAsStringSync();
+        new File('$tempDir/$fileName').writeAsStringSync(result);
+      }
+    }
+
+
+    // Variables for browser multi-tests.
+    bool multitest = info.optionsFromFile['isMultiHtmlTest'];
+    List<String> subtestNames =
+        multitest ? info.optionsFromFile['subtestNames'] : [null];
+    for (String subtestName in subtestNames) {
+    // Construct the command that executes the browser test
+      List<Command> commandSet = new List<Command>.from(commands);
+
+      var htmlPath_subtest = _createUrlPathFromFile(new Path(htmlPath));
+      var fullHtmlPath =
+          _getUriForBrowserTest(htmlPath_subtest, subtestName).toString();
+
+      List<String> args = <String>[];
+
+      if (runtime == "drt") {
+        var dartFlags = [];
+        var contentShellOptions = [];
+
+        contentShellOptions.add('--no-timeout');
+        contentShellOptions.add('--dump-render-tree');
+
+        if (compiler == 'none' || compiler == 'dart2dart') {
+          dartFlags.add('--ignore-unrecognized-flags');
+          if (configuration["checked"]) {
+            dartFlags.add('--enable_asserts');
+            dartFlags.add("--enable_type_checks");
+          }
+          dartFlags.addAll(vmOptions);
+        }
+
+        commandSet.add(
+            CommandBuilder.instance.getContentShellCommand(
+                contentShellFilename,
+                fullHtmlPath,
+                contentShellOptions,
+                dartFlags,
+                environmentOverrides));
+      } else {
+        commandSet.add(
+            CommandBuilder.instance.getBrowserTestCommand(
+                runtime,
+                fullHtmlPath,
+                configuration));
+      }
+
+      // Create BrowserTestCase and queue it.
+      var fullTestName = multitest ? '$testName/$subtestName' : testName;
+      var expectation = multitest ? expectations[fullTestName] : expectations;
+      var testCase = new BrowserTestCase(
+            '$suiteName/$fullTestName',
+            commandSet,
+            configuration,
+            expectation,
+            info,
+            isNegative(info),
+            fullHtmlPath);
+
+      enqueueNewTestCase(testCase);
+    }
+  }
+
+  void enqueueHtmlTest(
+      HtmlTestInformation info,
+      String testName,
+      expectations) {
+    final String compiler = configuration['compiler'];
+    final String runtime = configuration['runtime'];
+    // Html tests work only with the browser controller.
+    if (!TestUtils.isBrowserRuntime(runtime) || runtime == 'drt') {
+      return;
+    }
+    bool compileToJS = (compiler == 'dart2js');
+
+    final Path filePath = info.filePath;
+    final String tempDir = createOutputDirectory(filePath, '');
+    final Uri tempUri = new Uri.file('$tempDir/');
+    String contents = htmlTest.getContents(info, compileToJS);
+    final commands = [];
+
+    void Fail(String message) {
+      var msg = "$message: ${info.filePath}";
+      DebugLogger.warning(msg);
+      contents = htmlTest.makeFailingHtmlFile(msg);
+    }
+
+    if (info.scripts.length > 0) {
+      Uri testUri = new Uri.file(filePath.toNativePath());
+      for (String scriptPath in info.scripts) {
+        if (!scriptPath.endsWith('.dart') && !scriptPath.endsWith('.js')) {
+          Fail('HTML test scripts must be dart or javascript: $scriptPath');
+          break;
+        }
+        Uri uri = Uri.parse(scriptPath);
+        if (uri.isAbsolute) {
+          Fail('HTML test scripts must have relative paths: $scriptPath');
+          break;
+        }
+        if (uri.pathSegments.length > 1) {
+          Fail('HTML test scripts must be in test directory: $scriptPath');
+          break;
+        }
+        Uri script = testUri.resolveUri(uri);
+        Uri copiedScript = tempUri.resolveUri(uri);
+        if (compiler == 'none' || scriptPath.endsWith('.js')) {
+          new File.fromUri(copiedScript).writeAsStringSync(
+              new File.fromUri(script).readAsStringSync());
+        } else {
+          commands.add(_compileCommand(
+              script.toFilePath(),
+              copiedScript.toFilePath().replaceFirst(dartExtension, '.js'),
+              compiler,
+              tempDir,
+              info.optionsFromFile));
+        }
+      }
+    }
+    final Uri htmlFile = tempUri.resolve(filePath.filename);
+    new File.fromUri(htmlFile).writeAsStringSync(contents);
+
+    var htmlPath = _createUrlPathFromFile(new Path(htmlFile.toFilePath()));
+    var fullHtmlPath = _getUriForBrowserTest(htmlPath, null).toString();
+    commands.add(CommandBuilder.instance.getBrowserHtmlTestCommand(
+        runtime,
+        fullHtmlPath,
+        configuration,
+        info.expectedMessages));
+    String testDisplayName = '$suiteName/$testName';
+    var testCase = new BrowserTestCase(
+        testDisplayName,
+        commands,
+        configuration,
+        expectations,
+        info,
+        isNegative(info),
+        fullHtmlPath);
+    enqueueNewTestCase(testCase);
+    return;
   }
 
   /** Helper to create a compilation command for a single input file. */
   Command _compileCommand(String inputFile, String outputFile,
-      String compiler, String dir, vmOptions, optionsFromFile) {
+      String compiler, String dir, optionsFromFile) {
     assert (['dart2js', 'dart2dart'].contains(compiler));
-    String executable = compilerPath;
-    List<String> args = TestUtils.standardOptions(configuration);
+    String executable;
+    List<String> args;
+    if (compilerPath.endsWith('.dart')) {
+      // Run the compiler script via the Dart VM.
+      executable = dartVmBinaryFileName;
+      args = [compilerPath];
+    } else {
+      executable = compilerPath;
+      args = [];
+    }
+    args.addAll(TestUtils.standardOptions(configuration));
     String packageRoot =
       packageRootArgument(optionsFromFile['packageRoot']);
-    if (packageRoot != null) {
-      args.add(packageRoot);
-    }
+    if (packageRoot != null) args.add(packageRoot);
     args.add('--out=$outputFile');
     if (configuration['csp']) args.add('--csp');
     args.add(inputFile);
-    args.addAll(optionsFromFile['sharedOptions']);
-    if (executable.endsWith('.dart')) {
-      // Run the compiler script via the Dart VM.
-      args.insert(0, executable);
-      executable = dartVmBinaryFileName;
-    }
+    List<String> options = optionsFromFile['sharedOptions'];
+    if (options != null) args.addAll(options);
     return CommandBuilder.instance.getCompilationCommand(
         compiler, outputFile, !useSdk,
         dart2JsBootstrapDependencies, compilerPath, args, environmentOverrides);
@@ -1671,6 +1810,7 @@
   }
 }
 
+
 /// Used for testing packages in on off settings, i.e., we pass in the actual
 /// directory that we want to test.
 class PKGTestSuite extends StandardTestSuite {
@@ -1753,6 +1893,7 @@
   }
 }
 
+
 class AnalyzeLibraryTestSuite extends DartcCompilationTestSuite {
   AnalyzeLibraryTestSuite(Map configuration)
       : super(configuration,
@@ -1779,6 +1920,7 @@
   bool get listRecursively => true;
 }
 
+
 class PkgBuildTestSuite extends TestSuite {
   final String statusFilePath;
 
@@ -1913,6 +2055,7 @@
   }
 }
 
+
 class ExistsCache {
   Map<String, bool> _cache = <String, bool>{};
 
@@ -1929,6 +2072,7 @@
   }
 }
 
+
 class TestUtils {
   /**
    * Any script using TestUtils must set dartDirUri to a file:// URI
@@ -2275,6 +2419,7 @@
   }
 }
 
+
 class SummaryReport {
   static int total = 0;
   static int skipped = 0;
diff --git a/runtime/tests/vm/test_config.dart b/tools/testing/dart/vm_test_config.dart
similarity index 89%
rename from runtime/tests/vm/test_config.dart
rename to tools/testing/dart/vm_test_config.dart
index 394bb76..9fdf36b 100644
--- a/runtime/tests/vm/test_config.dart
+++ b/tools/testing/dart/vm_test_config.dart
@@ -4,7 +4,7 @@
 
 library vm_test_config;
 
-import '../../../tools/testing/dart/test_suite.dart';
+import 'test_suite.dart';
 
 class VMTestSuite extends CCTestSuite {
   VMTestSuite(Map configuration)
diff --git a/utils/apidoc/apidoc.dart b/utils/apidoc/apidoc.dart
index a9604f5..1dcc495 100644
--- a/utils/apidoc/apidoc.dart
+++ b/utils/apidoc/apidoc.dart
@@ -21,9 +21,9 @@
 import 'html_diff.dart';
 
 // TODO(rnystrom): Use "package:" URL (#4968).
-import '../../sdk/lib/_internal/compiler/implementation/mirrors/source_mirrors.dart';
-import '../../sdk/lib/_internal/compiler/implementation/mirrors/mirrors_util.dart';
-import '../../sdk/lib/_internal/compiler/implementation/filenames.dart';
+import '../../pkg/compiler/lib/src/mirrors/source_mirrors.dart';
+import '../../pkg/compiler/lib/src/mirrors/mirrors_util.dart';
+import '../../pkg/compiler/lib/src/filenames.dart';
 import '../../sdk/lib/_internal/dartdoc/lib/dartdoc.dart';
 import '../../sdk/lib/_internal/libraries.dart';
 import 'package:path/path.dart' as path;
diff --git a/utils/apidoc/docgen.gyp b/utils/apidoc/docgen.gyp
index 0cdd4ea..126e549 100644
--- a/utils/apidoc/docgen.gyp
+++ b/utils/apidoc/docgen.gyp
@@ -15,7 +15,7 @@
   ],
   'targets': [
     {
-      'target_name': 'docgen',
+      'target_name': 'dartdocgen',
       'type': 'none',
       'dependencies': [
         '../../create_sdk.gyp:create_sdk_internal',
@@ -23,7 +23,7 @@
         '../../pkg/pkg_files.gyp:pkg_files_stamp',
       ],
       'includes': [
-        '../../sdk/lib/core/corelib_sources.gypi',
+        '../../sdk/lib/core/core_sources.gypi',
       ],
       'actions': [
         {
@@ -63,8 +63,12 @@
             '../../sdk/bin/dart.bat',
             '../../sdk/bin/dart2js',
             '../../sdk/bin/dart2js.bat',
+            # TODO(alanknight): The docgen name is deprecated in favour of
+            # dartdocgen, and should be removed eventually.
             '../../sdk/bin/docgen',
+            '../../sdk/bin/dartdocgen',
             '../../sdk/bin/docgen.bat',
+            '../../sdk/bin/dartdocgen.bat',
             '../../tools/only_in_release_mode.py',
             '<(PRODUCT_DIR)/dart-sdk/README',
             '<(SHARED_INTERMEDIATE_DIR)/pkg_files.stamp',
@@ -77,7 +81,7 @@
             '../../tools/only_in_release_mode.py',
             '<@(_outputs)',
             '--',
-            '<(PRODUCT_DIR)/dart-sdk/bin/docgen<(script_suffix)',
+            '<(PRODUCT_DIR)/dart-sdk/bin/dartdocgen<(script_suffix)',
             '--out=<(PRODUCT_DIR)/api_docs/docgen',
             '--include-sdk',
             '--no-include-dependent-packages',
@@ -90,7 +94,7 @@
             '--exclude-lib=try',
             '../../pkg'
           ],
-          'message': 'Running docgen: <(_action)',
+          'message': 'Running dartdocgen: <(_action)',
         },
       ],
     }
diff --git a/utils/apidoc/html_diff.dart b/utils/apidoc/html_diff.dart
index 85c49c9..06adfca 100644
--- a/utils/apidoc/html_diff.dart
+++ b/utils/apidoc/html_diff.dart
@@ -13,10 +13,10 @@
 import 'lib/metadata.dart';
 
 // TODO(rnystrom): Use "package:" URL (#4968).
-import '../../sdk/lib/_internal/compiler/implementation/mirrors/analyze.dart';
-import '../../sdk/lib/_internal/compiler/implementation/mirrors/source_mirrors.dart';
-import '../../sdk/lib/_internal/compiler/implementation/mirrors/mirrors_util.dart';
-import '../../sdk/lib/_internal/compiler/implementation/source_file_provider.dart';
+import '../../pkg/compiler/lib/src/mirrors/analyze.dart';
+import '../../pkg/compiler/lib/src/mirrors/source_mirrors.dart';
+import '../../pkg/compiler/lib/src/mirrors/mirrors_util.dart';
+import '../../pkg/compiler/lib/src/source_file_provider.dart';
 
 // TODO(amouravski): There is currently magic that looks at dart:* libraries
 // rather than the declared library names. This changed due to recent syntax
diff --git a/utils/apidoc/lib/metadata.dart b/utils/apidoc/lib/metadata.dart
index 2881bc1..c56b0b6 100644
--- a/utils/apidoc/lib/metadata.dart
+++ b/utils/apidoc/lib/metadata.dart
@@ -1,7 +1,7 @@
 library metadata;
 
-import '../../../sdk/lib/_internal/compiler/implementation/mirrors/source_mirrors.dart';
-import '../../../sdk/lib/_internal/compiler/implementation/mirrors/mirrors_util.dart';
+import '../../../pkg/compiler/lib/src/mirrors/source_mirrors.dart';
+import '../../../pkg/compiler/lib/src/mirrors/mirrors_util.dart';
 
 /// Returns the metadata for the given string or null if not found.
 InstanceMirror findMetadata(List<InstanceMirror> metadataList, String find) {
diff --git a/utils/compiler/compiler.gyp b/utils/compiler/compiler.gyp
index 9be9644..61c4548 100644
--- a/utils/compiler/compiler.gyp
+++ b/utils/compiler/compiler.gyp
@@ -35,7 +35,7 @@
             '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart<(EXECUTABLE_SUFFIX)',
             'create_snapshot.dart',
             '--output_dir=<(SHARED_INTERMEDIATE_DIR)',
-            '--dart2js_main=sdk/lib/_internal/compiler/implementation/dart2js.dart',
+            '--dart2js_main=pkg/compiler/lib/src/dart2js.dart',
             '--docgen_main=pkg/docgen/bin/docgen.dart',
             '--package_root=<(PRODUCT_DIR)/packages/',
           ],
@@ -44,7 +44,7 @@
     },
     # Other targets depend on dart2js files, but have to many inputs,
     # which causes issues on some platforms.
-    # This target lists all the files in sdk/lib/_internal/compiler,
+    # This target lists all the files in pkg/compiler,
     # and creates a single dart2js_files.stamp
     {
       'target_name': 'dart2js_files_stamp',
@@ -55,7 +55,7 @@
           'inputs': [
             '../../tools/create_timestamp_file.py',
             '<!@(["python", "../../tools/list_files.py", "\\.dart$",'
-                ' "../../sdk/lib/_internal/compiler"])',
+                ' "../../pkg/compiler/lib"])',
           ],
           'outputs': [
             '<(SHARED_INTERMEDIATE_DIR)/dart2js_files.stamp',