Commit c43c9817 authored by simonpj@microsoft.com's avatar simonpj@microsoft.com

Fix Trac #3591: very tricky specialiser bug

  
There was a subtle bug in the interation of specialisation and floating,
described in Note [Specialisation of dictionary functions]. 
  
The net effect was to create a loop where none existed before; plain wrong.
  
In fixing it, I did quite a bit of house-cleaning in the specialiser, and
added a lot more comments.  It's tricky, alas.
parent 0cffd31b
......@@ -49,7 +49,7 @@ module Id (
isImplicitId, isDeadBinder, isDictId, isStrictId,
isExportedId, isLocalId, isGlobalId,
isRecordSelector, isNaughtyRecordSelector,
isClassOpId_maybe,
isClassOpId_maybe, isDFunId,
isPrimOpId, isPrimOpId_maybe,
isFCallId, isFCallId_maybe,
isDataConWorkId, isDataConWorkId_maybe, isDataConId_maybe, idDataCon,
......@@ -326,6 +326,7 @@ isNaughtyRecordSelector :: Id -> Bool
isPrimOpId :: Id -> Bool
isFCallId :: Id -> Bool
isDataConWorkId :: Id -> Bool
isDFunId :: Id -> Bool
isClassOpId_maybe :: Id -> Maybe Class
isPrimOpId_maybe :: Id -> Maybe PrimOp
......@@ -348,6 +349,10 @@ isPrimOpId id = case Var.idDetails id of
PrimOpId _ -> True
_ -> False
isDFunId id = case Var.idDetails id of
DFunId -> True
_ -> False
isPrimOpId_maybe id = case Var.idDetails id of
PrimOpId op -> Just op
_ -> Nothing
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment