shithub: mc

Download patch

ref: 0642dae7fd76080cae32ea7055f645579d5f9bc2
parent: 6df1963a5bd8aeda90153ace9b29cccdcab348f9
author: Ori Bernstein <[email protected]>
date: Tue Jan 3 15:31:22 EST 2012

Make it clear that typarams are unencodable.

    They are an internal type inference detail, and the concept of
    their equality, etc does not work across serialization or
    deserialization.

--- a/parse/type.c
+++ b/parse/type.c
@@ -430,7 +430,12 @@
             encbuf(t->sub[i], p, end - p);
     } else if (enctab[t->type].special == -1) {
         switch (t->type) {
-            case Tyname:        p += namefmt(p, end - p, t->name); break;
+            case Tyname:  p += namefmt(p, end - p, t->name); break;
+            case Tyvar:   die("Tyvar is not encodable");  break;
+            case Typaram: p += snprintf(p, end - p, "%s;", t->pname); break;
+            case Tystruct:
+            case Tyunion:
+            case Tyenum:
             default:
                 die("type %s should not be special", tystr(t));
         }