Skip to content

Commit

Permalink
Version 3.5.0-210.0.dev
Browse files Browse the repository at this point in the history
Merge fef2ba3 into dev
  • Loading branch information
Dart CI committed May 30, 2024
2 parents 2976c16 + fef2ba3 commit 9a2413c
Show file tree
Hide file tree
Showing 102 changed files with 1,238 additions and 1,429 deletions.
2 changes: 1 addition & 1 deletion DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ vars = {
### /third_party/ dependencies

# Prefer to use hashes of binaryen that have been reviewed & rolled into g3.
"binaryen_rev" : "b1245577ba92b77a97e266cf4c7f7cd15e6e7f28",
"binaryen_rev" : "d844d2e77b402d562ade8cf8fd96759b587bf09d",
"boringssl_gen_rev": "9c7294fd58261a79794f5afaa26598cf1442ad20",
"boringssl_rev": "d24a38200fef19150eef00cad35b138936c08767",
"browser-compat-data_tag": "ac8cae697014da1ff7124fba33b0b4245cc6cd1b", # v1.0.22
Expand Down
2 changes: 1 addition & 1 deletion pkg/analysis_server/lib/src/cider/completion.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'package:analysis_server/src/cider/local_library_contributor.dart';
import 'package:analysis_server/src/protocol_server.dart';
import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
import 'package:analysis_server/src/services/completion/dart/fuzzy_filter_sort.dart';
import 'package:analysis_server/src/services/completion/dart/local_library_contributor.dart';
import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
import 'package:analyzer/dart/element/element.dart' show LibraryElement;
import 'package:analyzer/src/dart/analysis/performance_logger.dart';
Expand Down
4 changes: 2 additions & 2 deletions pkg/compiler/lib/src/js_model/element_map_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -602,8 +602,8 @@ class JsKernelToElementMap implements JsToElementMap, IrToElementMap {
data.instantiationToBounds = data.thisType;
} else {
data.instantiationToBounds = getInterfaceType(ir.instantiateToBounds(
coreTypes.legacyRawType(node), coreTypes.objectClass,
isNonNullableByDefault: true) as ir.InterfaceType);
coreTypes.legacyRawType(node), coreTypes.objectClass)
as ir.InterfaceType);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/compiler/lib/src/kernel/element_map_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,8 @@ class KernelToElementMap implements IrToElementMap {
data.instantiationToBounds = data.thisType;
} else {
data.instantiationToBounds = getInterfaceType(ir.instantiateToBounds(
coreTypes.legacyRawType(node), coreTypes.objectClass,
isNonNullableByDefault: true) as ir.InterfaceType);
coreTypes.legacyRawType(node), coreTypes.objectClass)
as ir.InterfaceType);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/dartdev/lib/dartdev.dart
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class DartdevRunner extends CommandRunner<int> {
'A command-line utility for Dart development';

@override
late final ArgParser argParser;
final ArgParser argParser;

final bool verbose;

Expand Down
4 changes: 2 additions & 2 deletions pkg/dartdev/lib/src/commands/compile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -895,8 +895,8 @@ Sets the verbosity level of the compilation.
flagDefaultsTo: true,
);

late final Option defineOption;
late final Option packagesOption;
final Option defineOption;
final Option packagesOption;

CompileSubcommandCommand(super.name, super.description, super.verbose,
{super.hidden})
Expand Down
4 changes: 2 additions & 2 deletions pkg/dartdev/lib/src/dds_runner.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class DDSRunner {
const devToolsMessagePrefix =
'The Dart DevTools debugger and profiler is available at:';
if (debugDds) {
late StreamSubscription stdoutSub;
late final StreamSubscription stdoutSub;
stdoutSub = process.stdout.transform(utf8.decoder).listen((event) {
if (event.startsWith(devToolsMessagePrefix)) {
final ddsDebuggingUri = event.split(' ').last;
Expand All @@ -61,7 +61,7 @@ class DDSRunner {
}
});
}
late StreamSubscription stderrSub;
late final StreamSubscription stderrSub;
stderrSub = process.stderr.transform(utf8.decoder).listen((event) {
final result = json.decode(event) as Map<String, dynamic>;
final state = result['state'];
Expand Down
2 changes: 1 addition & 1 deletion pkg/dartdev/lib/src/generate_kernel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ Future<void> ensureCompilationServerIsRunning(
}
try {
Directory(p.dirname(serverInfoFile.path)).createSync(recursive: true);
late final Process frontendServerProcess;
final Process frontendServerProcess;
if (File(sdk.frontendServerAotSnapshot).existsSync()) {
frontendServerProcess = await Process.start(
sdk.dartAotRuntime,
Expand Down
4 changes: 1 addition & 3 deletions pkg/dartdev/tool/sdk_size.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@ import 'dart:io';

import 'package:path/path.dart' as p;

late final String dartSdkPath;
final String dartSdkPath = p.dirname(p.dirname(Platform.resolvedExecutable));

final List<FileStats> fileStats = [];

void main(List<String> arguments) {
final vm = Platform.resolvedExecutable;
dartSdkPath = p.dirname(p.dirname(vm));
final version =
File(p.join(dartSdkPath, 'version')).readAsStringSync().trim();

Expand Down
6 changes: 6 additions & 0 deletions pkg/front_end/lib/src/fasta/builder/builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,9 @@ abstract class Builder {
/// through patch libraries.
bool get isAugmenting;

/// Returns `true` if the related declaration is marked `augment`
bool get isAugment;

bool get isRegularMethod;

bool get isOperator;
Expand Down Expand Up @@ -318,6 +321,9 @@ abstract class BuilderImpl implements Builder {
@override
bool get isAugmenting => this != origin;

@override
bool get isAugment => false;

@override
bool get isRegularMethod => false;

Expand Down
3 changes: 3 additions & 0 deletions pkg/front_end/lib/src/fasta/builder/modifier_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ abstract class ModifierBuilderImpl extends BuilderImpl
@override
bool get isStatic => (modifiers & staticMask) != 0;

@override
bool get isAugment => (modifiers & augmentMask) != 0;

@override
bool get isNative => false;

Expand Down
3 changes: 3 additions & 0 deletions pkg/front_end/lib/src/fasta/incremental_compiler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ class IncrementalCompiler implements IncrementalKernelGenerator {
[bool? outlineOnly, this._incrementalSerializer])
: _ticker = context.options.ticker,
_resetTicker = true,
_previousPackagesUri = context.options.packagesUriRaw,
_initializationStrategy = new _InitializationStrategy.fromComponent(
_componentToInitializeFrom),
this.outlineOnly = outlineOnly ?? false,
Expand All @@ -184,6 +185,7 @@ class IncrementalCompiler implements IncrementalKernelGenerator {
this._incrementalSerializer])
: _ticker = context.options.ticker,
_resetTicker = true,
_previousPackagesUri = context.options.packagesUriRaw,
_initializationStrategy =
new _InitializationStrategy.fromUri(_initializeFromDillUri),
this.outlineOnly = outlineOnly ?? false,
Expand All @@ -196,6 +198,7 @@ class IncrementalCompiler implements IncrementalKernelGenerator {
[bool? resetTicker])
: _ticker = context.options.ticker,
this._resetTicker = resetTicker ?? true,
_previousPackagesUri = context.options.packagesUriRaw,
_initializationStrategy = new _InitializationStrategy.fromComponent(
_componentToInitializeFrom),
this.outlineOnly = false,
Expand Down
21 changes: 7 additions & 14 deletions pkg/front_end/lib/src/fasta/kernel/body_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4492,8 +4492,7 @@ class BodyBuilder extends StackListenerImpl
typeArgument = buildDartType(
typeArguments.single, TypeUse.literalTypeArgument,
allowPotentiallyConstantType: false);
typeArgument = instantiateToBounds(typeArgument, coreTypes.objectClass,
isNonNullableByDefault: true);
typeArgument = instantiateToBounds(typeArgument, coreTypes.objectClass);
}
} else {
typeArgument = implicitTypeArgument;
Expand Down Expand Up @@ -4546,8 +4545,7 @@ class BodyBuilder extends StackListenerImpl
typeArgument = buildDartType(
typeArguments.single, TypeUse.literalTypeArgument,
allowPotentiallyConstantType: false);
typeArgument = instantiateToBounds(typeArgument, coreTypes.objectClass,
isNonNullableByDefault: true);
typeArgument = instantiateToBounds(typeArgument, coreTypes.objectClass);
}
}

Expand Down Expand Up @@ -4681,8 +4679,7 @@ class BodyBuilder extends StackListenerImpl
typeArgument = buildDartType(
typeArguments.single, TypeUse.literalTypeArgument,
allowPotentiallyConstantType: false);
typeArgument = instantiateToBounds(typeArgument, coreTypes.objectClass,
isNonNullableByDefault: true);
typeArgument = instantiateToBounds(typeArgument, coreTypes.objectClass);
} else {
typeArgument = implicitTypeArgument;
}
Expand Down Expand Up @@ -4861,10 +4858,8 @@ class BodyBuilder extends StackListenerImpl
allowPotentiallyConstantType: false);
valueType = buildDartType(typeArguments[1], TypeUse.literalTypeArgument,
allowPotentiallyConstantType: false);
keyType = instantiateToBounds(keyType, coreTypes.objectClass,
isNonNullableByDefault: true);
valueType = instantiateToBounds(valueType, coreTypes.objectClass,
isNonNullableByDefault: true);
keyType = instantiateToBounds(keyType, coreTypes.objectClass);
valueType = instantiateToBounds(valueType, coreTypes.objectClass);
}
}

Expand Down Expand Up @@ -4906,10 +4901,8 @@ class BodyBuilder extends StackListenerImpl
allowPotentiallyConstantType: false);
valueType = buildDartType(typeArguments[1], TypeUse.literalTypeArgument,
allowPotentiallyConstantType: false);
keyType = instantiateToBounds(keyType, coreTypes.objectClass,
isNonNullableByDefault: true);
valueType = instantiateToBounds(valueType, coreTypes.objectClass,
isNonNullableByDefault: true);
keyType = instantiateToBounds(keyType, coreTypes.objectClass);
valueType = instantiateToBounds(valueType, coreTypes.objectClass);
}
} else {
keyType = implicitTypeArgument;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,7 @@ class BuilderMixinInferrer {
p.bound = substitution.substituteType(p.bound);
}
// Use instantiate to bounds.
List<DartType> bounds = calculateBounds(parameters, coreTypes.objectClass,
isNonNullableByDefault: true);
List<DartType> bounds = calculateBounds(parameters, coreTypes.objectClass);
for (int i = 0; i < mixedInType.typeArguments.length; ++i) {
mixedInType.typeArguments[i] = bounds[i];
}
Expand Down
26 changes: 26 additions & 0 deletions pkg/front_end/lib/src/fasta/scope.dart
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,18 @@ class Scope extends MutableScope {

Map<String, List<int>>? usedNames;

Map<String, List<Builder>>? augmentations;

Map<String, List<Builder>>? setterAugmentations;

Scope(
{required ScopeKind kind,
Map<String, Builder>? local,
Map<String, MemberBuilder>? setters,
Set<ExtensionBuilder>? extensions,
Scope? parent,
this.augmentations,
this.setterAugmentations,
required String debugName,
this.isModifiable = true})
: super(kind, local, setters, extensions, parent, debugName);
Expand Down Expand Up @@ -1515,6 +1521,16 @@ abstract class MergedScope<T extends Builder> {
name, member, _originScope.lookupLocalMember(name, setter: false),
setter: false, inPatchLibrary: inPatchLibrary);
});
Map<String, List<Builder>>? augmentations = scope.augmentations;
if (augmentations != null) {
for (String augmentedName in augmentations.keys) {
for (Builder augmentation in augmentations[augmentedName]!) {
_addBuilderToMergedScope(augmentedName, augmentation,
_originScope.lookupLocalMember(augmentedName, setter: false),
setter: false, inPatchLibrary: inPatchLibrary);
}
}
}
scope.forEachLocalSetter((String name, Builder member) {
// In case of duplicates we use the first declaration.
while (member.isDuplicate) {
Expand All @@ -1524,6 +1540,16 @@ abstract class MergedScope<T extends Builder> {
name, member, _originScope.lookupLocalMember(name, setter: true),
setter: true, inPatchLibrary: inPatchLibrary);
});
Map<String, List<Builder>>? setterAugmentations = scope.setterAugmentations;
if (setterAugmentations != null) {
for (String augmentedName in setterAugmentations.keys) {
for (Builder augmentation in setterAugmentations[augmentedName]!) {
_addBuilderToMergedScope(augmentedName, augmentation,
_originScope.lookupLocalMember(augmentedName, setter: true),
setter: true, inPatchLibrary: inPatchLibrary);
}
}
}
scope.forEachLocalExtension((ExtensionBuilder extensionBuilder) {
if (extensionBuilder is SourceExtensionBuilder &&
extensionBuilder.isUnnamedExtension) {
Expand Down
6 changes: 6 additions & 0 deletions pkg/front_end/lib/src/fasta/source/diet_listener.dart
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,12 @@ class DietListener extends StackListenerImpl {
debugEvent("AsyncModifier");
}

@override
void beginTopLevelMethod(
Token lastConsumed, Token? augmentToken, Token? externalToken) {
debugEvent("TopLevelMethod");
}

@override
void endTopLevelMethod(Token beginToken, Token? getOrSet, Token endToken) {
assert(checkState(beginToken, [
Expand Down
3 changes: 1 addition & 2 deletions pkg/front_end/lib/src/fasta/source/source_enum_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -829,8 +829,7 @@ class SourceEnumBuilder extends SourceClassBuilder {
classHierarchy.coreTypes,
new ListLiteral(values,
typeArgument: instantiateToBounds(rawType(Nullability.nonNullable),
classHierarchy.coreTypes.objectClass,
isNonNullableByDefault: true),
classHierarchy.coreTypes.objectClass),
isConst: true));

for (SourceFieldBuilder elementBuilder in elementBuilders) {
Expand Down
Loading

0 comments on commit 9a2413c

Please sign in to comment.