Named instances for Core Solidity#337
Open
rodrigogribeiro wants to merge 23 commits into
Open
Conversation
Member
mbenke
reviewed
May 6, 2026
mbenke
reviewed
May 6, 2026
mbenke
reviewed
May 7, 2026
mbenke
left a comment
Collaborator
There was a problem hiding this comment.
If an instance has the same name as a function, the compiler says the name is undefined, e.g.
// named instance/function name conflict
forall a.class a:C {}
instance [foo] word : C {}
function foo(x:word) { 7 }
contract Clash {
function main() -> word {
return foo(1);
}
}
Module validation failed for /home/ben/work/review/tmp/named4.solc:
Undefined name: foo
- in:return foo(1) ;
- in:function main () -> word {
return foo(1) ;
}
Co-authored-by: Marcin Benke <marcin.benke@argot.org>
Collaborator
|
Nicely done. I do not want to appear nitpicky but there still are some problems with case sensitivity: yields Of course it is not a good idea to have class names differing only in capitalisation, but I can imagine this happening with imports. |
Member
|
@mbenke Thank you for the review; it's helpful. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces named instances for Core Solidity, following the approach used by Idris.