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

Abstract class detection fails with overloaded names #9

Closed
nickbattle opened this issue Jan 22, 2016 · 1 comment
Closed

Abstract class detection fails with overloaded names #9

nickbattle opened this issue Jan 22, 2016 · 1 comment
Labels

Comments

@nickbattle
Copy link
Owner

This is equivalent to Overture bug #366. When an abstract function or operation is inherited by a subclass, that class is also abstract (cannot be instantiated) unless it implements the op/fn. This works. However, if the subclass has another op/fn that would overload with the inherited name, it is still necessary to implement the abstract op/fn to allow instantiation, but this test does not work. The following specification allows B to be instantiated (but it is abstract):

class A
operations
    public op: () ==> ()
    op() == is subclass responsibility;
end A

class B is subclass of A
operations
    public op: nat ==> ()
    op(-) == skip;
end B
@nickbattle
Copy link
Owner Author

After the fix, the specification now regards B as abstract, stating the unimplemented operation:

> p new B()
Error 3330: Cannot instantiate abstract class B in 'A' (console) at line 1:1
Unimplemented: op(() ==> ())

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

No branches or pull requests

1 participant