[type-annos-observers] Comments on the Nov 7 specification
Michael Ernst
mernst at cs.washington.edu
Mon Nov 19 22:33:56 PST 2012
Following up again, Werner Dietl suggested:
struct type_path {
u1 path_length;
type_path_entry path[path_length];
}
struct type_path_entry {
u2 type_path_kind;
}
(Having the extra type_path_entry struct seems redundant now...)
The value of type_path_kind div 1000 determines the kind:
0: annotation is deeper in this array type
1: annotation is deeper in this nested type
2: annotation is on the bound of this wildcard type arg
3: annotation is on the i'th type arg of this parameterized type
The value of type_path_kind modulo 1000 gives the offset within that kind.
Values where modulo 1000 equals 0 are invalid.
This is more compact, but perhaps it feels even too inefficient.
Eric, we haven't heard you chime in. Do you have an opinion on the several
alternatives we have discussed?
-Mike
More information about the type-annotations-spec-observers
mailing list