File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
csharp/ql/src/Useless code Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ private predicate alwaysInvokesToString(ParameterRead pr) {
4646 * method from `System.Object` or `System.ValueType`.
4747 */
4848predicate alwaysDefaultToString ( ValueOrRefType t ) {
49+ not t instanceof TupleType and
4950 exists ( ToStringMethod m | t .hasMethod ( m ) |
5051 m .getDeclaringType ( ) instanceof SystemObjectClass or
5152 m .getDeclaringType ( ) instanceof SystemValueTypeClass
@@ -55,6 +56,11 @@ predicate alwaysDefaultToString(ValueOrRefType t) {
5556 overriding .getABaseType + ( ) = t
5657 ) and
5758 ( ( t .isAbstract ( ) or t instanceof Interface ) implies not t .isEffectivelyPublic ( ) )
59+ or
60+ exists ( ValueOrRefType elem |
61+ elem = t .( TupleType ) .getElementType ( _) and
62+ alwaysDefaultToString ( elem )
63+ )
5864}
5965
6066class DefaultToStringType extends ValueOrRefType {
You can’t perform that action at this time.
0 commit comments