1
0
mirror of https://github.com/dart-lang/sdk synced 2024-07-03 08:19:13 +00:00

[vm] Use newer language version in package:vm which removes some unnecessary casts

TEST=ci

Change-Id: Ic1218bddf1879054f1d35ac550224a294d03cda8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366664
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
This commit is contained in:
Martin Kustermann 2024-05-16 08:57:40 +00:00 committed by Commit Queue
parent d8e6d26159
commit 05df51c962
4 changed files with 8 additions and 10 deletions

View File

@ -110,7 +110,7 @@ class InferredType {
}
if (_constantValue != null) {
buf.write(
' (value: ${_constantValue!.toText(astTextStrategyForTesting)})');
' (value: ${_constantValue.toText(astTextStrategyForTesting)})');
}
if (receiverNotInt) {
buf.write(' (receiver not int)');

View File

@ -1452,12 +1452,10 @@ class RuntimeType extends Type {
super._() {
if (_type is InterfaceType && numImmediateTypeArgs > 0) {
assert(typeArgs!.length >= numImmediateTypeArgs);
assert((_type as InterfaceType)
.typeArguments
.every((t) => t == const DynamicType()));
assert(_type.typeArguments.every((t) => t == const DynamicType()));
} else if (_type is FutureOrType) {
assert(typeArgs!.length >= numImmediateTypeArgs);
DartType typeArgument = (_type as FutureOrType).typeArgument;
DartType typeArgument = _type.typeArgument;
assert(typeArgument == const DynamicType());
} else {
assert(typeArgs == null);
@ -1537,7 +1535,7 @@ class RuntimeType extends Type {
@override
String toString() {
final head = _type is InterfaceType
? "${nodeToText((_type as InterfaceType).classNode)}"
? "${nodeToText(_type.classNode)}"
: "${nodeToText(_type)}";
final typeArgsStrs = (numImmediateTypeArgs == 0)
? ""
@ -1604,7 +1602,7 @@ class RuntimeType extends Type {
if (rhs is FutureOrType) {
if (_type is InterfaceType) {
Class thisClass = (_type as InterfaceType).classNode;
Class thisClass = _type.classNode;
if (thisClass == typeHierarchy.coreTypes.futureClass) {
return typeArgs![0].isSubtypeOfRuntimeType(
typeHierarchy, runtimeType.typeArgs![0], SubtypeTestKind.Subtype);

View File

@ -57,9 +57,9 @@ class VMConstantEvaluator extends ConstantEvaluator {
// Only add Platform fields if the Platform class is part of the component
// being evaluated.
if (_targetOS != null && _platformClass != null) {
_constantFields['operatingSystem'] = StringConstant(_targetOS!.name);
_constantFields['operatingSystem'] = StringConstant(_targetOS.name);
_constantFields['pathSeparator'] =
StringConstant(_targetOS!.pathSeparator);
StringConstant(_targetOS.pathSeparator);
}
}

View File

@ -4,7 +4,7 @@ description: VM specific Dart code and helper scripts
publish_to: none
environment:
sdk: '>=3.0.0 <4.0.0'
sdk: '>=3.3.0 <4.0.0'
# Use 'any' constraints here; we get our versions from the DEPS file.
dependencies: