Update 06_Declarations.md

#1195
This commit is contained in:
Jie Liang
2022-07-18 21:27:49 -05:00
committed by GitHub
parent 69c79b8d02
commit 2128ce6f51

View File

@ -528,8 +528,8 @@ _ : 参数类型
func f(x: Int = 42) -> Int { return x } func f(x: Int = 42) -> Int { return x }
f() // 有效,使用默认值 f() // 有效,使用默认值
f(7) // 有效,提供了 f(x: 7) // 有效,使用传入的
f(x: 7) // 无效,该参数没有外部名称 f(7) // 无效,缺少参数标签
``` ```
### 特殊方法 {#special-kinds-of-methods} ### 特殊方法 {#special-kinds-of-methods}