Skip to content
This repository has been archived by the owner on Aug 1, 2023. It is now read-only.

Quark should complain when you instantiate an abstract class #54

Open
janicedatawire opened this issue Nov 5, 2015 · 0 comments
Open

Comments

@janicedatawire
Copy link
Contributor

Defining a method signature in a class automatically makes both the method and the containing class abstract per the rules of Quark. However, Quark will compile files that instantiate abstract classes (both with and without explicitly defined constructors).

The resulting Java code does not compile:

$ javac Functions.java
Functions.java:3: error: Unit is abstract; cannot be instantiated
        convert.Unit length1 = new convert.Unit("length", "meter", 20.0);
                               ^
Functions.java:4: error: Unit is abstract; cannot be instantiated
        convert.Unit length2 = new convert.Unit("length", "foot", 0.0);
                               ^
Functions.java:5: error: Unit2 is abstract; cannot be instantiated
        convert.Unit2 abs = new convert.Unit2();
                            ^
3 errors
``

The resulting Python and Javascript works as long as you do not actively try to use the abstract method.
@bozzzzo bozzzzo added this to the frontend milestone Jul 27, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants