Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
f83f245c
Commit
f83f245c
authored
Apr 20, 2009
by
Rob Pike
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add another test to decl to see that result vars are redeclarable.
R=ken OCL=27620 CL=27620
parent
7e1cfa74
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
decl.go
test/decl.go
+8
-0
No files found.
test/decl.go
View file @
f83f245c
...
@@ -12,6 +12,11 @@ func f1() int { return 1 }
...
@@ -12,6 +12,11 @@ func f1() int { return 1 }
func
f2
()
(
float
,
int
)
{
return
1
,
2
}
func
f2
()
(
float
,
int
)
{
return
1
,
2
}
func
f3
()
(
float
,
int
,
string
)
{
return
1
,
2
,
"3"
}
func
f3
()
(
float
,
int
,
string
)
{
return
1
,
2
,
"3"
}
func
x
()
(
s
string
)
{
a
,
b
,
s
:=
f3
();
return
// tests that result var is in scope for redeclaration
}
func
main
()
{
func
main
()
{
i
,
f
,
s
:=
f3
();
i
,
f
,
s
:=
f3
();
j
,
f
:=
f2
();
// redeclare f
j
,
f
:=
f2
();
// redeclare f
...
@@ -26,4 +31,7 @@ func main() {
...
@@ -26,4 +31,7 @@ func main() {
m
,
g
,
s
:=
f3
();
m
,
g
,
s
:=
f3
();
m
,
h
,
s
:=
f3
();
m
,
h
,
s
:=
f3
();
}
}
if
x
()
!=
"3"
{
println
(
"g() failed"
);
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment