Skip to content

Commit fe12b05

Browse files
author
Dart CI
committed
Version 2.12.0-27.0.dev
Merge commit 'd54e2bb56805ecfdfd8202352e3c69a225b567be' into 'dev'
2 parents 1936a7d + d54e2bb commit fe12b05

File tree

672 files changed

+3289
-3386
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

672 files changed

+3289
-3386
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,9 @@ Updated the Linter to `0.1.123`, which includes:
9191
* New option `dart pub outdated mode=null-safety` that will analyze your
9292
dependencies for null-safety.
9393
* `dart pub publish` will now check your pubspec keys for likely typos.
94-
* `pub get` will print a warning if the resolution is in mixed-mode requiring
94+
* `dart pub get` will print a warning if the resolution is in mixed-mode requiring
9595
the code to run with `dart --no-sound-null-safety`.
96+
* New command `dart pub login` that logs in to pub.dev.
9697

9798
## 2.10.3 - 2020-10-29
9899

DEPS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ vars = {
4444
# co19 is a cipd package. Use update.sh in tests/co19[_2] to update these
4545
# hashes. It requires access to the dart-build-access group, which EngProd
4646
# has.
47-
"co19_rev": "2111e4f933e262e8b127bbbae766609463364a67",
47+
"co19_rev": "de1f3498dff1091b7ca715eb7f831e24ec1a8c64",
4848
"co19_2_rev": "e48b3090826cf40b8037648f19d211e8eab1b4b6",
4949

5050
# The internal benchmarks to use. See go/dart-benchmarks-internal
@@ -132,7 +132,7 @@ vars = {
132132
"ply_rev": "604b32590ffad5cbb82e4afef1d305512d06ae93",
133133
"pool_rev": "eedbd5fde84f9a1a8da643b475305a81841da599",
134134
"protobuf_rev": "3746c8fd3f2b0147623a8e3db89c3ff4330de760",
135-
"pub_rev": "5b4df5a6f931c63622ac349602d6ef0367e8070f",
135+
"pub_rev": "900e796a37fd9f68de9dd183cf4798fe5f055eaa",
136136
"pub_semver_tag": "v1.4.4",
137137
"resource_rev": "6b79867d0becf5395e5819a75720963b8298e9a7",
138138
"root_certificates_rev": "7e5ec82c99677a2e5b95ce296c4d68b0d3378ed8",

pkg/compiler/lib/src/ir/scope_visitor.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,10 @@ class ScopeModelBuilder extends ir.Visitor<EvaluationComplexity>
700700
EvaluationComplexity visitNeverType(ir.NeverType node) =>
701701
const EvaluationComplexity.lazy();
702702

703+
@override
704+
EvaluationComplexity visitNullType(ir.NullType node) =>
705+
const EvaluationComplexity.lazy();
706+
703707
@override
704708
EvaluationComplexity visitInvalidType(ir.InvalidType node) =>
705709
const EvaluationComplexity.lazy();

pkg/compiler/lib/src/ir/static_type.dart

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,12 @@ abstract class StaticTypeVisitor extends StaticTypeBase {
195195
while (type is ir.TypeParameterType) {
196196
type = (type as ir.TypeParameterType).parameter.bound;
197197
}
198-
return type is ir.InterfaceType ? type : null;
198+
if (type is ir.InterfaceType) {
199+
return type;
200+
} else if (type is ir.NullType) {
201+
return typeEnvironment.coreTypes.deprecatedNullType;
202+
}
203+
return null;
199204
}
200205

201206
/// Returns the static type of the expression as an instantiation of
@@ -222,7 +227,7 @@ abstract class StaticTypeVisitor extends StaticTypeBase {
222227
while (type is ir.TypeParameterType) {
223228
type = (type as ir.TypeParameterType).parameter.bound;
224229
}
225-
if (type == typeEnvironment.nullType) {
230+
if (type is ir.NullType) {
226231
return typeEnvironment.coreTypes
227232
.bottomInterfaceType(superclass, currentLibrary.nullable);
228233
}
@@ -711,7 +716,7 @@ abstract class StaticTypeVisitor extends StaticTypeBase {
711716
ir.DartType promotedType = typeMap.typeOf(node, typeEnvironment);
712717
assert(
713718
node.promotedType == null ||
714-
promotedType == typeEnvironment.nullType ||
719+
promotedType is ir.NullType ||
715720
promotedType is ir.FutureOrType ||
716721
typeEnvironment.isSubtypeOf(promotedType, node.promotedType,
717722
ir.SubtypeCheckMode.ignoringNullabilities),
@@ -1003,7 +1008,7 @@ abstract class StaticTypeVisitor extends StaticTypeBase {
10031008
ir.DartType visitNullCheck(ir.NullCheck node) {
10041009
ir.DartType operandType = visitNode(node.operand);
10051010
handleNullCheck(node, operandType);
1006-
ir.DartType resultType = operandType == typeEnvironment.nullType
1011+
ir.DartType resultType = operandType is ir.NullType
10071012
? const ir.NeverType(ir.Nullability.nonNullable)
10081013
: operandType.withDeclaredNullability(ir.Nullability.nonNullable);
10091014
_staticTypeCache._expressionTypes[node] = resultType;
@@ -1502,13 +1507,13 @@ class TypeHolder {
15021507
for (ir.DartType type in falseTypes) {
15031508
if (typeEnvironment.isSubtypeOf(
15041509
declaredType, type, ir.SubtypeCheckMode.ignoringNullabilities)) {
1505-
return typeEnvironment.nullType;
1510+
return const ir.NullType();
15061511
}
15071512
}
15081513
}
15091514
if (trueTypes != null) {
15101515
for (ir.DartType type in trueTypes) {
1511-
if (type == typeEnvironment.nullType) {
1516+
if (type is ir.NullType) {
15121517
return type;
15131518
}
15141519
if (typeEnvironment.isSubtypeOf(
@@ -1770,9 +1775,9 @@ class TargetInfo {
17701775
if (candidate == null) {
17711776
candidate = type;
17721777
} else {
1773-
if (type == typeEnvironment.nullType) {
1778+
if (type is ir.NullType) {
17741779
// Keep the current candidate.
1775-
} else if (candidate == typeEnvironment.nullType) {
1780+
} else if (candidate is ir.NullType) {
17761781
candidate = type;
17771782
} else if (typeEnvironment.isSubtypeOf(
17781783
candidate, type, ir.SubtypeCheckMode.ignoringNullabilities)) {

pkg/compiler/lib/src/ir/static_type_base.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ abstract class StaticTypeBase extends ir.Visitor<ir.DartType> {
121121
}
122122

123123
@override
124-
ir.DartType visitNullLiteral(ir.NullLiteral node) => typeEnvironment.nullType;
124+
ir.DartType visitNullLiteral(ir.NullLiteral node) => const ir.NullType();
125125

126126
@override
127127
ir.DartType visitIntLiteral(ir.IntLiteral node) =>

pkg/compiler/lib/src/ir/util.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,9 @@ class _FreeVariableVisitor implements ir.DartTypeVisitor<bool> {
221221
@override
222222
bool visitNeverType(ir.NeverType node) => false;
223223

224+
@override
225+
bool visitNullType(ir.NullType node) => false;
226+
224227
@override
225228
bool visitVoidType(ir.VoidType node) => false;
226229

pkg/compiler/lib/src/ir/visitors.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,11 @@ class DartTypeConverter extends ir.DartTypeVisitor<DartType> {
181181
DartType visitNeverType(ir.NeverType node) {
182182
return _convertNullability(_dartTypes.neverType(), node.nullability);
183183
}
184+
185+
@override
186+
DartType visitNullType(ir.NullType node) {
187+
return elementMap.commonElements.nullType;
188+
}
184189
}
185190

186191
class ConstantValuefier extends ir.ComputeOnceConstantVisitor<ConstantValue> {

pkg/compiler/lib/src/kernel/kernel_impact.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,12 @@ abstract class KernelImpactRegistryMixin implements ImpactRegistry {
141141
if (receiverType is ir.InterfaceType) {
142142
return new StrongModeConstraint(commonElements, _nativeBasicData,
143143
elementMap.getClass(receiverType.classNode), relation);
144+
} else if (receiverType is ir.NullType) {
145+
return new StrongModeConstraint(
146+
commonElements,
147+
_nativeBasicData,
148+
elementMap.getClass(typeEnvironment.coreTypes.deprecatedNullClass),
149+
relation);
144150
}
145151
return null;
146152
}

pkg/compiler/lib/src/serialization/abstract_source.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,8 @@ abstract class AbstractDataSource extends DataSourceMixin
276276
ir.Nullability nullability = readEnum(ir.Nullability.values);
277277
ir.DartType typeArgument = _readDartTypeNode(functionTypeVariables);
278278
return new ir.FutureOrType(typeArgument, nullability);
279+
case DartTypeNodeKind.nullType:
280+
return const ir.NullType();
279281
}
280282
throw new UnsupportedError("Unexpected DartTypeKind $kind");
281283
}

pkg/compiler/lib/src/serialization/helpers.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ enum DartTypeNodeKind {
120120
doesNotComplete,
121121
neverType,
122122
futureOrType,
123+
nullType,
123124
}
124125

125126
const String functionTypeNodeTag = 'function-type-node';
@@ -180,6 +181,12 @@ class DartTypeNodeWriter
180181
_sink.writeEnum(node.nullability);
181182
}
182183

184+
@override
185+
void visitNullType(
186+
ir.NullType node, List<ir.TypeParameter> functionTypeVariables) {
187+
_sink.writeEnum(DartTypeNodeKind.nullType);
188+
}
189+
183190
@override
184191
void visitInterfaceType(
185192
ir.InterfaceType node, List<ir.TypeParameter> functionTypeVariables) {

0 commit comments

Comments
 (0)