Panic on wrong imports with TypeData
Given
{-# LANGUAGE TypeData #-}
module TD where
type data A = X | Y | Z
This is accepted:
module TD2 where
import TD (Y(X))
It shouldn't be: X
is not a constructor of Y
. Adding one more
module TD2 where
import TD (Y(X), Z(X))
causes a panic:
<no location info>: error:
panic! (the 'impossible' happened)
GHC version 9.7.20230218:
hasParent
parent:Y parent:Z