[229] Invalid error on generic interface/generic type
Hello, this following (bad) example compiles (with warnings), but is
indicated as an error in R#:
public interface ICloneableGeneric : ICloneable
{
T Clone();
}
public class CloneableList : List, ICloneableGeneric where
T : ICloneableGeneric, IDisposable
{
T ICloneableGeneric.Clone]]>()
{
throw new Exception("The method or operation is not
implemented.");
}
object ICloneable.Clone()
{
throw new Exception("The method or operation is not
implemented.");
}
}
Thanks,
Wiebe Tijsma
Please sign in to leave a comment.
Though there are some problems in ReSharper (which will be fixed shortly),
you code is not compilable - method cannot have the type parameter named as
the type parameter of the interface
public interface ICloneableGeneric : ICloneable { T Clone(); } -- Eugene Pasynkov Developer JetBrains, Inc http://www.jetbrains.com "Develop with pleasure!" "Wiebe Tijsma" ]]> wrote in message
news:e0dstu$n14$1@is.intellij.net...
>
>
>
>
>
>
>
>
Eugene Pasynkov (JetBrains) wrote:
I know it's trash code, it's just that Visual Studio compiles it with
warnings (it probably shouldn't), but R# gives the wrong error message
('interface not implemented')...
Thanks!
Wiebe
This code is not compilable!
Type parameters cannot have duplicate names
--
Eugene Pasynkov
Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
"Wiebe Tijsma" <wiebeREMOVE@CAPITALStijsma.com> wrote in message
news:e0gc02$k4i$1@is.intellij.net...
>> Though there are some problems in ReSharper (which will be fixed
>> shortly), you code is not compilable - method cannot have the type
>> parameter named as the type parameter of the interface
>>
>> public interface ICloneableGeneric : ICloneable >> { >> T Clone(); >> } >> >> >]]>
>
>