Closed GoogleCodeExporter closed 9 years ago
I have this reproduced.
---------------------
import "LangPrelude.prg"
import "somefile.prg"
three = check 42
---------------------
You will see that rules appear three times. While working on issue 67 I have
observed this. My interpretation is
that for the current file and all imports the predefined definitions get
applied. Or at least their rules. It should
only be applied for the current file.
Raising prio, because (in issue 67's context) this can lead to ambiguities:
Axiom (DiffLabel): ['a != 'b] => DiffLabel 'a 'b --> []
Axiom (DiffLabel): ['a != 'b] => DiffLabel 'a 'b --> []
Original comment by ggr...@gmail.com
on 3 Nov 2009 at 6:41
Something like this fixes the symptoms. Not sure that this is the real solution:
ggreif$ svn diff Toplevel.hs
Index: Toplevel.hs
===================================================================
--- Toplevel.hs (Revision 277)
+++ Toplevel.hs (Arbeitskopie)
@@ -21,7 +21,7 @@
,var_env,type_env,rules,runtime_env,syntaxExt)
import RankN(pprint,Z,failD,disp0,dispRef)
import System(getArgs)
-import Data.Map(Map,toList)
+import Data.Map(Map,toList,empty)
import Directory
import Char(isAlpha,isDigit)
import System.IO(hClose)
@@ -221,7 +221,7 @@
importFile (Import name vs) tenv =
case lookup name (imports tenv) of
Just previous -> return tenv
- Nothing -> do { new <- elabFile name initTcEnv
+ Nothing -> do { new <- elabFile name (initTcEnv{rules = empty})
; unknownExt vs (syntaxExt new)
; return(importNames name vs new tenv) }
Original comment by ggr...@gmail.com
on 3 Nov 2009 at 9:24
Suggested fix checked in as r328.
Original comment by ggr...@gmail.com
on 10 Mar 2010 at 9:02
Original comment by ggr...@gmail.com
on 10 Mar 2010 at 9:03
Original issue reported on code.google.com by
ggr...@gmail.com
on 22 Dec 2007 at 6:31