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

Comments

Projects
None yet
3 participants
@davidhesselbom
Contributor

davidhesselbom commented Jan 9, 2015

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()
@zhaihj

This comment has been minimized.

Contributor

zhaihj 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.

@zhaihj

This comment has been minimized.

Contributor

zhaihj 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:
zhaihj@6921ea6

fasterthanlime added a commit that referenced this issue Jan 12, 2015

@fasterthanlime

This comment has been minimized.

Collaborator

fasterthanlime commented Jul 9, 2015

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