public static boolean check(
            BaseType found, 
            PrimitiveType.Type[] required,
            DebugInfo dInfo) {

        boolean result = (found == null || /*!(found instanceof PrimitiveType) ||*/
                !found.is(required));
        if (result) {
            StringBuilder str = new StringBuilder();
            for (int i = 0; i < required.length; ++i) {
                str.append(required[i]);
                str.append(" or ");
            }
            str.delete(str.length() - 4, str.length());
            Logger.logIncompatibleTypes(
                    (found == null) ? "UNKNOWN TYPE" : found.toString(),
                    str.toString(), 
                    dInfo.position);
        }
        
        return !result;
    }