gc: fix spurious typecheck loop in &composite literal

Fixes #2538.

R=ken2
CC=golang-dev
https://golang.org/cl/5449114
This commit is contained in:
Russ Cox 2011-12-07 15:48:55 -05:00
parent 1278c6c055
commit 5e98505ba7
2 changed files with 12 additions and 0 deletions

View File

@ -2198,6 +2198,7 @@ typecheckcomplit(Node **np)
n->typecheck = 1;
n->type = n->left->type;
n->left->type = t;
n->left->typecheck = 1;
}
*np = n;

11
test/fixedbugs/bug380.go Normal file
View File

@ -0,0 +1,11 @@
// $G $D/$F.go
// Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Used to cause a typechecking loop error.
package pkg
type T map[int]string
var q = &T{}