mirror of
https://github.com/GaloisInc/cryptol.git
synced 2025-01-05 15:07:12 +03:00
When applying a defaulting substitution, keep going even if value found.
Since our substitutions are idempotent, normally this would be just wasted work, but when we are defaulting, we must make sure that we default the varibales in the looked up thing also. This fixes #534
This commit is contained in:
parent
863c165c66
commit
f398a68fad
@ -155,7 +155,7 @@ apSubstMaybe su ty =
|
|||||||
applySubstToVar :: Subst -> TVar -> Maybe Type
|
applySubstToVar :: Subst -> TVar -> Maybe Type
|
||||||
applySubstToVar su x =
|
applySubstToVar su x =
|
||||||
case Map.lookup x (suMap su) of
|
case Map.lookup x (suMap su) of
|
||||||
Just t -> Just t
|
Just t -> Just (if suDefaulting su then apSubst su t else t)
|
||||||
Nothing
|
Nothing
|
||||||
| suDefaulting su -> Just $! defaultFreeVar x
|
| suDefaulting su -> Just $! defaultFreeVar x
|
||||||
| otherwise -> Nothing
|
| otherwise -> Nothing
|
||||||
|
Loading…
Reference in New Issue
Block a user