Change genSym behaviour

Instead of merely generating a locally unique name, use the existing
code for generating a new unique variable name in the unifier, which is
therefore globally unique.
This commit is contained in:
Edwin Brady 2020-06-02 12:13:38 +01:00
parent e7f8e2df8c
commit c3ee2a3fac
2 changed files with 3 additions and 3 deletions

View File

@ -84,8 +84,8 @@ elabScript fc nest env (NDCon nfc nm t ar args) exp
scriptRet (Just !(unelabNoSugar env ty))
elabCon defs "GenSym" [str]
= do str' <- evalClosure defs str
n <- uniqueName defs [] !(reify defs str')
scriptRet (UN n)
n <- genVarName !(reify defs str')
scriptRet n
elabCon defs "InCurrentNS" [n]
= do n' <- evalClosure defs n
nsn <- inCurrentNS !(reify defs n')

View File

@ -12,4 +12,4 @@ Error during reflection: Still not trying
refprims.idr:43:10--45:1:While processing right hand side of dummy3 at refprims.idr:43:1--45:1:
Error during reflection: Undefined name
refprims.idr:46:10--48:1:While processing right hand side of dummy4 at refprims.idr:46:1--48:1:
Error during reflection: failed after generating Main.plus_1
Error during reflection: failed after generating Main.{plus:5817}