mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-08-19 10:46:22 -06:00
avoid unnecessary variants
This commit is contained in:
@@ -501,7 +501,7 @@ resolveOverloads scope c t0 q args mb_ty = do
|
||||
arg_tys <- mapCM (checkArg g) c1 args
|
||||
let v_ttys = mapC (\c (t,ty) -> (t,eval g [] c ty [])) c2 ttys
|
||||
try (\(fun,fun_ty) -> reapply2 scope c3 fun fun_ty arg_tys mb_ty)
|
||||
(\ttys -> fmap (\(ts,ty) -> (FV ts,ty)) (snd (minimum g ttys)))
|
||||
(\ttys -> fmap (\(ts,ty) -> (mkFV ts,ty)) (snd (minimum g ttys)))
|
||||
v_ttys
|
||||
where
|
||||
checkArg g c (ImplArg arg) = do
|
||||
@@ -515,6 +515,9 @@ resolveOverloads scope c t0 q args mb_ty = do
|
||||
let v = eval g (scopeEnv scope) c2 arg []
|
||||
return (arg,v,arg_ty)
|
||||
|
||||
mkFV [t] = t
|
||||
mkFV ts = FV ts
|
||||
|
||||
minimum g [] = (maxBound,err)
|
||||
where
|
||||
err = evalError (pp "Overload resolution failed")
|
||||
|
||||
Reference in New Issue
Block a user