Handle optional splat.

This commit is contained in:
Dillon Kearns 2022-09-12 13:20:44 -07:00
parent 2115b9be9d
commit 261cd64ed5
2 changed files with 18 additions and 1 deletions

View File

@ -186,7 +186,12 @@ endingToVariantName ending =
)
OptionalSplat ->
( "SPLAT__", Just ( "splat", Elm.Annotation.string ) )
( "SPLAT__"
, Just
( "splat"
, Elm.Annotation.list Elm.Annotation.string
)
)
{-| -}

View File

@ -107,6 +107,18 @@ suite =
]
]
)
, test "optional splat" <|
\() ->
[ "SPLAT__" ]
|> expectRouteDefinition
(Elm.variantWith "SPLAT__"
[ Elm.Annotation.record
[ ( "splat"
, Elm.Annotation.list Elm.Annotation.string
)
]
]
)
]
]