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 internal compiler error for unimplemented base contract function. #5558

Merged
merged 1 commit into from
Dec 3, 2018

Conversation

anurag-git
Copy link
Contributor

Description

This pull request fixes the internal compiler error for super function by ignoring the super functions which doesn't have implementation.

Checklist

  • Code compiles correctly
  • All tests are passing
  • New tests have been created which fail without the change (if possible)
  • README / documentation was extended, if necessary
  • Changelog entry (if change is visible to the user)
  • Used meaningful commit messages

Fixes #5130

@codecov
Copy link

codecov bot commented Dec 1, 2018

Codecov Report

Merging #5558 into develop will decrease coverage by 59.17%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##           develop    #5558       +/-   ##
============================================
- Coverage    88.13%   28.96%   -59.18%     
============================================
  Files          321      321               
  Lines        31721    31557      -164     
  Branches      3810     3811        +1     
============================================
- Hits         27957     9139    -18818     
- Misses        2479    21729    +19250     
+ Partials      1285      689      -596
Flag Coverage Δ
#all ?
#syntax 28.96% <100%> (ø) ⬆️

@chriseth
Copy link
Contributor

chriseth commented Dec 2, 2018

This bug might prompt to re-think the whole super-concept here. Consider the following contracts:

contract A {
    uint x;
    function f() public;
}
contract B is A {
    function f() public {
        super.f();
        x++;
    }
}
contract C is A {
    function f() public {
        x++;
    }
}
contract D is B, C {
}
contract E is C, B {
}

@anurag-git
Copy link
Contributor Author

This seems to be classic diamond problem

@chriseth
Copy link
Contributor

chriseth commented Dec 3, 2018

@anurag-git no, the diamond problem is solved. The problem is that super is a static type when it actually should not.

@anurag-git
Copy link
Contributor Author

@chriseth, So we need to fix something as part of this PR, or take this issue separately

@chriseth
Copy link
Contributor

chriseth commented Dec 3, 2018

Actually having thought about it, it does make sense to only allow the user of super if there is an implementation.

@chriseth
Copy link
Contributor

chriseth commented Dec 3, 2018

I will rebase and add another test.

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.

Internal compiler error for call to unimplemented "super" function
3 participants