@@ -195,6 +195,7 @@ goopnames[] =
195
195
[OCONTINUE ] = "continue" ,
196
196
[OCOPY ] = "copy" ,
197
197
[ODEC ] = "--" ,
198
+ [ODELETE ] = "delete" ,
198
199
[ODEFER ] = "defer" ,
199
200
[ODIV ] = "/" ,
200
201
[OEQ ] = "==" ,
@@ -639,9 +640,15 @@ typefmt(Fmt *fp, Type *t)
639
640
return fmtprint (fp , "map[%T]%T" , t -> down , t -> type );
640
641
641
642
case TINTER :
643
+ t = t -> orig ;
642
644
fmtstrcpy (fp , "interface {" );
643
645
for (t1 = t -> type ; t1 != T ; t1 = t1 -> down )
644
- if (exportname (t1 -> sym -> name )) {
646
+ if (!t1 -> sym ) {
647
+ if (t1 -> down )
648
+ fmtprint (fp , " %T;" , t1 -> type );
649
+ else
650
+ fmtprint (fp , " %T " , t1 -> type );
651
+ } else if (exportname (t1 -> sym -> name )) {
645
652
if (t1 -> down )
646
653
fmtprint (fp , " %hS%hT;" , t1 -> sym , t1 -> type );
647
654
else
@@ -946,6 +953,7 @@ static int opprec[] = {
946
953
[OCONVNOP ] = 8 ,
947
954
[OCONV ] = 8 ,
948
955
[OCOPY ] = 8 ,
956
+ [ODELETE ] = 8 ,
949
957
[OLEN ] = 8 ,
950
958
[OLITERAL ] = 8 ,
951
959
[OMAKESLICE ] = 8 ,
@@ -1010,6 +1018,7 @@ static int opprec[] = {
1010
1018
[OGT ] = 4 ,
1011
1019
[ONE ] = 4 ,
1012
1020
[OCMPSTR ] = 4 ,
1021
+ [OCMPIFACE ] = 4 ,
1013
1022
1014
1023
[OSEND ] = 3 ,
1015
1024
[OANDAND ] = 2 ,
@@ -1218,6 +1227,7 @@ exprfmt(Fmt *f, Node *n, int prec)
1218
1227
case OAPPEND :
1219
1228
case OCAP :
1220
1229
case OCLOSE :
1230
+ case ODELETE :
1221
1231
case OLEN :
1222
1232
case OMAKE :
1223
1233
case ONEW :
@@ -1288,6 +1298,7 @@ exprfmt(Fmt *f, Node *n, int prec)
1288
1298
return 0 ;
1289
1299
1290
1300
case OCMPSTR :
1301
+ case OCMPIFACE :
1291
1302
exprfmt (f , n -> left , nprec );
1292
1303
fmtprint (f , " %#O " , n -> etype );
1293
1304
exprfmt (f , n -> right , nprec + 1 );
@@ -1303,8 +1314,10 @@ nodefmt(Fmt *f, Node *n)
1303
1314
Type * t ;
1304
1315
1305
1316
t = n -> type ;
1306
- if (n -> orig == N )
1317
+ if (n -> orig == N ) {
1318
+ n -> orig = n ;
1307
1319
fatal ("node with no orig %N" , n );
1320
+ }
1308
1321
1309
1322
// we almost always want the original, except in export mode for literals
1310
1323
// this saves the importer some work, and avoids us having to redo some
@@ -1359,6 +1372,7 @@ nodedump(Fmt *fp, Node *n)
1359
1372
indent (fp );
1360
1373
}
1361
1374
}
1375
+ fmtprint (fp , "[%p]" , n );
1362
1376
1363
1377
switch (n -> op ) {
1364
1378
default :
0 commit comments