File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed
csharp/ql/test/library-tests/dataflow/fields Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -51,3 +51,41 @@ public static void Sink(object o) { }
5151
5252 static T Source < T > ( object source ) => throw null ;
5353}
54+
55+ public partial class DPartial
56+ {
57+ private object _backingField ;
58+ public partial object PartialProp1
59+ {
60+ get { return _backingField ; }
61+ set { _backingField = value ; }
62+ }
63+
64+ public partial object PartialProp2
65+ {
66+ get { return null ; }
67+ set { }
68+ }
69+ }
70+
71+ public partial class DPartial
72+ {
73+ public partial object PartialProp1 { get ; set ; }
74+ public partial object PartialProp2 { get ; set ; }
75+
76+ public void M ( )
77+ {
78+ var o = Source < object > ( 1 ) ;
79+
80+ var d = new DPartial ( ) ;
81+ d . PartialProp1 = o ;
82+ d . PartialProp2 = o ;
83+
84+ Sink ( d . PartialProp1 ) ; // $ hasValueFlow=1
85+ Sink ( d . PartialProp2 ) ; // no flow
86+ }
87+
88+ public static void Sink ( object o ) { }
89+
90+ static T Source < T > ( object source ) => throw null ;
91+ }
You can’t perform that action at this time.
0 commit comments