Fix fastTypeOf to handle selectors in the presence of type synonyms

This commit is contained in:
Brian Huffman 2015-04-22 16:19:51 -07:00
parent aeb5ef6e6f
commit 4eb2d6734b

View File

@ -99,6 +99,7 @@ fastSchemaOf tyenv expr =
-- | Yields the return type of the selector on the given argument type.
typeSelect :: Type -> Selector -> Type
typeSelect (TUser _ _ ty) sel = typeSelect ty sel
typeSelect (TCon _tctuple ts) (TupleSel i _) = ts !! i
typeSelect (TRec fields) (RecordSel n _) = fromJust (lookup n fields)
typeSelect (TCon _tcseq [_, a]) (ListSel _ _) = a