Skip to content

Cleanup package_graph migration #2869

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Dec 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions lib/src/generator/templates.runtime_renderers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16641,44 +16641,44 @@ const _invisibleGetters = {
'specialClasses',
'allImplementorsAdded',
'allExtensionsAdded',
'documentedExtensions',
'allLibraries',
'allConstructedModelElements',
'allInheritableElements',
'packageMeta',
'config',
'rendererFactory',
'packageMetaProvider',
'defaultPackage',
'hasEmbedderSdk',
'packageMap',
'sdk',
'sdkLibrarySources',
'allLibrariesAdded',
'packageWarningCounter',
'publicPackages',
'publicLibraries',
'localLibraries',
'localPublicLibraries',
'inheritThrough',
'invisibleAnnotations',
'allModelElements',
'allLocalModelElements',
'allCanonicalModelElements',
'referenceChildren',
'name',
'implementors',
'documentedExtensions',
'extensions',
'defaultPackageName',
'defaultPackage',
'hasFooterVersion',
'packageGraph',
'resourceProvider',
'sdkLibrarySources',
'packages',
'publicPackages',
'localPackages',
'documentedPackages',
'libraryElementReexportedBy',
'allHrefs',
'libraries',
'publicLibraries',
'localLibraries',
'inheritThrough',
'invisibleAnnotations',
'allModelElements',
'allLocalModelElements',
'allCanonicalModelElements',
'referenceChildren',
'referenceParents'
},
'PackageMeta': {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/model/accessor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class Accessor extends ModelElement implements EnclosedElement {
/// for a synthetic accessor just in case it is inherited somewhere
/// down the line due to split inheritance.
bool get _hasSyntheticDocumentationComment =>
(isGetter || definingCombo.hasNodoc! || _comboDocsAreIndependent()) &&
(isGetter || definingCombo.hasNodoc || _comboDocsAreIndependent()) &&
definingCombo.hasDocumentationComment;

// If we're a setter, and a getter exists, do not add synthetic
Expand Down
2 changes: 1 addition & 1 deletion lib/src/model/documentation_comment.dart
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ mixin DocumentationComment
bool get hasDocumentationComment;

/// Returns true if the raw documentation comment has a nodoc indication.
bool? get hasNodoc {
bool get hasNodoc {
if (hasDocumentationComment &&
(documentationComment.contains('@nodoc') ||
documentationComment.contains('<nodoc>'))) {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/model/extension_target.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ mixin ExtensionTarget on ModelElement {
/// defined by [element] can exist where this extension applies, not including
/// any extension that applies to every type.
Iterable<Extension>? get potentiallyApplicableExtensions {
_potentiallyApplicableExtensions ??= packageGraph.documentedExtensions!
_potentiallyApplicableExtensions ??= packageGraph.documentedExtensions
.where((e) => !e.alwaysApplies)
.where((e) => e.couldApplyTo(this))
.toList(growable: false);
Expand Down
6 changes: 3 additions & 3 deletions lib/src/model/inheritable.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ mixin Inheritable on ContainerMember {
for (var c in inheritance.reversed) {
// Filter out mixins.
if (c!.containsElement(searchElement)) {
if ((packageGraph.inheritThrough!.contains(previous) &&
if ((packageGraph.inheritThrough.contains(previous) &&
c != definingEnclosingContainer) ||
(packageGraph.inheritThrough!.contains(c) &&
(packageGraph.inheritThrough.contains(c) &&
c == definingEnclosingContainer)) {
return previousNonSkippable!
.memberByExample(this)
Expand All @@ -90,7 +90,7 @@ mixin Inheritable on ContainerMember {
}
}
previous = c;
if (!packageGraph.inheritThrough!.contains(c)) {
if (!packageGraph.inheritThrough.contains(c)) {
previousNonSkippable = c;
}
}
Expand Down
4 changes: 2 additions & 2 deletions lib/src/model/library.dart
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ class Library extends ModelElement with Categorization, TopLevelContainer {
.toList(growable: false);

SdkLibrary? get sdkLib {
if (packageGraph.sdkLibrarySources!.containsKey(element.librarySource)) {
return packageGraph.sdkLibrarySources![element.librarySource];
if (packageGraph.sdkLibrarySources.containsKey(element.librarySource)) {
return packageGraph.sdkLibrarySources[element.librarySource];
}
return null;
}
Expand Down
8 changes: 4 additions & 4 deletions lib/src/model/model_element.dart
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ abstract class ModelElement extends Canonicalization

@override
late final bool isPublic = () {
if (name == '') {
if (name.isEmpty) {
return false;
}
if (this is! Library && (library == null || !library!.isPublic)) {
Expand All @@ -417,7 +417,7 @@ abstract class ModelElement extends Canonicalization
!(enclosingElement as Extension).isPublic) {
return false;
}
return utils.hasPublicName(element!) && !hasNodoc!;
return utils.hasPublicName(element!) && !hasNodoc;
}();

@override
Expand Down Expand Up @@ -543,7 +543,7 @@ abstract class ModelElement extends Canonicalization
if (this is Inheritable && !config.linkToRemote) {
if ((this as Inheritable).isInherited &&
_canonicalLibrary == null &&
packageGraph.publicLibraries!.contains(library)) {
packageGraph.publicLibraries.contains(library)) {
// In the event we've inherited a field from an object that isn't
// directly reexported, we may need to pretend we are canonical for
// this.
Expand All @@ -553,7 +553,7 @@ abstract class ModelElement extends Canonicalization
_canonicalLibraryIsSet = true;
}
assert(_canonicalLibrary == null ||
packageGraph.publicLibraries!.contains(_canonicalLibrary));
packageGraph.publicLibraries.contains(_canonicalLibrary));
return _canonicalLibrary;
}

Expand Down
Loading