Skip to content

Commit

Permalink
Keep using implicit while cross compiling with scala 2 (#877)
Browse files Browse the repository at this point in the history
  • Loading branch information
RustedBones authored Jan 3, 2024
1 parent c7619c9 commit 7450fad
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ object AnnotationTypeMacros:
'{ AnnotationType[T]($annotations) }

trait AnnotationTypeCompanionMacros:
inline given gen[T]: AnnotationType[T] = ${ AnnotationTypeMacros.annotationTypeMacro[T] }
inline implicit def gen[T]: AnnotationType[T] = ${ AnnotationTypeMacros.annotationTypeMacro[T] }
4 changes: 2 additions & 2 deletions shared/src/main/scala-3/magnolify/shared/EnumTypeMacros.scala
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ object EnumTypeMacros:
trait EnumTypeCompanionMacros extends EnumTypeCompanionMacros0

trait EnumTypeCompanionMacros0 extends EnumTypeCompanionMacros1:
inline given scalaEnumType[T <: Enumeration#Value](using
inline implicit def scalaEnumType[T <: Enumeration#Value](using
annotations: AnnotationType[T]
): EnumType[T] =
${ EnumTypeMacros.scalaEnumTypeMacro[T]('annotations) }

trait EnumTypeCompanionMacros1 extends EnumTypeDerivation:
inline given gen[T](using Mirror.Of[T]): EnumType[T] = derivedMirror[T]
inline implicit def gen[T](using Mirror.Of[T]): EnumType[T] = derivedMirror[T]
2 changes: 1 addition & 1 deletion test/src/test/scala/magnolify/shared/EnumTypeSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class EnumTypeSuite extends MagnolifySuite {
| ]
| )
|
|But given instance gen in trait EnumTypeCompanionMacros1 does not match type magnolify.shared.EnumType[Option[magnolify.test.ADT.Color]]
|But method gen in trait EnumTypeCompanionMacros1 does not match type magnolify.shared.EnumType[Option[magnolify.test.ADT.Color]]
|
|where: MirroredMonoType is a type in an anonymous class locally defined in class EnumTypeSuite which is an alias of Option[magnolify.test.ADT.Color]
| MirroredMonoType² is a type in trait Mirror with bounds""".stripMargin + " \n" + """|.
Expand Down

0 comments on commit 7450fad

Please sign in to comment.