tarao / record4s

Extensible records for Scala
https://tarao.orezdnu.org/record4s/
Apache License 2.0
64 stars 4 forks source link

"New anonymous class definition will be duplicated at each inline site" warning #111

Closed xuwei-k closed 3 months ago

xuwei-k commented 3 months ago

set scala 3.3.4-RC1 and core/compile

https://github.com/tarao/record4s/blob/3f127ed33099c485e08ccd1df1261c38d641e1fe/modules/core/src/main/scala/com/github/tarao/record4s/Converter.scala#L46-L56

[error] -- [E197] Potential Issue Error: my-record4s-project-dir/modules/core/src/main/scala/com/github/tarao/record4s/Converter.scala:46:4 
[error] 46 |    new Converter {
[error]    |    ^
[error]    |   New anonymous class definition will be duplicated at each inline site
[error]    |
[error]    | longer explanation available when compiling with `-explain`
[error] -- [E197] Potential Issue Error: my-record4s-project-dir/modules/core/src/main/scala/com/github/tarao/record4s/Converter.scala:56:23 
[error] 56 |  ): Converter[R, T] = new Converter {
[error]    |                       ^
[error]    |   New anonymous class definition will be duplicated at each inline site
[error]    |
[error]    | longer explanation available when compiling with `-explain`
xuwei-k commented 3 months ago

same warnings

https://github.com/tarao/record4s/blob/37f5efc877a8b2b216964bfee66692977b6756c1/modules/core/.js/src/main/scala/com/github/tarao/record4s/RecordPlatformSpecific.scala#L173

https://github.com/tarao/record4s/blob/37f5efc877a8b2b216964bfee66692977b6756c1/modules/circe/src/main/scala/com/github/tarao/record4s/circe/Codec.scala#L70

https://github.com/tarao/record4s/blob/37f5efc877a8b2b216964bfee66692977b6756c1/modules/circe/src/main/scala/com/github/tarao/record4s/circe/Codec.scala#L82