[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [DotGNU]Generic IL Examples
From: |
Rhys Weatherley |
Subject: |
Re: [DotGNU]Generic IL Examples |
Date: |
Wed, 19 Feb 2003 16:46:56 +1000 |
User-agent: |
KMail/1.4.3 |
On Wednesday 19 February 2003 04:29 pm, Fergus Henderson wrote:
> I assume that it is also possible to refer to such parameters by name,
> e.g. "!T"?
/me looks at Gyro ilasm code again
Nope. It's always an integer.
Which is probably what was intended. There are some weird scoping rules.
Sometimes "!0" can refer to "parameter 0" of the thing being instantiated in
a method call, not the surrounding class's "parameter 0". Resolving which T
is being referred to might be tricky. Consider this:
.class Blah<T,V> {
...
callvirt void class Stack<!1>::Push(!0)
callvirt void class Stack<!0>::Push(!0)
...
}
This roughly corresponds to:
callvirt void class Stack<V>::Push(V)
callvirt void class Stack<T>::Push(T)
i.e. the "!0" in the method signature parameters refers to the parameters to
"Stack", not the parameters to "Blah".
So, what use are the names T and V then? As far as I can tell, they are
comments in the metadata, useful for error reporting but little else.
I could add names to pnet's ilasm, but we'd need to come up with the right
scope rules. If you have a suggestion, then I'm all ears.
Cheers,
Rhys.
Re: [DotGNU]Generic IL Examples, James Michael DuPont, 2003/02/19