mirror of
https://github.com/GaloisInc/cryptol.git
synced 2024-11-29 01:45:36 +03:00
Fix fastTypeOf
to handle selectors in the presence of type synonyms
This commit is contained in:
parent
aeb5ef6e6f
commit
4eb2d6734b
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user