Version 2.12.0-128.0.dev
Merge commit 'c7519a3f01b4ee1b631d97c6aaba780bcc5fc32d' into 'dev'
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b0d0877..60d6806 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -117,9 +117,23 @@
* New command `dart pub add` that adds new dependencies to your `pubspec.yaml`.
And a corresponding `dart pub remove` that removes dependencies.
+* New option `dart pub upgrade --major-versions` will update constraints in
+ your `pubspec.yaml` to match the the _resolvable_ column reported in
+ `dart pub outdated`. This allows users to easily upgrade to latest version for
+ all dependencies where this is possible, even if such upgrade requires an
+ update to the version constraint in `pubspec.yaml`.
+
+ It is also possible to only upgrade the major version for a subset of your
+ dependencies using `dart pub upgrade --major-versions <dependencies...>`.
+* New option `dart pub upgrade --null-safety` will attempt to update constraints
+ in your `pubspec.yaml`, such that only null-safety migrated versions of
+ dependencies are allowed.
* New option `dart pub outdated --mode=null-safety` that will analyze your
dependencies for null-safety.
* `dart pub publish` will now check your pubspec keys for likely typos.
+* `dart pub upgrade package_foo` will fetch dependencies, but ignore the
+ `pubspec.lock` for `package_foo`, allowing users to only upgrade a subset of
+ dependencies.
* New command `dart pub login` that logs in to pub.dev.
* The `--server` option to `dart pub publish` and `dart pub uploader` have been
deprecated. Use `publish_to` in your `pubspec.yaml` or set the
diff --git a/DEPS b/DEPS
index 1dd8ce4..be29f0a 100644
--- a/DEPS
+++ b/DEPS
@@ -133,7 +133,7 @@
"ply_rev": "604b32590ffad5cbb82e4afef1d305512d06ae93",
"pool_rev": "7abe634002a1ba8a0928eded086062f1307ccfae",
"protobuf_rev": "0d03fd588df69e9863e2a2efc0059dee8f18d5b2",
- "pub_rev": "228e69e53862879c283c42b98086aa7536012a66",
+ "pub_rev": "a7e448b2b4743cebfc464b7973019c57f0a3b5a1",
"pub_semver_rev": "10569a1e867e909cf5db201f73118020453e5db8",
"resource_rev": "6b79867d0becf5395e5819a75720963b8298e9a7",
"root_certificates_rev": "7e5ec82c99677a2e5b95ce296c4d68b0d3378ed8",
diff --git a/pkg/_fe_analyzer_shared/test/inheritance/data/object_opt_in/core.dart b/pkg/_fe_analyzer_shared/test/inheritance/data/object_opt_in/core.dart
index 65dfce3..da9e41a 100644
--- a/pkg/_fe_analyzer_shared/test/inheritance/data/object_opt_in/core.dart
+++ b/pkg/_fe_analyzer_shared/test/inheritance/data/object_opt_in/core.dart
@@ -9,6 +9,8 @@
export 'dart:async' show Future;
+bool identical(a, b) => false;
+
/*class: Object:Object*/
class Object {
const Object();
diff --git a/pkg/_fe_analyzer_shared/test/inheritance/data/object_opt_out/core.dart b/pkg/_fe_analyzer_shared/test/inheritance/data/object_opt_out/core.dart
index 2712fa3..0df65e1 100644
--- a/pkg/_fe_analyzer_shared/test/inheritance/data/object_opt_out/core.dart
+++ b/pkg/_fe_analyzer_shared/test/inheritance/data/object_opt_out/core.dart
@@ -13,6 +13,8 @@
export 'dart:async' show Future;
+bool identical(a, b) => false;
+
/*class: Object:Object*/
class Object {
const Object();
diff --git a/pkg/front_end/lib/src/fasta/builder/procedure_builder.dart b/pkg/front_end/lib/src/fasta/builder/procedure_builder.dart
index d1c7d3b..18d69f7 100644
--- a/pkg/front_end/lib/src/fasta/builder/procedure_builder.dart
+++ b/pkg/front_end/lib/src/fasta/builder/procedure_builder.dart
@@ -822,7 +822,8 @@
function.returnType,
charOffset,
target.function.computeFunctionType(Nullability.nonNullable),
- targetInvocationArguments);
+ targetInvocationArguments,
+ staticTarget: target);
List<DartType> typeArguments;
if (result.inferredType is InterfaceType) {
typeArguments = (result.inferredType as InterfaceType).typeArguments;
diff --git a/pkg/front_end/lib/src/fasta/kernel/inference_visitor.dart b/pkg/front_end/lib/src/fasta/kernel/inference_visitor.dart
index 360130c..e426f0b 100644
--- a/pkg/front_end/lib/src/fasta/kernel/inference_visitor.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/inference_visitor.dart
@@ -422,7 +422,7 @@
computeConstructorReturnType(node.target, inferrer.coreTypes));
InvocationInferenceResult result = inferrer.inferInvocation(
typeContext, node.fileOffset, functionType, node.arguments,
- isConst: node.isConst);
+ isConst: node.isConst, staticTarget: node.target);
if (!inferrer.isTopLevel) {
SourceLibraryBuilder library = inferrer.library;
if (!hasExplicitTypeArguments) {
@@ -450,7 +450,8 @@
[], const DynamicType(), inferrer.library.nonNullable);
TypeArgumentsInfo typeArgumentsInfo = getTypeArgumentsInfo(node.arguments);
InvocationInferenceResult result = inferrer.inferInvocation(
- typeContext, node.fileOffset, calleeType, node.arguments);
+ typeContext, node.fileOffset, calleeType, node.arguments,
+ staticTarget: node.target);
Expression replacement = new StaticInvocation(node.target, node.arguments);
if (!inferrer.isTopLevel && node.target != null) {
inferrer.library.checkBoundsInStaticInvocation(
@@ -711,7 +712,7 @@
InvocationInferenceResult result = inferrer.inferInvocation(
typeContext, node.fileOffset, functionType, node.arguments,
- isConst: node.isConst);
+ isConst: node.isConst, staticTarget: node.target);
node.hasBeenInferred = true;
Expression resultNode = node;
if (!inferrer.isTopLevel) {
@@ -742,7 +743,7 @@
calleeType = replaceReturnType(calleeType, calleeType.returnType.unalias);
InvocationInferenceResult result = inferrer.inferInvocation(
typeContext, node.fileOffset, calleeType, node.arguments,
- isConst: node.isConst);
+ isConst: node.isConst, staticTarget: node.target);
node.hasBeenInferred = true;
Expression resultNode = node;
if (!inferrer.isTopLevel) {
@@ -770,7 +771,7 @@
calleeType = replaceReturnType(calleeType, calleeType.returnType.unalias);
InvocationInferenceResult result = inferrer.inferInvocation(
typeContext, node.fileOffset, calleeType, node.arguments,
- isConst: node.isConst);
+ isConst: node.isConst, staticTarget: node.target);
node.hasBeenInferred = true;
Expression resultNode = node;
if (!inferrer.isTopLevel) {
@@ -5126,7 +5127,7 @@
node.target.enclosingClass, inferrer.library.nonNullable));
inferrer.inferInvocation(
null, node.fileOffset, functionType, node.arguments,
- skipTypeArgumentInference: true);
+ skipTypeArgumentInference: true, staticTarget: node.target);
ArgumentsImpl.removeNonInferrableArgumentTypes(node.arguments);
}
@@ -5294,7 +5295,8 @@
[], const DynamicType(), inferrer.library.nonNullable);
TypeArgumentsInfo typeArgumentsInfo = getTypeArgumentsInfo(node.arguments);
InvocationInferenceResult result = inferrer.inferInvocation(
- typeContext, node.fileOffset, calleeType, node.arguments);
+ typeContext, node.fileOffset, calleeType, node.arguments,
+ staticTarget: node.target);
if (!inferrer.isTopLevel && node.target != null) {
inferrer.library.checkBoundsInStaticInvocation(
node,
@@ -5341,7 +5343,7 @@
inferrer.thisType);
inferrer.inferInvocation(
null, node.fileOffset, functionType, node.arguments,
- skipTypeArgumentInference: true);
+ skipTypeArgumentInference: true, staticTarget: node.target);
}
@override
diff --git a/pkg/front_end/lib/src/fasta/source/source_loader.dart b/pkg/front_end/lib/src/fasta/source/source_loader.dart
index 08b4b51..e28997d 100644
--- a/pkg/front_end/lib/src/fasta/source/source_loader.dart
+++ b/pkg/front_end/lib/src/fasta/source/source_loader.dart
@@ -1438,6 +1438,8 @@
print(object) {}
+bool identical(a, b) => false;
+
class Iterator<E> {
bool moveNext() => null;
E get current => null;
diff --git a/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart b/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
index 2b1cf58..addccd7 100644
--- a/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
+++ b/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
@@ -1834,7 +1834,8 @@
bool skipTypeArgumentInference: false,
bool isConst: false,
bool isImplicitExtensionMember: false,
- bool isImplicitCall: false}) {
+ bool isImplicitCall: false,
+ Member staticTarget}) {
int extensionTypeParameterCount = getExtensionTypeParameterCount(arguments);
if (extensionTypeParameterCount != 0) {
return _inferGenericExtensionMethodInvocation(extensionTypeParameterCount,
@@ -1854,7 +1855,8 @@
skipTypeArgumentInference: skipTypeArgumentInference,
isConst: isConst,
isImplicitExtensionMember: isImplicitExtensionMember,
- isImplicitCall: isImplicitCall);
+ isImplicitCall: isImplicitCall,
+ staticTarget: staticTarget);
}
InvocationInferenceResult _inferGenericExtensionMethodInvocation(
@@ -1870,7 +1872,8 @@
bool skipTypeArgumentInference: false,
bool isConst: false,
bool isImplicitExtensionMember: false,
- bool isImplicitCall: false}) {
+ bool isImplicitCall: false,
+ Member staticTarget}) {
FunctionType extensionFunctionType = new FunctionType(
[calleeType.positionalParameters.first],
const DynamicType(),
@@ -1887,7 +1890,8 @@
skipTypeArgumentInference: skipTypeArgumentInference,
receiverType: receiverType,
isImplicitExtensionMember: isImplicitExtensionMember,
- isImplicitCall: isImplicitCall);
+ isImplicitCall: isImplicitCall,
+ staticTarget: staticTarget);
Substitution extensionSubstitution = Substitution.fromPairs(
extensionFunctionType.typeParameters, extensionArguments.types);
@@ -1914,7 +1918,8 @@
isSpecialCasedTernaryOperator: isSpecialCasedTernaryOperator,
skipTypeArgumentInference: skipTypeArgumentInference,
isConst: isConst,
- isImplicitCall: isImplicitCall);
+ isImplicitCall: isImplicitCall,
+ staticTarget: staticTarget);
arguments.positional.clear();
arguments.positional.addAll(extensionArguments.positional);
arguments.positional.addAll(targetArguments.positional);
@@ -1942,7 +1947,8 @@
bool skipTypeArgumentInference: false,
bool isConst: false,
bool isImplicitExtensionMember: false,
- bool isImplicitCall}) {
+ bool isImplicitCall,
+ Member staticTarget}) {
List<TypeParameter> calleeTypeParameters = calleeType.typeParameters;
if (calleeTypeParameters.isNotEmpty) {
// It's possible that one of the callee type parameters might match a type
@@ -2004,11 +2010,8 @@
new List<DartType>.filled(
calleeTypeParameters.length, const DynamicType()));
}
- TreeNode parent = arguments.parent;
- bool isIdentical = arguments.positional.length == 2 &&
- parent is StaticInvocation &&
- parent.target.name.name == 'identical' &&
- parent.target.parent == typeSchemaEnvironment.coreTypes.coreLibrary;
+ bool isIdentical =
+ staticTarget == typeSchemaEnvironment.coreTypes.identicalProcedure;
// TODO(paulberry): if we are doing top level inference and type arguments
// were omitted, report an error.
for (int position = 0; position < arguments.positional.length; position++) {
diff --git a/sdk/lib/core/list.dart b/sdk/lib/core/list.dart
index 8cb3cc8..78575ba 100644
--- a/sdk/lib/core/list.dart
+++ b/sdk/lib/core/list.dart
@@ -742,7 +742,7 @@
* in numerical order.
*
* List<String> words = ['fee', 'fi', 'fo', 'fum'];
- * Map<int, String> map = words.asMap();
+ * Map<int, String> map = words.asMap(); // {0: fee, 1: fi, 2: fo, 3: fum}
* map[0] + map[1]; // 'feefi';
* map.keys.toList(); // [0, 1, 2, 3]
*/
diff --git a/tools/VERSION b/tools/VERSION
index c02a7f6..91de3c0 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 2
MINOR 12
PATCH 0
-PRERELEASE 127
+PRERELEASE 128
PRERELEASE_PATCH 0
\ No newline at end of file