forked from gnolang/gno
-
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(gnovm): returns error like in Golang when assignment with a func…
…tion which does not return any value (gnolang#3049) This PR aims at resolving this issue: gnolang#1082 This depends on gnolang#3017 because it refactored the code to sync the logic/code between AssignStmt vs ValueDecl. Related gnolang#2695 <details><summary>Contributors' checklist...</summary> - [ ] Added new tests, or not needed, or not feasible - [ ] Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory - [ ] Updated the official documentation or not needed - [ ] No breaking changes were made, or a `BREAKING CHANGE: xxx` message was included in the description - [ ] Added references to related issues and PRs - [ ] Provided any useful hints for running manual tests </details> --------- Co-authored-by: hieu.ha <[email protected]> Co-authored-by: Mikael VALLENET <[email protected]>
- Loading branch information
Showing
7 changed files
with
68 additions
and
13 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
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,10 @@ | ||
package main | ||
|
||
func f() { } | ||
|
||
func main() { | ||
a := f() | ||
} | ||
|
||
// Error: | ||
// main/files/assign37.gno:6:2: f<VPBlock(3,0)> (no value) used as value |
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,12 @@ | ||
package main | ||
|
||
import "fmt" | ||
|
||
func f() { } | ||
|
||
func main() { | ||
a, b := f(), f() | ||
} | ||
|
||
// Error: | ||
// main/files/assign37b.gno:8:2: f<VPBlock(3,0)> (no value) used as value |
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,10 @@ | ||
package main | ||
|
||
func f() {} | ||
|
||
func main() { | ||
var t = f() | ||
} | ||
|
||
// Error: | ||
// main/files/var34.gno:6:6: f<VPBlock(3,0)> (no value) used as value |
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,11 @@ | ||
package main | ||
|
||
func f() {} | ||
|
||
func main() { | ||
var a int | ||
a = f() | ||
} | ||
|
||
// Error: | ||
// main/files/var34b.gno:7:2: f<VPBlock(3,0)> (no value) used as value |
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,10 @@ | ||
package main | ||
|
||
func f() {} | ||
|
||
func main() { | ||
var a, b int = f(), 1 | ||
} | ||
|
||
// Error: | ||
// main/files/var34c.gno:6:6: f<VPBlock(3,0)> (no value) used as value |