aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/types2/testdata/check
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2021-07-28 13:50:09 -0700
committerRobert Griesemer <gri@golang.org>2021-07-29 19:45:50 +0000
commitc079b6baaa781e71a48661c05063d1d2754937f8 (patch)
tree55c52c63513c657ab611f0d3f9b2c7cbf4834cc4 /src/cmd/compile/internal/types2/testdata/check
parentff0c0dbca6a7a3a3d6528481829679be4c9d7e94 (diff)
downloadgo-c079b6baaa781e71a48661c05063d1d2754937f8.tar.gz
go-c079b6baaa781e71a48661c05063d1d2754937f8.zip
[dev.typeparams] cmd/compile/internal/types2: trigger verification while resolving instance
This is a straight port of CL 335978 with minor adjustements to white space and an error message. Change-Id: Icfcb562f75802a119ce5d02427bffecf7e279b2f Reviewed-on: https://go-review.googlesource.com/c/go/+/338097 Trust: Robert Griesemer <gri@golang.org> Reviewed-by: Robert Findley <rfindley@google.com>
Diffstat (limited to 'src/cmd/compile/internal/types2/testdata/check')
-rw-r--r--src/cmd/compile/internal/types2/testdata/check/issues.go24
1 files changed, 1 insertions, 3 deletions
diff --git a/src/cmd/compile/internal/types2/testdata/check/issues.go2 b/src/cmd/compile/internal/types2/testdata/check/issues.go2
index e29357de0b..1ede383ebe 100644
--- a/src/cmd/compile/internal/types2/testdata/check/issues.go2
+++ b/src/cmd/compile/internal/types2/testdata/check/issues.go2
@@ -74,10 +74,8 @@ func (u T2[U]) Add1() U {
return u.s + 1
}
-// TODO(rfindley): we should probably report an error here as well, not
-// just when the type is first instantiated.
func NewT2[U any]() T2[U /* ERROR U has no constraints */ ] {
- return T2[U]{}
+ return T2[U /* ERROR U has no constraints */ ]{}
}
func _() {