Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion swift-6.docc/GuidedTour/GuidedTour.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ print(teamScore)
<< Would you like a jelly baby?
-->

在 `if` 语句中,条件必须是一个布尔表达式——这意味着像 `if score { ... }` 这样的代码是错误的,而不是隐式地将 `score` 与零进行比较
在 `if` 语句中,条件必须是一个布尔表达式——这意味着像 `if score { ... }` 这样的代码是错误的,这不是 `score` 与零进行隐式比较的方法

你可以在赋值操作符(`=`)或 `return` 之后使用 `if` 或 `switch`,以根据条件选择一个值。

Expand Down