using System;
using System.Collections .Generic ;
using System.Linq ;
using System.Text ;
namespace IEnumerableTest
{
class Program
{
static void Main( string[ ] args)
{
Test.Normaltest ( new Base( ) ) ;
Test.IEnumerableTest ( new Base[ ] { } ) ;
Test.Normaltest ( new Inheritance( ) ) ;
Test.IEnumerableTest ( new Inheritance[ ] { } ) ;
Test.IEnumerableTest ( ( IEnumerable< Inheritance> ) new Inheritance[ ] { } ) ;
}
}
public static class Test
{
public static void Normaltest( Base obj) { }
public static void IEnumerableTest( IEnumerable< Base> obj) { }
}
public class Base
{
}
public class Inheritance : Base
{
}
}
dXNpbmcgU3lzdGVtOwp1c2luZyBTeXN0ZW0uQ29sbGVjdGlvbnMuR2VuZXJpYzsKdXNpbmcgU3lzdGVtLkxpbnE7CnVzaW5nIFN5c3RlbS5UZXh0OwoKbmFtZXNwYWNlIElFbnVtZXJhYmxlVGVzdAp7CiAgICBjbGFzcyBQcm9ncmFtCiAgICB7CiAgICAgICAgc3RhdGljIHZvaWQgTWFpbihzdHJpbmdbXSBhcmdzKQogICAgICAgIHsKCiAgICAgICAgICAgIFRlc3QuTm9ybWFsdGVzdChuZXcgQmFzZSgpKTsKICAgICAgICAgICAgVGVzdC5JRW51bWVyYWJsZVRlc3QobmV3IEJhc2VbXSB7IH0pOwoKICAgICAgICAgICAgVGVzdC5Ob3JtYWx0ZXN0KG5ldyBJbmhlcml0YW5jZSgpKTsKICAgICAgICAgICAgVGVzdC5JRW51bWVyYWJsZVRlc3QobmV3IEluaGVyaXRhbmNlW10geyB9KTsKCiAgICAgICAgICAgIFRlc3QuSUVudW1lcmFibGVUZXN0KChJRW51bWVyYWJsZTxJbmhlcml0YW5jZT4pbmV3IEluaGVyaXRhbmNlW10geyB9KTsKCiAgICAgICAgfQogICAgfQoKCiAgICBwdWJsaWMgc3RhdGljIGNsYXNzIFRlc3QKICAgIHsKICAgICAgICBwdWJsaWMgc3RhdGljIHZvaWQgTm9ybWFsdGVzdChCYXNlIG9iaikgeyB9CiAgICAgICAgcHVibGljIHN0YXRpYyB2b2lkIElFbnVtZXJhYmxlVGVzdChJRW51bWVyYWJsZTxCYXNlPiBvYmopIHsgfQoKICAgIH0KICAgIAoKICAgIHB1YmxpYyBjbGFzcyBCYXNlCiAgICB7CgogICAgfQoKICAgIHB1YmxpYyBjbGFzcyBJbmhlcml0YW5jZSA6IEJhc2UKICAgIHsKCiAgICB9CgoKCn0=
compilation info
prog.cs(19,18): error CS1502: The best overloaded method match for `IEnumerableTest.Test.IEnumerableTest(System.Collections.Generic.IEnumerable<IEnumerableTest.Base>)' has some invalid arguments
prog.cs(28,28): (Location of the symbol related to previous error)
prog.cs(19,18): error CS1503: Argument `#1' cannot convert `System.Collections.Generic.IEnumerable<IEnumerableTest.Inheritance>' expression to type `System.Collections.Generic.IEnumerable<IEnumerableTest.Base>'
Compilation failed: 2 error(s), 0 warnings
stdout