Exemple #1
0
 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));
 }
Exemple #2
0
 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));
 }