agda / agda

Agda is a dependently typed programming language / interactive theorem prover.
https://wiki.portal.chalmers.se/agda/pmwiki.php
Other
2.41k stars 339 forks source link

OptionWarnings are emitted twice #7221

Open andreasabel opened 2 months ago

andreasabel commented 2 months ago

OptionWarnings are emitted twice, e.g.: https://github.com/agda/agda/blob/05138510ac152b6fbb6130467502095073ba07cb/test/Succeed/LossyUnification.warn#L1-L6

Suspected reason: We are calling setOptionsFromPragma several times during processing a file. https://github.com/agda/agda/blob/05138510ac152b6fbb6130467502095073ba07cb/src/full/Agda/TypeChecking/Monad/Options.hs#L208-L212

Found while working on:

UlfNorell commented 2 months ago

Not sure how it applies to this issue, but in #6640 I had to jump through some hoops to not get the conflicting options warning multiple times:

andreasabel commented 2 months ago

My question here is whether we should dig out the reason why the warning is raised twice, or whether we reorganise the warning store so that duplicate warnings are just stored once. E.g. the warning store could be a map from positions to sets of warnings. (Currently it is a plain list.)