diff options
| author | aarne <aarne@cs.chalmers.se> | 2007-07-05 14:08:58 +0000 |
|---|---|---|
| committer | aarne <aarne@cs.chalmers.se> | 2007-07-05 14:08:58 +0000 |
| commit | 63f060dcf62a23c518379c46af40461afacfb27c (patch) | |
| tree | 40e0ce806203b39729965bc23e04a0d3d1e18058 /src | |
| parent | 4d228365aca9b5ed2ea90dd706a866042e776b14 (diff) | |
hacky solution to name resolution warnings
Diffstat (limited to 'src')
| -rw-r--r-- | src/GF/Compile/CheckGrammar.hs | 21 | ||||
| -rw-r--r-- | src/GF/Compile/Rename.hs | 3 |
2 files changed, 15 insertions, 9 deletions
diff --git a/src/GF/Compile/CheckGrammar.hs b/src/GF/Compile/CheckGrammar.hs index e980ec14f..d9dfe996d 100644 --- a/src/GF/Compile/CheckGrammar.hs +++ b/src/GF/Compile/CheckGrammar.hs @@ -45,6 +45,8 @@ import GF.Infra.CheckM import Data.List import Control.Monad +import Debug.Trace --- + showCheckModule :: [SourceModule] -> SourceModule -> Err ([SourceModule],String) showCheckModule mos m = do @@ -380,16 +382,18 @@ inferLType gr trm = case trm of Q m ident | isPredef m -> termWith trm $ checkErr (typPredefined ident) Q m ident -> checks [ ----- do ----- over <- getOverload gr Nothing trm ----- case over of ----- Just trty -> return trty ----- _ -> fail "not overloaded" ----- , termWith trm $ checkErr (lookupResType gr m ident) >>= comp , checkErr (lookupResDef gr m ident) >>= infer , +{- + do + over <- getOverload gr Nothing trm + case over of + Just trty -> return trty + _ -> prtFail "not overloaded" trm + , +-} prtFail "cannot infer type of constant" trm ] @@ -494,8 +498,9 @@ inferLType gr trm = case trm of ---- hack from Rename.identRenameTerm, to live with files with naming conflicts 18/6/2007 Strs (Cn (IC "#conflict") : ts) -> do - checkWarn ("WARNING: unresolved constant, could be any of" +++ unwords (map prt ts)) - infer $ head ts + trace ("WARNING: unresolved constant, could be any of" +++ unwords (map prt ts)) (infer $ head ts) +-- checkWarn ("WARNING: unresolved constant, could be any of" +++ unwords (map prt ts)) +-- infer $ head ts Strs ts -> do ts' <- mapM (\t -> justCheck t typeStr) ts diff --git a/src/GF/Compile/Rename.hs b/src/GF/Compile/Rename.hs index 0a148f02f..bc5925d22 100644 --- a/src/GF/Compile/Rename.hs +++ b/src/GF/Compile/Rename.hs @@ -105,7 +105,8 @@ renameIdentTerm env@(act,imps) t = [tr] -> return tr ts -> return $ Strs $ (cnIC "#conflict") : reverse ts -- a warning will be generated in CheckGrammar, and the head returned - -- in next V: Bad $ "conflicting imports:" +++ unwords (map prt ts) + -- in next V: + -- Bad $ "conflicting imports:" +++ unwords (map prt ts) --- | would it make sense to optimize this by inlining? |
