Skip to content

Commit

Permalink
Version 3.4.0-93.0.dev
Browse files Browse the repository at this point in the history
Merge 15ca9f2 into dev
  • Loading branch information
Dart CI committed Jan 31, 2024
2 parents 488e33c + 15ca9f2 commit 4b05eb9
Show file tree
Hide file tree
Showing 40 changed files with 666 additions and 784 deletions.
22 changes: 11 additions & 11 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ vars = {
# EOL comment after a dependency to disable this and pin it at its current
# revision.

"args_rev": "46d5033377d277d70bc6ec68504730b9384b1db1",
"args_rev": "03386ba1cc338086af46f1c742ef944c6a402862",
"async_rev": "e83d054b3ea0ff6cb25e5849c5408cd7c4fc1d3f",
"bazel_worker_rev": "3d9cd5823fc96872b7275fe99a4fabc4dcfe57c8",
"benchmark_harness_rev": "a62e4169c120ac04b1f5bfdf8f14346459529781",
Expand All @@ -129,7 +129,7 @@ vars = {
"collection_rev": "2d57a82ad079fe2d127f5a9b188170de2f5cdedc",
"convert_rev": "f8a72d67a10805bca358be8d7e189a62f79d86b9",
"crypto_rev": "f2efb981b461dcae43d0cf18a3a970142abfee35",
"csslib_rev": "1ad2d1ec461fb1836180e917220a5a48fd641897",
"csslib_rev": "ec86ee57c89f683352e66c55542bcc1daa425c13",
# Note: Updates to dart_style have to be coordinated with the infrastructure
# team so that the internal formatter `tools/sdks/dart-sdk/bin/dart format`
# matches the version here. Please follow this process to make updates:
Expand All @@ -142,25 +142,25 @@ vars = {
# For more details, see https://github.com/dart-lang/sdk/issues/30164.
"dart_style_rev": "633b01cba68f4b42ddc2985c3d521c22149d5ce3", # disable rev_sdk_deps.dart
"dartdoc_rev": "0f13e6443595f8e49cc86d783210d78c93d3502e",
"ecosystem_rev": "1e2785d6900b4d709a31f4c669381dc340cad605",
"ecosystem_rev": "9ee08a41b85973e5cc2f6144ff4de69bf9aed244",
"file_rev": "cd3a9324f6483f313ba1f0f3ff382ea4e6982ef2",
"fixnum_rev": "3e08c0d7ce1a0cd832a17391444898ec610b5f89",
"flute_rev": "f42b09f77132210499ec8ed819a60c260af03db6",
"glob_rev": "7c9a121e92687b7ac6456ec0796eb1e5c0373d90",
"html_rev": "06bc148600b1d1a70f2256bdf788c213f1f60f55",
"html_rev": "910f6d703ed0193318fb095be09e8ddf1bec3e05",
"http_rev": "f0a02f98f7c921e86ecc81c70f38bb6fbccc81b9", # https://github.com/dart-lang/sdk/issues/54165
"http_multi_server_rev": "ae484896624cee8b0a8a97a0fb1ea323c4c3d31f",
"http_multi_server_rev": "491f7c613198d38c489ee0010b9c5377ad29afde",
"http_parser_rev": "224c1a9d24b46c7a9da1f09147e0e1fbda78089d",
"intl_rev": "5d65e3808ce40e6282e40881492607df4e35669f",
"json_rpc_2_rev": "ac1fabddd51fc90aa6fa4e1248f1a7141899eb4a",
"leak_tracker_rev": "4a5b077739886f61bd6dc11c78865ef487c917c2",
"lints_rev": "3810f8b3dc3205cfaa4ccc0054b021e68046d851",
"logging_rev": "4d35a4e02b9237bd794378413e7ce3deb52ffcaf",
"logging_rev": "e04942dadc6ed9ed177ab0c6b8d0e80a789cd176",
"markdown_rev": "a8288ca3a3023228f1a8a832b78d00e11f0c4b30",
"matcher_rev": "d9cf4f69e3f557718ab5be042dd5503afcacac51",
"material_color_utilities_rev": "799b6ba2f3f1c28c67cc7e0b4f18e0c7d7f3c03e",
"mime_rev": "ca9f059d2334bb2657683e0a7f5949817cb4b0e6",
"mockito_rev": "e15e00086ed20f3175b2e677fd11611be4fa8e8e",
"mime_rev": "99fbdcc745e2f2cfb85be4a4c6c7b520cd25c2dd",
"mockito_rev": "0422551a774cbf72eea87ba80e71f7b5d81199f3",
"native_rev": "40382efb9c7a0774d2764238fc1802e562e9cbaf",
"package_config_rev": "33dd24659147bd7ed2fa87aeacc52d199be766b4",
"path_rev": "57a049cff2e2be7a302dd9683b2b194c6d06e2d4",
Expand All @@ -179,14 +179,14 @@ vars = {
"sync_http_rev": "f96db9543e5a9f62833ca9a24269b12fcf63d45b",
"tar_rev": "0fc831c6e93be5342d4863d9e464428e73007cce",
"term_glyph_rev": "4c5a49664ee78b62c35de528cec5a9469bb84936",
"test_rev": "846d73ee40a9cbd86348bc3cfc97f9c765872f2d",
"test_rev": "6700049d5de97906d033f4271f67f7599090bf4e",
"test_descriptor_rev": "59ce97fae49709fa1f479efa808c031a576e617e",
"test_process_rev": "d68de5bc53bf33a12334d06748af9db4844d66f0",
"test_reflective_loader_rev": "6edf5358b53bfda487840bad1a03d089326fa08c",
"tools_rev": "8ffc077f93ecb630c76a833be2cc80b918916428",
"tools_rev": "f6e67f2223fd5f9c6bdb3ace908d22c73ea02bc5",
"typed_data_rev": "6f6d81d64cd698f8def5116fc97b7b1fb7441696",
"usage_rev": "e99690ae6d5fa9ec24ac5218bcd3621e8e3ae8a9",
"vector_math_rev": "38a00c35575b71a095903467141e5ee60c94d011",
"vector_math_rev": "cb976c731f5f9011f09311cd1c39d5778d4f8f2e",
"watcher_rev": "66cd694ffb7ee6e09ff0cde6c9f788aa47ee1a23",
"web_rev": "d17fdd2b6ddec289920d02a3df92c3368f0a0e50",
"web_socket_channel_rev": "5241175e7c66271850d6e75fb9ec90068f9dd3c4", # https://github.com/dart-lang/sdk/issues/54165
Expand Down
2 changes: 1 addition & 1 deletion pkg/_fe_analyzer_shared/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: _fe_analyzer_shared
version: 66.0.0
version: 67.0.0
description: Logic that is shared between the front_end and analyzer packages.
repository: https://github.com/dart-lang/sdk/tree/main/pkg/_fe_analyzer_shared

Expand Down
14 changes: 8 additions & 6 deletions pkg/analyzer/lib/src/context/context.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@

import 'package:analyzer/dart/analysis/declared_variables.dart';
import 'package:analyzer/file_system/file_system.dart';
import 'package:analyzer/src/dart/analysis/analysis_options_map.dart';
import 'package:analyzer/src/dart/element/type_provider.dart';
import 'package:analyzer/src/dart/element/type_system.dart';
import 'package:analyzer/src/generated/engine.dart';
import 'package:analyzer/src/generated/source.dart';

/// An [AnalysisContext] in which analysis can be performed.
class AnalysisContextImpl implements AnalysisContext {
AnalysisOptionsImpl _analysisOptions;
AnalysisOptionsMap _analysisOptionsMap;

@override
final DeclaredVariables declaredVariables;
Expand All @@ -26,20 +27,20 @@ class AnalysisContextImpl implements AnalysisContext {
TypeSystemImpl? _typeSystemNonNullableByDefault;

AnalysisContextImpl({
required AnalysisOptionsImpl analysisOptions,
required AnalysisOptionsMap analysisOptionsMap,
required this.declaredVariables,
required this.sourceFactory,
}) : _analysisOptions = analysisOptions;
}) : _analysisOptionsMap = analysisOptionsMap;

@Deprecated("Use 'getAnalysisOptionsForFile(file)' instead")
@override
AnalysisOptionsImpl get analysisOptions {
return _analysisOptions;
return _analysisOptionsMap.firstOrDefault;
}

// TODO(scheglov): Remove it, exists only for Cider.
set analysisOptions(AnalysisOptionsImpl analysisOptions) {
_analysisOptions = analysisOptions;
_analysisOptionsMap = AnalysisOptionsMap.forSharedOptions(analysisOptions);
}

bool get hasTypeProvider {
Expand Down Expand Up @@ -71,7 +72,8 @@ class AnalysisContextImpl implements AnalysisContext {
}

@override
AnalysisOptionsImpl getAnalysisOptionsForFile(File file) => _analysisOptions;
AnalysisOptionsImpl getAnalysisOptionsForFile(File file) =>
_analysisOptionsMap.getOptions(file);

void setTypeProviders({
required TypeProviderImpl legacy,
Expand Down
4 changes: 4 additions & 0 deletions pkg/analyzer/lib/src/dart/analysis/analysis_options_map.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ class AnalysisOptionsMap {
/// Create an empty [AnalysisOptionsMap] instance.
AnalysisOptionsMap();

/// Get the first options entry or the default options object if there is none.
AnalysisOptionsImpl get firstOrDefault =>
entries.firstOrNull?.options ?? _defaultOptions;

/// Map this [folder] to the given [options].
void add(Folder folder, AnalysisOptionsImpl options) {
entries.add(OptionsMapEntry(folder, options));
Expand Down
22 changes: 10 additions & 12 deletions pkg/analyzer/lib/src/dart/analysis/driver.dart
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ import 'package:meta/meta.dart';
// TODO(scheglov): Clean up the list of implicitly analyzed files.
class AnalysisDriver {
/// The version of data format, should be incremented on every format change.
static const int DATA_VERSION = 332;
static const int DATA_VERSION = 333;

/// The number of exception contexts allowed to write. Once this field is
/// zero, we stop writing any new exception contexts in this process.
Expand Down Expand Up @@ -264,8 +264,7 @@ class AnalysisDriver {
bool _disposed = false;

/// A map that associates files to corresponding analysis options.
// TODO(pq): retype to OptionsOptionsMap
late final SharedOptionsOptionsMap analysisOptionsMap;
late final AnalysisOptionsMap analysisOptionsMap;

/// Create a new instance of [AnalysisDriver].
///
Expand All @@ -283,7 +282,7 @@ class AnalysisDriver {
this.analysisContext,
@Deprecated("Use 'analysisOptionsMap' instead")
AnalysisOptionsImpl? analysisOptions,
SharedOptionsOptionsMap? analysisOptionsMap,
AnalysisOptionsMap? analysisOptionsMap,
FileContentCache? fileContentCache,
UnlinkedUnitStore? unlinkedUnitStore,
InfoDeclarationStore? infoDeclarationStore,
Expand Down Expand Up @@ -341,7 +340,7 @@ class AnalysisDriver {

/// Return the analysis options used to control analysis.
@Deprecated("Use 'getAnalysisOptionsForFile(file)' instead")
AnalysisOptions get analysisOptions => analysisOptionsMap.sharedOptions;
AnalysisOptions get analysisOptions => analysisOptionsMap.firstOrDefault;

/// Return the current analysis session.
AnalysisSessionImpl get currentSession {
Expand All @@ -350,9 +349,9 @@ class AnalysisDriver {

/// Return a list of the names of all the plugins enabled in analysis options
/// in this driver.
List<String> get enabledPluginNames =>
// TODO(pq): get this value from a union of all the plugins enabled in the `analysisOptionsMap`
analysisOptionsMap.sharedOptions.enabledPluginNames;
List<String> get enabledPluginNames => analysisOptionsMap.entries
.map((e) => e.options.enabledPluginNames)
.flattenedToList2;

/// Return the stream that produces [ExceptionResult]s.
Stream<ExceptionResult> get exceptions => _exceptionController.stream;
Expand All @@ -375,7 +374,7 @@ class AnalysisDriver {
logger: _logger,
byteStore: _byteStore,
infoDeclarationStore: _infoDeclarationStore,
analysisOptions: analysisOptionsMap.sharedOptions,
analysisOptionsMap: analysisOptionsMap,
declaredVariables: declaredVariables,
sourceFactory: _sourceFactory,
macroSupport: macroSupport,
Expand Down Expand Up @@ -1658,7 +1657,6 @@ class AnalysisDriver {
void _fillSaltForElements() {
var buffer = ApiSignature();
buffer.addInt(DATA_VERSION);
buffer.addUint32List(analysisOptionsMap.sharedOptions.signatureForElements);
_addDeclaredVariablesToSignature(buffer);
_saltForElements = buffer.toUint32List();
}
Expand All @@ -1668,7 +1666,6 @@ class AnalysisDriver {
buffer.addInt(DATA_VERSION);
buffer.addBool(enableIndex);
buffer.addBool(enableDebugResolutionMarkers);
buffer.addUint32List(analysisOptionsMap.sharedOptions.signature);
_addDeclaredVariablesToSignature(buffer);

var workspace = analysisContext?.contextRoot.workspace;
Expand All @@ -1681,7 +1678,7 @@ class AnalysisDriver {
var buffer = ApiSignature();
buffer.addInt(DATA_VERSION);
buffer.addBool(enableIndex);
buffer.addUint32List(analysisOptionsMap.sharedOptions.unlinkedSignature);

_saltForUnlinked = buffer.toUint32List();
}

Expand Down Expand Up @@ -1811,6 +1808,7 @@ class AnalysisDriver {
signature.addUint32List(_saltForResolution);
signature.addString(library.file.uriStr);
signature.addString(library.libraryCycle.apiSignature);
signature.addUint32List(library.file.analysisOptions.signature);
signature.addString(file.uriStr);
signature.addString(file.contentHash);
return signature.toHex();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,8 @@ class DriverBasedAnalysisContext implements AnalysisContext {
]);

/// Get all the analysis options objects associated with this context.
List<AnalysisOptions> get allAnalysisOptions => [
// ignore: deprecated_member_use_from_same_package
analysisOptions,
];
List<AnalysisOptions> get allAnalysisOptions =>
[...driver.analysisOptionsMap.entries.map((e) => e.options)];

@override
@Deprecated("Use 'getAnalysisOptionsForFile(file)' instead")
Expand Down
12 changes: 0 additions & 12 deletions pkg/analyzer/lib/src/dart/analysis/library_analyzer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -867,12 +867,8 @@ class LibraryAnalyzer {
}) {
directive.element = element;
_resolveNamespaceDirective(
directive: directive,
primaryUriNode: directive.uri,
primaryUriState: state.uris.primary,
configurationNodes: directive.configurations,
configurationUris: state.uris.configurations,
selectedUriState: state.selectedUri,
);
if (state is LibraryExportWithUri) {
final selectedUriStr = state.selectedUri.relativeUriStr;
Expand Down Expand Up @@ -926,12 +922,8 @@ class LibraryAnalyzer {
directive.element = element;
directive.prefix?.staticElement = element.prefix?.element;
_resolveNamespaceDirective(
directive: directive,
primaryUriNode: directive.uri,
primaryUriState: state.uris.primary,
configurationNodes: directive.configurations,
configurationUris: state.uris.configurations,
selectedUriState: state.selectedUri,
);
if (state is LibraryImportWithUri) {
final selectedUriStr = state.selectedUri.relativeUriStr;
Expand Down Expand Up @@ -977,10 +969,6 @@ class LibraryAnalyzer {
}

void _resolveNamespaceDirective({
required NamespaceDirectiveImpl directive,
required StringLiteralImpl primaryUriNode,
required file_state.DirectiveUri primaryUriState,
required file_state.DirectiveUri selectedUriState,
required List<Configuration> configurationNodes,
required List<file_state.DirectiveUri> configurationUris,
}) {
Expand Down
7 changes: 3 additions & 4 deletions pkg/analyzer/lib/src/dart/analysis/library_context.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import 'package:analyzer/dart/analysis/declared_variables.dart';
import 'package:analyzer/dart/element/element.dart'
show CompilationUnitElement, LibraryElement;
import 'package:analyzer/src/context/context.dart';
import 'package:analyzer/src/dart/analysis/analysis_options_map.dart';
import 'package:analyzer/src/dart/analysis/byte_store.dart';
import 'package:analyzer/src/dart/analysis/driver.dart';
import 'package:analyzer/src/dart/analysis/file_state.dart';
Expand All @@ -18,8 +19,6 @@ import 'package:analyzer/src/dart/analysis/performance_logger.dart';
import 'package:analyzer/src/dart/analysis/session.dart';
import 'package:analyzer/src/dart/element/element.dart';
import 'package:analyzer/src/exception/exception.dart';
import 'package:analyzer/src/generated/engine.dart'
show AnalysisContext, AnalysisOptionsImpl;
import 'package:analyzer/src/generated/source.dart';
import 'package:analyzer/src/summary/package_bundle_reader.dart';
import 'package:analyzer/src/summary2/bundle_reader.dart';
Expand Down Expand Up @@ -56,14 +55,14 @@ class LibraryContext {
required this.byteStore,
required this.infoDeclarationStore,
required this.fileSystemState,
required AnalysisOptionsImpl analysisOptions,
required AnalysisOptionsMap analysisOptionsMap,
required DeclaredVariables declaredVariables,
required SourceFactory sourceFactory,
required this.macroSupport,
required SummaryDataStore? externalSummaries,
}) {
analysisContext = AnalysisContextImpl(
analysisOptions: analysisOptions,
analysisOptionsMap: analysisOptionsMap,
declaredVariables: declaredVariables,
sourceFactory: sourceFactory,
);
Expand Down
9 changes: 9 additions & 0 deletions pkg/analyzer/lib/src/dart/constant/evaluation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1244,6 +1244,15 @@ class ConstantVisitor extends UnifyingAstVisitor<Constant> {
typeSystem, nodeType, RecordState(positionalFields, namedFields));
}

@override
Constant? visitRecordTypeAnnotation(RecordTypeAnnotation node) {
return DartObjectImpl(
typeSystem,
_typeProvider.typeType,
TypeState(node.type),
);
}

@override
Constant visitSetOrMapLiteral(SetOrMapLiteral node) {
// Note: due to dartbug.com/33441, it's possible that a set/map literal
Expand Down
3 changes: 2 additions & 1 deletion pkg/analyzer/lib/src/dart/micro/resolve_file.dart
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,8 @@ class FileResolver {
declaredVariables: contextObjects!.declaredVariables,
byteStore: byteStore,
infoDeclarationStore: const NoOpInfoDeclarationStore(),
analysisOptions: contextObjects!.analysisOptions,
analysisOptionsMap: AnalysisOptionsMap.forSharedOptions(
contextObjects!.analysisOptions),
analysisSession: contextObjects!.analysisSession,
logger: logger,
fileSystemState: fsState!,
Expand Down
2 changes: 1 addition & 1 deletion pkg/analyzer/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ environment:
sdk: '>=3.0.0 <4.0.0'

dependencies:
_fe_analyzer_shared: ^66.0.0
_fe_analyzer_shared: ^67.0.0
collection: ^1.17.0
convert: ^3.0.0
crypto: ^3.0.0
Expand Down
11 changes: 11 additions & 0 deletions pkg/analyzer/test/src/dart/constant/evaluation_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -946,6 +946,17 @@ void f(Object? x) {
''');
}

test_recordTypeAnnotation() async {
await assertNoErrorsInCode(r'''
const a = ('',) is (int,);
''');
final result = _topLevelVar('a');
assertDartObjectText(result, r'''
bool false
variable: self::@variable::a
''');
}

test_typeParameter() async {
await assertErrorsInCode('''
class A<X> {
Expand Down
3 changes: 1 addition & 2 deletions pkg/dev_compiler/lib/src/compiler/module_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,7 @@ abstract class _ModuleBuilder {
}
}

/// Generates modules for with our DDC `dart_library.js` loading mechanism.
// TODO(jmesserly): remove this and replace with something that interoperates.
/// Generates DDC modules with our `ddc_module_loader.js` loading mechanism.
class DdcModuleBuilder extends _ModuleBuilder {
/// Build a module variable definition for [import].
///
Expand Down
4 changes: 2 additions & 2 deletions pkg/dev_compiler/lib/src/kernel/command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -734,10 +734,10 @@ JSCode jsProgramToCode(js_ast.Program moduleTree, ModuleFormat format,
text = text.replaceFirst(SharedCompiler.sourceMapLocationID, rawSourceMap);

// This is intended to be used by our build/debug tools to gather metrics.
// See pkg/dev_compiler/lib/js/legacy/dart_library.js for runtime code that
// See pkg/dev_compiler/lib/js/ddc/ddc_module_loader.js for runtime code that
// reads this.
//
// These keys (see corresponding logic in dart_library.js) include:
// These keys (see corresponding logic in ddc_module_loader.js) include:
// - dartSize: <size of Dart input code in bytes>
// - sourceMapSize: <size of JS source map in bytes>
//
Expand Down
Loading

0 comments on commit 4b05eb9

Please sign in to comment.