d_ with mixed-dimension indices should probably not contract with anything, but rather just sit "inert"? For eg,
Index i4;
Symbol n;
Dimension n;
Index in;
Local test1 = d_(i4,in)*d_(in,i4);
Local test2 = d_(in,i4)*d_(i4,in);
Local test3 = d_(in,i4)*d_(in,i4);
Local test4 = d_(i4,in)*d_(i4,in);
Print +s;
.end
yielding
test1 =
+ n
;
test2 =
+ 4
;
test3 =
+ 4
;
test4 =
+ n
;