fubark / cyber

Fast and concurrent scripting.
https://cyberscript.dev
MIT License
1.16k stars 38 forks source link

Cyber crashes (method with self parameter inside object) #71

Closed shimamura-sakura closed 7 months ago

shimamura-sakura commented 8 months ago

Version: release 0.3

This segfaults:

type A object:
    func b(self):
        pass

Removing self makes it don't crash.

Also, this doesn't segfault:

type A object:
    var i int
    func b(self):
        pass

I guess one shouldn't declare methods with self inside an object?

fubark commented 8 months ago

That's correct, it used to require self as a param but now you just use self inside the body. The fact that it's segfaulting for that is a bug, it should be a compile error instead.