Error: defined but not used: 'this'
- gaborhOP
I get the following error:
error: defined but not used: ‘this’
With a module very similar to this:
module Main.Excp where import Main.ErrorCode import DA.Exception exception Excp with errorCode: ErrorCode where message "Excp Exception: " <> show errorCodeWhat does this mean?
- cocreature
This comes from a warning that is not turned on by default, specifically
-Wunused-matches(or a slightly different flag that also ends up enabling this one).It’s a false positive here.
thisis in implicitly in scope inmessage(just like for templates) and you’re not using it so you get the warning. I’ll open an issue to fix that. - gaborh
What I have found is:
The following pragma is needed until upstream issue gets resolved:
https://github.com/digital-asset/daml/issues/11004{-# OPTIONS -Wno-unused-matches #-} - cocreature
Oh good catch, I forgot we already had that issue.