From: Robert Griesemer
A type determines a set of values together with operations and methods specific
to those values. A type may be denoted by a type name, if it has one, which must be
-followed by type arguments if the type is parameterized.
+followed by type arguments if the type is generic.
A type may also be specified using a type literal, which composes a type
from existing types.
@@ -2197,13 +2197,13 @@ Go is lexically scoped using blocks:
If the type definition specifies type parameters, -the type name denotes a parameterized type. -Parameterized types must be instantiated when they +the type name denotes a generic type. +Generic types must be instantiated when they are used.
@@ -2581,9 +2581,9 @@ func f[T any]() {-A parameterized type may also have methods associated with it. In this case, +A generic type may also have methods associated with it. In this case, the method receivers must declare the same number of type parameters as -present in the parameterized type definition. +present in the generic type definition.
@@ -2595,7 +2595,7 @@ func (l *List[T]) Len() int { ⦠}A type parameter list declares the type parameters -in a type-parameterized function or type declaration. +in a generic function or type declaration. The type parameter list looks like an ordinary function parameter list except that the type parameter names must all be present and the list is enclosed in square brackets rather than parentheses. @@ -2628,7 +2628,7 @@ has a corresponding (meta-)type which is called its
-A parsing ambiguity arises when the type parameter list for a parameterized type +A parsing ambiguity arises when the type parameter list for a generic type declares a single type parameter with a type constraint of the form
*C
or(C)
whereC
is not a (possibly parenthesized) type literal: @@ -2868,8 +2868,8 @@ func IndexRune(s string, r rune) int {If the function declaration specifies type parameters, -the function name denotes a type-parameterized function. -Type-parameterized functions must be instantiated when they +the function name denotes a generic function. +Generic functions must be instantiated when they are used.
@@ -2954,7 +2954,7 @@ to the base typePoint
.-If the receiver base type is a parameterized type, the +If the receiver base type is a generic type, the receiver specification must declare corresponding type parameters for the method to use. This makes the receiver type parameters available to the method.
@@ -3008,7 +3008,7 @@ OperandName = identifier | QualifiedIdent .
-An operand name denoting a type-parameterized function +An operand name denoting a generic function may be followed by a list of type arguments; the resulting operand is an instantiated function.
@@ -4083,7 +4083,7 @@ pt.Scale(3.5) // method call with receiver pt
-If f
denotes a parameterized function, it must be
+If f
denotes a generic function, it must be
instantiated before it can be called
or used as a function value.
-A parameterized function or type is instantiated by substituting type arguments +A generic function or type is instantiated by substituting type arguments for the type parameters. Instantiation proceeds in two phases:
-Instantiating a type results in a new non-parameterized named type; -instantiating a function produces a new non-parameterized function. +Instantiating a type results in a new non-generic named type; +instantiating a function produces a new non-generic function.
@@ -4257,10 +4257,10 @@ the remaining arguments to be inferred. Loosely speaking, type arguments may be-Parameterized types, and parameterized functions that are not called, +Generic types, and generic functions that are not called, require a type argument list for instantiation; if the list is partial, all remaining type arguments must be inferrable. -Calls to parameterized functions may provide a (possibly partial) type +Calls to generic functions may provide a (possibly partial) type argument list, or may omit it entirely if the omitted type arguments are inferrable from the ordinary (non-type) function arguments.
@@ -4429,7 +4429,7 @@ parameters used byT
.-For instance, given the type-parameterized function +For instance, given the generic function
@@ -6304,7 +6304,7 @@ if v == nil {-A type parameter or a parameterized type +A type parameter or a generic type may be used as a type in a case. If upon instantiation that type turns out to duplicate another entry in the switch, the first matching case is chosen.