@@ -111,6 +111,29 @@ module SummaryComponentStack {
111
111
112
112
class SummarizedCallable = Impl:: Public:: SummarizedCallable ;
113
113
114
+ private predicate recordConstructorFlow ( Constructor c , int i , Property p ) {
115
+ c = any ( Record r ) .getAMember ( ) and
116
+ exists ( string name |
117
+ c .getParameter ( i ) .getName ( ) = name and
118
+ c .getDeclaringType ( ) .getAMember ( name ) = p
119
+ )
120
+ }
121
+
122
+ private class RecordConstructorFlow extends SummarizedCallable {
123
+ RecordConstructorFlow ( ) { recordConstructorFlow ( this , _, _) }
124
+
125
+ override predicate propagatesFlow (
126
+ SummaryComponentStack input , SummaryComponentStack output , boolean preservesValue
127
+ ) {
128
+ exists ( int i , Property p |
129
+ recordConstructorFlow ( this , i , p ) and
130
+ input = SummaryComponentStack:: argument ( i ) and
131
+ output = SummaryComponentStack:: propertyOf ( p , SummaryComponentStack:: return ( ) ) and
132
+ preservesValue = true
133
+ )
134
+ }
135
+ }
136
+
114
137
private class SummarizedCallableDefaultClearsContent extends Impl:: Public:: SummarizedCallable {
115
138
SummarizedCallableDefaultClearsContent ( ) {
116
139
this instanceof Impl:: Public:: SummarizedCallable or none ( )
@@ -129,3 +152,17 @@ private class SummarizedCallableDefaultClearsContent extends Impl::Public::Summa
129
152
}
130
153
131
154
class RequiredSummaryComponentStack = Impl:: Public:: RequiredSummaryComponentStack ;
155
+
156
+ private class RecordConstructorFlowRequiredSummaryComponentStack extends RequiredSummaryComponentStack {
157
+ private SummaryComponent head ;
158
+
159
+ RecordConstructorFlowRequiredSummaryComponentStack ( ) {
160
+ exists ( Property p |
161
+ recordConstructorFlow ( _, _, p ) and
162
+ head = SummaryComponent:: property ( p ) and
163
+ this = SummaryComponentStack:: singleton ( SummaryComponent:: return ( ) )
164
+ )
165
+ }
166
+
167
+ override predicate required ( SummaryComponent c ) { c = head }
168
+ }
0 commit comments