Skip to content
Snippets Groups Projects
Commit 02372be1 authored by Matthew Pickering's avatar Matthew Pickering Committed by Marge Bot
Browse files

Allow keywords which can be used as variables to be used with OverloadedDotSyntax

There are quite a few keywords which are allowed to be used as
variables. Such as "as", "dependency" etc. These weren't accepted by
OverloadedDotSyntax.

The fix is pretty simple, use the varid production rather than raw
VARID.

Fixes #20723
parent 7e18b304
No related branches found
No related tags found
No related merge requests found
......@@ -3720,7 +3720,7 @@ qvar :: { LocatedN RdrName }
-- *after* we see the close paren.
field :: { Located FastString }
: VARID { sL1 $1 $! getVARID $1 }
: varid { reLocN $ fmap (occNameFS . rdrNameOcc) $1 }
qvarid :: { LocatedN RdrName }
: varid { $1 }
......
{-# LANGUAGE OverloadedRecordDot #-}
module T20723 where
data Rec = Rec { as :: Int, dependency :: Int, signature :: Int, javascript :: Int }
res r = r.as + r.dependency + r.signature + r.javascript
......@@ -9,4 +9,5 @@ test('NFSImport', [extra_files(['NFSExport.hs'])], multimod_compile, ['NFSImport
test('T18999_NoFieldSelectors', normal, compile, [''])
test('T18999_FieldSelectors', normal, compile, [''])
test('T19154', normal, compile, [''])
test('T20723', normal, compile, [''])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment