Reporter | Vladimir Reshetnikov (nikov) |
---|---|
Created | Dec 30, 2011 1:41:28 AM |
Updated | Feb 9, 2012 9:15:45 PM |
Priority | Normal |
Type | Bug |
Fix versions | Mirabile Futurum |
State | Submitted |
Assignee | Alexey Kuptsov (alexey.kuptsov) |
Subsystem | No subsystem |
Affected versions | No Affected versions |
Fixed in build | No Fixed in build |
using System; class A<T, S> where S : T { } class Program { static void Main() { new A<Exception, S>(); // Create S from usage } }
Actual result:
using System; class A<T, S> where S : T { } class Program { static void Main() { new A<Exception, S>(); // error CS0311: The type 'S' cannot be used as type parameter 'S' in the generic type or method 'A<T,S>'. There is no implicit reference conversion from 'S' to 'System.Exception'. } } internal class S { }
Expected:
using System; class A<T, S> where S : T { } class Program { static void Main() { new A<Exception, S>(); // OK } } internal class S : Exception { }