mirror of https://github.com/golang/go.git
parent
91395ae689
commit
be63b6dc44
|
|
@ -33,6 +33,14 @@ struct Case
|
||||||
};
|
};
|
||||||
#define C ((Case*)nil)
|
#define C ((Case*)nil)
|
||||||
|
|
||||||
|
Type*
|
||||||
|
notideal(Type *t)
|
||||||
|
{
|
||||||
|
if(t != T && t->etype == TIDEAL)
|
||||||
|
return T;
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
dumpcase(Case *c0)
|
dumpcase(Case *c0)
|
||||||
{
|
{
|
||||||
|
|
@ -254,8 +262,8 @@ sw0(Node *c, Type *place, int arg)
|
||||||
Type*
|
Type*
|
||||||
sw1(Node *c, Type *place, int arg)
|
sw1(Node *c, Type *place, int arg)
|
||||||
{
|
{
|
||||||
if(place == T)
|
if(place != T)
|
||||||
return c->type;
|
return notideal(c->type);
|
||||||
return place;
|
return place;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -605,7 +613,7 @@ exprswitch(Node *sw)
|
||||||
* walk the cases as appropriate for switch type
|
* walk the cases as appropriate for switch type
|
||||||
*/
|
*/
|
||||||
walkcases(sw, sw0, arg);
|
walkcases(sw, sw0, arg);
|
||||||
t = sw->ntest->type;
|
t = notideal(sw->ntest->type);
|
||||||
if(t == T)
|
if(t == T)
|
||||||
t = walkcases(sw, sw1, arg);
|
t = walkcases(sw, sw1, arg);
|
||||||
if(t == T)
|
if(t == T)
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,6 @@ func main() {
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
bug155.go:20: syntax error near default
|
bug157.go:20: syntax error near default
|
||||||
bug155.go:20: first switch statement must be a case
|
bug157.go:20: first switch statement must be a case
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -22,5 +22,5 @@ func main() {
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
bug156.go:14: fatal error: dowidth: unknown type: E-33
|
bug158.go:14: fatal error: dowidth: unknown type: E-33
|
||||||
*/
|
*/
|
||||||
|
|
@ -109,10 +109,6 @@ bugs/bug157.go:20: syntax error near default
|
||||||
bugs/bug157.go:20: first switch statement must be a case
|
bugs/bug157.go:20: first switch statement must be a case
|
||||||
BUG: should compile
|
BUG: should compile
|
||||||
|
|
||||||
=========== bugs/bug158.go
|
|
||||||
bugs/bug158.go:14: fatal error: dowidth: unknown type: E-33
|
|
||||||
BUG: should compile
|
|
||||||
|
|
||||||
=========== fixedbugs/bug016.go
|
=========== fixedbugs/bug016.go
|
||||||
fixedbugs/bug016.go:7: constant -3 overflows uint
|
fixedbugs/bug016.go:7: constant -3 overflows uint
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue