1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/tests/abandoned_attribute_usage_multiple_candidates_nested.py Sun Feb 14 23:49:17 2010 +0100
1.3 @@ -0,0 +1,31 @@
1.4 +#!/usr/bin/env python
1.5 +
1.6 +"""
1.7 +This test attempts to cause the recording of the usage of 'C' in the function
1.8 +'g', alongside the expectation that 'D' might be used instead. A guard
1.9 +stipulating constraints for all of 'g' cannot therefore be generated.
1.10 +"""
1.11 +
1.12 +class C:
1.13 + def f(self):
1.14 + return 1
1.15 +
1.16 +class D:
1.17 + def g(self):
1.18 + return 2
1.19 +
1.20 + def h(self):
1.21 + return 3
1.22 +
1.23 +def g(c):
1.24 + if 1:
1.25 + c.g()
1.26 + if 1:
1.27 + return c.h()
1.28 + return c.f()
1.29 +
1.30 +c = C()
1.31 +d = D()
1.32 +result1_3 = g(d)
1.33 +
1.34 +# vim: tabstop=4 expandtab shiftwidth=4