diff --git a/doc/go_spec.html b/doc/go_spec.html index 50cb718395..579e254790 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -2511,12 +2511,12 @@ An alias declaration binds an identifier to the given type

-AliasDecl = identifier "=" Type .
+AliasDecl = identifier [ TypeParameters ] "=" Type .
 

Within the scope of -the identifier, it serves as an alias for the type. +the identifier, it serves as an alias for the given type.

@@ -2526,6 +2526,24 @@ type (
 )
 
+

+If the alias declaration specifies type parameters +[Go 1.24], the type name denotes a generic alias. +Generic aliases must be instantiated when they +are used. +

+ +
+type set[P comparable] = map[P]bool
+
+ +

+In an alias declaration the given type cannot be a type parameter. +

+ +
+type A[P any] = P    // illegal: P is a type parameter
+

Type definitions

@@ -8687,6 +8705,15 @@ integer values from zero to an upper limit. function as range expression. + +

Go 1.24

+ +

Type unification rules