IEnumerable<T> in .NET 3.5 is not covariant

This commit is contained in:
Sam Harwell 2013-02-27 13:24:19 -06:00
parent 1020033096
commit f063557b7b
1 changed files with 4 additions and 0 deletions

View File

@ -392,7 +392,11 @@ namespace Antlr4.Runtime.Atn
Collections.EmptyList<PrecedencePredicate>();
List<PrecedencePredicate> result = collection.OfType<PrecedencePredicate>().ToList();
#if NET_4_0
collection.ExceptWith(result);
#else
collection.ExceptWith(result.Cast<SemanticContext>());
#endif
return result;
}
}