@@ -1119,6 +1119,7 @@ final class AssignedVariablePatternImpl extends VariablePatternImpl
11191119@AnalyzerPublicApi(message: 'exported by lib/dart/ast/ast.dart')
11201120abstract final class AssignmentExpression
11211121 implements
1122+ // ignore: deprecated_member_use_from_same_package
11221123 NullShortableExpression,
11231124 MethodReferenceExpression,
11241125 CompoundAssignmentExpression {
@@ -2159,7 +2160,10 @@ final class BreakStatementImpl extends StatementImpl implements BreakStatement {
21592160/// | identifier
21602161@AnalyzerPublicApi(message: 'exported by lib/dart/ast/ast.dart')
21612162abstract final class CascadeExpression
2162- implements Expression, NullShortableExpression {
2163+ implements
2164+ Expression,
2165+ // ignore: deprecated_member_use_from_same_package
2166+ NullShortableExpression {
21632167 /// The cascade sections sharing the common target.
21642168 NodeList<Expression> get cascadeSections;
21652169
@@ -7977,6 +7981,15 @@ sealed class ExpressionImpl extends CollectionElementImpl
79777981 }
79787982 }
79797983
7984+ /// Called when null shorting terminates, and so the type of an expression
7985+ /// needs to be made nullable.
7986+ ///
7987+ /// [type] is the new static type of the expression.
7988+ void recordNullShortedType(TypeImpl type) {
7989+ _staticType = type;
7990+ inferenceLogWriter?.recordNullShortedType(this, type);
7991+ }
7992+
79807993 /// Record that the static type of the given node is the given type.
79817994 ///
79827995 /// @param expression the node whose type is to be recorded
@@ -11198,7 +11211,10 @@ final class FunctionExpressionImpl extends ExpressionImpl
1119811211/// [Expression] [TypeArgumentList]? [ArgumentList]
1119911212@AnalyzerPublicApi(message: 'exported by lib/dart/ast/ast.dart')
1120011213abstract final class FunctionExpressionInvocation
11201- implements NullShortableExpression, InvocationExpression {
11214+ implements
11215+ // ignore: deprecated_member_use_from_same_package
11216+ NullShortableExpression,
11217+ InvocationExpression {
1120211218 /// The element associated with the function being invoked based on static
1120311219 /// type information.
1120411220 ///
@@ -13365,7 +13381,10 @@ final class ImportPrefixReferenceImpl extends AstNodeImpl
1336513381/// [Expression] '[' [Expression] ']'
1336613382@AnalyzerPublicApi(message: 'exported by lib/dart/ast/ast.dart')
1336713383abstract final class IndexExpression
13368- implements NullShortableExpression, MethodReferenceExpression {
13384+ implements
13385+ // ignore: deprecated_member_use_from_same_package
13386+ NullShortableExpression,
13387+ MethodReferenceExpression {
1336913388 /// The expression used to compute the index.
1337013389 Expression get index;
1337113390
@@ -16097,7 +16116,10 @@ final class MethodDeclarationImpl extends ClassMemberImpl
1609716116/// [ArgumentList]
1609816117@AnalyzerPublicApi(message: 'exported by lib/dart/ast/ast.dart')
1609916118abstract final class MethodInvocation
16100- implements NullShortableExpression, InvocationExpression {
16119+ implements
16120+ // ignore: deprecated_member_use_from_same_package
16121+ NullShortableExpression,
16122+ InvocationExpression {
1610116123 /// Whether this expression is cascaded.
1610216124 ///
1610316125 /// If it is, then the target of this expression isn't stored locally but is
@@ -17866,7 +17888,12 @@ final class NullLiteralImpl extends LiteralImpl implements NullLiteral {
1786617888}
1786717889
1786817890/// Abstract interface for expressions that may participate in null-shorting.
17891+ ///
17892+ /// This is an analyzer-internal interface that was exposed through the public
17893+ /// API by mistake. It is deprecated and will be removed in analyzer version
17894+ /// 9.0.0.
1786917895@AnalyzerPublicApi(message: 'exported by lib/dart/ast/ast.dart')
17896+ @Deprecated('No longer supported.')
1787017897abstract final class NullShortableExpression implements Expression {
1787117898 /// The expression that terminates any null shorting that might occur in this
1787217899 /// expression.
@@ -17883,10 +17910,14 @@ abstract final class NullShortableExpression implements Expression {
1788317910 /// Calling [nullShortingTermination] on any of these subexpressions yields
1788417911 /// the expression `a?.b[c] = d`, indicating that the null-shorting induced by
1788517912 /// the `?.` causes the rest of the subexpression `a?.b[c] = d` to be skipped.
17913+ @Deprecated('No longer supported.')
1788617914 Expression get nullShortingTermination;
1788717915}
1788817916
17889- base mixin NullShortableExpressionImpl implements NullShortableExpression {
17917+ base mixin NullShortableExpressionImpl
17918+ implements
17919+ // ignore: deprecated_member_use_from_same_package
17920+ NullShortableExpression {
1789017921 @override
1789117922 Expression get nullShortingTermination {
1789217923 var result = this;
@@ -19121,6 +19152,7 @@ final class PatternVariableDeclarationStatementImpl extends StatementImpl
1912119152abstract final class PostfixExpression
1912219153 implements
1912319154 Expression,
19155+ // ignore: deprecated_member_use_from_same_package
1912419156 NullShortableExpression,
1912519157 MethodReferenceExpression,
1912619158 CompoundAssignmentExpression {
@@ -19398,6 +19430,7 @@ final class PrefixedIdentifierImpl extends IdentifierImpl
1939819430abstract final class PrefixExpression
1939919431 implements
1940019432 Expression,
19433+ // ignore: deprecated_member_use_from_same_package
1940119434 NullShortableExpression,
1940219435 MethodReferenceExpression,
1940319436 CompoundAssignmentExpression {
@@ -19531,7 +19564,10 @@ final class PrefixExpressionImpl extends ExpressionImpl
1953119564/// [Expression] '.' [SimpleIdentifier]
1953219565@AnalyzerPublicApi(message: 'exported by lib/dart/ast/ast.dart')
1953319566abstract final class PropertyAccess
19534- implements NullShortableExpression, CommentReferableExpression {
19567+ implements
19568+ // ignore: deprecated_member_use_from_same_package
19569+ NullShortableExpression,
19570+ CommentReferableExpression {
1953519571 /// Whether this expression is cascaded.
1953619572 ///
1953719573 /// If it is, then the target of this expression isn't stored locally but is
0 commit comments