File tree Expand file tree Collapse file tree 4 files changed +27
-1
lines changed
csharp/ql/test/library-tests/properties Expand file tree Collapse file tree 4 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -230,3 +230,19 @@ properties.cs:
230230#-----| 2: (Parameters)
231231# 124| 0: [Parameter] value
232232# 124| 4: [BlockStmt] {...}
233+ # 128| 10: [Class] UseFieldKeyword
234+ # 130| 6: [Property] Prop
235+ # 130| -1: [TypeMention] object
236+ # 132| 3: [Getter] get_Prop
237+ # 132| 4: [BlockStmt] {...}
238+ # 132| 0: [ReturnStmt] return ...;
239+ # 132| 0: [FieldAccess] access to field Prop.field
240+ # 133| 4: [Setter] set_Prop
241+ #-----| 2: (Parameters)
242+ # 133| 0: [Parameter] value
243+ # 133| 4: [BlockStmt] {...}
244+ # 133| 0: [ExprStmt] ...;
245+ # 133| 0: [AssignExpr] ... = ...
246+ # 133| 0: [FieldAccess] access to field Prop.field
247+ # 133| 1: [ParameterAccess] access to parameter value
248+ # 130| 7: [Field] Prop.field
Original file line number Diff line number Diff line change 1+ | Prop.field |
12| caption |
23| next |
34| y |
Original file line number Diff line number Diff line change 11/**
2- * @name Test that there are no backing fields
2+ * @name Test that there are no backing fields except for properties that use the `field` keyword in their getter or setter.
33 */
44
55import csharp
Original file line number Diff line number Diff line change @@ -124,4 +124,13 @@ int InterfaceWithProperties.Prop2
124124 set { }
125125 }
126126 }
127+
128+ class UseFieldKeyword
129+ {
130+ public object Prop
131+ {
132+ get { return field ; }
133+ set { field = value ; }
134+ }
135+ }
127136}
You can’t perform that action at this time.
0 commit comments