Version 2.18.0-13.0.dev
Merge commit '02fc734b9990307f833ab8b6ca2a42b263a6931a' into 'dev'
diff --git a/pkg/analysis_server/lib/src/services/pub/pub_command.dart b/pkg/analysis_server/lib/src/services/pub/pub_command.dart
index 2351441..234d5ee 100644
--- a/pkg/analysis_server/lib/src/services/pub/pub_command.dart
+++ b/pkg/analysis_server/lib/src/services/pub/pub_command.dart
@@ -26,7 +26,6 @@
final InstrumentationService _instrumentationService;
late final ProcessRunner _processRunner;
- late final String _pubPath;
late final String _pubEnvironmentValue;
/// Active processes that should be killed when shutting down.
@@ -42,11 +41,6 @@
var _lastQueuedCommand = Future<void>.value();
PubCommand(this._instrumentationService, this._processRunner) {
- _pubPath = path.join(
- path.dirname(Platform.resolvedExecutable),
- Platform.isWindows ? 'pub.bat' : 'pub',
- );
-
// When calling the `pub` command, we must add an identifier to the
// PUB_ENVIRONMENT environment variable (joined with colons).
const _pubEnvString = 'analysis_server.pub_api';
@@ -114,10 +108,9 @@
await lastCommand.catchError((_) {});
try {
- final command = [_pubPath, ...args];
-
- _instrumentationService.logInfo('Starting pub command $command');
- final process = await _processRunner.start(_pubPath, args,
+ _instrumentationService.logInfo('Starting pub command $args');
+ final process = await _processRunner.start(
+ Platform.resolvedExecutable, ['pub', ...args],
workingDirectory: workingDirectory,
environment: {_pubEnvironmentKey: _pubEnvironmentValue});
_activeProcesses.add(process);
diff --git a/pkg/analysis_server/test/lsp/pub_package_service_test.dart b/pkg/analysis_server/test/lsp/pub_package_service_test.dart
index 83f4023..269cb64 100644
--- a/pkg/analysis_server/test/lsp/pub_package_service_test.dart
+++ b/pkg/analysis_server/test/lsp/pub_package_service_test.dart
@@ -134,14 +134,11 @@
Future<void> test_outdated_args() async {
processRunner.startHandler = (executable, args, {dir, env}) {
- var expectedPubPath = path.join(
- path.dirname(Platform.resolvedExecutable),
- Platform.isWindows ? 'pub.bat' : 'pub',
- );
- expect(executable, equals(expectedPubPath));
+ expect(executable, Platform.resolvedExecutable);
expect(
args,
equals([
+ 'pub',
'outdated',
'--show-all',
'--json',
diff --git a/pkg/analyzer/lib/src/dart/resolver/annotation_resolver.dart b/pkg/analyzer/lib/src/dart/resolver/annotation_resolver.dart
index f43c056..e50459e 100644
--- a/pkg/analyzer/lib/src/dart/resolver/annotation_resolver.dart
+++ b/pkg/analyzer/lib/src/dart/resolver/annotation_resolver.dart
@@ -115,11 +115,10 @@
resolver: _resolver,
node: node,
argumentList: argumentList,
- rawType: null,
contextType: null,
whyNotPromotedList: whyNotPromotedList,
constructorName: constructorName)
- .resolveInvocation();
+ .resolveInvocation(rawType: null);
return;
}
@@ -133,11 +132,10 @@
resolver: _resolver,
node: node,
argumentList: argumentList,
- rawType: constructorRawType,
contextType: null,
whyNotPromotedList: whyNotPromotedList,
constructorName: constructorName)
- .resolveInvocation();
+ .resolveInvocation(rawType: constructorRawType);
}
void _extensionGetter(
@@ -407,11 +405,10 @@
resolver: _resolver,
node: node,
argumentList: arguments,
- rawType: null,
contextType: null,
whyNotPromotedList: whyNotPromotedList,
constructorName: null)
- .resolveInvocation();
+ .resolveInvocation(rawType: null);
}
}
}
diff --git a/pkg/analyzer/lib/src/dart/resolver/function_expression_invocation_resolver.dart b/pkg/analyzer/lib/src/dart/resolver/function_expression_invocation_resolver.dart
index 03d4601..26bb256 100644
--- a/pkg/analyzer/lib/src/dart/resolver/function_expression_invocation_resolver.dart
+++ b/pkg/analyzer/lib/src/dart/resolver/function_expression_invocation_resolver.dart
@@ -119,10 +119,9 @@
resolver: _resolver,
node: node,
argumentList: node.argumentList,
- rawType: rawType,
whyNotPromotedList: whyNotPromotedList,
contextType: contextType,
- ).resolveInvocation();
+ ).resolveInvocation(rawType: rawType);
_inferenceHelper.recordStaticType(node, returnType,
contextType: contextType);
@@ -209,10 +208,9 @@
resolver: _resolver,
node: node,
argumentList: node.argumentList,
- rawType: null,
contextType: contextType,
whyNotPromotedList: whyNotPromotedList)
- .resolveInvocation();
+ .resolveInvocation(rawType: null);
node.staticInvokeType = DynamicTypeImpl.instance;
node.staticType = type;
}
diff --git a/pkg/analyzer/lib/src/dart/resolver/instance_creation_expression_resolver.dart b/pkg/analyzer/lib/src/dart/resolver/instance_creation_expression_resolver.dart
index 7445573..71472fa 100644
--- a/pkg/analyzer/lib/src/dart/resolver/instance_creation_expression_resolver.dart
+++ b/pkg/analyzer/lib/src/dart/resolver/instance_creation_expression_resolver.dart
@@ -66,10 +66,9 @@
resolver: _resolver,
node: node,
argumentList: node.argumentList,
- rawType: elementToInfer?.asType,
contextType: contextType,
whyNotPromotedList: whyNotPromotedList)
- .resolveInvocation();
+ .resolveInvocation(rawType: elementToInfer?.asType);
_resolver.inferenceHelper.recordStaticType(
node, node.constructorName.type.type!,
contextType: contextType);
diff --git a/pkg/analyzer/lib/src/dart/resolver/invocation_inference_helper.dart b/pkg/analyzer/lib/src/dart/resolver/invocation_inference_helper.dart
index 495866a..ee320b5 100644
--- a/pkg/analyzer/lib/src/dart/resolver/invocation_inference_helper.dart
+++ b/pkg/analyzer/lib/src/dart/resolver/invocation_inference_helper.dart
@@ -174,10 +174,9 @@
resolver: _resolver,
node: node,
argumentList: node.argumentList,
- rawType: rawType,
contextType: contextType,
whyNotPromotedList: whyNotPromotedList,
- ).resolveInvocation();
+ ).resolveInvocation(rawType: rawType);
recordStaticType(node, returnType, contextType: contextType);
}
diff --git a/pkg/analyzer/lib/src/dart/resolver/invocation_inferrer.dart b/pkg/analyzer/lib/src/dart/resolver/invocation_inferrer.dart
index fe15873..2c82679 100644
--- a/pkg/analyzer/lib/src/dart/resolver/invocation_inferrer.dart
+++ b/pkg/analyzer/lib/src/dart/resolver/invocation_inferrer.dart
@@ -61,7 +61,6 @@
{required ResolverVisitor resolver,
required AnnotationImpl node,
required ArgumentListImpl argumentList,
- required FunctionType? rawType,
required DartType? contextType,
required List<WhyNotPromotedGetter> whyNotPromotedList,
required this.constructorName})
@@ -69,7 +68,6 @@
resolver: resolver,
node: node,
argumentList: argumentList,
- rawType: rawType,
contextType: contextType,
whyNotPromotedList: whyNotPromotedList);
@@ -113,14 +111,12 @@
{required ResolverVisitor resolver,
required Node node,
required ArgumentListImpl argumentList,
- required FunctionType? rawType,
required DartType? contextType,
required List<WhyNotPromotedGetter> whyNotPromotedList})
: super(
resolver: resolver,
node: node,
argumentList: argumentList,
- rawType: rawType,
contextType: contextType,
whyNotPromotedList: whyNotPromotedList);
@@ -138,9 +134,8 @@
CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_METHOD;
@override
- DartType resolveInvocation() {
+ DartType resolveInvocation({required FunctionType? rawType}) {
var typeArgumentList = _typeArguments;
- var rawType = this.rawType;
List<DartType>? typeArgumentTypes;
GenericInferrer? inferrer;
@@ -202,7 +197,7 @@
} else if (rawType == null || rawType.typeFormals.isEmpty) {
typeArgumentTypes = const <DartType>[];
} else {
- this.rawType = rawType = getFreshTypeParameters(rawType.typeFormals)
+ rawType = getFreshTypeParameters(rawType.typeFormals)
.applyToFunctionType(rawType);
inferrer = resolver.typeSystem.setupGenericTypeInference(
@@ -233,7 +228,8 @@
resolver.typeSystem,
deferredClosures,
rawType?.typeFormals.toSet() ?? const {},
- _computeUndeferredParamInfo(parameterMap, deferredClosures))
+ _computeUndeferredParamInfo(
+ rawType, parameterMap, deferredClosures))
.planReconciliationStages()) {
if (inferrer != null && !isFirstStage) {
substitution = Substitution.fromPairs(
@@ -273,6 +269,7 @@
/// Computes a list of [_ParamInfo] objects corresponding to the invocation
/// parameters that were *not* deferred.
List<_ParamInfo> _computeUndeferredParamInfo(
+ FunctionType? rawType,
Map<Object, ParameterElement> parameterMap,
List<_DeferredParamInfo> deferredClosures) {
if (rawType == null) return const [];
@@ -315,14 +312,12 @@
{required ResolverVisitor resolver,
required FunctionExpressionInvocationImpl node,
required ArgumentListImpl argumentList,
- required FunctionType? rawType,
required DartType? contextType,
required List<WhyNotPromotedGetter> whyNotPromotedList})
: super._(
resolver: resolver,
node: node,
argumentList: argumentList,
- rawType: rawType,
contextType: contextType,
whyNotPromotedList: whyNotPromotedList);
@@ -338,14 +333,12 @@
{required ResolverVisitor resolver,
required InstanceCreationExpressionImpl node,
required ArgumentListImpl argumentList,
- required FunctionType? rawType,
required DartType? contextType,
required List<WhyNotPromotedGetter> whyNotPromotedList})
: super._(
resolver: resolver,
node: node,
argumentList: argumentList,
- rawType: rawType,
contextType: contextType,
whyNotPromotedList: whyNotPromotedList);
@@ -397,14 +390,12 @@
{required ResolverVisitor resolver,
required Node node,
required ArgumentListImpl argumentList,
- required FunctionType? rawType,
required DartType? contextType,
required List<WhyNotPromotedGetter> whyNotPromotedList})
: super._(
resolver: resolver,
node: node,
argumentList: argumentList,
- rawType: rawType,
contextType: contextType,
whyNotPromotedList: whyNotPromotedList);
@@ -432,18 +423,15 @@
final ResolverVisitor resolver;
final Node node;
final ArgumentListImpl argumentList;
- FunctionType? rawType;
final DartType? contextType;
final List<WhyNotPromotedGetter> whyNotPromotedList;
/// Prepares to perform type inference on an invocation expression of type
- /// [Node]. [rawType] should be the type of the function the invocation is
- /// resolved to (with type arguments not applied yet).
+ /// [Node].
InvocationInferrer(
{required this.resolver,
required this.node,
required this.argumentList,
- required this.rawType,
required this.contextType,
required this.whyNotPromotedList});
@@ -451,8 +439,10 @@
/// `identical` (which needs special flow analysis treatment).
bool get _isIdentical => false;
- /// Performs type inference on the invocation expression.
- void resolveInvocation() {
+ /// Performs type inference on the invocation expression. [rawType] should be
+ /// the type of the function the invocation is resolved to (with type
+ /// arguments not applied yet).
+ void resolveInvocation({required FunctionType? rawType}) {
var deferredClosures = _visitArguments(
parameterMap: _computeParameterMap(rawType?.parameters ?? const []));
if (deferredClosures != null) {
@@ -591,14 +581,12 @@
{required ResolverVisitor resolver,
required MethodInvocationImpl node,
required ArgumentListImpl argumentList,
- required FunctionType? rawType,
required DartType? contextType,
required List<WhyNotPromotedGetter> whyNotPromotedList})
: super._(
resolver: resolver,
node: node,
argumentList: argumentList,
- rawType: rawType,
contextType: contextType,
whyNotPromotedList: whyNotPromotedList);
diff --git a/pkg/analyzer/lib/src/dart/resolver/method_invocation_resolver.dart b/pkg/analyzer/lib/src/dart/resolver/method_invocation_resolver.dart
index 081bb5d..e7d3b26 100644
--- a/pkg/analyzer/lib/src/dart/resolver/method_invocation_resolver.dart
+++ b/pkg/analyzer/lib/src/dart/resolver/method_invocation_resolver.dart
@@ -332,10 +332,9 @@
resolver: _resolver,
node: node,
argumentList: node.argumentList,
- rawType: rawType is FunctionType ? rawType : null,
contextType: contextType,
whyNotPromotedList: whyNotPromotedList)
- .resolveInvocation();
+ .resolveInvocation(rawType: rawType is FunctionType ? rawType : null);
_inferenceHelper.recordStaticType(node, staticStaticType,
contextType: contextType);
}
@@ -478,10 +477,9 @@
resolver: _resolver,
node: node,
argumentList: node.argumentList,
- rawType: rawType,
whyNotPromotedList: whyNotPromotedList,
contextType: contextType)
- .resolveInvocation();
+ .resolveInvocation(rawType: rawType);
}
void _resolveReceiverFunctionBounded(
@@ -553,10 +551,9 @@
resolver: _resolver,
node: node,
argumentList: node.argumentList,
- rawType: null,
contextType: contextType,
whyNotPromotedList: whyNotPromotedList)
- .resolveInvocation();
+ .resolveInvocation(rawType: null);
_resolver.errorReporter.reportErrorForNode(
HintCode.RECEIVER_OF_TYPE_NEVER,
@@ -574,10 +571,9 @@
resolver: _resolver,
node: node,
argumentList: node.argumentList,
- rawType: null,
contextType: contextType,
whyNotPromotedList: whyNotPromotedList)
- .resolveInvocation();
+ .resolveInvocation(rawType: null);
return;
}
}
diff --git a/pkg/analyzer/lib/src/generated/resolver.dart b/pkg/analyzer/lib/src/generated/resolver.dart
index b757ae5..0d4d071 100644
--- a/pkg/analyzer/lib/src/generated/resolver.dart
+++ b/pkg/analyzer/lib/src/generated/resolver.dart
@@ -1545,6 +1545,9 @@
resolver: this,
node: node,
argumentList: node.argumentList,
+ contextType: null,
+ whyNotPromotedList: whyNotPromotedList)
+ .resolveInvocation(
rawType: receiverContextType == null
? null
: FunctionTypeImpl(
@@ -1554,10 +1557,7 @@
null, receiverContextType, ParameterKind.REQUIRED)
],
returnType: DynamicTypeImpl.instance,
- nullabilitySuffix: NullabilitySuffix.none),
- contextType: null,
- whyNotPromotedList: whyNotPromotedList)
- .resolveInvocation();
+ nullabilitySuffix: NullabilitySuffix.none));
extensionResolver.resolveOverride(node, whyNotPromotedList);
}
@@ -2170,10 +2170,9 @@
resolver: this,
node: node,
argumentList: node.argumentList,
- rawType: node.staticElement?.type,
contextType: null,
whyNotPromotedList: whyNotPromotedList)
- .resolveInvocation();
+ .resolveInvocation(rawType: node.staticElement?.type);
checkForArgumentTypesNotAssignableInList(
node.argumentList, whyNotPromotedList);
}
@@ -2280,10 +2279,9 @@
resolver: this,
node: node,
argumentList: node.argumentList,
- rawType: node.staticElement?.type,
contextType: null,
whyNotPromotedList: whyNotPromotedList)
- .resolveInvocation();
+ .resolveInvocation(rawType: node.staticElement?.type);
checkForArgumentTypesNotAssignableInList(
node.argumentList, whyNotPromotedList);
}
diff --git a/pkg/analyzer/test/src/dart/sdk/sdk_test.dart b/pkg/analyzer/test/src/dart/sdk/sdk_test.dart
index ebc6338..af30a09 100644
--- a/pkg/analyzer/test/src/dart/sdk/sdk_test.dart
+++ b/pkg/analyzer/test/src/dart/sdk/sdk_test.dart
@@ -5,7 +5,6 @@
import 'package:analyzer/file_system/file_system.dart';
import 'package:analyzer/src/context/builder.dart' show EmbedderYamlLocator;
import 'package:analyzer/src/dart/sdk/sdk.dart';
-import 'package:analyzer/src/generated/java_engine_io.dart';
import 'package:analyzer/src/generated/sdk.dart';
import 'package:analyzer/src/test_utilities/resource_provider_mixin.dart';
import 'package:pub_semver/pub_semver.dart';
@@ -192,13 +191,6 @@
expect(directory.exists, isTrue);
}
- void test_getPubExecutable() {
- FolderBasedDartSdk sdk = _createDartSdk();
- File executable = sdk.pubExecutable;
- expect(executable, isNotNull);
- expect(executable.exists, isTrue);
- }
-
void test_getSdkVersion() {
FolderBasedDartSdk sdk = _createDartSdk();
String version = sdk.sdkVersion;
@@ -222,7 +214,6 @@
content: _librariesFileContent());
_createFile(sdkDirectory, ['bin', 'dart']);
_createFile(sdkDirectory, ['bin', 'dart2js']);
- _createFile(sdkDirectory, ['bin', 'pub']);
_createFile(sdkDirectory, ['lib', 'async', 'async.dart']);
_createFile(sdkDirectory, ['lib', 'core', 'core.dart']);
_createFile(sdkDirectory, ['lib', 'core', 'num.dart']);
@@ -231,8 +222,6 @@
_createFile(sdkDirectory,
['lib', 'html', 'html_common', 'html_common_dart2js.dart']);
_createFile(sdkDirectory, ['lib', 'html', 'dart2js', 'html_dart2js.dart']);
- _createFile(
- sdkDirectory, ['bin', (OSUtilities.isWindows() ? 'pub.bat' : 'pub')]);
return FolderBasedDartSdk(resourceProvider, sdkDirectory);
}
diff --git a/tools/VERSION b/tools/VERSION
index 84d1f8d..c811137 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 2
MINOR 18
PATCH 0
-PRERELEASE 12
+PRERELEASE 13
PRERELEASE_PATCH 0
\ No newline at end of file