cmd/gc: ensure unique parameter and result names in function types
In addition to fixing the bug, the check is now linear instead of quadratic.
Fixes #4469.
R=ken2
CC=golang-dev
https://golang.org/cl/7773047
diff --git a/test/func1.go b/test/func1.go
index c89f7ff..fb6f561 100644
--- a/test/func1.go
+++ b/test/func1.go
@@ -14,6 +14,6 @@
}
-func f2(a int) (a int, b float32) { // ERROR "redeclared|definition"
+func f2(a int) (a int, b float32) { // ERROR "duplicate argument a|definition"
return 8, 8.0
}