File tree Expand file tree Collapse file tree 3 files changed +3
-3
lines changed Expand file tree Collapse file tree 3 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ Implicit classes have the following restrictions:
7777** 2. They may only take one non-implicit argument in their constructor.**
7878
7979
80- implicit class RichDate(date: java.util.Date ) // OK!
80+ implicit class RichDate(date: java.time.LocalDate ) // OK!
8181 implicit class Indexer[T](collection: Seq[T], index: Int) // BAD!
8282 implicit class Indexer[T](collection: Seq[T])(implicit index: Index) // OK!
8383
Original file line number Diff line number Diff line change @@ -208,7 +208,7 @@ sure to indicate the actual method names:
208208 * @return a new Person instance with the age determined by the
209209 * birthdate and current date.
210210 */
211- def apply(name: String, birthDate: java.util.Date ) = {}
211+ def apply(name: String, birthDate: java.time.LocalDate ) = {}
212212 }
213213
214214If your object holds implicit conversions, provide an example in the
Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ Scala 2.10引入了一种叫做隐式类的新特性。隐式类指的是用impl
6161
62622 . 构造函数只能携带一个非隐式参数。
6363````
64- implicit class RichDate(date: java.util.Date ) // 正确!
64+ implicit class RichDate(date: java.time.LocalDate ) // 正确!
6565 implicit class Indexer[T](collecton: Seq[T], index: Int) // 错误!
6666 implicit class Indexer[T](collecton: Seq[T])(implicit index: Index) // 正确!
6767````
You can’t perform that action at this time.
0 commit comments