public override bool IsAssignableFrom(PLanguageType otherType) { return(otherType.Canonicalize() is NamedTupleType other && Fields.Count == other.Fields.Count && Names.SequenceEqual(other.Names) && Types.Zip(other.Types, (myT, otherT) => myT.IsAssignableFrom(otherT)).All(x => x)); }
public override bool IsAssignableFrom(PLanguageType otherType) { // Tuples must be of the same size, and other tuple's fields must subtype this one's return(otherType.Canonicalize() is TupleType other && Types.Count == other.Types.Count && Types.Zip(other.Types, (myT, otherT) => myT.IsAssignableFrom(otherT)) .All(x => x)); }