File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
csharp/ql/lib/semmle/code/csharp/dataflow/internal Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -2080,6 +2080,16 @@ class CaptureNode extends NodeImpl, TCaptureNode {
20802080 override string toStringImpl ( ) { result = cn .toString ( ) }
20812081}
20822082
2083+ /**
2084+ * Holds if a property has accessors declared in multiple locations, and where
2085+ * all accessors have at least one declaration without a body.
2086+ * This can happen if both a "real" and a "stub" implementation is included in the
2087+ * same database (which is the case for .NET Runtime).
2088+ */
2089+ private predicate hasAutoImplementation ( Property p ) {
2090+ forall ( Accessor a | a = p .getAnAccessor ( ) | count ( getASourceLocation ( a ) ) > count ( a .getBody ( ) ) )
2091+ }
2092+
20832093/** A field or a property. */
20842094class FieldOrProperty extends Assignable , Modifiable {
20852095 FieldOrProperty ( ) {
@@ -2100,6 +2110,8 @@ class FieldOrProperty extends Assignable, Modifiable {
21002110 p .isAutoImplementedReadOnly ( )
21012111 or
21022112 p .getDeclaringType ( ) instanceof AnonymousClass
2113+ or
2114+ hasAutoImplementation ( p )
21032115 )
21042116 or
21052117 p .fromLibrary ( )
You can’t perform that action at this time.
0 commit comments