Source file test/typeparam/issue48645a.go
1 // run 2 3 // Copyright 2021 The Go Authors. All rights reserved. 4 // Use of this source code is governed by a BSD-style 5 // license that can be found in the LICENSE file. 6 7 package main 8 9 import ( 10 "fmt" 11 "reflect" 12 ) 13 14 type Stream[T any] struct { 15 } 16 17 func (s Stream[T]) DropWhile() Stream[T] { 18 return Pipe[T, T](s) 19 } 20 21 func Pipe[T, R any](s Stream[T]) Stream[R] { 22 it := func(fn func(R) bool) { 23 } 24 fmt.Println(reflect.TypeOf(it).String()) 25 return Stream[R]{} 26 } 27 28 func main() { 29 s := Stream[int]{} 30 s = s.DropWhile() 31 } 32