diff options
author | Li Haoyi <haoyi.sg@gmail.com> | 2019-10-09 10:54:16 +0800 |
---|---|---|
committer | Li Haoyi <haoyi.sg@gmail.com> | 2019-10-09 10:54:16 +0800 |
commit | 70dbe3ed561172a80ebff0515e727434b03040bf (patch) | |
tree | 01b05644facea813452e6c548ea3458c0fc5fdb7 /cask/src/cask/router/RoutesEndpointMetadata.scala | |
parent | 0f0f945abd365c9f6f83b3d315cea30eacb6ed51 (diff) | |
download | cask-70dbe3ed561172a80ebff0515e727434b03040bf.tar.gz cask-70dbe3ed561172a80ebff0515e727434b03040bf.tar.bz2 cask-70dbe3ed561172a80ebff0515e727434b03040bf.zip |
Convert `Decorator#OuterReturned` into a type parameter
Diffstat (limited to 'cask/src/cask/router/RoutesEndpointMetadata.scala')
-rw-r--r-- | cask/src/cask/router/RoutesEndpointMetadata.scala | 8 |
1 files changed, 4 insertions, 4 deletions
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 " + |