First pass at implementing foreign classes.
Most of the pieces are there: - You can declare a foreign class. - It will call your C function to provide an allocator function. - Whenever a foreign object is created, it calls the allocator. - Foreign methods can access the foreign bytes of an object. - Most of the runtime checking is in place for things like subclassing foreign classes. There is still some loose ends to tie up: - Finalizers are not called. - Some of the error-handling could be better. - The GC doesn't track how much memory a marked foreign object uses.
This commit is contained in:
@@ -1 +1 @@
|
||||
class Foo is 123 {} // expect runtime error: Must inherit from a class.
|
||||
class Foo is 123 {} // expect runtime error: Class 'Foo' cannot inherit from a non-class object.
|
||||
|
||||
Reference in New Issue
Block a user