Skip to content

Routes spec cannot contain route which matches to url with one-character segments #26

@katsujukou

Description

@katsujukou

When I wrote the spec containing the route which matches to url with one-character segments:

import Prelude
import Effect.Aff (Aff)
import Payload.Server (start_)
import Payload.Spec (Spec(..), GET)

main :: Aff Unit
main = do
  void $ start_ spec { a: \_ -> pure "" }
  where
    spec :: Spec
      { a :: GET "/a"
        { response :: String
        }
      }
    spec = Spec

I got no typeclass instance error:

 No type class instance was found for

    Prim.Symbol.Cons t5
                     t6
                     ""


while solving type class constraint

  Payload.Internal.UrlParsing.Match "/a"
                                    t2
                                    t3
                                    ""
                                    "any"
                                    t4

while applying a function start_
  of type Routable t0 (Record (() @Type)) t1 (Record (() @Type)) => Spec @Type t0 -> t1 -> Aff (Either String Server)
  to argument spec
while inferring the type of start_ spec
in value declaration main

where t0 is an unknown type
      t1 is an unknown type
      t4 is an unknown type
      t2 is an unknown type
      t3 is an unknown type
      t5 is an unknown type
      t6 is an unknown type

I tested this code with TryPureScript.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions