Commit 524fb81c authored by Russ Cox's avatar Russ Cox

gc: inlining bug

R=lvd
CC=golang-dev
https://golang.org/cl/5533078
parent b1d6fa51
...@@ -669,8 +669,10 @@ typefmt(Fmt *fp, Type *t) ...@@ -669,8 +669,10 @@ typefmt(Fmt *fp, Type *t)
case 0: case 0:
break; break;
case 1: case 1:
if(fmtmode != FExp) {
fmtprint(fp, " %T", getoutargx(t)->type->type); // struct->field->field's type fmtprint(fp, " %T", getoutargx(t)->type->type); // struct->field->field's type
break; break;
}
default: default:
fmtprint(fp, " %T", getoutargx(t)); fmtprint(fp, " %T", getoutargx(t));
break; break;
......
...@@ -14,6 +14,9 @@ func F1(T *T) bool { return T == nil } ...@@ -14,6 +14,9 @@ func F1(T *T) bool { return T == nil }
// Issue 2682. // Issue 2682.
func F2(c chan int) bool { return c == (<-chan int)(nil) } 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. // Call of inlined method with blank receiver.
func (_ *T) M() int { return 1 } func (_ *T) M() int { return 1 }
func (t *T) MM() int { return t.M() } func (t *T) MM() int { return t.M() }
...@@ -12,9 +12,9 @@ import "./one" ...@@ -12,9 +12,9 @@ import "./one"
func use() { func use() {
one.F1(nil) one.F1(nil)
one.F2(nil) one.F2(nil)
one.F3()
var t *one.T var t *one.T
t.M() t.M()
t.MM() t.MM()
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment