type T struct {
p *T
}
var x = T{p: &x}
This code does not compile:
tmp1.go:7: typechecking loop involving x = T literal
I don't see any obvious reason why this wouldn't be typecheckable.
This comes up when trying to compile descriptors for recursive .proto messages.
message Recursive {
optional Recursive x = 1;
}
The current proto compiler accepts such a message. I'm doing some experiments to optimize the proto-generated code. Part of that is having a descriptor for a Recursive message being able to point to itself (to describe its x field).
@griesemer @mdempsky @dsnet
This code does not compile:
I don't see any obvious reason why this wouldn't be typecheckable.
This comes up when trying to compile descriptors for recursive .proto messages.
The current proto compiler accepts such a message. I'm doing some experiments to optimize the proto-generated code. Part of that is having a descriptor for a
Recursivemessage being able to point to itself (to describe itsxfield).@griesemer @mdempsky @dsnet