summaryrefslogtreecommitdiff
path: root/usr/gri/pretty/selftest2.go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2009-03-05 17:15:36 -0800
committerRobert Griesemer <gri@golang.org>2009-03-05 17:15:36 -0800
commit1b3f18942be33faae1b5ba467b58eceb54c8026b (patch)
tree073148e3f2f143f1ab9b5a9c54dca5796786ca84 /usr/gri/pretty/selftest2.go
parentf518d0f3145781450b5a67afbb9643d8898ed499 (diff)
downloadgolang-1b3f18942be33faae1b5ba467b58eceb54c8026b.tar.gz
Lots of cleanups in prep. for checking in parser and ast into lib:
- removed any symbol table stuff - some interface cleanup - removed lot's of dead wood - half the support for type switches (simple form) - name capitalization Several rounds to come. R=r OCL=25797 CL=25797
Diffstat (limited to 'usr/gri/pretty/selftest2.go')
-rw-r--r--usr/gri/pretty/selftest2.go15
1 files changed, 14 insertions, 1 deletions
diff --git a/usr/gri/pretty/selftest2.go b/usr/gri/pretty/selftest2.go
index 8fa907462..48fe33cf9 100644
--- a/usr/gri/pretty/selftest2.go
+++ b/usr/gri/pretty/selftest2.go
@@ -5,7 +5,7 @@
package main
import (
- "array"; // not needed
+ "vector"; // not needed
"utf8"; // not needed
Fmt "fmt"
)
@@ -128,6 +128,19 @@ func f3(a *[]int, m map[string] int) {
}
+type I interface {}
+
+func f3(x I) int {
+ switch tmp := tmp.(type) {
+ case S: return 1;
+ }
+ switch {
+ case t := x.(S): return 2;
+ }
+ return 0;
+}
+
+
func main() {
// the prologue
for i := 0; i <= 10 /* limit */; i++ {