Changeset 14203 for src/Pugs/Eval

Show
Ignore:
Timestamp:
10/11/06 05:35:58 (2 years ago)
Author:
audreyt
Message:

* Pugs.Eval.Var: The type inferencer in inferExpType wasn't

able to look through (...)!

1+5 # inferred as Int
(1+5) # inferred as Any

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Eval/Var.hs

    r14176 r14203  
    310310    doFindSub slurpLens subSyms = do 
    311311        subs' <- subs slurpLens subSyms 
    312         -- let foo (x, sub) = show x ++ show (map paramContext $ subParams sub) 
    313         -- trace (unlines $ map foo $ sort subs') return () 
     312        -- traceM (unlines $ map (\(x, y) -> show (x, subParams y)) subs') 
    314313        return $ case sort subs' of 
    315314            ((_, sub):_)    -> Just sub 
     
    495494inferExpType (App (Var name) invs args) = do 
    496495    sub <- findSub name invs args 
    497     case sub of 
    498         Right sub    -> return $ subReturns sub 
    499         Left _       -> return $ mkType "Any" 
     496    return (either (const anyType) subReturns sub) 
    500497inferExpType (Ann (Cxt cxt) _) | typeOfCxt cxt /= (mkType "Any") = return $ typeOfCxt cxt 
    501 inferExpType (Ann (Cxt _) exp) = inferExpType exp 
    502 inferExpType (Ann (Pos _) exp) = inferExpType exp 
     498inferExpType (Ann _ exp) = inferExpType exp 
    503499inferExpType (Pad _ _ exp) = inferExpType exp 
    504500inferExpType (Sym _ _ exp) = inferExpType exp