undercover-el / undercover.el

A test coverage library for Emacs
MIT License
86 stars 14 forks source link

Ignore compiler warning ‘:send-report’ called as a function #32

Closed DamienCassou closed 7 years ago

DamienCassou commented 7 years ago
$ echo "(when (require 'undercover nil t) (undercover \"xx.el\" (:send-report nil)))" > foo.el

$ emacs --batch -Q -f batch-byte-compile foo.el
In toplevel form:
foo.el:2:4:Warning: ‘:send-report’ called as a function

undercover being a macro, :send-report does not have to be a function.

DamienCassou commented 7 years ago

I asked this question on stackoverflow too https://emacs.stackexchange.com/questions/33286/ignore-compiler-warning-send-report-called-as-a-function

sviridov commented 7 years ago

Hi! Unfortunately I'm on vacation right now. I will be able to look into this issue after next week. Thanks for the report!

sviridov commented 7 years ago

Just to share some information. I made a test project to test this warning in proper conditions:

Cask file:

(source melpa)
(source gnu)

(package-file "test.el")

(development
 (depends-on "undercover"))

test.el:

;;; test.el --- Description

;; Version: 0.0.0

(when (require 'undercover nil t)
  (undercover "xx.el" (:send-report nil)))

(provide 'test.el)

;;; test.el ends here

I got slightly different issues:

In toplevel form:
test.el:8:4:Warning: ‘:send-report’ called as a function

In end of data:
test.el:13:1:Warning: the following functions are not known to be defined:
    undercover, :send-report

But when I replace test.el content:

;;; test.el --- Description

;; Version: 0.0.0

(require 'undercover nil t)
(undercover "xx.el" (:send-report nil))

(provide 'test.el)

;;; test.el ends here

I see no warnings...

It looks like it something related to conditional statements. I'm not aware about any way to fix this issue. And I found this intresting comment on stack exchange.

So until you know a way of fixing it, I think we should ignore this issue...

DamienCassou commented 7 years ago

Good enough. Thanks