Version 2.11.0-224.0.dev

Merge commit 'fc317794dd853525ac7af866a9cee50c6141d139' into 'dev'
diff --git a/pkg/analysis_server/lib/src/services/correction/util.dart b/pkg/analysis_server/lib/src/services/correction/util.dart
index cbd971b..59dca74 100644
--- a/pkg/analysis_server/lib/src/services/correction/util.dart
+++ b/pkg/analysis_server/lib/src/services/correction/util.dart
@@ -831,10 +831,10 @@
 
     var element = type.element;
 
-    // Typedef(s) are represented as GenericFunctionTypeElement(s).
+    // Typedef(s) are represented as FunctionTypeAliasElement(s).
     if (element is GenericFunctionTypeElement &&
         element.typeParameters.isEmpty &&
-        element.enclosingElement is GenericTypeAliasElement) {
+        element.enclosingElement is FunctionTypeAliasElement) {
       element = element.enclosingElement;
     }
 
diff --git a/pkg/analysis_server/test/plugin/protocol_dart_test.dart b/pkg/analysis_server/test/plugin/protocol_dart_test.dart
index c0a13a9..745d3d3 100644
--- a/pkg/analysis_server/test/plugin/protocol_dart_test.dart
+++ b/pkg/analysis_server/test/plugin/protocol_dart_test.dart
@@ -412,7 +412,8 @@
 typedef F<T> = int Function(String x);
 ''');
     var unit = await resolveLibraryUnit(source);
-    engine.GenericTypeAliasElement engineElement = findElementInUnit(unit, 'F');
+    engine.FunctionTypeAliasElement engineElement =
+        findElementInUnit(unit, 'F');
     // create notification Element
     var element = convertElement(engineElement);
     expect(element.kind, ElementKind.FUNCTION_TYPE_ALIAS);
diff --git a/pkg/analyzer/CHANGELOG.md b/pkg/analyzer/CHANGELOG.md
index 2a979a6..924f983 100644
--- a/pkg/analyzer/CHANGELOG.md
+++ b/pkg/analyzer/CHANGELOG.md
@@ -1,3 +1,6 @@
+## 0.40.5-dev
+* Deprecated `GenericTypeAliasElement`. Use `FunctionTypeAliasElement`.
+
 ## 0.40.4
 * Deprecated `IndexExpression.auxiliaryElements` and
   `SimpleIdentifier.auxiliaryElements`. Use `CompoundAssignmentExpression`.
diff --git a/pkg/analyzer/lib/dart/element/element.dart b/pkg/analyzer/lib/dart/element/element.dart
index 9e50585..1848bff 100644
--- a/pkg/analyzer/lib/dart/element/element.dart
+++ b/pkg/analyzer/lib/dart/element/element.dart
@@ -1163,7 +1163,7 @@
   /// the given [typeArguments] and [nullabilitySuffix].
   ///
   /// Note that this always instantiates the typedef itself, so for a
-  /// [GenericTypeAliasElement] the returned [FunctionType] might still be a
+  /// [FunctionTypeAliasElement] the returned [FunctionType] might still be a
   /// generic function, with type formals. For example, if the typedef is:
   ///     typedef F<T> = void Function<U>(T, U);
   /// then `F<int>` will produce `void Function<U>(int, U)`.
@@ -1200,6 +1200,7 @@
 /// A synonym for [FunctionTypeAliasElement].
 ///
 /// Clients may not extend, implement, or mix-in this class.
+@Deprecated('Use FunctionTypeAliasElement instead')
 abstract class GenericTypeAliasElement implements FunctionTypeAliasElement {}
 
 /// A combinator that causes some of the names in a namespace to be hidden when
diff --git a/pkg/analyzer/lib/src/dart/constant/potentially_constant.dart b/pkg/analyzer/lib/src/dart/constant/potentially_constant.dart
index 3060c8f..7b620f3 100644
--- a/pkg/analyzer/lib/src/dart/constant/potentially_constant.dart
+++ b/pkg/analyzer/lib/src/dart/constant/potentially_constant.dart
@@ -39,7 +39,7 @@
 
 bool _isConstantTypeName(Identifier name) {
   var element = name.staticElement;
-  if (element is ClassElement || element is GenericTypeAliasElement) {
+  if (element is ClassElement || element is FunctionTypeAliasElement) {
     if (name is PrefixedIdentifier) {
       if (name.isDeferred) {
         return false;
diff --git a/pkg/analyzer/lib/src/dart/element/display_string_builder.dart b/pkg/analyzer/lib/src/dart/element/display_string_builder.dart
index 5625a7b..6c7dd55 100644
--- a/pkg/analyzer/lib/src/dart/element/display_string_builder.dart
+++ b/pkg/analyzer/lib/src/dart/element/display_string_builder.dart
@@ -126,14 +126,7 @@
     _writeNullability(type.nullabilitySuffix);
   }
 
-  void writeGenericFunctionTypeElement(GenericFunctionTypeElementImpl element) {
-    _writeType(element.returnType);
-    _write(' Function');
-    _writeTypeParameters(element.typeParameters);
-    _writeFormalParameters(element.parameters, forElement: true);
-  }
-
-  void writeGenericTypeAliasElement(GenericTypeAliasElementImpl element) {
+  void writeFunctionTypeAliasElement(FunctionTypeAliasElementImpl element) {
     _write('typedef ');
     _write(element.displayName);
     _writeTypeParameters(element.typeParameters);
@@ -141,6 +134,13 @@
     element.function?.appendTo(this);
   }
 
+  void writeGenericFunctionTypeElement(GenericFunctionTypeElementImpl element) {
+    _writeType(element.returnType);
+    _write(' Function');
+    _writeTypeParameters(element.typeParameters);
+    _writeFormalParameters(element.parameters, forElement: true);
+  }
+
   void writeImportElement(ImportElementImpl element) {
     _write('import ');
     (element.importedLibrary as LibraryElementImpl).appendTo(this);
diff --git a/pkg/analyzer/lib/src/dart/element/element.dart b/pkg/analyzer/lib/src/dart/element/element.dart
index b94c4fa..b88a11e 100644
--- a/pkg/analyzer/lib/src/dart/element/element.dart
+++ b/pkg/analyzer/lib/src/dart/element/element.dart
@@ -1407,9 +1407,9 @@
         }
 
         var reference = containerRef.getChild(name);
-        var element = node.declaredElement as GenericTypeAliasElement;
+        var element = node.declaredElement as FunctionTypeAliasElement;
         element ??=
-            GenericTypeAliasElementImpl.forLinkedNode(this, reference, node);
+            FunctionTypeAliasElementImpl.forLinkedNode(this, reference, node);
         _typeAliases.add(element);
       }
     }
@@ -1586,7 +1586,7 @@
         return functionImpl;
       }
     }
-    for (GenericTypeAliasElementImpl typeAlias in functionTypeAliases) {
+    for (FunctionTypeAliasElementImpl typeAlias in functionTypeAliases) {
       if (typeAlias.identifier == identifier) {
         return typeAlias;
       }
@@ -3178,7 +3178,7 @@
   void _safelyVisitPossibleChild(DartType type, ElementVisitor visitor) {
     Element element = type?.element;
     if (element is GenericFunctionTypeElementImpl &&
-        element.enclosingElement is! GenericTypeAliasElement) {
+        element.enclosingElement is! FunctionTypeAliasElement) {
       element.accept(visitor);
     }
   }
@@ -4438,6 +4438,215 @@
   T accept<T>(ElementVisitor<T> visitor) => visitor.visitFunctionElement(this);
 }
 
+/// An element that represents [FunctionTypeAlias] or [GenericTypeAlias].
+///
+/// Clients may not extend, implement or mix-in this class.
+class FunctionTypeAliasElementImpl extends ElementImpl
+    with
+        TypeParameterizedElementMixin
+    implements
+        // ignore: deprecated_member_use_from_same_package
+        GenericTypeAliasElement {
+  /// The element representing the generic function type.
+  GenericFunctionTypeElementImpl _function;
+
+  /// Initialize a newly created type alias element to have the given [name].
+  FunctionTypeAliasElementImpl(String name, int offset) : super(name, offset);
+
+  FunctionTypeAliasElementImpl.forLinkedNode(
+      CompilationUnitElementImpl enclosingUnit,
+      Reference reference,
+      AstNode linkedNode)
+      : super.forLinkedNode(enclosingUnit, reference, linkedNode) {
+    if (linkedNode is FunctionTypeAlias) {
+      linkedNode.name.staticElement = this;
+    } else {
+      (linkedNode as GenericTypeAlias).name.staticElement = this;
+    }
+  }
+
+  @override
+  int get codeLength {
+    if (linkedNode != null) {
+      return linkedContext.getCodeLength(linkedNode);
+    }
+    return super.codeLength;
+  }
+
+  @override
+  int get codeOffset {
+    if (linkedNode != null) {
+      return linkedContext.getCodeOffset(linkedNode);
+    }
+    return super.codeOffset;
+  }
+
+  @override
+  String get displayName => name;
+
+  @override
+  String get documentationComment {
+    if (linkedNode != null) {
+      var context = enclosingUnit.linkedContext;
+      var comment = context.getDocumentationComment(linkedNode);
+      return getCommentNodeRawText(comment);
+    }
+    return super.documentationComment;
+  }
+
+  @override
+  CompilationUnitElement get enclosingElement =>
+      super.enclosingElement as CompilationUnitElement;
+
+  @override
+  CompilationUnitElementImpl get enclosingUnit =>
+      _enclosingElement as CompilationUnitElementImpl;
+
+  @override
+  GenericFunctionTypeElementImpl get function {
+    if (_function != null) return _function;
+
+    if (linkedNode != null) {
+      if (linkedNode is GenericTypeAlias) {
+        var context = enclosingUnit.linkedContext;
+        var function = context.getGeneticTypeAliasFunction(linkedNode);
+        if (function != null) {
+          var reference = context.getGenericFunctionTypeReference(function);
+          _function = reference.element;
+          encloseElement(_function);
+          return _function;
+        } else {
+          return _function = GenericFunctionTypeElementImpl.forOffset(-1)
+            ..typeParameters = const <TypeParameterElement>[]
+            ..parameters = const <ParameterElement>[]
+            ..returnType = DynamicTypeImpl.instance;
+        }
+      } else {
+        return _function = GenericFunctionTypeElementImpl.forLinkedNode(
+          this,
+          reference.getChild('@function'),
+          linkedNode,
+        );
+      }
+    }
+
+    return _function;
+  }
+
+  /// Set the function element representing the generic function type on the
+  /// right side of the equals to the given [function].
+  set function(GenericFunctionTypeElementImpl function) {
+    if (function != null) {
+      function.enclosingElement = this;
+    }
+    _function = function;
+  }
+
+  /// Return `true` if the element has direct or indirect reference to itself
+  /// from anywhere except a class element or type parameter bounds.
+  bool get hasSelfReference {
+    if (linkedNode != null) {
+      return linkedContext.getHasTypedefSelfReference(linkedNode);
+    }
+    return false;
+  }
+
+  @override
+  bool get isSimplyBounded {
+    if (linkedNode != null) {
+      return linkedContext.isSimplyBounded(linkedNode);
+    }
+    return super.isSimplyBounded;
+  }
+
+  @override
+  ElementKind get kind => ElementKind.FUNCTION_TYPE_ALIAS;
+
+  @override
+  String get name {
+    if (linkedNode != null) {
+      return reference.name;
+    }
+    return super.name;
+  }
+
+  @override
+  int get nameOffset {
+    if (linkedNode != null) {
+      return enclosingUnit.linkedContext.getNameOffset(linkedNode);
+    }
+
+    return super.nameOffset;
+  }
+
+  /// Set the type parameters defined for this type to the given
+  /// [typeParameters].
+  set typeParameters(List<TypeParameterElement> typeParameters) {
+    for (TypeParameterElement typeParameter in typeParameters) {
+      (typeParameter as TypeParameterElementImpl).enclosingElement = this;
+    }
+    _typeParameterElements = typeParameters;
+  }
+
+  @override
+  T accept<T>(ElementVisitor<T> visitor) =>
+      visitor.visitFunctionTypeAliasElement(this);
+
+  @override
+  void appendTo(ElementDisplayStringBuilder builder) {
+    builder.writeFunctionTypeAliasElement(this);
+  }
+
+  @override
+  ElementImpl getChild(String identifier) {
+    for (TypeParameterElement typeParameter in typeParameters) {
+      TypeParameterElementImpl typeParameterImpl = typeParameter;
+      if (typeParameterImpl.identifier == identifier) {
+        return typeParameterImpl;
+      }
+    }
+    return null;
+  }
+
+  @override
+  FunctionType instantiate({
+    @required List<DartType> typeArguments,
+    @required NullabilitySuffix nullabilitySuffix,
+  }) {
+    if (function == null) {
+      return null;
+    }
+
+    if (typeArguments.length != typeParameters.length) {
+      throw ArgumentError("typeArguments.length (${typeArguments.length}) != "
+          "typeParameters.length (${typeParameters.length})");
+    }
+
+    var substitution = Substitution.fromPairs(typeParameters, typeArguments);
+    var type = substitution.substituteType(function.type) as FunctionType;
+
+    var resultNullability = type.nullabilitySuffix == NullabilitySuffix.question
+        ? NullabilitySuffix.question
+        : nullabilitySuffix;
+
+    return FunctionTypeImpl(
+      typeFormals: type.typeFormals,
+      parameters: type.parameters,
+      returnType: type.returnType,
+      nullabilitySuffix: resultNullability,
+      element: this,
+      typeArguments: typeArguments,
+    );
+  }
+
+  @override
+  void visitChildren(ElementVisitor visitor) {
+    super.visitChildren(visitor);
+    safelyVisitChildren(typeParameters, visitor);
+    function?.accept(visitor);
+  }
+}
+
 /// Common internal interface shared by elements whose type is a function type.
 ///
 /// Clients may not extend, implement or mix-in this class.
@@ -4606,213 +4815,6 @@
   }
 }
 
-/// A function type alias of the form
-///     `typedef` identifier typeParameters = genericFunctionType;
-///
-/// Clients may not extend, implement or mix-in this class.
-class GenericTypeAliasElementImpl extends ElementImpl
-    with TypeParameterizedElementMixin
-    implements GenericTypeAliasElement {
-  /// The element representing the generic function type.
-  GenericFunctionTypeElementImpl _function;
-
-  /// Initialize a newly created type alias element to have the given [name].
-  GenericTypeAliasElementImpl(String name, int offset) : super(name, offset);
-
-  GenericTypeAliasElementImpl.forLinkedNode(
-      CompilationUnitElementImpl enclosingUnit,
-      Reference reference,
-      AstNode linkedNode)
-      : super.forLinkedNode(enclosingUnit, reference, linkedNode) {
-    if (linkedNode is FunctionTypeAlias) {
-      linkedNode.name.staticElement = this;
-    } else {
-      (linkedNode as GenericTypeAlias).name.staticElement = this;
-    }
-  }
-
-  @override
-  int get codeLength {
-    if (linkedNode != null) {
-      return linkedContext.getCodeLength(linkedNode);
-    }
-    return super.codeLength;
-  }
-
-  @override
-  int get codeOffset {
-    if (linkedNode != null) {
-      return linkedContext.getCodeOffset(linkedNode);
-    }
-    return super.codeOffset;
-  }
-
-  @override
-  String get displayName => name;
-
-  @override
-  String get documentationComment {
-    if (linkedNode != null) {
-      var context = enclosingUnit.linkedContext;
-      var comment = context.getDocumentationComment(linkedNode);
-      return getCommentNodeRawText(comment);
-    }
-    return super.documentationComment;
-  }
-
-  @override
-  CompilationUnitElement get enclosingElement =>
-      super.enclosingElement as CompilationUnitElement;
-
-  @override
-  CompilationUnitElementImpl get enclosingUnit =>
-      _enclosingElement as CompilationUnitElementImpl;
-
-  @override
-  GenericFunctionTypeElementImpl get function {
-    if (_function != null) return _function;
-
-    if (linkedNode != null) {
-      if (linkedNode is GenericTypeAlias) {
-        var context = enclosingUnit.linkedContext;
-        var function = context.getGeneticTypeAliasFunction(linkedNode);
-        if (function != null) {
-          var reference = context.getGenericFunctionTypeReference(function);
-          _function = reference.element;
-          encloseElement(_function);
-          return _function;
-        } else {
-          return _function = GenericFunctionTypeElementImpl.forOffset(-1)
-            ..typeParameters = const <TypeParameterElement>[]
-            ..parameters = const <ParameterElement>[]
-            ..returnType = DynamicTypeImpl.instance;
-        }
-      } else {
-        return _function = GenericFunctionTypeElementImpl.forLinkedNode(
-          this,
-          reference.getChild('@function'),
-          linkedNode,
-        );
-      }
-    }
-
-    return _function;
-  }
-
-  /// Set the function element representing the generic function type on the
-  /// right side of the equals to the given [function].
-  set function(GenericFunctionTypeElementImpl function) {
-    if (function != null) {
-      function.enclosingElement = this;
-    }
-    _function = function;
-  }
-
-  /// Return `true` if the element has direct or indirect reference to itself
-  /// from anywhere except a class element or type parameter bounds.
-  bool get hasSelfReference {
-    if (linkedNode != null) {
-      return linkedContext.getHasTypedefSelfReference(linkedNode);
-    }
-    return false;
-  }
-
-  @override
-  bool get isSimplyBounded {
-    if (linkedNode != null) {
-      return linkedContext.isSimplyBounded(linkedNode);
-    }
-    return super.isSimplyBounded;
-  }
-
-  @override
-  ElementKind get kind => ElementKind.FUNCTION_TYPE_ALIAS;
-
-  @override
-  String get name {
-    if (linkedNode != null) {
-      return reference.name;
-    }
-    return super.name;
-  }
-
-  @override
-  int get nameOffset {
-    if (linkedNode != null) {
-      return enclosingUnit.linkedContext.getNameOffset(linkedNode);
-    }
-
-    return super.nameOffset;
-  }
-
-  /// Set the type parameters defined for this type to the given
-  /// [typeParameters].
-  set typeParameters(List<TypeParameterElement> typeParameters) {
-    for (TypeParameterElement typeParameter in typeParameters) {
-      (typeParameter as TypeParameterElementImpl).enclosingElement = this;
-    }
-    _typeParameterElements = typeParameters;
-  }
-
-  @override
-  T accept<T>(ElementVisitor<T> visitor) =>
-      visitor.visitFunctionTypeAliasElement(this);
-
-  @override
-  void appendTo(ElementDisplayStringBuilder builder) {
-    builder.writeGenericTypeAliasElement(this);
-  }
-
-  @override
-  ElementImpl getChild(String identifier) {
-    for (TypeParameterElement typeParameter in typeParameters) {
-      TypeParameterElementImpl typeParameterImpl = typeParameter;
-      if (typeParameterImpl.identifier == identifier) {
-        return typeParameterImpl;
-      }
-    }
-    return null;
-  }
-
-  @override
-  FunctionType instantiate({
-    @required List<DartType> typeArguments,
-    @required NullabilitySuffix nullabilitySuffix,
-  }) {
-    if (function == null) {
-      return null;
-    }
-
-    if (typeArguments.length != typeParameters.length) {
-      throw ArgumentError("typeArguments.length (${typeArguments.length}) != "
-          "typeParameters.length (${typeParameters.length})");
-    }
-
-    var substitution = Substitution.fromPairs(typeParameters, typeArguments);
-    var type = substitution.substituteType(function.type) as FunctionType;
-
-    var resultNullability = type.nullabilitySuffix == NullabilitySuffix.question
-        ? NullabilitySuffix.question
-        : nullabilitySuffix;
-
-    return FunctionTypeImpl(
-      typeFormals: type.typeFormals,
-      parameters: type.parameters,
-      returnType: type.returnType,
-      nullabilitySuffix: resultNullability,
-      element: this,
-      typeArguments: typeArguments,
-    );
-  }
-
-  @override
-  void visitChildren(ElementVisitor visitor) {
-    super.visitChildren(visitor);
-    safelyVisitChildren(typeParameters, visitor);
-    function?.accept(visitor);
-  }
-}
-
 /// A concrete implementation of a [HideElementCombinator].
 class HideElementCombinatorImpl implements HideElementCombinator {
   final LinkedUnitContext linkedContext;
diff --git a/pkg/analyzer/lib/src/dart/element/type.dart b/pkg/analyzer/lib/src/dart/element/type.dart
index 83c3e77..f0be482 100644
--- a/pkg/analyzer/lib/src/dart/element/type.dart
+++ b/pkg/analyzer/lib/src/dart/element/type.dart
@@ -139,7 +139,7 @@
   FunctionTypedElement get element {
     var element = super.element;
     // TODO(scheglov) Can we just construct it with the right element?
-    if (element is GenericTypeAliasElement) {
+    if (element is FunctionTypeAliasElement) {
       return element.function;
     }
     return element;
diff --git a/pkg/analyzer/lib/src/error/best_practices_verifier.dart b/pkg/analyzer/lib/src/error/best_practices_verifier.dart
index b3f890b..13f24e2 100644
--- a/pkg/analyzer/lib/src/error/best_practices_verifier.dart
+++ b/pkg/analyzer/lib/src/error/best_practices_verifier.dart
@@ -1081,7 +1081,7 @@
         ];
         for (var type in signatureTypes) {
           var typeElement = type?.element?.enclosingElement;
-          if (typeElement is GenericTypeAliasElement &&
+          if (typeElement is FunctionTypeAliasElement &&
               typeElement.hasInternal) {
             _errorReporter.reportErrorForNode(
                 HintCode.INVALID_EXPORT_OF_INTERNAL_ELEMENT_INDIRECTLY,
diff --git a/pkg/analyzer/lib/src/error/type_arguments_verifier.dart b/pkg/analyzer/lib/src/error/type_arguments_verifier.dart
index f43fffa..e37d63d 100644
--- a/pkg/analyzer/lib/src/error/type_arguments_verifier.dart
+++ b/pkg/analyzer/lib/src/error/type_arguments_verifier.dart
@@ -196,7 +196,7 @@
     if (type is InterfaceType) {
       typeParameters = type.element.typeParameters;
       typeArguments = type.typeArguments;
-    } else if (element is GenericTypeAliasElement && type is FunctionType) {
+    } else if (element is FunctionTypeAliasElement && type is FunctionType) {
       typeParameters = element.typeParameters;
       typeArguments = type.typeArguments;
     } else {
diff --git a/pkg/analyzer/lib/src/generated/declaration_resolver.dart b/pkg/analyzer/lib/src/generated/declaration_resolver.dart
index 8c9f8b8..fea0326 100644
--- a/pkg/analyzer/lib/src/generated/declaration_resolver.dart
+++ b/pkg/analyzer/lib/src/generated/declaration_resolver.dart
@@ -98,7 +98,7 @@
 
   /// Creates an [ElementWalker] which walks the child elements of a typedef
   /// element.
-  ElementWalker.forTypedef(GenericTypeAliasElementImpl element)
+  ElementWalker.forTypedef(FunctionTypeAliasElementImpl element)
       : element = element,
         _parameters = element.function.parameters,
         _typeParameters = element.typeParameters;
diff --git a/pkg/analyzer/lib/src/generated/error_verifier.dart b/pkg/analyzer/lib/src/generated/error_verifier.dart
index 6badff5..8e39f8f 100644
--- a/pkg/analyzer/lib/src/generated/error_verifier.dart
+++ b/pkg/analyzer/lib/src/generated/error_verifier.dart
@@ -4245,7 +4245,7 @@
     AstNode node,
     FunctionTypeAliasElement element,
   ) {
-    if ((element as GenericTypeAliasElementImpl).hasSelfReference) {
+    if ((element as FunctionTypeAliasElementImpl).hasSelfReference) {
       _errorReporter.reportErrorForNode(
         CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF,
         node,
diff --git a/pkg/analyzer/lib/src/generated/resolver.dart b/pkg/analyzer/lib/src/generated/resolver.dart
index 46728e7..2097005 100644
--- a/pkg/analyzer/lib/src/generated/resolver.dart
+++ b/pkg/analyzer/lib/src/generated/resolver.dart
@@ -1029,7 +1029,7 @@
     // TODO(scheglov) Change corresponding visiting places to visit comments
     // with name scopes set for correct comments resolution.
     if (parent is GenericTypeAlias) {
-      var element = parent.declaredElement as GenericTypeAliasElement;
+      var element = parent.declaredElement as FunctionTypeAliasElement;
       var outerScope = nameScope;
       try {
         nameScope = TypeParameterScope(nameScope, element.typeParameters);
@@ -2851,7 +2851,7 @@
   void visitGenericTypeAlias(GenericTypeAlias node) {
     Scope outerScope = nameScope;
     try {
-      GenericTypeAliasElement element = node.declaredElement;
+      FunctionTypeAliasElement element = node.declaredElement;
       nameScope = TypeParameterScope(nameScope, element.typeParameters);
       super.visitGenericTypeAlias(node);
 
diff --git a/pkg/analyzer/lib/src/generated/testing/element_factory.dart b/pkg/analyzer/lib/src/generated/testing/element_factory.dart
index 427d11f..c0c1b6e 100644
--- a/pkg/analyzer/lib/src/generated/testing/element_factory.dart
+++ b/pkg/analyzer/lib/src/generated/testing/element_factory.dart
@@ -261,9 +261,9 @@
     _objectElement = null;
   }
 
-  static GenericTypeAliasElementImpl genericTypeAliasElement(String name,
+  static FunctionTypeAliasElementImpl functionTypeAliasElement(String name,
       {List<ParameterElement> parameters = const [], DartType returnType}) {
-    var element = GenericTypeAliasElementImpl(name, -1);
+    var element = FunctionTypeAliasElementImpl(name, -1);
     element.function = GenericFunctionTypeElementImpl.forOffset(-1)
       ..parameters = parameters
       ..returnType = returnType ?? DynamicTypeImpl.instance;
diff --git a/pkg/analyzer/lib/src/summary2/default_types_builder.dart b/pkg/analyzer/lib/src/summary2/default_types_builder.dart
index d06952b..4a8d0c5 100644
--- a/pkg/analyzer/lib/src/summary2/default_types_builder.dart
+++ b/pkg/analyzer/lib/src/summary2/default_types_builder.dart
@@ -255,7 +255,7 @@
 
           if (declaration is ClassElement) {
             recurseParameters(declaration.typeParameters);
-          } else if (declaration is GenericTypeAliasElement) {
+          } else if (declaration is FunctionTypeAliasElement) {
             recurseParameters(declaration.typeParameters);
           }
           visited.remove(startType.element);
diff --git a/pkg/analyzer/lib/src/summary2/linked_element_factory.dart b/pkg/analyzer/lib/src/summary2/linked_element_factory.dart
index b074a62..8dd1b7c 100644
--- a/pkg/analyzer/lib/src/summary2/linked_element_factory.dart
+++ b/pkg/analyzer/lib/src/summary2/linked_element_factory.dart
@@ -299,7 +299,7 @@
 
     if (reference.name == '@function' && parent2.name == '@typeAlias') {
       var parent = reference.parent;
-      GenericTypeAliasElementImpl alias = elementOfReference(parent);
+      FunctionTypeAliasElementImpl alias = elementOfReference(parent);
       return alias.function;
     }
 
@@ -478,13 +478,13 @@
     return reference.element;
   }
 
-  GenericTypeAliasElementImpl _typeAlias(
+  FunctionTypeAliasElementImpl _typeAlias(
       CompilationUnitElementImpl unit, Reference reference) {
     if (reference.node == null) {
       _indexUnitElementDeclarations(unit);
       assert(reference.node != null, '$reference');
     }
-    GenericTypeAliasElementImpl.forLinkedNode(unit, reference, reference.node);
+    FunctionTypeAliasElementImpl.forLinkedNode(unit, reference, reference.node);
     return reference.element;
   }
 
diff --git a/pkg/analyzer/lib/src/summary2/linked_unit_context.dart b/pkg/analyzer/lib/src/summary2/linked_unit_context.dart
index 24a749f..ff54b07 100644
--- a/pkg/analyzer/lib/src/summary2/linked_unit_context.dart
+++ b/pkg/analyzer/lib/src/summary2/linked_unit_context.dart
@@ -973,7 +973,7 @@
         _typeParameters.remove(--_nextSyntheticTypeParameterId);
       }
 
-      GenericTypeAliasElement typedefElement;
+      FunctionTypeAliasElement typedefElement;
       List<DartType> typedefTypeArguments = const <DartType>[];
       if (linkedType.functionTypedef != 0) {
         typedefElement =
diff --git a/pkg/analyzer/lib/src/summary2/linking_bundle_context.dart b/pkg/analyzer/lib/src/summary2/linking_bundle_context.dart
index 72d0e9d..81cf9c2b 100644
--- a/pkg/analyzer/lib/src/summary2/linking_bundle_context.dart
+++ b/pkg/analyzer/lib/src/summary2/linking_bundle_context.dart
@@ -171,13 +171,13 @@
 
     Element typedefElement;
     List<DartType> typedefTypeArguments = const <DartType>[];
-    if (type.element is GenericTypeAliasElement) {
+    if (type.element is FunctionTypeAliasElement) {
       typedefElement = type.element;
       typedefTypeArguments = type.typeArguments;
     }
-    // TODO(scheglov) Cleanup to always use GenericTypeAliasElement.
+    // TODO(scheglov) Cleanup to always use FunctionTypeAliasElement.
     if (type.element is GenericFunctionTypeElement &&
-        type.element.enclosingElement is GenericTypeAliasElement) {
+        type.element.enclosingElement is FunctionTypeAliasElement) {
       typedefElement = type.element.enclosingElement;
       typedefTypeArguments = type.typeArguments;
     }
diff --git a/pkg/analyzer/lib/src/summary2/named_type_builder.dart b/pkg/analyzer/lib/src/summary2/named_type_builder.dart
index 0bc869d..fdf0073 100644
--- a/pkg/analyzer/lib/src/summary2/named_type_builder.dart
+++ b/pkg/analyzer/lib/src/summary2/named_type_builder.dart
@@ -91,7 +91,7 @@
       );
       type = typeSystem.toLegacyType(type);
       _type = type;
-    } else if (element is GenericTypeAliasElement) {
+    } else if (element is FunctionTypeAliasElement) {
       var rawType = _getRawFunctionType(element);
       if (rawType is FunctionType) {
         var parameters = element.typeParameters;
@@ -255,7 +255,7 @@
     }
   }
 
-  DartType _getRawFunctionType(GenericTypeAliasElementImpl element) {
+  DartType _getRawFunctionType(FunctionTypeAliasElementImpl element) {
     // If the element is not being linked, there is no reason (or a way,
     // because the linked node might be read only partially) to go through
     // its node - all its types have already been built.
diff --git a/pkg/analyzer/lib/src/summary2/reference_resolver.dart b/pkg/analyzer/lib/src/summary2/reference_resolver.dart
index 2844249..d142a4c 100644
--- a/pkg/analyzer/lib/src/summary2/reference_resolver.dart
+++ b/pkg/analyzer/lib/src/summary2/reference_resolver.dart
@@ -259,7 +259,7 @@
     var outerScope = scope;
     var outerReference = reference;
 
-    var element = node.declaredElement as GenericTypeAliasElementImpl;
+    var element = node.declaredElement as FunctionTypeAliasElementImpl;
     reference = element.reference;
 
     _createTypeParameterElements(node.typeParameters);
@@ -340,7 +340,7 @@
     var outerScope = scope;
     var outerReference = reference;
 
-    var element = node.declaredElement as GenericTypeAliasElementImpl;
+    var element = node.declaredElement as FunctionTypeAliasElementImpl;
     reference = element.reference;
 
     _createTypeParameterElements(node.typeParameters);
diff --git a/pkg/analyzer/lib/src/summary2/variance_builder.dart b/pkg/analyzer/lib/src/summary2/variance_builder.dart
index 704bd83..51d0100 100644
--- a/pkg/analyzer/lib/src/summary2/variance_builder.dart
+++ b/pkg/analyzer/lib/src/summary2/variance_builder.dart
@@ -74,7 +74,7 @@
           }
         }
         return result;
-      } else if (element is GenericTypeAliasElementImpl) {
+      } else if (element is FunctionTypeAliasElementImpl) {
         _functionTypeAliasElement(element);
 
         var result = Variance.unrelated;
@@ -178,7 +178,7 @@
     }
   }
 
-  void _functionTypeAliasElement(GenericTypeAliasElementImpl element) {
+  void _functionTypeAliasElement(FunctionTypeAliasElementImpl element) {
     var node = element.linkedNode;
     if (node is GenericTypeAlias) {
       _genericTypeAlias(node);
diff --git a/pkg/analyzer/lib/src/test_utilities/find_element.dart b/pkg/analyzer/lib/src/test_utilities/find_element.dart
index 2b1860b..ce24cde 100644
--- a/pkg/analyzer/lib/src/test_utilities/find_element.dart
+++ b/pkg/analyzer/lib/src/test_utilities/find_element.dart
@@ -220,9 +220,7 @@
 
     for (var type in unitElement.functionTypeAliases) {
       findIn(type.typeParameters);
-      if (type is GenericTypeAliasElement) {
-        findIn(type.function.typeParameters);
-      }
+      findIn(type.function.typeParameters);
     }
 
     for (var class_ in unitElement.types) {
@@ -371,7 +369,7 @@
 
   FunctionTypeAliasElement functionTypeAlias(String name) {
     for (var element in unitElement.functionTypeAliases) {
-      if (element is GenericTypeAliasElement && element.name == name) {
+      if (element.name == name) {
         return element;
       }
     }
diff --git a/pkg/analyzer/pubspec.yaml b/pkg/analyzer/pubspec.yaml
index 6cb8815..19e2e98 100644
--- a/pkg/analyzer/pubspec.yaml
+++ b/pkg/analyzer/pubspec.yaml
@@ -1,5 +1,5 @@
 name: analyzer
-version: 0.40.4
+version: 0.40.5-dev
 description: This package provides a library that performs static analysis of Dart code.
 homepage: https://github.com/dart-lang/sdk/tree/master/pkg/analyzer
 
diff --git a/pkg/analyzer/test/generated/elements_types_mixin.dart b/pkg/analyzer/test/generated/elements_types_mixin.dart
index b78f503..60c16a5 100644
--- a/pkg/analyzer/test/generated/elements_types_mixin.dart
+++ b/pkg/analyzer/test/generated/elements_types_mixin.dart
@@ -215,6 +215,16 @@
     );
   }
 
+  FunctionTypeAliasElementImpl functionTypeAlias({
+    @required String name,
+    List<TypeParameterElement> typeParameters = const [],
+    @required GenericFunctionTypeElement function,
+  }) {
+    return FunctionTypeAliasElementImpl(name, 0)
+      ..typeParameters = typeParameters
+      ..function = function;
+  }
+
   FunctionType functionTypeAliasType(
     FunctionTypeAliasElement element, {
     List<DartType> typeArguments = const [],
@@ -324,16 +334,6 @@
     return result;
   }
 
-  GenericTypeAliasElementImpl genericTypeAlias({
-    @required String name,
-    List<TypeParameterElement> typeParameters = const [],
-    @required GenericFunctionTypeElement function,
-  }) {
-    return GenericTypeAliasElementImpl(name, 0)
-      ..typeParameters = typeParameters
-      ..function = function;
-  }
-
   InterfaceType interfaceType(
     ClassElement element, {
     List<DartType> typeArguments = const [],
diff --git a/pkg/analyzer/test/src/dart/analysis/driver_resolution_test.dart b/pkg/analyzer/test/src/dart/analysis/driver_resolution_test.dart
index c32e960..c58b0ca 100644
--- a/pkg/analyzer/test/src/dart/analysis/driver_resolution_test.dart
+++ b/pkg/analyzer/test/src/dart/analysis/driver_resolution_test.dart
@@ -7813,7 +7813,7 @@
     await resolveTestFile();
 
     FunctionTypeAlias alias = findNode.functionTypeAlias('F<T>');
-    GenericTypeAliasElement aliasElement = alias.declaredElement;
+    FunctionTypeAliasElement aliasElement = alias.declaredElement;
 
     FieldDeclaration fDeclaration = findNode.fieldDeclaration('F<int> f');
 
diff --git a/pkg/analyzer/test/src/dart/element/element_test.dart b/pkg/analyzer/test/src/dart/element/element_test.dart
index c86ea47..5b35e23 100644
--- a/pkg/analyzer/test/src/dart/element/element_test.dart
+++ b/pkg/analyzer/test/src/dart/element/element_test.dart
@@ -1061,10 +1061,10 @@
   }
 
   void test_equality_recursive() {
-    var s = ElementFactory.genericTypeAliasElement('s');
-    var t = ElementFactory.genericTypeAliasElement('t');
-    var u = ElementFactory.genericTypeAliasElement('u');
-    var v = ElementFactory.genericTypeAliasElement('v');
+    var s = ElementFactory.functionTypeAliasElement('s');
+    var t = ElementFactory.functionTypeAliasElement('t');
+    var u = ElementFactory.functionTypeAliasElement('u');
+    var v = ElementFactory.functionTypeAliasElement('v');
     s.function.returnType = functionTypeAliasType(t);
     t.function.returnType = functionTypeAliasType(s);
     u.function.returnType = functionTypeAliasType(v);
@@ -1207,8 +1207,8 @@
   }
 
   void test_toString_recursive() {
-    var t = ElementFactory.genericTypeAliasElement("t");
-    var s = ElementFactory.genericTypeAliasElement("s");
+    var t = ElementFactory.functionTypeAliasElement("t");
+    var s = ElementFactory.functionTypeAliasElement("s");
     t.function.returnType = functionTypeAliasType(s);
     s.function.returnType = functionTypeAliasType(t);
     assertType(
@@ -1218,7 +1218,7 @@
   }
 
   void test_toString_recursive_via_interface_type() {
-    var f = ElementFactory.genericTypeAliasElement('f');
+    var f = ElementFactory.functionTypeAliasElement('f');
     ClassElementImpl c = ElementFactory.classElement2('C', ['T']);
     f.function.returnType = c.instantiate(
       typeArguments: [functionTypeAliasType(f)],
diff --git a/pkg/analyzer/test/src/dart/element/function_type_test.dart b/pkg/analyzer/test/src/dart/element/function_type_test.dart
index 72efa9d..803d055 100644
--- a/pkg/analyzer/test/src/dart/element/function_type_test.dart
+++ b/pkg/analyzer/test/src/dart/element/function_type_test.dart
@@ -75,14 +75,14 @@
     expect(f.typeFormals, typeFormals, reason: 'typeFormals');
   }
 
-  GenericTypeAliasElementImpl genericTypeAliasElement(
+  FunctionTypeAliasElementImpl functionTypeAliasElement(
     String name, {
     List<ParameterElement> parameters = const [],
     DartType returnType,
     List<TypeParameterElement> typeParameters = const [],
     List<TypeParameterElement> innerTypeParameters = const [],
   }) {
-    var aliasElement = GenericTypeAliasElementImpl(name, 0);
+    var aliasElement = FunctionTypeAliasElementImpl(name, 0);
     aliasElement.typeParameters = typeParameters;
 
     var functionElement = GenericFunctionTypeElementImpl.forOffset(0);
diff --git a/pkg/analyzer/test/src/summary/element_text.dart b/pkg/analyzer/test/src/summary/element_text.dart
index d4fd128..45d46f2 100644
--- a/pkg/analyzer/test/src/summary/element_text.dart
+++ b/pkg/analyzer/test/src/summary/element_text.dart
@@ -418,7 +418,7 @@
     writeMetadata(e, '', '\n');
     writeIf(!e.isSimplyBounded, 'notSimplyBounded ');
 
-    if (e is GenericTypeAliasElement) {
+    if (e is FunctionTypeAliasElement) {
       buffer.write('typedef ');
       writeName(e);
       writeCodeRange(e);
diff --git a/pkg/analyzer/test/util/element_type_matchers.dart b/pkg/analyzer/test/util/element_type_matchers.dart
index 4379510..1ace6dd 100644
--- a/pkg/analyzer/test/util/element_type_matchers.dart
+++ b/pkg/analyzer/test/util/element_type_matchers.dart
@@ -30,8 +30,6 @@
 
 const isGenericFunctionTypeElement = TypeMatcher<GenericFunctionTypeElement>();
 
-const isGenericTypeAliasElement = TypeMatcher<GenericTypeAliasElement>();
-
 const isHideElementCombinator = TypeMatcher<HideElementCombinator>();
 
 const isImportElement = TypeMatcher<ImportElement>();
diff --git a/pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_dart.dart b/pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_dart.dart
index e6fb385..3c3903e 100644
--- a/pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_dart.dart
+++ b/pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_dart.dart
@@ -1188,7 +1188,7 @@
     // Typedef(s) are represented as GenericFunctionTypeElement(s).
     if (element is GenericFunctionTypeElement &&
         element.typeParameters.isEmpty &&
-        element.enclosingElement is GenericTypeAliasElement) {
+        element.enclosingElement is FunctionTypeAliasElement) {
       element = element.enclosingElement;
     }
 
diff --git a/pkg/front_end/lib/widget_cache.dart b/pkg/front_end/lib/widget_cache.dart
index 06cdb6a..5c9f6d3 100644
--- a/pkg/front_end/lib/widget_cache.dart
+++ b/pkg/front_end/lib/widget_cache.dart
@@ -14,7 +14,7 @@
   WidgetCache(Component fullComponent) {
     Library frameworkLibrary;
     for (Library library in fullComponent.libraries) {
-      if (library?.importUri?.path == _frameworkLibrary) {
+      if (library?.importUri == _frameworkLibrary) {
         frameworkLibrary = library;
         break;
       }
@@ -36,7 +36,8 @@
   Class _statefulWidget;
   bool _frameworkTypesLocated = false;
 
-  static const String _frameworkLibrary = 'flutter/src/widgets/framework.dart';
+  static final Uri _frameworkLibrary =
+      Uri.parse('package:flutter/src/widgets/framework.dart');
 
   /// Mark [uri] as invalidated.
   void invalidate(Uri uri) {
@@ -121,11 +122,9 @@
     }
 
     // Update the class references to stateless, stateful, and state classes.
-    if (classHierarchy is ClosedWorldClassHierarchy) {
-      for (Library library in classHierarchy.knownLibraries) {
-        if (library?.importUri?.path == _frameworkLibrary) {
-          _locatedClassDeclarations(library);
-        }
+    for (Library library in classHierarchy.knownLibraries) {
+      if (library?.importUri == _frameworkLibrary) {
+        _locatedClassDeclarations(library);
       }
     }
 
diff --git a/pkg/kernel/lib/class_hierarchy.dart b/pkg/kernel/lib/class_hierarchy.dart
index f0ea6cc..9f92ab0 100644
--- a/pkg/kernel/lib/class_hierarchy.dart
+++ b/pkg/kernel/lib/class_hierarchy.dart
@@ -167,6 +167,13 @@
   /// True if the given class is extended by another class using `extends`.
   bool isExtended(Class class_);
 
+  /// Returns the set of libraries for which this class hierarchy can be
+  /// queried.
+  ///
+  /// Classes outside the set of known libraries are not part of the internal
+  /// model and queries about such classes will fail.
+  Iterable<Library> get knownLibraries;
+
   /// Invokes [callback] for every member declared in or inherited by [class_]
   /// that overrides or implements a member in a supertype of [class_]
   /// (or in rare cases, overrides a member declared in [class_]).
diff --git a/pkg/kernel/test/class_hierarchy_basic.dart b/pkg/kernel/test/class_hierarchy_basic.dart
index 6179cb0..b2b9322 100644
--- a/pkg/kernel/test/class_hierarchy_basic.dart
+++ b/pkg/kernel/test/class_hierarchy_basic.dart
@@ -11,6 +11,7 @@
 /// A simple implementation of the class hierarchy interface using
 /// hash tables for everything.
 class BasicClassHierarchy implements ClassHierarchy {
+  final Set<Library> knownLibraries;
   final Map<Class, Set<Class>> superclasses = <Class, Set<Class>>{};
   final Map<Class, Set<Class>> superMixtures = <Class, Set<Class>>{};
   final Map<Class, Set<Class>> supertypes = <Class, Set<Class>>{};
@@ -26,8 +27,9 @@
   final List<Class> classes = <Class>[];
   final Map<Class, int> classIndex = <Class, int>{};
 
-  BasicClassHierarchy(Component component) {
-    for (var library in component.libraries) {
+  BasicClassHierarchy(Component component)
+      : knownLibraries = component.libraries.toSet() {
+    for (var library in knownLibraries) {
       for (var classNode in library.classes) {
         buildSuperTypeSets(classNode);
         buildSuperTypeInstantiations(classNode);
diff --git a/pkg/nnbd_migration/lib/migration_cli.dart b/pkg/nnbd_migration/lib/migration_cli.dart
index 2e6790d..6c83181 100644
--- a/pkg/nnbd_migration/lib/migration_cli.dart
+++ b/pkg/nnbd_migration/lib/migration_cli.dart
@@ -537,27 +537,6 @@
     }
   }
 
-  /// Adds a set of "core" command line options to [parser].  If [hide] is
-  /// `true`, then rarely-used options are hidden.
-  ///
-  /// This method will be removed soon; please use [options] instead, and filter
-  /// out the options you don't need.
-  @deprecated
-  static void addCoreOptions(ArgParser parser, bool hide) {
-    const nonCoreOptions = {
-      CommandLineOptions.skipPubOutdatedFlag,
-      CommandLineOptions.webPreviewFlag,
-      CommandLineOptions.summaryOption,
-      CommandLineOptions.sdkPathOption
-    };
-    for (var option in options) {
-      if (!option.isSeparator && nonCoreOptions.contains(option.name)) {
-        continue;
-      }
-      option.addToParser(parser, hide);
-    }
-  }
-
   static ArgParser createParser({bool hide = true}) {
     var parser = ArgParser();
     parser.addFlag(CommandLineOptions.helpFlag,
diff --git a/pkg/nnbd_migration/lib/src/edge_builder.dart b/pkg/nnbd_migration/lib/src/edge_builder.dart
index 762e728..962dc5e 100644
--- a/pkg/nnbd_migration/lib/src/edge_builder.dart
+++ b/pkg/nnbd_migration/lib/src/edge_builder.dart
@@ -1703,7 +1703,7 @@
       _typeNameNesting++;
       var typeArguments = typeName.typeArguments?.arguments;
       var element = typeName.name.staticElement;
-      if (element is GenericTypeAliasElement) {
+      if (element is FunctionTypeAliasElement) {
         final typedefType = _variables.decoratedElementType(element.function);
         final typeNameType =
             _variables.decoratedTypeAnnotation(source, typeName);
diff --git a/pkg/nnbd_migration/lib/src/node_builder.dart b/pkg/nnbd_migration/lib/src/node_builder.dart
index 0bdb629..7baf8e8 100644
--- a/pkg/nnbd_migration/lib/src/node_builder.dart
+++ b/pkg/nnbd_migration/lib/src/node_builder.dart
@@ -418,7 +418,7 @@
       decoratedFunctionType = node.functionType.accept(this);
     });
     _variables.recordDecoratedElementType(
-        (node.declaredElement as GenericTypeAliasElement).function,
+        (node.declaredElement as FunctionTypeAliasElement).function,
         decoratedFunctionType);
     return null;
   }
diff --git a/tests/standalone/io/windows_environment_script.dart b/tests/standalone/io/windows_environment_script.dart
index 509ed5b..9712990 100644
--- a/tests/standalone/io/windows_environment_script.dart
+++ b/tests/standalone/io/windows_environment_script.dart
@@ -7,7 +7,7 @@
 main() {
   var scriptDir = Platform.environment['SCRIPTDIR']!;
   if (!scriptDir.contains('å')) throw "scriptDir not containing character å";
-  scriptDir = Platform.environment['ScriptDir'];
+  scriptDir = Platform.environment['ScriptDir']!;
   if (!scriptDir.contains('å')) throw "scriptDir not containing character å";
   var str = new File('$scriptDir/funky.bat').readAsStringSync();
   if (!str.contains('%~dp0')) throw "str not containing dp0";
diff --git a/tests/standalone/io/windows_environment_test.dart b/tests/standalone/io/windows_environment_test.dart
index d2698c2..f5fbe55 100644
--- a/tests/standalone/io/windows_environment_test.dart
+++ b/tests/standalone/io/windows_environment_test.dart
@@ -2,6 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+// OtherResources=windows_environment_script.dart
+
 import 'package:path/path.dart';
 import 'package:expect/expect.dart';
 import "dart:io";
@@ -12,15 +14,19 @@
   var funkyDir = new Directory(join(tempDir.path, 'å'));
   funkyDir.createSync();
   var funkyFile = new File(join(funkyDir.path, 'funky.bat'));
+  final vmOptions = Platform.executableArguments.join(' ');
   funkyFile.writeAsStringSync("""
 @echo off
 set SCRIPTDIR=%~dp0
-%1 %2
+echo %1 $vmOptions %2
+%1 $vmOptions %2
       """);
   var dart = Platform.executable;
   var script =
       Platform.script.resolve('windows_environment_script.dart').toFilePath();
   Process.run('cmd', ['/c', funkyFile.path, dart, script]).then((p) {
+    print('stdout: ${p.stdout}');
+    print('stderr: ${p.stderr}');
     if (0 != p.exitCode) throw "Exit code not 0";
     tempDir.deleteSync(recursive: true);
   });
diff --git a/tests/standalone_2/io/windows_environment_test.dart b/tests/standalone_2/io/windows_environment_test.dart
index d2698c2..f5fbe55 100644
--- a/tests/standalone_2/io/windows_environment_test.dart
+++ b/tests/standalone_2/io/windows_environment_test.dart
@@ -2,6 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+// OtherResources=windows_environment_script.dart
+
 import 'package:path/path.dart';
 import 'package:expect/expect.dart';
 import "dart:io";
@@ -12,15 +14,19 @@
   var funkyDir = new Directory(join(tempDir.path, 'å'));
   funkyDir.createSync();
   var funkyFile = new File(join(funkyDir.path, 'funky.bat'));
+  final vmOptions = Platform.executableArguments.join(' ');
   funkyFile.writeAsStringSync("""
 @echo off
 set SCRIPTDIR=%~dp0
-%1 %2
+echo %1 $vmOptions %2
+%1 $vmOptions %2
       """);
   var dart = Platform.executable;
   var script =
       Platform.script.resolve('windows_environment_script.dart').toFilePath();
   Process.run('cmd', ['/c', funkyFile.path, dart, script]).then((p) {
+    print('stdout: ${p.stdout}');
+    print('stderr: ${p.stderr}');
     if (0 != p.exitCode) throw "Exit code not 0";
     tempDir.deleteSync(recursive: true);
   });
diff --git a/tools/VERSION b/tools/VERSION
index 5634bb0..f320424 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
 MAJOR 2
 MINOR 11
 PATCH 0
-PRERELEASE 223
+PRERELEASE 224
 PRERELEASE_PATCH 0
\ No newline at end of file