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

fix(types): forbid override modifier for functions without super-function #1302

Merged
merged 14 commits into from
Jan 14, 2025

Conversation

i582
Copy link
Contributor

@i582 i582 commented Jan 13, 2025

Issue

Closes #1022.

Checklist

  • I have run the linter, formatter and spellchecker
  • I did not do unrelated and/or undiscussed refactorings

@i582 i582 requested a review from a team as a code owner January 13, 2025 21:17
@anton-trunov anton-trunov self-assigned this Jan 14, 2025
@anton-trunov anton-trunov added this to the v1.6.0 milestone Jan 14, 2025
Copy link
Member

@anton-trunov anton-trunov left a comment

Choose a reason for hiding this comment

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

After fixing some test file names, let's also add tests with inheriting a defined function through a sequence of traits and then overriding it, something along these lines:

trait T1 { fun foo() { } }

trait T2 with T1 { }

trait T3 with T2 { }

contract Test with T3 { override fun foo() { } }

@anton-trunov
Copy link
Member

Let's also add some diamond-like inheritance tests (if not added already)

@i582 i582 changed the title feat(types): add check if overridden functions have super function fix(types): forbid override modifier for functions without super function Jan 14, 2025
@i582
Copy link
Contributor Author

i582 commented Jan 14, 2025

Let's also add some diamond-like inheritance tests (if not added already)

added

@i582 i582 requested a review from anton-trunov January 14, 2025 07:54
CHANGELOG.md Outdated Show resolved Hide resolved
src/types/resolveDescriptors.ts Outdated Show resolved Hide resolved
@anton-trunov anton-trunov changed the title fix(types): forbid override modifier for functions without super function fix(types): forbid override modifier for functions without super-function Jan 14, 2025
@anton-trunov anton-trunov merged commit 6c7a0f1 into main Jan 14, 2025
17 checks passed
@anton-trunov anton-trunov deleted the pmakhnev/add-check-for-override-functions branch January 14, 2025 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Overriding non-existing function doesn't throws an error
2 participants