x.go:11: illegal types for operand: AS
*I
*T
(*interface vs *struct)
R=r
DELTA=10 (8 added, 0 deleted, 2 changed)
OCL=21457
CL=21602
TFUNC,
TARRAY,
T_old_DARRAY,
- TSTRUCT,
+ TSTRUCT, // 23
TCHAN,
TMAP,
- TINTER,
+ TINTER, // 26
TFORW,
TFIELD,
TANY,
print(" %lT\n", tl);
if(tr != T)
print(" %lT\n", tr);
+
+ // common mistake: *struct and *interface.
+ if(tl && tr && isptr[tl->etype] && isptr[tr->etype]) {
+ if(tl->type->etype == TSTRUCT && tr->type->etype == TINTER)
+ print(" (*struct vs *interface)\n");
+ else if(tl->type->etype == TINTER && tr->type->etype == TSTRUCT)
+ print(" (*interface vs *struct)\n");
+ }
}
/*