summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorVladislav Zavialov <vlad.z.4096@gmail.com>2021-03-12 15:38:38 +0300
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-03-15 00:43:05 -0400
commit92d98424bf7f8bbd55e1b123d0755c9d52f123dd (patch)
tree8e88c00684a2af432e018d4858e01c36392e58ee /testsuite
parent7ea7624c20b02b25b5d6b51ff75aa25313a0371d (diff)
downloadhaskell-92d98424bf7f8bbd55e1b123d0755c9d52f123dd.tar.gz
Fix record dot precedence (#19521)
By moving the handling of TIGHT_INFIX_PROJ to the correct place, we can remove the isGetField hack and fix a bug at the same time.
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/parser/should_compile/T19521.hs12
-rw-r--r--testsuite/tests/parser/should_compile/all.T1
2 files changed, 13 insertions, 0 deletions
diff --git a/testsuite/tests/parser/should_compile/T19521.hs b/testsuite/tests/parser/should_compile/T19521.hs
new file mode 100644
index 0000000000..5ebca17a3e
--- /dev/null
+++ b/testsuite/tests/parser/should_compile/T19521.hs
@@ -0,0 +1,12 @@
+{-# LANGUAGE OverloadedRecordDot #-}
+
+module T19521 where
+
+data Foo =
+ Foo {
+ val :: Int,
+ fun :: Int -> Int
+ }
+
+apply :: Foo -> Int
+apply foo = foo.fun foo.val
diff --git a/testsuite/tests/parser/should_compile/all.T b/testsuite/tests/parser/should_compile/all.T
index 4aa6d17ec0..d2b3a69385 100644
--- a/testsuite/tests/parser/should_compile/all.T
+++ b/testsuite/tests/parser/should_compile/all.T
@@ -174,3 +174,4 @@ test('T18834a', normal, compile, [''])
test('T18834b', normal, compile, [''])
test('T12862', normal, compile, [''])
test('T19082', normal, compile, [''])
+test('T19521', normal, compile, [''])