Exemple #1
0
 protected bool Equals(PatternNameBinding other)
 {
     return string.Equals(Name, other.Name) && Type == other.Type;
 }
Exemple #2
0
 protected bool Equals(PatternNameBinding other)
 {
     return(string.Equals(Name, other.Name) && Type == other.Type);
 }
Exemple #3
0
        /// <summary>
        /// Makes sure that pattern binding set 'B' contains all items from set 'A' and throws an error otherwise.
        /// </summary>
        private void validatePatternBindingSets(PatternNameBinding[] a, PatternNameBinding[] b)
        {
            // find at least one variable that does not strictly match
            var extra = a.Except(b).FirstOrDefault();
            if (extra == null)
                return;

            // find a variable with the same name to check whether the error is in the name or in the type
            var nameSake = b.FirstOrDefault(x => x.Name == extra.Name);
            if(nameSake == null)
                error(CompilerMessages.PatternNameSetMismatch, extra.Name);
            else
                error(CompilerMessages.PatternNameTypeMismatch, extra.Name, extra.Type, nameSake.Type);
        }