-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Introduce pragma experimental solidity
#14168
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
21 changes: 21 additions & 0 deletions
21
test/libsolidity/ASTJSON/pragma_experimental_solidity.json
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| { | ||
| "absolutePath": "a", | ||
| "experimentalSolidity": true, | ||
| "exportedSymbols": {}, | ||
| "id": 2, | ||
| "nodeType": "SourceUnit", | ||
| "nodes": | ||
| [ | ||
| { | ||
| "id": 1, | ||
| "literals": | ||
| [ | ||
| "experimental", | ||
| "solidity" | ||
| ], | ||
| "nodeType": "PragmaDirective", | ||
| "src": "0:29:1" | ||
| } | ||
| ], | ||
| "src": "0:30:1" | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| pragma experimental solidity; | ||
|
|
||
| // ---- |
20 changes: 20 additions & 0 deletions
20
test/libsolidity/ASTJSON/pragma_experimental_solidity_parseOnly.json
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| { | ||
| "absolutePath": "a", | ||
| "experimentalSolidity": true, | ||
| "id": 2, | ||
| "nodeType": "SourceUnit", | ||
| "nodes": | ||
| [ | ||
| { | ||
| "id": 1, | ||
| "literals": | ||
| [ | ||
| "experimental", | ||
| "solidity" | ||
| ], | ||
| "nodeType": "PragmaDirective", | ||
| "src": "0:29:1" | ||
| } | ||
| ], | ||
| "src": "0:30:1" | ||
| } |
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
3 changes: 3 additions & 0 deletions
3
test/libsolidity/syntaxTests/pragma/experimental_solidity.sol
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| pragma experimental solidity; | ||
| // ---- | ||
| // Warning 2264: (0-29): Experimental features are turned on. Do not use experimental features on live deployments. |
24 changes: 24 additions & 0 deletions
24
test/libsolidity/syntaxTests/pragma/experimental_solidity_multisource_not_all_enable.sol
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| ==== Source: A.sol ==== | ||
| contract A {} | ||
| ==== Source: B.sol ==== | ||
| pragma experimental solidity; | ||
| import "A.sol"; | ||
| contract B { | ||
| A a; | ||
| } | ||
| ==== Source: C.sol ==== | ||
| pragma experimental solidity; | ||
| import "A.sol"; | ||
| contract C { | ||
| A a; | ||
| } | ||
| ==== Source: D.sol ==== | ||
| pragma experimental solidity; | ||
| import "A.sol"; | ||
| contract D { | ||
| A a; | ||
| } | ||
| // ---- | ||
| // ParserError 2141: (B.sol:0-29): File declares "pragma experimental solidity". If you want to enable the experimental mode, all source units must include the pragma. | ||
| // ParserError 2141: (C.sol:0-29): File declares "pragma experimental solidity". If you want to enable the experimental mode, all source units must include the pragma. | ||
| // ParserError 2141: (D.sol:0-29): File declares "pragma experimental solidity". If you want to enable the experimental mode, all source units must include the pragma. |
5 changes: 5 additions & 0 deletions
5
test/libsolidity/syntaxTests/pragma/experimental_solidity_out_of_order_1.sol
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| contract A {} | ||
|
|
||
| pragma experimental solidity; | ||
| // ---- | ||
| // ParserError 8185: (45-45): Experimental pragma "solidity" can only be set at the beginning of the source unit. |
13 changes: 13 additions & 0 deletions
13
test/libsolidity/syntaxTests/pragma/experimental_solidity_out_of_order_2.sol
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| function f() pure returns (uint) | ||
nikola-matic marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| { | ||
| return 1; | ||
| } | ||
|
|
||
| pragma experimental solidity; | ||
|
|
||
| struct A | ||
| { | ||
| uint256 x; | ||
| } | ||
| // ---- | ||
| // ParserError 8185: (83-89): Experimental pragma "solidity" can only be set at the beginning of the source unit. | ||
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.
Uh oh!
There was an error while loading. Please reload this page.