Skip to content

Commit 27ab06e

Browse files
committed
Backports #17447 to lts
[Cherry-picked 8e65a2c] [Cherry-picked 978d4e4] [Cherry-picked 6f21d93] [Cherry-picked 8657620] [Cherry-picked 6021b7b] [Cherry-picked a99f0b6] [Cherry-picked 254f23e]
1 parent 69cfa7e commit 27ab06e

File tree

6 files changed

+476
-593
lines changed

6 files changed

+476
-593
lines changed

docs/_docs/internals/syntax.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,6 @@ SimpleType1 ::= id
201201
Singleton ::= SimpleRef
202202
| SimpleLiteral
203203
| Singleton ‘.’ id
204-
Singletons ::= Singleton { ‘,’ Singleton }
205204
FunArgType ::= [`erased`] Type
206205
| [`erased`] ‘=>’ Type PrefixOp(=>, t)
207206
FunArgTypes ::= FunArgType { ‘,’ FunArgType }
@@ -357,8 +356,8 @@ ClsParam ::= {Annotation}
357356
[{Modifier} (‘val’ | ‘var’) | ‘inline’] Param
358357
359358
DefParamClauses ::= DefParamClause { DefParamClause } -- and two DefTypeParamClause cannot be adjacent
360-
DefParamClause ::= DefTypeParamClause
361-
| DefTermParamClause
359+
DefParamClause ::= DefTypeParamClause
360+
| DefTermParamClause
362361
| UsingParamClause
363362
TypelessClauses ::= TypelessClause {TypelessClause}
364363
TypelessClause ::= DefTermParamClause

docs/_docs/reference/new-types/intersection-types-spec.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,10 @@ A & B <: B A & B <: A
4646
In another word, `A & B` is the same type as `B & A`, in the sense that the two types
4747
have the same values and are subtypes of each other.
4848

49-
If `C` is a type constructor, then `C[A] & C[B]` can be simplified using the following three rules:
49+
If `C` is a co- or contravariant type constructor, then `C[A] & C[B]` can be simplified using the following rules:
5050

5151
- If `C` is covariant, `C[A] & C[B] ~> C[A & B]`
5252
- If `C` is contravariant, `C[A] & C[B] ~> C[A | B]`
53-
- If `C` is non-variant, emit a compile error
5453

5554
When `C` is covariant, `C[A & B] <: C[A] & C[B]` can be derived:
5655

docs/_spec/02-identifiers-names-and-scopes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ In that case, the type of ´x´ is the type of the referenced entity.
5353

5454
A reference to a qualified (type- or term-) identifier ´e.x´ refers to the member of the type ´T´ of ´e´ which has the name ´x´ in the same namespace as the identifier.
5555
It is an error if ´T´ is not a [value type](03-types.html#value-types).
56-
The type of ´e.x´ is the member type of the referenced entity in ´T´.
56+
The type of ´e.x´ is specified as a [type designator](03-types.html#type-designators).
5757

5858
Binding precedence implies that the way source is bundled in files affects name resolution.
5959
In particular, imported names have higher precedence than names, defined in other files, that might otherwise be visible because they are defined in either the current package or an enclosing package.

0 commit comments

Comments
 (0)