Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overriding final function builds, but segfaults when run #851

Closed
davidhesselbom opened this issue Jan 9, 2015 · 3 comments
Closed

Overriding final function builds, but segfaults when run #851

davidhesselbom opened this issue Jan 9, 2015 · 3 comments
Milestone

Comments

@davidhesselbom
Copy link
Contributor

This builds, but when you run the program, it segfaults. I don't think it should build in the first place. Is this a bug?

First: class {
    init: func
    test: final func
}

Second: class extends First {
    init: func
    test: func
}

s := Second new()
s test()
@horasal
Copy link
Contributor

horasal commented Jan 9, 2015

I think it should be disallowed.
Inheriting from a final function makes no sense.

But how should we do with cover? It seems that every function in cover is final.

@horasal
Copy link
Contributor

horasal commented Jan 9, 2015

related problem:

First: class {
    init: func
    test: func
}

Second: class extends First {
    init: func
    test: final func
}

s := Second new()
s test()

By compiling the above code, I get:

test.ooc: In function ‘test__Second_class’:
test.ooc:28:29: error: ‘test__Second_test_impl’ undeclared (first use in this function)

Final func does not have impl, but rock is still using _impl when accessing it.

        .test = (void*) test__Second_test_impl,

patch:
horasal@6921ea6

@fasterthanlime
Copy link
Collaborator

Seems like this has been fixed in master, not sure why this bug is still open!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants