For #67547.
Change-Id: I1b2118a311dce906327ae6e29e582da539c60b2b
Reviewed-on: https://go-review.googlesource.com/c/go/+/587157
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Findley <rfindley@google.com>
// If T's type set is empty, or if it doesn't
// have specific types, constant x cannot be
// converted.
- ok = T.(*TypeParam).underIs(func(u Type) bool {
+ ok = Unalias(T).(*TypeParam).underIs(func(u Type) bool {
// u is nil if there are no specific type terms
if u == nil {
cause = check.sprintf("%s does not contain specific types", T)
// If T's type set is empty, or if it doesn't
// have specific types, constant x cannot be
// converted.
- ok = T.(*TypeParam).underIs(func(u Type) bool {
+ ok = Unalias(T).(*TypeParam).underIs(func(u Type) bool {
// u is nil if there are no specific type terms
if u == nil {
cause = check.sprintf("%s does not contain specific types", T)
--- /dev/null
+// Copyright 2024 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 p
+
+func _[P int]() {
+ type A = P
+ _ = A(0) // don't crash with this conversion
+}