@@ -213,9 +213,12 @@ simpleCase tc cover reflect phase fc argtys cs
213213 ([], numargs, [])
214214 t = CaseDef ns (prune proj (depatt ns' tree)) (fstT st) in
215215 if proj then return (stripLambdas t)
216− else if checkSameTypes (lstT st) tree
217− then return t
218− else Error (At fc (Msg "Typecase is not allowed"))
216+ else return t
217+-- FIXME: This check is not quite right in some cases, and is breaking
218+-- perfectly valid code!
219+-- if checkSameTypes (lstT st) tree
220+-- then return t
221+-- else Error (At fc (Msg "Typecase is not allowed"))
219222 Error err -> Error (At fc err)
220223 where args = map (\i -> sMN i "e") [0..]
221224 defaultCase True = STerm Erased