> > When you insert a value keyed by S{}, the compiler creates a value of > type I which has S as its dynamic type and S{} as its value. > > The program as speficied panics with >
Apologies if it wasn't clear from my original email, but I understand why this panics; I further acknowledge the behaviour is consistent with the spec. My question is why something that could be caught at compile time is not caught at compile time: >From a spec perspective, is this a case of keeping the implementation and > documentation simple, by treating all cases for interface-keyed maps the > same, i.e. runtime panic? > Or is there some other reason why this case isn't caught by the compiler/go > vet? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.