anchor.diff:          return;
         } else if (typeArguments.length == 2) {
           (node as SetOrMapLiteralImpl).becomeMap();
  -        var keyType = _getType(typeArguments[0]) ?? _dynamicType;
  -        var valueType = _getType(typeArguments[1]) ?? _dynamicType;
  +        var keyType = typeArguments[0].type;
  +        var valueType = typeArguments[1].type;
           _recordStaticType(
             node,
             _typeProvider.mapElement.instantiate(
  
positive.code:       }
      }
      return _LiteralResolution(_LiteralResolutionKind.ambiguous, null);
    }
  
    /**
     * Return the type represented by the given type [annotation].
     *
     * TODO(scheglov) This method should not exist.
     */
    DartType _getType(TypeAnnotation annotation) {
      DartType type = annotation.type;
      if (type == null) {
        //TODO(brianwilkerson) Determine the conditions for which the type is
        // null.
        return _dynamicType;
      }
      return type;
    }
  
    _InferredCollectionElementTypeInformation _inferCollectionElementType(
  
negative.code:     if (typeArguments != null) {
        if (typeArguments.length == 1) {
          (node as SetOrMapLiteralImpl).becomeSet();
          var elementType = typeArguments[0].type;
          _recordStaticType(
            node,
            _typeProvider.setElement.instantiate(
  