当我想在 scalajs 中解析 LocalDate 时,会出现链接错误:
java.time.LocalDate.parse("2016-11-11")
这是错误消息:
[error] Referring to non-existent method java.time.LocalDate$.parse(java.lang.CharSequence)java.time.LocalDate
[error] called from example.ScalaJSExample$$anonfun$myview$1.applyOrElse(scala.collection.immutable.List,scala.Function1)java.lang.Object
[error] called from example.ScalaJSExample$$anonfun$myview$1.applyOrElse(java.lang.Object,scala.Function1)java.lang.Object
[error] called from scala.concurrent.Future$class.$$anonfun$1(scala.concurrent.Future,scala.PartialFunction,scala.util.Try)java.lang.Object
但使用 java.time.LocalDate.of(2016,11,11) 没有任何错误。
问题是什么?!