go/internal/gccgoimporter: update package to match std lib version

Import changes from std lib version, specifically

      https://golang.org/cl/173440

which rolls out a more robust fix for issue 31540.

Updates golang/go#31540.

Change-Id: Ibeeb00ffd0ee6456d50fd4a243a1162f3940ad68
Reviewed-on: https://go-review.googlesource.com/c/tools/+/173777
Run-TryBot: Than McIntosh <thanm@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
diff --git a/go/internal/gccgoimporter/parser.go b/go/internal/gccgoimporter/parser.go
index ca63b34..6221084 100644
--- a/go/internal/gccgoimporter/parser.go
+++ b/go/internal/gccgoimporter/parser.go
@@ -497,6 +497,7 @@
 	// type alias
 	if p.tok == '=' {
 		p.next()
+		p.aliases[nlist[len(nlist)-1]] = name
 		if obj != nil {
 			// use the previously imported (canonical) type
 			t := obj.Type()
@@ -506,7 +507,6 @@
 		}
 		t := p.parseType(pkg, nlist...)
 		obj = types.NewTypeName(token.NoPos, pkg, name, t)
-		p.aliases[nlist[len(nlist)-1]] = name
 		scope.Insert(obj)
 		return t
 	}