summaryrefslogtreecommitdiff
path: root/test/declbad.go
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2011-02-14 13:23:51 +0100
committerOndřej Surý <ondrej@sury.org>2011-02-14 13:23:51 +0100
commit758ff64c69e34965f8af5b2d6ffd65e8d7ab2150 (patch)
tree6d6b34f8c678862fe9b56c945a7b63f68502c245 /test/declbad.go
parent3e45412327a2654a77944249962b3652e6142299 (diff)
downloadgolang-upstream/2011-02-01.1.tar.gz
Imported Upstream version 2011-02-01.1upstream/2011-02-01.1
Diffstat (limited to 'test/declbad.go')
-rw-r--r--test/declbad.go22
1 files changed, 11 insertions, 11 deletions
diff --git a/test/declbad.go b/test/declbad.go
index 269ebdefb..5e5e14501 100644
--- a/test/declbad.go
+++ b/test/declbad.go
@@ -8,51 +8,51 @@
package main
-func f1() int { return 1 }
-func f2() (float, int) { return 1, 2 }
-func f3() (float, int, string) { return 1, 2, "3" }
+func f1() int { return 1 }
+func f2() (float32, int) { return 1, 2 }
+func f3() (float32, int, string) { return 1, 2, "3" }
func main() {
{
// simple redeclaration
i := f1()
- i := f1() // ERROR "redeclared|no new"
+ i := f1() // ERROR "redeclared|no new"
_ = i
}
{
// change of type for f
i, f, s := f3()
- f, g, t := f3() // ERROR "redeclared|cannot assign|incompatible"
+ f, g, t := f3() // ERROR "redeclared|cannot assign|incompatible"
_, _, _, _, _ = i, f, s, g, t
}
{
// change of type for i
i, f, s := f3()
- j, i, t := f3() // ERROR "redeclared|cannot assign|incompatible"
+ j, i, t := f3() // ERROR "redeclared|cannot assign|incompatible"
_, _, _, _, _ = i, f, s, j, t
}
{
// no new variables
i, f, s := f3()
- i, f := f2() // ERROR "redeclared|no new"
+ i, f := f2() // ERROR "redeclared|no new"
_, _, _ = i, f, s
}
{
// single redeclaration
i, f, s := f3()
- i := f1() // ERROR "redeclared|no new|incompatible"
+ i := f1() // ERROR "redeclared|no new|incompatible"
_, _, _ = i, f, s
}
- // double redeclaration
+ // double redeclaration
{
i, f, s := f3()
- i, f := f2() // ERROR "redeclared|no new"
+ i, f := f2() // ERROR "redeclared|no new"
_, _, _ = i, f, s
}
{
// triple redeclaration
i, f, s := f3()
- i, f, s := f3() // ERROR "redeclared|no new"
+ i, f, s := f3() // ERROR "redeclared|no new"
_, _, _ = i, f, s
}
}