From a14b28a24d1add0c260160f9fbb986597961b7eb Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Mon, 6 Jul 2009 21:37:29 -0700 Subject: [PATCH] fix bug involving typed nil constants: interface = (*int)(nil) is not the same as interface = nil. package main func main() { var x interface{} = (*int)(nil); println(x.(*int)); } R=ken OCL=31232 CL=31232 --- src/cmd/gc/const.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/gc/const.c b/src/cmd/gc/const.c index 5ce4ebee74..d45e6136a1 100644 --- a/src/cmd/gc/const.c +++ b/src/cmd/gc/const.c @@ -94,7 +94,7 @@ convlit1(Node *n, Type *t, int explicit) goto bad; if(et == TINTER) { - if(ct == CTNIL) { + if(ct == CTNIL && n->type == types[TNIL]) { n->type = t; return; } -- 2.48.1