2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Scala 2.13.3 で複数引数の中置記法がコンパイルエラーになる

Posted at

個人というか、プライベートなチーム開発をしていて、折角だからできるだけ新しめのバージョンで実装してみようと思い、Scala2.13.3で実装していて、いつも通りSlickを書いていたら一瞬ハマった話。

環境

  • Scala 2.13.3
  • play-slick 5.0.0

エラー

[info] Compiling 24 Scala sources and 1 Java source to /Users/chibatoshinori/Projects/NewApp/NewAppApi/target/scala-2.13/classes ...
[error] /Users/chibatoshinori/Projects/NewApp/NewApp/app/gateways/abilities/AbilityDetailEntity.scala:33:110: multiarg infix syntax looks like a tuple and will be deprecated
[error]     override def * : ProvenShape[AbilityDetailEntity] = (ability, langCode, abilityName, abilityDescription) <> (AbilityDetailEntity.tupled, AbilityDetailEntity.unapply)
[error]                                                                                                              ^

multiarg infix syntax looks like a tuple and will be deprecated

タプルのような複数引数をとる中置記法が非推奨になった模様。

下記のPRが関連というか原因というか。

Discourage multi-argument infix syntax: lint applications (x op (a, b)), also lint operator-name definitions #8951

PRを見る限りだと、2.13.3からみたい。同じ2.13系でも2.13.2までなら問題なく動くのかも。(確認はしていない)

対応

中置記法がだめとのことなので、. でつなげる書き方に切り替えて対応。

override def * : ProvenShape[JobMasterEntity] = (key, calcMethodId, creditMin, creditMax).<>(JobMasterEntity.tupled, JobMasterEntity.unapply)
2
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?