Skip to content

Commit

Permalink
Test for #258: provoke clash with GHC.Exts.Symbol
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasabel committed Feb 27, 2024
1 parent 78177e1 commit e880446
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tests/issue_71.x
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,19 @@
-- DFA minimization crashed with "Prelude head: empty list" because
-- empty set of non-accepting states was treated as empty equivalence
-- class of states.
--
-- Issue #258, 2024-02-27, Andreas Abel:
-- Since GHC 9.4, type 'Symbol' conflicts with 'GHC.Exts.Symbol'
-- which was imported by alex <= 3.5.0.0
-- because of an unqualified import of 'GHC.Exts'.

module Main (main) where

import System.Exit
}

%wrapper "posn"
%token "Token"
%token "Symbol"

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

{
data Token = Whitespaces | A
-- Calling the token type 'Symbol' will trigger a clash with GHC.Exts.Symbol
-- if the lexer is built with alex <= 3.5.0.0.

data Symbol = Whitespaces | A
deriving (Eq, Show)

input = "aa \n\taa \t \n a"
Expand Down

0 comments on commit e880446

Please sign in to comment.