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

Class inheritance #474

Merged
merged 1 commit into from
Oct 26, 2021
Merged

Class inheritance #474

merged 1 commit into from
Oct 26, 2021

Conversation

Jason2605
Copy link
Member

Well detailed description of the change :

This change makes it so that the superclass can be denoted by an expression rather than a single identifier. This means we can store classes within different datatypes (such as a dictionary) and use this as the value for the superclass

Example:

class Test {}

const dict = {"class": Test};

class Inherit < dict["class"] {}

This will mainly be useful when modules within the stdlib start getting built in classes, it means we don't need to fully import the class into the namespace and instead can reference through the module namespace

Example

import UnitTest;

class Test < UnitTest.UnitTest {
    // Tests here
}

Resolves:

#472

Type of change:

  • New feature

Housekeeping

  • Tests have been updated to reflect the changes done within this PR (if applicable).

  • Documentation has been updated to reflect the changes done within this PR (if applicable).

@Jason2605 Jason2605 added the enhancement Implementation of a new feature label Oct 20, 2021
@Jason2605 Jason2605 self-assigned this Oct 20, 2021
@Jason2605 Jason2605 merged commit 8a538e0 into develop Oct 26, 2021
@Jason2605 Jason2605 deleted the feature/inheritance branch October 26, 2021 17:00
@Jason2605 Jason2605 mentioned this pull request Dec 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Implementation of a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant