def _set(self, t, val):
        # v is a Variable with one vref that this _set should consume
        # (can't actually check it because it might have added other refs
        # ex by adding it to the symbol table)

        if isinstance(t, _ast.Name):
            self._set(t.id, val)
        elif isinstance(t, _ast.Subscript):
            v = self._get(t.value)
            s = self._get(t.slice)
            f = v.getattr(self.em, "__setitem__", clsonly=True)
            f.call(self.em, [s, val])
        elif isinstance(t, _ast.Attribute):
            v = self._get(t.value)
            v.setattr(self.em, t.attr, val)
        elif isinstance(t, str):
            self._set_name(t, val)
        elif isinstance(t, (_ast.Tuple, _ast.List)):
            if isinstance(val.t, UnboxedTupleMT):
                assert len(t.elts) == len(val.v)
                for i in xrange(len(val.v)):
                    e = val.v[i]
                    e.incvref(self.em)
                    self._set(t.elts[i], e)
                val.decvref(self.em)
            elif isinstance(val.t, (TupleMT, ListMT)):
                if isinstance(val.t, TupleMT):
                    assert len(t.elts) == len(val.t.elt_types)
                else:
                    val.incvref(self.em)
                    r = val.getattr(self.em, "__len__", clsonly=True).call(self.em, [])
                    self.em.pl("call void @check_unpacking_length(i64 %d, i64 %s)" % (len(t.elts), r.v))

                for i in xrange(len(t.elts)):
                    val.incvref(self.em)
                    r = val.getattr(self.em, "__getitem__", clsonly=True).call(self.em, [Variable(Int, i, 1, True)])
                    self._set(t.elts[i], r)
                val.decvref(self.em)
            else:
                raise Exception(val.t)
        else:
            raise Exception(t)