Source file
test/fixedbugs/issue53309.go
1
2
3
4
5
6
7 package main
8
9 type TaskInput interface {
10 deps() []*taskDefinition
11 }
12
13 type Value[T any] interface {
14 metaValue
15 }
16
17 type metaValue interface {
18 TaskInput
19 }
20
21 type taskDefinition struct {
22 }
23
24 type taskResult struct {
25 task *taskDefinition
26 }
27
28 func (tr *taskResult) deps() []*taskDefinition {
29 return nil
30 }
31
32 func use[T any](v Value[T]) {
33 _, ok := v.(*taskResult)
34 if !ok {
35 panic("output must be *taskResult")
36 }
37 }
38
39 func main() {
40 tr := &taskResult{&taskDefinition{}}
41 use[string](Value[string](tr))
42 }
43
View as plain text