diff options
author | Matthew Dempsky <mdempsky@google.com> | 2021-07-01 12:47:58 -0700 |
---|---|---|
committer | Matthew Dempsky <mdempsky@google.com> | 2021-07-02 14:55:39 +0000 |
commit | 2aea44204ef8e3467bd2d21865e3d2b8045f3d12 (patch) | |
tree | f9091e3613940b6242cb99c4d1ed47ec0806f066 /src/cmd/compile/internal/noder/linker.go | |
parent | 30e5f266ed202740cfe0b7a9fde6117d6e1d6064 (diff) | |
download | go-2aea44204ef8e3467bd2d21865e3d2b8045f3d12.tar.gz go-2aea44204ef8e3467bd2d21865e3d2b8045f3d12.zip |
[dev.typeparams] cmd/compile: enable generics syntax with -lang=go1.18
We already use -lang=go1.18 to control the types2 type checker
behavior. This CL does the same for the parser.
Also, disable an assertion in the unified IR linker that depended on
the -G flag. This assertion was more useful during initial
bootstrapping of that code, but it's less critical now.
With these two changes, "GOEXPERIMENT=unified ./make.bash" is enough
to get a fully functional generics-enabled toolchain. There's no need
to continue specifying custom compiler flags later on.
Change-Id: I7766381926f3bb17eee2e5fcc182a38a39e937e1
Reviewed-on: https://go-review.googlesource.com/c/go/+/332373
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Matthew Dempsky <mdempsky@google.com>
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Diffstat (limited to 'src/cmd/compile/internal/noder/linker.go')
-rw-r--r-- | src/cmd/compile/internal/noder/linker.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/cmd/compile/internal/noder/linker.go b/src/cmd/compile/internal/noder/linker.go index ed47a355d8..eefb5083e5 100644 --- a/src/cmd/compile/internal/noder/linker.go +++ b/src/cmd/compile/internal/noder/linker.go @@ -149,9 +149,11 @@ func (l *linker) relocObj(pr *pkgReader, idx int) int { var ok bool obj, ok = sym.Def.(*ir.Name) - // Generic types and functions won't have definitions. + // Generic types and functions and declared constraint types won't + // have definitions. // For now, just generically copy their extension data. - if !ok && base.Flag.G == 0 { + // TODO(mdempsky): Restore assertion. + if !ok && false { base.Fatalf("missing definition for %v", sym) } } |