これが機能する理由:
List(
"string", "string2"
)
しかし、これはそうではありませんか?
List{
"string", "string2"
}
コンパイル エラー:;' expected but ',' found.
しかし、apply メソッドを使用した自分のオブジェクトの場合:
object Dictionary {
...
private[dictionary] def apply(words: List[Word]) = {
...
}
}
Dictionary { // curly braces works fine
List ( // but here, for List - I can Not use curly braces
"hello", "hello2"
)
}