Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scala 2.13.4: Auto-application to () is deprecated. (scalikejdbc-mapper-generator) #1134

Closed
SeanDaru opened this issue Dec 6, 2020 · 1 comment

Comments

@SeanDaru
Copy link

SeanDaru commented Dec 6, 2020

[Environment]

  • Scala
scalaVersion := "2.13.4"
  • scalikejdbc-mapper-generator
addSbtPlugin("org.scalikejdbc" %% "scalikejdbc-mapper-generator" % "3.5.0")
  • sample table
# mysql 8
CREATE TABLE humans
(
    id   BIGINT UNSIGNED AUTO_INCREMENT,
    name text,
    PRIMARY KEY (id)
);

I executed the below sbt task.

scalikejdbcGen humans Human
compile

Then, Scala compiler output the below warnings.

[warn] /.../Human.scala:35:32: Auto-application to `()` is deprecated. Supply the empty argument list `()` explicitly to invoke method single,
[warn] or remove the empty argument list from its definition (Java-defined methods are exempt).
[warn] In Scala 3, an unapplied method like this will be eta-expanded into a function.
[warn]     }.map(Human(h.resultName)).single.apply()
[warn]                                ^
[warn] /.../Human.scala:39:63: Auto-application to `()` is deprecated. Supply the empty argument list `()` explicitly to invoke method list,
[warn] or remove the empty argument list from its definition (Java-defined methods are exempt).
[warn] In Scala 3, an unapplied method like this will be eta-expanded into a function.
[warn]     withSQL(select.from(Human as h)).map(Human(h.resultName)).list.apply()
[warn]                                                               ^
[warn] /.../Human.scala:43:72: Auto-application to `()` is deprecated. Supply the empty argument list `()` explicitly to invoke method single,
[warn] or remove the empty argument list from its definition (Java-defined methods are exempt).
[warn] In Scala 3, an unapplied method like this will be eta-expanded into a function.
[warn]     withSQL(select(sqls.count).from(Human as h)).map(rs => rs.long(1)).single.apply().get
[warn]                                                                        ^
[warn] /.../Human.scala:49:32: Auto-application to `()` is deprecated. Supply the empty argument list `()` explicitly to invoke method single,
[warn] or remove the empty argument list from its definition (Java-defined methods are exempt).
[warn] In Scala 3, an unapplied method like this will be eta-expanded into a function.
[warn]     }.map(Human(h.resultName)).single.apply()
[warn]                                ^
[warn] /.../Human.scala:55:32: Auto-application to `()` is deprecated. Supply the empty argument list `()` explicitly to invoke method list,
[warn] or remove the empty argument list from its definition (Java-defined methods are exempt).
[warn] In Scala 3, an unapplied method like this will be eta-expanded into a function.
[warn]     }.map(Human(h.resultName)).list.apply()
[warn]                                ^
[warn] /.../Human.scala:61:22: Auto-application to `()` is deprecated. Supply the empty argument list `()` explicitly to invoke method single,
[warn] or remove the empty argument list from its definition (Java-defined methods are exempt).
[warn] In Scala 3, an unapplied method like this will be eta-expanded into a function.
[warn]     }.map(_.long(1)).single.apply().get
[warn]                      ^
[warn] /.../Human.scala:70:7: Auto-application to `()` is deprecated. Supply the empty argument list `()` explicitly to invoke method updateAndReturnGeneratedKey,
[warn] or remove the empty argument list from its definition (Java-defined methods are exempt).
[warn] In Scala 3, an unapplied method like this will be eta-expanded into a function.
[warn]     }.updateAndReturnGeneratedKey.apply()
[warn]       ^
[warn] /.../Human.scala:94:7: Auto-application to `()` is deprecated. Supply the empty argument list `()` explicitly to invoke method update,
[warn] or remove the empty argument list from its definition (Java-defined methods are exempt).
[warn] In Scala 3, an unapplied method like this will be eta-expanded into a function.
[warn]     }.update.apply()
[warn]       ^
[warn] /.../Human.scala:99:67: Auto-application to `()` is deprecated. Supply the empty argument list `()` explicitly to invoke method update,
[warn] or remove the empty argument list from its definition (Java-defined methods are exempt).
[warn] In Scala 3, an unapplied method like this will be eta-expanded into a function.
[warn]     withSQL { delete.from(Human).where.eq(column.id, entity.id) }.update.apply()
[warn]                                                                   ^

*I masked source path.


I think maybe that this source should be fixed.

https://github.com/scalikejdbc/scalikejdbc/blob/master/scalikejdbc-mapper-generator-core/src/main/scala/scalikejdbc/mapper/CodeGenerator.scala

@SeanDaru
Copy link
Author

SeanDaru commented Dec 7, 2020

I'm sorry...
This is duplicated with #1093 .

Please close.

@xuwei-k xuwei-k closed this as completed Dec 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants