for (GoType leftType : leftTypes) {
for (GoType rightType : rightTypes) {
if (leftType == null || rightType == null) {
return;
}
GoType leftUnder = leftType.underlyingType();
GoType rightUnder = rightType.underlyingType();
boolean hasInterface = leftUnder instanceof GoTypeInterface || rightUnder instanceof GoTypeInterface;
if (!equality) {
if (leftType instanceof GoTypePointer || rightType instanceof GoTypePointer){
result.addProblem(expression, "operator "+operator+" not defined on pointer");
return;
}
if (hasInterface) {
result.addProblem(expression, "operator "+operator+" not defined on interface");
return;
}
if (shift){
if (rightUnder == null) {
return;
}
String rightUnderStr = rightUnder.toString();
if (rightUnderStr.startsWith("uint")||rightUnderStr.equals("byte")){
return;
}else{
result.addProblem(expression, "shift count type " + rightUnder+", must be unsigned integer");
return;