Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Special-case translation of casts of 'irrefPatError'
Function like: > fun :: Maybe Int -> Int > f ~(Just x) = x Get a GHC core like: > f = \(ds :: Maybe Int) -> case ds of > _ -> patError () "error" `cast` (() #~ Int) > Just x -> x But since CLaSH Core has no cast, it looks after conversion like: > f = \(ds :: Maybe Int) -> case ds of > _ -> patError () "error" > Just x -> x Meaning that the default case now has type '()' instead of 'Int'. I've added the special-case translation for just this particular 'cast'. So that GHC's Core gets translated to: > f = \(ds :: Maybe Int) -> case ds of > _ -> patError Int "error" > Just x -> x Fixes #6
- Loading branch information