fix anchor name and link format
This commit is contained in:
@ -51,7 +51,7 @@ simpleMax(3.14159, 2.71828) // T 被推断为 Double 类型
|
||||
|
||||
泛型函数或构造器可以重载,但在泛型形参子句中的类型形参必须有不同的约束或要求,抑或二者皆不同。当调用重载的泛型函数或构造器时,编译器会根据这些约束来决定调用哪个重载函数或构造器。
|
||||
|
||||
更多关于泛型 where 从句的信息和关于泛型函数声明的例子,可以看一看 [泛型 where 子句](../02_language_guide/22_Generics.md#where_clauses)。
|
||||
更多关于泛型 where 从句的信息和关于泛型函数声明的例子,可以看一看 [泛型 where 子句](../02_language_guide/22_Generics.md#where-clauses)。
|
||||
|
||||
> 泛型形参子句语法
|
||||
>
|
||||
@ -67,9 +67,9 @@ simpleMax(3.14159, 2.71828) // T 被推断为 Double 类型
|
||||
#### generic-parameter {#generic-parameter}
|
||||
> *泛形形参* → [*类型名称*](./03_Types.md#type-name)
|
||||
>
|
||||
> *泛形形参* → [*类型名称*](./03_Types.md#type-name) **:** [*类型标识符*](./03_Types.md#type-identifier)
|
||||
> *泛形形参* → [*类型名称*](./03_Types.md#type-name) **:** [*类型标识符*](./03-Types.md#type-identifier)
|
||||
>
|
||||
> *泛形形参* → [*类型名称*](./03_Types.md#type-name) **:** [*协议合成类型*](./03_Types.md#protocol-composition-type)
|
||||
> *泛形形参* → [*类型名称*](./03_Types.md#type-name) **:** [*协议合成类型*](./03-Types.md#protocol-composition-type)
|
||||
>
|
||||
>
|
||||
#### requirement-clause {#requirement-clause}
|
||||
@ -87,13 +87,13 @@ simpleMax(3.14159, 2.71828) // T 被推断为 Double 类型
|
||||
>
|
||||
#### conformance-requirement {#conformance-requirement}
|
||||
>
|
||||
> *一致性约束* → [*类型标识符*](./03_Types.md#type-identifier) **:** [*类型标识符*](./03_Types.md#type-identifier)
|
||||
> *一致性约束* → [*类型标识符*](./03_Types.md#type-identifier) **:** [*类型标识符*](./03-Types.md#type-identifier)
|
||||
>
|
||||
> *一致性约束* → [*类型标识符*](./03_Types.md#type-identifier) **:** [*协议合成类型*](./03_Types.md#protocol-composition-type)
|
||||
> *一致性约束* → [*类型标识符*](./03_Types.md#type-identifier) **:** [*协议合成类型*](./03-Types.md#protocol-composition-type)
|
||||
>
|
||||
|
||||
#### same-type-requirement {#same-type-requirement}
|
||||
> *同类型约束* → [*类型标识符*](./03_Types.md#type-identifier) **==** [*类型*](./03_Types.md#type)
|
||||
> *同类型约束* → [*类型标识符*](./03_Types.md#type-identifier) **==** [*类型*](./03-Types.md#type)
|
||||
>
|
||||
|
||||
## 泛型实参子句 {#generic-argument}
|
||||
@ -118,7 +118,7 @@ struct Dictionary<Key: Hashable, Value>: CollectionType, DictionaryLiteralConver
|
||||
let arrayOfArrays: Array<Array<Int>> = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
|
||||
```
|
||||
|
||||
如 [泛型形参子句](#generic_parameter) 所述,不能用泛型实参子句来指定泛型函数或构造器的类型实参。
|
||||
如 [泛型形参子句](#generic-parameter) 所述,不能用泛型实参子句来指定泛型函数或构造器的类型实参。
|
||||
|
||||
> 泛型实参子句语法
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user