forked from NomicFoundation/slang
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Inherited members should be accessible to subclassing contracts
Ditto for type definitions
- Loading branch information
Showing
4 changed files
with
66 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
11 changes: 9 additions & 2 deletions
11
...s/solidity/outputs/cargo/slang_solidity/src/generated/bindings/generated/binding_rules.rs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
crates/solidity/outputs/cargo/tests/src/bindings_assertions/generated/contracts.rs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
43 changes: 43 additions & 0 deletions
43
crates/solidity/testing/snapshots/bindings_assertions/contracts/inheritance.sol
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
contract B1 { | ||
// ^def:1 | ||
function b1_func() returns (int) { | ||
// ^def:2 | ||
return 1; | ||
} | ||
} | ||
|
||
contract B2 { | ||
// ^def:3 | ||
enum E { E1, E2 } | ||
// ^def:7 | ||
function b2_func() returns (int) { | ||
// ^def:4 | ||
return 2; | ||
} | ||
} | ||
|
||
contract C is B1 { | ||
// ^def:5 | ||
// ^ref:1 | ||
E e_at_c; | ||
//<ref:! --- E should not be directly accessible here | ||
function c_func() returns (int) { | ||
// ^def:6 | ||
return 3 + b1_func() + b2_func(); | ||
// ^ref:! --- B2 is not in our ancestry | ||
// ^ref:2 | ||
} | ||
} | ||
|
||
contract D is C, B2 { | ||
// ^ref:3 | ||
// ^ref:5 | ||
E e_at_d; | ||
//<ref:7 | ||
function d_func() returns (int) { | ||
return c_func() + b1_func() + b2_func(); | ||
// ^ref:4 | ||
// ^ref:2 | ||
// ^ref:6 | ||
} | ||
} |