C# Class ImplicitConversionCausedByVariance

Changed in VS 2010 In https://msdn.microsoft.com/en-us/library/vstudio/ee855831.aspx A new implicit conversion is added for generic interfaces and delegates such as IEnumerable{T} and Func{TResult}.
Type parameter T of IEnumerable{T} has been covariant since .NET 4 (VS 2010). s; IEnumerable x = s; // OK in all versions. IEnumerable is inherited from IEnumerable. IEnumerable y = s; // OK in .NET 4 or later. string is inherited from object, so IEnumerable can be treated like a subtype of IEnumerable because of covariance. ]]>
Afficher le fichier Open project: ufcpp/UfcppSample

Méthodes publiques

Méthode Description
Test ( IEnumerable e ) : void
Test ( IEnumerable e ) : void

Private Methods

Méthode Description
Main ( string args ) : void

Method Details

Test() public static méthode

public static Test ( IEnumerable e ) : void
e IEnumerable
Résultat void

Test() public static méthode

public static Test ( IEnumerable e ) : void
e IEnumerable
Résultat void