Skip to content

Commit 451dcd6

Browse files
committed
Fix attribute key macro for scala3
1 parent 7cfb6c4 commit 451dcd6

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

core/src/main/scala-2/sttp/attributes/AttributeKeyMacro.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ private[attributes] object AttributeKeyMacro {
66
def apply[T: c.WeakTypeTag](c: blackbox.Context): c.Expr[AttributeKey[T]] = {
77
import c.universe._
88
c.Expr[AttributeKey[T]](
9-
q"new _root_.sttp.tapir.AttributeKey(${c.universe.show(implicitly[c.WeakTypeTag[T]].tpe)})"
9+
q"new _root_.sttp.attributes.AttributeKey(${c.universe.show(implicitly[c.WeakTypeTag[T]].tpe)})"
1010
)
1111
}
1212
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package sttp.attributes
2+
3+
import org.scalatest.matchers.should.Matchers
4+
import org.scalatest.flatspec.AnyFlatSpec
5+
6+
class AttributeKeyTest extends AnyFlatSpec with Matchers {
7+
it should "create an attribute key" in {
8+
val key = AttributeKey[SomeAttribute]
9+
key.typeName shouldBe "sttp.attributes.SomeAttribute"
10+
}
11+
}
12+
13+
case class SomeAttribute(v: String)

0 commit comments

Comments
 (0)