Changes between Version 18 and Version 19 of Commentary/Compiler/StrictnessAnalysis/KirstenNotes
- Timestamp:
- 11/15/06 09:50:19 (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Commentary/Compiler/StrictnessAnalysis/KirstenNotes
v18 v19 73 73 74 74 When we run into an expression like {{{(Cast e co)}}} that we're placing demand {{{d}}} on, we analyze {{{e}}} to get {{{dmd_ty}}}, then check whether the depth of {{{e}}} is equal to the depth of {{{dmd_ty}}} or not. This is necessary because we might be casting a function to a non-function type. So, if {{{d}}} and {{{dmd_ty}}} have equal depth, we return {{{dmd_ty}}} as is; if {{{d}}}'s arity is less, we drop the appropriate number of args from {{{dmd_ty}}}; if {{{dmd_ty}}}'s arity is less, we add the appropriate number of dummy argument demands to it. 75 76 = WARN: arity /= dmdTypeDepth rhs_dmd_ty && not (exprIsTrivial rhs) = 77 78 This warning can happen for (at least) two reasons: 79 - lambdas with a strict non-call demand placed on them were being handled wrong (see the first two examples in [Commentary/Compiler/StrictnessAnalysis/Examples]) 80 - coercions were being handled wrong, resulting in a demand type with depth 0 being assigned to an rhs consisting of a cast from/to a function type
