zero-deps / proto

Lightweight and fast serialization library for Scala 2/3 based on Protocol Buffers with macros
MIT License
34 stars 3 forks source link

check-macros #20

Closed tellnobody1 closed 3 years ago

tellnobody1 commented 3 years ago

Adding -Xcheck-macros (renamed -Ycheck:macros) to scalac options.

tellnobody1 commented 3 years ago

(using Quotes) is added because of https://github.com/lampepfl/dotty/pull/11442

tellnobody1 commented 3 years ago

Unfixed error:

[error] -- Error: /Users/andreyne/prj/kvs/deps/proto/proto/src/test/scala-3.0.0-RC2/testing.scala:132:32 
[error] 132 |  given MessageCodec[Message] = caseCodecAuto
[error]     |                                ^^^^^^^^^^^^^
[error]     |Exception occurred while executing macro expansion.
[error]     |java.lang.AssertionError: assertion failed: Reference to a method must be eta-expanded before it is used as an expression: scala.collection.immutable.Set.newBuilder
[error]     |   at scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:8)
[error]     |   at scala.quoted.runtime.impl.QuotesImpl$reflect$.scala$quoted$runtime$impl$QuotesImpl$reflect$$$xCheckMacroValidExpr(QuotesImpl.scala:2843)
[error]     |   at scala.quoted.runtime.impl.QuotesImpl$reflect$.xCheckMacroValidExpr$$anonfun$1(QuotesImpl.scala:2838)
[error]     |   at scala.Option.foreach(Option.scala:437)
[error]     |   at scala.quoted.runtime.impl.QuotesImpl$reflect$.scala$quoted$runtime$impl$QuotesImpl$reflect$$$xCheckMacroValidExpr(QuotesImpl.scala:2838)
[error]     |   at scala.quoted.runtime.impl.QuotesImpl$reflect$ValDef$.apply(QuotesImpl.scala:283)
[error]     |   at scala.quoted.runtime.impl.QuotesImpl$reflect$ValDef$.apply(QuotesImpl.scala:282)
[error]     |   at proto.BuildCodec.initValDef(BuildCodec.scala:416)
[error]     |   at proto.BuildCodec.initValDef$(BuildCodec.scala:7)