Open jwaldmann opened 10 years ago
The ADT of the syntax tree in TH does not contain any source locations that I am aware of.
Algorithms.Eitherize.matchFromConstructor: no match for constructor 'LinearInterpretation'
is a CO4 error. It complains about an incomplete pattern match.
but "LinearInterpretation" is from my source file
Yes, I assume there is a ADT
data TerminationOrder = FilterAndPrec ... | LinearInterpretation ...
and a pattern match
case (e :: TerminationOrder) of FilterAndPrec {} -> foo
without a branch for the LinearInterpretation
constructor
The input comes from haskell-src-exts (not TH), the doc says
All nodes in the syntax tree are annotated with something of a user-definable data type.
When parsing, this annotation will contain information about the source location
that the particular node comes from.
so perhaps something could be made to work. but it's not urgent
still keeping the issue open as a reminder.
CO4 uses haskell-src-meta
to map the syntax tree to TH. I assume that erases all location information. I will investigate...
if I have an incomplete pattern match (missing a case), I get
while
cabal build
but it does not show the location of the case. Is srcloc info available in TH at all?