# HG changeset patch # User Paul Boddie # Date 1480163629 -3600 # Node ID 3914ca979652b7d8a116f9beba1466c5f3d5373d # Parent 78c5ac97463db6bc529d0a7076fa5fc54444ac99 Use computed targets for known callables, thus obtaining bound methods. diff -r 78c5ac97463d -r 3914ca979652 tests/methods_unbound.py --- a/tests/methods_unbound.py Sat Nov 26 01:25:26 2016 +0100 +++ b/tests/methods_unbound.py Sat Nov 26 13:33:49 2016 +0100 @@ -76,6 +76,7 @@ except UnboundMethodInvocation: print "f(C, 1): Unbound method is not callable." +print f(c, 1) # 1 fn = f(C, 0) try: diff -r 78c5ac97463d -r 3914ca979652 translator.py --- a/translator.py Sat Nov 26 01:25:26 2016 +0100 +++ b/translator.py Sat Nov 26 13:33:49 2016 +0100 @@ -1073,8 +1073,8 @@ if target: stages.append(target) elif function: - stages.append("__load_via_object(&%s, %s).fn" % ( - encode_path(function), encode_symbol("pos", "__fn__"))) + stages.append("__load_via_object(__tmp_targets[%d].value, %s).fn" % ( + self.function_target, encode_symbol("pos", "__fn__"))) # With a known target, the function is obtained directly and called.