File tree 3 files changed +3
-3
lines changed
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:
77
77
** 2. They may only take one non-implicit argument in their constructor.**
78
78
79
79
80
- implicit class RichDate(date: java.util.Date ) // OK!
80
+ implicit class RichDate(date: java.time.LocalDate ) // OK!
81
81
implicit class Indexer[T](collection: Seq[T], index: Int) // BAD!
82
82
implicit class Indexer[T](collection: Seq[T])(implicit index: Index) // OK!
83
83
Original file line number Diff line number Diff line change @@ -208,7 +208,7 @@ sure to indicate the actual method names:
208
208
* @return a new Person instance with the age determined by the
209
209
* birthdate and current date.
210
210
*/
211
- def apply(name: String, birthDate: java.util.Date ) = {}
211
+ def apply(name: String, birthDate: java.time.LocalDate ) = {}
212
212
}
213
213
214
214
If 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
61
61
62
62
2 . 构造函数只能携带一个非隐式参数。
63
63
````
64
- implicit class RichDate(date: java.util.Date ) // 正确!
64
+ implicit class RichDate(date: java.time.LocalDate ) // 正确!
65
65
implicit class Indexer[T](collecton: Seq[T], index: Int) // 错误!
66
66
implicit class Indexer[T](collecton: Seq[T])(implicit index: Index) // 正确!
67
67
````
You can’t perform that action at this time.
0 commit comments