diff --git a/doc/go_spec.html b/doc/go_spec.html index 99bedf2671..c7f93c953d 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -1754,6 +1754,12 @@ depending on the direction of the directional channels present. +

+By definition, a core type is never a defined type, +type parameter, or +interface type. +

+

Examples of interfaces with core types:

@@ -2994,6 +3000,13 @@ non-blank identifier denoting a or a parenthesized expression.

+
+Operand     = Literal | OperandName [ TypeArgs ] | "(" Expression ")" .
+Literal     = BasicLit | CompositeLit | FunctionLit .
+BasicLit    = int_lit | float_lit | imaginary_lit | rune_lit | string_lit .
+OperandName = identifier | QualifiedIdent .
+
+

An operand name denoting a type-parameterized function may be followed by a list of type arguments; the @@ -3005,13 +3018,6 @@ The blank identifier may appear as an operand only on the left-hand side of an assignment.

-
-Operand     = Literal | OperandName [ TypeArgs ] | "(" Expression ")" .
-Literal     = BasicLit | CompositeLit | FunctionLit .
-BasicLit    = int_lit | float_lit | imaginary_lit | rune_lit | string_lit .
-OperandName = identifier | QualifiedIdent .
-
-

Qualified identifiers

@@ -3038,8 +3044,7 @@ math.Sin // denotes the Sin function in package math

Composite literals

-Composite literals construct values for structs, arrays, slices, and maps -and create a new value each time they are evaluated. +Composite literals construct new composite values each time they are evaluated. They consist of the type of the literal followed by a brace-bound list of elements. Each element may optionally be preceded by a corresponding key.

@@ -3057,11 +3062,12 @@ Element = Expression | LiteralValue .

-The LiteralType's underlying type must be a struct, array, slice, or map type +The LiteralType's core type T +must be a struct, array, slice, or map type (the grammar enforces this constraint except when the type is given as a TypeName). The types of the elements and keys must be assignable -to the respective field, element, and key types of the literal type; +to the respective field, element, and key types of type T; there is no additional conversion. The key is interpreted as a field name for struct literals, an index for array and slice literals, and a key for map literals. @@ -3318,6 +3324,8 @@ f.p[i].x()

Selectors

+ +

For a primary expression x that is not a package name, the @@ -3361,8 +3369,7 @@ The following rules apply to selectors: For a value x of type T or *T where T is not a pointer or interface type, x.f denotes the field or method at the shallowest depth -in T where there -is such an f. +in T where there is such an f. If there is not exactly one f with shallowest depth, the selector expression is illegal. @@ -3722,7 +3729,8 @@ The following rules apply: If a is not a map: