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

gc: inlining bug

R=lvd
CC=golang-dev
https://golang.org/cl/5533078
This commit is contained in:
Russ Cox 2012-01-11 20:32:02 -05:00
parent b1d6fa517c
commit 524fb81c41
3 changed files with 8 additions and 3 deletions

View File

@ -669,8 +669,10 @@ typefmt(Fmt *fp, Type *t)
case 0:
break;
case 1:
if(fmtmode != FExp) {
fmtprint(fp, " %T", getoutargx(t)->type->type); // struct->field->field's type
break;
}
default:
fmtprint(fp, " %T", getoutargx(t));
break;

View File

@ -14,6 +14,9 @@ func F1(T *T) bool { return T == nil }
// Issue 2682.
func F2(c chan int) bool { return c == (<-chan int)(nil) }
// Use of single named return value.
func F3() (ret []int) { return append(ret, 1) }
// Call of inlined method with blank receiver.
func (_ *T) M() int { return 1 }
func (t *T) MM() int { return t.M() }

View File

@ -12,9 +12,9 @@ import "./one"
func use() {
one.F1(nil)
one.F2(nil)
one.F3()
var t *one.T
t.M()
t.MM()
}