mirror of
https://github.com/golang/go
synced 2024-11-21 20:54:45 -07:00
gc: another shift bug
Fixes #1316. R=ken2 CC=golang-dev https://golang.org/cl/3575042
This commit is contained in:
parent
9da73612ed
commit
603f9feeec
@ -101,7 +101,7 @@ convlit1(Node **np, Type *t, int explicit)
|
||||
break;
|
||||
case OLSH:
|
||||
case ORSH:
|
||||
convlit1(&n->left, t, explicit);
|
||||
convlit1(&n->left, t, explicit && isideal(n->left->type));
|
||||
t = n->left->type;
|
||||
if(t != T && !isint[t->etype]) {
|
||||
yyerror("invalid operation: %#N (shift of type %T)", n, t);
|
||||
|
@ -26,4 +26,10 @@ func main() {
|
||||
println("type info didn't propagate in const: got", s)
|
||||
panic("fail")
|
||||
}
|
||||
x := uint(5)
|
||||
y := float64(uint64(1)<<x) // used to fail to compile
|
||||
if y != 32 {
|
||||
println("wrong y", y)
|
||||
panic("fail")
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user