1.1 --- a/tests/attribute_access_type_restriction_new.py Tue Feb 23 01:30:51 2010 +0100
1.2 +++ b/tests/attribute_access_type_restriction_new.py Thu Feb 25 01:22:21 2010 +0100
1.3 @@ -1,5 +1,10 @@
1.4 #!/usr/bin/env python
1.5
1.6 +"""
1.7 +This test illustrates the need for propagation of usage to assignments providing
1.8 +active name definitions.
1.9 +"""
1.10 +
1.11 class C:
1.12 def f(self):
1.13 return 1
1.14 @@ -19,15 +24,11 @@
1.15 return 5
1.16
1.17 def test_new(obj, obj2):
1.18 - # obj: C, D, E (f)
1.19 - # obj2:
1.20 - if obj.f(): # C, D, E (f)
1.21 - obj = obj2 # obj: D (g)
1.22 - obj.g() # D (g)
1.23 - # else:
1.24 - # ... # obj: C, D, E (f)
1.25 - # # (g) ^ (f)
1.26 - return obj.f() # C, D, E (f)
1.27 + # obj should provide f
1.28 + if obj.f():
1.29 + obj = obj2 # should provide f, g
1.30 + obj.g()
1.31 + return obj.f()
1.32
1.33 c = C()
1.34 d = D()