@@ -230,7 +230,6 @@ solveScheme scheme =
230230 header' <- T.traverse flatten header
231231 actuallySolve constraint
232232
233− allDistinct rigidQuantifiers
234233 youngPool <- TS.getPool
235234 TS.switchToPool oldPool
236235 generalize youngPool
@@ -240,34 +239,6 @@ solveScheme scheme =
240239
241240-- ADDITIONAL CHECKS
242241
243−-- Checks that all of the given variables belong to distinct equivalence classes.
244−-- Also checks that their structure is Nothing, so they represent a variable, not
245−-- a more complex term.
246−allDistinct :: [Variable] -> TS.Solver ()
247−allDistinct vars =
248− do seenMark <- TS.uniqueMark
249− forM_ vars $ \var ->
250− do desc <- liftIO $ UF.descriptor var
251− case _content desc of
252− Structure _ ->
253− crash "Can only generalize type variables, not structures."
254−
255− Atom _ ->
256− crash "Can only generalize type variables, not structures."
257−
258− Alias _ _ _ ->
259− crash "Can only generalize type variables, not aliases."
260−
261− Error ->
262− crash "Can only generalize type variables, not error types."
263−
264− Var _ _ _ ->
265− if _mark desc == seenMark then
266− crash "Duplicate variable during generalization."
267−
268− else
269− liftIO (UF.setDescriptor var (desc { _mark = seenMark }))
270−
271242
272243-- Check that a variable has rank == noRank, meaning that it can be generalized.
273244isGeneric :: Variable -> TS.Solver ()