ref: fdd488c60450d605e22992104983224a00089877
parent: 9e6df79b9758504cb7c1d965bce61d8ae9cf7c62
author: Ori Bernstein <[email protected]>
date: Mon Jun 4 17:36:21 EDT 2012
Unify the right types. We want a[i] to be the type of the array's base type, not of the array.
--- a/parse/infer.c
+++ b/parse/infer.c
@@ -295,12 +295,12 @@
case Oidx: /* @a[@b::tcint] -> @a */
t = mktyidxhack(n->line, type(args[1]));
t = unify(n, type(args[0]), t);
- settype(n, 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, t);
+ settype(n, mktyslice(n->line, type(args[1])));
break;
/* special cases */