From 70dbe3ed561172a80ebff0515e727434b03040bf Mon Sep 17 00:00:00 2001 From: Li Haoyi Date: Wed, 9 Oct 2019 10:54:16 +0800 Subject: Convert `Decorator#OuterReturned` into a type parameter --- cask/src/cask/router/RoutesEndpointMetadata.scala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'cask/src/cask/router/RoutesEndpointMetadata.scala') diff --git a/cask/src/cask/router/RoutesEndpointMetadata.scala b/cask/src/cask/router/RoutesEndpointMetadata.scala index 7940641..2445c9d 100644 --- a/cask/src/cask/router/RoutesEndpointMetadata.scala +++ b/cask/src/cask/router/RoutesEndpointMetadata.scala @@ -5,7 +5,7 @@ import cask.router.EntryPoint import language.experimental.macros import scala.reflect.macros.blackbox case class EndpointMetadata[T](decorators: Seq[RawDecorator], - endpoint: Endpoint[_, _], + endpoint: Endpoint[_, _, _], entryPoint: EntryPoint[T, _]) case class RoutesEndpointsMetadata[T](value: EndpointMetadata[T]*) object RoutesEndpointsMetadata{ @@ -16,15 +16,15 @@ object RoutesEndpointsMetadata{ val routeParts = for{ m <- c.weakTypeOf[T].members - annotations = m.annotations.filter(_.tree.tpe <:< c.weakTypeOf[Decorator[_, _]]) + annotations = m.annotations.filter(_.tree.tpe <:< c.weakTypeOf[Decorator[_, _, _]]) if annotations.nonEmpty } yield { - if(!(annotations.last.tree.tpe <:< weakTypeOf[Endpoint[_, _]])) c.abort( + if(!(annotations.last.tree.tpe <:< weakTypeOf[Endpoint[_, _, _]])) c.abort( annotations.head.tree.pos, s"Last annotation applied to a function must be an instance of Endpoint, " + s"not ${annotations.last.tree.tpe}" ) - val allEndpoints = annotations.filter(_.tree.tpe <:< weakTypeOf[Endpoint[_, _]]) + val allEndpoints = annotations.filter(_.tree.tpe <:< weakTypeOf[Endpoint[_, _, _]]) if(allEndpoints.length > 1) c.abort( annotations.last.tree.pos, s"You can only apply one Endpoint annotation to a function, not " + -- cgit v1.2.3