magic-lang / rock

ooc compiler written in ooc
http://ooc-lang.org/
MIT License
14 stars 4 forks source link

Method call on tuple may cause rock to throw an exception #52

Closed thomasfanell closed 8 years ago

thomasfanell commented 8 years ago

@zhaihj could you take a look at this?

Base: abstract class { }
Foo: class extends Base { init: func }

This piece of code works just fine:

(Foo new(), Foo new()) free() // calling Object free()

The code below will cause rock to flame out with [Exception in FunctionCallWriter]: Trying to write unresolved function a free():

a := Foo new()
b := Foo new()
(a, b) free()

For some reason, it won't go up to Object free() (here). Of course, if I define a free() myself, this code works, however, one should not be required to override free() is there is nothing to free (or any other method that happen to be defined in Object).