Lichen

Change of resolving.py

31:ced5eba497fd
resolving.py
     1.1 --- a/resolving.py	Mon Sep 05 23:38:33 2016 +0200
     1.2 +++ b/resolving.py	Mon Sep 05 23:53:52 2016 +0200
     1.3 @@ -117,12 +117,10 @@
     1.4                  ref = self.convert_invocation(ref)
     1.5                  self.importer.objects[key] = self.objects[key] = ref
     1.6  
     1.7 -        # Rewrite function defaults, which are effectively extra members of the
     1.8 -        # module.
     1.9 +        # Convert function defaults, which are effectively extra members of the
    1.10 +        # module, and function locals.
    1.11  
    1.12 -        defaults = self.function_defaults.items()
    1.13 -
    1.14 -        for fname, parameters in defaults:
    1.15 +        for fname, parameters in self.function_defaults.items():
    1.16              l = []
    1.17              for pname, ref in parameters:
    1.18                  if ref.has_kind("<invoke>"):
    1.19 @@ -130,6 +128,14 @@
    1.20                  l.append((pname, ref))
    1.21              self.function_defaults[fname] = l
    1.22  
    1.23 +        # Convert function locals referencing invocations.
    1.24 +
    1.25 +        for fname, names in self.function_locals.items():
    1.26 +            for name, ref in names.items():
    1.27 +                if ref.has_kind("<invoke>"):
    1.28 +                    ref = self.convert_invocation(ref)
    1.29 +                    names[name] = ref
    1.30 +
    1.31      def convert_invocation(self, ref):
    1.32  
    1.33          "Convert the given invocation 'ref', handling instantiation."