   if ctx.isMethod name, type
     translateIr ctx, (irMethod type, name)
   else
-    finalType = addConstraintsFrom ctx, {type, name: name, scopeIndex: scopeIndex}, substitute ctx.substitution, type
+    finalType = addConstraintsFrom ctx, {type, name: name, scopeIndex: scopeIndex}, type#substitute ctx.substitution, type
     classParams = dictsForConstraint ctx, finalType.constraints
     if classParams.length > 0
       {arity} = ctx.savedDeclaration name, scopeIndex

  sub

subLimit = (sub) ->
  if sub.start is Infinity then -Infinity else sub.start + sub.vars.length

subStart = (sub) ->


constraintsFromCanonicalType = (ctx, canonicalType, type) ->
  inferredType = freshInstance ctx, canonicalType
  # console.log "canonicalType", canonicalType, type
  # console.log (printType canonicalType)
  # console.log (printType inferredType)
  # console.log (printType type.type)
  ctx.extendSubstitution matchType inferredType.type, type.type#(substitute ctx.substitution, type).type
  # console.log "after", (printType inferredType.type)
  reduceConstraints ctx, inferredType.constraints
  #(substitute ctx.substitution, inferredType).constraints
  inferredType.constraints

irReference = (name, type, scopeIndex) ->
  {ir: irReferenceTranslate, name, type, scopeIndex}
