Alphanumeric type is not declared infix
qwbarch opened this issue · 2 comments
qwbarch commented
When using refined with Scala 3, the compiler complains about types not being declared as infix. For example:
val helloWorld: String Refined NonEmpty
This will cause the compiler to complain:
Alphanumeric type Refined is not declared `infix`; it should not be used as infix operator.
The operation can be rewritten automatically to `Refined` under -deprecation -rewrite.
Or rewrite to prefix syntax Refined[...] manually.bloop
fthomas commented
I think I would accept a PR that adds the infix
declaration to https://github.com/fthomas/refined/blob/master/modules/core/shared/src/main/scala-3.0+/eu/timepit/refined/api/Refined.scala. Does the compiler also complain if Refined
is declared infix
but you write Refined[...]
?
qwbarch commented
Nope, the compiler doesn't complain when writing it as Refined[A, B]
.
I'll submit a PR probably tomorrow 👍