sbt / contraband

http://www.scala-sbt.org/contraband/
Other
69 stars 22 forks source link

self type specification is not enough for Scala 3 #159

Closed eed3si9n closed 2 years ago

eed3si9n commented 2 years ago

steps

https://github.com/sbt/sbt/blob/a53eb471b32ebb6f796830320d1a44875c5b9767/testing/src/main/contraband/testing.contra

problem

[error] -- [E058] Type Mismatch Error: /home/runner/work/sbt/sbt/testing/src/main/contraband-scala/sbt/protocol/testing/codec/TestMessageFormats.scala:9:6 
[error] 9 |trait TestMessageFormats { self: sjsonnew.BasicJsonProtocol with sbt.protocol.testing.codec.TestStringEventFormats with sbt.protocol.testing.codec.TestInitEventFormats with sbt.protocol.testing.codec.TestResultFormats with sbt.protocol.testing.codec.TestCompleteEventFormats with sbt.protocol.testing.codec.StartTestGroupEventFormats with sbt.protocol.testing.codec.EndTestGroupEventFormats with sbt.protocol.testing.codec.EndTestGroupErrorEventFormats with sbt.protocol.testing.codec.TestItemDetailFormats with sbt.protocol.testing.codec.TestItemEventFormats =>
[error]   |      ^
[error]   |missing requirement: self type sjsonnew.BasicJsonProtocol & (sbt.protocol.testing.codec.TestStringEventFormats 
[error]   |  &
[error]   | (sbt.protocol.testing.codec.TestInitEventFormats & (
[error]   |  sbt.protocol.testing.codec.TestResultFormats
[error]   | & (sbt.protocol.testing.codec.TestCompleteEventFormats & (
[error]   |  sbt.protocol.testing.codec.StartTestGroupEventFormats
[error]   | & (sbt.protocol.testing.codec.EndTestGroupEventFormats & (
[error]   |  sbt.protocol.testing.codec.EndTestGroupErrorEventFormats
[error]   | & (sbt.protocol.testing.codec.TestItemDetailFormats & 
[error]   |  sbt.protocol.testing.codec.TestItemEventFormats
[error]   |)))))))) & sbt.protocol.testing.codec.TestMessageFormats of trait TestMessageFormats does not conform to self type sbt.internal.testing.StatusFormats & sjsonnew.BasicJsonProtocol
[error]   |of required trait TestItemDetailFormats

note

The generated code works for Scala 2, but Scala 3 seems to require list of all transitive self type implied dependencies due to https://github.com/lampepfl/dotty/issues/2214