Ticket #2202 (closed bug: fixed)
type error causes type checker stack overflow
| Reported by: | chiral | Owned by: | chak |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.10.1 |
| Component: | Compiler (Type checker) | Version: | 6.8.2 |
| Keywords: | Cc: | bdonlan@… | |
| Operating System: | Other | Architecture: | Other |
| Type of failure: | Difficulty: | Unknown | |
| Test Case: | Blocked By: | ||
| Blocking: | Related Tickets: |
Description
The following code causes
*** Exception: stack overflow
during type checking. I've tried to whittle the test case down, this may not be minimal. The (Ord a) instances and the unused vertexID member of the datatype seem to be necessary, otherwise the infinite type is correctly caught. Does not occur under 6.6.1
module GHCBug(
MeshVertex(..)
) where
data (Ord a) => MeshVertex a b = MeshVertex {
vertexID :: a,
vertexChildren :: [a]
} deriving (Show)
split :: (Ord a) =>
a ->
[MeshVertex a b] ->
[MeshVertex a b]
split a m = let
av = head m
newVTs = preSplit a m
av' = av { vertexChildren = newVTs }
newMVs = av' : m
newMesh = newMVs
in newMesh
preSplit :: (Ord a) =>
a ->
[MeshVertex a b] ->
[MeshVertex a b]
preSplit a m = preSplit a $ split a m
Change History
Note: See
TracTickets for help on using
tickets.
