gracelang / minigrace

Self-hosting compiler for the Grace programming language
39 stars 22 forks source link

Can't inherit from emptyList #213

Open apblack opened 8 years ago

apblack commented 8 years ago

In the C backend, an object that tries to inherit from emptyList gets

NoSuchMethod at line 22 of parser: no method 'emptyList$object(1)' in Module. called from Module.emptyList$object(1) (defined nowhere in standardGrace module)

I think that this is because emptyList is not defined as a class, but as a method that tail-returns a fresh object.

The workaround is to write

inherit collections.list.withAll []

instead.