Skip to content

Commit a335798

Browse files
committed
Test for #258: provoke clash with GHC.Exts.Symbol
1 parent c14f8b5 commit a335798

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

tests/issue_71.x

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,19 @@
77
-- DFA minimization crashed with "Prelude head: empty list" because
88
-- empty set of non-accepting states was treated as empty equivalence
99
-- class of states.
10+
--
11+
-- Issue #258, 2024-02-27, Andreas Abel:
12+
-- Since GHC 9.4, type 'Symbol' conflicts with 'GHC.Exts.Symbol'
13+
-- which was imported by alex <= 3.5.0.0
14+
-- because of an unqualified import of 'GHC.Exts'.
1015

1116
module Main (main) where
1217

1318
import System.Exit
1419
}
1520

1621
%wrapper "posn"
17-
%token "Token"
22+
%token "Symbol"
1823

1924
$whitespace = [\ \n\t]
2025
@whitespaces = $whitespace*
@@ -25,7 +30,10 @@ $whitespace = [\ \n\t]
2530
"a" { \ _ _ -> A }
2631

2732
{
28-
data Token = Whitespaces | A
33+
-- Calling the token type 'Symbol' will trigger a clash with GHC.Exts.Symbol
34+
-- if the lexer is built with alex <= 3.5.0.0.
35+
36+
data Symbol = Whitespaces | A
2937
deriving (Eq, Show)
3038

3139
input = "aa \n\taa \t \n a"

0 commit comments

Comments
 (0)