1// Copyright 2021 The Go Authors. All rights reserved. 2// Use of this source code is governed by a BSD-style 3// license that can be found in the LICENSE file. 4 5package p 6 7// indirection 8 9func _[P any](p P) { 10 _ = *p // ERROR cannot indirect p 11} 12 13func _[P interface{ int }](p P) { 14 _ = *p // ERROR cannot indirect p 15} 16 17func _[P interface{ *int }](p P) { 18 _ = *p 19} 20 21func _[P interface{ *int | *string }](p P) { 22 _ = *p // ERROR must have identical base types 23} 24 25type intPtr *int 26 27func _[P interface{ *int | intPtr } ](p P) { 28 var _ int = *p 29} 30