@@ -52,9 +52,8 @@ class DemoteViaExplicitWrite<Variable extends Object>
5252 String get shortName => 'explicitWrite' ;
5353
5454 @override
55- R accept< R , Node extends Object , Variable extends Object ,
56- Type extends Object > (
57- NonPromotionReasonVisitor <R , Node , Variable , Type > visitor) =>
55+ R accept <R , Node extends Object , Variable extends Object >(
56+ NonPromotionReasonVisitor <R , Node , Variable > visitor) =>
5857 visitor.visitDemoteViaExplicitWrite (
5958 this as DemoteViaExplicitWrite <Variable >);
6059
@@ -2978,23 +2977,22 @@ abstract class NonPromotionReason {
29782977 String get shortName;
29792978
29802979 /// Implementation of the visitor pattern for non-promotion reasons.
2981- R accept< R , Node extends Object , Variable extends Object ,
2982- Type extends Object > (
2983- NonPromotionReasonVisitor <R , Node , Variable , Type > visitor);
2980+ R accept <R , Node extends Object , Variable extends Object >(
2981+ NonPromotionReasonVisitor <R , Node , Variable > visitor);
29842982}
29852983
29862984/// Implementation of the visitor pattern for non-promotion reasons.
29872985abstract class NonPromotionReasonVisitor <R , Node extends Object ,
2988- Variable extends Object , Type extends Object > {
2986+ Variable extends Object > {
29892987 NonPromotionReasonVisitor ._() : assert (false , 'Do not extend this class' );
29902988
29912989 R visitDemoteViaExplicitWrite (DemoteViaExplicitWrite <Variable > reason);
29922990
29932991 R visitPropertyNotPromotedForInherentReason (
2994- PropertyNotPromotedForInherentReason < Type > reason);
2992+ PropertyNotPromotedForInherentReason reason);
29952993
29962994 R visitPropertyNotPromotedForNonInherentReason (
2997- PropertyNotPromotedForNonInherentReason < Type > reason);
2995+ PropertyNotPromotedForNonInherentReason reason);
29982996
29992997 R visitThisNotPromoted (ThisNotPromoted reason);
30002998}
@@ -3624,37 +3622,30 @@ class PromotionModel<Type extends Object> {
36243622
36253623/// Non-promotion reason describing the situation where an expression was not
36263624/// promoted due to the fact that it's a property get.
3627- abstract base class PropertyNotPromoted <Type extends Object >
3628- extends NonPromotionReason {
3625+ abstract base class PropertyNotPromoted extends NonPromotionReason {
36293626 /// The name of the property.
36303627 final String propertyName;
36313628
36323629 /// The field or property being accessed. This matches a `propertyMember`
36333630 /// value that was passed to [FlowAnalysis.propertyGet] .
36343631 final Object ? propertyMember;
36353632
3636- /// The static type of the property at the time of the access. This is the
3637- /// type that was passed to [FlowAnalysis.whyNotPromoted] ; it is provided to
3638- /// the client as a convenience for ID testing.
3639- final Type staticType;
3640-
36413633 /// Whether field promotion is enabled for the current library.
36423634 final bool fieldPromotionEnabled;
36433635
3644- PropertyNotPromoted (this .propertyName, this .propertyMember, this .staticType,
3636+ PropertyNotPromoted (this .propertyName, this .propertyMember,
36453637 {required this .fieldPromotionEnabled});
36463638}
36473639
36483640/// Non-promotion reason describing the situation where an expression was not
36493641/// promoted due to the fact that it's a property get, and the target of the
36503642/// property get is something inherently non-promotable.
3651- final class PropertyNotPromotedForInherentReason <Type extends Object >
3652- extends PropertyNotPromoted <Type > {
3643+ final class PropertyNotPromotedForInherentReason extends PropertyNotPromoted {
36533644 /// The reason why the property isn't promotable.
36543645 final PropertyNonPromotabilityReason whyNotPromotable;
36553646
3656- PropertyNotPromotedForInherentReason (super .propertyName, super .propertyMember,
3657- super .staticType , this .whyNotPromotable,
3647+ PropertyNotPromotedForInherentReason (
3648+ super .propertyName, super .propertyMember , this .whyNotPromotable,
36583649 {required super .fieldPromotionEnabled});
36593650
36603651 @override
@@ -3674,11 +3665,9 @@ final class PropertyNotPromotedForInherentReason<Type extends Object>
36743665 String get shortName => 'propertyNotPromotedForInherentReason' ;
36753666
36763667 @override
3677- R accept< R , Node extends Object , Variable extends Object ,
3678- Type extends Object > (
3679- NonPromotionReasonVisitor <R , Node , Variable , Type > visitor) =>
3680- visitor.visitPropertyNotPromotedForInherentReason (
3681- this as PropertyNotPromotedForInherentReason <Type >);
3668+ R accept <R , Node extends Object , Variable extends Object >(
3669+ NonPromotionReasonVisitor <R , Node , Variable > visitor) =>
3670+ visitor.visitPropertyNotPromotedForInherentReason (this );
36823671}
36833672
36843673/// Non-promotion reason describing the situation where an expression was not
@@ -3698,10 +3687,10 @@ final class PropertyNotPromotedForInherentReason<Type extends Object>
36983687/// promotion being disabled. So this class is used for both scenarios; it is up
36993688/// to the client to determine the correct non-promotion reason to report to the
37003689/// user.
3701- final class PropertyNotPromotedForNonInherentReason < Type extends Object >
3702- extends PropertyNotPromoted < Type > {
3690+ final class PropertyNotPromotedForNonInherentReason
3691+ extends PropertyNotPromoted {
37033692 PropertyNotPromotedForNonInherentReason (
3704- super .propertyName, super .propertyMember, super .staticType,
3693+ super .propertyName, super .propertyMember,
37053694 {required super .fieldPromotionEnabled});
37063695
37073696 @override
@@ -3711,11 +3700,9 @@ final class PropertyNotPromotedForNonInherentReason<Type extends Object>
37113700 String get shortName => 'PropertyNotPromotedForNonInherentReason' ;
37123701
37133702 @override
3714- R accept< R , Node extends Object , Variable extends Object ,
3715- Type extends Object > (
3716- NonPromotionReasonVisitor <R , Node , Variable , Type > visitor) =>
3717- visitor.visitPropertyNotPromotedForNonInherentReason (
3718- this as PropertyNotPromotedForNonInherentReason <Type >);
3703+ R accept <R , Node extends Object , Variable extends Object >(
3704+ NonPromotionReasonVisitor <R , Node , Variable > visitor) =>
3705+ visitor.visitPropertyNotPromotedForNonInherentReason (this );
37193706}
37203707
37213708/// Target for a property access that might undergo promotion.
@@ -4115,9 +4102,8 @@ class ThisNotPromoted extends NonPromotionReason {
41154102 String get shortName => 'thisNotPromoted' ;
41164103
41174104 @override
4118- R accept< R , Node extends Object , Variable extends Object ,
4119- Type extends Object > (
4120- NonPromotionReasonVisitor <R , Node , Variable , Type > visitor) =>
4105+ R accept <R , Node extends Object , Variable extends Object >(
4106+ NonPromotionReasonVisitor <R , Node , Variable > visitor) =>
41214107 visitor.visitThisNotPromoted (this );
41224108}
41234109
@@ -5924,12 +5910,11 @@ class _FlowAnalysisImpl<Node extends Object, Statement extends Node,
59245910 for (Type type in previouslyPromotedTypes) {
59255911 result[type] = whyNotPromotable == null
59265912 ? new PropertyNotPromotedForNonInherentReason (
5927- reference.propertyName, propertyMember, reference._type,
5913+ reference.propertyName, propertyMember,
59285914 fieldPromotionEnabled: fieldPromotionEnabled)
59295915 : new PropertyNotPromotedForInherentReason (
59305916 reference.propertyName,
59315917 propertyMember,
5932- reference._type,
59335918 whyNotPromotable,
59345919 fieldPromotionEnabled: fieldPromotionEnabled);
59355920 }
0 commit comments