mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
Python: Add test for @property problem
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
failures
|
||||
debug_callableNotUnique
|
||||
| code/class_properties.py:7:5:7:18 | Function arg | Qualified function name 'Prop.arg' is not unique within its file. Please fix. |
|
||||
| code/class_properties.py:12:5:12:25 | Function arg | Qualified function name 'Prop.arg' is not unique within its file. Please fix. |
|
||||
| code/class_properties.py:17:5:17:18 | Function arg | Qualified function name 'Prop.arg' is not unique within its file. Please fix. |
|
||||
| code/class_properties.py:10:5:10:18 | Function arg | Qualified function name 'Prop.arg' is not unique within its file. Please fix. |
|
||||
| code/class_properties.py:15:5:15:25 | Function arg | Qualified function name 'Prop.arg' is not unique within its file. Please fix. |
|
||||
| code/class_properties.py:20:5:20:18 | Function arg | Qualified function name 'Prop.arg' is not unique within its file. Please fix. |
|
||||
pointsTo_found_typeTracker_notFound
|
||||
| code/class_attr_assign.py:10:9:10:27 | ControlFlowNode for Attribute() | my_func |
|
||||
| code/class_attr_assign.py:11:9:11:25 | ControlFlowNode for Attribute() | my_func |
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
def func():
|
||||
print("func")
|
||||
|
||||
class Prop(object):
|
||||
def __init__(self, arg):
|
||||
self._arg = arg
|
||||
@@ -32,6 +35,11 @@ class Prop(object):
|
||||
|
||||
arg2 = property(_arg2_getter, _arg2_setter, _arg2_deleter)
|
||||
|
||||
@property
|
||||
def func_prop(self):
|
||||
print("Prop.func_prop getter")
|
||||
return func
|
||||
|
||||
prop = Prop(42) # $ tt=Prop.__init__
|
||||
|
||||
prop.arg
|
||||
@@ -41,3 +49,6 @@ del prop.arg
|
||||
prop.arg2
|
||||
prop.arg2 = 43
|
||||
del prop.arg2
|
||||
|
||||
f = prop.func_prop
|
||||
f() # $ SPURIOUS: tt=Prop.func_prop MISSING: tt=func
|
||||
|
||||
Reference in New Issue
Block a user