@@ -135,11 +135,20 @@ final Map<PackageWarning, PackageWarningDefinition> packageWarningDefinitions =
135135 PackageWarning .ignoredCanonicalFor: PackageWarningDefinition (
136136 PackageWarning .ignoredCanonicalFor,
137137 'ignored-canonical-for' ,
138- 'A @canonicalFor tag refers to a library which this symbol can not be canonical for' ),
138+ 'A @canonicalFor tag refers to a library which this symbol can not be '
139+ 'canonical for' ),
139140 PackageWarning .noCanonicalFound: PackageWarningDefinition (
140141 PackageWarning .noCanonicalFound,
141142 'no-canonical-found' ,
142- 'A symbol is part of the public interface for this package, but no library documented with this package documents it so dartdoc can not link to it' ),
143+ 'A symbol is part of the public interface for this package, but no '
144+ 'library documented with this package documents it so dartdoc can '
145+ 'not link to it' ),
146+ PackageWarning .noDefiningLibraryFound: PackageWarningDefinition (
147+ PackageWarning .noDefiningLibraryFound,
148+ 'no-defining-library-found' ,
149+ 'The defining library for an element could not be found; the library may '
150+ 'be imported or exported with a non-standard URI' ,
151+ defaultWarningMode: PackageWarningMode .error),
143152 PackageWarning .notImplemented: PackageWarningDefinition (
144153 PackageWarning .notImplemented,
145154 'not-implemented' ,
@@ -245,6 +254,7 @@ enum PackageWarning {
245254 ambiguousReexport,
246255 ignoredCanonicalFor,
247256 noCanonicalFound,
257+ noDefiningLibraryFound,
248258 notImplemented,
249259 noLibraryLevelDocs,
250260 packageOrderGivesMissingPackageName,
@@ -441,9 +451,7 @@ class PackageWarningCounter {
441451 PackageWarningOptionContext config =
442452 element? .config ?? packageGraph.defaultPackage.config;
443453 var warningMode = config.packageWarningOptions.getMode (kind);
444- if (! config.allowNonLocalWarnings &&
445- element != null &&
446- ! element.package.isLocal) {
454+ if (! config.allowNonLocalWarnings && ! (element? .package? .isLocal ?? true )) {
447455 warningMode = PackageWarningMode .ignore;
448456 }
449457 if (warningMode == PackageWarningMode .warn) {
0 commit comments