Skip to content

Commit 1fc1163

Browse files
author
Dart CI
committed
Version 3.13.0-152.0.dev
Merge de28cc3 into dev
2 parents 2c434ee + de28cc3 commit 1fc1163

61 files changed

Lines changed: 841 additions & 769 deletions

File tree

Some content is hidden

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

pkg/analysis_server_client/lib/src/protocol/protocol_common.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//
55
// This file has been automatically generated. Please do not edit it manually.
66
// To regenerate the file, use the script
7-
// "pkg/analysis_server/tool/spec/generate_files".
7+
// "pkg/analyzer_plugin/tool/spec/generate_all.dart".
88

99
// ignore_for_file: unnecessary_ignore, duplicate_ignore
1010
// ignore_for_file: unnecessary_type_name_in_constructor

pkg/analyzer/lib/src/dart/analysis/driver.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ testFineAfterLibraryAnalyzerHook;
109109
// TODO(scheglov): Clean up the list of implicitly analyzed files.
110110
class AnalysisDriver {
111111
/// The version of data format, should be incremented on every format change.
112-
static const int DATA_VERSION = 637;
112+
static const int DATA_VERSION = 638;
113113

114114
/// The number of exception contexts allowed to write. Once this field is
115115
/// zero, we stop writing any new exception contexts in this process.

pkg/analyzer/lib/src/dart/analysis/library_analyzer.dart

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,6 @@ class LibraryAnalyzer {
8686
final Map<FileState, FileAnalysis> _libraryFiles = {};
8787
late final LibraryVerificationContext _libraryVerificationContext;
8888

89-
/// One verifier per library so that state of elements can be shared across
90-
/// fragments in all files of this library.
91-
late final InheritanceOverrideVerifier _inheritanceOverrideVerifier;
92-
9389
final TestingData? _testingData;
9490
final TypeSystemOperations _typeSystemOperations;
9591

@@ -115,10 +111,6 @@ class LibraryAnalyzer {
115111
typeSystem: _typeSystem,
116112
),
117113
);
118-
_inheritanceOverrideVerifier = InheritanceOverrideVerifier(
119-
_typeSystem,
120-
_inheritance,
121-
);
122114
}
123115

124116
TypeProviderImpl get _typeProvider => _libraryElement.typeProvider;
@@ -341,8 +333,17 @@ class LibraryAnalyzer {
341333
/// Compute diagnostics in [_libraryFiles], including errors and warnings,
342334
/// lints, and a few other cases.
343335
void _computeDiagnostics() {
336+
var inheritanceOverrideVerifier = InheritanceOverrideVerifier(
337+
_typeSystem,
338+
_inheritance,
339+
diagnosticReportersByFragment: {
340+
for (var fileAnalysis in _libraryFiles.values)
341+
fileAnalysis.fragment: fileAnalysis.diagnosticReporter,
342+
},
343+
);
344+
344345
for (var fileAnalysis in _libraryFiles.values) {
345-
_computeVerifyErrors(fileAnalysis);
346+
_computeVerifyErrors(fileAnalysis, inheritanceOverrideVerifier);
346347
}
347348

348349
MemberDuplicateDefinitionVerifier.checkLibrary(
@@ -469,14 +470,17 @@ class LibraryAnalyzer {
469470
).afterLibrary();
470471
}
471472

472-
void _computeVerifyErrors(FileAnalysis fileAnalysis) {
473+
void _computeVerifyErrors(
474+
FileAnalysis fileAnalysis,
475+
InheritanceOverrideVerifier inheritanceOverrideVerifier,
476+
) {
473477
var diagnosticReporter = fileAnalysis.diagnosticReporter;
474478
var unit = fileAnalysis.unit;
475479

476480
_computeConstantErrors(fileAnalysis);
477481

478482
// Compute inheritance and override errors.
479-
_inheritanceOverrideVerifier.verifyUnit(unit, diagnosticReporter);
483+
inheritanceOverrideVerifier.verifyUnit(unit, diagnosticReporter);
480484

481485
// Use the ErrorVerifier to compute errors.
482486
ErrorVerifier errorVerifier = ErrorVerifier(

pkg/analyzer/lib/src/dart/element/element.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2143,6 +2143,14 @@ abstract class ElementImpl implements Element {
21432143
setFlag(_ElementStorageFlag.element_hasSinceSdkVersionValue, value);
21442144
}
21452145

2146+
/// Whether this element was created for an `augment` declaration that did
2147+
/// not have a same-kind declaration to augment.
2148+
@trackedIncludedInId
2149+
bool get isAugmentationWithoutAugmentedDeclaration {
2150+
return _firstFragment.isAugmentation &&
2151+
_firstFragment.previousFragment == null;
2152+
}
2153+
21462154
@override
21472155
@trackedIndirectly
21482156
bool get isPrivate {

pkg/analyzer/lib/src/dart/element/inheritance_manager3.dart

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ class ExtensionTypeConflictingStaticAndInstanceConflict extends Conflict {
5959

6060
/// Failure because of a getter and a method from direct superinterfaces.
6161
class GetterMethodConflict extends Conflict {
62-
final InternalExecutableElement getter;
63-
final InternalExecutableElement method;
62+
final InternalGetterElement getter;
63+
final InternalMethodElement method;
6464

6565
GetterMethodConflict({
6666
required super.name,
@@ -381,15 +381,14 @@ class InheritanceManager3 {
381381
) {
382382
assert(candidates.length > 1);
383383

384-
InternalExecutableElement? getter;
385-
InternalExecutableElement? method;
384+
InternalGetterElement? getter;
385+
InternalMethodElement? method;
386386
for (var candidate in candidates) {
387-
var kind = candidate.kind;
388-
if (kind == ElementKind.GETTER) {
389-
getter ??= candidate;
390-
}
391-
if (kind == ElementKind.METHOD) {
392-
method ??= candidate;
387+
switch (candidate) {
388+
case InternalGetterElement():
389+
getter ??= candidate;
390+
case InternalMethodElement():
391+
method ??= candidate;
393392
}
394393
}
395394

@@ -618,12 +617,16 @@ class InheritanceManager3 {
618617
if (candidate.enclosingElement == mixinElement) {
619618
namedCandidates[name] = [candidate];
620619
if (current.kind != candidate.kind) {
621-
var currentIsGetter = current.kind == ElementKind.GETTER;
620+
var currentIsGetter = current is InternalGetterElement;
622621
mixinConflicts.add(
623622
GetterMethodConflict(
624623
name: name,
625-
getter: currentIsGetter ? current : candidate,
626-
method: currentIsGetter ? candidate : current,
624+
getter: currentIsGetter
625+
? current
626+
: candidate as InternalGetterElement,
627+
method: currentIsGetter
628+
? candidate as InternalMethodElement
629+
: current as InternalMethodElement,
627630
),
628631
);
629632
}

0 commit comments

Comments
 (0)