Repository: google/closure-compiler
Pull request #1154 (2015-09-19 14:51:22)

ES6: Accept IdentiferName (including Keyword) in ExportSpecifier and ImportSpecifier.
 see:
    http://www.ecma-international.org/ecma-262/6.0/index.html#sec-imports
    http://www.ecma-international.org/ecma-262/6.0/index.html#sec-exports

This fix is necessary for  implementing "package index" module. e.g.:

```javascript
// index.js: 

export {default as AClass} from "./AClass" // AClass.js: export default class AClass { ...}
export {default as BClass} from "./BClass" // BClass.js: export default class BClass { ...}
```


MatrixFrog: Is any keyword supposed to be valid? Can you do this (even though it's a bit weird)? `import {else as x}` or `import {switch as x}` etc.
concavelenz: This doesn't sound right.  Is it just "default" you want handled?
rintaro: *Yes*, any keyword should be accepted I think.
https://esdiscuss.org/topic/moduleimport#content-55

Patch:
diff --git a/README.md b/README.md
index cbb22775c..ad20a390e 100644
--- a/README.md
+++ b/README.md
@@ -20,14 +20,18 @@ The [Closure Compiler](https://developers.google.com/closure/compiler/) is a too
 
 Note: The Closure Compiler requires [Java 7 or higher](http://www.java.com/).
 
-### Using [Maven](http://maven.apache.org/)
+### Using [Ant](http://ant.apache.org/)
 
-1. Download [Maven](http://maven.apache.org/download.cgi).
+1. Download the [Ant build tool](http://ant.apache.org/bindownload.cgi).
 
-2. Run `mvn -DskipTests` (omit the `-DskipTests` if you want to run all the
-unit tests too).
+2. At the root of the source tree, there is an Ant file named ```build.xml```.
+   To use it, navigate to the same directory and type the command
 
-    This will produce a jar file called `target/closure-compiler-1.0-SNAPSHOT.jar`.
+    ```
+    ant jar
+    ```
+
+    This will produce a jar file called ```build/compiler.jar```.
 
 ### Using [Eclipse](http://www.eclipse.org/)
 
diff --git a/contrib/externs/angular-1.4.js b/contrib/externs/angular-1.4.js
index 9543d587b..1afbff9e8 100644
--- a/contrib/externs/angular-1.4.js
+++ b/contrib/externs/angular-1.4.js
@@ -786,13 +786,6 @@ angular.Module.prototype.service = function(name, constructor) {};
  */
 angular.Module.prototype.value = function(name, object) {};
 
-/**
- * @param {string} name
- * @param {!angular.Injectable} decorator
- * @return {!angular.Module}
- */
-angular.Module.prototype.decorator = function(name, decorator) {};
-
 /**
  * @type {string}
  */
@@ -2006,7 +1999,7 @@ angular.$provide.prototype.constant = function(name, object) {};
 
 /**
  * @param {string} name
- * @param {!angular.Injectable} decorator
+ * @param {angular.Injectable} decorator
  */
 angular.$provide.prototype.decorator = function(name, decorator) {};
 
diff --git a/contrib/externs/maps/google_maps_api_v3_22.js b/contrib/externs/maps/google_maps_api_v3_22.js
index 84cd4e1d8..dc20113ce 100644
--- a/contrib/externs/maps/google_maps_api_v3_22.js
+++ b/contrib/externs/maps/google_maps_api_v3_22.js
@@ -1171,7 +1171,7 @@ google.maps.DirectionsRequest.prototype.avoidHighways;
 google.maps.DirectionsRequest.prototype.avoidTolls;
 
 /**
- * @type {google.maps.Place}
+ * @type {google.maps.LatLng|string}
  */
 google.maps.DirectionsRequest.prototype.destination;
 
@@ -1186,7 +1186,7 @@ google.maps.DirectionsRequest.prototype.durationInTraffic;
 google.maps.DirectionsRequest.prototype.optimizeWaypoints;
 
 /**
- * @type {google.maps.Place}
+ * @type {google.maps.LatLng|string}
  */
 google.maps.DirectionsRequest.prototype.origin;
 
@@ -1362,7 +1362,7 @@ google.maps.DirectionsStep.prototype.travel_mode;
 google.maps.DirectionsWaypoint = function() {};
 
 /**
- * @type {google.maps.Place}
+ * @type {google.maps.LatLng|string}
  */
 google.maps.DirectionsWaypoint.prototype.location;
 
@@ -1416,7 +1416,7 @@ google.maps.DistanceMatrixRequest.prototype.avoidHighways;
 google.maps.DistanceMatrixRequest.prototype.avoidTolls;
 
 /**
- * @type {Array<google.maps.Place>}
+ * @type {Array<google.maps.LatLng|string>}
  */
 google.maps.DistanceMatrixRequest.prototype.destinations;
 
@@ -1426,7 +1426,7 @@ google.maps.DistanceMatrixRequest.prototype.destinations;
 google.maps.DistanceMatrixRequest.prototype.durationInTraffic;
 
 /**
- * @type {Array<google.maps.Place>}
+ * @type {Array<google.maps.LatLng|string>}
  */
 google.maps.DistanceMatrixRequest.prototype.origins;
 
@@ -1933,7 +1933,7 @@ google.maps.GeocoderRequest = function() {};
 google.maps.GeocoderRequest.prototype.address;
 
 /**
- * @type {google.maps.LatLngBounds|google.maps.LatLngBoundsLiteral}
+ * @type {google.maps.LatLngBounds}
  */
 google.maps.GeocoderRequest.prototype.bounds;
 
@@ -2012,7 +2012,7 @@ google.maps.GeocoderStatus = {
 
 /**
  * @param {string} url
- * @param {google.maps.LatLngBounds|google.maps.LatLngBoundsLiteral} bounds
+ * @param {google.maps.LatLngBounds} bounds
  * @param {(google.maps.GroundOverlayOptions|Object.<string>)=} opt_opts
  * @extends {google.maps.MVCObject}
  * @constructor
@@ -2135,75 +2135,6 @@ google.maps.IconSequence.prototype.offset;
  */
 google.maps.IconSequence.prototype.repeat;
 
-/**
- * @param {google.maps.ImageMapTypeOptions|Object.<string>} opts
- * @implements {google.maps.MapType}
- * @extends {google.maps.MVCObject}
- * @constructor
- */
-google.maps.ImageMapType = function(opts) {};
-
-/**
- * @type {string}
- */
-google.maps.ImageMapType.prototype.alt;
-
-/**
- * @type {number}
- */
-google.maps.ImageMapType.prototype.maxZoom;
-
-/**
- * @type {number}
- */
-google.maps.ImageMapType.prototype.minZoom;
-
-/**
- * @type {string}
- */
-google.maps.ImageMapType.prototype.name;
-
-/**
- * @type {google.maps.Projection}
- */
-google.maps.ImageMapType.prototype.projection;
-
-/**
- * @type {number}
- */
-google.maps.ImageMapType.prototype.radius;
-
-/**
- * @type {google.maps.Size}
- */
-google.maps.ImageMapType.prototype.tileSize;
-
-/**
- * @nosideeffects
- * @return {number}
- */
-google.maps.ImageMapType.prototype.getOpacity = function() {};
-
-/**
- * @param {google.maps.Point} tileCoord
- * @param {number} zoom
- * @param {Document} ownerDocument
- * @return {Node}
- */
-google.maps.ImageMapType.prototype.getTile = function(tileCoord, zoom, ownerDocument) {};
-
-/**
- * @param {Node} tileDiv
- * @return {undefined}
- */
-google.maps.ImageMapType.prototype.releaseTile = function(tileDiv) {};
-
-/**
- * @param {number} opacity
- * @return {undefined}
- */
-google.maps.ImageMapType.prototype.setOpacity = function(opacity) {};
-
 /**
  * @interface
  */
@@ -2610,7 +2541,7 @@ google.maps.LatLngBounds = function(opt_sw, opt_ne) {};
 google.maps.LatLngBounds.prototype.contains = function(latLng) {};
 
 /**
- * @param {google.maps.LatLngBounds|google.maps.LatLngBoundsLiteral} other
+ * @param {google.maps.LatLngBounds} other
  * @return {boolean}
  */
 google.maps.LatLngBounds.prototype.equals = function(other) {};
@@ -2640,7 +2571,7 @@ google.maps.LatLngBounds.prototype.getNorthEast = function() {};
 google.maps.LatLngBounds.prototype.getSouthWest = function() {};
 
 /**
- * @param {google.maps.LatLngBounds|google.maps.LatLngBoundsLiteral} other
+ * @param {google.maps.LatLngBounds} other
  * @return {boolean}
  */
 google.maps.LatLngBounds.prototype.intersects = function(other) {};
@@ -2667,36 +2598,11 @@ google.maps.LatLngBounds.prototype.toString = function() {};
 google.maps.LatLngBounds.prototype.toUrlValue = function(opt_precision) {};
 
 /**
- * @param {google.maps.LatLngBounds|google.maps.LatLngBoundsLiteral} other
+ * @param {google.maps.LatLngBounds} other
  * @return {google.maps.LatLngBounds}
  */
 google.maps.LatLngBounds.prototype.union = function(other) {};
 
-/**
- * @interface
- */
-google.maps.LatLngBoundsLiteral = function() {};
-
-/**
- * @type {number}
- */
-google.maps.LatLngBoundsLiteral.prototype.east;
-
-/**
- * @type {number}
- */
-google.maps.LatLngBoundsLiteral.prototype.north;
-
-/**
- * @type {number}
- */
-google.maps.LatLngBoundsLiteral.prototype.south;
-
-/**
- * @type {number}
- */
-google.maps.LatLngBoundsLiteral.prototype.west;
-
 /**
  * @interface
  */
@@ -2881,7 +2787,7 @@ google.maps.Map.prototype.mapTypes;
 google.maps.Map.prototype.overlayMapTypes;
 
 /**
- * @param {google.maps.LatLngBounds|google.maps.LatLngBoundsLiteral} bounds
+ * @param {google.maps.LatLngBounds} bounds
  * @return {undefined}
  */
 google.maps.Map.prototype.fitBounds = function(bounds) {};
@@ -2954,7 +2860,7 @@ google.maps.Map.prototype.panBy = function(x, y) {};
 google.maps.Map.prototype.panTo = function(latLng) {};
 
 /**
- * @param {google.maps.LatLngBounds|google.maps.LatLngBoundsLiteral} latLngBounds
+ * @param {google.maps.LatLngBounds} latLngBounds
  * @return {undefined}
  */
 google.maps.Map.prototype.panToBounds = function(latLngBounds) {};
@@ -4329,7 +4235,7 @@ google.maps.Rectangle.prototype.getMap = function() {};
 google.maps.Rectangle.prototype.getVisible = function() {};
 
 /**
- * @param {google.maps.LatLngBounds|google.maps.LatLngBoundsLiteral} bounds
+ * @param {google.maps.LatLngBounds} bounds
  * @return {undefined}
  */
 google.maps.Rectangle.prototype.setBounds = function(bounds) {};
@@ -4370,7 +4276,7 @@ google.maps.Rectangle.prototype.setVisible = function(visible) {};
 google.maps.RectangleOptions = function() {};
 
 /**
- * @type {google.maps.LatLngBounds|google.maps.LatLngBoundsLiteral}
+ * @type {google.maps.LatLngBounds}
  */
 google.maps.RectangleOptions.prototype.bounds;
 
@@ -5967,7 +5873,7 @@ google.maps.places.Autocomplete.prototype.getBounds = function() {};
 google.maps.places.Autocomplete.prototype.getPlace = function() {};
 
 /**
- * @param {google.maps.LatLngBounds|google.maps.LatLngBoundsLiteral} bounds
+ * @param {google.maps.LatLngBounds} bounds
  * @return {undefined}
  */
 google.maps.places.Autocomplete.prototype.setBounds = function(bounds) {};
@@ -5990,7 +5896,7 @@ google.maps.places.Autocomplete.prototype.setTypes = function(types) {};
 google.maps.places.AutocompleteOptions = function() {};
 
 /**
- * @type {google.maps.LatLngBounds|google.maps.LatLngBoundsLiteral}
+ * @type {google.maps.LatLngBounds}
  */
 google.maps.places.AutocompleteOptions.prototype.bounds;
 
@@ -6059,7 +5965,7 @@ google.maps.places.AutocompleteService.prototype.getQueryPredictions = function(
 google.maps.places.AutocompletionRequest = function() {};
 
 /**
- * @type {google.maps.LatLngBounds|google.maps.LatLngBoundsLiteral}
+ * @type {google.maps.LatLngBounds}
  */
 google.maps.places.AutocompletionRequest.prototype.bounds;
 
@@ -6340,7 +6246,7 @@ google.maps.places.PlaceSearchPagination.prototype.nextPage = function() {};
 google.maps.places.PlaceSearchRequest = function() {};
 
 /**
- * @type {google.maps.LatLngBounds|google.maps.LatLngBoundsLiteral}
+ * @type {google.maps.LatLngBounds}
  */
 google.maps.places.PlaceSearchRequest.prototype.bounds;
 
@@ -6498,7 +6404,7 @@ google.maps.places.QueryAutocompletePrediction.prototype.terms;
 google.maps.places.QueryAutocompletionRequest = function() {};
 
 /**
- * @type {google.maps.LatLngBounds|google.maps.LatLngBoundsLiteral}
+ * @type {google.maps.LatLngBounds}
  */
 google.maps.places.QueryAutocompletionRequest.prototype.bounds;
 
@@ -6528,7 +6434,7 @@ google.maps.places.QueryAutocompletionRequest.prototype.radius;
 google.maps.places.RadarSearchRequest = function() {};
 
 /**
- * @type {google.maps.LatLngBounds|google.maps.LatLngBoundsLiteral}
+ * @type {google.maps.LatLngBounds}
  */
 google.maps.places.RadarSearchRequest.prototype.bounds;
 
@@ -6586,7 +6492,7 @@ google.maps.places.SearchBox.prototype.getBounds = function() {};
 google.maps.places.SearchBox.prototype.getPlaces = function() {};
 
 /**
- * @param {google.maps.LatLngBounds|google.maps.LatLngBoundsLiteral} bounds
+ * @param {google.maps.LatLngBounds} bounds
  * @return {undefined}
  */
 google.maps.places.SearchBox.prototype.setBounds = function(bounds) {};
@@ -6597,7 +6503,7 @@ google.maps.places.SearchBox.prototype.setBounds = function(bounds) {};
 google.maps.places.SearchBoxOptions = function() {};
 
 /**
- * @type {google.maps.LatLngBounds|google.maps.LatLngBoundsLiteral}
+ * @type {google.maps.LatLngBounds}
  */
 google.maps.places.SearchBoxOptions.prototype.bounds;
 
@@ -6607,7 +6513,7 @@ google.maps.places.SearchBoxOptions.prototype.bounds;
 google.maps.places.TextSearchRequest = function() {};
 
 /**
- * @type {google.maps.LatLngBounds|google.maps.LatLngBoundsLiteral}
+ * @type {google.maps.LatLngBounds}
  */
 google.maps.places.TextSearchRequest.prototype.bounds;
 
diff --git a/contrib/externs/maps/google_maps_api_v3_exp.js b/contrib/externs/maps/google_maps_api_v3_exp.js
index 84cd4e1d8..dc20113ce 100644
--- a/contrib/externs/maps/google_maps_api_v3_exp.js
+++ b/contrib/externs/maps/google_maps_api_v3_exp.js
@@ -1171,7 +1171,7 @@ google.maps.DirectionsRequest.prototype.avoidHighways;
 google.maps.DirectionsRequest.prototype.avoidTolls;
 
 /**
- * @type {google.maps.Place}
+ * @type {google.maps.LatLng|string}
  */
 google.maps.DirectionsRequest.prototype.destination;
 
@@ -1186,7 +1186,7 @@ google.maps.DirectionsRequest.prototype.durationInTraffic;
 google.maps.DirectionsRequest.prototype.optimizeWaypoints;
 
 /**
- * @type {google.maps.Place}
+ * @type {google.maps.LatLng|string}
  */
 google.maps.DirectionsRequest.prototype.origin;
 
@@ -1362,7 +1362,7 @@ google.maps.DirectionsStep.prototype.travel_mode;
 google.maps.DirectionsWaypoint = function() {};
 
 /**
- * @type {google.maps.Place}
+ * @type {google.maps.LatLng|string}
  */
 google.maps.DirectionsWaypoint.prototype.location;
 
@@ -1416,7 +1416,7 @@ google.maps.DistanceMatrixRequest.prototype.avoidHighways;
 google.maps.DistanceMatrixRequest.prototype.avoidTolls;
 
 /**
- * @type {Array<google.maps.Place>}
+ * @type {Array<google.maps.LatLng|string>}
  */
 google.maps.DistanceMatrixRequest.prototype.destinations;
 
@@ -1426,7 +1426,7 @@ google.maps.DistanceMatrixRequest.prototype.destinations;
 google.maps.DistanceMatrixRequest.prototype.durationInTraffic;
 
 /**
- * @type {Array<google.maps.Place>}
+ * @type {Array<google.maps.LatLng|string>}
  */
 google.maps.DistanceMatrixRequest.prototype.origins;
 
@@ -1933,7 +1933,7 @@ google.maps.GeocoderRequest = function() {};
 google.maps.GeocoderRequest.prototype.address;
 
 /**
- * @type {google.maps.LatLngBounds|google.maps.LatLngBoundsLiteral}
+ * @type {google.maps.LatLngBounds}
  */
 google.maps.GeocoderRequest.prototype.bounds;
 
@@ -2012,7 +2012,7 @@ google.maps.GeocoderStatus = {
 
 /**
  * @param {string} url
- * @param {google.maps.LatLngBounds|google.maps.LatLngBoundsLiteral} bounds
+ * @param {google.maps.LatLngBounds} bounds
  * @param {(google.maps.GroundOverlayOptions|Object.<string>)=} opt_opts
  * @extends {google.maps.MVCObject}
  * @constructor
@@ -2135,75 +2135,6 @@ google.maps.IconSequence.prototype.offset;
  */
 google.maps.IconSequence.prototype.repeat;
 
-/**
- * @param {google.maps.ImageMapTypeOptions|Object.<string>} opts
- * @implements {google.maps.MapType}
- * @extends {google.maps.MVCObject}
- * @constructor
- */
-google.maps.ImageMapType = function(opts) {};
-
-/**
- * @type {string}
- */
-google.maps.ImageMapType.prototype.alt;
-
-/**
- * @type {number}
- */
-google.maps.ImageMapType.prototype.maxZoom;
-
-/**
- * @type {number}
- */
-google.maps.ImageMapType.prototype.minZoom;
-
-/**
- * @type {string}
- */
-google.maps.ImageMapType.prototype.name;
-
-/**
- * @type {google.maps.Projection}
- */
-google.maps.ImageMapType.prototype.projection;
-
-/**
- * @type {number}
- */
-google.maps.ImageMapType.prototype.radius;
-
-/**
- * @type {google.maps.Size}
- */
-google.maps.ImageMapType.prototype.tileSize;
-
-/**
- * @nosideeffects
- * @return {number}
- */
-google.maps.ImageMapType.prototype.getOpacity = function() {};
-
-/**
- * @param {google.maps.Point} tileCoord
- * @param {number} zoom
- * @param {Document} ownerDocument
- * @return {Node}
- */
-google.maps.ImageMapType.prototype.getTile = function(tileCoord, zoom, ownerDocument) {};
-
-/**
- * @param {Node} tileDiv
- * @return {undefined}
- */
-google.maps.ImageMapType.prototype.releaseTile = function(tileDiv) {};
-
-/**
- * @param {number} opacity
- * @return {undefined}
- */
-google.maps.ImageMapType.prototype.setOpacity = function(opacity) {};
-
 /**
  * @interface
  */
@@ -2610,7 +2541,7 @@ google.maps.LatLngBounds = function(opt_sw, opt_ne) {};
 google.maps.LatLngBounds.prototype.contains = function(latLng) {};
 
 /**
- * @param {google.maps.LatLngBounds|google.maps.LatLngBoundsLiteral} other
+ * @param {google.maps.LatLngBounds} other
  * @return {boolean}
  */
 google.maps.LatLngBounds.prototype.equals = function(other) {};
@@ -2640,7 +2571,7 @@ google.maps.LatLngBounds.prototype.getNorthEast = function() {};
 google.maps.LatLngBounds.prototype.getSouthWest = function() {};
 
 /**
- * @param {google.maps.LatLngBounds|google.maps.LatLngBoundsLiteral} other
+ * @param {google.maps.LatLngBounds} other
  * @return {boolean}
  */
 google.maps.LatLngBounds.prototype.intersects = function(other) {};
@@ -2667,36 +2598,11 @@ google.maps.LatLngBounds.prototype.toString = function() {};
 google.maps.LatLngBounds.prototype.toUrlValue = function(opt_precision) {};
 
 /**
- * @param {google.maps.LatLngBounds|google.maps.LatLngBoundsLiteral} other
+ * @param {google.maps.LatLngBounds} other
  * @return {google.maps.LatLngBounds}
  */
 google.maps.LatLngBounds.prototype.union = function(other) {};
 
-/**
- * @interface
- */
-google.maps.LatLngBoundsLiteral = function() {};
-
-/**
- * @type {number}
- */
-google.maps.LatLngBoundsLiteral.prototype.east;
-
-/**
- * @type {number}
- */
-google.maps.LatLngBoundsLiteral.prototype.north;
-
-/**
- * @type {number}
- */
-google.maps.LatLngBoundsLiteral.prototype.south;
-
-/**
- * @type {number}
- */
-google.maps.LatLngBoundsLiteral.prototype.west;
-
 /**
  * @interface
  */
@@ -2881,7 +2787,7 @@ google.maps.Map.prototype.mapTypes;
 google.maps.Map.prototype.overlayMapTypes;
 
 /**
- * @param {google.maps.LatLngBounds|google.maps.LatLngBoundsLiteral} bounds
+ * @param {google.maps.LatLngBounds} bounds
  * @return {undefined}
  */
 google.maps.Map.prototype.fitBounds = function(bounds) {};
@@ -2954,7 +2860,7 @@ google.maps.Map.prototype.panBy = function(x, y) {};
 google.maps.Map.prototype.panTo = function(latLng) {};
 
 /**
- * @param {google.maps.LatLngBounds|google.maps.LatLngBoundsLiteral} latLngBounds
+ * @param {google.maps.LatLngBounds} latLngBounds
  * @return {undefined}
  */
 google.maps.Map.prototype.panToBounds = function(latLngBounds) {};
@@ -4329,7 +4235,7 @@ google.maps.Rectangle.prototype.getMap = function() {};
 google.maps.Rectangle.prototype.getVisible = function() {};
 
 /**
- * @param {google.maps.LatLngBounds|google.maps.LatLngBoundsLiteral} bounds
+ * @param {google.maps.LatLngBounds} bounds
  * @return {undefined}
  */
 google.maps.Rectangle.prototype.setBounds = function(bounds) {};
@@ -4370,7 +4276,7 @@ google.maps.Rectangle.prototype.setVisible = function(visible) {};
 google.maps.RectangleOptions = function() {};
 
 /**
- * @type {google.maps.LatLngBounds|google.maps.LatLngBoundsLiteral}
+ * @type {google.maps.LatLngBounds}
  */
 google.maps.RectangleOptions.prototype.bounds;
 
@@ -5967,7 +5873,7 @@ google.maps.places.Autocomplete.prototype.getBounds = function() {};
 google.maps.places.Autocomplete.prototype.getPlace = function() {};
 
 /**
- * @param {google.maps.LatLngBounds|google.maps.LatLngBoundsLiteral} bounds
+ * @param {google.maps.LatLngBounds} bounds
  * @return {undefined}
  */
 google.maps.places.Autocomplete.prototype.setBounds = function(bounds) {};
@@ -5990,7 +5896,7 @@ google.maps.places.Autocomplete.prototype.setTypes = function(types) {};
 google.maps.places.AutocompleteOptions = function() {};
 
 /**
- * @type {google.maps.LatLngBounds|google.maps.LatLngBoundsLiteral}
+ * @type {google.maps.LatLngBounds}
  */
 google.maps.places.AutocompleteOptions.prototype.bounds;
 
@@ -6059,7 +5965,7 @@ google.maps.places.AutocompleteService.prototype.getQueryPredictions = function(
 google.maps.places.AutocompletionRequest = function() {};
 
 /**
- * @type {google.maps.LatLngBounds|google.maps.LatLngBoundsLiteral}
+ * @type {google.maps.LatLngBounds}
  */
 google.maps.places.AutocompletionRequest.prototype.bounds;
 
@@ -6340,7 +6246,7 @@ google.maps.places.PlaceSearchPagination.prototype.nextPage = function() {};
 google.maps.places.PlaceSearchRequest = function() {};
 
 /**
- * @type {google.maps.LatLngBounds|google.maps.LatLngBoundsLiteral}
+ * @type {google.maps.LatLngBounds}
  */
 google.maps.places.PlaceSearchRequest.prototype.bounds;
 
@@ -6498,7 +6404,7 @@ google.maps.places.QueryAutocompletePrediction.prototype.terms;
 google.maps.places.QueryAutocompletionRequest = function() {};
 
 /**
- * @type {google.maps.LatLngBounds|google.maps.LatLngBoundsLiteral}
+ * @type {google.maps.LatLngBounds}
  */
 google.maps.places.QueryAutocompletionRequest.prototype.bounds;
 
@@ -6528,7 +6434,7 @@ google.maps.places.QueryAutocompletionRequest.prototype.radius;
 google.maps.places.RadarSearchRequest = function() {};
 
 /**
- * @type {google.maps.LatLngBounds|google.maps.LatLngBoundsLiteral}
+ * @type {google.maps.LatLngBounds}
  */
 google.maps.places.RadarSearchRequest.prototype.bounds;
 
@@ -6586,7 +6492,7 @@ google.maps.places.SearchBox.prototype.getBounds = function() {};
 google.maps.places.SearchBox.prototype.getPlaces = function() {};
 
 /**
- * @param {google.maps.LatLngBounds|google.maps.LatLngBoundsLiteral} bounds
+ * @param {google.maps.LatLngBounds} bounds
  * @return {undefined}
  */
 google.maps.places.SearchBox.prototype.setBounds = function(bounds) {};
@@ -6597,7 +6503,7 @@ google.maps.places.SearchBox.prototype.setBounds = function(bounds) {};
 google.maps.places.SearchBoxOptions = function() {};
 
 /**
- * @type {google.maps.LatLngBounds|google.maps.LatLngBoundsLiteral}
+ * @type {google.maps.LatLngBounds}
  */
 google.maps.places.SearchBoxOptions.prototype.bounds;
 
@@ -6607,7 +6513,7 @@ google.maps.places.SearchBoxOptions.prototype.bounds;
 google.maps.places.TextSearchRequest = function() {};
 
 /**
- * @type {google.maps.LatLngBounds|google.maps.LatLngBoundsLiteral}
+ * @type {google.maps.LatLngBounds}
  */
 google.maps.places.TextSearchRequest.prototype.bounds;
 
diff --git a/src/com/google/javascript/jscomp/AbstractCommandLineRunner.java b/src/com/google/javascript/jscomp/AbstractCommandLineRunner.java
index 2bb04610c..f6a6c17f3 100644
--- a/src/com/google/javascript/jscomp/AbstractCommandLineRunner.java
+++ b/src/com/google/javascript/jscomp/AbstractCommandLineRunner.java
@@ -2212,6 +2212,13 @@ public abstract class AbstractCommandLineRunner<A extends Compiler,
 
     private List<String> moduleRoots = ImmutableList.of(ES6ModuleLoader.DEFAULT_FILENAME_PREFIX);
 
+    /**
+     * Sets the CommonJS module path prefix (maps to {@link #setModuleRoots(List)}).
+     */
+    CommandLineConfig setCommonJSModulePathPrefix(String prefix) {
+      return setModuleRoots(ImmutableList.of(prefix));
+    }
+
     /**
      * Sets the module roots.
      */
diff --git a/src/com/google/javascript/jscomp/AbstractCompiler.java b/src/com/google/javascript/jscomp/AbstractCompiler.java
index ba8590176..6383834b9 100644
--- a/src/com/google/javascript/jscomp/AbstractCompiler.java
+++ b/src/com/google/javascript/jscomp/AbstractCompiler.java
@@ -48,7 +48,6 @@ public abstract class AbstractCompiler implements SourceExcerptProvider {
       "JSC_READ_ERROR", "Cannot read: {0}");
 
   boolean needsEs6Runtime = false;
-  boolean needsEs6DartRuntime = false;
 
   /**
    * Will be called before each pass runs.
diff --git a/src/com/google/javascript/jscomp/AmbiguateProperties.java b/src/com/google/javascript/jscomp/AmbiguateProperties.java
index 96c353c76..e6f5fee18 100644
--- a/src/com/google/javascript/jscomp/AmbiguateProperties.java
+++ b/src/com/google/javascript/jscomp/AmbiguateProperties.java
@@ -429,8 +429,9 @@ class AmbiguateProperties implements CompilerPass {
     }
 
     @Override
-    public Annotation getAnnotation() {
-      return annotation;
+    @SuppressWarnings("unchecked")
+    public <A extends Annotation> A getAnnotation() {
+      return (A) annotation;
     }
 
     @Override
diff --git a/src/com/google/javascript/jscomp/CheckJSDoc.java b/src/com/google/javascript/jscomp/CheckJSDoc.java
index 7bd8aa089..aeef410a1 100644
--- a/src/com/google/javascript/jscomp/CheckJSDoc.java
+++ b/src/com/google/javascript/jscomp/CheckJSDoc.java
@@ -85,26 +85,13 @@ final class CheckJSDoc extends AbstractPostOrderCallback implements CompilerPass
         && !info.getTemplateTypeNames().isEmpty()
         && !info.isConstructorOrInterface()
         && !isClassDecl(n)
-        && !info.containsFunctionDeclaration()) {
-      if (isFunctionDecl(n)) {
-        reportMisplaced(n, "template",
-            "The template variable is unused."
-            + " Please remove the @template annotation.");
-      } else {
-        reportMisplaced(n, "template",
-            "@template is only allowed in class, constructor, interface, function "
-            + "or method declarations");
-      }
+        && !(info.containsFunctionDeclaration())) {
+      reportMisplaced(n, "template",
+          "@template is only allowed in class, constructor, interface, function "
+          + "or method declarations");
     }
   }
 
-  private boolean isFunctionDecl(Node n) {
-    return n.isFunction()
-        || (n.isVar() && n.getFirstChild().getFirstChild() != null
-            && n.getFirstChild().getFirstChild().isFunction())
-        || n.isAssign() && n.getFirstChild().isQualifiedName() && n.getLastChild().isFunction();
-  }
-
   private boolean isClassDecl(Node n) {
     return isClass(n)
         || (n.isAssign() && isClass(n.getLastChild()))
@@ -275,6 +262,7 @@ final class CheckJSDoc extends AbstractPostOrderCallback implements CompilerPass
         case Token.DEFAULT_VALUE:
           Node parent = n.getParent();
           switch (parent.getType()) {
+            case Token.STRING_KEY:
             case Token.GETTER_DEF:
             case Token.SETTER_DEF:
             case Token.CATCH:
diff --git a/src/com/google/javascript/jscomp/CommandLineRunner.java b/src/com/google/javascript/jscomp/CommandLineRunner.java
index 87328868b..7d555f59e 100644
--- a/src/com/google/javascript/jscomp/CommandLineRunner.java
+++ b/src/com/google/javascript/jscomp/CommandLineRunner.java
@@ -489,12 +489,6 @@ public class CommandLineRunner extends
         usage = "Rewrite Polymer classes to be compiler-friendly.")
     private boolean polymerPass = false;
 
-    @Option(name = "--dart_pass",
-        hidden = true,
-        handler = BooleanOptionHandler.class,
-        usage = "Rewrite Dart Dev Compiler output to be compiler-friendly.")
-    private boolean dartPass = false;
-
     @Option(name = "--output_manifest",
         hidden = true,
         usage = "Prints out a list of all the files in the compilation. "
@@ -1166,8 +1160,6 @@ public class CommandLineRunner extends
 
     options.polymerPass = flags.polymerPass;
 
-    options.setDartPass(flags.dartPass);
-
     options.renamePrefixNamespace = flags.renamePrefixNamespace;
 
     if (!flags.translationsFile.isEmpty()) {
diff --git a/src/com/google/javascript/jscomp/CompilerOptions.java b/src/com/google/javascript/jscomp/CompilerOptions.java
index 4bbfd0d81..16ff73023 100644
--- a/src/com/google/javascript/jscomp/CompilerOptions.java
+++ b/src/com/google/javascript/jscomp/CompilerOptions.java
@@ -651,9 +651,6 @@ public class CompilerOptions {
   /** Processes Polymer calls */
   boolean polymerPass;
 
-  /** Processes the output of the Dart Dev Compiler */
-  boolean dartPass;
-
   /** Remove goog.abstractMethod assignments. */
   boolean removeAbstractMethods;
 
@@ -1030,7 +1027,6 @@ public class CompilerOptions {
     jqueryPass = false;
     angularPass = false;
     polymerPass = false;
-    dartPass = false;
     removeAbstractMethods = true;
     removeClosureAsserts = false;
     stripTypes = Collections.emptySet();
@@ -1491,10 +1487,6 @@ public class CompilerOptions {
     this.polymerPass = polymerPass;
   }
 
-  public void setDartPass(boolean dartPass) {
-    this.dartPass = dartPass;
-  }
-
   public void setCodingConvention(CodingConvention codingConvention) {
     this.codingConvention = codingConvention;
   }
diff --git a/src/com/google/javascript/jscomp/CompilerOptionsPreprocessor.java b/src/com/google/javascript/jscomp/CompilerOptionsPreprocessor.java
index 94d33f192..95ac5b1b0 100644
--- a/src/com/google/javascript/jscomp/CompilerOptionsPreprocessor.java
+++ b/src/com/google/javascript/jscomp/CompilerOptionsPreprocessor.java
@@ -67,15 +67,6 @@ final class CompilerOptionsPreprocessor {
           "The jQuery pass and the Closure pass cannot both be enabled.");
     }
 
-    if (options.dartPass) {
-      if (!options.getLanguageOut().isEs5OrHigher()) {
-        throw new InvalidOptionsException("Dart requires --language_out=ES5 or higher.");
-      }
-      // --dart_pass does not support type-aware property renaming yet.
-      options.setAmbiguateProperties(false);
-      options.setDisambiguateProperties(false);
-    }
-
     if (options.removeUnusedPrototypePropertiesInExterns
         && options.exportLocalPropertyDefinitions) {
       throw new InvalidOptionsException(
diff --git a/src/com/google/javascript/jscomp/DartSuperAccessorsPass.java b/src/com/google/javascript/jscomp/DartSuperAccessorsPass.java
deleted file mode 100644
index 5dd9fee0e..000000000
--- a/src/com/google/javascript/jscomp/DartSuperAccessorsPass.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
- * Copyright 2015 The Closure Compiler Authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.google.javascript.jscomp;
-
-import com.google.common.base.Preconditions;
-import com.google.javascript.rhino.IR;
-import com.google.javascript.rhino.Node;
-
-/**
- * Converts {@code super} getter and setter calls in order to support the output
- * of the Dart Dev Compiler (https://github.com/dart-lang/dev_compiler). This has
- * to run before the {@link Es6ConvertSuper} pass.
- *
- * <p>Note that the approach taken here doesn't lend itself to good optimizations of getters and
- * setters. An alternative approach is needed to generate fully optimizable output before general
- * ES6->ES5 lowering of super accessor expressions can be rolled out.
- *
- * <p>TODO(ochafik): Add support for `super.x++` (and --, pre/post variants).
- *
- * @author ochafik@google.com (Olivier Chafik)
- */
-public final class DartSuperAccessorsPass implements NodeTraversal.Callback,
-    HotSwapCompilerPass {
-  static final String CALL_SUPER_GET = "$jscomp.superGet";
-  static final String CALL_SUPER_SET = "$jscomp.superSet";
-
-  private final AbstractCompiler compiler;
-  /**
-   * Whether JSCompiler_renameProperty can and should be used (i.e. if we think a RenameProperties
-   * pass will be run).
-   */
-  private final boolean renameProperties;
-
-  public DartSuperAccessorsPass(AbstractCompiler compiler) {
-    this.compiler = compiler;
-    CompilerOptions options = compiler.getOptions();
-
-    this.renameProperties = options.propertyRenaming == PropertyRenamingPolicy.ALL_UNQUOTED;
-
-    Preconditions.checkState(options.getLanguageOut().isEs5OrHigher(),
-        "Dart super accessors pass requires ES5+ output");
-
-    // We currently rely on JSCompiler_renameProperty, which is not type-aware.
-    // We would need something like goog.reflect.object (with the super class type),
-    // but right now this would yield much larger code.
-    Preconditions.checkState(!options.ambiguateProperties && !options.disambiguateProperties,
-        "Dart super accessors pass is not compatible with property (dis)ambiguation yet");
-  }
-
-  @Override
-  public boolean shouldTraverse(NodeTraversal t, Node n, Node parent) {
-    if (isSuperGet(n)) {
-      visitSuperGet(n);
-      return false;
-    } else if (isSuperSet(n)) {
-      if (!n.isAssign()) {
-        n = normalizeAssignmentOp(n);
-      }
-      visitSuperSet(n);
-      return false;
-    }
-    return true;
-  }
-
-  private static boolean isCalled(Node n) {
-    Node parent = n.getParent();
-    return parent.isCall() && (n == parent.getFirstChild());
-  }
-
-  /** Transforms `a += b` to `a = a + b`. */
-  private static Node normalizeAssignmentOp(Node n) {
-    Node lhs = n.getFirstChild();
-    Node rhs = n.getLastChild();
-    Node newRhs = new Node(NodeUtil.getOpFromAssignmentOp(n),
-        lhs.cloneTree(), rhs.cloneTree()).srcrefTree(n);
-    return replace(n, IR.assign(lhs.cloneTree(), newRhs).srcrefTree(n));
-  }
-
-  @Override
-  public void visit(NodeTraversal t, Node n, Node parent) {}
-
-  private boolean isSuperGet(Node n) {
-    return (n.isGetProp() || n.isGetElem())
-        && !isCalled(n)
-        && n.getFirstChild().isSuper()
-        && isInsideInstanceMember(n);
-  }
-
-  private boolean isSuperSet(Node n) {
-    return NodeUtil.isAssignmentOp(n) && isSuperGet(n.getFirstChild());
-  }
-
-  /**
-   * Returns true if this node is or is enclosed by an instance member definition
-   * (non-static method, getter or setter).
-   */
-  private static boolean isInsideInstanceMember(Node n) {
-    while (n != null) {
-      if (n.isMemberFunctionDef()
-          || n.isGetterDef()
-          || n.isSetterDef()
-          || n.isComputedProp()) {
-        return !n.isStaticMember();
-      }
-      if (n.isClass()) {
-        // Stop at the first enclosing class.
-        return false;
-      }
-      n = n.getParent();
-    }
-    return false;
-  }
-
-  private void visitSuperGet(Node superGet) {
-    Node name = superGet.getLastChild().cloneTree();
-    Node callSuperGet = IR.call(
-        NodeUtil.newQName(compiler, CALL_SUPER_GET),
-        IR.thisNode(),
-        superGet.isGetProp() ? renameProperty(name) : name);
-    replace(superGet, callSuperGet.srcrefTree(superGet));
-    reportEs6Change();
-  }
-
-  private void visitSuperSet(Node superSet) {
-    Preconditions.checkArgument(superSet.isAssign());
-
-    // First, recurse on the assignment's right-hand-side.
-    NodeTraversal.traverse(compiler, superSet.getLastChild(), this);
-    Node rhs = superSet.getLastChild();
-
-    Node superGet = superSet.getFirstChild();
-
-    Node name = superGet.getLastChild().cloneTree();
-    Node callSuperSet = IR.call(
-        NodeUtil.newQName(compiler, CALL_SUPER_SET),
-        IR.thisNode(),
-        superGet.isGetProp() ? renameProperty(name) : name,
-        rhs.cloneTree());
-    replace(superSet, callSuperSet.srcrefTree(superSet));
-    reportEs6Change();
-  }
-
-  private void reportEs6Change() {
-    compiler.needsEs6Runtime = true;
-    compiler.needsEs6DartRuntime = true;
-    compiler.reportCodeChange();
-  }
-
-  private static Node replace(Node original, Node replacement) {
-    original.getParent().replaceChild(original, replacement);
-    return replacement;
-  }
-
-  /**
-   * Wraps a property string in a JSCompiler_renameProperty call.
-   *
-   * <p>Should only be called in phases running before {@link RenameProperties},
-   * if such a pass is even used (see {@link #renameProperties}).
-   */
-  private Node renameProperty(Node propertyName) {
-    Preconditions.checkArgument(propertyName.isString());
-    if (!renameProperties) {
-      return propertyName;
-    }
-    Node call = IR.call(IR.name(NodeUtil.JSC_PROPERTY_NAME_FN), propertyName);
-    call.srcrefTree(propertyName);
-    call.putBooleanProp(Node.FREE_CALL, true);
-    call.putBooleanProp(Node.IS_CONSTANT_NAME, true);
-    return call;
-  }
-
-  @Override
-  public void process(Node externs, Node root) {
-    NodeTraversal.traverse(compiler, externs, this);
-    NodeTraversal.traverse(compiler, root, this);
-  }
-
-  @Override
-  public void hotSwapScript(Node scriptRoot, Node originalRoot) {
-    NodeTraversal.traverse(compiler, scriptRoot, this);
-  }
-}
diff --git a/src/com/google/javascript/jscomp/DefaultPassConfig.java b/src/com/google/javascript/jscomp/DefaultPassConfig.java
index afe061f82..a41b3a275 100644
--- a/src/com/google/javascript/jscomp/DefaultPassConfig.java
+++ b/src/com/google/javascript/jscomp/DefaultPassConfig.java
@@ -293,12 +293,6 @@ public final class DefaultPassConfig extends PassConfig {
       checks.add(es6RewriteDestructuring);
     }
 
-    // It's important that the Dart super accessors pass run *before*
-    // es6ConvertSuper. This is enforced in the assertValidOrder method.
-    if (options.dartPass && !options.getLanguageOut().isEs6OrHigher()) {
-      checks.add(dartSuperAccessorsPass);
-    }
-
     // Late ES6 transpilation.
     // Includes ES6 features that are best handled natively by the compiler.
     // As we convert more passes to handle these features, we will be moving the transpilation
@@ -930,8 +924,6 @@ public final class DefaultPassConfig extends PassConfig {
    */
   private void assertValidOrder(List<PassFactory> checks) {
     int polymerIndex = checks.indexOf(polymerPass);
-    int dartSuperAccessorsIndex = checks.indexOf(dartSuperAccessorsPass);
-    int es6ConvertSuperIndex = checks.indexOf(es6ConvertSuper);
     int closureIndex = checks.indexOf(closurePrimitives);
     int suspiciousCodeIndex = checks.indexOf(suspiciousCode);
     int checkVarsIndex = checks.indexOf(checkVariableReferences);
@@ -943,11 +935,7 @@ public final class DefaultPassConfig extends PassConfig {
     }
     if (polymerIndex != -1 && suspiciousCodeIndex != -1) {
       Preconditions.checkState(polymerIndex < suspiciousCodeIndex,
-          "The Polymer pass must run before suspiciousCode processing.");
-    }
-    if (dartSuperAccessorsIndex != -1 && es6ConvertSuperIndex != -1) {
-      Preconditions.checkState(dartSuperAccessorsIndex < es6ConvertSuperIndex,
-          "The Dart super accessors pass must run before ES6->ES3 super lowering.");
+          "The Polymer pass must run befor suspiciousCode processing.");
     }
     if (googScopeIndex != -1) {
       Preconditions.checkState(checkVarsIndex != -1,
@@ -2641,15 +2629,6 @@ public final class DefaultPassConfig extends PassConfig {
     }
   };
 
-  /** Rewrites the super accessors calls to support Dart Dev Compiler output. */
-  private final HotSwapPassFactory dartSuperAccessorsPass =
-      new HotSwapPassFactory("dartSuperAccessorsPass", true) {
-    @Override
-    protected HotSwapCompilerPass create(AbstractCompiler compiler) {
-      return new DartSuperAccessorsPass(compiler);
-    }
-  };
-
   /**
    * A pass-factory that is good for {@code HotSwapCompilerPass} passes.
    */
diff --git a/src/com/google/javascript/jscomp/Es6RewriteArrowFunction.java b/src/com/google/javascript/jscomp/Es6RewriteArrowFunction.java
index 1b3de3d4b..9f2ef72f6 100644
--- a/src/com/google/javascript/jscomp/Es6RewriteArrowFunction.java
+++ b/src/com/google/javascript/jscomp/Es6RewriteArrowFunction.java
@@ -16,8 +16,6 @@
 package com.google.javascript.jscomp;
 
 import com.google.javascript.rhino.IR;
-import com.google.javascript.rhino.JSDocInfoBuilder;
-import com.google.javascript.rhino.JSTypeExpression;
 import com.google.javascript.rhino.Node;
 import com.google.javascript.rhino.Token;
 
@@ -110,11 +108,6 @@ public class Es6RewriteArrowFunction extends NodeTraversal.AbstractPreOrderCallb
     if (addArguments) {
       Node name = IR.name(ARGUMENTS_VAR);
       Node argumentsVar = IR.declaration(name, IR.name("arguments"), Token.CONST);
-      JSDocInfoBuilder jsdoc = new JSDocInfoBuilder(false);
-      jsdoc.recordType(
-          new JSTypeExpression(
-              new Node(Token.BANG, IR.string("Arguments")), "<Es6RewriteArrowFunction>"));
-      argumentsVar.setJSDocInfo(jsdoc.build());
       argumentsVar.useSourceInfoIfMissingFromForTree(parent);
       parent.addChildToFront(argumentsVar);
       scope.declare(ARGUMENTS_VAR, name, input);
diff --git a/src/com/google/javascript/jscomp/GlobalTypeInfo.java b/src/com/google/javascript/jscomp/GlobalTypeInfo.java
index eb2784660..d64ae059c 100644
--- a/src/com/google/javascript/jscomp/GlobalTypeInfo.java
+++ b/src/com/google/javascript/jscomp/GlobalTypeInfo.java
@@ -1617,7 +1617,7 @@ class GlobalTypeInfo implements CompilerPass {
           return commonTypes.getRegexpType();
         case Token.ARRAYLIT: {
           if (!n.hasChildren()) {
-            return commonTypes.getArrayInstance();
+            return null;
           }
           Node child = n.getFirstChild();
           JSType arrayType = simpleInferExprType(child);
diff --git a/src/com/google/javascript/jscomp/InjectEs6RuntimeLibrary.java b/src/com/google/javascript/jscomp/InjectEs6RuntimeLibrary.java
index b8ca3f7b0..0b084c6d7 100644
--- a/src/com/google/javascript/jscomp/InjectEs6RuntimeLibrary.java
+++ b/src/com/google/javascript/jscomp/InjectEs6RuntimeLibrary.java
@@ -31,9 +31,6 @@ class InjectEs6RuntimeLibrary implements CompilerPass {
     if (compiler.needsEs6Runtime) {
       compiler.ensureLibraryInjected("es6_runtime", false);
     }
-    if (compiler.needsEs6DartRuntime) {
-      compiler.ensureLibraryInjected("es6_dart_runtime", false);
-    }
   }
 }
 
diff --git a/src/com/google/javascript/jscomp/NewTypeInference.java b/src/com/google/javascript/jscomp/NewTypeInference.java
index 3998caa64..70834dd3b 100644
--- a/src/com/google/javascript/jscomp/NewTypeInference.java
+++ b/src/com/google/javascript/jscomp/NewTypeInference.java
@@ -2099,8 +2099,9 @@ final class NewTypeInference implements CompilerPass {
     EnvTypePair pair = analyzeExprFwd(expr.getFirstChild(), inEnv);
     JSType fromType = pair.type;
     JSType toType = symbolTable.getCastType(expr);
-    if (!JSType.haveCommonSubtype(fromType, toType) && !fromType.hasTypeVariable()) {
-      warnings.add(JSError.make(expr, INVALID_CAST, fromType.toString(), toType.toString()));
+    if (!JSType.haveCommonSubtype(fromType, toType)) {
+      warnings.add(JSError.make(
+          expr, INVALID_CAST, fromType.toString(), toType.toString()));
     }
     pair.type = toType;
     return pair;
diff --git a/src/com/google/javascript/jscomp/TypedScope.java b/src/com/google/javascript/jscomp/TypedScope.java
index c2ed76b31..f9381c559 100644
--- a/src/com/google/javascript/jscomp/TypedScope.java
+++ b/src/com/google/javascript/jscomp/TypedScope.java
@@ -268,6 +268,10 @@ public class TypedScope extends Scope implements StaticTypedScope<JSType> {
     return false;
   }
 
+  public boolean isHoistScope() {
+    throw new IllegalStateException("Method isHoistScope cannot be called on typed scopes.");
+  }
+
   public boolean isFunctionBlockScope() {
     throw new IllegalStateException(
         "Method isFunctionBlockScope cannot be called on typed scopes.");
diff --git a/src/com/google/javascript/jscomp/js/es6_dart_runtime.js b/src/com/google/javascript/jscomp/js/es6_dart_runtime.js
deleted file mode 100644
index 5960e690e..000000000
--- a/src/com/google/javascript/jscomp/js/es6_dart_runtime.js
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright 2014 The Closure Compiler Authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * @fileoverview  Additional runtime functions required for transpilation from
- * ES6 to ES5 of code generated by the Dart Dev Compiler.
- *
- * Note that DDC's output cannot currently be lowered to ES3 (heavy use of
- * getters or setters, including in the runtime), so these helpers make no
- * attempt of fallback behaviour when methods like Object.getPrototypeOf or
- * Object.getOwnPropertyDescriptor are undefined (unlike helpers in
- * es6_runtime.js).
- *
- * @author ochafik@google.com (Olivier Chafik)
- */
-
-
-/**
- * Gets a property descriptor for a target instance, skipping its class
- * and walking up the super-classes hierarchy.
- *
- * @private
- * @param {!Object} target
- * @param {!string} name
- * @return {!Object.<ObjectPropertyDescriptor>|undefined}
- */
-$jscomp.getSuperPropertyDescriptor_ = function(target, name) {
-  var getPrototypeOf = $jscomp.global.Object.getPrototypeOf;
-  var getOwnPropertyDescriptor = $jscomp.global.Object.getOwnPropertyDescriptor;
-  var cls = getPrototypeOf(target);
-  while (cls != null) {
-    cls = getPrototypeOf(cls);
-    if (cls != null) {
-      var desc = getOwnPropertyDescriptor(cls, name);
-      if (desc != null) {
-        return desc;
-      }
-    }
-  }
-  return undefined;
-};
-
-/**
- * Gets a property of a target instance using its super class getter or value,
- * or returns undefined if that property is not defined on any ancestor.
- *
- * @param {!Object} target
- * @param {!string} propertyName
- * @return {*}
- */
-$jscomp.superGet = function(target, propertyName) {
-  var desc = $jscomp.getSuperPropertyDescriptor_(target, propertyName);
-  return desc && (desc.get ? desc.get.call(target) : desc.value);
-};
-
-/**
- * Sets a property on a target instance using its super setter if is defined
- * on any ancestor, or setting it as a simple property on the target otherwise.
- *
- * @template T
- * @param {!Object} target
- * @param {!string} propertyName
- * @param {T} value
- * @return {T}
- */
-$jscomp.superSet = function(target, propertyName, value) {
-  var desc = $jscomp.getSuperPropertyDescriptor_(target, propertyName);
-  if (desc) {
-    if (!desc.set) {
-      throw new TypeError('No setter for super.' + propertyName);
-    }
-    desc.set.call(target, value);
-  } else {
-    target[propertyName] = value;
-  }
-  return value;
-};
diff --git a/src/com/google/javascript/jscomp/newtypes/JSType.java b/src/com/google/javascript/jscomp/newtypes/JSType.java
index e067e7572..7e9cb410a 100644
--- a/src/com/google/javascript/jscomp/newtypes/JSType.java
+++ b/src/com/google/javascript/jscomp/newtypes/JSType.java
@@ -341,11 +341,7 @@ public abstract class JSType implements TypeI {
   }
 
   public boolean isTypeVariable() {
-    return getMask() == TYPEVAR_MASK;
-  }
-
-  public boolean hasTypeVariable() {
-    return (getMask() & TYPEVAR_MASK) != 0;
+    return (getMask() & TYPEVAR_MASK) != 0 && (getMask() & ~TYPEVAR_MASK) == 0;
   }
 
   public boolean isStruct() {
diff --git a/src/com/google/javascript/jscomp/parsing/IRFactory.java b/src/com/google/javascript/jscomp/parsing/IRFactory.java
index f7ca728c2..a51654691 100644
--- a/src/com/google/javascript/jscomp/parsing/IRFactory.java
+++ b/src/com/google/javascript/jscomp/parsing/IRFactory.java
@@ -711,16 +711,18 @@ class IRFactory {
   }
 
   /**
-   * Names and destructuring patterns, in parameters or variable declarations are special,
-   * because they can have inline type docs attached.
+   * NAMEs in parameters or variable declarations are special, because they can
+   * have inline type docs attached.
    *
-   * <pre>function f(/** string &#42;/ x) {}</pre> annotates 'x' as a string.
+   * function f(/** string &#42;/ x) {}
+   * annotates 'x' as a string.
    *
    * @see <a href="http://code.google.com/p/jsdoc-toolkit/wiki/InlineDocs">
    *   Using Inline Doc Comments</a>
    */
-  private Node transformNodeWithInlineJsDoc(ParseTree node) {
-    JSDocInfo info = handleInlineJsDoc(node);
+  private Node transformNodeWithInlineJsDoc(
+      ParseTree node, boolean optionalInline) {
+    JSDocInfo info = handleInlineJsDoc(node, optionalInline);
     Node irNode = justTransform(node);
     if (info != null) {
       irNode.setJSDocInfo(info);
@@ -729,18 +731,21 @@ class IRFactory {
     return irNode;
   }
 
-  private JSDocInfo handleInlineJsDoc(ParseTree node) {
-    return handleInlineJsDoc(node.location);
+  private JSDocInfo handleInlineJsDoc(ParseTree node, boolean optional) {
+    return handleInlineJsDoc(node.location, optional);
   }
 
   private JSDocInfo handleInlineJsDoc(
-      com.google.javascript.jscomp.parsing.parser.Token token) {
-    return handleInlineJsDoc(token.location);
+      com.google.javascript.jscomp.parsing.parser.Token token,
+      boolean optional) {
+    return handleInlineJsDoc(token.location, optional);
   }
 
-  private JSDocInfo handleInlineJsDoc(SourceRange location) {
+  private JSDocInfo handleInlineJsDoc(
+      SourceRange location,
+      boolean optional) {
     Comment comment = getJsDoc(location);
-    if (comment != null && !comment.value.contains("@")) {
+    if (comment != null && (!optional || !comment.value.contains("@"))) {
       return recordJsDoc(location, parseInlineTypeDoc(comment));
     } else {
       return handleJsDoc(comment);
@@ -1234,7 +1239,7 @@ class IRFactory {
       Node params = newNode(Token.PARAM_LIST);
       if (checkParameters(tree.parameters)) {
         for (ParseTree param : tree.parameters) {
-          Node paramNode = transformNodeWithInlineJsDoc(param);
+          Node paramNode = transformNodeWithInlineJsDoc(param, false);
           // Children must be simple names, default parameters, rest
           // parameters, or destructuring patterns.
           Preconditions.checkState(paramNode.isName() || paramNode.isRest()
@@ -1349,7 +1354,7 @@ class IRFactory {
     }
 
     Node processNameWithInlineJSDoc(IdentifierToken identifierToken) {
-      JSDocInfo info = handleInlineJsDoc(identifierToken);
+      JSDocInfo info = handleInlineJsDoc(identifierToken, true);
       if (isReservedKeyword(identifierToken.toString())) {
         errorReporter.error(
           "identifier is a reserved word",
@@ -1820,13 +1825,14 @@ class IRFactory {
 
       Node node = newNode(declType);
       for (VariableDeclarationTree child : decl.declarations) {
-        node.addChildToBack(transformNodeWithInlineJsDoc(child));
+        node.addChildToBack(
+            transformNodeWithInlineJsDoc(child, true));
       }
       return node;
     }
 
     Node processVariableDeclaration(VariableDeclarationTree decl) {
-      Node node = transformNodeWithInlineJsDoc(decl.lvalue);
+      Node node = transformNodeWithInlineJsDoc(decl.lvalue, true);
       if (decl.initializer != null) {
         Node initializer = transform(decl.initializer);
         node.addChildToBack(initializer);
@@ -2027,10 +2033,13 @@ class IRFactory {
     }
 
     Node processExportSpec(ExportSpecifierTree tree) {
-      Node exportSpec = newNode(Token.EXPORT_SPEC,
-          processName(tree.importedName));
+      Node importedName = processName(tree.importedName, true);
+      importedName.setType(Token.NAME);
+      Node exportSpec = newNode(Token.EXPORT_SPEC, importedName);
       if (tree.destinationName != null) {
-        exportSpec.addChildToBack(processName(tree.destinationName));
+        Node destinationName = processName(tree.destinationName, true);
+        destinationName.setType(Token.NAME);
+        exportSpec.addChildToBack(destinationName);
       }
       return exportSpec;
     }
@@ -2048,8 +2057,9 @@ class IRFactory {
     }
 
     Node processImportSpec(ImportSpecifierTree tree) {
-      Node importSpec = newNode(Token.IMPORT_SPEC,
-          processName(tree.importedName));
+      Node importedName = processName(tree.importedName, true);
+      importedName.setType(Token.NAME);
+      Node importSpec = newNode(Token.IMPORT_SPEC, importedName);
       if (tree.destinationName != null) {
         importSpec.addChildToBack(processName(tree.destinationName));
       }
diff --git a/src/com/google/javascript/jscomp/parsing/parser/Parser.java b/src/com/google/javascript/jscomp/parsing/parser/Parser.java
index 2cce5054b..44227b6a4 100644
--- a/src/com/google/javascript/jscomp/parsing/parser/Parser.java
+++ b/src/com/google/javascript/jscomp/parsing/parser/Parser.java
@@ -374,6 +374,9 @@ public class Parser {
       } else {
         parseExplicitNames = false;
       }
+    } else if (Keywords.isKeyword(peekType())) {
+        Token keyword = nextToken();
+        reportError(keyword, "cannot use keyword '%s' here.", keyword);
     }
 
     if (parseExplicitNames) {
@@ -402,7 +405,7 @@ public class Parser {
     ImmutableList.Builder<ParseTree> elements;
     elements = ImmutableList.builder();
     eat(TokenType.OPEN_CURLY);
-    while (peekId()) {
+    while (peekIdOrKeyword()) {
       elements.add(parseImportSpecifier());
       if (!peek(TokenType.CLOSE_CURLY)) {
         eat(TokenType.COMMA);
@@ -415,11 +418,13 @@ public class Parser {
   //  ImportSpecifier ::= Identifier ('as' Identifier)?
   private ParseTree parseImportSpecifier() {
     SourcePosition start = getTreeStartLocation();
-    IdentifierToken importedName = eatId();
+    IdentifierToken importedName = eatIdOrKeywordAsId();
     IdentifierToken destinationName = null;
     if (peekPredefinedString(PredefinedName.AS)) {
       eatPredefinedString(PredefinedName.AS);
       destinationName = eatId();
+    } else if (Keywords.isKeyword(importedName.value)) {
+      reportExpectedError(null, PredefinedName.AS);
     }
     return new ImportSpecifierTree(
         getTreeLocation(start), importedName, destinationName);
@@ -521,6 +526,13 @@ public class Parser {
         (isExportSpecifier && peekPredefinedString(PredefinedName.FROM))) {
       eatPredefinedString(PredefinedName.FROM);
       moduleSpecifier = eat(TokenType.STRING).asLiteral();
+    } else if (isExportSpecifier) {
+      for (ParseTree tree : exportSpecifierList) {
+        IdentifierToken importedName = tree.asExportSpecifier().importedName;
+        if (Keywords.isKeyword(importedName.value)) {
+          reportError(importedName, "cannot use keyword '%s' here.", importedName.value);
+        }
+      }
     }
 
     if (needsSemiColon || peekImplicitSemiColon()) {
@@ -537,7 +549,7 @@ public class Parser {
     ImmutableList.Builder<ParseTree> elements;
     elements = ImmutableList.builder();
     eat(TokenType.OPEN_CURLY);
-    while (peekId()) {
+    while (peekIdOrKeyword()) {
       elements.add(parseExportSpecifier());
       if (!peek(TokenType.CLOSE_CURLY)) {
         eat(TokenType.COMMA);
@@ -550,11 +562,11 @@ public class Parser {
   //  ExportSpecifier ::= Identifier ('as' Identifier)?
   private ParseTree parseExportSpecifier() {
     SourcePosition start = getTreeStartLocation();
-    IdentifierToken importedName = eatId();
+    IdentifierToken importedName = eatIdOrKeywordAsId();
     IdentifierToken destinationName = null;
     if (peekPredefinedString(PredefinedName.AS)) {
       eatPredefinedString(PredefinedName.AS);
-      destinationName = eatId();
+      destinationName = eatIdOrKeywordAsId();
     }
     return new ExportSpecifierTree(
         getTreeLocation(start), importedName, destinationName);
@@ -796,8 +808,7 @@ public class Parser {
 
     ParseTree nameExpr;
     IdentifierToken name;
-    TokenType type = peekType();
-    if (type == TokenType.IDENTIFIER || Keywords.isKeyword(type)) {
+    if (peekIdOrKeyword()) {
       nameExpr = null;
       name = eatIdOrKeywordAsId();
     } else {
@@ -3233,7 +3244,7 @@ public class Parser {
     }
 
     Token name;
-    if (peekId() || Keywords.isKeyword(peekType())) {
+    if (peekIdOrKeyword()) {
       name = eatIdOrKeywordAsId();
       if (!peek(TokenType.COLON)) {
         IdentifierToken idToken = (IdentifierToken) name;
@@ -3414,6 +3425,11 @@ public class Parser {
         || (!inStrictContext() && Keywords.isStrictKeyword(type));
   }
 
+  private boolean peekIdOrKeyword() {
+    TokenType type = peekType();
+    return TokenType.IDENTIFIER == type || Keywords.isKeyword(type);
+  }
+
   private boolean peekAccessibilityModifier() {
     return EnumSet.of(TokenType.PUBLIC, TokenType.PROTECTED, TokenType.PRIVATE)
         .contains(peekType());
diff --git a/src/com/google/javascript/rhino/Node.java b/src/com/google/javascript/rhino/Node.java
index 03041d21d..6c62e25ad 100644
--- a/src/com/google/javascript/rhino/Node.java
+++ b/src/com/google/javascript/rhino/Node.java
@@ -1131,11 +1131,13 @@ public class Node implements Serializable {
       }
     }
 
-    if (printType && typei != null) {
-      String typeString = typei.toString();
-      if (typeString != null) {
-        sb.append(" : ");
-        sb.append(typeString);
+    if (printType) {
+      if (typei != null) {
+        String typeString = typei.toString();
+        if (typeString != null) {
+          sb.append(" : ");
+          sb.append(typeString);
+        }
       }
     }
   }
@@ -1834,6 +1836,7 @@ public class Node implements Serializable {
       case Token.NAME:
         return !getString().isEmpty() && getString().equals(n.getString());
       case Token.THIS:
+        return true;
       case Token.SUPER:
         return true;
       case Token.GETPROP:
diff --git a/src/com/google/javascript/rhino/Token.java b/src/com/google/javascript/rhino/Token.java
index e257c625e..512ad5171 100644
--- a/src/com/google/javascript/rhino/Token.java
+++ b/src/com/google/javascript/rhino/Token.java
@@ -569,132 +569,249 @@ public class Token {
   public static int arity(int token) {
     switch (token) {
       case ERROR:
+        return -1;
       case RETURN:
-      case NEW:
-      case CALL:
-      case STRING_KEY:
-      case REGEXP:
-      case ARRAYLIT:
-      case OBJECTLIT:
-      case TEMPLATELIT:
-      case TRY:
-      case PARAM_LIST:
-      case IF:
-      case SWITCH:
-      case FOR:
-      case BREAK:
-      case CONTINUE:
-      case VAR:
-      case BLOCK:
-      case SCRIPT:
-      case CONST:
-      case DEBUGGER:
-      case ANNOTATION:
-      case PIPE:
-      case STAR:
-      case EOC:
-      case QMARK:
-      case ELLIPSIS:
-      case BANG:
-      case EQUALS:
-      case LB:
-      case LC:
-      case COLON:
-      case YIELD:
         return -1;
-      case NAME:
-      case LABEL_NAME:
-      case NUMBER:
-      case STRING:
-      case NULL:
-      case THIS:
-      case FALSE:
-      case TRUE:
-      case EMPTY:
-      case REST:
-      case IMPORT_STAR:
-      case MEMBER_VARIABLE_DEF:
-        return 0;
-      case NOT:
-      case BITNOT:
-      case POS:
-      case NEG:
-      case DELPROP:
-      case TYPEOF:
-      case THROW:
-      case TEMPLATELIT_SUB:
-      case MEMBER_FUNCTION_DEF:
-      case INC:
-      case DEC:
-      case DEFAULT_CASE:
-      case EXPR_RESULT:
-      case GETTER_DEF:
-      case SETTER_DEF:
-      case CAST:
-      case SPREAD:
-      case VOID:
-      case NAMED_TYPE:
-      case TYPE_ALIAS:
-      case INDEX_SIGNATURE:
-      case CALL_SIGNATURE:
-        return 1;
       case BITOR:
+        return 2;
       case BITXOR:
+        return 2;
       case BITAND:
+        return 2;
       case EQ:
+        return 2;
       case NE:
+        return 2;
       case LT:
+        return 2;
       case LE:
+        return 2;
       case GT:
+        return 2;
       case GE:
+        return 2;
       case LSH:
+        return 2;
       case RSH:
+        return 2;
       case URSH:
+        return 2;
       case ADD:
+        return 2;
       case SUB:
+        return 2;
       case MUL:
+        return 2;
       case DIV:
+        return 2;
       case MOD:
+        return 2;
+      case NOT:
+        return 1;
+      case BITNOT:
+        return 1;
+      case POS:
+        return 1;
+      case NEG:
+        return 1;
+      case NEW:
+        return -1;
+      case DELPROP:
+        return 1;
+      case TYPEOF:
+        return 1;
       case GETPROP:
+        return 2;
       case GETELEM:
+        return 2;
+      case CALL:
+        return -1;
+      case NAME:
+        return 0;
+      case LABEL_NAME:
+        return 0;
+      case NUMBER:
+        return 0;
+      case STRING:
+        return 0;
+      case STRING_KEY:
+        return -1;
+      case NULL:
+        return 0;
+      case THIS:
+        return 0;
+      case FALSE:
+        return 0;
+      case TRUE:
+        return 0;
       case SHEQ:
+        return 2;
       case SHNE:
+        return 2;
+      case REGEXP:
+        return -1;
+      case THROW:
+        return 1;
       case IN:
+        return 2;
       case INSTANCEOF:
+        return 2;
+      case ARRAYLIT:
+        return -1;
+      case OBJECTLIT:
+        return -1;
       case TAGGED_TEMPLATELIT:
+        return 2;
+      case TEMPLATELIT:
+        return -1;
+      case TEMPLATELIT_SUB:
+        return 1;
+      case TRY:
+        return -1;
+      case CLASS:
+        return 3;
+      case MEMBER_FUNCTION_DEF:
+        return 1;
+      case PARAM_LIST:
+        return -1;
       case DEFAULT_VALUE:
+        return 2;
       case COMMA:
+        return 2;
       case ASSIGN:
+        return 2;
       case ASSIGN_BITOR:
+        return 2;
       case ASSIGN_BITXOR:
+        return 2;
       case ASSIGN_BITAND:
+        return 2;
       case ASSIGN_LSH:
+        return 2;
       case ASSIGN_RSH:
+        return 2;
       case ASSIGN_URSH:
+        return 2;
       case ASSIGN_ADD:
+        return 2;
       case ASSIGN_SUB:
+        return 2;
       case ASSIGN_MUL:
+        return 2;
       case ASSIGN_DIV:
+        return 2;
       case ASSIGN_MOD:
+        return 2;
+      case HOOK:
+        return 3;
       case OR:
+        return 2;
       case AND:
+        return 2;
+      case INC:
+        return 1;
+      case DEC:
+        return 1;
+      case FUNCTION:
+        return 3;
+      case IF:
+        return -1;
+      case SWITCH:
+        return -1;
       case CASE:
+        return 2;
+      case DEFAULT_CASE:
+        return 1;
       case WHILE:
+        return 2;
       case DO:
+        return 2;
+      case FOR:
+        return -1;
+      case FOR_OF:
+        return 3;
+      case BREAK:
+        return -1;
+      case CONTINUE:
+        return -1;
+      case VAR:
+        return -1;
       case WITH:
+        return 2;
       case CATCH:
+        return 2;
+      case EMPTY:
+        return 0;
+      case BLOCK:
+        return -1;
       case LABEL:
+        return 2;
+      case EXPR_RESULT:
+        return 1;
+      case SCRIPT:
+        return -1;
+      case GETTER_DEF:
+        return 1;
+      case SETTER_DEF:
+        return 1;
+      case CONST:
+        return -1;
+      case DEBUGGER:
+        return -1;
+      case CAST:
+        return 1;
+      case ANNOTATION:
+        return -1;
+      case PIPE:
+        return -1;
+      case STAR:
+        return -1;
+      case EOC:
+        return -1;
+      case QMARK:
+        return -1;
+      case ELLIPSIS:
+        return -1;
+      case REST:
+        return 0;
+      case SPREAD:
+        return 1;
+      case BANG:
+        return -1;
+      case VOID:
+        return 1;
+      case EQUALS:
+        return -1;
+      case LB:
+        return -1;
+      case LC:
+        return -1;
+      case COLON:
+        return -1;
       case COMPUTED_PROP:
-      case ENUM:
-      case NAMESPACE:
         return 2;
-      case CLASS:
-      case HOOK:
-      case FUNCTION:
-      case FOR_OF:
       case IMPORT:
+        return 3;
+      case IMPORT_STAR:
+        return 0;
+      case YIELD:
+        return -1;
       case INTERFACE:
         return 3;
+      case ENUM:
+        return 2;
+      case NAMESPACE:
+        return 2;
+      case NAMED_TYPE:
+        return 1;
+      case TYPE_ALIAS:
+        return 1;
+      case INDEX_SIGNATURE:
+        return 1;
+      case CALL_SIGNATURE:
+        return 1;
+      case MEMBER_VARIABLE_DEF:
+        return 0;
     }
     throw new IllegalStateException(
         "No arity defined for " + Token.name(token));
diff --git a/src/com/google/javascript/rhino/jstype/FunctionType.java b/src/com/google/javascript/rhino/jstype/FunctionType.java
index 0548287d4..63da0687f 100644
--- a/src/com/google/javascript/rhino/jstype/FunctionType.java
+++ b/src/com/google/javascript/rhino/jstype/FunctionType.java
@@ -1449,7 +1449,7 @@ public class FunctionType extends PrototypeObjectType implements FunctionTypeI {
    */
   @Override
   public Map<String, JSType> getPropertyTypeMap() {
-    Map<String, JSType> propTypeMap = new HashMap<>();
+    Map<String, JSType> propTypeMap = new HashMap<String, JSType>();
     updatePropertyTypeMap(this, propTypeMap, new HashSet<FunctionType>());
     return propTypeMap;
   }
diff --git a/src/com/google/javascript/rhino/jstype/NamedType.java b/src/com/google/javascript/rhino/jstype/NamedType.java
index 5e12eece3..b2b6223b7 100644
--- a/src/com/google/javascript/rhino/jstype/NamedType.java
+++ b/src/com/google/javascript/rhino/jstype/NamedType.java
@@ -132,11 +132,11 @@ public class NamedType extends ProxyObjectType {
 
   private void finishPropertyContinuations() {
     ObjectType referencedObjType = getReferencedObjTypeInternal();
-    if (referencedObjType != null
-        && !referencedObjType.isUnknownType()
-        && propertyContinuations != null) {
-      for (PropertyContinuation c : propertyContinuations) {
-        c.commit(this);
+    if (referencedObjType != null && !referencedObjType.isUnknownType()) {
+      if (propertyContinuations != null) {
+        for (PropertyContinuation c : propertyContinuations) {
+          c.commit(this);
+        }
       }
     }
     propertyContinuations = null;
diff --git a/src/com/google/javascript/rhino/jstype/ObjectType.java b/src/com/google/javascript/rhino/jstype/ObjectType.java
index 0b8b427d2..e75705fab 100644
--- a/src/com/google/javascript/rhino/jstype/ObjectType.java
+++ b/src/com/google/javascript/rhino/jstype/ObjectType.java
@@ -650,7 +650,7 @@ public abstract class ObjectType
    * @return a Map that maps the property's name to the property's type
    */
   public Map<String, JSType> getPropertyTypeMap() {
-    Map<String, JSType> propTypeMap = new HashMap<>();
+    Map<String, JSType> propTypeMap = new HashMap<String, JSType>();
     for (String name : this.getPropertyNames()) {
       propTypeMap.put(name, this.getPropertyType(name));
     }
diff --git a/src/com/google/javascript/rhino/jstype/ProxyObjectType.java b/src/com/google/javascript/rhino/jstype/ProxyObjectType.java
index 9cec8b43c..73c4e900a 100644
--- a/src/com/google/javascript/rhino/jstype/ProxyObjectType.java
+++ b/src/com/google/javascript/rhino/jstype/ProxyObjectType.java
@@ -270,9 +270,11 @@ public class ProxyObjectType extends ObjectType {
   }
 
   @Override
-  boolean defineProperty(String propertyName, JSType type, boolean inferred, Node propertyNode) {
-    return referencedObjType == null
-        || referencedObjType.defineProperty(propertyName, type, inferred, propertyNode);
+  boolean defineProperty(String propertyName, JSType type,
+      boolean inferred, Node propertyNode) {
+    return referencedObjType == null ? true :
+        referencedObjType.defineProperty(
+            propertyName, type, inferred, propertyNode);
   }
 
   @Override
diff --git a/src/com/google/javascript/rhino/jstype/RecordType.java b/src/com/google/javascript/rhino/jstype/RecordType.java
index 512de1f9b..2c4519109 100644
--- a/src/com/google/javascript/rhino/jstype/RecordType.java
+++ b/src/com/google/javascript/rhino/jstype/RecordType.java
@@ -216,7 +216,7 @@ public class RecordType extends PrototypeObjectType {
    * @return a Map that maps the property's name to the property's type
    */
   public Map<String, JSType> getOwnPropertyTypeMap() {
-    Map<String, JSType> propTypeMap = new HashMap<>();
+    Map<String, JSType> propTypeMap = new HashMap<String, JSType>();
     for (String name : this.getOwnPropertyNames()) {
       propTypeMap.put(name, this.getPropertyType(name));
     }


Test patch:
diff --git a/test/com/google/javascript/jscomp/AmbiguatePropertiesTest.java b/test/com/google/javascript/jscomp/AmbiguatePropertiesTest.java
index 337d1b2db..3caac05c3 100644
--- a/test/com/google/javascript/jscomp/AmbiguatePropertiesTest.java
+++ b/test/com/google/javascript/jscomp/AmbiguatePropertiesTest.java
@@ -39,7 +39,7 @@ public final class AmbiguatePropertiesTest extends CompilerTestCase {
   public AmbiguatePropertiesTest() {
     super(EXTERNS);
     enableNormalize();
-    enableTypeCheck();
+    enableTypeCheck(CheckLevel.WARNING);
     enableClosurePass();
     enableGatherExternProperties();
     compareJsDoc = false;
diff --git a/test/com/google/javascript/jscomp/CheckAccessControlsTest.java b/test/com/google/javascript/jscomp/CheckAccessControlsTest.java
index 018b85c7c..f47df173a 100644
--- a/test/com/google/javascript/jscomp/CheckAccessControlsTest.java
+++ b/test/com/google/javascript/jscomp/CheckAccessControlsTest.java
@@ -47,7 +47,7 @@ public final class CheckAccessControlsTest extends CompilerTestCase {
     super(CompilerTypeTestCase.DEFAULT_EXTERNS);
     parseTypeInfo = true;
     enableClosurePass();
-    enableTypeCheck();
+    enableTypeCheck(CheckLevel.WARNING);
   }
 
   @Override
diff --git a/test/com/google/javascript/jscomp/CheckConformanceTest.java b/test/com/google/javascript/jscomp/CheckConformanceTest.java
index 52cfbf80d..27600a9a8 100644
--- a/test/com/google/javascript/jscomp/CheckConformanceTest.java
+++ b/test/com/google/javascript/jscomp/CheckConformanceTest.java
@@ -89,7 +89,7 @@ public final class CheckConformanceTest extends CompilerTestCase {
   @Override
   protected void setUp() throws Exception {
     super.setUp();
-    super.enableTypeCheck();
+    super.enableTypeCheck(CheckLevel.OFF);
     super.enableClosurePass();
     configuration = DEFAULT_CONFORMANCE;
   }
diff --git a/test/com/google/javascript/jscomp/CheckEventfulObjectDisposalTest.java b/test/com/google/javascript/jscomp/CheckEventfulObjectDisposalTest.java
index 4527fa34c..98915fd1c 100644
--- a/test/com/google/javascript/jscomp/CheckEventfulObjectDisposalTest.java
+++ b/test/com/google/javascript/jscomp/CheckEventfulObjectDisposalTest.java
@@ -56,7 +56,7 @@ public final class CheckEventfulObjectDisposalTest extends CompilerTestCase {
   @Override
   protected void setUp() throws Exception {
     super.setUp();
-    enableTypeCheck();
+    enableTypeCheck(CheckLevel.WARNING);
     setAcceptedLanguage(LanguageMode.ECMASCRIPT5);
   }
 
diff --git a/test/com/google/javascript/jscomp/CheckJsDocTest.java b/test/com/google/javascript/jscomp/CheckJsDocTest.java
index 02927f0c6..57b1b677e 100644
--- a/test/com/google/javascript/jscomp/CheckJsDocTest.java
+++ b/test/com/google/javascript/jscomp/CheckJsDocTest.java
@@ -64,16 +64,6 @@ public final class CheckJsDocTest extends Es6CompilerTestCase {
         DISALLOWED_MEMBER_JSDOC);
   }
 
-  public void testInlineJSDoc() {
-    testSame("function f(/** string */ x) {}");
-    testSame("function f(/** @type {string} */ x) {}");
-
-    testSame("var /** string */ x = 'x';");
-    testSame("var /** @type {string} */ x = 'x';");
-    testSame("var /** string */ x, /** number */ y;");
-    testSame("var /** @type {string} */ x, /** @type {number} */ y;");
-  }
-
   public void testFunctionJSDocOnMethods() {
     testSameEs6("class Foo { /** @return {?} */ bar() {} }");
     testSameEs6("class Foo { /** @return {?} */ get bar() {} }");
@@ -84,11 +74,6 @@ public final class CheckJsDocTest extends Es6CompilerTestCase {
     testSameEs6("class Foo { /** @return {?} x */ set [bar](x) {} }");
   }
 
-  public void testObjectLiterals() {
-    testSame("var o = { /** @type {?} */ x: y };");
-    testWarning("var o = { x: /** @type {?} */ y };", MISPLACED_ANNOTATION);
-  }
-
   public void testMethodsOnObjectLiterals() {
     testSameEs6("var x = { /** @return {?} */ foo() {} };");
     testSameEs6("var x = { /** @return {?} */ [foo]() {} };");
@@ -241,21 +226,18 @@ public final class CheckJsDocTest extends Es6CompilerTestCase {
   public void testGoodTemplate4() {
     testSame("x.y.z = goog.defineClass(null, {/** @return T @template T */ m: function() {}});");
   }
-
   public void testBadTemplate1() {
-    testBadTemplate("/** @template T */ foo();");
+    testBadTemplate("/** @type {!Function} @template T */ var x = function(){};");
   }
 
   public void testBadTemplate2() {
+    testBadTemplate("/** @template T */ foo();");
+  }
+
+  public void testBadTemplate3() {
     testBadTemplate(LINE_JOINER.join(
         "x.y.z = goog.defineClass(null, {",
         "  /** @template T */ constructor: function() {}",
         "});"));
   }
-
-  public void testBadTemplate3() {
-    testBadTemplate("/** @template T */ function f() {}");
-    testBadTemplate("/** @template T */ var f = function() {};");
-    testBadTemplate("/** @template T */ Foo.prototype.f = function() {};");
-  }
 }
diff --git a/test/com/google/javascript/jscomp/CheckMissingReturnTest.java b/test/com/google/javascript/jscomp/CheckMissingReturnTest.java
index 652f5f7e9..dbe61ca64 100644
--- a/test/com/google/javascript/jscomp/CheckMissingReturnTest.java
+++ b/test/com/google/javascript/jscomp/CheckMissingReturnTest.java
@@ -25,7 +25,7 @@ import com.google.javascript.jscomp.CompilerOptions.LanguageMode;
 public final class CheckMissingReturnTest extends CompilerTestCase {
 
   public CheckMissingReturnTest() {
-    enableTypeCheck();
+    enableTypeCheck(CheckLevel.OFF);
   }
 
   @Override
diff --git a/test/com/google/javascript/jscomp/CheckTemplateParamsTest.java b/test/com/google/javascript/jscomp/CheckTemplateParamsTest.java
index 4cb24f494..c10ed1b53 100644
--- a/test/com/google/javascript/jscomp/CheckTemplateParamsTest.java
+++ b/test/com/google/javascript/jscomp/CheckTemplateParamsTest.java
@@ -28,7 +28,7 @@ import java.io.IOException;
 public final class CheckTemplateParamsTest extends CompilerTestCase {
   @Override
   public void setUp() throws IOException {
-    enableTypeCheck();
+    enableTypeCheck(CheckLevel.WARNING);
   }
 
   @Override
diff --git a/test/com/google/javascript/jscomp/CheckUnusedPrivatePropertiesTest.java b/test/com/google/javascript/jscomp/CheckUnusedPrivatePropertiesTest.java
index 046de2d69..10a94782c 100644
--- a/test/com/google/javascript/jscomp/CheckUnusedPrivatePropertiesTest.java
+++ b/test/com/google/javascript/jscomp/CheckUnusedPrivatePropertiesTest.java
@@ -50,7 +50,7 @@ public final class CheckUnusedPrivatePropertiesTest extends CompilerTestCase {
 
   @Override
   protected void setUp() {
-    this.enableTypeCheck();
+    this.enableTypeCheck(CheckLevel.OFF);
   }
 
   private void unused(String code) {
diff --git a/test/com/google/javascript/jscomp/ClosureRewriteClassTest.java b/test/com/google/javascript/jscomp/ClosureRewriteClassTest.java
index 8c5441f7e..d887aa11c 100644
--- a/test/com/google/javascript/jscomp/ClosureRewriteClassTest.java
+++ b/test/com/google/javascript/jscomp/ClosureRewriteClassTest.java
@@ -154,7 +154,7 @@ public final class ClosureRewriteClassTest extends CompilerTestCase {
 
   public void testAnnotations1() {
     // verify goog.defineClass values are constructible, by default
-    enableTypeCheck();
+    enableTypeCheck(CheckLevel.WARNING);
     testRewrite(
         "var x = goog.defineClass(Object, {\n"
         + "  constructor: function(){}\n"
@@ -168,7 +168,7 @@ public final class ClosureRewriteClassTest extends CompilerTestCase {
 
   public void testAnnotations2a() {
     // @interface is preserved
-    enableTypeCheck();
+    enableTypeCheck(CheckLevel.WARNING);
     testRewriteWarning(
         "var x = goog.defineClass(null, {\n"
         + "  /** @interface */\n"
@@ -184,7 +184,7 @@ public final class ClosureRewriteClassTest extends CompilerTestCase {
 
   public void testAnnotations2b() {
     // @interface is preserved, at the class level too
-    enableTypeCheck();
+    enableTypeCheck(CheckLevel.WARNING);
     testRewriteWarning(
         "/** @interface */\n"
         + "var x = goog.defineClass(null, {});"
@@ -198,7 +198,7 @@ public final class ClosureRewriteClassTest extends CompilerTestCase {
 
   public void testAnnotations3a() {
     // verify goog.defineClass is a @struct by default
-    enableTypeCheck();
+    enableTypeCheck(CheckLevel.WARNING);
     testRewriteWarning(
         "var y = goog.defineClass(null, {\n"
         + "  constructor: function(){}\n"
@@ -219,7 +219,7 @@ public final class ClosureRewriteClassTest extends CompilerTestCase {
 
   public void testAnnotations3b() {
     // verify goog.defineClass is a @struct by default, but can be overridden
-    enableTypeCheck();
+    enableTypeCheck(CheckLevel.WARNING);
     testRewrite(
         "/** @unrestricted */"
         + "var y = goog.defineClass(null, {\n"
diff --git a/test/com/google/javascript/jscomp/CompilerTestCase.java b/test/com/google/javascript/jscomp/CompilerTestCase.java
index caffb8400..efc159bfd 100644
--- a/test/com/google/javascript/jscomp/CompilerTestCase.java
+++ b/test/com/google/javascript/jscomp/CompilerTestCase.java
@@ -78,7 +78,8 @@ public abstract class CompilerTestCase extends TestCase {
   /** True iff type checking pass runs before pass being tested. */
   private boolean typeCheckEnabled = false;
 
-  @Deprecated private CheckLevel reportMissingOverrideCheckLevel = CheckLevel.WARNING;
+  /** Error level reported by type checker. */
+  private CheckLevel typeCheckLevel;
 
   /** Whether to the test compiler pass before the type check. */
   protected boolean runTypeCheckAfterProcessing = false;
@@ -274,23 +275,11 @@ public abstract class CompilerTestCase extends TestCase {
    *
    * @param level the level of severity to report for type errors
    *
-   * @deprecated Use enableTypeCheck()
    * @see TypeCheck
    */
-  @Deprecated
   public void enableTypeCheck(CheckLevel level) {
-    enableTypeCheck();
-    reportMissingOverrideCheckLevel = level;
-  }
-
-  /**
-   * Perform type checking before running the test pass. This will check
-   * for type errors and annotate nodes with type information.
-   *
-   * @see TypeCheck
-   */
-  public void enableTypeCheck() {
     typeCheckEnabled = true;
+    typeCheckLevel = level;
   }
 
   /**
@@ -1080,7 +1069,7 @@ public abstract class CompilerTestCase extends TestCase {
         // objects for the same type are created, and the type system
         // uses reference equality to compare many types.
         if (!runTypeCheckAfterProcessing && typeCheckEnabled && i == 0) {
-          TypeCheck check = createTypeCheck(compiler, reportMissingOverrideCheckLevel);
+          TypeCheck check = createTypeCheck(compiler, typeCheckLevel);
           check.processForTesting(externsRoot, mainRoot);
         }
 
@@ -1119,7 +1108,7 @@ public abstract class CompilerTestCase extends TestCase {
         }
 
         if (runTypeCheckAfterProcessing && typeCheckEnabled && i == 0) {
-          TypeCheck check = createTypeCheck(compiler, reportMissingOverrideCheckLevel);
+          TypeCheck check = createTypeCheck(compiler, typeCheckLevel);
           check.processForTesting(externsRoot, mainRoot);
         }
 
diff --git a/test/com/google/javascript/jscomp/CompilerTypeTestCase.java b/test/com/google/javascript/jscomp/CompilerTypeTestCase.java
index 2c22062c1..6eb5dab39 100644
--- a/test/com/google/javascript/jscomp/CompilerTypeTestCase.java
+++ b/test/com/google/javascript/jscomp/CompilerTypeTestCase.java
@@ -126,6 +126,9 @@ abstract class CompilerTypeTestCase extends BaseJSTypeTestCase {
           "function Arguments() {}",
           "/** @type {number} */",
           "Arguments.prototype.length;",
+          "", // TODO(blickly): Fix brittle @record test cases that depend on externs length
+          "",
+          "",
           "/** @type {?} */ var unknown;", // For producing unknowns in tests.
           ACTIVE_X_OBJECT_DEF);
 
diff --git a/test/com/google/javascript/jscomp/DartSuperAccessorsPassTest.java b/test/com/google/javascript/jscomp/DartSuperAccessorsPassTest.java
deleted file mode 100644
index 1892c6aad..000000000
--- a/test/com/google/javascript/jscomp/DartSuperAccessorsPassTest.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- * Copyright 2015 The Closure Compiler Authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.google.javascript.jscomp;
-
-import com.google.common.collect.ImmutableList;
-import com.google.javascript.jscomp.CompilerOptions.LanguageMode;
-
-/**
- * Test case for {@link DartSuperAccessorsPass}.
- *
- * @author ochafik@google.com (Olivier Chafik)
- */
-public final class DartSuperAccessorsPassTest extends CompilerTestCase {
-
-  /** Signature of the member functions / accessors we'll wrap expressions into. */
-  private static final ImmutableList<String> MEMBER_SIGNATURES = ImmutableList.of(
-      "constructor()",
-      "method()", "*generator()", "get prop()", "set prop(v)",
-      // ES6 Computed properties:
-      "[method]()", "*[generator]()", "get [prop]()", "set [prop](v)");
-
-  private PropertyRenamingPolicy propertyRenaming;
-  @Override
-  public void setUp() {
-    setAcceptedLanguage(LanguageMode.ECMASCRIPT6);
-    runTypeCheckAfterProcessing = true;
-    propertyRenaming = PropertyRenamingPolicy.ALL_UNQUOTED;
-  }
-
-  @Override
-  protected CompilerOptions getOptions() {
-    CompilerOptions options = super.getOptions();
-    options.setLanguageOut(LanguageMode.ECMASCRIPT5);
-    options.setDartPass(true);
-    options.setAmbiguateProperties(false);
-    options.setDisambiguateProperties(false);
-    options.setPropertyRenaming(propertyRenaming);
-    return options;
-  }
-
-  protected final PassFactory makePassFactory(
-      String name, final CompilerPass pass) {
-    return new PassFactory(name, true/* one-time pass */) {
-      @Override
-      protected CompilerPass create(AbstractCompiler compiler) {
-        return pass;
-      }
-    };
-  }
-
-  @Override
-  public CompilerPass getProcessor(final Compiler compiler) {
-    PhaseOptimizer optimizer = new PhaseOptimizer(compiler, null, null);
-    optimizer.addOneTimePass(
-        makePassFactory("dartSuperAccessors", new DartSuperAccessorsPass(compiler)));
-    return optimizer;
-  }
-
-  @Override
-  protected int getNumRepetitions() {
-    return 1;
-  }
-
-  public void testSuperGetElem() {
-    checkConversionWithinMembers(
-        "return super['prop']",
-        "return $jscomp.superGet(this, 'prop')");
-  }
-
-  public void testSuperGetProp_renameOff() {
-    propertyRenaming = PropertyRenamingPolicy.OFF;
-    checkConversionWithinMembers(
-        "return super.prop",
-        "return $jscomp.superGet(this, 'prop')");
-  }
-
-  public void testSuperGetProp_renameAll() {
-    propertyRenaming = PropertyRenamingPolicy.ALL_UNQUOTED;
-    checkConversionWithinMembers(
-        "return super.prop",
-        "return $jscomp.superGet(this, JSCompiler_renameProperty('prop'))");
-  }
-
-  public void testSuperSetElem() {
-    checkConversionWithinMembers(
-        "super['prop'] = x",
-        "$jscomp.superSet(this, 'prop', x)");
-  }
-
-  public void testSuperSetProp_renameOff() {
-    propertyRenaming = PropertyRenamingPolicy.OFF;
-    checkConversionWithinMembers(
-        "super.prop = x",
-        "$jscomp.superSet(this, 'prop', x)");
-  }
-
-  public void testSuperSetProp_renameAll() {
-    propertyRenaming = PropertyRenamingPolicy.ALL_UNQUOTED;
-    checkConversionWithinMembers(
-        "super.prop = x",
-        "$jscomp.superSet(this, JSCompiler_renameProperty('prop'), x)");
-  }
-
-  public void testSuperSetAssignmentOps() {
-    propertyRenaming = PropertyRenamingPolicy.OFF;
-    checkConversionWithinMembers(
-        "super.a |= b",
-        "$jscomp.superSet(this, 'a', $jscomp.superGet(this, 'a') | b)");
-    checkConversionWithinMembers(
-        "super.a ^= b",
-        "$jscomp.superSet(this, 'a', $jscomp.superGet(this, 'a') ^ b)");
-    checkConversionWithinMembers(
-        "super.a &= b",
-        "$jscomp.superSet(this, 'a', $jscomp.superGet(this, 'a') & b)");
-    checkConversionWithinMembers(
-        "super.a <<= b",
-        "$jscomp.superSet(this, 'a', $jscomp.superGet(this, 'a') << b)");
-    checkConversionWithinMembers(
-        "super.a >>= b",
-        "$jscomp.superSet(this, 'a', $jscomp.superGet(this, 'a') >> b)");
-    checkConversionWithinMembers(
-        "super.a >>>= b",
-        "$jscomp.superSet(this, 'a', $jscomp.superGet(this, 'a') >>> b)");
-    checkConversionWithinMembers(
-        "super.a += b",
-        "$jscomp.superSet(this, 'a', $jscomp.superGet(this, 'a') + b)");
-    checkConversionWithinMembers(
-        "super.a -= b",
-        "$jscomp.superSet(this, 'a', $jscomp.superGet(this, 'a') - b)");
-    checkConversionWithinMembers(
-        "super.a *= b",
-        "$jscomp.superSet(this, 'a', $jscomp.superGet(this, 'a') * b)");
-    checkConversionWithinMembers(
-        "super.a /= b",
-        "$jscomp.superSet(this, 'a', $jscomp.superGet(this, 'a') / b)");
-    checkConversionWithinMembers(
-        "super.a %= b",
-        "$jscomp.superSet(this, 'a', $jscomp.superGet(this, 'a') % b)");
-  }
-
-  public void testSuperSetRecursion() {
-    checkConversionWithinMembers(
-        "super['x'] = super['y']",
-        "$jscomp.superSet(this, 'x', $jscomp.superGet(this, 'y'))");
-    checkConversionWithinMembers(
-        "super['x'] = super['y'] = 10",
-        "$jscomp.superSet(this, 'x', $jscomp.superSet(this, 'y', 10))");
-    checkConversionWithinMembers(
-        "super['x'] += super['y']",
-        "$jscomp.superSet(this, 'x', $jscomp.superGet(this, 'x') + $jscomp.superGet(this, 'y'))");
-  }
-
-
-  public void testExpressionsWithoutSuperAccessors() {
-    String body = LINE_JOINER.join(
-        "foo.bar;",
-        "foo.bar();",
-        "this.bar;",
-        "this.bar();",
-        "super();",
-        "super.bar();");
-
-    for (String sig : MEMBER_SIGNATURES) {
-      testSame(wrap(sig, body));
-    }
-  }
-
-  public void testSuperAccessorsOutsideInstanceMembers() {
-    String body = LINE_JOINER.join(
-        "super.x;",
-        "super.x = y;");
-
-    testSame(body);
-
-    for (String sig : MEMBER_SIGNATURES) {
-      testSame(wrap("static " + sig, body));
-    }
-  }
-
-  /**
-   * Checks that when the provided {@code js} snippet is inside any kind of instance member
-   * function (instance method, getter or setter), it is converted to the {@code expected} snippet.
-   */
-  private void checkConversionWithinMembers(String js, String expected) {
-    for (String sig : MEMBER_SIGNATURES) {
-      test(wrap(sig, js), wrap(sig, expected));
-    }
-  }
-
-  /**
-   * Wraps a body (statements) in a member function / accessor with the provided signature.
-   * (can be static or not).
-   */
-  private String wrap(String memberSignature, String body) {
-    return LINE_JOINER.join(
-        "class X extends Y {",
-        "  " + memberSignature + " {",
-        "    " + body,
-        "  }",
-        "}");
-  }
-}
diff --git a/test/com/google/javascript/jscomp/DeclaredGlobalExternsOnWindowTest.java b/test/com/google/javascript/jscomp/DeclaredGlobalExternsOnWindowTest.java
index cccfd892f..80781591c 100644
--- a/test/com/google/javascript/jscomp/DeclaredGlobalExternsOnWindowTest.java
+++ b/test/com/google/javascript/jscomp/DeclaredGlobalExternsOnWindowTest.java
@@ -30,7 +30,7 @@ public final class DeclaredGlobalExternsOnWindowTest extends Es6CompilerTestCase
   @Override
   protected void setUp() {
     allowExternsChanges(true);
-    enableTypeCheck();
+    enableTypeCheck(CheckLevel.ERROR);
     runTypeCheckAfterProcessing = true;
   }
 
diff --git a/test/com/google/javascript/jscomp/DevirtualizePrototypeMethodsTest.java b/test/com/google/javascript/jscomp/DevirtualizePrototypeMethodsTest.java
index f4f61cf20..5704e166d 100644
--- a/test/com/google/javascript/jscomp/DevirtualizePrototypeMethodsTest.java
+++ b/test/com/google/javascript/jscomp/DevirtualizePrototypeMethodsTest.java
@@ -135,7 +135,7 @@ public final class DevirtualizePrototypeMethodsTest extends CompilerTestCase {
 
   public void testRewritePrototypeMethods2() throws Exception {
     // type checking on
-    enableTypeCheck();
+    enableTypeCheck(CheckLevel.ERROR);
     checkTypes(RewritePrototypeMethodTestInput.INPUT,
                RewritePrototypeMethodTestInput.EXPECTED,
                RewritePrototypeMethodTestInput.EXPECTED_TYPE_CHECKING_ON);
diff --git a/test/com/google/javascript/jscomp/DisambiguatePropertiesTest.java b/test/com/google/javascript/jscomp/DisambiguatePropertiesTest.java
index 663626aee..ac4c406bd 100644
--- a/test/com/google/javascript/jscomp/DisambiguatePropertiesTest.java
+++ b/test/com/google/javascript/jscomp/DisambiguatePropertiesTest.java
@@ -47,7 +47,7 @@ public final class DisambiguatePropertiesTest extends CompilerTestCase {
   protected void setUp() throws Exception {
     super.setUp();
     super.enableNormalize(true);
-    super.enableTypeCheck();
+    super.enableTypeCheck(CheckLevel.WARNING);
   }
 
   @Override
diff --git a/test/com/google/javascript/jscomp/Es6RewriteArrowFunctionTest.java b/test/com/google/javascript/jscomp/Es6RewriteArrowFunctionTest.java
index ecb14adc0..b2507b1be 100644
--- a/test/com/google/javascript/jscomp/Es6RewriteArrowFunctionTest.java
+++ b/test/com/google/javascript/jscomp/Es6RewriteArrowFunctionTest.java
@@ -90,20 +90,6 @@ public class Es6RewriteArrowFunctionTest extends CompilerTestCase {
             "}"));
   }
 
-  public void testArguments() {
-    test(
-        LINE_JOINER.join(
-            "function f() {",
-            "  var x = () => arguments;",
-            "}"),
-        LINE_JOINER.join(
-            "function f() {",
-            "  /** @type {!Arguments} */",
-            "  const $jscomp$arguments = arguments;",
-            "  var x = function() { return $jscomp$arguments; };",
-            "}"));
-  }
-
   public void testArrowFunctionInObject() {
     test("var obj = { f: () => 'bar' };",
          "var obj = { f: function() { return 'bar'; } };");
diff --git a/test/com/google/javascript/jscomp/Es6RewriteBlockScopedDeclarationTest.java b/test/com/google/javascript/jscomp/Es6RewriteBlockScopedDeclarationTest.java
index cf366d916..4bfef1308 100644
--- a/test/com/google/javascript/jscomp/Es6RewriteBlockScopedDeclarationTest.java
+++ b/test/com/google/javascript/jscomp/Es6RewriteBlockScopedDeclarationTest.java
@@ -769,7 +769,7 @@ public final class Es6RewriteBlockScopedDeclarationTest extends CompilerTestCase
   }
 
   public void testDoWhileForOfCapturedLetAnnotated() {
-    enableTypeCheck();
+    enableTypeCheck(CheckLevel.WARNING);
 
     testWarning("/** @type {number} */ let x = 5; x = 'str';", TypeValidator.TYPE_MISMATCH_WARNING);
 
diff --git a/test/com/google/javascript/jscomp/Es6RewriteDestructuringTest.java b/test/com/google/javascript/jscomp/Es6RewriteDestructuringTest.java
index 7bf243787..264da33fa 100644
--- a/test/com/google/javascript/jscomp/Es6RewriteDestructuringTest.java
+++ b/test/com/google/javascript/jscomp/Es6RewriteDestructuringTest.java
@@ -379,7 +379,7 @@ public class Es6RewriteDestructuringTest extends CompilerTestCase {
   }
 
   public void testDefaultParameters() {
-    enableTypeCheck();
+    enableTypeCheck(CheckLevel.WARNING);
     test(
         "function f(zero, one = 1, two = 2) {}; f(1); f(1,2,3);",
         LINE_JOINER.join(
@@ -417,7 +417,7 @@ public class Es6RewriteDestructuringTest extends CompilerTestCase {
   }
 
   public void testDefaultUndefinedParameters() {
-    enableTypeCheck();
+    enableTypeCheck(CheckLevel.WARNING);
 
     test("function f(zero, one=undefined) {}", "function f(zero, one) {}");
 
diff --git a/test/com/google/javascript/jscomp/Es6ToEs3ConverterTest.java b/test/com/google/javascript/jscomp/Es6ToEs3ConverterTest.java
index dabd1699f..84a5529a3 100644
--- a/test/com/google/javascript/jscomp/Es6ToEs3ConverterTest.java
+++ b/test/com/google/javascript/jscomp/Es6ToEs3ConverterTest.java
@@ -726,7 +726,7 @@ public final class Es6ToEs3ConverterTest extends CompilerTestCase {
   }
 
   public void testInvalidClassUse() {
-    enableTypeCheck();
+    enableTypeCheck(CheckLevel.WARNING);
 
     test(
         EXTERNS_BASE,
@@ -950,7 +950,7 @@ public final class Es6ToEs3ConverterTest extends CompilerTestCase {
   }
 
   public void testClassEs5GetterSetterIncorrectTypes() {
-    enableTypeCheck();
+    enableTypeCheck(CheckLevel.WARNING);
     languageOut = LanguageMode.ECMASCRIPT5;
 
     // Using @type instead of @return on a getter.
@@ -1406,7 +1406,7 @@ public final class Es6ToEs3ConverterTest extends CompilerTestCase {
             "($jscomp$spread$args1 = G.d()).n.apply($jscomp$spread$args1,",
             "    [].concat(b));"));
 
-    enableTypeCheck();
+    enableTypeCheck(CheckLevel.WARNING);
 
     test(
         EXTERNS_BASE,
diff --git a/test/com/google/javascript/jscomp/FunctionTypeBuilderTest.java b/test/com/google/javascript/jscomp/FunctionTypeBuilderTest.java
index 6f2d62223..ae2224c6e 100644
--- a/test/com/google/javascript/jscomp/FunctionTypeBuilderTest.java
+++ b/test/com/google/javascript/jscomp/FunctionTypeBuilderTest.java
@@ -18,6 +18,7 @@ package com.google.javascript.jscomp;
 
 import static com.google.javascript.rhino.testing.BaseJSTypeTestCase.ALL_NATIVE_EXTERN_TYPES;
 
+import com.google.javascript.jscomp.CheckLevel;
 import com.google.javascript.rhino.Node;
 import com.google.javascript.rhino.jstype.FunctionType;
 import com.google.javascript.rhino.jstype.ObjectType;
@@ -32,7 +33,7 @@ public final class FunctionTypeBuilderTest extends CompilerTestCase {
 
   public FunctionTypeBuilderTest() {
     parseTypeInfo = true;
-    enableTypeCheck();
+    enableTypeCheck(CheckLevel.WARNING);
   }
 
   @Override
diff --git a/test/com/google/javascript/jscomp/GatherExternPropertiesTest.java b/test/com/google/javascript/jscomp/GatherExternPropertiesTest.java
index b35ba6dc4..03698c6bb 100644
--- a/test/com/google/javascript/jscomp/GatherExternPropertiesTest.java
+++ b/test/com/google/javascript/jscomp/GatherExternPropertiesTest.java
@@ -26,7 +26,7 @@ import com.google.common.collect.ImmutableSet;
 public final class GatherExternPropertiesTest extends CompilerTestCase {
   public GatherExternPropertiesTest() {
     super();
-    enableTypeCheck();
+    enableTypeCheck(CheckLevel.WARNING);
   }
 
   @Override
diff --git a/test/com/google/javascript/jscomp/ImplicitNullabilityCheckTest.java b/test/com/google/javascript/jscomp/ImplicitNullabilityCheckTest.java
index 813c8637c..675cbe3d9 100644
--- a/test/com/google/javascript/jscomp/ImplicitNullabilityCheckTest.java
+++ b/test/com/google/javascript/jscomp/ImplicitNullabilityCheckTest.java
@@ -22,7 +22,7 @@ public final class ImplicitNullabilityCheckTest extends CompilerTestCase {
   @Override
   protected void setUp() throws Exception {
     super.setUp();
-    super.enableTypeCheck();
+    super.enableTypeCheck(CheckLevel.WARNING);
   }
 
   @Override
diff --git a/test/com/google/javascript/jscomp/InlinePropertiesTest.java b/test/com/google/javascript/jscomp/InlinePropertiesTest.java
index 16355889e..9108ef5c8 100644
--- a/test/com/google/javascript/jscomp/InlinePropertiesTest.java
+++ b/test/com/google/javascript/jscomp/InlinePropertiesTest.java
@@ -31,7 +31,7 @@ public final class InlinePropertiesTest extends CompilerTestCase {
   public InlinePropertiesTest() {
     super(EXTERNS);
     enableNormalize();
-    enableTypeCheck();
+    enableTypeCheck(CheckLevel.WARNING);
     enableClosurePass();
     enableGatherExternProperties();
     compareJsDoc = false;
diff --git a/test/com/google/javascript/jscomp/NewTypeInferenceES5OrLowerTest.java b/test/com/google/javascript/jscomp/NewTypeInferenceES5OrLowerTest.java
index 57766c0a4..bc9613c11 100644
--- a/test/com/google/javascript/jscomp/NewTypeInferenceES5OrLowerTest.java
+++ b/test/com/google/javascript/jscomp/NewTypeInferenceES5OrLowerTest.java
@@ -7342,7 +7342,8 @@ public final class NewTypeInferenceES5OrLowerTest extends NewTypeInferenceTestBa
   }
 
   public void testInferredArrayGenerics() {
-    typeCheck("/** @const */ var x = [];");
+    typeCheck(
+        "/** @const */ var x = [];", GlobalTypeInfo.COULD_NOT_INFER_CONST_TYPE);
 
     typeCheck(
         "/** @const */ var x = [1, 'str'];",
@@ -7394,17 +7395,6 @@ public final class NewTypeInferenceES5OrLowerTest extends NewTypeInferenceTestBa
         "/** @const */ var x = [new Foo, new Foo];",
         "function g() { var /** Array<Bar> */ a = x; }"),
         NewTypeInference.MISTYPED_ASSIGN_RHS);
-
-    // [] is inferred as Array<?>, so we miss the warning here
-    typeCheck(Joiner.on('\n').join(
-        "/** @const */",
-        "var x = [];",
-        "function f() {",
-        "  x[0] = 'asdf';",
-        "}",
-        "function g() {",
-        "  return x[0] - 5;",
-        "}"));
   }
 
   public void testSpecializedInstanceofCantGoToBottom() {
@@ -7801,24 +7791,6 @@ public final class NewTypeInferenceES5OrLowerTest extends NewTypeInferenceTestBa
         "(/** @type {number} */ ('asdf'));",
         NewTypeInference.INVALID_CAST);
 
-    typeCheck(Joiner.on('\n').join(
-        "/**",
-        " * @template T",
-        " * @param {T} x",
-        " */",
-        "function f(x) {",
-        "  /** @type{!Object} */ (x);",
-        "}"));
-
-    typeCheck(Joiner.on('\n').join(
-        "/**",
-        " * @template T",
-        " * @param {T|string} x",
-        " */",
-        "function f(x) {",
-        "  /** @type{!Object} */ (x);",
-        "}"));
-
     typeCheck(Joiner.on('\n').join(
         "function f(/** (number|string) */ x) {",
         "  var y = /** @type {number} */ (x);",
diff --git a/test/com/google/javascript/jscomp/NewTypeInferenceES6Test.java b/test/com/google/javascript/jscomp/NewTypeInferenceES6Test.java
index 8cae88e4b..a92f9916f 100644
--- a/test/com/google/javascript/jscomp/NewTypeInferenceES6Test.java
+++ b/test/com/google/javascript/jscomp/NewTypeInferenceES6Test.java
@@ -63,8 +63,4 @@ public final class NewTypeInferenceES6Test extends NewTypeInferenceTestBase {
   public void testTaggedTemplateLitGlobalThisRef() {
     typeCheck("taggedTemp`${this.a}TaggedTemp`", NewTypeInference.GLOBAL_THIS);
   }
-
-  public void testConstEmptyArrayNoWarning() {
-    typeCheck("const x = [];");
-  }
 }
diff --git a/test/com/google/javascript/jscomp/PolymerPassTest.java b/test/com/google/javascript/jscomp/PolymerPassTest.java
index 28db0e459..b9c562903 100644
--- a/test/com/google/javascript/jscomp/PolymerPassTest.java
+++ b/test/com/google/javascript/jscomp/PolymerPassTest.java
@@ -153,7 +153,7 @@ public class PolymerPassTest extends Es6CompilerTestCase {
   protected void setUp() throws Exception {
     super.setUp();
     allowExternsChanges(true);
-    enableTypeCheck();
+    enableTypeCheck(CheckLevel.WARNING);
     runTypeCheckAfterProcessing = true;
     parseTypeInfo = true;
   }
diff --git a/test/com/google/javascript/jscomp/ProcessEs6ModulesTest.java b/test/com/google/javascript/jscomp/ProcessEs6ModulesTest.java
index c5f609997..698498b86 100644
--- a/test/com/google/javascript/jscomp/ProcessEs6ModulesTest.java
+++ b/test/com/google/javascript/jscomp/ProcessEs6ModulesTest.java
@@ -101,13 +101,21 @@ public final class ProcessEs6ModulesTest extends CompilerTestCase {
   public void testImport() {
     testModules(
         "import name from 'other'; use(name);",
-        LINE_JOINER.join("goog.require('module$other');", "use(module$other.default);"));
+        "goog.require('module$other'); use(module$other.default);");
 
     testModules("import {n as name} from 'other';", "goog.require('module$other');");
 
     testModules(
         "import x, {f as foo, b as bar} from 'other'; use(x);",
-        LINE_JOINER.join("goog.require('module$other');", "use(module$other.default);"));
+        "goog.require('module$other'); use(module$other.default);");
+
+    testModules(
+        "import {default as name} from 'other'; use(name);",
+        "goog.require('module$other'); use(module$other.default);");
+
+    testModules(
+        "import {class as name} from 'other'; use(name);",
+        "goog.require('module$other'); use(module$other.class);");
   }
 
   public void testImport_missing() {
@@ -179,6 +187,20 @@ public final class ProcessEs6ModulesTest extends CompilerTestCase {
             "var b$$module$testcode = 2;",
             "module$testcode.foo = f$$module$testcode;",
             "module$testcode.bar = b$$module$testcode;"));
+
+    testModules(
+        "var f = 1; export {f as default};",
+        LINE_JOINER.join(
+            "goog.provide('module$testcode');",
+            "var f$$module$testcode = 1;",
+            "module$testcode.default = f$$module$testcode;"));
+
+    testModules(
+        "var f = 1; export {f as class};",
+        LINE_JOINER.join(
+            "goog.provide('module$testcode');",
+            "var f$$module$testcode = 1;",
+            "module$testcode.class = f$$module$testcode;"));
   }
 
   public void testExportWithJsDoc() {
@@ -227,11 +249,16 @@ public final class ProcessEs6ModulesTest extends CompilerTestCase {
 
   public void testExportFrom() {
     testModules(
-        "export {name} from 'other';",
+        LINE_JOINER.join(
+            "export {name} from 'other';",
+            "export {default} from 'other';",
+            "export {class} from 'other';"),
         LINE_JOINER.join(
             "goog.provide('module$testcode');",
             "goog.require('module$other');",
-            "module$testcode.name = module$other.name;"));
+            "module$testcode.name = module$other.name;",
+            "module$testcode.default = module$other.default;",
+            "module$testcode.class = module$other.class;"));
 
     testModules(
         "export {a, b as c, d} from 'other';",
@@ -241,6 +268,27 @@ public final class ProcessEs6ModulesTest extends CompilerTestCase {
             "module$testcode.a = module$other.a;",
             "module$testcode.c = module$other.b;",
             "module$testcode.d = module$other.d;"));
+
+    testModules(
+        "export {a as b, b as a} from 'other';",
+        LINE_JOINER.join(
+            "goog.provide('module$testcode');",
+            "goog.require('module$other');",
+            "module$testcode.b = module$other.a;",
+            "module$testcode.a = module$other.b;"));
+
+    testModules(
+        LINE_JOINER.join(
+            "export {default as a} from 'other';",
+            "export {a as a2, default as b} from 'other';",
+            "export {class as switch} from 'other';"),
+        LINE_JOINER.join(
+            "goog.provide('module$testcode');",
+            "goog.require('module$other');",
+            "module$testcode.a = module$other.default;",
+            "module$testcode.a2 = module$other.a;",
+            "module$testcode.b = module$other.default;",
+            "module$testcode.switch = module$other.class;"));
   }
 
   public void testExportDefault() {
diff --git a/test/com/google/javascript/jscomp/PureFunctionIdentifierTest.java b/test/com/google/javascript/jscomp/PureFunctionIdentifierTest.java
index d2e68b81e..cc10bf70a 100644
--- a/test/com/google/javascript/jscomp/PureFunctionIdentifierTest.java
+++ b/test/com/google/javascript/jscomp/PureFunctionIdentifierTest.java
@@ -172,7 +172,7 @@ public final class PureFunctionIdentifierTest extends CompilerTestCase {
 
   public PureFunctionIdentifierTest() {
     super(kExterns);
-    enableTypeCheck();
+    enableTypeCheck(CheckLevel.ERROR);
   }
 
   @Override
diff --git a/test/com/google/javascript/jscomp/RemoveUnusedClassPropertiesTest.java b/test/com/google/javascript/jscomp/RemoveUnusedClassPropertiesTest.java
index aa2e68380..7450136b3 100644
--- a/test/com/google/javascript/jscomp/RemoveUnusedClassPropertiesTest.java
+++ b/test/com/google/javascript/jscomp/RemoveUnusedClassPropertiesTest.java
@@ -207,7 +207,7 @@ public final class RemoveUnusedClassPropertiesTest extends CompilerTestCase {
   }
 
   public void testConstructorProperty1() {
-    enableTypeCheck();
+    enableTypeCheck(CheckLevel.OFF);
 
     test(
         "/** @constructor */ function C() {} C.prop = 1;",
@@ -215,7 +215,7 @@ public final class RemoveUnusedClassPropertiesTest extends CompilerTestCase {
   }
 
   public void testConstructorProperty2() {
-    enableTypeCheck();
+    enableTypeCheck(CheckLevel.OFF);
 
     testSame(
         "/** @constructor */ function C() {} "
diff --git a/test/com/google/javascript/jscomp/ReplaceStringsTest.java b/test/com/google/javascript/jscomp/ReplaceStringsTest.java
index 82513412d..92b5830c0 100644
--- a/test/com/google/javascript/jscomp/ReplaceStringsTest.java
+++ b/test/com/google/javascript/jscomp/ReplaceStringsTest.java
@@ -91,7 +91,7 @@ public final class ReplaceStringsTest extends CompilerTestCase {
   protected void setUp() throws Exception {
     super.setUp();
     super.enableLineNumberCheck(false);
-    super.enableTypeCheck();
+    super.enableTypeCheck(CheckLevel.WARNING);
     functionsToInspect = defaultFunctionsToInspect;
     reserved = Collections.emptySet();
     previous = null;
diff --git a/test/com/google/javascript/jscomp/RuntimeTypeCheckTest.java b/test/com/google/javascript/jscomp/RuntimeTypeCheckTest.java
index ba782e431..ad97be5b5 100644
--- a/test/com/google/javascript/jscomp/RuntimeTypeCheckTest.java
+++ b/test/com/google/javascript/jscomp/RuntimeTypeCheckTest.java
@@ -28,7 +28,7 @@ public final class RuntimeTypeCheckTest extends CompilerTestCase {
 
   public RuntimeTypeCheckTest() {
     super("/** @const */ var undefined;");
-    enableTypeCheck();
+    enableTypeCheck(CheckLevel.WARNING);
   }
 
   @Override
diff --git a/test/com/google/javascript/jscomp/ScopedAliasesTest.java b/test/com/google/javascript/jscomp/ScopedAliasesTest.java
index d46689f0b..889964a19 100644
--- a/test/com/google/javascript/jscomp/ScopedAliasesTest.java
+++ b/test/com/google/javascript/jscomp/ScopedAliasesTest.java
@@ -424,7 +424,7 @@ public final class ScopedAliasesTest extends CompilerTestCase {
   }
 
   public void testJsDocNotIgnored() {
-    enableTypeCheck();
+    enableTypeCheck(CheckLevel.WARNING);
     runTypeCheckAfterProcessing = true;
 
     String externs =
@@ -597,7 +597,7 @@ public final class ScopedAliasesTest extends CompilerTestCase {
   }
 
   public void testJsDocRecord() {
-    enableTypeCheck();
+    enableTypeCheck(CheckLevel.WARNING);
     runTypeCheckAfterProcessing = true;
     test(
         LINE_JOINER.join(
@@ -725,7 +725,7 @@ public final class ScopedAliasesTest extends CompilerTestCase {
   }
 
   public void testInlineJsDoc() {
-    enableTypeCheck();
+    enableTypeCheck(CheckLevel.WARNING);
     runTypeCheckAfterProcessing = true;
     test(LINE_JOINER.join(
         "/** @const */ var ns = {};",
@@ -744,7 +744,7 @@ public final class ScopedAliasesTest extends CompilerTestCase {
   }
 
   public void testInlineReturn() {
-    enableTypeCheck();
+    enableTypeCheck(CheckLevel.WARNING);
     runTypeCheckAfterProcessing = true;
     test(LINE_JOINER.join(
         "/** @const */ var ns = {};",
@@ -764,7 +764,7 @@ public final class ScopedAliasesTest extends CompilerTestCase {
   }
 
   public void testInlineParam() {
-    enableTypeCheck();
+    enableTypeCheck(CheckLevel.WARNING);
     runTypeCheckAfterProcessing = true;
     test(LINE_JOINER.join(
         "/** @const */ var ns = {};",
@@ -967,7 +967,7 @@ public final class ScopedAliasesTest extends CompilerTestCase {
   }
 
   public void testTypeCheck() {
-    enableTypeCheck();
+    enableTypeCheck(CheckLevel.WARNING);
     runTypeCheckAfterProcessing = true;
 
     test(
diff --git a/test/com/google/javascript/jscomp/StrictModeCheckTest.java b/test/com/google/javascript/jscomp/StrictModeCheckTest.java
index 6f39ba1bb..7eeae08ef 100644
--- a/test/com/google/javascript/jscomp/StrictModeCheckTest.java
+++ b/test/com/google/javascript/jscomp/StrictModeCheckTest.java
@@ -28,7 +28,7 @@ public final class StrictModeCheckTest extends Es6CompilerTestCase {
   @Override
   protected void setUp() throws Exception {
     super.setUp();
-    enableTypeCheck();
+    enableTypeCheck(CheckLevel.OFF);
   }
 
   @Override
diff --git a/test/com/google/javascript/jscomp/TypeCheckFunctionCheckTest.java b/test/com/google/javascript/jscomp/TypeCheckFunctionCheckTest.java
index 2e980e82e..c2ef49d2f 100644
--- a/test/com/google/javascript/jscomp/TypeCheckFunctionCheckTest.java
+++ b/test/com/google/javascript/jscomp/TypeCheckFunctionCheckTest.java
@@ -16,10 +16,11 @@
 
 package com.google.javascript.jscomp;
 
+import static com.google.javascript.jscomp.TypeCheck.WRONG_ARGUMENT_COUNT;
 import static com.google.javascript.jscomp.FunctionTypeBuilder.OPTIONAL_ARG_AT_END;
 import static com.google.javascript.jscomp.FunctionTypeBuilder.VAR_ARGS_MUST_BE_LAST;
-import static com.google.javascript.jscomp.TypeCheck.WRONG_ARGUMENT_COUNT;
 
+import com.google.javascript.jscomp.CheckLevel;
 import com.google.javascript.rhino.Node;
 
 /**
@@ -32,7 +33,7 @@ public final class TypeCheckFunctionCheckTest extends CompilerTestCase {
 
   public TypeCheckFunctionCheckTest() {
     parseTypeInfo = true;
-    enableTypeCheck();
+    enableTypeCheck(CheckLevel.ERROR);
   }
 
   @Override protected CompilerPass getProcessor(Compiler compiler) {
diff --git a/test/com/google/javascript/jscomp/TypeCheckTest.java b/test/com/google/javascript/jscomp/TypeCheckTest.java
index c9ed6e7ab..f2688f798 100644
--- a/test/com/google/javascript/jscomp/TypeCheckTest.java
+++ b/test/com/google/javascript/jscomp/TypeCheckTest.java
@@ -42,6 +42,8 @@ import java.util.Set;
 
 public final class TypeCheckTest extends CompilerTypeTestCase {
 
+  private CheckLevel reportMissingOverrides = CheckLevel.WARNING;
+
   private static final Joiner LINE_JOINER = Joiner.on("\n");
   private static final String SUGGESTION_CLASS =
       "/** @constructor\n */\n"
@@ -53,6 +55,7 @@ public final class TypeCheckTest extends CompilerTypeTestCase {
   @Override
   public void setUp() {
     super.setUp();
+    reportMissingOverrides = CheckLevel.WARNING;
   }
 
   public void testInitialTypingScope() {
@@ -5532,13 +5535,16 @@ public final class TypeCheckTest extends CompilerTypeTestCase {
   }
 
   public void testInferredReturn8() throws Exception {
+    reportMissingOverrides = CheckLevel.OFF;
     testTypes(
-        "/** @constructor */ function Foo() {}"
-            + "/** @param {number} x */ Foo.prototype.bar = function(x) {};"
-            + "/** @constructor \n * @extends {Foo} */ function SubFoo() {}"
-            + "/** @override @param {number} x */ SubFoo.prototype.bar = "
-            + "    function(x) { return 3; }",
-        "inconsistent return type\n" + "found   : number\n" + "required: undefined");
+        "/** @constructor */ function Foo() {}" +
+        "/** @param {number} x */ Foo.prototype.bar = function(x) {};" +
+        "/** @constructor \n * @extends {Foo} */ function SubFoo() {}" +
+        "/** @param {number} x */ SubFoo.prototype.bar = " +
+        "    function(x) { return 3; }",
+        "inconsistent return type\n" +
+        "found   : number\n" +
+        "required: undefined");
   }
 
   public void testInferredParam1() throws Exception {
@@ -5553,70 +5559,75 @@ public final class TypeCheckTest extends CompilerTypeTestCase {
   }
 
   public void testInferredParam2() throws Exception {
+    reportMissingOverrides = CheckLevel.OFF;
     testTypes(
-        "/** @param {string} x */ function f(x) {}"
-            + "/** @constructor */ function Foo() {}"
-            + "/** @param {number} x */ Foo.prototype.bar = function(x) {};"
-            + "/** @constructor \n * @extends {Foo} */ function SubFoo() {}"
-            + "/** @override @return {void} */ SubFoo.prototype.bar = "
-            + "    function(x) { f(x); }",
-        "actual parameter 1 of f does not match formal parameter\n"
-            + "found   : number\n"
-            + "required: string");
+        "/** @param {string} x */ function f(x) {}" +
+        "/** @constructor */ function Foo() {}" +
+        "/** @param {number} x */ Foo.prototype.bar = function(x) {};" +
+        "/** @constructor \n * @extends {Foo} */ function SubFoo() {}" +
+        "/** @return {void} */ SubFoo.prototype.bar = " +
+        "    function(x) { f(x); }",
+        "actual parameter 1 of f does not match formal parameter\n" +
+        "found   : number\n" +
+        "required: string");
   }
 
   public void testInferredParam3() throws Exception {
+    reportMissingOverrides = CheckLevel.OFF;
     testTypes(
-        "/** @param {string} x */ function f(x) {}"
-            + "/** @constructor */ function Foo() {}"
-            + "/** @param {number=} x */ Foo.prototype.bar = function(x) {};"
-            + "/** @constructor \n * @extends {Foo} */ function SubFoo() {}"
-            + "/** @override @return {void} */ SubFoo.prototype.bar = "
-            + "    function(x) { f(x); }; (new SubFoo()).bar();",
-        "actual parameter 1 of f does not match formal parameter\n"
-            + "found   : (number|undefined)\n"
-            + "required: string");
+        "/** @param {string} x */ function f(x) {}" +
+        "/** @constructor */ function Foo() {}" +
+        "/** @param {number=} x */ Foo.prototype.bar = function(x) {};" +
+        "/** @constructor \n * @extends {Foo} */ function SubFoo() {}" +
+        "/** @return {void} */ SubFoo.prototype.bar = " +
+        "    function(x) { f(x); }; (new SubFoo()).bar();",
+        "actual parameter 1 of f does not match formal parameter\n" +
+        "found   : (number|undefined)\n" +
+        "required: string");
   }
 
   public void testInferredParam4() throws Exception {
+    reportMissingOverrides = CheckLevel.OFF;
     testTypes(
-        "/** @param {string} x */ function f(x) {}"
-            + "/** @constructor */ function Foo() {}"
-            + "/** @param {...number} x */ Foo.prototype.bar = function(x) {};"
-            + "/** @constructor \n * @extends {Foo} */ function SubFoo() {}"
-            + "/** @override @return {void} */ SubFoo.prototype.bar = "
-            + "    function(x) { f(x); }; (new SubFoo()).bar();",
-        "actual parameter 1 of f does not match formal parameter\n"
-            + "found   : (number|undefined)\n"
-            + "required: string");
+        "/** @param {string} x */ function f(x) {}" +
+        "/** @constructor */ function Foo() {}" +
+        "/** @param {...number} x */ Foo.prototype.bar = function(x) {};" +
+        "/** @constructor \n * @extends {Foo} */ function SubFoo() {}" +
+        "/** @return {void} */ SubFoo.prototype.bar = " +
+        "    function(x) { f(x); }; (new SubFoo()).bar();",
+        "actual parameter 1 of f does not match formal parameter\n" +
+        "found   : (number|undefined)\n" +
+        "required: string");
   }
 
   public void testInferredParam5() throws Exception {
+    reportMissingOverrides = CheckLevel.OFF;
     testTypes(
-        "/** @param {string} x */ function f(x) {}"
-            + "/** @constructor */ function Foo() {}"
-            + "/** @param {...number} x */ Foo.prototype.bar = function(x) {};"
-            + "/** @constructor \n * @extends {Foo} */ function SubFoo() {}"
-            + "/** @override @param {number=} x \n * @param {...number} y  */ "
-            + "SubFoo.prototype.bar = "
-            + "    function(x, y) { f(x); }; (new SubFoo()).bar();",
-        "actual parameter 1 of f does not match formal parameter\n"
-            + "found   : (number|undefined)\n"
-            + "required: string");
+        "/** @param {string} x */ function f(x) {}" +
+        "/** @constructor */ function Foo() {}" +
+        "/** @param {...number} x */ Foo.prototype.bar = function(x) {};" +
+        "/** @constructor \n * @extends {Foo} */ function SubFoo() {}" +
+        "/** @param {number=} x \n * @param {...number} y  */ " +
+        "SubFoo.prototype.bar = " +
+        "    function(x, y) { f(x); }; (new SubFoo()).bar();",
+        "actual parameter 1 of f does not match formal parameter\n" +
+        "found   : (number|undefined)\n" +
+        "required: string");
   }
 
   public void testInferredParam6() throws Exception {
+    reportMissingOverrides = CheckLevel.OFF;
     testTypes(
-        "/** @param {string} x */ function f(x) {}"
-            + "/** @constructor */ function Foo() {}"
-            + "/** @param {number=} x */ Foo.prototype.bar = function(x) {};"
-            + "/** @constructor \n * @extends {Foo} */ function SubFoo() {}"
-            + "/** @override @param {number=} x \n * @param {number=} y */ "
-            + "SubFoo.prototype.bar = "
-            + "    function(x, y) { f(y); };",
-        "actual parameter 1 of f does not match formal parameter\n"
-            + "found   : (number|undefined)\n"
-            + "required: string");
+        "/** @param {string} x */ function f(x) {}" +
+        "/** @constructor */ function Foo() {}" +
+        "/** @param {number=} x */ Foo.prototype.bar = function(x) {};" +
+        "/** @constructor \n * @extends {Foo} */ function SubFoo() {}" +
+        "/** @param {number=} x \n * @param {number=} y */ " +
+        "SubFoo.prototype.bar = " +
+        "    function(x, y) { f(y); };",
+        "actual parameter 1 of f does not match formal parameter\n" +
+        "found   : (number|undefined)\n" +
+        "required: string");
   }
 
   public void testInferredParam7() throws Exception {
@@ -6774,26 +6785,27 @@ public final class TypeCheckTest extends CompilerTypeTestCase {
   }
 
   public void testIssue537d() throws Exception {
+    reportMissingOverrides = CheckLevel.OFF;
     testTypes(
-        "/** @constructor */ function Foo() {}"
-            + "Foo.prototype = {"
-            + "  /** @return {Bar} */ x: function() { new Bar(); },"
-            + "  /** @return {Foo} */ y: function() { new Bar(); }"
-            + "};"
-            + "/**\n"
-            + " * @constructor\n"
-            + " * @extends {Foo}\n"
-            + " */\n"
-            + "function Bar() {"
-            + "  this.xy = 3;"
-            + "}"
-            + "/** @return {Bar} */ function f() { return new Bar(); }"
-            + "/** @return {Foo} */ function g() { return new Bar(); }"
-            + "Bar.prototype = {"
-            + "  /** @override @return {Bar} */ x: function() { new Bar(); },"
-            + "  /** @override @return {Foo} */ y: function() { new Bar(); }"
-            + "};"
-            + "Bar.prototype.__proto__ = Foo.prototype;");
+        "/** @constructor */ function Foo() {}" +
+        "Foo.prototype = {" +
+        "  /** @return {Bar} */ x: function() { new Bar(); }," +
+        "  /** @return {Foo} */ y: function() { new Bar(); }" +
+        "};" +
+        "/**\n" +
+        " * @constructor\n" +
+        " * @extends {Foo}\n" +
+        " */\n" +
+        "function Bar() {" +
+        "  this.xy = 3;" +
+        "}" +
+        "/** @return {Bar} */ function f() { return new Bar(); }" +
+        "/** @return {Foo} */ function g() { return new Bar(); }" +
+        "Bar.prototype = {" +
+        "  /** @return {Bar} */ x: function() { new Bar(); }," +
+        "  /** @return {Foo} */ y: function() { new Bar(); }" +
+        "};" +
+        "Bar.prototype.__proto__ = Foo.prototype;");
   }
 
   public void testIssue586() throws Exception {
@@ -9511,16 +9523,17 @@ public final class TypeCheckTest extends CompilerTypeTestCase {
   public void testInheritanceCheck17() throws Exception {
     // Make sure this warning still works, even when there's no
     // @override tag.
+    reportMissingOverrides = CheckLevel.OFF;
     testTypes(
-        "var goog = {};"
-            + "/** @constructor */goog.Super = function() {};"
-            + "/** @param {number} x */ goog.Super.prototype.foo = function(x) {};"
-            + "/** @constructor\n @extends {goog.Super} */goog.Sub = function() {};"
-            + "/** @override @param {string} x */ goog.Sub.prototype.foo = function(x) {};",
-        "mismatch of the foo property type and the type of the property it "
-            + "overrides from superclass goog.Super\n"
-            + "original: function (this:goog.Super, number): undefined\n"
-            + "override: function (this:goog.Sub, string): undefined");
+        "var goog = {};" +
+        "/** @constructor */goog.Super = function() {};" +
+        "/** @param {number} x */ goog.Super.prototype.foo = function(x) {};" +
+        "/** @constructor\n @extends {goog.Super} */goog.Sub = function() {};" +
+        "/** @param {string} x */ goog.Sub.prototype.foo = function(x) {};",
+        "mismatch of the foo property type and the type of the property it " +
+        "overrides from superclass goog.Super\n" +
+        "original: function (this:goog.Super, number): undefined\n" +
+        "override: function (this:goog.Sub, string): undefined");
   }
 
   public void testInterfacePropertyOverride1() throws Exception {
@@ -10006,19 +10019,18 @@ public final class TypeCheckTest extends CompilerTypeTestCase {
   }
 
   public void testDataPropertyOnInterface2() throws Exception {
-    testTypes(
-        "/** @interface */ function T() {};\n"
-            + "/** @type {number} */T.prototype.x;\n"
-            + "/** @constructor \n"
-            + " *  @implements {T} \n"
-            + " */\n"
-            + "function C() {}\n"
-            + "/** @override */\n"
-            + "C.prototype.x = 'foo';",
-        "mismatch of the x property type and the type of the property it "
-            + "overrides from interface T\n"
-            + "original: number\n"
-            + "override: string");
+    reportMissingOverrides = CheckLevel.OFF;
+    testTypes("/** @interface */ function T() {};\n" +
+        "/** @type {number} */T.prototype.x;\n" +
+        "/** @constructor \n" +
+        " *  @implements {T} \n" +
+        " */\n" +
+        "function C() {}\n" +
+        "C.prototype.x = 'foo';",
+        "mismatch of the x property type and the type of the property it " +
+        "overrides from interface T\n" +
+        "original: number\n" +
+        "override: string");
   }
 
   public void testDataPropertyOnInterface3() throws Exception {
@@ -11299,20 +11311,23 @@ public final class TypeCheckTest extends CompilerTypeTestCase {
   }
 
   public void testLends11() throws Exception {
+    reportMissingOverrides = CheckLevel.OFF;
     testTypes(
-        "function defineClass(x, y) { return function() {}; } "
-            + "/** @constructor */"
-            + "var Foo = function() {};"
-            + "/** @return {*} */ Foo.prototype.bar = function() { return 3; };"
-            + "/**\n"
-            + " * @constructor\n"
-            + " * @extends {Foo}\n"
-            + " */\n"
-            + "var SubFoo = defineClass(Foo, "
-            + "    /** @lends {SubFoo.prototype} */ ({\n"
-            + "      /** @override @return {number} */ bar: function() { return 3; }}));"
-            + "/** @return {string} */ function f() { return (new SubFoo()).bar(); }",
-        "inconsistent return type\n" + "found   : number\n" + "required: string");
+        "function defineClass(x, y) { return function() {}; } " +
+        "/** @constructor */" +
+        "var Foo = function() {};" +
+        "/** @return {*} */ Foo.prototype.bar = function() { return 3; };" +
+        "/**\n" +
+        " * @constructor\n" +
+        " * @extends {Foo}\n" +
+        " */\n" +
+        "var SubFoo = defineClass(Foo, " +
+        "    /** @lends {SubFoo.prototype} */ ({\n" +
+        "      /** @return {number} */ bar: function() { return 3; }}));" +
+        "/** @return {string} */ function f() { return (new SubFoo()).bar(); }",
+        "inconsistent return type\n" +
+        "found   : number\n" +
+        "required: string");
   }
 
   public void testDeclaredNativeTypeEquality() throws Exception {
@@ -13962,10 +13977,14 @@ public final class TypeCheckTest extends CompilerTypeTestCase {
   public void testStructuralInterfaceMatching3() throws Exception {
     testTypesWithExtraExterns(
         LINE_JOINER.join(
-            "/** @record */",
+            "/**",
+            " * @record",
+            " */",
             "function I1() {}",
             "",
-            "/** @record */",
+            "/**",
+            " * @record",
+            " */",
             "function I2() {}"),
         LINE_JOINER.join(
             "/** @type {I1} */",
@@ -13979,10 +13998,14 @@ public final class TypeCheckTest extends CompilerTypeTestCase {
   public void testStructuralInterfaceMatching4_1() throws Exception {
     testTypesWithExtraExterns(
         LINE_JOINER.join(
-            "/** @record */",
+            "/**",
+            " * @record",
+            " */",
             "function I1() {}",
             "",
-            "/** @record */",
+            "/**",
+            " * @record",
+            " */",
             "function I2() {}"),
         LINE_JOINER.join(
             "/** @type {I1} */",
@@ -13996,10 +14019,14 @@ public final class TypeCheckTest extends CompilerTypeTestCase {
   public void testStructuralInterfaceMatching5_1() throws Exception {
     testTypesWithExtraExterns(
         LINE_JOINER.join(
-            "/** @record */",
+            "/**",
+            " * @record",
+            " */",
             "function I1() {}",
             "",
-            "/** @interface */",
+            "/**",
+            " * @interface",
+            " */",
             "function I3() {}",
             "/** @type {number} */",
             "I3.prototype.length;"),
@@ -14014,7 +14041,9 @@ public final class TypeCheckTest extends CompilerTypeTestCase {
   public void testStructuralInterfaceMatching7_1() throws Exception {
     testTypesWithExtraExterns(
         LINE_JOINER.join(
-            "/** @record */",
+            "/**",
+            " * @record",
+            " */",
             "function I1() {}",
             "",
             "/** @constructor */",
@@ -14056,7 +14085,9 @@ public final class TypeCheckTest extends CompilerTypeTestCase {
   public void testStructuralInterfaceMatching11_1() throws Exception {
     testTypesWithExtraExterns(
         LINE_JOINER.join(
-            "/** @interface */",
+            "/**",
+            " * @interface",
+            " */",
             "function I3() {}",
             "/** @type {number} */",
             "I3.prototype.length;",
@@ -14162,7 +14193,9 @@ public final class TypeCheckTest extends CompilerTypeTestCase {
   public void testStructuralInterfaceMatching15() throws Exception {
     testTypesWithExtraExterns(
         LINE_JOINER.join(
-            "/** @record */",
+            "/**",
+            " * @record",
+            " */",
             "function I5() {}",
             "/** @type {I5} */",
             "I5.prototype.next;",
@@ -14172,7 +14205,9 @@ public final class TypeCheckTest extends CompilerTypeTestCase {
             "/** @type {C6} */",
             "C6.prototype.next;",
             "",
-            "/** @constructor */",
+            "/**",
+            " * @constructor",
+            " */",
             "function C5() {}",
             "/** @type {C6} */",
             "C5.prototype.next;"),
@@ -14191,7 +14226,9 @@ public final class TypeCheckTest extends CompilerTypeTestCase {
    */
   private static final String EXTERNS_FOR_LONG_MATCHING_CHAIN_RECORD =
       LINE_JOINER.join(
-          "/** @record */",
+          "/**",
+          " * @record",
+          " */",
           "function I5() {}",
           "/** @type {I5} */",
           "I5.prototype.next;",
@@ -14226,7 +14263,9 @@ public final class TypeCheckTest extends CompilerTypeTestCase {
           "/** @type {C6_4} */",
           "C6_5.prototype.next;",
           "",
-          "/** @constructor */",
+          "/**",
+          " * @constructor",
+          " */",
           "function C5() {}",
           "/** @type {C6_5} */",
           "C5.prototype.next;");
@@ -14279,7 +14318,9 @@ public final class TypeCheckTest extends CompilerTypeTestCase {
    */
   private static final String EXTERNS_FOR_LONG_NONMATCHING_CHAIN =
       LINE_JOINER.join(
-          "/** @record */",
+          "/**",
+          " * @record",
+          " */",
           "function I5() {}",
           "/** @type {I5} */",
           "I5.prototype.next;",
@@ -14314,7 +14355,9 @@ public final class TypeCheckTest extends CompilerTypeTestCase {
           "/** @type {C6_4} */",
           "C6_5.prototype.next;",
           "",
-          "/** @interface */",
+          "/**",
+          " * @interface",
+          " */",
           "function C5() {}",
           "/** @type {C6_5} */",
           "C5.prototype.next;");
@@ -14381,12 +14424,16 @@ public final class TypeCheckTest extends CompilerTypeTestCase {
         // I5 and C5 shares the same type structure
         LINE_JOINER.join(
             EXTERNS_FOR_LONG_MATCHING_CHAIN_RECORD,
-            "/** @record */",
+            "/**",
+            " * @record",
+            " */",
             "function I7() {}",
             "/** @type{function(): I5} */",
             "I7.prototype.getElement = function(){};",
             "",
-            "/** @constructor */",
+            "/**",
+            " * @constructor",
+            " */",
             "function C7() {}",
             "/** @type{function(): C5} */",
             "C7.prototype.getElement = function(){};"),
@@ -14410,12 +14457,16 @@ public final class TypeCheckTest extends CompilerTypeTestCase {
         // the type structure of I5 and C5 are different
         LINE_JOINER.join(
             EXTERNS_FOR_LONG_NONMATCHING_CHAIN,
-            "/** @record */",
+            "/**",
+            " * @record",
+            " */",
             "function I7() {}",
             "/** @type{function(): I5} */",
             "I7.prototype.getElement = function(){};",
             "",
-            "/** @constructor */",
+            "/**",
+            " * @constructor",
+            " */",
             "function C7() {}",
             "/** @type{function(): C5} */",
             "C7.prototype.getElement = function(){};"),
@@ -14443,12 +14494,16 @@ public final class TypeCheckTest extends CompilerTypeTestCase {
         // I5 and C5 shares the same type structure
         LINE_JOINER.join(
             EXTERNS_FOR_LONG_MATCHING_CHAIN_RECORD,
-            "/** @record */",
+            "/**",
+            " * @record",
+            " */",
             "function I7() {}",
             "/** @type{function(C5): I5} */",
             "I7.prototype.getElement = function(){};",
             "",
-            "/** @constructor */",
+            "/**",
+            " * @constructor",
+            " */",
             "function C7() {}",
             "/** @type{function(I5): C5} */",
             "C7.prototype.getElement = function(){};"),
@@ -14472,12 +14527,16 @@ public final class TypeCheckTest extends CompilerTypeTestCase {
         // I5 and C5 shares the same type structure
         LINE_JOINER.join(
             EXTERNS_FOR_LONG_MATCHING_CHAIN_RECORD,
-            "/** @record */",
+            "/**",
+            " * @record",
+            " */",
             "function I7() {}",
             "/** @type{function(C5, C5, I5): I5} */",
             "I7.prototype.getElement = function(){};",
             "",
-            "/** @constructor */",
+            "/**",
+            " * @constructor",
+            " */",
             "function C7() {}",
             "/** @type{function(I5, C5): C5} */",
             "C7.prototype.getElement = function(){};"),
@@ -14501,12 +14560,16 @@ public final class TypeCheckTest extends CompilerTypeTestCase {
         // I5 and C5 shares the same type structure
         LINE_JOINER.join(
             EXTERNS_FOR_LONG_MATCHING_CHAIN_RECORD,
-            "/** @record */",
+            "/**",
+            " * @record",
+            " */",
             "function I7() {}",
             "/** @type{function(C5, C5, I5=): I5} */",
             "I7.prototype.getElement = function(){};",
             "",
-            "/** @constructor */",
+            "/**",
+            " * @constructor",
+            " */",
             "function C7() {}",
             "/** @type{function(I5, C5=, I5=): C5} */",
             "C7.prototype.getElement = function(){};"),
@@ -14532,7 +14595,9 @@ public final class TypeCheckTest extends CompilerTypeTestCase {
             "/** @type{function(this:I5, C5, C5, I5=): I5} */",
             "I7.prototype.getElement = function(){};",
             "",
-            "/** @constructor */",
+            "/**",
+            " * @constructor",
+            " */",
             "function C7() {}",
             "/** @type{function(this:C5, I5, C5=, I5=): C5} */",
             "C7.prototype.getElement = function(){};"),
@@ -14553,12 +14618,16 @@ public final class TypeCheckTest extends CompilerTypeTestCase {
         // I5 and C5 shares the same type structure
         LINE_JOINER.join(
             EXTERNS_FOR_LONG_MATCHING_CHAIN_RECORD,
-            "/** @record */",
+            "/**",
+            " * @record",
+            " */",
             "function I7() {}",
             "/** @type{function(this:C5, C5, C5, I5=): I5} */",
             "I7.prototype.getElement = function(){};",
             "",
-            "/** @constructor */",
+            "/**",
+            " * @constructor",
+            " */",
             "function C7() {}",
             "/** @type{function(this:I5, I5, C5=, I5=): C5} */",
             "C7.prototype.getElement = function(){};"),
@@ -14579,12 +14648,16 @@ public final class TypeCheckTest extends CompilerTypeTestCase {
         LINE_JOINER.join(
             "/** @record */ function I5() {}",
             "/** @constructor @implements {I5} */ function C5() {}",
-            "/** @record */",
+            "/**",
+            " * @record",
+            " */",
             "function I7() {}",
             "/** @type{function(this:C5, C5, C5, I5=): I5} */",
             "I7.prototype.getElement = function(){};",
             "",
-            "/** @constructor */",
+            "/**",
+            " * @constructor",
+            " */",
             "function C7() {}",
             "/** @type{function(this:I5, I5, C5=, I5=): C5} */",
             "C7.prototype.getElement = function(){};"),
@@ -14605,12 +14678,16 @@ public final class TypeCheckTest extends CompilerTypeTestCase {
         LINE_JOINER.join(
             "/** @interface */ function I5() {}",
             "/** @constructor @implements {I5} */ function C5() {}",
-            "/** @record */",
+            "/**",
+            " * @record",
+            " */",
             "function I7() {}",
             "/** @type{function(this:C5, C5, C5, I5=): I5} */",
             "I7.prototype.getElement = function(){};",
             "",
-            "/** @constructor */",
+            "/**",
+            " * @constructor",
+            " */",
             "function C7() {}",
             "/** @type{function(this:I5, I5, C5=, I5=): C5} */",
             "C7.prototype.getElement = function(){};"),
@@ -14633,12 +14710,16 @@ public final class TypeCheckTest extends CompilerTypeTestCase {
         LINE_JOINER.join(
             "/** @interface */ function I5() {}",
             "/** @constructor */ function C5() {}",
-            "/** @record */",
+            "/**",
+            " * @record",
+            " */",
             "function I7() {}",
             "/** @type{function(this:C5, C5, C5, I5=): I5} */",
             "I7.prototype.getElement = function(){};",
             "",
-            "/** @constructor */",
+            "/**",
+            " * @constructor",
+            " */",
             "function C7() {}",
             "/** @type{function(this:I5, I5, C5=, I5=): C5} */",
             "C7.prototype.getElement = function(){};"),
@@ -14661,12 +14742,16 @@ public final class TypeCheckTest extends CompilerTypeTestCase {
         LINE_JOINER.join(
             "/** @record */ function I5() {}",
             "/** @constructor */ function C5() {}",
-            "/** @record */",
+            "/**",
+            " * @record",
+            " */",
             "function I7() {}",
             "/** @type{function(this:C5, C5, C5, I5=): I5} */",
             "I7.prototype.getElement = function(){};",
             "",
-            "/** @constructor */",
+            "/**",
+            " * @constructor",
+            " */",
             "function C7() {}",
             "/** @type{function(this:I5, I5, C5=, I5=): C5} */",
             "C7.prototype.getElement = function(){};"),
@@ -14688,12 +14773,16 @@ public final class TypeCheckTest extends CompilerTypeTestCase {
         LINE_JOINER.join(
             "/** @record */ function I5() {}",
             "/** @constructor @implements {I5} */ function C5() {}",
-            "/** @record */",
+            "/**",
+            " * @record",
+            " */",
             "function I7() {}",
             "/** @type{function(this:I5, C5, C5, I5=): I5} */",
             "I7.prototype.getElement = function(){};",
             "",
-            "/** @constructor */",
+            "/**",
+            " * @constructor",
+            " */",
             "function C7() {}",
             "/** @type{function(this:C5, I5, C5=, I5=): C5} */",
             "C7.prototype.getElement = function(){};"),
@@ -14715,12 +14804,16 @@ public final class TypeCheckTest extends CompilerTypeTestCase {
         LINE_JOINER.join(
             "/** @interface */ function I5() {}",
             "/** @constructor */ function C5() {}",
-            "/** @record */",
+            "/**",
+            " * @record",
+            " */",
             "function I7() {}",
             "/** @type{function(this:I5, C5, C5, I5=): I5} */",
             "I7.prototype.getElement = function(){};",
             "",
-            "/** @constructor */",
+            "/**",
+            " * @constructor",
+            " */",
             "function C7() {}",
             "/** @type{function(this:C5, I5, C5=, I5=): C5} */",
             "C7.prototype.getElement = function(){};"),
@@ -14748,12 +14841,16 @@ public final class TypeCheckTest extends CompilerTypeTestCase {
         // I5 and C5 shares the same type structure
         LINE_JOINER.join(
             EXTERNS_FOR_LONG_MATCHING_CHAIN_RECORD,
-            "/** @record */",
+            "/**",
+            " * @record",
+            " */",
             "function I7() {}",
             "/** @type{function(this:C5, C5, C5, I5=): I5} */",
             "I7.prototype.getElement = function(){};",
             "",
-            "/** @constructor */",
+            "/**",
+            " * @constructor",
+            " */",
             "function C7() {}",
             "/** @type{function(this:I5, I5, C5=, I5=): C5} */",
             "C7.prototype.getElement = function(){};"),
@@ -14774,12 +14871,16 @@ public final class TypeCheckTest extends CompilerTypeTestCase {
         // I5 and C5 shares the same type structure
         LINE_JOINER.join(
             EXTERNS_FOR_LONG_MATCHING_CHAIN_RECORD,
-            "/** @record */",
+            "/**",
+            " * @record",
+            " */",
             "function I7() {}",
             "/** @type{function(this:C5, C5, C5, I5=): I5} */",
             "I7.prototype.getElement = function(){};",
             "",
-            "/** @constructor */",
+            "/**",
+            " * @constructor",
+            " */",
             "function C7() {}",
             "/** @type{function(this:I5, I5, C5=, I5=): C5} */",
             "C7.prototype.getElement = function(){};"),
@@ -14799,12 +14900,16 @@ public final class TypeCheckTest extends CompilerTypeTestCase {
         // I5 and C5 shares the same type structure
         LINE_JOINER.join(
             EXTERNS_FOR_LONG_MATCHING_CHAIN_RECORD,
-            "/** @record */",
+            "/**",
+            " * @record",
+            " */",
             "function I7() {}",
             "/** @type{function(this:C5, C5, C5, I5=): I5} */",
             "I7.prototype.getElement = function(){};",
             "",
-            "/** @constructor */",
+            "/**",
+            " * @constructor",
+            " */",
             "function C7() {}",
             "/** @type{function(this:I5, I5, C5=, I5=): C5} */",
             "C7.prototype.getElement = function(){};"),
@@ -14825,12 +14930,16 @@ public final class TypeCheckTest extends CompilerTypeTestCase {
         // I5 and C5 shares the same type structure
         LINE_JOINER.join(
             EXTERNS_FOR_LONG_MATCHING_CHAIN_RECORD,
-            "/** @record */",
+            "/**",
+            " * @record",
+            " */",
             "function I7() {}",
             "/** @type{function(this:C5, C5, C5, I5=): I5} */",
             "I7.prototype.getElement = function(){};",
             "",
-            "/** @constructor */",
+            "/**",
+            " * @constructor",
+            " */",
             "function C7() {}",
             "/** @type{function(this:I5, I5, C5=, I5=): C5} */",
             "C7.prototype.getElement = function(){};"),
@@ -14852,12 +14961,16 @@ public final class TypeCheckTest extends CompilerTypeTestCase {
         // I5 and C5 shares the same type structure
         LINE_JOINER.join(
             EXTERNS_FOR_LONG_MATCHING_CHAIN_RECORD,
-            "/** @record */",
+            "/**",
+            " * @record",
+            " */",
             "function I7() {}",
             "/** @type{function(this:C5, C5, C5, I5=): I5} */",
             "I7.prototype.getElement = function(){};",
             "",
-            "/** @constructor */",
+            "/**",
+            " * @constructor",
+            " */",
             "function C7() {}",
             "/** @type{function(this:I5, I5, C5=, I5=): C5} */",
             "C7.prototype.getElement = function(){};"),
@@ -14880,12 +14993,16 @@ public final class TypeCheckTest extends CompilerTypeTestCase {
         // the type structure of I5 and C5 are different
         LINE_JOINER.join(
             EXTERNS_FOR_LONG_NONMATCHING_CHAIN,
-            "/** @record */",
+            "/**",
+            " * @record",
+            " */",
             "function I7() {}",
             "/** @type{function(this:C5, C5, C5, I5=): I5} */",
             "I7.prototype.getElement = function(){};",
             "",
-            "/** @constructor */",
+            "/**",
+            " * @constructor",
+            " */",
             "function C7() {}",
             "/** @type{function(this:I5, I5, C5=, I5=): C5} */",
             "C7.prototype.getElement = function(){};"),
@@ -15251,12 +15368,16 @@ public final class TypeCheckTest extends CompilerTypeTestCase {
         // I5 and C5 shares the same type structure
         LINE_JOINER.join(
             EXTERNS_FOR_LONG_MATCHING_CHAIN_RECORD,
-            "/** @interface */",
+            "/**",
+            " * @interface",
+            " */",
             "function I7() {}",
             "/** @type{function(): I5} */",
             "I7.prototype.getElement = function(){};",
             "",
-            "/** @constructor */",
+            "/**",
+            " * @constructor",
+            " */",
             "function C7() {}",
             "/** @type{function(): C5} */",
             "C7.prototype.getElement = function(){};"),
@@ -15282,12 +15403,16 @@ public final class TypeCheckTest extends CompilerTypeTestCase {
         LINE_JOINER.join(
             "/** @interface */ function I5() {}",
             "/** @constructor @implements {I5} */ function C5() {}",
-            "/** @interface */",
+            "/**",
+            " * @interface",
+            " */",
             "function I7() {}",
             "/** @type{function(this:C5, C5, C5, I5=): I5} */",
             "I7.prototype.getElement = function(){};",
             "",
-            "/** @constructor */",
+            "/**",
+            " * @constructor",
+            " */",
             "function C7() {}",
             "/** @type{function(this:I5, I5, C5=, I5=): C5} */",
             "C7.prototype.getElement = function(){};"),
@@ -15876,14 +16001,18 @@ public final class TypeCheckTest extends CompilerTypeTestCase {
   public void testCovarianceForRecordType28() throws Exception {
     testTypesWithExtraExterns(
         LINE_JOINER.join(
-            "/** @constructor */",
+            "/**",
+            " * @constructor",
+            " */",
             "function XMLHttpRequest() {}",
             "/**",
             " * @return {undefined}",
             " */",
             "XMLHttpRequest.prototype.abort = function() {};",
             "",
-            "/** @constructor */",
+            "/**",
+            " * @constructor",
+            " */",
             "function XDomainRequest() {}",
             "",
             "XDomainRequest.prototype.abort = function() {};"),
@@ -15904,14 +16033,18 @@ public final class TypeCheckTest extends CompilerTypeTestCase {
   public void testCovarianceForRecordType29() throws Exception {
     testTypesWithExtraExterns(
         LINE_JOINER.join(
-            "/** @constructor */",
+            "/**",
+            " * @constructor",
+            " */",
             "function XMLHttpRequest() {}",
             "/**",
             " * @type {!Function}",
             " */",
             "XMLHttpRequest.prototype.abort = function() {};",
             "",
-            "/** @constructor */",
+            "/**",
+            " * @constructor",
+            " */",
             "function XDomainRequest() {}",
             "/**",
             " * @type {!Function}",
@@ -15934,7 +16067,9 @@ public final class TypeCheckTest extends CompilerTypeTestCase {
   public void testCovarianceForRecordType30() throws Exception {
     testTypesWithExtraExterns(
         LINE_JOINER.join(
-            "/** @constructor */",
+            "/**",
+            " * @constructor",
+            " */",
             "function A() {}"
             ),
         LINE_JOINER.join(
@@ -15956,7 +16091,9 @@ public final class TypeCheckTest extends CompilerTypeTestCase {
   public void testCovarianceForRecordType31() throws Exception {
     testTypesWithExtraExterns(
         LINE_JOINER.join(
-            "/** @constructor */",
+            "/**",
+            " * @constructor",
+            " */",
             "function A() {}"
             ),
         LINE_JOINER.join(
@@ -15976,17 +16113,23 @@ public final class TypeCheckTest extends CompilerTypeTestCase {
   }
 
   public void testDuplicateVariableDefinition1() throws Exception {
-    testTypes(
+    testTypesWithExtraExterns(
         LINE_JOINER.join(
-            "/** @record */",
+            "/**",
+            " * @record",
+            " */",
             "function A() {}",
             "/** @type {number} */",
             "A.prototype.prop;",
-            "/** @record */",
+            "/**",
+            " * @record",
+            " */",
             "function B() {}",
             "/** @type {number} */",
             "B.prototype.prop;",
-            "/** @constructor */",
+            "/**",
+            " * @constructor",
+            " */",
             "function C() {}",
             "/** @type {number} */",
             "C.prototype.prop;",
@@ -15994,78 +16137,85 @@ public final class TypeCheckTest extends CompilerTypeTestCase {
             "function fun () {}",
             "/** @return {(B|A|C)} */",
             "function fun () {}"),
-        "variable fun redefined, original definition at [testcode]:14");
+        "",
+        "variable fun redefined, original definition at [externs]:87");
   }
 
   public void testDuplicateVariableDefinition3() throws Exception {
-    testTypes(
+    testTypesWithExtraExterns(
         LINE_JOINER.join(
             "var ns = {};",
             "/** @type {{x:number}} */ ns.x;",
-            "/** @type {{x:number}} */ ns.x;"));
+            "/** @type {{x:number}} */ ns.x;"),
+        "");
   }
 
   public void testDuplicateVariableDefinition3_1() throws Exception {
-    testTypes(
+    testTypesWithExtraExterns(
         LINE_JOINER.join(
             "var ns = {};",
             "/** @type {{x:number}} */ ns.x;",
             "/** @type {{x:string}} */ ns.x;"),
+        "",
         "variable ns.x redefined with type {x: string}, original definition "
-        + "at [testcode]:2 with type {x: number}");
+        + "at [externs]:69 with type {x: number}");
   }
 
   public void testDuplicateVariableDefinition3_2() throws Exception {
-    testTypes(
+    testTypesWithExtraExterns(
         LINE_JOINER.join(
             "var ns = {};",
             "/** @type {{x:number}} */ ns.x;",
             "/** @type {{x:number, y:boolean}} */ ns.x;"),
+        "",
         "variable ns.x redefined with type {x: number, y: boolean}, "
-        + "original definition at [testcode]:2 with type {x: number}");
+        + "original definition at [externs]:69 with type {x: number}");
   }
 
   public void testDuplicateVariableDefinition4() throws Exception {
-    testTypes(
+    testTypesWithExtraExterns(
         LINE_JOINER.join(
             "var ns = {};",
-            "/** @record */ function rec3(){}",
-            "/** @record */ function rec4(){}",
+            "/** @record */ var rec3;",
+            "/** @record */ var rec4;",
             "/** @type {!rec3} */ ns.x;",
-            "/** @type {!rec4} */ ns.x;"));
+            "/** @type {!rec4} */ ns.x;"),
+        "");
   }
 
   public void testDuplicateVariableDefinition5() throws Exception {
-    testTypes(
+    testTypesWithExtraExterns(
         LINE_JOINER.join(
             "var ns = {};",
-            "/** @record */ function rec3(){}",
-            "/** @record */ function rec4(){}",
+            "/** @record */ var rec3;",
+            "/** @record */ var rec4;",
             "/** @type {number} */ rec4.prototype.prop;",
             "/** @type {!rec3} */ ns.x;",
             "/** @type {!rec4} */ ns.x;"),
+        "",
         "variable ns.x redefined with type rec4, original definition at "
-        + "[testcode]:5 with type rec3");
+        + "[externs]:72 with type rec3");
   }
 
   public void testDuplicateVariableDefinition6() throws Exception {
-    testTypes(
+    testTypesWithExtraExterns(
         LINE_JOINER.join(
             "var ns = {};",
-            "/** @record */ function rec3(){}",
+            "/** @record */ var rec3;",
             "/** @type {number} */ rec3.prototype.prop;",
-            "/** @record */ function rec4(){}",
+            "/** @record */ var rec4;",
             "/** @type {!rec3} */ ns.x;",
             "/** @type {!rec4} */ ns.x;"),
+        "",
         "variable ns.x redefined with type rec4, original definition at "
-        + "[testcode]:5 with type rec3");
+        + "[externs]:72 with type rec3");
   }
 
   /**
    * check bug fix 22713201 (the first case)
    */
   public void testDuplicateVariableDefinition7() throws Exception {
-    testTypes(
+    testTypesWithExtraExterns(
         LINE_JOINER.join(
             "/** @typedef {{prop:TD2}} */",
             "  var TD1;",
@@ -16076,28 +16226,30 @@ public final class TypeCheckTest extends CompilerTypeTestCase {
             "  var /** TD1 */ td1;",
             "  var /** TD2 */ td2;",
             "",
-            "  td1 = td2;"));
+            "  td1 = td2;"),
+        "");
   }
 
   public void testDuplicateVariableDefinition8() throws Exception {
-    testTypes(
+    testTypesWithExtraExterns(
         LINE_JOINER.join(
             "var ns = {}",
-            "/** @record */ function rec(){}",
+            "/** @record */ var rec;",
             "/** @type {number} */ rec.prototype.prop;",
             "",
             "/** @type {!rec} */ ns.x;",
             "/** @type {{prop:number}} */ ns.x;",
             "",
             "/** @type {{prop:number}} */ ns.y;",
-            "/** @type {!rec} */ ns.y;"));
+            "/** @type {!rec} */ ns.y;"),
+        "");
   }
 
   public void testDuplicateVariableDefinition8_2() throws Exception {
-    testTypes(
+    testTypesWithExtraExterns(
         LINE_JOINER.join(
             "var ns = {}",
-            "/** @record */ function rec(){}",
+            "/** @record */ var rec;",
             "/** @type {number} */ rec.prototype.prop;",
             "",
             "/** @type {!rec} */ ns.x;",
@@ -16105,15 +16257,16 @@ public final class TypeCheckTest extends CompilerTypeTestCase {
             "",
             "/** @type {{prop:number}} */ ns.y;",
             "/** @type {!rec} */ ns.y;"),
+        "",
         "variable ns.x redefined with type {prop: string}, original "
-        + "definition at [testcode]:5 with type rec");
+        + "definition at [externs]:72 with type rec");
   }
 
   public void testDuplicateVariableDefinition8_3() throws Exception {
-    testTypes(
+    testTypesWithExtraExterns(
         LINE_JOINER.join(
             "var ns = {}",
-            "/** @record */ function rec(){}",
+            "/** @record */ var rec;",
             "/** @type {string} */ rec.prototype.prop;",
             "",
             "/** @type {!rec} */ ns.x;",
@@ -16121,55 +16274,59 @@ public final class TypeCheckTest extends CompilerTypeTestCase {
             "",
             "/** @type {{prop:number}} */ ns.y;",
             "/** @type {!rec} */ ns.y;"),
+        "",
         "variable ns.y redefined with type rec, original definition at "
-        + "[testcode]:8 with type {prop: number}");
+        + "[externs]:75 with type {prop: number}");
   }
 
   public void testDuplicateVariableDefinition8_4() throws Exception {
-    testTypes(
+    testTypesWithExtraExterns(
         LINE_JOINER.join(
             "/** @record @template T */ function I() {}",
             "/** @type {T} */ I.prototype.prop;",
             "var ns = {}",
-            "/** @record */ function rec(){}",
+            "/** @record */ var rec;",
             "/** @type {I} */ rec.prototype.prop;",
             "",
             "/** @type {!rec} */ ns.x;",
-            "/** @type {{prop:I}} */ ns.x;"));
+            "/** @type {{prop:I}} */ ns.x;"),
+        "");
   }
 
   public void testDuplicateVariableDefinition8_5() throws Exception {
-    testTypes(
+    testTypesWithExtraExterns(
         LINE_JOINER.join(
             "/** @record @template T */ function I() {}",
             "/** @type {T} */ I.prototype.prop;",
             "var ns = {}",
-            "/** @record */ function rec(){}",
+            "/** @record */ var rec;",
             "/** @type {I<number>} */ rec.prototype.prop;",
             "",
             "/** @type {!rec} */ ns.x;",
-            "/** @type {{prop:I<number>}} */ ns.x;"));
+            "/** @type {{prop:I<number>}} */ ns.x;"),
+        "");
   }
 
   public void testDuplicateVariableDefinition8_6() throws Exception {
-    testTypes(
+    testTypesWithExtraExterns(
         LINE_JOINER.join(
             "/** @record @template T */ function I() {}",
             "/** @type {T} */ I.prototype.prop;",
             "var ns = {}",
-            "/** @record */ function rec(){}",
+            "/** @record */ var rec;",
             "/** @type {I<number>} */ rec.prototype.prop;",
             "",
             "/** @type {!rec} */ ns.x;",
             "/** @type {{prop:I<string>}} */ ns.x;"),
+        "",
         "variable ns.x redefined with type {prop: (I<string>|null)}, "
-        + "original definition at [testcode]:7 with type rec");
+        + "original definition at [externs]:74 with type rec");
   }
 
   // should have no warning, need to handle equivalence checking for
   // structural types with template types
   public void testDuplicateVariableDefinition8_7() throws Exception {
-    testTypes(
+    testTypesWithExtraExterns(
         LINE_JOINER.join(
             "/** @record @template T */",
             "function rec(){}",
@@ -16177,8 +16334,9 @@ public final class TypeCheckTest extends CompilerTypeTestCase {
             "",
             "/** @type {rec<string>} */ ns.x;",
             "/** @type {{value: string}} */ ns.x;"),
+        "",
         "variable ns.x redefined with type {value: string}, "
-        + "original definition at [testcode]:5 with type (null|rec<string>)");
+        + "original definition at [externs]:72 with type (null|rec<string>)");
   }
 
   private void testTypes(String js) throws Exception {
@@ -16374,7 +16532,11 @@ public final class TypeCheckTest extends CompilerTypeTestCase {
   }
 
   private TypeCheck makeTypeCheck() {
-    return new TypeCheck(compiler, new SemanticReverseAbstractInterpreter(registry), registry);
+    return new TypeCheck(
+        compiler,
+        new SemanticReverseAbstractInterpreter(registry),
+        registry,
+        reportMissingOverrides);
   }
 
   void testTypes(String js, String[] warnings) throws Exception {
diff --git a/test/com/google/javascript/jscomp/TypeValidatorTest.java b/test/com/google/javascript/jscomp/TypeValidatorTest.java
index e7e789e99..417e91b19 100644
--- a/test/com/google/javascript/jscomp/TypeValidatorTest.java
+++ b/test/com/google/javascript/jscomp/TypeValidatorTest.java
@@ -22,6 +22,7 @@ import static com.google.javascript.rhino.jstype.JSTypeNative.NUMBER_TYPE;
 import static com.google.javascript.rhino.jstype.JSTypeNative.STRING_TYPE;
 
 import com.google.common.collect.ImmutableList;
+import com.google.javascript.jscomp.CheckLevel;
 import com.google.javascript.jscomp.TypeValidator.TypeMismatch;
 import com.google.javascript.rhino.Node;
 import com.google.javascript.rhino.jstype.JSType;
@@ -40,7 +41,7 @@ public final class TypeValidatorTest extends CompilerTestCase {
   private Compiler compiler = null;
 
   public TypeValidatorTest() {
-    enableTypeCheck();
+    enableTypeCheck(CheckLevel.ERROR);
   }
 
   @Override
diff --git a/test/com/google/javascript/jscomp/lint/CheckForInOverArrayTest.java b/test/com/google/javascript/jscomp/lint/CheckForInOverArrayTest.java
index 68f8ecc4c..a53236b7e 100644
--- a/test/com/google/javascript/jscomp/lint/CheckForInOverArrayTest.java
+++ b/test/com/google/javascript/jscomp/lint/CheckForInOverArrayTest.java
@@ -33,7 +33,7 @@ public final class CheckForInOverArrayTest extends CompilerTestCase {
 
   @Override
   public void setUp() throws IOException {
-    enableTypeCheck();
+    enableTypeCheck(CheckLevel.WARNING);
   }
 
   @Override
diff --git a/test/com/google/javascript/jscomp/lint/CheckInterfacesTest.java b/test/com/google/javascript/jscomp/lint/CheckInterfacesTest.java
index 634ea5f39..d88d28579 100644
--- a/test/com/google/javascript/jscomp/lint/CheckInterfacesTest.java
+++ b/test/com/google/javascript/jscomp/lint/CheckInterfacesTest.java
@@ -16,6 +16,7 @@
 
 package com.google.javascript.jscomp.lint;
 
+import com.google.javascript.jscomp.CheckLevel;
 import com.google.javascript.jscomp.Compiler;
 import com.google.javascript.jscomp.CompilerPass;
 import com.google.javascript.jscomp.CompilerTestCase;
@@ -30,7 +31,7 @@ public final class CheckInterfacesTest extends CompilerTestCase {
   }
 
   public void setUp() {
-    enableTypeCheck();
+    enableTypeCheck(CheckLevel.ERROR);
   }
 
   public void testInterfaceArgs() throws Exception {
diff --git a/test/com/google/javascript/jscomp/lint/CheckNullableReturnTest.java b/test/com/google/javascript/jscomp/lint/CheckNullableReturnTest.java
index b51a8359c..488616e1e 100644
--- a/test/com/google/javascript/jscomp/lint/CheckNullableReturnTest.java
+++ b/test/com/google/javascript/jscomp/lint/CheckNullableReturnTest.java
@@ -35,7 +35,7 @@ public final class CheckNullableReturnTest extends CompilerTestCase {
 
   @Override
   public void setUp() throws IOException {
-    enableTypeCheck();
+    enableTypeCheck(CheckLevel.ERROR);
   }
 
   @Override
diff --git a/test/com/google/javascript/jscomp/parsing/NewParserTest.java b/test/com/google/javascript/jscomp/parsing/NewParserTest.java
index 15e06597e..f88064811 100644
--- a/test/com/google/javascript/jscomp/parsing/NewParserTest.java
+++ b/test/com/google/javascript/jscomp/parsing/NewParserTest.java
@@ -757,14 +757,17 @@ public final class NewParserTest extends BaseJSTypeTestCase {
   }
 
   public void testInlineJSDocAttachment3() {
-    parse("function f(/** @type {string} */ x) {}");
+    parseWarning(
+        "function f(/** @type {string} */ x) {}",
+        "Bad type annotation. type not recognized due to syntax error");
   }
 
   public void testInlineJSDocAttachment4() {
-    parse(
+    parseWarning(
         "function f(/**\n" +
         " * @type {string}\n" +
-        " */ x) {}");
+        " */ x) {}",
+        "Bad type annotation. type not recognized due to syntax error");
   }
 
   public void testInlineJSDocAttachment5() {
@@ -2654,7 +2657,46 @@ public final class NewParserTest extends BaseJSTypeTestCase {
     parse("import {x, y} from './someModule'");
     parse("import {x as x1, y as y1} from './someModule'");
     parse("import {x as x1, y as y1, } from './someModule'");
+    parse("import {default as d, class as c} from './someModule'");
+    parse("import d, {x as x1, y as y1} from './someModule'");
     parse("import * as sm from './someModule'");
+
+    parseError("import class from './someModule'",
+            "cannot use keyword 'class' here.");
+    parseError("import * as class from './someModule'",
+            "'identifier' expected");
+    parseError("import {a as class} from './someModule'",
+            "'identifier' expected");
+    parseError("import {class} from './someModule'",
+            "'as' expected");
+  }
+
+  public void testExport() {
+    mode = LanguageMode.ECMASCRIPT6;
+
+    parse("export const x = 1");
+    parse("export var x = 1");
+    parse("export function f() {}");
+    parse("export class c {}");
+    parse("export {x, y}");
+    parse("export {x as x1}");
+    parse("export {x as x1, y as x2}");
+    parse("export {x as default, y as class}");
+
+    parseError("export {default as x}",
+        "cannot use keyword 'default' here.");
+    parseError("export {package as x}",
+        "cannot use keyword 'package' here.");
+    parseError("export {package}",
+        "cannot use keyword 'package' here.");
+
+    parse("export {x as x1, y as y1} from './someModule'");
+    parse("export {x as x1, y as y1, } from './someModule'");
+    parse("export {default as d} from './someModule'");
+    parse("export {d as default, c as class} from './someModule'");
+    parse("export {default as default, class as class} from './someModule'");
+    parse("export {class} from './someModule'");
+    parse("export * from './someModule'");
   }
 
   public void testShebang() {