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
This commit is contained in:
Russ Cox 2009-07-06 21:37:29 -07:00
parent 7af032b87b
commit a14b28a24d

View File

@ -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;
}