aboutsummaryrefslogtreecommitdiff
path: root/test/typeparam/issue50598.dir/a2.go
diff options
context:
space:
mode:
authorDan Scales <danscales@google.com>2022-01-13 13:20:19 -0800
committerDan Scales <danscales@google.com>2022-01-14 16:41:18 +0000
commitb41185c5c3da2d5f52b3b5aa7eb034addd458938 (patch)
tree707a062e04f967fbd0b454edb98a53d035d08905 /test/typeparam/issue50598.dir/a2.go
parente550c3054586a224d949cc8fa030bac0887bee51 (diff)
downloadgo-b41185c5c3da2d5f52b3b5aa7eb034addd458938.tar.gz
go-b41185c5c3da2d5f52b3b5aa7eb034addd458938.zip
cmd/compile: add call to ImportedBody() when exporting shape inst body
When we export a shape instantiation, because a particular fully-instantiated type is needed by an inlineable function, we possibly export the body of the instantiation, if it is inlineable. In this case, we should have been calling ImportedBody() to make sure that the function body had already been read in (if it is actually imported from another package). Fixes #50598 Change-Id: I512d2bcc745faa6ff3a97e25bc8f46e2c2643d23 Reviewed-on: https://go-review.googlesource.com/c/go/+/378494 Trust: Dan Scales <danscales@google.com> Run-TryBot: Dan Scales <danscales@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'test/typeparam/issue50598.dir/a2.go')
-rw-r--r--test/typeparam/issue50598.dir/a2.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/typeparam/issue50598.dir/a2.go b/test/typeparam/issue50598.dir/a2.go
new file mode 100644
index 0000000000..3eb5200253
--- /dev/null
+++ b/test/typeparam/issue50598.dir/a2.go
@@ -0,0 +1,11 @@
+// Copyright 2022 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 a2
+
+import "a0"
+
+func New() int {
+ return a0.Builder[int]{}.New1()
+}