Oh, I see.  You're right, that is a bug.  Thanks.

Dave.

-----Original Message-----
From: Jeroen Frijters [mailto:[EMAIL PROTECTED]] 
Sent: 05 September 2002 13:32
To: [EMAIL PROTECTED]
Subject: Re: [DOTNET-ROTOR] Another Gyro question

That's not what I meant. Activator.CreateInstance() should check for
generic types and not allow instantiation. I don't see any problem with
Main living in a generic class, it's perfectly consistent with the way
statics are treated.

Regards,
Jeroen

> -----Original Message-----
> From: Discussion of the Rotor Shared Source CLI
> implementation [mailto:[EMAIL PROTECTED]] On
> Behalf Of Dave Berry (Independent Contractor)
> Sent: Thursday, September 05, 2002 14:24
> To: [EMAIL PROTECTED]
> Subject: Re: [DOTNET-ROTOR] Another Gyro question
>
>
> That's a good point: Main() should only be defined in non-generic
> classes.  The system should check for this, but currently this check
> isn't implemented.
>
> Dave.
>
> -----Original Message-----
> From: Jeroen Frijters [mailto:[EMAIL PROTECTED]]
> Sent: 05 September 2002 12:51
> To: [EMAIL PROTECTED]
> Subject: [DOTNET-ROTOR] Another Gyro question
>
> Given the following code:
> class Test<T>
> {
>   public static void Main()
>   {
>
> System.Console.WriteLine(System.Activator.CreateInstance(typeo
> f(Test<obj
> ect>).GetGenericType()));
>   }
> }
>
> This creates an instance of the generic type. I don't think
> this should
> be possible. Also, wouldn't it be a good idea to have typeof(Test)
> return the generic type?
>
> Regards,
> Jeroen
>

Reply via email to