}
fmtprint(f, ")");
break;
+
+ case OMAKEMAP:
+ fmtprint(f, "make(%#T)", n->type);
+ break;
+
+ case OMAPLIT:
+ fmtprint(f, "map literal");
}
if(prec > nprec)
int
eqtype1(Type *t1, Type *t2, int d, int names)
{
- if(d >= 10)
+ if(d >= 20)
return 1;
if(t1 == t2)
return 1;
return 1;
case TARRAY:
- if(t1->bound == t2->bound)
- break;
- return 0;
+ if(t1->bound != t2->bound)
+ return 0;
+ break;
case TCHAN:
- if(t1->chan == t2->chan)
- break;
- return 0;
+ if(t1->chan != t2->chan)
+ return 0;
+ break;
+
+ case TMAP:
+ if(!eqtype1(t1->down, t2->down, d+1, names))
+ return 0;
+ break;
}
return eqtype1(t1->type, t2->type, d+1, names);
}
// botch - shouldnt fall thru declaration
last = stat->end->n;
- if(last->op == OXFALL)
+ if(last->op == OXFALL) {
+ if(typeswvar) {
+ setlineno(last);
+ yyerror("cannot fallthrough in type switch");
+ }
last->op = OFALL;
- else
+ } else
stat = list(stat, br);
}
sw->ntest = nodbool(1);
typecheck(&sw->ntest, Erv);
}
-
+
if(sw->ntest->op == OTYPESW) {
typeswitch(sw);
//dump("sw", sw);
ranges: ranges,
str: str,
abbrevCache: make(map[uint32]abbrevTable),
- typeCache: make(map[uint32]Type),
+ typeCache: make(map[Offset]Type),
};
// Sniff .debug_info to figure out byte order.
// license that can be found in the LICENSE file.
package main
-type I int
+type I int
type S struct { f map[I]int }
var v1 = S{ make(map[int]int) } // ERROR "cannot|illegal|incompatible|wrong"
var v2 map[I]int = map[int]int{} // ERROR "cannot|illegal|incompatible|wrong"
panic PC=xxx
== bugs/
-
-=========== bugs/bug212.go
-BUG: errchk: command succeeded unexpectedly
-
-=========== bugs/bug213.go
-BUG: errchk: command succeeded unexpectedly