Ejemplo n.º 1
0
 /// <summary>
 /// For two function types to be compatible, both shall specify compatible returns types.
 /// Moreover, the parameter type lists, if both are present, shall agree in the number of parameters
 /// and in use of the ellipsis terminator.
 /// TODO: Support old style function type.
 /// </summary>
 /// <param name="other"></param>
 /// <returns></returns>
 public override bool Compatible(TUnqualified other)
 {
     if (other.IsFunc)
     {
         TFunc f = other as TFunc;
         if (ret.Compatible(f.ret) && isEllipis == f.isEllipis && parameters.Count() == f.parameters.Count())
         {
             return(parameters.Zip(f.parameters, (p, q) => p.Compatible(q)).Aggregate(true, (x, y) => x && y));
         }
     }
     return(false);
 }
Ejemplo n.º 2
0
 public bool Equals(TFunc t)
 {
     return(t != null && t.ret.Equals(ret) && t.parameters.SequenceEqual(parameters));
 }