atom: Constructor symbol varset is not converted to local space
Bug #877111 reported by
Matt Giuca
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mars |
Fix Released
|
Critical
|
Matt Giuca |
Bug Description
In the atom branch, the typedict module needs the type of constructor symbols, but it doesn't port the varset over to local space. That means this program crashes:
def cons(y :: a, xs :: List(a)) :: List(a):
return Cons(y, xs)
def foo(one :: a, two :: b) :: List(b):
return cons(two, Nil)
The call to cons passes a variable two of type b, and a variable Nil of type List(a). The problem is that they are in different namespaces: the List(a) from Nil is supposed to be converted to a List(b) in the local function. Instead, this raises a unification error ("augment_
Related branches
lp:~mgiuca/mars/atom
- Matt Giuca: Approve
-
Diff: 894 lines (+233/-144)10 files modifieddoc/dev/isa.rst (+16/-19)
src/ast_cfg.m (+70/-45)
src/cfg.m (+1/-1)
src/interactive.m (+6/-1)
src/interpret.m (+30/-19)
src/ir.m (+19/-15)
src/pretty.m (+14/-20)
src/typedict.m (+34/-11)
src/usedef.m (+14/-13)
test/cases/compiler/ctorsym-unify.mar (+29/-0)
Changed in mars: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Fixed in atom branch, r1273.