Re: [ADVANCED-DOTNET] ArgIterator is not object ???

2003-06-17 Thread Steve Johnson
I wrote: I would guess that it has not so much to do with ArgIterator being a special type, but that in this instance, iterator itself is stack allocated. Frankly, I don't think this requires documentation. We all know that you can't return a stack allocated struct from a function.

Re: [ADVANCED-DOTNET] ArgIterator is not object ???

2003-06-17 Thread Jeroen Frijters
It's hardcoded in the compiler. If you've got the Rotor sources installed, the check is done in TYPESYM::isSpecialByRefType(). http://dotnet.di.unipi.it/Content/sscli/docs/doxygen/csharp/symmgr_8cpp- source.html#l02546 Regards, Jeroen -Original Message- From: Frans Bouma

Re: [ADVANCED-DOTNET] ArgIterator is not object ???

2003-06-17 Thread Frans Bouma
It's hardcoded in the compiler. If you've got the Rotor sources installed, the check is done in TYPESYM::isSpecialByRefType(). http://dotnet.di.unipi.it/Content/sscli/docs/doxygen/csharp/sy mmgr_8cpp- source.html#l02546 Hmmm. I really wonder why they didn't simply add an attribute to

Re: [ADVANCED-DOTNET] ArgIterator is not object ???

2003-06-17 Thread Jeroen Frijters
It gets worse. Look at the following code: using System; class Class1 { static void Main(string[] args) { ArgIterator iter = new ArgIterator(Foo(__arglist(1, 2, 3))); } static RuntimeArgumentHandle Foo(__arglist) { return __arglist; } } This is effectively the same as

[ADVANCED-DOTNET] ArgIterator is not object ???

2003-06-16 Thread Bogdan Lachendro
Hi! Look at the code below: using System; namespace IteratorTest { public class Test { public object Method() { ArgIterator iterator; return iterator; } } } When I try to compile it I get :

Re: [ADVANCED-DOTNET] ArgIterator is not object ???

2003-06-16 Thread Bogdan Lachendro
On 6/16/2003 10:39 AM, Thomas Tomiczek wrote: Hm, ArgIterator is a struct, so it would have to be boxed to be returned. Ok, so take a look at this: using System; namespace IteratorTest { public struct MyStruct { } public class TestClass { public Object MethodOne()

Re: [ADVANCED-DOTNET] ArgIterator is not object ???

2003-06-16 Thread Jeroen Frijters
ArgIterator is a special type. It contains a pointer to the stack, so it isn't allowed to escape the current method. Otherwise, you'd have a pointer pointing into the middle of nowhere. Regards, Jeroen -Original Message- From: Bogdan Lachendro [mailto:[EMAIL PROTECTED] Sent:

Re: [ADVANCED-DOTNET] ArgIterator is not object ???

2003-06-16 Thread Thomas Tomiczek
Documentation for this anywhere? Especially on HOW they stop the boxing to happen. Regards Thomas Tomiczek THONA Consulting Ltd. (Microsoft MVP C#/.NET) -Original Message- From: Jeroen Frijters [mailto:[EMAIL PROTECTED] Sent: Montag, 16. Juni 2003 11:39 To: [EMAIL PROTECTED]

Re: [ADVANCED-DOTNET] ArgIterator is not object ???

2003-06-16 Thread Bogdan Lachendro
On 6/16/2003 11:39 AM, Jeroen Frijters wrote: ArgIterator is a special type. It contains a pointer to the stack, so it isn't allowed to escape the current method. Otherwise, you'd have a pointer pointing into the middle of nowhere. OK, I understand now, but where did you find out about this?

Re: [ADVANCED-DOTNET] ArgIterator is not object ???

2003-06-16 Thread Jeroen Frijters
I think it is documented somewhere in the ECMA CLI specification. I'm not sure, it's been a while. BTW, there is another type that also behaves like this: System.TypedReference. Regards, Jeroen -Original Message- From: Bogdan Lachendro [mailto:[EMAIL PROTECTED] Sent: Monday, June

Re: [ADVANCED-DOTNET] ArgIterator is not object ???

2003-06-16 Thread Steve Johnson
ArgIterator is a special type. It contains a pointer to the stack, so it isn't allowed to escape the current method. Otherwise, you'd have a pointer pointing into the middle of nowhere. I would guess that it has not so much to do with ArgIterator being a special type, but that in this