forked from paradigmxyz/solar
-
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.
feat: library requirements syntax checker (paradigmxyz#168)
* feat: library requirements syntax checker * fix
- Loading branch information
1 parent
76fc3a2
commit e321f62
Showing
3 changed files
with
41 additions
and
0 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
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,8 @@ | ||
library A{} | ||
|
||
library B is A {} //~ERROR: library is not allowed to inherit | ||
|
||
library C { | ||
uint256 constant x = 1; | ||
uint256 y; //~ERROR: library cannot have non-constant state variable | ||
} |
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,16 @@ | ||
error: library is not allowed to inherit | ||
--> ROOT/tests/ui/resolve/library_requirements.sol:LL:CC | ||
| | ||
LL | library B is A {} | ||
| ^ | ||
| | ||
|
||
error: library cannot have non-constant state variable | ||
--> ROOT/tests/ui/resolve/library_requirements.sol:LL:CC | ||
| | ||
LL | uint256 y; | ||
| ^^^^^^^^^^ | ||
| | ||
|
||
error: aborting due to 2 previous errors | ||
|