diff --git a/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/exhaustive.dart b/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/exhaustive.dart index c4bb4118dbf..debef262fd9 100644 --- a/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/exhaustive.dart +++ b/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/exhaustive.dart @@ -324,8 +324,8 @@ class _Checker { // Sorting isn't necessary, but makes the behavior deterministic. List sortedPropertyKeys = propertyKeys.toList()..sort(); - List sortedAdditionalPropertyKeys = - additionalPropertyKeys.toList()..sort(); + List sortedAdditionalPropertyKeys = additionalPropertyKeys.toList() + ..sort(); // Remove the first column from the value list and replace it with any // expanded fields. diff --git a/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/shared.dart b/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/shared.dart index bc6e4d49b55..5a2237b54ab 100644 --- a/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/shared.dart +++ b/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/shared.dart @@ -323,16 +323,15 @@ class ExhaustivenessCache< String textualRepresentation, ) { Type nonNullable = typeOperations.getNonNullable(type); - StaticType staticType = - _uniqueTypeMap[uniqueValue] ??= - new GeneralValueStaticType( - typeOperations, - this, - nonNullable, - new IdentityRestriction(uniqueValue), - textualRepresentation, - uniqueValue, - ); + StaticType staticType = _uniqueTypeMap[uniqueValue] ??= + new GeneralValueStaticType( + typeOperations, + this, + nonNullable, + new IdentityRestriction(uniqueValue), + textualRepresentation, + uniqueValue, + ); if (typeOperations.isNullable(type)) { staticType = staticType.nullable; } @@ -657,8 +656,9 @@ mixin SpaceCreator { if (space.singleSpaces.length == 1) { // Optimize for simple spaces to avoid unnecessary expansion of subtypes. SingleSpace singleSpace = space.singleSpaces.single; - bool isUnrestricted = - unrestrictedCache[singleSpace] ??= _isUnrestricted(singleSpace); + bool isUnrestricted = unrestrictedCache[singleSpace] ??= _isUnrestricted( + singleSpace, + ); if (isUnrestricted && type.isSubtypeOf(singleSpace.type)) { return true; } @@ -677,8 +677,8 @@ mixin SpaceCreator { for (StaticType subtype in subtypes) { bool found = false; for (SingleSpace singleSpace in space.singleSpaces) { - bool isUnrestricted = - unrestrictedCache[singleSpace] ??= _isUnrestricted(singleSpace); + bool isUnrestricted = unrestrictedCache[singleSpace] ??= + _isUnrestricted(singleSpace); if (isUnrestricted && subtype.isSubtypeOf(singleSpace.type)) { found = true; break; diff --git a/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/static_type.dart b/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/static_type.dart index c6191ef2e1b..45affaf0ee4 100644 --- a/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/static_type.dart +++ b/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/static_type.dart @@ -496,18 +496,15 @@ class WrappedStaticType extends _BaseStaticType { @override late final StaticType nonNullable = wrappedType.nonNullable == wrappedType && - impliedType.nonNullable == impliedType - ? this - : new WrappedStaticType( - wrappedType.nonNullable, - impliedType.nonNullable, - ); + impliedType.nonNullable == impliedType + ? this + : new WrappedStaticType(wrappedType.nonNullable, impliedType.nonNullable); @override late final StaticType nullable = wrappedType.nullable == wrappedType && impliedType.nullable == impliedType - ? this - : new WrappedStaticType(wrappedType.nullable, impliedType.nullable); + ? this + : new WrappedStaticType(wrappedType.nullable, impliedType.nullable); @override void typeToDart(DartTemplateBuffer buffer) { diff --git a/pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart b/pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart index f972d5655ee..25be59278a3 100644 --- a/pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart +++ b/pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart @@ -126,14 +126,9 @@ class ExpressionInfo { /// contains information about the expression `x == null`, calling this method /// produces an [ExpressionInfo] containing information about the expression /// `x != null`. - ExpressionInfo _invert() => - isNonTrivial - ? new ExpressionInfo( - type: _type, - ifTrue: ifFalse, - ifFalse: ifTrue, - ) - : this; + ExpressionInfo _invert() => isNonTrivial + ? new ExpressionInfo(type: _type, ifTrue: ifFalse, ifFalse: ifTrue) + : this; } /// [PropertyTarget] that is an expression appearing explicitly in the source @@ -2584,8 +2579,8 @@ class FlowAnalysisDebug< Map Function() callback, ) { String callbackToString = '#CALLBACK${_nextCallbackId++}'; - Map Function() wrappedCallback = - () => _wrap('$callbackToString()', callback, isQuery: true); + Map Function() wrappedCallback = () => + _wrap('$callbackToString()', callback, isQuery: true); _description[wrappedCallback] = callbackToString; return wrappedCallback; } @@ -2726,8 +2721,8 @@ class FlowModel { // guaranteed to be already assigned and won't be assigned again. if (helper.isFinal(variableKey)) continue; - PromotionModel newInfo = - info.discardPromotionsAndMarkNotUnassigned(); + PromotionModel newInfo = info + .discardPromotionsAndMarkNotUnassigned(); if (!identical(info, newInfo)) { result = result.updatePromotionInfo(helper, variableKey, newInfo); } @@ -2808,13 +2803,12 @@ class FlowModel { PromotionModel? promotionModel = left?.model; if (promotionModel == null) continue; PromotionModel? otherPromotionModel = right?.model; - PromotionModel newPromotionModel = - otherPromotionModel == null - ? promotionModel - : PromotionModel.inheritTested( - promotionModel, - otherPromotionModel.tested, - ); + PromotionModel newPromotionModel = otherPromotionModel == null + ? promotionModel + : PromotionModel.inheritTested( + promotionModel, + otherPromotionModel.tested, + ); if (!identical(newPromotionModel, promotionModel)) { result = result.updatePromotionInfo( helper, @@ -2848,7 +2842,10 @@ class FlowModel { var ( :PromotionInfo? ancestor, :List>> entries, - ) = helper.reader.diff(promotionInfo, base.promotionInfo); + ) = helper.reader.diff( + promotionInfo, + base.promotionInfo, + ); // If `this` matches the ancestor, then there are no state changes that need // to be rewound and applied to `base`. if (ancestor == promotionInfo) { @@ -3229,17 +3226,17 @@ class FlowModel { identical(newPromotedTypes, info.promotedTypes) ? this : updatePromotionInfo( - helper, - reference.promotionKey, - new PromotionModel( - promotedTypes: newPromotedTypes, - tested: newTested, - assigned: info.assigned, - unassigned: info.unassigned, - ssaNode: info.ssaNode, - nonPromotionHistory: info.nonPromotionHistory, - ), - ); + helper, + reference.promotionKey, + new PromotionModel( + promotedTypes: newPromotedTypes, + tested: newTested, + assigned: info.assigned, + unassigned: info.unassigned, + ssaNode: info.ssaNode, + nonPromotionHistory: info.nonPromotionHistory, + ), + ); } /// Forms a new state to reflect a control flow path that might have come from @@ -3292,7 +3289,10 @@ class FlowModel { var ( :PromotionInfo? ancestor, :List>> entries, - ) = helper.reader.diff(first.promotionInfo, second.promotionInfo); + ) = helper.reader.diff( + first.promotionInfo, + second.promotionInfo, + ); FlowModel newFlowModel = new FlowModel.withInfo( first.reachable, ancestor, @@ -3825,17 +3825,16 @@ class PromotionModel { /// Returns a promotion model that is the same as this one, but with the /// variable definitely assigned. - PromotionModel _setAssigned() => - assigned - ? this - : new PromotionModel( - promotedTypes: promotedTypes, - tested: tested, - assigned: true, - unassigned: false, - ssaNode: ssaNode, - nonPromotionHistory: nonPromotionHistory, - ); + PromotionModel _setAssigned() => assigned + ? this + : new PromotionModel( + promotedTypes: promotedTypes, + tested: tested, + assigned: true, + unassigned: false, + ssaNode: ssaNode, + nonPromotionHistory: nonPromotionHistory, + ); /// Determines whether a variable with the given [promotedTypes] should be /// promoted to [writtenType] based on types of interest. If it should, @@ -3855,8 +3854,9 @@ class PromotionModel { // Figure out if we have any promotion candidates (types that are a // supertype of writtenType and a proper subtype of the currently-promoted // type). If at any point we find an exact match, we take it immediately. - Type currentlyPromotedType = - promotedTypes.isNotEmpty ? promotedTypes.last : declaredType; + Type currentlyPromotedType = promotedTypes.isNotEmpty + ? promotedTypes.last + : declaredType; List? result = null; List? candidates = null; @@ -4012,8 +4012,9 @@ class PromotionModel { bool newAssigned = first.assigned && second.assigned; bool newUnassigned = first.unassigned && second.unassigned; bool newWriteCaptured = first.writeCaptured || second.writeCaptured; - List newTested = - newWriteCaptured ? const [] : joinTested(first.tested, second.tested); + List newTested = newWriteCaptured + ? const [] + : joinTested(first.tested, second.tested); SsaNode? newSsaNode = propertySsaNode; if (newSsaNode == null && !newWriteCaptured) { (newSsaNode, newFlowModel) = SsaNode._join( @@ -4170,10 +4171,9 @@ class PromotionModel { static List _addToPromotedTypes( List promotedTypes, Type promoted, - ) => - promotedTypes.isEmpty - ? [promoted] - : (promotedTypes.toList()..add(promoted)); + ) => promotedTypes.isEmpty + ? [promoted] + : (promotedTypes.toList()..add(promoted)); static List _addTypeToUniqueList( List types, @@ -4934,11 +4934,10 @@ class _BranchTargetContext extends _FlowContext { _BranchTargetContext(this._checkpoint); @override - Map get _debugFields => - super._debugFields - ..['breakModel'] = _breakModel - ..['continueModel'] = _continueModel - ..['checkpoint'] = _checkpoint; + Map get _debugFields => super._debugFields + ..['breakModel'] = _breakModel + ..['continueModel'] = _continueModel + ..['checkpoint'] = _checkpoint; @override String get _debugType => '_BranchTargetContext'; @@ -4966,10 +4965,9 @@ class _ConditionalContext extends _BranchContext { _ConditionalContext(super._branchModel); @override - Map get _debugFields => - super._debugFields - ..['thenInfo'] = _thenInfo - ..['thenModel'] = _thenModel; + Map get _debugFields => super._debugFields + ..['thenInfo'] = _thenInfo + ..['thenModel'] = _thenModel; @override String get _debugType => '_ConditionalContext'; @@ -5190,8 +5188,10 @@ class _FlowAnalysisImpl< @override void assert_end() { _AssertContext context = _stack.removeLast() as _AssertContext; - _current = - _join(context._previous, context._conditionInfo!.ifTrue).unsplit(); + _current = _join( + context._previous, + context._conditionInfo!.ifTrue, + ).unsplit(); } @override @@ -5223,15 +5223,15 @@ class _FlowAnalysisImpl< expression, value ? new ExpressionInfo( - type: boolType, - ifTrue: _current, - ifFalse: unreachable, - ) + type: boolType, + ifTrue: _current, + ifFalse: unreachable, + ) : new ExpressionInfo( - type: boolType, - ifTrue: unreachable, - ifFalse: _current, - ), + type: boolType, + ifTrue: unreachable, + ifFalse: _current, + ), ); } @@ -5442,11 +5442,10 @@ class _FlowAnalysisImpl< void doStatement_end(Expression condition) { _BranchTargetContext context = _stack.removeLast() as _BranchTargetContext; - _current = - _join( - _expressionEnd(condition, boolType).ifFalse, - context._breakModel, - ).unsplit(); + _current = _join( + _expressionEnd(condition, boolType).ifFalse, + context._breakModel, + ).unsplit(); } @override @@ -5546,14 +5545,13 @@ class _FlowAnalysisImpl< @override void for_bodyBegin(Statement? node, Expression? condition) { - ExpressionInfo conditionInfo = - condition == null - ? new ExpressionInfo( - type: boolType, - ifTrue: _current, - ifFalse: _current.setUnreachable(), - ) - : _expressionEnd(condition, boolType); + ExpressionInfo conditionInfo = condition == null + ? new ExpressionInfo( + type: boolType, + ifTrue: _current, + ifFalse: _current.setUnreachable(), + ) + : _expressionEnd(condition, boolType); _WhileContext context = new _WhileContext( _current.reachable.parent!, conditionInfo, @@ -5582,11 +5580,10 @@ class _FlowAnalysisImpl< FlowModel? breakState = context._breakModel; FlowModel falseCondition = context._conditionInfo.ifFalse; - _current = - _join( - falseCondition, - breakState, - ).inheritTested(this, _current).unsplit(); + _current = _join( + falseCondition, + breakState, + ).inheritTested(this, _current).unsplit(); } @override @@ -6343,14 +6340,12 @@ class _FlowAnalysisImpl< _current.promotionInfo ?.get(this, scrutineeReference.promotionKey) ?.ssaNode)) { - ifTrue = - ifTrue - .tryPromoteForTypeCheck(this, scrutineeReference, knownType) - .ifTrue; - ifFalse = - ifFalse - .tryPromoteForTypeCheck(this, scrutineeReference, knownType) - .ifFalse; + ifTrue = ifTrue + .tryPromoteForTypeCheck(this, scrutineeReference, knownType) + .ifTrue; + ifFalse = ifFalse + .tryPromoteForTypeCheck(this, scrutineeReference, knownType) + .ifFalse; } _current = ifTrue; if (cannotMatch) { @@ -6486,10 +6481,9 @@ class _FlowAnalysisImpl< } @override - SsaNode? ssaNodeForTesting(Variable variable) => - _current.promotionInfo - ?.get(this, promotionKeyStore.keyForVariable(variable)) - ?.ssaNode; + SsaNode? ssaNodeForTesting(Variable variable) => _current.promotionInfo + ?.get(this, promotionKeyStore.keyForVariable(variable)) + ?.ssaNode; @override bool switchStatement_afterCase() { @@ -6789,14 +6783,15 @@ class _FlowAnalysisImpl< promotionModel, ); } - _Reference expressionInfo = _variableReference( - variableKey, - unpromotedType, - ).restoreConditionVariableState( - promotionModel.ssaNode?.conditionVariableState, - this, - _current, - ); + _Reference expressionInfo = + _variableReference( + variableKey, + unpromotedType, + ).restoreConditionVariableState( + promotionModel.ssaNode?.conditionVariableState, + this, + _current, + ); _storeExpressionReference(expression, expressionInfo); _storeExpressionInfo(expression, expressionInfo); return promotionModel.promotedTypes.lastOrNull; @@ -7045,21 +7040,20 @@ class _FlowAnalysisImpl< // node can't be `null`. v1!; // - Otherwise, `p4 = rebasePromotedTypes(p1, p3)`. - p4 = - typeAnalyzerOptions.soundFlowAnalysisEnabled - ? PromotionModel.rebasePromotedTypes( - basePromotions: p1, - newPromotions: p3, - helper: this, - ) - : - // (UNSPECIFIED: reproduce old buggy behavior prior to the fix for - // https://github.com/dart-lang/language/issues/4382.) - PromotionModel.rebasePromotedTypes( - basePromotions: p3, - newPromotions: p1, - helper: this, - ); + p4 = typeAnalyzerOptions.soundFlowAnalysisEnabled + ? PromotionModel.rebasePromotedTypes( + basePromotions: p1, + newPromotions: p3, + helper: this, + ) + : + // (UNSPECIFIED: reproduce old buggy behavior prior to the fix for + // https://github.com/dart-lang/language/issues/4382.) + PromotionModel.rebasePromotedTypes( + basePromotions: p3, + newPromotions: p1, + helper: this, + ); // (UNSPECIFIED: and the SSA node after the `try-finally` statement is the // SSA node after the `try` block.) v4 = v1; @@ -7261,8 +7255,8 @@ class _FlowAnalysisImpl< if (propertyMember != null) { PropertyNonPromotabilityReason? whyNotPromotable = reference.propertyName.startsWith('_') - ? operations.whyPropertyIsNotPromotable(propertyMember) - : PropertyNonPromotabilityReason.isNotPrivate; + ? operations.whyPropertyIsNotPromotable(propertyMember) + : PropertyNonPromotabilityReason.isNotPrivate; _PropertySsaNode? ssaNode = (reference.ssaNode as _PropertySsaNode).previousSsaNode; List>? allPreviouslyPromotedTypes; @@ -7284,21 +7278,20 @@ class _FlowAnalysisImpl< for (List previouslyPromotedTypes in allPreviouslyPromotedTypes!) { for (Type type in previouslyPromotedTypes) { - result[type] = - whyNotPromotable == null - ? new PropertyNotPromotedForNonInherentReason( - reference.propertyName, - propertyMember, - fieldPromotionEnabled: - typeAnalyzerOptions.fieldPromotionEnabled, - ) - : new PropertyNotPromotedForInherentReason( - reference.propertyName, - propertyMember, - whyNotPromotable, - fieldPromotionEnabled: - typeAnalyzerOptions.fieldPromotionEnabled, - ); + result[type] = whyNotPromotable == null + ? new PropertyNotPromotedForNonInherentReason( + reference.propertyName, + propertyMember, + fieldPromotionEnabled: + typeAnalyzerOptions.fieldPromotionEnabled, + ) + : new PropertyNotPromotedForInherentReason( + reference.propertyName, + propertyMember, + whyNotPromotable, + fieldPromotionEnabled: + typeAnalyzerOptions.fieldPromotionEnabled, + ); } } return result; @@ -7511,8 +7504,8 @@ class _FlowAnalysisImpl< SsaNode newSsaNode = new SsaNode( conditionVariableState: expressionInfo != null && expressionInfo.isNonTrivial - ? expressionInfo - : null, + ? expressionInfo + : null, ); _current = _current.write( this, @@ -7524,14 +7517,13 @@ class _FlowAnalysisImpl< unpromotedType: unpromotedType, ); if (isImplicitlyTyped && operations.isTypeParameterType(matchedType)) { - _current = - _current - .tryPromoteForTypeCheck( - this, - _variableReference(promotionKey, unpromotedType), - matchedType, - ) - .ifTrue; + _current = _current + .tryPromoteForTypeCheck( + this, + _variableReference(promotionKey, unpromotedType), + matchedType, + ) + .ifTrue; } } @@ -7632,8 +7624,9 @@ class _FlowAnalysisImpl< if (typeClassification == TypeClassification.nonNullable) { return null; } else { - FlowModel? ifNotNull = - _current.tryMarkNonNullable(this, matchedValueReference).ifTrue; + FlowModel? ifNotNull = _current + .tryMarkNonNullable(this, matchedValueReference) + .ifTrue; _Reference? scrutineeReference = _scrutineeReference; // If the scrutinee is a variable reference, and the variable hasn't // changed since the start of the matching operation, promote it too. @@ -7650,8 +7643,9 @@ class _FlowAnalysisImpl< _current.promotionInfo ?.get(this, scrutineeReference.promotionKey) ?.ssaNode)) { - ifNotNull = - ifNotNull.tryMarkNonNullable(this, scrutineeReference).ifTrue; + ifNotNull = ifNotNull + .tryMarkNonNullable(this, scrutineeReference) + .ifTrue; } if (typeClassification == TypeClassification.nullOrEquivalent) { ifNotNull = ifNotNull.setUnreachable(); @@ -7711,8 +7705,9 @@ class _FlowAnalysisImpl< previousScrutineeReference: _scrutineeReference, ), ); - _Reference? scrutineeReference = - scrutineeInfo is _Reference ? scrutineeInfo : null; + _Reference? scrutineeReference = scrutineeInfo is _Reference + ? scrutineeInfo + : null; _scrutineeReference = scrutineeReference; SsaNode? scrutineeSsaNode; if (allowScrutineePromotion && scrutineeReference != null) { @@ -7795,8 +7790,8 @@ class _FlowAnalysisImpl< SsaNode newSsaNode = new SsaNode( conditionVariableState: expressionInfo != null && expressionInfo.isNonTrivial - ? expressionInfo - : null, + ? expressionInfo + : null, ); _current = _current.write( this, @@ -7987,10 +7982,9 @@ class _OrPatternContext extends _PatternContext { _OrPatternContext(super._matchedValueInfo, this._previousUnmatched); @override - Map get _debugFields => - super._debugFields - ..['previousUnmatched'] = _previousUnmatched - ..['lhsMatched'] = _lhsMatched; + Map get _debugFields => super._debugFields + ..['previousUnmatched'] = _previousUnmatched + ..['lhsMatched'] = _lhsMatched; @override String get _debugType => '_OrPatternContext'; @@ -8248,10 +8242,9 @@ class _SwitchStatementContext ) : _unmatched = _previous; @override - Map get _debugFields => - super._debugFields - ..['matchedValueInfo'] = _matchedValueInfo - ..['unmatched'] = _unmatched; + Map get _debugFields => super._debugFields + ..['matchedValueInfo'] = _matchedValueInfo + ..['unmatched'] = _unmatched; @override String get _debugType => '_SwitchStatementContext'; @@ -8287,10 +8280,9 @@ class _TryContext extends _SimpleContext { _TryContext(super.previous); @override - Map get _debugFields => - super._debugFields - ..['beforeCatch'] = _beforeCatch - ..['afterBodyAndCatches'] = '_afterBodyAndCatches'; + Map get _debugFields => super._debugFields + ..['beforeCatch'] = _beforeCatch + ..['afterBodyAndCatches'] = '_afterBodyAndCatches'; @override String get _debugType => '_TryContext'; @@ -8311,11 +8303,10 @@ class _TryFinallyContext extends _FlowContext { _TryFinallyContext(this._beforeTry); @override - Map get _debugFields => - super._debugFields - ..['beforeTry'] = _beforeTry - ..['afterTry'] = _afterTry - ..['beforeFinally'] = _beforeFinally; + Map get _debugFields => super._debugFields + ..['beforeTry'] = _beforeTry + ..['afterTry'] = _afterTry + ..['beforeFinally'] = _beforeFinally; @override String get _debugType => '_TryFinallyContext'; diff --git a/pkg/_fe_analyzer_shared/lib/src/messages/codes.dart b/pkg/_fe_analyzer_shared/lib/src/messages/codes.dart index e10fdb034de..b05f731c5a7 100644 --- a/pkg/_fe_analyzer_shared/lib/src/messages/codes.dart +++ b/pkg/_fe_analyzer_shared/lib/src/messages/codes.dart @@ -339,14 +339,14 @@ class DiagnosticMessageFromJson implements CfeDiagnosticMessage { decoded["plainTextFormatted"], ); CfeSeverity severity = CfeSeverity.values[decoded["severity"] as int]; - Uri? uri = - decoded["uri"] == null ? null : Uri.parse(decoded["uri"] as String); - List? involvedFiles = - decoded["involvedFiles"] == null - ? null - : _asListOfString( - decoded["involvedFiles"], - ).map((e) => Uri.parse(e)).toList(); + Uri? uri = decoded["uri"] == null + ? null + : Uri.parse(decoded["uri"] as String); + List? involvedFiles = decoded["involvedFiles"] == null + ? null + : _asListOfString( + decoded["involvedFiles"], + ).map((e) => Uri.parse(e)).toList(); String codeName = decoded["codeName"] as String; return new DiagnosticMessageFromJson( diff --git a/pkg/_fe_analyzer_shared/lib/src/messages/codes_generated.dart b/pkg/_fe_analyzer_shared/lib/src/messages/codes_generated.dart index 1c77f0214b5..b445f6bcc03 100644 --- a/pkg/_fe_analyzer_shared/lib/src/messages/codes_generated.dart +++ b/pkg/_fe_analyzer_shared/lib/src/messages/codes_generated.dart @@ -118,15 +118,14 @@ const MessageCode codeAbstractNotSync = const MessageCode( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeAbstractRedirectedClassInstantiation = const Template< - Message Function(String name) ->( - "AbstractRedirectedClassInstantiation", - problemMessageTemplate: - r"""Factory redirects to class '#name', which is abstract and can't be instantiated.""", - withArguments: _withArgumentsAbstractRedirectedClassInstantiation, - analyzerCodes: ["FACTORY_REDIRECTS_TO_ABSTRACT_CLASS"], -); +codeAbstractRedirectedClassInstantiation = + const Template( + "AbstractRedirectedClassInstantiation", + problemMessageTemplate: + r"""Factory redirects to class '#name', which is abstract and can't be instantiated.""", + withArguments: _withArgumentsAbstractRedirectedClassInstantiation, + analyzerCodes: ["FACTORY_REDIRECTS_TO_ABSTRACT_CLASS"], + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsAbstractRedirectedClassInstantiation(String name) { @@ -266,15 +265,14 @@ const MessageCode codeAwaitOfExtensionTypeNotFuture = const MessageCode( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeBaseClassImplementedOutsideOfLibrary = const Template< - Message Function(String name) ->( - "BaseClassImplementedOutsideOfLibrary", - problemMessageTemplate: - r"""The class '#name' can't be implemented outside of its library because it's a base class.""", - withArguments: _withArgumentsBaseClassImplementedOutsideOfLibrary, - analyzerCodes: ["BASE_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY"], -); +codeBaseClassImplementedOutsideOfLibrary = + const Template( + "BaseClassImplementedOutsideOfLibrary", + problemMessageTemplate: + r"""The class '#name' can't be implemented outside of its library because it's a base class.""", + withArguments: _withArgumentsBaseClassImplementedOutsideOfLibrary, + analyzerCodes: ["BASE_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY"], + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsBaseClassImplementedOutsideOfLibrary(String name) { @@ -298,15 +296,14 @@ const MessageCode codeBaseEnum = const MessageCode( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeBaseMixinImplementedOutsideOfLibrary = const Template< - Message Function(String name) ->( - "BaseMixinImplementedOutsideOfLibrary", - problemMessageTemplate: - r"""The mixin '#name' can't be implemented outside of its library because it's a base mixin.""", - withArguments: _withArgumentsBaseMixinImplementedOutsideOfLibrary, - analyzerCodes: ["BASE_MIXIN_IMPLEMENTED_OUTSIDE_OF_LIBRARY"], -); +codeBaseMixinImplementedOutsideOfLibrary = + const Template( + "BaseMixinImplementedOutsideOfLibrary", + problemMessageTemplate: + r"""The mixin '#name' can't be implemented outside of its library because it's a base mixin.""", + withArguments: _withArgumentsBaseMixinImplementedOutsideOfLibrary, + analyzerCodes: ["BASE_MIXIN_IMPLEMENTED_OUTSIDE_OF_LIBRARY"], + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsBaseMixinImplementedOutsideOfLibrary(String name) { @@ -322,15 +319,15 @@ Message _withArgumentsBaseMixinImplementedOutsideOfLibrary(String name) { // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeBaseOrFinalClassImplementedOutsideOfLibraryCause = const Template< - Message Function(String name, String name2) ->( - "BaseOrFinalClassImplementedOutsideOfLibraryCause", - problemMessageTemplate: - r"""The type '#name' is a subtype of '#name2', and '#name2' is defined here.""", - withArguments: _withArgumentsBaseOrFinalClassImplementedOutsideOfLibraryCause, - severity: CfeSeverity.context, -); +codeBaseOrFinalClassImplementedOutsideOfLibraryCause = + const Template( + "BaseOrFinalClassImplementedOutsideOfLibraryCause", + problemMessageTemplate: + r"""The type '#name' is a subtype of '#name2', and '#name2' is defined here.""", + withArguments: + _withArgumentsBaseOrFinalClassImplementedOutsideOfLibraryCause, + severity: CfeSeverity.context, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsBaseOrFinalClassImplementedOutsideOfLibraryCause( @@ -351,16 +348,16 @@ Message _withArgumentsBaseOrFinalClassImplementedOutsideOfLibraryCause( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeBinaryOperatorWrittenOut = const Template< - Message Function(String string, String string2) ->( - "BinaryOperatorWrittenOut", - problemMessageTemplate: - r"""Binary operator '#string' is written as '#string2' instead of the written out word.""", - correctionMessageTemplate: r"""Try replacing '#string' with '#string2'.""", - withArguments: _withArgumentsBinaryOperatorWrittenOut, - index: 112, -); +codeBinaryOperatorWrittenOut = + const Template( + "BinaryOperatorWrittenOut", + problemMessageTemplate: + r"""Binary operator '#string' is written as '#string2' instead of the written out word.""", + correctionMessageTemplate: + r"""Try replacing '#string' with '#string2'.""", + withArguments: _withArgumentsBinaryOperatorWrittenOut, + index: 112, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsBinaryOperatorWrittenOut(String string, String string2) { @@ -377,17 +374,16 @@ Message _withArgumentsBinaryOperatorWrittenOut(String string, String string2) { // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeBoundIssueViaCycleNonSimplicity = const Template< - Message Function(String name, String name2) ->( - "BoundIssueViaCycleNonSimplicity", - problemMessageTemplate: - r"""Generic type '#name' can't be used without type arguments in the bounds of its own type variables. It is referenced indirectly through '#name2'.""", - correctionMessageTemplate: - r"""Try providing type arguments to '#name2' here or to some other raw types in the bounds along the reference chain.""", - withArguments: _withArgumentsBoundIssueViaCycleNonSimplicity, - analyzerCodes: ["NOT_INSTANTIATED_BOUND"], -); +codeBoundIssueViaCycleNonSimplicity = + const Template( + "BoundIssueViaCycleNonSimplicity", + problemMessageTemplate: + r"""Generic type '#name' can't be used without type arguments in the bounds of its own type variables. It is referenced indirectly through '#name2'.""", + correctionMessageTemplate: + r"""Try providing type arguments to '#name2' here or to some other raw types in the bounds along the reference chain.""", + withArguments: _withArgumentsBoundIssueViaCycleNonSimplicity, + analyzerCodes: ["NOT_INSTANTIATED_BOUND"], + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsBoundIssueViaCycleNonSimplicity( @@ -410,9 +406,7 @@ Message _withArgumentsBoundIssueViaCycleNonSimplicity( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeBoundIssueViaLoopNonSimplicity = const Template< - Message Function(String name) ->( +codeBoundIssueViaLoopNonSimplicity = const Template( "BoundIssueViaLoopNonSimplicity", problemMessageTemplate: r"""Generic type '#name' can't be used without type arguments in the bounds of its own type variables.""", @@ -437,17 +431,16 @@ Message _withArgumentsBoundIssueViaLoopNonSimplicity(String name) { // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeBoundIssueViaRawTypeWithNonSimpleBounds = const Template< - Message Function(String name) ->( - "BoundIssueViaRawTypeWithNonSimpleBounds", - problemMessageTemplate: - r"""Generic type '#name' can't be used without type arguments in a type variable bound.""", - correctionMessageTemplate: - r"""Try providing type arguments to '#name' here.""", - withArguments: _withArgumentsBoundIssueViaRawTypeWithNonSimpleBounds, - analyzerCodes: ["NOT_INSTANTIATED_BOUND"], -); +codeBoundIssueViaRawTypeWithNonSimpleBounds = + const Template( + "BoundIssueViaRawTypeWithNonSimpleBounds", + problemMessageTemplate: + r"""Generic type '#name' can't be used without type arguments in a type variable bound.""", + correctionMessageTemplate: + r"""Try providing type arguments to '#name' here.""", + withArguments: _withArgumentsBoundIssueViaRawTypeWithNonSimpleBounds, + analyzerCodes: ["NOT_INSTANTIATED_BOUND"], + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsBoundIssueViaRawTypeWithNonSimpleBounds(String name) { @@ -726,16 +719,15 @@ const MessageCode codeCantInferPackagesFromPackageUri = const MessageCode( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeCantInferReturnTypeDueToNoCombinedSignature = const Template< - Message Function(String name) ->( - "CantInferReturnTypeDueToNoCombinedSignature", - problemMessageTemplate: - r"""Can't infer a return type for '#name' as the overridden members don't have a combined signature.""", - correctionMessageTemplate: r"""Try adding an explicit type.""", - withArguments: _withArgumentsCantInferReturnTypeDueToNoCombinedSignature, - analyzerCodes: ["COMPILE_TIME_ERROR.NO_COMBINED_SUPER_SIGNATURE"], -); +codeCantInferReturnTypeDueToNoCombinedSignature = + const Template( + "CantInferReturnTypeDueToNoCombinedSignature", + problemMessageTemplate: + r"""Can't infer a return type for '#name' as the overridden members don't have a combined signature.""", + correctionMessageTemplate: r"""Try adding an explicit type.""", + withArguments: _withArgumentsCantInferReturnTypeDueToNoCombinedSignature, + analyzerCodes: ["COMPILE_TIME_ERROR.NO_COMBINED_SUPER_SIGNATURE"], + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsCantInferReturnTypeDueToNoCombinedSignature(String name) { @@ -752,9 +744,7 @@ Message _withArgumentsCantInferReturnTypeDueToNoCombinedSignature(String name) { // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeCantInferTypeDueToCircularity = const Template< - Message Function(String string) ->( +codeCantInferTypeDueToCircularity = const Template( "CantInferTypeDueToCircularity", problemMessageTemplate: r"""Can't infer the type of '#string': circularity found during type inference.""", @@ -777,16 +767,15 @@ Message _withArgumentsCantInferTypeDueToCircularity(String string) { // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeCantInferTypeDueToNoCombinedSignature = const Template< - Message Function(String name) ->( - "CantInferTypeDueToNoCombinedSignature", - problemMessageTemplate: - r"""Can't infer a type for '#name' as the overridden members don't have a combined signature.""", - correctionMessageTemplate: r"""Try adding an explicit type.""", - withArguments: _withArgumentsCantInferTypeDueToNoCombinedSignature, - analyzerCodes: ["COMPILE_TIME_ERROR.NO_COMBINED_SUPER_SIGNATURE"], -); +codeCantInferTypeDueToNoCombinedSignature = + const Template( + "CantInferTypeDueToNoCombinedSignature", + problemMessageTemplate: + r"""Can't infer a type for '#name' as the overridden members don't have a combined signature.""", + correctionMessageTemplate: r"""Try adding an explicit type.""", + withArguments: _withArgumentsCantInferTypeDueToNoCombinedSignature, + analyzerCodes: ["COMPILE_TIME_ERROR.NO_COMBINED_SUPER_SIGNATURE"], + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsCantInferTypeDueToNoCombinedSignature(String name) { @@ -803,16 +792,15 @@ Message _withArgumentsCantInferTypeDueToNoCombinedSignature(String name) { // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeCantInferTypesDueToNoCombinedSignature = const Template< - Message Function(String name) ->( - "CantInferTypesDueToNoCombinedSignature", - problemMessageTemplate: - r"""Can't infer types for '#name' as the overridden members don't have a combined signature.""", - correctionMessageTemplate: r"""Try adding explicit types.""", - withArguments: _withArgumentsCantInferTypesDueToNoCombinedSignature, - analyzerCodes: ["COMPILE_TIME_ERROR.NO_COMBINED_SUPER_SIGNATURE"], -); +codeCantInferTypesDueToNoCombinedSignature = + const Template( + "CantInferTypesDueToNoCombinedSignature", + problemMessageTemplate: + r"""Can't infer types for '#name' as the overridden members don't have a combined signature.""", + correctionMessageTemplate: r"""Try adding explicit types.""", + withArguments: _withArgumentsCantInferTypesDueToNoCombinedSignature, + analyzerCodes: ["COMPILE_TIME_ERROR.NO_COMBINED_SUPER_SIGNATURE"], + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsCantInferTypesDueToNoCombinedSignature(String name) { @@ -892,9 +880,7 @@ Message _withArgumentsCantUseControlFlowOrSpreadAsConstant(Token token) { // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeCantUseDeferredPrefixAsConstant = const Template< - Message Function(Token token) ->( +codeCantUseDeferredPrefixAsConstant = const Template( "CantUseDeferredPrefixAsConstant", problemMessageTemplate: r"""'#lexeme' can't be used in a constant expression because it's marked as 'deferred' which means it isn't available until loaded.""", @@ -973,15 +959,16 @@ const MessageCode codeClassInClass = const MessageCode( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeClassShouldBeListedAsCallableInDynamicInterface = const Template< - Message Function(String name) ->( - "ClassShouldBeListedAsCallableInDynamicInterface", - problemMessageTemplate: r"""Cannot use class '#name' in a dynamic module.""", - correctionMessageTemplate: - r"""Try removing the reference to class '#name' or update the dynamic interface to list class '#name' as callable.""", - withArguments: _withArgumentsClassShouldBeListedAsCallableInDynamicInterface, -); +codeClassShouldBeListedAsCallableInDynamicInterface = + const Template( + "ClassShouldBeListedAsCallableInDynamicInterface", + problemMessageTemplate: + r"""Cannot use class '#name' in a dynamic module.""", + correctionMessageTemplate: + r"""Try removing the reference to class '#name' or update the dynamic interface to list class '#name' as callable.""", + withArguments: + _withArgumentsClassShouldBeListedAsCallableInDynamicInterface, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsClassShouldBeListedAsCallableInDynamicInterface( @@ -1000,17 +987,16 @@ Message _withArgumentsClassShouldBeListedAsCallableInDynamicInterface( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeClassShouldBeListedAsExtendableInDynamicInterface = const Template< - Message Function(String name) ->( - "ClassShouldBeListedAsExtendableInDynamicInterface", - problemMessageTemplate: - r"""Cannot extend, implement or mix-in class '#name' in a dynamic module.""", - correctionMessageTemplate: - r"""Try removing the reference to class '#name' or update the dynamic interface to list class '#name' as extendable.""", - withArguments: - _withArgumentsClassShouldBeListedAsExtendableInDynamicInterface, -); +codeClassShouldBeListedAsExtendableInDynamicInterface = + const Template( + "ClassShouldBeListedAsExtendableInDynamicInterface", + problemMessageTemplate: + r"""Cannot extend, implement or mix-in class '#name' in a dynamic module.""", + correctionMessageTemplate: + r"""Try removing the reference to class '#name' or update the dynamic interface to list class '#name' as extendable.""", + withArguments: + _withArgumentsClassShouldBeListedAsExtendableInDynamicInterface, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsClassShouldBeListedAsExtendableInDynamicInterface( @@ -1038,17 +1024,16 @@ const MessageCode codeColonInPlaceOfIn = const MessageCode( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeCombinedMemberSignatureFailed = const Template< - Message Function(String name, String name2) ->( - "CombinedMemberSignatureFailed", - problemMessageTemplate: - r"""Class '#name' inherits multiple members named '#name2' with incompatible signatures.""", - correctionMessageTemplate: - r"""Try adding a declaration of '#name2' to '#name'.""", - withArguments: _withArgumentsCombinedMemberSignatureFailed, - analyzerCodes: ["INCONSISTENT_INHERITANCE"], -); +codeCombinedMemberSignatureFailed = + const Template( + "CombinedMemberSignatureFailed", + problemMessageTemplate: + r"""Class '#name' inherits multiple members named '#name2' with incompatible signatures.""", + correctionMessageTemplate: + r"""Try adding a declaration of '#name2' to '#name'.""", + withArguments: _withArgumentsCombinedMemberSignatureFailed, + analyzerCodes: ["INCONSISTENT_INHERITANCE"], + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsCombinedMemberSignatureFailed(String name, String name2) { @@ -1248,9 +1233,7 @@ const MessageCode codeConstEvalContext = const MessageCode( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeConstEvalDeferredLibrary = const Template< - Message Function(String nameOKEmpty) ->( +codeConstEvalDeferredLibrary = const Template( "ConstEvalDeferredLibrary", problemMessageTemplate: r"""'#nameOKEmpty' can't be used in a constant expression because it's marked as 'deferred' which means it isn't available until loaded.""", @@ -1377,15 +1360,14 @@ Message _withArgumentsConstEvalGetterNotFound(String nameOKEmpty) { // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeConstEvalInvalidStaticInvocation = const Template< - Message Function(String nameOKEmpty) ->( - "ConstEvalInvalidStaticInvocation", - problemMessageTemplate: - r"""The invocation of '#nameOKEmpty' is not allowed in a constant expression.""", - withArguments: _withArgumentsConstEvalInvalidStaticInvocation, - analyzerCodes: ["CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE"], -); +codeConstEvalInvalidStaticInvocation = + const Template( + "ConstEvalInvalidStaticInvocation", + problemMessageTemplate: + r"""The invocation of '#nameOKEmpty' is not allowed in a constant expression.""", + withArguments: _withArgumentsConstEvalInvalidStaticInvocation, + analyzerCodes: ["CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE"], + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsConstEvalInvalidStaticInvocation(String nameOKEmpty) { @@ -1400,14 +1382,15 @@ Message _withArgumentsConstEvalInvalidStaticInvocation(String nameOKEmpty) { // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeConstEvalNegativeShift = const Template< - Message Function(String string, String string2, String string3) ->( - "ConstEvalNegativeShift", - problemMessageTemplate: - r"""Binary operator '#string' on '#string2' requires non-negative operand, but was '#string3'.""", - withArguments: _withArgumentsConstEvalNegativeShift, -); +codeConstEvalNegativeShift = + const Template< + Message Function(String string, String string2, String string3) + >( + "ConstEvalNegativeShift", + problemMessageTemplate: + r"""Binary operator '#string' on '#string2' requires non-negative operand, but was '#string3'.""", + withArguments: _withArgumentsConstEvalNegativeShift, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsConstEvalNegativeShift( @@ -1428,15 +1411,14 @@ Message _withArgumentsConstEvalNegativeShift( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeConstEvalNonConstantVariableGet = const Template< - Message Function(String nameOKEmpty) ->( - "ConstEvalNonConstantVariableGet", - problemMessageTemplate: - r"""The variable '#nameOKEmpty' is not a constant, only constant expressions are allowed.""", - withArguments: _withArgumentsConstEvalNonConstantVariableGet, - analyzerCodes: ["NON_CONSTANT_VALUE_IN_INITIALIZER"], -); +codeConstEvalNonConstantVariableGet = + const Template( + "ConstEvalNonConstantVariableGet", + problemMessageTemplate: + r"""The variable '#nameOKEmpty' is not a constant, only constant expressions are allowed.""", + withArguments: _withArgumentsConstEvalNonConstantVariableGet, + analyzerCodes: ["NON_CONSTANT_VALUE_IN_INITIALIZER"], + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsConstEvalNonConstantVariableGet(String nameOKEmpty) { @@ -1485,14 +1467,13 @@ const MessageCode codeConstEvalStartingPoint = const MessageCode( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeConstEvalTruncateError = const Template< - Message Function(String string, String string2) ->( - "ConstEvalTruncateError", - problemMessageTemplate: - r"""Binary operator '#string ~/ #string2' results is Infinity or NaN.""", - withArguments: _withArgumentsConstEvalTruncateError, -); +codeConstEvalTruncateError = + const Template( + "ConstEvalTruncateError", + problemMessageTemplate: + r"""Binary operator '#string ~/ #string2' results is Infinity or NaN.""", + withArguments: _withArgumentsConstEvalTruncateError, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsConstEvalTruncateError(String string, String string2) { @@ -1533,15 +1514,14 @@ Message _withArgumentsConstEvalUnhandledCoreException(String stringOKEmpty) { // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeConstEvalZeroDivisor = const Template< - Message Function(String string, String string2) ->( - "ConstEvalZeroDivisor", - problemMessageTemplate: - r"""Binary operator '#string' on '#string2' requires non-zero divisor, but divisor was '0'.""", - withArguments: _withArgumentsConstEvalZeroDivisor, - analyzerCodes: ["CONST_EVAL_THROWS_IDBZE"], -); +codeConstEvalZeroDivisor = + const Template( + "ConstEvalZeroDivisor", + problemMessageTemplate: + r"""Binary operator '#string' on '#string2' requires non-zero divisor, but divisor was '0'.""", + withArguments: _withArgumentsConstEvalZeroDivisor, + analyzerCodes: ["CONST_EVAL_THROWS_IDBZE"], + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsConstEvalZeroDivisor(String string, String string2) { @@ -1726,17 +1706,16 @@ const MessageCode codeConstructorNotSync = const MessageCode( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeConstructorShouldBeListedAsCallableInDynamicInterface = const Template< - Message Function(String name) ->( - "ConstructorShouldBeListedAsCallableInDynamicInterface", - problemMessageTemplate: - r"""Cannot invoke constructor '#name' from a dynamic module.""", - correctionMessageTemplate: - r"""Try removing the call or update the dynamic interface to list constructor '#name' as callable.""", - withArguments: - _withArgumentsConstructorShouldBeListedAsCallableInDynamicInterface, -); +codeConstructorShouldBeListedAsCallableInDynamicInterface = + const Template( + "ConstructorShouldBeListedAsCallableInDynamicInterface", + problemMessageTemplate: + r"""Cannot invoke constructor '#name' from a dynamic module.""", + correctionMessageTemplate: + r"""Try removing the call or update the dynamic interface to list constructor '#name' as callable.""", + withArguments: + _withArgumentsConstructorShouldBeListedAsCallableInDynamicInterface, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsConstructorShouldBeListedAsCallableInDynamicInterface( @@ -1911,17 +1890,16 @@ const MessageCode codeCovariantMember = const MessageCode( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeCycleInTypeParameters = const Template< - Message Function(String name, String string) ->( - "CycleInTypeParameters", - problemMessageTemplate: - r"""Type '#name' is a bound of itself via '#string'.""", - correctionMessageTemplate: - r"""Try breaking the cycle by removing at least one of the 'extends' clauses in the cycle.""", - withArguments: _withArgumentsCycleInTypeParameters, - analyzerCodes: ["TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND"], -); +codeCycleInTypeParameters = + const Template( + "CycleInTypeParameters", + problemMessageTemplate: + r"""Type '#name' is a bound of itself via '#string'.""", + correctionMessageTemplate: + r"""Try breaking the cycle by removing at least one of the 'extends' clauses in the cycle.""", + withArguments: _withArgumentsCycleInTypeParameters, + analyzerCodes: ["TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND"], + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsCycleInTypeParameters(String name, String string) { @@ -2121,16 +2099,17 @@ const MessageCode codeDefaultInSwitchExpression = const MessageCode( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeDefaultValueInRedirectingFactoryConstructor = const Template< - Message Function(String name) ->( - "DefaultValueInRedirectingFactoryConstructor", - problemMessageTemplate: - r"""Can't have a default value here because any default values of '#name' would be used instead.""", - correctionMessageTemplate: r"""Try removing the default value.""", - withArguments: _withArgumentsDefaultValueInRedirectingFactoryConstructor, - analyzerCodes: ["DEFAULT_VALUE_IN_REDIRECTING_FACTORY_CONSTRUCTOR"], -); +codeDefaultValueInRedirectingFactoryConstructor = + const Template( + "DefaultValueInRedirectingFactoryConstructor", + problemMessageTemplate: + r"""Can't have a default value here because any default values of '#name' would be used instead.""", + correctionMessageTemplate: r"""Try removing the default value.""", + withArguments: _withArgumentsDefaultValueInRedirectingFactoryConstructor, + analyzerCodes: [ + "DEFAULT_VALUE_IN_REDIRECTING_FACTORY_CONSTRUCTOR", + ], + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsDefaultValueInRedirectingFactoryConstructor(String name) { @@ -2224,16 +2203,17 @@ Message _withArgumentsDeferredPrefixDuplicatedCause(String name) { const Template< Message Function(int count, int count2, num _num1, num _num2, num _num3) > -codeDillOutlineSummary = const Template< - Message Function(int count, int count2, num _num1, num _num2, num _num3) ->( - "DillOutlineSummary", - problemMessageTemplate: - r"""Indexed #count libraries (#count2 bytes) in #num1%.3ms, that is, +codeDillOutlineSummary = + const Template< + Message Function(int count, int count2, num _num1, num _num2, num _num3) + >( + "DillOutlineSummary", + problemMessageTemplate: + r"""Indexed #count libraries (#count2 bytes) in #num1%.3ms, that is, #num2%12.3 bytes/ms, and #num3%12.3 ms/libraries.""", - withArguments: _withArgumentsDillOutlineSummary, -); + withArguments: _withArgumentsDillOutlineSummary, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsDillOutlineSummary( @@ -2669,15 +2649,15 @@ Message _withArgumentsDuplicatedParameterNameCause(String name) { // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeDuplicatedRecordLiteralFieldName = const Template< - Message Function(String name) ->( - "DuplicatedRecordLiteralFieldName", - problemMessageTemplate: r"""Duplicated record literal field name '#name'.""", - correctionMessageTemplate: - r"""Try renaming or removing one of the named record literal fields.""", - withArguments: _withArgumentsDuplicatedRecordLiteralFieldName, -); +codeDuplicatedRecordLiteralFieldName = + const Template( + "DuplicatedRecordLiteralFieldName", + problemMessageTemplate: + r"""Duplicated record literal field name '#name'.""", + correctionMessageTemplate: + r"""Try renaming or removing one of the named record literal fields.""", + withArguments: _withArgumentsDuplicatedRecordLiteralFieldName, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsDuplicatedRecordLiteralFieldName(String name) { @@ -2870,15 +2850,14 @@ const MessageCode codeEnumFactoryRedirectsToConstructor = const MessageCode( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeEnumImplementerContainsRestrictedInstanceDeclaration = const Template< - Message Function(String name, String name2) ->( - "EnumImplementerContainsRestrictedInstanceDeclaration", - problemMessageTemplate: - r"""'#name' has 'Enum' as a superinterface and can't contain non-static members with name '#name2'.""", - withArguments: - _withArgumentsEnumImplementerContainsRestrictedInstanceDeclaration, -); +codeEnumImplementerContainsRestrictedInstanceDeclaration = + const Template( + "EnumImplementerContainsRestrictedInstanceDeclaration", + problemMessageTemplate: + r"""'#name' has 'Enum' as a superinterface and can't contain non-static members with name '#name2'.""", + withArguments: + _withArgumentsEnumImplementerContainsRestrictedInstanceDeclaration, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsEnumImplementerContainsRestrictedInstanceDeclaration( @@ -2899,14 +2878,13 @@ Message _withArgumentsEnumImplementerContainsRestrictedInstanceDeclaration( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeEnumImplementerContainsValuesDeclaration = const Template< - Message Function(String name) ->( - "EnumImplementerContainsValuesDeclaration", - problemMessageTemplate: - r"""'#name' has 'Enum' as a superinterface and can't contain non-static member with name 'values'.""", - withArguments: _withArgumentsEnumImplementerContainsValuesDeclaration, -); +codeEnumImplementerContainsValuesDeclaration = + const Template( + "EnumImplementerContainsValuesDeclaration", + problemMessageTemplate: + r"""'#name' has 'Enum' as a superinterface and can't contain non-static member with name 'values'.""", + withArguments: _withArgumentsEnumImplementerContainsValuesDeclaration, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsEnumImplementerContainsValuesDeclaration(String name) { @@ -3269,17 +3247,16 @@ Message _withArgumentsExpectedIdentifier(Token token) { // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeExpectedIdentifierButGotKeyword = const Template< - Message Function(Token token) ->( - "ExpectedIdentifierButGotKeyword", - problemMessageTemplate: - r"""'#lexeme' can't be used as an identifier because it's a keyword.""", - correctionMessageTemplate: - r"""Try renaming this to be an identifier that isn't a keyword.""", - withArguments: _withArgumentsExpectedIdentifierButGotKeyword, - index: 113, -); +codeExpectedIdentifierButGotKeyword = + const Template( + "ExpectedIdentifierButGotKeyword", + problemMessageTemplate: + r"""'#lexeme' can't be used as an identifier because it's a keyword.""", + correctionMessageTemplate: + r"""Try renaming this to be an identifier that isn't a keyword.""", + withArguments: _withArgumentsExpectedIdentifierButGotKeyword, + index: 113, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsExpectedIdentifierButGotKeyword(Token token) { @@ -3472,15 +3449,14 @@ Message _withArgumentsExperimentDisabled(String string) { // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeExperimentDisabledInvalidLanguageVersion = const Template< - Message Function(String string, String string2) ->( - "ExperimentDisabledInvalidLanguageVersion", - problemMessageTemplate: - r"""This requires the '#string' language feature, which requires language version of #string2 or higher.""", - withArguments: _withArgumentsExperimentDisabledInvalidLanguageVersion, - analyzerCodes: ["ParserErrorCode.EXPERIMENT_NOT_ENABLED"], -); +codeExperimentDisabledInvalidLanguageVersion = + const Template( + "ExperimentDisabledInvalidLanguageVersion", + problemMessageTemplate: + r"""This requires the '#string' language feature, which requires language version of #string2 or higher.""", + withArguments: _withArgumentsExperimentDisabledInvalidLanguageVersion, + analyzerCodes: ["ParserErrorCode.EXPERIMENT_NOT_ENABLED"], + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsExperimentDisabledInvalidLanguageVersion( @@ -3541,17 +3517,16 @@ Message _withArgumentsExperimentExpiredEnabled(String name) { // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeExperimentNotEnabled = const Template< - Message Function(String string, String string2) ->( - "ExperimentNotEnabled", - problemMessageTemplate: - r"""This requires the '#string' language feature to be enabled.""", - correctionMessageTemplate: - r"""Try updating your pubspec.yaml to set the minimum SDK constraint to #string2 or higher, and running 'pub get'.""", - withArguments: _withArgumentsExperimentNotEnabled, - index: 48, -); +codeExperimentNotEnabled = + const Template( + "ExperimentNotEnabled", + problemMessageTemplate: + r"""This requires the '#string' language feature to be enabled.""", + correctionMessageTemplate: + r"""Try updating your pubspec.yaml to set the minimum SDK constraint to #string2 or higher, and running 'pub get'.""", + withArguments: _withArgumentsExperimentNotEnabled, + index: 48, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsExperimentNotEnabled(String string, String string2) { @@ -3569,9 +3544,7 @@ Message _withArgumentsExperimentNotEnabled(String string, String string2) { // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeExperimentNotEnabledOffByDefault = const Template< - Message Function(String string) ->( +codeExperimentNotEnabledOffByDefault = const Template( "ExperimentNotEnabledOffByDefault", problemMessageTemplate: r"""This requires the experimental '#string' language feature to be enabled.""", @@ -3617,16 +3590,15 @@ Message _withArgumentsExperimentOptOutComment(String string) { // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeExperimentOptOutExplicit = const Template< - Message Function(String string, String string2) ->( - "ExperimentOptOutExplicit", - problemMessageTemplate: - r"""The '#string' language feature is disabled for this library.""", - correctionMessageTemplate: - r"""Try removing the `@dart=` annotation or setting the language version to #string2 or higher.""", - withArguments: _withArgumentsExperimentOptOutExplicit, -); +codeExperimentOptOutExplicit = + const Template( + "ExperimentOptOutExplicit", + problemMessageTemplate: + r"""The '#string' language feature is disabled for this library.""", + correctionMessageTemplate: + r"""Try removing the `@dart=` annotation or setting the language version to #string2 or higher.""", + withArguments: _withArgumentsExperimentOptOutExplicit, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsExperimentOptOutExplicit(String string, String string2) { @@ -3644,16 +3616,15 @@ Message _withArgumentsExperimentOptOutExplicit(String string, String string2) { // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeExperimentOptOutImplicit = const Template< - Message Function(String string, String string2) ->( - "ExperimentOptOutImplicit", - problemMessageTemplate: - r"""The '#string' language feature is disabled for this library.""", - correctionMessageTemplate: - r"""Try removing the package language version or setting the language version to #string2 or higher.""", - withArguments: _withArgumentsExperimentOptOutImplicit, -); +codeExperimentOptOutImplicit = + const Template( + "ExperimentOptOutImplicit", + problemMessageTemplate: + r"""The '#string' language feature is disabled for this library.""", + correctionMessageTemplate: + r"""Try removing the package language version or setting the language version to #string2 or higher.""", + withArguments: _withArgumentsExperimentOptOutImplicit, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsExperimentOptOutImplicit(String string, String string2) { @@ -3692,14 +3663,13 @@ const MessageCode codeExplicitExtensionAsLvalue = const MessageCode( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeExplicitExtensionTypeArgumentMismatch = const Template< - Message Function(String name, int count) ->( - "ExplicitExtensionTypeArgumentMismatch", - problemMessageTemplate: - r"""Explicit extension application of extension '#name' takes '#count' type argument(s).""", - withArguments: _withArgumentsExplicitExtensionTypeArgumentMismatch, -); +codeExplicitExtensionTypeArgumentMismatch = + const Template( + "ExplicitExtensionTypeArgumentMismatch", + problemMessageTemplate: + r"""Explicit extension application of extension '#name' takes '#count' type argument(s).""", + withArguments: _withArgumentsExplicitExtensionTypeArgumentMismatch, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsExplicitExtensionTypeArgumentMismatch( @@ -3734,14 +3704,13 @@ const MessageCode codeExportedMain = const MessageCode( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeExpressionEvaluationKnownVariableUnavailable = const Template< - Message Function(String name) ->( - "ExpressionEvaluationKnownVariableUnavailable", - problemMessageTemplate: - r"""The variable '#name' is unavailable in this expression evaluation.""", - withArguments: _withArgumentsExpressionEvaluationKnownVariableUnavailable, -); +codeExpressionEvaluationKnownVariableUnavailable = + const Template( + "ExpressionEvaluationKnownVariableUnavailable", + problemMessageTemplate: + r"""The variable '#name' is unavailable in this expression evaluation.""", + withArguments: _withArgumentsExpressionEvaluationKnownVariableUnavailable, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsExpressionEvaluationKnownVariableUnavailable( @@ -3880,17 +3849,16 @@ Message _withArgumentsExtensionMemberConflictsWithObjectMember(String name) { // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeExtensionTypeCombinedMemberSignatureFailed = const Template< - Message Function(String name, String name2) ->( - "ExtensionTypeCombinedMemberSignatureFailed", - problemMessageTemplate: - r"""Extension type '#name' inherits multiple members named '#name2' with incompatible signatures.""", - correctionMessageTemplate: - r"""Try adding a declaration of '#name2' to '#name'.""", - withArguments: _withArgumentsExtensionTypeCombinedMemberSignatureFailed, - analyzerCodes: ["INCONSISTENT_INHERITANCE"], -); +codeExtensionTypeCombinedMemberSignatureFailed = + const Template( + "ExtensionTypeCombinedMemberSignatureFailed", + problemMessageTemplate: + r"""Extension type '#name' inherits multiple members named '#name2' with incompatible signatures.""", + correctionMessageTemplate: + r"""Try adding a declaration of '#name2' to '#name'.""", + withArguments: _withArgumentsExtensionTypeCombinedMemberSignatureFailed, + analyzerCodes: ["INCONSISTENT_INHERITANCE"], + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsExtensionTypeCombinedMemberSignatureFailed( @@ -4007,17 +3975,16 @@ const MessageCode codeExtensionTypeRepresentationTypeBottom = const MessageCode( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeExtensionTypeShouldBeListedAsCallableInDynamicInterface = const Template< - Message Function(String name) ->( - "ExtensionTypeShouldBeListedAsCallableInDynamicInterface", - problemMessageTemplate: - r"""Cannot use extension type '#name' in a dynamic module.""", - correctionMessageTemplate: - r"""Try removing the reference to extension type '#name' or update the dynamic interface to list extension type '#name' as callable.""", - withArguments: - _withArgumentsExtensionTypeShouldBeListedAsCallableInDynamicInterface, -); +codeExtensionTypeShouldBeListedAsCallableInDynamicInterface = + const Template( + "ExtensionTypeShouldBeListedAsCallableInDynamicInterface", + problemMessageTemplate: + r"""Cannot use extension type '#name' in a dynamic module.""", + correctionMessageTemplate: + r"""Try removing the reference to extension type '#name' or update the dynamic interface to list extension type '#name' as callable.""", + withArguments: + _withArgumentsExtensionTypeShouldBeListedAsCallableInDynamicInterface, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsExtensionTypeShouldBeListedAsCallableInDynamicInterface( @@ -4531,9 +4498,7 @@ const MessageCode codeFfiDefaultAssetDuplicate = const MessageCode( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeFfiEmptyStruct = const Template< - Message Function(String string, String name) ->( +codeFfiEmptyStruct = const Template( "FfiEmptyStruct", problemMessageTemplate: r"""#string '#name' is empty. Empty structs and unions are undefined behavior.""", @@ -4630,14 +4595,16 @@ Message _withArgumentsFfiFieldAnnotation(String name) { const Template< Message Function(String string, String name, List _names) > -codeFfiFieldCyclic = const Template< - Message Function(String string, String name, List _names) ->( - "FfiFieldCyclic", - problemMessageTemplate: r"""#string '#name' contains itself. Cycle elements: +codeFfiFieldCyclic = + const Template< + Message Function(String string, String name, List _names) + >( + "FfiFieldCyclic", + problemMessageTemplate: + r"""#string '#name' contains itself. Cycle elements: #names""", - withArguments: _withArgumentsFfiFieldCyclic, -); + withArguments: _withArgumentsFfiFieldCyclic, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsFfiFieldCyclic( @@ -4792,14 +4759,13 @@ codeFfiNativeOnlyNativeFieldWrapperClassCanBePointer = const MessageCode( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeFfiNativeUnexpectedNumberOfParameters = const Template< - Message Function(int count, int count2) ->( - "FfiNativeUnexpectedNumberOfParameters", - problemMessageTemplate: - r"""Unexpected number of Native annotation parameters. Expected #count but has #count2.""", - withArguments: _withArgumentsFfiNativeUnexpectedNumberOfParameters, -); +codeFfiNativeUnexpectedNumberOfParameters = + const Template( + "FfiNativeUnexpectedNumberOfParameters", + problemMessageTemplate: + r"""Unexpected number of Native annotation parameters. Expected #count but has #count2.""", + withArguments: _withArgumentsFfiNativeUnexpectedNumberOfParameters, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsFfiNativeUnexpectedNumberOfParameters( @@ -4816,15 +4782,14 @@ Message _withArgumentsFfiNativeUnexpectedNumberOfParameters( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeFfiNativeUnexpectedNumberOfParametersWithReceiver = const Template< - Message Function(int count, int count2) ->( - "FfiNativeUnexpectedNumberOfParametersWithReceiver", - problemMessageTemplate: - r"""Unexpected number of Native annotation parameters. Expected #count but has #count2. Native instance method annotation must have receiver as first argument.""", - withArguments: - _withArgumentsFfiNativeUnexpectedNumberOfParametersWithReceiver, -); +codeFfiNativeUnexpectedNumberOfParametersWithReceiver = + const Template( + "FfiNativeUnexpectedNumberOfParametersWithReceiver", + problemMessageTemplate: + r"""Unexpected number of Native annotation parameters. Expected #count but has #count2. Native instance method annotation must have receiver as first argument.""", + withArguments: + _withArgumentsFfiNativeUnexpectedNumberOfParametersWithReceiver, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsFfiNativeUnexpectedNumberOfParametersWithReceiver( @@ -4961,15 +4926,16 @@ const MessageCode codeFfiVariableLengthArrayNotLast = const MessageCode( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeFieldAlreadyInitializedAtDeclaration = const Template< - Message Function(String name) ->( - "FieldAlreadyInitializedAtDeclaration", - problemMessageTemplate: - r"""'#name' is a final instance variable that was initialized at the declaration.""", - withArguments: _withArgumentsFieldAlreadyInitializedAtDeclaration, - analyzerCodes: ["FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION"], -); +codeFieldAlreadyInitializedAtDeclaration = + const Template( + "FieldAlreadyInitializedAtDeclaration", + problemMessageTemplate: + r"""'#name' is a final instance variable that was initialized at the declaration.""", + withArguments: _withArgumentsFieldAlreadyInitializedAtDeclaration, + analyzerCodes: [ + "FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION", + ], + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsFieldAlreadyInitializedAtDeclaration(String name) { @@ -5024,15 +4990,14 @@ const MessageCode codeFieldInitializerOutsideConstructor = const MessageCode( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeFieldNotPromotedBecauseConflictingField = const Template< - Message Function(String name, String name2, String string) ->( - "FieldNotPromotedBecauseConflictingField", - problemMessageTemplate: - r"""'#name' couldn't be promoted because there is a conflicting non-promotable field in class '#name2'.""", - correctionMessageTemplate: r"""See #string""", - withArguments: _withArgumentsFieldNotPromotedBecauseConflictingField, -); +codeFieldNotPromotedBecauseConflictingField = + const Template( + "FieldNotPromotedBecauseConflictingField", + problemMessageTemplate: + r"""'#name' couldn't be promoted because there is a conflicting non-promotable field in class '#name2'.""", + correctionMessageTemplate: r"""See #string""", + withArguments: _withArgumentsFieldNotPromotedBecauseConflictingField, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsFieldNotPromotedBecauseConflictingField( @@ -5056,15 +5021,14 @@ Message _withArgumentsFieldNotPromotedBecauseConflictingField( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeFieldNotPromotedBecauseConflictingGetter = const Template< - Message Function(String name, String name2, String string) ->( - "FieldNotPromotedBecauseConflictingGetter", - problemMessageTemplate: - r"""'#name' couldn't be promoted because there is a conflicting getter in class '#name2'.""", - correctionMessageTemplate: r"""See #string""", - withArguments: _withArgumentsFieldNotPromotedBecauseConflictingGetter, -); +codeFieldNotPromotedBecauseConflictingGetter = + const Template( + "FieldNotPromotedBecauseConflictingGetter", + problemMessageTemplate: + r"""'#name' couldn't be promoted because there is a conflicting getter in class '#name2'.""", + correctionMessageTemplate: r"""See #string""", + withArguments: _withArgumentsFieldNotPromotedBecauseConflictingGetter, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsFieldNotPromotedBecauseConflictingGetter( @@ -5088,15 +5052,15 @@ Message _withArgumentsFieldNotPromotedBecauseConflictingGetter( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeFieldNotPromotedBecauseConflictingNsmForwarder = const Template< - Message Function(String name, String name2, String string) ->( - "FieldNotPromotedBecauseConflictingNsmForwarder", - problemMessageTemplate: - r"""'#name' couldn't be promoted because there is a conflicting noSuchMethod forwarder in class '#name2'.""", - correctionMessageTemplate: r"""See #string""", - withArguments: _withArgumentsFieldNotPromotedBecauseConflictingNsmForwarder, -); +codeFieldNotPromotedBecauseConflictingNsmForwarder = + const Template( + "FieldNotPromotedBecauseConflictingNsmForwarder", + problemMessageTemplate: + r"""'#name' couldn't be promoted because there is a conflicting noSuchMethod forwarder in class '#name2'.""", + correctionMessageTemplate: r"""See #string""", + withArguments: + _withArgumentsFieldNotPromotedBecauseConflictingNsmForwarder, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsFieldNotPromotedBecauseConflictingNsmForwarder( @@ -5120,15 +5084,14 @@ Message _withArgumentsFieldNotPromotedBecauseConflictingNsmForwarder( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeFieldNotPromotedBecauseExternal = const Template< - Message Function(String name, String string) ->( - "FieldNotPromotedBecauseExternal", - problemMessageTemplate: - r"""'#name' refers to an external field so it couldn't be promoted.""", - correctionMessageTemplate: r"""See #string""", - withArguments: _withArgumentsFieldNotPromotedBecauseExternal, -); +codeFieldNotPromotedBecauseExternal = + const Template( + "FieldNotPromotedBecauseExternal", + problemMessageTemplate: + r"""'#name' refers to an external field so it couldn't be promoted.""", + correctionMessageTemplate: r"""See #string""", + withArguments: _withArgumentsFieldNotPromotedBecauseExternal, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsFieldNotPromotedBecauseExternal( @@ -5149,15 +5112,14 @@ Message _withArgumentsFieldNotPromotedBecauseExternal( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeFieldNotPromotedBecauseNotEnabled = const Template< - Message Function(String name, String string) ->( - "FieldNotPromotedBecauseNotEnabled", - problemMessageTemplate: - r"""'#name' couldn't be promoted because field promotion is only available in Dart 3.2 and above.""", - correctionMessageTemplate: r"""See #string""", - withArguments: _withArgumentsFieldNotPromotedBecauseNotEnabled, -); +codeFieldNotPromotedBecauseNotEnabled = + const Template( + "FieldNotPromotedBecauseNotEnabled", + problemMessageTemplate: + r"""'#name' couldn't be promoted because field promotion is only available in Dart 3.2 and above.""", + correctionMessageTemplate: r"""See #string""", + withArguments: _withArgumentsFieldNotPromotedBecauseNotEnabled, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsFieldNotPromotedBecauseNotEnabled( @@ -5206,15 +5168,14 @@ Message _withArgumentsFieldNotPromotedBecauseNotField( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeFieldNotPromotedBecauseNotFinal = const Template< - Message Function(String name, String string) ->( - "FieldNotPromotedBecauseNotFinal", - problemMessageTemplate: - r"""'#name' refers to a non-final field so it couldn't be promoted.""", - correctionMessageTemplate: r"""See #string""", - withArguments: _withArgumentsFieldNotPromotedBecauseNotFinal, -); +codeFieldNotPromotedBecauseNotFinal = + const Template( + "FieldNotPromotedBecauseNotFinal", + problemMessageTemplate: + r"""'#name' refers to a non-final field so it couldn't be promoted.""", + correctionMessageTemplate: r"""See #string""", + withArguments: _withArgumentsFieldNotPromotedBecauseNotFinal, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsFieldNotPromotedBecauseNotFinal( @@ -5235,15 +5196,14 @@ Message _withArgumentsFieldNotPromotedBecauseNotFinal( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeFieldNotPromotedBecauseNotPrivate = const Template< - Message Function(String name, String string) ->( - "FieldNotPromotedBecauseNotPrivate", - problemMessageTemplate: - r"""'#name' refers to a public property so it couldn't be promoted.""", - correctionMessageTemplate: r"""See #string""", - withArguments: _withArgumentsFieldNotPromotedBecauseNotPrivate, -); +codeFieldNotPromotedBecauseNotPrivate = + const Template( + "FieldNotPromotedBecauseNotPrivate", + problemMessageTemplate: + r"""'#name' refers to a public property so it couldn't be promoted.""", + correctionMessageTemplate: r"""See #string""", + withArguments: _withArgumentsFieldNotPromotedBecauseNotPrivate, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsFieldNotPromotedBecauseNotPrivate( @@ -5293,15 +5253,14 @@ const MessageCode codeFinalAndVar = const MessageCode( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeFinalClassExtendedOutsideOfLibrary = const Template< - Message Function(String name) ->( - "FinalClassExtendedOutsideOfLibrary", - problemMessageTemplate: - r"""The class '#name' can't be extended outside of its library because it's a final class.""", - withArguments: _withArgumentsFinalClassExtendedOutsideOfLibrary, - analyzerCodes: ["FINAL_CLASS_EXTENDED_OUTSIDE_OF_LIBRARY"], -); +codeFinalClassExtendedOutsideOfLibrary = + const Template( + "FinalClassExtendedOutsideOfLibrary", + problemMessageTemplate: + r"""The class '#name' can't be extended outside of its library because it's a final class.""", + withArguments: _withArgumentsFinalClassExtendedOutsideOfLibrary, + analyzerCodes: ["FINAL_CLASS_EXTENDED_OUTSIDE_OF_LIBRARY"], + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsFinalClassExtendedOutsideOfLibrary(String name) { @@ -5317,15 +5276,14 @@ Message _withArgumentsFinalClassExtendedOutsideOfLibrary(String name) { // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeFinalClassImplementedOutsideOfLibrary = const Template< - Message Function(String name) ->( - "FinalClassImplementedOutsideOfLibrary", - problemMessageTemplate: - r"""The class '#name' can't be implemented outside of its library because it's a final class.""", - withArguments: _withArgumentsFinalClassImplementedOutsideOfLibrary, - analyzerCodes: ["FINAL_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY"], -); +codeFinalClassImplementedOutsideOfLibrary = + const Template( + "FinalClassImplementedOutsideOfLibrary", + problemMessageTemplate: + r"""The class '#name' can't be implemented outside of its library because it's a final class.""", + withArguments: _withArgumentsFinalClassImplementedOutsideOfLibrary, + analyzerCodes: ["FINAL_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY"], + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsFinalClassImplementedOutsideOfLibrary(String name) { @@ -5341,17 +5299,17 @@ Message _withArgumentsFinalClassImplementedOutsideOfLibrary(String name) { // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeFinalClassUsedAsMixinConstraintOutsideOfLibrary = const Template< - Message Function(String name) ->( - "FinalClassUsedAsMixinConstraintOutsideOfLibrary", - problemMessageTemplate: - r"""The class '#name' can't be used as a mixin superclass constraint outside of its library because it's a final class.""", - withArguments: _withArgumentsFinalClassUsedAsMixinConstraintOutsideOfLibrary, - analyzerCodes: [ - "FINAL_CLASS_USED_AS_MIXIN_CONSTRAINT_OUTSIDE_OF_LIBRARY", - ], -); +codeFinalClassUsedAsMixinConstraintOutsideOfLibrary = + const Template( + "FinalClassUsedAsMixinConstraintOutsideOfLibrary", + problemMessageTemplate: + r"""The class '#name' can't be used as a mixin superclass constraint outside of its library because it's a final class.""", + withArguments: + _withArgumentsFinalClassUsedAsMixinConstraintOutsideOfLibrary, + analyzerCodes: [ + "FINAL_CLASS_USED_AS_MIXIN_CONSTRAINT_OUTSIDE_OF_LIBRARY", + ], + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsFinalClassUsedAsMixinConstraintOutsideOfLibrary( @@ -5401,17 +5359,16 @@ Message _withArgumentsFinalFieldNotInitialized(String name) { // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeFinalFieldNotInitializedByConstructor = const Template< - Message Function(String name) ->( - "FinalFieldNotInitializedByConstructor", - problemMessageTemplate: - r"""Final field '#name' is not initialized by this constructor.""", - correctionMessageTemplate: - r"""Try to initialize the field using an initializing formal or a field initializer.""", - withArguments: _withArgumentsFinalFieldNotInitializedByConstructor, - analyzerCodes: ["FINAL_NOT_INITIALIZED_CONSTRUCTOR_1"], -); +codeFinalFieldNotInitializedByConstructor = + const Template( + "FinalFieldNotInitializedByConstructor", + problemMessageTemplate: + r"""Final field '#name' is not initialized by this constructor.""", + correctionMessageTemplate: + r"""Try to initialize the field using an initializing formal or a field initializer.""", + withArguments: _withArgumentsFinalFieldNotInitializedByConstructor, + analyzerCodes: ["FINAL_NOT_INITIALIZED_CONSTRUCTOR_1"], + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsFinalFieldNotInitializedByConstructor(String name) { @@ -5707,16 +5664,15 @@ Message _withArgumentsIllegalMixinDueToConstructorsCause(String name) { // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeIllegalPatternAssignmentVariableName = const Template< - Message Function(Token token) ->( - "IllegalPatternAssignmentVariableName", - problemMessageTemplate: - r"""A variable assigned by a pattern assignment can't be named '#lexeme'.""", - correctionMessageTemplate: r"""Choose a different name.""", - withArguments: _withArgumentsIllegalPatternAssignmentVariableName, - index: 160, -); +codeIllegalPatternAssignmentVariableName = + const Template( + "IllegalPatternAssignmentVariableName", + problemMessageTemplate: + r"""A variable assigned by a pattern assignment can't be named '#lexeme'.""", + correctionMessageTemplate: r"""Choose a different name.""", + withArguments: _withArgumentsIllegalPatternAssignmentVariableName, + index: 160, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsIllegalPatternAssignmentVariableName(Token token) { @@ -5793,16 +5749,15 @@ const MessageCode codeIllegalSyncGeneratorVoidReturnType = const MessageCode( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeImplementMultipleExtensionTypeMembers = const Template< - Message Function(String name, String name2) ->( - "ImplementMultipleExtensionTypeMembers", - problemMessageTemplate: - r"""The extension type '#name' can't inherit the member '#name2' from more than one extension type.""", - correctionMessageTemplate: - r"""Try declaring a member '#name2' in '#name' to resolve the conflict.""", - withArguments: _withArgumentsImplementMultipleExtensionTypeMembers, -); +codeImplementMultipleExtensionTypeMembers = + const Template( + "ImplementMultipleExtensionTypeMembers", + problemMessageTemplate: + r"""The extension type '#name' can't inherit the member '#name2' from more than one extension type.""", + correctionMessageTemplate: + r"""Try declaring a member '#name2' in '#name' to resolve the conflict.""", + withArguments: _withArgumentsImplementMultipleExtensionTypeMembers, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsImplementMultipleExtensionTypeMembers( @@ -5825,16 +5780,16 @@ Message _withArgumentsImplementMultipleExtensionTypeMembers( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeImplementNonExtensionTypeAndExtensionTypeMember = const Template< - Message Function(String name, String name2) ->( - "ImplementNonExtensionTypeAndExtensionTypeMember", - problemMessageTemplate: - r"""The extension type '#name' can't inherit the member '#name2' as both an extension type member and a non-extension type member.""", - correctionMessageTemplate: - r"""Try declaring a member '#name2' in '#name' to resolve the conflict.""", - withArguments: _withArgumentsImplementNonExtensionTypeAndExtensionTypeMember, -); +codeImplementNonExtensionTypeAndExtensionTypeMember = + const Template( + "ImplementNonExtensionTypeAndExtensionTypeMember", + problemMessageTemplate: + r"""The extension type '#name' can't inherit the member '#name2' as both an extension type member and a non-extension type member.""", + correctionMessageTemplate: + r"""Try declaring a member '#name2' in '#name' to resolve the conflict.""", + withArguments: + _withArgumentsImplementNonExtensionTypeAndExtensionTypeMember, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsImplementNonExtensionTypeAndExtensionTypeMember( @@ -5946,14 +5901,13 @@ Message _withArgumentsImplementsSuperClass(String name) { // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeImplicitMixinOverride = const Template< - Message Function(String name, String name2, String name3) ->( - "ImplicitMixinOverride", - problemMessageTemplate: - r"""Applying the mixin '#name' to '#name2' introduces an erroneous override of '#name3'.""", - withArguments: _withArgumentsImplicitMixinOverride, -); +codeImplicitMixinOverride = + const Template( + "ImplicitMixinOverride", + problemMessageTemplate: + r"""Applying the mixin '#name' to '#name2' introduces an erroneous override of '#name3'.""", + withArguments: _withArgumentsImplicitMixinOverride, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsImplicitMixinOverride( @@ -5987,17 +5941,16 @@ const MessageCode codeImplicitSuperCallOfNonMethod = const MessageCode( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeImplicitSuperInitializerMissingArguments = const Template< - Message Function(String name) ->( - "ImplicitSuperInitializerMissingArguments", - problemMessageTemplate: - r"""The implicitly called unnamed constructor from '#name' has required parameters.""", - correctionMessageTemplate: - r"""Try adding an explicit super initializer with the required arguments.""", - withArguments: _withArgumentsImplicitSuperInitializerMissingArguments, - analyzerCodes: ["IMPLICIT_SUPER_INITIALIZER_MISSING_ARGUMENTS"], -); +codeImplicitSuperInitializerMissingArguments = + const Template( + "ImplicitSuperInitializerMissingArguments", + problemMessageTemplate: + r"""The implicitly called unnamed constructor from '#name' has required parameters.""", + correctionMessageTemplate: + r"""Try adding an explicit super initializer with the required arguments.""", + withArguments: _withArgumentsImplicitSuperInitializerMissingArguments, + analyzerCodes: ["IMPLICIT_SUPER_INITIALIZER_MISSING_ARGUMENTS"], + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsImplicitSuperInitializerMissingArguments(String name) { @@ -6097,14 +6050,13 @@ const MessageCode codeIncorrectTypeArgumentVariable = const MessageCode( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeIncrementalCompilerIllegalParameter = const Template< - Message Function(String string) ->( - "IncrementalCompilerIllegalParameter", - problemMessageTemplate: - r"""Illegal parameter name '#string' found during expression compilation.""", - withArguments: _withArgumentsIncrementalCompilerIllegalParameter, -); +codeIncrementalCompilerIllegalParameter = + const Template( + "IncrementalCompilerIllegalParameter", + problemMessageTemplate: + r"""Illegal parameter name '#string' found during expression compilation.""", + withArguments: _withArgumentsIncrementalCompilerIllegalParameter, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsIncrementalCompilerIllegalParameter(String string) { @@ -6119,14 +6071,13 @@ Message _withArgumentsIncrementalCompilerIllegalParameter(String string) { // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeIncrementalCompilerIllegalTypeParameter = const Template< - Message Function(String string) ->( - "IncrementalCompilerIllegalTypeParameter", - problemMessageTemplate: - r"""Illegal type parameter name '#string' found during expression compilation.""", - withArguments: _withArgumentsIncrementalCompilerIllegalTypeParameter, -); +codeIncrementalCompilerIllegalTypeParameter = + const Template( + "IncrementalCompilerIllegalTypeParameter", + problemMessageTemplate: + r"""Illegal type parameter name '#string' found during expression compilation.""", + withArguments: _withArgumentsIncrementalCompilerIllegalTypeParameter, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsIncrementalCompilerIllegalTypeParameter(String string) { @@ -6162,15 +6113,14 @@ const MessageCode codeInheritedMembersConflictCause2 = const MessageCode( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeInheritedRestrictedMemberOfEnumImplementer = const Template< - Message Function(String name, String name2) ->( - "InheritedRestrictedMemberOfEnumImplementer", - problemMessageTemplate: - r"""A concrete instance member named '#name' can't be inherited from '#name2' in a class that implements 'Enum'.""", - withArguments: _withArgumentsInheritedRestrictedMemberOfEnumImplementer, - analyzerCodes: ["ILLEGAL_CONCRETE_ENUM_MEMBER"], -); +codeInheritedRestrictedMemberOfEnumImplementer = + const Template( + "InheritedRestrictedMemberOfEnumImplementer", + problemMessageTemplate: + r"""A concrete instance member named '#name' can't be inherited from '#name2' in a class that implements 'Enum'.""", + withArguments: _withArgumentsInheritedRestrictedMemberOfEnumImplementer, + analyzerCodes: ["ILLEGAL_CONCRETE_ENUM_MEMBER"], + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsInheritedRestrictedMemberOfEnumImplementer( @@ -6191,19 +6141,18 @@ Message _withArgumentsInheritedRestrictedMemberOfEnumImplementer( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeInitializeFromDillNotSelfContained = const Template< - Message Function(String string, Uri uri_) ->( - "InitializeFromDillNotSelfContained", - problemMessageTemplate: - r"""Tried to initialize from a previous compilation (#string), but the file was not self-contained. This might be a bug. +codeInitializeFromDillNotSelfContained = + const Template( + "InitializeFromDillNotSelfContained", + problemMessageTemplate: + r"""Tried to initialize from a previous compilation (#string), but the file was not self-contained. This might be a bug. The Dart team would greatly appreciate it if you would take a moment to report this problem at http://dartbug.com/new. If you are comfortable with it, it would improve the chances of fixing any bug if you included the file #uri in your error report, but be aware that this file includes your source code. Either way, you should probably delete the file so it doesn't use unnecessary disk space.""", - withArguments: _withArgumentsInitializeFromDillNotSelfContained, - severity: CfeSeverity.warning, -); + withArguments: _withArgumentsInitializeFromDillNotSelfContained, + severity: CfeSeverity.warning, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsInitializeFromDillNotSelfContained( @@ -6226,17 +6175,16 @@ Either way, you should probably delete the file so it doesn't use unnecessary di // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeInitializeFromDillNotSelfContainedNoDump = const Template< - Message Function(String string) ->( - "InitializeFromDillNotSelfContainedNoDump", - problemMessageTemplate: - r"""Tried to initialize from a previous compilation (#string), but the file was not self-contained. This might be a bug. +codeInitializeFromDillNotSelfContainedNoDump = + const Template( + "InitializeFromDillNotSelfContainedNoDump", + problemMessageTemplate: + r"""Tried to initialize from a previous compilation (#string), but the file was not self-contained. This might be a bug. The Dart team would greatly appreciate it if you would take a moment to report this problem at http://dartbug.com/new.""", - withArguments: _withArgumentsInitializeFromDillNotSelfContainedNoDump, - severity: CfeSeverity.warning, -); + withArguments: _withArgumentsInitializeFromDillNotSelfContainedNoDump, + severity: CfeSeverity.warning, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsInitializeFromDillNotSelfContainedNoDump(String string) { @@ -6255,12 +6203,13 @@ The Dart team would greatly appreciate it if you would take a moment to report t const Template< Message Function(String string, String string2, String string3, Uri uri_) > -codeInitializeFromDillUnknownProblem = const Template< - Message Function(String string, String string2, String string3, Uri uri_) ->( - "InitializeFromDillUnknownProblem", - problemMessageTemplate: - r"""Tried to initialize from a previous compilation (#string), but couldn't. +codeInitializeFromDillUnknownProblem = + const Template< + Message Function(String string, String string2, String string3, Uri uri_) + >( + "InitializeFromDillUnknownProblem", + problemMessageTemplate: + r"""Tried to initialize from a previous compilation (#string), but couldn't. Error message was '#string2'. Stacktrace included '#string3'. This might be a bug. @@ -6268,9 +6217,9 @@ This might be a bug. The Dart team would greatly appreciate it if you would take a moment to report this problem at http://dartbug.com/new. If you are comfortable with it, it would improve the chances of fixing any bug if you included the file #uri in your error report, but be aware that this file includes your source code. Either way, you should probably delete the file so it doesn't use unnecessary disk space.""", - withArguments: _withArgumentsInitializeFromDillUnknownProblem, - severity: CfeSeverity.warning, -); + withArguments: _withArgumentsInitializeFromDillUnknownProblem, + severity: CfeSeverity.warning, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsInitializeFromDillUnknownProblem( @@ -6305,20 +6254,21 @@ Either way, you should probably delete the file so it doesn't use unnecessary di // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeInitializeFromDillUnknownProblemNoDump = const Template< - Message Function(String string, String string2, String string3) ->( - "InitializeFromDillUnknownProblemNoDump", - problemMessageTemplate: - r"""Tried to initialize from a previous compilation (#string), but couldn't. +codeInitializeFromDillUnknownProblemNoDump = + const Template< + Message Function(String string, String string2, String string3) + >( + "InitializeFromDillUnknownProblemNoDump", + problemMessageTemplate: + r"""Tried to initialize from a previous compilation (#string), but couldn't. Error message was '#string2'. Stacktrace included '#string3'. This might be a bug. The Dart team would greatly appreciate it if you would take a moment to report this problem at http://dartbug.com/new.""", - withArguments: _withArgumentsInitializeFromDillUnknownProblemNoDump, - severity: CfeSeverity.warning, -); + withArguments: _withArgumentsInitializeFromDillUnknownProblemNoDump, + severity: CfeSeverity.warning, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsInitializeFromDillUnknownProblemNoDump( @@ -6400,15 +6350,14 @@ Message _withArgumentsInputFileNotFound(Uri uri_) { // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeInstanceAndSynthesizedStaticConflict = const Template< - Message Function(String name) ->( - "InstanceAndSynthesizedStaticConflict", - problemMessageTemplate: - r"""This instance member conflicts with the synthesized static member called '#name'.""", - withArguments: _withArgumentsInstanceAndSynthesizedStaticConflict, - analyzerCodes: ["CONFLICTING_STATIC_AND_INSTANCE"], -); +codeInstanceAndSynthesizedStaticConflict = + const Template( + "InstanceAndSynthesizedStaticConflict", + problemMessageTemplate: + r"""This instance member conflicts with the synthesized static member called '#name'.""", + withArguments: _withArgumentsInstanceAndSynthesizedStaticConflict, + analyzerCodes: ["CONFLICTING_STATIC_AND_INSTANCE"], + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsInstanceAndSynthesizedStaticConflict(String name) { @@ -6511,9 +6460,7 @@ Message _withArgumentsInstantiationTooManyArguments(int count, int count2) { // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeIntegerLiteralIsOutOfRange = const Template< - Message Function(String string) ->( +codeIntegerLiteralIsOutOfRange = const Template( "IntegerLiteralIsOutOfRange", problemMessageTemplate: r"""The integer literal #string can't be represented in 64 bits.""", @@ -6538,9 +6485,7 @@ Message _withArgumentsIntegerLiteralIsOutOfRange(String string) { // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeInterfaceCheck = const Template< - Message Function(String name, String name2) ->( +codeInterfaceCheck = const Template( "InterfaceCheck", problemMessageTemplate: r"""The implementation of '#name' in the non-abstract class '#name2' does not conform to its interface.""", @@ -6563,15 +6508,14 @@ Message _withArgumentsInterfaceCheck(String name, String name2) { // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeInterfaceClassExtendedOutsideOfLibrary = const Template< - Message Function(String name) ->( - "InterfaceClassExtendedOutsideOfLibrary", - problemMessageTemplate: - r"""The class '#name' can't be extended outside of its library because it's an interface class.""", - withArguments: _withArgumentsInterfaceClassExtendedOutsideOfLibrary, - analyzerCodes: ["INTERFACE_CLASS_EXTENDED_OUTSIDE_OF_LIBRARY"], -); +codeInterfaceClassExtendedOutsideOfLibrary = + const Template( + "InterfaceClassExtendedOutsideOfLibrary", + problemMessageTemplate: + r"""The class '#name' can't be extended outside of its library because it's an interface class.""", + withArguments: _withArgumentsInterfaceClassExtendedOutsideOfLibrary, + analyzerCodes: ["INTERFACE_CLASS_EXTENDED_OUTSIDE_OF_LIBRARY"], + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsInterfaceClassExtendedOutsideOfLibrary(String name) { @@ -7009,9 +6953,7 @@ const MessageCode codeInvalidCodePoint = const MessageCode( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeInvalidConstantPatternBinary = const Template< - Message Function(String name) ->( +codeInvalidConstantPatternBinary = const Template( "InvalidConstantPatternBinary", problemMessageTemplate: r"""The binary operator #name is not supported as a constant pattern.""", @@ -7303,14 +7245,13 @@ const MessageCode codeInvalidThisInInitializer = const MessageCode( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeInvalidTypeParameterInSupertype = const Template< - Message Function(String name, String string2, String name2) ->( - "InvalidTypeParameterInSupertype", - problemMessageTemplate: - r"""Can't use implicitly 'out' variable '#name' in an '#string2' position in supertype '#name2'.""", - withArguments: _withArgumentsInvalidTypeParameterInSupertype, -); +codeInvalidTypeParameterInSupertype = + const Template( + "InvalidTypeParameterInSupertype", + problemMessageTemplate: + r"""Can't use implicitly 'out' variable '#name' in an '#string2' position in supertype '#name2'.""", + withArguments: _withArgumentsInvalidTypeParameterInSupertype, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsInvalidTypeParameterInSupertype( @@ -7335,14 +7276,15 @@ Message _withArgumentsInvalidTypeParameterInSupertype( const Template< Message Function(String string, String name, String string2, String name2) > -codeInvalidTypeParameterInSupertypeWithVariance = const Template< - Message Function(String string, String name, String string2, String name2) ->( - "InvalidTypeParameterInSupertypeWithVariance", - problemMessageTemplate: - r"""Can't use '#string' type variable '#name' in an '#string2' position in supertype '#name2'.""", - withArguments: _withArgumentsInvalidTypeParameterInSupertypeWithVariance, -); +codeInvalidTypeParameterInSupertypeWithVariance = + const Template< + Message Function(String string, String name, String string2, String name2) + >( + "InvalidTypeParameterInSupertypeWithVariance", + problemMessageTemplate: + r"""Can't use '#string' type variable '#name' in an '#string2' position in supertype '#name2'.""", + withArguments: _withArgumentsInvalidTypeParameterInSupertypeWithVariance, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsInvalidTypeParameterInSupertypeWithVariance( @@ -7372,14 +7314,15 @@ Message _withArgumentsInvalidTypeParameterInSupertypeWithVariance( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeInvalidTypeParameterVariancePosition = const Template< - Message Function(String string, String name, String string2) ->( - "InvalidTypeParameterVariancePosition", - problemMessageTemplate: - r"""Can't use '#string' type variable '#name' in an '#string2' position.""", - withArguments: _withArgumentsInvalidTypeParameterVariancePosition, -); +codeInvalidTypeParameterVariancePosition = + const Template< + Message Function(String string, String name, String string2) + >( + "InvalidTypeParameterVariancePosition", + problemMessageTemplate: + r"""Can't use '#string' type variable '#name' in an '#string2' position.""", + withArguments: _withArgumentsInvalidTypeParameterVariancePosition, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsInvalidTypeParameterVariancePosition( @@ -7401,14 +7344,16 @@ Message _withArgumentsInvalidTypeParameterVariancePosition( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeInvalidTypeParameterVariancePositionInReturnType = const Template< - Message Function(String string, String name, String string2) ->( - "InvalidTypeParameterVariancePositionInReturnType", - problemMessageTemplate: - r"""Can't use '#string' type variable '#name' in an '#string2' position in the return type.""", - withArguments: _withArgumentsInvalidTypeParameterVariancePositionInReturnType, -); +codeInvalidTypeParameterVariancePositionInReturnType = + const Template< + Message Function(String string, String name, String string2) + >( + "InvalidTypeParameterVariancePositionInReturnType", + problemMessageTemplate: + r"""Can't use '#string' type variable '#name' in an '#string2' position in the return type.""", + withArguments: + _withArgumentsInvalidTypeParameterVariancePositionInReturnType, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsInvalidTypeParameterVariancePositionInReturnType( @@ -7493,9 +7438,7 @@ Message _withArgumentsInvokeNonFunction(String name) { // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeJointPatternVariableNotInAll = const Template< - Message Function(String name) ->( +codeJointPatternVariableNotInAll = const Template( "JointPatternVariableNotInAll", problemMessageTemplate: r"""The variable '#name' is available in some, but not all cases that share this body.""", @@ -7517,15 +7460,14 @@ Message _withArgumentsJointPatternVariableNotInAll(String name) { // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeJointPatternVariableWithLabelDefault = const Template< - Message Function(String name) ->( - "JointPatternVariableWithLabelDefault", - problemMessageTemplate: - r"""The variable '#name' is not available because there is a label or 'default' case.""", - withArguments: _withArgumentsJointPatternVariableWithLabelDefault, - analyzerCodes: ["INVALID_PATTERN_VARIABLE_IN_SHARED_CASE_SCOPE"], -); +codeJointPatternVariableWithLabelDefault = + const Template( + "JointPatternVariableWithLabelDefault", + problemMessageTemplate: + r"""The variable '#name' is not available because there is a label or 'default' case.""", + withArguments: _withArgumentsJointPatternVariableWithLabelDefault, + analyzerCodes: ["INVALID_PATTERN_VARIABLE_IN_SHARED_CASE_SCOPE"], + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsJointPatternVariableWithLabelDefault(String name) { @@ -7541,9 +7483,7 @@ Message _withArgumentsJointPatternVariableWithLabelDefault(String name) { // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeJointPatternVariablesMismatch = const Template< - Message Function(String name) ->( +codeJointPatternVariablesMismatch = const Template( "JointPatternVariablesMismatch", problemMessageTemplate: r"""Variable pattern '#name' doesn't have the same type or finality in all cases.""", @@ -7564,16 +7504,15 @@ Message _withArgumentsJointPatternVariablesMismatch(String name) { // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeJsInteropDartClassExtendsJSClass = const Template< - Message Function(String name, String name2) ->( - "JsInteropDartClassExtendsJSClass", - problemMessageTemplate: - r"""Dart class '#name' cannot extend JS interop class '#name2'.""", - correctionMessageTemplate: - r"""Try adding the JS interop annotation or removing it from the parent class.""", - withArguments: _withArgumentsJsInteropDartClassExtendsJSClass, -); +codeJsInteropDartClassExtendsJSClass = + const Template( + "JsInteropDartClassExtendsJSClass", + problemMessageTemplate: + r"""Dart class '#name' cannot extend JS interop class '#name2'.""", + correctionMessageTemplate: + r"""Try adding the JS interop annotation or removing it from the parent class.""", + withArguments: _withArgumentsJsInteropDartClassExtendsJSClass, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsJsInteropDartClassExtendsJSClass( @@ -7606,16 +7545,15 @@ codeJsInteropDartJsInteropAnnotationForStaticInteropOnly = const MessageCode( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeJsInteropDisallowedInteropLibraryInDart2Wasm = const Template< - Message Function(String name) ->( - "JsInteropDisallowedInteropLibraryInDart2Wasm", - problemMessageTemplate: - r"""JS interop library '#name' can't be imported when compiling to Wasm.""", - correctionMessageTemplate: - r"""Try using 'dart:js_interop' or 'dart:js_interop_unsafe' instead.""", - withArguments: _withArgumentsJsInteropDisallowedInteropLibraryInDart2Wasm, -); +codeJsInteropDisallowedInteropLibraryInDart2Wasm = + const Template( + "JsInteropDisallowedInteropLibraryInDart2Wasm", + problemMessageTemplate: + r"""JS interop library '#name' can't be imported when compiling to Wasm.""", + correctionMessageTemplate: + r"""Try using 'dart:js_interop' or 'dart:js_interop_unsafe' instead.""", + withArguments: _withArgumentsJsInteropDisallowedInteropLibraryInDart2Wasm, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsJsInteropDisallowedInteropLibraryInDart2Wasm( @@ -7651,16 +7589,15 @@ const MessageCode codeJsInteropEnclosingClassJSAnnotationContext = // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeJsInteropExportClassNotMarkedExportable = const Template< - Message Function(String name) ->( - "JsInteropExportClassNotMarkedExportable", - problemMessageTemplate: - r"""Class '#name' does not have a `@JSExport` on it or any of its members.""", - correctionMessageTemplate: - r"""Use the `@JSExport` annotation on this class.""", - withArguments: _withArgumentsJsInteropExportClassNotMarkedExportable, -); +codeJsInteropExportClassNotMarkedExportable = + const Template( + "JsInteropExportClassNotMarkedExportable", + problemMessageTemplate: + r"""Class '#name' does not have a `@JSExport` on it or any of its members.""", + correctionMessageTemplate: + r"""Use the `@JSExport` annotation on this class.""", + withArguments: _withArgumentsJsInteropExportClassNotMarkedExportable, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsJsInteropExportClassNotMarkedExportable(String name) { @@ -7677,17 +7614,16 @@ Message _withArgumentsJsInteropExportClassNotMarkedExportable(String name) { // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeJsInteropExportDartInterfaceHasNonEmptyJSExportValue = const Template< - Message Function(String name) ->( - "JsInteropExportDartInterfaceHasNonEmptyJSExportValue", - problemMessageTemplate: - r"""The value in the `@JSExport` annotation on the class or mixin '#name' will be ignored.""", - correctionMessageTemplate: r"""Remove the value in the annotation.""", - withArguments: - _withArgumentsJsInteropExportDartInterfaceHasNonEmptyJSExportValue, - severity: CfeSeverity.warning, -); +codeJsInteropExportDartInterfaceHasNonEmptyJSExportValue = + const Template( + "JsInteropExportDartInterfaceHasNonEmptyJSExportValue", + problemMessageTemplate: + r"""The value in the `@JSExport` annotation on the class or mixin '#name' will be ignored.""", + correctionMessageTemplate: r"""Remove the value in the annotation.""", + withArguments: + _withArgumentsJsInteropExportDartInterfaceHasNonEmptyJSExportValue, + severity: CfeSeverity.warning, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsJsInteropExportDartInterfaceHasNonEmptyJSExportValue( @@ -7706,9 +7642,7 @@ Message _withArgumentsJsInteropExportDartInterfaceHasNonEmptyJSExportValue( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeJsInteropExportDisallowedMember = const Template< - Message Function(String name) ->( +codeJsInteropExportDisallowedMember = const Template( "JsInteropExportDisallowedMember", problemMessageTemplate: r"""Member '#name' is not a concrete instance member or declares type parameters, and therefore can't be exported.""", @@ -7733,16 +7667,15 @@ Message _withArgumentsJsInteropExportDisallowedMember(String name) { // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeJsInteropExportMemberCollision = const Template< - Message Function(String name, String string) ->( - "JsInteropExportMemberCollision", - problemMessageTemplate: - r"""The following class members collide with the same export '#name': #string.""", - correctionMessageTemplate: - r"""Either remove the conflicting members or use a different export name.""", - withArguments: _withArgumentsJsInteropExportMemberCollision, -); +codeJsInteropExportMemberCollision = + const Template( + "JsInteropExportMemberCollision", + problemMessageTemplate: + r"""The following class members collide with the same export '#name': #string.""", + correctionMessageTemplate: + r"""Either remove the conflicting members or use a different export name.""", + withArguments: _withArgumentsJsInteropExportMemberCollision, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsJsInteropExportMemberCollision( @@ -7764,9 +7697,7 @@ Message _withArgumentsJsInteropExportMemberCollision( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeJsInteropExportNoExportableMembers = const Template< - Message Function(String name) ->( +codeJsInteropExportNoExportableMembers = const Template( "JsInteropExportNoExportableMembers", problemMessageTemplate: r"""Class '#name' has no exportable members in the class or the inheritance chain.""", @@ -7871,16 +7802,15 @@ const MessageCode codeJsInteropIsATearoff = const MessageCode( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeJsInteropJSClassExtendsDartClass = const Template< - Message Function(String name, String name2) ->( - "JsInteropJSClassExtendsDartClass", - problemMessageTemplate: - r"""JS interop class '#name' cannot extend Dart class '#name2'.""", - correctionMessageTemplate: - r"""Try removing the JS interop annotation or adding it to the parent class.""", - withArguments: _withArgumentsJsInteropJSClassExtendsDartClass, -); +codeJsInteropJSClassExtendsDartClass = + const Template( + "JsInteropJSClassExtendsDartClass", + problemMessageTemplate: + r"""JS interop class '#name' cannot extend Dart class '#name2'.""", + correctionMessageTemplate: + r"""Try removing the JS interop annotation or adding it to the parent class.""", + withArguments: _withArgumentsJsInteropJSClassExtendsDartClass, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsJsInteropJSClassExtendsDartClass( @@ -7912,16 +7842,15 @@ const MessageCode codeJsInteropNamedParameters = const MessageCode( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeJsInteropNativeClassInAnnotation = const Template< - Message Function(String name, String name2, String string3) ->( - "JsInteropNativeClassInAnnotation", - problemMessageTemplate: - r"""Non-static JS interop class '#name' conflicts with natively supported class '#name2' in '#string3'.""", - correctionMessageTemplate: - r"""Try replacing it with a static JS interop class using `@staticInterop` with extension methods, or use js_util to interact with the native object of type '#name2'.""", - withArguments: _withArgumentsJsInteropNativeClassInAnnotation, -); +codeJsInteropNativeClassInAnnotation = + const Template( + "JsInteropNativeClassInAnnotation", + problemMessageTemplate: + r"""Non-static JS interop class '#name' conflicts with natively supported class '#name2' in '#string3'.""", + correctionMessageTemplate: + r"""Try replacing it with a static JS interop class using `@staticInterop` with extension methods, or use js_util to interact with the native object of type '#name2'.""", + withArguments: _withArgumentsJsInteropNativeClassInAnnotation, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsJsInteropNativeClassInAnnotation( @@ -7962,16 +7891,15 @@ const MessageCode codeJsInteropNonExternalMember = const MessageCode( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeJsInteropNonStaticWithStaticInteropSupertype = const Template< - Message Function(String name, String name2) ->( - "JsInteropNonStaticWithStaticInteropSupertype", - problemMessageTemplate: - r"""Class '#name' does not have an `@staticInterop` annotation, but has supertype '#name2', which does.""", - correctionMessageTemplate: - r"""Try marking '#name' as a `@staticInterop` class, or don't inherit '#name2'.""", - withArguments: _withArgumentsJsInteropNonStaticWithStaticInteropSupertype, -); +codeJsInteropNonStaticWithStaticInteropSupertype = + const Template( + "JsInteropNonStaticWithStaticInteropSupertype", + problemMessageTemplate: + r"""Class '#name' does not have an `@staticInterop` annotation, but has supertype '#name2', which does.""", + correctionMessageTemplate: + r"""Try marking '#name' as a `@staticInterop` class, or don't inherit '#name2'.""", + withArguments: _withArgumentsJsInteropNonStaticWithStaticInteropSupertype, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsJsInteropNonStaticWithStaticInteropSupertype( @@ -8039,17 +7967,16 @@ const MessageCode codeJsInteropOperatorsNotSupported = const MessageCode( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeJsInteropStaticInteropExternalFunctionTypeViolation = const Template< - Message Function(String string2) ->( - "JsInteropStaticInteropExternalFunctionTypeViolation", - problemMessageTemplate: - r"""External JS interop member contains invalid types in its function signature: '#string2'.""", - correctionMessageTemplate: - r"""Use one of these valid types instead: JS types from 'dart:js_interop', ExternalDartReference, void, bool, num, double, int, String, extension types that erase to one of these types, '@staticInterop' types, 'dart:html' types when compiling to JS, or a type parameter that is a subtype of a valid non-primitive type.""", - withArguments: - _withArgumentsJsInteropStaticInteropExternalFunctionTypeViolation, -); +codeJsInteropStaticInteropExternalFunctionTypeViolation = + const Template( + "JsInteropStaticInteropExternalFunctionTypeViolation", + problemMessageTemplate: + r"""External JS interop member contains invalid types in its function signature: '#string2'.""", + correctionMessageTemplate: + r"""Use one of these valid types instead: JS types from 'dart:js_interop', ExternalDartReference, void, bool, num, double, int, String, extension types that erase to one of these types, '@staticInterop' types, 'dart:html' types when compiling to JS, or a type parameter that is a subtype of a valid non-primitive type.""", + withArguments: + _withArgumentsJsInteropStaticInteropExternalFunctionTypeViolation, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsJsInteropStaticInteropExternalFunctionTypeViolation( @@ -8085,22 +8012,24 @@ const Template< String string3, ) > -codeJsInteropStaticInteropMockMissingGetterOrSetter = const Template< - Message Function( - String name, - String string, - String string2, - String name2, - String string3, - ) ->( - "JsInteropStaticInteropMockMissingGetterOrSetter", - problemMessageTemplate: - r"""Dart class '#name' has a #string, but does not have a #string2 to implement any of the following extension member(s) with export name '#name2': #string3.""", - correctionMessageTemplate: - r"""Declare an exportable #string2 that implements one of these extension members.""", - withArguments: _withArgumentsJsInteropStaticInteropMockMissingGetterOrSetter, -); +codeJsInteropStaticInteropMockMissingGetterOrSetter = + const Template< + Message Function( + String name, + String string, + String string2, + String name2, + String string3, + ) + >( + "JsInteropStaticInteropMockMissingGetterOrSetter", + problemMessageTemplate: + r"""Dart class '#name' has a #string, but does not have a #string2 to implement any of the following extension member(s) with export name '#name2': #string3.""", + correctionMessageTemplate: + r"""Declare an exportable #string2 that implements one of these extension members.""", + withArguments: + _withArgumentsJsInteropStaticInteropMockMissingGetterOrSetter, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsJsInteropStaticInteropMockMissingGetterOrSetter( @@ -8135,16 +8064,15 @@ Message _withArgumentsJsInteropStaticInteropMockMissingGetterOrSetter( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeJsInteropStaticInteropMockMissingImplements = const Template< - Message Function(String name, String name2, String string) ->( - "JsInteropStaticInteropMockMissingImplements", - problemMessageTemplate: - r"""Dart class '#name' does not have any members that implement any of the following extension member(s) with export name '#name2': #string.""", - correctionMessageTemplate: - r"""Declare an exportable member that implements one of these extension members.""", - withArguments: _withArgumentsJsInteropStaticInteropMockMissingImplements, -); +codeJsInteropStaticInteropMockMissingImplements = + const Template( + "JsInteropStaticInteropMockMissingImplements", + problemMessageTemplate: + r"""Dart class '#name' does not have any members that implement any of the following extension member(s) with export name '#name2': #string.""", + correctionMessageTemplate: + r"""Declare an exportable member that implements one of these extension members.""", + withArguments: _withArgumentsJsInteropStaticInteropMockMissingImplements, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsJsInteropStaticInteropMockMissingImplements( @@ -8169,15 +8097,14 @@ Message _withArgumentsJsInteropStaticInteropMockMissingImplements( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeJsInteropStaticInteropNoJSAnnotation = const Template< - Message Function(String name) ->( - "JsInteropStaticInteropNoJSAnnotation", - problemMessageTemplate: - r"""`@staticInterop` classes should also have the `@JS` annotation.""", - correctionMessageTemplate: r"""Add `@JS` to class '#name'.""", - withArguments: _withArgumentsJsInteropStaticInteropNoJSAnnotation, -); +codeJsInteropStaticInteropNoJSAnnotation = + const Template( + "JsInteropStaticInteropNoJSAnnotation", + problemMessageTemplate: + r"""`@staticInterop` classes should also have the `@JS` annotation.""", + correctionMessageTemplate: r"""Add `@JS` to class '#name'.""", + withArguments: _withArgumentsJsInteropStaticInteropNoJSAnnotation, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsJsInteropStaticInteropNoJSAnnotation(String name) { @@ -8244,16 +8171,16 @@ Message _withArgumentsJsInteropStaticInteropTearOffsDisallowed( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeJsInteropStaticInteropToJSFunctionTypeViolation = const Template< - Message Function(String string2) ->( - "JsInteropStaticInteropToJSFunctionTypeViolation", - problemMessageTemplate: - r"""Function converted via 'toJS' contains invalid types in its function signature: '#string2'.""", - correctionMessageTemplate: - r"""Use one of these valid types instead: JS types from 'dart:js_interop', ExternalDartReference, void, bool, num, double, int, String, extension types that erase to one of these types, '@staticInterop' types, 'dart:html' types when compiling to JS, or a type parameter that is a subtype of a valid non-primitive type.""", - withArguments: _withArgumentsJsInteropStaticInteropToJSFunctionTypeViolation, -); +codeJsInteropStaticInteropToJSFunctionTypeViolation = + const Template( + "JsInteropStaticInteropToJSFunctionTypeViolation", + problemMessageTemplate: + r"""Function converted via 'toJS' contains invalid types in its function signature: '#string2'.""", + correctionMessageTemplate: + r"""Use one of these valid types instead: JS types from 'dart:js_interop', ExternalDartReference, void, bool, num, double, int, String, extension types that erase to one of these types, '@staticInterop' types, 'dart:html' types when compiling to JS, or a type parameter that is a subtype of a valid non-primitive type.""", + withArguments: + _withArgumentsJsInteropStaticInteropToJSFunctionTypeViolation, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsJsInteropStaticInteropToJSFunctionTypeViolation( @@ -8272,15 +8199,16 @@ Message _withArgumentsJsInteropStaticInteropToJSFunctionTypeViolation( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeJsInteropStaticInteropTrustTypesUsageNotAllowed = const Template< - Message Function(String name) ->( - "JsInteropStaticInteropTrustTypesUsageNotAllowed", - problemMessageTemplate: - r"""JS interop class '#name' has an `@trustTypes` annotation, but `@trustTypes` is only supported within the sdk.""", - correctionMessageTemplate: r"""Try removing the `@trustTypes` annotation.""", - withArguments: _withArgumentsJsInteropStaticInteropTrustTypesUsageNotAllowed, -); +codeJsInteropStaticInteropTrustTypesUsageNotAllowed = + const Template( + "JsInteropStaticInteropTrustTypesUsageNotAllowed", + problemMessageTemplate: + r"""JS interop class '#name' has an `@trustTypes` annotation, but `@trustTypes` is only supported within the sdk.""", + correctionMessageTemplate: + r"""Try removing the `@trustTypes` annotation.""", + withArguments: + _withArgumentsJsInteropStaticInteropTrustTypesUsageNotAllowed, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsJsInteropStaticInteropTrustTypesUsageNotAllowed( @@ -8299,17 +8227,16 @@ Message _withArgumentsJsInteropStaticInteropTrustTypesUsageNotAllowed( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeJsInteropStaticInteropTrustTypesUsedWithoutStaticInterop = const Template< - Message Function(String name) ->( - "JsInteropStaticInteropTrustTypesUsedWithoutStaticInterop", - problemMessageTemplate: - r"""JS interop class '#name' has an `@trustTypes` annotation, but no `@staticInterop` annotation.""", - correctionMessageTemplate: - r"""Try marking the class using `@staticInterop`.""", - withArguments: - _withArgumentsJsInteropStaticInteropTrustTypesUsedWithoutStaticInterop, -); +codeJsInteropStaticInteropTrustTypesUsedWithoutStaticInterop = + const Template( + "JsInteropStaticInteropTrustTypesUsedWithoutStaticInterop", + problemMessageTemplate: + r"""JS interop class '#name' has an `@trustTypes` annotation, but no `@staticInterop` annotation.""", + correctionMessageTemplate: + r"""Try marking the class using `@staticInterop`.""", + withArguments: + _withArgumentsJsInteropStaticInteropTrustTypesUsedWithoutStaticInterop, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsJsInteropStaticInteropTrustTypesUsedWithoutStaticInterop( @@ -8328,16 +8255,15 @@ Message _withArgumentsJsInteropStaticInteropTrustTypesUsedWithoutStaticInterop( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeJsInteropStaticInteropWithInstanceMembers = const Template< - Message Function(String name) ->( - "JsInteropStaticInteropWithInstanceMembers", - problemMessageTemplate: - r"""JS interop class '#name' with `@staticInterop` annotation cannot declare instance members.""", - correctionMessageTemplate: - r"""Try moving the instance member to a static extension.""", - withArguments: _withArgumentsJsInteropStaticInteropWithInstanceMembers, -); +codeJsInteropStaticInteropWithInstanceMembers = + const Template( + "JsInteropStaticInteropWithInstanceMembers", + problemMessageTemplate: + r"""JS interop class '#name' with `@staticInterop` annotation cannot declare instance members.""", + correctionMessageTemplate: + r"""Try moving the instance member to a static extension.""", + withArguments: _withArgumentsJsInteropStaticInteropWithInstanceMembers, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsJsInteropStaticInteropWithInstanceMembers(String name) { @@ -8355,16 +8281,15 @@ Message _withArgumentsJsInteropStaticInteropWithInstanceMembers(String name) { // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeJsInteropStaticInteropWithNonStaticSupertype = const Template< - Message Function(String name, String name2) ->( - "JsInteropStaticInteropWithNonStaticSupertype", - problemMessageTemplate: - r"""JS interop class '#name' has an `@staticInterop` annotation, but has supertype '#name2', which does not.""", - correctionMessageTemplate: - r"""Try marking the supertype as a static interop class using `@staticInterop`.""", - withArguments: _withArgumentsJsInteropStaticInteropWithNonStaticSupertype, -); +codeJsInteropStaticInteropWithNonStaticSupertype = + const Template( + "JsInteropStaticInteropWithNonStaticSupertype", + problemMessageTemplate: + r"""JS interop class '#name' has an `@staticInterop` annotation, but has supertype '#name2', which does not.""", + correctionMessageTemplate: + r"""Try marking the supertype as a static interop class using `@staticInterop`.""", + withArguments: _withArgumentsJsInteropStaticInteropWithNonStaticSupertype, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsJsInteropStaticInteropWithNonStaticSupertype( @@ -8453,14 +8378,15 @@ const MessageCode codeLanguageVersionPatchContext = const MessageCode( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeLanguageVersionTooHighExplicit = const Template< - Message Function(int count, int count2, int count3, int count4) ->( - "LanguageVersionTooHighExplicit", - problemMessageTemplate: - r"""The specified language version #count.#count2 is too high. The highest supported language version is #count3.#count4.""", - withArguments: _withArgumentsLanguageVersionTooHighExplicit, -); +codeLanguageVersionTooHighExplicit = + const Template< + Message Function(int count, int count2, int count3, int count4) + >( + "LanguageVersionTooHighExplicit", + problemMessageTemplate: + r"""The specified language version #count.#count2 is too high. The highest supported language version is #count3.#count4.""", + withArguments: _withArgumentsLanguageVersionTooHighExplicit, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsLanguageVersionTooHighExplicit( @@ -8486,14 +8412,21 @@ Message _withArgumentsLanguageVersionTooHighExplicit( const Template< Message Function(int count, int count2, String name, int count3, int count4) > -codeLanguageVersionTooHighPackage = const Template< - Message Function(int count, int count2, String name, int count3, int count4) ->( - "LanguageVersionTooHighPackage", - problemMessageTemplate: - r"""The language version #count.#count2 specified for the package '#name' is too high. The highest supported language version is #count3.#count4.""", - withArguments: _withArgumentsLanguageVersionTooHighPackage, -); +codeLanguageVersionTooHighPackage = + const Template< + Message Function( + int count, + int count2, + String name, + int count3, + int count4, + ) + >( + "LanguageVersionTooHighPackage", + problemMessageTemplate: + r"""The language version #count.#count2 specified for the package '#name' is too high. The highest supported language version is #count3.#count4.""", + withArguments: _withArgumentsLanguageVersionTooHighPackage, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsLanguageVersionTooHighPackage( @@ -8521,14 +8454,15 @@ Message _withArgumentsLanguageVersionTooHighPackage( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeLanguageVersionTooLowExplicit = const Template< - Message Function(int count, int count2, int count3, int count4) ->( - "LanguageVersionTooLowExplicit", - problemMessageTemplate: - r"""The specified language version #count.#count2 is too low. The lowest supported language version is #count3.#count4.""", - withArguments: _withArgumentsLanguageVersionTooLowExplicit, -); +codeLanguageVersionTooLowExplicit = + const Template< + Message Function(int count, int count2, int count3, int count4) + >( + "LanguageVersionTooLowExplicit", + problemMessageTemplate: + r"""The specified language version #count.#count2 is too low. The lowest supported language version is #count3.#count4.""", + withArguments: _withArgumentsLanguageVersionTooLowExplicit, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsLanguageVersionTooLowExplicit( @@ -8554,14 +8488,21 @@ Message _withArgumentsLanguageVersionTooLowExplicit( const Template< Message Function(int count, int count2, String name, int count3, int count4) > -codeLanguageVersionTooLowPackage = const Template< - Message Function(int count, int count2, String name, int count3, int count4) ->( - "LanguageVersionTooLowPackage", - problemMessageTemplate: - r"""The language version #count.#count2 specified for the package '#name' is too low. The lowest supported language version is #count3.#count4.""", - withArguments: _withArgumentsLanguageVersionTooLowPackage, -); +codeLanguageVersionTooLowPackage = + const Template< + Message Function( + int count, + int count2, + String name, + int count3, + int count4, + ) + >( + "LanguageVersionTooLowPackage", + problemMessageTemplate: + r"""The language version #count.#count2 specified for the package '#name' is too low. The lowest supported language version is #count3.#count4.""", + withArguments: _withArgumentsLanguageVersionTooLowPackage, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsLanguageVersionTooLowPackage( @@ -8609,9 +8550,7 @@ Message _withArgumentsLateDefinitelyAssignedError(String name) { // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeLateDefinitelyUnassignedError = const Template< - Message Function(String name) ->( +codeLateDefinitelyUnassignedError = const Template( "LateDefinitelyUnassignedError", problemMessageTemplate: r"""Late variable '#name' without initializer is definitely unassigned.""", @@ -8729,15 +8668,14 @@ const MessageCode codeLoadLibraryTakesNoArguments = const MessageCode( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeLocalVariableUsedBeforeDeclared = const Template< - Message Function(String name) ->( - "LocalVariableUsedBeforeDeclared", - problemMessageTemplate: - r"""Local variable '#name' can't be referenced before it is declared.""", - withArguments: _withArgumentsLocalVariableUsedBeforeDeclared, - analyzerCodes: ["REFERENCED_BEFORE_DECLARATION"], -); +codeLocalVariableUsedBeforeDeclared = + const Template( + "LocalVariableUsedBeforeDeclared", + problemMessageTemplate: + r"""Local variable '#name' can't be referenced before it is declared.""", + withArguments: _withArgumentsLocalVariableUsedBeforeDeclared, + analyzerCodes: ["REFERENCED_BEFORE_DECLARATION"], + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsLocalVariableUsedBeforeDeclared(String name) { @@ -8927,16 +8865,16 @@ Message _withArgumentsMemberNotFound(String name) { // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeMemberShouldBeListedAsCallableInDynamicInterface = const Template< - Message Function(String name) ->( - "MemberShouldBeListedAsCallableInDynamicInterface", - problemMessageTemplate: - r"""Cannot invoke member '#name' from a dynamic module.""", - correctionMessageTemplate: - r"""Try removing the call or update the dynamic interface to list member '#name' as callable.""", - withArguments: _withArgumentsMemberShouldBeListedAsCallableInDynamicInterface, -); +codeMemberShouldBeListedAsCallableInDynamicInterface = + const Template( + "MemberShouldBeListedAsCallableInDynamicInterface", + problemMessageTemplate: + r"""Cannot invoke member '#name' from a dynamic module.""", + correctionMessageTemplate: + r"""Try removing the call or update the dynamic interface to list member '#name' as callable.""", + withArguments: + _withArgumentsMemberShouldBeListedAsCallableInDynamicInterface, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsMemberShouldBeListedAsCallableInDynamicInterface( @@ -8955,17 +8893,16 @@ Message _withArgumentsMemberShouldBeListedAsCallableInDynamicInterface( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeMemberShouldBeListedAsCanBeOverriddenInDynamicInterface = const Template< - Message Function(String name, String name2) ->( - "MemberShouldBeListedAsCanBeOverriddenInDynamicInterface", - problemMessageTemplate: - r"""Cannot override member '#name.#name2' in a dynamic module.""", - correctionMessageTemplate: - r"""Try removing the override or update the dynamic interface to list member '#name.#name2' as can-be-overridden.""", - withArguments: - _withArgumentsMemberShouldBeListedAsCanBeOverriddenInDynamicInterface, -); +codeMemberShouldBeListedAsCanBeOverriddenInDynamicInterface = + const Template( + "MemberShouldBeListedAsCanBeOverriddenInDynamicInterface", + problemMessageTemplate: + r"""Cannot override member '#name.#name2' in a dynamic module.""", + correctionMessageTemplate: + r"""Try removing the override or update the dynamic interface to list member '#name.#name2' as can-be-overridden.""", + withArguments: + _withArgumentsMemberShouldBeListedAsCanBeOverriddenInDynamicInterface, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsMemberShouldBeListedAsCanBeOverriddenInDynamicInterface( @@ -9126,22 +9063,21 @@ Message _withArgumentsMissingImplementationCause(String name) { // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template _names)> -codeMissingImplementationNotAbstract = const Template< - Message Function(String name, List _names) ->( - "MissingImplementationNotAbstract", - problemMessageTemplate: - r"""The non-abstract class '#name' is missing implementations for these members: +codeMissingImplementationNotAbstract = + const Template _names)>( + "MissingImplementationNotAbstract", + problemMessageTemplate: + r"""The non-abstract class '#name' is missing implementations for these members: #names""", - correctionMessageTemplate: r"""Try to either + correctionMessageTemplate: r"""Try to either - provide an implementation, - inherit an implementation from a superclass or mixin, - mark the class as abstract, or - provide a 'noSuchMethod' implementation. """, - withArguments: _withArgumentsMissingImplementationNotAbstract, - analyzerCodes: ["CONCRETE_CLASS_WITH_ABSTRACT_MEMBER"], -); + withArguments: _withArgumentsMissingImplementationNotAbstract, + analyzerCodes: ["CONCRETE_CLASS_WITH_ABSTRACT_MEMBER"], + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsMissingImplementationNotAbstract( @@ -9303,15 +9239,16 @@ Message _withArgumentsMissingVariablePattern(String name) { // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeMixinApplicationNoConcreteGetter = const Template< - Message Function(String name) ->( - "MixinApplicationNoConcreteGetter", - problemMessageTemplate: - r"""The class doesn't have a concrete implementation of the super-accessed member '#name'.""", - withArguments: _withArgumentsMixinApplicationNoConcreteGetter, - analyzerCodes: ["MIXIN_APPLICATION_NO_CONCRETE_SUPER_INVOKED_MEMBER"], -); +codeMixinApplicationNoConcreteGetter = + const Template( + "MixinApplicationNoConcreteGetter", + problemMessageTemplate: + r"""The class doesn't have a concrete implementation of the super-accessed member '#name'.""", + withArguments: _withArgumentsMixinApplicationNoConcreteGetter, + analyzerCodes: [ + "MIXIN_APPLICATION_NO_CONCRETE_SUPER_INVOKED_MEMBER", + ], + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsMixinApplicationNoConcreteGetter(String name) { @@ -9336,15 +9273,16 @@ const MessageCode codeMixinApplicationNoConcreteMemberContext = // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeMixinApplicationNoConcreteMethod = const Template< - Message Function(String name) ->( - "MixinApplicationNoConcreteMethod", - problemMessageTemplate: - r"""The class doesn't have a concrete implementation of the super-invoked member '#name'.""", - withArguments: _withArgumentsMixinApplicationNoConcreteMethod, - analyzerCodes: ["MIXIN_APPLICATION_NO_CONCRETE_SUPER_INVOKED_MEMBER"], -); +codeMixinApplicationNoConcreteMethod = + const Template( + "MixinApplicationNoConcreteMethod", + problemMessageTemplate: + r"""The class doesn't have a concrete implementation of the super-invoked member '#name'.""", + withArguments: _withArgumentsMixinApplicationNoConcreteMethod, + analyzerCodes: [ + "MIXIN_APPLICATION_NO_CONCRETE_SUPER_INVOKED_MEMBER", + ], + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsMixinApplicationNoConcreteMethod(String name) { @@ -9360,15 +9298,16 @@ Message _withArgumentsMixinApplicationNoConcreteMethod(String name) { // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeMixinApplicationNoConcreteSetter = const Template< - Message Function(String name) ->( - "MixinApplicationNoConcreteSetter", - problemMessageTemplate: - r"""The class doesn't have a concrete implementation of the super-accessed setter '#name'.""", - withArguments: _withArgumentsMixinApplicationNoConcreteSetter, - analyzerCodes: ["MIXIN_APPLICATION_NO_CONCRETE_SUPER_INVOKED_MEMBER"], -); +codeMixinApplicationNoConcreteSetter = + const Template( + "MixinApplicationNoConcreteSetter", + problemMessageTemplate: + r"""The class doesn't have a concrete implementation of the super-accessed setter '#name'.""", + withArguments: _withArgumentsMixinApplicationNoConcreteSetter, + analyzerCodes: [ + "MIXIN_APPLICATION_NO_CONCRETE_SUPER_INVOKED_MEMBER", + ], + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsMixinApplicationNoConcreteSetter(String name) { @@ -9421,16 +9360,15 @@ Message _withArgumentsMixinInheritsFromNotObject(String name) { // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeMixinSubtypeOfBaseIsNotBase = const Template< - Message Function(String name, String name2) ->( - "MixinSubtypeOfBaseIsNotBase", - problemMessageTemplate: - r"""The mixin '#name' must be 'base' because the supertype '#name2' is 'base'.""", - correctionMessageTemplate: r"""Try adding 'base' to the mixin.""", - withArguments: _withArgumentsMixinSubtypeOfBaseIsNotBase, - analyzerCodes: ["MIXIN_SUBTYPE_OF_BASE_IS_NOT_BASE"], -); +codeMixinSubtypeOfBaseIsNotBase = + const Template( + "MixinSubtypeOfBaseIsNotBase", + problemMessageTemplate: + r"""The mixin '#name' must be 'base' because the supertype '#name2' is 'base'.""", + correctionMessageTemplate: r"""Try adding 'base' to the mixin.""", + withArguments: _withArgumentsMixinSubtypeOfBaseIsNotBase, + analyzerCodes: ["MIXIN_SUBTYPE_OF_BASE_IS_NOT_BASE"], + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsMixinSubtypeOfBaseIsNotBase(String name, String name2) { @@ -9449,16 +9387,15 @@ Message _withArgumentsMixinSubtypeOfBaseIsNotBase(String name, String name2) { // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeMixinSubtypeOfFinalIsNotBase = const Template< - Message Function(String name, String name2) ->( - "MixinSubtypeOfFinalIsNotBase", - problemMessageTemplate: - r"""The mixin '#name' must be 'base' because the supertype '#name2' is 'final'.""", - correctionMessageTemplate: r"""Try adding 'base' to the mixin.""", - withArguments: _withArgumentsMixinSubtypeOfFinalIsNotBase, - analyzerCodes: ["MIXIN_SUBTYPE_OF_FINAL_IS_NOT_BASE"], -); +codeMixinSubtypeOfFinalIsNotBase = + const Template( + "MixinSubtypeOfFinalIsNotBase", + problemMessageTemplate: + r"""The mixin '#name' must be 'base' because the supertype '#name2' is 'final'.""", + correctionMessageTemplate: r"""Try adding 'base' to the mixin.""", + withArguments: _withArgumentsMixinSubtypeOfFinalIsNotBase, + analyzerCodes: ["MIXIN_SUBTYPE_OF_FINAL_IS_NOT_BASE"], + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsMixinSubtypeOfFinalIsNotBase(String name, String name2) { @@ -9494,16 +9431,15 @@ const MessageCode codeMixinWithClause = const MessageCode( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeModifierOutOfOrder = const Template< - Message Function(String string, String string2) ->( - "ModifierOutOfOrder", - problemMessageTemplate: - r"""The modifier '#string' should be before the modifier '#string2'.""", - correctionMessageTemplate: r"""Try re-ordering the modifiers.""", - withArguments: _withArgumentsModifierOutOfOrder, - index: 56, -); +codeModifierOutOfOrder = + const Template( + "ModifierOutOfOrder", + problemMessageTemplate: + r"""The modifier '#string' should be before the modifier '#string2'.""", + correctionMessageTemplate: r"""Try re-ordering the modifiers.""", + withArguments: _withArgumentsModifierOutOfOrder, + index: 56, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsModifierOutOfOrder(String string, String string2) { @@ -9527,9 +9463,7 @@ const MessageCode codeMoreThanOneSuperInitializer = const MessageCode( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeMultipleClauses = const Template< - Message Function(String string, String string2) ->( +codeMultipleClauses = const Template( "MultipleClauses", problemMessageTemplate: r"""Each '#string' definition can have at most one '#string2' clause.""", @@ -9656,14 +9590,13 @@ const MessageCode codeNamedFunctionExpression = const MessageCode( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeNamedMixinOverride = const Template< - Message Function(String name, String name2) ->( - "NamedMixinOverride", - problemMessageTemplate: - r"""The mixin application class '#name' introduces an erroneous override of '#name2'.""", - withArguments: _withArgumentsNamedMixinOverride, -); +codeNamedMixinOverride = + const Template( + "NamedMixinOverride", + problemMessageTemplate: + r"""The mixin application class '#name' introduces an erroneous override of '#name2'.""", + withArguments: _withArgumentsNamedMixinOverride, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsNamedMixinOverride(String name, String name2) { @@ -9783,17 +9716,16 @@ const MessageCode codeNoUnnamedConstructorInObject = const MessageCode( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeNonAsciiIdentifier = const Template< - Message Function(String character, int codePoint) ->( - "NonAsciiIdentifier", - problemMessageTemplate: - r"""The non-ASCII character '#character' (#unicode) can't be used in identifiers, only in strings and comments.""", - correctionMessageTemplate: - r"""Try using an US-ASCII letter, a digit, '_' (an underscore), or '$' (a dollar sign).""", - withArguments: _withArgumentsNonAsciiIdentifier, - analyzerCodes: ["ILLEGAL_CHARACTER"], -); +codeNonAsciiIdentifier = + const Template( + "NonAsciiIdentifier", + problemMessageTemplate: + r"""The non-ASCII character '#character' (#unicode) can't be used in identifiers, only in strings and comments.""", + correctionMessageTemplate: + r"""Try using an US-ASCII letter, a digit, '_' (an underscore), or '$' (a dollar sign).""", + withArguments: _withArgumentsNonAsciiIdentifier, + analyzerCodes: ["ILLEGAL_CHARACTER"], + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsNonAsciiIdentifier(String character, int codePoint) { @@ -10005,15 +9937,14 @@ const MessageCode codeNotAConstantExpression = const MessageCode( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeNotAPrefixInTypeAnnotation = const Template< - Message Function(String name, String name2) ->( - "NotAPrefixInTypeAnnotation", - problemMessageTemplate: - r"""'#name.#name2' can't be used as a type because '#name' doesn't refer to an import prefix.""", - withArguments: _withArgumentsNotAPrefixInTypeAnnotation, - analyzerCodes: ["NOT_A_TYPE"], -); +codeNotAPrefixInTypeAnnotation = + const Template( + "NotAPrefixInTypeAnnotation", + problemMessageTemplate: + r"""'#name.#name2' can't be used as a type because '#name' doesn't refer to an import prefix.""", + withArguments: _withArgumentsNotAPrefixInTypeAnnotation, + analyzerCodes: ["NOT_A_TYPE"], + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsNotAPrefixInTypeAnnotation(String name, String name2) { @@ -10249,9 +10180,7 @@ const MessageCode codeOnlyTry = const MessageCode( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeOperatorMinusParameterMismatch = const Template< - Message Function(String name) ->( +codeOperatorMinusParameterMismatch = const Template( "OperatorMinusParameterMismatch", problemMessageTemplate: r"""Operator '#name' should have zero or one parameter.""", @@ -10409,15 +10338,14 @@ Message _withArgumentsOverriddenMethodCause(String name) { // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeOverrideFewerNamedArguments = const Template< - Message Function(String name, String name2) ->( - "OverrideFewerNamedArguments", - problemMessageTemplate: - r"""The method '#name' has fewer named arguments than those of overridden method '#name2'.""", - withArguments: _withArgumentsOverrideFewerNamedArguments, - analyzerCodes: ["INVALID_OVERRIDE_NAMED"], -); +codeOverrideFewerNamedArguments = + const Template( + "OverrideFewerNamedArguments", + problemMessageTemplate: + r"""The method '#name' has fewer named arguments than those of overridden method '#name2'.""", + withArguments: _withArgumentsOverrideFewerNamedArguments, + analyzerCodes: ["INVALID_OVERRIDE_NAMED"], + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsOverrideFewerNamedArguments(String name, String name2) { @@ -10435,15 +10363,14 @@ Message _withArgumentsOverrideFewerNamedArguments(String name, String name2) { // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeOverrideFewerPositionalArguments = const Template< - Message Function(String name, String name2) ->( - "OverrideFewerPositionalArguments", - problemMessageTemplate: - r"""The method '#name' has fewer positional arguments than those of overridden method '#name2'.""", - withArguments: _withArgumentsOverrideFewerPositionalArguments, - analyzerCodes: ["INVALID_OVERRIDE_POSITIONAL"], -); +codeOverrideFewerPositionalArguments = + const Template( + "OverrideFewerPositionalArguments", + problemMessageTemplate: + r"""The method '#name' has fewer positional arguments than those of overridden method '#name2'.""", + withArguments: _withArgumentsOverrideFewerPositionalArguments, + analyzerCodes: ["INVALID_OVERRIDE_POSITIONAL"], + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsOverrideFewerPositionalArguments( @@ -10464,15 +10391,14 @@ Message _withArgumentsOverrideFewerPositionalArguments( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeOverrideMismatchNamedParameter = const Template< - Message Function(String name, String name2, String name3) ->( - "OverrideMismatchNamedParameter", - problemMessageTemplate: - r"""The method '#name' doesn't have the named parameter '#name2' of overridden method '#name3'.""", - withArguments: _withArgumentsOverrideMismatchNamedParameter, - analyzerCodes: ["INVALID_OVERRIDE_NAMED"], -); +codeOverrideMismatchNamedParameter = + const Template( + "OverrideMismatchNamedParameter", + problemMessageTemplate: + r"""The method '#name' doesn't have the named parameter '#name2' of overridden method '#name3'.""", + withArguments: _withArgumentsOverrideMismatchNamedParameter, + analyzerCodes: ["INVALID_OVERRIDE_NAMED"], + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsOverrideMismatchNamedParameter( @@ -10496,14 +10422,13 @@ Message _withArgumentsOverrideMismatchNamedParameter( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeOverrideMismatchRequiredNamedParameter = const Template< - Message Function(String name, String name2, String name3) ->( - "OverrideMismatchRequiredNamedParameter", - problemMessageTemplate: - r"""The required named parameter '#name' in method '#name2' is not required in overridden method '#name3'.""", - withArguments: _withArgumentsOverrideMismatchRequiredNamedParameter, -); +codeOverrideMismatchRequiredNamedParameter = + const Template( + "OverrideMismatchRequiredNamedParameter", + problemMessageTemplate: + r"""The required named parameter '#name' in method '#name2' is not required in overridden method '#name3'.""", + withArguments: _withArgumentsOverrideMismatchRequiredNamedParameter, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsOverrideMismatchRequiredNamedParameter( @@ -10527,15 +10452,14 @@ Message _withArgumentsOverrideMismatchRequiredNamedParameter( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeOverrideMoreRequiredArguments = const Template< - Message Function(String name, String name2) ->( - "OverrideMoreRequiredArguments", - problemMessageTemplate: - r"""The method '#name' has more required arguments than those of overridden method '#name2'.""", - withArguments: _withArgumentsOverrideMoreRequiredArguments, - analyzerCodes: ["INVALID_OVERRIDE_REQUIRED"], -); +codeOverrideMoreRequiredArguments = + const Template( + "OverrideMoreRequiredArguments", + problemMessageTemplate: + r"""The method '#name' has more required arguments than those of overridden method '#name2'.""", + withArguments: _withArgumentsOverrideMoreRequiredArguments, + analyzerCodes: ["INVALID_OVERRIDE_REQUIRED"], + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsOverrideMoreRequiredArguments(String name, String name2) { @@ -10553,15 +10477,14 @@ Message _withArgumentsOverrideMoreRequiredArguments(String name, String name2) { // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeOverrideTypeParametersMismatch = const Template< - Message Function(String name, String name2) ->( - "OverrideTypeParametersMismatch", - problemMessageTemplate: - r"""Declared type variables of '#name' doesn't match those on overridden method '#name2'.""", - withArguments: _withArgumentsOverrideTypeParametersMismatch, - analyzerCodes: ["INVALID_METHOD_OVERRIDE_TYPE_PARAMETERS"], -); +codeOverrideTypeParametersMismatch = + const Template( + "OverrideTypeParametersMismatch", + problemMessageTemplate: + r"""Declared type variables of '#name' doesn't match those on overridden method '#name2'.""", + withArguments: _withArgumentsOverrideTypeParametersMismatch, + analyzerCodes: ["INVALID_METHOD_OVERRIDE_TYPE_PARAMETERS"], + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsOverrideTypeParametersMismatch( @@ -10679,15 +10602,14 @@ Message _withArgumentsPartOfInLibrary(Uri uri_) { // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codePartOfLibraryNameMismatch = const Template< - Message Function(Uri uri_, String name, String name2) ->( - "PartOfLibraryNameMismatch", - problemMessageTemplate: - r"""Using '#uri' as part of '#name' but its 'part of' declaration says '#name2'.""", - withArguments: _withArgumentsPartOfLibraryNameMismatch, - analyzerCodes: ["PART_OF_DIFFERENT_LIBRARY"], -); +codePartOfLibraryNameMismatch = + const Template( + "PartOfLibraryNameMismatch", + problemMessageTemplate: + r"""Using '#uri' as part of '#name' but its 'part of' declaration says '#name2'.""", + withArguments: _withArgumentsPartOfLibraryNameMismatch, + analyzerCodes: ["PART_OF_DIFFERENT_LIBRARY"], + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsPartOfLibraryNameMismatch( @@ -10741,15 +10663,14 @@ const MessageCode codePartOfTwoLibrariesContext = const MessageCode( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codePartOfUriMismatch = const Template< - Message Function(Uri uri_, Uri uri2_, Uri uri3_) ->( - "PartOfUriMismatch", - problemMessageTemplate: - r"""Using '#uri' as part of '#uri2' but its 'part of' declaration says '#uri3'.""", - withArguments: _withArgumentsPartOfUriMismatch, - analyzerCodes: ["PART_OF_DIFFERENT_LIBRARY"], -); +codePartOfUriMismatch = + const Template( + "PartOfUriMismatch", + problemMessageTemplate: + r"""Using '#uri' as part of '#uri2' but its 'part of' declaration says '#uri3'.""", + withArguments: _withArgumentsPartOfUriMismatch, + analyzerCodes: ["PART_OF_DIFFERENT_LIBRARY"], + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsPartOfUriMismatch(Uri uri_, Uri uri2_, Uri uri3_) { @@ -10766,9 +10687,7 @@ Message _withArgumentsPartOfUriMismatch(Uri uri_, Uri uri2_, Uri uri3_) { // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codePartOfUseUri = const Template< - Message Function(Uri uri_, Uri uri2_, String name) ->( +codePartOfUseUri = const Template( "PartOfUseUri", problemMessageTemplate: r"""Using '#uri' as part of '#uri2' but its 'part of' declaration says '#name'.""", @@ -10857,9 +10776,7 @@ const MessageCode codePatchExtensionTypeParametersMismatch = const MessageCode( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codePatchInjectionFailed = const Template< - Message Function(String name, Uri uri_) ->( +codePatchInjectionFailed = const Template( "PatchInjectionFailed", problemMessageTemplate: r"""Can't inject public '#name' into '#uri'.""", correctionMessageTemplate: @@ -10883,17 +10800,16 @@ Message _withArgumentsPatchInjectionFailed(String name, Uri uri_) { // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codePatternAssignmentDeclaresVariable = const Template< - Message Function(String name) ->( - "PatternAssignmentDeclaresVariable", - problemMessageTemplate: - r"""Variable '#name' can't be declared in a pattern assignment.""", - correctionMessageTemplate: - r"""Try using a preexisting variable or changing the assignment to a pattern variable declaration.""", - withArguments: _withArgumentsPatternAssignmentDeclaresVariable, - index: 145, -); +codePatternAssignmentDeclaresVariable = + const Template( + "PatternAssignmentDeclaresVariable", + problemMessageTemplate: + r"""Variable '#name' can't be declared in a pattern assignment.""", + correctionMessageTemplate: + r"""Try using a preexisting variable or changing the assignment to a pattern variable declaration.""", + withArguments: _withArgumentsPatternAssignmentDeclaresVariable, + index: 145, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsPatternAssignmentDeclaresVariable(String name) { @@ -11145,14 +11061,13 @@ const MessageCode codeRepresentationFieldTrailingComma = const MessageCode( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeRequiredNamedParameterHasDefaultValueError = const Template< - Message Function(String name) ->( - "RequiredNamedParameterHasDefaultValueError", - problemMessageTemplate: - r"""Named parameter '#name' is required and can't have a default value.""", - withArguments: _withArgumentsRequiredNamedParameterHasDefaultValueError, -); +codeRequiredNamedParameterHasDefaultValueError = + const Template( + "RequiredNamedParameterHasDefaultValueError", + problemMessageTemplate: + r"""Named parameter '#name' is required and can't have a default value.""", + withArguments: _withArgumentsRequiredNamedParameterHasDefaultValueError, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsRequiredNamedParameterHasDefaultValueError(String name) { @@ -11277,15 +11192,14 @@ Message _withArgumentsSdkSummaryNotFound(Uri uri_) { // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeSealedClassSubtypeOutsideOfLibrary = const Template< - Message Function(String name) ->( - "SealedClassSubtypeOutsideOfLibrary", - problemMessageTemplate: - r"""The class '#name' can't be extended, implemented, or mixed in outside of its library because it's a sealed class.""", - withArguments: _withArgumentsSealedClassSubtypeOutsideOfLibrary, - analyzerCodes: ["SEALED_CLASS_SUBTYPE_OUTSIDE_OF_LIBRARY"], -); +codeSealedClassSubtypeOutsideOfLibrary = + const Template( + "SealedClassSubtypeOutsideOfLibrary", + problemMessageTemplate: + r"""The class '#name' can't be extended, implemented, or mixed in outside of its library because it's a sealed class.""", + withArguments: _withArgumentsSealedClassSubtypeOutsideOfLibrary, + analyzerCodes: ["SEALED_CLASS_SUBTYPE_OUTSIDE_OF_LIBRARY"], + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsSealedClassSubtypeOutsideOfLibrary(String name) { @@ -11419,16 +11333,17 @@ const MessageCode codeSetterWithWrongNumberOfFormals = const MessageCode( const Template< Message Function(int count, int count2, num _num1, num _num2, num _num3) > -codeSourceBodySummary = const Template< - Message Function(int count, int count2, num _num1, num _num2, num _num3) ->( - "SourceBodySummary", - problemMessageTemplate: - r"""Built bodies for #count compilation units (#count2 bytes) in #num1%.3ms, that is, +codeSourceBodySummary = + const Template< + Message Function(int count, int count2, num _num1, num _num2, num _num3) + >( + "SourceBodySummary", + problemMessageTemplate: + r"""Built bodies for #count compilation units (#count2 bytes) in #num1%.3ms, that is, #num2%12.3 bytes/ms, and #num3%12.3 ms/compilation unit.""", - withArguments: _withArgumentsSourceBodySummary, -); + withArguments: _withArgumentsSourceBodySummary, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsSourceBodySummary( @@ -11461,16 +11376,17 @@ ${num3} ms/compilation unit.""", const Template< Message Function(int count, int count2, num _num1, num _num2, num _num3) > -codeSourceOutlineSummary = const Template< - Message Function(int count, int count2, num _num1, num _num2, num _num3) ->( - "SourceOutlineSummary", - problemMessageTemplate: - r"""Built outlines for #count compilation units (#count2 bytes) in #num1%.3ms, that is, +codeSourceOutlineSummary = + const Template< + Message Function(int count, int count2, num _num1, num _num2, num _num3) + >( + "SourceOutlineSummary", + problemMessageTemplate: + r"""Built outlines for #count compilation units (#count2 bytes) in #num1%.3ms, that is, #num2%12.3 bytes/ms, and #num3%12.3 ms/compilation unit.""", - withArguments: _withArgumentsSourceOutlineSummary, -); + withArguments: _withArgumentsSourceOutlineSummary, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsSourceOutlineSummary( @@ -11592,17 +11508,16 @@ const MessageCode codeStaticTearOffFromInstantiatedClass = const MessageCode( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeSubtypeOfBaseIsNotBaseFinalOrSealed = const Template< - Message Function(String name, String name2) ->( - "SubtypeOfBaseIsNotBaseFinalOrSealed", - problemMessageTemplate: - r"""The type '#name' must be 'base', 'final' or 'sealed' because the supertype '#name2' is 'base'.""", - correctionMessageTemplate: - r"""Try adding 'base', 'final', or 'sealed' to the type.""", - withArguments: _withArgumentsSubtypeOfBaseIsNotBaseFinalOrSealed, - analyzerCodes: ["SUBTYPE_OF_BASE_IS_NOT_BASE_FINAL_OR_SEALED"], -); +codeSubtypeOfBaseIsNotBaseFinalOrSealed = + const Template( + "SubtypeOfBaseIsNotBaseFinalOrSealed", + problemMessageTemplate: + r"""The type '#name' must be 'base', 'final' or 'sealed' because the supertype '#name2' is 'base'.""", + correctionMessageTemplate: + r"""Try adding 'base', 'final', or 'sealed' to the type.""", + withArguments: _withArgumentsSubtypeOfBaseIsNotBaseFinalOrSealed, + analyzerCodes: ["SUBTYPE_OF_BASE_IS_NOT_BASE_FINAL_OR_SEALED"], + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsSubtypeOfBaseIsNotBaseFinalOrSealed( @@ -11625,17 +11540,16 @@ Message _withArgumentsSubtypeOfBaseIsNotBaseFinalOrSealed( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeSubtypeOfFinalIsNotBaseFinalOrSealed = const Template< - Message Function(String name, String name2) ->( - "SubtypeOfFinalIsNotBaseFinalOrSealed", - problemMessageTemplate: - r"""The type '#name' must be 'base', 'final' or 'sealed' because the supertype '#name2' is 'final'.""", - correctionMessageTemplate: - r"""Try adding 'base', 'final', or 'sealed' to the type.""", - withArguments: _withArgumentsSubtypeOfFinalIsNotBaseFinalOrSealed, - analyzerCodes: ["SUBTYPE_OF_FINAL_IS_NOT_BASE_FINAL_OR_SEALED"], -); +codeSubtypeOfFinalIsNotBaseFinalOrSealed = + const Template( + "SubtypeOfFinalIsNotBaseFinalOrSealed", + problemMessageTemplate: + r"""The type '#name' must be 'base', 'final' or 'sealed' because the supertype '#name2' is 'final'.""", + correctionMessageTemplate: + r"""Try adding 'base', 'final', or 'sealed' to the type.""", + withArguments: _withArgumentsSubtypeOfFinalIsNotBaseFinalOrSealed, + analyzerCodes: ["SUBTYPE_OF_FINAL_IS_NOT_BASE_FINAL_OR_SEALED"], + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsSubtypeOfFinalIsNotBaseFinalOrSealed( @@ -11695,14 +11609,13 @@ Message _withArgumentsSuperExtensionTypeIsIllegal(String name) { // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeSuperExtensionTypeIsTypeParameter = const Template< - Message Function(String name) ->( - "SuperExtensionTypeIsTypeParameter", - problemMessageTemplate: - r"""The type variable '#name' can't be implemented by an extension type.""", - withArguments: _withArgumentsSuperExtensionTypeIsTypeParameter, -); +codeSuperExtensionTypeIsTypeParameter = + const Template( + "SuperExtensionTypeIsTypeParameter", + problemMessageTemplate: + r"""The type variable '#name' can't be implemented by an extension type.""", + withArguments: _withArgumentsSuperExtensionTypeIsTypeParameter, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsSuperExtensionTypeIsTypeParameter(String name) { @@ -11774,15 +11687,14 @@ Message _withArgumentsSuperclassHasNoConstructor(String name) { // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeSuperclassHasNoDefaultConstructor = const Template< - Message Function(String name) ->( - "SuperclassHasNoDefaultConstructor", - problemMessageTemplate: - r"""The superclass, '#name', has no unnamed constructor that takes no arguments.""", - withArguments: _withArgumentsSuperclassHasNoDefaultConstructor, - analyzerCodes: ["NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT"], -); +codeSuperclassHasNoDefaultConstructor = + const Template( + "SuperclassHasNoDefaultConstructor", + problemMessageTemplate: + r"""The superclass, '#name', has no unnamed constructor that takes no arguments.""", + withArguments: _withArgumentsSuperclassHasNoDefaultConstructor, + analyzerCodes: ["NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT"], + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsSuperclassHasNoDefaultConstructor(String name) { @@ -12413,9 +12325,7 @@ Message _withArgumentsUnmatchedAugmentationClass(String name) { // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeUnmatchedAugmentationClassMember = const Template< - Message Function(String name) ->( +codeUnmatchedAugmentationClassMember = const Template( "UnmatchedAugmentationClassMember", problemMessageTemplate: r"""Augmentation member '#name' doesn't match a member in the augmented class.""", @@ -12440,9 +12350,7 @@ Message _withArgumentsUnmatchedAugmentationClassMember(String name) { // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeUnmatchedAugmentationConstructor = const Template< - Message Function(String name) ->( +codeUnmatchedAugmentationConstructor = const Template( "UnmatchedAugmentationConstructor", problemMessageTemplate: r"""Augmentation constructor '#name' doesn't match a constructor in the augmented class.""", @@ -12467,9 +12375,7 @@ Message _withArgumentsUnmatchedAugmentationConstructor(String name) { // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeUnmatchedAugmentationDeclaration = const Template< - Message Function(String name) ->( +codeUnmatchedAugmentationDeclaration = const Template( "UnmatchedAugmentationDeclaration", problemMessageTemplate: r"""Augmentation '#name' doesn't match a declaration in the augmented library.""", @@ -12494,9 +12400,7 @@ Message _withArgumentsUnmatchedAugmentationDeclaration(String name) { // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeUnmatchedAugmentationLibraryMember = const Template< - Message Function(String name) ->( +codeUnmatchedAugmentationLibraryMember = const Template( "UnmatchedAugmentationLibraryMember", problemMessageTemplate: r"""Augmentation member '#name' doesn't match a member in the augmented library.""", @@ -12817,16 +12721,15 @@ const MessageCode codeVarReturnType = const MessageCode( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeVariableCouldBeNullDueToWrite = const Template< - Message Function(String name, String string) ->( - "VariableCouldBeNullDueToWrite", - problemMessageTemplate: - r"""Variable '#name' could not be promoted due to an assignment.""", - correctionMessageTemplate: - r"""Try null checking the variable after the assignment. See #string""", - withArguments: _withArgumentsVariableCouldBeNullDueToWrite, -); +codeVariableCouldBeNullDueToWrite = + const Template( + "VariableCouldBeNullDueToWrite", + problemMessageTemplate: + r"""Variable '#name' could not be promoted due to an assignment.""", + correctionMessageTemplate: + r"""Try null checking the variable after the assignment. See #string""", + withArguments: _withArgumentsVariableCouldBeNullDueToWrite, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsVariableCouldBeNullDueToWrite( @@ -12930,16 +12833,15 @@ const MessageCode codeWeakReferenceTargetNotStaticTearoff = const MessageCode( // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template -codeWebLiteralCannotBeRepresentedExactly = const Template< - Message Function(String string, String string2) ->( - "WebLiteralCannotBeRepresentedExactly", - problemMessageTemplate: - r"""The integer literal #string can't be represented exactly in JavaScript.""", - correctionMessageTemplate: - r"""Try changing the literal to something that can be represented in JavaScript. In JavaScript #string2 is the nearest value that can be represented exactly.""", - withArguments: _withArgumentsWebLiteralCannotBeRepresentedExactly, -); +codeWebLiteralCannotBeRepresentedExactly = + const Template( + "WebLiteralCannotBeRepresentedExactly", + problemMessageTemplate: + r"""The integer literal #string can't be represented exactly in JavaScript.""", + correctionMessageTemplate: + r"""Try changing the literal to something that can be represented in JavaScript. In JavaScript #string2 is the nearest value that can be represented exactly.""", + withArguments: _withArgumentsWebLiteralCannotBeRepresentedExactly, + ); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. Message _withArgumentsWebLiteralCannotBeRepresentedExactly( diff --git a/pkg/_fe_analyzer_shared/lib/src/metadata/elements.dart b/pkg/_fe_analyzer_shared/lib/src/metadata/elements.dart index ccdce1eec52..c6a0c9b8083 100644 --- a/pkg/_fe_analyzer_shared/lib/src/metadata/elements.dart +++ b/pkg/_fe_analyzer_shared/lib/src/metadata/elements.dart @@ -58,11 +58,11 @@ class MapEntryElement extends Element { return newKey == null && newValue == null ? null : new MapEntryElement( - newKey ?? key, - newValue ?? value, - isNullAwareKey: isNullAwareKey, - isNullAwareValue: isNullAwareValue, - ); + newKey ?? key, + newValue ?? value, + isNullAwareKey: isNullAwareKey, + isNullAwareValue: isNullAwareValue, + ); } } @@ -103,10 +103,10 @@ class IfElement extends Element { return newCondition == null && newThen == null && newOtherwise == null ? null : new IfElement( - newCondition ?? condition, - newThen ?? then, - newOtherwise ?? otherwise, - ); + newCondition ?? condition, + newThen ?? then, + newOtherwise ?? otherwise, + ); } else { return newCondition == null && newThen == null ? null diff --git a/pkg/_fe_analyzer_shared/lib/src/metadata/evaluate.dart b/pkg/_fe_analyzer_shared/lib/src/metadata/evaluate.dart index c11a70fe00b..3bfc14ec9e3 100644 --- a/pkg/_fe_analyzer_shared/lib/src/metadata/evaluate.dart +++ b/pkg/_fe_analyzer_shared/lib/src/metadata/evaluate.dart @@ -526,10 +526,9 @@ class Evaluator { } default: Element? then = _visitElement(element.then); - Element? otherwise = - element.otherwise != null - ? _visitElement(element.otherwise!) - : null; + Element? otherwise = element.otherwise != null + ? _visitElement(element.otherwise!) + : null; if (then != null) { list.add(new IfElement(condition, then, otherwise)); } else if (otherwise != null) { @@ -637,10 +636,9 @@ class Evaluator { } default: Element? then = _visitElement(element.then); - Element? otherwise = - element.otherwise != null - ? _visitElement(element.otherwise!) - : null; + Element? otherwise = element.otherwise != null + ? _visitElement(element.otherwise!) + : null; if (then != null) { return new IfElement(condition, then, otherwise); } else if (otherwise != null) { diff --git a/pkg/_fe_analyzer_shared/lib/src/metadata/expressions.dart b/pkg/_fe_analyzer_shared/lib/src/metadata/expressions.dart index deab02cbd21..8e70d6456e0 100644 --- a/pkg/_fe_analyzer_shared/lib/src/metadata/expressions.dart +++ b/pkg/_fe_analyzer_shared/lib/src/metadata/expressions.dart @@ -85,10 +85,10 @@ class ConstructorInvocation extends Expression { return newType == null && newArguments == null ? null : new ConstructorInvocation( - newType ?? type, - constructor, - newArguments ?? arguments, - ); + newType ?? type, + constructor, + newArguments ?? arguments, + ); } } @@ -209,10 +209,10 @@ class ImplicitInvocation extends Expression { newArguments == null ? null : new ImplicitInvocation( - newReceiver ?? receiver, - newTypeArguments ?? typeArguments, - newArguments ?? arguments, - ); + newReceiver ?? receiver, + newTypeArguments ?? typeArguments, + newArguments ?? arguments, + ); } } @@ -235,10 +235,10 @@ class StaticInvocation extends Expression { return newTypeArguments == null && newArguments == null ? null : new StaticInvocation( - function, - newTypeArguments ?? typeArguments, - newArguments ?? arguments, - ); + function, + newTypeArguments ?? typeArguments, + newArguments ?? arguments, + ); } } @@ -260,9 +260,9 @@ class Instantiation extends Expression { return newReceiver == null && newTypeArguments == null ? null : new Instantiation( - newReceiver ?? receiver, - newTypeArguments ?? typeArguments, - ); + newReceiver ?? receiver, + newTypeArguments ?? typeArguments, + ); } } @@ -295,11 +295,11 @@ class MethodInvocation extends Expression { newArguments == null ? null : new MethodInvocation( - newReceiver ?? receiver, - name, - newTypeArguments ?? typeArguments, - newArguments ?? arguments, - ); + newReceiver ?? receiver, + name, + newTypeArguments ?? typeArguments, + newArguments ?? arguments, + ); } } @@ -389,10 +389,10 @@ class ConditionalExpression extends Expression { return newCondition == null && newThen == null && newOtherwise == null ? null : new ConditionalExpression( - newCondition ?? condition, - newThen ?? then, - newOtherwise ?? otherwise, - ); + newCondition ?? condition, + newThen ?? then, + newOtherwise ?? otherwise, + ); } } @@ -414,9 +414,9 @@ class ListLiteral extends Expression { return newTypeArguments == null && newElements == null ? null : new ListLiteral( - newTypeArguments ?? typeArguments, - newElements ?? elements, - ); + newTypeArguments ?? typeArguments, + newElements ?? elements, + ); } } @@ -438,9 +438,9 @@ class SetOrMapLiteral extends Expression { return newTypeArguments == null && newElements == null ? null : new SetOrMapLiteral( - newTypeArguments ?? typeArguments, - newElements ?? elements, - ); + newTypeArguments ?? typeArguments, + newElements ?? elements, + ); } } @@ -525,10 +525,10 @@ class EqualityExpression extends Expression { return newLeft == null && newRight == null ? null : new EqualityExpression( - newLeft ?? left, - newRight ?? right, - isNotEquals: isNotEquals, - ); + newLeft ?? left, + newRight ?? right, + isNotEquals: isNotEquals, + ); } } @@ -620,10 +620,10 @@ class IsTest extends Expression { return newType == null && newExpression == null ? null : new IsTest( - newExpression ?? expression, - newType ?? type, - isNot: isNot, - ); + newExpression ?? expression, + newType ?? type, + isNot: isNot, + ); } } diff --git a/pkg/_fe_analyzer_shared/lib/src/metadata/formal_parameters.dart b/pkg/_fe_analyzer_shared/lib/src/metadata/formal_parameters.dart index 1b6f710da32..63da0635c9b 100644 --- a/pkg/_fe_analyzer_shared/lib/src/metadata/formal_parameters.dart +++ b/pkg/_fe_analyzer_shared/lib/src/metadata/formal_parameters.dart @@ -44,13 +44,13 @@ class FormalParameter { resolvedDefaultValue == null ? null : new FormalParameter( - resolvedMetadata ?? metadata, - resolvedTypeAnnotation ?? typeAnnotation, - name, - resolvedDefaultValue ?? defaultValue, - isNamed: isNamed, - isRequired: isRequired, - ); + resolvedMetadata ?? metadata, + resolvedTypeAnnotation ?? typeAnnotation, + name, + resolvedDefaultValue ?? defaultValue, + isNamed: isNamed, + isRequired: isRequired, + ); } @override diff --git a/pkg/_fe_analyzer_shared/lib/src/metadata/parser.dart b/pkg/_fe_analyzer_shared/lib/src/metadata/parser.dart index 80c12c7ea9d..ab09048f09d 100644 --- a/pkg/_fe_analyzer_shared/lib/src/metadata/parser.dart +++ b/pkg/_fe_analyzer_shared/lib/src/metadata/parser.dart @@ -63,8 +63,9 @@ class AnnotationsListener extends StackListener { ]), ); List? arguments = pop(_NullValues.Arguments) as List?; - IdentifierProto? identifier = - periodBeforeName != null ? pop() as IdentifierProto : null; + IdentifierProto? identifier = periodBeforeName != null + ? pop() as IdentifierProto + : null; List? typeArguments = pop(_NullValues.TypeAnnotations) as List?; Proto proto = pop() as Proto; @@ -136,8 +137,9 @@ class AnnotationsListener extends StackListener { /* (qualified) name before type arguments */ _ValueKinds._Proto, ]), ); - IdentifierProto? constructorName = - periodBeforeName != null ? pop() as IdentifierProto : null; + IdentifierProto? constructorName = periodBeforeName != null + ? pop() as IdentifierProto + : null; List? typeArguments = pop(_NullValues.TypeAnnotations) as List?; Proto className = pop() as Proto; @@ -780,8 +782,9 @@ class AnnotationsListener extends StackListener { List? typeArguments = pop(_NullValues.TypeAnnotations) as List?; Proto type = pop() as Proto; - TypeAnnotation typeAnnotation = - type.instantiate(typeArguments).toTypeAnnotation(); + TypeAnnotation typeAnnotation = type + .instantiate(typeArguments) + .toTypeAnnotation(); if (questionMark != null) { typeAnnotation = new NullableTypeAnnotation(typeAnnotation); } @@ -1201,9 +1204,9 @@ class AnnotationsListener extends StackListener { leftBracket, hasNamedFields ? [ - _ValueKinds._RecordTypeEntries, - ...repeatedKind(_ValueKinds._RecordTypeEntry, count - 1), - ] + _ValueKinds._RecordTypeEntries, + ...repeatedKind(_ValueKinds._RecordTypeEntry, count - 1), + ] : repeatedKind(_ValueKinds._RecordTypeEntry, count), ), ); diff --git a/pkg/_fe_analyzer_shared/lib/src/metadata/proto.dart b/pkg/_fe_analyzer_shared/lib/src/metadata/proto.dart index 4c6320532f4..c2ef70fe0c5 100644 --- a/pkg/_fe_analyzer_shared/lib/src/metadata/proto.dart +++ b/pkg/_fe_analyzer_shared/lib/src/metadata/proto.dart @@ -1052,12 +1052,12 @@ class ConstructorProto extends Proto { Proto invoke(List? arguments) { return arguments != null ? new ExpressionProto( - new ConstructorInvocation( - new NamedTypeAnnotation(type, typeArguments), - reference, - arguments, - ), - ) + new ConstructorInvocation( + new NamedTypeAnnotation(type, typeArguments), + reference, + arguments, + ), + ) : this; } @@ -1141,8 +1141,8 @@ class FunctionProto extends Proto { Proto invoke(List? arguments) { return arguments != null ? new ExpressionProto( - new StaticInvocation(reference, const [], arguments), - ) + new StaticInvocation(reference, const [], arguments), + ) : this; } @@ -1185,8 +1185,8 @@ class FunctionInstantiationProto extends Proto { Proto invoke(List? arguments) { return arguments != null ? new ExpressionProto( - new StaticInvocation(reference, typeArguments, arguments), - ) + new StaticInvocation(reference, typeArguments, arguments), + ) : this; } @@ -1383,8 +1383,12 @@ class ExpressionInstantiationProto extends Proto { Proto invoke(List? arguments) { return arguments != null ? new ExpressionProto( - new ImplicitInvocation(receiver.toExpression(), const [], arguments), - ) + new ImplicitInvocation( + receiver.toExpression(), + const [], + arguments, + ), + ) : this; } @@ -1591,8 +1595,8 @@ class ExpressionProto extends Proto { Proto invoke(List? arguments) { return arguments != null ? new ExpressionProto( - new ImplicitInvocation(expression, const [], arguments), - ) + new ImplicitInvocation(expression, const [], arguments), + ) : this; } @@ -1633,8 +1637,8 @@ class FunctionTypeParameterProto extends Proto { Proto invoke(List? arguments) { return arguments != null ? new ExpressionProto( - new ImplicitInvocation(toExpression(), const [], arguments), - ) + new ImplicitInvocation(toExpression(), const [], arguments), + ) : this; } diff --git a/pkg/_fe_analyzer_shared/lib/src/metadata/type_annotations.dart b/pkg/_fe_analyzer_shared/lib/src/metadata/type_annotations.dart index 24041c48ab6..bbf1e27378a 100644 --- a/pkg/_fe_analyzer_shared/lib/src/metadata/type_annotations.dart +++ b/pkg/_fe_analyzer_shared/lib/src/metadata/type_annotations.dart @@ -181,10 +181,10 @@ class FunctionTypeAnnotation extends TypeAnnotation { resolvedTypeParameters == null ? null : new FunctionTypeAnnotation( - resolvedReturnType ?? returnType, - resolvedTypeParameters ?? typeParameters, - resolvedFormalParameters ?? formalParameters, - ); + resolvedReturnType ?? returnType, + resolvedTypeParameters ?? typeParameters, + resolvedFormalParameters ?? formalParameters, + ); } } @@ -241,9 +241,9 @@ class RecordTypeAnnotation extends TypeAnnotation { return resolvedPositional == null && resolvedNamed == null ? null : new RecordTypeAnnotation( - resolvedPositional ?? positional, - resolvedNamed ?? named, - ); + resolvedPositional ?? positional, + resolvedNamed ?? named, + ); } } @@ -262,10 +262,10 @@ class RecordTypeEntry { return resolvedMetadata == null && resolvedTypeAnnotation == null ? null : new RecordTypeEntry( - resolvedMetadata ?? metadata, - resolvedTypeAnnotation ?? typeAnnotation, - name, - ); + resolvedMetadata ?? metadata, + resolvedTypeAnnotation ?? typeAnnotation, + name, + ); } @override diff --git a/pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart b/pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart index ec826eac6b5..3e12a164a9a 100644 --- a/pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart +++ b/pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart @@ -2090,11 +2090,10 @@ class Parser { if (isModifier(next)) { // Recovery - ModifierContext context = - new ModifierContext(this) - ..covariantToken = covariantToken - ..requiredToken = requiredToken - ..varFinalOrConst = varFinalOrConst; + ModifierContext context = new ModifierContext(this) + ..covariantToken = covariantToken + ..requiredToken = requiredToken + ..varFinalOrConst = varFinalOrConst; token = context.parseFormalParameterModifiers( token, @@ -3800,12 +3799,11 @@ class Parser { // If another `var`, `final`, or `const` then fall through // to parse that as part of the next top level declaration. } else { - ModifierContext context = - new ModifierContext(this) - ..externalToken = externalToken - ..augmentToken = augmentToken - ..lateToken = lateToken - ..varFinalOrConst = varFinalOrConst; + ModifierContext context = new ModifierContext(this) + ..externalToken = externalToken + ..augmentToken = augmentToken + ..lateToken = lateToken + ..varFinalOrConst = varFinalOrConst; token = context.parseTopLevelMemberModifiers(token); next = token.next!; @@ -4060,16 +4058,14 @@ class Parser { Token token = typeInfo.parseType(beforeType, this); assert(token.next == name || token.next!.isEof); - IdentifierContext context = - kind == DeclarationKind.TopLevel - ? IdentifierContext.topLevelVariableDeclaration - : IdentifierContext.fieldDeclaration; - Token firstName = - name = ensureIdentifierPotentiallyRecovered( - token, - context, - /* isRecovered = */ nameIsRecovered, - ); + IdentifierContext context = kind == DeclarationKind.TopLevel + ? IdentifierContext.topLevelVariableDeclaration + : IdentifierContext.fieldDeclaration; + Token firstName = name = ensureIdentifierPotentiallyRecovered( + token, + context, + /* isRecovered = */ nameIsRecovered, + ); // Check for covariant late final with initializer. if (covariantToken != null && lateToken != null) { @@ -4965,15 +4961,14 @@ class Parser { } } if (isModifier(next)) { - ModifierContext context = - new ModifierContext(this) - ..covariantToken = covariantToken - ..augmentToken = augmentToken - ..externalToken = externalToken - ..lateToken = lateToken - ..staticToken = staticToken - ..varFinalOrConst = varFinalOrConst - ..abstractToken = abstractToken; + ModifierContext context = new ModifierContext(this) + ..covariantToken = covariantToken + ..augmentToken = augmentToken + ..externalToken = externalToken + ..lateToken = lateToken + ..staticToken = staticToken + ..varFinalOrConst = varFinalOrConst + ..abstractToken = abstractToken; token = context.parseClassMemberModifiers(token); next = token.next!; @@ -5414,20 +5409,17 @@ class Parser { case DeclarationKind.Class: case DeclarationKind.Mixin: case DeclarationKind.Enum: - memberKind = - staticToken != null - ? MemberKind.StaticMethod - : MemberKind.NonStaticMethod; + memberKind = staticToken != null + ? MemberKind.StaticMethod + : MemberKind.NonStaticMethod; case DeclarationKind.Extension: - memberKind = - staticToken != null - ? MemberKind.ExtensionStaticMethod - : MemberKind.ExtensionNonStaticMethod; + memberKind = staticToken != null + ? MemberKind.ExtensionStaticMethod + : MemberKind.ExtensionNonStaticMethod; case DeclarationKind.ExtensionType: - memberKind = - staticToken != null - ? MemberKind.ExtensionTypeStaticMethod - : MemberKind.ExtensionTypeNonStaticMethod; + memberKind = staticToken != null + ? MemberKind.ExtensionTypeStaticMethod + : MemberKind.ExtensionTypeNonStaticMethod; } Token beforeParam = token; @@ -5648,11 +5640,10 @@ class Parser { if (!isValidNonRecordTypeReference(token.next!)) { // Recovery - ModifierContext context = - new ModifierContext(this) - ..externalToken = externalToken - ..staticOrCovariant = staticOrCovariant - ..varFinalOrConst = varFinalOrConst; + ModifierContext context = new ModifierContext(this) + ..externalToken = externalToken + ..staticOrCovariant = staticOrCovariant + ..varFinalOrConst = varFinalOrConst; token = context.parseModifiersAfterFactory(token); @@ -5859,11 +5850,10 @@ class Parser { ) { Token token = beforeName.next!; listener.beginFunctionName(token); - token = - ensureIdentifier( - beforeName, - IdentifierContext.localFunctionDeclaration, - ).next!; + token = ensureIdentifier( + beforeName, + IdentifierContext.localFunctionDeclaration, + ).next!; if (isFunctionExpression) { reportRecoverableError( beforeName.next!, @@ -6446,15 +6436,14 @@ class Parser { if (allowPatterns && looksLikeOuterPatternEquals(token)) { token = parsePatternAssignment(token); } else { - token = - token.next!.isA(Keyword.THROW) - ? parseThrowExpression(token, /* allowCascades = */ true) - : parsePrecedenceExpression( - token, - ASSIGNMENT_PRECEDENCE, - /* allowCascades = */ true, - ConstantPatternContext.none, - ); + token = token.next!.isA(Keyword.THROW) + ? parseThrowExpression(token, /* allowCascades = */ true) + : parsePrecedenceExpression( + token, + ASSIGNMENT_PRECEDENCE, + /* allowCascades = */ true, + ConstantPatternContext.none, + ); } } expressionDepth--; @@ -6465,11 +6454,11 @@ class Parser { return token.next!.isA(Keyword.THROW) ? parseThrowExpression(token, /* allowCascades = */ false) : parsePrecedenceExpression( - token, - ASSIGNMENT_PRECEDENCE, - /* allowCascades = */ false, - ConstantPatternContext.none, - ); + token, + ASSIGNMENT_PRECEDENCE, + /* allowCascades = */ false, + ConstantPatternContext.none, + ); } bool canParseAsConditional(Token question) { @@ -6727,15 +6716,14 @@ class Parser { ); operator = next; } - token = - next.next!.isA(Keyword.THROW) - ? parseThrowExpression(next, allowCascades) - : parsePrecedenceExpression( - next, - level, - allowCascades, - ConstantPatternContext.none, - ); + token = next.next!.isA(Keyword.THROW) + ? parseThrowExpression(next, allowCascades) + : parsePrecedenceExpression( + next, + level, + allowCascades, + ConstantPatternContext.none, + ); listener.handleAssignmentExpression(operator, token); } else if (tokenLevel == POSTFIX_PRECEDENCE) { if ((identical(type, TokenType.PLUS_PLUS)) || @@ -7305,7 +7293,7 @@ class Parser { while (true) { bool potentialNullAware = (next.isA(TokenType.QUESTION) && - next.next!.isA(TokenType.OPEN_SQUARE_BRACKET)); + next.next!.isA(TokenType.OPEN_SQUARE_BRACKET)); if (potentialNullAware && !checkedNullAware) { // While it's a potential null aware index it hasn't been checked. // It might be a conditional expression. @@ -7663,11 +7651,10 @@ class Parser { next.isA(TokenType.COLON)) { // Record with named expression. wasRecord = true; - token = - ensureIdentifier( - token, - IdentifierContext.namedRecordFieldReference, - ).next!; + token = ensureIdentifier( + token, + IdentifierContext.namedRecordFieldReference, + ).next!; colon = token; wasValidRecord = true; } @@ -7884,10 +7871,9 @@ class Parser { // This looks like the start of an expression. // Report an error, insert the comma, and continue parsing. SyntheticToken comma = new SyntheticToken(TokenType.COMMA, next.offset); - codes.Message message = - ifCount > 0 - ? codes.codeExpectedElseOrComma - : codes.codeExpectedButGot.withArguments(','); + codes.Message message = ifCount > 0 + ? codes.codeExpectedElseOrComma + : codes.codeExpectedButGot.withArguments(','); next = rewriteAndRecover(token, message, comma); } token = next; @@ -7969,8 +7955,9 @@ class Parser { Token? nullAwareValueToken; Token next = token.next!; if (next.isA(TokenType.QUESTION_PERIOD)) { - token = - nullAwareValueToken = _splitFollowingQuestionPeriod(token); + token = nullAwareValueToken = _splitFollowingQuestionPeriod( + token, + ); } else if (next.isA(TokenType.QUESTION)) { token = nullAwareValueToken = next; } @@ -8024,10 +8011,9 @@ class Parser { TokenType.COMMA, next.offset, ); - codes.Message message = - ifCount > 0 - ? codes.codeExpectedElseOrComma - : codes.codeExpectedButGot.withArguments(','); + codes.Message message = ifCount > 0 + ? codes.codeExpectedElseOrComma + : codes.codeExpectedButGot.withArguments(','); token = rewriteAndRecover(token, message, comma); } else { reportRecoverableError( @@ -8884,11 +8870,10 @@ class Parser { Token? colon = null; if (next.next!.isA(TokenType.COLON) || /* recovery */ next.isA(TokenType.COLON)) { - token = - ensureIdentifier( - token, - IdentifierContext.namedArgumentReference, - ).next!; + token = ensureIdentifier( + token, + IdentifierContext.namedArgumentReference, + ).next!; colon = token; } bool expressionHandled = false; @@ -9200,10 +9185,9 @@ class Parser { if (isModifier(next)) { // Recovery - ModifierContext context = - new ModifierContext(this) - ..lateToken = lateToken - ..varFinalOrConst = varFinalOrConst; + ModifierContext context = new ModifierContext(this) + ..lateToken = lateToken + ..varFinalOrConst = varFinalOrConst; token = context.parseVariableDeclarationModifiers(token); next = token.next!; @@ -9345,8 +9329,9 @@ class Parser { UndoableTokenStreamRewriter undoableTokenStreamRewriter = new UndoableTokenStreamRewriter(); cachedRewriter = undoableTokenStreamRewriter; - Token afterExpression = - parseExpressionWithoutCascade(afterIdentifier).next!; + Token afterExpression = parseExpressionWithoutCascade( + afterIdentifier, + ).next!; // Undo all changes and reset. undoableTokenStreamRewriter.undo(); listener = originalListener; @@ -9601,11 +9586,10 @@ class Parser { token = rewriter.insertSyntheticToken(token, TokenType.SEMICOLON); } - openParen.endGroup = - token = rewriter.insertToken( - token, - new SyntheticToken(TokenType.CLOSE_PAREN, leftParenthesis.offset), - ); + openParen.endGroup = token = rewriter.insertToken( + token, + new SyntheticToken(TokenType.CLOSE_PAREN, leftParenthesis.offset), + ); token = rewriter.insertSyntheticIdentifier(token); rewriter.insertSyntheticToken(token, TokenType.SEMICOLON); @@ -10054,10 +10038,9 @@ class Parser { ), ); } - token = - allowCascades - ? parseExpression(throwToken) - : parseExpressionWithoutCascade(throwToken); + token = allowCascades + ? parseExpression(throwToken) + : parseExpressionWithoutCascade(throwToken); listener.handleThrowExpression(throwToken, token); return token; } @@ -11560,11 +11543,10 @@ class Parser { // `((:a, :b), :c, :d)` (and similar) is fine. // Record with named expression. wasRecord = true; - token = - ensureIdentifier( - token, - IdentifierContext.namedRecordFieldReference, - ).next!; + token = ensureIdentifier( + token, + IdentifierContext.namedRecordFieldReference, + ).next!; colon = token; wasValidRecord = true; } @@ -11631,11 +11613,10 @@ class Parser { // This is different from `parseParenthesizedPatternOrRecordPattern` // because this isn't valid because of the missing name: // `var Point((:x, :y), :z) = Point((x: 1, y: 2), 3);` - token = - ensureIdentifier( - token, - IdentifierContext.namedArgumentReference, - ).next!; + token = ensureIdentifier( + token, + IdentifierContext.namedArgumentReference, + ).next!; colon = token; } token = parsePattern(token, patternContext); diff --git a/pkg/_fe_analyzer_shared/lib/src/parser/parser_main.dart b/pkg/_fe_analyzer_shared/lib/src/parser/parser_main.dart index 681b7316bd3..8da5b838c29 100644 --- a/pkg/_fe_analyzer_shared/lib/src/parser/parser_main.dart +++ b/pkg/_fe_analyzer_shared/lib/src/parser/parser_main.dart @@ -36,11 +36,12 @@ mainEntryPoint(List arguments) async { for (String argument in arguments) { if (argument.startsWith("@")) { Uri uri = Uri.base.resolve(argument.substring(/* start = */ 1)); - await for (String file in new File.fromUri(uri) - .openRead() - .cast>() - .transform(utf8.decoder) - .transform(const LineSplitter())) { + await for (String file + in new File.fromUri(uri) + .openRead() + .cast>() + .transform(utf8.decoder) + .transform(const LineSplitter())) { outLine(uri.resolve(file)); } } else { diff --git a/pkg/_fe_analyzer_shared/lib/src/parser/quote.dart b/pkg/_fe_analyzer_shared/lib/src/parser/quote.dart index f5da12f2b93..e08ba493184 100644 --- a/pkg/_fe_analyzer_shared/lib/src/parser/quote.dart +++ b/pkg/_fe_analyzer_shared/lib/src/parser/quote.dart @@ -180,27 +180,25 @@ String unescape( switch (quote) { case Quote.Single: case Quote.Double: - result = - !string.contains("\\") - ? string - : unescapeCodeUnits( - string.codeUnits, - /* isRaw = */ false, - location, - listener, - ); + result = !string.contains("\\") + ? string + : unescapeCodeUnits( + string.codeUnits, + /* isRaw = */ false, + location, + listener, + ); break; case Quote.MultiLineSingle: case Quote.MultiLineDouble: - result = - !string.contains("\\") && !string.contains("\r") - ? string - : unescapeCodeUnits( - string.codeUnits, - /* isRaw = */ false, - location, - listener, - ); + result = !string.contains("\\") && !string.contains("\r") + ? string + : unescapeCodeUnits( + string.codeUnits, + /* isRaw = */ false, + location, + listener, + ); break; case Quote.RawSingle: case Quote.RawDouble: @@ -208,15 +206,14 @@ String unescape( break; case Quote.RawMultiLineSingle: case Quote.RawMultiLineDouble: - result = - !string.contains("\r") - ? string - : unescapeCodeUnits( - string.codeUnits, - /* isRaw = */ true, - location, - listener, - ); + result = !string.contains("\r") + ? string + : unescapeCodeUnits( + string.codeUnits, + /* isRaw = */ true, + location, + listener, + ); break; } return considerCanonicalizeString(result); diff --git a/pkg/_fe_analyzer_shared/lib/src/parser/token_stream_rewriter.dart b/pkg/_fe_analyzer_shared/lib/src/parser/token_stream_rewriter.dart index fcd6eb0d922..5b1152968e8 100644 --- a/pkg/_fe_analyzer_shared/lib/src/parser/token_stream_rewriter.dart +++ b/pkg/_fe_analyzer_shared/lib/src/parser/token_stream_rewriter.dart @@ -38,8 +38,10 @@ abstract class TokenStreamRewriter { Token next = token.next!; int offset = next.charOffset; - BeginToken leftParen = - next = new SyntheticBeginToken(TokenType.OPEN_PAREN, offset); + BeginToken leftParen = next = new SyntheticBeginToken( + TokenType.OPEN_PAREN, + offset, + ); if (includeIdentifier) { next = _setNext( next, diff --git a/pkg/_fe_analyzer_shared/lib/src/parser/type_info_impl.dart b/pkg/_fe_analyzer_shared/lib/src/parser/type_info_impl.dart index a7f65a9cfc2..536b0e6d0bd 100644 --- a/pkg/_fe_analyzer_shared/lib/src/parser/type_info_impl.dart +++ b/pkg/_fe_analyzer_shared/lib/src/parser/type_info_impl.dart @@ -579,15 +579,15 @@ class ComplexTypeInfo implements TypeInfo { return beforeQuestionMark == null ? this : new ComplexTypeInfo._nonNullable( - start, - typeArguments, - beforeQuestionMark, - typeVariableStarters, - gftHasReturnType, - isRecordType, - gftReturnTypeHasRecordType, - recovered, - ); + start, + typeArguments, + beforeQuestionMark, + typeVariableStarters, + gftHasReturnType, + isRecordType, + gftReturnTypeHasRecordType, + recovered, + ); } @override @@ -1677,10 +1677,9 @@ class ComplexTypeParamOrArgInfo extends TypeParamOrArgInfo { // but ensure that parser events are ignored by replacing the listener. final Listener originalListener = parser.listener; parser.listener = new ForwardingListener(); - token = - isArguments - ? invalidTypeVar.parseArguments(token, parser) - : invalidTypeVar.parseVariables(token, parser); + token = isArguments + ? invalidTypeVar.parseArguments(token, parser) + : invalidTypeVar.parseVariables(token, parser); next = token.next!; parser.listener = originalListener; diff --git a/pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart b/pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart index d4de474cbcc..f4f26ec9f6c 100644 --- a/pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart +++ b/pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart @@ -1516,8 +1516,9 @@ abstract class AbstractScanner implements Scanner { advance(); return tokenizeFractionPart(nextnext, start, hasSeparators); } else { - TokenType tokenType = - hasSeparators ? TokenType.INT_WITH_SEPARATORS : TokenType.INT; + TokenType tokenType = hasSeparators + ? TokenType.INT_WITH_SEPARATORS + : TokenType.INT; appendSubstringToken(tokenType, start, /* asciiOnly = */ true); return next; } @@ -1532,8 +1533,9 @@ abstract class AbstractScanner implements Scanner { ), ); } - TokenType tokenType = - hasSeparators ? TokenType.INT_WITH_SEPARATORS : TokenType.INT; + TokenType tokenType = hasSeparators + ? TokenType.INT_WITH_SEPARATORS + : TokenType.INT; appendSubstringToken(tokenType, start, /* asciiOnly = */ true); return next; } @@ -1598,10 +1600,9 @@ abstract class AbstractScanner implements Scanner { ), ); } - TokenType tokenType = - hasSeparators - ? TokenType.HEXADECIMAL_WITH_SEPARATORS - : TokenType.HEXADECIMAL; + TokenType tokenType = hasSeparators + ? TokenType.HEXADECIMAL_WITH_SEPARATORS + : TokenType.HEXADECIMAL; appendSubstringToken(tokenType, start, /* asciiOnly = */ true); return next; } @@ -1744,8 +1745,9 @@ abstract class AbstractScanner implements Scanner { } next = advance(); } - TokenType tokenType = - hasSeparators ? TokenType.DOUBLE_WITH_SEPARATORS : TokenType.DOUBLE; + TokenType tokenType = hasSeparators + ? TokenType.DOUBLE_WITH_SEPARATORS + : TokenType.DOUBLE; appendSubstringToken(tokenType, start, /* asciiOnly = */ true); return next; } diff --git a/pkg/_fe_analyzer_shared/lib/src/scanner/scanner.dart b/pkg/_fe_analyzer_shared/lib/src/scanner/scanner.dart index a1b521d9eca..731b4fb019d 100644 --- a/pkg/_fe_analyzer_shared/lib/src/scanner/scanner.dart +++ b/pkg/_fe_analyzer_shared/lib/src/scanner/scanner.dart @@ -72,8 +72,8 @@ ScannerResult scan( // If there was a single missing `}` and the scanner can identify a good // candidate for better recovery, create a new scanner and instruct it to // do that recovery. - int? offsetForCurlyBracketRecoveryStart = - scanner.getOffsetForCurlyBracketRecoveryStart(); + int? offsetForCurlyBracketRecoveryStart = scanner + .getOffsetForCurlyBracketRecoveryStart(); if (offsetForCurlyBracketRecoveryStart != null) { scanner = new Utf8BytesScanner( bytes, @@ -108,8 +108,8 @@ ScannerResult scanString( // If there was a single missing `}` and the scanner can identify a good // candidate for better recovery, create a new scanner and instruct it to // do that recovery. - int? offsetForCurlyBracketRecoveryStart = - scanner.getOffsetForCurlyBracketRecoveryStart(); + int? offsetForCurlyBracketRecoveryStart = scanner + .getOffsetForCurlyBracketRecoveryStart(); if (offsetForCurlyBracketRecoveryStart != null) { scanner = new StringScanner( source, diff --git a/pkg/_fe_analyzer_shared/lib/src/scanner/string_scanner.dart b/pkg/_fe_analyzer_shared/lib/src/scanner/string_scanner.dart index 0fd08af667a..9b29939bac0 100644 --- a/pkg/_fe_analyzer_shared/lib/src/scanner/string_scanner.dart +++ b/pkg/_fe_analyzer_shared/lib/src/scanner/string_scanner.dart @@ -172,12 +172,11 @@ class StringScanner extends AbstractScanner { bool asciiOnly, String syntheticChars, ) { - String value = - syntheticChars.length == 0 - ? canonicalizeSubString(_string, start, scanOffset) - : canonicalizeString( - _string.substring(start, scanOffset) + syntheticChars, - ); + String value = syntheticChars.length == 0 + ? canonicalizeSubString(_string, start, scanOffset) + : canonicalizeString( + _string.substring(start, scanOffset) + syntheticChars, + ); return new SyntheticStringToken( type, value, diff --git a/pkg/_fe_analyzer_shared/lib/src/scanner/token_impl.dart b/pkg/_fe_analyzer_shared/lib/src/scanner/token_impl.dart index 60dae34c383..bdc50d08f0e 100644 --- a/pkg/_fe_analyzer_shared/lib/src/scanner/token_impl.dart +++ b/pkg/_fe_analyzer_shared/lib/src/scanner/token_impl.dart @@ -66,10 +66,9 @@ class StringTokenImpl extends SimpleToken implements StringToken { }) : super(type, charOffset, precedingComments) { int length = end - start; if (!allowLazy || length <= LAZY_THRESHOLD) { - valueOrLazySubstring = - canonicalize - ? canonicalizeSubString(data, start, end) - : data.substring(start, end); + valueOrLazySubstring = canonicalize + ? canonicalizeSubString(data, start, end) + : data.substring(start, end); } else { valueOrLazySubstring = new _LazySubstring( data, diff --git a/pkg/_fe_analyzer_shared/lib/src/scanner/utf8_bytes_scanner.dart b/pkg/_fe_analyzer_shared/lib/src/scanner/utf8_bytes_scanner.dart index 5dd82d01282..2b06a8d47d5 100644 --- a/pkg/_fe_analyzer_shared/lib/src/scanner/utf8_bytes_scanner.dart +++ b/pkg/_fe_analyzer_shared/lib/src/scanner/utf8_bytes_scanner.dart @@ -510,13 +510,11 @@ class Utf8BytesScanner extends AbstractScanner { bool asciiOnly, String syntheticChars, ) { - String value = - syntheticChars.length == 0 - ? canonicalizeUtf8SubString(_bytes, start, byteOffset, asciiOnly) - : canonicalizeString( - decodeString(_bytes, start, byteOffset, asciiOnly) + - syntheticChars, - ); + String value = syntheticChars.length == 0 + ? canonicalizeUtf8SubString(_bytes, start, byteOffset, asciiOnly) + : canonicalizeString( + decodeString(_bytes, start, byteOffset, asciiOnly) + syntheticChars, + ); return new SyntheticStringToken( type, value, diff --git a/pkg/_fe_analyzer_shared/lib/src/testing/annotated_code_helper.dart b/pkg/_fe_analyzer_shared/lib/src/testing/annotated_code_helper.dart index 03ef5a23470..5d10f6e234d 100644 --- a/pkg/_fe_analyzer_shared/lib/src/testing/annotated_code_helper.dart +++ b/pkg/_fe_analyzer_shared/lib/src/testing/annotated_code_helper.dart @@ -263,23 +263,23 @@ class AnnotatedCode { String toText() { StringBuffer sb = new StringBuffer(); - List list = - annotations.toList()..sort((a, b) { - int result = a.offset.compareTo(b.offset); - if (result == 0) { - if (a.index != null && b.index != null) { - result = a.index!.compareTo(b.index!); - } else if (a.index != null) { - result = -1; - } else if (b.index != null) { - result = 1; - } + List list = annotations.toList() + ..sort((a, b) { + int result = a.offset.compareTo(b.offset); + if (result == 0) { + if (a.index != null && b.index != null) { + result = a.index!.compareTo(b.index!); + } else if (a.index != null) { + result = -1; + } else if (b.index != null) { + result = 1; } - if (result == 0) { - result = annotations.indexOf(a).compareTo(annotations.indexOf(b)); - } - return result; - }); + } + if (result == 0) { + result = annotations.indexOf(a).compareTo(annotations.indexOf(b)); + } + return result; + }); int offset = 0; for (Annotation annotation in list) { sb.write(sourceCode.substring(offset, annotation.offset)); diff --git a/pkg/_fe_analyzer_shared/lib/src/testing/id_generation.dart b/pkg/_fe_analyzer_shared/lib/src/testing/id_generation.dart index 4a1ca15e12a..08ed2f241cf 100644 --- a/pkg/_fe_analyzer_shared/lib/src/testing/id_generation.dart +++ b/pkg/_fe_analyzer_shared/lib/src/testing/id_generation.dart @@ -50,8 +50,8 @@ Map> computeAnnotationsPerUri( dataMap.forEach((Id id, ActualData data) { Map>> actualDataPerId = actualDataPerUri[uri] ??= {}; - Map> actualDataPerMarker = - actualDataPerId[id] ??= {}; + Map> actualDataPerMarker = actualDataPerId[id] ??= + {}; actualDataPerMarker[marker] = data; }); }); @@ -164,10 +164,9 @@ List _computeAnnotations( ); } - Set idSet = - {} - ..addAll(idValuePerId.keys) - ..addAll(actualDataPerId.keys); + Set idSet = {} + ..addAll(idValuePerId.keys) + ..addAll(actualDataPerId.keys); List result = []; for (Id id in idSet) { Map idValuePerMarker = idValuePerId[id] ?? {}; @@ -203,10 +202,9 @@ List _computeAnnotations( actualAnnotation = createAnnotationFromData(actualData, null); } } - Annotation? annotation = - createDiff != null - ? createDiff(expectedAnnotation, actualAnnotation) - : actualAnnotation; + Annotation? annotation = createDiff != null + ? createDiff(expectedAnnotation, actualAnnotation) + : actualAnnotation; if (annotation != null) { newAnnotationsPerMarker[marker] = annotation; } diff --git a/pkg/_fe_analyzer_shared/lib/src/testing/id_testing.dart b/pkg/_fe_analyzer_shared/lib/src/testing/id_testing.dart index 897a4ccad90..960bd6ced7c 100644 --- a/pkg/_fe_analyzer_shared/lib/src/testing/id_testing.dart +++ b/pkg/_fe_analyzer_shared/lib/src/testing/id_testing.dart @@ -270,9 +270,10 @@ TestData computeTestData( } else if (testFile is Directory) { testName = testFileUri.pathSegments[testFileUri.pathSegments.length - 2]; additionalFiles = new Map(); - for (FileSystemEntity entry in testFile - .listSync(recursive: true) - .where((entity) => !entity.path.endsWith('~'))) { + for (FileSystemEntity entry + in testFile + .listSync(recursive: true) + .where((entity) => !entity.path.endsWith('~'))) { if (entry is! File) continue; if (entry.uri.pathSegments.last == "main.dart") { mainTestFile = entry; @@ -572,9 +573,9 @@ Future> checkCode( succinct ? 'EXTRA $modeName DATA for ${id.descriptor}' : 'EXTRA $modeName DATA for ${id.descriptor}:\n ' - 'object : ${actualData.objectText}\n ' - 'actual : ${colorizeActual(actualValueText)}\n ' - 'Data was expected for these ids: ${expectedMap.keys}', + 'object : ${actualData.objectText}\n ' + 'actual : ${colorizeActual(actualValueText)}\n ' + 'Data was expected for these ids: ${expectedMap.keys}', succinct: succinct, ); if (filterActualData == null || filterActualData(null, actualData)) { @@ -595,10 +596,10 @@ Future> checkCode( succinct ? 'UNEXPECTED $modeName DATA for ${id.descriptor}' : 'UNEXPECTED $modeName DATA for ${id.descriptor}:\n ' - 'detail : ${colorizeMessage(unexpectedMessage)}\n ' - 'object : ${actualData.objectText}\n ' - 'expected: ${colorizeExpected('$expected')}\n ' - 'actual : ${colorizeActual(actualValueText)}', + 'detail : ${colorizeMessage(unexpectedMessage)}\n ' + 'object : ${actualData.objectText}\n ' + 'expected: ${colorizeExpected('$expected')}\n ' + 'actual : ${colorizeActual(actualValueText)}', succinct: succinct, ); if (filterActualData == null || @@ -943,16 +944,15 @@ Future runTests( String relativeDir = dataDir.uri.path.replaceAll(Uri.base.path, ''); print('Data dir: ${relativeDir}'); - List entities = - dataDir - .listSync() - .where( - (entity) => - !entity.path.endsWith('~') && - !entity.path.endsWith('marker.options') && - !entity.path.endsWith('.expect'), - ) - .toList(); + List entities = dataDir + .listSync() + .where( + (entity) => + !entity.path.endsWith('~') && + !entity.path.endsWith('marker.options') && + !entity.path.endsWith('.expect'), + ) + .toList(); if (shards > 1) { entities.sort((a, b) => getTestName(a).compareTo(getTestName(b))); int start = entities.length * shardIndex ~/ shards; @@ -1045,8 +1045,8 @@ Future runTests( // invalid uris. return; } - Map> actualDataPerId = - actualDataPerUri[uri] ??= {}; + Map> actualDataPerId = actualDataPerUri[uri] ??= + {}; actualDataPerId.addAll(actualData); } diff --git a/pkg/_fe_analyzer_shared/lib/src/type_inference/shared_inference_log.dart b/pkg/_fe_analyzer_shared/lib/src/type_inference/shared_inference_log.dart index 380987c4266..d64dcc2e64c 100644 --- a/pkg/_fe_analyzer_shared/lib/src/type_inference/shared_inference_log.dart +++ b/pkg/_fe_analyzer_shared/lib/src/type_inference/shared_inference_log.dart @@ -371,10 +371,9 @@ abstract class SharedInferenceLogWriterImpl List nodeSetDescriptions = [ for (Object? node in state.nodeSet) describe(node), ]; - String nodeSetDescription = - nodeSetDescriptions.length == 1 - ? nodeSetDescriptions[0] - : nodeSetDescriptions.join(', '); + String nodeSetDescription = nodeSetDescriptions.length == 1 + ? nodeSetDescriptions[0] + : nodeSetDescriptions.join(', '); fail( '${describeMethod()}: expected containing node to be ' '${describe(expectedNode)}, actual is $nodeSetDescription', @@ -790,8 +789,9 @@ abstract class SharedInferenceLogWriterImpl expectedNode: expression, expectedKind: StateKind.expression, ); - String query = - target != null ? '${describe(target)}.$methodName' : methodName; + String query = target != null + ? '${describe(target)}.$methodName' + : methodName; addEvent(new Event(message: 'LOOKUP $query FINDS $type')); } diff --git a/pkg/_fe_analyzer_shared/lib/src/type_inference/type_analysis_result.dart b/pkg/_fe_analyzer_shared/lib/src/type_inference/type_analysis_result.dart index 1abfa6130d1..a3769e62e31 100644 --- a/pkg/_fe_analyzer_shared/lib/src/type_inference/type_analysis_result.dart +++ b/pkg/_fe_analyzer_shared/lib/src/type_inference/type_analysis_result.dart @@ -213,14 +213,14 @@ class MatchContext< /// [TypeAnalyzerErrors.refutablePatternInIrrefutableContext]. MatchContext makeRefutable() => irrefutableContext == null - ? this - : new MatchContext( - isFinal: isFinal, - switchScrutinee: switchScrutinee, - assignedVariables: assignedVariables, - componentVariables: componentVariables, - patternVariablePromotionKeys: patternVariablePromotionKeys, - ); + ? this + : new MatchContext( + isFinal: isFinal, + switchScrutinee: switchScrutinee, + assignedVariables: assignedVariables, + componentVariables: componentVariables, + patternVariablePromotionKeys: patternVariablePromotionKeys, + ); /// Returns a modified version of `this`, with a new value of /// [patternVariablePromotionKeys]. diff --git a/pkg/_fe_analyzer_shared/lib/src/type_inference/type_analyzer.dart b/pkg/_fe_analyzer_shared/lib/src/type_inference/type_analyzer.dart index 20a27e18098..ccc8c8d7cf4 100644 --- a/pkg/_fe_analyzer_shared/lib/src/type_inference/type_analyzer.dart +++ b/pkg/_fe_analyzer_shared/lib/src/type_inference/type_analyzer.dart @@ -557,15 +557,14 @@ mixin TypeAnalyzer< SharedTypeView promotedValueType = flow.getMatchedValueType(); bool isImplicitlyTyped = declaredType == null; // TODO(paulberry): are we handling _isFinal correctly? - int promotionKey = - context.patternVariablePromotionKeys[variableName] = flow - .declaredVariablePattern( - matchedType: promotedValueType, - staticType: staticType, - isFinal: context.isFinal || operations.isVariableFinal(variable), - isLate: false, - isImplicitlyTyped: isImplicitlyTyped, - ); + int promotionKey = context.patternVariablePromotionKeys[variableName] = flow + .declaredVariablePattern( + matchedType: promotedValueType, + staticType: staticType, + isFinal: context.isFinal || operations.isVariableFinal(variable), + isLate: false, + isImplicitlyTyped: isImplicitlyTyped, + ); setVariableType(variable, staticType); (context.componentVariables[variableName] ??= []).add(variable); flow.assignMatchedPatternVariable(variable, promotionKey); @@ -857,8 +856,9 @@ mixin TypeAnalyzer< type: operations.doubleType, typeSchema: schema, ); - SharedTypeView type = - convertToDouble ? operations.doubleType : operations.intType; + SharedTypeView type = convertToDouble + ? operations.doubleType + : operations.intType; return new IntTypeAnalysisResult( type: type, convertedToDouble: convertToDouble, @@ -1538,10 +1538,9 @@ mixin TypeAnalyzer< }) { // Stack: () SharedTypeSchemaView patternTypeSchema = dispatchPatternSchema(pattern); - SharedTypeSchemaView expressionTypeSchema = - hasAwait - ? operations.streamTypeSchema(patternTypeSchema) - : operations.iterableTypeSchema(patternTypeSchema); + SharedTypeSchemaView expressionTypeSchema = hasAwait + ? operations.streamTypeSchema(patternTypeSchema) + : operations.iterableTypeSchema(patternTypeSchema); SharedTypeView expressionType = analyzeExpression( expression, expressionTypeSchema, @@ -1549,10 +1548,9 @@ mixin TypeAnalyzer< // Stack: (Expression) Error? patternForInExpressionIsNotIterableError; - SharedTypeView? elementType = - hasAwait - ? operations.matchStreamType(expressionType) - : operations.matchIterableType(expressionType); + SharedTypeView? elementType = hasAwait + ? operations.matchStreamType(expressionType) + : operations.matchIterableType(expressionType); if (elementType == null) { if (expressionType is SharedDynamicType) { elementType = operations.dynamicType; @@ -2185,8 +2183,8 @@ mixin TypeAnalyzer< isExhaustive = true; requiresExhaustivenessValidation = false; } else if (typeAnalyzerOptions.patternsEnabled) { - requiresExhaustivenessValidation = - isExhaustive = operations.isAlwaysExhaustiveType(scrutineeType); + requiresExhaustivenessValidation = isExhaustive = operations + .isAlwaysExhaustiveType(scrutineeType); } else { isExhaustive = isLegacySwitchExhaustive(node, scrutineeType); requiresExhaustivenessValidation = false; @@ -2723,9 +2721,8 @@ mixin TypeAnalyzer< location: location, inconsistency: typeIfConsistent != null && isFinalIfConsistent != null - ? JoinedPatternVariableInconsistency.none - : JoinedPatternVariableInconsistency - .differentFinalityOrType, + ? JoinedPatternVariableInconsistency.none + : JoinedPatternVariableInconsistency.differentFinalityOrType, isFinal: isFinalIfConsistent ?? false, type: typeIfConsistent ?? operations.errorType, ); diff --git a/pkg/_fe_analyzer_shared/lib/src/type_inference/type_analyzer_operations.dart b/pkg/_fe_analyzer_shared/lib/src/type_inference/type_analyzer_operations.dart index 740e3e01258..1f61a9d9cdc 100644 --- a/pkg/_fe_analyzer_shared/lib/src/type_inference/type_analyzer_operations.dart +++ b/pkg/_fe_analyzer_shared/lib/src/type_inference/type_analyzer_operations.dart @@ -1351,8 +1351,8 @@ mixin TypeAnalyzerOperationsMixin< !isBoundOmitted(typeParameterToInfer)) { MergedTypeConstraint constraintFromBound = mergeInConstraintsFromBound( typeParameterToInfer: typeParameterToInfer, - typeParametersToInfer: - typeParametersToInfer.cast(), + typeParametersToInfer: typeParametersToInfer + .cast(), lower: constraint.lower.unwrapTypeSchemaView(), inferencePhaseConstraints: constraints, dataForTesting: dataForTesting, @@ -1439,8 +1439,8 @@ mixin TypeAnalyzerOperationsMixin< // Coverage-ignore-block(suite): Not run. MergedTypeConstraint constraintFromBound = mergeInConstraintsFromBound( typeParameterToInfer: typeParameterToInfer, - typeParametersToInfer: - typeParametersToInfer.cast(), + typeParametersToInfer: typeParametersToInfer + .cast(), lower: constraint.lower.unwrapTypeSchemaView(), inferencePhaseConstraints: constraints, dataForTesting: dataForTesting, diff --git a/pkg/_fe_analyzer_shared/lib/src/type_inference/variable_bindings.dart b/pkg/_fe_analyzer_shared/lib/src/type_inference/variable_bindings.dart index 42133b50351..921ad40630c 100644 --- a/pkg/_fe_analyzer_shared/lib/src/type_inference/variable_bindings.dart +++ b/pkg/_fe_analyzer_shared/lib/src/type_inference/variable_bindings.dart @@ -186,12 +186,11 @@ abstract class VariableBinder { result[entry.key] = joinPatternVariables( key: key, components: variables, - inconsistency: - sharedVariable.allCases - ? JoinedPatternVariableInconsistency.none - : sharedScope.hasLabel - ? JoinedPatternVariableInconsistency.sharedCaseHasLabel - : JoinedPatternVariableInconsistency.sharedCaseAbsent, + inconsistency: sharedVariable.allCases + ? JoinedPatternVariableInconsistency.none + : sharedScope.hasLabel + ? JoinedPatternVariableInconsistency.sharedCaseHasLabel + : JoinedPatternVariableInconsistency.sharedCaseAbsent, ); } } diff --git a/pkg/_fe_analyzer_shared/lib/src/util/libraries_specification.dart b/pkg/_fe_analyzer_shared/lib/src/util/libraries_specification.dart index 19222caeacf..9f261a33ebb 100644 --- a/pkg/_fe_analyzer_shared/lib/src/util/libraries_specification.dart +++ b/pkg/_fe_analyzer_shared/lib/src/util/libraries_specification.dart @@ -303,8 +303,9 @@ class LibrariesSpecification { Uri uri = checkAndResolve(data['uri']); List patches; if (data['patches'] is List) { - patches = - data['patches'].map((s) => specUri.resolve(s)).toList(); + patches = data['patches'] + .map((s) => specUri.resolve(s)) + .toList(); } else if (data['patches'] is String) { patches = [checkAndResolve(data['patches'])]; } else if (data['patches'] == null) { diff --git a/pkg/_fe_analyzer_shared/pubspec.yaml b/pkg/_fe_analyzer_shared/pubspec.yaml index 6f9bec15ff1..5733d5acdea 100644 --- a/pkg/_fe_analyzer_shared/pubspec.yaml +++ b/pkg/_fe_analyzer_shared/pubspec.yaml @@ -6,7 +6,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.7.0 + sdk: ^3.9.0 resolution: workspace diff --git a/pkg/_fe_analyzer_shared/test/annotated_code_helper_test.dart b/pkg/_fe_analyzer_shared/test/annotated_code_helper_test.dart index 27f3944d336..acb864c3a3d 100644 --- a/pkg/_fe_analyzer_shared/test/annotated_code_helper_test.dart +++ b/pkg/_fe_analyzer_shared/test/annotated_code_helper_test.dart @@ -35,8 +35,10 @@ void testDir(String dataDirPath) { ); String relativeDir = dataDir.uri.path.replaceAll(Uri.base.path, ''); print('Data dir: ${relativeDir}'); - List entities = - dataDir.listSync().where((entity) => !entity.path.endsWith('~')).toList(); + List entities = dataDir + .listSync() + .where((entity) => !entity.path.endsWith('~')) + .toList(); for (FileSystemEntity entity in entities) { print('----------------------------------------------------------------'); diff --git a/pkg/_fe_analyzer_shared/test/exhaustiveness/data/issue51986.dart b/pkg/_fe_analyzer_shared/test/exhaustiveness/data/issue51986.dart index f36c6fcd4ea..cbf40d0e79f 100644 --- a/pkg/_fe_analyzer_shared/test/exhaustiveness/data/issue51986.dart +++ b/pkg/_fe_analyzer_shared/test/exhaustiveness/data/issue51986.dart @@ -18,12 +18,12 @@ int test1(Object obj) { } int test2(Object obj) => -/* + /* error=non-exhaustive:Object(), fields={isEven:-}, type=Object */ -switch (obj) { - int(isEven: true) as int /*space=int(isEven: true)|Null*/ => 1, - int _ /*space=int*/ => 2, -}; + switch (obj) { + int(isEven: true) as int /*space=int(isEven: true)|Null*/ => 1, + int _ /*space=int*/ => 2, + }; diff --git a/pkg/_fe_analyzer_shared/test/exhaustiveness/data/issue56998.dart b/pkg/_fe_analyzer_shared/test/exhaustiveness/data/issue56998.dart index 3796245e02c..022d0f7b534 100644 --- a/pkg/_fe_analyzer_shared/test/exhaustiveness/data/issue56998.dart +++ b/pkg/_fe_analyzer_shared/test/exhaustiveness/data/issue56998.dart @@ -3,15 +3,15 @@ // BSD-style license that can be found in the LICENSE file. int nonExhaustive1(T value) => -/* + /* checkingOrder={int?,int,Null}, error=non-exhaustive:null, subtypes={int,Null}, type=int? */ -switch (value) { - int() /*space=int*/ => value, -}; + switch (value) { + int() /*space=int*/ => value, + }; int nonExhaustive2(T? value) => /* checkingOrder={int?,int,Null}, diff --git a/pkg/_fe_analyzer_shared/test/flow_analysis/assigned_variables/data/closure.dart b/pkg/_fe_analyzer_shared/test/flow_analysis/assigned_variables/data/closure.dart index 3f5376ef753..7ef3e9b6817 100644 --- a/pkg/_fe_analyzer_shared/test/flow_analysis/assigned_variables/data/closure.dart +++ b/pkg/_fe_analyzer_shared/test/flow_analysis/assigned_variables/data/closure.dart @@ -20,17 +20,15 @@ doubleNesting(int a, int b, int c) { // Note: for a closure, "assigned" and "captured" are restricted to // variables declared in enclosing contexts, so d, e, and f are not // included. - var fn1 = /*declared={d, e, fn2}, assigned={b, c}, captured={c}*/ ( - int d, - int e, - ) { - b = 0; - d = 0; - // Similarly, f is not included in "assigned" here. - var fn2 = /*declared={f}, assigned={c, e}*/ (int f) { - c = 0; - e = 0; - f = 0; - }; - }; + var fn1 = /*declared={d, e, fn2}, assigned={b, c}, captured={c}*/ + (int d, int e) { + b = 0; + d = 0; + // Similarly, f is not included in "assigned" here. + var fn2 = /*declared={f}, assigned={c, e}*/ (int f) { + c = 0; + e = 0; + f = 0; + }; + }; } diff --git a/pkg/_fe_analyzer_shared/test/flow_analysis/assigned_variables_test.dart b/pkg/_fe_analyzer_shared/test/flow_analysis/assigned_variables_test.dart index 67cf302dbe1..a85d64bc62c 100644 --- a/pkg/_fe_analyzer_shared/test/flow_analysis/assigned_variables_test.dart +++ b/pkg/_fe_analyzer_shared/test/flow_analysis/assigned_variables_test.dart @@ -595,10 +595,9 @@ main() { group('Final assertions:', () { bool assertionsEnabled = false; assert(assertionsEnabled = true); - var asserts = - assertionsEnabled - ? throwsA(TypeMatcher()) - : returnsNormally; + var asserts = assertionsEnabled + ? throwsA(TypeMatcher()) + : returnsNormally; test('finish may not be called twice', () { var assignedVariables = AssignedVariablesForTesting<_Node, _Variable>(); diff --git a/pkg/_fe_analyzer_shared/test/flow_analysis/flow_analysis_test.dart b/pkg/_fe_analyzer_shared/test/flow_analysis/flow_analysis_test.dart index 5fd92e68099..a48a4f2ae07 100644 --- a/pkg/_fe_analyzer_shared/test/flow_analysis/flow_analysis_test.dart +++ b/pkg/_fe_analyzer_shared/test/flow_analysis/flow_analysis_test.dart @@ -3409,8 +3409,8 @@ main() { expect(reachableSplitUnsplit.overallReachable, true); expect(reachableSplitUnsplit.locallyReachable, true); var reachableSplitUnreachable = reachableSplit.setUnreachable(); - var reachableSplitUnreachableUnsplit = - reachableSplitUnreachable.unsplit(); + var reachableSplitUnreachableUnsplit = reachableSplitUnreachable + .unsplit(); expect(reachableSplitUnreachableUnsplit.parent, same(base.parent)); expect(reachableSplitUnreachableUnsplit.overallReachable, false); expect(reachableSplitUnreachableUnsplit.locallyReachable, false); @@ -3419,8 +3419,8 @@ main() { var unreachableSplitUnsplit = unreachableSplit.unsplit(); expect(unreachableSplitUnsplit, same(unreachable)); var unreachableSplitUnreachable = unreachableSplit.setUnreachable(); - var unreachableSplitUnreachableUnsplit = - unreachableSplitUnreachable.unsplit(); + var unreachableSplitUnreachableUnsplit = unreachableSplitUnreachable + .unsplit(); expect(unreachableSplitUnreachableUnsplit, same(unreachable)); }); @@ -3637,37 +3637,33 @@ main() { }); test('promoted -> unchanged (same)', () { - var s1 = - FlowModel( - Reachability.initial, - )._tryPromoteForTypeCheck(h, objectQVar, 'int').ifTrue; + var s1 = FlowModel( + Reachability.initial, + )._tryPromoteForTypeCheck(h, objectQVar, 'int').ifTrue; var s2 = s1._tryPromoteForTypeCheck(h, objectQVar, 'int').ifTrue; expect(s2, same(s1)); }); test('promoted -> unchanged (supertype)', () { - var s1 = - FlowModel( - Reachability.initial, - )._tryPromoteForTypeCheck(h, objectQVar, 'int').ifTrue; + var s1 = FlowModel( + Reachability.initial, + )._tryPromoteForTypeCheck(h, objectQVar, 'int').ifTrue; var s2 = s1._tryPromoteForTypeCheck(h, objectQVar, 'Object').ifTrue; expect(s2, same(s1)); }); test('promoted -> unchanged (unrelated)', () { - var s1 = - FlowModel( - Reachability.initial, - )._tryPromoteForTypeCheck(h, objectQVar, 'int').ifTrue; + var s1 = FlowModel( + Reachability.initial, + )._tryPromoteForTypeCheck(h, objectQVar, 'int').ifTrue; var s2 = s1._tryPromoteForTypeCheck(h, objectQVar, 'String').ifTrue; expect(s2, same(s1)); }); test('promoted -> subtype', () { - var s1 = - FlowModel( - Reachability.initial, - )._tryPromoteForTypeCheck(h, objectQVar, 'int?').ifTrue; + var s1 = FlowModel( + Reachability.initial, + )._tryPromoteForTypeCheck(h, objectQVar, 'int?').ifTrue; var s2 = s1._tryPromoteForTypeCheck(h, objectQVar, 'int').ifTrue; expect(s2.reachable.overallReachable, true); expect(s2.promotionInfo.unwrap(h), { @@ -3753,11 +3749,10 @@ main() { }); test('un-promotes fully', () { - var s1 = - FlowModel(Reachability.initial) - ._declare(h, objectQVar, true) - ._tryPromoteForTypeCheck(h, objectQVar, 'int') - .ifTrue; + var s1 = FlowModel(Reachability.initial) + ._declare(h, objectQVar, true) + ._tryPromoteForTypeCheck(h, objectQVar, 'int') + .ifTrue; expect( s1.promotionInfo.unwrap(h), contains(h.promotionKeyStore.keyForVariable(objectQVar)), @@ -3781,13 +3776,12 @@ main() { }); test('un-promotes partially, when no exact match', () { - var s1 = - FlowModel(Reachability.initial) - ._declare(h, objectQVar, true) - ._tryPromoteForTypeCheck(h, objectQVar, 'num?') - .ifTrue - ._tryPromoteForTypeCheck(h, objectQVar, 'int') - .ifTrue; + var s1 = FlowModel(Reachability.initial) + ._declare(h, objectQVar, true) + ._tryPromoteForTypeCheck(h, objectQVar, 'num?') + .ifTrue + ._tryPromoteForTypeCheck(h, objectQVar, 'int') + .ifTrue; expect(s1.promotionInfo.unwrap(h), { h.promotionKeyStore.keyForVariable(objectQVar): _matchVariableModel( chain: ['num?', 'int'], @@ -3815,15 +3809,14 @@ main() { }); test('un-promotes partially, when exact match', () { - var s1 = - FlowModel(Reachability.initial) - ._declare(h, objectQVar, true) - ._tryPromoteForTypeCheck(h, objectQVar, 'num?') - .ifTrue - ._tryPromoteForTypeCheck(h, objectQVar, 'num') - .ifTrue - ._tryPromoteForTypeCheck(h, objectQVar, 'int') - .ifTrue; + var s1 = FlowModel(Reachability.initial) + ._declare(h, objectQVar, true) + ._tryPromoteForTypeCheck(h, objectQVar, 'num?') + .ifTrue + ._tryPromoteForTypeCheck(h, objectQVar, 'num') + .ifTrue + ._tryPromoteForTypeCheck(h, objectQVar, 'int') + .ifTrue; expect(s1.promotionInfo.unwrap(h), { h.promotionKeyStore.keyForVariable(objectQVar): _matchVariableModel( chain: ['num?', 'num', 'int'], @@ -3851,13 +3844,12 @@ main() { }); test('leaves promoted, when exact match', () { - var s1 = - FlowModel(Reachability.initial) - ._declare(h, objectQVar, true) - ._tryPromoteForTypeCheck(h, objectQVar, 'num?') - .ifTrue - ._tryPromoteForTypeCheck(h, objectQVar, 'num') - .ifTrue; + var s1 = FlowModel(Reachability.initial) + ._declare(h, objectQVar, true) + ._tryPromoteForTypeCheck(h, objectQVar, 'num?') + .ifTrue + ._tryPromoteForTypeCheck(h, objectQVar, 'num') + .ifTrue; expect(s1.promotionInfo.unwrap(h), { h.promotionKeyStore.keyForVariable(objectQVar): _matchVariableModel( chain: ['num?', 'num'], @@ -3886,13 +3878,12 @@ main() { }); test('leaves promoted, when writing a subtype', () { - var s1 = - FlowModel(Reachability.initial) - ._declare(h, objectQVar, true) - ._tryPromoteForTypeCheck(h, objectQVar, 'num?') - .ifTrue - ._tryPromoteForTypeCheck(h, objectQVar, 'num') - .ifTrue; + var s1 = FlowModel(Reachability.initial) + ._declare(h, objectQVar, true) + ._tryPromoteForTypeCheck(h, objectQVar, 'num?') + .ifTrue + ._tryPromoteForTypeCheck(h, objectQVar, 'num') + .ifTrue; expect(s1.promotionInfo.unwrap(h), { h.promotionKeyStore.keyForVariable(objectQVar): _matchVariableModel( chain: ['num?', 'num'], @@ -3984,11 +3975,10 @@ main() { }); test('when promoted', () { - var s1 = - FlowModel(Reachability.initial) - ._declare(h, objectQVar, true) - ._tryPromoteForTypeCheck(h, objectQVar, 'int?') - .ifTrue; + var s1 = FlowModel(Reachability.initial) + ._declare(h, objectQVar, true) + ._tryPromoteForTypeCheck(h, objectQVar, 'int?') + .ifTrue; expect(s1.promotionInfo.unwrap(h), { h.promotionKeyStore.keyForVariable(objectQVar): _matchVariableModel( chain: ['int?'], @@ -4011,11 +4001,10 @@ main() { }); test('when not promoted', () { - var s1 = - FlowModel(Reachability.initial) - ._declare(h, objectQVar, true) - ._tryPromoteForTypeCheck(h, objectQVar, 'int?') - .ifFalse; + var s1 = FlowModel(Reachability.initial) + ._declare(h, objectQVar, true) + ._tryPromoteForTypeCheck(h, objectQVar, 'int?') + .ifFalse; expect(s1.promotionInfo.unwrap(h), { h.promotionKeyStore.keyForVariable(objectQVar): _matchVariableModel( chain: ['Object'], @@ -4039,11 +4028,10 @@ main() { }); test('Promotes to type of interest when not previously promoted', () { - var s1 = - FlowModel(Reachability.initial) - ._declare(h, objectQVar, true) - ._tryPromoteForTypeCheck(h, objectQVar, 'num?') - .ifFalse; + var s1 = FlowModel(Reachability.initial) + ._declare(h, objectQVar, true) + ._tryPromoteForTypeCheck(h, objectQVar, 'num?') + .ifFalse; expect(s1.promotionInfo.unwrap(h), { h.promotionKeyStore.keyForVariable(objectQVar): _matchVariableModel( chain: ['Object'], @@ -4066,13 +4054,12 @@ main() { }); test('Promotes to type of interest when previously promoted', () { - var s1 = - FlowModel(Reachability.initial) - ._declare(h, objectQVar, true) - ._tryPromoteForTypeCheck(h, objectQVar, 'num?') - .ifTrue - ._tryPromoteForTypeCheck(h, objectQVar, 'int?') - .ifFalse; + var s1 = FlowModel(Reachability.initial) + ._declare(h, objectQVar, true) + ._tryPromoteForTypeCheck(h, objectQVar, 'num?') + .ifTrue + ._tryPromoteForTypeCheck(h, objectQVar, 'int?') + .ifFalse; expect(s1.promotionInfo.unwrap(h), { h.promotionKeyStore.keyForVariable(objectQVar): _matchVariableModel( chain: ['num?', 'num'], @@ -4111,13 +4098,12 @@ main() { test('; first', () { var x = Var('x')..type = Type('Object?'); - var s1 = - FlowModel(Reachability.initial) - ._declare(h, x, true) - ._tryPromoteForTypeCheck(h, x, 'B?') - .ifFalse - ._tryPromoteForTypeCheck(h, x, 'A?') - .ifFalse; + var s1 = FlowModel(Reachability.initial) + ._declare(h, x, true) + ._tryPromoteForTypeCheck(h, x, 'B?') + .ifFalse + ._tryPromoteForTypeCheck(h, x, 'A?') + .ifFalse; expect(s1.promotionInfo.unwrap(h), { h.promotionKeyStore.keyForVariable(x): _matchVariableModel( chain: ['Object'], @@ -4143,13 +4129,12 @@ main() { test('; second', () { var x = Var('x')..type = Type('Object?'); - var s1 = - FlowModel(Reachability.initial) - ._declare(h, x, true) - ._tryPromoteForTypeCheck(h, x, 'A?') - .ifFalse - ._tryPromoteForTypeCheck(h, x, 'B?') - .ifFalse; + var s1 = FlowModel(Reachability.initial) + ._declare(h, x, true) + ._tryPromoteForTypeCheck(h, x, 'A?') + .ifFalse + ._tryPromoteForTypeCheck(h, x, 'B?') + .ifFalse; expect(s1.promotionInfo.unwrap(h), { h.promotionKeyStore.keyForVariable(x): _matchVariableModel( chain: ['Object'], @@ -4175,13 +4160,12 @@ main() { test('; nullable and non-nullable', () { var x = Var('x')..type = Type('Object?'); - var s1 = - FlowModel(Reachability.initial) - ._declare(h, x, true) - ._tryPromoteForTypeCheck(h, x, 'A') - .ifFalse - ._tryPromoteForTypeCheck(h, x, 'A?') - .ifFalse; + var s1 = FlowModel(Reachability.initial) + ._declare(h, x, true) + ._tryPromoteForTypeCheck(h, x, 'A') + .ifFalse + ._tryPromoteForTypeCheck(h, x, 'A?') + .ifFalse; expect(s1.promotionInfo.unwrap(h), { h.promotionKeyStore.keyForVariable(x): _matchVariableModel( chain: ['Object'], @@ -4207,13 +4191,12 @@ main() { group('; ambiguous', () { test('; no promotion', () { - var s1 = - FlowModel(Reachability.initial) - ._declare(h, objectQVar, true) - ._tryPromoteForTypeCheck(h, objectQVar, 'List') - .ifFalse - ._tryPromoteForTypeCheck(h, objectQVar, 'List') - .ifFalse; + var s1 = FlowModel(Reachability.initial) + ._declare(h, objectQVar, true) + ._tryPromoteForTypeCheck(h, objectQVar, 'List') + .ifFalse + ._tryPromoteForTypeCheck(h, objectQVar, 'List') + .ifFalse; expect(s1.promotionInfo.unwrap(h), { h.promotionKeyStore.keyForVariable( objectQVar, @@ -4242,13 +4225,12 @@ main() { }); test('exact match', () { - var s1 = - FlowModel(Reachability.initial) - ._declare(h, objectQVar, true) - ._tryPromoteForTypeCheck(h, objectQVar, 'List') - .ifFalse - ._tryPromoteForTypeCheck(h, objectQVar, 'List') - .ifFalse; + var s1 = FlowModel(Reachability.initial) + ._declare(h, objectQVar, true) + ._tryPromoteForTypeCheck(h, objectQVar, 'List') + .ifFalse + ._tryPromoteForTypeCheck(h, objectQVar, 'List') + .ifFalse; expect(s1.promotionInfo.unwrap(h), { h.promotionKeyStore.keyForVariable(objectQVar): _matchVariableModel( ofInterest: ['List', 'List'], @@ -4278,13 +4260,12 @@ main() { test('when promoted via test', () { var x = Var('x')..type = Type('Object?'); - var s1 = - FlowModel(Reachability.initial) - ._declare(h, x, true) - ._tryPromoteForTypeCheck(h, x, 'num?') - .ifTrue - ._tryPromoteForTypeCheck(h, x, 'int?') - .ifTrue; + var s1 = FlowModel(Reachability.initial) + ._declare(h, x, true) + ._tryPromoteForTypeCheck(h, x, 'num?') + .ifTrue + ._tryPromoteForTypeCheck(h, x, 'int?') + .ifTrue; expect(s1.promotionInfo.unwrap(h), { h.promotionKeyStore.keyForVariable(x): _matchVariableModel( chain: ['num?', 'int?'], @@ -4358,19 +4339,17 @@ main() { }); test('promoted -> unchanged', () { - var s1 = - FlowModel( - Reachability.initial, - )._tryPromoteForTypeCheck(h, objectQVar, 'int').ifTrue; + var s1 = FlowModel( + Reachability.initial, + )._tryPromoteForTypeCheck(h, objectQVar, 'int').ifTrue; var s2 = s1._tryMarkNonNullable(h, objectQVar).ifTrue; expect(s2, same(s1)); }); test('promoted -> re-promoted', () { - var s1 = - FlowModel( - Reachability.initial, - )._tryPromoteForTypeCheck(h, objectQVar, 'int?').ifTrue; + var s1 = FlowModel( + Reachability.initial, + )._tryPromoteForTypeCheck(h, objectQVar, 'int?').ifTrue; var s2 = s1._tryMarkNonNullable(h, objectQVar).ifTrue; expect(s2.reachable.overallReachable, true); expect(s2.promotionInfo.unwrap(h), { @@ -4394,11 +4373,10 @@ main() { group('conservativeJoin', () { test('unchanged', () { - var s1 = - FlowModel(Reachability.initial) - ._declare(h, intQVar, true) - ._tryPromoteForTypeCheck(h, objectQVar, 'int') - .ifTrue; + var s1 = FlowModel(Reachability.initial) + ._declare(h, intQVar, true) + ._tryPromoteForTypeCheck(h, objectQVar, 'int') + .ifTrue; var s2 = s1._conservativeJoin(h, [intQVar], []); expect(s2, isNot(same(s1))); expect(s2.reachable, same(s1.reachable)); @@ -4415,12 +4393,11 @@ main() { }); test('written', () { - var s1 = - FlowModel(Reachability.initial) - ._tryPromoteForTypeCheck(h, objectQVar, 'int') - .ifTrue - ._tryPromoteForTypeCheck(h, intQVar, 'int') - .ifTrue; + var s1 = FlowModel(Reachability.initial) + ._tryPromoteForTypeCheck(h, objectQVar, 'int') + .ifTrue + ._tryPromoteForTypeCheck(h, intQVar, 'int') + .ifTrue; var s2 = s1._conservativeJoin(h, [intQVar], []); expect(s2.reachable.overallReachable, true); expect(s2.promotionInfo.unwrap(h), { @@ -4436,12 +4413,11 @@ main() { }); test('write captured', () { - var s1 = - FlowModel(Reachability.initial) - ._tryPromoteForTypeCheck(h, objectQVar, 'int') - .ifTrue - ._tryPromoteForTypeCheck(h, intQVar, 'int') - .ifTrue; + var s1 = FlowModel(Reachability.initial) + ._tryPromoteForTypeCheck(h, objectQVar, 'int') + .ifTrue + ._tryPromoteForTypeCheck(h, intQVar, 'int') + .ifTrue; var s2 = s1._conservativeJoin(h, [], [intQVar]); expect(s2.reachable.overallReachable, true); expect(s2.promotionInfo.unwrap(h), { @@ -4596,10 +4572,9 @@ main() { if (thisType != null) { s1 = s1._tryPromoteForTypeCheck(h, x, thisType).ifTrue; } - var s2 = - otherType == null - ? s0 - : s0._tryPromoteForTypeCheck(h, x, otherType).ifTrue; + var s2 = otherType == null + ? s0 + : s0._tryPromoteForTypeCheck(h, x, otherType).ifTrue; var result = s2.rebaseForward(h, s1); if (expectedChain == null) { expect( @@ -4637,8 +4612,9 @@ main() { // Verify that the given promotion chain matches the expected list of // strings. void _checkChain(List chain, List expected) { - var strings = - chain.map((t) => t.unwrapTypeView().type).toList(); + var strings = chain + .map((t) => t.unwrapTypeView().type) + .toList(); expect(strings, expected); } @@ -7532,8 +7508,9 @@ main() { ifCase( x, recordPattern([ - (wildcard(type: 'num') - ..errorId = 'NUM').and(wildcard(type: 'int')).recordField(), + (wildcard( + type: 'num', + )..errorId = 'NUM').and(wildcard(type: 'int')).recordField(), ]), [checkPromoted(x, '(int,)')], ), @@ -7575,9 +7552,9 @@ main() { ifCase( x, recordPattern([ - (wildcard(type: 'Object') - ..errorId = - 'OBJECT').and(wildcard(type: 'int')).recordField(), + (wildcard(type: 'Object')..errorId = 'OBJECT') + .and(wildcard(type: 'int')) + .recordField(), ]), [checkPromoted(x, '(int,)')], ), @@ -12829,12 +12806,12 @@ Matcher _matchVariableModel({ assigned ??= anything; unassigned ??= anything; writeCaptured ??= anything; - Matcher chainMatcher = - chain is List ? _matchPromotionChain(chain) : wrapMatcher(chain); - Matcher ofInterestMatcher = - ofInterest is List - ? _matchOfInterestSet(ofInterest) - : wrapMatcher(ofInterest); + Matcher chainMatcher = chain is List + ? _matchPromotionChain(chain) + : wrapMatcher(chain); + Matcher ofInterestMatcher = ofInterest is List + ? _matchOfInterestSet(ofInterest) + : wrapMatcher(ofInterest); Matcher assignedMatcher = wrapMatcher(assigned); Matcher unassignedMatcher = wrapMatcher(unassigned); Matcher writeCapturedMatcher = wrapMatcher(writeCaptured); diff --git a/pkg/_fe_analyzer_shared/test/flow_analysis/nullability/data/null_aware_call.dart b/pkg/_fe_analyzer_shared/test/flow_analysis/nullability/data/null_aware_call.dart index 2f0b560ad08..73688028210 100644 --- a/pkg/_fe_analyzer_shared/test/flow_analysis/nullability/data/null_aware_call.dart +++ b/pkg/_fe_analyzer_shared/test/flow_analysis/nullability/data/null_aware_call.dart @@ -4,7 +4,8 @@ class C { C method(dynamic value) => this; - C Function(dynamic) get functionGetter => (_) => this; + C Function(dynamic) get functionGetter => + (_) => this; } void methodCall(C? c) { diff --git a/pkg/_fe_analyzer_shared/test/flow_analysis/type_promotion/data/assigned_anywhere.dart b/pkg/_fe_analyzer_shared/test/flow_analysis/type_promotion/data/assigned_anywhere.dart index 8bb53e932a1..d50a34fe1f6 100644 --- a/pkg/_fe_analyzer_shared/test/flow_analysis/type_promotion/data/assigned_anywhere.dart +++ b/pkg/_fe_analyzer_shared/test/flow_analysis/type_promotion/data/assigned_anywhere.dart @@ -23,18 +23,17 @@ topLevel_function(Object x, Object y) { y = 'foo'; } -topLevel_function_arrow(Object x, Object y) => - (x is int && y is int) - ? [ - /*int*/ x, - /*int*/ y, - () { - /*int*/ - x; - y; - }, - ] - : (y = 'foo'); +topLevel_function_arrow(Object x, Object y) => (x is int && y is int) + ? [ + /*int*/ x, + /*int*/ y, + () { + /*int*/ + x; + y; + }, + ] + : (y = 'foo'); void topLevel_setter(Object x) { Object y = f(0); @@ -52,15 +51,14 @@ void topLevel_setter(Object x) { y = 'foo'; } -void topLevel_setter_arrow(Object y) => - (y is int) - ? [ - /*int*/ y, - () { - y; - }, - ] - : (y = 'foo'); +void topLevel_setter_arrow(Object y) => (y is int) + ? [ + /*int*/ y, + () { + y; + }, + ] + : (y = 'foo'); get topLevel_getter { Object x = f(0); @@ -101,14 +99,14 @@ class C { factory C.constructor_arrow(Object x, Object y) => C( (x is int && y is int) ? [ - /*int*/ x, - /*int*/ y, - () { - /*int*/ - x; - y; - }, - ] + /*int*/ x, + /*int*/ y, + () { + /*int*/ + x; + y; + }, + ] : (y = 'foo'), ); @@ -117,14 +115,14 @@ class C { f( (x is int && y is int) ? [ - /*int*/ x, - /*int*/ y, - () { - /*int*/ - x; - y; - }, - ] + /*int*/ x, + /*int*/ y, + () { + /*int*/ + x; + y; + }, + ] : (y = 'foo'), ), ); @@ -144,18 +142,17 @@ class C { y = 'foo'; } - method_arrow(Object x, Object y) => - (x is int && y is int) - ? [ - /*int*/ x, - /*int*/ y, - () { - /*int*/ - x; - y; - }, - ] - : (y = 'foo'); + method_arrow(Object x, Object y) => (x is int && y is int) + ? [ + /*int*/ x, + /*int*/ y, + () { + /*int*/ + x; + y; + }, + ] + : (y = 'foo'); void setter(Object x) { Object y = f(0); @@ -173,15 +170,14 @@ class C { y = 'foo'; } - void setter_arrow(Object y) => - (y is int) - ? [ - /*int*/ y, - () { - y; - }, - ] - : (y = 'foo'); + void setter_arrow(Object y) => (y is int) + ? [ + /*int*/ y, + () { + y; + }, + ] + : (y = 'foo'); get getter { Object x = f(0); diff --git a/pkg/_fe_analyzer_shared/test/flow_analysis/why_not_promoted/data/argument_type_not_assignable_nullability_error.dart b/pkg/_fe_analyzer_shared/test/flow_analysis/why_not_promoted/data/argument_type_not_assignable_nullability_error.dart index bf811729839..512f8625edb 100644 --- a/pkg/_fe_analyzer_shared/test/flow_analysis/why_not_promoted/data/argument_type_not_assignable_nullability_error.dart +++ b/pkg/_fe_analyzer_shared/test/flow_analysis/why_not_promoted/data/argument_type_not_assignable_nullability_error.dart @@ -42,10 +42,9 @@ class C3 { required_named(C3 c) { if (c.bad == null) return; c.f( - i: - c - . - /*notPromoted(propertyNotPromotedForInherentReason(target: member:C3.bad))*/ bad, + i: c + . + /*notPromoted(propertyNotPromotedForInherentReason(target: member:C3.bad))*/ bad, ); } @@ -57,10 +56,9 @@ class C4 { optional_named(C4 c) { if (c.bad == null) return; c.f( - i: - c - . - /*notPromoted(propertyNotPromotedForInherentReason(target: member:C4.bad))*/ bad, + i: c + . + /*notPromoted(propertyNotPromotedForInherentReason(target: member:C4.bad))*/ bad, ); } @@ -345,10 +343,9 @@ class C21 { assignmentRhs(C21 c, int i) { if (c.bad == null) return; - i = - c - . - /*notPromoted(propertyNotPromotedForInherentReason(target: member:C21.bad))*/ bad; + i = c + . + /*notPromoted(propertyNotPromotedForInherentReason(target: member:C21.bad))*/ bad; } class C22 { @@ -357,10 +354,9 @@ class C22 { variableInitializer(C22 c) { if (c.bad == null) return; - int i = - c - . - /*notPromoted(propertyNotPromotedForInherentReason(target: member:C22.bad))*/ bad; + int i = c + . + /*notPromoted(propertyNotPromotedForInherentReason(target: member:C22.bad))*/ bad; } class C23 { @@ -369,10 +365,9 @@ class C23 { final int y; C23.constructorInitializer(C23 c) : x = c.bad!, - y = - c - . - /*notPromoted(propertyNotPromotedForInherentReason(target: member:C23.bad))*/ bad; + y = c + . + /*notPromoted(propertyNotPromotedForInherentReason(target: member:C23.bad))*/ bad; } class C24 { @@ -382,38 +377,34 @@ class C24 { forVariableInitializer(C24 c) { if (c.bad == null) return; for ( - int i = - c - . - /*notPromoted(propertyNotPromotedForInherentReason(target: member:C24.bad))*/ bad; + int i = c + . + /*notPromoted(propertyNotPromotedForInherentReason(target: member:C24.bad))*/ bad; false; ) {} [ for ( - int i = - c - . - /*notPromoted(propertyNotPromotedForInherentReason(target: member:C24.bad))*/ bad; + int i = c + . + /*notPromoted(propertyNotPromotedForInherentReason(target: member:C24.bad))*/ bad; false; ) null, ]; ({ for ( - int i = - c - . - /*notPromoted(propertyNotPromotedForInherentReason(target: member:C24.bad))*/ bad; + int i = c + . + /*notPromoted(propertyNotPromotedForInherentReason(target: member:C24.bad))*/ bad; false; ) null, }); ({ for ( - int i = - c - . - /*notPromoted(propertyNotPromotedForInherentReason(target: member:C24.bad))*/ bad; + int i = c + . + /*notPromoted(propertyNotPromotedForInherentReason(target: member:C24.bad))*/ bad; false; ) null: null, @@ -427,38 +418,34 @@ class C25 { forAssignmentInitializer(C25 c, int i) { if (c.bad == null) return; for ( - i = - c - . - /*notPromoted(propertyNotPromotedForInherentReason(target: member:C25.bad))*/ bad; + i = c + . + /*notPromoted(propertyNotPromotedForInherentReason(target: member:C25.bad))*/ bad; false; ) {} [ for ( - i = - c - . - /*notPromoted(propertyNotPromotedForInherentReason(target: member:C25.bad))*/ bad; + i = c + . + /*notPromoted(propertyNotPromotedForInherentReason(target: member:C25.bad))*/ bad; false; ) null, ]; ({ for ( - i = - c - . - /*notPromoted(propertyNotPromotedForInherentReason(target: member:C25.bad))*/ bad; + i = c + . + /*notPromoted(propertyNotPromotedForInherentReason(target: member:C25.bad))*/ bad; false; ) null, }); ({ for ( - i = - c - . - /*notPromoted(propertyNotPromotedForInherentReason(target: member:C25.bad))*/ bad; + i = c + . + /*notPromoted(propertyNotPromotedForInherentReason(target: member:C25.bad))*/ bad; false; ) null: null, @@ -472,10 +459,9 @@ class C26 { compoundAssignmentRhs(C26 c) { num n = 0; if (c.bad == null) return; - n += - c - . - /*notPromoted(propertyNotPromotedForInherentReason(target: member:C26.bad))*/ bad; + n += c + . + /*notPromoted(propertyNotPromotedForInherentReason(target: member:C26.bad))*/ bad; } class C27 { @@ -592,8 +578,7 @@ class C35 { indexSetRhs(C35 c, List x) { if (c.bad == null) return; - x[0] = - c - . - /*notPromoted(propertyNotPromotedForInherentReason(target: member:C35.bad))*/ bad; + x[0] = c + . + /*notPromoted(propertyNotPromotedForInherentReason(target: member:C35.bad))*/ bad; } diff --git a/pkg/_fe_analyzer_shared/test/inference/inferred_variable_types/data/local_functions.dart b/pkg/_fe_analyzer_shared/test/inference/inferred_variable_types/data/local_functions.dart index 13098854e6a..031f76f77ad 100644 --- a/pkg/_fe_analyzer_shared/test/inference/inferred_variable_types/data/local_functions.dart +++ b/pkg/_fe_analyzer_shared/test/inference/inferred_variable_types/data/local_functions.dart @@ -19,9 +19,9 @@ localFunctions() { } var /*dynamic Function(dynamic)*/ singleReturn2 = - /*dynamic*/ (/*dynamic*/ o) { - return o; - }; + /*dynamic*/ (/*dynamic*/ o) { + return o; + }; /*int*/ typedArrowReturn1() => 1; @@ -45,16 +45,15 @@ localFunctions() { } } - var /*int? Function(bool)*/ multipleTypedReturns2 = /*int?*/ ( - bool condition, - ) { - if (condition) { - return 1; - } else { - return null; - } - }; + var /*int? Function(bool)*/ multipleTypedReturns2 = /*int?*/ + (bool condition) { + if (condition) { + return 1; + } else { + return null; + } + }; - int Function(String) inferredFromContext = /*int*/ - (/*String*/ condition) => condition.length; + int Function(String) inferredFromContext = /*int*/ (/*String*/ condition) => + condition.length; } diff --git a/pkg/_fe_analyzer_shared/test/metadata/evaluate_data/list_literal.dart b/pkg/_fe_analyzer_shared/test/metadata/evaluate_data/list_literal.dart index f7cab95e036..bd9b916ac0f 100644 --- a/pkg/_fe_analyzer_shared/test/metadata/evaluate_data/list_literal.dart +++ b/pkg/_fe_analyzer_shared/test/metadata/evaluate_data/list_literal.dart @@ -90,7 +90,9 @@ evaluate=ListLiteral([ExpressionElement(IntegerLiteral(1))]) constBool=BooleanLiteral(true)*/ void listLiteral10() {} -@Helper([...[0, 1]]) +@Helper([ + ...[0, 1], +]) /*member: listLiteral11: resolved=ListLiteral([SpreadElement(...ListLiteral([ ExpressionElement(IntegerLiteral(0)), @@ -111,7 +113,9 @@ constList=ListLiteral([ ExpressionElement(IntegerLiteral(3))])*/ void listLiteral12() {} -@Helper([...?[0, 1]]) +@Helper([ + ...?[0, 1], +]) /*member: listLiteral13: resolved=ListLiteral([SpreadElement(?...ListLiteral([ ExpressionElement(IntegerLiteral(0)), @@ -222,7 +226,10 @@ evaluate=ListLiteral([]) constBool=BooleanLiteral(true)*/ void listLiteral24() {} -@Helper([if (constBool) if (constBool) ?null else ?null]) +@Helper([ + if (constBool) + if (constBool) ?null else ?null, +]) /*member: listLiteral25: resolved=ListLiteral([IfElement( StaticGet(constBool), diff --git a/pkg/_fe_analyzer_shared/test/metadata/evaluate_data/set_or_map_literal.dart b/pkg/_fe_analyzer_shared/test/metadata/evaluate_data/set_or_map_literal.dart index 835d26938ea..2b35860a452 100644 --- a/pkg/_fe_analyzer_shared/test/metadata/evaluate_data/set_or_map_literal.dart +++ b/pkg/_fe_analyzer_shared/test/metadata/evaluate_data/set_or_map_literal.dart @@ -90,7 +90,9 @@ evaluate=SetOrMapLiteral({ExpressionElement(IntegerLiteral(1))}) constBool=BooleanLiteral(true)*/ void setOrMapLiteral10() {} -@Helper({...{0, 1}}) +@Helper({ + ...{0, 1}, +}) /*member: setOrMapLiteral11: resolved=SetOrMapLiteral({SpreadElement(...SetOrMapLiteral({ ExpressionElement(IntegerLiteral(0)), @@ -111,7 +113,9 @@ constList=ListLiteral([ ExpressionElement(IntegerLiteral(3))])*/ void setOrMapLiteral12() {} -@Helper({...?{0, 1}}) +@Helper({ + ...?{0, 1}, +}) /*member: setOrMapLiteral13: resolved=SetOrMapLiteral({SpreadElement(?...SetOrMapLiteral({ ExpressionElement(IntegerLiteral(0)), @@ -222,7 +226,10 @@ evaluate=SetOrMapLiteral({}) constBool=BooleanLiteral(true)*/ void setOrMapLiteral24() {} -@Helper({if (constBool) if (constBool) ?null else ?null}) +@Helper({ + if (constBool) + if (constBool) ?null else ?null, +}) /*member: setOrMapLiteral25: resolved=SetOrMapLiteral({IfElement( StaticGet(constBool), diff --git a/pkg/_fe_analyzer_shared/test/mini_ast.dart b/pkg/_fe_analyzer_shared/test/mini_ast.dart index 9762c7c82f6..2fc561f1cdf 100644 --- a/pkg/_fe_analyzer_shared/test/mini_ast.dart +++ b/pkg/_fe_analyzer_shared/test/mini_ast.dart @@ -867,10 +867,8 @@ class Cascade extends Expression { var previousCascadeTargetIR = h.typeAnalyzer._currentCascadeTargetIR; var previousCascadeType = h.typeAnalyzer._currentCascadeTargetType; // Create a let-variable that will be initialized to the value of the LHS - var targetTmp = - h.typeAnalyzer._currentCascadeTargetIR = h.irBuilder.allocateTmp( - location: location, - ); + var targetTmp = h.typeAnalyzer._currentCascadeTargetIR = h.irBuilder + .allocateTmp(location: location); h.typeAnalyzer._currentCascadeTargetType = h.flow .cascadeExpression_afterTarget( target, @@ -1107,10 +1105,9 @@ class CheckPromoted extends Expression { @override String toString() { - var predicate = - expectedTypeStr == null - ? 'not promoted' - : 'promoted to $expectedTypeStr'; + var predicate = expectedTypeStr == null + ? 'not promoted' + : 'promoted to $expectedTypeStr'; return 'check $promotable $predicate;'; } @@ -1553,10 +1550,9 @@ class ExpressionCollectionElement extends CollectionElement { @override void visit(Harness h, CollectionElementContext context) { - SharedTypeSchemaView typeSchema = - context is CollectionElementContextType - ? context.elementTypeSchema - : h.operations.unknownType; + SharedTypeSchemaView typeSchema = context is CollectionElementContextType + ? context.elementTypeSchema + : h.operations.unknownType; h.typeAnalyzer.analyzeExpression(expression, typeSchema); h.irBuilder.apply( 'celt', @@ -2000,10 +1996,9 @@ class Harness { ) { if (operator == '==' || operator == '!=') { return RelationalOperatorResolution( - kind: - operator == '==' - ? RelationalOperatorKind.equals - : RelationalOperatorKind.notEquals, + kind: operator == '==' + ? RelationalOperatorKind.equals + : RelationalOperatorKind.notEquals, parameterType: SharedTypeView(Type('Object')), returnType: SharedTypeView(Type('bool')), ); @@ -3914,8 +3909,8 @@ class ObjectPattern extends Pattern { this, fields: fields, ); - var matchedType = - objectPatternResult.matchedValueType.unwrapTypeView(); + var matchedType = objectPatternResult.matchedValueType + .unwrapTypeView(); var requiredType = objectPatternResult.requiredType.unwrapTypeView(); h.irBuilder.atom(matchedType.type, Kind.type, location: location); h.irBuilder.atom(requiredType.type, Kind.type, location: location); @@ -4368,10 +4363,9 @@ class PostIncDec extends Expression { @override ExpressionTypeAnalysisResult visit(Harness h, SharedTypeSchemaView schema) { - Type type = - h.typeAnalyzer - .analyzeExpression(lhs, h.operations.unknownType) - .unwrapTypeView(); + Type type = h.typeAnalyzer + .analyzeExpression(lhs, h.operations.unknownType) + .unwrapTypeView(); lhs._visitPostIncDec(h, this, type); return new ExpressionTypeAnalysisResult(type: SharedTypeView(type)); } @@ -4456,10 +4450,9 @@ class Property extends PromotableLValue { 'a null-aware property.', ); } - var receiverType = - h.typeAnalyzer - .analyzeExpression(target, h.operations.unknownType) - .unwrapTypeView(); + var receiverType = h.typeAnalyzer + .analyzeExpression(target, h.operations.unknownType) + .unwrapTypeView(); var member = h.typeAnalyzer._lookupMember(receiverType, propertyName); return member; } @@ -4884,8 +4877,8 @@ class RecordPattern extends Pattern { this, fields: fields, ); - var matchedType = - recordPatternResult.matchedValueType.unwrapTypeView(); + var matchedType = recordPatternResult.matchedValueType + .unwrapTypeView(); var requiredType = recordPatternResult.requiredType.unwrapTypeView(); h.irBuilder.atom(matchedType.type, Kind.type, location: location); h.irBuilder.atom(requiredType.type, Kind.type, location: location); @@ -5193,12 +5186,11 @@ class SwitchStatement extends Statement { @override String toString() { var isLegacyExhaustive = this.isLegacyExhaustive; - var exhaustiveness = - isLegacyExhaustive == null - ? '' - : isLegacyExhaustive - ? '' - : ''; + var exhaustiveness = isLegacyExhaustive == null + ? '' + : isLegacyExhaustive + ? '' + : ''; String body; if (cases.isEmpty) { body = '{}'; @@ -5706,15 +5698,14 @@ class VariableDeclaration extends Statement { if (initializer == null) { // Use the shared logic for analyzing uninitialized variable // declarations. - staticType = - h.typeAnalyzer - .analyzeUninitializedVariableDeclaration( - this, - variable, - declaredType?.wrapSharedTypeView(), - isFinal: isFinal, - ) - .unwrapTypeView(); + staticType = h.typeAnalyzer + .analyzeUninitializedVariableDeclaration( + this, + variable, + declaredType?.wrapSharedTypeView(), + isFinal: isFinal, + ) + .unwrapTypeView(); h.irBuilder.atom(staticType.type, Kind.type, location: location); irName = 'declare'; argKinds = [Kind.variable, Kind.type]; @@ -5723,23 +5714,21 @@ class VariableDeclaration extends Statement { // There's no shared logic for analyzing initialized variable // declarations, so analyze the declaration directly. if (isLate) h.flow.lateInitializer_begin(this); - var initializerType = - h.typeAnalyzer - .analyzeExpression( - initializer, - declaredType?.wrapSharedTypeSchemaView() ?? - h.operations.unknownType, - ) - .unwrapTypeView(); + var initializerType = h.typeAnalyzer + .analyzeExpression( + initializer, + declaredType?.wrapSharedTypeSchemaView() ?? + h.operations.unknownType, + ) + .unwrapTypeView(); if (isLate) h.flow.lateInitializer_end(); - staticType = - variable.type = - declaredType ?? - h.typeAnalyzer - .variableTypeFromInitializerType( - initializerType.wrapSharedTypeView(), - ) - .unwrapTypeView(); + staticType = variable.type = + declaredType ?? + h.typeAnalyzer + .variableTypeFromInitializerType( + initializerType.wrapSharedTypeView(), + ) + .unwrapTypeView(); h.flow.declare(variable, SharedTypeView(staticType), initialized: true); h.flow.initialize( variable, @@ -5836,10 +5825,10 @@ class VariablePattern extends Pattern { variable.name, declaredType?.wrapSharedTypeView(), ); - var matchedType = - declaredVariablePatternResult.matchedValueType.unwrapTypeView(); - var staticType = - declaredVariablePatternResult.staticType.unwrapTypeView(); + var matchedType = declaredVariablePatternResult.matchedValueType + .unwrapTypeView(); + var staticType = declaredVariablePatternResult.staticType + .unwrapTypeView(); h.typeAnalyzer.handleDeclaredVariablePattern( this, matchedType: matchedType, @@ -6084,8 +6073,9 @@ class Write extends Expression { void preVisit(PreVisitor visitor) { lhs.preVisit( visitor, - disposition: - rhs == null ? _LValueDisposition.readWrite : _LValueDisposition.write, + disposition: rhs == null + ? _LValueDisposition.readWrite + : _LValueDisposition.write, ); rhs?.preVisit(visitor); } @@ -6100,15 +6090,13 @@ class Write extends Expression { if (rhs == null) { // We are simulating an increment/decrement operation. // TODO(paulberry): Make a separate node type for this. - type = - h.typeAnalyzer - .analyzeExpression(lhs, h.operations.unknownType) - .unwrapTypeView(); + type = h.typeAnalyzer + .analyzeExpression(lhs, h.operations.unknownType) + .unwrapTypeView(); } else { - type = - h.typeAnalyzer - .analyzeExpression(rhs, h.operations.unknownType) - .unwrapTypeView(); + type = h.typeAnalyzer + .analyzeExpression(rhs, h.operations.unknownType) + .unwrapTypeView(); } lhs._visitWrite(h, this, type, rhs); // TODO(paulberry): null shorting @@ -6678,8 +6666,8 @@ class _MiniAstTypeAnalyzer arguments[i], methodType is FunctionType && !methodType.isQuestionType ? operations.typeToSchema( - SharedTypeView(methodType.positionalParameters[i]), - ) + SharedTypeView(methodType.positionalParameters[i]), + ) : operations.unknownType, ); } @@ -6767,18 +6755,17 @@ class _MiniAstTypeAnalyzer }) { var member = _lookupMember(thisType, propertyName); var memberType = member?._type ?? operations.dynamicType.unwrapTypeView(); - var promotedType = - flow - .propertyGet( - node, - isSuperAccess - ? SuperPropertyTarget.singleton - : ThisPropertyTarget.singleton, - propertyName, - member, - SharedTypeView(memberType), - ) - ?.unwrapTypeView(); + var promotedType = flow + .propertyGet( + node, + isSuperAccess + ? SuperPropertyTarget.singleton + : ThisPropertyTarget.singleton, + propertyName, + member, + SharedTypeView(memberType), + ) + ?.unwrapTypeView(); return new ExpressionTypeAnalysisResult( type: SharedTypeView(promotedType ?? memberType), ); diff --git a/pkg/_fe_analyzer_shared/test/mini_ir.dart b/pkg/_fe_analyzer_shared/test/mini_ir.dart index eaa70043e7c..232a6046593 100644 --- a/pkg/_fe_analyzer_shared/test/mini_ir.dart +++ b/pkg/_fe_analyzer_shared/test/mini_ir.dart @@ -268,8 +268,9 @@ class MiniIRBuilder { }) { var value = _pop(Kind.expression); var index = indexTmp == null ? _pop(Kind.expression) : indexTmp._name; - var receiver = - receiverTmp == null ? _pop(Kind.expression) : receiverTmp._name; + var receiver = receiverTmp == null + ? _pop(Kind.expression) + : receiverTmp._name; _push( IRNode( ir: '[]=($receiver, $index, $value)', @@ -344,8 +345,9 @@ class MiniIRBuilder { required String location, }) { var value = _pop(Kind.expression); - var receiver = - receiverTmp == null ? _pop(Kind.expression) : receiverTmp._name; + var receiver = receiverTmp == null + ? _pop(Kind.expression) + : receiverTmp._name; _push( IRNode( ir: 'set_$propertyName($receiver, $value)', diff --git a/pkg/_fe_analyzer_shared/test/mini_types.dart b/pkg/_fe_analyzer_shared/test/mini_types.dart index 03cbe77487f..b3a154ab663 100644 --- a/pkg/_fe_analyzer_shared/test/mini_types.dart +++ b/pkg/_fe_analyzer_shared/test/mini_types.dart @@ -167,10 +167,9 @@ class FunctionType extends Type implements SharedFunctionType { } if (typeParametersShared.isNotEmpty) { // Check if types are equal under a consistent renaming of type formals - var freshTypeParameterGenerator = - FreshTypeParameterGenerator() - ..excludeNamesUsedIn(this) - ..excludeNamesUsedIn(other); + var freshTypeParameterGenerator = FreshTypeParameterGenerator() + ..excludeNamesUsedIn(this) + ..excludeNamesUsedIn(other); var thisSubstitution = {}; var otherSubstitution = {}; var thisTypeFormalBounds = []; @@ -893,16 +892,13 @@ abstract class Type implements SharedType, _Substitutable { /// - A function type (e.g. `void Function()`) /// - A promoted type variable type (e.g. `T&int`) @override - String toString({bool parenthesizeIfComplex = false}) => - isQuestionType - ? _parenthesizeIf( - parenthesizeIfComplex, - '${_toStringWithoutSuffix(parenthesizeIfComplex: true)}' - '?', - ) - : _toStringWithoutSuffix( - parenthesizeIfComplex: parenthesizeIfComplex, - ); + String toString({bool parenthesizeIfComplex = false}) => isQuestionType + ? _parenthesizeIf( + parenthesizeIfComplex, + '${_toStringWithoutSuffix(parenthesizeIfComplex: true)}' + '?', + ) + : _toStringWithoutSuffix(parenthesizeIfComplex: parenthesizeIfComplex); /// Returns a string representation of the portion of this string that /// precedes the nullability suffix. @@ -1225,11 +1221,10 @@ class TypeSystem { 'Future': (_) => [Type('Object')], 'int': (_) => [Type('num'), Type('Object')], 'Iterable': (_) => [Type('Object')], - 'List': - (args) => [ - PrimaryType(TypeRegistry.iterable, args: args), - Type('Object'), - ], + 'List': (args) => [ + PrimaryType(TypeRegistry.iterable, args: args), + Type('Object'), + ], 'Map': (_) => [Type('Object')], 'Object': (_) => [], 'num': (_) => [Type('Object')], @@ -2431,10 +2426,10 @@ extension on List { newType == null ? namedFunctionParameter : NamedFunctionParameter( - isRequired: namedFunctionParameter.isRequired, - name: namedFunctionParameter.name, - type: newType, - ), + isRequired: namedFunctionParameter.isRequired, + name: namedFunctionParameter.name, + type: newType, + ), ); } return newList; @@ -2458,10 +2453,10 @@ extension on List { newType == null ? namedFunctionParameter : NamedFunctionParameter( - isRequired: namedFunctionParameter.isRequired, - name: namedFunctionParameter.name, - type: newType, - ), + isRequired: namedFunctionParameter.isRequired, + name: namedFunctionParameter.name, + type: newType, + ), ); } return newList; diff --git a/pkg/_fe_analyzer_shared/test/scanner_benchmark.dart b/pkg/_fe_analyzer_shared/test/scanner_benchmark.dart index b6c904b9795..744c8c9b178 100644 --- a/pkg/_fe_analyzer_shared/test/scanner_benchmark.dart +++ b/pkg/_fe_analyzer_shared/test/scanner_benchmark.dart @@ -50,33 +50,30 @@ void main(List args) { case ScanType.string: lengthProcessed = content.length; for (int i = 0; i < iterations; i++) { - hasErrors = - scanString( - content, - configuration: new ScannerConfiguration(enableTripleShift: true), - includeComments: true, - ).hasErrors; + hasErrors = scanString( + content, + configuration: new ScannerConfiguration(enableTripleShift: true), + includeComments: true, + ).hasErrors; } case ScanType.bytes: lengthProcessed = contentBytes.length; for (int i = 0; i < iterations; i++) { - hasErrors = - scan( - contentBytes, - configuration: new ScannerConfiguration(enableTripleShift: true), - includeComments: true, - ).hasErrors; + hasErrors = scan( + contentBytes, + configuration: new ScannerConfiguration(enableTripleShift: true), + includeComments: true, + ).hasErrors; } case ScanType.stringAsBytes: lengthProcessed = content.length; for (int i = 0; i < iterations; i++) { Uint8List tmp = utf8.encode(contentZeroTerminated); - hasErrors = - scan( - tmp, - configuration: new ScannerConfiguration(enableTripleShift: true), - includeComments: true, - ).hasErrors; + hasErrors = scan( + tmp, + configuration: new ScannerConfiguration(enableTripleShift: true), + includeComments: true, + ).hasErrors; } case ScanType.countLfs: lengthProcessed = contentBytes.length; diff --git a/pkg/_fe_analyzer_shared/test/type_inference/type_inference_test.dart b/pkg/_fe_analyzer_shared/test/type_inference/type_inference_test.dart index dd18f702021..cc1c3d12b41 100644 --- a/pkg/_fe_analyzer_shared/test/type_inference/type_inference_test.dart +++ b/pkg/_fe_analyzer_shared/test/type_inference/type_inference_test.dart @@ -1371,8 +1371,9 @@ main() { h.run( [ switch_(expr('int')..errorId = 'SCRUTINEE', [ - (expr('num') - ..errorId = 'EXPRESSION').pattern.then([break_()]), + (expr( + 'num', + )..errorId = 'EXPRESSION').pattern.then([break_()]), ], isLegacyExhaustive: false), ], expectedErrors: { @@ -1388,8 +1389,9 @@ main() { h.run( [ switch_(expr('int')..errorId = 'SCRUTINEE', [ - (expr('String') - ..errorId = 'EXPRESSION').pattern.then([break_()]), + (expr( + 'String', + )..errorId = 'EXPRESSION').pattern.then([break_()]), ], isLegacyExhaustive: false), ], expectedErrors: { @@ -1414,8 +1416,9 @@ main() { h.run( [ switch_(expr('int')..errorId = 'SCRUTINEE', [ - (expr('dynamic') - ..errorId = 'EXPRESSION').pattern.then([break_()]), + (expr( + 'dynamic', + )..errorId = 'EXPRESSION').pattern.then([break_()]), ], isLegacyExhaustive: false), ], expectedErrors: { @@ -2753,9 +2756,9 @@ main() { h.run( [ (patternVariableDeclaration( - (wildcard(type: 'int') - ..errorId = - 'LHS').and(wildcard(type: 'double')..errorId = 'RHS'), + (wildcard(type: 'int')..errorId = 'LHS').and( + wildcard(type: 'double')..errorId = 'RHS', + ), expr('num'), )..errorId = 'CONTEXT'), ], @@ -3575,8 +3578,9 @@ main() { [ (patternVariableDeclaration( recordPattern([ - (Var('a').pattern(type: 'int') - ..errorId = 'VAR(a)').recordField(), + (Var( + 'a', + ).pattern(type: 'int')..errorId = 'VAR(a)').recordField(), Var('b').pattern().recordField(), ])..errorId = 'PATTERN', expr('(int,)').checkSchema('(int, _)'), @@ -3705,8 +3709,9 @@ main() { [ (patternVariableDeclaration( recordPattern([ - (Var('a').pattern(type: 'int') - ..errorId = 'VAR(a)').recordField('a'), + (Var('a').pattern( + type: 'int', + )..errorId = 'VAR(a)').recordField('a'), Var('b').pattern().recordField('b'), ])..errorId = 'PATTERN', expr('({int a})').checkSchema('({int a, _ b})'), diff --git a/pkg/_fe_analyzer_shared/test/util/libraries_specification_test.dart b/pkg/_fe_analyzer_shared/test/util/libraries_specification_test.dart index eb891bed859..0be6f8c0466 100644 --- a/pkg/_fe_analyzer_shared/test/util/libraries_specification_test.dart +++ b/pkg/_fe_analyzer_shared/test/util/libraries_specification_test.dart @@ -479,7 +479,8 @@ void main() { test('include entry must be a existing path and target', () async { var otherFile = 'g.json'; var otherUri = specUri.resolve(otherFile); - var jsonString = ''' + var jsonString = + ''' { "target": { "include": [{"path": "$otherFile", "target": "none"}], @@ -531,7 +532,8 @@ void main() { var thisUri = specUri.resolve(thisFile); var otherFile = 'g.json'; var otherUri = thisUri.resolve(otherFile); - var thisJsonString = ''' + var thisJsonString = + ''' { "target": { "include": [{"path": "$thisFile", "target": "target"}], @@ -547,7 +549,8 @@ void main() { throwsA(checkException(messageCyclicSpec(thisUri))), ); - thisJsonString = ''' + thisJsonString = + ''' { "target": { "include": [{"path": "$otherFile", "target": "none"}], @@ -555,7 +558,8 @@ void main() { } } '''; - var otherJsonString = ''' + var otherJsonString = + ''' { "none": { "include": [{"path": "$thisFile", "target": "target"}], @@ -614,7 +618,8 @@ void main() { var otherUri2 = thisUri.resolve(otherFile2); var otherFile3 = '../i.json'; var otherUri3 = otherUri2.resolve(otherFile3); - var thisJsonString = ''' + var thisJsonString = + ''' { "foo": { "include": [ @@ -645,7 +650,8 @@ void main() { } } }'''; - var otherJsonString2 = ''' + var otherJsonString2 = + ''' { "foo": { "libraries": { @@ -962,7 +968,8 @@ void main() { } } } - '''.replaceAll(new RegExp('\\s'), ''), + ''' + .replaceAll(new RegExp('\\s'), ''), ); }); });