Skip to content

Instantly share code, notes, and snippets.

@damithadayananda
Created April 14, 2022 07:32
Show Gist options
  • Save damithadayananda/1b7ee87f76dcbb2aa6b817e7e5d6db63 to your computer and use it in GitHub Desktop.
Save damithadayananda/1b7ee87f76dcbb2aa6b817e7e5d6db63 to your computer and use it in GitHub Desktop.
package typeInference
import "golang.org/x/exp/constraints"
type Point []int32
func ConstraintTypeInference(){
constraintTypeInferenceDemo(Point{1,2},4)
}
func constraintTypeInferenceDemo[U ~[]T, T constraints.Integer](x []T,y T )U{
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment