Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dos65 committed Nov 9, 2020
1 parent fdae92c commit ce0ecb5
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import xerial.sbt.Sonatype._

lazy val commonSettings = Seq(
scalaVersion := "2.13.3",
scalaVersion := "2.12.12",
organization := "io.github.dos65",
version := "0.0.3-SNAPSHOT",
crossScalaVersions := Seq("2.12.12", "2.13.3"),
Expand Down
2 changes: 1 addition & 1 deletion modules/core/src/main/scala/make/Tagged.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package make

object tagged {

case class :@:[A, B](value: A)
case class :@:[+A, B](value: A)

implicit class Syntax[A](val a: A) extends AnyVal {
def tagged[B]: A :@: B = :@:(a)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,9 @@ class MakeAnnotationMacro(val c: blackbox.Context) {
val (tree, tpt) =
v.mods.annotations match {
case anno :: _ =>
val annotationSelect =
anno
.asInstanceOf[Apply].fun
.asInstanceOf[Select].qualifier
.asInstanceOf[New].tpt
.asInstanceOf[Select]
val tpt = tq"_root_.make.tagged.:@:[${v.tpt}, $annotationSelect]"
// TODO doesn't work for 2.13
val annoTpe = c.typecheck(anno).tpe
val tpt = tq"_root_.make.tagged.:@:[${v.tpt}, $annoTpe]"
val tree = Select(Ident(name), TermName("value"))
(tree, tpt)
case Nil =>
Expand Down
2 changes: 1 addition & 1 deletion modules/core/src/test/scala/make/MakeTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class MakeTest extends FunSuite {
}

@autoMake
case class Anno(@anno.Sample a: Int)
class Anno(@anno.Sample a: Int)

test("anno") {
import make.tagged._
Expand Down

0 comments on commit ce0ecb5

Please sign in to comment.