You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Have found a weird issue with SmartType in Scala 2.13.10 with -Xsource:3 enabled.
With the below snippet, it would report an error We were unable to read your assertion at compile-time. (attached at the bottom) during compilation.
However, this only happens after the scalac option -Xsource:3 is enabled.
Besides, if I add some calls before declaring object Blah extends Subtype[Int], like the commented code in the snippet, the compilation would succeed. I also tried providing different type parameter into Subtype, like String, the problem persists.
I have also tried both zio-prelude version "1.0.0-RC16" and "1.0.0-RC15". Both would fail.
importzio.prelude.Assertion._importzio.prelude.SubtypeobjectAssertionsTest {
// Blah(1) // uncommenting this line would make it compiledobjectBlahextendsSubtype[Int] {
// noinspection TypeAnnotationoverridedefassertion= assert(greaterThanOrEqualTo(1))
}
typeBlah=Blah.Typedeffoo():Int=Blah(50)
}
[error] Newtype Assertion Failed
[error] We were unable to read your assertion at compile-time.
[error] This is because you have annotated `def assertion` with its type signature:
[error]
[error] override def assertion: QuotedAssertion[Int] = assert(...)
[error]
[error] Due to the macro machinery powering this feature, you MUST NOT ANNOTATE this method.
[error] Try deleting the type annotation and recompiling. Something like:
[error]
[error] override def assertion = assert(...)
[error]
[error] Blah(50)
[error] ^
The text was updated successfully, but these errors were encountered:
Have found a weird issue with SmartType in Scala 2.13.10 with
-Xsource:3
enabled.With the below snippet, it would report an error
We were unable to read your assertion at compile-time.
(attached at the bottom) during compilation.However, this only happens after the scalac option
-Xsource:3
is enabled.Besides, if I add some calls before declaring
object Blah extends Subtype[Int]
, like the commented code in the snippet, the compilation would succeed. I also tried providing different type parameter intoSubtype
, likeString
, the problem persists.I have also tried both zio-prelude version "1.0.0-RC16" and "1.0.0-RC15". Both would fail.
The text was updated successfully, but these errors were encountered: