Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
AnyRef (Java 関数の引数) の配列を Int のタプルに変換する必要がありました。hereから受け入れられた回答を試しましたが、その質問では配列がAnyRefの配列ではなくAnyの配列であると想定されていたため、これはうまくいきませんでした。
最終的に、私のために働いたコードは次のようになりました:
val (x, y) = args match { case Array(x: Integer, y: Integer, _*) => (x, y) }
自動ボックス化された AnyRefs (Java オブジェクト) からソースしているという事実に対処するために、Int ではなくボックス化クラス Integer を使用していることに注意してください。