ref: 3423dd0094c98305133e3dc142761de12461ae22
parent: 48f0c839b6ce7bec4537e48271bcbe6def469a0c
author: Ori Bernstein <[email protected]>
date: Tue Jun 5 15:51:07 EDT 2012
Fix whitespace.
--- a/parse/infer.c
+++ b/parse/infer.c
@@ -175,14 +175,12 @@
/* we want to unify Tyidxhack => concrete indexable. Flip
* to make this happen, if needed */
if (b->type == Tyidxhack) {
- a = *pb;
- b = *pa;
+ a = *pb;
+ b = *pa;
}
return a->type == Tyidxhack || a->type == Tyarray || a->type == Tyslice;
}
-
-
static Type *unify(Node *ctx, Type *a, Type *b)
{
Type *t;
@@ -199,8 +197,8 @@
mergecstrs(ctx, a, b);
if (a->type == Tyvar) {
- tytab[a->tid] = b;
- return b;
+ tytab[a->tid] = b;
+ return b;
} else if (a->type == b->type || idxhacked(&a, &b)) {
for (i = 0; i < b->nsub; i++) {
/* types must have same arity */
@@ -305,14 +303,14 @@
settype(n, t);
break;
case Oidx: /* @a[@b::tcint] -> @a */
- t = mktyidxhack(n->line, type(args[1]));
- t = unify(n, type(args[0]), t);
- settype(n, type(args[1]));
+ t = mktyidxhack(n->line, type(args[1]));
+ t = unify(n, type(args[0]), t);
+ settype(n, type(args[1]));
break;
case Oslice: /* @a[@b::tcint,@b::tcint] -> @a[,] */
- t = mktyidxhack(n->line, type(args[1]));
- t = unify(n, type(args[0]), t);
- settype(n, mktyslice(n->line, type(args[1])));
+ t = mktyidxhack(n->line, type(args[1]));
+ t = unify(n, type(args[0]), t);
+ settype(n, mktyslice(n->line, type(args[1])));
break;
/* special cases */