summaryrefslogtreecommitdiff
path: root/test/declbad.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2011-01-19 23:09:00 -0500
committerRuss Cox <rsc@golang.org>2011-01-19 23:09:00 -0500
commited3592f95664c555d787d87b28ff783b846257e6 (patch)
tree9bfdc7720f6c491c1c293a4bd367abec2a1221f4 /test/declbad.go
parent8d36be6d5ae904467a0be5e7dc3965581a3dbf73 (diff)
downloadgo-ed3592f95664c555d787d87b28ff783b846257e6.tar.gz
delete float, complex - code changes
also: cmplx -> complex float64(1.0) -> 1.0 float64(1) -> 1.0 R=gri, r, gri1, r2 CC=golang-dev http://codereview.appspot.com/3991043
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
}
}