1
0
mirror of https://github.com/golang/go synced 2024-11-22 01:04:40 -07:00

gc: const debug bool = false

R=ken2
CC=golang-dev
https://golang.org/cl/186232
This commit is contained in:
Russ Cox 2010-01-19 15:25:44 -08:00
parent 14ccf44fc7
commit fe01d4c8a1
2 changed files with 4 additions and 1 deletions

View File

@ -182,7 +182,7 @@ walkdef(Node *n)
t = n->type;
if(t != T) {
convlit(&e, t);
if(!isint[t->etype] && !isfloat[t->etype] && t->etype != TSTRING)
if(!isint[t->etype] && !isfloat[t->etype] && t->etype != TSTRING && t->etype != TBOOL)
yyerror("invalid constant type %T", t);
}
n->val = e->val;

View File

@ -15,5 +15,8 @@ const d chan int = 4 // ERROR "convert|wrong|incompatible"
const e func() = 5 // ERROR "convert|wrong|incompatible"
const f struct{} = 6 // ERROR "convert|wrong|incompatible"
const g interface{} = 7 // ERROR "constant|wrong|incompatible"
const h bool = false
const i int = 2
const j float = 5
func main() { println(a, b, c, d, e, f, g) }