aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/types2/typexpr.go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2020-10-22 15:32:05 -0700
committerRobert Griesemer <gri@golang.org>2020-10-27 03:37:05 +0000
commit87eab74628bc23831bd783806e8ec16927bd9a50 (patch)
treeadac6d1cd51a2d77dbc10926b5be0894c2a4dfd2 /src/cmd/compile/internal/types2/typexpr.go
parent5bfd2964a6519c8046b16b41bb9f84ecb6202356 (diff)
downloadgo-87eab74628bc23831bd783806e8ec16927bd9a50.tar.gz
go-87eab74628bc23831bd783806e8ec16927bd9a50.zip
[dev.typeparams] cmd/compile: enable type-checking of generic code
This change makes a first connection between the compiler and types2. When the -G flag is provided, the compiler accepts code using type parameters; with this change generic code is also type-checked (but then compilation ends). Change-Id: I0fa6f6213267a458a6b33afe8ff26869fd838a63 Reviewed-on: https://go-review.googlesource.com/c/go/+/264303 Trust: Robert Griesemer <gri@golang.org> Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'src/cmd/compile/internal/types2/typexpr.go')
-rw-r--r--src/cmd/compile/internal/types2/typexpr.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/types2/typexpr.go b/src/cmd/compile/internal/types2/typexpr.go
index ae5ea669f5..0edd7731fa 100644
--- a/src/cmd/compile/internal/types2/typexpr.go
+++ b/src/cmd/compile/internal/types2/typexpr.go
@@ -418,7 +418,7 @@ func (check *Checker) funcType(sig *Signature, recvPar *syntax.Field, tparams []
// goTypeName returns the Go type name for typ and
// removes any occurences of "types." from that name.
func goTypeName(typ Type) string {
- return strings.ReplaceAll(fmt.Sprintf("%T", typ), "types.", "")
+ return strings.Replace(fmt.Sprintf("%T", typ), "types.", "", -1) // strings.ReplaceAll is not available in Go 1.4
}
// typInternal drives type checking of types.