Description
Proposal Details
Example:
var a *st //struct
if a==nil //true,yes
var b = any(a) //
a0,yes := b.(*st)
if yes==true //true,yes
if a0==nil//true,yes
if b==nil//(false, yes or no?) The problem arises here when someone argues that this judgement should not hold, based on the type assertion (a0,yes := b.(*st)).
But I think this is wrong, the if b==nil judgement should be based on a value judgement (true,yes), not on a type judgement (false,no). If you make a type judgement
(a0,yes := b.(*st)) is sufficient, the only thing missing is the value judgement of the interface type (essentially the compiler is judging two interfaces of the same type by the value judgement, which is a bit confusing).
Interface type occupies two pointers {typeinfo_ptr, value_ptr}, we should take the judgement (value_ptr) judgement (nil), such as integers (0==0, 1!=0), pointers can also be understood as a kind of value. The following connection example causes problems exactly what I said!