mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 02:57:35 +00:00
Change packages analyzer and _fe_analyzer_shared to use language version 3.2.
This will allow these packages to take advantage of private field promotion. Change-Id: I35dc57ecd7a0c3afde4713cd60aca86b479393a3 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/351162 Commit-Queue: Paul Berry <paulberry@google.com> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
This commit is contained in:
parent
14f7622ef4
commit
9d39c79471
|
@ -4,7 +4,7 @@ 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
|
||||
|
||||
environment:
|
||||
sdk: ^3.0.0
|
||||
sdk: ^3.2.0
|
||||
|
||||
dependencies:
|
||||
meta: ^1.9.0
|
||||
|
|
|
@ -77,7 +77,7 @@ class PhysicalResourceProvider implements ResourceProvider {
|
|||
@override
|
||||
Folder? getStateLocation(String pluginId) {
|
||||
if (_stateLocation != null) {
|
||||
io.Directory directory = io.Directory(join(_stateLocation!, pluginId));
|
||||
io.Directory directory = io.Directory(join(_stateLocation, pluginId));
|
||||
directory.createSync(recursive: true);
|
||||
return _PhysicalFolder(directory);
|
||||
}
|
||||
|
|
|
@ -2366,9 +2366,9 @@ class NodeReplacer extends ThrowingAstVisitor<bool> {
|
|||
node.defaultValue = _newNode as ExpressionImpl;
|
||||
var parameterElement = node.declaredElement;
|
||||
if (parameterElement is DefaultParameterElementImpl) {
|
||||
parameterElement.constantInitializer = _newNode as ExpressionImpl;
|
||||
parameterElement.constantInitializer = _newNode;
|
||||
} else if (parameterElement is DefaultFieldFormalParameterElementImpl) {
|
||||
parameterElement.constantInitializer = _newNode as ExpressionImpl;
|
||||
parameterElement.constantInitializer = _newNode;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1075,7 +1075,7 @@ class ConstantVisitor extends UnifyingAstVisitor<Constant> {
|
|||
}
|
||||
|
||||
if (_substitution != null) {
|
||||
type = _substitution!.substituteType(type);
|
||||
type = _substitution.substituteType(type);
|
||||
}
|
||||
|
||||
return _getConstantValue(
|
||||
|
|
|
@ -3130,7 +3130,7 @@ class TypeState extends InstanceState {
|
|||
if (_type == null) {
|
||||
return StringState.UNKNOWN_VALUE;
|
||||
}
|
||||
return StringState(_type!.getDisplayString());
|
||||
return StringState(_type.getDisplayString());
|
||||
}
|
||||
|
||||
@override
|
||||
|
@ -3153,7 +3153,7 @@ class TypeState extends InstanceState {
|
|||
}
|
||||
|
||||
return BoolState.from(
|
||||
typeSystem.runtimeTypesEqual(_type!, rightType),
|
||||
typeSystem.runtimeTypesEqual(_type, rightType),
|
||||
);
|
||||
}
|
||||
return BoolState.FALSE_STATE;
|
||||
|
|
|
@ -24,7 +24,7 @@ class AnnotationVerifier {
|
|||
|
||||
/// Whether [_currentLibrary] is part of its containing package's public API.
|
||||
late final bool _inPackagePublicApi = _workspacePackage != null &&
|
||||
_workspacePackage!.sourceIsInPublicApi(_currentLibrary.source);
|
||||
_workspacePackage.sourceIsInPublicApi(_currentLibrary.source);
|
||||
|
||||
AnnotationVerifier(
|
||||
this._errorReporter,
|
||||
|
|
|
@ -91,7 +91,7 @@ class BestPracticesVerifier extends RecursiveAstVisitor<void> {
|
|||
|
||||
/// Whether [_currentLibrary] is part of its containing package's public API.
|
||||
late final bool _inPackagePublicApi = _workspacePackage != null &&
|
||||
_workspacePackage!.sourceIsInPublicApi(_currentLibrary.source);
|
||||
_workspacePackage.sourceIsInPublicApi(_currentLibrary.source);
|
||||
|
||||
BestPracticesVerifier(
|
||||
this._errorReporter,
|
||||
|
@ -1541,7 +1541,7 @@ class BestPracticesVerifier extends RecursiveAstVisitor<void> {
|
|||
// if we were unable to determine what package [_currentLibrary] is in.
|
||||
return false;
|
||||
}
|
||||
return _workspacePackage!.contains(library.source);
|
||||
return _workspacePackage.contains(library.source);
|
||||
}
|
||||
|
||||
/// Checks for the passed as expression for the [WarningCode.UNNECESSARY_CAST]
|
||||
|
@ -2017,7 +2017,7 @@ class _InvalidAccessVerifier {
|
|||
// if we were unable to determine what package [_currentLibrary] is in.
|
||||
return false;
|
||||
}
|
||||
return _workspacePackage!.contains(library.source);
|
||||
return _workspacePackage.contains(library.source);
|
||||
}
|
||||
|
||||
/// Check if @visibleForTemplate is applied to the given [Element].
|
||||
|
|
|
@ -376,6 +376,6 @@ class DeprecatedMemberUseVerifier extends BaseDeprecatedMemberUseVerifier {
|
|||
if (_workspacePackage == null || library == null) {
|
||||
return false;
|
||||
}
|
||||
return _workspacePackage!.contains(library.source);
|
||||
return _workspacePackage.contains(library.source);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5158,7 +5158,7 @@ class _WhyNotPromotedVisitor
|
|||
node = node.identifier;
|
||||
}
|
||||
if (_dataForTesting != null) {
|
||||
_dataForTesting!.nonPromotionReasonTargets[node] = reason.shortName;
|
||||
_dataForTesting.nonPromotionReasonTargets[node] = reason.shortName;
|
||||
}
|
||||
var variableName = reason.variable.name;
|
||||
return [_contextMessageForWrite(variableName, node, reason)];
|
||||
|
|
|
@ -779,7 +779,7 @@ class PluginsOptionValidator extends OptionsValidator {
|
|||
reporter.reportErrorForSpan(
|
||||
AnalysisOptionsWarningCode.MULTIPLE_PLUGINS,
|
||||
plugins.span,
|
||||
[_firstIncludedPluginName!],
|
||||
[_firstIncludedPluginName],
|
||||
);
|
||||
}
|
||||
} else if (plugins is YamlList) {
|
||||
|
@ -791,7 +791,7 @@ class PluginsOptionValidator extends OptionsValidator {
|
|||
reporter.reportErrorForSpan(
|
||||
AnalysisOptionsWarningCode.MULTIPLE_PLUGINS,
|
||||
plugin.span,
|
||||
[_firstIncludedPluginName!],
|
||||
[_firstIncludedPluginName],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -825,7 +825,7 @@ class PluginsOptionValidator extends OptionsValidator {
|
|||
reporter.reportErrorForSpan(
|
||||
AnalysisOptionsWarningCode.MULTIPLE_PLUGINS,
|
||||
plugin.span,
|
||||
[_firstIncludedPluginName!],
|
||||
[_firstIncludedPluginName],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ class LRUMap<K, V> {
|
|||
K evictedKey = _map.keys.first;
|
||||
V evictedValue = _map.remove(evictedKey) as V;
|
||||
if (_handler != null) {
|
||||
_handler!.call(evictedKey, evictedValue);
|
||||
_handler.call(evictedKey, evictedValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ description: >-
|
|||
repository: https://github.com/dart-lang/sdk/tree/main/pkg/analyzer
|
||||
|
||||
environment:
|
||||
sdk: '>=3.0.0 <4.0.0'
|
||||
sdk: '>=3.2.0 <4.0.0'
|
||||
|
||||
dependencies:
|
||||
_fe_analyzer_shared: ^67.0.0
|
||||
|
|
|
@ -56,7 +56,7 @@ class ResolutionVerifier extends RecursiveAstVisitor<void> {
|
|||
node.visitChildren(this);
|
||||
var elementAnnotation = node.elementAnnotation;
|
||||
if (elementAnnotation == null) {
|
||||
if (_knownExceptions == null || !_knownExceptions!.contains(node)) {
|
||||
if (_knownExceptions == null || !_knownExceptions.contains(node)) {
|
||||
_unresolvedNodes.add(node);
|
||||
}
|
||||
}
|
||||
|
@ -244,7 +244,7 @@ class ResolutionVerifier extends RecursiveAstVisitor<void> {
|
|||
bool Function(Element)? predicate,
|
||||
) {
|
||||
if (element == null) {
|
||||
if (_knownExceptions == null || !_knownExceptions!.contains(node)) {
|
||||
if (_knownExceptions == null || !_knownExceptions.contains(node)) {
|
||||
_unresolvedNodes.add(node);
|
||||
}
|
||||
} else if (predicate != null) {
|
||||
|
|
Loading…
Reference in a new issue