{
int nprec;
NodeList *l;
+ Type *t;
while(n && n->implicit)
n = n->left;
case OSTRUCTLIT:
if (fmtmode == FExp) { // requires special handling of field names
fmtprint(f, "%T{", n->type);
- for(l=n->list; l; l=l->next)
+ for(l=n->list; l; l=l->next) {
+ // another special case: if n->left is an embedded field of builtin type,
+ // it needs to be non-qualified. Can't figure that out in %S, so do it here
+ if(l->n->left->type->embedded) {
+ t = l->n->left->type->type;
+ if(t->sym == S)
+ t = t->type;
+ fmtprint(f, " %T:%N", t, l->n->right);
+ } else
+ fmtprint(f, " %hhS:%N", l->n->left->sym, l->n->right);
+
if(l->next)
- fmtprint(f, " %hhS:%N,", l->n->left->sym, l->n->right);
+ fmtstrcpy(f, ",");
else
- fmtprint(f, " %hhS:%N ", l->n->left->sym, l->n->right);
+ fmtstrcpy(f, " ");
+ }
return fmtstrcpy(f, "}");
}
// fallthrough
--- /dev/null
+// Copyright 2012 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.
+
+package one
+
+type T struct { int }
+
+func New(i int) T { return T{i} }
--- /dev/null
+// Copyright 2012 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.
+
+// Use the functions in one.go so that the inlined
+// forms get type-checked.
+
+package two
+
+import "./one"
+
+func use() {
+ _ = one.New(1)
+}
\ No newline at end of file
--- /dev/null
+// $G $D/$F.dir/one.go && $G $D/$F.dir/two.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.
+
+package ignored