comparison src/elaborate.sml @ 1991:7db8356caef5

Tweaked parameter renaming for functors, so now demos and the original bug-triggering application work
author Adam Chlipala <adam@chlipala.net>
date Thu, 20 Feb 2014 15:50:33 -0500
parents 210fb3dfc483
children 799be3911ce3
comparison
equal deleted inserted replaced
1990:7bd2ecf96bb0 1991:7db8356caef5
4453 val (ran', gs) = elabSgn (env', denv') ran 4453 val (ran', gs) = elabSgn (env', denv') ran
4454 in 4454 in
4455 subSgn env' loc actual ran'; 4455 subSgn env' loc actual ran';
4456 (ran', gs) 4456 (ran', gs)
4457 end 4457 end
4458
4459 (* Later compiler phases are simplified by alpha-varying
4460 * the functor formal argument here, if the same name
4461 * will be defined independently in the functor body. *)
4462 fun ensureUnused m =
4463 case E.projectStr env' {sgn = actual, str = (L'.StrVar 0, loc), field = m} of
4464 NONE => m
4465 | SOME _ => ensureUnused ("?" ^ m)
4466
4467 val m = ensureUnused m
4468 in 4458 in
4469 ((L'.StrFun (m, n, dom', formal, str'), loc), 4459 ((L'.StrFun (m, n, dom', formal, str'), loc),
4470 (L'.SgnFun (m, n, dom', formal), loc), 4460 (L'.SgnFun (m, n, dom', formal), loc),
4471 enD gs1 @ gs2 @ enD gs3) 4461 enD gs1 @ gs2 @ enD gs3)
4472 end 4462 end