Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumGogenerics type parametersSingle-choice MCQ

A method on a generic type cannot introduce its own type parameters. Given the type below, which statement is correct?

type List[T any] struct { items []T } // Attempt: // func (l List[T]) Map[U any](f func(T) U) List[U] { ... }