1
1
mirror of https://github.com/github/semantic.git synced 2025-01-01 11:46:14 +03:00

Add type annotation for mkChannelType

This commit is contained in:
Rick Winfrey 2017-11-29 16:25:57 -08:00
parent ed012fe18d
commit d0a521779e

View File

@ -272,6 +272,7 @@ arrayType = makeTerm <$> symbol ArrayType <*> children (Type.Array . Just <$> ex
channelType :: Assignment
channelType = makeTerm' <$> symbol ChannelType <*> children (mkChannelType <$> optional (token AnonLAngleMinus) <* token AnonChan <*> optional (token AnonLAngleMinus) <*> expression)
where
mkChannelType :: Maybe a -> Maybe a -> b -> Union Syntax b
mkChannelType receive send | Just _ <- receive = inj . Go.Type.ReceiveChannel
| Just _ <- send = inj . Go.Type.SendChannel
| otherwise = inj . Go.Type.BidirectionalChannel