Skip to content

Commit 1eff6ad

Browse files
committed
Fix Simplify Chinese Translation of Scala Tour: self types according to liufengyun's suggestion
1 parent ab97ce2 commit 1eff6ad

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

_zh-cn/tour/self-types.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ previous-page: compound-types
1515
---
1616
自类型用于声明一个特质必须混入其他特质,尽管该特质没有直接扩展其他特质。 这使得所依赖的成员可以在没有导入的情况下使用。
1717

18-
自类型是一种缩小 `this` 类型或 `this` 别名类型的方法。 语法看起来像普通函数语法,但是意义完全不一样。
18+
自类型是一种细化 `this` `this` 别名之类型的方法。 语法看起来像普通函数语法,但是意义完全不一样。
1919

2020
要在特质中使用自类型,写一个标识符,跟上要混入的另一个特质,以及 `=>`(例如 `someIdentifier: SomeOtherTrait =>`)。
2121
```tut
@@ -24,7 +24,7 @@ trait User {
2424
}
2525
2626
trait Tweeter {
27-
this: User => // 重新分配 this 的类型
27+
this: User => // 重新赋予 this 的类型
2828
def tweet(tweetText: String) = println(s"$username: $tweetText")
2929
}
3030

0 commit comments

Comments
 (0)