-
Notifications
You must be signed in to change notification settings - Fork 413
feat: named and unnamed type assignment 3 of 3 #2367
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
Show all changes
19 commits
Select commit
Hold shift + click to select a range
76b2b92
feat: named and unnamed type assignment 3 of 3
piux2 176ad01
chore: updated the hidden variable prefix
piux2 429ddb6
chore: lint white space
piux2 628a8f5
added more test cases and fixed typos
piux2 ea25c44
merged with the updated main branch
piux2 1d6d66c
chore: lint remove white space
piux2 26ae187
Merge branch 'master' into fix_decompose_assignment
zivkovicmilos 7ed4de0
Merge remote-tracking branch 'origin/master' into fix_decompose_assig…
piux2 02e0915
fix: add temp variable in the declaration
piux2 ffdfa29
Merge branch 'fix_decompose_assignment' of https://github.com/piux2/g…
piux2 2c9d737
chore: fix typos
piux2 2935558
chore: remove unnecessary len check
piux2 f31f880
chore: fix more typos
piux2 6620a32
Merge branch 'master' into fix_decompose_assignment
piux2 7ad004a
chore: better naming
piux2 96d0162
Merge branch 'fix_decompose_assignment' of https://github.com/piux2/g…
piux2 7db8fa9
chores: better panic message
piux2 bb958e7
chores: more comments
piux2 e214285
Merge branch 'fix_decompose_assignment' of https://github.com/piux2/g…
piux2 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
26 changes: 26 additions & 0 deletions
26
gnovm/tests/files/assign_unnamed_type/decompose/decompose_unnamed1a_filetest.gno
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,26 @@ | ||
package main | ||
|
||
type nat []int | ||
|
||
func x() (nat, []int) { | ||
a := nat{1} | ||
b := []int{2} | ||
return a, b | ||
} | ||
|
||
func main() { | ||
var u1 []int | ||
var n2 nat | ||
|
||
_, n2 = x() | ||
// .tmp1, .tmp_2 := x() | ||
// _, u2 = .tmp1, .tmp_2 | ||
|
||
println(u1) | ||
println(n2) | ||
|
||
} | ||
|
||
// Output: | ||
// (nil []int) | ||
// (slice[(2 int)] main.nat) |
26 changes: 26 additions & 0 deletions
26
gnovm/tests/files/assign_unnamed_type/decompose/decompose_unnamed1b_filetest.gno
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,26 @@ | ||
package main | ||
|
||
type nat []int | ||
|
||
func x() (nat, []int) { | ||
a := nat{1} | ||
b := []int{2} | ||
return a, b | ||
} | ||
|
||
func main() { | ||
var u1 []int | ||
var n2 nat | ||
|
||
u1, _ = x() | ||
// .tmp1, .tmp_2 := x() | ||
// u1, _ = .tmp1, .tmp_2 | ||
|
||
println(u1) | ||
println(n2) | ||
|
||
} | ||
|
||
// Output: | ||
// slice[(1 int)] | ||
// (nil main.nat) |
Oops, something went wrong.
Oops, something went wrong.
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.