Frege/frege

Using re-exported values triggers "unused" hints on -make builds

Closed this issue · 0 comments

When compiling with -hints -make, it emits false-positive "unused" warnings on re-exported values even if they are used.

A minimal example:

-- A.fr
module A where

funcA :: Int
funcA = 1
-- AB.fr
module AB where

import A public

funcAB :: Int
funcAB = 2
-- Main.fr
module Main where

import AB (funcA, funcAB)

main = println funcA
-- use of funcAB supresses the warning
-- main = println funcAB
$ fregec -hints -make Main
calling: javac -cp /home/yohashi/lib/java/fregec.jar:. -d . -sourcepath . -encoding UTF-8 ./A.java
calling: javac -cp /home/yohashi/lib/java/fregec.jar:. -d . -sourcepath . -encoding UTF-8 ./AB.java
H ./Main.fr:3: unused import of AB as AB
calling: javac -cp /home/yohashi/lib/java/fregec.jar:. -d . -sourcepath . -encoding UTF-8 ./Main.java

Note that this warning doesn't occur when compiling incrementally:

$ touch Main.fr
$ fregec -hints -make Main
calling: javac -cp /home/yohashi/lib/java/fregec.jar:. -d . -sourcepath . -encoding UTF-8 ./Main.java

$ touch AB.fr
$ fregec -hints -make Main
calling: javac -cp /home/yohashi/lib/java/fregec.jar:. -d . -sourcepath . -encoding UTF-8 ./AB.java
H ./Main.fr:3: unused import of AB as AB
calling: javac -cp /home/yohashi/lib/java/fregec.jar:. -d . -sourcepath . -encoding UTF-8 ./Main.java