Generics: static member invocation

Tech-Archive recommends: Speed Up your PC by fixing your registry



Hello All!

I'm trying to compile the following code in VS2005 Beta
class A
{
public static void SA() { }
}

class B<T> where T : A
{
public static void SB()
{
T.SA();
}
}

And I'm getting the following error
Error 7 'T' is a 'type parameter', which is not valid in the given
context

My question is: Is it a bug or feature?

Thanks in advance

.



Relevant Pages

  • How to read AssemblyInfo.cs ?
    ... I'm using dotnetframework 1.1. ... public static void Main ... Compile is no error, ... Prev by Date: ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Passing enum wholly
    ... >> Is there a way to specify that restriction on a parameter at compile ... public static void EnumOperationwhere T: ... Prev by Date: ...
    (microsoft.public.dotnet.languages.csharp)
  • Error when comparing against empty string using JDBC 2005 Beta 2
    ... I am having a problem with JDBC 2005 Beta when comparing against an empty ... Index out of range1 Valid ... public static void main ...
    (microsoft.public.sqlserver.jdbcdriver)
  • Re: JIT and addresses
    ... If I compile the following lines of code and break the execution with ... instructions to addresses way up in the address space. ... public static void a ... 0000001a nop ...
    (microsoft.public.dotnet.framework.clr)
  • Re: Console Application on windows CE 5.0
    ... public static void Main ... //s.Send(asen.GetBytes("The string was recieved by the server. ... If you compile against the ... half-a-dozen applications written with eVC running on it. ...
    (microsoft.public.windowsce.platbuilder)