Open TeofilC opened 10 months ago
left to itself, hlint will default enable its own selection of language extensions. apparently one of the extensions it is default enabling causes this problem. we can override this. putting -XHaskell98 overcomes the parse error.
update: i guess it's CPP
that is getting default enabled. -XNoCPP
also overcomes the parse failure.
Excellent yes it does look like CPP
is to blame
what's happening is that when CPP
is enabled, hlint runs a cpp preprocessor. when it does that, after preprocessing the resulting program is
foo = [undefined| foo
which is indeed an unterminated quasiquote. another workaround is to put a leading space before the #
e.g.
{-# LANGUAGE QuasiQuotes #-}
foo = [undefined| foo
#{_hello}|]
Thanks! I'm not sure if this ticket should be closed now.
I guess the missing piece is that if another user runs into this, they'd have to search to find these workarounds. I'm not sure if hlint could direct them towards them somehow
Take the following module:
This features a quasiqoute that runs over several lines. And one of those lines starts with a
#
, which makes it look a bit like CPP but it isn't.HLint gives the following output:
Yet GHC correctly parses this. (Though the use of undefined then gives us an error later)