diff options
| author | Daniel Morsing <daniel.morsing@gmail.com> | 2013-08-29 16:48:44 +0200 |
|---|---|---|
| committer | Daniel Morsing <daniel.morsing@gmail.com> | 2013-08-29 16:48:44 +0200 |
| commit | 280c8b90e2785a7de2216cb129752bbeca09210a (patch) | |
| tree | 07f9f56a7cca90fb5c0bcb4fd7f4d7be53d83c44 /src | |
| parent | bf58d209992395f8c30c8554b2d04dc4e4ce128f (diff) | |
| download | go-280c8b90e2785a7de2216cb129752bbeca09210a.tar.xz | |
cmd/gc: make method names for function scoped types unique
Types in function scope can have methods on them if they embed another type, but we didn't make the name unique, meaning that 2 identically named types in different functions would conflict with eachother.
Fixes #6269.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/13326045
Diffstat (limited to 'src')
| -rw-r--r-- | src/cmd/gc/fmt.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/cmd/gc/fmt.c b/src/cmd/gc/fmt.c index 8673b39ce6..0db7ed22d2 100644 --- a/src/cmd/gc/fmt.c +++ b/src/cmd/gc/fmt.c @@ -604,8 +604,11 @@ typefmt(Fmt *fp, Type *t) if(!(fp->flags&FmtLong) && t->sym && t->etype != TFIELD && t != types[t->etype]) { switch(fmtmode) { case FTypeId: - if(fp->flags&FmtShort) + if(fp->flags&FmtShort) { + if(t->vargen) + return fmtprint(fp, "%hS·%d", t->sym, t->vargen); return fmtprint(fp, "%hS", t->sym); + } if(fp->flags&FmtUnsigned) return fmtprint(fp, "%uS", t->sym); // fallthrough |
