anchor.diff:              paramIdents.normalParameterTypes.length == func.normalParameterTypes.length; })
           .update((AbstractType func) {
             if (func is FunctionType) {
  -            for (var i = 0; i < paramIdents.normalParameterTypes.length;i++)
  +            
  +            for (var i = 0; i < paramIdents.normalParameterTypes.length;i++){
                 subsetConstraint(func.normalParameterTypes[i], paramIdents.normalParameterTypes[i]);
  -            for (var i = 0; i < func.optionalParameterTypes.length;i++)
  -              subsetConstraint(func.normalParameterTypes[i], paramIdents.normalParameterTypes[i]);
  +              subsetConstraint(paramIdents.normalParameterTypes[i], func.normalParameterTypes[i], filter: onlyParameterTypesAndAnnotated);
  +            }
  +            for (var i = 0; i < func.optionalParameterTypes.length;i++){
  +              subsetConstraint(func.optionalParameterTypes[i], paramIdents.optionalParameterTypes[i]);
  +              subsetConstraint(paramIdents.optionalParameterTypes[i], func.optionalParameterTypes[i], filter: onlyParameterTypesAndAnnotated);
  +            }
               
               for(Name name in func.namedParameterTypes.keys){
                 subsetConstraint(func.namedParameterTypes[name], paramIdents.namedParameterTypes[name]);
  +              subsetConstraint(paramIdents.namedParameterTypes[name], func.namedParameterTypes[name], filter: onlyParameterTypesAndAnnotated);
               }
               subsetConstraint(func.returnType, returnIdent);
             }
  
positive.code:   }
  }
  
  typedef bool FilterFunc(AbstractType);
  typedef dynamic NotifyFunc(AbstractType);
  
  class TypeVariable {
    Set<AbstractType> _types = new Set<AbstractType>();
  
negative.code:     subsetConstraint(b, a);
    }
    
    void subsetConstraint(TypeIdentifier a, TypeIdentifier b, {FilterFunc filter: null, Map<ParameterType, AbstractType> binds: null}) {
      if (a == b)
        return;
      
      // If the binds is bound, then the subset should first resolve the binding.
      Function bindFunction;
      if (binds != null){
        bindFunction = (AbstractType type) {
          if (type is ParameterType){
            if (binds.containsKey(type))
              types.add(b, binds[type]);
            else
              types.add(b, type);
          } else if (type is NominalType){
            types.add(b, genericMapGenerator.createInstanceWithBinds(type, binds));
          } else
            types.add(b, type);
        };
      } else {
        bindFunction = (AbstractType type) => types.add(b, type);
      }
      
      if (filter == null)
        foreach(a).update(bindFunction);
      else
        foreach(a).where(filter).update(bindFunction);
    }
  }
  
  