File tree Expand file tree Collapse file tree 1 file changed +6
-14
lines changed Expand file tree Collapse file tree 1 file changed +6
-14
lines changed Original file line number Diff line number Diff line change @@ -141,20 +141,12 @@ class RelevantDefinition extends AssignableDefinition {
141
141
// Ensure that the definition is not in dead code
142
142
exists ( this .getAControlFlowNode ( ) ) and
143
143
not this .isMaybeLive ( ) and
144
- (
145
- // Allow dead initializer assignments, such as `string s = string.Empty`, but only
146
- // if the initializer expression assigns a default-like value, and there exists another
147
- // definition of the same variable
148
- this .isInitializer ( )
149
- implies
150
- (
151
- not this .isDefaultLikeInitializer ( )
152
- or
153
- not exists ( AssignableDefinition other | other .getTarget ( ) = this .getTarget ( ) |
154
- other != this
155
- )
156
- )
157
- )
144
+ // Allow dead initializer assignments, such as `string s = string.Empty`, but only
145
+ // if the initializer expression assigns a default-like value, and there exists another
146
+ // definition of the same variable
147
+ if this .isDefaultLikeInitializer ( )
148
+ then this = unique( AssignableDefinition def | def .getTarget ( ) = this .getTarget ( ) )
149
+ else any ( )
158
150
}
159
151
}
160
152
You can’t perform that action at this time.
0 commit comments