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

remove support for enum inheritance #837

Merged
merged 1 commit into from
Aug 11, 2023

Conversation

zerbina
Copy link
Collaborator

@zerbina zerbina commented Aug 10, 2023

Summary

Enum types supported an internal base type that could only be specified
in macro-generated enum types (there's no syntax for representing it),
but there aren't any tests for it, the features seems to have never
been documented anywhere, and enums that inherit from other enums are
not consistently considered in the compiler. The feature is thus
removed.

Details

  • remove support for nkEnumTy AST having a non-empty first slot. This
    now results in an illformed AST error
  • remove support for enum inheritance from tryReadingTypeField
  • remove the rsemInheritanceOnlyWorksWithAnEnum report

Summary
=======

Enum types supported an internal base type that could only be specified
in macro-generated enum types (there's no syntax for representing it),
but weren't aren't any tests for it, the features seems to have never
been documented anywhere, and enums that inherit from other enums are
not consistently considered in the compiler. The feature is thus
removed.

Details
=======

- remove support for `nkEnumTy` AST having a non-empty first slot. This
  now results in an `illformed AST` error
- remove support for enum inheritance from `tryReadingTypeField`
- remove the `rsemInheritanceOnlyWorksWithAnEnum` report
@zerbina zerbina added compiler/sem Related to semantic-analysis system of the compiler simplification Removal of the old, unused, unnecessary or un/under-specified language features. language-design Language design syntax, semantics, types, statics and dynamics. labels Aug 10, 2023
@zerbina zerbina requested a review from saem August 10, 2023 21:49
Copy link
Collaborator

@saem saem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool. Eventually with a bit of work we'll be able to remove the unnecessary hole in the ast. 🎉

@zerbina
Copy link
Collaborator Author

zerbina commented Aug 11, 2023

/merge

@github-actions
Copy link

Merge requested by: @zerbina

Contents after the first section break of the PR description has been removed and preserved below:


Notes for Reviewers

@chore-runner chore-runner bot added this pull request to the merge queue Aug 11, 2023
Merged via the queue into nim-works:devel with commit 659b30a Aug 11, 2023
18 checks passed
@zerbina zerbina deleted the remove-enum-inheritance branch August 14, 2023 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/sem Related to semantic-analysis system of the compiler language-design Language design syntax, semantics, types, statics and dynamics. simplification Removal of the old, unused, unnecessary or un/under-specified language features.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants