As Dan noted, this is because we haven't yet implemented the correct
garbage collection algorithm for an array type generated at runtime.
For channels, maps, and slices this is easy as the garbage collection
algorithm is always basically the same. For array types we need to
actually do some work. It's feasible but hasn't been done yet.
> I strongly suspect this won't happen for go-1.1 but is having a:
>
> func StructOf(fields []StructField) Type
>
> method in the roadmap ?
>
> that would definitely opens up the possibility to create a
> reflect-based go interpreter (which would be more in-sync' with the
> underlying go implementation than what go-eval is - always lagging and
> all)
I think we will get there eventually but not for Go 1.1. The issue is
that the runtime currently requires that two identical types use the
same pointer for the type descriptor, hence all the typelinks stuff.
We have to ensure that if the program defines a struct, and somebody
calls reflect.StructOf with the same field names and types, that we
wind up with the same pointer. Maybe the typelinks mechanism will
also work for structs; I'm not sure. Plus of course we will need to
implement the correct gc algorithm.
Ian