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

Quickfix to add 'virtual' and 'override' to function #4050

Merged
merged 8 commits into from
Sep 5, 2023

Conversation

Aniket-Engg
Copy link
Collaborator

@Aniket-Engg Aniket-Engg commented Sep 4, 2023

related to #3927

It shows quickfix for compilation errors like:
TypeError: Trying to override non-virtual function. Did you forget to add "virtual"
&
TypeError: Overriding function is missing "override" specifier

code to reproduce these errors:

pragma solidity 0.8.18;

contract Store {
    function store(uint256 num) public {
        num = num + 1;
    }
}

contract Storage is Store {
    function store(uint256 num) public {
        num = num + 2;
    }
}

This PR also involves some code refactoring

@netlify
Copy link

netlify bot commented Sep 4, 2023

Deploy Preview for remixproject ready!

Name Link
🔨 Latest commit 7c852f8
🔍 Latest deploy log https://app.netlify.com/sites/remixproject/deploys/64f6dd43cdb7840008528d39
😎 Deploy Preview https://deploy-preview-4050--remixproject.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@Aniket-Engg Aniket-Engg added the editor Related to code editor label Sep 4, 2023
@Aniket-Engg Aniket-Engg added the ready-to-review PR ready to review label Sep 4, 2023
Copy link
Collaborator

@LianaHus LianaHus left a comment

Choose a reason for hiding this comment

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

IMHO it should do the opposite thing. instead of updating the file to the current version we should update the current version to the acceptable one.

@Aniket-Engg Aniket-Engg changed the title Quickfix to update pragma to support selected compiler version Quickfix code refactoring using switch statement Sep 5, 2023
@Aniket-Engg Aniket-Engg changed the title Quickfix code refactoring using switch statement Quickfix to add 'virtual' and 'override' to function Sep 5, 2023
@Aniket-Engg Aniket-Engg merged commit d24540f into master Sep 5, 2023
6 checks passed
@Aniket-Engg Aniket-Engg deleted the pragmaVersion branch September 5, 2023 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editor Related to code editor ready-to-review PR ready to review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants